ETH Price: $2,808.17 (-5.10%)
 

Overview

Max Total Supply

302,104 ALBUM

Holders

23,332

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A

Other Info

Filtered by Token Holder
travelsjoy.base.eth
Balance
2 ALBUM
0x0029E3b212C5a0277DdE199703b2A9E945e16782
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information

Contract Source Code Verified (Exact Match)

Contract Name:
TokenMirror

Compiler Version
v0.8.25+commit.b61c2a91

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.25;

import "dn404/DN404Mirror.sol";
import "solady/tokens/ERC2981.sol";
import "nft-metadata-renderer/NFTMetadataRenderer.sol";

import "./interfaces/IToken.sol";
import "./interfaces/ITokenMirror.sol";
import "./interfaces/IERC7572.sol";
import "./interfaces/IERC4906.sol";
import "./interfaces/IERC20.sol";

contract TokenMirror is
    ITokenMirror,
    TokenMirrorEvents,
    DN404Mirror,
    ERC2981,
    IERC7572,
    IERC4906
{
    TokenConfig private _tokenConfig;

    address private immutable _entropy;

    constructor(
        address deployer,
        uint16 royaltyBPS_,
        address royaltyRecipient_,
        TokenConfig memory tokenConfig_
    ) DN404Mirror(deployer) {
        _setDefaultRoyalty(royaltyRecipient_, royaltyBPS_);
        _tokenConfig = tokenConfig_;
        emit ContractURIUpdated();
    }

    modifier onlyBaseERC20() {
        if (msg.sender != _getDN404NFTStorage().baseERC20) {
            revert Unauthorized();
        }
        _;
    }

    function upsertMedia(
        string calldata credits_,
        string calldata decryptionKeysURL_,
        string calldata tokenImageURL_
    ) external override onlyBaseERC20 {
        if (bytes(credits_).length > 0) {
            _tokenConfig.credits = credits_;
            emit ContractURIUpdated();
        }

        if (bytes(decryptionKeysURL_).length > 0)
            _tokenConfig.decryptionKeysURL = decryptionKeysURL_;

        if (bytes(tokenImageURL_).length > 0) {
            _tokenConfig.tokenImageURL = tokenImageURL_;

            uint256 _totalSupply = totalSupply();
            if (_totalSupply > 0) {
                emit BatchMetadataUpdate(1, _totalSupply);
            }
        }

        emit MediaUpdated(credits_, decryptionKeysURL_, tokenImageURL_);
    }

    function tokenURI(
        uint256 tokenId
    ) public view override returns (string memory) {
        ownerOf(tokenId);

        address base = _getDN404NFTStorage().baseERC20;

        uint8 score = IToken(base).getScore(tokenId);

        NFTMetadataRenderer.Field[]
            memory attributeFields = new NFTMetadataRenderer.Field[](2);
        attributeFields[1] = NFTMetadataRenderer.Field("trait_type", "SWORDS");
        attributeFields[0] = NFTMetadataRenderer.Field(
            "value",
            LibString.repeat(unicode"⚔️", score)
        );
        string memory attributesData = string(
            abi.encodePacked(
                "{",
                NFTMetadataRenderer.fieldData(attributeFields),
                "}"
            )
        );

        return
            string(
                NFTMetadataRenderer.tokenURIMetadata(
                    IERC20(base).name(),
                    _tokenConfig.description,
                    _tokenURIFields(score),
                    attributesData,
                    tokenId,
                    0
                )
            );
    }

    function contractURI() public view returns (string memory) {
        NFTMetadataRenderer.Field[]
            memory mediaFields = new NFTMetadataRenderer.Field[](3);
        mediaFields[2] = NFTMetadataRenderer.Field({
            name: "image",
            value: _tokenConfig.contractImageURL
        });
        mediaFields[1] = NFTMetadataRenderer.Field({
            name: "external_link",
            value: _tokenConfig.externalURL
        });
        mediaFields[0] = NFTMetadataRenderer.Field({
            name: "credits",
            value: _tokenConfig.credits
        });

        (address royaltyRecipient, uint256 royaltyBPS) = royaltyInfo(1, 10_000);

        return
            string(
                NFTMetadataRenderer.contractURIMetadata(
                    IERC20(_getDN404NFTStorage().baseERC20).name(),
                    _tokenConfig.description,
                    mediaFields,
                    royaltyBPS,
                    royaltyRecipient
                )
            );
    }

    function refreshMetadata(
        uint256 _fromTokenId,
        uint256 _toTokenId
    ) external onlyBaseERC20 {
        emit BatchMetadataUpdate(_fromTokenId, _toTokenId);
    }

    function supportsInterface(
        bytes4 interfaceId
    ) public pure override(DN404Mirror, ERC2981) returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            let s := shr(224, interfaceId)
            // ERC165: 0x01ffc9a7, ERC721: 0x80ac58cd, ERC721Metadata: 0x5b5e139f, ERC2981: 0x2a55205a, ERC4906: 0x49064906, ERC7572:0xe8a3d485
            result := or(
                or(eq(s, 0x01ffc9a7), eq(s, 0x80ac58cd)),
                or(eq(s, 0x5b5e139f), or(eq(s, 0x2a55205a), eq(s, 0xe8a3d485)))
            )
        }
    }

    function _tokenURIFields(
        uint8 score
    ) internal view returns (NFTMetadataRenderer.Field[] memory) {
        NFTMetadataRenderer.Field[]
            memory mediaFields = new NFTMetadataRenderer.Field[](3);
        mediaFields[0] = NFTMetadataRenderer.Field({
            name: "decryption_keys_url",
            value: _tokenConfig.decryptionKeysURL
        });
        mediaFields[1] = NFTMetadataRenderer.Field({
            name: "encrypted_album_url",
            value: _tokenConfig.encryptedAlbumURL
        });
        mediaFields[2] = NFTMetadataRenderer.Field({
            name: "image",
            value: string.concat(
                _tokenConfig.tokenImageURL,
                string.concat(LibString.toString(score), ".png")
            )
        });
        return mediaFields;
    }
}

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

/// @title DN404Mirror
/// @notice DN404Mirror provides an interface for interacting with the
/// NFT tokens in a DN404 implementation.
///
/// @author vectorized.eth (@optimizoor)
/// @author Quit (@0xQuit)
/// @author Michael Amadi (@AmadiMichaels)
/// @author cygaar (@0xCygaar)
/// @author Thomas (@0xjustadev)
/// @author Harrison (@PopPunkOnChain)
///
/// @dev Note:
/// - The ERC721 data is stored in the base DN404 contract.
contract DN404Mirror {
    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                           EVENTS                           */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Emitted when token `id` is transferred from `from` to `to`.
    event Transfer(address indexed from, address indexed to, uint256 indexed id);

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

    /// @dev Emitted when `owner` enables or disables `operator` to manage all of their tokens.
    event ApprovalForAll(address indexed owner, address indexed operator, bool isApproved);

    /// @dev The ownership is transferred from `oldOwner` to `newOwner`.
    /// This is for marketplace signaling purposes. This contract has a `pullOwner()`
    /// function that will sync the owner from the base contract.
    event OwnershipTransferred(address indexed oldOwner, address indexed newOwner);

    /// @dev `keccak256(bytes("Transfer(address,address,uint256)"))`.
    uint256 private constant _TRANSFER_EVENT_SIGNATURE =
        0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;

    /// @dev `keccak256(bytes("Approval(address,address,uint256)"))`.
    uint256 private constant _APPROVAL_EVENT_SIGNATURE =
        0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925;

    /// @dev `keccak256(bytes("ApprovalForAll(address,address,bool)"))`.
    uint256 private constant _APPROVAL_FOR_ALL_EVENT_SIGNATURE =
        0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31;

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                        CUSTOM ERRORS                       */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Thrown when a call for an NFT function did not originate
    /// from the base DN404 contract.
    error SenderNotBase();

    /// @dev Thrown when a call for an NFT function did not originate from the deployer.
    error SenderNotDeployer();

    /// @dev Thrown when transferring an NFT to a contract address that
    /// does not implement ERC721Receiver.
    error TransferToNonERC721ReceiverImplementer();

    /// @dev Thrown when a linkMirrorContract call is received and the
    /// NFT mirror contract has already been linked to a DN404 base contract.
    error AlreadyLinked();

    /// @dev Thrown when retrieving the base DN404 address when a link has not
    /// been established.
    error NotLinked();

    /// @dev The function selector is not recognized.
    error FnSelectorNotRecognized();

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                          STORAGE                           */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Struct contain the NFT mirror contract storage.
    struct DN404NFTStorage {
        // Address of the ERC20 base contract.
        address baseERC20;
        // The deployer, if provided. If non-zero, the initialization of the
        // ERC20 <-> ERC721 link can only be done by the deployer via the ERC20 base contract.
        address deployer;
        // The owner of the ERC20 base contract. For marketplace signaling.
        address owner;
    }

    /// @dev Returns a storage pointer for DN404NFTStorage.
    function _getDN404NFTStorage() internal pure virtual returns (DN404NFTStorage storage $) {
        /// @solidity memory-safe-assembly
        assembly {
            // `uint72(bytes9(keccak256("DN404_MIRROR_STORAGE")))`.
            $.slot := 0x3602298b8c10b01230 // Truncate to 9 bytes to reduce bytecode size.
        }
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                        CONSTRUCTOR                         */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    constructor(address deployer) {
        // For non-proxies, we will store the deployer so that only the deployer can
        // link the base contract.
        _getDN404NFTStorage().deployer = deployer;
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                     ERC721 OPERATIONS                      */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Returns the token collection name from the base DN404 contract.
    function name() public view virtual returns (string memory) {
        return _readString(0x06fdde03, 0); // `name()`.
    }

    /// @dev Returns the token collection symbol from the base DN404 contract.
    function symbol() public view virtual returns (string memory) {
        return _readString(0x95d89b41, 0); // `symbol()`.
    }

    /// @dev Returns the Uniform Resource Identifier (URI) for token `id` from
    /// the base DN404 contract.
    function tokenURI(uint256 id) public view virtual returns (string memory) {
        ownerOf(id); // `ownerOf` reverts if the token does not exist.
        // We'll leave if optional for `_tokenURI` to revert for non-existent token
        // on the ERC20 side, since this is only recommended by the ERC721 standard.
        return _readString(0xcb30b460, id); // `tokenURINFT(uint256)`.
    }

    /// @dev Returns the total NFT supply from the base DN404 contract.
    function totalSupply() public view virtual returns (uint256) {
        return _readWord(0xe2c79281, 0, 0); // `totalNFTSupply()`.
    }

    /// @dev Returns the number of NFT tokens owned by `nftOwner` from the base DN404 contract.
    ///
    /// Requirements:
    /// - `nftOwner` must not be the zero address.
    function balanceOf(address nftOwner) public view virtual returns (uint256) {
        return _readWord(0xf5b100ea, uint160(nftOwner), 0); // `balanceOfNFT(address)`.
    }

    /// @dev Returns the owner of token `id` from the base DN404 contract.
    ///
    /// Requirements:
    /// - Token `id` must exist.
    function ownerOf(uint256 id) public view virtual returns (address) {
        return address(uint160(_readWord(0x2d8a746e, id, 0))); // `ownerOfNFT(uint256)`.
    }

    /// @dev Returns the owner of token `id` from the base DN404 contract.
    /// Returns `address(0)` instead of reverting if the token does not exist.
    function ownerAt(uint256 id) public view virtual returns (address) {
        return address(uint160(_readWord(0xc016aa52, id, 0))); // `ownerAtNFT(uint256)`.
    }

    /// @dev Sets `spender` as the approved account to manage token `id` in
    /// the base DN404 contract.
    ///
    /// Requirements:
    /// - Token `id` must exist.
    /// - The caller must be the owner of the token,
    ///   or an approved operator for the token owner.
    ///
    /// Emits an {Approval} event.
    function approve(address spender, uint256 id) public payable virtual {
        address base = baseERC20();
        /// @solidity memory-safe-assembly
        assembly {
            spender := shr(96, shl(96, spender))
            let m := mload(0x40)
            mstore(0x00, 0xd10b6e0c) // `approveNFT(address,uint256,address)`.
            mstore(0x20, spender)
            mstore(0x40, id)
            mstore(0x60, caller())
            if iszero(
                and( // Arguments of `and` are evaluated last to first.
                    gt(returndatasize(), 0x1f), // The call must return at least 32 bytes.
                    call(gas(), base, callvalue(), 0x1c, 0x64, 0x00, 0x20)
                )
            ) {
                returndatacopy(m, 0x00, returndatasize())
                revert(m, returndatasize())
            }
            mstore(0x40, m) // Restore the free memory pointer.
            mstore(0x60, 0) // Restore the zero pointer.
            // Emit the {Approval} event.
            log4(codesize(), 0x00, _APPROVAL_EVENT_SIGNATURE, shr(96, mload(0x0c)), spender, id)
        }
    }

    /// @dev Returns the account approved to manage token `id` from
    /// the base DN404 contract.
    ///
    /// Requirements:
    /// - Token `id` must exist.
    function getApproved(uint256 id) public view virtual returns (address) {
        return address(uint160(_readWord(0x27ef5495, id, 0))); // `getApprovedNFT(uint256)`.
    }

    /// @dev Sets whether `operator` is approved to manage the tokens of the caller in
    /// the base DN404 contract.
    ///
    /// Emits an {ApprovalForAll} event.
    function setApprovalForAll(address operator, bool approved) public virtual {
        address base = baseERC20();
        /// @solidity memory-safe-assembly
        assembly {
            operator := shr(96, shl(96, operator))
            let m := mload(0x40)
            mstore(0x00, 0xf6916ddd) // `setApprovalForAllNFT(address,bool,address)`.
            mstore(0x20, operator)
            mstore(0x40, iszero(iszero(approved)))
            mstore(0x60, caller())
            if iszero(
                and( // Arguments of `and` are evaluated last to first.
                    eq(mload(0x00), 1), // The call must return 1.
                    call(gas(), base, callvalue(), 0x1c, 0x64, 0x00, 0x20)
                )
            ) {
                returndatacopy(m, 0x00, returndatasize())
                revert(m, returndatasize())
            }
            // Emit the {ApprovalForAll} event.
            // The `approved` value is already at 0x40.
            log3(0x40, 0x20, _APPROVAL_FOR_ALL_EVENT_SIGNATURE, caller(), operator)
            mstore(0x40, m) // Restore the free memory pointer.
            mstore(0x60, 0) // Restore the zero pointer.
        }
    }

    /// @dev Returns whether `operator` is approved to manage the tokens of `nftOwner` from
    /// the base DN404 contract.
    function isApprovedForAll(address nftOwner, address operator)
        public
        view
        virtual
        returns (bool)
    {
        // `isApprovedForAllNFT(address,address)`.
        return _readWord(0x62fb246d, uint160(nftOwner), uint160(operator)) != 0;
    }

    /// @dev Transfers token `id` from `from` to `to`.
    ///
    /// Requirements:
    ///
    /// - Token `id` must exist.
    /// - `from` must be the owner of the token.
    /// - `to` cannot be the zero address.
    /// - The caller must be the owner of the token, or be approved to manage the token.
    ///
    /// Emits a {Transfer} event.
    function transferFrom(address from, address to, uint256 id) public payable virtual {
        address base = baseERC20();
        /// @solidity memory-safe-assembly
        assembly {
            from := shr(96, shl(96, from))
            to := shr(96, shl(96, to))
            let m := mload(0x40)
            mstore(m, 0xe5eb36c8) // `transferFromNFT(address,address,uint256,address)`.
            mstore(add(m, 0x20), from)
            mstore(add(m, 0x40), to)
            mstore(add(m, 0x60), id)
            mstore(add(m, 0x80), caller())
            if iszero(
                and( // Arguments of `and` are evaluated last to first.
                    eq(mload(m), 1), // The call must return 1.
                    call(gas(), base, callvalue(), add(m, 0x1c), 0x84, m, 0x20)
                )
            ) {
                returndatacopy(m, 0x00, returndatasize())
                revert(m, returndatasize())
            }
            // Emit the {Transfer} event.
            log4(codesize(), 0x00, _TRANSFER_EVENT_SIGNATURE, from, to, id)
        }
    }

    /// @dev Equivalent to `safeTransferFrom(from, to, id, "")`.
    function safeTransferFrom(address from, address to, uint256 id) public payable virtual {
        transferFrom(from, to, id);
        if (_hasCode(to)) _checkOnERC721Received(from, to, id, "");
    }

    /// @dev Transfers token `id` from `from` to `to`.
    ///
    /// Requirements:
    ///
    /// - Token `id` must exist.
    /// - `from` must be the owner of the token.
    /// - `to` cannot be the zero address.
    /// - The caller must be the owner of the token, or be approved to manage the token.
    /// - 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 id, bytes calldata data)
        public
        payable
        virtual
    {
        transferFrom(from, to, id);
        if (_hasCode(to)) _checkOnERC721Received(from, to, id, data);
    }

    /// @dev Returns true if this contract implements the interface defined by `interfaceId`.
    /// See: https://eips.ethereum.org/EIPS/eip-165
    /// This function call must use less than 30000 gas.
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            let s := shr(224, interfaceId)
            // ERC165: 0x01ffc9a7, ERC721: 0x80ac58cd, ERC721Metadata: 0x5b5e139f.
            result := or(or(eq(s, 0x01ffc9a7), eq(s, 0x80ac58cd)), eq(s, 0x5b5e139f))
        }
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                  OWNER SYNCING OPERATIONS                  */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Returns the `owner` of the contract, for marketplace signaling purposes.
    function owner() public view virtual returns (address) {
        return _getDN404NFTStorage().owner;
    }

    /// @dev Permissionless function to pull the owner from the base DN404 contract
    /// if it implements ownable, for marketplace signaling purposes.
    function pullOwner() public virtual returns (bool) {
        address newOwner;
        address base = baseERC20();
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, 0x8da5cb5b) // `owner()`.
            let success := staticcall(gas(), base, 0x1c, 0x04, 0x00, 0x20)
            newOwner := mul(shr(96, mload(0x0c)), and(gt(returndatasize(), 0x1f), success))
        }
        DN404NFTStorage storage $ = _getDN404NFTStorage();
        address oldOwner = $.owner;
        if (oldOwner != newOwner) {
            $.owner = newOwner;
            emit OwnershipTransferred(oldOwner, newOwner);
        }
        return true;
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                     MIRROR OPERATIONS                      */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Returns the address of the base DN404 contract.
    function baseERC20() public view virtual returns (address base) {
        base = _getDN404NFTStorage().baseERC20;
        if (base == address(0)) revert NotLinked();
    }

    /// @dev Fallback modifier to execute calls from the base DN404 contract.
    modifier dn404NFTFallback() virtual {
        DN404NFTStorage storage $ = _getDN404NFTStorage();

        uint256 fnSelector = _calldataload(0x00) >> 224;

        // `logTransfer(uint256[])`.
        if (fnSelector == 0x263c69d6) {
            if (msg.sender != $.baseERC20) revert SenderNotBase();
            /// @solidity memory-safe-assembly
            assembly {
                let o := add(0x24, calldataload(0x04)) // Packed logs offset.
                let end := add(o, shl(5, calldataload(sub(o, 0x20))))
                for {} iszero(eq(o, end)) { o := add(0x20, o) } {
                    let d := calldataload(o) // Entry in the packed logs.
                    let a := shr(96, d) // The address.
                    let b := and(1, d) // Whether it is a burn.
                    log4(
                        codesize(),
                        0x00,
                        _TRANSFER_EVENT_SIGNATURE,
                        mul(a, b), // `from`.
                        mul(a, iszero(b)), // `to`.
                        shr(168, shl(160, d)) // `id`.
                    )
                }
                mstore(0x00, 0x01)
                return(0x00, 0x20)
            }
        }
        // `logDirectTransfer(address,address,uint256[])`.
        if (fnSelector == 0x144027d3) {
            if (msg.sender != $.baseERC20) revert SenderNotBase();
            /// @solidity memory-safe-assembly
            assembly {
                let from := calldataload(0x04)
                let to := calldataload(0x24)
                let o := add(0x24, calldataload(0x44)) // Direct logs offset.
                let end := add(o, shl(5, calldataload(sub(o, 0x20))))
                for {} iszero(eq(o, end)) { o := add(0x20, o) } {
                    log4(codesize(), 0x00, _TRANSFER_EVENT_SIGNATURE, from, to, calldataload(o))
                }
                mstore(0x00, 0x01)
                return(0x00, 0x20)
            }
        }
        // `linkMirrorContract(address)`.
        if (fnSelector == 0x0f4599e5) {
            if ($.deployer != address(0)) {
                if (address(uint160(_calldataload(0x04))) != $.deployer) {
                    revert SenderNotDeployer();
                }
            }
            if ($.baseERC20 != address(0)) revert AlreadyLinked();
            $.baseERC20 = msg.sender;
            /// @solidity memory-safe-assembly
            assembly {
                mstore(0x00, 0x01)
                return(0x00, 0x20)
            }
        }
        _;
    }

    /// @dev Fallback function for calls from base DN404 contract.
    /// Override this if you need to implement your custom
    /// fallback with utilities like Solady's `LibZip.cdFallback()`.
    /// And always remember to always wrap the fallback with `dn404NFTFallback`.
    fallback() external payable virtual dn404NFTFallback {
        revert FnSelectorNotRecognized(); // Not mandatory. Just for quality of life.
    }

    /// @dev This is to silence the compiler warning.
    /// Override and remove the revert if you want your contract to receive ETH via receive.
    receive() external payable virtual {
        if (msg.value != 0) revert();
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                      PRIVATE HELPERS                       */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Helper to read a string from the base DN404 contract.
    function _readString(uint256 fnSelector, uint256 arg0)
        private
        view
        returns (string memory result)
    {
        address base = baseERC20();
        /// @solidity memory-safe-assembly
        assembly {
            result := mload(0x40)
            mstore(0x00, fnSelector)
            mstore(0x20, arg0)
            if iszero(staticcall(gas(), base, 0x1c, 0x24, 0x00, 0x00)) {
                returndatacopy(result, 0x00, returndatasize())
                revert(result, returndatasize())
            }
            returndatacopy(0x00, 0x00, 0x20) // Copy the offset of the string in returndata.
            returndatacopy(result, mload(0x00), 0x20) // Copy the length of the string.
            returndatacopy(add(result, 0x20), add(mload(0x00), 0x20), mload(result)) // Copy the string.
            let end := add(add(result, 0x20), mload(result))
            mstore(end, 0) // Zeroize the word after the string.
            mstore(0x40, add(end, 0x20)) // Allocate memory.
        }
    }

    /// @dev Helper to read a word from the base DN404 contract.
    function _readWord(uint256 fnSelector, uint256 arg0, uint256 arg1)
        private
        view
        returns (uint256 result)
    {
        address base = baseERC20();
        /// @solidity memory-safe-assembly
        assembly {
            let m := mload(0x40)
            mstore(0x00, fnSelector)
            mstore(0x20, arg0)
            mstore(0x40, arg1)
            if iszero(
                and( // Arguments of `and` are evaluated last to first.
                    gt(returndatasize(), 0x1f), // The call must return at least 32 bytes.
                    staticcall(gas(), base, 0x1c, 0x44, 0x00, 0x20)
                )
            ) {
                returndatacopy(m, 0x00, returndatasize())
                revert(m, returndatasize())
            }
            mstore(0x40, m) // Restore the free memory pointer.
            result := mload(0x00)
        }
    }

    /// @dev Returns the calldata value at `offset`.
    function _calldataload(uint256 offset) private pure returns (uint256 value) {
        /// @solidity memory-safe-assembly
        assembly {
            value := calldataload(offset)
        }
    }

    /// @dev Returns if `a` has bytecode of non-zero length.
    function _hasCode(address a) private view returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := extcodesize(a) // Can handle dirty upper bits.
        }
    }

    /// @dev Perform a call to invoke {IERC721Receiver-onERC721Received} on `to`.
    /// Reverts if the target does not support the function correctly.
    function _checkOnERC721Received(address from, address to, uint256 id, bytes memory data)
        private
    {
        /// @solidity memory-safe-assembly
        assembly {
            // Prepare the calldata.
            let m := mload(0x40)
            let onERC721ReceivedSelector := 0x150b7a02
            mstore(m, onERC721ReceivedSelector)
            mstore(add(m, 0x20), caller()) // The `operator`, which is always `msg.sender`.
            mstore(add(m, 0x40), shr(96, shl(96, from)))
            mstore(add(m, 0x60), id)
            mstore(add(m, 0x80), 0x80)
            let n := mload(data)
            mstore(add(m, 0xa0), n)
            if n { pop(staticcall(gas(), 4, add(data, 0x20), n, add(m, 0xc0), n)) }
            // Revert if the call reverts.
            if iszero(call(gas(), to, 0, add(m, 0x1c), add(n, 0xa4), m, 0x20)) {
                if returndatasize() {
                    // Bubble up the revert if the call reverts.
                    returndatacopy(m, 0x00, returndatasize())
                    revert(m, returndatasize())
                }
            }
            // Load the returndata and compare it.
            if iszero(eq(mload(m), shl(224, onERC721ReceivedSelector))) {
                mstore(0x00, 0xd1a57ed6) // `TransferToNonERC721ReceiverImplementer()`.
                revert(0x1c, 0x04)
            }
        }
    }
}

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

