FRAX Price: $0.99 (-2.04%)

Contract

0x99058B8A91145c3657088f336b3180A25f44ccCD

Overview

FRAX Balance | FXTL Balance

0 FRAX | 0 FXTL

FRAX Value

$0.00

Token Holdings

More Info

Private Name Tags

TokenTracker

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Redeem This PO S...149477532025-01-12 18:23:37377 days ago1736706217IN
0x99058B8A...25f44ccCD
0 FRAX0.000000240.00010025
Redeem This PO S...149477512025-01-12 18:23:33377 days ago1736706213IN
0x99058B8A...25f44ccCD
0 FRAX0.000000240.00010025
Redeem This PO S...149477492025-01-12 18:23:29377 days ago1736706209IN
0x99058B8A...25f44ccCD
0 FRAX0.000000240.00010025
Redeem This PO S...149477472025-01-12 18:23:25377 days ago1736706205IN
0x99058B8A...25f44ccCD
0 FRAX0.000000240.00010025
Redeem This PO S...149477452025-01-12 18:23:21377 days ago1736706201IN
0x99058B8A...25f44ccCD
0 FRAX0.000000240.00010025
Redeem This PO S...149477432025-01-12 18:23:17377 days ago1736706197IN
0x99058B8A...25f44ccCD
0 FRAX0.000000250.00010025
Redeem This PO S...149477412025-01-12 18:23:13377 days ago1736706193IN
0x99058B8A...25f44ccCD
0 FRAX0.000000250.00010025
Redeem This PO S...149477392025-01-12 18:23:09377 days ago1736706189IN
0x99058B8A...25f44ccCD
0 FRAX0.000000250.00010025
Redeem This PO S...149477372025-01-12 18:23:05377 days ago1736706185IN
0x99058B8A...25f44ccCD
0 FRAX0.000000230.00010025
Redeem This PO S...149477362025-01-12 18:23:03377 days ago1736706183IN
0x99058B8A...25f44ccCD
0 FRAX0.000000230.00010025
Redeem This PO S...149477332025-01-12 18:22:57377 days ago1736706177IN
0x99058B8A...25f44ccCD
0 FRAX0.000000230.00010025
Redeem This PO S...149477322025-01-12 18:22:55377 days ago1736706175IN
0x99058B8A...25f44ccCD
0 FRAX0.000000250.00010025
Redeem This PO S...149477302025-01-12 18:22:51377 days ago1736706171IN
0x99058B8A...25f44ccCD
0 FRAX0.000000250.00010025
Redeem This PO S...149477282025-01-12 18:22:47377 days ago1736706167IN
0x99058B8A...25f44ccCD
0 FRAX0.000000250.00010025
Redeem This PO S...149477262025-01-12 18:22:43377 days ago1736706163IN
0x99058B8A...25f44ccCD
0 FRAX0.000000250.00010025
Redeem This PO S...149477242025-01-12 18:22:39377 days ago1736706159IN
0x99058B8A...25f44ccCD
0 FRAX0.000000250.00010025
Redeem This PO S...149477222025-01-12 18:22:35377 days ago1736706155IN
0x99058B8A...25f44ccCD
0 FRAX0.000000250.00010025
Redeem This PO S...149477202025-01-12 18:22:31377 days ago1736706151IN
0x99058B8A...25f44ccCD
0 FRAX0.000000250.00010025
Redeem This PO S...149477182025-01-12 18:22:27377 days ago1736706147IN
0x99058B8A...25f44ccCD
0 FRAX0.000000250.00010025
Claim Title149477132025-01-12 18:22:17377 days ago1736706137IN
0x99058B8A...25f44ccCD
0 FRAX0.000000280.00010025
Claim Title149477082025-01-12 18:22:07377 days ago1736706127IN
0x99058B8A...25f44ccCD
0 FRAX0.000000280.00010025
Claim Title149477022025-01-12 18:21:55377 days ago1736706115IN
0x99058B8A...25f44ccCD
0 FRAX0.000000270.00010025
Claim Title149476972025-01-12 18:21:45377 days ago1736706105IN
0x99058B8A...25f44ccCD
0 FRAX0.000000270.00010025
Claim Title149476932025-01-12 18:21:37377 days ago1736706097IN
0x99058B8A...25f44ccCD
0 FRAX0.000000270.00010025
Claim Title149476892025-01-12 18:21:29377 days ago1736706089IN
0x99058B8A...25f44ccCD
0 FRAX0.000000260.00010025
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
NotFakeRWAs

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
// contracts/notfake.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "../solidity-stringutils/src/strings.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IDelegationRegistry {
    function setDelegationForSelf(address initialDelegate) external;
    function disableSelfManagingDelegations() external;
}

contract NotFakeRWAs is ERC721Enumerable, ReentrancyGuard {

    using strings for string;
    using strings for strings.slice;
    address delegateRegistryAddress = 0x4392dC16867D53DBFE227076606455634d4c2795;

    uint256 public constant _MAXTITLECOUNT = 8000;
    uint256 public constant itemPrice = 500000 ether; 
    uint256 public purchasedTitles = 0;
    address public immutable payToken;
    
    mapping(uint256 => string) internal firstNameOverride;
    mapping(uint256 => string) internal lastNameOverride;
    mapping(uint256 => bool) internal numNameChanges;
    
    string private constant firstAdj = "Smelly;Fragrant;Delicious;Old;Shiny;Rusty;Polished;Pristine;Dirty;Spicy;Ugly;Perfect;Lousy;Fake;Broken;Thrice-used;Sweaty;Succulent;Thick;Moist";
    uint16 private constant firstAdjLength = 20;
    string private constant secondAdj = "Inflatable;Foreclosed;Limited Ed.;Radioactive;Collapsable;Paper;Plastic;Half-Used;Yellowish;Toy;Off-White;Prank;Dilapidated;Leaking;Sticky;Fuzzy;Gleaming;Dripping;Wooden;Synthetic";
    uint16 private constant secondAdjLength = 20;
    string private constant noun = "Banana Peel;Mansion;Gateway PC;Watch;Honda Civic;Video Card;Hardware Wallet;Sock;Printer;Airdrop Point;Toothbrush;Llama;Floppy Disk;Jalopy;Laptop;AI Model;Train;Air Fryer;Pokemon Card;AI Robot GF";
    uint16 private constant nounLength = 20;
    
    string private constant firstName = "A.";
    string private constant lastName =  "Nonymous";
    string private constant svgStart = '<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMin meet" viewBox="0 0 350 350"><style>.base,text{font-family:serif}.base{font-size:14px}rect{stroke-width:2}</style><rect filter="url(#wobble)" width="94%" height="65%" x="2.5%" y="17%" fill="#ebdfa7"/><defs><pattern id="pattern1" x="4" y="4" width="20" height="6" patternUnits="userSpaceOnUse"><path stroke-width="2" style="stroke:#a89983;fill:none" d="M0 0h20v3H0z"/></pattern><pattern id="pattern2" x="4" y="-4" width="6" height="20" patternUnits="userSpaceOnUse"><path stroke-width="2" style="stroke:#a89983;fill:none" d="M0 0h3v20H0z"/></pattern><pattern id="pattern3" x="4" y="0" width="6" height="20" patternUnits="userSpaceOnUse"><path stroke-width="2" style="stroke:#a89983;fill:none" d="M0 0h3v20H0z"/></pattern><pattern id="pattern4" x="6" y="4" width="20" height="6" patternUnits="userSpaceOnUse"><path stroke-width="2" style="stroke:#a89983;fill:none" d="M0 0h20v3H0z"/></pattern><filter id="wobble"><feTurbulence baseFrequency=".052" numOctaves="3"/><feDisplacementMap in="SourceGraphic" scale="12"/></filter><filter id="box"><feTurbulence baseFrequency=".011" numOctaves="12"/><feDisplacementMap in="SourceGraphic" scale="1"/></filter><clipPath id="cut-off-bottom"><path d="M10 65h340v225H10z"/></clipPath></defs><path clip-path="url(#cut-off-bottom)" filter="url(#wobble)" stroke="#efe3a7" stroke-width="4" fill="none" d="M105 66a50 50 0 1 1-16-40 106 106 0 1 1-50 126 30 30 0 1 1 20-10m97 64a96 96 0 1 1 80-80"/><path clip-path="url(#cut-off-bottom)" filter="url(#wobble)" stroke="#e8d9a3" stroke-width="4" fill="none" d="M205 110a150 350 0 1 1-12-40 200 200 0 1 1-50 120 130 130 0 1 1 20-10m90 23a92 92 0 1 1 80-80"/><path filter="url(#box)" stroke="#a89983" fill="none" d="M24 75h20v20H24z"/><path filter="url(#box)" stroke-width="2" fill="url(#pattern2)" d="M50 75h250v22H50z"/><path filter="url(#box)" stroke="#a89983" fill="none" d="M306 75h20v20h-20z"/><path filter="url(#box)" stroke="#none" fill="url(#pattern1)" d="M24 98h20v160H24z"/><path filter="url(#box)" stroke="#a89983" fill="none" d="M24 260h20v20H24z"/><path filter="url(#box)" stroke-width="2" fill="url(#pattern3)" d="M48 260h250v20H48z"/><path filter="url(#box)" stroke="#a89983" fill="none" d="M306 260h20v20h-20z"/><path filter="url(#box)" stroke="#none" fill="url(#pattern4)" d="M306 98h20v160h-20z"/><text x="53" y="119" font-size="17" fill="#332312"> A (not fake) Real World Asset Title</text><text x="60" y="149" font-size="12" fill="#332312">This ERC721 token is to certify that the holder </text><text y="167" x="50%" dominant-baseline="middle" text-anchor="middle" fill="#332312" font-size="14">';
    

    
    function random(string memory input) internal pure returns (uint256) {
        return uint256(keccak256(abi.encodePacked(input)));
    }
    
    
    function claimTitle(uint16 quantity) external {
        require(quantity > 0, "Minimum 1 tokens need to be minted");
	    require(quantity <= titlesRemainingToBeMinted(), "Purchase amount is greater than the RWAs available");
       // require(isSaleActive, "Sale is not active");
		require(quantity <= 20, "Max 20 Titles");
        require(IERC20(payToken).transferFrom(msg.sender, address(this), itemPrice*quantity), "Insufficient funds");
		
		for(uint16 i =0; i < quantity; i++)
		{
		uint256 tokenId = purchasedTitles;
        _safeMint(msg.sender, tokenId, "");
        purchasedTitles+=1;
		}
    }
    
    function claimTitle(string memory firstname, string memory lastname) external payable {
	    require(1 <= titlesRemainingToBeMinted(), "Purchase amount is greater than the token available");
	    require(utfStringLength(firstname)<21, "First name must be under 21 characters.");
        require(utfStringLength(lastname)<21, "Last name must be under 21 characters.");
        require(!hasSVGEscapeCharacters(firstname) && !hasSVGEscapeCharacters(lastname), "Input contains invalid characters (<>\"\'&)");
		 require(IERC20(payToken).transferFrom(msg.sender, address(this), itemPrice), "Insufficient funds");
         if(utfStringLength(firstname)==0&&utfStringLength(lastname)==0)
         {
            firstname = "A.";
            lastname = "Nonymous";
         }
		uint256 tokenId = purchasedTitles;
        _safeMint(msg.sender, tokenId,"");
        firstNameOverride[tokenId] = firstname;
        lastNameOverride[tokenId] = lastname;
        numNameChanges[tokenId] = true;
        purchasedTitles++; 
    }

    function hasSVGEscapeCharacters(string memory input) internal pure returns (bool) {
    bytes memory inputBytes = bytes(input);
    for (uint i = 0; i < inputBytes.length; i++) {
        bytes1 char = inputBytes[i];
        if (char == '<' || char == '>' || char == '"' || char == '\'' || char == '&') {
            return true;
        }
    }
    return false;
}
    
    function utfStringLength(string memory str) internal pure returns (uint length){
        uint i=0;
        bytes memory string_rep = bytes(str);

        while (i<string_rep.length)
        {
            if (string_rep[i]>>7==0)
                i+=1;
            else if (string_rep[i]>>5==0x06)
                i+=2;
            else if (string_rep[i]>>4==0x0E)
                i+=3;
            else if (string_rep[i]>>3==0x1E)
                i+=4;
            else
                //For safety
                i+=1;

            length++;
        }
    }
    
    
    function isOwner(uint256 tokenId) public view returns (bool) {
        return (balanceOf(msg.sender)>0);
    }
    
    function titlesRemainingToBeMinted() public view returns (uint256) {
        return _MAXTITLECOUNT - purchasedTitles;
    }

    function isAllTokenMinted() public view returns (bool) {
        return purchasedTitles == _MAXTITLECOUNT;
    }

    function getFirstName(uint256 tokenId) public view returns (string memory) {
        if (numNameChanges[tokenId]) {
            return firstNameOverride[tokenId];
        }
        return firstName;
    }
    
    function getLastName(uint256 tokenId) public view returns (string memory) {
        if (numNameChanges[tokenId]) {
            return lastNameOverride[tokenId];
        }
        return lastName;
    }

    function getAsset(uint256 tokenId) public view returns (string memory) {
        string memory first = randomizer(tokenId, "first_adj", firstAdj, firstAdjLength, false);
        string memory second = randomizer(tokenId, "second_adj", secondAdj, secondAdjLength, false);
        string memory spacer = " ";
        string memory _noun = randomizer(tokenId, "noun", noun, nounLength, false);
        return string(abi.encodePacked(first, spacer, second, spacer, _noun));
    }

    function randomizer(uint256 tokenId, string memory keyPrefix, string memory sourceCSV, uint256 sourceCSVLength, bool rareTrait) internal pure returns (string memory) {
        uint256 rand = random(string(abi.encodePacked(keyPrefix, Strings.toString(tokenId))));
        
            return getNameFromCSV(sourceCSV, rand % sourceCSVLength);
      
    }
    
    function getNameFromCSV(string memory str, uint256 index) internal pure returns (string memory) {
        strings.slice memory strSlice = str.toSlice();
        string memory separatorStr = ";";
        strings.slice memory separator = separatorStr.toSlice();
        strings.slice memory item;
        for (uint256 i = 0; i <= index; i++) {
            item = strSlice.split(separator);
        }
        return item.toString();
    }
    

    function uri(uint256 tokenId) public view returns (string memory) {
        
        string[9] memory parts;
        parts[0] = svgStart;
        
        parts[1] = getFirstName(tokenId);
        
        parts[2] = ' ';
        
        parts[3] =  getLastName(tokenId);

        parts[4] = '</text><text x="60" y="189" fill="#332312" font-size="12">has complete ownership of the following item:</text><text y="226" x="50%" dominant-baseline="middle" text-anchor="middle" fill="#332312" font-size="17">';
        
        parts[5] = getAsset(tokenId);
        
        parts[6] = '</text>';
        
        parts[7] = '';
       
        parts[8] = '<circle filter="url(#wobble)" cx="295.5" cy="255.5" r="35" fill="#380a05"/><circle cx="297.5" cy="257.7" r="30" fill="#5e130a"/><circle cx="296.5" cy="256.7" r="29" fill="#6e131a"/><circle cx="295.5" cy="255.7" r="28" fill="#5e130a"/><text x="285" y="242.7" font-size="10" fill="#7e232a">Real</text><text x="285" y="253.7" font-size="10" fill="#7e232a">World</text><text x="285" y="264.7" font-size="10" fill="#7e232a">Abs</text><text x="285" y="276.7" font-size="10" fill="#7e232a">$RWA</text></svg>';
        
        string memory output = string(abi.encodePacked(parts[0], parts[1], parts[2], parts[3], parts[4], parts[5], parts[6], parts[7], parts[8]));

        string memory json = Base64.encode(bytes(string(abi.encodePacked('{"name": "Not Fake RWA Title #', toString(tokenId), '", "description": "A Not Fake RWA title... only on Fraxtal.", "image": "data:image/svg+xml;base64,', Base64.encode(bytes(output)), '"}'))));
        output = string(abi.encodePacked('data:application/json;base64,', json));
    
        return output;
    }

    function redeemThisPOSandGiveMeMyRWABack(uint256 tokenId) public virtual nonReentrant {
        // Only the owner or approved can burn the token
        require(ownerOf(tokenId)==msg.sender, "Not owner nor approved");
        _burn(tokenId);

        IERC20(payToken).transfer(msg.sender, itemPrice);
    }
    
    function toString(uint256 value) internal pure returns (string memory) {
    // Inspired by OraclizeAPI's implementation - MIT license
    // 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);
    }
    
    constructor(address _payToken) ERC721("Not Fake RWAS", "RWAS") {
        payToken = _payToken;
        IDelegationRegistry(delegateRegistryAddress).setDelegationForSelf(msg.sender);
        IDelegationRegistry(delegateRegistryAddress).disableSelfManagingDelegations();
    }
}

