creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "contracts/utils/LibRenderer.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity 0.8.20;\n\nimport { Strings } from \"../utils/vendor/Strings.sol\";\n\nenum Color {\n    DEFAULT,\n    GREEN,\n    CYAN,\n    BLUE,\n    PURPLE,\n    PINK,\n    ORANGE,\n    RED\n}\n\nenum ColorType {\n    PRIMARY,\n    SECONDARY,\n    LIGHT,\n    DARK\n}\n\nlibrary LibRenderer {\n    using Strings for uint256;\n    using Strings for string;\n\n    function calcAnimationVariables(\n        string memory partyName\n    ) external pure returns (uint256 duration, uint256 steps, uint256 delay, uint256 translateX) {\n        translateX = bytes(partyName).length * 30 + 300;\n        duration = translateX / 56;\n\n        // Make duration even so that the animation delay is always exactly\n        // half of the duration.\n        if (duration % 2 != 0) duration += 1;\n\n        delay = duration / 2;\n        steps = translateX / 6;\n    }\n\n    function formatAsDecimalString(\n        uint256 n,\n        uint256 decimals,\n        uint256 maxChars\n    ) external pure returns (string memory) {\n        string memory str = n.toString();\n        uint256 oneUnit = 10 ** decimals;\n        if (n < 10 ** (decimals - 2)) {\n            return \"&lt;0.01\";\n        } else if (n < oneUnit) {\n            // Preserve leading zeros for decimals.\n            // (e.g. if 0.01, `n` will \"1\" so we need to prepend a \"0\").\n            return\n                string.concat(\"0.\", prependNumWithZeros(str, decimals).substring(0, maxChars - 1));\n        } else if (n >= 1000 * oneUnit) {\n            return str.substring(0, maxChars);\n        } else {\n            uint256 i = bytes((n / oneUnit).toString()).length;\n            return string.concat(str.substring(0, i), \".\", str.substring(i, maxChars));\n        }\n    }\n\n    function prependNumWithZeros(\n        string memory numStr,\n        uint256 expectedLength\n    ) public pure returns (string memory) {\n        uint256 length = bytes(numStr).length;\n        if (length < expectedLength) {\n            for (uint256 i; i < expectedLength - length; ++i) {\n                numStr = string.concat(\"0\", numStr);\n            }\n        }\n\n        return numStr;\n    }\n\n    function generateColorHex(\n        Color color,\n        ColorType colorType\n    ) external pure returns (string memory colorHex) {\n        if (color == Color.DEFAULT) {\n            if (colorType == ColorType.PRIMARY) {\n                return \"#A7B8CF\";\n            } else if (colorType == ColorType.SECONDARY) {\n                return \"#DCE5F0\";\n            } else if (colorType == ColorType.LIGHT) {\n                return \"#91A6C3\";\n            } else if (colorType == ColorType.DARK) {\n                return \"#50586D\";\n            }\n        } else if (color == Color.GREEN) {\n            if (colorType == ColorType.PRIMARY) {\n                return \"#10B173\";\n            } else if (colorType == ColorType.SECONDARY) {\n                return \"#93DCB7\";\n            } else if (colorType == ColorType.LIGHT) {\n                return \"#00A25A\";\n            } else if (colorType == ColorType.DARK) {\n                return \"#005E3B\";\n            }\n        } else if (color == Color.CYAN) {\n            if (colorType == ColorType.PRIMARY) {\n                return \"#00C1FA\";\n            } else if (colorType == ColorType.SECONDARY) {\n                return \"#B1EFFD\";\n            } else if (colorType == ColorType.LIGHT) {\n                return \"#00B4EA\";\n            } else if (colorType == ColorType.DARK) {\n                return \"#005669\";\n            }\n        } else if (color == Color.BLUE) {\n            if (colorType == ColorType.PRIMARY) {\n                return \"#2C78F3\";\n            } else if (colorType == ColorType.SECONDARY) {\n                return \"#B3D4FF\";\n            } else if (colorType == ColorType.LIGHT) {\n                return \"#0E70E0\";\n            } else if (colorType == ColorType.DARK) {\n                return \"#00286A\";\n            }\n        } else if (color == Color.PURPLE) {\n            if (colorType == ColorType.PRIMARY) {\n                return \"#9B45DF\";\n            } else if (colorType == ColorType.SECONDARY) {\n                return \"#D2ACF2\";\n            } else if (colorType == ColorType.LIGHT) {\n                return \"#832EC9\";\n            } else if (colorType == ColorType.DARK) {\n                return \"#47196B\";\n            }\n        } else if (color == Color.PINK) {\n            if (colorType == ColorType.PRIMARY) {\n                return \"#FF6BF3\";\n            } else if (colorType == ColorType.SECONDARY) {\n                return \"#FFC8FB\";\n            } else if (colorType == ColorType.LIGHT) {\n                return \"#E652E2\";\n            } else if (colorType == ColorType.DARK) {\n                return \"#911A96\";\n            }\n        } else if (color == Color.ORANGE) {\n            if (colorType == ColorType.PRIMARY) {\n                return \"#FF8946\";\n            } else if (colorType == ColorType.SECONDARY) {\n                return \"#FFE38B\";\n            } else if (colorType == ColorType.LIGHT) {\n                return \"#E47B2F\";\n            } else if (colorType == ColorType.DARK) {\n                return \"#732700\";\n            }\n        } else if (color == Color.RED) {\n            if (colorType == ColorType.PRIMARY) {\n                return \"#EC0000\";\n            } else if (colorType == ColorType.SECONDARY) {\n                return \"#FFA6A6\";\n            } else if (colorType == ColorType.LIGHT) {\n                return \"#D70000\";\n            } else if (colorType == ColorType.DARK) {\n                return \"#6F0000\";\n            }\n        }\n    }\n\n    function getCollectionImageAndBanner(\n        Color color,\n        bool isDarkMode\n    ) external pure returns (string memory image, string memory banner) {\n        if (isDarkMode) {\n            if (color == Color.GREEN) {\n                image = \"QmdcjXrxj7EimjuNTLQp1uKM2zYhuF1WVkVjF6TpfNNXrf\";\n                banner = \"QmR3vqAV17SJiwksiCHV1cLQuf9TKZuar8NQu8GmKkHRXM\";\n            } else if (color == Color.CYAN) {\n                image = \"QmS678DTkTTzFQEDiqj3AsW6wt6bi4bNhWbKcBM29HBhhB\";\n                banner = \"QmYSbXyPh9Lx2wmv6Z7SK8iFD9kyADxtaohV1gv6ZVKFj4\";\n            } else if (color == Color.BLUE) {\n                image = \"QmX2k8beAjyVhPk1ZrK6KrwbqLk3fRNPPmknRti7zEtGQa\";\n                banner = \"QmaXN8MbcrjkHPt97Z7xeuTCx6wPkJ9xZN7ExZZwMabspy\";\n            } else if (color == Color.PURPLE) {\n                image = \"Qmf8SrxKH3QZQCEzcMbA3UoJGZ1j2coTLaQFptWhZZvqhg\";\n                banner = \"QmWhpo9kN2Nf8ioWb7BKwqsCQKt3M2TduHPNqMqXz9jUK4\";\n            } else if (color == Color.PINK) {\n                image = \"QmV5eT9DWvU5BJa4LVSemkoDKyjJBC56adk2JLWMXYEQfn\";\n                banner = \"QmP2NTyvMQ5yN1RY4nH1HfoTX2r6Ug6WZfN9GFf9toak8M\";\n            } else if (color == Color.ORANGE) {\n                image = \"QmPirB7VFaao2ZUxLtM5WTCwZhE7c9Uy2heyNZF5t9PgsS\";\n                banner = \"QmUMgkjhrxedcLUvWt8VKrZdvrCGmjxWDSDXfm2M96nKUx\";\n            } else if (color == Color.RED) {\n                image = \"QmNRZ3syuEiiAkWYRFs9BpQ5M38wv8tEu17J2sYwmMdeta\";\n                banner = \"QmQV1EjzwQsXdgi6C6ubfopZrprk6Ab9LVnggZBgJDg5C2\";\n            } else {\n                image = \"QmNwGtGyYwDfS6ghQbDw5a9buv7auFXz63W3rDhzmxjVhw\";\n                banner = \"QmYUujTBgH6RTswZSiSzuy2GUojE6H9edaXeoSwwvh2T7o\";\n            }\n        } else {\n            if (color == Color.GREEN) {\n                image = \"QmR7t2g2hrkMYyzhUMEANzEGX74FQcbg3c7eTvCcQucMst\";\n                banner = \"Qmc3zRfT6nC2G1KgoWpCvLDVjNi7x7KFgwButecj3sq9qg\";\n            } else if (color == Color.CYAN) {\n                image = \"QmeiBRb9muNXej3dn4usjjdtbUpgYASfA5jmWqJRshivGH\";\n                banner = \"QmcsvMB2xiBKKMyKsBkC51TjWnyk42nNJnsudoGFsvvXCt\";\n            } else if (color == Color.BLUE) {\n                image = \"QmaErgGsanUTo73RMgvizMg3c7x1d1X4t76Tti22Pc1xan\";\n                banner = \"QmSjhHF994xBd7wavV4mhj7GpZmw5euQUBxpiPbbmxExqp\";\n            } else if (color == Color.PURPLE) {\n                image = \"QmeVJTcUpKQFSz5aBsVpQk8quoXEEZBNPAAMo3wHvdRzHa\";\n                banner = \"QmYx6aHYGitr6p8dHUa7n4nyew3pWy1Mfdn8fpFLejmhHC\";\n            } else if (color == Color.PINK) {\n                image = \"QmY4JJkBEeHVYHdfCCXPd7bWkAhNRxuKTWdf9MssGxSmCG\";\n                banner = \"QmQH5CFf3qXG2oymGzwTDgUmPFBsaTw2Qbfhjk58VHcABd\";\n            } else if (color == Color.ORANGE) {\n                image = \"QmYhB3vjBLPwPTC5SBidNbZhB5oBMBMpKy4g6ejTxmGLkK\";\n                banner = \"QmRP8cVjJyPRV7wXs5ApwbCFyTBpHXmHsDexbcN4o7aomd\";\n            } else if (color == Color.RED) {\n                image = \"QmfG8HPMEsKwKJ8xX3i2JhJtCskuiUjZLe8NhvXFdYyFR2\";\n                banner = \"QmazXbqfFtQexkwFDbYkyvLF4xRSDrmEVQS4PSAs2ZtxDn\";\n            } else {\n                image = \"QmZKE4XkPvU7Z8CdgK2Cn7gLQ4t8CDkkfnR1j5bZ2AfRJu\";\n                banner = \"QmTKCqLUQJt3VxGuUqLMj1jcCRRsaZwY4k757Wb7YPzmH2\";\n            }\n        }\n\n        image = string.concat(\"ipfs://\", image);\n        banner = string.concat(\"ipfs://\", banner);\n    }\n}\n"
      },
      "contracts/utils/vendor/Strings.sol": {
        "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8;\n\n// Modified from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Strings.sol\nlibrary Strings {\n    bytes16 private constant _HEX_SYMBOLS = \"0123456789abcdef\";\n    uint8 private constant _ADDRESS_LENGTH = 20;\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        // Inspired by OraclizeAPI's implementation - MIT licence\n        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\n\n        if (value == 0) {\n            return \"0\";\n        }\n        uint256 temp = value;\n        uint256 digits;\n        while (temp != 0) {\n            digits++;\n            temp /= 10;\n        }\n        bytes memory buffer = new bytes(digits);\n        while (value != 0) {\n            digits -= 1;\n            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n            value /= 10;\n        }\n        return string(buffer);\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        if (value == 0) {\n            return \"0x00\";\n        }\n        uint256 temp = value;\n        uint256 length = 0;\n        while (temp != 0) {\n            length++;\n            temp >>= 8;\n        }\n        return toHexString(value, length);\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        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_SYMBOLS[value & 0xf];\n            value >>= 4;\n        }\n        require(value == 0, \"Strings: hex length insufficient\");\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 representation.\n     */\n    function toHexString(address addr) internal pure returns (string memory) {\n        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n    }\n\n    function substring(\n        string memory str,\n        uint startIndex,\n        uint endIndex\n    ) internal pure returns (string memory) {\n        bytes memory strBytes = bytes(str);\n        bytes memory result = new bytes(endIndex - startIndex);\n        for (uint i = startIndex; i < endIndex; i++) {\n            result[i - startIndex] = strBytes[i];\n        }\n        return string(result);\n    }\n}\n"
      }
    },
    "settings": {
      "remappings": [
        "forge-std/=lib/forge-std/src/",
        "openzeppelin/=lib/openzeppelin-contracts/",
        "solmate/=lib/solmate/src/",
        "@openzeppelin/contracts/=lib/erc20-creator/lib/openzeppelin-contracts/contracts/",
        "ds-test/=lib/forge-std/lib/ds-test/src/",
        "erc20-creator/=lib/erc20-creator/src/",
        "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
        "openzeppelin-contracts/=lib/openzeppelin-contracts/",
        "party-addresses/=lib/party-addresses/",
        "party-protocol/=lib/erc20-creator/lib/party-protocol/",
        "v2-core/=lib/v2-core/contracts/",
        "v2-periphery/=lib/v2-periphery/contracts/"
      ],
      "optimizer": {
        "enabled": true,
        "runs": 50
      },
      "metadata": {
        "useLiteralContent": false,
        "bytecodeHash": "ipfs",
        "appendCBOR": true
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "evmVersion": "shanghai",
      "viaIR": true,
      "libraries": {
        "contracts/utils/LibRenderer.sol": {
          "LibRenderer": "0xD73a81cD18928b98A22008f1e28c81bb97202deE"
        }
      }
    }
  }}