/// @notice Simple ERC2981 NFT Royalty Standard implementation.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/tokens/ERC2981.sol)
/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/common/ERC2981.sol)
abstract contract ERC2981 {
    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                       CUSTOM ERRORS                        */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The royalty fee numerator exceeds the fee denominator.
    error RoyaltyOverflow();

    /// @dev The royalty receiver cannot be the zero address.
    error RoyaltyReceiverIsZeroAddress();

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                          STORAGE                           */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The default royalty info is given by:
    /// ```
    ///     let packed := sload(_ERC2981_MASTER_SLOT_SEED)
    ///     let receiver := shr(96, packed)
    ///     let royaltyFraction := xor(packed, shl(96, receiver))
    /// ```
    ///
    /// The per token royalty info is given by.
    /// ```
    ///     mstore(0x00, tokenId)
    ///     mstore(0x20, _ERC2981_MASTER_SLOT_SEED)
    ///     let packed := sload(keccak256(0x00, 0x40))
    ///     let receiver := shr(96, packed)
    ///     let royaltyFraction := xor(packed, shl(96, receiver))
    /// ```
    uint256 private constant _ERC2981_MASTER_SLOT_SEED = 0xaa4ec00224afccfdb7;

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                          ERC2981                           */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Checks that `_feeDenominator` is non-zero.
    constructor() {
        require(_feeDenominator() != 0, "Fee denominator cannot be zero.");
    }

    /// @dev Returns the denominator for the royalty amount.
    /// Defaults to 10000, which represents fees in basis points.
    /// Override this function to return a custom amount if needed.
    function _feeDenominator() internal pure virtual returns (uint96) {
        return 10000;
    }

    /// @dev Returns true if this contract implements the interface defined by `interfaceId`.
    /// See: https://eips.ethereum.org/EIPS/eip-165
    /// This function call must use less than 30000 gas.
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            let s := shr(224, interfaceId)
            // ERC165: 0x01ffc9a7, ERC2981: 0x2a55205a.
            result := or(eq(s, 0x01ffc9a7), eq(s, 0x2a55205a))
        }
    }

    /// @dev Returns the `receiver` and `royaltyAmount` for `tokenId` sold at `salePrice`.
    function royaltyInfo(uint256 tokenId, uint256 salePrice)
        public
        view
        virtual
        returns (address receiver, uint256 royaltyAmount)
    {
        uint256 feeDenominator = _feeDenominator();
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, tokenId)
            mstore(0x20, _ERC2981_MASTER_SLOT_SEED)
            let packed := sload(keccak256(0x00, 0x40))
            receiver := shr(96, packed)
            if iszero(receiver) {
                packed := sload(mload(0x20))
                receiver := shr(96, packed)
            }
            let x := salePrice
            let y := xor(packed, shl(96, receiver)) // `feeNumerator`.
            // Overflow check, equivalent to `require(y == 0 || x <= type(uint256).max / y)`.
            // Out-of-gas revert. Should not be triggered in practice, but included for safety.
            returndatacopy(returndatasize(), returndatasize(), mul(y, gt(x, div(not(0), y))))
            royaltyAmount := div(mul(x, y), feeDenominator)
        }
    }

    /// @dev Sets the default royalty `receiver` and `feeNumerator`.
    ///
    /// Requirements:
    /// - `receiver` must not be the zero address.
    /// - `feeNumerator` must not be greater than the fee denominator.
    function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
        uint256 feeDenominator = _feeDenominator();
        /// @solidity memory-safe-assembly
        assembly {
            feeNumerator := shr(160, shl(160, feeNumerator))
            if gt(feeNumerator, feeDenominator) {
                mstore(0x00, 0x350a88b3) // `RoyaltyOverflow()`.
                revert(0x1c, 0x04)
            }
            let packed := shl(96, receiver)
            if iszero(packed) {
                mstore(0x00, 0xb4457eaa) // `RoyaltyReceiverIsZeroAddress()`.
                revert(0x1c, 0x04)
            }
            sstore(_ERC2981_MASTER_SLOT_SEED, or(packed, feeNumerator))
        }
    }

    /// @dev Sets the default royalty `receiver` and `feeNumerator` to zero.
    function _deleteDefaultRoyalty() internal virtual {
        /// @solidity memory-safe-assembly
        assembly {
            sstore(_ERC2981_MASTER_SLOT_SEED, 0)
        }
    }

    /// @dev Sets the royalty `receiver` and `feeNumerator` for `tokenId`.
    ///
    /// Requirements:
    /// - `receiver` must not be the zero address.
    /// - `feeNumerator` must not be greater than the fee denominator.
    function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator)
        internal
        virtual
    {
        uint256 feeDenominator = _feeDenominator();
        /// @solidity memory-safe-assembly
        assembly {
            feeNumerator := shr(160, shl(160, feeNumerator))
            if gt(feeNumerator, feeDenominator) {
                mstore(0x00, 0x350a88b3) // `RoyaltyOverflow()`.
                revert(0x1c, 0x04)
            }
            let packed := shl(96, receiver)
            if iszero(packed) {
                mstore(0x00, 0xb4457eaa) // `RoyaltyReceiverIsZeroAddress()`.
                revert(0x1c, 0x04)
            }
            mstore(0x00, tokenId)
            mstore(0x20, _ERC2981_MASTER_SLOT_SEED)
            sstore(keccak256(0x00, 0x40), or(packed, feeNumerator))
        }
    }

    /// @dev Sets the royalty `receiver` and `feeNumerator` for `tokenId` to zero.
    function _resetTokenRoyalty(uint256 tokenId) internal virtual {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, tokenId)
            mstore(0x20, _ERC2981_MASTER_SLOT_SEED)
            sstore(keccak256(0x00, 0x40), 0)
        }
    }
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

import "solady/utils/Base64.sol";
import "solady/utils/LibString.sol";

/// @notice Library for rendering metadata for NFTs.
/// @author indreams.eth
library NFTMetadataRenderer {
    struct Field {
        string name;
        string value;
    }

    /// @notice Generate tokenURI metadata.
    /// @param name Name of NFT in metadata.
    /// @param description Description of NFT in metadata.
    /// @param mediaFields List of mediaFields to include in metadata.
    /// @param attributesData List of attributes to include in metadata.
    /// @param tokenId Token ID for specific token.
    /// @param size Size of entire edition to show.
    function tokenURIMetadata(
        string memory name,
        string memory description,
        Field[] memory mediaFields,
        string memory attributesData,
        uint256 tokenId,
        uint256 size
    ) internal pure returns (string memory) {
        return
            encodeMetadataJSON(
                createTokenURIMetadataJSON(
                    name,
                    description,
                    mediaFields,
                    attributesData,
                    tokenId,
                    size
                )
            );
    }

    /// @notice Generate contractURI metadata.
    /// @param name Name of NFT in metadata.
    /// @param description Description of NFT in metadata.
    /// @param mediaFields List of mediaFields to include in metadata.
    /// @param royaltyBPS Royalty basis points.
    /// @param royaltyRecipient Royalty recipient.
    function contractURIMetadata(
        string memory name,
        string memory description,
        Field[] memory mediaFields,
        uint256 royaltyBPS,
        address royaltyRecipient
    ) internal pure returns (string memory) {
        return
            encodeMetadataJSON(
                createContractURIMetadataJSON(
                    name,
                    description,
                    mediaFields,
                    royaltyBPS,
                    royaltyRecipient
                )
            );
    }

    function createTokenURIMetadataJSON(
        string memory name,
        string memory description,
        Field[] memory mediaFields,
        string memory attributesData,
        uint256 tokenId,
        uint256 size
    ) internal pure returns (bytes memory) {
        bytes memory tokenNumber;
        if (size > 0) {
            tokenNumber = abi.encodePacked("/", LibString.toString(size));
        }

        bytes memory mediaData;
        if (mediaFields.length > 0) {
            mediaData = abi.encodePacked(",", fieldData(mediaFields));
        }

        bytes memory attributes;
        if (bytes(attributesData).length > 0) {
            attributes = abi.encodePacked(
                ', "attributes": [',
                attributesData,
                "]"
            );
        }

        return
            abi.encodePacked(
                '{"name": "',
                name,
                " ",
                LibString.toString(tokenId),
                tokenNumber,
                '","',
                'description": "',
                description,
                '"',
                mediaData,
                attributes,
                "}"
            );
    }

    function createContractURIMetadataJSON(
        string memory name,
        string memory description,
        Field[] memory mediaFields,
        uint256 royaltyBPS,
        address royaltyRecipient
    ) internal pure returns (bytes memory) {
        bytes memory mediaData;
        if (mediaFields.length > 0) {
            mediaData = abi.encodePacked(",", fieldData(mediaFields));
        }

        return
            abi.encodePacked(
                '{"name": "',
                name,
                '", "description": "',
                description,
                '", "seller_fee_basis_points": ',
                LibString.toString(royaltyBPS),
                ', "fee_recipient": "',
                LibString.toHexString(uint256(uint160(royaltyRecipient)), 20),
                '"',
                mediaData,
                "}"
            );
    }

    /// @notice Encode the json bytes into base64 data uri format.
    /// @param json The json bytes to encode.
    function encodeMetadataJSON(
        bytes memory json
    ) internal pure returns (string memory) {
        return
            string.concat("data:application/json;base64,", Base64.encode(json));
    }

    /// @notice Encode the svg bytes into base64 data uri format.
    /// @param svg The svg bytes to encode.
    function encodeSVG(bytes memory svg) internal pure returns (string memory) {
        return string.concat("data:image/svg+xml;base64,", Base64.encode(svg));
    }

    /// @notice Generate key/value data for metadata.
    /// [{name: "x", value: "y"}, {name:"a", value: "b"}] -> "a": "b", "x": "y"
    /// @param fields List of fields to include in metadata.
    function fieldData(
        Field[] memory fields
    ) internal pure returns (string memory) {
        if (fields.length == 0) return "";

        string memory tokenMedia = string.concat(
            '"',
            fields[0].name,
            '": "',
            fields[0].value,
            '"'
        );

        for (uint256 i = 1; i < fields.length; i++) {
            tokenMedia = string.concat(
                '"',
                fields[i].name,
                '": "',
                fields[i].value,
                '",',
                tokenMedia
            );
        }
        return tokenMedia;
    }
}

// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.25;

interface IToken {
    error InvalidMintTimes();
    error InvalidInterval();
    error InvalidPrice();
    error TotalSupplyReached();
    error NotLive();
    error NotTransferable();
    error InvalidNFTAmount();
    error Unsupported();
    error BeforeMintPeriod();
    error AfterMintPeriod();
    error InvalidIntervalAmount();
    error InvalidFee();
    error InvalidEntropyFee();
    error RandomnessAlreadyFulfilled();
    error CannotRevealWhileMintIsLive();
    error InvalidProvider();
    error InvalidSequenceId();

    struct MintConfig {
        uint256 startTime;
        uint256 endTime;
        uint256 interval;
        uint96 ethPrice;
        uint96 usdcPrice;
        address usdcAddress;
        address fundsRecipient;
    }

    function purchase(uint256 nftAmount_, address to_) external payable;

    function purchaseWithUSDC(uint256 nftAmount_, address to_) external;

    function mint(uint256 nftAmount_, address to_) external;

    function reduceIntervals(uint256 intervalAmount_) external;

    function allowTransfers() external;

    function toggleLive() external;

    function upsertMedia(
        string calldata credits_,
        string calldata decryptionKeysURL_,
        string calldata tokenImageURL_
    ) external;

    function mintCount(address account) external view returns (uint256);

    function reveal() external payable;

    function getScore(uint256 tokenId) external view returns (uint8);

    function setSkipNFT(address account, bool status) external returns (bool);
}

interface TokenEvents {
    event IntervalsReduced(
        uint256 oldIntervalsReduced,
        uint256 newIntervalsReduced
    );
    event Minted(
        address to,
        uint256 amount,
        uint256 secondsReduced,
        uint256 totalIntervalsReduced
    );
    event LiveSet(bool live);
    event TransfersAllowed();
    event EntropyRequested(address sender, uint64 sequenceId);
}

// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.25;

interface ITokenMirror {
    error Unauthorized();

    struct TokenConfig {
        string description;
        string externalURL;
        string contractImageURL;
        string tokenImageURL;
        string encryptedAlbumURL;
        string decryptionKeysURL;
        string credits;
    }

    function upsertMedia(
        string calldata credits_,
        string calldata decryptionKeysURL_,
        string calldata tokenImageURL_
    ) external;

    function refreshMetadata(uint256 _fromTokenId, uint256 _toTokenId) external;
}

interface TokenMirrorEvents {
    event MediaUpdated(
        string credits,
        string decryptionKeysURL,
        string tokenImageURL
    );
}

File 7 of 11 : IERC7572.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.25;

interface IERC7572 {
    event ContractURIUpdated();

    function contractURI() external view returns (string memory);
}

File 8 of 11 : IERC4906.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.25;

interface IERC4906 {
    event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);
}

File 9 of 11 : IERC20.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.25;

interface IERC20 {
    function name() external view returns (string memory);
}

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

/// @notice Library to encode strings in Base64.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/Base64.sol)
/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/Base64.sol)
/// @author Modified from (https://github.com/Brechtpd/base64/blob/main/base64.sol) by Brecht Devos - <[email protected]>.
library Base64 {
    /// @dev Encodes `data` using the base64 encoding described in RFC 4648.
    /// See: https://datatracker.ietf.org/doc/html/rfc4648
    /// @param fileSafe  Whether to replace '+' with '-' and '/' with '_'.
    /// @param noPadding Whether to strip away the padding.
    function encode(bytes memory data, bool fileSafe, bool noPadding)
        internal
        pure
        returns (string memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let dataLength := mload(data)

            if dataLength {
                // Multiply by 4/3 rounded up.
                // The `shl(2, ...)` is equivalent to multiplying by 4.
                let encodedLength := shl(2, div(add(dataLength, 2), 3))

                // Set `result` to point to the start of the free memory.
                result := mload(0x40)

                // Store the table into the scratch space.
                // Offsetted by -1 byte so that the `mload` will load the character.
                // We will rewrite the free memory pointer at `0x40` later with
                // the allocated size.
                // The magic constant 0x0670 will turn "-_" into "+/".
                mstore(0x1f, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef")
                mstore(0x3f, xor("ghijklmnopqrstuvwxyz0123456789-_", mul(iszero(fileSafe), 0x0670)))

                // Skip the first slot, which stores the length.
                let ptr := add(result, 0x20)
                let end := add(ptr, encodedLength)

                let dataEnd := add(add(0x20, data), dataLength)
                let dataEndValue := mload(dataEnd) // Cache the value at the `dataEnd` slot.
                mstore(dataEnd, 0x00) // Zeroize the `dataEnd` slot to clear dirty bits.

                // Run over the input, 3 bytes at a time.
                for {} 1 {} {
                    data := add(data, 3) // Advance 3 bytes.
                    let input := mload(data)

                    // Write 4 bytes. Optimized for fewer stack operations.
                    mstore8(0, mload(and(shr(18, input), 0x3F)))
                    mstore8(1, mload(and(shr(12, input), 0x3F)))
                    mstore8(2, mload(and(shr(6, input), 0x3F)))
                    mstore8(3, mload(and(input, 0x3F)))
                    mstore(ptr, mload(0x00))

                    ptr := add(ptr, 4) // Advance 4 bytes.
                    if iszero(lt(ptr, end)) { break }
                }
                mstore(dataEnd, dataEndValue) // Restore the cached value at `dataEnd`.
                mstore(0x40, add(end, 0x20)) // Allocate the memory.
                // Equivalent to `o = [0, 2, 1][dataLength % 3]`.
                let o := div(2, mod(dataLength, 3))
                // Offset `ptr` and pad with '='. We can simply write over the end.
                mstore(sub(ptr, o), shl(240, 0x3d3d))
                // Set `o` to zero if there is padding.
                o := mul(iszero(iszero(noPadding)), o)
                mstore(sub(ptr, o), 0) // Zeroize the slot after the string.
                mstore(result, sub(encodedLength, o)) // Store the length.
            }
        }
    }

    /// @dev Encodes `data` using the base64 encoding described in RFC 4648.
    /// Equivalent to `encode(data, false, false)`.
    function encode(bytes memory data) internal pure returns (string memory result) {
        result = encode(data, false, false);
    }

    /// @dev Encodes `data` using the base64 encoding described in RFC 4648.
    /// Equivalent to `encode(data, fileSafe, false)`.
    function encode(bytes memory data, bool fileSafe)
        internal
        pure
        returns (string memory result)
    {
        result = encode(data, fileSafe, false);
    }

    /// @dev Decodes base64 encoded `data`.
    ///
    /// Supports:
    /// - RFC 4648 (both standard and file-safe mode).
    /// - RFC 3501 (63: ',').
    ///
    /// Does not support:
    /// - Line breaks.
    ///
    /// Note: For performance reasons,
    /// this function will NOT revert on invalid `data` inputs.
    /// Outputs for invalid inputs will simply be undefined behaviour.
    /// It is the user's responsibility to ensure that the `data`
    /// is a valid base64 encoded string.
    function decode(string memory data) internal pure returns (bytes memory result) {
        /// @solidity memory-safe-assembly
        assembly {
            let dataLength := mload(data)

            if dataLength {
                let decodedLength := mul(shr(2, dataLength), 3)

                for {} 1 {} {
                    // If padded.
                    if iszero(and(dataLength, 3)) {
                        let t := xor(mload(add(data, dataLength)), 0x3d3d)
                        // forgefmt: disable-next-item
                        decodedLength := sub(
                            decodedLength,
                            add(iszero(byte(30, t)), iszero(byte(31, t)))
                        )
                        break
                    }
                    // If non-padded.
                    decodedLength := add(decodedLength, sub(and(dataLength, 3), 1))
                    break
                }
                result := mload(0x40)

                // Write the length of the bytes.
                mstore(result, decodedLength)

                // Skip the first slot, which stores the length.
                let ptr := add(result, 0x20)
                let end := add(ptr, decodedLength)

                // Load the table into the scratch space.
                // Constants are optimized for smaller bytecode with zero gas overhead.
                // `m` also doubles as the mask of the upper 6 bits.
                let m := 0xfc000000fc00686c7074787c8084888c9094989ca0a4a8acb0b4b8bcc0c4c8cc
                mstore(0x5b, m)
                mstore(0x3b, 0x04080c1014181c2024282c3034383c4044484c5054585c6064)
                mstore(0x1a, 0xf8fcf800fcd0d4d8dce0e4e8ecf0f4)

                for {} 1 {} {
                    // Read 4 bytes.
                    data := add(data, 4)
                    let input := mload(data)

                    // Write 3 bytes.
                    // forgefmt: disable-next-item
                    mstore(ptr, or(
                        and(m, mload(byte(28, input))),
                        shr(6, or(
                            and(m, mload(byte(29, input))),
                            shr(6, or(
                                and(m, mload(byte(30, input))),
                                shr(6, mload(byte(31, input)))
                            ))
                        ))
                    ))
                    ptr := add(ptr, 3)
                    if iszero(lt(ptr, end)) { break }
                }
                mstore(0x40, add(end, 0x20)) // Allocate the memory.
                mstore(end, 0) // Zeroize the slot after the bytes.
                mstore(0x60, 0) // Restore the zero slot.
            }
        }
    }
}

