creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "src/OnChainManny.sol": {
        "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.20;\n\nimport {Base64} from \"@openzeppelin/contracts/utils/Base64.sol\";\nimport {SSTORE2} from \"solady/utils/SSTORE2.sol\";\nimport {InflateLib} from \"inflate-sol/InflateLib.sol\";\n\ncontract OnChainManny {\n    /* -------------------------------------------------------------------------- */\n    /*                                    STATE                                   */\n    /* -------------------------------------------------------------------------- */\n    address[] private _slots;\n    uint256 private immutable _size;\n    /* -------------------------------------------------------------------------- */\n    /*                               INITIALIZATION                               */\n    /* -------------------------------------------------------------------------- */\n\n    constructor(address[] memory slots, uint256 size) {\n        _slots = slots;\n        _size = size;\n    }\n    /* -------------------------------------------------------------------------- */\n    /*                                    DATA                                    */\n    /* -------------------------------------------------------------------------- */\n\n    function read() external view returns (string memory) {\n        bytes memory data;\n        for (uint256 i; i < _slots.length; i++) {\n            data = bytes.concat(data, SSTORE2.read(_slots[i]));\n        }\n        (, bytes memory output) = InflateLib.puff(data, _size);\n        return string(abi.encodePacked(\"data:model/gltf-binary;base64,\", Base64.encode(bytes(output))));\n    }\n}\n"
      },
      "lib/openzeppelin-contracts/contracts/utils/Base64.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Base64.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides a set of functions to operate with Base64 strings.\n */\nlibrary Base64 {\n    /**\n     * @dev Base64 Encoding/Decoding Table\n     */\n    string internal constant _TABLE = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n    /**\n     * @dev Converts a `bytes` to its Bytes64 `string` representation.\n     */\n    function encode(bytes memory data) internal pure returns (string memory) {\n        /**\n         * Inspired by Brecht Devos (Brechtpd) implementation - MIT licence\n         * https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol\n         */\n        if (data.length == 0) return \"\";\n\n        // Loads the table into memory\n        string memory table = _TABLE;\n\n        // Encoding takes 3 bytes chunks of binary data from `bytes` data parameter\n        // and split into 4 numbers of 6 bits.\n        // The final Base64 length should be `bytes` data length multiplied by 4/3 rounded up\n        // - `data.length + 2`  -> Round up\n        // - `/ 3`              -> Number of 3-bytes chunks\n        // - `4 *`              -> 4 characters for each chunk\n        string memory result = new string(4 * ((data.length + 2) / 3));\n\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Prepare the lookup table (skip the first \"length\" byte)\n            let tablePtr := add(table, 1)\n\n            // Prepare result pointer, jump over length\n            let resultPtr := add(result, 32)\n\n            // Run over the input, 3 bytes at a time\n            for {\n                let dataPtr := data\n                let endPtr := add(data, mload(data))\n            } lt(dataPtr, endPtr) {\n\n            } {\n                // Advance 3 bytes\n                dataPtr := add(dataPtr, 3)\n                let input := mload(dataPtr)\n\n                // To write each character, shift the 3 bytes (18 bits) chunk\n                // 4 times in blocks of 6 bits for each character (18, 12, 6, 0)\n                // and apply logical AND with 0x3F which is the number of\n                // the previous character in the ASCII table prior to the Base64 Table\n                // The result is then added to the table to get the character to write,\n                // and finally write it in the result pointer but with a left shift\n                // of 256 (1 byte) - 8 (1 ASCII char) = 248 bits\n\n                mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F))))\n                resultPtr := add(resultPtr, 1) // Advance\n\n                mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F))))\n                resultPtr := add(resultPtr, 1) // Advance\n\n                mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F))))\n                resultPtr := add(resultPtr, 1) // Advance\n\n                mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F))))\n                resultPtr := add(resultPtr, 1) // Advance\n            }\n\n            // When data `bytes` is not exactly 3 bytes long\n            // it is padded with `=` characters at the end\n            switch mod(mload(data), 3)\n            case 1 {\n                mstore8(sub(resultPtr, 1), 0x3d)\n                mstore8(sub(resultPtr, 2), 0x3d)\n            }\n            case 2 {\n                mstore8(sub(resultPtr, 1), 0x3d)\n            }\n        }\n\n        return result;\n    }\n}\n"
      },
      "lib/solady/src/utils/SSTORE2.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Read and write to persistent storage at a fraction of the cost.\n/// @author Solady (https://github.com/vectorized/solmady/blob/main/src/utils/SSTORE2.sol)\n/// @author Saw-mon-and-Natalie (https://github.com/Saw-mon-and-Natalie)\n/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SSTORE2.sol)\n/// @author Modified from 0xSequence (https://github.com/0xSequence/sstore2/blob/master/contracts/SSTORE2.sol)\nlibrary SSTORE2 {\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                         CONSTANTS                          */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev We skip the first byte as it's a STOP opcode,\n    /// which ensures the contract can't be called.\n    uint256 internal constant DATA_OFFSET = 1;\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                        CUSTOM ERRORS                       */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Unable to deploy the storage contract.\n    error DeploymentFailed();\n\n    /// @dev The storage contract address is invalid.\n    error InvalidPointer();\n\n    /// @dev Attempt to read outside of the storage contract's bytecode bounds.\n    error ReadOutOfBounds();\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                         WRITE LOGIC                        */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Writes `data` into the bytecode of a storage contract and returns its address.\n    function write(bytes memory data) internal returns (address pointer) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let originalDataLength := mload(data)\n\n            // Add 1 to data size since we are prefixing it with a STOP opcode.\n            let dataSize := add(originalDataLength, DATA_OFFSET)\n\n            /**\n             * ------------------------------------------------------------------------------+\n             * Opcode      | Mnemonic        | Stack                   | Memory              |\n             * ------------------------------------------------------------------------------|\n             * 61 dataSize | PUSH2 dataSize  | dataSize                |                     |\n             * 80          | DUP1            | dataSize dataSize       |                     |\n             * 60 0xa      | PUSH1 0xa       | 0xa dataSize dataSize   |                     |\n             * 3D          | RETURNDATASIZE  | 0 0xa dataSize dataSize |                     |\n             * 39          | CODECOPY        | dataSize                | [0..dataSize): code |\n             * 3D          | RETURNDATASIZE  | 0 dataSize              | [0..dataSize): code |\n             * F3          | RETURN          |                         | [0..dataSize): code |\n             * 00          | STOP            |                         |                     |\n             * ------------------------------------------------------------------------------+\n             * @dev Prefix the bytecode with a STOP opcode to ensure it cannot be called.\n             * Also PUSH2 is used since max contract size cap is 24,576 bytes which is less than 2 ** 16.\n             */\n            mstore(\n                // Do a out-of-gas revert if `dataSize` is more than 2 bytes.\n                // The actual EVM limit may be smaller and may change over time.\n                add(data, gt(dataSize, 0xffff)),\n                // Left shift `dataSize` by 64 so that it lines up with the 0000 after PUSH2.\n                or(0xfd61000080600a3d393df300, shl(0x40, dataSize))\n            )\n\n            // Deploy a new contract with the generated creation code.\n            pointer := create(0, add(data, 0x15), add(dataSize, 0xa))\n\n            // If `pointer` is zero, revert.\n            if iszero(pointer) {\n                // Store the function selector of `DeploymentFailed()`.\n                mstore(0x00, 0x30116425)\n                // Revert with (offset, size).\n                revert(0x1c, 0x04)\n            }\n\n            // Restore original length of the variable size `data`.\n            mstore(data, originalDataLength)\n        }\n    }\n\n    /// @dev Writes `data` into the bytecode of a storage contract with `salt`\n    /// and returns its deterministic address.\n    function writeDeterministic(bytes memory data, bytes32 salt)\n        internal\n        returns (address pointer)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let originalDataLength := mload(data)\n            let dataSize := add(originalDataLength, DATA_OFFSET)\n\n            mstore(\n                // Do a out-of-gas revert if `dataSize` is more than 2 bytes.\n                // The actual EVM limit may be smaller and may change over time.\n                add(data, gt(dataSize, 0xffff)),\n                // Left shift `dataSize` by 64 so that it lines up with the 0000 after PUSH2.\n                or(0xfd61000080600a3d393df300, shl(0x40, dataSize))\n            )\n\n            // Deploy a new contract with the generated creation code.\n            pointer := create2(0, add(data, 0x15), add(dataSize, 0xa), salt)\n\n            // If `pointer` is zero, revert.\n            if iszero(pointer) {\n                // Store the function selector of `DeploymentFailed()`.\n                mstore(0x00, 0x30116425)\n                // Revert with (offset, size).\n                revert(0x1c, 0x04)\n            }\n\n            // Restore original length of the variable size `data`.\n            mstore(data, originalDataLength)\n        }\n    }\n\n    /// @dev Returns the initialization code hash of the storage contract for `data`.\n    /// Used for mining vanity addresses with create2crunch.\n    function initCodeHash(bytes memory data) internal pure returns (bytes32 hash) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let originalDataLength := mload(data)\n            let dataSize := add(originalDataLength, DATA_OFFSET)\n\n            // Do a out-of-gas revert if `dataSize` is more than 2 bytes.\n            // The actual EVM limit may be smaller and may change over time.\n            returndatacopy(returndatasize(), returndatasize(), shr(16, dataSize))\n\n            mstore(data, or(0x61000080600a3d393df300, shl(0x40, dataSize)))\n\n            hash := keccak256(add(data, 0x15), add(dataSize, 0xa))\n\n            // Restore original length of the variable size `data`.\n            mstore(data, originalDataLength)\n        }\n    }\n\n    /// @dev Returns the address of the storage contract for `data`\n    /// deployed with `salt` by `deployer`.\n    /// Note: The returned result has dirty upper 96 bits. Please clean if used in assembly.\n    function predictDeterministicAddress(bytes memory data, bytes32 salt, address deployer)\n        internal\n        pure\n        returns (address predicted)\n    {\n        bytes32 hash = initCodeHash(data);\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Compute and store the bytecode hash.\n            mstore8(0x00, 0xff) // Write the prefix.\n            mstore(0x35, hash)\n            mstore(0x01, shl(96, deployer))\n            mstore(0x15, salt)\n            predicted := keccak256(0x00, 0x55)\n            // Restore the part of the free memory pointer that has been overwritten.\n            mstore(0x35, 0)\n        }\n    }\n\n    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n    /*                         READ LOGIC                         */\n    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n    /// @dev Returns all the `data` from the bytecode of the storage contract at `pointer`.\n    function read(address pointer) internal view returns (bytes memory data) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let pointerCodesize := extcodesize(pointer)\n            if iszero(pointerCodesize) {\n                // Store the function selector of `InvalidPointer()`.\n                mstore(0x00, 0x11052bb4)\n                // Revert with (offset, size).\n                revert(0x1c, 0x04)\n            }\n            // Offset all indices by 1 to skip the STOP opcode.\n            let size := sub(pointerCodesize, DATA_OFFSET)\n\n            // Get the pointer to the free memory and allocate\n            // enough 32-byte words for the data and the length of the data,\n            // then copy the code to the allocated memory.\n            // Masking with 0xffe0 will suffice, since contract size is less than 16 bits.\n            data := mload(0x40)\n            mstore(0x40, add(data, and(add(size, 0x3f), 0xffe0)))\n            mstore(data, size)\n            mstore(add(add(data, 0x20), size), 0) // Zeroize the last slot.\n            extcodecopy(pointer, add(data, 0x20), DATA_OFFSET, size)\n        }\n    }\n\n    /// @dev Returns the `data` from the bytecode of the storage contract at `pointer`,\n    /// from the byte at `start`, to the end of the data stored.\n    function read(address pointer, uint256 start) internal view returns (bytes memory data) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let pointerCodesize := extcodesize(pointer)\n            if iszero(pointerCodesize) {\n                // Store the function selector of `InvalidPointer()`.\n                mstore(0x00, 0x11052bb4)\n                // Revert with (offset, size).\n                revert(0x1c, 0x04)\n            }\n\n            // If `!(pointer.code.size > start)`, reverts.\n            // This also handles the case where `start + DATA_OFFSET` overflows.\n            if iszero(gt(pointerCodesize, start)) {\n                // Store the function selector of `ReadOutOfBounds()`.\n                mstore(0x00, 0x84eb0dd1)\n                // Revert with (offset, size).\n                revert(0x1c, 0x04)\n            }\n            let size := sub(pointerCodesize, add(start, DATA_OFFSET))\n\n            // Get the pointer to the free memory and allocate\n            // enough 32-byte words for the data and the length of the data,\n            // then copy the code to the allocated memory.\n            // Masking with 0xffe0 will suffice, since contract size is less than 16 bits.\n            data := mload(0x40)\n            mstore(0x40, add(data, and(add(size, 0x3f), 0xffe0)))\n            mstore(data, size)\n            mstore(add(add(data, 0x20), size), 0) // Zeroize the last slot.\n            extcodecopy(pointer, add(data, 0x20), add(start, DATA_OFFSET), size)\n        }\n    }\n\n    /// @dev Returns the `data` from the bytecode of the storage contract at `pointer`,\n    /// from the byte at `start`, to the byte at `end` (exclusive) of the data stored.\n    function read(address pointer, uint256 start, uint256 end)\n        internal\n        view\n        returns (bytes memory data)\n    {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let pointerCodesize := extcodesize(pointer)\n            if iszero(pointerCodesize) {\n                // Store the function selector of `InvalidPointer()`.\n                mstore(0x00, 0x11052bb4)\n                // Revert with (offset, size).\n                revert(0x1c, 0x04)\n            }\n\n            // If `!(pointer.code.size > end) || (start > end)`, revert.\n            // This also handles the cases where\n            // `end + DATA_OFFSET` or `start + DATA_OFFSET` overflows.\n            if iszero(\n                and(\n                    gt(pointerCodesize, end), // Within bounds.\n                    iszero(gt(start, end)) // Valid range.\n                )\n            ) {\n                // Store the function selector of `ReadOutOfBounds()`.\n                mstore(0x00, 0x84eb0dd1)\n                // Revert with (offset, size).\n                revert(0x1c, 0x04)\n            }\n            let size := sub(end, start)\n\n            // Get the pointer to the free memory and allocate\n            // enough 32-byte words for the data and the length of the data,\n            // then copy the code to the allocated memory.\n            // Masking with 0xffe0 will suffice, since contract size is less than 16 bits.\n            data := mload(0x40)\n            mstore(0x40, add(data, and(add(size, 0x3f), 0xffe0)))\n            mstore(data, size)\n            mstore(add(add(data, 0x20), size), 0) // Zeroize the last slot.\n            extcodecopy(pointer, add(data, 0x20), add(start, DATA_OFFSET), size)\n        }\n    }\n}\n"
      },
      "lib/inflate-sol/contracts/InflateLib.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity >=0.8.0 <0.9.0;\n\n/// @notice Based on https://github.com/madler/zlib/blob/master/contrib/puff\nlibrary InflateLib {\n    // Maximum bits in a code\n    uint256 constant MAXBITS = 15;\n    // Maximum number of literal/length codes\n    uint256 constant MAXLCODES = 286;\n    // Maximum number of distance codes\n    uint256 constant MAXDCODES = 30;\n    // Maximum codes lengths to read\n    uint256 constant MAXCODES = (MAXLCODES + MAXDCODES);\n    // Number of fixed literal/length codes\n    uint256 constant FIXLCODES = 288;\n\n    // Error codes\n    enum ErrorCode {\n        ERR_NONE, // 0 successful inflate\n        ERR_NOT_TERMINATED, // 1 available inflate data did not terminate\n        ERR_OUTPUT_EXHAUSTED, // 2 output space exhausted before completing inflate\n        ERR_INVALID_BLOCK_TYPE, // 3 invalid block type (type == 3)\n        ERR_STORED_LENGTH_NO_MATCH, // 4 stored block length did not match one's complement\n        ERR_TOO_MANY_LENGTH_OR_DISTANCE_CODES, // 5 dynamic block code description: too many length or distance codes\n        ERR_CODE_LENGTHS_CODES_INCOMPLETE, // 6 dynamic block code description: code lengths codes incomplete\n        ERR_REPEAT_NO_FIRST_LENGTH, // 7 dynamic block code description: repeat lengths with no first length\n        ERR_REPEAT_MORE, // 8 dynamic block code description: repeat more than specified lengths\n        ERR_INVALID_LITERAL_LENGTH_CODE_LENGTHS, // 9 dynamic block code description: invalid literal/length code lengths\n        ERR_INVALID_DISTANCE_CODE_LENGTHS, // 10 dynamic block code description: invalid distance code lengths\n        ERR_MISSING_END_OF_BLOCK, // 11 dynamic block code description: missing end-of-block code\n        ERR_INVALID_LENGTH_OR_DISTANCE_CODE, // 12 invalid literal/length or distance code in fixed or dynamic block\n        ERR_DISTANCE_TOO_FAR, // 13 distance is too far back in fixed or dynamic block\n        ERR_CONSTRUCT // 14 internal: error in construct()\n    }\n\n    // Input and output state\n    struct State {\n        //////////////////\n        // Output state //\n        //////////////////\n        // Output buffer\n        bytes output;\n        // Bytes written to out so far\n        uint256 outcnt;\n        /////////////////\n        // Input state //\n        /////////////////\n        // Input buffer\n        bytes input;\n        // Bytes read so far\n        uint256 incnt;\n        ////////////////\n        // Temp state //\n        ////////////////\n        // Bit buffer\n        uint256 bitbuf;\n        // Number of bits in bit buffer\n        uint256 bitcnt;\n        //////////////////////////\n        // Static Huffman codes //\n        //////////////////////////\n        Huffman lencode;\n        Huffman distcode;\n    }\n\n    // Huffman code decoding tables\n    struct Huffman {\n        uint256[] counts;\n        uint256[] symbols;\n    }\n\n    function bits(\n        State memory s,\n        uint256 need\n    ) private pure returns (ErrorCode, uint256) {\n        // Bit accumulator (can use up to 20 bits)\n        uint256 val;\n\n        // Load at least need bits into val\n        val = s.bitbuf;\n        while (s.bitcnt < need) {\n            if (s.incnt == s.input.length) {\n                // Out of input\n                return (ErrorCode.ERR_NOT_TERMINATED, 0);\n            }\n\n            // Load eight bits\n            val |= uint256(uint8(s.input[s.incnt++])) << s.bitcnt;\n            s.bitcnt += 8;\n        }\n\n        // Drop need bits and update buffer, always zero to seven bits left\n        s.bitbuf = val >> need;\n        s.bitcnt -= need;\n\n        // Return need bits, zeroing the bits above that\n        uint256 ret = (val & ((1 << need) - 1));\n        return (ErrorCode.ERR_NONE, ret);\n    }\n\n    function _stored(State memory s) private pure returns (ErrorCode) {\n        // Length of stored block\n        uint256 len;\n\n        // Discard leftover bits from current byte (assumes s.bitcnt < 8)\n        s.bitbuf = 0;\n        s.bitcnt = 0;\n\n        // Get length and check against its one's complement\n        if (s.incnt + 4 > s.input.length) {\n            // Not enough input\n            return ErrorCode.ERR_NOT_TERMINATED;\n        }\n        len = uint256(uint8(s.input[s.incnt++]));\n        len |= uint256(uint8(s.input[s.incnt++])) << 8;\n\n        if (\n            uint8(s.input[s.incnt++]) != (~len & 0xFF) ||\n            uint8(s.input[s.incnt++]) != ((~len >> 8) & 0xFF)\n        ) {\n            // Didn't match complement!\n            return ErrorCode.ERR_STORED_LENGTH_NO_MATCH;\n        }\n\n        // Copy len bytes from in to out\n        if (s.incnt + len > s.input.length) {\n            // Not enough input\n            return ErrorCode.ERR_NOT_TERMINATED;\n        }\n        if (s.outcnt + len > s.output.length) {\n            // Not enough output space\n            return ErrorCode.ERR_OUTPUT_EXHAUSTED;\n        }\n        while (len != 0) {\n            // Note: Solidity reverts on underflow, so we decrement here\n            len -= 1;\n            s.output[s.outcnt++] = s.input[s.incnt++];\n        }\n\n        // Done with a valid stored block\n        return ErrorCode.ERR_NONE;\n    }\n\n    function _decode(\n        State memory s,\n        Huffman memory h\n    ) private pure returns (ErrorCode, uint256) {\n        // Current number of bits in code\n        uint256 len;\n        // Len bits being decoded\n        uint256 code = 0;\n        // First code of length len\n        uint256 first = 0;\n        // Number of codes of length len\n        uint256 count;\n        // Index of first code of length len in symbol table\n        uint256 index = 0;\n        // Error code\n        ErrorCode err;\n\n        for (len = 1; len <= MAXBITS; len++) {\n            // Get next bit\n            uint256 tempCode;\n            (err, tempCode) = bits(s, 1);\n            if (err != ErrorCode.ERR_NONE) {\n                return (err, 0);\n            }\n            code |= tempCode;\n            count = h.counts[len];\n\n            // If length len, return symbol\n            if (code < first + count) {\n                return (ErrorCode.ERR_NONE, h.symbols[index + (code - first)]);\n            }\n            // Else update for next length\n            index += count;\n            first += count;\n            first <<= 1;\n            code <<= 1;\n        }\n\n        // Ran out of codes\n        return (ErrorCode.ERR_INVALID_LENGTH_OR_DISTANCE_CODE, 0);\n    }\n\n    function _construct(\n        Huffman memory h,\n        uint256[] memory lengths,\n        uint256 n,\n        uint256 start\n    ) private pure returns (ErrorCode) {\n        // Current symbol when stepping through lengths[]\n        uint256 symbol;\n        // Current length when stepping through h.counts[]\n        uint256 len;\n        // Number of possible codes left of current length\n        uint256 left;\n        // Offsets in symbol table for each length\n        uint256[MAXBITS + 1] memory offs;\n\n        // Count number of codes of each length\n        for (len = 0; len <= MAXBITS; len++) {\n            h.counts[len] = 0;\n        }\n        for (symbol = 0; symbol < n; symbol++) {\n            // Assumes lengths are within bounds\n            h.counts[lengths[start + symbol]]++;\n        }\n        // No codes!\n        if (h.counts[0] == n) {\n            // Complete, but decode() will fail\n            return (ErrorCode.ERR_NONE);\n        }\n\n        // Check for an over-subscribed or incomplete set of lengths\n\n        // One possible code of zero length\n        left = 1;\n\n        for (len = 1; len <= MAXBITS; len++) {\n            // One more bit, double codes left\n            left <<= 1;\n            if (left < h.counts[len]) {\n                // Over-subscribed--return error\n                return ErrorCode.ERR_CONSTRUCT;\n            }\n            // Deduct count from possible codes\n\n            left -= h.counts[len];\n        }\n\n        // Generate offsets into symbol table for each length for sorting\n        offs[1] = 0;\n        for (len = 1; len < MAXBITS; len++) {\n            offs[len + 1] = offs[len] + h.counts[len];\n        }\n\n        // Put symbols in table sorted by length, by symbol order within each length\n        for (symbol = 0; symbol < n; symbol++) {\n            if (lengths[start + symbol] != 0) {\n                h.symbols[offs[lengths[start + symbol]]++] = symbol;\n            }\n        }\n\n        // Left > 0 means incomplete\n        return left > 0 ? ErrorCode.ERR_CONSTRUCT : ErrorCode.ERR_NONE;\n    }\n\n    function _codes(\n        State memory s,\n        Huffman memory lencode,\n        Huffman memory distcode\n    ) private pure returns (ErrorCode) {\n        // Decoded symbol\n        uint256 symbol;\n        // Length for copy\n        uint256 len;\n        // Distance for copy\n        uint256 dist;\n        // TODO Solidity doesn't support constant arrays, but these are fixed at compile-time\n        // Size base for length codes 257..285\n        uint16[29] memory lens = [\n            3,\n            4,\n            5,\n            6,\n            7,\n            8,\n            9,\n            10,\n            11,\n            13,\n            15,\n            17,\n            19,\n            23,\n            27,\n            31,\n            35,\n            43,\n            51,\n            59,\n            67,\n            83,\n            99,\n            115,\n            131,\n            163,\n            195,\n            227,\n            258\n        ];\n        // Extra bits for length codes 257..285\n        uint8[29] memory lext = [\n            0,\n            0,\n            0,\n            0,\n            0,\n            0,\n            0,\n            0,\n            1,\n            1,\n            1,\n            1,\n            2,\n            2,\n            2,\n            2,\n            3,\n            3,\n            3,\n            3,\n            4,\n            4,\n            4,\n            4,\n            5,\n            5,\n            5,\n            5,\n            0\n        ];\n        // Offset base for distance codes 0..29\n        uint16[30] memory dists = [\n            1,\n            2,\n            3,\n            4,\n            5,\n            7,\n            9,\n            13,\n            17,\n            25,\n            33,\n            49,\n            65,\n            97,\n            129,\n            193,\n            257,\n            385,\n            513,\n            769,\n            1025,\n            1537,\n            2049,\n            3073,\n            4097,\n            6145,\n            8193,\n            12289,\n            16385,\n            24577\n        ];\n        // Extra bits for distance codes 0..29\n        uint8[30] memory dext = [\n            0,\n            0,\n            0,\n            0,\n            1,\n            1,\n            2,\n            2,\n            3,\n            3,\n            4,\n            4,\n            5,\n            5,\n            6,\n            6,\n            7,\n            7,\n            8,\n            8,\n            9,\n            9,\n            10,\n            10,\n            11,\n            11,\n            12,\n            12,\n            13,\n            13\n        ];\n        // Error code\n        ErrorCode err;\n\n        // Decode literals and length/distance pairs\n        while (symbol != 256) {\n            (err, symbol) = _decode(s, lencode);\n            if (err != ErrorCode.ERR_NONE) {\n                // Invalid symbol\n                return err;\n            }\n\n            if (symbol < 256) {\n                // Literal: symbol is the byte\n                // Write out the literal\n                if (s.outcnt == s.output.length) {\n                    return ErrorCode.ERR_OUTPUT_EXHAUSTED;\n                }\n                s.output[s.outcnt] = bytes1(uint8(symbol));\n                s.outcnt++;\n            } else if (symbol > 256) {\n                uint256 tempBits;\n                // Length\n                // Get and compute length\n                symbol -= 257;\n                if (symbol >= 29) {\n                    // Invalid fixed code\n                    return ErrorCode.ERR_INVALID_LENGTH_OR_DISTANCE_CODE;\n                }\n\n                (err, tempBits) = bits(s, lext[symbol]);\n                if (err != ErrorCode.ERR_NONE) {\n                    return err;\n                }\n                len = lens[symbol] + tempBits;\n\n                // Get and check distance\n                (err, symbol) = _decode(s, distcode);\n                if (err != ErrorCode.ERR_NONE) {\n                    // Invalid symbol\n                    return err;\n                }\n                (err, tempBits) = bits(s, dext[symbol]);\n                if (err != ErrorCode.ERR_NONE) {\n                    return err;\n                }\n                dist = dists[symbol] + tempBits;\n                if (dist > s.outcnt) {\n                    // Distance too far back\n                    return ErrorCode.ERR_DISTANCE_TOO_FAR;\n                }\n\n                // Copy length bytes from distance bytes back\n                if (s.outcnt + len > s.output.length) {\n                    return ErrorCode.ERR_OUTPUT_EXHAUSTED;\n                }\n                while (len != 0) {\n                    // Note: Solidity reverts on underflow, so we decrement here\n                    len -= 1;\n                    s.output[s.outcnt] = s.output[s.outcnt - dist];\n                    s.outcnt++;\n                }\n            } else {\n                s.outcnt += len;\n            }\n        }\n\n        // Done with a valid fixed or dynamic block\n        return ErrorCode.ERR_NONE;\n    }\n\n    function _build_fixed(State memory s) private pure returns (ErrorCode) {\n        // Build fixed Huffman tables\n        // TODO this is all a compile-time constant\n        uint256 symbol;\n        uint256[] memory lengths = new uint256[](FIXLCODES);\n\n        // Literal/length table\n        for (symbol = 0; symbol < 144; symbol++) {\n            lengths[symbol] = 8;\n        }\n        for (; symbol < 256; symbol++) {\n            lengths[symbol] = 9;\n        }\n        for (; symbol < 280; symbol++) {\n            lengths[symbol] = 7;\n        }\n        for (; symbol < FIXLCODES; symbol++) {\n            lengths[symbol] = 8;\n        }\n\n        _construct(s.lencode, lengths, FIXLCODES, 0);\n\n        // Distance table\n        for (symbol = 0; symbol < MAXDCODES; symbol++) {\n            lengths[symbol] = 5;\n        }\n\n        _construct(s.distcode, lengths, MAXDCODES, 0);\n\n        return ErrorCode.ERR_NONE;\n    }\n\n    function _fixed(State memory s) private pure returns (ErrorCode) {\n        // Decode data until end-of-block code\n        return _codes(s, s.lencode, s.distcode);\n    }\n\n    function _build_dynamic_lengths(\n        State memory s\n    ) private pure returns (ErrorCode, uint256[] memory) {\n        uint256 ncode;\n        // Index of lengths[]\n        uint256 index;\n        // Descriptor code lengths\n        uint256[] memory lengths = new uint256[](MAXCODES);\n        // Error code\n        ErrorCode err;\n        // Permutation of code length codes\n        uint8[19] memory order = [\n            16,\n            17,\n            18,\n            0,\n            8,\n            7,\n            9,\n            6,\n            10,\n            5,\n            11,\n            4,\n            12,\n            3,\n            13,\n            2,\n            14,\n            1,\n            15\n        ];\n\n        (err, ncode) = bits(s, 4);\n        if (err != ErrorCode.ERR_NONE) {\n            return (err, lengths);\n        }\n        ncode += 4;\n\n        // Read code length code lengths (really), missing lengths are zero\n        for (index = 0; index < ncode; index++) {\n            (err, lengths[order[index]]) = bits(s, 3);\n            if (err != ErrorCode.ERR_NONE) {\n                return (err, lengths);\n            }\n        }\n        for (; index < 19; index++) {\n            lengths[order[index]] = 0;\n        }\n\n        return (ErrorCode.ERR_NONE, lengths);\n    }\n\n    function _build_dynamic(\n        State memory s\n    ) private pure returns (ErrorCode, Huffman memory, Huffman memory) {\n        // Number of lengths in descriptor\n        uint256 nlen;\n        uint256 ndist;\n        // Index of lengths[]\n        uint256 index;\n        // Error code\n        ErrorCode err;\n        // Descriptor code lengths\n        uint256[] memory lengths = new uint256[](MAXCODES);\n        // Length and distance codes\n        Huffman memory lencode = Huffman(\n            new uint256[](MAXBITS + 1),\n            new uint256[](MAXLCODES)\n        );\n        Huffman memory distcode = Huffman(\n            new uint256[](MAXBITS + 1),\n            new uint256[](MAXDCODES)\n        );\n        uint256 tempBits;\n\n        // Get number of lengths in each table, check lengths\n        (err, nlen) = bits(s, 5);\n        if (err != ErrorCode.ERR_NONE) {\n            return (err, lencode, distcode);\n        }\n        nlen += 257;\n        (err, ndist) = bits(s, 5);\n        if (err != ErrorCode.ERR_NONE) {\n            return (err, lencode, distcode);\n        }\n        ndist += 1;\n\n        if (nlen > MAXLCODES || ndist > MAXDCODES) {\n            // Bad counts\n            return (\n                ErrorCode.ERR_TOO_MANY_LENGTH_OR_DISTANCE_CODES,\n                lencode,\n                distcode\n            );\n        }\n\n        (err, lengths) = _build_dynamic_lengths(s);\n        if (err != ErrorCode.ERR_NONE) {\n            return (err, lencode, distcode);\n        }\n\n        // Build huffman table for code lengths codes (use lencode temporarily)\n        err = _construct(lencode, lengths, 19, 0);\n        if (err != ErrorCode.ERR_NONE) {\n            // Require complete code set here\n            return (\n                ErrorCode.ERR_CODE_LENGTHS_CODES_INCOMPLETE,\n                lencode,\n                distcode\n            );\n        }\n\n        // Read length/literal and distance code length tables\n        index = 0;\n        while (index < nlen + ndist) {\n            // Decoded value\n            uint256 symbol;\n            // Last length to repeat\n            uint256 len;\n\n            (err, symbol) = _decode(s, lencode);\n            if (err != ErrorCode.ERR_NONE) {\n                // Invalid symbol\n                return (err, lencode, distcode);\n            }\n\n            if (symbol < 16) {\n                // Length in 0..15\n                lengths[index++] = symbol;\n            } else {\n                // Repeat instruction\n                // Assume repeating zeros\n                len = 0;\n                if (symbol == 16) {\n                    // Repeat last length 3..6 times\n                    if (index == 0) {\n                        // No last length!\n                        return (\n                            ErrorCode.ERR_REPEAT_NO_FIRST_LENGTH,\n                            lencode,\n                            distcode\n                        );\n                    }\n                    // Last length\n                    len = lengths[index - 1];\n                    (err, tempBits) = bits(s, 2);\n                    if (err != ErrorCode.ERR_NONE) {\n                        return (err, lencode, distcode);\n                    }\n                    symbol = 3 + tempBits;\n                } else if (symbol == 17) {\n                    // Repeat zero 3..10 times\n                    (err, tempBits) = bits(s, 3);\n                    if (err != ErrorCode.ERR_NONE) {\n                        return (err, lencode, distcode);\n                    }\n                    symbol = 3 + tempBits;\n                } else {\n                    // == 18, repeat zero 11..138 times\n                    (err, tempBits) = bits(s, 7);\n                    if (err != ErrorCode.ERR_NONE) {\n                        return (err, lencode, distcode);\n                    }\n                    symbol = 11 + tempBits;\n                }\n\n                if (index + symbol > nlen + ndist) {\n                    // Too many lengths!\n                    return (ErrorCode.ERR_REPEAT_MORE, lencode, distcode);\n                }\n                while (symbol != 0) {\n                    // Note: Solidity reverts on underflow, so we decrement here\n                    symbol -= 1;\n\n                    // Repeat last or zero symbol times\n                    lengths[index++] = len;\n                }\n            }\n        }\n\n        // Check for end-of-block code -- there better be one!\n        if (lengths[256] == 0) {\n            return (ErrorCode.ERR_MISSING_END_OF_BLOCK, lencode, distcode);\n        }\n\n        // Build huffman table for literal/length codes\n        err = _construct(lencode, lengths, nlen, 0);\n        if (\n            err != ErrorCode.ERR_NONE &&\n            (err == ErrorCode.ERR_NOT_TERMINATED ||\n                err == ErrorCode.ERR_OUTPUT_EXHAUSTED ||\n                nlen != lencode.counts[0] + lencode.counts[1])\n        ) {\n            // Incomplete code ok only for single length 1 code\n            return (\n                ErrorCode.ERR_INVALID_LITERAL_LENGTH_CODE_LENGTHS,\n                lencode,\n                distcode\n            );\n        }\n\n        // Build huffman table for distance codes\n        err = _construct(distcode, lengths, ndist, nlen);\n        if (\n            err != ErrorCode.ERR_NONE &&\n            (err == ErrorCode.ERR_NOT_TERMINATED ||\n                err == ErrorCode.ERR_OUTPUT_EXHAUSTED ||\n                ndist != distcode.counts[0] + distcode.counts[1])\n        ) {\n            // Incomplete code ok only for single length 1 code\n            return (\n                ErrorCode.ERR_INVALID_DISTANCE_CODE_LENGTHS,\n                lencode,\n                distcode\n            );\n        }\n\n        return (ErrorCode.ERR_NONE, lencode, distcode);\n    }\n\n    function _dynamic(State memory s) private pure returns (ErrorCode) {\n        // Length and distance codes\n        Huffman memory lencode;\n        Huffman memory distcode;\n        // Error code\n        ErrorCode err;\n\n        (err, lencode, distcode) = _build_dynamic(s);\n        if (err != ErrorCode.ERR_NONE) {\n            return err;\n        }\n\n        // Decode data until end-of-block code\n        return _codes(s, lencode, distcode);\n    }\n\n    function puff(\n        bytes memory source,\n        uint256 destlen\n    ) internal pure returns (ErrorCode, bytes memory) {\n        // Input/output state\n        State memory s = State(\n            new bytes(destlen),\n            0,\n            source,\n            0,\n            0,\n            0,\n            Huffman(new uint256[](MAXBITS + 1), new uint256[](FIXLCODES)),\n            Huffman(new uint256[](MAXBITS + 1), new uint256[](MAXDCODES))\n        );\n        // Temp: last bit\n        uint256 last;\n        // Temp: block type bit\n        uint256 t;\n        // Error code\n        ErrorCode err;\n\n        // Build fixed Huffman tables\n        err = _build_fixed(s);\n        if (err != ErrorCode.ERR_NONE) {\n            return (err, s.output);\n        }\n\n        // Process blocks until last block or error\n        while (last == 0) {\n            // One if last block\n            (err, last) = bits(s, 1);\n            if (err != ErrorCode.ERR_NONE) {\n                return (err, s.output);\n            }\n\n            // Block type 0..3\n            (err, t) = bits(s, 2);\n            if (err != ErrorCode.ERR_NONE) {\n                return (err, s.output);\n            }\n\n            err = (\n                t == 0\n                    ? _stored(s)\n                    : (\n                        t == 1\n                            ? _fixed(s)\n                            : (\n                                t == 2\n                                    ? _dynamic(s)\n                                    : ErrorCode.ERR_INVALID_BLOCK_TYPE\n                            )\n                    )\n            );\n            // type == 3, invalid\n\n            if (err != ErrorCode.ERR_NONE) {\n                // Return with error\n                break;\n            }\n        }\n\n        return (err, s.output);\n    }\n}\n"
      }
    },
    "settings": {
      "remappings": [
        "ds-test/=lib/forge-std/lib/ds-test/src/",
        "forge-std/=lib/forge-std/src/",
        "inflate-sol/=lib/inflate-sol/contracts/",
        "solady/=lib/solady/src/",
        "solmate/=lib/solmate/src/",
        "zipped-contracts/=lib/zipped-contracts/",
        "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
        "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
        "openzeppelin-contracts/=lib/openzeppelin-contracts/"
      ],
      "optimizer": {
        "enabled": true,
        "runs": 200
      },
      "metadata": {
        "useLiteralContent": false,
        "bytecodeHash": "ipfs",
        "appendCBOR": true
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "evmVersion": "paris",
      "viaIR": false,
      "libraries": {}
    }
  }}