/// [MIT License]
/// @title Base64
/// @notice Provides a function for encoding some bytes in base64
/// @author Brecht Devos <[email protected]>
library Base64 {
    bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

    /// @notice Encodes some bytes to the base64 representation
    function encode(bytes memory data) internal pure returns (string memory) {
        uint256 len = data.length;
        if (len == 0) return "";

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

        // Add some extra buffer at the end
        bytes memory result = new bytes(encodedLen + 32);

        bytes memory table = TABLE;

        assembly {
            let tablePtr := add(table, 1)
            let resultPtr := add(result, 32)

            for {
                let i := 0
            } lt(i, len) {

            } {
                i := add(i, 3)
                let input := and(mload(add(data, i)), 0xffffff)

                let out := mload(add(tablePtr, and(shr(18, input), 0x3F)))
                out := shl(8, out)
                out := add(out, and(mload(add(tablePtr, and(shr(12, input), 0x3F))), 0xFF))
                out := shl(8, out)
                out := add(out, and(mload(add(tablePtr, and(shr(6, input), 0x3F))), 0xFF))
                out := shl(8, out)
                out := add(out, and(mload(add(tablePtr, and(input, 0x3F))), 0xFF))
                out := shl(224, out)

                mstore(resultPtr, out)

                resultPtr := add(resultPtr, 4)
            }

            switch mod(len, 3)
            case 1 {
                mstore(sub(resultPtr, 2), shl(240, 0x3d3d))
            }
            case 2 {
                mstore(sub(resultPtr, 1), shl(248, 0x3d))
            }

            mstore(result, encodedLen)
        }

        return string(result);
    }
}

File 2 of 18 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.20;

import {IERC721} from "./IERC721.sol";
import {IERC721Receiver} from "./IERC721Receiver.sol";
import {IERC721Metadata} from "./extensions/IERC721Metadata.sol";
import {Context} from "../../utils/Context.sol";
import {Strings} from "../../utils/Strings.sol";
import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol";
import {IERC721Errors} from "../../interfaces/draft-IERC6093.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}.
 */
abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    mapping(uint256 tokenId => address) private _owners;

    mapping(address owner => uint256) private _balances;

    mapping(uint256 tokenId => address) private _tokenApprovals;

    mapping(address owner => mapping(address operator => 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 returns (uint256) {
        if (owner == address(0)) {
            revert ERC721InvalidOwner(address(0));
        }
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual returns (address) {
        return _requireOwned(tokenId);
    }

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

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

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

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string.concat(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 {
        _approve(to, tokenId, _msgSender());
    }

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

        return _getApproved(tokenId);
    }

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

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(address from, address to, uint256 tokenId) public virtual {
        if (to == address(0)) {
            revert ERC721InvalidReceiver(address(0));
        }
        // Setting an "auth" arguments enables the `_isAuthorized` check which verifies that the token exists
        // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.
        address previousOwner = _update(to, tokenId, _msgSender());
        if (previousOwner != from) {
            revert ERC721IncorrectOwner(from, tokenId, previousOwner);
        }
    }

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

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {
        transferFrom(from, to, tokenId);
        _checkOnERC721Received(from, to, tokenId, data);
    }

    /**
     * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist
     *
     * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the
     * core ERC721 logic MUST be matched with the use of {_increaseBalance} to keep balances
     * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by
     * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.
     */
    function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
        return _owners[tokenId];
    }

    /**
     * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.
     */
    function _getApproved(uint256 tokenId) internal view virtual returns (address) {
        return _tokenApprovals[tokenId];
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in
     * particular (ignoring whether it is owned by `owner`).
     *
     * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this
     * assumption.
     */
    function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {
        return
            spender != address(0) &&
            (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);
    }

    /**
     * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.
     * Reverts if `spender` does not have approval from the provided `owner` for the given token or for all its assets
     * the `spender` for the specific `tokenId`.
     *
     * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this
     * assumption.
     */
    function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {
        if (!_isAuthorized(owner, spender, tokenId)) {
            if (owner == address(0)) {
                revert ERC721NonexistentToken(tokenId);
            } else {
                revert ERC721InsufficientApproval(spender, tokenId);
            }
        }
    }

    /**
     * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override.
     *
     * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that
     * a uint256 would ever overflow from increments when these increments are bounded to uint128 values.
     *
     * WARNING: Increasing an account's balance using this function tends to be paired with an override of the
     * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership
     * remain consistent with one another.
     */
    function _increaseBalance(address account, uint128 value) internal virtual {
        unchecked {
            _balances[account] += value;
        }
    }

    /**
     * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner
     * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.
     *
     * The `auth` argument is optional. If the value passed is non 0, then this function will check that
     * `auth` is either the owner of the token, or approved to operate on the token (by the owner).
     *
     * Emits a {Transfer} event.
     *
     * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.
     */
    function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {
        address from = _ownerOf(tokenId);

        // Perform (optional) operator check
        if (auth != address(0)) {
            _checkAuthorized(from, auth, tokenId);
        }

        // Execute the update
        if (from != address(0)) {
            // Clear approval. No need to re-authorize or emit the Approval event
            _approve(address(0), tokenId, address(0), false);

            unchecked {
                _balances[from] -= 1;
            }
        }

        if (to != address(0)) {
            unchecked {
                _balances[to] += 1;
            }
        }

        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        return from;
    }

    /**
     * @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 {
        if (to == address(0)) {
            revert ERC721InvalidReceiver(address(0));
        }
        address previousOwner = _update(to, tokenId, address(0));
        if (previousOwner != address(0)) {
            revert ERC721InvalidSender(address(0));
        }
    }

    /**
     * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.
     *
     * 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 {
        _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);
        _checkOnERC721Received(address(0), to, tokenId, data);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     * This is an internal function that does not check if the sender is authorized to operate on the token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal {
        address previousOwner = _update(address(0), tokenId, address(0));
        if (previousOwner == address(0)) {
            revert ERC721NonexistentToken(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 {
        if (to == address(0)) {
            revert ERC721InvalidReceiver(address(0));
        }
        address previousOwner = _update(to, tokenId, address(0));
        if (previousOwner == address(0)) {
            revert ERC721NonexistentToken(tokenId);
        } else if (previousOwner != from) {
            revert ERC721IncorrectOwner(from, tokenId, previousOwner);
        }
    }

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients
     * are aware of the ERC721 standard 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 like {safeTransferFrom} in the sense that it invokes
     * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `tokenId` token must exist and be owned by `from`.
     * - `to` cannot be the zero address.
     * - `from` cannot be the zero address.
     * - 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) internal {
        _safeTransfer(from, to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {
        _transfer(from, to, tokenId);
        _checkOnERC721Received(from, to, tokenId, data);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is
     * either the owner of the token, or approved to operate on all tokens held by this owner.
     *
     * Emits an {Approval} event.
     *
     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
     */
    function _approve(address to, uint256 tokenId, address auth) internal {
        _approve(to, tokenId, auth, true);
    }

    /**
     * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not
     * emitted in the context of transfers.
     */
    function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {
        // Avoid reading the owner unless necessary
        if (emitEvent || auth != address(0)) {
            address owner = _requireOwned(tokenId);

            // We do not use _isAuthorized because single-token approvals should not be able to call approve
            if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {
                revert ERC721InvalidApprover(auth);
            }

            if (emitEvent) {
                emit Approval(owner, to, tokenId);
            }
        }

        _tokenApprovals[tokenId] = to;
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Requirements:
     * - operator can't be the address zero.
     *
     * Emits an {ApprovalForAll} event.
     */
    function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {
        if (operator == address(0)) {
            revert ERC721InvalidOperator(operator);
        }
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).
     * Returns the owner.
     *
     * Overrides to ownership logic should be done to {_ownerOf}.
     */
    function _requireOwned(uint256 tokenId) internal view returns (address) {
        address owner = _ownerOf(tokenId);
        if (owner == address(0)) {
            revert ERC721NonexistentToken(tokenId);
        }
        return owner;
    }

    /**
     * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target address. This will revert if the
     * recipient doesn't accept the token transfer. 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
     */
    function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory data) private {
        if (to.code.length > 0) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
                if (retval != IERC721Receiver.onERC721Received.selector) {
                    revert ERC721InvalidReceiver(to);
                }
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert ERC721InvalidReceiver(to);
                } else {
                    /// @solidity memory-safe-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/ERC721Enumerable.sol)

pragma solidity ^0.8.20;

import {ERC721} from "../ERC721.sol";
import {IERC721Enumerable} from "./IERC721Enumerable.sol";
import {IERC165} from "../../../utils/introspection/ERC165.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.
 *
 * CAUTION: `ERC721` extensions that implement custom `balanceOf` logic, such as `ERC721Consecutive`,
 * interfere with enumerability and should not be used together with `ERC721Enumerable`.
 */
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
    mapping(address owner => mapping(uint256 index => uint256)) private _ownedTokens;
    mapping(uint256 tokenId => uint256) private _ownedTokensIndex;

    uint256[] private _allTokens;
    mapping(uint256 tokenId => uint256) private _allTokensIndex;

    /**
     * @dev An `owner`'s token query was out of bounds for `index`.
     *
     * NOTE: The owner being `address(0)` indicates a global out of bounds index.
     */
    error ERC721OutOfBoundsIndex(address owner, uint256 index);

    /**
     * @dev Batch mint is not allowed.
     */
    error ERC721EnumerableForbiddenBatchMint();

    /**
     * @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 returns (uint256) {
        if (index >= balanceOf(owner)) {
            revert ERC721OutOfBoundsIndex(owner, index);
        }
        return _ownedTokens[owner][index];
    }

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

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual returns (uint256) {
        if (index >= totalSupply()) {
            revert ERC721OutOfBoundsIndex(address(0), index);
        }
        return _allTokens[index];
    }

    /**
     * @dev See {ERC721-_update}.
     */
    function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {
        address previousOwner = super._update(to, tokenId, auth);

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

        return previousOwner;
    }

    /**
     * @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 = balanceOf(to) - 1;
        _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 = balanceOf(from);
        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();
    }

    /**
     * See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch
     */
    function _increaseBalance(address account, uint128 amount) internal virtual override {
        if (amount > 0) {
            revert ERC721EnumerableForbiddenBatchMint();
        }
        super._increaseBalance(account, amount);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

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

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    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() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

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

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

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../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.
 *
 * The initial owner is set to the address provided by the deployer. 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;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling 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 {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _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);
    }
}

/*
 * @title String & slice utility library for Solidity contracts.
 * @author Nick Johnson <[email protected]>
 *
 * @dev Functionality in this library is largely implemented using an
 *      abstraction called a 'slice'. A slice represents a part of a string -
 *      anything from the entire string to a single character, or even no
 *      characters at all (a 0-length slice). Since a slice only has to specify
 *      an offset and a length, copying and manipulating slices is a lot less
 *      expensive than copying and manipulating the strings they reference.
 *
 *      To further reduce gas costs, most functions on slice that need to return
 *      a slice modify the original one instead of allocating a new one; for
 *      instance, `s.split(".")` will return the text up to the first '.',
 *      modifying s to only contain the remainder of the string after the '.'.
 *      In situations where you do not want to modify the original slice, you
 *      can make a copy first with `.copy()`, for example:
 *      `s.copy().split(".")`. Try and avoid using this idiom in loops; since
 *      Solidity has no memory management, it will result in allocating many
 *      short-lived slices that are later discarded.
 *
 *      Functions that return two slices come in two versions: a non-allocating
 *      version that takes the second slice as an argument, modifying it in
 *      place, and an allocating version that allocates and returns the second
 *      slice; see `nextRune` for example.
 *
 *      Functions that have to copy string data will return strings rather than
 *      slices; these can be cast back to slices for further processing if
 *      required.
 *
 *      For convenience, some functions are provided with non-modifying
 *      variants that create a new slice and return both; for instance,
 *      `s.splitNew('.')` leaves s unmodified, and returns two values
 *      corresponding to the left and right parts of the string.
 */

pragma solidity ^0.8.13;

library strings {
    struct slice {
        uint _len;
        uint _ptr;
    }

    function memcpy(uint dest, uint src, uint leng) private pure {
        // Copy word-length chunks while possible
        for(; leng >= 32; leng -= 32) {
            assembly {
                mstore(dest, mload(src))
            }
            dest += 32;
            src += 32;
        }

        // Copy remaining bytes
        uint mask = 256 ** (32 - leng) - 1;
        assembly {
            let srcpart := and(mload(src), not(mask))
            let destpart := and(mload(dest), mask)
            mstore(dest, or(destpart, srcpart))
        }
    }

    /*
     * @dev Returns a slice containing the entire string.
     * @param self The string to make a slice from.
     * @return A newly allocated slice containing the entire string.
     */
    function toSlice(string memory self) internal pure returns (slice memory) {
        uint ptr;
        assembly {
            ptr := add(self, 0x20)
        }
        return slice(bytes(self).length, ptr);
    }

    /*
     * @dev Returns the length of a null-terminated bytes32 string.
     * @param self The value to find the length of.
     * @return The length of the string, from 0 to 32.
     */
  function len(bytes32 self) internal pure returns (uint) {
    uint ret = 0;
    if (self == bytes32(0))
        return 0;

    // Check each byte from the left
    for (uint i = 0; i < 32; i++) {
        // Shift self to the right by i*8 bits and check if the rightmost byte is 0
        if ((bytes32(uint(self) >> (i * 8)) & bytes32(uint256(0xFF))) == bytes32(0)) {
            return i; // Return the position of the first null byte
        }
    }

    return 32; // If no null byte found, return 32
}

    /*
     * @dev Returns a slice containing the entire bytes32, interpreted as a
     *      null-terminated utf-8 string.
     * @param self The bytes32 value to convert to a slice.
     * @return A new slice containing the value of the input argument up to the
     *         first null.
     */
    function toSliceB32(bytes32 self) internal pure returns (slice memory ret) {
        // Allocate space for `self` in memory, copy it there, and point ret at it
        assembly {
            let ptr := mload(0x40)
            mstore(0x40, add(ptr, 0x20))
            mstore(ptr, self)
            mstore(add(ret, 0x20), ptr)
        }
        ret._len = len(self);
    }

    /*
     * @dev Returns a new slice containing the same data as the current slice.
     * @param self The slice to copy.
     * @return A new slice containing the same data as `self`.
     */
    function copy(slice memory self) internal pure returns (slice memory) {
        return slice(self._len, self._ptr);
    }

    /*
     * @dev Copies a slice to a new string.
     * @param self The slice to copy.
     * @return A newly allocated string containing the slice's text.
     */
    function toString(slice memory self) internal pure returns (string memory) {
        string memory ret = new string(self._len);
        uint retptr;
        assembly { retptr := add(ret, 32) }

        memcpy(retptr, self._ptr, self._len);
        return ret;
    }

    /*
     * @dev Returns the length in runes of the slice. Note that this operation
     *      takes time proportional to the length of the slice; avoid using it
     *      in loops, and call `slice.empty()` if you only need to know whether
     *      the slice is empty or not.
     * @param self The slice to operate on.
     * @return The length of the slice in runes.
     */
    function len(slice memory self) internal pure returns (uint l) {
        // Starting at ptr-31 means the LSB will be the byte we care about
        uint ptr = self._ptr - 31;
        uint end = ptr + self._len;
        for (l = 0; ptr < end; l++) {
            uint8 b;
            assembly { b := and(mload(ptr), 0xFF) }
            if (b < 0x80) {
                ptr += 1;
            } else if(b < 0xE0) {
                ptr += 2;
            } else if(b < 0xF0) {
                ptr += 3;
            } else if(b < 0xF8) {
                ptr += 4;
            } else if(b < 0xFC) {
                ptr += 5;
            } else {
                ptr += 6;
            }
        }
    }

    /*
     * @dev Returns true if the slice is empty (has a length of 0).
     * @param self The slice to operate on.
     * @return True if the slice is empty, False otherwise.
     */
    function empty(slice memory self) internal pure returns (bool) {
        return self._len == 0;
    }

    /*
     * @dev Returns a positive number if `other` comes lexicographically after
     *      `self`, a negative number if it comes before, or zero if the
     *      contents of the two slices are equal. Comparison is done per-rune,
     *      on unicode codepoints.
     * @param self The first slice to compare.
     * @param other The second slice to compare.
     * @return The result of the comparison.
     */
    function compare(slice memory self, slice memory other) internal pure returns (int) {
        uint shortest = self._len;
        if (other._len < self._len)
            shortest = other._len;

        uint selfptr = self._ptr;
        uint otherptr = other._ptr;
        for (uint idx = 0; idx < shortest; idx += 32) {
            uint a;
            uint b;
            assembly {
                a := mload(selfptr)
                b := mload(otherptr)
            }
            if (a != b) {
                // Mask out irrelevant bytes and check again
                uint256 mask = type(uint256).max; // 0xffff...
                if(shortest < 32) {
                  mask = ~(2 ** (8 * (32 - shortest + idx)) - 1);
                }
                uint256 diff = (a & mask) - (b & mask);
                if (diff != 0)
                    return int(diff);
            }
            selfptr += 32;
            otherptr += 32;
        }
        return int(self._len) - int(other._len);
    }

    /*
     * @dev Returns true if the two slices contain the same text.
     * @param self The first slice to compare.
     * @param self The second slice to compare.
     * @return True if the slices are equal, false otherwise.
     */
    function equals(slice memory self, slice memory other) internal pure returns (bool) {
        return compare(self, other) == 0;
    }

    /*
     * @dev Extracts the first rune in the slice into `rune`, advancing the
     *      slice to point to the next rune and returning `self`.
     * @param self The slice to operate on.
     * @param rune The slice that will contain the first rune.
     * @return `rune`.
     */
    function nextRune(slice memory self, slice memory rune) internal pure returns (slice memory) {
        rune._ptr = self._ptr;

        if (self._len == 0) {
            rune._len = 0;
            return rune;
        }

        uint l;
        uint b;
        // Load the first byte of the rune into the LSBs of b
        assembly { b := and(mload(sub(mload(add(self, 32)), 31)), 0xFF) }
        if (b < 0x80) {
            l = 1;
        } else if(b < 0xE0) {
            l = 2;
        } else if(b < 0xF0) {
            l = 3;
        } else {
            l = 4;
        }

        // Check for truncated codepoints
        if (l > self._len) {
            rune._len = self._len;
            self._ptr += self._len;
            self._len = 0;
            return rune;
        }

        self._ptr += l;
        self._len -= l;
        rune._len = l;
        return rune;
    }

    /*
     * @dev Returns the first rune in the slice, advancing the slice to point
     *      to the next rune.
     * @param self The slice to operate on.
     * @return A slice containing only the first rune from `self`.
     */
    function nextRune(slice memory self) internal pure returns (slice memory ret) {
        nextRune(self, ret);
    }

    /*
     * @dev Returns the number of the first codepoint in the slice.
     * @param self The slice to operate on.
     * @return The number of the first codepoint in the slice.
     */
    function ord(slice memory self) internal pure returns (uint ret) {
        if (self._len == 0) {
            return 0;
        }

        uint word;
        uint length;
        uint divisor = 2 ** 248;

        // Load the rune into the MSBs of b
        assembly { word:= mload(mload(add(self, 32))) }
        uint b = word / divisor;
        if (b < 0x80) {
            ret = b;
            length = 1;
        } else if(b < 0xE0) {
            ret = b & 0x1F;
            length = 2;
        } else if(b < 0xF0) {
            ret = b & 0x0F;
            length = 3;
        } else {
            ret = b & 0x07;
            length = 4;
        }

        // Check for truncated codepoints
        if (length > self._len) {
            return 0;
        }

        for (uint i = 1; i < length; i++) {
            divisor = divisor / 256;
            b = (word / divisor) & 0xFF;
            if (b & 0xC0 != 0x80) {
                // Invalid UTF-8 sequence
                return 0;
            }
            ret = (ret * 64) | (b & 0x3F);
        }

        return ret;
    }

    /*
     * @dev Returns the keccak-256 hash of the slice.
     * @param self The slice to hash.
     * @return The hash of the slice.
     */
    function keccak(slice memory self) internal pure returns (bytes32 ret) {
        assembly {
            ret := keccak256(mload(add(self, 32)), mload(self))
        }
    }

    /*
     * @dev Returns true if `self` starts with `needle`.
     * @param self The slice to operate on.
     * @param needle The slice to search for.
     * @return True if the slice starts with the provided text, false otherwise.
     */
    function startsWith(slice memory self, slice memory needle) internal pure returns (bool) {
        if (self._len < needle._len) {
            return false;
        }

        if (self._ptr == needle._ptr) {
            return true;
        }

        bool equal;
        assembly {
            let length := mload(needle)
            let selfptr := mload(add(self, 0x20))
            let needleptr := mload(add(needle, 0x20))
            equal := eq(keccak256(selfptr, length), keccak256(needleptr, length))
        }
        return equal;
    }

    /*
     * @dev If `self` starts with `needle`, `needle` is removed from the
     *      beginning of `self`. Otherwise, `self` is unmodified.
     * @param self The slice to operate on.
     * @param needle The slice to search for.
     * @return `self`
     */
    function beyond(slice memory self, slice memory needle) internal pure returns (slice memory) {
        if (self._len < needle._len) {
            return self;
        }

        bool equal = true;
        if (self._ptr != needle._ptr) {
            assembly {
                let length := mload(needle)
                let selfptr := mload(add(self, 0x20))
                let needleptr := mload(add(needle, 0x20))
                equal := eq(keccak256(selfptr, length), keccak256(needleptr, length))
            }
        }

        if (equal) {
            self._len -= needle._len;
            self._ptr += needle._len;
        }

        return self;
    }

    /*
     * @dev Returns true if the slice ends with `needle`.
     * @param self The slice to operate on.
     * @param needle The slice to search for.
     * @return True if the slice starts with the provided text, false otherwise.
     */
    function endsWith(slice memory self, slice memory needle) internal pure returns (bool) {
        if (self._len < needle._len) {
            return false;
        }

        uint selfptr = self._ptr + self._len - needle._len;

        if (selfptr == needle._ptr) {
            return true;
        }

        bool equal;
        assembly {
            let length := mload(needle)
            let needleptr := mload(add(needle, 0x20))
            equal := eq(keccak256(selfptr, length), keccak256(needleptr, length))
        }

        return equal;
    }

    /*
     * @dev If `self` ends with `needle`, `needle` is removed from the
     *      end of `self`. Otherwise, `self` is unmodified.
     * @param self The slice to operate on.
     * @param needle The slice to search for.
     * @return `self`
     */
    function until(slice memory self, slice memory needle) internal pure returns (slice memory) {
        if (self._len < needle._len) {
            return self;
        }

        uint selfptr = self._ptr + self._len - needle._len;
        bool equal = true;
        if (selfptr != needle._ptr) {
            assembly {
                let length := mload(needle)
                let needleptr := mload(add(needle, 0x20))
                equal := eq(keccak256(selfptr, length), keccak256(needleptr, length))
            }
        }

        if (equal) {
            self._len -= needle._len;
        }

        return self;
    }

    // Returns the memory address of the first byte of the first occurrence of
    // `needle` in `self`, or the first byte after `self` if not found.
    function findPtr(uint selflen, uint selfptr, uint needlelen, uint needleptr) private pure returns (uint) {
        uint ptr = selfptr;
        uint idx;

        if (needlelen <= selflen) {
            if (needlelen <= 32) {
                bytes32 mask = bytes32(~(2 ** (8 * (32 - needlelen)) - 1));

                bytes32 needledata;
                assembly { needledata := and(mload(needleptr), mask) }

                uint end = selfptr + selflen - needlelen;
                bytes32 ptrdata;
                assembly { ptrdata := and(mload(ptr), mask) }

                while (ptrdata != needledata) {
                    if (ptr >= end)
                        return selfptr + selflen;
                    ptr++;
                    assembly { ptrdata := and(mload(ptr), mask) }
                }
                return ptr;
            } else {
                // For long needles, use hashing
                bytes32 hash;
                assembly { hash := keccak256(needleptr, needlelen) }

                for (idx = 0; idx <= selflen - needlelen; idx++) {
                    bytes32 testHash;
                    assembly { testHash := keccak256(ptr, needlelen) }
                    if (hash == testHash)
                        return ptr;
                    ptr += 1;
                }
            }
        }
        return selfptr + selflen;
    }

    // Returns the memory address of the first byte after the last occurrence of
    // `needle` in `self`, or the address of `self` if not found.
    function rfindPtr(uint selflen, uint selfptr, uint needlelen, uint needleptr) private pure returns (uint) {
        uint ptr;

        if (needlelen <= selflen) {
            if (needlelen <= 32) {
                bytes32 mask = bytes32(~(2 ** (8 * (32 - needlelen)) - 1));

                bytes32 needledata;
                assembly { needledata := and(mload(needleptr), mask) }

                ptr = selfptr + selflen - needlelen;
                bytes32 ptrdata;
                assembly { ptrdata := and(mload(ptr), mask) }

                while (ptrdata != needledata) {
                    if (ptr <= selfptr)
                        return selfptr;
                    ptr--;
                    assembly { ptrdata := and(mload(ptr), mask) }
                }
                return ptr + needlelen;
            } else {
                // For long needles, use hashing
                bytes32 hash;
                assembly { hash := keccak256(needleptr, needlelen) }
                ptr = selfptr + (selflen - needlelen);
                while (ptr >= selfptr) {
                    bytes32 testHash;
                    assembly { testHash := keccak256(ptr, needlelen) }
                    if (hash == testHash)
                        return ptr + needlelen;
                    ptr -= 1;
                }
            }
        }
        return selfptr;
    }

    /*
     * @dev Modifies `self` to contain everything from the first occurrence of
     *      `needle` to the end of the slice. `self` is set to the empty slice
     *      if `needle` is not found.
     * @param self The slice to search and modify.
     * @param needle The text to search for.
     * @return `self`.
     */
    function find(slice memory self, slice memory needle) internal pure returns (slice memory) {
        uint ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr);
        self._len -= ptr - self._ptr;
        self._ptr = ptr;
        return self;
    }

    /*
     * @dev Modifies `self` to contain the part of the string from the start of
     *      `self` to the end of the first occurrence of `needle`. If `needle`
     *      is not found, `self` is set to the empty slice.
     * @param self The slice to search and modify.
     * @param needle The text to search for.
     * @return `self`.
     */
    function rfind(slice memory self, slice memory needle) internal pure returns (slice memory) {
        uint ptr = rfindPtr(self._len, self._ptr, needle._len, needle._ptr);
        self._len = ptr - self._ptr;
        return self;
    }

    /*
     * @dev Splits the slice, setting `self` to everything after the first
     *      occurrence of `needle`, and `token` to everything before it. If
     *      `needle` does not occur in `self`, `self` is set to the empty slice,
     *      and `token` is set to the entirety of `self`.
     * @param self The slice to split.
     * @param needle The text to search for in `self`.
     * @param token An output parameter to which the first token is written.
     * @return `token`.
     */
    function split(slice memory self, slice memory needle, slice memory token) internal pure returns (slice memory) {
        uint ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr);
        token._ptr = self._ptr;
        token._len = ptr - self._ptr;
        if (ptr == self._ptr + self._len) {
            // Not found
            self._len = 0;
        } else {
            self._len -= token._len + needle._len;
            self._ptr = ptr + needle._len;
        }
        return token;
    }

    /*
     * @dev Splits the slice, setting `self` to everything after the first
     *      occurrence of `needle`, and returning everything before it. If
     *      `needle` does not occur in `self`, `self` is set to the empty slice,
     *      and the entirety of `self` is returned.
     * @param self The slice to split.
     * @param needle The text to search for in `self`.
     * @return The part of `self` up to the first occurrence of `delim`.
     */
    function split(slice memory self, slice memory needle) internal pure returns (slice memory token) {
        split(self, needle, token);
    }

    /*
     * @dev Splits the slice, setting `self` to everything before the last
     *      occurrence of `needle`, and `token` to everything after it. If
     *      `needle` does not occur in `self`, `self` is set to the empty slice,
     *      and `token` is set to the entirety of `self`.
     * @param self The slice to split.
     * @param needle The text to search for in `self`.
     * @param token An output parameter to which the first token is written.
     * @return `token`.
     */
    function rsplit(slice memory self, slice memory needle, slice memory token) internal pure returns (slice memory) {
        uint ptr = rfindPtr(self._len, self._ptr, needle._len, needle._ptr);
        token._ptr = ptr;
        token._len = self._len - (ptr - self._ptr);
        if (ptr == self._ptr) {
            // Not found
            self._len = 0;
        } else {
            self._len -= token._len + needle._len;
        }
        return token;
    }

    /*
     * @dev Splits the slice, setting `self` to everything before the last
     *      occurrence of `needle`, and returning everything after it. If
     *      `needle` does not occur in `self`, `self` is set to the empty slice,
     *      and the entirety of `self` is returned.
     * @param self The slice to split.
     * @param needle The text to search for in `self`.
     * @return The part of `self` after the last occurrence of `delim`.
     */
    function rsplit(slice memory self, slice memory needle) internal pure returns (slice memory token) {
        rsplit(self, needle, token);
    }

    /*
     * @dev Counts the number of nonoverlapping occurrences of `needle` in `self`.
     * @param self The slice to search.
     * @param needle The text to search for in `self`.
     * @return The number of occurrences of `needle` found in `self`.
     */
    function count(slice memory self, slice memory needle) internal pure returns (uint cnt) {
        uint ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr) + needle._len;
        while (ptr <= self._ptr + self._len) {
            cnt++;
            ptr = findPtr(self._len - (ptr - self._ptr), ptr, needle._len, needle._ptr) + needle._len;
        }
    }

    /*
     * @dev Returns True if `self` contains `needle`.
     * @param self The slice to search.
     * @param needle The text to search for in `self`.
     * @return True if `needle` is found in `self`, false otherwise.
     */
    function contains(slice memory self, slice memory needle) internal pure returns (bool) {
        return rfindPtr(self._len, self._ptr, needle._len, needle._ptr) != self._ptr;
    }

    /*
     * @dev Returns a newly allocated string containing the concatenation of
     *      `self` and `other`.
     * @param self The first slice to concatenate.
     * @param other The second slice to concatenate.
     * @return The concatenation of the two strings.
     */
    function concat(slice memory self, slice memory other) internal pure returns (string memory) {
        string memory ret = new string(self._len + other._len);
        uint retptr;
        assembly { retptr := add(ret, 32) }
        memcpy(retptr, self._ptr, self._len);
        memcpy(retptr + self._len, other._ptr, other._len);
        return ret;
    }

    /*
     * @dev Joins an array of slices, using `self` as a delimiter, returning a
     *      newly allocated string.
     * @param self The delimiter to use.
     * @param parts A list of slices to join.
     * @return A newly allocated string containing all the slices in `parts`,
     *         joined with `self`.
     */
    function join(slice memory self, slice[] memory parts) internal pure returns (string memory) {
        if (parts.length == 0)
            return "";

        uint length = self._len * (parts.length - 1);
        for(uint i = 0; i < parts.length; i++)
            length += parts[i]._len;

        string memory ret = new string(length);
        uint retptr;
        assembly { retptr := add(ret, 32) }

        for(uint i = 0; i < parts.length; i++) {
            memcpy(retptr, parts[i]._ptr, parts[i]._len);
            retptr += parts[i]._len;
            if (i < parts.length - 1) {
                memcpy(retptr, self._ptr, self._len);
                retptr += self._len;
            }
        }

        return ret;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 value) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}

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