File 11 of 11 : LibString.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/// @notice Library for converting numbers into strings and other string operations.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibString.sol)
/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/LibString.sol)
///
/// @dev Note:
/// For performance and bytecode compactness, most of the string operations are restricted to
/// byte strings (7-bit ASCII), except where otherwise specified.
/// Usage of byte string operations on charsets with runes spanning two or more bytes
/// can lead to undefined behavior.
library LibString {
    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                        CUSTOM ERRORS                       */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The length of the output is too small to contain all the hex digits.
    error HexLengthInsufficient();

    /// @dev The length of the string is more than 32 bytes.
    error TooBigForSmallString();

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                         CONSTANTS                          */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The constant returned when the `search` is not found in the string.
    uint256 internal constant NOT_FOUND = type(uint256).max;

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                     DECIMAL OPERATIONS                     */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns the base 10 decimal representation of `value`.
    function toString(uint256 value) internal pure returns (string memory str) {
        /// @solidity memory-safe-assembly
        assembly {
            // The maximum value of a uint256 contains 78 digits (1 byte per digit), but
            // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned.
            // We will need 1 word for the trailing zeros padding, 1 word for the length,
            // and 3 words for a maximum of 78 digits.
            str := add(mload(0x40), 0x80)
            // Update the free memory pointer to allocate.
            mstore(0x40, add(str, 0x20))
            // Zeroize the slot after the string.
            mstore(str, 0)

            // Cache the end of the memory to calculate the length later.
            let end := str

            let w := not(0) // Tsk.
            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            for { let temp := value } 1 {} {
                str := add(str, w) // `sub(str, 1)`.
                // Write the character to the pointer.
                // The ASCII index of the '0' character is 48.
                mstore8(str, add(48, mod(temp, 10)))
                // Keep dividing `temp` until zero.
                temp := div(temp, 10)
                if iszero(temp) { break }
            }

            let length := sub(end, str)
            // Move the pointer 32 bytes leftwards to make room for the length.
            str := sub(str, 0x20)
            // Store the length.
            mstore(str, length)
        }
    }

    /// @dev Returns the base 10 decimal representation of `value`.
    function toString(int256 value) internal pure returns (string memory str) {
        if (value >= 0) {
            return toString(uint256(value));
        }
        unchecked {
            str = toString(~uint256(value) + 1);
        }
        /// @solidity memory-safe-assembly
        assembly {
            // We still have some spare memory space on the left,
            // as we have allocated 3 words (96 bytes) for up to 78 digits.
            let length := mload(str) // Load the string length.
            mstore(str, 0x2d) // Store the '-' character.
            str := sub(str, 1) // Move back the string pointer by a byte.
            mstore(str, add(length, 1)) // Update the string length.
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                   HEXADECIMAL OPERATIONS                   */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns the hexadecimal representation of `value`,
    /// left-padded to an input length of `length` bytes.
    /// The output is prefixed with "0x" encoded using 2 hexadecimal digits per byte,
    /// giving a total length of `length * 2 + 2` bytes.
    /// Reverts if `length` is too small for the output to contain all the digits.
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory str) {
        str = toHexStringNoPrefix(value, length);
        /// @solidity memory-safe-assembly
        assembly {
            let strLength := add(mload(str), 2) // Compute the length.
            mstore(str, 0x3078) // Write the "0x" prefix.
            str := sub(str, 2) // Move the pointer.
            mstore(str, strLength) // Write the length.
        }
    }

    /// @dev Returns the hexadecimal representation of `value`,
    /// left-padded to an input length of `length` bytes.
    /// The output is prefixed with "0x" encoded using 2 hexadecimal digits per byte,
    /// giving a total length of `length * 2` bytes.
    /// Reverts if `length` is too small for the output to contain all the digits.
    function toHexStringNoPrefix(uint256 value, uint256 length)
        internal
        pure
        returns (string memory str)
    {
        /// @solidity memory-safe-assembly
        assembly {
            // We need 0x20 bytes for the trailing zeros padding, `length * 2` bytes
            // for the digits, 0x02 bytes for the prefix, and 0x20 bytes for the length.
            // We add 0x20 to the total and round down to a multiple of 0x20.
            // (0x20 + 0x20 + 0x02 + 0x20) = 0x62.
            str := add(mload(0x40), and(add(shl(1, length), 0x42), not(0x1f)))
            // Allocate the memory.
            mstore(0x40, add(str, 0x20))
            // Zeroize the slot after the string.
            mstore(str, 0)

            // Cache the end to calculate the length later.
            let end := str
            // Store "0123456789abcdef" in scratch space.
            mstore(0x0f, 0x30313233343536373839616263646566)

            let start := sub(str, add(length, length))
            let w := not(1) // Tsk.
            let temp := value
            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            for {} 1 {} {
                str := add(str, w) // `sub(str, 2)`.
                mstore8(add(str, 1), mload(and(temp, 15)))
                mstore8(str, mload(and(shr(4, temp), 15)))
                temp := shr(8, temp)
                if iszero(xor(str, start)) { break }
            }

            if temp {
                mstore(0x00, 0x2194895a) // `HexLengthInsufficient()`.
                revert(0x1c, 0x04)
            }

            // Compute the string's length.
            let strLength := sub(end, str)
            // Move the pointer and write the length.
            str := sub(str, 0x20)
            mstore(str, strLength)
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte.
    /// As address are 20 bytes long, the output will left-padded to have
    /// a length of `20 * 2 + 2` bytes.
    function toHexString(uint256 value) internal pure returns (string memory str) {
        str = toHexStringNoPrefix(value);
        /// @solidity memory-safe-assembly
        assembly {
            let strLength := add(mload(str), 2) // Compute the length.
            mstore(str, 0x3078) // Write the "0x" prefix.
            str := sub(str, 2) // Move the pointer.
            mstore(str, strLength) // Write the length.
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output is prefixed with "0x".
    /// The output excludes leading "0" from the `toHexString` output.
    /// `0x00: "0x0", 0x01: "0x1", 0x12: "0x12", 0x123: "0x123"`.
    function toMinimalHexString(uint256 value) internal pure returns (string memory str) {
        str = toHexStringNoPrefix(value);
        /// @solidity memory-safe-assembly
        assembly {
            let o := eq(byte(0, mload(add(str, 0x20))), 0x30) // Whether leading zero is present.
            let strLength := add(mload(str), 2) // Compute the length.
            mstore(add(str, o), 0x3078) // Write the "0x" prefix, accounting for leading zero.
            str := sub(add(str, o), 2) // Move the pointer, accounting for leading zero.
            mstore(str, sub(strLength, o)) // Write the length, accounting for leading zero.
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output excludes leading "0" from the `toHexStringNoPrefix` output.
    /// `0x00: "0", 0x01: "1", 0x12: "12", 0x123: "123"`.
    function toMinimalHexStringNoPrefix(uint256 value) internal pure returns (string memory str) {
        str = toHexStringNoPrefix(value);
        /// @solidity memory-safe-assembly
        assembly {
            let o := eq(byte(0, mload(add(str, 0x20))), 0x30) // Whether leading zero is present.
            let strLength := mload(str) // Get the length.
            str := add(str, o) // Move the pointer, accounting for leading zero.
            mstore(str, sub(strLength, o)) // Write the length, accounting for leading zero.
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output is encoded using 2 hexadecimal digits per byte.
    /// As address are 20 bytes long, the output will left-padded to have
    /// a length of `20 * 2` bytes.
    function toHexStringNoPrefix(uint256 value) internal pure returns (string memory str) {
        /// @solidity memory-safe-assembly
        assembly {
            // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length,
            // 0x02 bytes for the prefix, and 0x40 bytes for the digits.
            // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x40) is 0xa0.
            str := add(mload(0x40), 0x80)
            // Allocate the memory.
            mstore(0x40, add(str, 0x20))
            // Zeroize the slot after the string.
            mstore(str, 0)

            // Cache the end to calculate the length later.
            let end := str
            // Store "0123456789abcdef" in scratch space.
            mstore(0x0f, 0x30313233343536373839616263646566)

            let w := not(1) // Tsk.
            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            for { let temp := value } 1 {} {
                str := add(str, w) // `sub(str, 2)`.
                mstore8(add(str, 1), mload(and(temp, 15)))
                mstore8(str, mload(and(shr(4, temp), 15)))
                temp := shr(8, temp)
                if iszero(temp) { break }
            }

            // Compute the string's length.
            let strLength := sub(end, str)
            // Move the pointer and write the length.
            str := sub(str, 0x20)
            mstore(str, strLength)
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output is prefixed with "0x", encoded using 2 hexadecimal digits per byte,
    /// and the alphabets are capitalized conditionally according to
    /// https://eips.ethereum.org/EIPS/eip-55
    function toHexStringChecksummed(address value) internal pure returns (string memory str) {
        str = toHexString(value);
        /// @solidity memory-safe-assembly
        assembly {
            let mask := shl(6, div(not(0), 255)) // `0b010000000100000000 ...`
            let o := add(str, 0x22)
            let hashed := and(keccak256(o, 40), mul(34, mask)) // `0b10001000 ... `
            let t := shl(240, 136) // `0b10001000 << 240`
            for { let i := 0 } 1 {} {
                mstore(add(i, i), mul(t, byte(i, hashed)))
                i := add(i, 1)
                if eq(i, 20) { break }
            }
            mstore(o, xor(mload(o), shr(1, and(mload(0x00), and(mload(o), mask)))))
            o := add(o, 0x20)
            mstore(o, xor(mload(o), shr(1, and(mload(0x20), and(mload(o), mask)))))
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte.
    function toHexString(address value) internal pure returns (string memory str) {
        str = toHexStringNoPrefix(value);
        /// @solidity memory-safe-assembly
        assembly {
            let strLength := add(mload(str), 2) // Compute the length.
            mstore(str, 0x3078) // Write the "0x" prefix.
            str := sub(str, 2) // Move the pointer.
            mstore(str, strLength) // Write the length.
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output is encoded using 2 hexadecimal digits per byte.
    function toHexStringNoPrefix(address value) internal pure returns (string memory str) {
        /// @solidity memory-safe-assembly
        assembly {
            str := mload(0x40)

            // Allocate the memory.
            // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length,
            // 0x02 bytes for the prefix, and 0x28 bytes for the digits.
            // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x28) is 0x80.
            mstore(0x40, add(str, 0x80))

            // Store "0123456789abcdef" in scratch space.
            mstore(0x0f, 0x30313233343536373839616263646566)

            str := add(str, 2)
            mstore(str, 40)

            let o := add(str, 0x20)
            mstore(add(o, 40), 0)

            value := shl(96, value)

            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            for { let i := 0 } 1 {} {
                let p := add(o, add(i, i))
                let temp := byte(i, value)
                mstore8(add(p, 1), mload(and(temp, 15)))
                mstore8(p, mload(shr(4, temp)))
                i := add(i, 1)
                if eq(i, 20) { break }
            }
        }
    }

    /// @dev Returns the hex encoded string from the raw bytes.
    /// The output is encoded using 2 hexadecimal digits per byte.
    function toHexString(bytes memory raw) internal pure returns (string memory str) {
        str = toHexStringNoPrefix(raw);
        /// @solidity memory-safe-assembly
        assembly {
            let strLength := add(mload(str), 2) // Compute the length.
            mstore(str, 0x3078) // Write the "0x" prefix.
            str := sub(str, 2) // Move the pointer.
            mstore(str, strLength) // Write the length.
        }
    }

    /// @dev Returns the hex encoded string from the raw bytes.
    /// The output is encoded using 2 hexadecimal digits per byte.
    function toHexStringNoPrefix(bytes memory raw) internal pure returns (string memory str) {
        /// @solidity memory-safe-assembly
        assembly {
            let length := mload(raw)
            str := add(mload(0x40), 2) // Skip 2 bytes for the optional prefix.
            mstore(str, add(length, length)) // Store the length of the output.

            // Store "0123456789abcdef" in scratch space.
            mstore(0x0f, 0x30313233343536373839616263646566)

            let o := add(str, 0x20)
            let end := add(raw, length)

            for {} iszero(eq(raw, end)) {} {
                raw := add(raw, 1)
                mstore8(add(o, 1), mload(and(mload(raw), 15)))
                mstore8(o, mload(and(shr(4, mload(raw)), 15)))
                o := add(o, 2)
            }
            mstore(o, 0) // Zeroize the slot after the string.
            mstore(0x40, add(o, 0x20)) // Allocate the memory.
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                   RUNE STRING OPERATIONS                   */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns the number of UTF characters in the string.
    function runeCount(string memory s) internal pure returns (uint256 result) {
        /// @solidity memory-safe-assembly
        assembly {
            if mload(s) {
                mstore(0x00, div(not(0), 255))
                mstore(0x20, 0x0202020202020202020202020202020202020202020202020303030304040506)
                let o := add(s, 0x20)
                let end := add(o, mload(s))
                for { result := 1 } 1 { result := add(result, 1) } {
                    o := add(o, byte(0, mload(shr(250, mload(o)))))
                    if iszero(lt(o, end)) { break }
                }
            }
        }
    }

    /// @dev Returns if this string is a 7-bit ASCII string.
    /// (i.e. all characters codes are in [0..127])
    function is7BitASCII(string memory s) internal pure returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            let mask := shl(7, div(not(0), 255))
            result := 1
            let n := mload(s)
            if n {
                let o := add(s, 0x20)
                let end := add(o, n)
                let last := mload(end)
                mstore(end, 0)
                for {} 1 {} {
                    if and(mask, mload(o)) {
                        result := 0
                        break
                    }
                    o := add(o, 0x20)
                    if iszero(lt(o, end)) { break }
                }
                mstore(end, last)
            }
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                   BYTE STRING OPERATIONS                   */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    // For performance and bytecode compactness, byte string operations are restricted
    // to 7-bit ASCII strings. All offsets are byte offsets, not UTF character offsets.
    // Usage of byte string operations on charsets with runes spanning two or more bytes
    // can lead to undefined behavior.

    /// @dev Returns `subject` all occurrences of `search` replaced with `replacement`.
    function replace(string memory subject, string memory search, string memory replacement)
        internal
        pure
        returns (string memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let subjectLength := mload(subject)
            let searchLength := mload(search)
            let replacementLength := mload(replacement)

            subject := add(subject, 0x20)
            search := add(search, 0x20)
            replacement := add(replacement, 0x20)
            result := add(mload(0x40), 0x20)

            let subjectEnd := add(subject, subjectLength)
            if iszero(gt(searchLength, subjectLength)) {
                let subjectSearchEnd := add(sub(subjectEnd, searchLength), 1)
                let h := 0
                if iszero(lt(searchLength, 0x20)) { h := keccak256(search, searchLength) }
                let m := shl(3, sub(0x20, and(searchLength, 0x1f)))
                let s := mload(search)
                for {} 1 {} {
                    let t := mload(subject)
                    // Whether the first `searchLength % 32` bytes of
                    // `subject` and `search` matches.
                    if iszero(shr(m, xor(t, s))) {
                        if h {
                            if iszero(eq(keccak256(subject, searchLength), h)) {
                                mstore(result, t)
                                result := add(result, 1)
                                subject := add(subject, 1)
                                if iszero(lt(subject, subjectSearchEnd)) { break }
                                continue
                            }
                        }
                        // Copy the `replacement` one word at a time.
                        for { let o := 0 } 1 {} {
                            mstore(add(result, o), mload(add(replacement, o)))
                            o := add(o, 0x20)
                            if iszero(lt(o, replacementLength)) { break }
                        }
                        result := add(result, replacementLength)
                        subject := add(subject, searchLength)
                        if searchLength {
                            if iszero(lt(subject, subjectSearchEnd)) { break }
                            continue
                        }
                    }
                    mstore(result, t)
                    result := add(result, 1)
                    subject := add(subject, 1)
                    if iszero(lt(subject, subjectSearchEnd)) { break }
                }
            }

            let resultRemainder := result
            result := add(mload(0x40), 0x20)
            let k := add(sub(resultRemainder, result), sub(subjectEnd, subject))
            // Copy the rest of the string one word at a time.
            for {} lt(subject, subjectEnd) {} {
                mstore(resultRemainder, mload(subject))
                resultRemainder := add(resultRemainder, 0x20)
                subject := add(subject, 0x20)
            }
            result := sub(result, 0x20)
            let last := add(add(result, 0x20), k) // Zeroize the slot after the string.
            mstore(last, 0)
            mstore(0x40, add(last, 0x20)) // Allocate the memory.
            mstore(result, k) // Store the length.
        }
    }

    /// @dev Returns the byte index of the first location of `search` in `subject`,
    /// searching from left to right, starting from `from`.
    /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found.
    function indexOf(string memory subject, string memory search, uint256 from)
        internal
        pure
        returns (uint256 result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            for { let subjectLength := mload(subject) } 1 {} {
                if iszero(mload(search)) {
                    if iszero(gt(from, subjectLength)) {
                        result := from
                        break
                    }
                    result := subjectLength
                    break
                }
                let searchLength := mload(search)
                let subjectStart := add(subject, 0x20)

                result := not(0) // Initialize to `NOT_FOUND`.

                subject := add(subjectStart, from)
                let end := add(sub(add(subjectStart, subjectLength), searchLength), 1)

                let m := shl(3, sub(0x20, and(searchLength, 0x1f)))
                let s := mload(add(search, 0x20))

                if iszero(and(lt(subject, end), lt(from, subjectLength))) { break }

                if iszero(lt(searchLength, 0x20)) {
                    for { let h := keccak256(add(search, 0x20), searchLength) } 1 {} {
                        if iszero(shr(m, xor(mload(subject), s))) {
                            if eq(keccak256(subject, searchLength), h) {
                                result := sub(subject, subjectStart)
                                break
                            }
                        }
                        subject := add(subject, 1)
                        if iszero(lt(subject, end)) { break }
                    }
                    break
                }
                for {} 1 {} {
                    if iszero(shr(m, xor(mload(subject), s))) {
                        result := sub(subject, subjectStart)
                        break
                    }
                    subject := add(subject, 1)
                    if iszero(lt(subject, end)) { break }
                }
                break
            }
        }
    }

    /// @dev Returns the byte index of the first location of `search` in `subject`,
    /// searching from left to right.
    /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found.
    function indexOf(string memory subject, string memory search)
        internal
        pure
        returns (uint256 result)
    {
        result = indexOf(subject, search, 0);
    }

    /// @dev Returns the byte index of the first location of `search` in `subject`,
    /// searching from right to left, starting from `from`.
    /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found.
    function lastIndexOf(string memory subject, string memory search, uint256 from)
        internal
        pure
        returns (uint256 result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            for {} 1 {} {
                result := not(0) // Initialize to `NOT_FOUND`.
                let searchLength := mload(search)
                if gt(searchLength, mload(subject)) { break }
                let w := result

                let fromMax := sub(mload(subject), searchLength)
                if iszero(gt(fromMax, from)) { from := fromMax }

                let end := add(add(subject, 0x20), w)
                subject := add(add(subject, 0x20), from)
                if iszero(gt(subject, end)) { break }
                // As this function is not too often used,
                // we shall simply use keccak256 for smaller bytecode size.
                for { let h := keccak256(add(search, 0x20), searchLength) } 1 {} {
                    if eq(keccak256(subject, searchLength), h) {
                        result := sub(subject, add(end, 1))
                        break
                    }
                    subject := add(subject, w) // `sub(subject, 1)`.
                    if iszero(gt(subject, end)) { break }
                }
                break
            }
        }
    }

    /// @dev Returns the byte index of the first location of `search` in `subject`,
    /// searching from right to left.
    /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found.
    function lastIndexOf(string memory subject, string memory search)
        internal
        pure
        returns (uint256 result)
    {
        result = lastIndexOf(subject, search, uint256(int256(-1)));
    }

    /// @dev Returns true if `search` is found in `subject`, false otherwise.
    function contains(string memory subject, string memory search) internal pure returns (bool) {
        return indexOf(subject, search) != NOT_FOUND;
    }

    /// @dev Returns whether `subject` starts with `search`.
    function startsWith(string memory subject, string memory search)
        internal
        pure
        returns (bool result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let searchLength := mload(search)
            // Just using keccak256 directly is actually cheaper.
            // forgefmt: disable-next-item
            result := and(
                iszero(gt(searchLength, mload(subject))),
                eq(
                    keccak256(add(subject, 0x20), searchLength),
                    keccak256(add(search, 0x20), searchLength)
                )
            )
        }
    }

    /// @dev Returns whether `subject` ends with `search`.
    function endsWith(string memory subject, string memory search)
        internal
        pure
        returns (bool result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let searchLength := mload(search)
            let subjectLength := mload(subject)
            // Whether `search` is not longer than `subject`.
            let withinRange := iszero(gt(searchLength, subjectLength))
            // Just using keccak256 directly is actually cheaper.
            // forgefmt: disable-next-item
            result := and(
                withinRange,
                eq(
                    keccak256(
                        // `subject + 0x20 + max(subjectLength - searchLength, 0)`.
                        add(add(subject, 0x20), mul(withinRange, sub(subjectLength, searchLength))),
                        searchLength
                    ),
                    keccak256(add(search, 0x20), searchLength)
                )
            )
        }
    }

    /// @dev Returns `subject` repeated `times`.
    function repeat(string memory subject, uint256 times)
        internal
        pure
        returns (string memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let subjectLength := mload(subject)
            if iszero(or(iszero(times), iszero(subjectLength))) {
                subject := add(subject, 0x20)
                result := mload(0x40)
                let output := add(result, 0x20)
                for {} 1 {} {
                    // Copy the `subject` one word at a time.
                    for { let o := 0 } 1 {} {
                        mstore(add(output, o), mload(add(subject, o)))
                        o := add(o, 0x20)
                        if iszero(lt(o, subjectLength)) { break }
                    }
                    output := add(output, subjectLength)
                    times := sub(times, 1)
                    if iszero(times) { break }
                }
                mstore(output, 0) // Zeroize the slot after the string.
                let resultLength := sub(output, add(result, 0x20))
                mstore(result, resultLength) // Store the length.
                // Allocate the memory.
                mstore(0x40, add(result, add(resultLength, 0x20)))
            }
        }
    }

    /// @dev Returns a copy of `subject` sliced from `start` to `end` (exclusive).
    /// `start` and `end` are byte offsets.
    function slice(string memory subject, uint256 start, uint256 end)
        internal
        pure
        returns (string memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let subjectLength := mload(subject)
            if iszero(gt(subjectLength, end)) { end := subjectLength }
            if iszero(gt(subjectLength, start)) { start := subjectLength }
            if lt(start, end) {
                result := mload(0x40)
                let resultLength := sub(end, start)
                mstore(result, resultLength)
                subject := add(subject, start)
                let w := not(0x1f)
                // Copy the `subject` one word at a time, backwards.
                for { let o := and(add(resultLength, 0x1f), w) } 1 {} {
                    mstore(add(result, o), mload(add(subject, o)))
                    o := add(o, w) // `sub(o, 0x20)`.
                    if iszero(o) { break }
                }
                // Zeroize the slot after the string.
                mstore(add(add(result, 0x20), resultLength), 0)
                // Allocate memory for the length and the bytes,
                // rounded up to a multiple of 32.
                mstore(0x40, add(result, and(add(resultLength, 0x3f), w)))
            }
        }
    }

    /// @dev Returns a copy of `subject` sliced from `start` to the end of the string.
    /// `start` is a byte offset.
    function slice(string memory subject, uint256 start)
        internal
        pure
        returns (string memory result)
    {
        result = slice(subject, start, uint256(int256(-1)));
    }

    /// @dev Returns all the indices of `search` in `subject`.
    /// The indices are byte offsets.
    function indicesOf(string memory subject, string memory search)
        internal
        pure
        returns (uint256[] memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let subjectLength := mload(subject)
            let searchLength := mload(search)

            if iszero(gt(searchLength, subjectLength)) {
                subject := add(subject, 0x20)
                search := add(search, 0x20)
                result := add(mload(0x40), 0x20)

                let subjectStart := subject
                let subjectSearchEnd := add(sub(add(subject, subjectLength), searchLength), 1)
                let h := 0
                if iszero(lt(searchLength, 0x20)) { h := keccak256(search, searchLength) }
                let m := shl(3, sub(0x20, and(searchLength, 0x1f)))
                let s := mload(search)
                for {} 1 {} {
                    let t := mload(subject)
                    // Whether the first `searchLength % 32` bytes of
                    // `subject` and `search` matches.
                    if iszero(shr(m, xor(t, s))) {
                        if h {
                            if iszero(eq(keccak256(subject, searchLength), h)) {
                                subject := add(subject, 1)
                                if iszero(lt(subject, subjectSearchEnd)) { break }
                                continue
                            }
                        }
                        // Append to `result`.
                        mstore(result, sub(subject, subjectStart))
                        result := add(result, 0x20)
                        // Advance `subject` by `searchLength`.
                        subject := add(subject, searchLength)
                        if searchLength {
                            if iszero(lt(subject, subjectSearchEnd)) { break }
                            continue
                        }
                    }
                    subject := add(subject, 1)
                    if iszero(lt(subject, subjectSearchEnd)) { break }
                }
                let resultEnd := result
                // Assign `result` to the free memory pointer.
                result := mload(0x40)
                // Store the length of `result`.
                mstore(result, shr(5, sub(resultEnd, add(result, 0x20))))
                // Allocate memory for result.
                // We allocate one more word, so this array can be recycled for {split}.
                mstore(0x40, add(resultEnd, 0x20))
            }
        }
    }

    /// @dev Returns a arrays of strings based on the `delimiter` inside of the `subject` string.
    function split(string memory subject, string memory delimiter)
        internal
        pure
        returns (string[] memory result)
    {
        uint256[] memory indices = indicesOf(subject, delimiter);
        /// @solidity memory-safe-assembly
        assembly {
            let w := not(0x1f)
            let indexPtr := add(indices, 0x20)
            let indicesEnd := add(indexPtr, shl(5, add(mload(indices), 1)))
            mstore(add(indicesEnd, w), mload(subject))
            mstore(indices, add(mload(indices), 1))
            let prevIndex := 0
            for {} 1 {} {
                let index := mload(indexPtr)
                mstore(indexPtr, 0x60)
                if iszero(eq(index, prevIndex)) {
                    let element := mload(0x40)
                    let elementLength := sub(index, prevIndex)
                    mstore(element, elementLength)
                    // Copy the `subject` one word at a time, backwards.
                    for { let o := and(add(elementLength, 0x1f), w) } 1 {} {
                        mstore(add(element, o), mload(add(add(subject, prevIndex), o)))
                        o := add(o, w) // `sub(o, 0x20)`.
                        if iszero(o) { break }
                    }
                    // Zeroize the slot after the string.
                    mstore(add(add(element, 0x20), elementLength), 0)
                    // Allocate memory for the length and the bytes,
                    // rounded up to a multiple of 32.
                    mstore(0x40, add(element, and(add(elementLength, 0x3f), w)))
                    // Store the `element` into the array.
                    mstore(indexPtr, element)
                }
                prevIndex := add(index, mload(delimiter))
                indexPtr := add(indexPtr, 0x20)
                if iszero(lt(indexPtr, indicesEnd)) { break }
            }
            result := indices
            if iszero(mload(delimiter)) {
                result := add(indices, 0x20)
                mstore(result, sub(mload(indices), 2))
            }
        }
    }

    /// @dev Returns a concatenated string of `a` and `b`.
    /// Cheaper than `string.concat()` and does not de-align the free memory pointer.
    function concat(string memory a, string memory b)
        internal
        pure
        returns (string memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let w := not(0x1f)
            result := mload(0x40)
            let aLength := mload(a)
            // Copy `a` one word at a time, backwards.
            for { let o := and(add(aLength, 0x20), w) } 1 {} {
                mstore(add(result, o), mload(add(a, o)))
                o := add(o, w) // `sub(o, 0x20)`.
                if iszero(o) { break }
            }
            let bLength := mload(b)
            let output := add(result, aLength)
            // Copy `b` one word at a time, backwards.
            for { let o := and(add(bLength, 0x20), w) } 1 {} {
                mstore(add(output, o), mload(add(b, o)))
                o := add(o, w) // `sub(o, 0x20)`.
                if iszero(o) { break }
            }
            let totalLength := add(aLength, bLength)
            let last := add(add(result, 0x20), totalLength)
            // Zeroize the slot after the string.
            mstore(last, 0)
            // Stores the length.
            mstore(result, totalLength)
            // Allocate memory for the length and the bytes,
            // rounded up to a multiple of 32.
            mstore(0x40, and(add(last, 0x1f), w))
        }
    }

    /// @dev Returns a copy of the string in either lowercase or UPPERCASE.
    /// WARNING! This function is only compatible with 7-bit ASCII strings.
    function toCase(string memory subject, bool toUpper)
        internal
        pure
        returns (string memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let length := mload(subject)
            if length {
                result := add(mload(0x40), 0x20)
                subject := add(subject, 1)
                let flags := shl(add(70, shl(5, toUpper)), 0x3ffffff)
                let w := not(0)
                for { let o := length } 1 {} {
                    o := add(o, w)
                    let b := and(0xff, mload(add(subject, o)))
                    mstore8(add(result, o), xor(b, and(shr(b, flags), 0x20)))
                    if iszero(o) { break }
                }
                result := mload(0x40)
                mstore(result, length) // Store the length.
                let last := add(add(result, 0x20), length)
                mstore(last, 0) // Zeroize the slot after the string.
                mstore(0x40, add(last, 0x20)) // Allocate the memory.
            }
        }
    }

    /// @dev Returns a string from a small bytes32 string.
    /// `s` must be null-terminated, or behavior will be undefined.
    function fromSmallString(bytes32 s) internal pure returns (string memory result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := mload(0x40)
            let n := 0
            for {} byte(n, s) { n := add(n, 1) } {} // Scan for '\0'.
            mstore(result, n)
            let o := add(result, 0x20)
            mstore(o, s)
            mstore(add(o, n), 0)
            mstore(0x40, add(result, 0x40))
        }
    }

    /// @dev Returns the small string, with all bytes after the first null byte zeroized.
    function normalizeSmallString(bytes32 s) internal pure returns (bytes32 result) {
        /// @solidity memory-safe-assembly
        assembly {
            for {} byte(result, s) { result := add(result, 1) } {} // Scan for '\0'.
            mstore(0x00, s)
            mstore(result, 0x00)
            result := mload(0x00)
        }
    }

    /// @dev Returns the string as a normalized null-terminated small string.
    function toSmallString(string memory s) internal pure returns (bytes32 result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := mload(s)
            if iszero(lt(result, 33)) {
                mstore(0x00, 0xec92f9a3) // `TooBigForSmallString()`.
                revert(0x1c, 0x04)
            }
            result := shl(shl(3, sub(32, result)), mload(add(s, result)))
        }
    }

    /// @dev Returns a lowercased copy of the string.
    /// WARNING! This function is only compatible with 7-bit ASCII strings.
    function lower(string memory subject) internal pure returns (string memory result) {
        result = toCase(subject, false);
    }

    /// @dev Returns an UPPERCASED copy of the string.
    /// WARNING! This function is only compatible with 7-bit ASCII strings.
    function upper(string memory subject) internal pure returns (string memory result) {
        result = toCase(subject, true);
    }

    /// @dev Escapes the string to be used within HTML tags.
    function escapeHTML(string memory s) internal pure returns (string memory result) {
        /// @solidity memory-safe-assembly
        assembly {
            let end := add(s, mload(s))
            result := add(mload(0x40), 0x20)
            // Store the bytes of the packed offsets and strides into the scratch space.
            // `packed = (stride << 5) | offset`. Max offset is 20. Max stride is 6.
            mstore(0x1f, 0x900094)
            mstore(0x08, 0xc0000000a6ab)
            // Store "&quot;&amp;&#39;&lt;&gt;" into the scratch space.
            mstore(0x00, shl(64, 0x2671756f743b26616d703b262333393b266c743b2667743b))
            for {} iszero(eq(s, end)) {} {
                s := add(s, 1)
                let c := and(mload(s), 0xff)
                // Not in `["\"","'","&","<",">"]`.
                if iszero(and(shl(c, 1), 0x500000c400000000)) {
                    mstore8(result, c)
                    result := add(result, 1)
                    continue
                }
                let t := shr(248, mload(c))
                mstore(result, mload(and(t, 0x1f)))
                result := add(result, shr(5, t))
            }
            let last := result
            mstore(last, 0) // Zeroize the slot after the string.
            result := mload(0x40)
            mstore(result, sub(last, add(result, 0x20))) // Store the length.
            mstore(0x40, add(last, 0x20)) // Allocate the memory.
        }
    }

    /// @dev Escapes the string to be used within double-quotes in a JSON.
    /// If `addDoubleQuotes` is true, the result will be enclosed in double-quotes.
    function escapeJSON(string memory s, bool addDoubleQuotes)
        internal
        pure
        returns (string memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let end := add(s, mload(s))
            result := add(mload(0x40), 0x20)
            if addDoubleQuotes {
                mstore8(result, 34)
                result := add(1, result)
            }
            // Store "\\u0000" in scratch space.
            // Store "0123456789abcdef" in scratch space.
            // Also, store `{0x08:"b", 0x09:"t", 0x0a:"n", 0x0c:"f", 0x0d:"r"}`.
            // into the scratch space.
            mstore(0x15, 0x5c75303030303031323334353637383961626364656662746e006672)
            // Bitmask for detecting `["\"","\\"]`.
            let e := or(shl(0x22, 1), shl(0x5c, 1))
            for {} iszero(eq(s, end)) {} {
                s := add(s, 1)
                let c := and(mload(s), 0xff)
                if iszero(lt(c, 0x20)) {
                    if iszero(and(shl(c, 1), e)) {
                        // Not in `["\"","\\"]`.
                        mstore8(result, c)
                        result := add(result, 1)
                        continue
                    }
                    mstore8(result, 0x5c) // "\\".
                    mstore8(add(result, 1), c)
                    result := add(result, 2)
                    continue
                }
                if iszero(and(shl(c, 1), 0x3700)) {
                    // Not in `["\b","\t","\n","\f","\d"]`.
                    mstore8(0x1d, mload(shr(4, c))) // Hex value.
                    mstore8(0x1e, mload(and(c, 15))) // Hex value.
                    mstore(result, mload(0x19)) // "\\u00XX".
                    result := add(result, 6)
                    continue
                }
                mstore8(result, 0x5c) // "\\".
                mstore8(add(result, 1), mload(add(c, 8)))
                result := add(result, 2)
            }
            if addDoubleQuotes {
                mstore8(result, 34)
                result := add(1, result)
            }
            let last := result
            mstore(last, 0) // Zeroize the slot after the string.
            result := mload(0x40)
            mstore(result, sub(last, add(result, 0x20))) // Store the length.
            mstore(0x40, add(last, 0x20)) // Allocate the memory.
        }
    }

    /// @dev Escapes the string to be used within double-quotes in a JSON.
    function escapeJSON(string memory s) internal pure returns (string memory result) {
        result = escapeJSON(s, false);
    }

    /// @dev Returns whether `a` equals `b`.
    function eq(string memory a, string memory b) internal pure returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := eq(keccak256(add(a, 0x20), mload(a)), keccak256(add(b, 0x20), mload(b)))
        }
    }

    /// @dev Returns whether `a` equals `b`, where `b` is a null-terminated small string.
    function eqs(string memory a, bytes32 b) internal pure returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            // These should be evaluated on compile time, as far as possible.
            let m := not(shl(7, div(not(iszero(b)), 255))) // `0x7f7f ...`.
            let x := not(or(m, or(b, add(m, and(b, m)))))
            let r := shl(7, iszero(iszero(shr(128, x))))
            r := or(r, shl(6, iszero(iszero(shr(64, shr(r, x))))))
            r := or(r, shl(5, lt(0xffffffff, shr(r, x))))
            r := or(r, shl(4, lt(0xffff, shr(r, x))))
            r := or(r, shl(3, lt(0xff, shr(r, x))))
            // forgefmt: disable-next-item
            result := gt(eq(mload(a), add(iszero(x), xor(31, shr(3, r)))),
                xor(shr(add(8, r), b), shr(add(8, r), mload(add(a, 0x20)))))
        }
    }

    /// @dev Packs a single string with its length into a single word.
    /// Returns `bytes32(0)` if the length is zero or greater than 31.
    function packOne(string memory a) internal pure returns (bytes32 result) {
        /// @solidity memory-safe-assembly
        assembly {
            // We don't need to zero right pad the string,
            // since this is our own custom non-standard packing scheme.
            result :=
                mul(
                    // Load the length and the bytes.
                    mload(add(a, 0x1f)),
                    // `length != 0 && length < 32`. Abuses underflow.
                    // Assumes that the length is valid and within the block gas limit.
                    lt(sub(mload(a), 1), 0x1f)
                )
        }
    }

    /// @dev Unpacks a string packed using {packOne}.
    /// Returns the empty string if `packed` is `bytes32(0)`.
    /// If `packed` is not an output of {packOne}, the output behavior is undefined.
    function unpackOne(bytes32 packed) internal pure returns (string memory result) {
        /// @solidity memory-safe-assembly
        assembly {
            // Grab the free memory pointer.
            result := mload(0x40)
            // Allocate 2 words (1 for the length, 1 for the bytes).
            mstore(0x40, add(result, 0x40))
            // Zeroize the length slot.
            mstore(result, 0)
            // Store the length and bytes.
            mstore(add(result, 0x1f), packed)
            // Right pad with zeroes.
            mstore(add(add(result, 0x20), mload(result)), 0)
        }
    }

    /// @dev Packs two strings with their lengths into a single word.
    /// Returns `bytes32(0)` if combined length is zero or greater than 30.
    function packTwo(string memory a, string memory b) internal pure returns (bytes32 result) {
        /// @solidity memory-safe-assembly
        assembly {
            let aLength := mload(a)
            // We don't need to zero right pad the strings,
            // since this is our own custom non-standard packing scheme.
            result :=
                mul(
                    // Load the length and the bytes of `a` and `b`.
                    or(
                        shl(shl(3, sub(0x1f, aLength)), mload(add(a, aLength))),
                        mload(sub(add(b, 0x1e), aLength))
                    ),
                    // `totalLength != 0 && totalLength < 31`. Abuses underflow.
                    // Assumes that the lengths are valid and within the block gas limit.
                    lt(sub(add(aLength, mload(b)), 1), 0x1e)
                )
        }
    }

    /// @dev Unpacks strings packed using {packTwo}.
    /// Returns the empty strings if `packed` is `bytes32(0)`.
    /// If `packed` is not an output of {packTwo}, the output behavior is undefined.
    function unpackTwo(bytes32 packed)
        internal
        pure
        returns (string memory resultA, string memory resultB)
    {
        /// @solidity memory-safe-assembly
        assembly {
            // Grab the free memory pointer.
            resultA := mload(0x40)
            resultB := add(resultA, 0x40)
            // Allocate 2 words for each string (1 for the length, 1 for the byte). Total 4 words.
            mstore(0x40, add(resultB, 0x40))
            // Zeroize the length slots.
            mstore(resultA, 0)
            mstore(resultB, 0)
            // Store the lengths and bytes.
            mstore(add(resultA, 0x1f), packed)
            mstore(add(resultB, 0x1f), mload(add(add(resultA, 0x20), mload(resultA))))
            // Right pad with zeroes.
            mstore(add(add(resultA, 0x20), mload(resultA)), 0)
            mstore(add(add(resultB, 0x20), mload(resultB)), 0)
        }
    }

    /// @dev Directly returns `a` without copying.
    function directReturn(string memory a) internal pure {
        assembly {
            // Assumes that the string does not start from the scratch space.
            let retStart := sub(a, 0x20)
            let retUnpaddedSize := add(mload(a), 0x40)
            // Right pad with zeroes. Just in case the string is produced
            // by a method that doesn't zero right pad.
            mstore(add(retStart, retUnpaddedSize), 0)
            // Store the return offset.
            mstore(retStart, 0x20)
            // End the transaction, returning the string.
            return(retStart, and(not(0x1f), add(0x1f, retUnpaddedSize)))
        }
    }
}

