creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "src/codejar/src/CodeJar.sol": {
        "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.23;\n\n/**\n * @title Code Jar\n * @notice Deploys contract code to deterministic addresses\n * @author Compound Labs, Inc.\n */\ncontract CodeJar {\n    /**\n     * @notice Deploys the code via Code Jar, no-op if it already exists\n     * @dev This call is meant to be idemponent and fairly inexpensive on a second call\n     * @param code The creation bytecode of the code to save\n     * @return The address of the contract that matches the input code's contructor output\n     */\n    function saveCode(bytes memory code) external returns (address) {\n        address codeAddress = getCodeAddress(code);\n\n        if (codeAddress.code.length > 0) {\n            // Code is already deployed\n            return codeAddress;\n        } else {\n            // The code has not been deployed here (or it was deployed and destructed).\n            address script;\n            assembly {\n                script := create2(0, add(code, 0x20), mload(code), 0)\n            }\n\n            // Posit: these cannot fail and are purely defense-in-depth\n            require(script == codeAddress);\n\n            uint256 scriptSz;\n            assembly {\n                scriptSz := extcodesize(script)\n            }\n\n            // Disallow the empty code and self-destructing constructors\n            // Note: Script can still self-destruct after being deployed until Dencun\n            require(scriptSz > 0);\n\n            return codeAddress;\n        }\n    }\n\n    /**\n     * @notice Checks if code was already deployed by CodeJar\n     * @param code The runtime bytecode of the code to check\n     * @return True if code already exists in Code Jar\n     */\n    function codeExists(bytes calldata code) external view returns (bool) {\n        address codeAddress = getCodeAddress(code);\n\n        return codeAddress.code.length > 0;\n    }\n\n    /**\n     * @dev Returns the create2 address based on the creation code\n     * @return The create2 address to deploy this code (via init code)\n     */\n    function getCodeAddress(bytes memory code) public view returns (address) {\n        return address(\n            uint160(uint256(keccak256(abi.encodePacked(bytes1(0xff), address(this), uint256(0), keccak256(code)))))\n        );\n    }\n}\n"
      }
    },
    "settings": {
      "remappings": [
        "test/=test/",
        "codejar/=src/codejar/",
        "legend-scripts/=src/legend-scripts/",
        "quark-core/=src/quark-core/",
        "quark-core-scripts/=src/quark-core-scripts/",
        "quark-factory/=src/quark-factory/",
        "quark-proxy/=src/quark-proxy/",
        "@uniswap/=lib/",
        "ds-test/=lib/forge-std/lib/ds-test/src/",
        "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
        "forge-std/=lib/forge-std/src/",
        "openzeppelin-contracts/=lib/openzeppelin-contracts/",
        "openzeppelin/=lib/openzeppelin-contracts/contracts/",
        "v3-core/=lib/v3-core/",
        "v3-periphery/=lib/v3-periphery/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": true,
      "libraries": {}
    }
  }}