pragma solidity ^0.8.20;

import {IERC165} from "../../utils/introspection/IERC165.sol";

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

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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * 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 address zero.
     *
     * 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 9 of 18 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.20;

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.20;

import {IERC721} from "../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);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

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

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)

pragma solidity ^0.8.20;

import {Math} from "./math/Math.sol";
import {SignedMath} from "./math/SignedMath.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant HEX_DIGITS = "0123456789abcdef";
    uint8 private constant ADDRESS_LENGTH = 20;

    /**
     * @dev The `value` string doesn't fit in the specified `length`.
     */
    error StringsInsufficientHexLength(uint256 value, uint256 length);

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toStringSigned(int256 value) internal pure returns (string memory) {
        return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value)));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        uint256 localValue = value;
        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_DIGITS[localValue & 0xf];
            localValue >>= 4;
        }
        if (localValue != 0) {
            revert StringsInsufficientHexLength(value, length);
        }
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal
     * representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "./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);
 * }
 * ```
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;

/**
 * @dev Standard ERC20 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.
 */
interface IERC20Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC20InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC20InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     * @param allowance Amount of tokens a `spender` is allowed to operate with.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC20InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC20InvalidSpender(address spender);
}

/**
 * @dev Standard ERC721 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.
 */
interface IERC721Errors {
    /**
     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.
     * Used in balance queries.
     * @param owner Address of the current owner of a token.
     */
    error ERC721InvalidOwner(address owner);

    /**
     * @dev Indicates a `tokenId` whose `owner` is the zero address.
     * @param tokenId Identifier number of a token.
     */
    error ERC721NonexistentToken(uint256 tokenId);

    /**
     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param tokenId Identifier number of a token.
     * @param owner Address of the current owner of a token.
     */
    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC721InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC721InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param tokenId Identifier number of a token.
     */
    error ERC721InsufficientApproval(address operator, uint256 tokenId);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC721InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC721InvalidOperator(address operator);
}

/**
 * @dev Standard ERC1155 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.
 */
interface IERC1155Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     * @param tokenId Identifier number of a token.
     */
    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC1155InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC1155InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param owner Address of the current owner of a token.
     */
    error ERC1155MissingApprovalForAll(address operator, address owner);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC1155InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC1155InvalidOperator(address operator);

    /**
     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
     * Used in batch transfers.
     * @param idsLength Length of the array of token identifiers
     * @param valuesLength Length of the array of token amounts
     */
    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.20;

import {IERC721} from "../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);

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Muldiv operation overflow.
     */
    error MathOverflowedMulDiv();

    enum Rounding {
        Floor, // Toward negative infinity
        Ceil, // Toward positive infinity
        Trunc, // Toward zero
        Expand // Away from zero
    }

    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds towards infinity instead
     * of rounding towards zero.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        if (b == 0) {
            // Guarantee the same behavior as in a regular Solidity division.
            return a / b;
        }

        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
     * denominator == 0.
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
     * Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0 = x * y; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            if (denominator <= prod1) {
                revert MathOverflowedMulDiv();
            }

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator.
            // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.

            uint256 twos = denominator & (0 - denominator);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
            // works in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
     * towards zero.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
        }
    }

    /**
     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
     */
    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
        return uint8(rounding) % 2 == 1;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

Settings
{
  "remappings": [
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_payToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ERC721EnumerableForbiddenBatchMint","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721IncorrectOwner","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721InsufficientApproval","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC721InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC721InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721InvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC721InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC721InvalidSender","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721NonexistentToken","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"ERC721OutOfBoundsIndex","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"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":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"_MAXTITLECOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"firstname","type":"string"},{"internalType":"string","name":"lastname","type":"string"}],"name":"claimTitle","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint16","name":"quantity","type":"uint16"}],"name":"claimTitle","outputs":[],"stateMutability":"nonpayable","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":"getAsset","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getFirstName","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getLastName","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isAllTokenMinted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"itemPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"payToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"purchasedTitles","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"redeemThisPOSandGiveMeMyRWABack","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"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":[],"name":"titlesRemainingToBeMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"uint256","name":"tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]

60a0604052600b80546001600160a01b031916734392dc16867d53dbfe227076606455634d4c27951790556000600c553480156200003c57600080fd5b5060405162004363380380620043638339810160408190526200005f916200019f565b6040518060400160405280600d81526020016c4e6f742046616b65205257415360981b815250604051806040016040528060048152602001635257415360e01b8152508160009081620000b3919062000278565b506001620000c2828262000278565b50506001600a55506001600160a01b03818116608052600b546040516302b8a21d60e01b81523360048201529116906302b8a21d90602401600060405180830381600087803b1580156200011557600080fd5b505af11580156200012a573d6000803e3d6000fd5b50505050600b60009054906101000a90046001600160a01b03166001600160a01b03166325ce9a376040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156200017f57600080fd5b505af115801562000194573d6000803e3d6000fd5b505050505062000344565b600060208284031215620001b257600080fd5b81516001600160a01b0381168114620001ca57600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620001fc57607f821691505b6020821081036200021d57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111562000273576000816000526020600020601f850160051c810160208610156200024e5750805b601f850160051c820191505b818110156200026f578281556001016200025a565b5050505b505050565b81516001600160401b03811115620002945762000294620001d1565b620002ac81620002a58454620001e7565b8462000223565b602080601f831160018114620002e45760008415620002cb5750858301515b600019600386901b1c1916600185901b1785556200026f565b600085815260208120601f198616915b828110156200031557888601518255948401946001909101908401620002f4565b5085821015620003345787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b608051613fee620003756000396000818161045801528181610ae601528181610e5601526111ad0152613fee6000f3fe6080604052600436106101cd5760003560e01c80636352211e116100f7578063a760a29f11610095578063dac6db1c11610064578063dac6db1c14610526578063e985e9c514610544578063eac8f5b814610564578063fea347081461058457600080fd5b8063a760a29f146104ad578063b88d4fde146104c6578063c87b56dd146104e6578063d655fcf21461050657600080fd5b806395d89b41116100d157806395d89b411461043157806396336b301461044657806397426cbd1461047a578063a22cb4651461048d57600080fd5b80636352211e146103dc57806370a08231146103fc578063810b2aff1461041c57600080fd5b806317ec7f9e1161016f57806336acc9c91161013e57806336acc9c91461035c57806339c7639c1461037c57806342842e0e1461039c5780634f6ccce7146103bc57600080fd5b806317ec7f9e146102e357806318160ddd1461030757806323b872dd1461031c5780632f745c591461033c57600080fd5b8063095ea7b3116101ab578063095ea7b3146102615780630e89341c14610283578063172a56c1146102a3578063174029f6146102c357600080fd5b806301ffc9a7146101d257806306fdde0314610207578063081812fc14610229575b600080fd5b3480156101de57600080fd5b506101f26101ed3660046126c2565b61059a565b60405190151581526020015b60405180910390f35b34801561021357600080fd5b5061021c6105c5565b6040516101fe919061272f565b34801561023557600080fd5b50610249610244366004612742565b610657565b6040516001600160a01b0390911681526020016101fe565b34801561026d57600080fd5b5061028161027c366004612777565b610680565b005b34801561028f57600080fd5b5061021c61029e366004612742565b61068f565b3480156102af57600080fd5b5061021c6102be366004612742565b610835565b3480156102cf57600080fd5b5061021c6102de366004612742565b61090b565b3480156102ef57600080fd5b506102f9611f4081565b6040519081526020016101fe565b34801561031357600080fd5b506008546102f9565b34801561032857600080fd5b506102816103373660046127a1565b610962565b34801561034857600080fd5b506102f9610357366004612777565b6109f2565b34801561036857600080fd5b50610281610377366004612742565b610a57565b34801561038857600080fd5b506101f2610397366004612742565b610b69565b3480156103a857600080fd5b506102816103b73660046127a1565b610b7c565b3480156103c857600080fd5b506102f96103d7366004612742565b610b9c565b3480156103e857600080fd5b506102496103f7366004612742565b610bf5565b34801561040857600080fd5b506102f96104173660046127dd565b610c00565b34801561042857600080fd5b506102f9610c48565b34801561043d57600080fd5b5061021c610c5f565b34801561045257600080fd5b506102497f000000000000000000000000000000000000000000000000000000000000000081565b6102816104883660046128a4565b610c6e565b34801561049957600080fd5b506102816104a8366004612916565b610ff2565b3480156104b957600080fd5b50600c54611f40146101f2565b3480156104d257600080fd5b506102816104e136600461294d565b610ffd565b3480156104f257600080fd5b5061021c610501366004612742565b611014565b34801561051257600080fd5b506102816105213660046129c9565b611089565b34801561053257600080fd5b506102f96969e10de76676d080000081565b34801561055057600080fd5b506101f261055f3660046129ed565b6112fa565b34801561057057600080fd5b5061021c61057f366004612742565b611328565b34801561059057600080fd5b506102f9600c5481565b60006001600160e01b0319821663780e9d6360e01b14806105bf57506105bf8261145c565b92915050565b6060600080546105d490612a20565b80601f016020809104026020016040519081016040528092919081815260200182805461060090612a20565b801561064d5780601f106106225761010080835404028352916020019161064d565b820191906000526020600020905b81548152906001019060200180831161063057829003601f168201915b5050505050905090565b6000610662826114ac565b506000828152600460205260409020546001600160a01b03166105bf565b61068b8282336114e5565b5050565b6060610699612684565b60405180610aa00160405280610a63815260200161310e610a63913981526106c083610835565b60208281019190915260408051808201825260018152600160fd1b928101929092528201526106ee8361090b565b606082015260408051610100810190915260d2808252613e346020830139608082015261071a83611328565b60a082015260408051808201825260078152661e17ba32bc3a1f60c91b60208083019190915260c0840191909152815180820183526000815260e0840152815161022081019092526101f480835290613b7190830139610100820181905281516020808401516040808601516060870151608088015160a089015160c08a015160e08b0151955160009a6107bc9a999697959694959394929392909101612a70565b604051602081830303815290604052905060006108096107db866114f2565b6107e4846115fb565b6040516020016107f5929190612b31565b6040516020818303038152906040526115fb565b90508060405160200161081c9190612c18565b60408051601f1981840301815291905295945050505050565b6000818152600f602052604090205460609060ff16156108ed576000828152600d60205260409020805461086890612a20565b80601f016020809104026020016040519081016040528092919081815260200182805461089490612a20565b80156108e15780601f106108b6576101008083540402835291602001916108e1565b820191906000526020600020905b8154815290600101906020018083116108c457829003601f168201915b50505050509050919050565b5050604080518082019091526002815261209760f11b602082015290565b6000818152600f602052604090205460609060ff161561093e576000828152600e60205260409020805461086890612a20565b50506040805180820190915260088152674e6f6e796d6f757360c01b602082015290565b6001600160a01b03821661099157604051633250574960e11b8152600060048201526024015b60405180910390fd5b600061099e838333611765565b9050836001600160a01b0316816001600160a01b0316146109ec576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610988565b50505050565b60006109fd83610c00565b8210610a2e5760405163295f44f760e21b81526001600160a01b038416600482015260248101839052604401610988565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b610a5f611832565b33610a6982610bf5565b6001600160a01b031614610ab85760405162461bcd60e51b8152602060048201526016602482015275139bdd081bdddb995c881b9bdc88185c1c1c9bdd995960521b6044820152606401610988565b610ac18161185c565b60405163a9059cbb60e01b81523360048201526969e10de76676d080000060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a9059cbb906044016020604051808303816000875af1158015610b37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5b9190612c5d565b50610b666001600a55565b50565b600080610b7533610c00565b1192915050565b610b9783838360405180602001604052806000815250610ffd565b505050565b6000610ba760085490565b8210610bd05760405163295f44f760e21b81526000600482015260248101839052604401610988565b60088281548110610be357610be3612a5a565b90600052602060002001549050919050565b60006105bf826114ac565b60006001600160a01b038216610c2c576040516322718ad960e21b815260006004820152602401610988565b506001600160a01b031660009081526003602052604090205490565b6000600c54611f40610c5a9190612c90565b905090565b6060600180546105d490612a20565b610c76610c48565b60011115610ce25760405162461bcd60e51b815260206004820152603360248201527f507572636861736520616d6f756e742069732067726561746572207468616e2060448201527274686520746f6b656e20617661696c61626c6560681b6064820152608401610988565b6015610ced83611897565b10610d4a5760405162461bcd60e51b815260206004820152602760248201527f4669727374206e616d65206d75737420626520756e646572203231206368617260448201526630b1ba32b9399760c91b6064820152608401610988565b6015610d5582611897565b10610db15760405162461bcd60e51b815260206004820152602660248201527f4c617374206e616d65206d75737420626520756e64657220323120636861726160448201526531ba32b9399760d11b6064820152608401610988565b610dba826119c8565b158015610dcd5750610dcb816119c8565b155b610e2b5760405162461bcd60e51b815260206004820152602960248201527f496e70757420636f6e7461696e7320696e76616c6964206368617261637465726044820152687320283c3e2227262960b81b6064820152608401610988565b6040516323b872dd60e01b81523360048201523060248201526969e10de76676d080000060448201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064016020604051808303816000875af1158015610ea7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ecb9190612c5d565b610f0c5760405162461bcd60e51b8152602060048201526012602482015271496e73756666696369656e742066756e647360701b6044820152606401610988565b610f1582611897565b158015610f285750610f2681611897565b155b15610f6e5760405180604001604052806002815260200161209760f11b8152509150604051806040016040528060088152602001674e6f6e796d6f757360c01b81525090505b6000600c549050610f8f338260405180602001604052806000815250611a85565b6000818152600d60205260409020610fa78482612cf3565b506000818152600e60205260409020610fc08382612cf3565b506000818152600f60205260408120805460ff19166001179055600c805491610fe883612db3565b9190505550505050565b61068b338383611a9c565b611008848484610962565b6109ec84848484611b3b565b606061101f826114ac565b50600061103760408051602081019091526000815290565b905060008151116110575760405180602001604052806000815250611082565b8061106184611c64565b604051602001611072929190612dcc565b6040516020818303038152906040525b9392505050565b60008161ffff16116110e85760405162461bcd60e51b815260206004820152602260248201527f4d696e696d756d203120746f6b656e73206e65656420746f206265206d696e74604482015261195960f21b6064820152608401610988565b6110f0610c48565b8161ffff16111561115e5760405162461bcd60e51b815260206004820152603260248201527f507572636861736520616d6f756e742069732067726561746572207468616e20604482015271746865205257417320617661696c61626c6560701b6064820152608401610988565b60148161ffff1611156111a35760405162461bcd60e51b815260206004820152600d60248201526c4d6178203230205469746c657360981b6044820152606401610988565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166323b872dd33306111ec61ffff86166969e10de76676d0800000612dfb565b6040516001600160e01b031960e086901b1681526001600160a01b03938416600482015292909116602483015260448201526064016020604051808303816000875af1158015611240573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112649190612c5d565b6112a55760405162461bcd60e51b8152602060048201526012602482015271496e73756666696369656e742066756e647360701b6044820152606401610988565b60005b8161ffff168161ffff16101561068b576000600c5490506112d9338260405180602001604052806000815250611a85565b6001600c60008282546112ec9190612e12565b9091555050506001016112a8565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6060600061137483604051806040016040528060098152602001683334b939ba2fb0b23560b91b8152506040518060c00160405280608f8152602001613d65608f913960146000611cf7565b905060006113c1846040518060400160405280600a81526020016939b2b1b7b7322fb0b23560b11b8152506040518060e0016040528060b38152602001613f0660b3913960146000611cf7565b90506000604051806040016040528060018152602001600160fd1b8152509050600061142786604051806040016040528060048152602001633737bab760e11b81525060405180610100016040528060c3815260200161304b60c3913960146000611cf7565b90508382848484604051602001611442959493929190612e25565b604051602081830303815290604052945050505050919050565b60006001600160e01b031982166380ac58cd60e01b148061148d57506001600160e01b03198216635b5e139f60e01b145b806105bf57506301ffc9a760e01b6001600160e01b03198316146105bf565b6000818152600260205260408120546001600160a01b0316806105bf57604051637e27328960e01b815260048101849052602401610988565b610b978383836001611d4d565b6060816000036115195750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611543578061152d81612db3565b915061153c9050600a83612ea6565b915061151d565b60008167ffffffffffffffff81111561155e5761155e6127f8565b6040519080825280601f01601f191660200182016040528015611588576020820181803683370190505b5090505b84156115f35761159d600183612c90565b91506115aa600a86612eba565b6115b5906030612e12565b60f81b8183815181106115ca576115ca612a5a565b60200101906001600160f81b031916908160001a9053506115ec600a86612ea6565b945061158c565b949350505050565b8051606090600081900361161f575050604080516020810190915260008152919050565b6000600361162e836002612e12565b6116389190612ea6565b611643906004612dfb565b90506000611652826020612e12565b67ffffffffffffffff81111561166a5761166a6127f8565b6040519080825280601f01601f191660200182016040528015611694576020820181803683370190505b5090506000604051806060016040528060408152602001613df4604091399050600181016020830160005b86811015611720576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b8352600490920191016116bf565b50600386066001811461173a576002811461174b57611757565b613d3d60f01b600119830152611757565b603d60f81b6000198301525b505050918152949350505050565b600080611773858585611e53565b90506001600160a01b0381166117d0576117cb84600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b6117f3565b846001600160a01b0316816001600160a01b0316146117f3576117f38185611f4c565b6001600160a01b03851661180f5761180a84611fdd565b6115f3565b846001600160a01b0316816001600160a01b0316146115f3576115f3858561208c565b6002600a540361185557604051633ee5aeb560e01b815260040160405180910390fd5b6002600a55565b600061186b6000836000611765565b90506001600160a01b03811661068b57604051637e27328960e01b815260048101839052602401610988565b600080825b80518210156119c15760078183815181106118b9576118b9612a5a565b01602001516001600160f81b031990811690911c166000036118e7576118e0600183612e12565b91506119af565b60058183815181106118fb576118fb612a5a565b01602001516001600160f81b031990811690911c16600360f91b03611925576118e0600283612e12565b600481838151811061193957611939612a5a565b01602001516001600160f81b031990811690911c16600760f91b03611963576118e0600383612e12565b600381838151811061197757611977612a5a565b01602001516001600160f81b031990811690911c16600f60f91b036119a1576118e0600483612e12565b6119ac600183612e12565b91505b826119b981612db3565b93505061189c565b5050919050565b600081815b8151811015611a7b5760008282815181106119ea576119ea612a5a565b01602001516001600160f81b0319169050600f60fa1b811480611a1a5750601f60f91b6001600160f81b03198216145b80611a325750601160f91b6001600160f81b03198216145b80611a4a5750602760f81b6001600160f81b03198216145b80611a625750601360f91b6001600160f81b03198216145b15611a7257506001949350505050565b506001016119cd565b5060009392505050565b611a8f83836120dc565b610b976000848484611b3b565b6001600160a01b038216611ace57604051630b61174360e31b81526001600160a01b0383166004820152602401610988565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b156109ec57604051630a85bd0160e11b81526001600160a01b0384169063150b7a0290611b7d903390889087908790600401612ece565b6020604051808303816000875af1925050508015611bb8575060408051601f3d908101601f19168201909252611bb591810190612f0b565b60015b611c21573d808015611be6576040519150601f19603f3d011682016040523d82523d6000602084013e611beb565b606091505b508051600003611c1957604051633250574960e11b81526001600160a01b0385166004820152602401610988565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b14611c5d57604051633250574960e11b81526001600160a01b0385166004820152602401610988565b5050505050565b60606000611c7183612141565b600101905060008167ffffffffffffffff811115611c9157611c916127f8565b6040519080825280601f01601f191660200182016040528015611cbb576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611cc557509392505050565b60606000611d2d86611d0889611c64565b604051602001611d19929190612dcc565b604051602081830303815290604052612219565b9050611d4285611d3d8684612eba565b61224a565b979650505050505050565b8080611d6157506001600160a01b03821615155b15611e23576000611d71846114ac565b90506001600160a01b03831615801590611d9d5750826001600160a01b0316816001600160a01b031614155b8015611db05750611dae81846112fa565b155b15611dd95760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610988565b8115611e215783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b6000828152600260205260408120546001600160a01b0390811690831615611e8057611e80818486612303565b6001600160a01b03811615611ebe57611e9d600085600080611d4d565b6001600160a01b038116600090815260036020526040902080546000190190555b6001600160a01b03851615611eed576001600160a01b0385166000908152600360205260409020805460010190555b60008481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b6000611f5783610c00565b600083815260076020526040902054909150808214611faa576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090611fef90600190612c90565b6000838152600960205260408120546008805493945090928490811061201757612017612a5a565b90600052602060002001549050806008838154811061203857612038612a5a565b600091825260208083209091019290925582815260099091526040808220849055858252812055600880548061207057612070612f28565b6001900381819060005260206000200160009055905550505050565b6000600161209984610c00565b6120a39190612c90565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6001600160a01b03821661210657604051633250574960e11b815260006004820152602401610988565b600061211483836000611765565b90506001600160a01b03811615610b97576040516339e3563760e11b815260006004820152602401610988565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106121805772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106121ac576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106121ca57662386f26fc10000830492506010015b6305f5e10083106121e2576305f5e100830492506008015b61271083106121f657612710830492506004015b60648310612208576064830492506002015b600a83106105bf5760010192915050565b60008160405160200161222c9190612f3e565b60408051601f19818403018152919052805160209091012092915050565b6060600061227f8460408051808201825260008082526020918201528151808301909252825182529182019181019190915290565b60408051808201825260018152603b60f81b6020808301918252835180850185526000808252908201819052845180860186528451815280830193909352845180860190955280855290840152929350919060005b8681116122f9576122e58584612367565b9150806122f181612db3565b9150506122d4565b50611d428161238d565b61230e8383836123f6565b610b97576001600160a01b03831661233c57604051637e27328960e01b815260048101829052602401610988565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610988565b6040805180820190915260008082526020820152612386838383612459565b5092915050565b60606000826000015167ffffffffffffffff8111156123ae576123ae6127f8565b6040519080825280601f01601f1916602001820160405280156123d8576020820181803683370190505b50905060006020820190506123868185602001518660000151612504565b60006001600160a01b038316158015906115f35750826001600160a01b0316846001600160a01b03161480612430575061243084846112fa565b806115f35750506000908152600460205260409020546001600160a01b03908116911614919050565b6040805180820190915260008082526020820152600061248b8560000151866020015186600001518760200151612575565b6020808701805191860191909152519091506124a79082612c90565b8352845160208601516124ba9190612e12565b81036124c957600085526124fb565b835183516124d79190612e12565b855186906124e6908390612c90565b90525083516124f59082612e12565b60208601525b50909392505050565b6020811061253c578151835261251b602084612e12565b9250612528602083612e12565b9150612535602082612c90565b9050612504565b6000600161254b836020612c90565b6125579061010061303e565b6125619190612c90565b925184518416931916929092179092525050565b6000838186851161267a57602085116126295760006001612597876020612c90565b6125a2906008612dfb565b6125ad90600261303e565b6125b79190612c90565b85519019915081166000876125cc8b8b612e12565b6125d69190612c90565b855190915083165b82811461261b57818610612603576125f68b8b612e12565b96505050505050506115f3565b8561260d81612db3565b9650508386511690506125de565b8596505050505050506115f3565b508383206000905b61263b8689612c90565b82116126785785832080820361265757839450505050506115f3565b612662600185612e12565b935050818061267090612db3565b925050612631565b505b611d428787612e12565b6040518061012001604052806009905b60608152602001906001900390816126945790505090565b6001600160e01b031981168114610b6657600080fd5b6000602082840312156126d457600080fd5b8135611082816126ac565b60005b838110156126fa5781810151838201526020016126e2565b50506000910152565b6000815180845261271b8160208601602086016126df565b601f01601f19169290920160200192915050565b6020815260006110826020830184612703565b60006020828403121561275457600080fd5b5035919050565b80356001600160a01b038116811461277257600080fd5b919050565b6000806040838503121561278a57600080fd5b6127938361275b565b946020939093013593505050565b6000806000606084860312156127b657600080fd5b6127bf8461275b565b92506127cd6020850161275b565b9150604084013590509250925092565b6000602082840312156127ef57600080fd5b6110828261275b565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff80841115612829576128296127f8565b604051601f8501601f19908116603f01168101908282118183101715612851576128516127f8565b8160405280935085815286868601111561286a57600080fd5b858560208301376000602087830101525050509392505050565b600082601f83011261289557600080fd5b6110828383356020850161280e565b600080604083850312156128b757600080fd5b823567ffffffffffffffff808211156128cf57600080fd5b6128db86838701612884565b935060208501359150808211156128f157600080fd5b506128fe85828601612884565b9150509250929050565b8015158114610b6657600080fd5b6000806040838503121561292957600080fd5b6129328361275b565b9150602083013561294281612908565b809150509250929050565b6000806000806080858703121561296357600080fd5b61296c8561275b565b935061297a6020860161275b565b925060408501359150606085013567ffffffffffffffff81111561299d57600080fd5b8501601f810187136129ae57600080fd5b6129bd8782356020840161280e565b91505092959194509250565b6000602082840312156129db57600080fd5b813561ffff8116811461108257600080fd5b60008060408385031215612a0057600080fd5b612a098361275b565b9150612a176020840161275b565b90509250929050565b600181811c90821680612a3457607f821691505b602082108103612a5457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b60008a51612a82818460208f016126df565b8a51612a948183860160208f016126df565b8a519184010190612aa9818360208e016126df565b8951612abb8183850160208e016126df565b8951929091010190612ad1818360208c016126df565b8751612ae38183850160208c016126df565b8751929091010190612af9818360208a016126df565b8551612b0b8183850160208a016126df565b8551929091010190612b218183602088016126df565b019b9a5050505050505050505050565b7f7b226e616d65223a20224e6f742046616b6520525741205469746c6520230000815260008351612b6981601e8501602088016126df565b7f222c20226465736372697074696f6e223a202241204e6f742046616b65205257601e918401918201527f41207469746c652e2e2e206f6e6c79206f6e204672617874616c2e222c202269603e8201527f6d616765223a2022646174613a696d6167652f7376672b786d6c3b6261736536605e820152610d0b60f21b607e8201528351612bfd8160808401602088016126df565b61227d60f01b60809290910191820152608201949350505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000815260008251612c5081601d8501602087016126df565b91909101601d0192915050565b600060208284031215612c6f57600080fd5b815161108281612908565b634e487b7160e01b600052601160045260246000fd5b818103818111156105bf576105bf612c7a565b601f821115610b97576000816000526020600020601f850160051c81016020861015612ccc5750805b601f850160051c820191505b81811015612ceb57828155600101612cd8565b505050505050565b815167ffffffffffffffff811115612d0d57612d0d6127f8565b612d2181612d1b8454612a20565b84612ca3565b602080601f831160018114612d565760008415612d3e5750858301515b600019600386901b1c1916600185901b178555612ceb565b600085815260208120601f198616915b82811015612d8557888601518255948401946001909101908401612d66565b5085821015612da35787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060018201612dc557612dc5612c7a565b5060010190565b60008351612dde8184602088016126df565b835190830190612df28183602088016126df565b01949350505050565b80820281158282048414176105bf576105bf612c7a565b808201808211156105bf576105bf612c7a565b60008651612e37818460208b016126df565b865190830190612e4b818360208b016126df565b8651910190612e5e818360208a016126df565b8551910190612e718183602089016126df565b8451910190612e848183602088016126df565b01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b600082612eb557612eb5612e90565b500490565b600082612ec957612ec9612e90565b500690565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612f0190830184612703565b9695505050505050565b600060208284031215612f1d57600080fd5b8151611082816126ac565b634e487b7160e01b600052603160045260246000fd5b60008251612f508184602087016126df565b9190910192915050565b600181815b80851115612f95578160001904821115612f7b57612f7b612c7a565b80851615612f8857918102915b93841c9390800290612f5f565b509250929050565b600082612fac575060016105bf565b81612fb9575060006105bf565b8160018114612fcf5760028114612fd957612ff5565b60019150506105bf565b60ff841115612fea57612fea612c7a565b50506001821b6105bf565b5060208310610133831016604e8410600b8410161715613018575081810a6105bf565b6130228383612f5a565b806000190482111561303657613036612c7a565b029392505050565b60006110828383612f9d56fe42616e616e61205065656c3b4d616e73696f6e3b476174657761792050433b57617463683b486f6e64612043697669633b566964656f20436172643b48617264776172652057616c6c65743b536f636b3b5072696e7465723b41697264726f7020506f696e743b546f6f746862727573683b4c6c616d613b466c6f707079204469736b3b4a616c6f70793b4c6170746f703b4149204d6f64656c3b547261696e3b4169722046727965723b506f6b656d6f6e20436172643b414920526f626f742047463c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f73766722207072657365727665417370656374526174696f3d22784d696e594d696e206d656574222076696577426f783d223020302033353020333530223e3c7374796c653e2e626173652c746578747b666f6e742d66616d696c793a73657269667d2e626173657b666f6e742d73697a653a313470787d726563747b7374726f6b652d77696474683a327d3c2f7374796c653e3c726563742066696c7465723d2275726c2823776f62626c6529222077696474683d2239342522206865696768743d223635252220783d22322e35252220793d22313725222066696c6c3d2223656264666137222f3e3c646566733e3c7061747465726e2069643d227061747465726e312220783d22342220793d2234222077696474683d22323022206865696768743d223622207061747465726e556e6974733d227573657253706163654f6e557365223e3c70617468207374726f6b652d77696474683d223222207374796c653d227374726f6b653a236138393938333b66696c6c3a6e6f6e652220643d224d302030683230763348307a222f3e3c2f7061747465726e3e3c7061747465726e2069643d227061747465726e322220783d22342220793d222d34222077696474683d223622206865696768743d22323022207061747465726e556e6974733d227573657253706163654f6e557365223e3c70617468207374726f6b652d77696474683d223222207374796c653d227374726f6b653a236138393938333b66696c6c3a6e6f6e652220643d224d302030683376323048307a222f3e3c2f7061747465726e3e3c7061747465726e2069643d227061747465726e332220783d22342220793d2230222077696474683d223622206865696768743d22323022207061747465726e556e6974733d227573657253706163654f6e557365223e3c70617468207374726f6b652d77696474683d223222207374796c653d227374726f6b653a236138393938333b66696c6c3a6e6f6e652220643d224d302030683376323048307a222f3e3c2f7061747465726e3e3c7061747465726e2069643d227061747465726e342220783d22362220793d2234222077696474683d22323022206865696768743d223622207061747465726e556e6974733d227573657253706163654f6e557365223e3c70617468207374726f6b652d77696474683d223222207374796c653d227374726f6b653a236138393938333b66696c6c3a6e6f6e652220643d224d302030683230763348307a222f3e3c2f7061747465726e3e3c66696c7465722069643d22776f62626c65223e3c666554757262756c656e636520626173654672657175656e63793d222e30353222206e756d4f6374617665733d2233222f3e3c6665446973706c6163656d656e744d617020696e3d22536f757263654772617068696322207363616c653d223132222f3e3c2f66696c7465723e3c66696c7465722069643d22626f78223e3c666554757262756c656e636520626173654672657175656e63793d222e30313122206e756d4f6374617665733d223132222f3e3c6665446973706c6163656d656e744d617020696e3d22536f757263654772617068696322207363616c653d2231222f3e3c2f66696c7465723e3c636c6970506174682069643d226375742d6f66662d626f74746f6d223e3c7061746820643d224d313020363568333430763232354831307a222f3e3c2f636c6970506174683e3c2f646566733e3c7061746820636c69702d706174683d2275726c28236375742d6f66662d626f74746f6d29222066696c7465723d2275726c2823776f62626c652922207374726f6b653d222365666533613722207374726f6b652d77696474683d2234222066696c6c3d226e6f6e652220643d224d3130352036366135302035302030203120312d31362d343020313036203130362030203120312d3530203132362033302033302030203120312032302d31306d39372036346139362039362030203120312038302d3830222f3e3c7061746820636c69702d706174683d2275726c28236375742d6f66662d626f74746f6d29222066696c7465723d2275726c2823776f62626c652922207374726f6b653d222365386439613322207374726f6b652d77696474683d2234222066696c6c3d226e6f6e652220643d224d3230352031313061313530203335302030203120312d31322d343020323030203230302030203120312d35302031323020313330203133302030203120312032302d31306d39302032336139322039322030203120312038302d3830222f3e3c706174682066696c7465723d2275726c2823626f782922207374726f6b653d2223613839393833222066696c6c3d226e6f6e652220643d224d32342037356832307632304832347a222f3e3c706174682066696c7465723d2275726c2823626f782922207374726f6b652d77696474683d2232222066696c6c3d2275726c28237061747465726e32292220643d224d3530203735683235307632324835307a222f3e3c706174682066696c7465723d2275726c2823626f782922207374726f6b653d2223613839393833222066696c6c3d226e6f6e652220643d224d333036203735683230763230682d32307a222f3e3c706174682066696c7465723d2275726c2823626f782922207374726f6b653d22236e6f6e65222066696c6c3d2275726c28237061747465726e31292220643d224d3234203938683230763136304832347a222f3e3c706174682066696c7465723d2275726c2823626f782922207374726f6b653d2223613839393833222066696c6c3d226e6f6e652220643d224d3234203236306832307632304832347a222f3e3c706174682066696c7465723d2275726c2823626f782922207374726f6b652d77696474683d2232222066696c6c3d2275726c28237061747465726e33292220643d224d343820323630683235307632304834387a222f3e3c706174682066696c7465723d2275726c2823626f782922207374726f6b653d2223613839393833222066696c6c3d226e6f6e652220643d224d33303620323630683230763230682d32307a222f3e3c706174682066696c7465723d2275726c2823626f782922207374726f6b653d22236e6f6e65222066696c6c3d2275726c28237061747465726e34292220643d224d33303620393868323076313630682d32307a222f3e3c7465787420783d2235332220793d223131392220666f6e742d73697a653d223137222066696c6c3d2223333332333132223e204120286e6f742066616b6529205265616c20576f726c64204173736574205469746c653c2f746578743e3c7465787420783d2236302220793d223134392220666f6e742d73697a653d223132222066696c6c3d2223333332333132223e546869732045524337323120746f6b656e20697320746f206365727469667920746861742074686520686f6c646572203c2f746578743e3c7465787420793d223136372220783d223530252220646f6d696e616e742d626173656c696e653d226d6964646c652220746578742d616e63686f723d226d6964646c65222066696c6c3d22233333323331322220666f6e742d73697a653d223134223e3c636972636c652066696c7465723d2275726c2823776f62626c6529222063783d223239352e35222063793d223235352e352220723d223335222066696c6c3d2223333830613035222f3e3c636972636c652063783d223239372e35222063793d223235372e372220723d223330222066696c6c3d2223356531333061222f3e3c636972636c652063783d223239362e35222063793d223235362e372220723d223239222066696c6c3d2223366531333161222f3e3c636972636c652063783d223239352e35222063793d223235352e372220723d223238222066696c6c3d2223356531333061222f3e3c7465787420783d223238352220793d223234322e372220666f6e742d73697a653d223130222066696c6c3d2223376532333261223e5265616c3c2f746578743e3c7465787420783d223238352220793d223235332e372220666f6e742d73697a653d223130222066696c6c3d2223376532333261223e576f726c643c2f746578743e3c7465787420783d223238352220793d223236342e372220666f6e742d73697a653d223130222066696c6c3d2223376532333261223e4162733c2f746578743e3c7465787420783d223238352220793d223237362e372220666f6e742d73697a653d223130222066696c6c3d2223376532333261223e245257413c2f746578743e3c2f7376673e536d656c6c793b4672616772616e743b44656c6963696f75733b4f6c643b5368696e793b52757374793b506f6c69736865643b5072697374696e653b44697274793b53706963793b55676c793b506572666563743b4c6f7573793b46616b653b42726f6b656e3b5468726963652d757365643b5377656174793b53756363756c656e743b546869636b3b4d6f6973744142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f3c2f746578743e3c7465787420783d2236302220793d22313839222066696c6c3d22233333323331322220666f6e742d73697a653d223132223e68617320636f6d706c657465206f776e657273686970206f662074686520666f6c6c6f77696e67206974656d3a3c2f746578743e3c7465787420793d223232362220783d223530252220646f6d696e616e742d626173656c696e653d226d6964646c652220746578742d616e63686f723d226d6964646c65222066696c6c3d22233333323331322220666f6e742d73697a653d223137223e496e666c617461626c653b466f7265636c6f7365643b4c696d697465642045642e3b526164696f6163746976653b436f6c6c61707361626c653b50617065723b506c61737469633b48616c662d557365643b59656c6c6f776973683b546f793b4f66662d57686974653b5072616e6b3b44696c61706964617465643b4c65616b696e673b537469636b793b46757a7a793b476c65616d696e673b4472697070696e673b576f6f64656e3b53796e746865746963a2646970667358221220994affcbee094be09df2bfe0880ebce3d79f3c64f840fcd40924bfe27989865164736f6c63430008180033000000000000000000000000c84c0f36e42d0100c6ff5e1d04e2978f0a5b63cf

Deployed Bytecode

0x6080604052600436106101cd5760003560e01c80636352211e116100f7578063a760a29f11610095578063dac6db1c11610064578063dac6db1c14610526578063e985e9c514610544578063eac8f5b814610564578063fea347081461058457600080fd5b8063a760a29f146104ad578063b88d4fde146104c6578063c87b56dd146104e6578063d655fcf21461050657600080fd5b806395d89b41116100d157806395d89b411461043157806396336b301461044657806397426cbd1461047a578063a22cb4651461048d57600080fd5b80636352211e146103dc57806370a08231146103fc578063810b2aff1461041c57600080fd5b806317ec7f9e1161016f57806336acc9c91161013e57806336acc9c91461035c57806339c7639c1461037c57806342842e0e1461039c5780634f6ccce7146103bc57600080fd5b806317ec7f9e146102e357806318160ddd1461030757806323b872dd1461031c5780632f745c591461033c57600080fd5b8063095ea7b3116101ab578063095ea7b3146102615780630e89341c14610283578063172a56c1146102a3578063174029f6146102c357600080fd5b806301ffc9a7146101d257806306fdde0314610207578063081812fc14610229575b600080fd5b3480156101de57600080fd5b506101f26101ed3660046126c2565b61059a565b60405190151581526020015b60405180910390f35b34801561021357600080fd5b5061021c6105c5565b6040516101fe919061272f565b34801561023557600080fd5b50610249610244366004612742565b610657565b6040516001600160a01b0390911681526020016101fe565b34801561026d57600080fd5b5061028161027c366004612777565b610680565b005b34801561028f57600080fd5b5061021c61029e366004612742565b61068f565b3480156102af57600080fd5b5061021c6102be366004612742565b610835565b3480156102cf57600080fd5b5061021c6102de366004612742565b61090b565b3480156102ef57600080fd5b506102f9611f4081565b6040519081526020016101fe565b34801561031357600080fd5b506008546102f9565b34801561032857600080fd5b506102816103373660046127a1565b610962565b34801561034857600080fd5b506102f9610357366004612777565b6109f2565b34801561036857600080fd5b50610281610377366004612742565b610a57565b34801561038857600080fd5b506101f2610397366004612742565b610b69565b3480156103a857600080fd5b506102816103b73660046127a1565b610b7c565b3480156103c857600080fd5b506102f96103d7366004612742565b610b9c565b3480156103e857600080fd5b506102496103f7366004612742565b610bf5565b34801561040857600080fd5b506102f96104173660046127dd565b610c00565b34801561042857600080fd5b506102f9610c48565b34801561043d57600080fd5b5061021c610c5f565b34801561045257600080fd5b506102497f000000000000000000000000c84c0f36e42d0100c6ff5e1d04e2978f0a5b63cf81565b6102816104883660046128a4565b610c6e565b34801561049957600080fd5b506102816104a8366004612916565b610ff2565b3480156104b957600080fd5b50600c54611f40146101f2565b3480156104d257600080fd5b506102816104e136600461294d565b610ffd565b3480156104f257600080fd5b5061021c610501366004612742565b611014565b34801561051257600080fd5b506102816105213660046129c9565b611089565b34801561053257600080fd5b506102f96969e10de76676d080000081565b34801561055057600080fd5b506101f261055f3660046129ed565b6112fa565b34801561057057600080fd5b5061021c61057f366004612742565b611328565b34801561059057600080fd5b506102f9600c5481565b60006001600160e01b0319821663780e9d6360e01b14806105bf57506105bf8261145c565b92915050565b6060600080546105d490612a20565b80601f016020809104026020016040519081016040528092919081815260200182805461060090612a20565b801561064d5780601f106106225761010080835404028352916020019161064d565b820191906000526020600020905b81548152906001019060200180831161063057829003601f168201915b5050505050905090565b6000610662826114ac565b506000828152600460205260409020546001600160a01b03166105bf565b61068b8282336114e5565b5050565b6060610699612684565b60405180610aa00160405280610a63815260200161310e610a63913981526106c083610835565b60208281019190915260408051808201825260018152600160fd1b928101929092528201526106ee8361090b565b606082015260408051610100810190915260d2808252613e346020830139608082015261071a83611328565b60a082015260408051808201825260078152661e17ba32bc3a1f60c91b60208083019190915260c0840191909152815180820183526000815260e0840152815161022081019092526101f480835290613b7190830139610100820181905281516020808401516040808601516060870151608088015160a089015160c08a015160e08b0151955160009a6107bc9a999697959694959394929392909101612a70565b604051602081830303815290604052905060006108096107db866114f2565b6107e4846115fb565b6040516020016107f5929190612b31565b6040516020818303038152906040526115fb565b90508060405160200161081c9190612c18565b60408051601f1981840301815291905295945050505050565b6000818152600f602052604090205460609060ff16156108ed576000828152600d60205260409020805461086890612a20565b80601f016020809104026020016040519081016040528092919081815260200182805461089490612a20565b80156108e15780601f106108b6576101008083540402835291602001916108e1565b820191906000526020600020905b8154815290600101906020018083116108c457829003601f168201915b50505050509050919050565b5050604080518082019091526002815261209760f11b602082015290565b6000818152600f602052604090205460609060ff161561093e576000828152600e60205260409020805461086890612a20565b50506040805180820190915260088152674e6f6e796d6f757360c01b602082015290565b6001600160a01b03821661099157604051633250574960e11b8152600060048201526024015b60405180910390fd5b600061099e838333611765565b9050836001600160a01b0316816001600160a01b0316146109ec576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610988565b50505050565b60006109fd83610c00565b8210610a2e5760405163295f44f760e21b81526001600160a01b038416600482015260248101839052604401610988565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b610a5f611832565b33610a6982610bf5565b6001600160a01b031614610ab85760405162461bcd60e51b8152602060048201526016602482015275139bdd081bdddb995c881b9bdc88185c1c1c9bdd995960521b6044820152606401610988565b610ac18161185c565b60405163a9059cbb60e01b81523360048201526969e10de76676d080000060248201527f000000000000000000000000c84c0f36e42d0100c6ff5e1d04e2978f0a5b63cf6001600160a01b03169063a9059cbb906044016020604051808303816000875af1158015610b37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5b9190612c5d565b50610b666001600a55565b50565b600080610b7533610c00565b1192915050565b610b9783838360405180602001604052806000815250610ffd565b505050565b6000610ba760085490565b8210610bd05760405163295f44f760e21b81526000600482015260248101839052604401610988565b60088281548110610be357610be3612a5a565b90600052602060002001549050919050565b60006105bf826114ac565b60006001600160a01b038216610c2c576040516322718ad960e21b815260006004820152602401610988565b506001600160a01b031660009081526003602052604090205490565b6000600c54611f40610c5a9190612c90565b905090565b6060600180546105d490612a20565b610c76610c48565b60011115610ce25760405162461bcd60e51b815260206004820152603360248201527f507572636861736520616d6f756e742069732067726561746572207468616e2060448201527274686520746f6b656e20617661696c61626c6560681b6064820152608401610988565b6015610ced83611897565b10610d4a5760405162461bcd60e51b815260206004820152602760248201527f4669727374206e616d65206d75737420626520756e646572203231206368617260448201526630b1ba32b9399760c91b6064820152608401610988565b6015610d5582611897565b10610db15760405162461bcd60e51b815260206004820152602660248201527f4c617374206e616d65206d75737420626520756e64657220323120636861726160448201526531ba32b9399760d11b6064820152608401610988565b610dba826119c8565b158015610dcd5750610dcb816119c8565b155b610e2b5760405162461bcd60e51b815260206004820152602960248201527f496e70757420636f6e7461696e7320696e76616c6964206368617261637465726044820152687320283c3e2227262960b81b6064820152608401610988565b6040516323b872dd60e01b81523360048201523060248201526969e10de76676d080000060448201527f000000000000000000000000c84c0f36e42d0100c6ff5e1d04e2978f0a5b63cf6001600160a01b0316906323b872dd906064016020604051808303816000875af1158015610ea7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ecb9190612c5d565b610f0c5760405162461bcd60e51b8152602060048201526012602482015271496e73756666696369656e742066756e647360701b6044820152606401610988565b610f1582611897565b158015610f285750610f2681611897565b155b15610f6e5760405180604001604052806002815260200161209760f11b8152509150604051806040016040528060088152602001674e6f6e796d6f757360c01b81525090505b6000600c549050610f8f338260405180602001604052806000815250611a85565b6000818152600d60205260409020610fa78482612cf3565b506000818152600e60205260409020610fc08382612cf3565b506000818152600f60205260408120805460ff19166001179055600c805491610fe883612db3565b9190505550505050565b61068b338383611a9c565b611008848484610962565b6109ec84848484611b3b565b606061101f826114ac565b50600061103760408051602081019091526000815290565b905060008151116110575760405180602001604052806000815250611082565b8061106184611c64565b604051602001611072929190612dcc565b6040516020818303038152906040525b9392505050565b60008161ffff16116110e85760405162461bcd60e51b815260206004820152602260248201527f4d696e696d756d203120746f6b656e73206e65656420746f206265206d696e74604482015261195960f21b6064820152608401610988565b6110f0610c48565b8161ffff16111561115e5760405162461bcd60e51b815260206004820152603260248201527f507572636861736520616d6f756e742069732067726561746572207468616e20604482015271746865205257417320617661696c61626c6560701b6064820152608401610988565b60148161ffff1611156111a35760405162461bcd60e51b815260206004820152600d60248201526c4d6178203230205469746c657360981b6044820152606401610988565b6001600160a01b037f000000000000000000000000c84c0f36e42d0100c6ff5e1d04e2978f0a5b63cf166323b872dd33306111ec61ffff86166969e10de76676d0800000612dfb565b6040516001600160e01b031960e086901b1681526001600160a01b03938416600482015292909116602483015260448201526064016020604051808303816000875af1158015611240573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112649190612c5d565b6112a55760405162461bcd60e51b8152602060048201526012602482015271496e73756666696369656e742066756e647360701b6044820152606401610988565b60005b8161ffff168161ffff16101561068b576000600c5490506112d9338260405180602001604052806000815250611a85565b6001600c60008282546112ec9190612e12565b9091555050506001016112a8565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6060600061137483604051806040016040528060098152602001683334b939ba2fb0b23560b91b8152506040518060c00160405280608f8152602001613d65608f913960146000611cf7565b905060006113c1846040518060400160405280600a81526020016939b2b1b7b7322fb0b23560b11b8152506040518060e0016040528060b38152602001613f0660b3913960146000611cf7565b90506000604051806040016040528060018152602001600160fd1b8152509050600061142786604051806040016040528060048152602001633737bab760e11b81525060405180610100016040528060c3815260200161304b60c3913960146000611cf7565b90508382848484604051602001611442959493929190612e25565b604051602081830303815290604052945050505050919050565b60006001600160e01b031982166380ac58cd60e01b148061148d57506001600160e01b03198216635b5e139f60e01b145b806105bf57506301ffc9a760e01b6001600160e01b03198316146105bf565b6000818152600260205260408120546001600160a01b0316806105bf57604051637e27328960e01b815260048101849052602401610988565b610b978383836001611d4d565b6060816000036115195750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611543578061152d81612db3565b915061153c9050600a83612ea6565b915061151d565b60008167ffffffffffffffff81111561155e5761155e6127f8565b6040519080825280601f01601f191660200182016040528015611588576020820181803683370190505b5090505b84156115f35761159d600183612c90565b91506115aa600a86612eba565b6115b5906030612e12565b60f81b8183815181106115ca576115ca612a5a565b60200101906001600160f81b031916908160001a9053506115ec600a86612ea6565b945061158c565b949350505050565b8051606090600081900361161f575050604080516020810190915260008152919050565b6000600361162e836002612e12565b6116389190612ea6565b611643906004612dfb565b90506000611652826020612e12565b67ffffffffffffffff81111561166a5761166a6127f8565b6040519080825280601f01601f191660200182016040528015611694576020820181803683370190505b5090506000604051806060016040528060408152602001613df4604091399050600181016020830160005b86811015611720576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b8352600490920191016116bf565b50600386066001811461173a576002811461174b57611757565b613d3d60f01b600119830152611757565b603d60f81b6000198301525b505050918152949350505050565b600080611773858585611e53565b90506001600160a01b0381166117d0576117cb84600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b6117f3565b846001600160a01b0316816001600160a01b0316146117f3576117f38185611f4c565b6001600160a01b03851661180f5761180a84611fdd565b6115f3565b846001600160a01b0316816001600160a01b0316146115f3576115f3858561208c565b6002600a540361185557604051633ee5aeb560e01b815260040160405180910390fd5b6002600a55565b600061186b6000836000611765565b90506001600160a01b03811661068b57604051637e27328960e01b815260048101839052602401610988565b600080825b80518210156119c15760078183815181106118b9576118b9612a5a565b01602001516001600160f81b031990811690911c166000036118e7576118e0600183612e12565b91506119af565b60058183815181106118fb576118fb612a5a565b01602001516001600160f81b031990811690911c16600360f91b03611925576118e0600283612e12565b600481838151811061193957611939612a5a565b01602001516001600160f81b031990811690911c16600760f91b03611963576118e0600383612e12565b600381838151811061197757611977612a5a565b01602001516001600160f81b031990811690911c16600f60f91b036119a1576118e0600483612e12565b6119ac600183612e12565b91505b826119b981612db3565b93505061189c565b5050919050565b600081815b8151811015611a7b5760008282815181106119ea576119ea612a5a565b01602001516001600160f81b0319169050600f60fa1b811480611a1a5750601f60f91b6001600160f81b03198216145b80611a325750601160f91b6001600160f81b03198216145b80611a4a5750602760f81b6001600160f81b03198216145b80611a625750601360f91b6001600160f81b03198216145b15611a7257506001949350505050565b506001016119cd565b5060009392505050565b611a8f83836120dc565b610b976000848484611b3b565b6001600160a01b038216611ace57604051630b61174360e31b81526001600160a01b0383166004820152602401610988565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b156109ec57604051630a85bd0160e11b81526001600160a01b0384169063150b7a0290611b7d903390889087908790600401612ece565b6020604051808303816000875af1925050508015611bb8575060408051601f3d908101601f19168201909252611bb591810190612f0b565b60015b611c21573d808015611be6576040519150601f19603f3d011682016040523d82523d6000602084013e611beb565b606091505b508051600003611c1957604051633250574960e11b81526001600160a01b0385166004820152602401610988565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b14611c5d57604051633250574960e11b81526001600160a01b0385166004820152602401610988565b5050505050565b60606000611c7183612141565b600101905060008167ffffffffffffffff811115611c9157611c916127f8565b6040519080825280601f01601f191660200182016040528015611cbb576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611cc557509392505050565b60606000611d2d86611d0889611c64565b604051602001611d19929190612dcc565b604051602081830303815290604052612219565b9050611d4285611d3d8684612eba565b61224a565b979650505050505050565b8080611d6157506001600160a01b03821615155b15611e23576000611d71846114ac565b90506001600160a01b03831615801590611d9d5750826001600160a01b0316816001600160a01b031614155b8015611db05750611dae81846112fa565b155b15611dd95760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610988565b8115611e215783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b6000828152600260205260408120546001600160a01b0390811690831615611e8057611e80818486612303565b6001600160a01b03811615611ebe57611e9d600085600080611d4d565b6001600160a01b038116600090815260036020526040902080546000190190555b6001600160a01b03851615611eed576001600160a01b0385166000908152600360205260409020805460010190555b60008481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b6000611f5783610c00565b600083815260076020526040902054909150808214611faa576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090611fef90600190612c90565b6000838152600960205260408120546008805493945090928490811061201757612017612a5a565b90600052602060002001549050806008838154811061203857612038612a5a565b600091825260208083209091019290925582815260099091526040808220849055858252812055600880548061207057612070612f28565b6001900381819060005260206000200160009055905550505050565b6000600161209984610c00565b6120a39190612c90565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6001600160a01b03821661210657604051633250574960e11b815260006004820152602401610988565b600061211483836000611765565b90506001600160a01b03811615610b97576040516339e3563760e11b815260006004820152602401610988565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106121805772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106121ac576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106121ca57662386f26fc10000830492506010015b6305f5e10083106121e2576305f5e100830492506008015b61271083106121f657612710830492506004015b60648310612208576064830492506002015b600a83106105bf5760010192915050565b60008160405160200161222c9190612f3e565b60408051601f19818403018152919052805160209091012092915050565b6060600061227f8460408051808201825260008082526020918201528151808301909252825182529182019181019190915290565b60408051808201825260018152603b60f81b6020808301918252835180850185526000808252908201819052845180860186528451815280830193909352845180860190955280855290840152929350919060005b8681116122f9576122e58584612367565b9150806122f181612db3565b9150506122d4565b50611d428161238d565b61230e8383836123f6565b610b97576001600160a01b03831661233c57604051637e27328960e01b815260048101829052602401610988565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610988565b6040805180820190915260008082526020820152612386838383612459565b5092915050565b60606000826000015167ffffffffffffffff8111156123ae576123ae6127f8565b6040519080825280601f01601f1916602001820160405280156123d8576020820181803683370190505b50905060006020820190506123868185602001518660000151612504565b60006001600160a01b038316158015906115f35750826001600160a01b0316846001600160a01b03161480612430575061243084846112fa565b806115f35750506000908152600460205260409020546001600160a01b03908116911614919050565b6040805180820190915260008082526020820152600061248b8560000151866020015186600001518760200151612575565b6020808701805191860191909152519091506124a79082612c90565b8352845160208601516124ba9190612e12565b81036124c957600085526124fb565b835183516124d79190612e12565b855186906124e6908390612c90565b90525083516124f59082612e12565b60208601525b50909392505050565b6020811061253c578151835261251b602084612e12565b9250612528602083612e12565b9150612535602082612c90565b9050612504565b6000600161254b836020612c90565b6125579061010061303e565b6125619190612c90565b925184518416931916929092179092525050565b6000838186851161267a57602085116126295760006001612597876020612c90565b6125a2906008612dfb565b6125ad90600261303e565b6125b79190612c90565b85519019915081166000876125cc8b8b612e12565b6125d69190612c90565b855190915083165b82811461261b57818610612603576125f68b8b612e12565b96505050505050506115f3565b8561260d81612db3565b9650508386511690506125de565b8596505050505050506115f3565b508383206000905b61263b8689612c90565b82116126785785832080820361265757839450505050506115f3565b612662600185612e12565b935050818061267090612db3565b925050612631565b505b611d428787612e12565b6040518061012001604052806009905b60608152602001906001900390816126945790505090565b6001600160e01b031981168114610b6657600080fd5b6000602082840312156126d457600080fd5b8135611082816126ac565b60005b838110156126fa5781810151838201526020016126e2565b50506000910152565b6000815180845261271b8160208601602086016126df565b601f01601f19169290920160200192915050565b6020815260006110826020830184612703565b60006020828403121561275457600080fd5b5035919050565b80356001600160a01b038116811461277257600080fd5b919050565b6000806040838503121561278a57600080fd5b6127938361275b565b946020939093013593505050565b6000806000606084860312156127b657600080fd5b6127bf8461275b565b92506127cd6020850161275b565b9150604084013590509250925092565b6000602082840312156127ef57600080fd5b6110828261275b565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff80841115612829576128296127f8565b604051601f8501601f19908116603f01168101908282118183101715612851576128516127f8565b8160405280935085815286868601111561286a57600080fd5b858560208301376000602087830101525050509392505050565b600082601f83011261289557600080fd5b6110828383356020850161280e565b600080604083850312156128b757600080fd5b823567ffffffffffffffff808211156128cf57600080fd5b6128db86838701612884565b935060208501359150808211156128f157600080fd5b506128fe85828601612884565b9150509250929050565b8015158114610b6657600080fd5b6000806040838503121561292957600080fd5b6129328361275b565b9150602083013561294281612908565b809150509250929050565b6000806000806080858703121561296357600080fd5b61296c8561275b565b935061297a6020860161275b565b925060408501359150606085013567ffffffffffffffff81111561299d57600080fd5b8501601f810187136129ae57600080fd5b6129bd8782356020840161280e565b91505092959194509250565b6000602082840312156129db57600080fd5b813561ffff8116811461108257600080fd5b60008060408385031215612a0057600080fd5b612a098361275b565b9150612a176020840161275b565b90509250929050565b600181811c90821680612a3457607f821691505b602082108103612a5457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b60008a51612a82818460208f016126df565b8a51612a948183860160208f016126df565b8a519184010190612aa9818360208e016126df565b8951612abb8183850160208e016126df565b8951929091010190612ad1818360208c016126df565b8751612ae38183850160208c016126df565b8751929091010190612af9818360208a016126df565b8551612b0b8183850160208a016126df565b8551929091010190612b218183602088016126df565b019b9a5050505050505050505050565b7f7b226e616d65223a20224e6f742046616b6520525741205469746c6520230000815260008351612b6981601e8501602088016126df565b7f222c20226465736372697074696f6e223a202241204e6f742046616b65205257601e918401918201527f41207469746c652e2e2e206f6e6c79206f6e204672617874616c2e222c202269603e8201527f6d616765223a2022646174613a696d6167652f7376672b786d6c3b6261736536605e820152610d0b60f21b607e8201528351612bfd8160808401602088016126df565b61227d60f01b60809290910191820152608201949350505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000815260008251612c5081601d8501602087016126df565b91909101601d0192915050565b600060208284031215612c6f57600080fd5b815161108281612908565b634e487b7160e01b600052601160045260246000fd5b818103818111156105bf576105bf612c7a565b601f821115610b97576000816000526020600020601f850160051c81016020861015612ccc5750805b601f850160051c820191505b81811015612ceb57828155600101612cd8565b505050505050565b815167ffffffffffffffff811115612d0d57612d0d6127f8565b612d2181612d1b8454612a20565b84612ca3565b602080601f831160018114612d565760008415612d3e5750858301515b600019600386901b1c1916600185901b178555612ceb565b600085815260208120601f198616915b82811015612d8557888601518255948401946001909101908401612d66565b5085821015612da35787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060018201612dc557612dc5612c7a565b5060010190565b60008351612dde8184602088016126df565b835190830190612df28183602088016126df565b01949350505050565b80820281158282048414176105bf576105bf612c7a565b808201808211156105bf576105bf612c7a565b60008651612e37818460208b016126df565b865190830190612e4b818360208b016126df565b8651910190612e5e818360208a016126df565b8551910190612e718183602089016126df565b8451910190612e848183602088016126df565b01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b600082612eb557612eb5612e90565b500490565b600082612ec957612ec9612e90565b500690565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612f0190830184612703565b9695505050505050565b600060208284031215612f1d57600080fd5b8151611082816126ac565b634e487b7160e01b600052603160045260246000fd5b60008251612f508184602087016126df565b9190910192915050565b600181815b80851115612f95578160001904821115612f7b57612f7b612c7a565b80851615612f8857918102915b93841c9390800290612f5f565b509250929050565b600082612fac575060016105bf565b81612fb9575060006105bf565b8160018114612fcf5760028114612fd957612ff5565b60019150506105bf565b60ff841115612fea57612fea612c7a565b50506001821b6105bf565b5060208310610133831016604e8410600b8410161715613018575081810a6105bf565b6130228383612f5a565b806000190482111561303657613036612c7a565b029392505050565b60006110828383612f9d56fe42616e616e61205065656c3b4d616e73696f6e3b476174657761792050433b57617463683b486f6e64612043697669633b566964656f20436172643b48617264776172652057616c6c65743b536f636b3b5072696e7465723b41697264726f7020506f696e743b546f6f746862727573683b4c6c616d613b466c6f707079204469736b3b4a616c6f70793b4c6170746f703b4149204d6f64656c3b547261696e3b4169722046727965723b506f6b656d6f6e20436172643b414920526f626f742047463c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f73766722207072657365727665417370656374526174696f3d22784d696e594d696e206d656574222076696577426f783d223020302033353020333530223e3c7374796c653e2e626173652c746578747b666f6e742d66616d696c793a73657269667d2e626173657b666f6e742d73697a653a313470787d726563747b7374726f6b652d77696474683a327d3c2f7374796c653e3c726563742066696c7465723d2275726c2823776f62626c6529222077696474683d2239342522206865696768743d223635252220783d22322e35252220793d22313725222066696c6c3d2223656264666137222f3e3c646566733e3c7061747465726e2069643d227061747465726e312220783d22342220793d2234222077696474683d22323022206865696768743d223622207061747465726e556e6974733d227573657253706163654f6e557365223e3c70617468207374726f6b652d77696474683d223222207374796c653d227374726f6b653a236138393938333b66696c6c3a6e6f6e652220643d224d302030683230763348307a222f3e3c2f7061747465726e3e3c7061747465726e2069643d227061747465726e322220783d22342220793d222d34222077696474683d223622206865696768743d22323022207061747465726e556e6974733d227573657253706163654f6e557365223e3c70617468207374726f6b652d77696474683d223222207374796c653d227374726f6b653a236138393938333b66696c6c3a6e6f6e652220643d224d302030683376323048307a222f3e3c2f7061747465726e3e3c7061747465726e2069643d227061747465726e332220783d22342220793d2230222077696474683d223622206865696768743d22323022207061747465726e556e6974733d227573657253706163654f6e557365223e3c70617468207374726f6b652d77696474683d223222207374796c653d227374726f6b653a236138393938333b66696c6c3a6e6f6e652220643d224d302030683376323048307a222f3e3c2f7061747465726e3e3c7061747465726e2069643d227061747465726e342220783d22362220793d2234222077696474683d22323022206865696768743d223622207061747465726e556e6974733d227573657253706163654f6e557365223e3c70617468207374726f6b652d77696474683d223222207374796c653d227374726f6b653a236138393938333b66696c6c3a6e6f6e652220643d224d302030683230763348307a222f3e3c2f7061747465726e3e3c66696c7465722069643d22776f62626c65223e3c666554757262756c656e636520626173654672657175656e63793d222e30353222206e756d4f6374617665733d2233222f3e3c6665446973706c6163656d656e744d617020696e3d22536f757263654772617068696322207363616c653d223132222f3e3c2f66696c7465723e3c66696c7465722069643d22626f78223e3c666554757262756c656e636520626173654672657175656e63793d222e30313122206e756d4f6374617665733d223132222f3e3c6665446973706c6163656d656e744d617020696e3d22536f757263654772617068696322207363616c653d2231222f3e3c2f66696c7465723e3c636c6970506174682069643d226375742d6f66662d626f74746f6d223e3c7061746820643d224d313020363568333430763232354831307a222f3e3c2f636c6970506174683e3c2f646566733e3c7061746820636c69702d706174683d2275726c28236375742d6f66662d626f74746f6d29222066696c7465723d2275726c2823776f62626c652922207374726f6b653d222365666533613722207374726f6b652d77696474683d2234222066696c6c3d226e6f6e652220643d224d3130352036366135302035302030203120312d31362d343020313036203130362030203120312d3530203132362033302033302030203120312032302d31306d39372036346139362039362030203120312038302d3830222f3e3c7061746820636c69702d706174683d2275726c28236375742d6f66662d626f74746f6d29222066696c7465723d2275726c2823776f62626c652922207374726f6b653d222365386439613322207374726f6b652d77696474683d2234222066696c6c3d226e6f6e652220643d224d3230352031313061313530203335302030203120312d31322d343020323030203230302030203120312d35302031323020313330203133302030203120312032302d31306d39302032336139322039322030203120312038302d3830222f3e3c706174682066696c7465723d2275726c2823626f782922207374726f6b653d2223613839393833222066696c6c3d226e6f6e652220643d224d32342037356832307632304832347a222f3e3c706174682066696c7465723d2275726c2823626f782922207374726f6b652d77696474683d2232222066696c6c3d2275726c28237061747465726e32292220643d224d3530203735683235307632324835307a222f3e3c706174682066696c7465723d2275726c2823626f782922207374726f6b653d2223613839393833222066696c6c3d226e6f6e652220643d224d333036203735683230763230682d32307a222f3e3c706174682066696c7465723d2275726c2823626f782922207374726f6b653d22236e6f6e65222066696c6c3d2275726c28237061747465726e31292220643d224d3234203938683230763136304832347a222f3e3c706174682066696c7465723d2275726c2823626f782922207374726f6b653d2223613839393833222066696c6c3d226e6f6e652220643d224d3234203236306832307632304832347a222f3e3c706174682066696c7465723d2275726c2823626f782922207374726f6b652d77696474683d2232222066696c6c3d2275726c28237061747465726e33292220643d224d343820323630683235307632304834387a222f3e3c706174682066696c7465723d2275726c2823626f782922207374726f6b653d2223613839393833222066696c6c3d226e6f6e652220643d224d33303620323630683230763230682d32307a222f3e3c706174682066696c7465723d2275726c2823626f782922207374726f6b653d22236e6f6e65222066696c6c3d2275726c28237061747465726e34292220643d224d33303620393868323076313630682d32307a222f3e3c7465787420783d2235332220793d223131392220666f6e742d73697a653d223137222066696c6c3d2223333332333132223e204120286e6f742066616b6529205265616c20576f726c64204173736574205469746c653c2f746578743e3c7465787420783d2236302220793d223134392220666f6e742d73697a653d223132222066696c6c3d2223333332333132223e546869732045524337323120746f6b656e20697320746f206365727469667920746861742074686520686f6c646572203c2f746578743e3c7465787420793d223136372220783d223530252220646f6d696e616e742d626173656c696e653d226d6964646c652220746578742d616e63686f723d226d6964646c65222066696c6c3d22233333323331322220666f6e742d73697a653d223134223e3c636972636c652066696c7465723d2275726c2823776f62626c6529222063783d223239352e35222063793d223235352e352220723d223335222066696c6c3d2223333830613035222f3e3c636972636c652063783d223239372e35222063793d223235372e372220723d223330222066696c6c3d2223356531333061222f3e3c636972636c652063783d223239362e35222063793d223235362e372220723d223239222066696c6c3d2223366531333161222f3e3c636972636c652063783d223239352e35222063793d223235352e372220723d223238222066696c6c3d2223356531333061222f3e3c7465787420783d223238352220793d223234322e372220666f6e742d73697a653d223130222066696c6c3d2223376532333261223e5265616c3c2f746578743e3c7465787420783d223238352220793d223235332e372220666f6e742d73697a653d223130222066696c6c3d2223376532333261223e576f726c643c2f746578743e3c7465787420783d223238352220793d223236342e372220666f6e742d73697a653d223130222066696c6c3d2223376532333261223e4162733c2f746578743e3c7465787420783d223238352220793d223237362e372220666f6e742d73697a653d223130222066696c6c3d2223376532333261223e245257413c2f746578743e3c2f7376673e536d656c6c793b4672616772616e743b44656c6963696f75733b4f6c643b5368696e793b52757374793b506f6c69736865643b5072697374696e653b44697274793b53706963793b55676c793b506572666563743b4c6f7573793b46616b653b42726f6b656e3b5468726963652d757365643b5377656174793b53756363756c656e743b546869636b3b4d6f6973744142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f3c2f746578743e3c7465787420783d2236302220793d22313839222066696c6c3d22233333323331322220666f6e742d73697a653d223132223e68617320636f6d706c657465206f776e657273686970206f662074686520666f6c6c6f77696e67206974656d3a3c2f746578743e3c7465787420793d223232362220783d223530252220646f6d696e616e742d626173656c696e653d226d6964646c652220746578742d616e63686f723d226d6964646c65222066696c6c3d22233333323331322220666f6e742d73697a653d223137223e496e666c617461626c653b466f7265636c6f7365643b4c696d697465642045642e3b526164696f6163746976653b436f6c6c61707361626c653b50617065723b506c61737469633b48616c662d557365643b59656c6c6f776973683b546f793b4f66662d57686974653b5072616e6b3b44696c61706964617465643b4c65616b696e673b537469636b793b46757a7a793b476c65616d696e673b4472697070696e673b576f6f64656e3b53796e746865746963a2646970667358221220994affcbee094be09df2bfe0880ebce3d79f3c64f840fcd40924bfe27989865164736f6c63430008180033

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

000000000000000000000000c84c0f36e42d0100c6ff5e1d04e2978f0a5b63cf

-----Decoded View---------------
Arg [0] : _payToken (address): 0xc84c0f36e42D0100c6FF5e1D04e2978f0A5B63Cf

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000c84c0f36e42d0100c6ff5e1d04e2978f0a5b63cf


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.