Settings
{
  "remappings": [
    "dn404/=lib/dn404/src/",
    "forge-std/=lib/forge-std/src/",
    "solady/=lib/solady/src/",
    "nft-metadata-renderer/=lib/nft-metadata-renderer/src/",
    "ds-test/=lib/uniform-random-number/lib/forge-std/lib/ds-test/src/",
    "openzeppelin/=lib/uniform-random-number/lib/openzeppelin-contracts/contracts/",
    "uniform-random-number/=lib/uniform-random-number/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"deployer","type":"address"},{"internalType":"uint16","name":"royaltyBPS_","type":"uint16"},{"internalType":"address","name":"royaltyRecipient_","type":"address"},{"components":[{"internalType":"string","name":"description","type":"string"},{"internalType":"string","name":"externalURL","type":"string"},{"internalType":"string","name":"contractImageURL","type":"string"},{"internalType":"string","name":"tokenImageURL","type":"string"},{"internalType":"string","name":"encryptedAlbumURL","type":"string"},{"internalType":"string","name":"decryptionKeysURL","type":"string"},{"internalType":"string","name":"credits","type":"string"}],"internalType":"struct ITokenMirror.TokenConfig","name":"tokenConfig_","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyLinked","type":"error"},{"inputs":[],"name":"FnSelectorNotRecognized","type":"error"},{"inputs":[],"name":"NotLinked","type":"error"},{"inputs":[],"name":"RoyaltyOverflow","type":"error"},{"inputs":[],"name":"RoyaltyReceiverIsZeroAddress","type":"error"},{"inputs":[],"name":"SenderNotBase","type":"error"},{"inputs":[],"name":"SenderNotDeployer","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","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":"isApproved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"BatchMetadataUpdate","type":"event"},{"anonymous":false,"inputs":[],"name":"ContractURIUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"credits","type":"string"},{"indexed":false,"internalType":"string","name":"decryptionKeysURL","type":"string"},{"indexed":false,"internalType":"string","name":"tokenImageURL","type":"string"}],"name":"MediaUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Transfer","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"nftOwner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseERC20","outputs":[{"internalType":"address","name":"base","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nftOwner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"ownerAt","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pullOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fromTokenId","type":"uint256"},{"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"refreshMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","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":"result","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"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":"id","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"string","name":"credits_","type":"string"},{"internalType":"string","name":"decryptionKeysURL_","type":"string"},{"internalType":"string","name":"tokenImageURL_","type":"string"}],"name":"upsertMedia","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a060405234801561001057600080fd5b50604051612bdd380380612bdd83398101604081905261002f9161027f565b683602298b8c10b0123180546001600160a01b0319166001600160a01b0386161790556100608261ffff8516610126565b805181906000908190610073908261048a565b5060208201516001820190610088908261048a565b506040820151600282019061009d908261048a565b50606082015160038201906100b2908261048a565b50608082015160048201906100c7908261048a565b5060a082015160058201906100dc908261048a565b5060c082015160068201906100f1908261048a565b50506040517fa5d4097edda6d87cb9329af83fb3712ef77eeb13738ffe43cc35a4ce305ad9629150600090a150505050610549565b6001600160601b0316612710808211156101485763350a88b36000526004601cfd5b8260601b8061015f5763b4457eaa6000526004601cfd5b90911768aa4ec00224afccfdb7555050565b80516001600160a01b038116811461018857600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b03811182821017156101c5576101c561018d565b60405290565b604051601f8201601f191681016001600160401b03811182821017156101f3576101f361018d565b604052919050565b600082601f83011261020c57600080fd5b81516001600160401b038111156102255761022561018d565b6020610239601f8301601f191682016101cb565b828152858284870101111561024d57600080fd5b60005b8381101561026b578581018301518282018401528201610250565b506000928101909101919091529392505050565b6000806000806080858703121561029557600080fd5b61029e85610171565b9350602085015161ffff811681146102b557600080fd5b92506102c360408601610171565b60608601519092506001600160401b03808211156102e057600080fd5b9086019060e082890312156102f457600080fd5b6102fc6101a3565b82518281111561030b57600080fd5b6103178a8286016101fb565b82525060208301518281111561032c57600080fd5b6103388a8286016101fb565b60208301525060408301518281111561035057600080fd5b61035c8a8286016101fb565b60408301525060608301518281111561037457600080fd5b6103808a8286016101fb565b60608301525060808301518281111561039857600080fd5b6103a48a8286016101fb565b60808301525060a0830151828111156103bc57600080fd5b6103c88a8286016101fb565b60a08301525060c0830151828111156103e057600080fd5b6103ec8a8286016101fb565b60c0830152509598949750929550505050565b600181811c9082168061041357607f821691505b60208210810361043357634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610485576000816000526020600020601f850160051c810160208610156104625750805b601f850160051c820191505b818110156104815782815560010161046e565b5050505b505050565b81516001600160401b038111156104a3576104a361018d565b6104b7816104b184546103ff565b84610439565b602080601f8311600181146104ec57600084156104d45750858301515b600019600386901b1c1916600185901b178555610481565b600085815260208120601f198616915b8281101561051b578886015182559484019460019091019084016104fc565b50858210156105395787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805161267c6105616000396000505061267c6000f3fe6080604052600436106101395760003560e01c80636cef16e6116100ab578063a22cb4651161006f578063a22cb4651461058a578063aeb4c867146105aa578063b88d4fde146105ca578063c87b56dd146105dd578063e8a3d485146105fd578063e985e9c5146106125761014b565b80636cef16e61461050557806370a082311461051a5780638da5cb5b1461053a57806395d89b411461056057806397e5311c146105755761014b565b806323b872dd116100fd57806323b872dd1461044057806324359879146104535780632a55205a1461047357806342842e0e146104b25780636352211e146104c557806369bfdcdf146104e55761014b565b806301ffc9a71461034b57806306fdde03146103b0578063081812fc146103d2578063095ea7b31461040a57806318160ddd1461041d5761014b565b3661014b57341561014957600080fd5b005b683602298b8c10b0123060003560e01c63263c69d68190036102015781546001600160a01b0316331461019157604051631b1e598960e11b815260040160405180910390fd5b600435602401602081033560051b81015b8082146101f45781358060601c816001168260a01b60a81c811583028284027fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600038a45050508160200191506101a2565b5050600160005260206000f35b8063144027d3036102975781546001600160a01b0316331461023657604051631b1e598960e11b815260040160405180910390fd5b600435602435604435602401602081033560051b81015b80821461028857813583857fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600038a481602001915061024d565b50505050600160005260206000f35b80630f4599e5036103325760018201546001600160a01b0316156102ed5760018201546001600160a01b03166004356001600160a01b0316146102ed576040516362cf623d60e11b815260040160405180910390fd5b81546001600160a01b03161561031657604051635fb2b52360e11b815260040160405180910390fd5b81546001600160a01b0319163317825560016000908152602090f35b604051631e085ca760e11b815260040160405180910390fd5b34801561035757600080fd5b5061039b610366366004611c00565b60008160e01c63e8a3d4858114632a55205a821417635b5e139f8214176380ac58cd82146301ffc9a783141717915050919050565b60405190151581526020015b60405180910390f35b3480156103bc57600080fd5b506103c5610632565b6040516103a79190611c55565b3480156103de57600080fd5b506103f26103ed366004611c88565b610648565b6040516001600160a01b0390911681526020016103a7565b610149610418366004611cbd565b610660565b34801561042957600080fd5b506104326106e6565b6040519081526020016103a7565b61014961044e366004611ce7565b6106f8565b34801561045f57600080fd5b506103f261046e366004611c88565b610787565b34801561047f57600080fd5b5061049361048e366004611d23565b610799565b604080516001600160a01b0390931683526020830191909152016103a7565b6101496104c0366004611ce7565b6107ee565b3480156104d157600080fd5b506103f26104e0366004611c88565b610820565b3480156104f157600080fd5b50610149610500366004611d23565b610832565b34801561051157600080fd5b5061039b6108a1565b34801561052657600080fd5b50610432610535366004611d45565b61095c565b34801561054657600080fd5b50683602298b8c10b01232546001600160a01b03166103f2565b34801561056c57600080fd5b506103c5610977565b34801561058157600080fd5b506103f2610988565b34801561059657600080fd5b506101496105a5366004611d60565b6109bd565b3480156105b657600080fd5b506101496105c5366004611de5565b610a40565b6101496105d8366004611e7f565b610b71565b3480156105e957600080fd5b506103c56105f8366004611c88565b610bcc565b34801561060957600080fd5b506103c5610ec3565b34801561061e57600080fd5b5061039b61062d366004611eee565b6112d5565b60606106436306fdde036000611301565b905090565b600061065a6327ef5495836000611367565b92915050565b600061066a610988565b90508260601b60601c925060405163d10b6e0c600052836020528260405233606052602060006064601c34865af1601f3d11166106aa573d6000823e3d81fd5b806040525060006060528183600c5160601c7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600038a4505050565b600061064363e2c79281600080611367565b6000610702610988565b90508360601b60601c93508260601b60601c925060405163e5eb36c881528460208201528360408201528260608201523360808201526020816084601c840134865af1600182511416610758573d6000823e3d81fd5b508183857fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600038a450505050565b600061065a63c016aa52836000611367565b600082815268aa4ec00224afccfdb76020526040812054606081901c919061271090836107cd576020515490508060601c93505b606084901b1884600019829004811182023d3d3e9396930204935090915050565b6107f98383836106f8565b813b1561081b5761081b838383604051806020016040528060008152506113af565b505050565b600061065a632d8a746e836000611367565b683602298b8c10b01230546001600160a01b03163314610864576040516282b42960e81b815260040160405180910390fd5b60408051838152602081018390527f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c910160405180910390a15050565b60008060006108ae610988565b9050638da5cb5b600052602060006004601c845afa600c51683602298b8c10b0123254601f3d119290921660609190911c029250683602298b8c10b01230906001600160a01b039081169084168114610951576002820180546001600160a01b0319166001600160a01b0386811691821790925560405190918316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35b600194505050505090565b600061065a63f5b100ea836001600160a01b03166000611367565b60606106436395d89b416000611301565b683602298b8c10b01230546001600160a01b0316806109ba57604051632d9523d760e11b815260040160405180910390fd5b90565b60006109c7610988565b90508260601b60601c925060405163f6916ddd6000528360205282151560405233606052602060006064601c34865af160016000511416610a0b573d6000823e3d81fd5b83337f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160206040a36040525050600060605250565b683602298b8c10b01230546001600160a01b03163314610a72576040516282b42960e81b815260040160405180910390fd5b8415610ab0576006610a85868883611fb9565b506040517fa5d4097edda6d87cb9329af83fb3712ef77eeb13738ffe43cc35a4ce305ad96290600090a15b8215610ac5576005610ac3848683611fb9565b505b8015610b28576003610ad8828483611fb9565b506000610ae36106e6565b90508015610b26576040805160018152602081018390527f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c910160405180910390a15b505b7f739d822656484937666adaf38fb201e6758158cb04a1666a819819de86fa27d9868686868686604051610b61969594939291906120a2565b60405180910390a1505050505050565b610b7c8585856106f8565b833b15610bc557610bc585858585858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113af92505050565b5050505050565b6060610bd782610820565b506000683602298b8c10b0123054604051630e1af57b60e01b8152600481018590526001600160a01b0390911691506000908290630e1af57b90602401602060405180830381865afa158015610c31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5591906120eb565b6040805160028082526060820190925291925060009190816020015b6040805180820190915260608082526020820152815260200190600190039081610c7157905050905060405180604001604052806040518060400160405280600a81526020016974726169745f7479706560b01b81525081526020016040518060400160405280600681526020016553574f52445360d01b81525081525081600181518110610d0257610d0261210e565b602002602001018190525060405180604001604052806040518060400160405280600581526020016476616c756560d81b8152508152602001610d6660405180604001604052806006815260200165e29a94efb88f60d01b8152508560ff1661143b565b81525081600081518110610d7c57610d7c61210e565b60200260200101819052506000610d9282611497565b604051602001610da29190612140565b6040516020818303038152906040529050610eb9846001600160a01b03166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa158015610df4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610e1c9190810190612174565b60008054610e2990611f37565b80601f0160208091040260200160405190810160405280929190818152602001828054610e5590611f37565b8015610ea25780601f10610e7757610100808354040283529160200191610ea2565b820191906000526020600020905b815481529060010190602001808311610e8557829003601f168201915b5050505050610eb08661158e565b848a6000611846565b9695505050505050565b6040805160038082526080820190925260609160009190816020015b6040805180820190915260608082526020820152815260200190600190039081610edf57505060408051608081018252600591810191825264696d61676560d81b6060820152908152600280549293509091602083019190610f4090611f37565b80601f0160208091040260200160405190810160405280929190818152602001828054610f6c90611f37565b8015610fb95780601f10610f8e57610100808354040283529160200191610fb9565b820191906000526020600020905b815481529060010190602001808311610f9c57829003601f168201915b505050505081525081600281518110610fd457610fd461210e565b602002602001018190525060405180604001604052806040518060400160405280600d81526020016c65787465726e616c5f6c696e6b60981b81525081526020016000600101805461102590611f37565b80601f016020809104026020016040519081016040528092919081815260200182805461105190611f37565b801561109e5780601f106110735761010080835404028352916020019161109e565b820191906000526020600020905b81548152906001019060200180831161108157829003601f168201915b5050505050815250816001815181106110b9576110b961210e565b60200260200101819052506040518060400160405280604051806040016040528060078152602001666372656469747360c81b81525081526020016000600601805461110490611f37565b80601f016020809104026020016040519081016040528092919081815260200182805461113090611f37565b801561117d5780601f106111525761010080835404028352916020019161117d565b820191906000526020600020905b81548152906001019060200180831161116057829003601f168201915b5050505050815250816000815181106111985761119861210e565b60200260200101819052506000806111b36001612710610799565b915091506112cd6111ca683602298b8c10b0123090565b54604080516306fdde0360e01b815290516001600160a01b03909216916306fdde03916004808201926000929091908290030181865afa158015611212573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261123a9190810190612174565b6000805461124790611f37565b80601f016020809104026020016040519081016040528092919081815260200182805461127390611f37565b80156112c05780601f10611295576101008083540402835291602001916112c0565b820191906000526020600020905b8154815290600101906020018083116112a357829003601f168201915b5050505050858486611869565b935050505090565b60006112f86362fb246d846001600160a01b0316846001600160a01b0316611367565b15159392505050565b6060600061130d610988565b9050604051915083600052826020526000806024601c845afa611333573d6000833e3d82fd5b60206000803e6020600051833e8151602060005101602084013e815160208301016000815260208101604052505092915050565b600080611372610988565b9050604051856000528460205283604052602060006044601c855afa601f3d11166113a0573d6000823e3d81fd5b60405250506000519392505050565b60405163150b7a028082523360208301528560601b60601c604083015283606083015260808083015282518060a084015280156113f6578060c08401826020870160045afa505b60208360a48301601c860160008a5af1611419573d15611419573d6000843e3d83fd5b508060e01b8251146114335763d1a57ed66000526004601cfd5b505050505050565b606082518015831517611490576020840193506040519150602082015b60005b858101518282015260200182811061145b5750600019909301928101836114585760008152829003601f198101835282016040525b5092915050565b606081516000036114b657505060408051602081019091526000815290565b6000826000815181106114cb576114cb61210e565b602002602001015160000151836000815181106114ea576114ea61210e565b602002602001015160200151604051602001611507929190612216565b60408051601f19818403018152919052905060015b8351811015611490578381815181106115375761153761210e565b6020026020010151600001518482815181106115555761155561210e565b602002602001015160200151836040516020016115749392919061226b565b60408051601f19818403018152919052915060010161151c565b6040805160038082526080820190925260609160009190816020015b60408051808201909152606080825260208201528152602001906001900390816115aa57505060408051608081018252601391810191825272191958dc9e5c1d1a5bdb97dad95e5cd7dd5c9b606a1b606082015290815260058054929350909160208301919061161990611f37565b80601f016020809104026020016040519081016040528092919081815260200182805461164590611f37565b80156116925780601f1061166757610100808354040283529160200191611692565b820191906000526020600020905b81548152906001019060200180831161167557829003601f168201915b5050505050815250816000815181106116ad576116ad61210e565b6020026020010181905250604051806040016040528060405180604001604052806013815260200172195b98dc9e5c1d195917d85b189d5b57dd5c9b606a1b81525081526020016000600401805461170490611f37565b80601f016020809104026020016040519081016040528092919081815260200182805461173090611f37565b801561177d5780601f106117525761010080835404028352916020019161177d565b820191906000526020600020905b81548152906001019060200180831161176057829003601f168201915b5050505050815250816001815181106117985761179861210e565b6020026020010181905250604051806040016040528060405180604001604052806005815260200164696d61676560d81b815250815260200160006003016117e28660ff1661187b565b6040516020016117f291906122dc565b60408051601f19818403018152908290526118109291602001612304565b604051602081830303815290604052815250816002815181106118355761183561210e565b602090810291909101015292915050565b606061185e6118598888888888886118bf565b611996565b979650505050505050565b6060610eb961185987878787876119c7565b60606080604051019050602081016040526000815280600019835b928101926030600a8206018453600a900480611896575050819003601f19909101908152919050565b60608082156118f3576118d18361187b565b6040516020016118e1919061238b565b60405160208183030381529060405290505b8551606090156119285761190687611497565b60405160200161191691906123b4565b60405160208183030381529060405290505b855160609015611955578660405160200161194391906123d0565b60405160208183030381529060405290505b8961195f8761187b565b848b858560405160200161197896959493929190612415565b60405160208183030381529060405293505050509695505050505050565b60606119a182611a4e565b6040516020016119b191906124fd565b6040516020818303038152906040529050919050565b6060806000855111156119ff576119dd85611497565b6040516020016119ed91906123b4565b60405160208183030381529060405290505b8686611a0a8661187b565b611a1e866001600160a01b03166014611a5c565b84604051602001611a33959493929190612542565b60405160208183030381529060405291505095945050505050565b606061065a82600080611a82565b6060611a688383611b78565b805161307882526002016001199091019081529392505050565b606083518015611b70576003600282010460021b60405192507f4142434445464748494a4b4c4d4e4f505152535455565758595a616263646566601f526106708515027f6768696a6b6c6d6e6f707172737475767778797a303132333435363738392d5f18603f52602083018181018388602001018051600082525b60038a0199508951603f8160121c1651600053603f81600c1c1651600153603f8160061c1651600253603f811651600353506000518452600484019350828410611afe579052602001604052613d3d60f01b600384066002048083039190915260008615159091029182900352900382525b509392505050565b6060601f1960428360011b01166040510190506020810160405260008152806f30313233343536373839616263646566600f528283018203600119855b600f811651948201946001860153600f8160041c1651855360081c848303611bb5578015611beb57632194895a6000526004601cfd5b505050819003601f1990910190815292915050565b600060208284031215611c1257600080fd5b81356001600160e01b031981168114611c2a57600080fd5b9392505050565b60005b83811015611c4c578181015183820152602001611c34565b50506000910152565b6020815260008251806020840152611c74816040850160208701611c31565b601f01601f19169190910160400192915050565b600060208284031215611c9a57600080fd5b5035919050565b80356001600160a01b0381168114611cb857600080fd5b919050565b60008060408385031215611cd057600080fd5b611cd983611ca1565b946020939093013593505050565b600080600060608486031215611cfc57600080fd5b611d0584611ca1565b9250611d1360208501611ca1565b9150604084013590509250925092565b60008060408385031215611d3657600080fd5b50508035926020909101359150565b600060208284031215611d5757600080fd5b611c2a82611ca1565b60008060408385031215611d7357600080fd5b611d7c83611ca1565b915060208301358015158114611d9157600080fd5b809150509250929050565b60008083601f840112611dae57600080fd5b50813567ffffffffffffffff811115611dc657600080fd5b602083019150836020828501011115611dde57600080fd5b9250929050565b60008060008060008060608789031215611dfe57600080fd5b863567ffffffffffffffff80821115611e1657600080fd5b611e228a838b01611d9c565b90985096506020890135915080821115611e3b57600080fd5b611e478a838b01611d9c565b90965094506040890135915080821115611e6057600080fd5b50611e6d89828a01611d9c565b979a9699509497509295939492505050565b600080600080600060808688031215611e9757600080fd5b611ea086611ca1565b9450611eae60208701611ca1565b935060408601359250606086013567ffffffffffffffff811115611ed157600080fd5b611edd88828901611d9c565b969995985093965092949392505050565b60008060408385031215611f0157600080fd5b611f0a83611ca1565b9150611f1860208401611ca1565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680611f4b57607f821691505b602082108103611f6b57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561081b576000816000526020600020601f850160051c81016020861015611f9a5750805b601f850160051c820191505b8181101561143357828155600101611fa6565b67ffffffffffffffff831115611fd157611fd1611f21565b611fe583611fdf8354611f37565b83611f71565b6000601f84116001811461201957600085156120015750838201355b600019600387901b1c1916600186901b178355610bc5565b600083815260209020601f19861690835b8281101561204a578685013582556020948501946001909201910161202a565b50868210156120675760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6060815260006120b660608301888a612079565b82810360208401526120c9818789612079565b905082810360408401526120de818587612079565b9998505050505050505050565b6000602082840312156120fd57600080fd5b815160ff81168114611c2a57600080fd5b634e487b7160e01b600052603260045260246000fd5b60008151612136818560208601611c31565b9290920192915050565b607b60f81b81526000825161215c816001850160208701611c31565b607d60f81b6001939091019283015250600201919050565b60006020828403121561218657600080fd5b815167ffffffffffffffff8082111561219e57600080fd5b818401915084601f8301126121b257600080fd5b8151818111156121c4576121c4611f21565b604051601f8201601f19908116603f011681019083821181831017156121ec576121ec611f21565b8160405282815287602084870101111561220557600080fd5b61185e836020830160208801611c31565b6000601160f91b8083528451612233816001860160208901611c31565b63111d101160e11b6001918501918201528451612257816005840160208901611c31565b016005810191909152600601949350505050565b601160f91b81528351600090612288816001850160208901611c31565b63111d101160e11b60019184019182015284516122ac816005840160208901611c31565b61088b60f21b6005929091019182015283516122cf816007840160208801611c31565b0160070195945050505050565b600082516122ee818460208701611c31565b632e706e6760e01b920191825250600401919050565b600080845461231281611f37565b6001828116801561232a576001811461233f5761236e565b60ff198416875282151583028701945061236e565b8860005260208060002060005b858110156123655781548a82015290840190820161234c565b50505082870194505b505050508351612382818360208801611c31565b01949350505050565b602f60f81b8152600082516123a7816001850160208701611c31565b9190910160010192915050565b600b60fa1b8152600082516123a7816001850160208701611c31565b702c202261747472696275746573223a205b60781b815281516000906123fd816011850160208701611c31565b605d60f81b6011939091019283015250601201919050565b693d913730b6b2911d101160b11b8152865160009061243b81600a850160208c01611c31565b600160fd1b600a91840191820152875161245c81600b840160208c01611c31565b875191019061247281600b840160208b01611c31565b6211161160e91b600b92909101918201526e3232b9b1b934b83a34b7b7111d101160891b600e82015285516124ae81601d840160208a01611c31565b601160f91b601d929091019182015284516124d081601e840160208901611c31565b6124ef6124e2601e8385010187612124565b607d60f81b815260010190565b9a9950505050505050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161253581601d850160208701611c31565b91909101601d0192915050565b693d913730b6b2911d101160b11b8152855160009061256881600a850160208b01611c31565b72111610113232b9b1b934b83a34b7b7111d101160691b600a91840191820152865161259b81601d840160208b01611c31565b7f222c202273656c6c65725f6665655f62617369735f706f696e7473223a200000601d929091019182015285516125d981603b840160208a01611c31565b731610113332b2afb932b1b4b834b2b73a111d101160611b603b9290910191820152845161260e81604f840160208901611c31565b601160f91b604f92909101918201528351612630816050840160208801611c31565b6120de605082840101607d60f81b81526001019056fea264697066735822122000111603c6f5903a02ca269a7f6fc7dbd2e240bdfab63de47887e38cce7de70164736f6c63430008190033000000000000000000000000c91359dc9fea6f848797de7fd26d5610dda40d4700000000000000000000000000000000000000000000000000000000000001f400000000000000000000000079f84cdce6ca936e2d37471d5d2f8248c6317ea8000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000715265636f7264656420696e20736563726574206f766572207369782079656172732c204f6e63652055706f6e20612054696d6520696e205368616f6c696e2069732074686520736576656e74682073747564696f20616c62756d2066726f6d207468652057752d54616e6720436c616e2e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001468747470733a2f2f746865616c62756d2e636f6d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000036697066733a2f2f516d6650586b466e483554753842456135474454466f4135336262384b5a35437a7a726e7051736d7137374b61752f000000000000000000000000000000000000000000000000000000000000000000000000000000000036697066733a2f2f516d62627a384877427a326933733548344a614b6b355264627a57574672786450554b6971374a64696e76736e4a2f000000000000000000000000000000000000000000000000000000000000000000000000000000000036697066733a2f2f516d64715766387575415352356647663246466a6a4a4c776e35615741666563645a677368725271675a446670442f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000036697066733a2f2f516d53664d3877547252416958675358587a4a72344d41666137396f346d533569746f67746a7553486b474453642f00000000000000000000

Deployed Bytecode

0x6080604052600436106101395760003560e01c80636cef16e6116100ab578063a22cb4651161006f578063a22cb4651461058a578063aeb4c867146105aa578063b88d4fde146105ca578063c87b56dd146105dd578063e8a3d485146105fd578063e985e9c5146106125761014b565b80636cef16e61461050557806370a082311461051a5780638da5cb5b1461053a57806395d89b411461056057806397e5311c146105755761014b565b806323b872dd116100fd57806323b872dd1461044057806324359879146104535780632a55205a1461047357806342842e0e146104b25780636352211e146104c557806369bfdcdf146104e55761014b565b806301ffc9a71461034b57806306fdde03146103b0578063081812fc146103d2578063095ea7b31461040a57806318160ddd1461041d5761014b565b3661014b57341561014957600080fd5b005b683602298b8c10b0123060003560e01c63263c69d68190036102015781546001600160a01b0316331461019157604051631b1e598960e11b815260040160405180910390fd5b600435602401602081033560051b81015b8082146101f45781358060601c816001168260a01b60a81c811583028284027fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600038a45050508160200191506101a2565b5050600160005260206000f35b8063144027d3036102975781546001600160a01b0316331461023657604051631b1e598960e11b815260040160405180910390fd5b600435602435604435602401602081033560051b81015b80821461028857813583857fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600038a481602001915061024d565b50505050600160005260206000f35b80630f4599e5036103325760018201546001600160a01b0316156102ed5760018201546001600160a01b03166004356001600160a01b0316146102ed576040516362cf623d60e11b815260040160405180910390fd5b81546001600160a01b03161561031657604051635fb2b52360e11b815260040160405180910390fd5b81546001600160a01b0319163317825560016000908152602090f35b604051631e085ca760e11b815260040160405180910390fd5b34801561035757600080fd5b5061039b610366366004611c00565b60008160e01c63e8a3d4858114632a55205a821417635b5e139f8214176380ac58cd82146301ffc9a783141717915050919050565b60405190151581526020015b60405180910390f35b3480156103bc57600080fd5b506103c5610632565b6040516103a79190611c55565b3480156103de57600080fd5b506103f26103ed366004611c88565b610648565b6040516001600160a01b0390911681526020016103a7565b610149610418366004611cbd565b610660565b34801561042957600080fd5b506104326106e6565b6040519081526020016103a7565b61014961044e366004611ce7565b6106f8565b34801561045f57600080fd5b506103f261046e366004611c88565b610787565b34801561047f57600080fd5b5061049361048e366004611d23565b610799565b604080516001600160a01b0390931683526020830191909152016103a7565b6101496104c0366004611ce7565b6107ee565b3480156104d157600080fd5b506103f26104e0366004611c88565b610820565b3480156104f157600080fd5b50610149610500366004611d23565b610832565b34801561051157600080fd5b5061039b6108a1565b34801561052657600080fd5b50610432610535366004611d45565b61095c565b34801561054657600080fd5b50683602298b8c10b01232546001600160a01b03166103f2565b34801561056c57600080fd5b506103c5610977565b34801561058157600080fd5b506103f2610988565b34801561059657600080fd5b506101496105a5366004611d60565b6109bd565b3480156105b657600080fd5b506101496105c5366004611de5565b610a40565b6101496105d8366004611e7f565b610b71565b3480156105e957600080fd5b506103c56105f8366004611c88565b610bcc565b34801561060957600080fd5b506103c5610ec3565b34801561061e57600080fd5b5061039b61062d366004611eee565b6112d5565b60606106436306fdde036000611301565b905090565b600061065a6327ef5495836000611367565b92915050565b600061066a610988565b90508260601b60601c925060405163d10b6e0c600052836020528260405233606052602060006064601c34865af1601f3d11166106aa573d6000823e3d81fd5b806040525060006060528183600c5160601c7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600038a4505050565b600061064363e2c79281600080611367565b6000610702610988565b90508360601b60601c93508260601b60601c925060405163e5eb36c881528460208201528360408201528260608201523360808201526020816084601c840134865af1600182511416610758573d6000823e3d81fd5b508183857fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600038a450505050565b600061065a63c016aa52836000611367565b600082815268aa4ec00224afccfdb76020526040812054606081901c919061271090836107cd576020515490508060601c93505b606084901b1884600019829004811182023d3d3e9396930204935090915050565b6107f98383836106f8565b813b1561081b5761081b838383604051806020016040528060008152506113af565b505050565b600061065a632d8a746e836000611367565b683602298b8c10b01230546001600160a01b03163314610864576040516282b42960e81b815260040160405180910390fd5b60408051838152602081018390527f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c910160405180910390a15050565b60008060006108ae610988565b9050638da5cb5b600052602060006004601c845afa600c51683602298b8c10b0123254601f3d119290921660609190911c029250683602298b8c10b01230906001600160a01b039081169084168114610951576002820180546001600160a01b0319166001600160a01b0386811691821790925560405190918316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35b600194505050505090565b600061065a63f5b100ea836001600160a01b03166000611367565b60606106436395d89b416000611301565b683602298b8c10b01230546001600160a01b0316806109ba57604051632d9523d760e11b815260040160405180910390fd5b90565b60006109c7610988565b90508260601b60601c925060405163f6916ddd6000528360205282151560405233606052602060006064601c34865af160016000511416610a0b573d6000823e3d81fd5b83337f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160206040a36040525050600060605250565b683602298b8c10b01230546001600160a01b03163314610a72576040516282b42960e81b815260040160405180910390fd5b8415610ab0576006610a85868883611fb9565b506040517fa5d4097edda6d87cb9329af83fb3712ef77eeb13738ffe43cc35a4ce305ad96290600090a15b8215610ac5576005610ac3848683611fb9565b505b8015610b28576003610ad8828483611fb9565b506000610ae36106e6565b90508015610b26576040805160018152602081018390527f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c910160405180910390a15b505b7f739d822656484937666adaf38fb201e6758158cb04a1666a819819de86fa27d9868686868686604051610b61969594939291906120a2565b60405180910390a1505050505050565b610b7c8585856106f8565b833b15610bc557610bc585858585858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113af92505050565b5050505050565b6060610bd782610820565b506000683602298b8c10b0123054604051630e1af57b60e01b8152600481018590526001600160a01b0390911691506000908290630e1af57b90602401602060405180830381865afa158015610c31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5591906120eb565b6040805160028082526060820190925291925060009190816020015b6040805180820190915260608082526020820152815260200190600190039081610c7157905050905060405180604001604052806040518060400160405280600a81526020016974726169745f7479706560b01b81525081526020016040518060400160405280600681526020016553574f52445360d01b81525081525081600181518110610d0257610d0261210e565b602002602001018190525060405180604001604052806040518060400160405280600581526020016476616c756560d81b8152508152602001610d6660405180604001604052806006815260200165e29a94efb88f60d01b8152508560ff1661143b565b81525081600081518110610d7c57610d7c61210e565b60200260200101819052506000610d9282611497565b604051602001610da29190612140565b6040516020818303038152906040529050610eb9846001600160a01b03166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa158015610df4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610e1c9190810190612174565b60008054610e2990611f37565b80601f0160208091040260200160405190810160405280929190818152602001828054610e5590611f37565b8015610ea25780601f10610e7757610100808354040283529160200191610ea2565b820191906000526020600020905b815481529060010190602001808311610e8557829003601f168201915b5050505050610eb08661158e565b848a6000611846565b9695505050505050565b6040805160038082526080820190925260609160009190816020015b6040805180820190915260608082526020820152815260200190600190039081610edf57505060408051608081018252600591810191825264696d61676560d81b6060820152908152600280549293509091602083019190610f4090611f37565b80601f0160208091040260200160405190810160405280929190818152602001828054610f6c90611f37565b8015610fb95780601f10610f8e57610100808354040283529160200191610fb9565b820191906000526020600020905b815481529060010190602001808311610f9c57829003601f168201915b505050505081525081600281518110610fd457610fd461210e565b602002602001018190525060405180604001604052806040518060400160405280600d81526020016c65787465726e616c5f6c696e6b60981b81525081526020016000600101805461102590611f37565b80601f016020809104026020016040519081016040528092919081815260200182805461105190611f37565b801561109e5780601f106110735761010080835404028352916020019161109e565b820191906000526020600020905b81548152906001019060200180831161108157829003601f168201915b5050505050815250816001815181106110b9576110b961210e565b60200260200101819052506040518060400160405280604051806040016040528060078152602001666372656469747360c81b81525081526020016000600601805461110490611f37565b80601f016020809104026020016040519081016040528092919081815260200182805461113090611f37565b801561117d5780601f106111525761010080835404028352916020019161117d565b820191906000526020600020905b81548152906001019060200180831161116057829003601f168201915b5050505050815250816000815181106111985761119861210e565b60200260200101819052506000806111b36001612710610799565b915091506112cd6111ca683602298b8c10b0123090565b54604080516306fdde0360e01b815290516001600160a01b03909216916306fdde03916004808201926000929091908290030181865afa158015611212573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261123a9190810190612174565b6000805461124790611f37565b80601f016020809104026020016040519081016040528092919081815260200182805461127390611f37565b80156112c05780601f10611295576101008083540402835291602001916112c0565b820191906000526020600020905b8154815290600101906020018083116112a357829003601f168201915b5050505050858486611869565b935050505090565b60006112f86362fb246d846001600160a01b0316846001600160a01b0316611367565b15159392505050565b6060600061130d610988565b9050604051915083600052826020526000806024601c845afa611333573d6000833e3d82fd5b60206000803e6020600051833e8151602060005101602084013e815160208301016000815260208101604052505092915050565b600080611372610988565b9050604051856000528460205283604052602060006044601c855afa601f3d11166113a0573d6000823e3d81fd5b60405250506000519392505050565b60405163150b7a028082523360208301528560601b60601c604083015283606083015260808083015282518060a084015280156113f6578060c08401826020870160045afa505b60208360a48301601c860160008a5af1611419573d15611419573d6000843e3d83fd5b508060e01b8251146114335763d1a57ed66000526004601cfd5b505050505050565b606082518015831517611490576020840193506040519150602082015b60005b858101518282015260200182811061145b5750600019909301928101836114585760008152829003601f198101835282016040525b5092915050565b606081516000036114b657505060408051602081019091526000815290565b6000826000815181106114cb576114cb61210e565b602002602001015160000151836000815181106114ea576114ea61210e565b602002602001015160200151604051602001611507929190612216565b60408051601f19818403018152919052905060015b8351811015611490578381815181106115375761153761210e565b6020026020010151600001518482815181106115555761155561210e565b602002602001015160200151836040516020016115749392919061226b565b60408051601f19818403018152919052915060010161151c565b6040805160038082526080820190925260609160009190816020015b60408051808201909152606080825260208201528152602001906001900390816115aa57505060408051608081018252601391810191825272191958dc9e5c1d1a5bdb97dad95e5cd7dd5c9b606a1b606082015290815260058054929350909160208301919061161990611f37565b80601f016020809104026020016040519081016040528092919081815260200182805461164590611f37565b80156116925780601f1061166757610100808354040283529160200191611692565b820191906000526020600020905b81548152906001019060200180831161167557829003601f168201915b5050505050815250816000815181106116ad576116ad61210e565b6020026020010181905250604051806040016040528060405180604001604052806013815260200172195b98dc9e5c1d195917d85b189d5b57dd5c9b606a1b81525081526020016000600401805461170490611f37565b80601f016020809104026020016040519081016040528092919081815260200182805461173090611f37565b801561177d5780601f106117525761010080835404028352916020019161177d565b820191906000526020600020905b81548152906001019060200180831161176057829003601f168201915b5050505050815250816001815181106117985761179861210e565b6020026020010181905250604051806040016040528060405180604001604052806005815260200164696d61676560d81b815250815260200160006003016117e28660ff1661187b565b6040516020016117f291906122dc565b60408051601f19818403018152908290526118109291602001612304565b604051602081830303815290604052815250816002815181106118355761183561210e565b602090810291909101015292915050565b606061185e6118598888888888886118bf565b611996565b979650505050505050565b6060610eb961185987878787876119c7565b60606080604051019050602081016040526000815280600019835b928101926030600a8206018453600a900480611896575050819003601f19909101908152919050565b60608082156118f3576118d18361187b565b6040516020016118e1919061238b565b60405160208183030381529060405290505b8551606090156119285761190687611497565b60405160200161191691906123b4565b60405160208183030381529060405290505b855160609015611955578660405160200161194391906123d0565b60405160208183030381529060405290505b8961195f8761187b565b848b858560405160200161197896959493929190612415565b60405160208183030381529060405293505050509695505050505050565b60606119a182611a4e565b6040516020016119b191906124fd565b6040516020818303038152906040529050919050565b6060806000855111156119ff576119dd85611497565b6040516020016119ed91906123b4565b60405160208183030381529060405290505b8686611a0a8661187b565b611a1e866001600160a01b03166014611a5c565b84604051602001611a33959493929190612542565b60405160208183030381529060405291505095945050505050565b606061065a82600080611a82565b6060611a688383611b78565b805161307882526002016001199091019081529392505050565b606083518015611b70576003600282010460021b60405192507f4142434445464748494a4b4c4d4e4f505152535455565758595a616263646566601f526106708515027f6768696a6b6c6d6e6f707172737475767778797a303132333435363738392d5f18603f52602083018181018388602001018051600082525b60038a0199508951603f8160121c1651600053603f81600c1c1651600153603f8160061c1651600253603f811651600353506000518452600484019350828410611afe579052602001604052613d3d60f01b600384066002048083039190915260008615159091029182900352900382525b509392505050565b6060601f1960428360011b01166040510190506020810160405260008152806f30313233343536373839616263646566600f528283018203600119855b600f811651948201946001860153600f8160041c1651855360081c848303611bb5578015611beb57632194895a6000526004601cfd5b505050819003601f1990910190815292915050565b600060208284031215611c1257600080fd5b81356001600160e01b031981168114611c2a57600080fd5b9392505050565b60005b83811015611c4c578181015183820152602001611c34565b50506000910152565b6020815260008251806020840152611c74816040850160208701611c31565b601f01601f19169190910160400192915050565b600060208284031215611c9a57600080fd5b5035919050565b80356001600160a01b0381168114611cb857600080fd5b919050565b60008060408385031215611cd057600080fd5b611cd983611ca1565b946020939093013593505050565b600080600060608486031215611cfc57600080fd5b611d0584611ca1565b9250611d1360208501611ca1565b9150604084013590509250925092565b60008060408385031215611d3657600080fd5b50508035926020909101359150565b600060208284031215611d5757600080fd5b611c2a82611ca1565b60008060408385031215611d7357600080fd5b611d7c83611ca1565b915060208301358015158114611d9157600080fd5b809150509250929050565b60008083601f840112611dae57600080fd5b50813567ffffffffffffffff811115611dc657600080fd5b602083019150836020828501011115611dde57600080fd5b9250929050565b60008060008060008060608789031215611dfe57600080fd5b863567ffffffffffffffff80821115611e1657600080fd5b611e228a838b01611d9c565b90985096506020890135915080821115611e3b57600080fd5b611e478a838b01611d9c565b90965094506040890135915080821115611e6057600080fd5b50611e6d89828a01611d9c565b979a9699509497509295939492505050565b600080600080600060808688031215611e9757600080fd5b611ea086611ca1565b9450611eae60208701611ca1565b935060408601359250606086013567ffffffffffffffff811115611ed157600080fd5b611edd88828901611d9c565b969995985093965092949392505050565b60008060408385031215611f0157600080fd5b611f0a83611ca1565b9150611f1860208401611ca1565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680611f4b57607f821691505b602082108103611f6b57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561081b576000816000526020600020601f850160051c81016020861015611f9a5750805b601f850160051c820191505b8181101561143357828155600101611fa6565b67ffffffffffffffff831115611fd157611fd1611f21565b611fe583611fdf8354611f37565b83611f71565b6000601f84116001811461201957600085156120015750838201355b600019600387901b1c1916600186901b178355610bc5565b600083815260209020601f19861690835b8281101561204a578685013582556020948501946001909201910161202a565b50868210156120675760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6060815260006120b660608301888a612079565b82810360208401526120c9818789612079565b905082810360408401526120de818587612079565b9998505050505050505050565b6000602082840312156120fd57600080fd5b815160ff81168114611c2a57600080fd5b634e487b7160e01b600052603260045260246000fd5b60008151612136818560208601611c31565b9290920192915050565b607b60f81b81526000825161215c816001850160208701611c31565b607d60f81b6001939091019283015250600201919050565b60006020828403121561218657600080fd5b815167ffffffffffffffff8082111561219e57600080fd5b818401915084601f8301126121b257600080fd5b8151818111156121c4576121c4611f21565b604051601f8201601f19908116603f011681019083821181831017156121ec576121ec611f21565b8160405282815287602084870101111561220557600080fd5b61185e836020830160208801611c31565b6000601160f91b8083528451612233816001860160208901611c31565b63111d101160e11b6001918501918201528451612257816005840160208901611c31565b016005810191909152600601949350505050565b601160f91b81528351600090612288816001850160208901611c31565b63111d101160e11b60019184019182015284516122ac816005840160208901611c31565b61088b60f21b6005929091019182015283516122cf816007840160208801611c31565b0160070195945050505050565b600082516122ee818460208701611c31565b632e706e6760e01b920191825250600401919050565b600080845461231281611f37565b6001828116801561232a576001811461233f5761236e565b60ff198416875282151583028701945061236e565b8860005260208060002060005b858110156123655781548a82015290840190820161234c565b50505082870194505b505050508351612382818360208801611c31565b01949350505050565b602f60f81b8152600082516123a7816001850160208701611c31565b9190910160010192915050565b600b60fa1b8152600082516123a7816001850160208701611c31565b702c202261747472696275746573223a205b60781b815281516000906123fd816011850160208701611c31565b605d60f81b6011939091019283015250601201919050565b693d913730b6b2911d101160b11b8152865160009061243b81600a850160208c01611c31565b600160fd1b600a91840191820152875161245c81600b840160208c01611c31565b875191019061247281600b840160208b01611c31565b6211161160e91b600b92909101918201526e3232b9b1b934b83a34b7b7111d101160891b600e82015285516124ae81601d840160208a01611c31565b601160f91b601d929091019182015284516124d081601e840160208901611c31565b6124ef6124e2601e8385010187612124565b607d60f81b815260010190565b9a9950505050505050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161253581601d850160208701611c31565b91909101601d0192915050565b693d913730b6b2911d101160b11b8152855160009061256881600a850160208b01611c31565b72111610113232b9b1b934b83a34b7b7111d101160691b600a91840191820152865161259b81601d840160208b01611c31565b7f222c202273656c6c65725f6665655f62617369735f706f696e7473223a200000601d929091019182015285516125d981603b840160208a01611c31565b731610113332b2afb932b1b4b834b2b73a111d101160611b603b9290910191820152845161260e81604f840160208901611c31565b601160f91b604f92909101918201528351612630816050840160208801611c31565b6120de605082840101607d60f81b81526001019056fea264697066735822122000111603c6f5903a02ca269a7f6fc7dbd2e240bdfab63de47887e38cce7de70164736f6c63430008190033

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

000000000000000000000000c91359dc9fea6f848797de7fd26d5610dda40d4700000000000000000000000000000000000000000000000000000000000001f400000000000000000000000079f84cdce6ca936e2d37471d5d2f8248c6317ea8000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000715265636f7264656420696e20736563726574206f766572207369782079656172732c204f6e63652055706f6e20612054696d6520696e205368616f6c696e2069732074686520736576656e74682073747564696f20616c62756d2066726f6d207468652057752d54616e6720436c616e2e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001468747470733a2f2f746865616c62756d2e636f6d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000036697066733a2f2f516d6650586b466e483554753842456135474454466f4135336262384b5a35437a7a726e7051736d7137374b61752f000000000000000000000000000000000000000000000000000000000000000000000000000000000036697066733a2f2f516d62627a384877427a326933733548344a614b6b355264627a57574672786450554b6971374a64696e76736e4a2f000000000000000000000000000000000000000000000000000000000000000000000000000000000036697066733a2f2f516d64715766387575415352356647663246466a6a4a4c776e35615741666563645a677368725271675a446670442f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000036697066733a2f2f516d53664d3877547252416958675358587a4a72344d41666137396f346d533569746f67746a7553486b474453642f00000000000000000000

-----Decoded View---------------
Arg [0] : deployer (address): 0xc91359DC9fEa6F848797DE7fD26D5610DDa40d47
Arg [1] : royaltyBPS_ (uint16): 500
Arg [2] : royaltyRecipient_ (address): 0x79F84CdCe6Ca936E2D37471D5d2F8248c6317Ea8
Arg [3] : tokenConfig_ (tuple):
Arg [1] : description (string): Recorded in secret over six years, Once Upon a Time in Shaolin is the seventh studio album from the Wu-Tang Clan.
Arg [2] : externalURL (string): https://thealbum.com
Arg [3] : contractImageURL (string): ipfs://QmfPXkFnH5Tu8BEa5GDTFoA53bb8KZ5CzzrnpQsmq77Kau/
Arg [4] : tokenImageURL (string): ipfs://Qmbbz8HwBz2i3s5H4JaKk5RdbzWWFrxdPUKiq7JdinvsnJ/
Arg [5] : encryptedAlbumURL (string): ipfs://QmdqWf8uuASR5fGf2FFjjJLwn5aWAfecdZgshrRqgZDfpD/
Arg [6] : decryptionKeysURL (string):
Arg [7] : credits (string): ipfs://QmSfM8wTrRAiXgSXXzJr4MAfa79o4mS5itogtjuSHkGDSd/


-----Encoded View---------------
31 Constructor Arguments found :
Arg [0] : 000000000000000000000000c91359dc9fea6f848797de7fd26d5610dda40d47
Arg [1] : 00000000000000000000000000000000000000000000000000000000000001f4
Arg [2] : 00000000000000000000000079f84cdce6ca936e2d37471d5d2f8248c6317ea8
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [4] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000180
Arg [6] : 00000000000000000000000000000000000000000000000000000000000001c0
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000220
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000280
Arg [9] : 00000000000000000000000000000000000000000000000000000000000002e0
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000300
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000071
Arg [12] : 5265636f7264656420696e20736563726574206f766572207369782079656172
Arg [13] : 732c204f6e63652055706f6e20612054696d6520696e205368616f6c696e2069
Arg [14] : 732074686520736576656e74682073747564696f20616c62756d2066726f6d20
Arg [15] : 7468652057752d54616e6720436c616e2e000000000000000000000000000000
Arg [16] : 0000000000000000000000000000000000000000000000000000000000000014
Arg [17] : 68747470733a2f2f746865616c62756d2e636f6d000000000000000000000000
Arg [18] : 0000000000000000000000000000000000000000000000000000000000000036
Arg [19] : 697066733a2f2f516d6650586b466e483554753842456135474454466f413533
Arg [20] : 6262384b5a35437a7a726e7051736d7137374b61752f00000000000000000000
Arg [21] : 0000000000000000000000000000000000000000000000000000000000000036
Arg [22] : 697066733a2f2f516d62627a384877427a326933733548344a614b6b35526462
Arg [23] : 7a57574672786450554b6971374a64696e76736e4a2f00000000000000000000
Arg [24] : 0000000000000000000000000000000000000000000000000000000000000036
Arg [25] : 697066733a2f2f516d64715766387575415352356647663246466a6a4a4c776e
Arg [26] : 35615741666563645a677368725271675a446670442f00000000000000000000
Arg [27] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [28] : 0000000000000000000000000000000000000000000000000000000000000036
Arg [29] : 697066733a2f2f516d53664d3877547252416958675358587a4a72344d416661
Arg [30] : 37396f346d533569746f67746a7553486b474453642f00000000000000000000


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

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