creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "src/erc-1155/ERC1155TL.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {Strings} from \"openzeppelin/utils/Strings.sol\";\nimport {ERC1155Upgradeable, IERC1155, IERC165} from \"openzeppelin-upgradeable/token/ERC1155/ERC1155Upgradeable.sol\";\nimport {EIP2981TLUpgradeable} from \"tl-sol-tools/upgradeable/royalties/EIP2981TLUpgradeable.sol\";\nimport {OwnableAccessControlUpgradeable} from \"tl-sol-tools/upgradeable/access/OwnableAccessControlUpgradeable.sol\";\nimport {IStory} from \"src/interfaces/IStory.sol\";\nimport {IERC1155TL} from \"src/erc-1155/IERC1155TL.sol\";\nimport {ICreatorBase} from \"src/interfaces/ICreatorBase.sol\";\nimport {IBlockListRegistry} from \"src/interfaces/IBlockListRegistry.sol\";\nimport {ITLNftDelegationRegistry} from \"src/interfaces/ITLNftDelegationRegistry.sol\";\n\n/// @title ERC1155TL.sol\n/// @notice Sovereign ERC-1155 Creator Contract with Story Inscriptions\n/// @author transientlabs.xyz\n/// @custom:version 3.0.1\ncontract ERC1155TL is\n    ERC1155Upgradeable,\n    EIP2981TLUpgradeable,\n    OwnableAccessControlUpgradeable,\n    ICreatorBase,\n    IERC1155TL,\n    IStory\n{\n    /*//////////////////////////////////////////////////////////////////////////\n                                Custom Types\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @dev String representation for address\n    using Strings for address;\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                State Variables\n    //////////////////////////////////////////////////////////////////////////*/\n\n    string public constant VERSION = \"3.0.1\";\n    bytes32 public constant ADMIN_ROLE = keccak256(\"ADMIN_ROLE\");\n    bytes32 public constant APPROVED_MINT_CONTRACT = keccak256(\"APPROVED_MINT_CONTRACT\");\n    uint256 private _counter;\n    string public name;\n    string public symbol;\n    bool public storyEnabled;\n    IBlockListRegistry public blocklistRegistry;\n    mapping(uint256 => Token) private _tokens;\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                    Errors\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @dev Token uri is an empty string\n    error EmptyTokenURI();\n\n    /// @dev Batch size too small\n    error BatchSizeTooSmall();\n\n    /// @dev Mint to zero addresses\n    error MintToZeroAddresses();\n\n    /// @dev Array length mismatch\n    error ArrayLengthMismatch();\n\n    /// @dev Token not owned by the owner of the contract\n    error CallerNotTokenOwner();\n\n    /// @dev Caller is not approved or owner\n    error CallerNotApprovedOrOwner();\n\n    /// @dev Token does not exist\n    error TokenDoesntExist();\n\n    /// @dev Burning zero tokens\n    error BurnZeroTokens();\n\n    /// @dev Operator for token approvals blocked\n    error OperatorBlocked();\n\n    /// @dev Story not enabled for collectors\n    error StoryNotEnabled();\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                Constructor\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @param disable Boolean to disable initialization for the implementation contract\n    constructor(bool disable) {\n        if (disable) _disableInitializers();\n    }\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                Initializer\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @dev `tx.origin` is used in the events here as these can be deployed via contract factories and we want to capture the true sender\n    /// @param name_ The name of the 721 contract\n    /// @param symbol_ The symbol of the 721 contract\n    /// @param personalization A string to emit as a collection story. Can be ASCII art or something else that is a personalization of the contract.\n    /// @param defaultRoyaltyRecipient The default address for royalty payments\n    /// @param defaultRoyaltyPercentage The default royalty percentage of basis points (out of 10,000)\n    /// @param initOwner The owner of the contract\n    /// @param admins Array of admin addresses to add to the contract\n    /// @param enableStory A bool deciding whether to add story fuctionality or not\n    /// @param initBlockListRegistry Address of the blocklist registry to use\n    function initialize(\n        string memory name_,\n        string memory symbol_,\n        string memory personalization,\n        address defaultRoyaltyRecipient,\n        uint256 defaultRoyaltyPercentage,\n        address initOwner,\n        address[] memory admins,\n        bool enableStory,\n        address initBlockListRegistry\n    ) external initializer {\n        // initialize parent contracts\n        __ERC1155_init(\"\");\n        __EIP2981TL_init(defaultRoyaltyRecipient, defaultRoyaltyPercentage);\n        __OwnableAccessControl_init(initOwner);\n\n        // add admins\n        _setRole(ADMIN_ROLE, admins, true);\n\n        // set name & symbol\n        name = name_;\n        symbol = symbol_;\n\n        // story\n        storyEnabled = enableStory;\n        emit StoryStatusUpdate(tx.origin, enableStory);\n\n        // blocklist\n        blocklistRegistry = IBlockListRegistry(initBlockListRegistry);\n        emit BlockListRegistryUpdate(tx.origin, address(0), initBlockListRegistry);\n\n        // emit personalization as collection story\n        if (bytes(personalization).length > 0) {\n            emit CollectionStory(tx.origin, tx.origin.toHexString(), personalization);\n        }\n    }\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                General Functions\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @inheritdoc ICreatorBase\n    function totalSupply() external view returns (uint256) {\n        return _counter;\n    }\n\n    /// @inheritdoc IERC1155TL\n    function getTokenDetails(uint256 tokenId) external view returns (Token memory) {\n        return _tokens[tokenId];\n    }\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                Access Control Functions\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @inheritdoc ICreatorBase\n    function setApprovedMintContracts(address[] calldata minters, bool status) external onlyRoleOrOwner(ADMIN_ROLE) {\n        _setRole(APPROVED_MINT_CONTRACT, minters, status);\n    }\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                Creation Functions\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @inheritdoc IERC1155TL\n    function createToken(string calldata newUri, address[] calldata addresses, uint256[] calldata amounts)\n        external\n        onlyRoleOrOwner(ADMIN_ROLE)\n    {\n        _createToken(newUri, addresses, amounts);\n    }\n\n    /// @inheritdoc IERC1155TL\n    function createToken(\n        string calldata newUri,\n        address[] calldata addresses,\n        uint256[] calldata amounts,\n        address royaltyAddress,\n        uint256 royaltyPercent\n    ) external onlyRoleOrOwner(ADMIN_ROLE) {\n        uint256 tokenId = _createToken(newUri, addresses, amounts);\n        _overrideTokenRoyaltyInfo(tokenId, royaltyAddress, royaltyPercent);\n    }\n\n    /// @inheritdoc IERC1155TL\n    function batchCreateToken(string[] calldata newUris, address[][] calldata addresses, uint256[][] calldata amounts)\n        external\n        onlyRoleOrOwner(ADMIN_ROLE)\n    {\n        if (newUris.length == 0) revert EmptyTokenURI();\n        if (newUris.length != addresses.length || addresses.length != amounts.length) revert ArrayLengthMismatch();\n        for (uint256 i = 0; i < newUris.length; i++) {\n            _createToken(newUris[i], addresses[i], amounts[i]);\n        }\n    }\n\n    /// @inheritdoc IERC1155TL\n    function batchCreateToken(\n        string[] calldata newUris,\n        address[][] calldata addresses,\n        uint256[][] calldata amounts,\n        address[] calldata royaltyAddresses,\n        uint256[] calldata royaltyPercents\n    ) external onlyRoleOrOwner(ADMIN_ROLE) {\n        if (newUris.length == 0) revert EmptyTokenURI();\n        if (\n            newUris.length != addresses.length || addresses.length != amounts.length\n                || amounts.length != royaltyAddresses.length || royaltyAddresses.length != royaltyPercents.length\n        ) revert ArrayLengthMismatch();\n        for (uint256 i = 0; i < newUris.length; i++) {\n            uint256 tokenId = _createToken(newUris[i], addresses[i], amounts[i]);\n            _overrideTokenRoyaltyInfo(tokenId, royaltyAddresses[i], royaltyPercents[i]);\n        }\n    }\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                Mint Functions\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @inheritdoc IERC1155TL\n    function mintToken(uint256 tokenId, address[] calldata addresses, uint256[] calldata amounts)\n        external\n        onlyRoleOrOwner(ADMIN_ROLE)\n    {\n        _mintToken(tokenId, addresses, amounts);\n    }\n\n    /// @inheritdoc IERC1155TL\n    function externalMint(uint256 tokenId, address[] calldata addresses, uint256[] calldata amounts)\n        external\n        onlyRole(APPROVED_MINT_CONTRACT)\n    {\n        _mintToken(tokenId, addresses, amounts);\n    }\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                Burn Functions\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @inheritdoc IERC1155TL\n    function burn(address from, uint256[] calldata tokenIds, uint256[] calldata amounts) external {\n        if (tokenIds.length == 0) revert BurnZeroTokens();\n        if (msg.sender != from && !isApprovedForAll(from, msg.sender)) revert CallerNotApprovedOrOwner();\n        _burnBatch(from, tokenIds, amounts);\n    }\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                Royalty Functions\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @inheritdoc ICreatorBase\n    function setDefaultRoyalty(address newRecipient, uint256 newPercentage) external onlyRoleOrOwner(ADMIN_ROLE) {\n        _setDefaultRoyaltyInfo(newRecipient, newPercentage);\n    }\n\n    /// @inheritdoc ICreatorBase\n    function setTokenRoyalty(uint256 tokenId, address newRecipient, uint256 newPercentage)\n        external\n        onlyRoleOrOwner(ADMIN_ROLE)\n    {\n        _overrideTokenRoyaltyInfo(tokenId, newRecipient, newPercentage);\n    }\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                Token Uri Functions\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @inheritdoc IERC1155TL\n    function setTokenUri(uint256 tokenId, string calldata newUri) external onlyRoleOrOwner(ADMIN_ROLE) {\n        if (!_exists(tokenId)) revert TokenDoesntExist();\n        if (bytes(newUri).length == 0) revert EmptyTokenURI();\n        _tokens[tokenId].uri = newUri;\n        emit IERC1155.URI(newUri, tokenId);\n    }\n\n    /// @inheritdoc ERC1155Upgradeable\n    function uri(uint256 tokenId) public view override(ERC1155Upgradeable) returns (string memory) {\n        if (!_exists(tokenId)) revert TokenDoesntExist();\n        return _tokens[tokenId].uri;\n    }\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                Story Inscriptions\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @inheritdoc IStory\n    function addCollectionStory(string calldata, /*creatorName*/ string calldata story)\n        external\n        onlyRoleOrOwner(ADMIN_ROLE)\n    {\n        emit CollectionStory(msg.sender, msg.sender.toHexString(), story);\n    }\n\n    /// @inheritdoc IStory\n    function addCreatorStory(uint256 tokenId, string calldata, /*creatorName*/ string calldata story)\n        external\n        onlyRoleOrOwner(ADMIN_ROLE)\n    {\n        if (!_exists(tokenId)) revert TokenDoesntExist();\n        emit CreatorStory(tokenId, msg.sender, msg.sender.toHexString(), story);\n    }\n\n    /// @inheritdoc IStory\n    function addStory(uint256 tokenId, string calldata, /*collectorName*/ string calldata story) external {\n        if (!storyEnabled) revert StoryNotEnabled();\n        if (balanceOf(msg.sender, tokenId) == 0) revert CallerNotTokenOwner();\n        emit Story(tokenId, msg.sender, msg.sender.toHexString(), story);\n    }\n\n    /// @inheritdoc ICreatorBase\n    function setStoryStatus(bool status) external onlyRoleOrOwner(ADMIN_ROLE) {\n        storyEnabled = status;\n        emit StoryStatusUpdate(msg.sender, status);\n    }\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                BlockList\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @inheritdoc ICreatorBase\n    function setBlockListRegistry(address newBlockListRegistry) external onlyRoleOrOwner(ADMIN_ROLE) {\n        address oldBlockListRegistry = address(blocklistRegistry);\n        blocklistRegistry = IBlockListRegistry(newBlockListRegistry);\n        emit BlockListRegistryUpdate(msg.sender, oldBlockListRegistry, newBlockListRegistry);\n    }\n\n    /// @inheritdoc ERC1155Upgradeable\n    function setApprovalForAll(address operator, bool approved) public override(ERC1155Upgradeable) {\n        if (approved) {\n            if (_isOperatorBlocked(operator)) revert OperatorBlocked();\n        }\n        ERC1155Upgradeable.setApprovalForAll(operator, approved);\n    }\n\n    /*//////////////////////////////////////////////////////////////////////////\n                            NFT Delegation Registry\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @inheritdoc ICreatorBase\n    function tlNftDelegationRegistry() external pure returns (ITLNftDelegationRegistry) {\n        return ITLNftDelegationRegistry(address(0));\n    }\n\n    /// @inheritdoc ICreatorBase\n    function setNftDelegationRegistry(address /*newNftDelegationRegistry*/ ) external pure {\n        revert();\n    }\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                ERC-165 Support\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @inheritdoc IERC165\n    function supportsInterface(bytes4 interfaceId)\n        public\n        view\n        override(ERC1155Upgradeable, EIP2981TLUpgradeable)\n        returns (bool)\n    {\n        return (\n            ERC1155Upgradeable.supportsInterface(interfaceId) || EIP2981TLUpgradeable.supportsInterface(interfaceId)\n                || interfaceId == type(ICreatorBase).interfaceId || interfaceId == type(IStory).interfaceId\n                || interfaceId == 0x0d23ecb9 // previous story contract version that is still supported\n                || interfaceId == type(IERC1155TL).interfaceId\n        );\n    }\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                Internal Functions\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @notice Private helper function to verify a token exists\n    /// @param tokenId The token to check existence for\n    function _exists(uint256 tokenId) private view returns (bool) {\n        return _tokens[tokenId].created;\n    }\n\n    /// @notice Private helper function to create a new token\n    /// @param newUri The uri for the token to create\n    /// @param addresses The addresses to mint the new token to\n    /// @param amounts The amount of the new token to mint to each address\n    /// @return uint256 Token id created\n    function _createToken(string memory newUri, address[] memory addresses, uint256[] memory amounts)\n        private\n        returns (uint256)\n    {\n        if (bytes(newUri).length == 0) revert EmptyTokenURI();\n        if (addresses.length == 0) revert MintToZeroAddresses();\n        if (addresses.length != amounts.length) revert ArrayLengthMismatch();\n        _counter++;\n        _tokens[_counter] = Token(true, newUri);\n        for (uint256 i = 0; i < addresses.length; i++) {\n            _mint(addresses[i], _counter, amounts[i], \"\");\n        }\n\n        return _counter;\n    }\n\n    /// @notice Private helper function\n    /// @param tokenId The token to mint\n    /// @param addresses The addresses to mint to\n    /// @param amounts Amounts of the token to mint to each address\n    function _mintToken(uint256 tokenId, address[] calldata addresses, uint256[] calldata amounts) private {\n        if (!_exists(tokenId)) revert TokenDoesntExist();\n        if (addresses.length == 0) revert MintToZeroAddresses();\n        if (addresses.length != amounts.length) revert ArrayLengthMismatch();\n        for (uint256 i = 0; i < addresses.length; i++) {\n            _mint(addresses[i], tokenId, amounts[i], \"\");\n        }\n    }\n\n    // @notice Function to get if an operator is blocked for token approvals\n    function _isOperatorBlocked(address operator) internal view returns (bool) {\n        if (address(blocklistRegistry) == address(0)) {\n            return false;\n        } else {\n            return blocklistRegistry.getBlockListStatus(operator);\n        }\n    }\n}\n"
      },
      "lib/tl-sol-tools/lib/openzeppelin-contracts/contracts/utils/Strings.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"./math/Math.sol\";\nimport {SignedMath} from \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n    bytes16 private constant HEX_DIGITS = \"0123456789abcdef\";\n    uint8 private constant ADDRESS_LENGTH = 20;\n\n    /**\n     * @dev The `value` string doesn't fit in the specified `length`.\n     */\n    error StringsInsufficientHexLength(uint256 value, uint256 length);\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n     */\n    function toString(uint256 value) internal pure returns (string memory) {\n        unchecked {\n            uint256 length = Math.log10(value) + 1;\n            string memory buffer = new string(length);\n            uint256 ptr;\n            /// @solidity memory-safe-assembly\n            assembly {\n                ptr := add(buffer, add(32, length))\n            }\n            while (true) {\n                ptr--;\n                /// @solidity memory-safe-assembly\n                assembly {\n                    mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\n                }\n                value /= 10;\n                if (value == 0) break;\n            }\n            return buffer;\n        }\n    }\n\n    /**\n     * @dev Converts a `int256` to its ASCII `string` decimal representation.\n     */\n    function toStringSigned(int256 value) internal pure returns (string memory) {\n        return string.concat(value < 0 ? \"-\" : \"\", toString(SignedMath.abs(value)));\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n     */\n    function toHexString(uint256 value) internal pure returns (string memory) {\n        unchecked {\n            return toHexString(value, Math.log256(value) + 1);\n        }\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n     */\n    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n        uint256 localValue = value;\n        bytes memory buffer = new bytes(2 * length + 2);\n        buffer[0] = \"0\";\n        buffer[1] = \"x\";\n        for (uint256 i = 2 * length + 1; i > 1; --i) {\n            buffer[i] = HEX_DIGITS[localValue & 0xf];\n            localValue >>= 4;\n        }\n        if (localValue != 0) {\n            revert StringsInsufficientHexLength(value, length);\n        }\n        return string(buffer);\n    }\n\n    /**\n     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal\n     * representation.\n     */\n    function toHexString(address addr) internal pure returns (string memory) {\n        return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);\n    }\n\n    /**\n     * @dev Returns true if the two strings are equal.\n     */\n    function equal(string memory a, string memory b) internal pure returns (bool) {\n        return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\n    }\n}\n"
      },
      "lib/tl-sol-tools/lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/ERC1155Upgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/ERC1155.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC1155} from \"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\";\nimport {IERC1155Receiver} from \"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\";\nimport {IERC1155MetadataURI} from \"@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol\";\nimport {ContextUpgradeable} from \"../../utils/ContextUpgradeable.sol\";\nimport {IERC165} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport {ERC165Upgradeable} from \"../../utils/introspection/ERC165Upgradeable.sol\";\nimport {Arrays} from \"@openzeppelin/contracts/utils/Arrays.sol\";\nimport {IERC1155Errors} from \"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\";\nimport {Initializable} from \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the basic standard multi-token.\n * See https://eips.ethereum.org/EIPS/eip-1155\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\n */\nabstract contract ERC1155Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC1155, IERC1155MetadataURI, IERC1155Errors {\n    using Arrays for uint256[];\n    using Arrays for address[];\n\n    /// @custom:storage-location erc7201:openzeppelin.storage.ERC1155\n    struct ERC1155Storage {\n        mapping(uint256 id => mapping(address account => uint256)) _balances;\n\n        mapping(address account => mapping(address operator => bool)) _operatorApprovals;\n\n        // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\n        string _uri;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.ERC1155\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant ERC1155StorageLocation = 0x88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c4500;\n\n    function _getERC1155Storage() private pure returns (ERC1155Storage storage $) {\n        assembly {\n            $.slot := ERC1155StorageLocation\n        }\n    }\n\n    /**\n     * @dev See {_setURI}.\n     */\n    function __ERC1155_init(string memory uri_) internal onlyInitializing {\n        __ERC1155_init_unchained(uri_);\n    }\n\n    function __ERC1155_init_unchained(string memory uri_) internal onlyInitializing {\n        _setURI(uri_);\n    }\n\n    /**\n     * @dev See {IERC165-supportsInterface}.\n     */\n    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165) returns (bool) {\n        return\n            interfaceId == type(IERC1155).interfaceId ||\n            interfaceId == type(IERC1155MetadataURI).interfaceId ||\n            super.supportsInterface(interfaceId);\n    }\n\n    /**\n     * @dev See {IERC1155MetadataURI-uri}.\n     *\n     * This implementation returns the same URI for *all* token types. It relies\n     * on the token type ID substitution mechanism\n     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n     *\n     * Clients calling this function must replace the `\\{id\\}` substring with the\n     * actual token type ID.\n     */\n    function uri(uint256 /* id */) public view virtual returns (string memory) {\n        ERC1155Storage storage $ = _getERC1155Storage();\n        return $._uri;\n    }\n\n    /**\n     * @dev See {IERC1155-balanceOf}.\n     */\n    function balanceOf(address account, uint256 id) public view virtual returns (uint256) {\n        ERC1155Storage storage $ = _getERC1155Storage();\n        return $._balances[id][account];\n    }\n\n    /**\n     * @dev See {IERC1155-balanceOfBatch}.\n     *\n     * Requirements:\n     *\n     * - `accounts` and `ids` must have the same length.\n     */\n    function balanceOfBatch(\n        address[] memory accounts,\n        uint256[] memory ids\n    ) public view virtual returns (uint256[] memory) {\n        if (accounts.length != ids.length) {\n            revert ERC1155InvalidArrayLength(ids.length, accounts.length);\n        }\n\n        uint256[] memory batchBalances = new uint256[](accounts.length);\n\n        for (uint256 i = 0; i < accounts.length; ++i) {\n            batchBalances[i] = balanceOf(accounts.unsafeMemoryAccess(i), ids.unsafeMemoryAccess(i));\n        }\n\n        return batchBalances;\n    }\n\n    /**\n     * @dev See {IERC1155-setApprovalForAll}.\n     */\n    function setApprovalForAll(address operator, bool approved) public virtual {\n        _setApprovalForAll(_msgSender(), operator, approved);\n    }\n\n    /**\n     * @dev See {IERC1155-isApprovedForAll}.\n     */\n    function isApprovedForAll(address account, address operator) public view virtual returns (bool) {\n        ERC1155Storage storage $ = _getERC1155Storage();\n        return $._operatorApprovals[account][operator];\n    }\n\n    /**\n     * @dev See {IERC1155-safeTransferFrom}.\n     */\n    function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes memory data) public virtual {\n        address sender = _msgSender();\n        if (from != sender && !isApprovedForAll(from, sender)) {\n            revert ERC1155MissingApprovalForAll(sender, from);\n        }\n        _safeTransferFrom(from, to, id, value, data);\n    }\n\n    /**\n     * @dev See {IERC1155-safeBatchTransferFrom}.\n     */\n    function safeBatchTransferFrom(\n        address from,\n        address to,\n        uint256[] memory ids,\n        uint256[] memory values,\n        bytes memory data\n    ) public virtual {\n        address sender = _msgSender();\n        if (from != sender && !isApprovedForAll(from, sender)) {\n            revert ERC1155MissingApprovalForAll(sender, from);\n        }\n        _safeBatchTransferFrom(from, to, ids, values, data);\n    }\n\n    /**\n     * @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`. Will mint (or burn) if `from`\n     * (or `to`) is the zero address.\n     *\n     * Emits a {TransferSingle} event if the arrays contain one element, and {TransferBatch} otherwise.\n     *\n     * Requirements:\n     *\n     * - If `to` refers to a smart contract, it must implement either {IERC1155Receiver-onERC1155Received}\n     *   or {IERC1155Receiver-onERC1155BatchReceived} and return the acceptance magic value.\n     * - `ids` and `values` must have the same length.\n     *\n     * NOTE: The ERC-1155 acceptance check is not performed in this function. See {_updateWithAcceptanceCheck} instead.\n     */\n    function _update(address from, address to, uint256[] memory ids, uint256[] memory values) internal virtual {\n        ERC1155Storage storage $ = _getERC1155Storage();\n        if (ids.length != values.length) {\n            revert ERC1155InvalidArrayLength(ids.length, values.length);\n        }\n\n        address operator = _msgSender();\n\n        for (uint256 i = 0; i < ids.length; ++i) {\n            uint256 id = ids.unsafeMemoryAccess(i);\n            uint256 value = values.unsafeMemoryAccess(i);\n\n            if (from != address(0)) {\n                uint256 fromBalance = $._balances[id][from];\n                if (fromBalance < value) {\n                    revert ERC1155InsufficientBalance(from, fromBalance, value, id);\n                }\n                unchecked {\n                    // Overflow not possible: value <= fromBalance\n                    $._balances[id][from] = fromBalance - value;\n                }\n            }\n\n            if (to != address(0)) {\n                $._balances[id][to] += value;\n            }\n        }\n\n        if (ids.length == 1) {\n            uint256 id = ids.unsafeMemoryAccess(0);\n            uint256 value = values.unsafeMemoryAccess(0);\n            emit TransferSingle(operator, from, to, id, value);\n        } else {\n            emit TransferBatch(operator, from, to, ids, values);\n        }\n    }\n\n    /**\n     * @dev Version of {_update} that performs the token acceptance check by calling\n     * {IERC1155Receiver-onERC1155Received} or {IERC1155Receiver-onERC1155BatchReceived} on the receiver address if it\n     * contains code (eg. is a smart contract at the moment of execution).\n     *\n     * IMPORTANT: Overriding this function is discouraged because it poses a reentrancy risk from the receiver. So any\n     * update to the contract state after this function would break the check-effect-interaction pattern. Consider\n     * overriding {_update} instead.\n     */\n    function _updateWithAcceptanceCheck(\n        address from,\n        address to,\n        uint256[] memory ids,\n        uint256[] memory values,\n        bytes memory data\n    ) internal virtual {\n        _update(from, to, ids, values);\n        if (to != address(0)) {\n            address operator = _msgSender();\n            if (ids.length == 1) {\n                uint256 id = ids.unsafeMemoryAccess(0);\n                uint256 value = values.unsafeMemoryAccess(0);\n                _doSafeTransferAcceptanceCheck(operator, from, to, id, value, data);\n            } else {\n                _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, values, data);\n            }\n        }\n    }\n\n    /**\n     * @dev Transfers a `value` tokens of token type `id` from `from` to `to`.\n     *\n     * Emits a {TransferSingle} event.\n     *\n     * Requirements:\n     *\n     * - `to` cannot be the zero address.\n     * - `from` must have a balance of tokens of type `id` of at least `value` amount.\n     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n     * acceptance magic value.\n     */\n    function _safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes memory data) internal {\n        if (to == address(0)) {\n            revert ERC1155InvalidReceiver(address(0));\n        }\n        if (from == address(0)) {\n            revert ERC1155InvalidSender(address(0));\n        }\n        (uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value);\n        _updateWithAcceptanceCheck(from, to, ids, values, data);\n    }\n\n    /**\n     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\n     *\n     * Emits a {TransferBatch} event.\n     *\n     * Requirements:\n     *\n     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n     * acceptance magic value.\n     * - `ids` and `values` must have the same length.\n     */\n    function _safeBatchTransferFrom(\n        address from,\n        address to,\n        uint256[] memory ids,\n        uint256[] memory values,\n        bytes memory data\n    ) internal {\n        if (to == address(0)) {\n            revert ERC1155InvalidReceiver(address(0));\n        }\n        if (from == address(0)) {\n            revert ERC1155InvalidSender(address(0));\n        }\n        _updateWithAcceptanceCheck(from, to, ids, values, data);\n    }\n\n    /**\n     * @dev Sets a new URI for all token types, by relying on the token type ID\n     * substitution mechanism\n     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n     *\n     * By this mechanism, any occurrence of the `\\{id\\}` substring in either the\n     * URI or any of the values in the JSON file at said URI will be replaced by\n     * clients with the token type ID.\n     *\n     * For example, the `https://token-cdn-domain/\\{id\\}.json` URI would be\n     * interpreted by clients as\n     * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\n     * for token type ID 0x4cce0.\n     *\n     * See {uri}.\n     *\n     * Because these URIs cannot be meaningfully represented by the {URI} event,\n     * this function emits no events.\n     */\n    function _setURI(string memory newuri) internal virtual {\n        ERC1155Storage storage $ = _getERC1155Storage();\n        $._uri = newuri;\n    }\n\n    /**\n     * @dev Creates a `value` amount of tokens of type `id`, and assigns them to `to`.\n     *\n     * Emits a {TransferSingle} event.\n     *\n     * Requirements:\n     *\n     * - `to` cannot be the zero address.\n     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n     * acceptance magic value.\n     */\n    function _mint(address to, uint256 id, uint256 value, bytes memory data) internal {\n        if (to == address(0)) {\n            revert ERC1155InvalidReceiver(address(0));\n        }\n        (uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value);\n        _updateWithAcceptanceCheck(address(0), to, ids, values, data);\n    }\n\n    /**\n     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\n     *\n     * Emits a {TransferBatch} event.\n     *\n     * Requirements:\n     *\n     * - `ids` and `values` must have the same length.\n     * - `to` cannot be the zero address.\n     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n     * acceptance magic value.\n     */\n    function _mintBatch(address to, uint256[] memory ids, uint256[] memory values, bytes memory data) internal {\n        if (to == address(0)) {\n            revert ERC1155InvalidReceiver(address(0));\n        }\n        _updateWithAcceptanceCheck(address(0), to, ids, values, data);\n    }\n\n    /**\n     * @dev Destroys a `value` amount of tokens of type `id` from `from`\n     *\n     * Emits a {TransferSingle} event.\n     *\n     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `from` must have at least `value` amount of tokens of type `id`.\n     */\n    function _burn(address from, uint256 id, uint256 value) internal {\n        if (from == address(0)) {\n            revert ERC1155InvalidSender(address(0));\n        }\n        (uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value);\n        _updateWithAcceptanceCheck(from, address(0), ids, values, \"\");\n    }\n\n    /**\n     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\n     *\n     * Emits a {TransferBatch} event.\n     *\n     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `from` must have at least `value` amount of tokens of type `id`.\n     * - `ids` and `values` must have the same length.\n     */\n    function _burnBatch(address from, uint256[] memory ids, uint256[] memory values) internal {\n        if (from == address(0)) {\n            revert ERC1155InvalidSender(address(0));\n        }\n        _updateWithAcceptanceCheck(from, address(0), ids, values, \"\");\n    }\n\n    /**\n     * @dev Approve `operator` to operate on all of `owner` tokens\n     *\n     * Emits an {ApprovalForAll} event.\n     *\n     * Requirements:\n     *\n     * - `operator` cannot be the zero address.\n     */\n    function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {\n        ERC1155Storage storage $ = _getERC1155Storage();\n        if (operator == address(0)) {\n            revert ERC1155InvalidOperator(address(0));\n        }\n        $._operatorApprovals[owner][operator] = approved;\n        emit ApprovalForAll(owner, operator, approved);\n    }\n\n    /**\n     * @dev Performs an acceptance check by calling {IERC1155-onERC1155Received} on the `to` address\n     * if it contains code at the moment of execution.\n     */\n    function _doSafeTransferAcceptanceCheck(\n        address operator,\n        address from,\n        address to,\n        uint256 id,\n        uint256 value,\n        bytes memory data\n    ) private {\n        if (to.code.length > 0) {\n            try IERC1155Receiver(to).onERC1155Received(operator, from, id, value, data) returns (bytes4 response) {\n                if (response != IERC1155Receiver.onERC1155Received.selector) {\n                    // Tokens rejected\n                    revert ERC1155InvalidReceiver(to);\n                }\n            } catch (bytes memory reason) {\n                if (reason.length == 0) {\n                    // non-ERC1155Receiver implementer\n                    revert ERC1155InvalidReceiver(to);\n                } else {\n                    /// @solidity memory-safe-assembly\n                    assembly {\n                        revert(add(32, reason), mload(reason))\n                    }\n                }\n            }\n        }\n    }\n\n    /**\n     * @dev Performs a batch acceptance check by calling {IERC1155-onERC1155BatchReceived} on the `to` address\n     * if it contains code at the moment of execution.\n     */\n    function _doSafeBatchTransferAcceptanceCheck(\n        address operator,\n        address from,\n        address to,\n        uint256[] memory ids,\n        uint256[] memory values,\n        bytes memory data\n    ) private {\n        if (to.code.length > 0) {\n            try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, values, data) returns (\n                bytes4 response\n            ) {\n                if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {\n                    // Tokens rejected\n                    revert ERC1155InvalidReceiver(to);\n                }\n            } catch (bytes memory reason) {\n                if (reason.length == 0) {\n                    // non-ERC1155Receiver implementer\n                    revert ERC1155InvalidReceiver(to);\n                } else {\n                    /// @solidity memory-safe-assembly\n                    assembly {\n                        revert(add(32, reason), mload(reason))\n                    }\n                }\n            }\n        }\n    }\n\n    /**\n     * @dev Creates an array in memory with only one value for each of the elements provided.\n     */\n    function _asSingletonArrays(\n        uint256 element1,\n        uint256 element2\n    ) private pure returns (uint256[] memory array1, uint256[] memory array2) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Load the free memory pointer\n            array1 := mload(0x40)\n            // Set array length to 1\n            mstore(array1, 1)\n            // Store the single element at the next word after the length (where content starts)\n            mstore(add(array1, 0x20), element1)\n\n            // Repeat for next array locating it right after the first array\n            array2 := add(array1, 0x40)\n            mstore(array2, 1)\n            mstore(add(array2, 0x20), element2)\n\n            // Update the free memory pointer by pointing after the second array\n            mstore(0x40, add(array2, 0x40))\n        }\n    }\n}\n"
      },
      "lib/tl-sol-tools/src/upgradeable/royalties/EIP2981TLUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport {ERC165Upgradeable} from \"openzeppelin-upgradeable/utils/introspection/ERC165Upgradeable.sol\";\nimport {IEIP2981} from \"../../royalties/IEIP2981.sol\";\n\n/// @title EIP2981TLUpgradeable.sol\n/// @notice Abstract contract to define a default royalty spec\n///         while allowing for specific token overrides\n/// @dev Follows EIP-2981 (https://eips.ethereum.org/EIPS/eip-2981)\n/// @author transientlabs.xyz\n/// @custom:version 3.1.0\nabstract contract EIP2981TLUpgradeable is IEIP2981, ERC165Upgradeable {\n    /*//////////////////////////////////////////////////////////////////////////\n                                    Types\n    //////////////////////////////////////////////////////////////////////////*/\n\n    struct RoyaltySpec {\n        address recipient;\n        uint256 percentage;\n    }\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                    Storage\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @custom:storage-location erc7201:transientlabs.storage.EIP2981TLStorage\n    struct EIP2981TLStorage {\n        address defaultRecipient;\n        uint256 defaultPercentage;\n        mapping(uint256 => RoyaltySpec) tokenOverrides;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"transientlabs.storage.EIP2981TLStorage\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant EIP2981TLStorageLocation =\n        0xe9db8e9b56f2e28e12956850f386d9a4c1e886a4f584b61a10a9d0cacee70700;\n\n    function _getEIP2981TLStorage() private pure returns (EIP2981TLStorage storage $) {\n        assembly {\n            $.slot := EIP2981TLStorageLocation\n        }\n    }\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                Constants\n    //////////////////////////////////////////////////////////////////////////*/\n\n    uint256 public constant BASIS = 10_000;\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                    Events\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @dev Event to emit when the default roylaty is updated\n    event DefaultRoyaltyUpdate(address indexed sender, address newRecipient, uint256 newPercentage);\n\n    /// @dev Event to emit when a token royalty is overriden\n    event TokenRoyaltyOverride(address indexed sender, uint256 indexed tokenId, address newRecipient, uint256 newPercentage);\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                    Errors\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @dev error if the recipient is set to address(0)\n    error ZeroAddressError();\n\n    /// @dev error if the royalty percentage is greater than to 100%\n    error MaxRoyaltyError();\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                Initializer\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @notice Function to initialize the contract\n    /// @param defaultRecipient The default royalty payout address\n    /// @param defaultPercentage The deafult royalty percentage, out of 10,000\n    function __EIP2981TL_init(address defaultRecipient, uint256 defaultPercentage) internal onlyInitializing {\n        __EIP2981TL_init_unchained(defaultRecipient, defaultPercentage);\n    }\n\n    /// @notice Unchained function to initialize the contract\n    /// @param defaultRecipient The default royalty payout address\n    /// @param defaultPercentage The deafult royalty percentage, out of 10,000\n    function __EIP2981TL_init_unchained(address defaultRecipient, uint256 defaultPercentage)\n        internal\n        onlyInitializing\n    {\n        _setDefaultRoyaltyInfo(defaultRecipient, defaultPercentage);\n    }\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                Royalty Changing Functions\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @notice Function to set default royalty info\n    /// @param newRecipient The new default royalty payout address\n    /// @param newPercentage The new default royalty percentage, out of 10,000\n    function _setDefaultRoyaltyInfo(address newRecipient, uint256 newPercentage) internal {\n        EIP2981TLStorage storage $ = _getEIP2981TLStorage();\n        if (newRecipient == address(0)) revert ZeroAddressError();\n        if (newPercentage > 10_000) revert MaxRoyaltyError();\n        $.defaultRecipient = newRecipient;\n        $.defaultPercentage = newPercentage;\n        emit DefaultRoyaltyUpdate(msg.sender, newRecipient, newPercentage);\n    }\n\n    /// @notice Function to override royalty spec on a specific token\n    /// @param tokenId The token id to override royalty for\n    /// @param newRecipient The new royalty payout address\n    /// @param newPercentage The new royalty percentage, out of 10,000\n    function _overrideTokenRoyaltyInfo(uint256 tokenId, address newRecipient, uint256 newPercentage) internal {\n        EIP2981TLStorage storage $ = _getEIP2981TLStorage();\n        if (newRecipient == address(0)) revert ZeroAddressError();\n        if (newPercentage > 10_000) revert MaxRoyaltyError();\n        $.tokenOverrides[tokenId].recipient = newRecipient;\n        $.tokenOverrides[tokenId].percentage = newPercentage;\n        emit TokenRoyaltyOverride(msg.sender, tokenId, newRecipient, newPercentage);\n    }\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                Royalty Info\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @inheritdoc IEIP2981\n    function royaltyInfo(uint256 tokenId, uint256 salePrice)\n        external\n        view\n        returns (address receiver, uint256 royaltyAmount)\n    {\n        EIP2981TLStorage storage $ = _getEIP2981TLStorage();\n        address recipient = $.defaultRecipient;\n        uint256 percentage = $.defaultPercentage;\n        if ($.tokenOverrides[tokenId].recipient != address(0)) {\n            recipient = $.tokenOverrides[tokenId].recipient;\n            percentage = $.tokenOverrides[tokenId].percentage;\n        }\n        return (recipient, salePrice * percentage / BASIS);\n    }\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                ERC-165 Override\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @inheritdoc ERC165Upgradeable\n    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable) returns (bool) {\n        return interfaceId == type(IEIP2981).interfaceId || ERC165Upgradeable.supportsInterface(interfaceId);\n    }\n\n    /*//////////////////////////////////////////////////////////////////////////\n                            External View Functions\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @notice Query the default royalty receiver and percentage.\n    /// @return Tuple containing the default royalty recipient and percentage out of 10_000\n    function getDefaultRoyaltyRecipientAndPercentage() external view returns (address, uint256) {\n        EIP2981TLStorage storage $ = _getEIP2981TLStorage();\n        return ($.defaultRecipient, $.defaultPercentage);\n    }\n}\n"
      },
      "lib/tl-sol-tools/src/upgradeable/access/OwnableAccessControlUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport {OwnableUpgradeable} from \"openzeppelin-upgradeable/access/OwnableUpgradeable.sol\";\nimport {EnumerableSet} from \"openzeppelin/utils/structs/EnumerableSet.sol\";\n\n/// @title OwnableAccessControlUpgradeable.sol\n/// @notice Single owner, flexible access control mechanics\n/// @dev Can easily be extended by inheriting and applying additional roles\n/// @dev By default, only the owner can grant roles but by inheriting, but you\n///      may allow other roles to grant roles by using the internal helper.\n/// @author transientlabs.xyz\n/// @custom:version 3.0.0\nabstract contract OwnableAccessControlUpgradeable is OwnableUpgradeable {\n    /*//////////////////////////////////////////////////////////////////////////\n                                    Types\n    //////////////////////////////////////////////////////////////////////////*/\n\n    using EnumerableSet for EnumerableSet.AddressSet;\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                    Storage\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @custom:storage-location erc7201:transientlabs.storage.OwnableAccessControl\n    struct OwnableAccessControlStorage {\n        uint256 c; // counter to be able to revoke all priviledges\n        mapping(uint256 => mapping(bytes32 => mapping(address => bool))) roleStatus;\n        mapping(uint256 => mapping(bytes32 => EnumerableSet.AddressSet)) roleMembers;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"transientlabs.storage.OwnableAccessControl\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant OwnableAccessControlStorageLocation =\n        0x0d0469b3d32e63681b9fc586a5627ad5e70b3d1ad20f31767e4b6c4141c7e300;\n\n    function _getOwnableAccessControlStorage() private pure returns (OwnableAccessControlStorage storage $) {\n        assembly {\n            $.slot := OwnableAccessControlStorageLocation\n        }\n    }\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                    Events\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @param from Address that authorized the role change\n    /// @param user The address who's role has been changed\n    /// @param approved Boolean indicating the user's status in role\n    /// @param role The bytes32 role created in the inheriting contract\n    event RoleChange(address indexed from, address indexed user, bool indexed approved, bytes32 role);\n\n    /// @param from Address that authorized the revoke\n    event AllRolesRevoked(address indexed from);\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                    Errors\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @dev Does not have specified role\n    error NotSpecifiedRole(bytes32 role);\n\n    /// @dev Is not specified role or owner\n    error NotRoleOrOwner(bytes32 role);\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                    Modifiers\n    //////////////////////////////////////////////////////////////////////////*/\n\n    modifier onlyRole(bytes32 role) {\n        if (!hasRole(role, msg.sender)) {\n            revert NotSpecifiedRole(role);\n        }\n        _;\n    }\n\n    modifier onlyRoleOrOwner(bytes32 role) {\n        if (!hasRole(role, msg.sender) && owner() != msg.sender) {\n            revert NotRoleOrOwner(role);\n        }\n        _;\n    }\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                    Initializer\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @param initOwner The address of the initial owner\n    function __OwnableAccessControl_init(address initOwner) internal onlyInitializing {\n        __Ownable_init(initOwner);\n        __OwnableAccessControl_init_unchained();\n    }\n\n    function __OwnableAccessControl_init_unchained() internal onlyInitializing {}\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                External Role Functions\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @notice Function to revoke all roles currently present\n    /// @dev Increments the `_c` variables\n    /// @dev Requires owner privileges\n    function revokeAllRoles() external onlyOwner {\n        OwnableAccessControlStorage storage $ = _getOwnableAccessControlStorage();\n        $.c++;\n        emit AllRolesRevoked(msg.sender);\n    }\n\n    /// @notice Function to renounce role\n    /// @param role Bytes32 role created in inheriting contracts\n    function renounceRole(bytes32 role) external {\n        address[] memory members = new address[](1);\n        members[0] = msg.sender;\n        _setRole(role, members, false);\n    }\n\n    /// @notice Function to grant/revoke a role to an address\n    /// @dev Requires owner to call this function but this may be further\n    ///      extended using the internal helper function in inheriting contracts\n    /// @param role Bytes32 role created in inheriting contracts\n    /// @param roleMembers List of addresses that should have roles attached to them based on `status`\n    /// @param status Bool whether to remove or add `roleMembers` to the `role`\n    function setRole(bytes32 role, address[] memory roleMembers, bool status) external onlyOwner {\n        _setRole(role, roleMembers, status);\n    }\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                External View Functions\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @notice Function to see if an address is the owner\n    /// @param role Bytes32 role created in inheriting contracts\n    /// @param potentialRoleMember Address to check for role membership\n    function hasRole(bytes32 role, address potentialRoleMember) public view returns (bool) {\n        OwnableAccessControlStorage storage $ = _getOwnableAccessControlStorage();\n        return $.roleStatus[$.c][role][potentialRoleMember];\n    }\n\n    /// @notice Function to get role members\n    /// @param role Bytes32 role created in inheriting contracts\n    function getRoleMembers(bytes32 role) public view returns (address[] memory) {\n        OwnableAccessControlStorage storage $ = _getOwnableAccessControlStorage();\n        return $.roleMembers[$.c][role].values();\n    }\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                Internal Helper Functions\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @notice Helper function to set addresses for a role\n    /// @param role Bytes32 role created in inheriting contracts\n    /// @param roleMembers List of addresses that should have roles attached to them based on `status`\n    /// @param status Bool whether to remove or add `roleMembers` to the `role`\n    function _setRole(bytes32 role, address[] memory roleMembers, bool status) internal {\n        OwnableAccessControlStorage storage $ = _getOwnableAccessControlStorage();\n        for (uint256 i = 0; i < roleMembers.length; i++) {\n            $.roleStatus[$.c][role][roleMembers[i]] = status;\n            if (status) {\n                $.roleMembers[$.c][role].add(roleMembers[i]);\n            } else {\n                $.roleMembers[$.c][role].remove(roleMembers[i]);\n            }\n            emit RoleChange(msg.sender, roleMembers[i], status, role);\n        }\n    }\n}\n"
      },
      "src/interfaces/IStory.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\n/// @title Transient Labs Story Inscriptions Interface\n/// @dev Interface id: 0x2464f17b\n/// @dev Previous interface id that is still supported: 0x0d23ecb9\n/// @author transientlabs.xyz\n/// @custom:version 6.0.0\ninterface IStory {\n    /*//////////////////////////////////////////////////////////////////////////\n                                Events\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @notice Event describing a collection story getting added to a contract\n    /// @dev This event stories creator stories on chain in the event log that apply to an entire collection\n    /// @param creatorAddress The address of the creator of the collection\n    /// @param creatorName String representation of the creator's name\n    /// @param story The story written and attached to the collection\n    event CollectionStory(address indexed creatorAddress, string creatorName, string story);\n\n    /// @notice Event describing a creator story getting added to a token\n    /// @dev This events stores creator stories on chain in the event log\n    /// @param tokenId The token id to which the story is attached\n    /// @param creatorAddress The address of the creator of the token\n    /// @param creatorName String representation of the creator's name\n    /// @param story The story written and attached to the token id\n    event CreatorStory(uint256 indexed tokenId, address indexed creatorAddress, string creatorName, string story);\n\n    /// @notice Event describing a collector story getting added to a token\n    /// @dev This events stores collector stories on chain in the event log\n    /// @param tokenId The token id to which the story is attached\n    /// @param collectorAddress The address of the collector of the token\n    /// @param collectorName String representation of the collectors's name\n    /// @param story The story written and attached to the token id\n    event Story(uint256 indexed tokenId, address indexed collectorAddress, string collectorName, string story);\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                Story Functions\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @notice Function to let the creator add a story to the collection they have created\n    /// @dev Depending on the implementation, this function may be restricted in various ways, such as\n    ///      limiting the number of times the creator may write a story.\n    /// @dev This function MUST emit the CollectionStory event each time it is called\n    /// @dev This function MUST implement logic to restrict access to only the creator\n    /// @param creatorName String representation of the creator's name\n    /// @param story The story written and attached to the token id\n    function addCollectionStory(string calldata creatorName, string calldata story) external;\n\n    /// @notice Function to let the creator add a story to any token they have created\n    /// @dev Depending on the implementation, this function may be restricted in various ways, such as\n    ///      limiting the number of times the creator may write a story.\n    /// @dev This function MUST emit the CreatorStory event each time it is called\n    /// @dev This function MUST implement logic to restrict access to only the creator\n    /// @dev This function MUST revert if a story is written to a non-existent token\n    /// @param tokenId The token id to which the story is attached\n    /// @param creatorName String representation of the creator's name\n    /// @param story The story written and attached to the token id\n    function addCreatorStory(uint256 tokenId, string calldata creatorName, string calldata story) external;\n\n    /// @notice Function to let collectors add a story to any token they own\n    /// @dev Depending on the implementation, this function may be restricted in various ways, such as\n    ///      limiting the number of times a collector may write a story.\n    /// @dev This function MUST emit the Story event each time it is called\n    /// @dev This function MUST implement logic to restrict access to only the owner of the token\n    /// @dev This function MUST revert if a story is written to a non-existent token\n    /// @param tokenId The token id to which the story is attached\n    /// @param collectorName String representation of the collectors's name\n    /// @param story The story written and attached to the token id\n    function addStory(uint256 tokenId, string calldata collectorName, string calldata story) external;\n}\n"
      },
      "src/erc-1155/IERC1155TL.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\n/// @title IERC1155TL.sol\n/// @notice Interface for ERC1155TL\n/// @dev Interface id = 0x452d5a4a\n/// @author transientlabs.xyz\n/// @custom:version 3.0.0\ninterface IERC1155TL {\n    /*//////////////////////////////////////////////////////////////////////////\n                                    Types\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @dev Struct defining a token\n    struct Token {\n        bool created;\n        string uri;\n    }\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                    Functions\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @notice Function to get token creation details\n    /// @param tokenId The token to lookup\n    function getTokenDetails(uint256 tokenId) external view returns (Token memory);\n\n    /// @notice Function to create a token that can be minted to creator or airdropped\n    /// @dev Requires owner or admin\n    /// @param newUri The uri for the token to create\n    /// @param addresses The addresses to mint the new token to\n    /// @param amounts The amount of the new token to mint to each address\n    function createToken(string calldata newUri, address[] calldata addresses, uint256[] calldata amounts) external;\n\n    /// @notice Function to create a token that can be minted to creator or airdropped\n    /// @dev Overloaded function where you can set the token royalty config in this tx\n    /// @dev Requires owner or admin\n    /// @param newUri The uri for the token to create\n    /// @param addresses The addresses to mint the new token to\n    /// @param amounts The amount of the new token to mint to each address\n    /// @param royaltyAddress Royalty payout address for the created token\n    /// @param royaltyPercent Royalty percentage for this token\n    function createToken(\n        string calldata newUri,\n        address[] calldata addresses,\n        uint256[] calldata amounts,\n        address royaltyAddress,\n        uint256 royaltyPercent\n    ) external;\n\n    /// @notice function to batch create tokens that can be minted to creator or airdropped\n    /// @dev requires owner or admin\n    /// @param newUris the uris for the tokens to create\n    /// @param addresses 2d dynamic array holding the addresses to mint the new tokens to\n    /// @param amounts 2d dynamic array holding the amounts of the new tokens to mint to each address\n    function batchCreateToken(string[] calldata newUris, address[][] calldata addresses, uint256[][] calldata amounts)\n        external;\n\n    /// @notice Function to batch create tokens that can be minted to creator or airdropped\n    /// @dev Overloaded function where you can set the token royalty config in this tx\n    /// @dev Requires owner or admin\n    /// @param newUris Rhe uris for the tokens to create\n    /// @param addresses 2d dynamic array holding the addresses to mint the new tokens to\n    /// @param amounts 2d dynamic array holding the amounts of the new tokens to mint to each address\n    /// @param royaltyAddresses Royalty payout addresses for the tokens\n    /// @param royaltyPercents Royalty payout percents for the tokens\n    function batchCreateToken(\n        string[] calldata newUris,\n        address[][] calldata addresses,\n        uint256[][] calldata amounts,\n        address[] calldata royaltyAddresses,\n        uint256[] calldata royaltyPercents\n    ) external;\n\n    /// @notice Function to mint existing token to recipients\n    /// @dev Requires owner or admin\n    /// @param tokenId The token to mint\n    /// @param addresses The addresses to mint to\n    /// @param amounts Amounts of the token to mint to each address\n    function mintToken(uint256 tokenId, address[] calldata addresses, uint256[] calldata amounts) external;\n\n    /// @notice External mint function\n    /// @dev Requires caller to be an approved mint contract\n    /// @param tokenId The token to mint\n    /// @param addresses The addresses to mint to\n    /// @param amounts Amounts of the token to mint to each address\n    function externalMint(uint256 tokenId, address[] calldata addresses, uint256[] calldata amounts) external;\n\n    /// @notice Function to burn tokens from an account\n    /// @dev Msg.sender must be token owner or operator\n    /// @dev If this function is called from another contract as part of a burn/redeem, the contract must ensure that no amount is '0' or if it is, that it isn't a vulnerability.\n    /// @param from Address to burn from\n    /// @param tokenIds Array of tokens to burn\n    /// @param amounts Amount of each token to burn\n    function burn(address from, uint256[] calldata tokenIds, uint256[] calldata amounts) external;\n\n    /// @notice Function to set a token uri\n    /// @dev Requires owner or admin\n    /// @param tokenId The token to mint\n    /// @param newUri The new token uri\n    function setTokenUri(uint256 tokenId, string calldata newUri) external;\n}\n"
      },
      "src/interfaces/ICreatorBase.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.22;\n\nimport {IBlockListRegistry} from \"src/interfaces/IBlockListRegistry.sol\";\nimport {ITLNftDelegationRegistry} from \"src/interfaces/ITLNftDelegationRegistry.sol\";\n\n/// @title ICreatorBase.sol\n/// @notice Base interface for creator contracts\n/// @dev Interface id = 0x1c8e024d\n/// @author transientlabs.xyz\n/// @custom:version 3.0.0\ninterface ICreatorBase {\n    /*//////////////////////////////////////////////////////////////////////////\n                                    Events\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @dev Event for changing the story status\n    event StoryStatusUpdate(address indexed sender, bool indexed status);\n\n    /// @dev Event for changing the BlockList registry\n    event BlockListRegistryUpdate(\n        address indexed sender, address indexed prevBlockListRegistry, address indexed newBlockListRegistry\n    );\n\n    /// @dev Event for changing the NFT Delegation registry\n    event NftDelegationRegistryUpdate(\n        address indexed sender, address indexed prevNftDelegationRegistry, address indexed newNftDelegationRegistry\n    );\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                    Functions\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @notice Function to get total supply minted so far\n    function totalSupply() external view returns (uint256);\n\n    /// @notice Function to set approved mint contracts\n    /// @dev Access to owner or admin\n    /// @param minters Array of minters to grant approval to\n    /// @param status Status for the minters\n    function setApprovedMintContracts(address[] calldata minters, bool status) external;\n\n    /// @notice Function to change the blocklist registry\n    /// @dev Access to owner or admin\n    /// @param newBlockListRegistry The new blocklist registry\n    function setBlockListRegistry(address newBlockListRegistry) external;\n\n    /// @notice Function to get the blocklist registry\n    function blocklistRegistry() external view returns (IBlockListRegistry);\n\n    /// @notice Function to change the TL NFT delegation registry\n    /// @dev Access to owner or admin\n    /// @param newNftDelegationRegistry The new blocklist registry\n    function setNftDelegationRegistry(address newNftDelegationRegistry) external;\n\n    /// @notice Function to get the delegation registry\n    function tlNftDelegationRegistry() external view returns (ITLNftDelegationRegistry);\n\n    /// @notice Function to set the default royalty specification\n    /// @dev Requires owner or admin\n    /// @param newRecipient The new royalty payout address\n    /// @param newPercentage The new royalty percentage in basis (out of 10,000)\n    function setDefaultRoyalty(address newRecipient, uint256 newPercentage) external;\n\n    /// @notice Function to override a token's royalty info\n    /// @dev Requires owner or admin\n    /// @param tokenId The token to override royalty for\n    /// @param newRecipient The new royalty payout address for the token id\n    /// @param newPercentage The new royalty percentage in basis (out of 10,000) for the token id\n    function setTokenRoyalty(uint256 tokenId, address newRecipient, uint256 newPercentage) external;\n\n    /// @notice Function to enable or disable collector story inscriptions\n    /// @dev Requires owner or admin\n    /// @param status The status to set for collector story inscriptions\n    function setStoryStatus(bool status) external;\n\n    /// @notice Function to get the status of collector stories\n    /// @return bool Status of collector stories being enabled\n    function storyEnabled() external view returns (bool);\n}\n"
      },
      "src/interfaces/IBlockListRegistry.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\n\n/// @title BlockList Registry\n/// @notice Interface for the BlockListRegistry Contract\n/// @author transientlabs.xyz\n/// @custom:version 4.0.3\ninterface IBlockListRegistry {\n    /*//////////////////////////////////////////////////////////////////////////\n                                Events\n    //////////////////////////////////////////////////////////////////////////*/\n\n    event BlockListStatusChange(address indexed user, address indexed operator, bool indexed status);\n\n    event BlockListCleared(address indexed user);\n\n    /*//////////////////////////////////////////////////////////////////////////\n                          Public Read Functions\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @notice Function to get blocklist status with True meaning that the operator is blocked\n    /// @param operator The operator in question to check against the blocklist\n    function getBlockListStatus(address operator) external view returns (bool);\n\n    /*//////////////////////////////////////////////////////////////////////////\n                          Public Write Functions\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @notice Function to set the block list status for multiple operators\n    /// @dev Must be called by the blockList owner\n    /// @param operators An address array of operators to set a status for\n    /// @param status The status to set for all `operators`\n    function setBlockListStatus(address[] calldata operators, bool status) external;\n\n    /// @notice Function to clear the block list status\n    /// @dev Must be called by the blockList owner\n    function clearBlockList() external;\n}\n"
      },
      "src/interfaces/ITLNftDelegationRegistry.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\n/// @title ITLNftDelegationRegistry.sol\n/// @notice Interface for the TL NFT Delegation Registry\n/// @author transientlabs.xyz\n/// @custom:version 1.0.0\ninterface ITLNftDelegationRegistry {\n    /// @notice Function to check if an address is delegated for a vault for an ERC-721 token\n    /// @dev This function does not ensure the vault is the current owner of the token\n    /// @dev This function SHOULD return `True` if the delegate is delegated for the vault whether it's on the token level, contract level, or wallet level (all)\n    /// @param delegate The address to check for delegation status\n    /// @param vault The vault address to check against\n    /// @param nftContract The nft contract address to check\n    /// @param tokenId The token id to check against\n    /// @return bool `True` is delegated, `False` if not\n    function checkDelegateForERC721(address delegate, address vault, address nftContract, uint256 tokenId)\n        external\n        view\n        returns (bool);\n\n    /// @notice Function to check if an address is delegated for a vault for an ERC-1155 token\n    /// @dev This function does not ensure the vault has a balance of the token in question\n    /// @dev This function SHOULD return `True` if the delegate is delegated for the vault whether it's on the token level, contract level, or wallet level (all)\n    /// @param delegate The address to check for delegation status\n    /// @param vault The vault address to check against\n    /// @param nftContract The nft contract address to check\n    /// @param tokenId The token id to check against\n    /// @return bool `True` is delegated, `False` if not\n    function checkDelegateForERC1155(address delegate, address vault, address nftContract, uint256 tokenId)\n        external\n        view\n        returns (bool);\n}\n"
      },
      "lib/tl-sol-tools/lib/openzeppelin-contracts/contracts/utils/math/Math.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n    /**\n     * @dev Muldiv operation overflow.\n     */\n    error MathOverflowedMulDiv();\n\n    enum Rounding {\n        Floor, // Toward negative infinity\n        Ceil, // Toward positive infinity\n        Trunc, // Toward zero\n        Expand // Away from zero\n    }\n\n    /**\n     * @dev Returns the addition of two unsigned integers, with an overflow flag.\n     */\n    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            uint256 c = a + b;\n            if (c < a) return (false, 0);\n            return (true, c);\n        }\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.\n     */\n    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            if (b > a) return (false, 0);\n            return (true, a - b);\n        }\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n     */\n    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n            // benefit is lost if 'b' is also tested.\n            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n            if (a == 0) return (true, 0);\n            uint256 c = a * b;\n            if (c / a != b) return (false, 0);\n            return (true, c);\n        }\n    }\n\n    /**\n     * @dev Returns the division of two unsigned integers, with a division by zero flag.\n     */\n    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            if (b == 0) return (false, 0);\n            return (true, a / b);\n        }\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n     */\n    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            if (b == 0) return (false, 0);\n            return (true, a % b);\n        }\n    }\n\n    /**\n     * @dev Returns the largest of two numbers.\n     */\n    function max(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a > b ? a : b;\n    }\n\n    /**\n     * @dev Returns the smallest of two numbers.\n     */\n    function min(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a < b ? a : b;\n    }\n\n    /**\n     * @dev Returns the average of two numbers. The result is rounded towards\n     * zero.\n     */\n    function average(uint256 a, uint256 b) internal pure returns (uint256) {\n        // (a + b) / 2 can overflow.\n        return (a & b) + (a ^ b) / 2;\n    }\n\n    /**\n     * @dev Returns the ceiling of the division of two numbers.\n     *\n     * This differs from standard division with `/` in that it rounds towards infinity instead\n     * of rounding towards zero.\n     */\n    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n        if (b == 0) {\n            // Guarantee the same behavior as in a regular Solidity division.\n            return a / b;\n        }\n\n        // (a + b - 1) / b can overflow on addition, so we distribute.\n        return a == 0 ? 0 : (a - 1) / b + 1;\n    }\n\n    /**\n     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n     * denominator == 0.\n     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n     * Uniswap Labs also under MIT license.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n        unchecked {\n            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n            // variables such that product = prod1 * 2^256 + prod0.\n            uint256 prod0 = x * y; // Least significant 256 bits of the product\n            uint256 prod1; // Most significant 256 bits of the product\n            assembly {\n                let mm := mulmod(x, y, not(0))\n                prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n            }\n\n            // Handle non-overflow cases, 256 by 256 division.\n            if (prod1 == 0) {\n                // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n                // The surrounding unchecked block does not change this fact.\n                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n                return prod0 / denominator;\n            }\n\n            // Make sure the result is less than 2^256. Also prevents denominator == 0.\n            if (denominator <= prod1) {\n                revert MathOverflowedMulDiv();\n            }\n\n            ///////////////////////////////////////////////\n            // 512 by 256 division.\n            ///////////////////////////////////////////////\n\n            // Make division exact by subtracting the remainder from [prod1 prod0].\n            uint256 remainder;\n            assembly {\n                // Compute remainder using mulmod.\n                remainder := mulmod(x, y, denominator)\n\n                // Subtract 256 bit number from 512 bit number.\n                prod1 := sub(prod1, gt(remainder, prod0))\n                prod0 := sub(prod0, remainder)\n            }\n\n            // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\n            // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n            uint256 twos = denominator & (0 - denominator);\n            assembly {\n                // Divide denominator by twos.\n                denominator := div(denominator, twos)\n\n                // Divide [prod1 prod0] by twos.\n                prod0 := div(prod0, twos)\n\n                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n                twos := add(div(sub(0, twos), twos), 1)\n            }\n\n            // Shift in bits from prod1 into prod0.\n            prod0 |= prod1 * twos;\n\n            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n            // four bits. That is, denominator * inv = 1 mod 2^4.\n            uint256 inverse = (3 * denominator) ^ 2;\n\n            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\n            // works in modular arithmetic, doubling the correct bits in each step.\n            inverse *= 2 - denominator * inverse; // inverse mod 2^8\n            inverse *= 2 - denominator * inverse; // inverse mod 2^16\n            inverse *= 2 - denominator * inverse; // inverse mod 2^32\n            inverse *= 2 - denominator * inverse; // inverse mod 2^64\n            inverse *= 2 - denominator * inverse; // inverse mod 2^128\n            inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n            // is no longer required.\n            result = prod0 * inverse;\n            return result;\n        }\n    }\n\n    /**\n     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n        uint256 result = mulDiv(x, y, denominator);\n        if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {\n            result += 1;\n        }\n        return result;\n    }\n\n    /**\n     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n     * towards zero.\n     *\n     * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n     */\n    function sqrt(uint256 a) internal pure returns (uint256) {\n        if (a == 0) {\n            return 0;\n        }\n\n        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n        //\n        // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n        //\n        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n        //\n        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n        uint256 result = 1 << (log2(a) >> 1);\n\n        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n        // into the expected uint128 result.\n        unchecked {\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            return min(result, a / result);\n        }\n    }\n\n    /**\n     * @notice Calculates sqrt(a), following the selected rounding direction.\n     */\n    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = sqrt(a);\n            return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 2 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >> 128 > 0) {\n                value >>= 128;\n                result += 128;\n            }\n            if (value >> 64 > 0) {\n                value >>= 64;\n                result += 64;\n            }\n            if (value >> 32 > 0) {\n                value >>= 32;\n                result += 32;\n            }\n            if (value >> 16 > 0) {\n                value >>= 16;\n                result += 16;\n            }\n            if (value >> 8 > 0) {\n                value >>= 8;\n                result += 8;\n            }\n            if (value >> 4 > 0) {\n                value >>= 4;\n                result += 4;\n            }\n            if (value >> 2 > 0) {\n                value >>= 2;\n                result += 2;\n            }\n            if (value >> 1 > 0) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log2(value);\n            return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 10 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >= 10 ** 64) {\n                value /= 10 ** 64;\n                result += 64;\n            }\n            if (value >= 10 ** 32) {\n                value /= 10 ** 32;\n                result += 32;\n            }\n            if (value >= 10 ** 16) {\n                value /= 10 ** 16;\n                result += 16;\n            }\n            if (value >= 10 ** 8) {\n                value /= 10 ** 8;\n                result += 8;\n            }\n            if (value >= 10 ** 4) {\n                value /= 10 ** 4;\n                result += 4;\n            }\n            if (value >= 10 ** 2) {\n                value /= 10 ** 2;\n                result += 2;\n            }\n            if (value >= 10 ** 1) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log10(value);\n            return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 256 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     *\n     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n     */\n    function log256(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >> 128 > 0) {\n                value >>= 128;\n                result += 16;\n            }\n            if (value >> 64 > 0) {\n                value >>= 64;\n                result += 8;\n            }\n            if (value >> 32 > 0) {\n                value >>= 32;\n                result += 4;\n            }\n            if (value >> 16 > 0) {\n                value >>= 16;\n                result += 2;\n            }\n            if (value >> 8 > 0) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log256(value);\n            return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n     */\n    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n        return uint8(rounding) % 2 == 1;\n    }\n}\n"
      },
      "lib/tl-sol-tools/lib/openzeppelin-contracts/contracts/utils/math/SignedMath.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n    /**\n     * @dev Returns the largest of two signed numbers.\n     */\n    function max(int256 a, int256 b) internal pure returns (int256) {\n        return a > b ? a : b;\n    }\n\n    /**\n     * @dev Returns the smallest of two signed numbers.\n     */\n    function min(int256 a, int256 b) internal pure returns (int256) {\n        return a < b ? a : b;\n    }\n\n    /**\n     * @dev Returns the average of two signed numbers without overflow.\n     * The result is rounded towards zero.\n     */\n    function average(int256 a, int256 b) internal pure returns (int256) {\n        // Formula from the book \"Hacker's Delight\"\n        int256 x = (a & b) + ((a ^ b) >> 1);\n        return x + (int256(uint256(x) >> 255) & (a ^ b));\n    }\n\n    /**\n     * @dev Returns the absolute unsigned value of a signed value.\n     */\n    function abs(int256 n) internal pure returns (uint256) {\n        unchecked {\n            // must be unchecked in order to support `n = type(int256).min`\n            return uint256(n >= 0 ? n : -n);\n        }\n    }\n}\n"
      },
      "lib/tl-sol-tools/lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (token/ERC1155/IERC1155.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n */\ninterface IERC1155 is IERC165 {\n    /**\n     * @dev Emitted when `value` amount of tokens of type `id` are transferred from `from` to `to` by `operator`.\n     */\n    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n    /**\n     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n     * transfers.\n     */\n    event TransferBatch(\n        address indexed operator,\n        address indexed from,\n        address indexed to,\n        uint256[] ids,\n        uint256[] values\n    );\n\n    /**\n     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n     * `approved`.\n     */\n    event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n    /**\n     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n     *\n     * If an {URI} event was emitted for `id`, the standard\n     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n     * returned by {IERC1155MetadataURI-uri}.\n     */\n    event URI(string value, uint256 indexed id);\n\n    /**\n     * @dev Returns the value of tokens of token type `id` owned by `account`.\n     *\n     * Requirements:\n     *\n     * - `account` cannot be the zero address.\n     */\n    function balanceOf(address account, uint256 id) external view returns (uint256);\n\n    /**\n     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n     *\n     * Requirements:\n     *\n     * - `accounts` and `ids` must have the same length.\n     */\n    function balanceOfBatch(\n        address[] calldata accounts,\n        uint256[] calldata ids\n    ) external view returns (uint256[] memory);\n\n    /**\n     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n     *\n     * Emits an {ApprovalForAll} event.\n     *\n     * Requirements:\n     *\n     * - `operator` cannot be the caller.\n     */\n    function setApprovalForAll(address operator, bool approved) external;\n\n    /**\n     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n     *\n     * See {setApprovalForAll}.\n     */\n    function isApprovedForAll(address account, address operator) external view returns (bool);\n\n    /**\n     * @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`.\n     *\n     * WARNING: This function can potentially allow a reentrancy attack when transferring tokens\n     * to an untrusted contract, when invoking {onERC1155Received} on the receiver.\n     * Ensure to follow the checks-effects-interactions pattern and consider employing\n     * reentrancy guards when interacting with untrusted contracts.\n     *\n     * Emits a {TransferSingle} event.\n     *\n     * Requirements:\n     *\n     * - `to` cannot be the zero address.\n     * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n     * - `from` must have a balance of tokens of type `id` of at least `value` amount.\n     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n     * acceptance magic value.\n     */\n    function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes calldata data) external;\n\n    /**\n     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n     *\n     * WARNING: This function can potentially allow a reentrancy attack when transferring tokens\n     * to an untrusted contract, when invoking {onERC1155BatchReceived} on the receiver.\n     * Ensure to follow the checks-effects-interactions pattern and consider employing\n     * reentrancy guards when interacting with untrusted contracts.\n     *\n     * Emits either a {TransferSingle} or a {TransferBatch} event, depending on the length of the array arguments.\n     *\n     * Requirements:\n     *\n     * - `ids` and `values` must have the same length.\n     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n     * acceptance magic value.\n     */\n    function safeBatchTransferFrom(\n        address from,\n        address to,\n        uint256[] calldata ids,\n        uint256[] calldata values,\n        bytes calldata data\n    ) external;\n}\n"
      },
      "lib/tl-sol-tools/lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155Receiver.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Interface that must be implemented by smart contracts in order to receive\n * ERC-1155 token transfers.\n */\ninterface IERC1155Receiver is IERC165 {\n    /**\n     * @dev Handles the receipt of a single ERC1155 token type. This function is\n     * called at the end of a `safeTransferFrom` after the balance has been updated.\n     *\n     * NOTE: To accept the transfer, this must return\n     * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n     * (i.e. 0xf23a6e61, or its own function selector).\n     *\n     * @param operator The address which initiated the transfer (i.e. msg.sender)\n     * @param from The address which previously owned the token\n     * @param id The ID of the token being transferred\n     * @param value The amount of tokens being transferred\n     * @param data Additional data with no specified format\n     * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n     */\n    function onERC1155Received(\n        address operator,\n        address from,\n        uint256 id,\n        uint256 value,\n        bytes calldata data\n    ) external returns (bytes4);\n\n    /**\n     * @dev Handles the receipt of a multiple ERC1155 token types. This function\n     * is called at the end of a `safeBatchTransferFrom` after the balances have\n     * been updated.\n     *\n     * NOTE: To accept the transfer(s), this must return\n     * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n     * (i.e. 0xbc197c81, or its own function selector).\n     *\n     * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n     * @param from The address which previously owned the token\n     * @param ids An array containing ids of each token being transferred (order and length must match values array)\n     * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n     * @param data Additional data with no specified format\n     * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n     */\n    function onERC1155BatchReceived(\n        address operator,\n        address from,\n        uint256[] calldata ids,\n        uint256[] calldata values,\n        bytes calldata data\n    ) external returns (bytes4);\n}\n"
      },
      "lib/tl-sol-tools/lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/extensions/IERC1155MetadataURI.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC1155} from \"../IERC1155.sol\";\n\n/**\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\n */\ninterface IERC1155MetadataURI is IERC1155 {\n    /**\n     * @dev Returns the URI for token type `id`.\n     *\n     * If the `\\{id\\}` substring is present in the URI, it must be replaced by\n     * clients with the actual token type ID.\n     */\n    function uri(uint256 id) external view returns (string memory);\n}\n"
      },
      "lib/tl-sol-tools/lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\n    }\n}\n"
      },
      "lib/tl-sol-tools/lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n    /**\n     * @dev Returns true if this contract implements the interface defined by\n     * `interfaceId`. See the corresponding\n     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n     * to learn more about how these ids are created.\n     *\n     * This function call must use less than 30 000 gas.\n     */\n    function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
      },
      "lib/tl-sol-tools/lib/openzeppelin-contracts-upgradeable/contracts/utils/introspection/ERC165Upgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport {Initializable} from \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165Upgradeable is Initializable, IERC165 {\n    function __ERC165_init() internal onlyInitializing {\n    }\n\n    function __ERC165_init_unchained() internal onlyInitializing {\n    }\n    /**\n     * @dev See {IERC165-supportsInterface}.\n     */\n    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n        return interfaceId == type(IERC165).interfaceId;\n    }\n}\n"
      },
      "lib/tl-sol-tools/lib/openzeppelin-contracts/contracts/utils/Arrays.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Arrays.sol)\n\npragma solidity ^0.8.20;\n\nimport {StorageSlot} from \"./StorageSlot.sol\";\nimport {Math} from \"./math/Math.sol\";\n\n/**\n * @dev Collection of functions related to array types.\n */\nlibrary Arrays {\n    using StorageSlot for bytes32;\n\n    /**\n     * @dev Searches a sorted `array` and returns the first index that contains\n     * a value greater or equal to `element`. If no such index exists (i.e. all\n     * values in the array are strictly less than `element`), the array length is\n     * returned. Time complexity O(log n).\n     *\n     * `array` is expected to be sorted in ascending order, and to contain no\n     * repeated elements.\n     */\n    function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {\n        uint256 low = 0;\n        uint256 high = array.length;\n\n        if (high == 0) {\n            return 0;\n        }\n\n        while (low < high) {\n            uint256 mid = Math.average(low, high);\n\n            // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\n            // because Math.average rounds towards zero (it does integer division with truncation).\n            if (unsafeAccess(array, mid).value > element) {\n                high = mid;\n            } else {\n                low = mid + 1;\n            }\n        }\n\n        // At this point `low` is the exclusive upper bound. We will return the inclusive upper bound.\n        if (low > 0 && unsafeAccess(array, low - 1).value == element) {\n            return low - 1;\n        } else {\n            return low;\n        }\n    }\n\n    /**\n     * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n     *\n     * WARNING: Only use if you are certain `pos` is lower than the array length.\n     */\n    function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlot.AddressSlot storage) {\n        bytes32 slot;\n        // We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr`\n        // following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays.\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            mstore(0, arr.slot)\n            slot := add(keccak256(0, 0x20), pos)\n        }\n        return slot.getAddressSlot();\n    }\n\n    /**\n     * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n     *\n     * WARNING: Only use if you are certain `pos` is lower than the array length.\n     */\n    function unsafeAccess(bytes32[] storage arr, uint256 pos) internal pure returns (StorageSlot.Bytes32Slot storage) {\n        bytes32 slot;\n        // We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr`\n        // following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays.\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            mstore(0, arr.slot)\n            slot := add(keccak256(0, 0x20), pos)\n        }\n        return slot.getBytes32Slot();\n    }\n\n    /**\n     * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n     *\n     * WARNING: Only use if you are certain `pos` is lower than the array length.\n     */\n    function unsafeAccess(uint256[] storage arr, uint256 pos) internal pure returns (StorageSlot.Uint256Slot storage) {\n        bytes32 slot;\n        // We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr`\n        // following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays.\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            mstore(0, arr.slot)\n            slot := add(keccak256(0, 0x20), pos)\n        }\n        return slot.getUint256Slot();\n    }\n\n    /**\n     * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n     *\n     * WARNING: Only use if you are certain `pos` is lower than the array length.\n     */\n    function unsafeMemoryAccess(uint256[] memory arr, uint256 pos) internal pure returns (uint256 res) {\n        assembly {\n            res := mload(add(add(arr, 0x20), mul(pos, 0x20)))\n        }\n    }\n\n    /**\n     * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n     *\n     * WARNING: Only use if you are certain `pos` is lower than the array length.\n     */\n    function unsafeMemoryAccess(address[] memory arr, uint256 pos) internal pure returns (address res) {\n        assembly {\n            res := mload(add(add(arr, 0x20), mul(pos, 0x20)))\n        }\n    }\n}\n"
      },
      "lib/tl-sol-tools/lib/openzeppelin-contracts/contracts/interfaces/draft-IERC6093.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.\n */\ninterface IERC20Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     */\n    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC20InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC20InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\n     * @param allowance Amount of tokens a `spender` is allowed to operate with.\n     * @param needed Minimum amount required to perform a transfer.\n     */\n    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC20InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.\n */\ninterface IERC721Errors {\n    /**\n     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.\n     * Used in balance queries.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC721InvalidOwner(address owner);\n\n    /**\n     * @dev Indicates a `tokenId` whose `owner` is the zero address.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC721NonexistentToken(uint256 tokenId);\n\n    /**\n     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param tokenId Identifier number of a token.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC721InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC721InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC721InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.\n */\ninterface IERC1155Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC1155InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC1155InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC1155MissingApprovalForAll(address operator, address owner);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC1155InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC1155InvalidOperator(address operator);\n\n    /**\n     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n     * Used in batch transfers.\n     * @param idsLength Length of the array of token identifiers\n     * @param valuesLength Length of the array of token amounts\n     */\n    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n"
      },
      "lib/tl-sol-tools/lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n *     function initialize() initializer public {\n *         __ERC20_init(\"MyToken\", \"MTK\");\n *     }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n *     function initializeV2() reinitializer(2) public {\n *         __ERC20Permit_init(\"MyToken\");\n *     }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n *     _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Storage of the initializable contract.\n     *\n     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\n     * when using with upgradeable contracts.\n     *\n     * @custom:storage-location erc7201:openzeppelin.storage.Initializable\n     */\n    struct InitializableStorage {\n        /**\n         * @dev Indicates that the contract has been initialized.\n         */\n        uint64 _initialized;\n        /**\n         * @dev Indicates that the contract is in the process of being initialized.\n         */\n        bool _initializing;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Initializable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\n\n    /**\n     * @dev The contract is already initialized.\n     */\n    error InvalidInitialization();\n\n    /**\n     * @dev The contract is not initializing.\n     */\n    error NotInitializing();\n\n    /**\n     * @dev Triggered when the contract has been initialized or reinitialized.\n     */\n    event Initialized(uint64 version);\n\n    /**\n     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n     * `onlyInitializing` functions can be used to initialize parent contracts.\n     *\n     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\n     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\n     * production.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier initializer() {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        // Cache values to avoid duplicated sloads\n        bool isTopLevelCall = !$._initializing;\n        uint64 initialized = $._initialized;\n\n        // Allowed calls:\n        // - initialSetup: the contract is not in the initializing state and no previous version was\n        //                 initialized\n        // - construction: the contract is initialized at version 1 (no reininitialization) and the\n        //                 current contract is just being deployed\n        bool initialSetup = initialized == 0 && isTopLevelCall;\n        bool construction = initialized == 1 && address(this).code.length == 0;\n\n        if (!initialSetup && !construction) {\n            revert InvalidInitialization();\n        }\n        $._initialized = 1;\n        if (isTopLevelCall) {\n            $._initializing = true;\n        }\n        _;\n        if (isTopLevelCall) {\n            $._initializing = false;\n            emit Initialized(1);\n        }\n    }\n\n    /**\n     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n     * used to initialize parent contracts.\n     *\n     * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n     * are added through upgrades and that require initialization.\n     *\n     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n     * cannot be nested. If one is invoked in the context of another, execution will revert.\n     *\n     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n     * a contract, executing them in the right order is up to the developer or operator.\n     *\n     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier reinitializer(uint64 version) {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing || $._initialized >= version) {\n            revert InvalidInitialization();\n        }\n        $._initialized = version;\n        $._initializing = true;\n        _;\n        $._initializing = false;\n        emit Initialized(version);\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} and {reinitializer} modifiers, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        _checkInitializing();\n        _;\n    }\n\n    /**\n     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\n     */\n    function _checkInitializing() internal view virtual {\n        if (!_isInitializing()) {\n            revert NotInitializing();\n        }\n    }\n\n    /**\n     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n     * through proxies.\n     *\n     * Emits an {Initialized} event the first time it is successfully executed.\n     */\n    function _disableInitializers() internal virtual {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing) {\n            revert InvalidInitialization();\n        }\n        if ($._initialized != type(uint64).max) {\n            $._initialized = type(uint64).max;\n            emit Initialized(type(uint64).max);\n        }\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function _getInitializedVersion() internal view returns (uint64) {\n        return _getInitializableStorage()._initialized;\n    }\n\n    /**\n     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n     */\n    function _isInitializing() internal view returns (bool) {\n        return _getInitializableStorage()._initializing;\n    }\n\n    /**\n     * @dev Returns a pointer to the storage namespace.\n     */\n    // solhint-disable-next-line var-name-mixedcase\n    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\n        assembly {\n            $.slot := INITIALIZABLE_STORAGE\n        }\n    }\n}\n"
      },
      "lib/tl-sol-tools/src/royalties/IEIP2981.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\n///\n/// @dev Interface for the NFT Royalty Standard\n///\ninterface IEIP2981 {\n    /// ERC165 bytes to add to interface array - set in parent contract\n    /// implementing this standard\n    ///\n    /// bytes4(keccak256(\"royaltyInfo(uint256,uint256)\")) == 0x2a55205a\n\n    /// @notice Called with the sale price to determine how much royalty\n    //          is owed and to whom.\n    /// @param tokenId The NFT asset queried for royalty information\n    /// @param salePrice The sale price of the NFT asset specified by tokenId\n    /// @return receiver Address of who should be sent the royalty payment\n    /// @return royaltyAmount The royalty payment amount for salePrice\n    function royaltyInfo(uint256 tokenId, uint256 salePrice)\n        external\n        view\n        returns (address receiver, uint256 royaltyAmount);\n}\n"
      },
      "lib/tl-sol-tools/lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ContextUpgradeable} from \"../utils/ContextUpgradeable.sol\";\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The initial owner is set to the address provided by the deployer. This can\n * later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n    /// @custom:storage-location erc7201:openzeppelin.storage.Ownable\n    struct OwnableStorage {\n        address _owner;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Ownable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300;\n\n    function _getOwnableStorage() private pure returns (OwnableStorage storage $) {\n        assembly {\n            $.slot := OwnableStorageLocation\n        }\n    }\n\n    /**\n     * @dev The caller account is not authorized to perform an operation.\n     */\n    error OwnableUnauthorizedAccount(address account);\n\n    /**\n     * @dev The owner is not a valid owner account. (eg. `address(0)`)\n     */\n    error OwnableInvalidOwner(address owner);\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n     */\n    function __Ownable_init(address initialOwner) internal onlyInitializing {\n        __Ownable_init_unchained(initialOwner);\n    }\n\n    function __Ownable_init_unchained(address initialOwner) internal onlyInitializing {\n        if (initialOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(initialOwner);\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        _checkOwner();\n        _;\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        OwnableStorage storage $ = _getOwnableStorage();\n        return $._owner;\n    }\n\n    /**\n     * @dev Throws if the sender is not the owner.\n     */\n    function _checkOwner() internal view virtual {\n        if (owner() != _msgSender()) {\n            revert OwnableUnauthorizedAccount(_msgSender());\n        }\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby disabling any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        if (newOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        OwnableStorage storage $ = _getOwnableStorage();\n        address oldOwner = $._owner;\n        $._owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n}\n"
      },
      "lib/tl-sol-tools/lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n *     // Add the library methods\n *     using EnumerableSet for EnumerableSet.AddressSet;\n *\n *     // Declare a set state variable\n *     EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n    // To implement this library for multiple types with as little code\n    // repetition as possible, we write it in terms of a generic Set type with\n    // bytes32 values.\n    // The Set implementation uses private functions, and user-facing\n    // implementations (such as AddressSet) are just wrappers around the\n    // underlying Set.\n    // This means that we can only create new EnumerableSets for types that fit\n    // in bytes32.\n\n    struct Set {\n        // Storage of set values\n        bytes32[] _values;\n        // Position is the index of the value in the `values` array plus 1.\n        // Position 0 is used to mean a value is not in the set.\n        mapping(bytes32 value => uint256) _positions;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function _add(Set storage set, bytes32 value) private returns (bool) {\n        if (!_contains(set, value)) {\n            set._values.push(value);\n            // The value is stored at length-1, but we add 1 to all indexes\n            // and use 0 as a sentinel value\n            set._positions[value] = set._values.length;\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function _remove(Set storage set, bytes32 value) private returns (bool) {\n        // We cache the value's position to prevent multiple reads from the same storage slot\n        uint256 position = set._positions[value];\n\n        if (position != 0) {\n            // Equivalent to contains(set, value)\n            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n            // the array, and then remove the last element (sometimes called as 'swap and pop').\n            // This modifies the order of the array, as noted in {at}.\n\n            uint256 valueIndex = position - 1;\n            uint256 lastIndex = set._values.length - 1;\n\n            if (valueIndex != lastIndex) {\n                bytes32 lastValue = set._values[lastIndex];\n\n                // Move the lastValue to the index where the value to delete is\n                set._values[valueIndex] = lastValue;\n                // Update the tracked position of the lastValue (that was just moved)\n                set._positions[lastValue] = position;\n            }\n\n            // Delete the slot where the moved value was stored\n            set._values.pop();\n\n            // Delete the tracked position for the deleted slot\n            delete set._positions[value];\n\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function _contains(Set storage set, bytes32 value) private view returns (bool) {\n        return set._positions[value] != 0;\n    }\n\n    /**\n     * @dev Returns the number of values on the set. O(1).\n     */\n    function _length(Set storage set) private view returns (uint256) {\n        return set._values.length;\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function _at(Set storage set, uint256 index) private view returns (bytes32) {\n        return set._values[index];\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function _values(Set storage set) private view returns (bytes32[] memory) {\n        return set._values;\n    }\n\n    // Bytes32Set\n\n    struct Bytes32Set {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n        return _add(set._inner, value);\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n        return _remove(set._inner, value);\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n        return _contains(set._inner, value);\n    }\n\n    /**\n     * @dev Returns the number of values in the set. O(1).\n     */\n    function length(Bytes32Set storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n        return _at(set._inner, index);\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n        bytes32[] memory store = _values(set._inner);\n        bytes32[] memory result;\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            result := store\n        }\n\n        return result;\n    }\n\n    // AddressSet\n\n    struct AddressSet {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(AddressSet storage set, address value) internal returns (bool) {\n        return _add(set._inner, bytes32(uint256(uint160(value))));\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(AddressSet storage set, address value) internal returns (bool) {\n        return _remove(set._inner, bytes32(uint256(uint160(value))));\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(AddressSet storage set, address value) internal view returns (bool) {\n        return _contains(set._inner, bytes32(uint256(uint160(value))));\n    }\n\n    /**\n     * @dev Returns the number of values in the set. O(1).\n     */\n    function length(AddressSet storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function at(AddressSet storage set, uint256 index) internal view returns (address) {\n        return address(uint160(uint256(_at(set._inner, index))));\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(AddressSet storage set) internal view returns (address[] memory) {\n        bytes32[] memory store = _values(set._inner);\n        address[] memory result;\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            result := store\n        }\n\n        return result;\n    }\n\n    // UintSet\n\n    struct UintSet {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(UintSet storage set, uint256 value) internal returns (bool) {\n        return _add(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(UintSet storage set, uint256 value) internal returns (bool) {\n        return _remove(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n        return _contains(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Returns the number of values in the set. O(1).\n     */\n    function length(UintSet storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n        return uint256(_at(set._inner, index));\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(UintSet storage set) internal view returns (uint256[] memory) {\n        bytes32[] memory store = _values(set._inner);\n        uint256[] memory result;\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            result := store\n        }\n\n        return result;\n    }\n}\n"
      },
      "lib/tl-sol-tools/lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n *     function _getImplementation() internal view returns (address) {\n *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n *     }\n *\n *     function _setImplementation(address newImplementation) internal {\n *         require(newImplementation.code.length > 0);\n *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n *     }\n * }\n * ```\n */\nlibrary StorageSlot {\n    struct AddressSlot {\n        address value;\n    }\n\n    struct BooleanSlot {\n        bool value;\n    }\n\n    struct Bytes32Slot {\n        bytes32 value;\n    }\n\n    struct Uint256Slot {\n        uint256 value;\n    }\n\n    struct StringSlot {\n        string value;\n    }\n\n    struct BytesSlot {\n        bytes value;\n    }\n\n    /**\n     * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n     */\n    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n     */\n    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n     */\n    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n     */\n    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `StringSlot` with member `value` located at `slot`.\n     */\n    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n     */\n    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := store.slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BytesSlot` with member `value` located at `slot`.\n     */\n    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n     */\n    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := store.slot\n        }\n    }\n}\n"
      }
    },
    "settings": {
      "remappings": [
        "ds-test/=lib/forge-std/lib/ds-test/src/",
        "forge-std/=lib/forge-std/src/",
        "openzeppelin-upgradeable/=lib/tl-sol-tools/lib/openzeppelin-contracts-upgradeable/contracts/",
        "openzeppelin/=lib/tl-sol-tools/lib/openzeppelin-contracts/contracts/",
        "tl-sol-tools/=lib/tl-sol-tools/src/",
        "@manifoldxyz/libraries-solidity/=lib/tl-sol-tools/lib/royalty-registry-solidity/lib/libraries-solidity/",
        "@openzeppelin/contracts-upgradeable/=lib/tl-sol-tools/lib/openzeppelin-contracts-upgradeable/contracts/",
        "@openzeppelin/contracts/=lib/tl-sol-tools/lib/openzeppelin-contracts/contracts/",
        "create2-helpers/=lib/tl-sol-tools/lib/royalty-registry-solidity/lib/create2-helpers/",
        "create2-scripts/=lib/tl-sol-tools/lib/royalty-registry-solidity/lib/create2-helpers/script/",
        "erc4626-tests/=lib/tl-sol-tools/lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
        "libraries-solidity/=lib/tl-sol-tools/lib/royalty-registry-solidity/lib/libraries-solidity/contracts/",
        "royalty-registry-solidity/=lib/tl-sol-tools/lib/royalty-registry-solidity/",
        "openzeppelin-contracts-upgradeable/=lib/tl-sol-tools/lib/openzeppelin-contracts-upgradeable/",
        "openzeppelin-contracts/=lib/tl-sol-tools/lib/openzeppelin-contracts/"
      ],
      "optimizer": {
        "enabled": true,
        "runs": 20000
      },
      "metadata": {
        "useLiteralContent": false,
        "bytecodeHash": "ipfs",
        "appendCBOR": true
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "evmVersion": "paris",
      "libraries": {}
    }
  }}