[
  {
    "path": ".cargo/config.toml",
    "content": "[alias]\nlint = \"clippy --all-targets --all-features -- --no-deps -W clippy::pedantic -W clippy::undocumented_unsafe_blocks  -A clippy::module_name_repetitions -A clippy::missing_errors_doc -A clippy::missing_panics_doc\"\n"
  },
  {
    "path": ".gitattributes",
    "content": "*.* text eol=lf\n*.png -text\n*.jpg -text\n*.gif -text\n"
  },
  {
    "path": ".github/CODEOWNERS",
    "content": "* @foundry-rs/starknet-foundry\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/1-bug_report.yml",
    "content": "name: Problem Report\ndescription: Report a problem with a tool\ntype: \"Bug\"\nbody:\n  - type: dropdown\n    id: tool-name\n    attributes:\n      label: Select Tool\n      description: Select for which tool you would like to report a bug.\n      multiple: false\n      options:\n        - snforge\n        - sncast\n    validations:\n      required: true\n\n  - type: input\n    id: foundry-version\n    attributes:\n      label: Foundry Version\n      description: What tool version are you using? This can be checked by running `snforge --version` and `sncast --version` accordingly.\n    validations:\n      required: true\n\n  - type: dropdown\n    id: operating-system\n    attributes:\n      label: What operating system are you using?\n      multiple: false\n      options:\n        - Linux\n        - MacOS\n    validations:\n      required: true\n\n  - type: dropdown\n    id: system-architecture\n    attributes:\n      label: What system architecture are you using?\n      multiple: false\n      options:\n        - x86\n        - arm\n    validations:\n      required: true\n\n  - type: textarea\n    id: what-happened\n    attributes:\n      label: Issue Description\n      description: Describe the problem that happened to you. The more details you provide, the better.\n      placeholder: Running `snforge` doesn't produce tests\n    validations:\n      required: true\n\n  - type: textarea\n    id: logs\n    attributes:\n      label: Command Line Output\n      description: If relevant, please provide the command output related to the problem described above.\n    validations:\n      required: false\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/2-feature_request.yml",
    "content": "name: Feature Request\ndescription: Request a feature to be added to a tool\ntype: \"Feature\"\nbody:\n  - type: dropdown\n    id: tool-name\n    attributes:\n      label: Select Tool\n      description: Select for which tool you would like to request a feature.\n      multiple: false\n      options:\n        - snforge\n        - sncast\n    validations:\n      required: true\n\n  - type: textarea\n    id: Suggestion\n    attributes:\n      label: Requested Feature\n      description: Describe the feature you would like to be added to the tool selected above.\n    validations:\n      required: true\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/3-work_item.yml",
    "content": "name: Work Item\ndescription: Submit an actionable task\nbody:\n  - type: textarea\n    id: current-state\n    attributes:\n      label: Current State\n      description: Describe the current state and outline the problem\n      placeholder: Currently, the `print_a` cheatcode prints `\"a\"` to stdout. This is problematic because user might want it to be printed on their actual printer.\n    validations:\n      required: true\n\n  - type: input\n    id: objective\n    attributes:\n      label: Objective\n      description: Briefly describe the correct state\n      placeholder: The `print_a` cheatcode should magically detect if user wants to print to stdout or a printer.\n    validations:\n      required: true\n\n  - type: textarea\n    id: additional-context\n    attributes:\n      label: Additional Context\n      description: Provide additional context on the desired state.\n      placeholder: If we can detect any printers in local network it might indicate that user wants to print to it.\n    validations:\n      required: false\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/4-child_work_item.yml",
    "content": "name: Child Item\ndescription: Child work item for tracking issues\ntype: \"Task\"\nbody:\n  - type: input\n    id: objective\n    attributes:\n      label: Objective\n      description: Briefly describe the task\n      placeholder: Add unit tests for `print_a` cheatcode.\n    validations:\n      required: true\n\n  - type: textarea\n    id: additional-context\n    attributes:\n      label: Additional Context\n      description: Provide additional context on the task\n      placeholder: Make sure to include case where `print_a` cheatcode is called with an empty string.\n    validations:\n      required: false\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "content": "blank_issues_enabled: false\ncontact_links:\n  - name: Telegram Support Channel\n    url: https://t.me/starknet_foundry_support\n    about: This issue tracker is only for bugs and feature requests. Support is available through Telegram channel.\n"
  },
  {
    "path": ".github/actions/setup-tools/action.yml",
    "content": "name: Setup Tools\ndescription: Installs Rust and optionally Scarb, Universal Sierra Compiler and LLVM 19 toolchain\n\ninputs:\n  install-llvm:\n    description: 'Whether to install the LLVM 19 toolchain'\n    required: false\n    default: 'false'\n  setup-scarb:\n    description: 'Whether to setup scarb'\n    required: false\n    default: 'true'\n  scarb-version:\n    description: 'Optional: Scarb version to install. If not set, uses version from .tool-versions'\n    required: false\n    default: ''\n  setup-usc:\n    description: 'Whether to setup universal-sierra-compiler'\n    required: false\n    default: 'true'\n\nruns:\n  using: \"composite\"\n  steps:\n    - uses: dtolnay/rust-toolchain@stable\n\n    - uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6\n\n    - uses: software-mansion/setup-scarb@v1\n      if: ${{ inputs.setup-scarb == 'true' }}\n      with:\n        scarb-version: ${{ inputs.scarb-version }}\n\n    - uses: software-mansion/setup-universal-sierra-compiler@v1\n      if: ${{ inputs.setup-usc == 'true' }}\n\n    - name: Add LLVM APT repository\n      uses: myci-actions/add-deb-repo@11\n      if: ${{ inputs.install-llvm == 'true' }}\n      with:\n        repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main\n        repo-name: llvm-repo\n        keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key\n\n    - name: Install LLVM\n      shell: bash\n      if: ${{ inputs.install-llvm == 'true' }}\n      run: |\n        sudo apt-get update\n        sudo apt-get install -y \\\n          llvm-19 llvm-19-dev llvm-19-runtime \\\n          clang-19 clang-tools-19 \\\n          lld-19 libpolly-19-dev libmlir-19-dev mlir-19-tools\n\n    - name: Set environment variables\n      if: ${{ inputs.install-llvm == 'true' }}\n      shell: bash\n      run: |\n        echo \"MLIR_SYS_190_PREFIX=/usr/lib/llvm-19/\" >> $GITHUB_ENV\n        echo \"LLVM_SYS_191_PREFIX=/usr/lib/llvm-19/\" >> $GITHUB_ENV\n        echo \"TABLEGEN_190_PREFIX=/usr/lib/llvm-19/\" >> $GITHUB_ENV\n"
  },
  {
    "path": ".github/dependabot.yml",
    "content": "# To get started with Dependabot version updates, you'll need to specify which\n# package ecosystems to update and where the package manifests are located.\n# Please see the documentation for all configuration options:\n# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates\n\nversion: 2\nupdates:\n  - package-ecosystem: \"cargo\"\n    directory: \"/\"\n    schedule:\n      interval: \"monthly\"\n    ignore:\n      - dependency-name: \"cairo-*\"\n    groups:\n      all-dependencies:\n        patterns:\n          - \"*\"\n\n\n  - package-ecosystem: \"github-actions\"\n    directory: \"/\"\n    schedule:\n      interval: \"monthly\"\n    groups:\n      actions:\n        patterns:\n          - \"*\"\n"
  },
  {
    "path": ".github/pull_request_template.md",
    "content": "<!-- Reference any GitHub issues resolved by this PR -->\n\nCloses #\n\n## Introduced changes\n\n<!-- A brief description of the changes -->\n\n-\n\n## Checklist\n\n<!-- Make sure all of these are complete -->\n\n- [ ] Linked relevant issue\n- [ ] Updated relevant documentation\n- [ ] Added relevant tests\n- [ ] Performed self-review of the code\n- [ ] Added changes to `CHANGELOG.md`\n"
  },
  {
    "path": ".github/workflows/_build-binaries-native.yml",
    "content": "# NOTE: This is a draft created for the future if we continue integration with the native.\n# TODO(#3790) this is currently unused, integrate into nightly release flow\nname: Build Native binaries\n\non:\n  workflow_call:\n    inputs:\n      # Specify the version in MAJOR.MINOR.PATCH format, without a leading 'v'\n      version:\n        required: true\n        type: string\n      ref:\n        required: false\n        type: string\n\njobs:\n  build-binaries:\n    name: Build ${{ matrix.target }}\n    runs-on: ${{ matrix.os }}\n\n    env:\n      # Cross-compiled targets will override this to `cross`.\n      CARGO: cargo\n\n    strategy:\n      matrix:\n        # Currently we have only managed to build successfuly on x86 gnu Linux\n        # - On MacOS, LLVM is installed with brew and the built binary requires having LLVM installed through it,\n        #   even though it is supossed to be bundled.\n        # - MUSL Linux was not investigated\n        # - Aarch64 Linux requires LLVM to be build for Aarch64, but proc macros run against host OS, which is x86_64\n        #   when building through cross. With current setup, we install LLVM for only one of these arches.\n        #   We need to investigate cross compiling LLVM for multiple architectures.\n        include:\n          - target: x86_64-unknown-linux-gnu\n            os: ubuntu-latest\n            system: linux\n\n#          - target: x86_64-unknown-linux-musl\n#            os: ubuntu-latest\n#            system: linux\n#\n#          - target: aarch64-unknown-linux-gnu\n#            os: ubuntu-latest\n#            system: linux\n#\n#          - target: aarch64-unknown-linux-musl\n#            os: ubuntu-latest\n#            system: linux\n#\n#          - target: x86_64-apple-darwin\n#            os: macos-14-large\n#            system: macos\n#\n#          - target: aarch64-apple-darwin\n#            os: macos-latest\n#            system: macos\n\n    steps:\n      - name: Checkout with ref\n        if: inputs.ref != ''\n        uses: actions/checkout@v6\n        with:\n          ref: ${{ inputs.ref }}\n\n      - name: Checkout default\n        if: inputs.ref == ''\n        uses: actions/checkout@v6\n\n      - name: Setup rust\n        run: |\n          rustup target add ${{ matrix.target }}\n\n      - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5\n\n      - name: Setup LLVM on MacOS\n        if: matrix.system == 'macos'\n        run: |\n          brew install llvm@19\n          brew reinstall zstd\n          echo \"MLIR_SYS_190_PREFIX=$(brew --prefix llvm@19)\" >> $GITHUB_ENV\n          echo \"LLVM_SYS_191_PREFIX=$(brew --prefix llvm@19)\" >> $GITHUB_ENV\n          echo \"TABLEGEN_190_PREFIX=$(brew --prefix llvm@19)\" >> $GITHUB_ENV\n          echo \"LIBRARY_PATH=/opt/homebrew/lib\" >> $GITHUB_ENV\n\n      - name: Install cross\n        if: matrix.system == 'linux'\n        run: |\n          cargo install cross --git https://github.com/cross-rs/cross\n\n      - name: Build MacOS\n        if: matrix.system == 'macos'\n        run: |\n          export MLIR_SYS_190_PREFIX=${{ env.MLIR_SYS_190_PREFIX }}\n          export LLVM_SYS_191_PREFIX=${{ env.LLVM_SYS_191_PREFIX }}\n          export TABLEGEN_190_PREFIX=${{ env.TABLEGEN_190_PREFIX }}\n          export LIBRARY_PATH=${{ env.LIBRARY_PATH }}\n          cargo build --release --locked --target ${{ matrix.target }}\n\n      - name: Build Linux\n        if: matrix.system == 'linux'\n        run: |\n          # Use cross to link oldest GLIBC possible.\n          cross build --release --locked --target ${{ matrix.target }}\n\n      - name: Package\n        shell: bash\n        run: |\n          set -euxo pipefail\n          PKG_FULL_NAME=\"starknet-foundry-v${{ inputs.version }}-${{ matrix.target }}\"\n          echo \"PKG_FULL_NAME=$PKG_FULL_NAME\" >> $GITHUB_ENV\n\n          ./scripts/package.sh \"${{ matrix.target }}\" \"$PKG_FULL_NAME\"\n\n      - name: Upload artifact\n        uses: actions/upload-artifact@v5\n        with:\n          # TODO(#3790): Perhaps this name needs to be changed to avoid conflicts with `_build-binaries.yml` workflow\n          name: build-${{ matrix.target }}\n          path: ${{ env.PKG_FULL_NAME }}.*\n"
  },
  {
    "path": ".github/workflows/_build-binaries.yml",
    "content": "name: Build binaries\n\non:\n  workflow_call:\n    inputs:\n      # Specify the version in MAJOR.MINOR.PATCH format, without a leading 'v'\n      version:\n        required: true\n        type: string\n      ref:\n        required: false\n        type: string\n\njobs:\n  build-binaries:\n    name: Build ${{ matrix.target }}\n    runs-on: ${{ matrix.os }}\n\n    env:\n      # Cross-compiled targets will override this to `cross`.\n      CARGO: cargo\n\n    strategy:\n      matrix:\n        include:\n          - target: x86_64-unknown-linux-gnu\n            os: ubuntu-latest\n            # Use cross to link oldest GLIBC possible.\n            cross: true\n\n          - target: x86_64-unknown-linux-musl\n            os: ubuntu-latest\n            cross: true\n\n          - target: aarch64-unknown-linux-gnu\n            os: ubuntu-latest\n            cross: true\n\n          - target: aarch64-unknown-linux-musl\n            os: ubuntu-latest\n            cross: true\n\n          - target: x86_64-apple-darwin\n            os: macos-latest\n\n          - target: aarch64-apple-darwin\n            os: macos-latest\n\n    steps:\n      - name: Checkout with ref\n        if: inputs.ref != ''\n        uses: actions/checkout@v6\n        with:\n          ref: ${{ inputs.ref }}\n\n      - name: Checkout default\n        if: inputs.ref == ''\n        uses: actions/checkout@v6\n\n      - name: Setup rust\n        run: |\n          rustup target add ${{ matrix.target }}\n\n      - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5\n        with:\n          workspaces: starknet-foundry\n\n      - name: Install cross\n        if: matrix.cross\n        uses: taiki-e/install-action@cross\n\n      - name: Enable cross-compilation\n        if: matrix.cross\n        shell: bash\n        run: |\n          echo \"CARGO=cross\" >> $GITHUB_ENV\n\n      - name: Build\n        run: ${{ env.CARGO }} build --release --locked --bins --target ${{ matrix.target }}\n\n      - name: Package\n        shell: bash\n        run: |\n          set -euxo pipefail\n          PKG_FULL_NAME=\"starknet-foundry-v${{ inputs.version }}-${{ matrix.target }}\"\n          echo \"PKG_FULL_NAME=$PKG_FULL_NAME\" >> $GITHUB_ENV\n\n          ./scripts/package.sh \"${{ matrix.target }}\" \"$PKG_FULL_NAME\"\n\n      - name: Upload artifact\n        uses: actions/upload-artifact@v5\n        with:\n          name: build-${{ matrix.target }}\n          path: ${{ env.PKG_FULL_NAME }}.*\n          overwrite: true\n"
  },
  {
    "path": ".github/workflows/_build-plugin-binaries.yml",
    "content": "name: Build snforge_scarb_plugin\n\non:\n  workflow_call:\n    inputs:\n      # Specify the version in MAJOR.MINOR.PATCH format, without a leading 'v'\n      overridden_plugin_version:\n        required: false\n        type: string\n      ref:\n        required: false\n        type: string\n      plugin_name:\n        required: true\n        type: string\n  workflow_dispatch:\n    inputs:\n      # Specify the version in MAJOR.MINOR.PATCH format, without a leading 'v'\n      overridden_plugin_version:\n        required: false\n        type: string\n      plugin_name:\n        required: true\n        type: string\n\njobs:\n  build-binaries:\n    name: Build ${{ matrix.target }}\n    runs-on: ${{ matrix.os }}\n    env:\n      # Cross-compiled targets will override this to `cross`.\n      CARGO: cargo\n\n    strategy:\n      matrix:\n        include:\n          - target: x86_64-unknown-linux-gnu\n            os: ubuntu-latest\n            # Use cross to link oldest GLIBC possible.\n            cross: true\n            lib-name-prefix: \"lib\"\n            ext: \"so\"\n\n          - target: aarch64-unknown-linux-gnu\n            os: ubuntu-latest\n            cross: true\n            lib-name-prefix: \"lib\"\n            ext: \"so\"\n\n          - target: x86_64-apple-darwin\n            os: macos-latest\n            lib-name-prefix: \"lib\"\n            ext: \"dylib\"\n\n          - target: aarch64-apple-darwin\n            os: macos-latest\n            lib-name-prefix: \"lib\"\n            ext: \"dylib\"\n\n          # The scarb builds for following platforms are experimental and not officially supported by starknet-foundry.\n          # https://docs.swmansion.com/scarb/download.html#platform-support\n          # Reference issue: TODO(#2886)\n\n          # - target: aarch64-unknown-linux-musl\n          #   os: ubuntu-latest\n          #   cross: true\n          #   ext: \"so\"\n\n          # - target: x86_64-unknown-linux-musl\n          #   os: ubuntu-latest\n          #   cross: true\n          #   ext: \"so\"\n\n    steps:\n      - name: Checkout with ref\n        if: inputs.ref != ''\n        uses: actions/checkout@v6\n        with:\n          ref: ${{ inputs.ref }}\n\n      - name: Checkout default\n        if: inputs.ref == ''\n        uses: actions/checkout@v6\n\n      - name: Setup rust\n        run: |\n          rustup target add ${{ matrix.target }}\n\n      - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5\n\n      - name: Install cross\n        if: matrix.cross\n        uses: taiki-e/install-action@cross\n\n      - name: Enable cross-compilation\n        if: matrix.cross\n        shell: bash\n        run: |\n          echo \"CARGO=cross\" >> $GITHUB_ENV\n\n      - name: Build\n        working-directory: crates/${{ inputs.plugin_name }}\n        run: ${{ env.CARGO }} build --release --locked --target ${{ matrix.target }}\n\n      - name: Rename Binary\n        shell: bash\n        run: |\n          set -euxo pipefail\n          \n          source scripts/handle_version.sh\n          \n          PACKAGE_NAME=${{ inputs.plugin_name }}\n          PACKAGE_NAME=${PACKAGE_NAME//-/_}  # Replace `-` with `_` in name\n          PACKAGE_VERSION=$(get_version \"${{ inputs.overridden_plugin_version }}\" \"crates/${{ inputs.plugin_name }}/Scarb.toml\")\n\n          TARGET=\"${{ matrix.target }}\"\n          EXT=\"${{ matrix.ext }}\"\n          LIB_NAME=\"${{ matrix.lib-name-prefix }}${PACKAGE_NAME}\"\n\n          OUTPUT_BINARY=\"${PACKAGE_NAME}_v${PACKAGE_VERSION}_${TARGET}.${EXT}\"\n\n          mv ./crates/${{ inputs.plugin_name }}/target/${TARGET}/release/${LIB_NAME}.${EXT} ./crates/${{ inputs.plugin_name }}/target/${TARGET}/release/${OUTPUT_BINARY}\n\n          echo \"OUTPUT_BINARY_PATH=./crates/${{ inputs.plugin_name }}/target/${TARGET}/release/${OUTPUT_BINARY}\" >> $GITHUB_ENV\n\n      - name: Upload Artifact\n        uses: actions/upload-artifact@v5\n        with:\n          name: build-${{ inputs.plugin_name }}-${{ matrix.target }}\n          path: ${{ env.OUTPUT_BINARY_PATH }}\n          compression-level: 0\n          overwrite: true\n"
  },
  {
    "path": ".github/workflows/_publish-plugin.yml",
    "content": "name: Upload plugin to registry\n\non:\n  workflow_call:\n    inputs:\n      prod_registry:\n        required: false\n        type: boolean\n      # Specify the version in MAJOR.MINOR.PATCH format, without a leading 'v'\n      overridden_plugin_version:\n        required: false\n        type: string\n      plugin_name:\n        required: true\n        type: string\n\njobs:\n  check-uploaded:\n    name: Check ${{ inputs.plugin_name }} Version\n    runs-on: ubuntu-latest\n    outputs:\n      plugin_uploaded: ${{ steps.check-uploaded.outputs.plugin_uploaded }}\n    steps:\n      - uses: actions/checkout@v6\n      - name: Check version\n        id: check-uploaded\n        run: |\n          set -exo pipefail\n        \n          source scripts/handle_version.sh\n          \n          plugin_name_underscores=${{ inputs.plugin_name }}\n          plugin_name_underscores=${plugin_name_underscores//-/_}\n          plugin_version=$(get_version \"${{ inputs.overridden_plugin_version }}\" \"crates/${{ inputs.plugin_name }}/Scarb.toml\")\n          \n          registry_url=${{ inputs.prod_registry == true && 'https://scarbs.xyz' || 'https://scarbs.dev' }}\n          plugin_uploaded=$(curl -s ${registry_url}/api/v1/index/sn/fo/${plugin_name_underscores}.json | jq --arg version \"$plugin_version\" '[.[] | select(.v == $version)] | length > 0')\n          echo \"plugin_uploaded=$plugin_uploaded\" >> $GITHUB_OUTPUT\n\n  upload-to-registry:\n    name: Upload ${{ inputs.plugin_name }} to the registry\n    runs-on: ubuntu-latest\n    needs: [check-uploaded]\n    env:\n      SCARB_REGISTRY_AUTH_TOKEN: ${{ inputs.prod_registry == true && secrets.SCARB_REGISTRY_AUTH_TOKEN || secrets.DEV_SCARB_REGISTRY_AUTH_TOKEN }}\n    steps:\n      - uses: actions/checkout@v6\n      - uses: dtolnay/rust-toolchain@stable\n      - uses: software-mansion/setup-scarb@v1\n\n      - name: Download artifacts\n        uses: actions/download-artifact@v6\n        with:\n          path: artifacts-dl\n\n      - name: Unpack artifacts to target directory\n        run: |\n          set -euxo pipefail\n          \n          plugin_name_underscores=${{ inputs.plugin_name }}\n          plugin_name_underscores=${plugin_name_underscores//-/_}\n          \n          mkdir -p crates/${{ inputs.plugin_name }}/target/scarb/cairo-plugin\n          mv artifacts-dl/build-*/${plugin_name_underscores}_v* crates/${{ inputs.plugin_name }}/target/scarb/cairo-plugin/\n          \n          # Required for testing prebuild plugin while creating release.\n          if [[ -n \"${{ inputs.overridden_plugin_version }}\" ]]; then\n            cd crates/${{ inputs.plugin_name }}/target/scarb/cairo-plugin/\n            overridden_version=\"${{ inputs.overridden_plugin_version }}\"\n\n            for file in ${plugin_name_underscores}_v*; do\n              if [[ -f \"$file\" && ! \"$file\" =~ \"${plugin_name_underscores}_v${overridden_version}\" ]]; then\n                platform=$(echo \"$file\" | sed -E \"s/${plugin_name_underscores}_v[0-9]+\\.[0-9]+\\.[0-9]+(-rc.[0-9]+)?_(.+)/\\2/\")\n                new_file=\"${plugin_name_underscores}_v${overridden_version}_${platform}\"\n                mv \"$file\" \"$new_file\"\n              fi\n            done\n          fi\n\n      - name: Publish ${{ inputs.plugin_name }}\n        if: needs.check-uploaded.outputs.plugin_uploaded == 'false'\n        working-directory: crates/${{ inputs.plugin_name }}\n        run: |\n          set -exo pipefail\n          source ../../scripts/handle_version.sh\n          \n          update_version_in_file \"Scarb.toml\" \"${{ inputs.overridden_plugin_version }}\"\n          update_version_in_file \"Cargo.toml\" \"${{ inputs.overridden_plugin_version }}\"\n\n          scarb publish --allow-dirty ${{ inputs.prod_registry == true && ' ' || '--index https://scarbs.dev/' }} \n"
  },
  {
    "path": ".github/workflows/_test-binaries.yml",
    "content": "name: Test binaries\n\non:\n  workflow_call:\n    inputs:\n      # Specify the version in MAJOR.MINOR.PATCH format, without a leading 'v'\n      bin_version:\n        required: true\n        type: string\n      # Specify the version in MAJOR.MINOR.PATCH format, without a leading 'v'\n      std_version:\n        required: true\n        type: string\n\njobs:\n  test-binary:\n    name: Test binary\n    runs-on: ${{ matrix.os }}\n\n    strategy:\n      fail-fast: true\n      matrix:\n        include:\n          - target: x86_64-unknown-linux-gnu\n            os: ubuntu-latest\n\n          - target: aarch64-apple-darwin\n            os: macos-latest\n\n          - target: x86_64-apple-darwin\n            # Target macos-latest uses Mac with ARM, macos-14-large is still on Intel\n            os: macos-14-large\n\n    steps:\n      - uses: actions/checkout@v6\n      - uses: software-mansion/setup-scarb@v1\n\n      - name: Setup rust\n        run: |\n          rustup target add ${{ matrix.target }}\n\n      - name: Download artifacts\n        uses: actions/download-artifact@v6\n        with:\n          path: artifacts-dl\n\n      - name: Move artifacts to staging directory\n        shell: bash\n        run: |\n          mkdir -p artifacts\n          mv artifacts-dl/build-*/starknet-foundry-v* artifacts/\n\n      - name: Get artifacts path\n        shell: bash\n        run: |\n          ARTIFACTS_PATH=\"artifacts/starknet-foundry-v${{ inputs.bin_version }}-${{ matrix.target }}.tar.gz\"\n          \n          echo \"ARTIFACTS_PATH=$ARTIFACTS_PATH\" >> $GITHUB_ENV\n\n      - name: Unpack artifact\n        shell: bash\n        run: |\n          tar xzvf ${{ env.ARTIFACTS_PATH }}\n\n      - name: Install universal-sierra-compiler\n        uses: software-mansion/setup-universal-sierra-compiler@v1\n\n      - name: Smoke test\n        shell: bash\n        env:\n          RPC_URL: ${{ secrets.NODE_URL }}\n        run: |\n          ARTIFACTS_PATH=\"${{ env.ARTIFACTS_PATH }}\"\n          ARTIFACTS_PATH=\"${ARTIFACTS_PATH%.tar.gz}\"\n          ARTIFACTS_PATH=\"${ARTIFACTS_PATH%.zip}\"\n          ARTIFACTS_PATH=\"${ARTIFACTS_PATH#artifacts/}\"\n          \n          SNFORGE_PATH=$(readlink -f $ARTIFACTS_PATH/bin/snforge)\n          SNCAST_PATH=$(readlink -f $ARTIFACTS_PATH/bin/sncast)\n          \n          REPO_URL=${{ github.repositoryUrl }}\n          REVISION=${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}\n          VERSION=${{ inputs.std_version }}\n          \n          ./scripts/smoke_test.sh \"$RPC_URL\" \"$SNFORGE_PATH\" \"$SNCAST_PATH\" \"$REPO_URL\" \"$REVISION\" \"$VERSION\"\n          \n"
  },
  {
    "path": ".github/workflows/automate-stale.yml",
    "content": "name: 'Automation - Stale issues and PRs'\n\non:\n  schedule:\n    - cron: '0 7 * * 1-5'\n\nenv:\n  DAYS_BEFORE_STALE: 30\n  DAYS_BEFORE_CLOSE: 14\n\njobs:\n  stale:\n    runs-on: ubuntu-latest\n    permissions:\n      pull-requests: write\n    steps:\n      - name: Run Stale Bot\n        id: stale\n        uses: actions/stale@v10\n        with:\n          # General settings\n          days-before-stale: ${{ env.DAYS_BEFORE_STALE }}\n          days-before-close: ${{ env.DAYS_BEFORE_CLOSE }}\n          operations-per-run: 3000\n          enable-statistics: true # This is only useful if secret ACTIONS_STEP_DEBUG=true\n          remove-stale-when-updated: true\n\n          # PR settings\n          stale-pr-label: stale\n          stale-pr-message: |\n            Hi! This pull request hasn't had any activity for a while, so I am\n            marking it as stale. It will close in ${{ env.DAYS_BEFORE_CLOSE }}\n            days if it is not updated. Thanks for contributing!\n          close-pr-message: |\n            This pull request has been automatically closed due to inactivity.  \n            Feel free to reopen it or create a new one if needed.\n            Thanks for contributing!\n            \n"
  },
  {
    "path": ".github/workflows/ci.yml",
    "content": "name: CI\n\non:\n  pull_request:\n  merge_group:\n  push:\n    branches:\n      - master\n  workflow_dispatch:\n\nconcurrency:\n  group: ${{ github.head_ref || github.run_id }}\n  cancel-in-progress: true\n\njobs:\n  get-scarb-versions:\n    if: github.event_name == 'merge_group'\n    name: Get Scarb versions\n    runs-on: ubuntu-latest\n    outputs:\n      versions: ${{ steps.get_versions.outputs.versions }}\n    steps:\n      - uses: actions/checkout@v6\n      - uses: asdf-vm/actions/setup@b7bcd026f18772e44fe1026d729e1611cc435d47\n      - run: |\n          asdf plugin add scarb\n          asdf install scarb latest\n          asdf set --home scarb latest\n\n      - name: Get versions\n        id: get_versions\n        run: |\n          scarb_versions=$(./scripts/get_scarb_versions.sh --previous)\n          echo ${scarb_versions[@]}\n          echo \"versions=[${scarb_versions[@]}]\" >> \"$GITHUB_OUTPUT\"\n\n  test-workspace:\n    # Runs tests from all crates across the workspace, except:\n    # - `sncast` tests\n    # - `forge` integration and e2e tests\n    # `native-api` is also excluded as there are no tests and it requires extra setup to compile.\n    name: Workspace Tests\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v6\n      - uses: ./.github/actions/setup-tools\n      - run: cargo test --profile ci --workspace --exclude sncast --exclude forge --exclude native-api\n      - run: cargo test --profile ci --lib -p forge\n\n  build-test-forge-nextest-archive:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v6\n      - uses: ./.github/actions/setup-tools\n        with:\n          setup-scarb: 'false'\n          setup-usc: 'false'\n      - name: Install nextest\n        uses: taiki-e/install-action@v2\n        with:\n          tool: nextest@0.9.98\n      - name: Determine test features\n        id: test_features\n        run: |\n          FEATURES=\"run_test_for_scarb_since_2_15_1\"\n          echo \"features=$FEATURES\" >> \"$GITHUB_OUTPUT\"\n      - name: Build and archive tests\n        run: |\n          if [ -n \"${{ steps.test_features.outputs.features }}\" ]; then\n            cargo nextest archive --cargo-profile ci -p forge --features \"${{ steps.test_features.outputs.features }}\" --archive-file 'nextest-archive-${{ runner.os }}.tar.zst'\n          else\n            cargo nextest archive --cargo-profile ci -p forge --archive-file 'nextest-archive-${{ runner.os }}.tar.zst'\n          fi\n      - name: Upload archive to workflow\n        uses: actions/upload-artifact@v5\n        with:\n          name: nextest-archive-${{ runner.os }}\n          path: nextest-archive-${{ runner.os }}.tar.zst\n\n  build-test-forge-nextest-archive-native:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v6\n      - uses: ./.github/actions/setup-tools\n        with:\n          install-llvm: 'true'\n          setup-scarb: 'false'\n          setup-usc: 'false'\n      - name: Install nextest\n        uses: taiki-e/install-action@v2\n        with:\n          tool: nextest@0.9.98\n      - name: Determine test features\n        id: test_features\n        run: |\n          FEATURES=\"cairo-native,run_test_for_scarb_since_2_15_1\"\n          echo \"features=$FEATURES\" >> \"$GITHUB_OUTPUT\"\n      - name: Build and archive tests\n        run: cargo nextest archive --cargo-profile ci -p forge --features \"${{ steps.test_features.outputs.features }}\" --archive-file 'nextest-archive-${{ runner.os }}-native.tar.zst'\n      - name: Upload archive to workflow\n        uses: actions/upload-artifact@v5\n        with:\n          name: nextest-archive-${{ runner.os }}-native\n          path: nextest-archive-${{ runner.os }}-native.tar.zst\n\n  test-forge-integration:\n    name: Test Forge / Integration Tests\n    runs-on: [ ubuntu-latest ]\n    needs: [ build-test-forge-nextest-archive ]\n    strategy:\n      fail-fast: false\n      matrix:\n        partition: [ 1, 2, 3 ]\n    steps:\n      - uses: actions/checkout@v6\n      - uses: ./.github/actions/setup-tools\n      - uses: taiki-e/install-action@v2\n        with:\n          tool: nextest@0.9.98\n      - uses: actions/download-artifact@v6\n        with:\n          name: nextest-archive-${{ runner.os }}\n      - name: nextest partition ${{ matrix.partition }}/3\n        run: cargo nextest run --no-fail-fast --partition 'count:${{ matrix.partition }}/3' --archive-file 'nextest-archive-${{ runner.os }}.tar.zst' integration\n\n  test-forge-integration-native:\n    name: Test Forge / Integration Tests (native)\n    runs-on: [ ubuntu-latest ]\n    needs: [ build-test-forge-nextest-archive-native ]\n    strategy:\n      fail-fast: false\n      matrix:\n        partition: [ 1, 2, 3 ]\n    steps:\n      - uses: actions/checkout@v6\n      - uses: ./.github/actions/setup-tools\n      - uses: taiki-e/install-action@v2\n        with:\n          tool: nextest@0.9.98\n      - uses: actions/download-artifact@v6\n        with:\n          name: nextest-archive-${{ runner.os }}-native\n      - name: nextest partition ${{ matrix.partition }}/3\n        run: cargo nextest run --no-fail-fast --partition 'count:${{ matrix.partition }}/3' --archive-file 'nextest-archive-${{ runner.os }}-native.tar.zst' integration\n\n  test-forge-e2e:\n    name: Test Forge / E2E Tests\n    runs-on: ubuntu-latest\n    needs: [ build-test-forge-nextest-archive ]\n    strategy:\n      fail-fast: false\n      matrix:\n        partition: [ 1, 2, 3 ]\n    steps:\n      - name: Extract branch name\n        if: github.event_name != 'pull_request'\n        run: echo \"BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})\" >> $GITHUB_ENV\n        shell: bash\n\n      - name: Extract branch name on pull request\n        if: github.event_name == 'pull_request'\n        run: echo \"BRANCH_NAME=$(echo $GITHUB_HEAD_REF)\" >> $GITHUB_ENV\n        shell: bash\n\n      - name: Extract repo name and owner\n        if: github.event_name != 'pull_request'\n        run: echo \"REPO_NAME=$(echo ${{ github.repository }}.git)\" >> $GITHUB_ENV\n        shell: bash\n\n      - name: Extract repo name and owner on pull request\n        if: github.event_name == 'pull_request'\n        run: echo \"REPO_NAME=$(echo ${{ github.event.pull_request.head.repo.full_name }}.git)\" >> $GITHUB_ENV\n        shell: bash\n\n      - name: Install cairo-profiler\n        run: |\n          curl -L https://raw.githubusercontent.com/software-mansion/cairo-profiler/main/scripts/install.sh | sh\n      - name: Install cairo-coverage\n        run: |\n          curl -L https://raw.githubusercontent.com/software-mansion/cairo-coverage/main/scripts/install.sh | sh\n\n      - uses: actions/checkout@v6\n      - uses: asdf-vm/actions/install@b7bcd026f18772e44fe1026d729e1611cc435d47\n      - uses: ./.github/actions/setup-tools\n      - uses: taiki-e/install-action@v2\n        with:\n          tool: nextest@0.9.98\n      - uses: actions/download-artifact@v6\n        with:\n          name: nextest-archive-${{ runner.os }}\n      - name: nextest partition ${{ matrix.partition }}/3\n        run: cargo nextest run --no-fail-fast --partition 'count:${{ matrix.partition }}/3' --archive-file 'nextest-archive-${{ runner.os }}.tar.zst' e2e\n\n  test-forge-e2e-native:\n    name: Test Forge / E2E Tests (native)\n    runs-on: ubuntu-latest\n    needs: [ build-test-forge-nextest-archive-native ]\n    strategy:\n      fail-fast: false\n      matrix:\n        partition: [ 1, 2, 3 ]\n    steps:\n      - name: Extract branch name\n        if: github.event_name != 'pull_request'\n        run: echo \"BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})\" >> $GITHUB_ENV\n        shell: bash\n\n      - name: Extract branch name on pull request\n        if: github.event_name == 'pull_request'\n        run: echo \"BRANCH_NAME=$(echo $GITHUB_HEAD_REF)\" >> $GITHUB_ENV\n        shell: bash\n\n      - name: Extract repo name and owner\n        if: github.event_name != 'pull_request'\n        run: echo \"REPO_NAME=$(echo ${{ github.repository }}.git)\" >> $GITHUB_ENV\n        shell: bash\n\n      - name: Extract repo name and owner on pull request\n        if: github.event_name == 'pull_request'\n        run: echo \"REPO_NAME=$(echo ${{ github.event.pull_request.head.repo.full_name }}.git)\" >> $GITHUB_ENV\n        shell: bash\n\n      - name: Install cairo-profiler\n        run: |\n          curl -L https://raw.githubusercontent.com/software-mansion/cairo-profiler/main/scripts/install.sh | sh\n      - name: Install cairo-coverage\n        run: |\n          curl -L https://raw.githubusercontent.com/software-mansion/cairo-coverage/main/scripts/install.sh | sh\n\n      - uses: actions/checkout@v6\n      - uses: asdf-vm/actions/install@b7bcd026f18772e44fe1026d729e1611cc435d47\n      - uses: ./.github/actions/setup-tools\n      - uses: taiki-e/install-action@v2\n        with:\n          tool: nextest@0.9.98\n      - uses: actions/download-artifact@v6\n        with:\n          name: nextest-archive-${{ runner.os }}-native\n      - name: nextest partition ${{ matrix.partition }}/3\n        run: cargo nextest run --no-fail-fast --partition 'count:${{ matrix.partition }}/3' --archive-file 'nextest-archive-${{ runner.os }}-native.tar.zst' e2e\n\n  test-forge-e2e-snap:\n    if: github.event_name == 'merge_group'\n    name: Test Forge / E2E Snap (Scarb ${{ matrix.version }})\n    runs-on: ubuntu-latest\n    needs: get-scarb-versions\n    strategy:\n      fail-fast: false\n      matrix:\n        version: ${{ fromJSON(needs.get-scarb-versions.outputs.versions) }}\n\n    steps:\n      - name: Extract branch name\n        if: github.event_name != 'pull_request'\n        run: echo \"BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})\" >> $GITHUB_ENV\n        shell: bash\n\n      - name: Extract branch name on pull request\n        if: github.event_name == 'pull_request'\n        run: echo \"BRANCH_NAME=$(echo $GITHUB_HEAD_REF)\" >> $GITHUB_ENV\n        shell: bash\n\n      - name: Extract repo name and owner\n        if: github.event_name != 'pull_request'\n        run: echo \"REPO_NAME=$(echo ${{ github.repository }}.git)\" >> $GITHUB_ENV\n        shell: bash\n\n      - name: Extract repo name and owner on pull request\n        if: github.event_name == 'pull_request'\n        run: echo \"REPO_NAME=$(echo ${{ github.event.pull_request.head.repo.full_name }}.git)\" >> $GITHUB_ENV\n        shell: bash\n\n      - name: Install cairo-profiler\n        run: |\n          curl -L https://raw.githubusercontent.com/software-mansion/cairo-profiler/main/scripts/install.sh | sh\n      - name: Install cairo-coverage\n        run: |\n          curl -L https://raw.githubusercontent.com/software-mansion/cairo-coverage/main/scripts/install.sh | sh\n\n      - uses: actions/checkout@v6\n      - uses: ./.github/actions/setup-tools\n        with:\n          scarb-version: ${{ matrix.version }}\n      - name: Run snap E2E tests\n        run: cargo test --profile ci -p forge --test main snap_\n\n  test-plugin-checks:\n    name: Test plugin across different scarb versions\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v6\n      - uses: ./.github/actions/setup-tools\n        # No setup scarb action is used because we want to install multiple versions of scarb through asdf\n        with:\n          setup-scarb: 'false'\n      - uses: asdf-vm/actions/install@b7bcd026f18772e44fe1026d729e1611cc435d47\n      - run: cargo test --profile ci --package forge --features test_for_multiple_scarb_versions e2e::plugin_diagnostic\n\n  test-requirements-check-special-conditions:\n    name: Test requirements check special conditions\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v6\n      - uses: ./.github/actions/setup-tools\n        with:\n          setup-scarb: 'false'\n\n      - run: cargo test --profile ci --package forge --features no_scarb_installed --lib compatibility_check::tests::failing_tool_not_installed\n\n      - uses: software-mansion/setup-scarb@v1\n        with:\n          scarb-version: \"2.12.0\"\n\n      - run: cargo test --profile ci --package forge --features scarb_2_12_0 --test main e2e::requirements::test_warning_on_scarb_version_below_recommended\n\n  test-forge-oracles:\n    name: Test Oracles in Forge\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v5\n      - uses: ./.github/actions/setup-tools\n        with:\n          scarb-version: '2.13.1'\n      - run: cargo test --profile ci -p forge --features run_test_for_scarb_since_2_13_1 e2e::oracles\n\n  test-forge-scarb-plugin:\n    name: Test Forge Scarb Plugin\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v6\n      - uses: ./.github/actions/setup-tools\n      - name: Run Forge Scarb Plugin tests\n        working-directory: crates/snforge-scarb-plugin\n        run: cargo test --profile ci\n\n  test-cast:\n    name: Test Cast\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v6\n      - uses: asdf-vm/actions/install@b7bcd026f18772e44fe1026d729e1611cc435d47\n      - uses: ./.github/actions/setup-tools\n      - name: Run tests\n        run: cargo test --profile ci -p sncast\n\n  test-ledger:\n    name: Test Ledger\n    runs-on: ubuntu-latest\n    container: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools\n\n    steps:\n      - uses: actions/checkout@v6\n      - uses: asdf-vm/actions/install@b7bcd026f18772e44fe1026d729e1611cc435d47\n      - uses: ./.github/actions/setup-tools\n      - name: Run tests\n        run: cargo test --profile ci -p sncast --features ledger-emulator ledger -- --ignored\n\n  fmt-lint-typos:\n    name: Lint and Format\n    runs-on: ubuntu-latest\n    env:\n      # Make sure CI fails on all warnings - including Clippy lints.\n      RUSTFLAGS: \"-Dwarnings\"\n    steps:\n      - uses: actions/checkout@v6\n      - uses: ./.github/actions/setup-tools\n        with:\n          install-llvm: 'true'\n          setup-usc: 'false'\n      - run: rustup component add rustfmt\n\n      - name: Check formatting\n        run: cargo fmt --check\n\n      - name: Check formatting snforge-scarb-plugin\n        run: cargo fmt --check\n        working-directory: crates/snforge-scarb-plugin\n\n      - name: Lint\n        run: cargo lint\n\n      - name: Lint snforge-scarb-plugin\n        run: cargo lint\n        working-directory: crates/snforge-scarb-plugin\n\n      - name: Check cairo files format\n        run: |\n          output=$(find . -type f -name \"Scarb.toml\" -execdir sh -c '\n              echo \"Running \\\"scarb fmt\\\" in directory: $PWD\"\n              scarb fmt --check\n          ' \\;)\n          echo \"$output\"\n          if grep -iq \"Diff\" <<< \"$output\"; then\n              exit 1\n          fi\n          exit 0\n\n      - name: Check typos\n        uses: crate-ci/typos@v1.40.0\n\n  build-docs:\n    name: Test Building Docs\n    runs-on: ubuntu-latest\n    env:\n      MDBOOK_VERSION: 0.4.52\n      # TODO(#3970): Use latest version after resolving issue\n      MDBOOK_VARIABLES_VERSION: 0.3.0\n    steps:\n      - uses: actions/checkout@v6\n      - uses: ./.github/actions/setup-tools\n      - name: Install mdBook\n        run: |\n          cargo install --version ${MDBOOK_VERSION} mdbook\n          cargo install --version ${MDBOOK_VARIABLES_VERSION} mdbook-variables\n      - name: Install mdBook Link-Check\n        run: |\n          cargo install mdbook-linkcheck\n      - name: Build with mdBook\n        run: |\n          # TODO(#2781): Use `mdbook build`\n          ./scripts/build_docs.sh\n      - name: Install Forge\n        env:\n          CARGO_INCREMENTAL: 0\n        run: |\n          cargo install --path crates/forge --locked --debug\n      - name: Verify Cairo listings\n        run: |\n          ./scripts/verify_cairo_listings.sh\n"
  },
  {
    "path": ".github/workflows/docs.yml",
    "content": "# Initial version from: https://github.com/actions/starter-workflows/blob/main/pages/mdbook.yml\n#\nname: Deploy mdBook site to Pages\n\non:\n  # Allows using this workflow in other workflows\n  workflow_call:\n\n  # Allows you to run this workflow manually from the Actions tab\n  workflow_dispatch:\n\n  release:\n    types:\n      - released\n\n# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages\npermissions:\n  contents: read\n  pages: write\n  id-token: write\n\n# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.\n# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.\nconcurrency:\n  group: \"pages\"\n  cancel-in-progress: false\n\njobs:\n  # Build job\n  build:\n    runs-on: ubuntu-latest\n    env:\n      MDBOOK_VERSION: 0.4.52\n      # TODO(#3970): Use latest version after resolving issue\n      MDBOOK_VARIABLES_VERSION: 0.3.0\n    steps:\n      - uses: actions/checkout@v6\n      - uses: dtolnay/rust-toolchain@0b1efabc08b657293548b77fb76cc02d26091c7e\n        with:\n          toolchain: stable\n      - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5\n      - uses: actions/setup-node@v6\n      - name: Install sitemap CLI\n        run: |\n          npm i -g static-sitemap-cli\n      - name: Install mdBook\n        run: |\n          cargo install --version ${MDBOOK_VERSION} mdbook\n          cargo install --version ${MDBOOK_VARIABLES_VERSION} mdbook-variables\n      - name: Install mdBook Link-Check\n        run: |\n          cargo install mdbook-linkcheck\n      - name: Install Scarb\n        uses: software-mansion/setup-scarb@v1\n        with:\n          scarb-version: latest\n      - name: Generate and build snforge_std docs\n        run: scarb doc --build\n        working-directory: ./snforge_std\n      - name: Generate and build sncast_std docs\n        run: scarb doc --build\n        working-directory: ./sncast_std\n      - name: Setup Pages\n        id: pages\n        uses: actions/configure-pages@v5\n      - name: Build with mdBook\n        run: mdbook build\n        working-directory: ./docs\n      - name: Add snforge_std docs\n        run: |\n          mkdir -p ./docs/book/html/snforge_std\n          cp -r ./snforge_std/target/doc/snforge_std/book/* ./docs/book/html/snforge_std/\n      - name: Add sncast_std docs\n        run: |\n          mkdir -p ./docs/book/html/sncast_std\n          cp -r ./sncast_std/target/doc/sncast_std/book/* ./docs/book/html/sncast_std/\n      - name: Generate sitemap\n        run: |\n          sscli --base https://foundry-rs.github.io/starknet-foundry\n        working-directory: ./docs/book/html\n      - name: Upload artifact\n        uses: actions/upload-pages-artifact@v4\n        with:\n          path: ./docs/book/html\n  # Deployment job\n  deploy:\n    environment:\n      name: github-pages\n      url: ${{ steps.deployment.outputs.page_url }}\n    runs-on: ubuntu-latest\n    needs: build\n    steps:\n      - name: Deploy to GitHub Pages\n        id: deployment\n        uses: actions/deploy-pages@v4\n"
  },
  {
    "path": ".github/workflows/nightly.yml",
    "content": "name: Nightly\n\non:\n  workflow_dispatch:\n    inputs:\n      dry_run:\n        description: \"Dry run\"\n        type: boolean\n        default: true\n  workflow_call:\n\n\nconcurrency:\n  group: ${{ github.workflow }}\n  cancel-in-progress: true\n\npermissions:\n  contents: write\n\njobs:\n  prepare:\n    runs-on: ubuntu-latest\n    outputs:\n      nightly_tag: ${{ steps.version.outputs.nightly_tag }}\n      nightly_version: ${{ steps.version.outputs.nightly_version }}\n      nightly_branch: ${{ steps.version.outputs.nightly_branch }}\n    steps:\n      - uses: actions/checkout@v6\n\n      - name: Configure Git for committing\n        run: |\n          git config user.name github-actions\n          git config user.email github-actions@github.com\n\n      - name: Determine nightly version\n        id: version\n        shell: bash\n        run: |\n          NIGHTLY_TAG=\"nightly-$(date -u +%Y-%m-%d)\"\n          NIGHTLY_BRANCH=\"nightly/tmp/$NIGHTLY_TAG\"\n\n          CURR_VERSION=$(grep '^version' Cargo.toml | cut -d '\"' -f2)\n          NIGHTLY_VERSION=\"${CURR_VERSION}+${NIGHTLY_TAG}\"\n\n          echo \"NIGHTLY_TAG=$NIGHTLY_TAG\" >> $GITHUB_ENV\n          echo \"NIGHTLY_VERSION=$NIGHTLY_VERSION\" >> $GITHUB_ENV\n          echo \"NIGHTLY_BRANCH=$NIGHTLY_BRANCH\" >> $GITHUB_ENV\n\n          echo \"nightly_tag=$NIGHTLY_TAG\" >> $GITHUB_OUTPUT\n          echo \"nightly_version=$NIGHTLY_VERSION\" >> $GITHUB_OUTPUT\n          echo \"nightly_branch=$NIGHTLY_BRANCH\" >> $GITHUB_OUTPUT\n\n      - uses: software-mansion/setup-scarb@v1\n\n      - name: Update metadata before release\n        run: ./scripts/release.sh ${{ env.NIGHTLY_VERSION }}\n\n      - name: Create release notes\n        run: |\n          repo=\"${{ github.repository }}\"\n          hash=\"${{ github.sha }}\"\n          echo \"Source commit: [\\`${hash:0:7}\\`](https://github.com/$repo/commit/$hash)\" > NIGHTLY_RELEASE_NOTES.md\n\n      - name: Commit patches\n        run: |\n          git checkout -b ${{ env.NIGHTLY_BRANCH }}\n          git add .\n          git commit -m ${{ env.NIGHTLY_TAG }}\n          echo $(git log -1)\n\n      # NOTE: This must be the last operation done in this job in order for cleanup job to work properly.\n      - name: Push patches to the repository\n        run: git push origin ${{ env.NIGHTLY_BRANCH }}\n\n  build-binaries:\n    needs: prepare\n    uses: ./.github/workflows/_build-binaries.yml\n    with:\n      version: ${{ needs.prepare.outputs.nightly_version }}\n      ref: ${{ needs.prepare.outputs.nightly_branch }}\n\n  build-plugin-binaries:\n    name: Build plugin binaries\n    needs: prepare\n    uses: ./.github/workflows/_build-plugin-binaries.yml\n    with:\n      overridden_plugin_version: ${{ needs.prepare.outputs.nightly_version }}\n      ref: ${{ needs.prepare.outputs.nightly_branch }}\n      plugin_name: \"snforge-scarb-plugin\"\n\n  publish-plugin:\n    needs: [ prepare, build-plugin-binaries ]\n    if: ${{ !(inputs.dry_run) }}\n    uses: ./.github/workflows/_publish-plugin.yml\n    secrets: inherit\n    with:\n      prod_registry: false\n      overridden_plugin_version: ${{ needs.prepare.outputs.nightly_version }}\n      plugin_name: \"snforge-scarb-plugin\"\n\n\n  publish-std:\n    needs: [ prepare, publish-plugin ]\n    if: ${{ !(inputs.dry_run) }}\n    uses: ./.github/workflows/publish-std.yml\n    secrets: inherit\n    with:\n      prod_registry: false\n      plugin_dep_version: ${{ needs.prepare.outputs.nightly_version }}\n      override_std_version: ${{ needs.prepare.outputs.nightly_version }}\n\n  test-binary:\n    name: Test binary\n    needs: [ prepare, build-binaries, build-plugin-binaries, publish-plugin, publish-std ]\n    uses: ./.github/workflows/_test-binaries.yml\n    secrets: inherit\n    with:\n      bin_version: ${{ needs.prepare.outputs.nightly_version }}\n      std_version: ${{ needs.prepare.outputs.nightly_version }}\n\n  create-release:\n    runs-on: ubuntu-latest\n    needs: [ prepare, build-binaries, test-binary ]\n    # Do not run on dry_run\n    if: ${{ !(inputs.dry_run) }}\n    env:\n      GH_TOKEN: ${{ secrets.SNFOUNDRY_NIGHTLIES_CONTENTS_WRITE }}\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          ref: ${{ needs.prepare.outputs.nightly_branch }}\n\n      - name: Create source code archives\n        run: |\n          git archive \"--prefix=starknet-foundry-${{ needs.prepare.outputs.nightly_tag }}/\" -o \"starknet-foundry-${{ needs.prepare.outputs.nightly_tag }}.zip\" HEAD\n          git archive \"--prefix=starknet-foundry-${{ needs.prepare.outputs.nightly_tag }}/\" -o \"starknet-foundry-${{ needs.prepare.outputs.nightly_tag }}.tar.gz\" HEAD\n\n      - name: Download artifacts\n        uses: actions/download-artifact@v6\n        with:\n          path: artifacts-dl\n\n      - name: Unpack artifacts to staging directory\n        run: |\n          mkdir -p artifacts\n          mv artifacts-dl/build-*/starknet-foundry-* artifacts/\n          ls -lh artifacts/\n\n      - name: Create GitHub release\n        run: |\n          gh release create \\\n            \"${{ needs.prepare.outputs.nightly_tag }}\" \\\n            --repo software-mansion-labs/starknet-foundry-nightlies \\\n            --latest \\\n            --title \"${{ needs.prepare.outputs.nightly_tag }}\" \\\n            --notes-file NIGHTLY_RELEASE_NOTES.md\n\n      - name: Upload built artifacts\n        run: |\n          for file in ./artifacts/*\n          do\n            # We remove the version tag from the filename so it can\n            # be easily accessed in asdf and installation scripts.\n            #\n            # For example:\n            # starknet-foundry-v0.44.0+nightly-2025-05-22-aarch64-apple-darwin.tar.gz\n            # becomes:\n            # starknet-foundry-nightly-2025-05-22-aarch64-apple-darwin.tar.gz\n\n            label=$(echo \"$file\" | sed -E \"s/v[^+]*\\+//\" | sed -E \"s|.*/||\")\n            cp \"$file\" \"$label\"\n            file=\"$label\"\n\n            gh release upload \\\n              \"${{ needs.prepare.outputs.nightly_tag }}\" \\\n              \"$file\" \\\n              --repo software-mansion-labs/starknet-foundry-nightlies\n          done\n\n      - name: Upload source code archives\n        run: |\n          for file in \\\n            \"starknet-foundry-${{ needs.prepare.outputs.nightly_tag }}.zip#Starknet Foundry source code (zip)\" \\\n            \"starknet-foundry-${{ needs.prepare.outputs.nightly_tag }}.tar.gz#Starknet Foundry source code (tar.gz)\"\n          do\n            gh release upload \\\n              \"${{ needs.prepare.outputs.nightly_tag }}\" \\\n              \"$file\" \\\n              --repo software-mansion-labs/starknet-foundry-nightlies\n          done\n\n  cleanup:\n    runs-on: ubuntu-latest\n    if: always() && needs.prepare.result == 'success'\n    needs: [ prepare, create-release ]\n    steps:\n      - uses: actions/checkout@v6\n      - name: Delete nightly branch\n        run: |\n          git push origin -d ${{ needs.prepare.outputs.nightly_branch }}\n"
  },
  {
    "path": ".github/workflows/publish-plugin.yml",
    "content": "name: Publish snforge_scarb_plugin\n\non:\n  workflow_dispatch:\n    inputs:\n      prod_registry:\n        required: false\n        type: boolean\n      # Specify the version in MAJOR.MINOR.PATCH format, without a leading 'v'\n      overridden_plugin_version:\n        required: false\n        type: string\n      plugin_name:\n        required: true\n        type: string\n\njobs:\n  build-binaries:\n    name: Build Plugin Binaries\n    uses: ./.github/workflows/_build-plugin-binaries.yml\n    with:\n      overridden_plugin_version: ${{ inputs.overridden_plugin_version != '' && inputs.overridden_plugin_version || '' }}\n      plugin_name: ${{ inputs.plugin_name }}\n  \n  publish-plugin:\n    name: Publish Plugin\n    needs: build-binaries\n    uses: ./.github/workflows/_publish-plugin.yml\n    with:\n      prod_registry: ${{ inputs.prod_registry }}\n      overridden_plugin_version: ${{ inputs.overridden_plugin_version != '' && inputs.overridden_plugin_version || '' }}\n      plugin_name: '${{ inputs.plugin_name }}'\n    secrets: inherit\n"
  },
  {
    "path": ".github/workflows/publish-std.yml",
    "content": "name: Publish snforge_std and sncast_std\n\non:\n  workflow_call:\n    inputs:\n      prod_registry:\n        required: false\n        type: boolean\n      # Specify the version in MAJOR.MINOR.PATCH format, without a leading 'v'\n      override_std_version:\n        required: false\n        type: string\n      # snforge_std in the repository has a plugin dependency specified as a relative path, which must be overridden each time before publishing.\n      # Specify the version in MAJOR.MINOR.PATCH format, without a leading 'v'\n      plugin_dep_version:\n        required: true\n        type: string\n  workflow_dispatch:\n    inputs:\n      prod_registry:\n        required: false\n        type: boolean\n      # Specify the version in MAJOR.MINOR.PATCH format, without a leading 'v'\n      override_std_version:\n        required: false\n        type: string\n      # snforge_std in the repository has a plugin dependency specified as a relative path, which must be overridden each time before publishing.\n      # Specify the version in MAJOR.MINOR.PATCH format, without a leading 'v'\n      plugin_dep_version:\n        required: true\n        type: string\n\njobs:\n  check-uploaded:\n    name: Check stds uploaded\n    runs-on: ubuntu-latest\n    outputs:\n      snforge_std_uploaded: ${{ steps.check-uploaded.outputs.snforge_std_uploaded }}\n      sncast_std_uploaded: ${{ steps.check-uploaded.outputs.sncast_std_uploaded }}\n    steps:\n      - uses: actions/checkout@v6\n      - name: Check version\n        id: check-uploaded\n        run: |\n          set -exo pipefail\n          \n          source scripts/handle_version.sh\n          \n          snforge_std_version=$(get_version \"${{ inputs.override_std_version }}\" \"snforge_std\")\n          sncast_std_version=$(get_version \"${{ inputs.override_std_version }}\" \"sncast_std\")\n          \n          registry_url=${{ inputs.prod_registry == true && 'https://scarbs.xyz' || 'https://scarbs.dev' }}\n          \n          snforge_std_uploaded=$(curl -s ${registry_url}/api/v1/index/sn/fo/snforge_std.json | jq --arg version \"$snforge_std_version\" '[.[] | select(.v == $version)] | length > 0')\n          sncast_std_uploaded=$(curl -s ${registry_url}/api/v1/index/sn/ca/sncast_std.json | jq --arg version \"$sncast_std_version\" '[.[] | select(.v == $version)] | length > 0')\n          \n          echo \"snforge_std_uploaded=$snforge_std_uploaded\" >> $GITHUB_OUTPUT\n          echo \"sncast_std_uploaded=$sncast_std_uploaded\" >> $GITHUB_OUTPUT\n  publish-to-registry:\n    name: Publish packages to the registry\n    runs-on: ubuntu-latest\n    needs: [ check-uploaded ]\n    env:\n      SCARB_REGISTRY_AUTH_TOKEN: ${{ inputs.prod_registry == true && secrets.SCARB_REGISTRY_AUTH_TOKEN || secrets.DEV_SCARB_REGISTRY_AUTH_TOKEN }}\n    steps:\n      - uses: actions/checkout@v6\n\n      - uses: dtolnay/rust-toolchain@0b1efabc08b657293548b77fb76cc02d26091c7e\n        with:\n          toolchain: stable\n\n      - uses: software-mansion/setup-scarb@v1\n\n      - name: Publish sncast_std\n        if: needs.check-uploaded.outputs.sncast_std_uploaded == 'false'\n        working-directory: sncast_std\n        run: |\n          source ../scripts/handle_version.sh\n          \n          update_version_in_file \"Scarb.toml\" \"${{ inputs.override_std_version }}\"\n          \n          scarb publish --allow-dirty ${{ inputs.prod_registry == true && ' ' || '--index https://scarbs.dev/' }}\n\n      - name: Publish snforge_std\n        if: needs.check-uploaded.outputs.snforge_std_uploaded == 'false'\n        working-directory: snforge_std\n        run: |\n          source ../scripts/handle_version.sh\n          \n          update_version_in_file \"Scarb.toml\" \"${{ inputs.override_std_version }}\"\n          \n          if ${{ inputs.prod_registry == true }}; then\n            scarb add snforge_scarb_plugin@${{ inputs.plugin_dep_version }}\n          else\n            sed -i.bak \"/snforge_scarb_plugin/ s/\\(snforge_scarb_plugin = \\).*/\\1{ version = \\\"=${{ inputs.plugin_dep_version }}\\\", registry = \\\"https:\\/\\/scarbs.dev\\/\\\" }/\" Scarb.toml\n            rm Scarb.toml.bak 2>/dev/null\n          fi\n          \n          scarb publish --allow-dirty ${{ inputs.prod_registry == true && ' ' || '--index https://scarbs.dev/' }}\n"
  },
  {
    "path": ".github/workflows/release.yml",
    "content": "name: Release\n\non:\n  push:\n    branches:\n      - 'master'\n    tags:\n      - v[0-9]+.*\n\npermissions:\n  contents: write\n\njobs:\n  verify-version:\n    name: Verify that version that triggered this workflow is greater than most recent  release\n    runs-on: ubuntu-latest\n    outputs:\n      # Steps `verifyBranchVersion` and `verifyTagVersion` are mutually exclusive, only one of them will run\n      versionIsValid: ${{ steps.verifyBranchVersion.outputs.versionIsValid }}${{ steps.verifyTagVersion.outputs.versionIsValid }}\n      version: ${{ steps.verifyBranchVersion.outputs.version }}${{ steps.verifyTagVersion.outputs.version }}\n    steps:\n      - uses: actions/checkout@v6\n\n      - uses: actions/setup-node@v6\n        with:\n          cache: 'npm'\n          cache-dependency-path: scripts/package-lock.json\n      - run: npm ci\n        working-directory: scripts\n\n      - name: Get version from Cargo.toml\n        id: lookupVersion\n        uses: mikefarah/yq@7ccaf8e700ce99eb3f0f6cef7f5930a0b3c827cd\n        with:\n          cmd: yq -oy '.workspace.package.version' 'Cargo.toml'\n\n      - name: Get version from the latest releases\n        id: lookupVersionRelease\n        uses: pozetroninc/github-action-get-latest-release@master\n        with:\n          owner: foundry-rs\n          repo: starknet-foundry\n          excludes: draft\n\n      - name: Verify branch version\n        id: verifyBranchVersion\n        if: github.ref_type == 'branch'\n        run: |\n          RELEASE_VERSION=${{ steps.lookupVersionRelease.outputs.release }}\n          COMMIT_VERSION=${{ steps.lookupVersion.outputs.result }}\n\n          echo \"Project version from newest release = $RELEASE_VERSION\"\n          echo \"Project version from this commit = $COMMIT_VERSION\"\n\n          if gh release view \"v$COMMIT_VERSION\" >/dev/null 2>&1; then\n            echo \"Release v$COMMIT_VERSION already exists - aborting\"\n            echo \"versionIsValid=false\" >> \"$GITHUB_OUTPUT\"\n            exit 0\n          fi\n\n          IS_GREATER=$(node ./scripts/compareVersions.js $RELEASE_VERSION $COMMIT_VERSION)\n          echo \"versionIsValid=$IS_GREATER\" >> \"$GITHUB_OUTPUT\"\n          echo \"version=$COMMIT_VERSION\" >> \"$GITHUB_OUTPUT\"\n        env:\n          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: Verify tag version\n        id: verifyTagVersion\n        if: github.ref_type == 'tag'\n        run: |\n          TAG_NAME=\"$GITHUB_REF_NAME\"\n          TAG_VERSION=\"${TAG_NAME#v}\"\n          CARGO_VERSION=\"${{ steps.lookupVersion.outputs.result }}\"\n\n          echo \"Tag version = $TAG_VERSION\"\n          echo \"Project version from Cargo.toml = $CARGO_VERSION\"\n\n          if [ \"$TAG_VERSION\" != \"$CARGO_VERSION\" ]; then\n            echo \"Tag version ($TAG_VERSION) does not match Cargo.toml version ($CARGO_VERSION)\"\n            exit 1\n          fi\n\n          # Tag is usually created when publishing release from GitHub UI.\n          # Then it triggers this workflow again and we want to exit without error.\n          if gh release view \"$TAG_NAME\" >/dev/null 2>&1; then\n            echo \"Release $TAG_NAME already exists - aborting\"\n            echo \"versionIsValid=false\" >> \"$GITHUB_OUTPUT\"\n            exit 0\n          fi\n\n          echo \"versionIsValid=true\" >> \"$GITHUB_OUTPUT\"\n          echo \"version=$TAG_VERSION\" >> \"$GITHUB_OUTPUT\"\n        env:\n          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n  build-binaries:\n    name: Build binaries\n    needs: verify-version\n    if: ${{ needs.verify-version.outputs.versionIsValid == 'true' }}\n    uses: ./.github/workflows/_build-binaries.yml\n    with:\n      version: ${{ needs.verify-version.outputs.version }}\n\n  build-plugin-binaries:\n    name: Build plugin binaries\n    if: ${{ needs.verify-version.outputs.versionIsValid == 'true' }}\n    needs: verify-version\n    uses: ./.github/workflows/_build-plugin-binaries.yml\n    with:\n      plugin_name: \"snforge-scarb-plugin\"\n\n  dev-publish-plugin:\n    needs: [verify-version, build-plugin-binaries]\n    if: ${{ needs.verify-version.outputs.versionIsValid == 'true' }}\n    uses: ./.github/workflows/_publish-plugin.yml\n    secrets: inherit\n    with:\n      prod_registry: false\n      overridden_plugin_version: ${{ needs.verify-version.outputs.version }}-test.${{ github.run_id }}\n      plugin_name: \"snforge-scarb-plugin\"\n\n  dev-publish-std:\n    needs: [verify-version, dev-publish-plugin]\n    if: ${{ needs.verify-version.outputs.versionIsValid == 'true' }}\n    uses: ./.github/workflows/publish-std.yml\n    secrets: inherit\n    with:\n      prod_registry: false\n      plugin_dep_version: ${{ needs.verify-version.outputs.version }}-test.${{ github.run_id }}\n      override_std_version: ${{ needs.verify-version.outputs.version }}-test.${{ github.run_id }}\n\n  test-binary:\n    name: Test binary\n    needs: [build-binaries, verify-version, dev-publish-std, dev-publish-plugin]\n    uses: ./.github/workflows/_test-binaries.yml\n    secrets: inherit\n    with:\n      bin_version: ${{ needs.verify-version.outputs.version }}\n      std_version: ${{ needs.verify-version.outputs.version }}-test.${{ github.run_id }}\n\n  create-release:\n    name: Create release\n    runs-on: ubuntu-latest\n    needs: [ test-binary, verify-version ]\n    steps:\n      - uses: actions/checkout@v6\n\n      - name: Download artifacts\n        uses: actions/download-artifact@v6\n        with:\n          path: artifacts-dl\n\n      - name: Unpack artifacts to staging directory\n        run: |\n          mkdir -p artifacts\n          mv artifacts-dl/build-*/starknet-foundry-* artifacts/\n\n      - name: Create GitHub release\n        id: create-release\n        uses: taiki-e/create-gh-release-action@26b80501670402f1999aff4b934e1574ef2d3705\n        with:\n          token: ${{ secrets.GITHUB_TOKEN }}\n          draft: true\n          changelog: CHANGELOG.md\n          allow-missing-changelog: false\n          title: $version\n          ref: refs/tags/v${{ needs.verify-version.outputs.version }}\n\n      - name: Upload artifacts to the release\n        working-directory: artifacts\n        run: gh release upload \"$TAG\" *\n        env:\n          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          TAG: ${{ steps.create-release.outputs.computed-prefix }}${{ steps.create-release.outputs.version }}\n\n  publish-snforge-scarb-plugin:\n    name: Publish snforge_scarb_plugin\n    needs: [test-binary, create-release]\n    uses: ./.github/workflows/_publish-plugin.yml\n    secrets: inherit\n    with:\n      prod_registry: true\n      plugin_name: \"snforge-scarb-plugin\"\n\n  publish-to-registry:\n    name: Publish packages to the registry\n    needs: [ verify-version, publish-snforge-scarb-plugin ]\n    uses: ./.github/workflows/publish-std.yml\n    secrets: inherit\n    with:\n      plugin_dep_version: ${{ needs.verify-version.outputs.version }}\n      prod_registry: true\n"
  },
  {
    "path": ".github/workflows/scheduled.yml",
    "content": "name: Scheduled\n\non:\n  pull_request:\n    paths:\n      - scripts/get_scarb_versions.sh\n      - .github/workflows/scheduled.yml\n  schedule:\n    # Two schedules needed so we can distinguish between nightly and non-nightly runs\n    - cron: '0 0 * * 0'\n    - cron: '0 0 * * 3'\n  workflow_dispatch:\n\njobs:\n  get-scarb-versions:\n    if: github.event.repository.fork == false\n    name: Get Scarb versions\n    outputs:\n      versions: ${{ steps.get_versions.outputs.versions }}\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v6\n      - uses: asdf-vm/actions/setup@b7bcd026f18772e44fe1026d729e1611cc435d47\n      - run: |\n          asdf plugin add scarb\n          asdf install scarb latest\n          asdf set --home scarb latest\n\n      - name: Get versions\n        id: get_versions\n        run: |\n          scarb_versions=$(./scripts/get_scarb_versions.sh)\n          echo ${scarb_versions[@]}\n          echo \"versions=[${scarb_versions[@]}]\" >> \"$GITHUB_OUTPUT\"\n\n  test-forge-unit-and-integration:\n    if: github.event.repository.fork == false\n    runs-on: ubuntu-latest\n    needs: get-scarb-versions\n    strategy:\n      fail-fast: false\n      matrix:\n        version: ${{ fromJSON(needs.get-scarb-versions.outputs.versions) }}\n\n    steps:\n      - uses: actions/checkout@v6\n      - uses: dtolnay/rust-toolchain@stable\n      - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5\n      - uses: software-mansion/setup-scarb@v1\n        with:\n          scarb-version: ${{ matrix.version }}\n      - uses: software-mansion/setup-universal-sierra-compiler@v1\n\n      - run: cargo test --profile ci --lib -p forge\n      - run: cargo test --profile ci -p forge integration --features non_exact_gas_assertions\n\n  test-forge-e2e:\n    if: github.event.repository.fork == false\n    runs-on: ubuntu-latest\n    needs: get-scarb-versions\n    strategy:\n      fail-fast: false\n      matrix:\n        version: ${{ fromJSON(needs.get-scarb-versions.outputs.versions) }}\n\n    steps:\n      - name: Extract branch name\n        if: github.event_name != 'pull_request'\n        run: echo \"BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})\" >> $GITHUB_ENV\n\n      - name: Extract branch name on pull request\n        if: github.event_name == 'pull_request'\n        run: echo \"BRANCH_NAME=$(echo $GITHUB_HEAD_REF)\" >> $GITHUB_ENV\n\n      - name: Extract repo name and owner\n        if: github.event_name != 'pull_request'\n        run: echo \"REPO_NAME=$(echo ${{ github.repository }}.git)\" >> $GITHUB_ENV\n\n      - name: Extract repo name and owner on pull request\n        if: github.event_name == 'pull_request'\n        run: echo \"REPO_NAME=$(echo ${{ github.event.pull_request.head.repo.full_name }}.git)\" >> $GITHUB_ENV\n\n      - uses: actions/checkout@v6\n      - uses: dtolnay/rust-toolchain@stable\n      - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5\n      - uses: software-mansion/setup-scarb@v1\n        with:\n          scarb-version: ${{ matrix.version }}\n      - uses: software-mansion/setup-universal-sierra-compiler@v1\n      - name: Install cairo-profiler\n        run: |\n          curl -L https://raw.githubusercontent.com/software-mansion/cairo-profiler/main/scripts/install.sh | sh\n      - name: Install cairo-coverage\n        run: |\n          curl -L https://raw.githubusercontent.com/software-mansion/cairo-coverage/main/scripts/install.sh | sh\n\n      - name: Determine test features\n        id: test_features\n        run: |\n          SCARB_VERSION=\"${{ matrix.version }}\"\n\n          if [ \"$(printf '%s\\n' \"2.15.1\" \"$SCARB_VERSION\" | sort -V | head -n1)\" = \"2.15.1\" ]; then\n            FEATURES=\"skip_test_for_only_latest_scarb,run_test_for_scarb_since_2_15_1\"\n          else\n            FEATURES=\"skip_test_for_only_latest_scarb\"\n          fi\n          echo \"features=$FEATURES\" >> \"$GITHUB_OUTPUT\"\n\n      - run: cargo test --profile ci -p forge --features \"${{ steps.test_features.outputs.features }}\" e2e\n\n  test-cast:\n    if: github.event.repository.fork == false\n    runs-on: ubuntu-latest\n    needs: get-scarb-versions\n    strategy:\n      fail-fast: false\n      matrix:\n        version: ${{ fromJSON(needs.get-scarb-versions.outputs.versions) }}\n\n    steps:\n      - uses: actions/checkout@v6\n      - uses: dtolnay/rust-toolchain@stable\n      - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5\n      - uses: software-mansion/setup-scarb@v1\n        with:\n          scarb-version: ${{ matrix.version }}\n      - uses: software-mansion/setup-universal-sierra-compiler@v1\n      - name: Get Devnet version from .tool-versions\n        id: get-devnet-version\n        run: |\n          devnet_version=$(grep starknet-devnet .tool-versions | cut -d \" \" -f 2)\n          echo \"Devnet version: $devnet_version\"\n          echo \"version=$devnet_version\" >> \"$GITHUB_OUTPUT\"\n      - uses: asdf-vm/actions/install@b7bcd026f18772e44fe1026d729e1611cc435d47\n        with:\n          tool_versions: |\n            starknet-devnet ${{ steps.get-devnet-version.outputs.version }}\n\n      - run: cargo test --profile ci -p sncast\n\n  get-version:\n    name: Get current foundry version\n    if: github.event.repository.fork == false\n    runs-on: ubuntu-latest\n    outputs:\n      version: ${{ steps.validVersion.outputs.version }}\n    steps:\n      - uses: actions/checkout@v6\n\n      - name: Get version from Cargo.toml\n        id: lookupVersion\n        uses: mikefarah/yq@7ccaf8e700ce99eb3f0f6cef7f5930a0b3c827cd\n        with:\n          cmd: yq -oy '.workspace.package.version' 'Cargo.toml'\n\n      - name: Return version\n        id: validVersion\n        run: |\n          COMMIT_VERSION=${{ steps.lookupVersion.outputs.result }}\n          echo \"Project version from this commit = $COMMIT_VERSION\"\n          echo \"version=$COMMIT_VERSION\" >> \"$GITHUB_OUTPUT\"\n\n  build-plugin-binaries:\n    name: Build plugin binaries\n    needs: get-version\n    uses: ./.github/workflows/_build-plugin-binaries.yml\n    with:\n      overridden_plugin_version: ${{ needs.get-version.outputs.version }}-test.${{ github.run_id }}\n      plugin_name: 'snforge-scarb-plugin'\n\n  publish-plugin:\n    needs: [ get-version, build-plugin-binaries ]\n    uses: ./.github/workflows/_publish-plugin.yml\n    secrets: inherit\n    with:\n      prod_registry: false\n      overridden_plugin_version: ${{ needs.get-version.outputs.version }}-test.${{ github.run_id }}\n      plugin_name: 'snforge-scarb-plugin'\n\n  publish-std:\n    needs: [ get-version, publish-plugin ]\n    uses: ./.github/workflows/publish-std.yml\n    secrets: inherit\n    with:\n      prod_registry: false\n      plugin_dep_version: ${{ needs.get-version.outputs.version }}-test.${{ github.run_id }}\n      override_std_version: ${{ needs.get-version.outputs.version }}-test.${{ github.run_id }}\n\n  build-binaries:\n    needs: [ get-version ]\n    uses: ./.github/workflows/_build-binaries.yml\n    with:\n      version: ${{ needs.get-version.outputs.version }}-test.${{ github.run_id }}\n\n  test-binary:\n    name: Test binary\n    needs: [ build-binaries, get-version, publish-std ]\n    uses: ./.github/workflows/_test-binaries.yml\n    secrets: inherit\n    with:\n      bin_version: ${{ needs.get-version.outputs.version }}-test.${{ github.run_id }}\n      std_version: ${{ needs.get-version.outputs.version }}-test.${{ github.run_id }}\n\n  create-nightly-release:\n    # Creating a nightly release will trigger a Maat experiment for it as well\n    # Publish nightly only on Sundays\n    if: ${{ (github.event_name == 'schedule') && (github.event.schedule == '0 0 * * 0') }}\n    needs: [ test-binary ]\n    secrets: inherit\n    uses:\n      ./.github/workflows/nightly.yml\n\n  notify_if_failed:\n    runs-on: ubuntu-latest\n    if: always() && contains(needs.*.result, 'failure') && github.event_name == 'schedule'\n    needs: [ create-nightly-release, test-forge-unit-and-integration, test-forge-e2e, test-cast , build-plugin-binaries, build-binaries, publish-plugin, publish-std, test-binary ]\n    steps:\n      - name: Notify that the workflow has failed\n        uses: slackapi/slack-github-action@v2.1.1\n        with:\n          webhook: ${{ secrets.SLACK_SCHEDULED_TESTS_FAILURE_WEBHOOK_URL }}\n          webhook-type: webhook-trigger\n          payload: |\n            url: \"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\"\n"
  },
  {
    "path": ".gitignore",
    "content": ".idea\npyproject.toml\n.DS_Store\n*/.tool-versions\ntarget\n.vscode/\n.env\nScarb.lock\n!snforge_std/Scarb.lock\n!sncast_std/Scarb.lock\n*/node_modules\n.spr.yml\n.snfoundry_cache/\n.snfoundry_versioned_programs/\nsnfoundry_trace/\ncoverage/\n**/.forge_e2e_cache/\n*.snap.new\n"
  },
  {
    "path": ".tool-versions",
    "content": "scarb 2.17.0\nstarknet-devnet 0.8.0-rc.3\n"
  },
  {
    "path": "CAIRO_NATIVE.md",
    "content": "# Running Cairo Native\n\n<!-- TOC -->\n* [Running Cairo Native](#running-cairo-native)\n  * [Installing Starknet Foundry With Cairo Native Support](#installing-starknet-foundry-with-cairo-native-support)\n    * [LLVM](#llvm)\n    * [`ld`](#ld)\n      * [Linux](#linux)\n      * [MacOS](#macos)\n  * [Running Tests](#running-tests)\n<!-- TOC -->\n\n## Installing Starknet Foundry With Cairo Native Support\n\nCairo Native introduces additional dependencies outside of the Rust ecosystem.\n\n### LLVM\n\nLLVM is linked into Starknet Foundry binary, so it doesn't have to be installed separately at the cost of an increased\nbinary size.\n\n### `ld`\n\nCairo Native crate makes direct calls to `ld`, which must in turn be installed on the system.\n\n#### Linux\n\nThe package `binutils` contains `ld`, install it with package manager relevant to your distribution or build it\nfrom source.\n\n#### MacOS\n\n`ld` is part of the Xcode command line tools. Install it with `xcode-select --install`.\n\n## Running Tests\n\nTo run tests run `snforge test --run-native`, without the flag, the execution will still run in the VM.\n\nWhen running native features that rely on VM trace like test backtrace, profiler, coverage will not work.\nRunning native enforces the test to run with `sierra-gas` as tracked resource. Tracking vm resources is not possible\nwith the native execution. "
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Changelog\n\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n## [Unreleased]\n\n### Forge\n\n#### Added\n\n- `--launch-debugger` flag that allows launching a test in debug mode using `cairo-debugger` crate. Read more [here](https://foundry-rs.github.io/starknet-foundry/snforge-advanced-features/debugging.html#live-debugging)\n\n#### Changed\n\n- Minimal recommended `Scarb` version is now `2.15.2` (updated from `2.14.0`)\n\n### Cast\n\n#### Fixed\n\n- `sncast verify` now uses the configured network or infers it from the RPC chain ID when `--network` is omitted.\n\n## [0.59.0] - 2026-04-10\n\n### Forge\n\n#### Added\n\n- Cheats for transaction info `proof_facts`\n\n#### Changed\n\n- Updated execution to reflect Starknet `v0.14.2`, specifically the storage gas price changes (see [SNIP-37](https://community.starknet.io/t/snip-37-revisit-storage-access-cost/116143) for more details)\n\n### Cast\n\n#### Added\n\n- `sncast get tx` command to get transaction details by hash.\n- `sncast utils selector` command to calculate entrypoint selector (`sn_keccak`) from function name.\n- `sncast get class-hash-at` command to get the class hash of a contract at a given address.\n- `--with-proof-facts` flag for `sncast get tx` to include proof facts in tx response. Read more [here](https://community.starknet.io/t/snip-36-in-protocol-proof-verification/116123l).\n- `--proof-file` and `--proof-facts-file` flags for `sncast invoke` to attach proof data from files.\n\n## [0.58.1] - 2026-03-31\n\n### Forge\n\n#### Fixed\n\n- Bug with using cheats in library calls\n\n### Cast\n\n#### Added\n\n- `--nonce` flag to `sncast multicall run`\n\n## [0.58.0] - 2026-03-18\n\n### Forge\n\n#### Added\n- `--max-threads` flag to control the maximum number of threads used for test execution\n- `optimize-inlining` subcommand, which performs a brute-force search of the optimal `inlining-strategy` threshold for the project over user defined benchmark\n\n#### Fixed\n\n- Bug with invalid function name mappings for functions with `#[test]` attribute\n- `--exit-first` flag now correctly stops execution for all packages when tests are run in a workspace\n\n### Cast\n\n#### Added\n\n- Support for Ledger hardware wallet as a transaction signer\n- `sncast get nonce` command to get the nonce of a contract\n- `sncast multicall execute`, which allows to pass calls directly as CLI arguments. Read more [here](https://foundry-rs.github.io/starknet-foundry/starknet/multicall.html#multicall-with-cli-arguments)\n\n#### Changed\n\n- `sncast balance` and `sncast tx-status` commands have been moved under `sncast get` subcommand (`sncast get balance`, `sncast get tx-status`). The old commands still work, but will be removed in the future.\n- Referencing an id in multicall configuration files now requires the `@` prefix.\n\n## [0.57.0] - 2026-02-24\n\n### Forge\n\n#### Added\n\n- Partitioned test execution with `--partition <INDEX>/<TOTAL>` flag. Read more [here](https://foundry-rs.github.io/starknet-foundry/snforge-advanced-features/tests-partitioning.html)\n\n#### Changed\n\n- Minimal recommended `Scarb` version is now `2.14.0` (updated from `2.13.1`)\n- In case of a test failure, generic `ENTRYPOINT_FAILED` errors are now included in the panic data\n\n#### Fixed\n\n- State modified by failed contract calls executed within the test function is now correctly reverted\n- `--exact` flag now requires `--test-filter` to be non-empty\n\n### Cast\n\n#### Added\n\n- `--sierra-file` flag to `sncast declare-from` to allow declaring contract from a local Sierra file.\n\n#### Removed\n\n- Due to termination of starkscan.co, `StarkScan` option for `block-explorer` field in `snfoundry.toml` was removed. For a full list of supported block explorer services, see the [block explorer documentation](https://foundry-rs.github.io/starknet-foundry/appendix/snfoundry-toml.html#block-explorer)\n\n## [0.56.0] - 2026-02-03\n\n### Forge\n\n#### Removed\n\n- Support for Scarb versions < 2.12.0. `snforge` now requires Scarb 2.12.0 or newer\n- The deprecated `snforge_scarb_plugin_deprecated`\n- The deprecated `snforge_std_deprecated`\n\n#### Changed\n\n- `--detailed-resources` output now includes all gas-related resources\n- `deploy` and `deploy_at` methods on `ContractClass` instance now allow constructor errors to be caught instead of failing immediately. This change diverges from the behavior of the `deploy_syscall` on the network, where such errors cannot be caught.\n- Template created by `snforge new --template erc20-contract` now uses `openzeppelin_token` version `3.0.0` (updated from `1.0.0`). This template requires Scarb version >= `2.15.1`.\n\n## [0.55.0] - 2026-01-13\n\n### Forge\n\n#### Changed\n\n- Minimal recommended `Scarb` version is now `2.13.1` (updated from `2.12.2`)\n- `snforge_scarb_plugin` now emits an error if unexpected named args are passed to `#[available_gas]`, `#[fork]`, `#[fuzzer]`, `#[should_panic]` and `#[test_case]` attributes\n\n#### Fixed\n\n- Byte arrays containing non-printable characters are now displayed correctly in fuzz test output\n\n### Cast\n\n#### Added\n\n- `network` field can now be configured in `snfoundry.toml`\n\n#### Changed\n\n- `--network` flag can be used with `--add-profile` flag\n\n#### Fixed\n\n- `sncast balance` command now correctly displays token unit instead of token for `eth` and `strk`\n\n## [0.55.0-rc.0] - 2025-12-18\n\n### Forge\n\n#### Changed\n\n- Minimal recommended `Scarb` version is now `2.12.2` (updated from `2.11.4`)\n\n#### Fixed\n\n- Signature generation now enforces the low-s rule\n- Fixed a bug that caused a slowdown in test execution\n- Panic that occurred in debug trace and gas report when using mock calls\n\n#### Removed\n\n- The deprecated `snforge completion`. Use `snforge completions` instead.\n\n### Cast\n\n#### Changed\n\n- Error message for already declared contracts now includes the class hash\n\n#### Fixed\n\n- When using `account create` or `account import` commands without specifying `--network` or `--url`, url from snfoundry.toml is now used correctly (if present)\n- Fixed account's balance value from `sncast balance` command\n\n#### Removed\n\n- The deprecated `sncast completion`. Use `sncast completions` instead.\n\n## [0.54.0] - 2025-12-09\n\n### Forge\n\n#### Added\n\n- `get_current_vm_step` function to get the current step during test execution. For more see [docs](https://foundry-rs.github.io/starknet-foundry/snforge-library/testing/get_current_vm_step.html)\n\n#### Fixed\n\n- Cheatcodes are now reflected in called contract, when directly using a library call from test code\n- Oracles are fully supported for Scarb versions >= 2.13.1. Bugs related to oracles' output handling have been fixed.\n  Removed the `--experimental-oracles` flag.`\n- Fixed a bug that caused failure data to be displayed twice\n\n### Cast\n\n#### Added\n\n- `type` field to most responses when using `--json` output format.\n\n#### Changed\n\n- `sncast script init` now longer adds `cairo_test` as dependency in `Scarb.toml`\n- Replaced the free RPC provider to Zan\n- The supported RPC version is now 0.10.0\n\n#### Fixed\n\n- Restored missing `command` missing from some responses when using `--json` output format.\n- When deploying account with `--keystore` flag `sncast` now longer ask two times for password\n\n## [0.53.0] - 2025-11-24\n\n### Cast\n\n#### Changed\n\n- Hash function used when declaring contracts is selected based on the Starknet version\n\n## [0.53.0-rc.0] - 2025-11-18\n\n### Forge\n\n#### Added\n\n- `--gas-report` flag to display a table of L2 gas breakdown for each contract and selector\n\n### Cast\n\n#### Changed\n\n- The supported RPC version is now 0.10.0-rc.1\n\n## [0.52.0] - 2025-11-05\n\n### Forge\n\n#### Changed\n\n- Gas values in fuzzing test output are now displayed as whole numbers without fractional parts\n- Minimal recommended `Scarb` version is now `2.11.4` (updated from `2.10.1`)\n\n#### Fixed\n\n- A bug that prevented the `#[test_case]` attribute from being used on its own with cheatcodes\n\n### Cast\n\n#### Added \n\n- Possibility to configure urls of predefined networks used by `--network` flag via `sncast` profile in `snfoundry.toml`\n\n## [0.51.2] - 2025-10-31\n\n### Cast\n\n#### Changed\n\n- Replaced the free RPC provider used.\n\n## [0.51.1] - 2025-10-23\n\n### Forge\n\n#### Fixed\n\n- A bug that caused `meta_tx_v0` to panic when tracked resources are Sierra gas.\n\n## [0.51.0] - 2025-10-21\n\n### Forge\n\n#### Added\n\n- `Fuzzable` trait implementations for `bool` and `ContractAddress`\n- Type aliases for `StarkCurveKeyPair`, `Secp256k1CurveKeyPair`, `Secp256r1CurveKeyPair`\n- Option to display L2 gas for each call in the debugging trace\n\n#### Changed\n\n- Updated the error message returned when calling a nonexistent method on a contract to better align with the format used by the network\n- The default tracked resource is now Sierra gas, so gas reporting results may differ compared to previous versions. For more information refer to the [documentation](https://foundry-rs.github.io/starknet-foundry/testing/gas-and-resource-estimation.html)\n- When using the `--detailed-resources` flag, the used Sierra gas key is now shown as `sierra gas` instead of `sierra_gas_consumption`\n\n### Cast\n\n#### Added\n\n- Debug logging for `sncast` commands that can be enabled by setting `SNCAST_LOG` env variable.\n- `sncast declare` command now outputs a ready-to-use deployment command after successful declaration.\n- Possibility to use [`starknet-devnet`](https://github.com/0xSpaceShard/starknet-devnet) predeployed accounts directly in `sncast` without needing to import them. They are available under specific names - `devnet-1`, `devnet-2`, ..., `devnet-<N>`. Read more [here](https://foundry-rs.github.io/starknet-foundry/starknet/integration_with_devnet.html#predeployed-accounts)\n- Support for `--network devnet` flag that attempts to auto-detect running `starknet-devnet` instance and connect to it.\n- Support for automatically declaring the contract when running `sncast deploy`, by providing `--contract-name` flag instead of `--class-hash`. \n- `sncast balance` command to fetch the balance of an account for a specified token.\n\n#### Fixed\n\n- `sncast declare` now shows a correct error message when contract is already declared.\n\n## [0.50.0] - 2025-09-29\n\n### Forge\n\n#### Added\n\n- `#[test_case]` attribute for parameterized testing. Read more [here](https://foundry-rs.github.io/starknet-foundry/snforge-advanced-features/parametrized-testing.html)\n\n#### Changed\n\n- Minimal supported `Scarb` version is now `2.10.0` (updated from `2.9.1`)\n- Minimal supported `snforge_std` and `snforge_std_deprecated` version is now `0.50.0`\n- `deploy` and `deploy_at` methods on `ContractClass` instance now fail immediately upon encountering an error, preventing the error from being caught. This change aligns with the behavior of the `deploy_syscall` on the network\n\n#### Fixed\n\n- [`core::testing::get_available_gas`](https://docs.starknet.io/build/corelib/core-testing-get_available_gas) now works correctly in snforge tests\n\n#### Removed\n\n- Possibility to use `#[available_gas]` with unnamed argument. Use named arguments instead, e.g. `#[available_gas(l2_gas: 5)]`.\n- The deprecated command `snforge init`. Use `snforge new` to initialize new `Forge` projects\n\n### Cast\n\n#### Added\n\n- `sncast declare-from` command to declare a contract by fetching it from a different Starknet instance\n\n## [0.49.0] - 2025-09-03\n\n### Forge\n\n#### Added\n\n- Support for `meta_tx_v0` syscall with cheatcode compatibility\n- `snforge` now supports [oracles](https://docs.swmansion.com/cairo-oracle/) with `--experimental-oracles` flag.\n- `--trace-components` flag to allow selecting which components of the trace to do display. Read more [here](https://foundry-rs.github.io/starknet-foundry/snforge-advanced-features/debugging.html#trace-components)\n\n### Cast\n\n#### Added\n\n- `--test-files` flag to `verify` command to include test files under src/ for verification (only applies to voyager)\n- `--tip` flag to `invoke`, `declare`, `deploy`, `multicall run` and `account deploy` commands to set the transaction tip\n- `--estimate-tip` flag which automatically adds an estimated tip to the transaction. The tip is calculated based on the current network conditions and added to the transaction fee\n- `utils class-hash` command to calculate the class hash for a contract\n\n#### Changed\n\n- The supported RPC version is now 0.9.0\n- [New UDC](https://starkscan.co/contract/0x02ceed65a4bd731034c01113685c831b01c15d7d432f71afb1cf1634b53a2125) is now used during deployment\n\n## [0.48.1] - 2025-08-14\n\n### Forge\n\n#### Fixed\n\n- A bug that caused `#[fuzzer]` attribute to fail when used with generic structs\n\n## [0.48.0] - 2025-08-05\n\n### Forge\n\n#### Added\n\n- `snforge_std` is now compatible with Scarb procedural macros V2. Migration is required if using Scarb versions before `2.12.0`. See [migration guide](https://foundry-rs.github.io/starknet-foundry/getting-started/0-47-0-migration-guide.html).\n\n#### Changed\n\n- If using a Scarb version before `2.10.0` or not using `allow-prebuild-plugins`, the minimal required rust version to run `snforge` is now `1.87.0`\n\n### Cast\n\n#### Fixed\n\n- Block explorer links are now hidden by default when using [`starknet-devnet`](https://github.com/0xSpaceShard/starknet-devnet). Set `SNCAST_FORCE_SHOW_EXPLORER_LINKS=1` env variable to display them.\n\n## [0.47.0] - 2025-07-28\n\n### Forge\n\n#### Added\n\n- `interact_with_state` cheatcode to enable effective use of `contract_state_for_testing` in snforge tests\n- Support for using [Scarb profiles](https://docs.swmansion.com/scarb/docs/reference/profiles.html) with `snforge test`, allowing to pass the same profile flags as in Scarb (`--release`, `--dev`, `--profile`) to build artifacts using a specific profile\n\n#### Deprecated\n\n- The `snforge completion` command. Use `snforge completions` instead\n\n#### Fixed\n\n- Passing a cheatcode span of 0 was incorrectly treated as `CheatSpan::Indefinite`. This is now resolved by making `CheatSpan::TargetCalls` accept `NonZero<usize>` instead of just `usize` in `snforge_std`.\n\n### Cast\n\n#### Added\n\n- `ready` option for `--type` flag in `account create` and `account import` commands (Argent wallet has rebranded as Ready)\n\n#### Changed\n\n- Braavos accounts with all class hashes are now supported\n\n#### Deprecated\n\n- `argent` option for `--type` flag in `account create` and `account import` commands. Use `ready` instead\n- The `sncast completion` command. Use `sncast completions` instead\n\n## [0.46.0] - 2025-07-09\n\n### Forge\n\n#### Added\n\n- Total test summary when running tests across multiple packages (for example when running `snforge test --workspace`)\n\n#### Fixed\n\n- Bug where syscall execution resources from nested calls were being calculated twice\n\n### Cast\n\n#### Added\n\n- `sncast utils serialize` command to serialize Cairo expressions into calldata\n- `sncast verify` now supports verifying against [voyager](https://voyager.online/) block explorer.\n\n#### Changed\n\n- Improved commands output readability with colors and simplified layout.\n- `sncast verify` no longer defaults to using walnut.\n\n#### Fixed\n\n- Bug where `account create` raised an error if no `--name` was provided and the file specified by `--accounts-file` was empty\n\n#### Removed\n\n- `--int-format` and `--hex-format`, all values are displayed with default format\n\n## [0.45.0] - 2025-06-16\n\n### Forge\n\n#### Added\n- ETH token is now pre-deployed by default in every test, and `Token::ETH` was added to `snforge_std`\n- `--skip` flag to allow excluding any test whose name contains the provided string\n\n#### Changed\n- Updated output format for `--exit-first` flag. Tests skipped due to preceding failures are no longer displayed in the summary. Alternative information is shown when applicable.\n- `storage address` was renamed to `contract address` in the output of `--trace-verbosity`\n\n#### Fixed\n\n- bug that caused `--trace-verbosity` to panic in fork tests\n- fixed a bug in tests where resources used in nested calls were counted multiple times, leading to overestimated gas and resource usage\n\n#### Removed\n\n- Windows support. For details on migration, see the WSL [installation guide](https://foundry-rs.github.io/starknet-foundry/getting-started/installation.html#linux-and-macos).\n\n### Cast\n\n#### Fixed\n\n- bug where `account create` raised an error if the file specified by `--accounts-file` was empty\n\n#### Removed\n\n- Windows support. For details on migration, see the WSL [installation guide](https://foundry-rs.github.io/starknet-foundry/getting-started/installation.html#linux-and-macos).\n\n## [0.44.0] - 2025-05-26\n\n### Forge\n\n#### Changed\n\n- Minimal supported `snforge_std` version is 0.44.0\n- Changed the code generated by `snforge_std`'s `#[test]` attribute\n\n#### Fixed\n\n- \"invalid syscall selector\" error appearing when using arithmetic circuits\n- Bug that caused incorrect gas tracking for contracts using Sierra version less than `1.7.0` when `sierra-gas` was passed as the `tracked-resource`\n\n### Cast\n\n#### Added\n\n- Displaying the path of the config file when adding a new profile\n\n#### Changed\n\n- OpenZeppelin account updated to v1.0.0 [preset](https://docs.openzeppelin.com/contracts-cairo/1.0.0/api/account#AccountUpgradeable)\n- Restored support for Braavos accounts\n- Accounts created with `--type braavos` use updated v1.2.0 class hash\n- Output of `sncast account create` is now clearer; the estimated fee is displayed in both STRK and FRI.\n- Renamed the field `max_fee` to `estimated_fee` in the `sncast account create` output.\n\n## [0.43.1] - 2025-05-16\n\n### Cast\n\n#### Removed\n\n- Broken Voyager RPC provider\n\n## [0.43.0] - 2025-05-09\n\n### Forge\n\n#### Added\n\n- `set_balance` cheatcode for setting an ERC20 token balance for specified contract address. The STRK token is now pre-deployed in every test by default. This can be disabled by adding `#[disable_predeployed_contracts]` attribute to test.\n- added option to display trace of contracts execution. Read more [here](https://foundry-rs.github.io/starknet-foundry/snforge-advanced-features/debugging.html)\n\n#### Changed\n\n- \"Success data\" message is no longer printed when a test using the `#[should_panic]` attribute passes\n\n### Cast\n\n#### Added\n\n- when using `sncast call` the response will be printed as a Cairo-like string representation of the return values\n\n#### Changed\n\n- The supported RPC version is now 0.8.1\n\n## [0.42.0] - 2025-04-28\n\n### Forge\n\n#### Added\n\n- Safe dispatchers can now be used inside contracts\n\n#### Changed\n\n- Minimal supported Scarb version is now `2.9.1`\n- Improved display of backtrace for contracts that panicked, when `panic-backtrace = true` in `Scarb.toml`. Without using this feature, the backtrace may be less accurate than before.\n  As of this release, this feature is available only in `scarb nightly-2025-03-27`.\n\n#### Fixed\n\n- The state correctly reverts after failed internal calls\n\n### Cast\n\n#### Fixed\n\n- Bug that prevented from passing values to `--arguments` that started with a leading minus `-` sign.\n- User is now prompted to save an imported or deployed account in `sncast` config even when using `--network` flag\n\n## [0.41.0] - 2025-04-08\n\n### Forge\n\n#### Added\n\n- `--template` flag to `snforge new` command that allows selecting a template for the new project. Possible values are `balance-contract` (default), `cairo-program` and `erc20-contract`\n\n#### Fixed\n\n- fixed incorrect extra newlines in test summary\n\n### Cast\n\n#### Added\n\n- Support for `array![].span()` in `--arguments` command\n\n#### Changed\n\n- `verify` command now supports the `--class-hash` for Walnut verification\n\n#### Removed\n\n- `NftScan` is no longer supported as `block-explorer` option\n\n## [0.40.0] - 2025-03-26\n\n### Cast\n\n#### Added\n\n- `--l1-gas`, `--l1-gas-price`, `--l2-gas`, `--l2-gas-price`, `--l1-data-gas`, `--l1-data-gas-price` flags\n- methods for fee settings creation, in `FeeSettingsTrait`: `max_fee()`, `resource_bounds()` and `estimate()` (in `sncast_std`)\n\n#### Changed\n\n- Updated argent class hash used in account creation to v0.4.0\n- wrapped error for `ContractError` is now of type `ContractErrorData` (in `sncast_std`)\n- field `execution_error` in `TransactionExecutionErrorData` is now of type `ContractExecutionError` (in `sncast_std`)\n- Using Braavos accounts is temporarily disabled because they don't yet work with the RPC version supported by `sncast`\n- `sncast script init` command now initializes project with the `sncast_std` dependency from the [registry](https://scarbs.xyz/packages/sncast_std)\n\n#### Removed\n\n- `--max-gas` and `--max-gas-unit-price` flags\n- `max_gas`, `max_gas_unit_price` fields in `FeeSettings` (in `sncast_std`)\n\n## [0.39.0] - 2025-03-19\n\n### Forge\n\n#### Added\n\n- `snforge completion` command - used to generate autocompletion script\n- Cheats for `get_block_hash_syscall`\n- new `--tracked-resource` flag, that will change currently tracked resource\n  (`cairo-steps` for vm resources - default; `sierra-gas` for sierra gas consumed resources in cairo native)\n- Testing events api improvements. New `IsEmitted` trait. Implemented `Into<snforge_std::Event>` for `starknet::Event` and `PartialEq` trait implementations for `snforge_std::Event` and `snforge_std::Events`.\n\n\n#### Changed\n- gas is now reported using resource bounds triplet (l1_gas, l1_data_gas and l2_gas)\n- `available_gas` now accepts named arguments denoting resource bounds (eg `#[available_gas(l1_gas: 1, l1_data_gas: 2, l2_gas: 3)]`)\n\n#### Fixed\n\n- Bug with file locking that prevented forking from working on Windows\n\n### Cast\n\n#### Added\n\n- `sncast completion` command - used to generate autocompletion script\n\n## [0.38.3] - 2025-03-07\n\n### Forge\n\n#### Fixed\n\n- Issue with uploading `snforge_std` to scarbs package registry that prevented it from including package reexports required in Scarb >= 2.11.0\n\n## [0.38.2] - 2025-03-06\n\n### Forge\n\n#### Changed\n\n- Fork cache version is pinned to the forge version.\n\n#### Fixed\n\n- `snforge_scarb_plugin` now emits an error when parameters are passed without using the `#[fuzzer]` attribute\n- A bug that was causing execution to hang if using forking\n\n## [0.38.0] - 2025-02-25\n\n### Forge\n\n#### Added\n\n- `snforge clean` command - used to manage and remove files generated by snforge. It supports cleaning the following components: coverage, profile, cache, trace, all\n- `snforge new` now adds the `snfoundry_trace`, `coverage`, and `profile` directories to `.gitignore`.\n- Custom types can be used in fuzz testing by implementing the `Fuzzable` trait\n- Support for Cairo 2.10.0\n\n#### Changed\n\n- It is now required to include the `#[fuzzer]` attribute for fuzz tests to work\n- Scarb `2.8.5` is now the minimal recommended version. Using Starknet Foundry with versions below it is no longer officially supported and may not work.\n\n#### Deprecated\n\n- `snforge clean-cache` command\n\n### Cast\n\n#### Changed\n\n- `--name` flag is now optional when using `account create` (default name is generated)\n\n## [0.37.0] - 2025-02-03\n\n### Forge\n\n#### Added\n\n- Rust is no longer required to use `snforge` if using Scarb >= 2.10.0 on supported platforms - precompiled `snforge_scarb_plugin` plugin binaries are now published to [package registry](https://scarbs.xyz) for new versions.\n- Added a suggestion for using the `--max-n-steps` flag when the Cairo VM returns the error: `Could not reach the end of the program. RunResources has no remaining steps`.\n\n#### Fixed\n\n- coverage validation now supports comments in `Scarb.toml`\n\n### Cast\n\n#### Added\n\n- Default RPC providers under `--network` flag\n\n#### Changed\n\n- Renamed `--network` flag to `--network-name` in `sncast account delete` command\n\n#### Fixed\n\n- Bug resulting in value passed for `max_fee` being ignored in cast scripts when using `deploy` with STRK token\n\n#### Removed\n\n- `--fee-token` and `--version` flags, subsequently support for transaction versions other than v3\n- Support for ETH transactions in scripts\n\n## [0.36.0] - 2025-01-15\n\n### Forge\n\n#### Changed\n\n- Trace files saved in `snfoundry_trace` directory will now use `_` as separators instead of `::`\n\n### Cast\n\n#### Added\n\n- When using `--max-fee` with transactions v3, calculated max gas and max gas unit price are automatically validated to ensure they are greater than 0 after conversion\n- interactive interface that allows setting created or imported account as the default\n\n#### Changed\n\n- Values passed to the `--max-fee`, `--max-gas`, and `--max-gas-unit-price` flags must be greater than 0\n\n#### Deprecated\n\n- `--version` flag\n\n## [0.35.1] - 2024-12-16\n\n### Forge\n\n#### Fixed\n\n- Minimal Rust version in requirements check is the same as in docs (`1.80.1`)\n- `snforge` produces trace for contracts even if they fail or panic (assuming test passed)\n\n## [0.35.0] - 2024-12-13\n\n### Forge\n\n#### Added\n\n- Requirements validation during `snforge` runtime\n- `snforge check-requirements` command\n- `snforge new` command\n\n#### Changed\n\n- `snforge_scarb_plugin` will now also emit warnings when errors occur\n- `snforge_std` migrated to `2024_07` edition\n- `snforge_std` from scarbs package registry is now used in `snforge new` template\n\n#### Deprecated\n\n- `snforge init` command\n\n### Cast\n\n#### Added\n\n- `account create` command shows prepared deployment command\n\n#### Changed\n\n- `--version` flag is now optional and `v3` will be used by default\n- Displaying underlying RPC error instead of \"Unknown RPC error\" in edge cases\n\n#### Deprecated\n\n- `--fee-token` flag - `strk` will be used by default\n\n## [0.34.0] - 2024-11-26\n\n### Forge\n\n#### Added\n\n- `generate_random_felt()` for generating (pseudo) random felt value.\n- Printing information about compiling Sierra using `universal-sierra-compiler`\n- Displaying backtrace when contract call fails\n\n#### Changed\n\n- Tests config run is now executed in parallel resulting in faster `snforge test` setup in some cases\n\n### Cast\n\n#### Added\n\n- You can skip `--name` flag when using `account import` - a default name will be generated.\n- Addresses outputted when calling `sncast account create`, `sncast deploy` and `sncast declare` are now padded to 64 characters length and prefixed with `0x0`\n- Globally available configuration to store profiles to share between projects.\n\n#### Changed\n\n- Changed return type of `declare` in Cairo Deployment Scripts so it can handle already declared contracts without failing\n- Allow using `show-config` command without providing rpc url\n\n## [0.33.0] - 2024-11-04\n\n### Cast\n\n#### Added\n\n- You can now use numbers without quotes as inputs for calls in multicall config file.\n- New `--arguments` flag to `call`, `invoke` and `deploy` for automatic conversion of Cairo expressions instead of serialized form.\n\n### Forge\n\n#### Changed\n\n- You can now pass arguments to `cairo-profiler` and `cairo-coverage`. Everything after `--` will be passed to underlying binary. E.g.\n  `snforge test --build-profile -- --show-inlined-functions`\n- You can't use now `--coverage` and `--build-profile` flags at the same time. If you want to use both, you need to run\n  `snforge test` twice with different flags.\n- Contract artifacts are compiled to CASM concurrently.\n- Starknet artifacts are now loaded from all tests targets\n- Cairo Edition in `snforge init` template set to `2024_07`\n\n#### Fixed\n\n- Scarb features work with optimized compilation\n- Custom test targets are now supported with optimized compilation\n- Calling contract functions via safe-dispatcher now returns an `Err` when attempting to invoke a non-existent entry point, instead of causing a panic.\n\n## [0.32.0] - 2024-10-16\n\n### Cast\n\n#### Changed\n\n- Short option for `--accounts-file` flag has been removed.\n- Short option for `--contract-address` is now `-d` instead of `-a`.\n- `account add` is renamed to `account import`.\n- `account import` can be now used without specifying `--private-key` or `--private-key-file` flags. Instead private key will be read interactively from the user.\n\n#### Fixed\n- `account delete` command: It is no longer necessary to provide the `--url` argument each time. Either the `--url` or `--network` argument must be provided, but not both, as they are mutually exclusive.\n\n### Forge\n\n#### Changed\n\n- When using test name filter with `--exact` flag, forge will try to compile only the selected test.\n\n## [0.31.0] - 2024-09-26\n\n### Cast\n\n#### Changed\n\n- `declare` and `verify` commands now use the Scarb `release` profile instead of the `dev` profile as the default for building artifacts\n- StarkScan links now point to specific pages for transactions, contracts and classes.\n\n#### Fixed\n\n- Explorer links displayed upon committing transactions are now properly formatted\n- `sncast declare` no longer fails for flat contracts (i.e. CASM artifacts with `bytecode_segment_lengths` being a number)\n\n### Forge\n\n#### Added\n\n- Project generated by `snforge` contains `assert_macros` dependency with version 0.1.0 for Scarb <= 2.8.0, otherwise equal to Scarb\n- Support for overriding fork configuration in test attribute with a different block ID, tag, or hash.\n- `--no-optimization` flag that can be used to build contracts using the [starknet contract target](https://docs.swmansion.com/scarb/docs/extensions/starknet/contract-target.html#starknet-contract-target. This is the default behavior when using Scarb < 2.8.3\n\n#### Changed\n\n- For Scarb >= `2.8.3` contract artifacts are built as part of the test target now. This process speeds up the compilation time, but the behavior of the contracts potentially may not be 100% consistent with the real networks. It can be disabled using the [--no-optimization flag](https://foundry-rs.github.io/starknet-foundry/appendix/snforge/test.html#--no-optimization)\n- `snforge` now validates if your project is setup to generate debug info needed for `cairo-coverage` when running  `--coverage` flag\n\n### `snforge_scarb_plugin`\n\n#### Fixed\n\n- The package is now correctly versioned\n\n## [0.30.0] - 2024-09-04\n\n### Forge\n\n#### Added\n\n- Derived `Debug` and `Clone` on `trace.cairo` items\n- `--coverage` flag to the `test` command. Saves trace data and then generates coverage report of test cases which pass and are not fuzz tests. You need [cairo-coverage](https://github.com/software-mansion/cairo-coverage) installed on your system.\n\n#### Fixed\n\n- `latest` fork block id tag validation in `Scarb.toml` is now consistent\n- `RangeCheck96`,  `AddMod`, `MulMod` builtins are now properly supported\n- Fixed escaping `'` in `#[should_panic]`s\n- Fixed `scarb init` with snforge runner\n\n## [0.29.0] - 2024-08-28\n\n### Forge\n\n#### Added\n\n- Support for Scarb features in `snforge test` - flags the same as in Scarb. Read more [here](https://docs.swmansion.com/scarb/docs/reference/conditional-compilation.html#features)\n\n#### Fixed\n\n- `snforge init` no longer emits warnings\n- Project template generated by `snforge init` matches new `declare` cheatcode interface and compiles properly\n\n## [0.28.0] - 2024-08-21\n\n### Forge\n\n#### Changed\n\n- Bumped Cairo version to `2.7.0`\n- Max steps in tests (configured by argument `--max-n-steps`) now defaults to 10 million\nif not provided (changed from 4 million).\n\n### Cast\n\n#### Added\n- Commands that commit transactions now display links to block explorers. When in human-readable mode, `invoke`, `declare`, `deploy`, `multicall run`, `account create` and `account deploy` will display additional information with an url. A new key in Cast configuration - `block-explorer` determines which block explorer service the displayed link leads to. Possible options are:` StarkScan`, `Voyager`, `ViewBlock`, `OkLink`, `NftScan`.\n\n#### Changed\n- `account create` outputs hint about the type of the tokens required to prefund a newly created account with before deployment\n\n- `sncast` no longer expects `--url` as a common argument. It is now required specifically by commands that utilise it, i.e. `account add`, `account create`, `account delete`, `account deploy`, `multicall run`, `script run`, `call`, `declare`, `deploy`, `invoke`, `show-config`, `tx-status`.\nCommands that do not require `--url` anymore: `account list`, `multicall new`, `script init`, `verify`\n\n### Forge\n\n#### Changed\n- Fork tests now discover chain ID via provided RPC URL, defaulting to `SN_SEPOLIA`\n- `#[fork]` attribute parameters format. [Read more here](https://foundry-rs.github.io/starknet-foundry/snforge-advanced-features/fork-testing.html)\n- steps counting\n- Block tag changed name from `Latest`  to `latest`\n- `declare` cheatcode now returns `Result<DeclareResult, Array<felt252>>` [Read more here](https://foundry-rs.github.io/starknet-foundry/appendix/snforge-library/declare.html)\n\n## [0.27.0] - 2024-07-24\n\n### Forge\n\n#### Added\n\n- `spy_messages_to_l1()` for listening in on messages to L1 sent by your contracts. [Read more here](https://foundry-rs.github.io/starknet-foundry/testing/testing-messages-to-l1.html).\n\n#### Changed\n\n- Renamed global cheatcodes listed [here](https://foundry-rs.github.io/starknet-foundry/appendix/cheatcodes.html) - cheatcode invocations affecting the global scope and working indefinitely, already marked with a `_global` suffix, received a `start_` prefix\n\n### Cast\n\n#### Added\n\n- `verify` subcommand to verify contract (walnut APIs supported as of this version). [Read more here](https://foundry-rs.github.io/starknet-foundry/appendix/sncast/verify.html)\n- support for v3 transactions on account deploy, deploy, declare, invoke\n- Newest class hash for OpenZeppelin account contracts\n- `account list` subcommand for listing all available accounts [Read more here](https://foundry-rs.github.io/starknet-foundry/appendix/sncast/account/list.html)\n\n#### Changed\n\n- `multicall new` no longer prints generated template to stdout and now requires specifying output path. [Read more here](https://foundry-rs.github.io/starknet-foundry/appendix/sncast/multicall/new.html)\n\n## [0.26.0] - 2024-07-03\n\n### Forge\n\n#### Changed\n- Updated event testing - read more [here](./docs/src/testing/testing-events.md) on how it now works and [here](./docs/src/appendix/cheatcodes/spy_events.md)\nabout updated `spy_events` cheatcode\n\n## [0.25.0] - 2024-06-12\n\n### Forge\n\n#### Changed\n\n- `SyscallResultStringErrorTrait::map_error_to_string` removed in favor of utility function (`snforge_std::byte_array::try_deserialize_bytearray_error`)\n\n### Cast\n\n#### Removed\n- `--class-hash` flag from `account deploy` command\n\n#### Added\n\n- `tx-status` subcommand to get transaction status. [Read more here](./docs/src/starknet/tx-status.md)\n- `tx_status` function to cast_std. [Read more here](./docs/src/appendix/sncast-library/tx_status.md)\n- Support for creating argent accounts\n- Support for creating braavos accounts\n\n## [0.24.0] - 2024-05-22\n\n### Forge\n\n#### Removed\n\n- `prank`, `warp`, `roll`, `elect`, `spoof` cheatcodes in favour of `cheat_execution_info`\n\n#### Added\n\n- `cheat_execution_info` cheatcode and per variable helpers for it\n\n### Cast\n\n#### Added\n\n- New required flag `--type` to `account add` command\n\n### Forge\n\n#### Changed\n\n- `SignerTrait::sign` now returns `Result` instead of failing the test\n\n- `L1HandlerTrait::execute()` takes source address and payloads as arguments [Read more here](https://foundry-rs.github.io/starknet-foundry/appendix/cheatcodes/l1_handler.html)\n\n- When calling to an address which does not exists, error is forwarded to cairo runtime instead of failing the test\n\n## [0.23.0] - 2024-05-08\n\n### Forge\n\n#### Removed\n\n- `event_name_hash` removal, in favour of `selector!` usage\n\n#### Changed\n\n- the tool now always compiles Sierra contract artifacts to CASM using\n[`USC`](https://github.com/software-mansion/universal-sierra-compiler) - before it used to consume CASM artifacts\nproduced by Scarb if they were present. Setting up `casm = true` in `Scarb.toml` is no longer recommended - it may slow\ndown the compilation.\n- The `replace_bytecode` cheatcode now returns `Result` with a possible `ReplaceBytecodeError`, since it may cause unexpected errors down the line when not handled properly\n\n### Cast\n\n#### Changed\n\n- the tool now always compiles Sierra contract artifacts to CASM using\n[`USC`](https://github.com/software-mansion/universal-sierra-compiler) - before it used to consume CASM artifacts\nproduced by Scarb if they were present. Setting up `casm = true` in `Scarb.toml` is no longer recommended - it may slow\ndown the compilation.\n\n#### Fixed\n\n- scripts built with release profile are now properly recognized and ran\n\n## [0.22.0] - 2024-04-17\n\n### Forge\n\n#### Changed\n\n- `deploy` / `deploy_at` now additionally return the constructor return data via `SyscallResult<(ContractAddress, Span<felt252>)>`\n- `declare` returns `Result<ContractClass, Array<felt252>>` instead of `ContractClass`\n- `L1HandlerTrait::execute()` returns `SyscallResult<()>`\n- `SyscallResultStringErrorTrait::map_string_error` renamed to `SyscallResultStringErrorTrait::map_error_to_string`\n- `var` now supports `ByteArray` with double quoting, and returns `Array<felt252>` instead of a single `felt252`\n\n#### Removed\n- `snforge_std::RevertedTransaction`\n\n## [0.21.0] - 2024-04-03\n\n### Forge\n\n#### Changed\n\n- `read_txt` and `read_json` now supports `ByteArray`\n\n### Cast\n\n#### Added\n\n- sncast script idempotency feature - every action done by the script that alters the network state will be tracked in state file,\nand won't be replayed if previously succeeded\n\n## [0.20.1] - 2024-03-22\n\n## [0.20.0] - 2024-03-20\n\n### Forge\n\n#### Added\n\n- variants of cheatcodes with `CheatSpan` (read more [here](https://foundry-rs.github.io/starknet-foundry/testing/using-cheatcodes#setting-cheatcode-span))\n- Providing configuration data with env variables [DOCS](https://foundry-rs.github.io/starknet-foundry/projects/configuration.html#environmental-variables)\n\n#### Fixed\n\n- Events emitted in cairo 0 contracts are now properly collected\n- `--build-profile` no longer fails silently (compatible with [`cairo-profiler`](https://github.com/software-mansion/cairo-profiler) 0.2.0)\n\n#### Changed\n\n- Default `chain_id` has been changed from `SN_GOERLI` to `SN_SEPOLIA`\n- Supported RPC version is now 0.7.0\n- Gas calculation is in sync with starknet 0.13.1 (with EIP 4844 blob usage enabled)\n- Resources displayed (steps, builtins) now include OS costs of syscalls\n\n### Cast\n\n#### Added\n\n- Support for OpenZeppelin Cairo 1 (or higher) accounts creation, deployment and usage\n- Providing configuration data with env variables [DOCS](https://foundry-rs.github.io/starknet-foundry/projects/configuration.html#environmental-variables)\n\n#### Changed\n\n- Supported RPC version is now 0.7.0\n- Default class hash in `account create` and `account deploy` has been changed to [cairo2 class hash](https://starkscan.co/class/0x04c6d6cf894f8bc96bb9c525e6853e5483177841f7388f74a46cfda6f028c755)\n\n## [0.19.0] - 2024-03-06\n\n### Forge\n\n⚠️ This version requires installing external [universal-sierra-compiler (v2.0.0)](https://github.com/software-mansion/universal-sierra-compiler) ⚠️\n\n#### Added\n\n- [`replace_bytecode`](https://foundry-rs.github.io/starknet-foundry/appendix/cheatcodes/replace_bytecode.html) cheatcode\n- result of the call to the trace\n- added `--build-profile` flag to the `--test` command. Saves trace data and then builds profiles of test cases which pass and are not fuzz tests. You need [cairo-profiler](https://github.com/software-mansion/cairo-profiler) installed on your system.\n- dependency on the [universal-sierra-compiler](https://github.com/software-mansion/universal-sierra-compiler)\nbinary, which will allow forge to be independent of sierra version\n\n\n#### Changed\n\n- `var()`, `read_txt()`, `read_json()`, `FileTrait::new()`, `declare()` now use regular strings (`ByteArray`) instead of short strings (`felt252`)\n- `start_mock_call()`, `stop_mock_call()`, `L1Handler` now use selector (`selector!()`) instead of names\n\n### Cast\n\n#### Changed\n\n- `declare()` now uses regular strings (`ByteArray`) instead of short strings (`felt252`)\n- `call()` and `invoke()` now require function selector (`selector!()`) instead of function name in scripts (sncast_std)\n\n#### Removed\n\n- `--path-to-scarb-toml` optional flag that allowed to specify the path to the `Scarb.toml` file\n- `--deployed` flag from `account add` subcommand\n\n## [0.18.0] - 2024-02-21\n\n### Forge\n\n#### Added\n\n- contract names to call trace\n- `--max-n-steps` argument that allows setting own steps limit\n\n#### Changed\n\n- Unknown entry point error when calling a contract counts as a panic\n- Cairo edition set to `2023_11`\n\n#### Fixed\n\n- Calling Cairo 0 contract no longer cancels cheatcodes in further calls\n\n### Cast\n\n#### Added\n\n- `script init` command to generate a template file structure for deployment scripts\n- Warning is emitted when executing sncast commands if the node's JSON-RPC version is incompatible\n\n#### Changed\n\n- to run a deployment script it is required to use `script run` subcommand\n\n## [0.17.1] - 2024-02-12\n\n### Cast\n\n#### Changed\n\n- fixed a bug where a profile was passed to scarb even when it did not exist\n- error handling from inside deployment scripts is now possible (`declare`, `deploy`, `call`, `invoke` now return `Result<T, ScriptCommandError>`)\n\n### Forge\n\n#### Added\n\n- `map_string_error` for use with dispatchers, which automatically converts string errors from the syscall result (read more [here](https://foundry-rs.github.io/starknet-foundry/testing/contracts#handling-errors))\n\n## [0.17.0] - 2024-02-07\n\n### Forge\n\n#### Added\n\n- Warning in fork testing is emitted, when node JSON-RPC version is incompatible\n- `get_call_trace` library function for retrieving call trace in tests\n\n#### Changed\n\n- Gas estimation is now aligned with the Starknet v0.13\n\n#### Removed\n\n- `snforge_std::PrintTrait` - use `print!`, `println!` macros and / or `core::debug::PrintTrait` instead\n\n#### Fixed\n\n- Gas used in constructors and handling of L1 messages is now properly included in total gas cost\n\n### Cast\n\n#### Changed\n\n- sncast tool configuration is now moved away from `Scarb.toml` to `snfoundry.toml` file. This file must be present in current or any parent directories in order to use profiles.\n\n#### Added\n\n- `--package` flag for `declare` and `script` subcommands, that specifies scarb package to work with\n- `Debug` and `Display` impls for script subcommand responses - use `print!`, `println!` macros instead of calling `.print()`\n\n## [0.16.0] - 2024-01-26\n\n### Forge\n\n#### Added\n- Bump to cairo 2.5.0\n\n#### Changed\n\n- `SafeDispatcher`s usages need to be tagged with `#[feature(\"safe_dispatcher)]` (directly before usage), see [the shamans post](https://community.starknet.io/t/cairo-v2-5-0-is-out/112807#safe-dispatchers-15)\n\n## [0.15.0] - 2024-01-24\n\n### Forge\n\n#### Added\n\n- `--detailed-resources` flag for displaying additional info about used resources\n- `store` and `load` cheatcodes\n- `--save-trace-data` flag to `snforge test` command. Traces can be used for profiling purposes.\n\n#### Changed\n\n- `available_gas` attribute is now supported (Scarb >= 2.4.4 is required)\n\n#### Fixed\n\n- Error message for tests that should panic but pass\n\n### Cast\n\n#### Changed\n\n- the 'pending' block is used instead of 'latest' as the default when obtaining the nonce\n\n## [0.14.0] - 2024-01-11\n\n### Forge\n\n#### Added\n\n- `Secp256k1` and `Secp256r1` curves support for `KeyPair` in `snforge_std`\n\n#### Changed\n\n- maximum number of computational steps per call set to current Starknet limit (3M)\n- `mean` and `std deviation` fields are displayed for gas usage while running fuzzing tests\n- Cairo edition in `snforge_std` and `sncast_std` set to `2023_10`\n- `snforge_std::signature` module with `stark_curve`, `secp256k1_curve` and `secp256r1_curve` submodules\n\n#### Fixed\n\n- Safe library dispatchers in test code no longer propagate errors when not intended to\n\n## [0.13.1] - 2023-12-20\n\n### Forge\n\n#### Added\n\n- `assert_not_emitted` assert to check if an event was not emitted\n\n#### Changed\n\n- fields from `starknet::info::v2::TxInfo` are now part of `TxInfoMock` from `snforge_std::cheatcodes::tx_info`\n- consistent latest block numbers for each url are now used across the whole run when testing against forks\n\n#### Fixed\n\n- Parsing panic data from call contract result\n\n### Cast\n\n#### Added\n\n- add support for sepolia network\n- `--yes` option to `account delete` command that allows to skip confirmation prompt\n\n#### Changed\n\n- Argument `max-fee` in `account deploy` is now optional\n\n## [0.13.0] - 2023-12-14\n\n### Forge\n\n#### Changed\n\n- Bump cairo to 2.4.0.\n- Migrated test compilation and collection to Scarb, snforge should now be compatible with every Scarb version >= 2.4.0 unless breaking changes happen\n\n## [0.12.0] - 2023-12-06\n\n### Forge\n\n#### Added\n\n- print gas usage for each test\n- Support for test collector built-in in Scarb with the `--use-scarb-collector` flag. Requires at least `nightly-2023-12-04` version of Scarb.\n\n### Cast\n\n#### Added\n\n- `--wait-timeout` to set timeout for waiting for tx on network using `--wait` flag (default 60s)\n- `--wait-retry-interval` to adjust the time between consecutive attempts to fetch tx from network using `--wait` flag (default 5s)\n- allow setting nonce in declare, deploy and invoke (using `--nonce` and in deployment scripts)\n- add `get_nonce` function to cast_std\n- `--private-key-file` option to `account add` command that allows to provide a path to the file holding account private key\n\n## [0.11.0] - 2023-11-22\n\n### Forge\n\n#### Added\n\n- `elect` cheatcode for mocking the sequencer address. Read more [here](./docs/src/appendix/cheatcodes/sequencer_address/start_elect.md).\n- `--rerun-failed` option to run tests that failed during the last run.\n\n#### Changed\n- `start_warp` and `stop_warp` now take `CheatTarget` as the first argument instead of `ContractAddress`. Read more [here](./docs/src/appendix/cheatcodes/block_timestamp/start_warp.md).\n- `start_prank` and `stop_prank` now take `CheatTarget` as the first argument instead of `ContractAddress`. Read more [here](./docs/src/appendix/cheatcodes/caller_address/start_prank.md).\n- `start_roll` and `stop_roll` now take `CheatTarget` as the first argument instead of `ContractAddress`. Read more [here](./docs/src/appendix/cheatcodes/block_number/start_roll.md).\n\nPS: Credits to @bllu404 for the help with the new interfaces for cheats!\n\n#### Fixed\n\n- using unsupported `available_gas` attribute now fails the specific test case instead of the whole runner\n\n### Cast\n\n#### Added\n\n- MVP for cairo deployment scripts with declare, deploy, invoke and call\n\n## [0.10.2] - 2023-11-13\n\n### Forge\n\n#### Changed\n\n- Bump cairo to 2.3.1\n\n#### Removed\n\n- `available_gas` attribute, it didn't compute correctly gas usage. Contract functions execution cost would not be included.\n\n## [0.10.1] - 2023-11-09\n\n### Cast\n\n#### Fixed\n\n- scarb metadata in declare subcommand now takes manifest path from cli if passed instead of looking for it\n\n## [0.10.0] - 2023-11-08\n\n### Forge\n\n#### Removed\n\n- forking of the `Pending` block\n\n#### Added\n\n- `--color` option to control when colored output is used\n- when specifying `BlockId::Tag(Latest)` block number of the used block will be printed\n- printing number of ignored and filtered out tests\n\n#### Fixed\n\n- Segment Arena Builtin crashing with `CairoResourcesNotContainedInFeeCosts` when Felt252Dict was used\n\n### Cast\n\n#### Fixed\n\n- account commands now always return valid json when `--json` flag is passed\n- allow passing multiple calldata argument items without quotes\n- display correct error message when account file is invalid\n\n## [0.9.1] - 2023-10-30\n\n### Forge\n\n#### Fixed\n\n- diagnostic paths referring to `tests` folder\n- caching `get_class_hash_at` in forking test mode (credits to @jainkunal for catching the bug)\n\n## [0.9.0] - 2023-10-25\n\n### Forge\n\n#### Added\n\n- `#[ignore]` attribute together with `--ignored` and `include-ignored` flags - read more [here](https://foundry-rs.github.io/starknet-foundry/testing/testing.html#ignoring-some-tests-unless-specifically-requested)\n- support for `deploy_syscall` directly in the test code (alternative to `deploy`)\n- `snforge_std::signature` module for performing ecdsa signatures\n\n#### Changed\n\n- updated Cairo version to 2.3.0 - compatible Scarb version is 2.3.0:\n  - tests in `src` folder now have to be in a module annotated with `#[cfg(test)]`\n- `snforge_std::PrintTrait` will not convert values representing ASCII control characters to strings\n- separated `snforge` to subcommands: `snforge test`, `snforge init` and `snforge clean-cache`.\nRead more [here](https://foundry-rs.github.io/starknet-foundry/appendix/snforge.html).\n- `starknet::get_block_info` now returns correct block info in a forked block\n\n### Cast\n\n#### Added\n\n- `show-config` subcommand to display currently used configuration\n- `account delete` command for removing accounts from the accounts file\n- `--hex-format` flag has been added\n\n#### Removed\n\n- `-i` short for `--int-format` is removed, now have to use the full form `--int-format`\n\n## [0.8.3] - 2023-10-17\n\n### Forge\n\n#### Changed\n\n- Test from different crates are no longer run in parallel\n- Test outputs are printed in non-deterministic order\n\n#### Fixed\n\n- Test output are printed in real time again\n- Bug when application would not wait for tasks to terminate after execution was cancelled\n\n## [0.8.2] - 2023-10-12\n\n### Forge\n\n#### Fixed\n- incorrect caller address bug\n\n## [0.8.1] - 2023-10-12\n### Forge\n\n#### Fixed\n- significantly reduced ram usage\n\n## [0.8.0] - 2023-10-11\n\n### Forge\n\n#### Added\n\n- `#[fuzzer(...)]` attribute allowing to specify a fuzzer configuration for a single test case\n- Support for `u8`, `u16`, `u32`, `u64`, `u128`, `u256` types to fuzzer\n- `--clean-cache` flag\n- Changed interface of `L1Handler.execute` and `L1Handler` (dropped `fee` parameter, added result handling with `RevertedTransaction`)\n- Contract now has associated state, more about it [here](https://foundry-rs.github.io/starknet-foundry/testing/testing_contract_internals.html)\n- cheatcodes (`prank`, `roll`, `warp`) now work on forked Cairo 0 contracts\n\n#### Changed\n\n- Spying events interface is updated to enable the use of events defined inside contracts in assertions\n- Test are executed in parallel\n- Fixed inconsistent pointers bug https://github.com/foundry-rs/starknet-foundry/issues/659\n- Fixed an issue where `deploy_at` would not trigger the constructors https://github.com/foundry-rs/starknet-foundry/issues/805\n\n### Cast\n\n#### Changed\n\n- dropped official support for cairo 1 compiled contracts. While they still should be working without any problems,\nfrom now on the only officially supported cairo compiler version is 2\n\n## [0.7.1] - 2023-09-27\n\n### Forge\n\n#### Added\n\n- `var` library function for reading environmental variables\n\n#### Fixed\n- Using any concrete `block_id` when using forking mode, would lead to crashes\n\n## [0.7.0] - 2023-09-27\n\n### Forge\n\n#### Added\n\n- Support for scarb workspaces\n- Initial version of fuzz testing with randomly generated values\n- `#[fork(...)]` attribute allowing testing against a network fork\n\n#### Changed\n\n- Tests are collected only from a package tree (`src/lib.cairo` as an entrypoint) and `tests` folder:\n  - If there is a `lib.cairo` file in `tests` folder, then it is treated as an entrypoint to the `tests` package from which tests are collected\n  - Otherwise, all test files matching `tests/*.cairo` regex are treated as modules and added to a single virtual `lib.cairo`, which is treated as described above\n\n### Cast\n\n#### Added\n\n- `account add` command for importing accounts to the accounts file\n- `account create` command for creating openzeppelin accounts with starkli-style keystore\n- `account deploy` command for deploying openzeppelin accounts with starkli-style keystore\n\n### Changed\n\n- `--add-profile` no longer accepts `-a` for short\n- allow the `id` property in multicalls to be referenced in the inputs of `deploy` and `invoke` calls\n\n## [0.6.0] - 2023-09-13\n\n### Forge\n\n#### Added\n\n- `deploy_at` cheatcode\n- printing failures summary at the end of an execution\n- filtering tests now uses an absolute module tree path — it is possible to filter tests by module names, etc.\n\n#### Fixed\n\n- non-zero exit code is returned when any tests fail\n- mock_call works with dispatchers if contract does not exists\n\n### Cast\n\n#### Added\n\n- support for starkli-style accounts, allowing the use of existing accounts\n\n#### Changed\n\n- fixed misleading error message when there was no scarb in PATH and `--path-to-scarb-toml` was passed\n- modified `multicall new` command output, to be in line with other commands outputs\n\n## [0.5.0] - 2023-08-30\n\n### Forge\n\n#### Added\n\n- support for `keccak_syscall` syscall. It can be used directly in cairo tests\n- `l1_handler_execute` cheatcode\n- support for `roll`ing/`warp`ing/`prank`ing the constructor logic (precalculate address, prank, assert pranked state in constructor)\n- `spy_events` cheatcode\n- Functions `read_json` and `FileParser<T>::parse_json` to load data from json files and deserialize it\n\n#### Changed\n\n- rename `TxtParser` trait to `FileParser`\n- rename `parse_txt` trait to `read_txt`\n- support for printing in contracts\n- `spoof` cheatcode\n- snforge command-line flag `--init`\n\n### Cast\n\n#### Added\n\n- Support for custom networks - accounts created on custom networks are saved in `accounts-file` under network's\n  chain_id\n- `accounts-file` field in Scarb.toml profile\n- Include the class hash of an account contract in the `accounts-file`\n\n#### Removed\n\n- `--network` option together with the `network` field in Scarb.toml profile — previously used as a validation factor;\n  now networks are identified by their chain_id\n\n## [0.4.0] - 2023-08-17\n\n### Forge\n\n#### Added\n\n- `#[should_panic]` attribute support\n- Documentation to public methods\n- Information sections to documentation about importing `snforge_std`\n- Print support for basic numeric data types\n- Functions `parse_txt` and `TxtParser<T>::deserialize_txt` to load data from plain text files and serialize it\n- `get_class_hash` cheatcode\n- `mock_call` cheatcode\n- `precalculate_address` cheatcode\n\n#### Changed\n\n- Exported `snforge_std` as a Scarb package, now you have to import it explicitly with e.g. `use snforge_std::declare`\n  and add it as a dependency to your Scarb.toml\n\n```toml\n[dependencies]\n# ...\nsnforge_std = { git = \"https://github.com/foundry-rs/starknet-foundry\", tag = \"v0.4.0\" }\n```\n\n- Moved `ForgeConfigFromScarb` to `scarb.rs` and renamed to `ForgeConfig`\n- Made private:\n    - `print_collected_tests_count`\n    - `print_running_tests`\n    - `print_test_result`\n    - `print_test_summary`\n    - `TestCaseSummary::from_run_result`\n    - `TestCaseSummary::skipped`\n    - `extract_result_data`\n    - `StarknetArtifacts`\n    - `StarknetContractArtifactPaths`\n    - `StarknetContract`\n- Split `dependencies_for_package` into separate methods:\n    - `paths_for_package`\n    - `corelib_for_package`\n    - `target_name_for_package`\n    - `compilation_unit_for_package`\n\n- Fails test when user tries to use syscalls not supported by forge test runner\n- Updated cairo-lang to 2.1.0, starknet-api to 0.4.1 and blockifier to 0.2.0-rc0\n\n### Cast\n\n#### Added\n\n- Added `--class-hash` flag to account create/deploy, allowing for custom openzeppelin account contract class hash\n\n## [0.3.0] - 2023-08-02\n\n### Forge\n\n#### Added\n\n- `warp` cheatcode\n- `roll` cheatcode\n- `prank` cheatcode\n- Most unsafe libfuncs can now be used in contracts\n\n#### Changed\n\n- `declare` return type to `starknet::ClassHash`, doesn't return a `Result`\n- `PreparedContract` `class_hash` changed to `starknet::ClassHash`\n- `deploy` return type to `starknet::ContractAddress`\n\n#### Fixed\n\n- Using the same cairo file names as corelib files no longer fails test execution\n\n### Cast\n\n#### Added\n\n- multicall as a single transaction\n- account creation and deployment\n- `--wait` flag to wait for transaction to be accepted/rejected\n\n#### Changed\n\n- sierra and casm artifacts are now required in Scarb.toml for contract declaration\n- improved error messages\n\n## [0.1.1] - 2023-07-26\n\n### Forge & Cast\n\n#### Fixed\n\n- `class_hash`es calculation\n- Test collection\n\n## [0.1.0] - 2023-07-19\n\n### Forge & Cast\n\n#### Added\n\n- Initial release\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contribution Guideline\n\nStarknet Foundry is under active development and is open for contributions!\n\n## Opening an issue \n\nIf you think something doesn't work or something is missing please open an issue! This way we can address this problem\nand make Starknet Foundry better!\nBefore opening an issue, it is always a good idea to search existing \n[issues](https://github.com/foundry-rs/starknet-foundry/issues) and verify if a similar one doesn't already exist. \n\n\n## Contributing\n\n### Environment setup\n\nSee [development guide](https://foundry-rs.github.io/starknet-foundry/development/environment-setup.html) in Starknet\nFoundry book for environment setup.\n\n### Selecting an issue\nIf you are a first time contributor pick up any issue labeled as `good-first-issue`. Write a comment that you would like to \nwork on it and we will assign it to you. Need some guidance? Reach out to other developers on [Telegram](https://t.me/+d8ULaPxeRqlhMDNk).\n\nIf you are a more experienced Starknet Foundry contributor you can pick any issue labeled as `help-wanted`. Make sure to discuss the details with the core team beforehand.\n\n### Writing Tests\n\nPlease make sure the feature you are implementing is thoroughly tested with automatic tests.\nYou can check existing tests in the repository to see the recommended approach to testing.\n\n#### Snapshot tests\nSome tests use [`insta`](https://crates.io/crates/insta) snapshots files (`.snap`) to store expected test output, specifically for testing some of Starknet Foundry features with older Scarb versions.\nWhen adding such test case, please add a `snap_` prefix to its name to ensure it's tested on CI for all supported Scarb versions.\nTo make sure snapshot tests pass for all currently supported Scarb versions, run:\n```sh\n./scripts/check_snapshots.sh\n```\nIf some of the snapshot tests fail, run:\n```sh\n./scripts/check_snapshots.sh --fix\n```\nand review the newly generated snapshots.\n\n### Pull Request Size\n\nTry to make your pull request self-contained, only introducing the necessary changes.\nIf your feature is complicated,\nconsider splitting the changes into meaningful parts and introducing them as separate pull requests.\n\nCreating very large pull requests may significantly increase review time or even prevent them from being merged.\n\n### Contributions Related to Spelling and Grammar\n\nAt this time, we will not be accepting contributions that only fix spelling or grammar errors in documentation, code or\nelsewhere.\n\n### `sncast` Guidelines\n\n#### Command Outputs\n\nPlease follow these rules when creating outputs for `sncast`:\n\n- Use an imperative tone\n- Keep your message concise and to the point\n- When displaying config, use `key: value` format\n- If the executed command has a natural successor-command, display it as hint in the output. For example, the output of `declare` command should include a hint to use `deploy` command next.\n<!-- TODO(#2859): Add bullet point about colors used for text when displaying fees, addresses and hashes -->\n"
  },
  {
    "path": "Cargo.toml",
    "content": "[workspace]\nresolver = \"2\"\nmembers = [\n    \"crates/shared\",\n    \"crates/forge\",\n    \"crates/forge-runner\",\n    \"crates/sncast\",\n    \"crates/cheatnet\",\n    \"crates/conversions\",\n    \"crates/conversions/cairo-serde-macros\",\n    \"crates/data-transformer\",\n    \"crates/runtime\",\n    \"crates/scarb-api\",\n    \"crates/configuration\",\n    \"crates/universal-sierra-compiler-api\",\n    \"crates/docs\",\n    \"crates/debugging\",\n    \"crates/testing/packages_validation\",\n    \"crates/foundry-ui\",\n    \"crates/native-api\",\n]\n\nexclude = [\"crates/snforge-scarb-plugin\"]\n\n[profile.release]\ncodegen-units = 1\nlto = \"thin\"\n\n[profile.ci]\ninherits = \"dev\"\nincremental = false\n\n[workspace.package]\nversion = \"0.59.0\"\nedition = \"2024\"\nrepository = \"https://github.com/foundry-rs/starknet-foundry\"\nlicense = \"MIT\"\nlicense-file = \"LICENSE\"\n\n[workspace.dependencies]\nblockifier = { version = \"0.18.0-rc.1\", features = [\"testing\", \"tracing\", \"node_api\"] }\nstarknet_api = \"0.18.0-rc.1\"\nbigdecimal = \"0.4.10\"\ncairo-debugger = { git = \"https://github.com/software-mansion-labs/cairo-debugger\", rev = \"90fa679cd7572fedc5e17dadf15ec44a97b9ce11\" }\ncairo-native = \"0.9.0-rc.0\"\ncairo-lang-casm = { version = \"=2.17.0\", features = [\"serde\"] }\ncairo-lang-sierra = \"=2.17.0\"\ncairo-lang-utils = \"=2.17.0\"\ncairo-lang-starknet = \"=2.17.0\"\ncairo-lang-filesystem = \"=2.17.0\"\ncairo-lang-diagnostics = \"=2.17.0\"\ncairo-lang-syntax = \"=2.17.0\"\ncairo-lang-test-plugin = \"=2.17.0\"\ncairo-lang-starknet-classes = \"=2.17.0\"\ncairo-lang-parser = \"=2.17.0\"\ncairo-lang-sierra-to-casm = \"=2.17.0\"\ncairo-vm = { version = \"=3.2.0\", features = [\"test_utils\"] }\ncairo-annotations = { version = \"0.8.0\", features = [\"cairo-lang\"] }\ndirs = \"6.0.0\"\ndialoguer = \"0.12.0\"\nstarknet-types-core = { version = \"0.2.4\", features = [\"hash\", \"prime-bigint\"] }\nanyhow = \"1.0.100\"\nassert_fs = \"1.1.2\"\ncamino = { version = \"1.2.1\", features = [\"serde1\"] }\nclap = { version = \"4.5.57\", features = [\"derive\", \"deprecated\"] }\nclap_complete = \"4.5.65\"\nconsole = \"0.16.1\"\ninclude_dir = \"0.7.4\"\nindoc = \"2\"\nitertools = \"0.14.0\"\nindexmap = \"2.11.4\"\nnum-traits = \"0.2.19\"\nrayon = \"1.10\"\nregex = \"1.11.3\"\nserde = { version = \"1.0.219\", features = [\"derive\"] }\nserde_json = \"1.0.149\"\nstarknet-rust = \"0.19.0-rc.2\"\nstarknet-rust-crypto = \"0.9.0\"\ntempfile = \"3.24.0\"\nthiserror = \"2.0.17\"\nctor = \"0.6.2\"\nurl = { \"version\" = \"2.5.4\", \"features\" = [\"serde\"] }\ntokio = { version = \"1.50.0\", features = [\"full\"] }\nfutures = \"0.3.31\"\nnum-bigint = { version = \"0.4.6\", features = [\"rand\"] }\nwalkdir = \"2.5.0\"\nrand = \"0.8.5\"\nproject-root = \"0.2.2\"\nwhich = \"8.0.2\"\nconversions = { path = \"./crates/conversions\" }\nshared = { path = \"./crates/shared\" }\ndocs = { path = \"./crates/docs\" }\ntest-case = \"3.3.1\"\nscarb-metadata = \"1.14.0\"\nflatten-serde-json = \"0.1.0\"\nsnapbox = \"1.0.1\"\nscarb-ui = \"0.1.7\"\nsemver = \"1.0.27\"\nbimap = \"0.6.3\"\nprimitive-types = { version = \"0.14.0\", features = [\"serde\"] }\nshellexpand = \"3.1.0\"\ntoml = \"1.0.6\"\nrpassword = \"7.3.1\"\npromptly = \"0.3.1\"\nptree = \"0.5.2\"\nreqwest = { version = \"0.13.1\", features = [\"json\", \"rustls\"] }\nfs_extra = \"1.3.0\"\nopenssl = { version = \"0.10\", features = [\"vendored\"] }\ntoml_edit = \"0.25.4\"\naxum = \"0.8.8\"\nfs2 = \"0.4.3\"\nflate2 = \"1.1.0\"\nk256 = { version = \"0.13.4\", features = [\"sha256\", \"ecdsa\", \"serde\"] }\np256 = { version = \"0.13.2\", features = [\"sha256\", \"ecdsa\", \"serde\"] }\nglob = \"0.3.2\"\nsha3 = \"0.10.8\"\nsha2 = \"0.10.8\"\nbase16ct = { version = \"1.0.0\", features = [\"alloc\"] }\nasync-trait = \"0.1.87\"\nserde_path_to_error = \"0.1.20\"\nwiremock = \"0.6.3\"\ncoins-ledger = \"0.13.0\"\nspeculos-client = \"0.1.2\"\nconst-hex = \"1.18.1\"\nindicatif = \"0.18.3\"\nshell-words = \"1.1.0\"\nsanitize-filename = \"0.6.0\"\nderive_more = { version = \"2.1.1\", features = [\"display\"] }\npaste = \"1.0.15\"\nstrum = \"0.28\"\nstrum_macros = \"0.28\"\nscarb-oracle-hint-service = \"0.1.1\"\nchrono = \"0.4.42\"\ntracing-subscriber = { version = \"0.3.20\", features = [\"env-filter\"] }\ntracing = \"0.1.43\"\ntracing-chrome = \"0.7.2\"\ntracing-log = \"0.2.0\"\ncomfy-table = \"7\"\ncreate-output-dir = \"1.0.0\"\ninsta = { version = \"1.46.0\", features = [\"filters\"] }\nplotters = { version = \"0.3\", default-features = false, features = [\"all_series\", \"all_elements\", \"svg_backend\", \"bitmap_backend\", \"bitmap_encoder\", \"full_palette\", \"colormaps\", \"ab_glyph\"] }\nmimalloc = \"0.1\"\n"
  },
  {
    "path": "Cross.toml",
    "content": "# TODO(#3790) Setup cross for native\n#[build]\n#pre-build = [\n#    \"dpkg --add-architecture $CROSS_DEB_ARCH\",\n#    \"apt-get update\",\n#    \"apt-get install -y --no-install-recommends ca-certificates gnupg wget software-properties-common lsb-release\",\n#    \"apt-get install -y --no-install-recommends zlib1g-dev libzstd-dev zlib1g-dev:$CROSS_DEB_ARCH libzstd-dev:$CROSS_DEB_ARCH\",\n#    \"echo \\\"deb http://apt.llvm.org/focal/ llvm-toolchain-focal-19 main\\\" > /etc/apt/sources.list.d/llvm-toolchain-focal.list\",\n#    \"echo \\\"deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-19 main\\\" >> /etc/apt/sources.list.d/llvm-toolchain-focal.list\",\n#    \"wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -\",\n#    \"apt-get update\",\n#    \"apt-get install -y --no-install-recommends llvm-19 llvm-19-dev llvm-19-runtime clang-19 clang-tools-19 lld-19 libpolly-19-dev libmlir-19-dev mlir-19-tools\",\n#]\n#\n#[target.x86_64-unknown-linux-gnu.env]\n#passthrough = [\n#    \"MLIR_SYS_190_PREFIX=/usr/lib/llvm-19\",\n#    \"LLVM_SYS_191_PREFIX=/usr/lib/llvm-19\",\n#    \"TABLEGEN_190_PREFIX=/usr/lib/llvm-19\",\n#]\n"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2023 Software Mansion <swmansion.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "<img src=\"./docs/src/images/logo.png\" alt=\"logo\" width=\"120\" align=\"right\" />\n\n## Starknet Foundry\n\n[![Telegram Chat][tg-badge]][tg-url] [![Telegram Support][tg-support-badge]][tg-support-url]\n\n[tg-badge]: https://img.shields.io/endpoint?color=neon&logo=telegram&label=chat&style=flat-square&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fstarknet_foundry\n\n[tg-url]: https://t.me/starknet_foundry\n\n[tg-support-badge]: https://img.shields.io/endpoint?color=neon&logo=telegram&label=support&style=flat-square&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fstarknet_foundry_support\n\n[tg-support-url]: https://t.me/starknet_foundry_support\n\n\nBlazingly fast toolkit for developing Starknet contracts designed & developed by\nex [Protostar](https://github.com/software-mansion/protostar) team from [Software Mansion](https://swmansion.com) based\non native [Cairo](https://github.com/starkware-libs/cairo) test runner\nand [Blockifier](https://github.com/starkware-libs/sequencer/tree/main/crates/blockifier), written in Rust 🦀.\n\nNeed help getting started with Starknet Foundry? Read the\n📖 [Starknet Foundry Book](https://foundry-rs.github.io/starknet-foundry/)!\n\n![Example run](.github/images/demo.gif)\n\nStarknet Foundry, like its [Ethereum counterpart](https://github.com/foundry-rs/foundry), consists of different modules\n\n- [`snforge`](https://github.com/foundry-rs/starknet-foundry/tree/master/crates/forge): Starknet testing\n  framework (like Truffle, Hardhat and DappTools but for Starknet).\n- [`sncast`](https://github.com/foundry-rs/starknet-foundry/tree/master/crates/sncast): All-in-one tool for\n  interacting with Starknet smart contracts, sending transactions and getting chain data.\n\n## Installation\n\n[Follow the installation manual](https://foundry-rs.github.io/starknet-foundry/getting-started/installation.html)\n\n## Roadmap\n\nStarknet Foundry is under active development! Expect a lot of new features to appear soon! 🔥\n\n- [x] Running tests written in Cairo\n- [x] Contract interactions testing\n- [x] Interacting with Starknet from command line\n- [x] Multicall support\n- [x] Cheatcodes\n- [x] Starknet state forking\n- [x] Fuzz testing\n- [x] Parallel tests execution\n- [x] Performance improvements\n- [x] Deployment scripts written in Cairo\n- [ ] Transactions profiling 🏗️\n- [ ] Debugging utilities 🏗️\n- [ ] Test coverage reports (check out [cairo-coverage](https://github.com/software-mansion/cairo-coverage)) 🏗️\n- [ ] L1 ↔ L2 messaging and cross-chain testing\n\nSee the [whole roadmap](./ROADMAP.md). \n\n## Getting Help\n\nYou haven't found your answer to your question in\nthe [Starknet Foundry Book](https://foundry-rs.github.io/starknet-foundry/)?\n\n- Join the [Telegram](https://t.me/starknet_foundry_support) group to get help\n- Open a [GitHub discussion](https://github.com/foundry-rs/starknet-foundry/discussions) with your question\n- Join the [Starknet Discord](https://discord.com/invite/starknet-community)\n\nFound a bug? Open an [issue](https://github.com/foundry-rs/starknet-foundry/issues).\n\n## Contributions\n\nStarknet Foundry is under active development, and we appreciate any help from the community! Want to contribute? Read\nthe [contribution guidelines](./CONTRIBUTING.md).\n\nCheck out [development guide](https://foundry-rs.github.io/starknet-foundry/development/environment-setup.html) for\nlocal environment setup guide.\n"
  },
  {
    "path": "RELEASING.md",
    "content": "# Instruction For Creating New Starknet Foundry Releases\n\n1. Create a new branch.\n2. Run `./scripts/release.sh MAJOR.MINOR.PATCH`.\n3. Merge introduced changes to master branch.\n4. Wait for release workflows to pass. A new release will be created on GitHub.\n\n## Manually Creating a Release\n\nIn case a manual creation of release is necessary, for example when\ncherry-picking changes, a release can also be triggered by creating a tag\nwith the name format `vMAJOR.MINOR.PATCH`.\n\nNote that in this case `CHANGELOG.md`, `Cargo.toml` and `Cargo.lock` files\nhave to be updated accordingly.\n\n# Nightly releases\n\nNightly release must be triggered manually using the Nightly GitHub action.\nThis action builds binaries from specified ref and uploads them to the [starknet-foundry-nightlies](https://github.com/software-mansion-labs/starknet-foundry-nightlies) repository.\nAdditionally, there are `stds` and `plugin` versions uploaded to the [_dev_ registry](https://scarbs.dev/).\nAfter a successful release, [Ma'at](https://github.com/software-mansion/maat) is automatically triggered to run experiments in nightly workspace. Results can be found [here](https://docs.swmansion.com/maat/)\n\n### Maintenance\n\nSome access tokens require annual renewal due to expiration:\n- `SNFOUNDRY_NIGHTLIES_CONTENTS_WRITE` - grants permission to create releases in nightlies repository.\n- `MAAT_CONTENTS_READ_ACTIONS_WRITE` - required to trigger Ma'at run.\n"
  },
  {
    "path": "ROADMAP.md",
    "content": "# Roadmap\n\nTentative roadmap for Starknet Foundry. This document reflects the state of the roadmap at the time of writing.\nWe strive for our roadmap to reflect user needs and feedback, expect changes to this document.\n\n**All feedback and request welcome.**\n\n## Table of Contents\n\n<!-- TOC -->\n* [Roadmap](#roadmap)\n  * [Table of Contents](#table-of-contents)\n  * [Reference](#reference)\n  * [Forge](#forge)\n    * [🏗 Test Partitioning](#-test-partitioning)\n    * [🏗 Asserting Steps in Execution](#-asserting-steps-in-execution)\n    * [Reverting Storage Changes in Execution](#reverting-storage-changes-in-execution)\n    * [🏗 Sierra -> Casm Compilation](#-sierra---casm-compilation)\n    * [Performance Investigation](#performance-investigation)\n    * [Advanced Forking / Forking State Asserting](#advanced-forking--forking-state-asserting)\n    * [Derive Macro for `Fuzzable` Trait](#derive-macro-for-fuzzable-trait)\n    * [Typesafe Contract \"declare\"](#typesafe-contract-declare)\n    * [Research Variant and Differential Testing, Better Fuzzing Algorithms](#research-variant-and-differential-testing-better-fuzzing-algorithms)\n  * [Cast](#cast)\n    * [New Cast Scripts](#new-cast-scripts)\n    * [Transaction Dry Run](#transaction-dry-run)\n    * [CLI Revamp and Configuration Refactor](#cli-revamp-and-configuration-refactor)\n    * [Better Accounts Support](#better-accounts-support)\n    * [New Multicall Interface](#new-multicall-interface)\n    * [Contract Aliases in `snfoundry.toml`](#contract-aliases-in-snfoundrytoml)\n<!-- TOC -->\n\n## Reference\n\n* Item \"size\" is in the scale 1 to 5 and reflects its relative complexity compared to other items in the roadmap.\n* Items marked with 🏗️ are in progress.\n* Items marked with ✅ are done.\n\n## Forge\n\n### 🏗 Test Partitioning\n\n_Size: 3_\n\nhttps://github.com/foundry-rs/starknet-foundry/issues/3548\n\nPartitioning test suite into smaller test suites, to be run on separate machines in CI. Similar to `cargo nextest`.\n\n### 🏗 Asserting Steps in Execution\n\n_Size: 2_\n\nhttps://github.com/foundry-rs/starknet-foundry/issues/2671\n\nFeature for asserting the number of steps used in test execution.\n\n### Reverting Storage Changes in Execution\n\n_Size: 3_\n\nhttps://github.com/foundry-rs/starknet-foundry/issues/3837\n\nChange the test execution model to revert storage changes from top-level calls in case of recoverable failure.\n\n### 🏗 Sierra -> Casm Compilation\n\n_Size: 3_\n\nhttps://github.com/foundry-rs/starknet-foundry/issues/3832\n\nSierra -> Casm performance investigation and optimization (if viable).\n\n### Performance Investigation\n\n_Size: 3_\n\nhttps://github.com/foundry-rs/starknet-foundry/issues/3899\n\nInvestigate bottlenecks in standard test execution (workspace & package processing, config run, collecting configs, test\nexecution) using tracing harnesses. Performance report on eventual findings and measurements for future optimizations.\n\n### Advanced Forking / Forking State Asserting\n\n_Size: 5_\n\nNew test mechanism for detecting regressions in new contract versions (for upgrades on chain). Forking and asserting\nstate changes after executing a test scenario.\n\n### Derive Macro for `Fuzzable` Trait\n\n_Size: 2_\n\nhttps://github.com/foundry-rs/starknet-foundry/issues/2968\n\nAbility to automatically derive `Fuzzable` trait for structs if they contain only `Fuzzable` fields.\n\n### Typesafe Contract \"declare\"\n\n_Size: 4_\n\nhttps://github.com/foundry-rs/starknet-foundry/issues/1531\n\nDetect and fail on invalid contract names at compilation time.\n\n### Research Variant and Differential Testing, Better Fuzzing Algorithms\n\n_Size: 5_\n\nhttps://github.com/foundry-rs/starknet-foundry/issues/2464\n\nInspired by features from Ethereum's Foundry, research the viability of adding variant and differential testing and\nintegrating better\nfuzzing algorithms.\n\n## Cast\n\n### New Cast Scripts\n\n_Size: 5_\n\nhttps://github.com/foundry-rs/starknet-foundry/issues/3523\n\nNew Cast Scripts with focus on the ease of use, using Scarb plugins, integrated into snforge/scarb tests structure.\n\n### Transaction Dry Run\n\n_Size: 1_\n\nhttps://github.com/foundry-rs/starknet-foundry/issues/2136\n\nRunning `sncast` transaction without executing them through the fee estimation endpoint.\n\n### CLI Revamp and Configuration Refactor\n\n_Size: 4_\n\nRemoving non-common arguments that are used as common (e.g. `-account`). Internal changes to how `sncast` loads and\ncombines configuration.\n\n### Better Accounts Support\n\n_Size: 4_\n\nSupport for Ledger wallet, keystore support with encryption, account storage rework.\n\n### New Multicall Interface\n\n_Size: 3_\n\nhttps://github.com/foundry-rs/starknet-foundry/issues/3810\n\nNative multicall support for invoking transactions in `sncast invoke` or a better dedicated command. Removal of\nmulticall files.\n\n### Contract Aliases in `snfoundry.toml`\n\n_Size: 1_\n\nhttps://github.com/foundry-rs/starknet-foundry/issues/2240\n\nAliases for contracts in `snfoundry.toml` that can be used in commands instead of contract addresses.\n"
  },
  {
    "path": "_typos.toml",
    "content": "[default.extend-words]\nba = \"ba\"\n\n[files]\nextend-exclude = [\"docs/theme/head.hbs\"]\n"
  },
  {
    "path": "crates/cheatnet/Cargo.toml",
    "content": "[package]\nname = \"cheatnet\"\nversion.workspace = true\nedition.workspace = true\n\n[features]\ntesting = []\ncairo-native = [\"dep:cairo-native\", \"blockifier/cairo_native\"]\n\n[dependencies]\nanyhow.workspace = true\nblockifier.workspace = true\nbimap.workspace = true\ncamino.workspace = true\nstarknet_api.workspace = true\nstarknet-types-core.workspace = true\ncairo-lang-casm.workspace = true\ncairo-lang-utils.workspace = true\ncairo-lang-starknet-classes.workspace = true\ncairo-vm.workspace = true\ncairo-annotations.workspace = true\nregex.workspace = true\nindoc.workspace = true\nindexmap.workspace = true\nstarknet-rust.workspace = true\nthiserror.workspace = true\nserde_json.workspace = true\nserde.workspace = true\nflatten-serde-json.workspace = true\nnum-traits.workspace = true\nurl.workspace = true\nrayon.workspace = true\ntokio.workspace = true\nnum-bigint.workspace = true\nconversions.workspace = true\nfs2.workspace = true\nflate2.workspace = true\ndata-transformer = { path = \"../data-transformer\" }\nscarb-api = { path = \"../scarb-api\" }\nruntime = { path = \"../runtime\" }\nuniversal-sierra-compiler-api = { path = \"../universal-sierra-compiler-api\" }\nk256.workspace = true\np256.workspace = true\nshared.workspace = true\nrand.workspace = true\nfoundry-ui = { path = \"../foundry-ui\" }\nscarb-oracle-hint-service.workspace = true\ncairo-native = { workspace = true, optional = true }\n\n[dev-dependencies]\nctor.workspace = true\nindoc.workspace = true\nrayon.workspace = true\nglob.workspace = true\ntest-case.workspace = true\ntempfile.workspace = true\n"
  },
  {
    "path": "crates/cheatnet/src/constants.rs",
    "content": "use starknet_api::contract_class::{ContractClass, SierraVersion};\nuse std::collections::HashMap;\nuse std::sync::Arc;\n\nuse blockifier::execution::entry_point::{CallType, ExecutableCallEntryPoint};\nuse cairo_lang_starknet_classes::casm_contract_class::CasmContractClass;\nuse cairo_lang_starknet_classes::compiler_version::current_sierra_version_id;\nuse conversions::IntoConv;\nuse conversions::string::TryFromHexStr;\nuse indoc::indoc;\nuse runtime::starknet::constants::{\n    TEST_ADDRESS, TEST_CONTRACT_CLASS_HASH, TEST_ENTRY_POINT_SELECTOR,\n};\nuse runtime::starknet::context::ERC20_CONTRACT_ADDRESS;\nuse runtime::starknet::state::DictStateReader;\nuse starknet_api::contract_class::EntryPointType;\nuse starknet_api::core::ClassHash;\nuse starknet_api::{core::ContractAddress, transaction::fields::Calldata};\nuse starknet_rust::core::utils::get_selector_from_name;\n\n// Mocked class hashes, those are not checked anywhere\npub const TEST_ERC20_CONTRACT_CLASS_HASH: &str = \"0x1010\";\n\nfn contract_class_no_entrypoints() -> ContractClass {\n    let raw_contract_class = indoc!(\n        r#\"{\n          \"prime\": \"0x800000000000011000000000000000000000000000000000000000000000001\",\n          \"compiler_version\": \"2.4.0\",\n          \"bytecode\": [],\n          \"hints\": [],\n          \"entry_points_by_type\": {\n            \"EXTERNAL\": [],\n            \"L1_HANDLER\": [],\n            \"CONSTRUCTOR\": []\n          }\n        }\"#,\n    );\n    let casm_contract_class: CasmContractClass = serde_json::from_str(raw_contract_class)\n        .expect(\"`raw_contract_class` should be valid casm contract class\");\n\n    ContractClass::V1((casm_contract_class, SierraVersion::default()))\n}\n\n#[must_use]\npub fn contract_class(raw_casm: &str, sierra_version: SierraVersion) -> ContractClass {\n    let casm_contract_class: CasmContractClass =\n        serde_json::from_str(raw_casm).expect(\"`raw_casm` should be valid casm contract class\");\n\n    ContractClass::V1((casm_contract_class, sierra_version))\n}\n\n// Creates a state with predeployed account and erc20 used to send transactions during tests.\n// Deployed contracts are cairo 0 contracts\n// Account does not include validations\n#[must_use]\npub fn build_testing_state() -> DictStateReader {\n    let test_erc20_class_hash =\n        TryFromHexStr::try_from_hex_str(TEST_ERC20_CONTRACT_CLASS_HASH).unwrap();\n    let test_contract_class_hash =\n        TryFromHexStr::try_from_hex_str(TEST_CONTRACT_CLASS_HASH).unwrap();\n\n    let class_hash_to_class = HashMap::from([\n        // This is dummy put here only to satisfy blockifier\n        // this class is not used and the test contract cannot be called\n        (test_contract_class_hash, contract_class_no_entrypoints()),\n    ]);\n\n    let test_erc20_address = TryFromHexStr::try_from_hex_str(ERC20_CONTRACT_ADDRESS).unwrap();\n    let test_address = TryFromHexStr::try_from_hex_str(TEST_ADDRESS).unwrap();\n    let address_to_class_hash = HashMap::from([\n        (test_erc20_address, test_erc20_class_hash),\n        (test_address, test_contract_class_hash),\n    ]);\n\n    DictStateReader {\n        address_to_class_hash,\n        class_hash_to_class,\n        ..Default::default()\n    }\n}\n\n#[must_use]\npub fn build_test_entry_point() -> ExecutableCallEntryPoint {\n    let test_selector = get_selector_from_name(TEST_ENTRY_POINT_SELECTOR).unwrap();\n    let entry_point_selector = test_selector.into_();\n    ExecutableCallEntryPoint {\n        class_hash: ClassHash(TryFromHexStr::try_from_hex_str(TEST_CONTRACT_CLASS_HASH).unwrap()),\n        code_address: Some(TryFromHexStr::try_from_hex_str(TEST_ADDRESS).unwrap()),\n        entry_point_type: EntryPointType::External,\n        entry_point_selector,\n        calldata: Calldata(Arc::new(vec![])),\n        storage_address: TryFromHexStr::try_from_hex_str(TEST_ADDRESS).unwrap(),\n        caller_address: ContractAddress::default(),\n        call_type: CallType::Call,\n        initial_gas: i64::MAX as u64,\n    }\n}\n\n#[must_use]\npub fn get_current_sierra_version() -> SierraVersion {\n    let version_id = current_sierra_version_id();\n    SierraVersion::new(\n        version_id.major as u64,\n        version_id.minor as u64,\n        version_id.patch as u64,\n    )\n}\n"
  },
  {
    "path": "crates/cheatnet/src/data/eth_erc20_casm.json",
    "content": "{\"bytecode\":[\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x136\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x5e6\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x106\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0xf1\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xbd\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xa1\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x7f\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x63\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x4d55\",\"0x482480017fff8000\",\"0x4d54\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x2503a\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x25\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x48127fd27fff8000\",\"0x48127fe07fff8000\",\"0x48127fea7fff8000\",\"0x1104800180018000\",\"0x23fb\",\"0x20680017fff7ffd\",\"0xd\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x64\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x1ae\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x7f8\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x834\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xe7e\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x119e\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x16bc\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x136\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x5e6\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x106\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0xf1\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xbd\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xa1\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x7f\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x63\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x4c09\",\"0x482480017fff8000\",\"0x4c08\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x2503a\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x25\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x48127fd27fff8000\",\"0x48127fe07fff8000\",\"0x48127fea7fff8000\",\"0x1104800180018000\",\"0x2356\",\"0x20680017fff7ffd\",\"0xd\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x64\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x1ae\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x7f8\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x834\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xe7e\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x119e\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x16bc\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x136\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x5e6\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x106\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0xf1\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xbd\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xa1\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x7f\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x63\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x4abd\",\"0x482480017fff8000\",\"0x4abc\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x2503a\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x25\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x48127fd27fff8000\",\"0x48127fe07fff8000\",\"0x48127fea7fff8000\",\"0x1104800180018000\",\"0x2163\",\"0x20680017fff7ffd\",\"0xd\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x64\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x1ae\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x7f8\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x834\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xe7e\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x119e\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x16bc\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x136\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x5e6\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x106\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0xf1\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xbd\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xa1\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x7f\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x63\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x4971\",\"0x482480017fff8000\",\"0x4970\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x2503a\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x25\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x48127fd27fff8000\",\"0x48127fe07fff8000\",\"0x48127fea7fff8000\",\"0x1104800180018000\",\"0x20be\",\"0x20680017fff7ffd\",\"0xd\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x64\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x1ae\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x7f8\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x834\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xe7e\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x119e\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x16bc\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x95\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x1bf8\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x48127ffb7fff8000\",\"0x482480017ffb8000\",\"0x492\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x48bd\",\"0x482480017fff8000\",\"0x48bc\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0xa0680017fff8000\",\"0x9\",\"0x4824800180007ffd\",\"0x3336\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff57fff\",\"0x10780017fff7fff\",\"0x5c\",\"0x4824800180007ffd\",\"0x3336\",\"0x400080007ff67fff\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x3fc801c47df4de8d5835f8bfd4d0b8823ba63e5a3f278086901402d680abfc\",\"0x482480017ff38000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffb\",\"0x400280027ffb7ffc\",\"0x400280037ffb7ffd\",\"0x480280057ffb8000\",\"0x20680017fff7fff\",\"0x39\",\"0x480280047ffb8000\",\"0x480280067ffb8000\",\"0x482680017ffb8000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x12\",\"0x4824800180007ffc\",\"0x10000000000000000\",\"0x4844800180008002\",\"0x8000000000000110000000000000000\",\"0x4830800080017ffe\",\"0x480080007ff57fff\",\"0x482480017ffe8000\",\"0xefffffffffffffdeffffffffffffffff\",\"0x480080017ff37fff\",\"0x400080027ff27ffb\",\"0x402480017fff7ffb\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7fff\",\"0x16\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x482480017ffc8000\",\"0xffffffffffffffff0000000000000000\",\"0x400080017ff77fff\",\"0x40780017fff7fff\",\"0x1\",\"0x400080007fff7ffa\",\"0x482480017ff68000\",\"0x2\",\"0x482480017ffb8000\",\"0x55a\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7265553634202d206e6f6e20753634\",\"0x400080007ffe7fff\",\"0x482480017ff08000\",\"0x3\",\"0x48127ff57fff8000\",\"0x48127ff37fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0xa\",\"0x480280047ffb8000\",\"0x48127ffc7fff8000\",\"0x482480017ffe8000\",\"0x776\",\"0x482680017ffb8000\",\"0x8\",\"0x480280067ffb8000\",\"0x480280077ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x21b6\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0xffffffffffffffffffffffffffffdc06\",\"0x400280007ff87fff\",\"0x10780017fff7fff\",\"0x91\",\"0x4825800180007ffa\",\"0x23fa\",\"0x400280007ff87fff\",\"0x482680017ff88000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x1104800180018000\",\"0x2038\",\"0x48127f8e7fff8000\",\"0x20680017fff7ff5\",\"0x7a\",\"0x48127fff7fff8000\",\"0x20680017fff7ff7\",\"0x66\",\"0x48127fff7fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x13\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x48127fee7fff8000\",\"0x480a7ff97fff8000\",\"0x482480017ff98000\",\"0x55a\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x4808\",\"0x482480017fff8000\",\"0x4807\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x6630\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffb\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007fe77fff\",\"0x10780017fff7fff\",\"0x2d\",\"0x48307ffe80007ffb\",\"0x400080007fe87fff\",\"0x482480017fe88000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff77fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffb7fff8000\",\"0x48127fe87fff8000\",\"0x48127fe87fff8000\",\"0x48127fe87fff8000\",\"0x48127fe87fff8000\",\"0x48127fe87fff8000\",\"0x48127fe87fff8000\",\"0x1104800180018000\",\"0x20bb\",\"0x20680017fff7ffd\",\"0x10\",\"0x40780017fff7fff\",\"0x1\",\"0x400080007fff7ffe\",\"0x48127ff97fff8000\",\"0x48127ff67fff8000\",\"0x48127ff87fff8000\",\"0x48127ff57fff8000\",\"0x48127ff77fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff97fff8000\",\"0x482480017ff68000\",\"0xc8\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x482480017fe48000\",\"0x1\",\"0x480a7ff97fff8000\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x48127ff07fff8000\",\"0x480a7ff97fff8000\",\"0x482480017ffa8000\",\"0x686\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480a7ff77fff8000\",\"0x48127ff37fff8000\",\"0x480a7ff97fff8000\",\"0x482480017ffc8000\",\"0x87a\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x482680017ff88000\",\"0x1\",\"0x480a7ff97fff8000\",\"0x482680017ffa8000\",\"0x20ee\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0xffffffffffffffffffffffffffffdba2\",\"0x400280007ff87fff\",\"0x10780017fff7fff\",\"0x91\",\"0x4825800180007ffa\",\"0x245e\",\"0x400280007ff87fff\",\"0x482680017ff88000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x1104800180018000\",\"0x1f90\",\"0x48127f8e7fff8000\",\"0x20680017fff7ff5\",\"0x7a\",\"0x48127fff7fff8000\",\"0x20680017fff7ff7\",\"0x66\",\"0x48127fff7fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x13\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x48127fee7fff8000\",\"0x480a7ff97fff8000\",\"0x482480017ff98000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x4760\",\"0x482480017fff8000\",\"0x475f\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x1e1a4\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007fe67fff\",\"0x10780017fff7fff\",\"0x2b\",\"0x48307ffe80007ffa\",\"0x400080007fe77fff\",\"0x482480017fe78000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff77fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffb7fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x1104800180018000\",\"0x20d3\",\"0x20680017fff7ffd\",\"0xe\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff67fff8000\",\"0x48127ff87fff8000\",\"0x48127ff57fff8000\",\"0x48127ff77fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff97fff8000\",\"0x482480017ff68000\",\"0x64\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x482480017fe38000\",\"0x1\",\"0x480a7ff97fff8000\",\"0x48127ff37fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x48127ff07fff8000\",\"0x480a7ff97fff8000\",\"0x482480017ffa8000\",\"0x6ea\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480a7ff77fff8000\",\"0x48127ff37fff8000\",\"0x480a7ff97fff8000\",\"0x482480017ffc8000\",\"0x8de\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x482680017ff88000\",\"0x1\",\"0x480a7ff97fff8000\",\"0x482680017ffa8000\",\"0x20ee\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0xffffffffffffffffffffffffffffdba2\",\"0x400280007ff87fff\",\"0x10780017fff7fff\",\"0x91\",\"0x4825800180007ffa\",\"0x245e\",\"0x400280007ff87fff\",\"0x482680017ff88000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x1104800180018000\",\"0x1ee8\",\"0x48127f8e7fff8000\",\"0x20680017fff7ff5\",\"0x7a\",\"0x48127fff7fff8000\",\"0x20680017fff7ff7\",\"0x66\",\"0x48127fff7fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x13\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x48127fee7fff8000\",\"0x480a7ff97fff8000\",\"0x482480017ff98000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x46b8\",\"0x482480017fff8000\",\"0x46b7\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x5\",\"0x482480017fff8000\",\"0x1ea28\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007fe67fff\",\"0x10780017fff7fff\",\"0x2b\",\"0x48307ffe80007ffa\",\"0x400080007fe77fff\",\"0x482480017fe78000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff77fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffb7fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x1104800180018000\",\"0x21a6\",\"0x20680017fff7ffd\",\"0xe\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff67fff8000\",\"0x48127ff87fff8000\",\"0x48127ff57fff8000\",\"0x48127ff77fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff97fff8000\",\"0x482480017ff68000\",\"0x64\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x482480017fe38000\",\"0x1\",\"0x480a7ff97fff8000\",\"0x48127ff37fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x48127ff07fff8000\",\"0x480a7ff97fff8000\",\"0x482480017ffa8000\",\"0x6ea\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480a7ff77fff8000\",\"0x48127ff37fff8000\",\"0x480a7ff97fff8000\",\"0x482480017ffc8000\",\"0x8de\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x482680017ff88000\",\"0x1\",\"0x480a7ff97fff8000\",\"0x482680017ffa8000\",\"0x20ee\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0xffffffffffffffffffffffffffffdba2\",\"0x400280007ff87fff\",\"0x10780017fff7fff\",\"0x91\",\"0x4825800180007ffa\",\"0x245e\",\"0x400280007ff87fff\",\"0x482680017ff88000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x1104800180018000\",\"0x1e40\",\"0x48127f8e7fff8000\",\"0x20680017fff7ff5\",\"0x7a\",\"0x48127fff7fff8000\",\"0x20680017fff7ff7\",\"0x66\",\"0x48127fff7fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x13\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x48127fee7fff8000\",\"0x480a7ff97fff8000\",\"0x482480017ff98000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x4610\",\"0x482480017fff8000\",\"0x460f\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x6\",\"0x482480017fff8000\",\"0x391e8\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007fe67fff\",\"0x10780017fff7fff\",\"0x2b\",\"0x48307ffe80007ffa\",\"0x400080007fe77fff\",\"0x482480017fe78000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff77fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffb7fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x1104800180018000\",\"0x21e1\",\"0x20680017fff7ffd\",\"0xe\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff67fff8000\",\"0x48127ff87fff8000\",\"0x48127ff57fff8000\",\"0x48127ff77fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff97fff8000\",\"0x482480017ff68000\",\"0x64\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x482480017fe38000\",\"0x1\",\"0x480a7ff97fff8000\",\"0x48127ff37fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x48127ff07fff8000\",\"0x480a7ff97fff8000\",\"0x482480017ffa8000\",\"0x6ea\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480a7ff77fff8000\",\"0x48127ff37fff8000\",\"0x480a7ff97fff8000\",\"0x482480017ffc8000\",\"0x8de\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x482680017ff88000\",\"0x1\",\"0x480a7ff97fff8000\",\"0x482680017ffa8000\",\"0x20ee\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x112\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0xfd2\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xf6\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x48127ffc7fff8000\",\"0x480280007ffc8000\",\"0x48307ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffd7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480080007ff78000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffd7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xc8\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007fee7ffc\",\"0x480080017fed7ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027fec7ffd\",\"0x10780017fff7fff\",\"0xb3\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007fef7ffd\",\"0x480080017fee7ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027fed7ffe\",\"0x482480017fed8000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x4537\",\"0x482480017fff8000\",\"0x4536\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x371e\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x70\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x480680017fff8000\",\"0x52c476292b358ba7d29adb58502341b4cc5437d07f67d3e285e085828bc820\",\"0x400280007ff87fff\",\"0x400280017ff87fe5\",\"0x480280027ff88000\",\"0x400280037ff87fff\",\"0x400280047ff87fea\",\"0x480280057ff88000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080017fec7ffc\",\"0x480080027feb7ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080037fe97ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080017fec7ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080027fea7ffd\",\"0x400080037fe97ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff88000\",\"0x6\",\"0x482480017fe68000\",\"0x4\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffb\",\"0x400280027ffb7ffc\",\"0x400280037ffb7ffa\",\"0x480280057ffb8000\",\"0x20680017fff7fff\",\"0x2d\",\"0x480280047ffb8000\",\"0x480280067ffb8000\",\"0x482680017ffb8000\",\"0x7\",\"0x48127ffd7fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x0\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x1\",\"0x48307ffd80007fff\",\"0x20680017fff7fff\",\"0x7\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017ffb8000\",\"0x64\",\"0x480680017fff8000\",\"0x1\",\"0x400080007ffb7fff\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x48127ffc7fff8000\",\"0x48127ff47fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff67fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480280047ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffd8000\",\"0x5dc\",\"0x482680017ffb8000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ffb8000\",\"0x480280077ffb8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017fec8000\",\"0x3\",\"0x482480017ff88000\",\"0x55a\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff37fff8000\",\"0x482480017ffa8000\",\"0xa78\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0xff0\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0xa9\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x1874\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x8d\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x48127ffc7fff8000\",\"0x480280007ffc8000\",\"0x48307ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ff57fff8000\",\"0x482480017ff98000\",\"0x55a\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x4440\",\"0x482480017fff8000\",\"0x443f\",\"0x48127ffa7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x3142\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffb\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007fee7fff\",\"0x10780017fff7fff\",\"0x52\",\"0x48307ffe80007ffb\",\"0x400080007fef7fff\",\"0x480680017fff8000\",\"0x2e9f66c6eea14532c94ad25405a4fcb32faa4969559c128d837caa0ec50a655\",\"0x400280007ff87fff\",\"0x400280017ff87ff4\",\"0x480280027ff88000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080017fe97ffc\",\"0x480080027fe87ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080037fe67ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080017fe97ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080027fe77ffd\",\"0x400080037fe67ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff67fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff88000\",\"0x3\",\"0x482480017fe38000\",\"0x4\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffb\",\"0x400280027ffb7ffc\",\"0x400280037ffb7ffa\",\"0x480280057ffb8000\",\"0x20680017fff7fff\",\"0x12\",\"0x480280047ffb8000\",\"0x40780017fff7fff\",\"0x1\",\"0x480280067ffb8000\",\"0x400080007ffe7fff\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ffb7fff8000\",\"0x482680017ffb8000\",\"0x7\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480280047ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffd8000\",\"0x12c\",\"0x482680017ffb8000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ffb8000\",\"0x480280077ffb8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017feb8000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x74e\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0xfa\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x122a\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xca\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0xb5\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x435a\",\"0x482480017fff8000\",\"0x4359\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x3782\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x72\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x480680017fff8000\",\"0x52c476292b358ba7d29adb58502341b4cc5437d07f67d3e285e085828bc820\",\"0x480680017fff8000\",\"0x3711c9d994faf6055172091cb841fd4831aa743e6f3315163b06a122c841846\",\"0x400280007ff87ffe\",\"0x400280017ff87fff\",\"0x480280027ff88000\",\"0x400280037ff87fff\",\"0x400280047ff87fe9\",\"0x480280057ff88000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080017feb7ffc\",\"0x480080027fea7ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080037fe87ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080017feb7ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080027fe97ffd\",\"0x400080037fe87ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff47fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff88000\",\"0x6\",\"0x482480017fe58000\",\"0x4\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffb\",\"0x400280027ffb7ffc\",\"0x400280037ffb7ffa\",\"0x480280057ffb8000\",\"0x20680017fff7fff\",\"0x2d\",\"0x480280047ffb8000\",\"0x480280067ffb8000\",\"0x482680017ffb8000\",\"0x7\",\"0x48127ffd7fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x0\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x1\",\"0x48307ffd80007fff\",\"0x20680017fff7fff\",\"0x7\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017ffb8000\",\"0x64\",\"0x480680017fff8000\",\"0x1\",\"0x400080007ffb7fff\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x48127ffc7fff8000\",\"0x48127ff47fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff67fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480280047ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffd8000\",\"0x5dc\",\"0x482680017ffb8000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ffb8000\",\"0x480280077ffb8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x55a\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xa78\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0xfa\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x122a\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xca\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0xb5\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x424a\",\"0x482480017fff8000\",\"0x4249\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x3782\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x72\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x480680017fff8000\",\"0x52c476292b358ba7d29adb58502341b4cc5437d07f67d3e285e085828bc820\",\"0x480680017fff8000\",\"0x251e864ca2a080f55bce5da2452e8cfcafdbc951a3e7fff5023d558452ec228\",\"0x400280007ff87ffe\",\"0x400280017ff87fff\",\"0x480280027ff88000\",\"0x400280037ff87fff\",\"0x400280047ff87fe9\",\"0x480280057ff88000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080017feb7ffc\",\"0x480080027fea7ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080037fe87ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080017feb7ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080027fe97ffd\",\"0x400080037fe87ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff47fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff88000\",\"0x6\",\"0x482480017fe58000\",\"0x4\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffb\",\"0x400280027ffb7ffc\",\"0x400280037ffb7ffa\",\"0x480280057ffb8000\",\"0x20680017fff7fff\",\"0x2d\",\"0x480280047ffb8000\",\"0x480280067ffb8000\",\"0x482680017ffb8000\",\"0x7\",\"0x48127ffd7fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x0\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x1\",\"0x48307ffd80007fff\",\"0x20680017fff7fff\",\"0x7\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017ffb8000\",\"0x64\",\"0x480680017fff8000\",\"0x1\",\"0x400080007ffb7fff\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x48127ffc7fff8000\",\"0x48127ff47fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff67fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480280047ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffd8000\",\"0x5dc\",\"0x482680017ffb8000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ffb8000\",\"0x480280077ffb8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x55a\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xa78\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0xdf\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x122a\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xaf\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x9a\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x413a\",\"0x482480017fff8000\",\"0x4139\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x9\",\"0x482480017fff8000\",\"0x2413a\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x57\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x48127fff7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffd\",\"0x480280037ffb8000\",\"0x20680017fff7fff\",\"0x30\",\"0x480280027ffb8000\",\"0x480280047ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffd7fff8000\",\"0x480a7ff87fff8000\",\"0x482680017ffb8000\",\"0x5\",\"0x480680017fff8000\",\"0x3711c9d994faf6055172091cb841fd4831aa743e6f3315163b06a122c841846\",\"0x48127fe17fff8000\",\"0x480680017fff8000\",\"0x7\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127fdb7fff8000\",\"0x480080027ff38000\",\"0x1104800180018000\",\"0x1ff3\",\"0x20680017fff7ffd\",\"0xe\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x482480017ff78000\",\"0x258\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff97fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x10780017fff7fff\",\"0x14\",\"0x480280027ffb8000\",\"0x1104800180018000\",\"0x40ec\",\"0x482480017fff8000\",\"0x40eb\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x9\",\"0x482480017fff8000\",\"0x213ea\",\"0x480a7ff87fff8000\",\"0x48127ff47fff8000\",\"0x48307ffd7ff68000\",\"0x482680017ffb8000\",\"0x6\",\"0x480280047ffb8000\",\"0x480280057ffb8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x55a\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xa78\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0xdf\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x122a\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xaf\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x9a\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x4045\",\"0x482480017fff8000\",\"0x4044\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x9\",\"0x482480017fff8000\",\"0x24072\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x57\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x48127fff7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffd\",\"0x480280037ffb8000\",\"0x20680017fff7fff\",\"0x30\",\"0x480280027ffb8000\",\"0x480280047ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffd7fff8000\",\"0x480a7ff87fff8000\",\"0x482680017ffb8000\",\"0x5\",\"0x480680017fff8000\",\"0x3711c9d994faf6055172091cb841fd4831aa743e6f3315163b06a122c841846\",\"0x48127fe17fff8000\",\"0x480680017fff8000\",\"0x5\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127fdb7fff8000\",\"0x480080027ff38000\",\"0x1104800180018000\",\"0x2051\",\"0x20680017fff7ffd\",\"0xe\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x482480017ff78000\",\"0x258\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff97fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x10780017fff7fff\",\"0x14\",\"0x480280027ffb8000\",\"0x1104800180018000\",\"0x3ff7\",\"0x482480017fff8000\",\"0x3ff6\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x9\",\"0x482480017fff8000\",\"0x21322\",\"0x480a7ff87fff8000\",\"0x48127ff47fff8000\",\"0x48307ffd7ff68000\",\"0x482680017ffb8000\",\"0x6\",\"0x480280047ffb8000\",\"0x480280057ffb8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x55a\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xa78\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0xdf\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x122a\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xaf\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x9a\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x3f50\",\"0x482480017fff8000\",\"0x3f4f\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x9\",\"0x482480017fff8000\",\"0x2413a\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x57\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x48127fff7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffd\",\"0x480280037ffb8000\",\"0x20680017fff7fff\",\"0x30\",\"0x480280027ffb8000\",\"0x480280047ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffd7fff8000\",\"0x480a7ff87fff8000\",\"0x482680017ffb8000\",\"0x5\",\"0x480680017fff8000\",\"0x251e864ca2a080f55bce5da2452e8cfcafdbc951a3e7fff5023d558452ec228\",\"0x48127fe17fff8000\",\"0x480680017fff8000\",\"0x3\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127fdb7fff8000\",\"0x480080027ff38000\",\"0x1104800180018000\",\"0x1e09\",\"0x20680017fff7ffd\",\"0xe\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x482480017ff78000\",\"0x258\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff97fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x10780017fff7fff\",\"0x14\",\"0x480280027ffb8000\",\"0x1104800180018000\",\"0x3f02\",\"0x482480017fff8000\",\"0x3f01\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x9\",\"0x482480017fff8000\",\"0x213ea\",\"0x480a7ff87fff8000\",\"0x48127ff47fff8000\",\"0x48307ffd7ff68000\",\"0x482680017ffb8000\",\"0x6\",\"0x480280047ffb8000\",\"0x480280057ffb8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x55a\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xa78\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0xdf\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x122a\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xaf\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x9a\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x3e5b\",\"0x482480017fff8000\",\"0x3e5a\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x9\",\"0x482480017fff8000\",\"0x24072\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x57\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x48127fff7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffd\",\"0x480280037ffb8000\",\"0x20680017fff7fff\",\"0x30\",\"0x480280027ffb8000\",\"0x480280047ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffd7fff8000\",\"0x480a7ff87fff8000\",\"0x482680017ffb8000\",\"0x5\",\"0x480680017fff8000\",\"0x251e864ca2a080f55bce5da2452e8cfcafdbc951a3e7fff5023d558452ec228\",\"0x48127fe17fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127fdb7fff8000\",\"0x480080027ff38000\",\"0x1104800180018000\",\"0x1e67\",\"0x20680017fff7ffd\",\"0xe\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x482480017ff78000\",\"0x258\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff97fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x10780017fff7fff\",\"0x14\",\"0x480280027ffb8000\",\"0x1104800180018000\",\"0x3e0d\",\"0x482480017fff8000\",\"0x3e0c\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x9\",\"0x482480017fff8000\",\"0x21322\",\"0x480a7ff87fff8000\",\"0x48127ff47fff8000\",\"0x48307ffd7ff68000\",\"0x482680017ffb8000\",\"0x6\",\"0x480280047ffb8000\",\"0x480280057ffb8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x55a\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xa78\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x7c\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x1810\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x60\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x48127ffc7fff8000\",\"0x480280007ffc8000\",\"0x48307ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ff57fff8000\",\"0x482480017ff98000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x3d8d\",\"0x482480017fff8000\",\"0x3d8c\",\"0x48127ffa7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x1451e\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007fed7fff\",\"0x10780017fff7fff\",\"0x23\",\"0x48307ffe80007ffa\",\"0x400080007fee7fff\",\"0x482480017fee8000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x48127ff07fff8000\",\"0x1104800180018000\",\"0x1eea\",\"0x20680017fff7ffd\",\"0xd\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x64\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fea8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x7b2\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x68\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x1bf8\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x48127ffb7fff8000\",\"0x482480017ffb8000\",\"0x492\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x3d06\",\"0x482480017fff8000\",\"0x3d05\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0xa0680017fff8000\",\"0x9\",\"0x4824800180007ffd\",\"0x2af8\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff57fff\",\"0x10780017fff7fff\",\"0x2f\",\"0x4824800180007ffd\",\"0x2af8\",\"0x400080007ff67fff\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x341c1bdfd89f69748aa00b5742b03adbffd79b8e80cab5c50d91cd8c2a79be1\",\"0x482480017ff38000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffb\",\"0x400280027ffb7ffc\",\"0x400280037ffb7ffd\",\"0x480280057ffb8000\",\"0x20680017fff7fff\",\"0x11\",\"0x480280047ffb8000\",\"0x40780017fff7fff\",\"0x1\",\"0x480280067ffb8000\",\"0x400080007ffe7fff\",\"0x48127ffa7fff8000\",\"0x48127ffc7fff8000\",\"0x482680017ffb8000\",\"0x7\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480280047ffb8000\",\"0x48127ffc7fff8000\",\"0x482480017ffe8000\",\"0x12c\",\"0x482680017ffb8000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ffb8000\",\"0x480280077ffb8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x21b6\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x68\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x1bf8\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x48127ffb7fff8000\",\"0x482480017ffb8000\",\"0x492\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x3c89\",\"0x482480017fff8000\",\"0x3c88\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0xa0680017fff8000\",\"0x9\",\"0x4824800180007ffd\",\"0x2af8\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff57fff\",\"0x10780017fff7fff\",\"0x2f\",\"0x4824800180007ffd\",\"0x2af8\",\"0x400080007ff67fff\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0xb6ce5410fca59d078ee9b2a4371a9d684c530d697c64fbef0ae6d5e8f0ac72\",\"0x482480017ff38000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffb\",\"0x400280027ffb7ffc\",\"0x400280037ffb7ffd\",\"0x480280057ffb8000\",\"0x20680017fff7fff\",\"0x11\",\"0x480280047ffb8000\",\"0x40780017fff7fff\",\"0x1\",\"0x480280067ffb8000\",\"0x400080007ffe7fff\",\"0x48127ffa7fff8000\",\"0x48127ffc7fff8000\",\"0x482680017ffb8000\",\"0x7\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480280047ffb8000\",\"0x48127ffc7fff8000\",\"0x482480017ffe8000\",\"0x12c\",\"0x482680017ffb8000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ffb8000\",\"0x480280077ffb8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x21b6\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x95\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x1bf8\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x48127ffb7fff8000\",\"0x482480017ffb8000\",\"0x492\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x3c0c\",\"0x482480017fff8000\",\"0x3c0b\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0xa0680017fff8000\",\"0x9\",\"0x4824800180007ffd\",\"0x3336\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff57fff\",\"0x10780017fff7fff\",\"0x5c\",\"0x4824800180007ffd\",\"0x3336\",\"0x400080007ff67fff\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1f0d4aa99431d246bac9b8e48c33e888245b15e9678f64f9bdfc8823dc8f979\",\"0x482480017ff38000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffb\",\"0x400280027ffb7ffc\",\"0x400280037ffb7ffd\",\"0x480280057ffb8000\",\"0x20680017fff7fff\",\"0x39\",\"0x480280047ffb8000\",\"0x480280067ffb8000\",\"0x482680017ffb8000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x12\",\"0x4824800180007ffc\",\"0x100\",\"0x4844800180008002\",\"0x8000000000000110000000000000000\",\"0x4830800080017ffe\",\"0x480080007ff57fff\",\"0x482480017ffe8000\",\"0xefffffffffffffde00000000000000ff\",\"0x480080017ff37fff\",\"0x400080027ff27ffb\",\"0x402480017fff7ffb\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7fff\",\"0x16\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x482480017ffc8000\",\"0xffffffffffffffffffffffffffffff00\",\"0x400080017ff77fff\",\"0x40780017fff7fff\",\"0x1\",\"0x400080007fff7ffa\",\"0x482480017ff68000\",\"0x2\",\"0x482480017ffb8000\",\"0x55a\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f72655538202d206e6f6e207538\",\"0x400080007ffe7fff\",\"0x482480017ff08000\",\"0x3\",\"0x48127ff57fff8000\",\"0x48127ff37fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0xa\",\"0x480280047ffb8000\",\"0x48127ffc7fff8000\",\"0x482480017ffe8000\",\"0x776\",\"0x482680017ffb8000\",\"0x8\",\"0x480280067ffb8000\",\"0x480280077ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x21b6\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x5e\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x1bf8\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x48127ffb7fff8000\",\"0x482480017ffb8000\",\"0x492\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x3b62\",\"0x482480017fff8000\",\"0x3b61\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0xa0680017fff8000\",\"0x9\",\"0x4824800180007ffd\",\"0x6bc6\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff57fff\",\"0x10780017fff7fff\",\"0x25\",\"0x4824800180007ffd\",\"0x6bc6\",\"0x400080007ff67fff\",\"0x482480017ff68000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x110e2f729c9c2b988559994a3daccd838cf52faf88e18101373e67dd061455a\",\"0x1104800180018000\",\"0x1d4b\",\"0x20680017fff7ffd\",\"0xf\",\"0x40780017fff7fff\",\"0x1\",\"0x400080007fff7ffd\",\"0x400080017fff7ffe\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x2\",\"0x208b7fff7fff7ffe\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x12c\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x21b6\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0xae\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x128e\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x7e\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x69\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x55a\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x3abd\",\"0x482480017fff8000\",\"0x3abc\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x6e82\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffb\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff37fff\",\"0x10780017fff7fff\",\"0x28\",\"0x48307ffe80007ffb\",\"0x400080007ff47fff\",\"0x482480017ff48000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x3a4e8ec16e258a799fe707996fd5d21d42b29adc1499a370edf7f809d8c458a\",\"0x48127fe87fff8000\",\"0x1104800180018000\",\"0x1d64\",\"0x20680017fff7ffd\",\"0x10\",\"0x40780017fff7fff\",\"0x1\",\"0x400080007fff7ffd\",\"0x400080017fff7ffe\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x2\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x12c\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017ff08000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x4f6\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xa14\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0xfa\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x9ec\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xca\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0xb5\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480080007fef8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x81\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x6c\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x39c8\",\"0x482480017fff8000\",\"0x39c7\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x7012\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x29\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x3c87bf42ed4f01f11883bf54f43d91d2cbbd5fec26d1df9c74c57ae138800a4\",\"0x48127fd97fff8000\",\"0x48127fe67fff8000\",\"0x1104800180018000\",\"0x1d35\",\"0x20680017fff7ffd\",\"0x10\",\"0x40780017fff7fff\",\"0x1\",\"0x400080007fff7ffd\",\"0x400080017fff7ffe\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x2\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x12c\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x55a\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xa78\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0xd98\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x12b6\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x161\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x5e6\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x131\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x11c\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xe8\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xcc\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xaa\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x8e\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x3883\",\"0x482480017fff8000\",\"0x3882\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x21962\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x50\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x48127fff7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffd\",\"0x480280037ffb8000\",\"0x20680017fff7fff\",\"0x29\",\"0x480280027ffb8000\",\"0x480280047ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffd7fff8000\",\"0x480a7ff87fff8000\",\"0x482680017ffb8000\",\"0x5\",\"0x480080027ffb8000\",\"0x48127fcb7fff8000\",\"0x48127fd97fff8000\",\"0x48127fe37fff8000\",\"0x1104800180018000\",\"0x1cb0\",\"0x20680017fff7ffd\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x1\",\"0x400080007ffe7fff\",\"0x48127ff97fff8000\",\"0x48127ff67fff8000\",\"0x482480017ff68000\",\"0x190\",\"0x48127ff77fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff97fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x10780017fff7fff\",\"0x14\",\"0x480280027ffb8000\",\"0x1104800180018000\",\"0x383c\",\"0x482480017fff8000\",\"0x383b\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x1ec12\",\"0x480a7ff87fff8000\",\"0x48127ff47fff8000\",\"0x48307ffd7ff68000\",\"0x482680017ffb8000\",\"0x6\",\"0x480280047ffb8000\",\"0x480280057ffb8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x1ae\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x7f8\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x834\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xe7e\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x119e\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x16bc\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x4\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0xfffffffffffffffffffffffffffffc68\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x1cb\",\"0x4825800180007ffa\",\"0x398\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x19c\",\"0x40137fff7fff8003\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4825800180048003\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x186\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48317fff80008003\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480080007fef8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x152\",\"0x40137fff7fff8002\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4825800180048002\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x13c\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48317fff80008002\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x108\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xec\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xca\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xae\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x36d8\",\"0x482480017fff8000\",\"0x36d7\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x8\",\"0x482480017fff8000\",\"0x3479c\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x70\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x48127fff7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffd\",\"0x480280037ffb8000\",\"0x20680017fff7fff\",\"0x49\",\"0x480280027ffb8000\",\"0x480280047ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffd7fff8000\",\"0x480a7ff87fff8000\",\"0x482680017ffb8000\",\"0x5\",\"0x480a80037fff8000\",\"0x480080027ffa8000\",\"0x40137fd97fff8000\",\"0x40137fe47fff8001\",\"0x480a80007fff8000\",\"0x480a80017fff8000\",\"0x1104800180018000\",\"0x1edc\",\"0x20680017fff7ffd\",\"0x26\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480a80037fff8000\",\"0x480a80027fff8000\",\"0x480a80007fff8000\",\"0x480a80017fff8000\",\"0x1104800180018000\",\"0x1af7\",\"0x20680017fff7ffd\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x1\",\"0x400080007ffe7fff\",\"0x48127ff97fff8000\",\"0x48127ff67fff8000\",\"0x482480017ff68000\",\"0x190\",\"0x48127ff77fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff97fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x10780017fff7fff\",\"0x26\",\"0x1104800180018000\",\"0x3684\",\"0x482480017fff8000\",\"0x3683\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x1eb4a\",\"0x48127ff47fff8000\",\"0x48127ff17fff8000\",\"0x48307ffd7ff18000\",\"0x48127ff27fff8000\",\"0x48127ff37fff8000\",\"0x48127ff37fff8000\",\"0x10780017fff7fff\",\"0x14\",\"0x480280027ffb8000\",\"0x1104800180018000\",\"0x3671\",\"0x482480017fff8000\",\"0x3670\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x8\",\"0x482480017fff8000\",\"0x31a4c\",\"0x480a7ff87fff8000\",\"0x48127ff47fff8000\",\"0x48307ffd7ff68000\",\"0x482680017ffb8000\",\"0x6\",\"0x480280047ffb8000\",\"0x480280057ffb8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x1ae\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x7f8\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x834\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xe7e\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202333\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x119e\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x1716\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x1a36\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x1fae\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x20c6\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x161\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x5e6\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x131\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x11c\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xe8\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xcc\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xaa\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x8e\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x3529\",\"0x482480017fff8000\",\"0x3528\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xe2a4\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x50\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x48127fff7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffd\",\"0x480280037ffb8000\",\"0x20680017fff7fff\",\"0x29\",\"0x480280027ffb8000\",\"0x480280047ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffd7fff8000\",\"0x480a7ff87fff8000\",\"0x482680017ffb8000\",\"0x5\",\"0x480080027ffb8000\",\"0x48127fcb7fff8000\",\"0x48127fd97fff8000\",\"0x48127fe37fff8000\",\"0x1104800180018000\",\"0x1eb5\",\"0x20680017fff7ffd\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x1\",\"0x400080007ffe7fff\",\"0x48127ff97fff8000\",\"0x48127ff67fff8000\",\"0x482480017ff68000\",\"0x190\",\"0x48127ff77fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff97fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x10780017fff7fff\",\"0x14\",\"0x480280027ffb8000\",\"0x1104800180018000\",\"0x34e2\",\"0x482480017fff8000\",\"0x34e1\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xb554\",\"0x480a7ff87fff8000\",\"0x48127ff47fff8000\",\"0x48307ffd7ff68000\",\"0x482680017ffb8000\",\"0x6\",\"0x480280047ffb8000\",\"0x480280057ffb8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x1ae\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x7f8\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x834\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xe7e\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x119e\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x16bc\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x144\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x5e6\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x114\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0xff\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xcb\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xaf\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x8d\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x71\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x33b2\",\"0x482480017fff8000\",\"0x33b1\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x156ee\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x33\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x48127fd27fff8000\",\"0x48127fe07fff8000\",\"0x48127fea7fff8000\",\"0x1104800180018000\",\"0x1e2e\",\"0x20680017fff7ffd\",\"0x1b\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff97fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x1\",\"0x400080007ffc7fff\",\"0x48127ff77fff8000\",\"0x48127ff47fff8000\",\"0x48127ffc7fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff77fff8000\",\"0x482480017ff68000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x2bc\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x1ae\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x7f8\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x834\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xe7e\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x119e\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x16bc\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x144\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x5e6\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x114\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0xff\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xcb\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xaf\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x8d\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x71\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x3258\",\"0x482480017fff8000\",\"0x3257\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x156ee\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x33\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x48127fd27fff8000\",\"0x48127fe07fff8000\",\"0x48127fea7fff8000\",\"0x1104800180018000\",\"0x1e60\",\"0x20680017fff7ffd\",\"0x1b\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff97fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x1\",\"0x400080007ffc7fff\",\"0x48127ff77fff8000\",\"0x48127ff47fff8000\",\"0x48127ffc7fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff77fff8000\",\"0x482480017ff68000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x2bc\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x1ae\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x7f8\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x834\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xe7e\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x119e\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x16bc\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x5e\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x1bf8\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x48127ffb7fff8000\",\"0x482480017ffb8000\",\"0x492\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x3196\",\"0x482480017fff8000\",\"0x3195\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0xa0680017fff8000\",\"0x9\",\"0x4824800180007ffd\",\"0x6bc6\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff57fff\",\"0x10780017fff7fff\",\"0x25\",\"0x4824800180007ffd\",\"0x6bc6\",\"0x400080007ff67fff\",\"0x482480017ff68000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x110e2f729c9c2b988559994a3daccd838cf52faf88e18101373e67dd061455a\",\"0x1104800180018000\",\"0x137f\",\"0x20680017fff7ffd\",\"0xf\",\"0x40780017fff7fff\",\"0x1\",\"0x400080007fff7ffd\",\"0x400080017fff7ffe\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x2\",\"0x208b7fff7fff7ffe\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x12c\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x21b6\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0xae\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x128e\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x7e\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x69\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x55a\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x30f1\",\"0x482480017fff8000\",\"0x30f0\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x6e82\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffb\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff37fff\",\"0x10780017fff7fff\",\"0x28\",\"0x48307ffe80007ffb\",\"0x400080007ff47fff\",\"0x482480017ff48000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x3a4e8ec16e258a799fe707996fd5d21d42b29adc1499a370edf7f809d8c458a\",\"0x48127fe87fff8000\",\"0x1104800180018000\",\"0x1398\",\"0x20680017fff7ffd\",\"0x10\",\"0x40780017fff7fff\",\"0x1\",\"0x400080007fff7ffd\",\"0x400080017fff7ffe\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x2\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x12c\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017ff08000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x4f6\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xa14\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x4\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0xfffffffffffffffffffffffffffffc68\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x1cb\",\"0x4825800180007ffa\",\"0x398\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x19c\",\"0x40137fff7fff8003\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4825800180048003\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x186\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48317fff80008003\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480080007fef8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x152\",\"0x40137fff7fff8002\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4825800180048002\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x13c\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48317fff80008002\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x108\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xec\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xca\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xae\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2f93\",\"0x482480017fff8000\",\"0x2f92\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x8\",\"0x482480017fff8000\",\"0x3479c\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x70\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x48127fff7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffd\",\"0x480280037ffb8000\",\"0x20680017fff7fff\",\"0x49\",\"0x480280027ffb8000\",\"0x480280047ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffd7fff8000\",\"0x480a7ff87fff8000\",\"0x482680017ffb8000\",\"0x5\",\"0x480a80037fff8000\",\"0x480080027ffa8000\",\"0x40137fd97fff8000\",\"0x40137fe47fff8001\",\"0x480a80007fff8000\",\"0x480a80017fff8000\",\"0x1104800180018000\",\"0x1797\",\"0x20680017fff7ffd\",\"0x26\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480a80037fff8000\",\"0x480a80027fff8000\",\"0x480a80007fff8000\",\"0x480a80017fff8000\",\"0x1104800180018000\",\"0x13b2\",\"0x20680017fff7ffd\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x1\",\"0x400080007ffe7fff\",\"0x48127ff97fff8000\",\"0x48127ff67fff8000\",\"0x482480017ff68000\",\"0x190\",\"0x48127ff77fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff97fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x10780017fff7fff\",\"0x26\",\"0x1104800180018000\",\"0x2f3f\",\"0x482480017fff8000\",\"0x2f3e\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x1eb4a\",\"0x48127ff47fff8000\",\"0x48127ff17fff8000\",\"0x48307ffd7ff18000\",\"0x48127ff27fff8000\",\"0x48127ff37fff8000\",\"0x48127ff37fff8000\",\"0x10780017fff7fff\",\"0x14\",\"0x480280027ffb8000\",\"0x1104800180018000\",\"0x2f2c\",\"0x482480017fff8000\",\"0x2f2b\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x8\",\"0x482480017fff8000\",\"0x31a4c\",\"0x480a7ff87fff8000\",\"0x48127ff47fff8000\",\"0x48307ffd7ff68000\",\"0x482680017ffb8000\",\"0x6\",\"0x480280047ffb8000\",\"0x480280057ffb8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x1ae\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x7f8\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x834\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xe7e\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202333\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x119e\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x1716\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x1a36\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x1fae\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x20c6\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x144\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x5e6\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x114\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0xff\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xcb\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xaf\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x8d\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x71\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2de4\",\"0x482480017fff8000\",\"0x2de3\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x156ee\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x33\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x48127fd27fff8000\",\"0x48127fe07fff8000\",\"0x48127fea7fff8000\",\"0x1104800180018000\",\"0x1860\",\"0x20680017fff7ffd\",\"0x1b\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff97fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x1\",\"0x400080007ffc7fff\",\"0x48127ff77fff8000\",\"0x48127ff47fff8000\",\"0x48127ffc7fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff77fff8000\",\"0x482480017ff68000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x2bc\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x1ae\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x7f8\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x834\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xe7e\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x119e\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x16bc\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x144\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x5e6\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x114\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0xff\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xcb\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xaf\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x8d\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x71\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2c8a\",\"0x482480017fff8000\",\"0x2c89\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x156ee\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x33\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x48127fd27fff8000\",\"0x48127fe07fff8000\",\"0x48127fea7fff8000\",\"0x1104800180018000\",\"0x1892\",\"0x20680017fff7ffd\",\"0x1b\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff97fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x1\",\"0x400080007ffc7fff\",\"0x48127ff77fff8000\",\"0x48127ff47fff8000\",\"0x48127ffc7fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff77fff8000\",\"0x482480017ff68000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x2bc\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x1ae\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x7f8\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x834\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xe7e\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x119e\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x16bc\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0xffffffffffffffffffffffffffffe192\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x297\",\"0x4825800180007ffa\",\"0x1e6e\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x27c\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x48127ffc7fff8000\",\"0x480280007ffc8000\",\"0x48307ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x262\",\"0x482480017ffb8000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480080007ff88000\",\"0x48307ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffd7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff77fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffd7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x234\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x12\",\"0x4824800180007ffd\",\"0x100\",\"0x4844800180008002\",\"0x8000000000000110000000000000000\",\"0x4830800080017ffe\",\"0x480080007fe87fff\",\"0x482480017ffe8000\",\"0xefffffffffffffde00000000000000ff\",\"0x480080017fe67fff\",\"0x400080027fe57ffb\",\"0x402480017fff7ffb\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7fff\",\"0x21c\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007feb7ffd\",\"0x482480017ffd8000\",\"0xffffffffffffffffffffffffffffff00\",\"0x400080017fea7fff\",\"0x482480017fea8000\",\"0x2\",\"0x48127ffc7fff8000\",\"0x48307ff680007ff7\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff48000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff17fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x1ea\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x1ce\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x1ac\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x190\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48127ff07fff8000\",\"0x48127ffa7fff8000\",\"0x48307ff580007ff6\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffc7fff8000\",\"0x482480017ff38000\",\"0x1\",\"0x48127ff37fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480080007ff08000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffc7fff8000\",\"0x48127ff37fff8000\",\"0x48127ff37fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x15f\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff17ffc\",\"0x480080017ff07ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027fef7ffd\",\"0x10780017fff7fff\",\"0x14a\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff27ffd\",\"0x480080017ff17ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff07ffe\",\"0x482480017ff08000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480080007fef8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x116\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x101\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480080007fef8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xcd\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0xb8\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x84\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x12\",\"0x4824800180007ffd\",\"0x10000000000000000\",\"0x4844800180008002\",\"0x8000000000000110000000000000000\",\"0x4830800080017ffe\",\"0x480080007ff27fff\",\"0x482480017ffe8000\",\"0xefffffffffffffdeffffffffffffffff\",\"0x480080017ff07fff\",\"0x400080027fef7ffb\",\"0x402480017fff7ffb\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7fff\",\"0x6c\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ffd8000\",\"0xffffffffffffffff0000000000000000\",\"0x400080017ff47fff\",\"0x482480017ff48000\",\"0x2\",\"0x48127ffc7fff8000\",\"0x48307ff680007ff7\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2a55\",\"0x482480017fff8000\",\"0x2a54\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0xb\",\"0x482480017fff8000\",\"0x56a54\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x2b\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x48127f917fff8000\",\"0x48127f957fff8000\",\"0x48127f9b7fff8000\",\"0x48127fb67fff8000\",\"0x48127fb67fff8000\",\"0x48127fbb7fff8000\",\"0x48127fc87fff8000\",\"0x48127fd57fff8000\",\"0x48127fe37fff8000\",\"0x1104800180018000\",\"0x17e3\",\"0x20680017fff7ffd\",\"0xd\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x64\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017fef8000\",\"0x3\",\"0x482480017ff78000\",\"0x384\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x96a\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202338\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0xc8a\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x11a8\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202337\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x14c8\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x19e6\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202336\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017fef8000\",\"0x3\",\"0x482480017ff88000\",\"0x1d06\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff67fff8000\",\"0x482480017ffa8000\",\"0x2224\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202335\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x2260\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x28aa\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x28e6\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x2f30\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202334\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017fe58000\",\"0x3\",\"0x482480017ff78000\",\"0x307a\",\"0x10780017fff7fff\",\"0x5\",\"0x48127fee7fff8000\",\"0x482480017ffa8000\",\"0x3660\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202333\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ff57fff8000\",\"0x482480017ff98000\",\"0x3bd8\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x3e30\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffa7fff\",\"0x400380017ffa7ff8\",\"0x480280037ffa8000\",\"0x20680017fff7fff\",\"0x8d\",\"0x480280027ffa8000\",\"0x480280047ffa8000\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1390569bb0a3a722eb4228e8700301347da081211d5c2ded2db22ef389551ab\",\"0x480080007ffc8000\",\"0x480080017ffb8000\",\"0x480080027ffa8000\",\"0x480080037ff98000\",\"0x480080047ff88000\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280057ffa7fff\",\"0x400280067ffa7ff7\",\"0x400280077ffa7ff8\",\"0x400280087ffa7ff9\",\"0x4802800a7ffa8000\",\"0x20680017fff7fff\",\"0x5e\",\"0x480280097ffa8000\",\"0x4802800b7ffa8000\",\"0x482680017ffa8000\",\"0xc\",\"0x48127ffd7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffc\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480280007ff77ffc\",\"0x480280017ff77ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400280027ff77ffd\",\"0x10780017fff7fff\",\"0x33\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffb\",\"0x480280007ff77ffd\",\"0x480280017ff77ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400280027ff77ffe\",\"0x48307ff880007ff2\",\"0x482680017ff78000\",\"0x3\",\"0x48127ff87fff8000\",\"0x20680017fff7ffd\",\"0xc\",\"0x48127ffe7fff8000\",\"0x48127ffe7fff8000\",\"0x480a7ff97fff8000\",\"0x48127ff37fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x1104800180018000\",\"0x17b1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x28f6\",\"0x482480017fff8000\",\"0x28f5\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1e9d8\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4d494e5445525f4f4e4c59\",\"0x400080007ffe7fff\",\"0x48127ff57fff8000\",\"0x48307ffc7ff58000\",\"0x480a7ff97fff8000\",\"0x48127fea7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x28dd\",\"0x482480017fff8000\",\"0x28dc\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1e848\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4e6f6e20436f6e747261637441646472657373\",\"0x400080007ffe7fff\",\"0x482680017ff78000\",\"0x3\",\"0x48307ffc7fef8000\",\"0x48127fed7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x13\",\"0x480280097ffa8000\",\"0x1104800180018000\",\"0x28c4\",\"0x482480017fff8000\",\"0x28c3\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1ef5a\",\"0x480a7ff77fff8000\",\"0x48307ffe7ff78000\",\"0x482680017ffa8000\",\"0xd\",\"0x4802800b7ffa8000\",\"0x4802800c7ffa8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ff97fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480280027ffa8000\",\"0x1104800180018000\",\"0x28aa\",\"0x482480017fff8000\",\"0x28a9\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x21f02\",\"0x480a7ff77fff8000\",\"0x48307ffe7ff78000\",\"0x480a7ff97fff8000\",\"0x482680017ffa8000\",\"0x6\",\"0x480680017fff8000\",\"0x1\",\"0x480280047ffa8000\",\"0x480280057ffa8000\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffa7fff\",\"0x400380017ffa7ff8\",\"0x480280037ffa8000\",\"0x20680017fff7fff\",\"0x8d\",\"0x480280027ffa8000\",\"0x480280047ffa8000\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1390569bb0a3a722eb4228e8700301347da081211d5c2ded2db22ef389551ab\",\"0x480080007ffc8000\",\"0x480080017ffb8000\",\"0x480080027ffa8000\",\"0x480080037ff98000\",\"0x480080047ff88000\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280057ffa7fff\",\"0x400280067ffa7ff7\",\"0x400280077ffa7ff8\",\"0x400280087ffa7ff9\",\"0x4802800a7ffa8000\",\"0x20680017fff7fff\",\"0x5e\",\"0x480280097ffa8000\",\"0x4802800b7ffa8000\",\"0x482680017ffa8000\",\"0xc\",\"0x48127ffd7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffc\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480280007ff77ffc\",\"0x480280017ff77ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400280027ff77ffd\",\"0x10780017fff7fff\",\"0x33\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffb\",\"0x480280007ff77ffd\",\"0x480280017ff77ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400280027ff77ffe\",\"0x48307ff880007ff2\",\"0x482680017ff78000\",\"0x3\",\"0x48127ff87fff8000\",\"0x20680017fff7ffd\",\"0xc\",\"0x48127ffe7fff8000\",\"0x48127ffe7fff8000\",\"0x480a7ff97fff8000\",\"0x48127ff37fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x1104800180018000\",\"0x19e5\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x284f\",\"0x482480017fff8000\",\"0x284e\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1e9d8\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4d494e5445525f4f4e4c59\",\"0x400080007ffe7fff\",\"0x48127ff57fff8000\",\"0x48307ffc7ff58000\",\"0x480a7ff97fff8000\",\"0x48127fea7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2836\",\"0x482480017fff8000\",\"0x2835\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1e848\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4e6f6e20436f6e747261637441646472657373\",\"0x400080007ffe7fff\",\"0x482680017ff78000\",\"0x3\",\"0x48307ffc7fef8000\",\"0x48127fed7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x13\",\"0x480280097ffa8000\",\"0x1104800180018000\",\"0x281d\",\"0x482480017fff8000\",\"0x281c\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1ef5a\",\"0x480a7ff77fff8000\",\"0x48307ffe7ff78000\",\"0x482680017ffa8000\",\"0xd\",\"0x4802800b7ffa8000\",\"0x4802800c7ffa8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ff97fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480280027ffa8000\",\"0x1104800180018000\",\"0x2803\",\"0x482480017fff8000\",\"0x2802\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x21f02\",\"0x480a7ff77fff8000\",\"0x48307ffe7ff78000\",\"0x480a7ff97fff8000\",\"0x482680017ffa8000\",\"0x6\",\"0x480680017fff8000\",\"0x1\",\"0x480280047ffa8000\",\"0x480280057ffa8000\",\"0x208b7fff7fff7ffe\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xa\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x8\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x98\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffe\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480280007ffb7ffc\",\"0x480280017ffb7ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400280027ffb7ffd\",\"0x10780017fff7fff\",\"0x84\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffd\",\"0x480280007ffb7ffd\",\"0x480280017ffb7ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400280027ffb7ffe\",\"0x482680017ffb8000\",\"0x3\",\"0x48127ff67fff8000\",\"0x48127ff67fff8000\",\"0x1104800180018000\",\"0x1c2e\",\"0x20680017fff7ff8\",\"0x5e\",\"0x20680017fff7ffb\",\"0x46\",\"0x48307ff980007ffa\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xa\",\"0x482480017ff88000\",\"0x1\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff57fff8000\",\"0x10780017fff7fff\",\"0x8\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x1b\",\"0x480080007fff8000\",\"0x20680017fff7fff\",\"0x6\",\"0x480680017fff8000\",\"0x1\",\"0x10780017fff7fff\",\"0x4\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1\",\"0x48127fef7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127f9e7fff8000\",\"0x48127fee7fff8000\",\"0x48127fee7fff8000\",\"0x48127fee7fff8000\",\"0x48127fee7fff8000\",\"0x48307ff480007ff5\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x3\",\"0x48127fef7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x8\",\"0x48127fef7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x48127fef7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x8\",\"0x48127fef7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127fed7fff8000\",\"0x48127fed7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x56\",\"0x482680017ffb8000\",\"0x3\",\"0x10780017fff7fff\",\"0x5\",\"0x40780017fff7fff\",\"0x5c\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127f9e7fff8000\",\"0x48127f9e7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480a7ff37fff8000\",\"0x480a7ff47fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff67fff8000\",\"0x1104800180018000\",\"0x1c70\",\"0x20680017fff7ffd\",\"0x9d\",\"0x1104800180018000\",\"0x271e\",\"0x482480017fff8000\",\"0x271d\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x480a7ff67fff8000\",\"0x480080007ffc8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x1104800180018000\",\"0x1c9e\",\"0x20680017fff7ffc\",\"0x7a\",\"0x480680017fff8000\",\"0x1ac8d354f2e793629cb233a16f10d13cf15b9c45bbc620577c8e1df95ede545\",\"0x400280007ff57fff\",\"0x400280017ff57ffe\",\"0x480280027ff58000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027ff07ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff37ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017ff17ffd\",\"0x400080027ff07ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff17fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff58000\",\"0x3\",\"0x482480017fed8000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ff77fff\",\"0x400280017ff77ffb\",\"0x400280027ff77ffc\",\"0x400280037ff77ffa\",\"0x480280057ff78000\",\"0x20680017fff7fff\",\"0x3b\",\"0x480280047ff78000\",\"0x480280067ff78000\",\"0x482680017ff78000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x12\",\"0x4824800180007ffc\",\"0x10000000000000000\",\"0x4844800180008002\",\"0x8000000000000110000000000000000\",\"0x4830800080017ffe\",\"0x480080007ff57fff\",\"0x482480017ffe8000\",\"0xefffffffffffffdeffffffffffffffff\",\"0x480080017ff37fff\",\"0x400080027ff27ffb\",\"0x402480017fff7ffb\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7fff\",\"0x15\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x482480017ffc8000\",\"0xffffffffffffffff0000000000000000\",\"0x400080017ff77fff\",\"0x482480017ff78000\",\"0x2\",\"0x482480017ffc8000\",\"0x3ca\",\"0x48127ff47fff8000\",\"0x48127fe37fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff47fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7265553634202d206e6f6e20753634\",\"0x400080007ffe7fff\",\"0x482480017ff08000\",\"0x3\",\"0x48127ff57fff8000\",\"0x48127fed7fff8000\",\"0x48127fdc7fff8000\",\"0x48127ff17fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480280047ff78000\",\"0x48127ffc7fff8000\",\"0x482480017ffe8000\",\"0x712\",\"0x48127ff97fff8000\",\"0x48127fe87fff8000\",\"0x482680017ff78000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ff78000\",\"0x480280077ff78000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2692\",\"0x482480017fff8000\",\"0x2691\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x346c\",\"0x48127ff37fff8000\",\"0x48307ffe7ff38000\",\"0x48127ff37fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x10780017fff7fff\",\"0xf\",\"0x1104800180018000\",\"0x2683\",\"0x482480017fff8000\",\"0x2682\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x4326\",\"0x48127ff57fff8000\",\"0x48307ffe7ff58000\",\"0x480a7ff67fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ff57fff8000\",\"0x48127ffa7fff8000\",\"0x480a7ff77fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x4\",\"0x480a7ff37fff8000\",\"0x480a7ff47fff8000\",\"0x480a7ff57fff8000\",\"0x480a7ff77fff8000\",\"0x1104800180018000\",\"0x1c94\",\"0x20680017fff7ffd\",\"0x15f\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400080007ffa7fff\",\"0x400080017ffa7ffe\",\"0x480080037ffa8000\",\"0x20680017fff7fff\",\"0x141\",\"0x480080027ff98000\",\"0x480080047ff88000\",\"0x480080007fff8000\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x3fc801c47df4de8d5835f8bfd4d0b8823ba63e5a3f278086901402d680abfc\",\"0x480080007ffc8000\",\"0x480080017ffb8000\",\"0x480080027ffa8000\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080057fef7fff\",\"0x400080067fef7ff9\",\"0x400080077fef7ffa\",\"0x400080087fef7ffb\",\"0x4800800a7fef8000\",\"0x20680017fff7fff\",\"0x110\",\"0x480080097fee8000\",\"0x4800800b7fed8000\",\"0x482480017fec8000\",\"0xc\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x12\",\"0x4824800180007ffc\",\"0x10000000000000000\",\"0x4844800180008002\",\"0x8000000000000110000000000000000\",\"0x4830800080017ffe\",\"0x480080007fe37fff\",\"0x482480017ffe8000\",\"0xefffffffffffffdeffffffffffffffff\",\"0x480080017fe17fff\",\"0x400080027fe07ffb\",\"0x402480017fff7ffb\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7fff\",\"0xe3\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007fe67ffc\",\"0x482480017ffc8000\",\"0xffffffffffffffff0000000000000000\",\"0x400080017fe57fff\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ff97ff48000\",\"0x4824800180007fff\",\"0x10000000000000000\",\"0x400080027fe17fff\",\"0x10780017fff7fff\",\"0xb9\",\"0x48307ff97ff48001\",\"0x4824800180007fff\",\"0xffffffffffffffff0000000000000000\",\"0x400080027fe17ffe\",\"0x480680017fff8000\",\"0x127500\",\"0x48127ffb7fff8000\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffd7ffc8000\",\"0x4824800180007fff\",\"0x10000000000000000\",\"0x400080037fdc7fff\",\"0x10780017fff7fff\",\"0x8f\",\"0x48307ffd7ffc8001\",\"0x4824800180007fff\",\"0xffffffffffffffff0000000000000000\",\"0x400080037fdc7ffe\",\"0x482480017fdc8000\",\"0x4\",\"0x48127ffb7fff8000\",\"0x48127fdc7fff8000\",\"0x480a7ff67fff8000\",\"0x48127fef7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127fef7fff8000\",\"0x40137ff37fff8003\",\"0x1104800180018000\",\"0x1cc7\",\"0x20680017fff7ffd\",\"0x67\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480a80037fff8000\",\"0x1104800180018000\",\"0x1d4e\",\"0x40137ffa7fff8002\",\"0x40137ffb7fff8001\",\"0x40137ffc7fff8000\",\"0x20680017fff7ffd\",\"0x49\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff67fff8000\",\"0x48127ff67fff8000\",\"0x480680017fff8000\",\"0x15\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ff37fff8000\",\"0x1104800180018000\",\"0x1dcc\",\"0x20680017fff7ffb\",\"0x28\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x456d69744576656e74\",\"0x4002800080007fff\",\"0x4002800180007ffe\",\"0x4002800280007ffa\",\"0x4002800380007ffb\",\"0x4002800480007ffc\",\"0x4002800580007ffd\",\"0x4802800780008000\",\"0x20680017fff7fff\",\"0x10\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80027fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0x8\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80027fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0xa\",\"0x480680017fff8000\",\"0x1\",\"0x4802800880008000\",\"0x4802800980008000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x2b5c\",\"0x480a80027fff8000\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x4ef2\",\"0x480a80027fff8000\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2598\",\"0x482480017fff8000\",\"0x2597\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xaeba\",\"0x48127ff27fff8000\",\"0x48307ffe7ff28000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2586\",\"0x482480017fff8000\",\"0x2585\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x10e32\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x7536345f616464204f766572666c6f77\",\"0x400080007ffe7fff\",\"0x482480017fd38000\",\"0x4\",\"0x48307ffc7ff28000\",\"0x48127fd37fff8000\",\"0x480a7ff67fff8000\",\"0x48127fe67fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x256b\",\"0x482480017fff8000\",\"0x256a\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x110d0\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x7536345f616464204f766572666c6f77\",\"0x400080007ffe7fff\",\"0x482480017fd88000\",\"0x3\",\"0x48307ffc7ff28000\",\"0x48127fd87fff8000\",\"0x480a7ff67fff8000\",\"0x48127feb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2550\",\"0x482480017fff8000\",\"0x254f\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x10e78\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7265553634202d206e6f6e20753634\",\"0x400080007ffe7fff\",\"0x482480017fd78000\",\"0x3\",\"0x48307ffc7fee8000\",\"0x48127fec7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x15\",\"0x40780017fff7fff\",\"0xc\",\"0x480080097fe28000\",\"0x1104800180018000\",\"0x2535\",\"0x482480017fff8000\",\"0x2534\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x11512\",\"0x48127fd77fff8000\",\"0x48307ffe7ff78000\",\"0x482480017fd88000\",\"0xd\",\"0x4800800b7fd78000\",\"0x4800800c7fd68000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fd27fff8000\",\"0x480a7ff67fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x480080027ff98000\",\"0x1104800180018000\",\"0x251a\",\"0x482480017fff8000\",\"0x2519\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x14532\",\"0x48127fee7fff8000\",\"0x48307ffe7ff78000\",\"0x48127fee7fff8000\",\"0x480a7ff67fff8000\",\"0x482480017fed8000\",\"0x6\",\"0x480680017fff8000\",\"0x1\",\"0x480080047feb8000\",\"0x480080057fea8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2505\",\"0x482480017fff8000\",\"0x2504\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x16efe\",\"0x48127ff27fff8000\",\"0x48307ffe7ff28000\",\"0x48127ff27fff8000\",\"0x480a7ff67fff8000\",\"0x48127ff17fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x3\",\"0x480a7ff37fff8000\",\"0x480a7ff47fff8000\",\"0x480a7ff57fff8000\",\"0x480a7ff77fff8000\",\"0x1104800180018000\",\"0x1b19\",\"0x20680017fff7ffd\",\"0xc7\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480a7ff67fff8000\",\"0x48127ff87fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffdaf\",\"0x20680017fff7ffd\",\"0xa4\",\"0x48127ff97fff8000\",\"0x20680017fff7ffe\",\"0x18\",\"0x1104800180018000\",\"0x24d5\",\"0x482480017fff8000\",\"0x24d4\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x10f68\",\"0x48127ff07fff8000\",\"0x48307ffe7ff78000\",\"0x48127ff07fff8000\",\"0x48127ff07fff8000\",\"0x48127ff07fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x48127ff77fff8000\",\"0x48127ffe7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x1104800180018000\",\"0x1b78\",\"0x20680017fff7ffd\",\"0x68\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x1104800180018000\",\"0x1bfe\",\"0x40137ffa7fff8002\",\"0x40137ffb7fff8001\",\"0x40137ffc7fff8000\",\"0x20680017fff7ffd\",\"0x49\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff67fff8000\",\"0x48127ff67fff8000\",\"0x480680017fff8000\",\"0x13\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ff37fff8000\",\"0x1104800180018000\",\"0x1c7c\",\"0x20680017fff7ffb\",\"0x28\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x456d69744576656e74\",\"0x4002800080007fff\",\"0x4002800180007ffe\",\"0x4002800280007ffa\",\"0x4002800380007ffb\",\"0x4002800480007ffc\",\"0x4002800580007ffd\",\"0x4802800780008000\",\"0x20680017fff7fff\",\"0x10\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80027fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0x8\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80027fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0xa\",\"0x480680017fff8000\",\"0x1\",\"0x4802800880008000\",\"0x4802800980008000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x2b5c\",\"0x480a80027fff8000\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x4ef2\",\"0x480a80027fff8000\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2448\",\"0x482480017fff8000\",\"0x2447\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xaeba\",\"0x48127ff27fff8000\",\"0x48307ffe7ff28000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2436\",\"0x482480017fff8000\",\"0x2435\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x11030\",\"0x48127ff17fff8000\",\"0x48307ffe7ff18000\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2422\",\"0x482480017fff8000\",\"0x2421\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x3\",\"0x482480017fff8000\",\"0x1778c\",\"0x48127ff27fff8000\",\"0x48307ffe7ff28000\",\"0x48127ff27fff8000\",\"0x480a7ff67fff8000\",\"0x48127ff17fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x9\",\"0x480a7ff37fff8000\",\"0x480a7ff47fff8000\",\"0x480a7ff57fff8000\",\"0x480a7ff77fff8000\",\"0x1104800180018000\",\"0x1a36\",\"0x20680017fff7ffd\",\"0x2e0\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0xcfc0e4c73ce8e46b07c3167ce01ce17e6c2deaaa5b88b977bbb10abe25c9ad\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff87fff\",\"0x400080017ff87ffc\",\"0x400080027ff87ffd\",\"0x400080037ff87ffe\",\"0x480080057ff88000\",\"0x20680017fff7fff\",\"0x2bc\",\"0x480080047ff78000\",\"0x480080067ff68000\",\"0x482480017ff58000\",\"0x7\",\"0x48127ffd7fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1\",\"0x48307ffe80007fff\",\"0x20680017fff7fff\",\"0x28d\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400080007ff87fff\",\"0x400080017ff87ffe\",\"0x480080037ff88000\",\"0x20680017fff7fff\",\"0x26f\",\"0x480080027ff78000\",\"0x480080047ff68000\",\"0x480080007fff8000\",\"0x48127fe67fff8000\",\"0x48127ffc7fff8000\",\"0x48127fe67fff8000\",\"0x480a7ff67fff8000\",\"0x482480017ff08000\",\"0x5\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x400180007ff48006\",\"0x400180017ff48007\",\"0x400180027ff48008\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffc9a\",\"0x20680017fff7ffd\",\"0x245\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x40137ff47fff8005\",\"0x1104800180018000\",\"0x1ce1\",\"0x40137ffa7fff8001\",\"0x40137ffb7fff8002\",\"0x40137ffc7fff8004\",\"0x20680017fff7ffd\",\"0x21e\",\"0x48127ff97fff8000\",\"0x20780017fff8005\",\"0x1c\",\"0x1104800180018000\",\"0x23ad\",\"0x482480017fff8000\",\"0x23ac\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1f216\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x554e4b4e4f574e5f494d504c454d454e544154494f4e\",\"0x400080007ffe7fff\",\"0x48127fee7fff8000\",\"0x48307ffc7ff58000\",\"0x480a80017fff8000\",\"0x480a80027fff8000\",\"0x480a80047fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127fff7fff8000\",\"0x4829800580018007\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff37fff\",\"0x10780017fff7fff\",\"0x1dd\",\"0x400080007ff47fff\",\"0x48127ffd7fff8000\",\"0x4828800780017ffa\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080017ff07fff\",\"0x10780017fff7fff\",\"0x1b8\",\"0x400080017ff17fff\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x482480017fef8000\",\"0x2\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x11\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ff37fff8000\",\"0x1104800180018000\",\"0x1b60\",\"0x20680017fff7ffb\",\"0x186\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x456d69744576656e74\",\"0x4002800080047fff\",\"0x4002800180047ffe\",\"0x4002800280047ffa\",\"0x4002800380047ffb\",\"0x4002800480047ffc\",\"0x4002800580047ffd\",\"0x4802800780048000\",\"0x20680017fff7fff\",\"0x168\",\"0x4802800680048000\",\"0x4826800180048000\",\"0x8\",\"0x48127ffe7fff8000\",\"0x20780017fff7ffd\",\"0x8\",\"0x48127ff37fff8000\",\"0x482480017ffe8000\",\"0x7b0c\",\"0x48127ffc7fff8000\",\"0x10780017fff7fff\",\"0x42\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0xcfc0e4c73ce8e46b07c3167ce01ce17e6c2deaaa5b88b977bbb10abe25c9ad\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080007ff97fff\",\"0x400080017ff97ffb\",\"0x400080027ff97ffc\",\"0x400080037ff97ffd\",\"0x400080047ff97ffe\",\"0x480080067ff98000\",\"0x20680017fff7fff\",\"0x135\",\"0x480080057ff88000\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x48127fea7fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0xf\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ff87fff8000\",\"0x48127ff57fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ff37fff8000\",\"0x402580017fe88003\",\"0x7\",\"0x1104800180018000\",\"0x1b19\",\"0x20680017fff7ffb\",\"0xfd\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x456d69744576656e74\",\"0x4002800080037fff\",\"0x4002800180037ffe\",\"0x4002800280037ffa\",\"0x4002800380037ffb\",\"0x4002800480037ffc\",\"0x4002800580037ffd\",\"0x4802800780038000\",\"0x20680017fff7fff\",\"0xdf\",\"0x4802800680038000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x4826800180038000\",\"0x8\",\"0x40137fff7fff8000\",\"0x20780017fff7ff9\",\"0x67\",\"0x40780017fff7fff\",\"0x1\",\"0x48297ffb80007ffc\",\"0x400080007ffe7fff\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x1104800180018000\",\"0x1cee\",\"0x20680017fff7ffd\",\"0x44\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x3ea3b9a8522d36784cb325f9c7e2ec3c9f3e6d63031a6c6b8743cc22412f604\",\"0x480680017fff8000\",\"0x4c69627261727943616c6c\",\"0x4002800080007fff\",\"0x4002800180007ffd\",\"0x4003800280007ffa\",\"0x4002800380007ffe\",\"0x4002800480007ffb\",\"0x4002800580007ffc\",\"0x4802800780008000\",\"0x20680017fff7fff\",\"0xc\",\"0x4802800680008000\",\"0x48127fff7fff8000\",\"0x4826800180008000\",\"0xa\",\"0x480680017fff8000\",\"0x0\",\"0x4802800880008000\",\"0x4802800980008000\",\"0x10780017fff7fff\",\"0xb\",\"0x4802800680008000\",\"0x482480017fff8000\",\"0x64\",\"0x4826800180008000\",\"0xa\",\"0x480680017fff8000\",\"0x1\",\"0x4802800880008000\",\"0x4802800980008000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127ff17fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x10780017fff7fff\",\"0x34\",\"0x1104800180018000\",\"0x22d6\",\"0x482480017fff8000\",\"0x22d5\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xe8d0\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4549435f4c49425f43414c4c5f4641494c4544\",\"0x400080007ffe7fff\",\"0x48127fe87fff8000\",\"0x48307ffc7ff18000\",\"0x480a80017fff8000\",\"0x480a80027fff8000\",\"0x48127fef7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x22bc\",\"0x482480017fff8000\",\"0x22bb\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x11878\",\"0x48127ff47fff8000\",\"0x48307ffe7ff48000\",\"0x480a80017fff8000\",\"0x480a80027fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffd7fff8000\",\"0x482480017ffd8000\",\"0x3886\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x5265706c616365436c617373\",\"0x400080007ffe7fff\",\"0x400080017ffe7ffd\",\"0x400180027ffe7ff8\",\"0x480080047ffe8000\",\"0x20680017fff7fff\",\"0xe\",\"0x480080037ffd8000\",\"0x48127fff7fff8000\",\"0x482480017ffb8000\",\"0x5\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0xb\",\"0x480080037ffd8000\",\"0x482480017fff8000\",\"0x64\",\"0x482480017ffb8000\",\"0x7\",\"0x480680017fff8000\",\"0x1\",\"0x480080057ff98000\",\"0x480080067ff88000\",\"0x20680017fff7ffd\",\"0x35\",\"0x48127ff57fff8000\",\"0x48127ffa7fff8000\",\"0x480a80017fff8000\",\"0x480a80027fff8000\",\"0x48127ff87fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x1104800180018000\",\"0x193e\",\"0x20680017fff7ffd\",\"0x12\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x1104800180018000\",\"0x19c4\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2264\",\"0x482480017fff8000\",\"0x2263\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x5b36\",\"0x48127ff27fff8000\",\"0x48307ffe7ff28000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2252\",\"0x482480017fff8000\",\"0x2251\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xbab8\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x5245504c4143455f434c4153535f484153485f4641494c4544\",\"0x400080007ffe7fff\",\"0x48127fec7fff8000\",\"0x48307ffc7ff18000\",\"0x480a80017fff8000\",\"0x480a80027fff8000\",\"0x48127fef7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x4802800680038000\",\"0x1104800180018000\",\"0x2237\",\"0x482480017fff8000\",\"0x2236\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x12214\",\"0x48307fff7ff88000\",\"0x4826800180038000\",\"0xa\",\"0x4802800880038000\",\"0x4802800980038000\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x4\",\"0x1104800180018000\",\"0x2224\",\"0x482480017fff8000\",\"0x2223\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x14d48\",\"0x48307fff7fef8000\",\"0x480a80037fff8000\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x48127fea7fff8000\",\"0x48127ffb7fff8000\",\"0x480a80017fff8000\",\"0x480a80027fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x480080057ff88000\",\"0x1104800180018000\",\"0x220b\",\"0x482480017fff8000\",\"0x220a\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x17354\",\"0x48127fe57fff8000\",\"0x48307ffe7ff78000\",\"0x480a80017fff8000\",\"0x480a80027fff8000\",\"0x482480017fec8000\",\"0x9\",\"0x480680017fff8000\",\"0x1\",\"0x480080077fea8000\",\"0x480080087fe98000\",\"0x208b7fff7fff7ffe\",\"0x4802800680048000\",\"0x1104800180018000\",\"0x21f5\",\"0x482480017fff8000\",\"0x21f4\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x19eb0\",\"0x48307fff7ff88000\",\"0x4826800180048000\",\"0xa\",\"0x4802800880048000\",\"0x4802800980048000\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x4\",\"0x1104800180018000\",\"0x21e2\",\"0x482480017fff8000\",\"0x21e1\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1c9e4\",\"0x48307fff7fef8000\",\"0x480a80047fff8000\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x48127fea7fff8000\",\"0x48127ffb7fff8000\",\"0x480a80017fff8000\",\"0x480a80027fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x21ca\",\"0x482480017fff8000\",\"0x21c9\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1eda2\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x494d504c454d454e544154494f4e5f45585049524544\",\"0x400080007ffe7fff\",\"0x482480017fe78000\",\"0x2\",\"0x48307ffc7ff28000\",\"0x480a80017fff8000\",\"0x480a80027fff8000\",\"0x480a80047fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x21af\",\"0x482480017fff8000\",\"0x21ae\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1ef78\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4e4f545f454e41424c45445f594554\",\"0x400080007ffe7fff\",\"0x482480017fea8000\",\"0x1\",\"0x48307ffc7ff28000\",\"0x480a80017fff8000\",\"0x480a80027fff8000\",\"0x480a80047fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2194\",\"0x482480017fff8000\",\"0x2193\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1f40a\",\"0x48127ff17fff8000\",\"0x48307ffe7ff18000\",\"0x480a80017fff8000\",\"0x480a80027fff8000\",\"0x480a80047fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2180\",\"0x482480017fff8000\",\"0x217f\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x3\",\"0x482480017fff8000\",\"0x25cce\",\"0x48127ff17fff8000\",\"0x48307ffe7ff18000\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x208b7fff7fff7ffe\",\"0x480080027ff78000\",\"0x1104800180018000\",\"0x216b\",\"0x482480017fff8000\",\"0x216a\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x2c600\",\"0x48127fe17fff8000\",\"0x48307ffe7ff78000\",\"0x48127fe17fff8000\",\"0x480a7ff67fff8000\",\"0x482480017feb8000\",\"0x6\",\"0x480680017fff8000\",\"0x1\",\"0x480080047fe98000\",\"0x480080057fe88000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2156\",\"0x482480017fff8000\",\"0x2155\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x2eea0\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x46494e414c495a4544\",\"0x400080007ffe7fff\",\"0x48127fe37fff8000\",\"0x48307ffc7ff28000\",\"0x48127fe37fff8000\",\"0x480a7ff67fff8000\",\"0x48127fed7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480080047ff78000\",\"0x1104800180018000\",\"0x213b\",\"0x482480017fff8000\",\"0x213a\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x2f3b4\",\"0x48127fec7fff8000\",\"0x48307ffe7ff78000\",\"0x48127fec7fff8000\",\"0x480a7ff67fff8000\",\"0x482480017feb8000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480080067fe98000\",\"0x480080077fe88000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2126\",\"0x482480017fff8000\",\"0x2125\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x31f10\",\"0x48127ff27fff8000\",\"0x48307ffe7ff28000\",\"0x48127ff27fff8000\",\"0x480a7ff67fff8000\",\"0x48127ff17fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x2\",\"0x480680017fff8000\",\"0x52c476292b358ba7d29adb58502341b4cc5437d07f67d3e285e085828bc820\",\"0x400280007ff37fff\",\"0x400380017ff37ff5\",\"0x480280027ff38000\",\"0x400280037ff37fff\",\"0x400380047ff37ff6\",\"0x480280057ff38000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff17ffc\",\"0x480280017ff17ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff17ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff17ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff17ffd\",\"0x400280027ff17ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff38000\",\"0x6\",\"0x482680017ff18000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ff47fff\",\"0x400380017ff47ff2\",\"0x400280027ff47ffc\",\"0x400280037ff47ffb\",\"0x480280057ff48000\",\"0x20680017fff7fff\",\"0x10a\",\"0x480280047ff48000\",\"0x480280067ff48000\",\"0x482680017ff48000\",\"0x7\",\"0x48127ffd7fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1\",\"0x48307ffe80007fff\",\"0x20680017fff7fff\",\"0xe0\",\"0x48127ffc7fff8000\",\"0x20780017fff7ff6\",\"0x1b\",\"0x1104800180018000\",\"0x20c4\",\"0x482480017fff8000\",\"0x20c3\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x7\",\"0x482480017fff8000\",\"0x1d100\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x494e56414c49445f4143434f554e545f41444452455353\",\"0x400080007ffe7fff\",\"0x48127feb7fff8000\",\"0x48307ffc7ff58000\",\"0x48127fe87fff8000\",\"0x48127fed7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x2e9f66c6eea14532c94ad25405a4fcb32faa4969559c128d837caa0ec50a655\",\"0x400080007ff27fff\",\"0x400180017ff27ff5\",\"0x480080027ff28000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007fee7ffc\",\"0x480080017fed7ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027feb7ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007fee7ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017fec7ffd\",\"0x400080027feb7ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff67fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017fe88000\",\"0x3\",\"0x482480017fe88000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007feb7fff\",\"0x400080017feb7ffb\",\"0x400080027feb7ffc\",\"0x400080037feb7ffa\",\"0x480080057feb8000\",\"0x20680017fff7fff\",\"0x77\",\"0x480080047fea8000\",\"0x48127ffc7fff8000\",\"0x48127ffe7fff8000\",\"0x48127ff97fff8000\",\"0x482480017fe68000\",\"0x7\",\"0x480080067fe58000\",\"0x1104800180018000\",\"0x1a93\",\"0x20680017fff7ffd\",\"0x5a\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480a7ff57fff8000\",\"0x480a7ff67fff8000\",\"0x1104800180018000\",\"0x1b1f\",\"0x40137ffb7fff8001\",\"0x40137ffc7fff8000\",\"0x20680017fff7ffd\",\"0x45\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x480a7ff77fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ff37fff8000\",\"0x1104800180018000\",\"0x1845\",\"0x20680017fff7ffb\",\"0x26\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x456d69744576656e74\",\"0x4002800080007fff\",\"0x4002800180007ffe\",\"0x4002800280007ffa\",\"0x4002800380007ffb\",\"0x4002800480007ffc\",\"0x4002800580007ffd\",\"0x4802800780008000\",\"0x20680017fff7fff\",\"0xf\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0x8\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0xa\",\"0x480680017fff8000\",\"0x1\",\"0x4802800880008000\",\"0x4802800980008000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x2b5c\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x4c36\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x10780017fff7fff\",\"0x26\",\"0x1104800180018000\",\"0x2016\",\"0x482480017fff8000\",\"0x2015\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x13510\",\"0x48127ff27fff8000\",\"0x48307ffe7ff28000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x48127ff37fff8000\",\"0x48127ff37fff8000\",\"0x10780017fff7fff\",\"0x14\",\"0x480080047fea8000\",\"0x1104800180018000\",\"0x2003\",\"0x482480017fff8000\",\"0x2002\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x6\",\"0x482480017fff8000\",\"0x19dca\",\"0x48127ff57fff8000\",\"0x48307ffe7ff78000\",\"0x48127ff27fff8000\",\"0x482480017fdf8000\",\"0x8\",\"0x480080067fde8000\",\"0x480080077fdd8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x1fe9\",\"0x482480017fff8000\",\"0x1fe8\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x7\",\"0x482480017fff8000\",\"0x1d2f4\",\"0x48127fee7fff8000\",\"0x48307ffe7ff48000\",\"0x48127feb7fff8000\",\"0x48127ff07fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x480280047ff48000\",\"0x1104800180018000\",\"0x1fd3\",\"0x482480017fff8000\",\"0x1fd2\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x7\",\"0x482480017fff8000\",\"0x1d6dc\",\"0x48127ff57fff8000\",\"0x48307ffe7ff78000\",\"0x48127ff27fff8000\",\"0x482680017ff48000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ff48000\",\"0x480280077ff48000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x2\",\"0x480680017fff8000\",\"0x52c476292b358ba7d29adb58502341b4cc5437d07f67d3e285e085828bc820\",\"0x400280007ff37fff\",\"0x400380017ff37ff5\",\"0x480280027ff38000\",\"0x400280037ff37fff\",\"0x400380047ff37ff6\",\"0x480280057ff38000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff17ffc\",\"0x480280017ff17ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff17ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff17ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff17ffd\",\"0x400280027ff17ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff38000\",\"0x6\",\"0x482680017ff18000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ff47fff\",\"0x400380017ff47ff2\",\"0x400280027ff47ffc\",\"0x400280037ff47ffb\",\"0x480280057ff48000\",\"0x20680017fff7fff\",\"0xee\",\"0x480280047ff48000\",\"0x480280067ff48000\",\"0x482680017ff48000\",\"0x7\",\"0x48127ffd7fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1\",\"0x48307ffe80007fff\",\"0x20680017fff7fff\",\"0x17\",\"0x1104800180018000\",\"0x1f74\",\"0x482480017fff8000\",\"0x1f73\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x7\",\"0x482480017fff8000\",\"0x1d22c\",\"0x48127fee7fff8000\",\"0x48307ffe7ff48000\",\"0x48127feb7fff8000\",\"0x48127ff07fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x2e9f66c6eea14532c94ad25405a4fcb32faa4969559c128d837caa0ec50a655\",\"0x400080007ff37fff\",\"0x400180017ff37ff5\",\"0x480080027ff38000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007fef7ffc\",\"0x480080017fee7ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027fec7ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007fef7ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017fed7ffd\",\"0x400080027fec7ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff37fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017fe98000\",\"0x3\",\"0x482480017fe98000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007fec7fff\",\"0x400080017fec7ffb\",\"0x400080027fec7ffc\",\"0x400080037fec7ffa\",\"0x480080057fec8000\",\"0x20680017fff7fff\",\"0x77\",\"0x480080047feb8000\",\"0x48127ffc7fff8000\",\"0x48127ffe7fff8000\",\"0x48127ff97fff8000\",\"0x482480017fe78000\",\"0x7\",\"0x480080067fe68000\",\"0x1104800180018000\",\"0x1947\",\"0x20680017fff7ffd\",\"0x5a\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480a7ff57fff8000\",\"0x480a7ff67fff8000\",\"0x1104800180018000\",\"0x1aec\",\"0x40137ffb7fff8001\",\"0x40137ffc7fff8000\",\"0x20680017fff7ffd\",\"0x45\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x480a7ff77fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ff37fff8000\",\"0x1104800180018000\",\"0x16f9\",\"0x20680017fff7ffb\",\"0x26\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x456d69744576656e74\",\"0x4002800080007fff\",\"0x4002800180007ffe\",\"0x4002800280007ffa\",\"0x4002800380007ffb\",\"0x4002800480007ffc\",\"0x4002800580007ffd\",\"0x4802800780008000\",\"0x20680017fff7fff\",\"0xf\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0x8\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0xa\",\"0x480680017fff8000\",\"0x1\",\"0x4802800880008000\",\"0x4802800980008000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x2b5c\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x4c36\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x10780017fff7fff\",\"0x26\",\"0x1104800180018000\",\"0x1eca\",\"0x482480017fff8000\",\"0x1ec9\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x13510\",\"0x48127ff27fff8000\",\"0x48307ffe7ff28000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x48127ff37fff8000\",\"0x48127ff37fff8000\",\"0x10780017fff7fff\",\"0x14\",\"0x480080047feb8000\",\"0x1104800180018000\",\"0x1eb7\",\"0x482480017fff8000\",\"0x1eb6\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x6\",\"0x482480017fff8000\",\"0x19dca\",\"0x48127ff57fff8000\",\"0x48307ffe7ff78000\",\"0x48127ff27fff8000\",\"0x482480017fe08000\",\"0x8\",\"0x480080067fdf8000\",\"0x480080077fde8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480280047ff48000\",\"0x1104800180018000\",\"0x1e9c\",\"0x482480017fff8000\",\"0x1e9b\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x7\",\"0x482480017fff8000\",\"0x1d614\",\"0x48127ff57fff8000\",\"0x48307ffe7ff78000\",\"0x48127ff27fff8000\",\"0x482680017ff48000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ff48000\",\"0x480280077ff48000\",\"0x208b7fff7fff7ffe\",\"0x4825800180007ffd\",\"0x3711c9d994faf6055172091cb841fd4831aa743e6f3315163b06a122c841846\",\"0x20680017fff7fff\",\"0x1b\",\"0x1104800180018000\",\"0x1e84\",\"0x482480017fff8000\",\"0x1e83\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x13c22\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x474f565f41444d494e5f43414e4e4f545f53454c465f52454d4f5645\",\"0x400080007ffe7fff\",\"0x480a7ff97fff8000\",\"0x48327ffc7ffa8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480a7ffa7fff8000\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffc7fff\",\"0x400280017ffc7ffe\",\"0x480280037ffc8000\",\"0x20680017fff7fff\",\"0x51\",\"0x480280027ffc8000\",\"0x480280047ffc8000\",\"0x48127ffe7fff8000\",\"0x480080007ffe8000\",\"0x480080017ffd8000\",\"0x480080027ffc8000\",\"0x480080037ffb8000\",\"0x480080047ffa8000\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280057ffc7fff\",\"0x400280067ffc7ff9\",\"0x480280087ffc8000\",\"0x20680017fff7fff\",\"0x2d\",\"0x480280077ffc8000\",\"0x480280097ffc8000\",\"0x480080027fff8000\",\"0x48307ff880007fff\",\"0x482680017ffc8000\",\"0xa\",\"0x48127ffb7fff8000\",\"0x20680017fff7ffd\",\"0xb\",\"0x480a7ff97fff8000\",\"0x48127ffe7fff8000\",\"0x480a7ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ff07fff8000\",\"0x1104800180018000\",\"0x1a15\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x1e42\",\"0x482480017fff8000\",\"0x1e41\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0xe3da\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f4e4c595f53454c465f43414e5f52454e4f554e4345\",\"0x400080007ffe7fff\",\"0x480a7ff97fff8000\",\"0x48307ffc7ff58000\",\"0x480a7ffb7fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480280077ffc8000\",\"0x1104800180018000\",\"0x1e28\",\"0x482480017fff8000\",\"0x1e27\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0xe75e\",\"0x480a7ff97fff8000\",\"0x48307ffe7ff78000\",\"0x480a7ffb7fff8000\",\"0x482680017ffc8000\",\"0xb\",\"0x480680017fff8000\",\"0x1\",\"0x480280097ffc8000\",\"0x4802800a7ffc8000\",\"0x208b7fff7fff7ffe\",\"0x480280027ffc8000\",\"0x1104800180018000\",\"0x1e13\",\"0x482480017fff8000\",\"0x1e12\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x11382\",\"0x480a7ff97fff8000\",\"0x48307ffe7ff78000\",\"0x480a7ffb7fff8000\",\"0x482680017ffc8000\",\"0x6\",\"0x480680017fff8000\",\"0x1\",\"0x480280047ffc8000\",\"0x480280057ffc8000\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8005\",\"0xe\",\"0x4825800180057ffd\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ffa7ffc\",\"0x480280017ffa7ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ffa7ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x480a7ffd7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ffa7ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ffa7ffd\",\"0x400280027ffa7ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ffa8000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffc7fff\",\"0x400380017ffc7ffb\",\"0x400280027ffc7ffd\",\"0x400280037ffc7ffc\",\"0x480280057ffc8000\",\"0x20680017fff7fff\",\"0x87\",\"0x480280047ffc8000\",\"0x480280067ffc8000\",\"0x482680017ffc8000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x57\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff48000\",\"0x1\",\"0x482480017ff58000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff87fff\",\"0x400080017ff87ffb\",\"0x400080027ff87ffc\",\"0x400080037ff87ffd\",\"0x480080057ff88000\",\"0x20680017fff7fff\",\"0x38\",\"0x480080047ff78000\",\"0x480080067ff68000\",\"0x482480017ff58000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x11\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x40780017fff7fff\",\"0xc\",\"0x482480017fec8000\",\"0x1\",\"0x482480017ff18000\",\"0x6b8\",\"0x48127fef7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fe17fff8000\",\"0x48127feb7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017ff18000\",\"0x3\",\"0x48127ff67fff8000\",\"0x48127ff47fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x1d\",\"0x40780017fff7fff\",\"0xb\",\"0x480080047fec8000\",\"0x48127ff17fff8000\",\"0x482480017ffe8000\",\"0x6a4\",\"0x482480017fe98000\",\"0x8\",\"0x480080067fe88000\",\"0x480080077fe78000\",\"0x10780017fff7fff\",\"0x23\",\"0x40780017fff7fff\",\"0xb\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fe68000\",\"0x3\",\"0x482480017feb8000\",\"0x2d8c\",\"0x48127fe97fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x16\",\"0x480280047ffc8000\",\"0x48127fe67fff8000\",\"0x482480017ffe8000\",\"0x3494\",\"0x482680017ffc8000\",\"0x8\",\"0x480280067ffc8000\",\"0x480280077ffc8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x208b7fff7fff7ffe\",\"0x400380007ffa7ffc\",\"0x400380017ffa7ffd\",\"0x480280027ffa8000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff87ffc\",\"0x480280017ff87ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff87ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff87ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff87ffd\",\"0x400280027ff87ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ffa8000\",\"0x3\",\"0x482680017ff88000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffb7fff\",\"0x400380017ffb7ff9\",\"0x400280027ffb7ffc\",\"0x400280037ffb7ffb\",\"0x480280057ffb8000\",\"0x20680017fff7fff\",\"0x89\",\"0x480280047ffb8000\",\"0x480280067ffb8000\",\"0x482680017ffb8000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x58\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff38000\",\"0x1\",\"0x482480017ff58000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff87fff\",\"0x400080017ff87ffb\",\"0x400080027ff87ffc\",\"0x400080037ff87ffd\",\"0x480080057ff88000\",\"0x20680017fff7fff\",\"0x39\",\"0x480080047ff78000\",\"0x480080067ff68000\",\"0x482480017ff58000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x12\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x40780017fff7fff\",\"0xc\",\"0x482480017fec8000\",\"0x1\",\"0x482480017ff18000\",\"0x6b8\",\"0x48127fde7fff8000\",\"0x48127fee7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fe07fff8000\",\"0x48127fea7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017ff18000\",\"0x3\",\"0x48127ff67fff8000\",\"0x48127ff47fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x1d\",\"0x40780017fff7fff\",\"0xb\",\"0x480080047fec8000\",\"0x48127ff17fff8000\",\"0x482480017ffe8000\",\"0x6a4\",\"0x482480017fe98000\",\"0x8\",\"0x480080067fe88000\",\"0x480080077fe78000\",\"0x10780017fff7fff\",\"0x24\",\"0x40780017fff7fff\",\"0xb\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fe68000\",\"0x3\",\"0x482480017feb8000\",\"0x2d8c\",\"0x48127fe97fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fde7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x16\",\"0x480280047ffb8000\",\"0x48127fe67fff8000\",\"0x482480017ffe8000\",\"0x3494\",\"0x482680017ffb8000\",\"0x8\",\"0x480280067ffb8000\",\"0x480280077ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fde7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x400380007ff97ffb\",\"0x400380017ff97ffc\",\"0x480280027ff98000\",\"0x400280037ff97fff\",\"0x400380047ff97ffd\",\"0x480280057ff98000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff77ffc\",\"0x480280017ff77ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff77ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff77ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff77ffd\",\"0x400280027ff77ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff98000\",\"0x6\",\"0x482680017ff78000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffa7fff\",\"0x400380017ffa7ff8\",\"0x400280027ffa7ffc\",\"0x400280037ffa7ffb\",\"0x480280057ffa8000\",\"0x20680017fff7fff\",\"0x89\",\"0x480280047ffa8000\",\"0x480280067ffa8000\",\"0x482680017ffa8000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x58\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff38000\",\"0x1\",\"0x482480017ff58000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff87fff\",\"0x400080017ff87ffb\",\"0x400080027ff87ffc\",\"0x400080037ff87ffd\",\"0x480080057ff88000\",\"0x20680017fff7fff\",\"0x39\",\"0x480080047ff78000\",\"0x480080067ff68000\",\"0x482480017ff58000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x12\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x40780017fff7fff\",\"0xc\",\"0x482480017fec8000\",\"0x1\",\"0x482480017ff18000\",\"0x6b8\",\"0x48127fde7fff8000\",\"0x48127fee7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fe07fff8000\",\"0x48127fea7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017ff18000\",\"0x3\",\"0x48127ff67fff8000\",\"0x48127ff47fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x1d\",\"0x40780017fff7fff\",\"0xb\",\"0x480080047fec8000\",\"0x48127ff17fff8000\",\"0x482480017ffe8000\",\"0x6a4\",\"0x482480017fe98000\",\"0x8\",\"0x480080067fe88000\",\"0x480080077fe78000\",\"0x10780017fff7fff\",\"0x24\",\"0x40780017fff7fff\",\"0xb\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fe68000\",\"0x3\",\"0x482480017feb8000\",\"0x2d8c\",\"0x48127fe97fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fde7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x16\",\"0x480280047ffa8000\",\"0x48127fe67fff8000\",\"0x482480017ffe8000\",\"0x3494\",\"0x482680017ffa8000\",\"0x8\",\"0x480280067ffa8000\",\"0x480280077ffa8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fde7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x2\",\"0x20780017fff7ffa\",\"0x1b\",\"0x1104800180018000\",\"0x1ba5\",\"0x482480017fff8000\",\"0x1ba4\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x1e23a\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x45524332303a207472616e736665722066726f6d2030\",\"0x400080007ffe7fff\",\"0x480a7ff67fff8000\",\"0x48327ffc7ff78000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480a7ff77fff8000\",\"0x20780017fff7ffb\",\"0x1b\",\"0x1104800180018000\",\"0x1b89\",\"0x482480017fff8000\",\"0x1b88\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x1e172\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x45524332303a207472616e7366657220746f2030\",\"0x400080007ffe7fff\",\"0x480a7ff67fff8000\",\"0x48307ffc7ff58000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x3a4e8ec16e258a799fe707996fd5d21d42b29adc1499a370edf7f809d8c458a\",\"0x400280007ff87fff\",\"0x400380017ff87ffa\",\"0x480280027ff88000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff67ffc\",\"0x480280017ff67ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff67ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff67ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff67ffd\",\"0x400280027ff67ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff67fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff88000\",\"0x3\",\"0x482680017ff68000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ff97fff\",\"0x400280017ff97ffb\",\"0x400280027ff97ffc\",\"0x400280037ff97ffa\",\"0x480280057ff98000\",\"0x20680017fff7fff\",\"0x354\",\"0x480280047ff98000\",\"0x480280067ff98000\",\"0x482680017ff98000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x321\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff28000\",\"0x1\",\"0x482480017ff58000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff87fff\",\"0x400080017ff87ffb\",\"0x400080027ff87ffc\",\"0x400080037ff87ffd\",\"0x480080057ff88000\",\"0x20680017fff7fff\",\"0x2f9\",\"0x480080047ff78000\",\"0x480080067ff68000\",\"0x482480017ff58000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x2c8\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x48287ffd80017ffb\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080017ff57fff\",\"0x40780017fff7fff\",\"0x1\",\"0x482480017ff48000\",\"0x2\",\"0x48127ffb7fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x9\",\"0x482480017ff48000\",\"0x2\",\"0x482480017ffb8000\",\"0xa\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48287ffc80017fe9\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff97fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ffa7fff\",\"0x40780017fff7fff\",\"0x5\",\"0x482480017ff58000\",\"0x1\",\"0x482480017ff58000\",\"0x208\",\"0x48127ff87fff8000\",\"0x48127ff47fff8000\",\"0x10780017fff7fff\",\"0x13\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48307ffe80017ff9\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0x26e\",\"0x400080017ff57fff\",\"0x482480017ff58000\",\"0x2\",\"0x48127ffc7fff8000\",\"0x48127ff97fff8000\",\"0x48127ffc7fff8000\",\"0x20680017fff7ff4\",\"0x258\",\"0x480680017fff8000\",\"0x3a4e8ec16e258a799fe707996fd5d21d42b29adc1499a370edf7f809d8c458a\",\"0x400080007fd87fff\",\"0x400180017fd87ffa\",\"0x480080027fd88000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff67ffc\",\"0x480080017ff57ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027ff37ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff67ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017ff47ffd\",\"0x400080027ff37ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff47fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017fce8000\",\"0x3\",\"0x482480017ff08000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080007fdc7fff\",\"0x400080017fdc7ffb\",\"0x400080027fdc7ffc\",\"0x400080037fdc7ffa\",\"0x400080047fdc7ff0\",\"0x480080067fdc8000\",\"0x20680017fff7fff\",\"0x20a\",\"0x480080057fdb8000\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff68000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080077fd67fff\",\"0x400080087fd67ffc\",\"0x400080097fd67ffd\",\"0x4000800a7fd67ffe\",\"0x4000800b7fd67feb\",\"0x4800800d7fd68000\",\"0x20680017fff7fff\",\"0x1e8\",\"0x4800800c7fd58000\",\"0x480680017fff8000\",\"0x3a4e8ec16e258a799fe707996fd5d21d42b29adc1499a370edf7f809d8c458a\",\"0x400080007ff47fff\",\"0x400180017ff47ffb\",\"0x480080027ff48000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff07ffc\",\"0x480080017fef7ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027fed7ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff07ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017fee7ffd\",\"0x400080027fed7ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff67fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017fea8000\",\"0x3\",\"0x482480017fea8000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x4000800e7fc67fff\",\"0x4000800f7fc67ffb\",\"0x400080107fc67ffc\",\"0x400080117fc67ffa\",\"0x480080137fc68000\",\"0x20680017fff7fff\",\"0x19b\",\"0x480080127fc58000\",\"0x480080147fc48000\",\"0x482480017fc38000\",\"0x15\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x16a\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff28000\",\"0x1\",\"0x482480017ff58000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff87fff\",\"0x400080017ff87ffb\",\"0x400080027ff87ffc\",\"0x400080037ff87ffd\",\"0x480080057ff88000\",\"0x20680017fff7fff\",\"0x144\",\"0x480080047ff78000\",\"0x480080067ff68000\",\"0x482480017ff58000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x115\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x48287ffd7ffb8001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080017ff57fff\",\"0x40780017fff7fff\",\"0x1\",\"0x482480017ff48000\",\"0x2\",\"0x48127ffb7fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x9\",\"0x482480017ff48000\",\"0x2\",\"0x482480017ffb8000\",\"0xa\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48287ffc7fe98001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080007ff97fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ffa7fff\",\"0x40780017fff7fff\",\"0x5\",\"0x482480017ff58000\",\"0x1\",\"0x482480017ff58000\",\"0x208\",\"0x48127ff87fff8000\",\"0x48127ff47fff8000\",\"0x10780017fff7fff\",\"0x13\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48307ffe7ff98001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0xbd\",\"0x400080017ff57fff\",\"0x482480017ff58000\",\"0x2\",\"0x48127ffc7fff8000\",\"0x48127ff97fff8000\",\"0x48127ffc7fff8000\",\"0x20680017fff7ff4\",\"0xa9\",\"0x480680017fff8000\",\"0x3a4e8ec16e258a799fe707996fd5d21d42b29adc1499a370edf7f809d8c458a\",\"0x400080007fd87fff\",\"0x400180017fd87ffb\",\"0x480080027fd88000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff67ffc\",\"0x480080017ff57ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027ff37ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff67ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017ff47ffd\",\"0x400080027ff37ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff47fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x402580017fce8001\",\"0x3\",\"0x482480017ff18000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080007fdd7fff\",\"0x400080017fdd7ffc\",\"0x400080027fdd7ffd\",\"0x400080037fdd7ffb\",\"0x400080047fdd7ff1\",\"0x480080067fdd8000\",\"0x20680017fff7fff\",\"0x64\",\"0x480080057fdc8000\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff78000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080077fd77fff\",\"0x400080087fd77ffc\",\"0x400080097fd77ffd\",\"0x4000800a7fd77ffe\",\"0x4000800b7fd77fec\",\"0x4800800d7fd78000\",\"0x20680017fff7fff\",\"0x4b\",\"0x4800800c7fd68000\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff47fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x19\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ff37fff8000\",\"0x402580017fc68000\",\"0xe\",\"0x1104800180018000\",\"0x1150\",\"0x20680017fff7ffb\",\"0x26\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x456d69744576656e74\",\"0x4002800080007fff\",\"0x4002800180007ffe\",\"0x4002800280007ffa\",\"0x4002800380007ffb\",\"0x4002800480007ffc\",\"0x4002800580007ffd\",\"0x4802800780008000\",\"0x20680017fff7fff\",\"0xf\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0x8\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0xa\",\"0x480680017fff8000\",\"0x1\",\"0x4802800880008000\",\"0x4802800980008000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x2b5c\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x4800800c7fd68000\",\"0x482480017fff8000\",\"0x4d58\",\"0x482480017fd48000\",\"0x10\",\"0x4800800e7fd38000\",\"0x4800800f7fd28000\",\"0x10780017fff7fff\",\"0xb\",\"0x40780017fff7fff\",\"0x6\",\"0x480080057fd68000\",\"0x482480017fff8000\",\"0x78dc\",\"0x482480017fd48000\",\"0x9\",\"0x480080077fd38000\",\"0x480080087fd28000\",\"0x48127ff27fff8000\",\"0x48127ffb7fff8000\",\"0x480a80017fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x190f\",\"0x482480017fff8000\",\"0x190e\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xa8c0\",\"0x48127ff67fff8000\",\"0x48307ffe7ff68000\",\"0x10780017fff7fff\",\"0xf\",\"0x40780017fff7fff\",\"0x3\",\"0x1104800180018000\",\"0x1901\",\"0x482480017fff8000\",\"0x1900\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xa9ce\",\"0x482480017feb8000\",\"0x2\",\"0x48307ffe7ff28000\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x753235365f616464204f766572666c6f77\",\"0x400080007ffe7fff\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x48127fcd7fff8000\",\"0x48127fdd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x18e7\",\"0x482480017fff8000\",\"0x18e6\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xadc0\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017feb8000\",\"0x3\",\"0x48307ffc7ff08000\",\"0x48127fee7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x2b\",\"0x40780017fff7fff\",\"0xb\",\"0x480080047fec8000\",\"0x1104800180018000\",\"0x18ce\",\"0x482480017fff8000\",\"0x18cd\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xb4c8\",\"0x48127feb7fff8000\",\"0x48307ffe7ff88000\",\"0x482480017fe38000\",\"0x8\",\"0x480080067fe28000\",\"0x480080077fe18000\",\"0x10780017fff7fff\",\"0x2b\",\"0x40780017fff7fff\",\"0xb\",\"0x1104800180018000\",\"0x18bc\",\"0x482480017fff8000\",\"0x18bb\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xdb4c\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fe08000\",\"0x3\",\"0x48307ffc7fe58000\",\"0x48127fe37fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x13\",\"0x40780017fff7fff\",\"0x16\",\"0x480080127faf8000\",\"0x1104800180018000\",\"0x18a3\",\"0x482480017fff8000\",\"0x18a2\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xe2b8\",\"0x48127fe07fff8000\",\"0x48307ffe7ff88000\",\"0x482480017fa68000\",\"0x16\",\"0x480080147fa58000\",\"0x480080157fa48000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fd87fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x4800800c7fd58000\",\"0x1104800180018000\",\"0x188b\",\"0x482480017fff8000\",\"0x188a\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1159e\",\"0x48307fff7ff88000\",\"0x482480017fcc8000\",\"0x10\",\"0x4800800e7fcb8000\",\"0x4800800f7fca8000\",\"0x10780017fff7fff\",\"0x14\",\"0x40780017fff7fff\",\"0x6\",\"0x480080057fd58000\",\"0x1104800180018000\",\"0x1877\",\"0x482480017fff8000\",\"0x1876\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x14122\",\"0x48307fff7ff88000\",\"0x482480017fcc8000\",\"0x9\",\"0x480080077fcb8000\",\"0x480080087fca8000\",\"0x48127feb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fe87fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x185f\",\"0x482480017fff8000\",\"0x185e\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x3\",\"0x482480017fff8000\",\"0x17368\",\"0x48127ff57fff8000\",\"0x48307ffe7ff58000\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x3\",\"0x1104800180018000\",\"0x184f\",\"0x482480017fff8000\",\"0x184e\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x3\",\"0x482480017fff8000\",\"0x17476\",\"0x482480017fea8000\",\"0x2\",\"0x48307ffe7ff18000\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x753235365f737562204f766572666c6f77\",\"0x400080007ffe7fff\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x48127fcc7fff8000\",\"0x48127fdc7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x1833\",\"0x482480017fff8000\",\"0x1832\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x3\",\"0x482480017fff8000\",\"0x17868\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fea8000\",\"0x3\",\"0x48307ffc7fef8000\",\"0x48127fed7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x2f\",\"0x40780017fff7fff\",\"0xb\",\"0x480080047fec8000\",\"0x1104800180018000\",\"0x1818\",\"0x482480017fff8000\",\"0x1817\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x3\",\"0x482480017fff8000\",\"0x17f70\",\"0x48127fea7fff8000\",\"0x48307ffe7ff78000\",\"0x482480017fe28000\",\"0x8\",\"0x480080067fe18000\",\"0x480080077fe08000\",\"0x10780017fff7fff\",\"0x2f\",\"0x40780017fff7fff\",\"0xb\",\"0x1104800180018000\",\"0x1804\",\"0x482480017fff8000\",\"0x1803\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x3\",\"0x482480017fff8000\",\"0x1a5f4\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fdf8000\",\"0x3\",\"0x48307ffc7fe48000\",\"0x48127fe27fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x15\",\"0x40780017fff7fff\",\"0x16\",\"0x480280047ff98000\",\"0x1104800180018000\",\"0x17e9\",\"0x482480017fff8000\",\"0x17e8\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x3\",\"0x482480017fff8000\",\"0x1ad60\",\"0x48127fdf7fff8000\",\"0x48307ffe7ff78000\",\"0x482680017ff98000\",\"0x8\",\"0x480280067ff98000\",\"0x480280077ff98000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fd77fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x3c87bf42ed4f01f11883bf54f43d91d2cbbd5fec26d1df9c74c57ae138800a4\",\"0x400280007ff87fff\",\"0x400380017ff87ffa\",\"0x480280027ff88000\",\"0x400280037ff87fff\",\"0x400380047ff87ffb\",\"0x480280057ff88000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff67ffc\",\"0x480280017ff67ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff67ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff67ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff67ffd\",\"0x400280027ff67ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff88000\",\"0x6\",\"0x482680017ff68000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ff97fff\",\"0x400380017ff97ff7\",\"0x400280027ff97ffc\",\"0x400280037ff97ffb\",\"0x480280057ff98000\",\"0x20680017fff7fff\",\"0x138\",\"0x480280047ff98000\",\"0x480280067ff98000\",\"0x482680017ff98000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x105\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff38000\",\"0x1\",\"0x482480017ff58000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff87fff\",\"0x400080017ff87ffb\",\"0x400080027ff87ffc\",\"0x400080037ff87ffd\",\"0x480080057ff88000\",\"0x20680017fff7fff\",\"0xdd\",\"0x480080047ff78000\",\"0x480080067ff68000\",\"0x482480017ff58000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0xac\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ff17fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ff68000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x48127fed7fff8000\",\"0x48127ff77fff8000\",\"0x4824800180007ffa\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x8\",\"0x40780017fff7fff\",\"0x2\",\"0x482480017ffa8000\",\"0xb4\",\"0x10780017fff7fff\",\"0xa\",\"0x48127ffc7fff8000\",\"0x4824800180007ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x7a\",\"0x48127ffe7fff8000\",\"0x48287ffd80017ffb\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff57fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ff67fff\",\"0x40780017fff7fff\",\"0x1\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x9\",\"0x482480017ff58000\",\"0x1\",\"0x482480017ffb8000\",\"0xa\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48287ffc80017ff3\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff97fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ffa7fff\",\"0x40780017fff7fff\",\"0x5\",\"0x482480017ff58000\",\"0x1\",\"0x482480017ff58000\",\"0x208\",\"0x48127ff87fff8000\",\"0x48127ff47fff8000\",\"0x10780017fff7fff\",\"0x13\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48307ffe80017ff9\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0x23\",\"0x400080017ff57fff\",\"0x482480017ff58000\",\"0x2\",\"0x48127ffc7fff8000\",\"0x48127ff97fff8000\",\"0x48127ffc7fff8000\",\"0x20680017fff7ff4\",\"0xd\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x48127fce7fff8000\",\"0x48127fde7fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x1104800180018000\",\"0xa7\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x16ee\",\"0x482480017fff8000\",\"0x16ed\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xaf14\",\"0x48127ff57fff8000\",\"0x48307ffe7ff58000\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x3\",\"0x1104800180018000\",\"0x16de\",\"0x482480017fff8000\",\"0x16dd\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xb022\",\"0x482480017fea8000\",\"0x2\",\"0x48307ffe7ff18000\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x753235365f737562204f766572666c6f77\",\"0x400080007ffe7fff\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x48127fc37fff8000\",\"0x48127fd37fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x16c2\",\"0x482480017fff8000\",\"0x16c1\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xbba8\",\"0x48127ff27fff8000\",\"0x48307ffe7ff68000\",\"0x48127fda7fff8000\",\"0x48127fea7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x16ad\",\"0x482480017fff8000\",\"0x16ac\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xb8c4\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fea8000\",\"0x3\",\"0x48307ffc7fef8000\",\"0x48127fed7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x2f\",\"0x40780017fff7fff\",\"0xb\",\"0x480080047fec8000\",\"0x1104800180018000\",\"0x1692\",\"0x482480017fff8000\",\"0x1691\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xbfcc\",\"0x48127fea7fff8000\",\"0x48307ffe7ff78000\",\"0x482480017fe28000\",\"0x8\",\"0x480080067fe18000\",\"0x480080077fe08000\",\"0x10780017fff7fff\",\"0x2f\",\"0x40780017fff7fff\",\"0xb\",\"0x1104800180018000\",\"0x167e\",\"0x482480017fff8000\",\"0x167d\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xe650\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fdf8000\",\"0x3\",\"0x48307ffc7fe48000\",\"0x48127fe27fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x15\",\"0x40780017fff7fff\",\"0x16\",\"0x480280047ff98000\",\"0x1104800180018000\",\"0x1663\",\"0x482480017fff8000\",\"0x1662\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xedbc\",\"0x48127fdf7fff8000\",\"0x48307ffe7ff78000\",\"0x482680017ff98000\",\"0x8\",\"0x480280067ff98000\",\"0x480280077ff98000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fd77fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x2\",\"0x20780017fff7ffa\",\"0x1b\",\"0x1104800180018000\",\"0x1646\",\"0x482480017fff8000\",\"0x1645\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xab7c\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x45524332303a20617070726f76652066726f6d2030\",\"0x400080007ffe7fff\",\"0x480a7ff67fff8000\",\"0x48327ffc7ff78000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480a7ff77fff8000\",\"0x20780017fff7ffb\",\"0x1b\",\"0x1104800180018000\",\"0x162a\",\"0x482480017fff8000\",\"0x1629\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xaab4\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x45524332303a20617070726f766520746f2030\",\"0x400080007ffe7fff\",\"0x480a7ff67fff8000\",\"0x48307ffc7ff58000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x3c87bf42ed4f01f11883bf54f43d91d2cbbd5fec26d1df9c74c57ae138800a4\",\"0x400280007ff87fff\",\"0x400380017ff87ffa\",\"0x480280027ff88000\",\"0x400280037ff87fff\",\"0x400380047ff87ffb\",\"0x480280057ff88000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff67ffc\",\"0x480280017ff67ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff67ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff67ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff67ffd\",\"0x400280027ff67ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x402780017ff88001\",\"0x6\",\"0x482680017ff68000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400280007ff97fff\",\"0x400280017ff97ffc\",\"0x400280027ff97ffd\",\"0x400280037ff97ffb\",\"0x400380047ff97ffc\",\"0x480280067ff98000\",\"0x20680017fff7fff\",\"0x64\",\"0x480280057ff98000\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff78000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400280077ff97fff\",\"0x400280087ff97ffc\",\"0x400280097ff97ffd\",\"0x4002800a7ff97ffe\",\"0x4003800b7ff97ffd\",\"0x4802800d7ff98000\",\"0x20680017fff7fff\",\"0x4b\",\"0x4802800c7ff98000\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff47fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x17\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ff37fff8000\",\"0x402780017ff98000\",\"0xe\",\"0x1104800180018000\",\"0xda8\",\"0x20680017fff7ffb\",\"0x26\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x456d69744576656e74\",\"0x4002800080007fff\",\"0x4002800180007ffe\",\"0x4002800280007ffa\",\"0x4002800380007ffb\",\"0x4002800480007ffc\",\"0x4002800580007ffd\",\"0x4802800780008000\",\"0x20680017fff7fff\",\"0xf\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0x8\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0xa\",\"0x480680017fff8000\",\"0x1\",\"0x4802800880008000\",\"0x4802800980008000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x2b5c\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x4802800c7ff98000\",\"0x482480017fff8000\",\"0x4d58\",\"0x482680017ff98000\",\"0x10\",\"0x4802800e7ff98000\",\"0x4802800f7ff98000\",\"0x10780017fff7fff\",\"0xb\",\"0x40780017fff7fff\",\"0x6\",\"0x480280057ff98000\",\"0x482480017fff8000\",\"0x78dc\",\"0x482680017ff98000\",\"0x9\",\"0x480280077ff98000\",\"0x480280087ff98000\",\"0x48127ff27fff8000\",\"0x48127ffb7fff8000\",\"0x480a80017fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffa7fff\",\"0x400380017ffa7ff8\",\"0x480280037ffa8000\",\"0x20680017fff7fff\",\"0x172\",\"0x480280027ffa8000\",\"0x480280047ffa8000\",\"0x480080027fff8000\",\"0x480680017fff8000\",\"0x3c87bf42ed4f01f11883bf54f43d91d2cbbd5fec26d1df9c74c57ae138800a4\",\"0x400280007ff97fff\",\"0x400280017ff97ffe\",\"0x480280027ff98000\",\"0x400280037ff97fff\",\"0x400380047ff97ffb\",\"0x480280057ff98000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff77ffc\",\"0x480280017ff77ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff77ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff77ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff77ffd\",\"0x400280027ff77ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff37fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff98000\",\"0x6\",\"0x482680017ff78000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280057ffa7fff\",\"0x400280067ffa7ffb\",\"0x400280077ffa7ffc\",\"0x400280087ffa7ffa\",\"0x4802800a7ffa8000\",\"0x20680017fff7fff\",\"0x11e\",\"0x480280097ffa8000\",\"0x4802800b7ffa8000\",\"0x482680017ffa8000\",\"0xc\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0xeb\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff28000\",\"0x1\",\"0x482480017ff58000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff87fff\",\"0x400080017ff87ffb\",\"0x400080027ff87ffc\",\"0x400080037ff87ffd\",\"0x480080057ff88000\",\"0x20680017fff7fff\",\"0xc3\",\"0x480080047ff78000\",\"0x480080067ff68000\",\"0x482480017ff58000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x92\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x48287ffd7ffb8001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080017ff57fff\",\"0x40780017fff7fff\",\"0x1\",\"0x482480017ff48000\",\"0x2\",\"0x48127ffb7fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x9\",\"0x482480017ff48000\",\"0x2\",\"0x482480017ffb8000\",\"0xa\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48287ffc7fe98001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080007ff97fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ffa7fff\",\"0x40780017fff7fff\",\"0x5\",\"0x482480017ff58000\",\"0x1\",\"0x482480017ff58000\",\"0x208\",\"0x48127ff87fff8000\",\"0x48127ff47fff8000\",\"0x10780017fff7fff\",\"0x13\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48307ffe7ff98001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0x38\",\"0x400080017ff57fff\",\"0x482480017ff58000\",\"0x2\",\"0x48127ffc7fff8000\",\"0x48127ff97fff8000\",\"0x48127ffc7fff8000\",\"0x20680017fff7ff4\",\"0x22\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x48127fd77fff8000\",\"0x48127fe77fff8000\",\"0x48127fc87fff8000\",\"0x480a7ffb7fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffe4e\",\"0x20680017fff7ffd\",\"0xd\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x147f\",\"0x482480017fff8000\",\"0x147e\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xb234\",\"0x48127ff57fff8000\",\"0x48307ffe7ff58000\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x3\",\"0x1104800180018000\",\"0x146f\",\"0x482480017fff8000\",\"0x146e\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xb342\",\"0x482480017fea8000\",\"0x2\",\"0x48307ffe7ff18000\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x753235365f616464204f766572666c6f77\",\"0x400080007ffe7fff\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x48127fcc7fff8000\",\"0x48127fdc7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x1453\",\"0x482480017fff8000\",\"0x1452\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xb734\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fea8000\",\"0x3\",\"0x48307ffc7fef8000\",\"0x48127fed7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x2f\",\"0x40780017fff7fff\",\"0xb\",\"0x480080047fec8000\",\"0x1104800180018000\",\"0x1438\",\"0x482480017fff8000\",\"0x1437\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xbe3c\",\"0x48127fea7fff8000\",\"0x48307ffe7ff78000\",\"0x482480017fe28000\",\"0x8\",\"0x480080067fe18000\",\"0x480080077fe08000\",\"0x10780017fff7fff\",\"0x2f\",\"0x40780017fff7fff\",\"0xb\",\"0x1104800180018000\",\"0x1424\",\"0x482480017fff8000\",\"0x1423\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xe4c0\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fdf8000\",\"0x3\",\"0x48307ffc7fe48000\",\"0x48127fe27fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x15\",\"0x40780017fff7fff\",\"0x16\",\"0x480280097ffa8000\",\"0x1104800180018000\",\"0x1409\",\"0x482480017fff8000\",\"0x1408\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xec2c\",\"0x48127fdf7fff8000\",\"0x48307ffe7ff78000\",\"0x482680017ffa8000\",\"0xd\",\"0x4802800b7ffa8000\",\"0x4802800c7ffa8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fd77fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480280027ffa8000\",\"0x1104800180018000\",\"0x13ef\",\"0x482480017fff8000\",\"0x13ee\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x1235e\",\"0x480a7ff77fff8000\",\"0x48307ffe7ff78000\",\"0x480a7ff97fff8000\",\"0x482680017ffa8000\",\"0x6\",\"0x480680017fff8000\",\"0x1\",\"0x480280047ffa8000\",\"0x480280057ffa8000\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffa7fff\",\"0x400380017ffa7ff8\",\"0x480280037ffa8000\",\"0x20680017fff7fff\",\"0x172\",\"0x480280027ffa8000\",\"0x480280047ffa8000\",\"0x480080027fff8000\",\"0x480680017fff8000\",\"0x3c87bf42ed4f01f11883bf54f43d91d2cbbd5fec26d1df9c74c57ae138800a4\",\"0x400280007ff97fff\",\"0x400280017ff97ffe\",\"0x480280027ff98000\",\"0x400280037ff97fff\",\"0x400380047ff97ffb\",\"0x480280057ff98000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff77ffc\",\"0x480280017ff77ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff77ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff77ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff77ffd\",\"0x400280027ff77ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff37fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff98000\",\"0x6\",\"0x482680017ff78000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280057ffa7fff\",\"0x400280067ffa7ffb\",\"0x400280077ffa7ffc\",\"0x400280087ffa7ffa\",\"0x4802800a7ffa8000\",\"0x20680017fff7fff\",\"0x11e\",\"0x480280097ffa8000\",\"0x4802800b7ffa8000\",\"0x482680017ffa8000\",\"0xc\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0xeb\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff28000\",\"0x1\",\"0x482480017ff58000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff87fff\",\"0x400080017ff87ffb\",\"0x400080027ff87ffc\",\"0x400080037ff87ffd\",\"0x480080057ff88000\",\"0x20680017fff7fff\",\"0xc3\",\"0x480080047ff78000\",\"0x480080067ff68000\",\"0x482480017ff58000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x92\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x48287ffd80017ffb\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080017ff57fff\",\"0x40780017fff7fff\",\"0x1\",\"0x482480017ff48000\",\"0x2\",\"0x48127ffb7fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x9\",\"0x482480017ff48000\",\"0x2\",\"0x482480017ffb8000\",\"0xa\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48287ffc80017fe9\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff97fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ffa7fff\",\"0x40780017fff7fff\",\"0x5\",\"0x482480017ff58000\",\"0x1\",\"0x482480017ff58000\",\"0x208\",\"0x48127ff87fff8000\",\"0x48127ff47fff8000\",\"0x10780017fff7fff\",\"0x13\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48307ffe80017ff9\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0x38\",\"0x400080017ff57fff\",\"0x482480017ff58000\",\"0x2\",\"0x48127ffc7fff8000\",\"0x48127ff97fff8000\",\"0x48127ffc7fff8000\",\"0x20680017fff7ff4\",\"0x22\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x48127fd77fff8000\",\"0x48127fe77fff8000\",\"0x48127fc87fff8000\",\"0x480a7ffb7fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffcc2\",\"0x20680017fff7ffd\",\"0xd\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x12f3\",\"0x482480017fff8000\",\"0x12f2\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xb234\",\"0x48127ff57fff8000\",\"0x48307ffe7ff58000\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x3\",\"0x1104800180018000\",\"0x12e3\",\"0x482480017fff8000\",\"0x12e2\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xb342\",\"0x482480017fea8000\",\"0x2\",\"0x48307ffe7ff18000\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x753235365f737562204f766572666c6f77\",\"0x400080007ffe7fff\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x48127fcc7fff8000\",\"0x48127fdc7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x12c7\",\"0x482480017fff8000\",\"0x12c6\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xb734\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fea8000\",\"0x3\",\"0x48307ffc7fef8000\",\"0x48127fed7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x2f\",\"0x40780017fff7fff\",\"0xb\",\"0x480080047fec8000\",\"0x1104800180018000\",\"0x12ac\",\"0x482480017fff8000\",\"0x12ab\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xbe3c\",\"0x48127fea7fff8000\",\"0x48307ffe7ff78000\",\"0x482480017fe28000\",\"0x8\",\"0x480080067fe18000\",\"0x480080077fe08000\",\"0x10780017fff7fff\",\"0x2f\",\"0x40780017fff7fff\",\"0xb\",\"0x1104800180018000\",\"0x1298\",\"0x482480017fff8000\",\"0x1297\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xe4c0\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fdf8000\",\"0x3\",\"0x48307ffc7fe48000\",\"0x48127fe27fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x15\",\"0x40780017fff7fff\",\"0x16\",\"0x480280097ffa8000\",\"0x1104800180018000\",\"0x127d\",\"0x482480017fff8000\",\"0x127c\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xec2c\",\"0x48127fdf7fff8000\",\"0x48307ffe7ff78000\",\"0x482680017ffa8000\",\"0xd\",\"0x4802800b7ffa8000\",\"0x4802800c7ffa8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fd77fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480280027ffa8000\",\"0x1104800180018000\",\"0x1263\",\"0x482480017fff8000\",\"0x1262\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x1235e\",\"0x480a7ff77fff8000\",\"0x48307ffe7ff78000\",\"0x480a7ff97fff8000\",\"0x482680017ffa8000\",\"0x6\",\"0x480680017fff8000\",\"0x1\",\"0x480280047ffa8000\",\"0x480280057ffa8000\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x341c1bdfd89f69748aa00b5742b03adbffd79b8e80cab5c50d91cd8c2a79be1\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400280007ff47fff\",\"0x400380017ff47ff2\",\"0x400280027ff47ffd\",\"0x400280037ff47ffe\",\"0x400380047ff47ff5\",\"0x480280067ff48000\",\"0x20680017fff7fff\",\"0xe2\",\"0x480280057ff48000\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0xb6ce5410fca59d078ee9b2a4371a9d684c530d697c64fbef0ae6d5e8f0ac72\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400280077ff47fff\",\"0x400280087ff47ffc\",\"0x400280097ff47ffd\",\"0x4002800a7ff47ffe\",\"0x4003800b7ff47ff6\",\"0x4802800d7ff48000\",\"0x20680017fff7fff\",\"0xc0\",\"0x4802800c7ff48000\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1f0d4aa99431d246bac9b8e48c33e888245b15e9678f64f9bdfc8823dc8f979\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x4002800e7ff47fff\",\"0x4002800f7ff47ffc\",\"0x400280107ff47ffd\",\"0x400280117ff47ffe\",\"0x400380127ff47ff7\",\"0x480280147ff48000\",\"0x20680017fff7fff\",\"0x9e\",\"0x480280137ff48000\",\"0x480a7ff17fff8000\",\"0x48127ffe7fff8000\",\"0x480a7ff37fff8000\",\"0x482680017ff48000\",\"0x15\",\"0x480a7ffa7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x1104800180018000\",\"0xd0\",\"0x20680017fff7ffd\",\"0x7e\",\"0x48127ffa7fff8000\",\"0x20780017fff7ffb\",\"0x1b\",\"0x1104800180018000\",\"0x1211\",\"0x482480017fff8000\",\"0x1210\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x9\",\"0x482480017fff8000\",\"0x2ea7c\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x494e56414c49445f4d494e5445525f41444452455353\",\"0x400080007ffe7fff\",\"0x48127fef7fff8000\",\"0x48307ffc7ff58000\",\"0x48127fef7fff8000\",\"0x48127fef7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1390569bb0a3a722eb4228e8700301347da081211d5c2ded2db22ef389551ab\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080007ff77fff\",\"0x400080017ff77ffc\",\"0x400080027ff77ffd\",\"0x400080037ff77ffe\",\"0x400180047ff77ffb\",\"0x480080067ff78000\",\"0x20680017fff7fff\",\"0x3e\",\"0x480080057ff68000\",\"0x48127ff27fff8000\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x482480017ff28000\",\"0x7\",\"0x480a7ffc7fff8000\",\"0x1104800180018000\",\"0xecb\",\"0x20680017fff7ffd\",\"0x29\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x3fc801c47df4de8d5835f8bfd4d0b8823ba63e5a3f278086901402d680abfc\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080007ff87fff\",\"0x400080017ff87ffc\",\"0x400080027ff87ffd\",\"0x400080037ff87ffe\",\"0x400180047ff87ffd\",\"0x480080067ff88000\",\"0x20680017fff7fff\",\"0xf\",\"0x480080057ff78000\",\"0x48127ff37fff8000\",\"0x48127ffe7fff8000\",\"0x48127ff37fff8000\",\"0x482480017ff38000\",\"0x7\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x480080057ff78000\",\"0x48127ff37fff8000\",\"0x48127ffe7fff8000\",\"0x48127ff37fff8000\",\"0x482480017ff38000\",\"0x9\",\"0x480680017fff8000\",\"0x1\",\"0x480080077ff18000\",\"0x480080087ff08000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x2bc0\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480080057ff68000\",\"0x1104800180018000\",\"0x11ac\",\"0x482480017fff8000\",\"0x11ab\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x9\",\"0x482480017fff8000\",\"0x2bfe8\",\"0x48127feb7fff8000\",\"0x48307ffe7ff78000\",\"0x48127feb7fff8000\",\"0x482480017feb8000\",\"0x9\",\"0x480680017fff8000\",\"0x1\",\"0x480080077fe98000\",\"0x480080087fe88000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x1198\",\"0x482480017fff8000\",\"0x1197\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x9\",\"0x482480017fff8000\",\"0x2ec70\",\"0x48127ff27fff8000\",\"0x48307ffe7ff28000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x208b7fff7fff7ffe\",\"0x480280137ff48000\",\"0x1104800180018000\",\"0x1184\",\"0x482480017fff8000\",\"0x1183\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0xb\",\"0x482480017fff8000\",\"0x4db5c\",\"0x48307fff7ff88000\",\"0x482680017ff48000\",\"0x17\",\"0x480280157ff48000\",\"0x480280167ff48000\",\"0x10780017fff7fff\",\"0x24\",\"0x4802800c7ff48000\",\"0x1104800180018000\",\"0x1172\",\"0x482480017fff8000\",\"0x1171\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0xb\",\"0x482480017fff8000\",\"0x5071c\",\"0x48307fff7ff88000\",\"0x482680017ff48000\",\"0x10\",\"0x4802800e7ff48000\",\"0x4802800f7ff48000\",\"0x10780017fff7fff\",\"0x12\",\"0x480280057ff48000\",\"0x1104800180018000\",\"0x1160\",\"0x482480017fff8000\",\"0x115f\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0xb\",\"0x482480017fff8000\",\"0x53340\",\"0x48307fff7ff88000\",\"0x482680017ff48000\",\"0x9\",\"0x480280077ff48000\",\"0x480280087ff48000\",\"0x480a7ff17fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ff37fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x2\",\"0x20780017fff7ffb\",\"0x1b\",\"0x1104800180018000\",\"0x1144\",\"0x482480017fff8000\",\"0x1143\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1e578\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x45524332303a206d696e7420746f2030\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x48327ffc7ff88000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480a7ff77fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffa7fff8000\",\"0x480680017fff8000\",\"0x110e2f729c9c2b988559994a3daccd838cf52faf88e18101373e67dd061455a\",\"0x1104800180018000\",\"0xedb\",\"0x20680017fff7ffd\",\"0x2a4\",\"0x48127ffb7fff8000\",\"0x48287ffd7ffe8001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080007ff67fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ff77fff\",\"0x40780017fff7fff\",\"0x1\",\"0x482480017ff68000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x9\",\"0x482480017ff68000\",\"0x1\",\"0x482480017ffb8000\",\"0xa\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48287ffc7ff68001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080007ff97fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ffa7fff\",\"0x40780017fff7fff\",\"0x5\",\"0x482480017ff58000\",\"0x1\",\"0x482480017ff58000\",\"0x208\",\"0x48127ff87fff8000\",\"0x48127ff47fff8000\",\"0x10780017fff7fff\",\"0x13\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48307ffe7ff98001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0x24d\",\"0x400080017ff57fff\",\"0x482480017ff58000\",\"0x2\",\"0x48127ffc7fff8000\",\"0x48127ff97fff8000\",\"0x48127ffc7fff8000\",\"0x20680017fff7ff4\",\"0x237\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x110e2f729c9c2b988559994a3daccd838cf52faf88e18101373e67dd061455a\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080007fe57fff\",\"0x400080017fe57ffc\",\"0x400080027fe57ffd\",\"0x400080037fe57ffe\",\"0x400080047fe57ffa\",\"0x480080067fe58000\",\"0x20680017fff7fff\",\"0x20d\",\"0x480080057fe48000\",\"0x480680017fff8000\",\"0x110e2f729c9c2b988559994a3daccd838cf52faf88e18101373e67dd061455a\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ffd8000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080077fde7fff\",\"0x400080087fde7ffc\",\"0x400080097fde7ffd\",\"0x4000800a7fde7ffe\",\"0x4000800b7fde7ff4\",\"0x4800800d7fde8000\",\"0x20680017fff7fff\",\"0x1e9\",\"0x4800800c7fdd8000\",\"0x480680017fff8000\",\"0x3a4e8ec16e258a799fe707996fd5d21d42b29adc1499a370edf7f809d8c458a\",\"0x400280007ff97fff\",\"0x400380017ff97ffb\",\"0x480280027ff98000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007fe97ffc\",\"0x480080017fe87ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027fe67ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007fe97ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017fe77ffd\",\"0x400080027fe67ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff67fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff98000\",\"0x3\",\"0x482480017fe38000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x4000800e7fce7fff\",\"0x4000800f7fce7ffb\",\"0x400080107fce7ffc\",\"0x400080117fce7ffa\",\"0x480080137fce8000\",\"0x20680017fff7fff\",\"0x19c\",\"0x480080127fcd8000\",\"0x480080147fcc8000\",\"0x482480017fcb8000\",\"0x15\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x16b\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff28000\",\"0x1\",\"0x482480017ff58000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff87fff\",\"0x400080017ff87ffb\",\"0x400080027ff87ffc\",\"0x400080037ff87ffd\",\"0x480080057ff88000\",\"0x20680017fff7fff\",\"0x145\",\"0x480080047ff78000\",\"0x480080067ff68000\",\"0x482480017ff58000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x116\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x48287ffd7ffb8001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080017ff57fff\",\"0x40780017fff7fff\",\"0x1\",\"0x482480017ff48000\",\"0x2\",\"0x48127ffb7fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x9\",\"0x482480017ff48000\",\"0x2\",\"0x482480017ffb8000\",\"0xa\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48287ffc7fe98001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080007ff97fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ffa7fff\",\"0x40780017fff7fff\",\"0x5\",\"0x482480017ff58000\",\"0x1\",\"0x482480017ff58000\",\"0x208\",\"0x48127ff87fff8000\",\"0x48127ff47fff8000\",\"0x10780017fff7fff\",\"0x13\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48307ffe7ff98001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0xbe\",\"0x400080017ff57fff\",\"0x482480017ff58000\",\"0x2\",\"0x48127ffc7fff8000\",\"0x48127ff97fff8000\",\"0x48127ffc7fff8000\",\"0x20680017fff7ff4\",\"0xaa\",\"0x480680017fff8000\",\"0x3a4e8ec16e258a799fe707996fd5d21d42b29adc1499a370edf7f809d8c458a\",\"0x400080007fd87fff\",\"0x400180017fd87ffb\",\"0x480080027fd88000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff67ffc\",\"0x480080017ff57ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027ff37ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff67ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017ff47ffd\",\"0x400080027ff37ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff47fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x402580017fce8001\",\"0x3\",\"0x482480017ff18000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080007fdd7fff\",\"0x400080017fdd7ffc\",\"0x400080027fdd7ffd\",\"0x400080037fdd7ffb\",\"0x400080047fdd7ff1\",\"0x480080067fdd8000\",\"0x20680017fff7fff\",\"0x65\",\"0x480080057fdc8000\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff78000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080077fd77fff\",\"0x400080087fd77ffc\",\"0x400080097fd77ffd\",\"0x4000800a7fd77ffe\",\"0x4000800b7fd77fec\",\"0x4800800d7fd78000\",\"0x20680017fff7fff\",\"0x4c\",\"0x4800800c7fd68000\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff47fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x19\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ff37fff8000\",\"0x402580017fc68000\",\"0xe\",\"0x1104800180018000\",\"0x79d\",\"0x20680017fff7ffb\",\"0x26\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x456d69744576656e74\",\"0x4002800080007fff\",\"0x4002800180007ffe\",\"0x4002800280007ffa\",\"0x4002800380007ffb\",\"0x4002800480007ffc\",\"0x4002800580007ffd\",\"0x4802800780008000\",\"0x20680017fff7fff\",\"0xf\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0x8\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0xa\",\"0x480680017fff8000\",\"0x1\",\"0x4802800880008000\",\"0x4802800980008000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x2b5c\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x4800800c7fd68000\",\"0x482480017fff8000\",\"0x4d58\",\"0x482480017fd48000\",\"0x10\",\"0x4800800e7fd38000\",\"0x4800800f7fd28000\",\"0x10780017fff7fff\",\"0xb\",\"0x40780017fff7fff\",\"0x6\",\"0x480080057fd68000\",\"0x482480017fff8000\",\"0x78dc\",\"0x482480017fd48000\",\"0x9\",\"0x480080077fd38000\",\"0x480080087fd28000\",\"0x48127ff27fff8000\",\"0x48127ffb7fff8000\",\"0x480a80017fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0xf5c\",\"0x482480017fff8000\",\"0xf5b\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xa8c0\",\"0x48127ff67fff8000\",\"0x48307ffe7ff68000\",\"0x10780017fff7fff\",\"0xf\",\"0x40780017fff7fff\",\"0x3\",\"0x1104800180018000\",\"0xf4e\",\"0x482480017fff8000\",\"0xf4d\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xa9ce\",\"0x482480017feb8000\",\"0x2\",\"0x48307ffe7ff28000\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x753235365f616464204f766572666c6f77\",\"0x400080007ffe7fff\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x48127fcd7fff8000\",\"0x48127fdd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0xf34\",\"0x482480017fff8000\",\"0xf33\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xadc0\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017feb8000\",\"0x3\",\"0x48307ffc7ff08000\",\"0x48127fee7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x2b\",\"0x40780017fff7fff\",\"0xb\",\"0x480080047fec8000\",\"0x1104800180018000\",\"0xf1b\",\"0x482480017fff8000\",\"0xf1a\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xb4c8\",\"0x48127feb7fff8000\",\"0x48307ffe7ff88000\",\"0x482480017fe38000\",\"0x8\",\"0x480080067fe28000\",\"0x480080077fe18000\",\"0x10780017fff7fff\",\"0x2b\",\"0x40780017fff7fff\",\"0xb\",\"0x1104800180018000\",\"0xf09\",\"0x482480017fff8000\",\"0xf08\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xdb4c\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fe08000\",\"0x3\",\"0x48307ffc7fe58000\",\"0x48127fe37fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x13\",\"0x40780017fff7fff\",\"0x16\",\"0x480080127fb78000\",\"0x1104800180018000\",\"0xef0\",\"0x482480017fff8000\",\"0xeef\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xe2b8\",\"0x48127fe07fff8000\",\"0x48307ffe7ff88000\",\"0x482480017fae8000\",\"0x16\",\"0x480080147fad8000\",\"0x480080157fac8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fd87fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x4800800c7fdd8000\",\"0x1104800180018000\",\"0xed8\",\"0x482480017fff8000\",\"0xed7\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1159e\",\"0x48307fff7ff88000\",\"0x482480017fd48000\",\"0x10\",\"0x4800800e7fd38000\",\"0x4800800f7fd28000\",\"0x10780017fff7fff\",\"0x14\",\"0x40780017fff7fff\",\"0x7\",\"0x480080057fdd8000\",\"0x1104800180018000\",\"0xec4\",\"0x482480017fff8000\",\"0xec3\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1417c\",\"0x48307fff7ff88000\",\"0x482480017fd48000\",\"0x9\",\"0x480080077fd38000\",\"0x480080087fd28000\",\"0x48127fe47fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ff97fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0xeac\",\"0x482480017fff8000\",\"0xeab\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x16d1e\",\"0x48127ff57fff8000\",\"0x48307ffe7ff58000\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x3\",\"0x1104800180018000\",\"0xe9c\",\"0x482480017fff8000\",\"0xe9b\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x16e2c\",\"0x482480017fea8000\",\"0x2\",\"0x48307ffe7ff18000\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x753235365f616464204f766572666c6f77\",\"0x400080007ffe7fff\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x480a7ff97fff8000\",\"0x48127fdb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0xe80\",\"0x482480017fff8000\",\"0xe7f\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x17a16\",\"0x48127ff37fff8000\",\"0x48307ffe7ff38000\",\"0x480a7ff97fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x2\",\"0x20780017fff7ffb\",\"0x1b\",\"0x1104800180018000\",\"0xe69\",\"0x482480017fff8000\",\"0xe68\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1e578\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x45524332303a206275726e2066726f6d2030\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x48327ffc7ff88000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480a7ff77fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffa7fff8000\",\"0x480680017fff8000\",\"0x110e2f729c9c2b988559994a3daccd838cf52faf88e18101373e67dd061455a\",\"0x1104800180018000\",\"0xc00\",\"0x20680017fff7ffd\",\"0x2a4\",\"0x48127ffb7fff8000\",\"0x48287ffd80017ffe\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff67fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ff77fff\",\"0x40780017fff7fff\",\"0x1\",\"0x482480017ff68000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x9\",\"0x482480017ff68000\",\"0x1\",\"0x482480017ffb8000\",\"0xa\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48287ffc80017ff6\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff97fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ffa7fff\",\"0x40780017fff7fff\",\"0x5\",\"0x482480017ff58000\",\"0x1\",\"0x482480017ff58000\",\"0x208\",\"0x48127ff87fff8000\",\"0x48127ff47fff8000\",\"0x10780017fff7fff\",\"0x13\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48307ffe80017ff9\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0x24d\",\"0x400080017ff57fff\",\"0x482480017ff58000\",\"0x2\",\"0x48127ffc7fff8000\",\"0x48127ff97fff8000\",\"0x48127ffc7fff8000\",\"0x20680017fff7ff4\",\"0x237\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x110e2f729c9c2b988559994a3daccd838cf52faf88e18101373e67dd061455a\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080007fe57fff\",\"0x400080017fe57ffc\",\"0x400080027fe57ffd\",\"0x400080037fe57ffe\",\"0x400080047fe57ffa\",\"0x480080067fe58000\",\"0x20680017fff7fff\",\"0x20d\",\"0x480080057fe48000\",\"0x480680017fff8000\",\"0x110e2f729c9c2b988559994a3daccd838cf52faf88e18101373e67dd061455a\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ffd8000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080077fde7fff\",\"0x400080087fde7ffc\",\"0x400080097fde7ffd\",\"0x4000800a7fde7ffe\",\"0x4000800b7fde7ff4\",\"0x4800800d7fde8000\",\"0x20680017fff7fff\",\"0x1e9\",\"0x4800800c7fdd8000\",\"0x480680017fff8000\",\"0x3a4e8ec16e258a799fe707996fd5d21d42b29adc1499a370edf7f809d8c458a\",\"0x400280007ff97fff\",\"0x400380017ff97ffb\",\"0x480280027ff98000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007fe97ffc\",\"0x480080017fe87ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027fe67ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007fe97ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017fe77ffd\",\"0x400080027fe67ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff67fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff98000\",\"0x3\",\"0x482480017fe38000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x4000800e7fce7fff\",\"0x4000800f7fce7ffb\",\"0x400080107fce7ffc\",\"0x400080117fce7ffa\",\"0x480080137fce8000\",\"0x20680017fff7fff\",\"0x19c\",\"0x480080127fcd8000\",\"0x480080147fcc8000\",\"0x482480017fcb8000\",\"0x15\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x16b\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff28000\",\"0x1\",\"0x482480017ff58000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff87fff\",\"0x400080017ff87ffb\",\"0x400080027ff87ffc\",\"0x400080037ff87ffd\",\"0x480080057ff88000\",\"0x20680017fff7fff\",\"0x145\",\"0x480080047ff78000\",\"0x480080067ff68000\",\"0x482480017ff58000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x116\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x48287ffd80017ffb\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080017ff57fff\",\"0x40780017fff7fff\",\"0x1\",\"0x482480017ff48000\",\"0x2\",\"0x48127ffb7fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x9\",\"0x482480017ff48000\",\"0x2\",\"0x482480017ffb8000\",\"0xa\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48287ffc80017fe9\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff97fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ffa7fff\",\"0x40780017fff7fff\",\"0x5\",\"0x482480017ff58000\",\"0x1\",\"0x482480017ff58000\",\"0x208\",\"0x48127ff87fff8000\",\"0x48127ff47fff8000\",\"0x10780017fff7fff\",\"0x13\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48307ffe80017ff9\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0xbe\",\"0x400080017ff57fff\",\"0x482480017ff58000\",\"0x2\",\"0x48127ffc7fff8000\",\"0x48127ff97fff8000\",\"0x48127ffc7fff8000\",\"0x20680017fff7ff4\",\"0xaa\",\"0x480680017fff8000\",\"0x3a4e8ec16e258a799fe707996fd5d21d42b29adc1499a370edf7f809d8c458a\",\"0x400080007fd87fff\",\"0x400180017fd87ffb\",\"0x480080027fd88000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff67ffc\",\"0x480080017ff57ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027ff37ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff67ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017ff47ffd\",\"0x400080027ff37ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff47fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x402580017fce8001\",\"0x3\",\"0x482480017ff18000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080007fdd7fff\",\"0x400080017fdd7ffc\",\"0x400080027fdd7ffd\",\"0x400080037fdd7ffb\",\"0x400080047fdd7ff1\",\"0x480080067fdd8000\",\"0x20680017fff7fff\",\"0x65\",\"0x480080057fdc8000\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff78000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080077fd77fff\",\"0x400080087fd77ffc\",\"0x400080097fd77ffd\",\"0x4000800a7fd77ffe\",\"0x4000800b7fd77fec\",\"0x4800800d7fd78000\",\"0x20680017fff7fff\",\"0x4c\",\"0x4800800c7fd68000\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff47fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x19\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ff37fff8000\",\"0x402580017fc68000\",\"0xe\",\"0x1104800180018000\",\"0x4c2\",\"0x20680017fff7ffb\",\"0x26\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x456d69744576656e74\",\"0x4002800080007fff\",\"0x4002800180007ffe\",\"0x4002800280007ffa\",\"0x4002800380007ffb\",\"0x4002800480007ffc\",\"0x4002800580007ffd\",\"0x4802800780008000\",\"0x20680017fff7fff\",\"0xf\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0x8\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0xa\",\"0x480680017fff8000\",\"0x1\",\"0x4802800880008000\",\"0x4802800980008000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x2b5c\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x4800800c7fd68000\",\"0x482480017fff8000\",\"0x4d58\",\"0x482480017fd48000\",\"0x10\",\"0x4800800e7fd38000\",\"0x4800800f7fd28000\",\"0x10780017fff7fff\",\"0xb\",\"0x40780017fff7fff\",\"0x6\",\"0x480080057fd68000\",\"0x482480017fff8000\",\"0x78dc\",\"0x482480017fd48000\",\"0x9\",\"0x480080077fd38000\",\"0x480080087fd28000\",\"0x48127ff27fff8000\",\"0x48127ffb7fff8000\",\"0x480a80017fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0xc81\",\"0x482480017fff8000\",\"0xc80\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xa8c0\",\"0x48127ff67fff8000\",\"0x48307ffe7ff68000\",\"0x10780017fff7fff\",\"0xf\",\"0x40780017fff7fff\",\"0x3\",\"0x1104800180018000\",\"0xc73\",\"0x482480017fff8000\",\"0xc72\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xa9ce\",\"0x482480017feb8000\",\"0x2\",\"0x48307ffe7ff28000\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x753235365f737562204f766572666c6f77\",\"0x400080007ffe7fff\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x48127fcd7fff8000\",\"0x48127fdd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0xc59\",\"0x482480017fff8000\",\"0xc58\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xadc0\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017feb8000\",\"0x3\",\"0x48307ffc7ff08000\",\"0x48127fee7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x2b\",\"0x40780017fff7fff\",\"0xb\",\"0x480080047fec8000\",\"0x1104800180018000\",\"0xc40\",\"0x482480017fff8000\",\"0xc3f\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xb4c8\",\"0x48127feb7fff8000\",\"0x48307ffe7ff88000\",\"0x482480017fe38000\",\"0x8\",\"0x480080067fe28000\",\"0x480080077fe18000\",\"0x10780017fff7fff\",\"0x2b\",\"0x40780017fff7fff\",\"0xb\",\"0x1104800180018000\",\"0xc2e\",\"0x482480017fff8000\",\"0xc2d\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xdb4c\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fe08000\",\"0x3\",\"0x48307ffc7fe58000\",\"0x48127fe37fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x13\",\"0x40780017fff7fff\",\"0x16\",\"0x480080127fb78000\",\"0x1104800180018000\",\"0xc15\",\"0x482480017fff8000\",\"0xc14\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xe2b8\",\"0x48127fe07fff8000\",\"0x48307ffe7ff88000\",\"0x482480017fae8000\",\"0x16\",\"0x480080147fad8000\",\"0x480080157fac8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fd87fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x4800800c7fdd8000\",\"0x1104800180018000\",\"0xbfd\",\"0x482480017fff8000\",\"0xbfc\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1159e\",\"0x48307fff7ff88000\",\"0x482480017fd48000\",\"0x10\",\"0x4800800e7fd38000\",\"0x4800800f7fd28000\",\"0x10780017fff7fff\",\"0x14\",\"0x40780017fff7fff\",\"0x7\",\"0x480080057fdd8000\",\"0x1104800180018000\",\"0xbe9\",\"0x482480017fff8000\",\"0xbe8\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1417c\",\"0x48307fff7ff88000\",\"0x482480017fd48000\",\"0x9\",\"0x480080077fd38000\",\"0x480080087fd28000\",\"0x48127fe47fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ff97fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0xbd1\",\"0x482480017fff8000\",\"0xbd0\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x16d1e\",\"0x48127ff57fff8000\",\"0x48307ffe7ff58000\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x3\",\"0x1104800180018000\",\"0xbc1\",\"0x482480017fff8000\",\"0xbc0\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x16e2c\",\"0x482480017fea8000\",\"0x2\",\"0x48307ffe7ff18000\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x753235365f737562204f766572666c6f77\",\"0x400080007ffe7fff\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x480a7ff97fff8000\",\"0x48127fdb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0xba5\",\"0x482480017fff8000\",\"0xba4\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x17a16\",\"0x48127ff37fff8000\",\"0x48307ffe7ff38000\",\"0x480a7ff97fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x208b7fff7fff7ffe\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xa\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x8\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xbb\",\"0x20680017fff7fff\",\"0x8a\",\"0x48307ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xa\",\"0x482480017ffb8000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480080007ff88000\",\"0x10780017fff7fff\",\"0x8\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x60\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffe\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480280007ffb7ffc\",\"0x480280017ffb7ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400280027ffb7ffd\",\"0x10780017fff7fff\",\"0x4c\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffd\",\"0x480280007ffb7ffd\",\"0x480280017ffb7ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400280027ffb7ffe\",\"0x482680017ffb8000\",\"0x3\",\"0x48127ff67fff8000\",\"0x48127ff67fff8000\",\"0x1104800180018000\",\"0x9c2\",\"0x20680017fff7ffa\",\"0x2a\",\"0x20680017fff7ffd\",\"0xb\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fd27fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x10780017fff7fff\",\"0xc\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffc\",\"0xc\",\"0x48127ff37fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x10780017fff7fff\",\"0x47\",\"0x40780017fff7fff\",\"0x4\",\"0x48127fef7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x10780017fff7fff\",\"0x1f\",\"0x40780017fff7fff\",\"0xd\",\"0x48127fec7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127fea7fff8000\",\"0x48127fea7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x2e\",\"0x482680017ffb8000\",\"0x3\",\"0x10780017fff7fff\",\"0x5\",\"0x40780017fff7fff\",\"0x34\",\"0x480a7ffb7fff8000\",\"0x48127fc77fff8000\",\"0x48127fc77fff8000\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x34\",\"0x4824800180007fcb\",\"0x1\",\"0x20680017fff7fff\",\"0x19\",\"0x480a7ffb7fff8000\",\"0x48127fc67fff8000\",\"0x48127fc67fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x7\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fbe7fff8000\",\"0x48127fbe7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x3c\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fbe7fff8000\",\"0x48127fbe7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x400380007ffd7ff6\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x1\",\"0x20780017fff7ff7\",\"0x21\",\"0x480680017fff8000\",\"0x0\",\"0x400080007ffe7fff\",\"0x400180017ffe7ff8\",\"0x48297ff980007ffa\",\"0x400080027ffd7fff\",\"0x480a7ff47fff8000\",\"0x480a7ff57fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x3\",\"0x1104800180018000\",\"0x48b\",\"0x20680017fff7ffd\",\"0x8\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x10780017fff7fff\",\"0x13\",\"0x48127ffb7fff8000\",\"0x482480017ffb8000\",\"0x3e8\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x1\",\"0x400080007ffe7fff\",\"0x480a7ff47fff8000\",\"0x482680017ff58000\",\"0xa0a\",\"0x48127ffb7fff8000\",\"0x482480017ffb8000\",\"0x1\",\"0x20780017fff7ffb\",\"0x7\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017ffd8000\",\"0x64\",\"0x480680017fff8000\",\"0x1\",\"0x400080007ffd7fff\",\"0x48127ffa7fff8000\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0xa70\",\"0x482480017fff8000\",\"0xa6f\",\"0x480080007fff8000\",\"0x480080037fff8000\",\"0x482480017fff8000\",\"0xc62\",\"0xa0680017fff8000\",\"0x8\",\"0x48317ffe80007ff6\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff57fff\",\"0x10780017fff7fff\",\"0x7f\",\"0x48317ffe80007ff6\",\"0x400280007ff57fff\",\"0x482680017ff58000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x65\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x48127ffc7fff8000\",\"0x480280007ffc8000\",\"0x48307ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffd7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff77fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffd7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x38\",\"0x480080007fff8000\",\"0x48327ff87ff98000\",\"0x48327ffe7ffa8000\",\"0x400280007ff77ffe\",\"0x400280017ff77fff\",\"0x400380027ff77ffb\",\"0x48127ff87fff8000\",\"0x482680017ff78000\",\"0x6\",\"0x480280037ff78000\",\"0x480280047ff78000\",\"0x480280057ff78000\",\"0xa0680017fff8000\",\"0x9\",\"0x4824800180007ffa\",\"0x816\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007fe87fff\",\"0x10780017fff7fff\",\"0x12\",\"0x4824800180007ffa\",\"0x816\",\"0x400080007fe97fff\",\"0x482480017fe98000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x48127ff87fff8000\",\"0x480a7ff87fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127feb7fff8000\",\"0x48127feb7fff8000\",\"0x1104800180018000\",\"0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffa9\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482480017fe68000\",\"0x1\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48327ff97ff98000\",\"0x482680017ffa8000\",\"0x1\",\"0x400280007ff77ffe\",\"0x400280017ff77fff\",\"0x400380027ff77ffb\",\"0x48127ff17fff8000\",\"0x482480017ff88000\",\"0x5be\",\"0x482680017ff78000\",\"0x6\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff67fff8000\",\"0x48127ff67fff8000\",\"0x480280037ff78000\",\"0x208b7fff7fff7ffe\",\"0x482680017ff98000\",\"0x1\",\"0x400280007ff77fff\",\"0x400380017ff77ffa\",\"0x400380027ff77ffb\",\"0x48127ffc7fff8000\",\"0x482480017ffc8000\",\"0xad2\",\"0x482680017ff78000\",\"0x6\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480280037ff78000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482680017ff58000\",\"0x1\",\"0x480a7ff67fff8000\",\"0x480a7ff77fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffd7fff\",\"0x400380017ffd7ffb\",\"0x480280037ffd8000\",\"0x20680017fff7fff\",\"0x7c\",\"0x480280027ffd8000\",\"0x480280047ffd8000\",\"0x480680017fff8000\",\"0x52c476292b358ba7d29adb58502341b4cc5437d07f67d3e285e085828bc820\",\"0x480680017fff8000\",\"0x251e864ca2a080f55bce5da2452e8cfcafdbc951a3e7fff5023d558452ec228\",\"0x400280007ffc7ffe\",\"0x400280017ffc7fff\",\"0x480280027ffc8000\",\"0x480080027ffc8000\",\"0x400280037ffc7ffe\",\"0x400280047ffc7fff\",\"0x480280057ffc8000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ffa7ffc\",\"0x480280017ffa7ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ffa7ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ffa7ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ffa7ffd\",\"0x400280027ffa7ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ffc8000\",\"0x6\",\"0x482680017ffa8000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280057ffd7fff\",\"0x400280067ffd7ffb\",\"0x400280077ffd7ffc\",\"0x400280087ffd7ffa\",\"0x4802800a7ffd8000\",\"0x20680017fff7fff\",\"0x34\",\"0x480280097ffd8000\",\"0x4802800b7ffd8000\",\"0x482680017ffd8000\",\"0xc\",\"0x48127ffd7fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1\",\"0x48307ffe80007fff\",\"0x20680017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f4e4c595f555047524144455f474f5645524e4f52\",\"0x400080007ffe7fff\",\"0x48127ff37fff8000\",\"0x48127ff97fff8000\",\"0x48127ff07fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x2\",\"0x48127ff37fff8000\",\"0x482480017ff98000\",\"0xb4\",\"0x48127ff07fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x9\",\"0x480280097ffd8000\",\"0x48127ff37fff8000\",\"0x482480017ffe8000\",\"0x456\",\"0x48127ff07fff8000\",\"0x482680017ffd8000\",\"0xd\",\"0x480680017fff8000\",\"0x1\",\"0x4802800b7ffd8000\",\"0x4802800c7ffd8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x16\",\"0x480280027ffd8000\",\"0x1104800180018000\",\"0x94e\",\"0x482480017fff8000\",\"0x94d\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x357a\",\"0x480a7ffa7fff8000\",\"0x48307ffe7ff78000\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x6\",\"0x480680017fff8000\",\"0x1\",\"0x480280047ffd8000\",\"0x480280057ffd8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480a7ff27fff8000\",\"0x480a7ff37fff8000\",\"0x480a7ff77fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff67fff8000\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffe7d\",\"0x20680017fff7ffd\",\"0x72\",\"0x1104800180018000\",\"0x92a\",\"0x482480017fff8000\",\"0x929\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x480a7ff57fff8000\",\"0x480080007ffc8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffeab\",\"0x20680017fff7ffc\",\"0x4f\",\"0x480680017fff8000\",\"0x1ac8d354f2e793629cb233a16f10d13cf15b9c45bbc620577c8e1df95ede545\",\"0x400280007ff47fff\",\"0x400280017ff47ffe\",\"0x480280027ff48000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027ff07ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff37ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017ff17ffd\",\"0x400080027ff07ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff17fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff48000\",\"0x3\",\"0x482480017fed8000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400280007ff67fff\",\"0x400280017ff67ffb\",\"0x400280027ff67ffc\",\"0x400280037ff67ffa\",\"0x400380047ff67ffd\",\"0x480280067ff68000\",\"0x20680017fff7fff\",\"0x10\",\"0x480280057ff68000\",\"0x48127ffc7fff8000\",\"0x48127ffe7fff8000\",\"0x48127ff97fff8000\",\"0x48127fe87fff8000\",\"0x482680017ff68000\",\"0x7\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x480280057ff68000\",\"0x48127ffc7fff8000\",\"0x48127ffe7fff8000\",\"0x48127ff97fff8000\",\"0x48127fe87fff8000\",\"0x482680017ff68000\",\"0x9\",\"0x480680017fff8000\",\"0x1\",\"0x480280077ff68000\",\"0x480280087ff68000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x8c9\",\"0x482480017fff8000\",\"0x8c8\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x2dbe\",\"0x48127ff37fff8000\",\"0x48307ffe7ff38000\",\"0x48127ff37fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x10780017fff7fff\",\"0xf\",\"0x1104800180018000\",\"0x8ba\",\"0x482480017fff8000\",\"0x8b9\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x3c78\",\"0x48127ff57fff8000\",\"0x48307ffe7ff58000\",\"0x480a7ff57fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ff47fff8000\",\"0x48127ffa7fff8000\",\"0x480a7ff67fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480a7ff27fff8000\",\"0x480a7ff37fff8000\",\"0x480a7ff77fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff67fff8000\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffde6\",\"0x20680017fff7ffd\",\"0x72\",\"0x1104800180018000\",\"0x893\",\"0x482480017fff8000\",\"0x892\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x480a7ff57fff8000\",\"0x480080007ffc8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffe14\",\"0x20680017fff7ffc\",\"0x4f\",\"0x480680017fff8000\",\"0x2a31bbb25d4dfa03fe73a91cbbab880b7c9cc4461880193ae5819ca6bbfe7cc\",\"0x400280007ff47fff\",\"0x400280017ff47ffe\",\"0x480280027ff48000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027ff07ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff37ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017ff17ffd\",\"0x400080027ff07ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff17fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff48000\",\"0x3\",\"0x482480017fed8000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400280007ff67fff\",\"0x400280017ff67ffb\",\"0x400280027ff67ffc\",\"0x400280037ff67ffa\",\"0x400380047ff67ffd\",\"0x480280067ff68000\",\"0x20680017fff7fff\",\"0x10\",\"0x480280057ff68000\",\"0x48127ffc7fff8000\",\"0x48127ffe7fff8000\",\"0x48127ff97fff8000\",\"0x48127fe87fff8000\",\"0x482680017ff68000\",\"0x7\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x480280057ff68000\",\"0x48127ffc7fff8000\",\"0x48127ffe7fff8000\",\"0x48127ff97fff8000\",\"0x48127fe87fff8000\",\"0x482680017ff68000\",\"0x9\",\"0x480680017fff8000\",\"0x1\",\"0x480280077ff68000\",\"0x480280087ff68000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x832\",\"0x482480017fff8000\",\"0x831\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x2dbe\",\"0x48127ff37fff8000\",\"0x48307ffe7ff38000\",\"0x48127ff37fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x10780017fff7fff\",\"0xf\",\"0x1104800180018000\",\"0x823\",\"0x482480017fff8000\",\"0x822\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x3c78\",\"0x48127ff57fff8000\",\"0x48307ffe7ff58000\",\"0x480a7ff57fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ff47fff8000\",\"0x48127ffa7fff8000\",\"0x480a7ff67fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x6\",\"0x10b7ff37fff7fff\",\"0x10780017fff7fff\",\"0x11d\",\"0x10780017fff7fff\",\"0x10c\",\"0x10780017fff7fff\",\"0xfb\",\"0x10780017fff7fff\",\"0xea\",\"0x10780017fff7fff\",\"0xd8\",\"0x10780017fff7fff\",\"0xc6\",\"0x10780017fff7fff\",\"0xb4\",\"0x10780017fff7fff\",\"0xa4\",\"0x10780017fff7fff\",\"0x7a\",\"0x10780017fff7fff\",\"0x50\",\"0x10780017fff7fff\",\"0x26\",\"0x10780017fff7fff\",\"0x13\",\"0x480680017fff8000\",\"0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9\",\"0x400280007ffb7fff\",\"0x400380007ffd7ff6\",\"0x400380017ffd7ff7\",\"0x400380027ffd7ff8\",\"0x400380037ffd7ff9\",\"0x482680017ff28000\",\"0x141e\",\"0x480a7ffa7fff8000\",\"0x482680017ffb8000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x4\",\"0x10780017fff7fff\",\"0x103\",\"0x480680017fff8000\",\"0x134692b230b9e1ffa39098904722134159652b09c5bc41d88d6698779d228ff\",\"0x400280007ffb7fff\",\"0x400380007ffd7ff6\",\"0x400380017ffd7ff7\",\"0x400380027ffd7ff8\",\"0x400380037ffd7ff9\",\"0x482680017ff28000\",\"0x13ba\",\"0x480a7ffa7fff8000\",\"0x482680017ffb8000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x4\",\"0x10780017fff7fff\",\"0xf2\",\"0x480680017fff8000\",\"0x38a81c7fd04bac40e22e3eab2bcb3a09398bba67d0c5a263c6665c9c0b13a3\",\"0x400280007ffb7fff\",\"0x480a7ff17fff8000\",\"0x480a7ff27fff8000\",\"0x480a7ff47fff8000\",\"0x480a7ff57fff8000\",\"0x480a7ff67fff8000\",\"0x480a7ff77fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x400b7ffa7fff8004\",\"0x402780017ffb8005\",\"0x1\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffd0e\",\"0x20680017fff7ffd\",\"0xb\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480a80047fff8000\",\"0x480a80057fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x7633a8d8b49c5c6002a1329e2c9791ea2ced86e06e01e17b5d0d1d5312c792\",\"0x400280007ffb7fff\",\"0x480a7ff17fff8000\",\"0x480a7ff27fff8000\",\"0x480a7ff47fff8000\",\"0x480a7ff57fff8000\",\"0x480a7ff67fff8000\",\"0x480a7ff77fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x400b7ffa7fff8002\",\"0x402780017ffb8003\",\"0x1\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffce6\",\"0x20680017fff7ffd\",\"0xb\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480a80027fff8000\",\"0x480a80037fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x34bb683f971572e1b0f230f3dd40f3dbcee94e0b3e3261dd0a91229a1adc4b7\",\"0x400280007ffb7fff\",\"0x480a7ff17fff8000\",\"0x480a7ff27fff8000\",\"0x480a7ff47fff8000\",\"0x480a7ff57fff8000\",\"0x480a7ff67fff8000\",\"0x480a7ff77fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x400b7ffa7fff8000\",\"0x402780017ffb8001\",\"0x1\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffcbe\",\"0x20680017fff7ffd\",\"0xb\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480a80007fff8000\",\"0x480a80017fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0xd1831486d8c46712712653f17d3414869aa50b4c16836d0b3d4afcfeafa024\",\"0x400280007ffb7fff\",\"0x400380007ffd7ff9\",\"0x482680017ff28000\",\"0x14e6\",\"0x480a7ffa7fff8000\",\"0x482680017ffb8000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x1\",\"0x10780017fff7fff\",\"0x6c\",\"0x480680017fff8000\",\"0x9d4a59b844ac9d98627ddba326ab3707a7d7e105fd03c777569d0f61a91f1e\",\"0x400280007ffb7fff\",\"0x400380007ffd7ff7\",\"0x400380017ffd7ff8\",\"0x400380027ffd7ff9\",\"0x482680017ff28000\",\"0x141e\",\"0x480a7ffa7fff8000\",\"0x482680017ffb8000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x3\",\"0x10780017fff7fff\",\"0x5c\",\"0x480680017fff8000\",\"0x2842fd3b01bb0858fef6a2da51cdd9f995c7d36d7625fb68dd5d69fcc0a6d76\",\"0x400280007ffb7fff\",\"0x400380007ffd7ff7\",\"0x400380017ffd7ff8\",\"0x400380027ffd7ff9\",\"0x482680017ff28000\",\"0x141e\",\"0x480a7ffa7fff8000\",\"0x482680017ffb8000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x3\",\"0x10780017fff7fff\",\"0x4c\",\"0x480680017fff8000\",\"0x2b23b0c08c7b22209aea4100552de1b7876a49f04ee5a4d94f83ad24bc4ec1c\",\"0x400280007ffb7fff\",\"0x400380007ffd7ff7\",\"0x400380017ffd7ff8\",\"0x400380027ffd7ff9\",\"0x482680017ff28000\",\"0x141e\",\"0x480a7ffa7fff8000\",\"0x482680017ffb8000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x3\",\"0x10780017fff7fff\",\"0x3c\",\"0x480680017fff8000\",\"0x3ae95723946e49d38f0cf844cef1fb25870e9a74999a4b96271625efa849b4c\",\"0x400280007ffb7fff\",\"0x400380007ffd7ff8\",\"0x400380017ffd7ff9\",\"0x482680017ff28000\",\"0x1482\",\"0x480a7ffa7fff8000\",\"0x482680017ffb8000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x2\",\"0x10780017fff7fff\",\"0x2d\",\"0x480680017fff8000\",\"0x2d8a82390cce552844e57407d23a1e48a38c4b979d525b1673171e503e116ab\",\"0x400280007ffb7fff\",\"0x400380007ffd7ff8\",\"0x400380017ffd7ff9\",\"0x482680017ff28000\",\"0x1482\",\"0x480a7ffa7fff8000\",\"0x482680017ffb8000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x2\",\"0x10780017fff7fff\",\"0x1e\",\"0x480680017fff8000\",\"0x2143175c365244751ccde24dd8f54f934672d6bc9110175c9e58e1e73705531\",\"0x400280007ffb7fff\",\"0x400380007ffd7ff8\",\"0x400380017ffd7ff9\",\"0x482680017ff28000\",\"0x1482\",\"0x480a7ffa7fff8000\",\"0x482680017ffb8000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x2\",\"0x10780017fff7fff\",\"0xf\",\"0x480680017fff8000\",\"0x25e2d538533284b9d61dfe45b9aaa563d33ef8374d9bb26d77a009b8e21f0de\",\"0x400280007ffb7fff\",\"0x400380007ffd7ff8\",\"0x400380017ffd7ff9\",\"0x482680017ff28000\",\"0x14e6\",\"0x480a7ffa7fff8000\",\"0x482680017ffb8000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x2\",\"0x480a7ff17fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480a7ff37fff8000\",\"0x480a7ff47fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff67fff8000\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffc19\",\"0x20680017fff7ffd\",\"0x9d\",\"0x1104800180018000\",\"0x6c6\",\"0x482480017fff8000\",\"0x6c5\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x480a7ff67fff8000\",\"0x480080007ffc8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffc47\",\"0x20680017fff7ffc\",\"0x7a\",\"0x480680017fff8000\",\"0x2a31bbb25d4dfa03fe73a91cbbab880b7c9cc4461880193ae5819ca6bbfe7cc\",\"0x400280007ff57fff\",\"0x400280017ff57ffe\",\"0x480280027ff58000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027ff07ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff37ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017ff17ffd\",\"0x400080027ff07ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff17fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff58000\",\"0x3\",\"0x482480017fed8000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ff77fff\",\"0x400280017ff77ffb\",\"0x400280027ff77ffc\",\"0x400280037ff77ffa\",\"0x480280057ff78000\",\"0x20680017fff7fff\",\"0x3b\",\"0x480280047ff78000\",\"0x480280067ff78000\",\"0x482680017ff78000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x12\",\"0x4824800180007ffc\",\"0x10000000000000000\",\"0x4844800180008002\",\"0x8000000000000110000000000000000\",\"0x4830800080017ffe\",\"0x480080007ff57fff\",\"0x482480017ffe8000\",\"0xefffffffffffffdeffffffffffffffff\",\"0x480080017ff37fff\",\"0x400080027ff27ffb\",\"0x402480017fff7ffb\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7fff\",\"0x15\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x482480017ffc8000\",\"0xffffffffffffffff0000000000000000\",\"0x400080017ff77fff\",\"0x482480017ff78000\",\"0x2\",\"0x482480017ffc8000\",\"0x3ca\",\"0x48127ff47fff8000\",\"0x48127fe37fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff47fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7265553634202d206e6f6e20753634\",\"0x400080007ffe7fff\",\"0x482480017ff08000\",\"0x3\",\"0x48127ff57fff8000\",\"0x48127fed7fff8000\",\"0x48127fdc7fff8000\",\"0x48127ff17fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480280047ff78000\",\"0x48127ffc7fff8000\",\"0x482480017ffe8000\",\"0x712\",\"0x48127ff97fff8000\",\"0x48127fe87fff8000\",\"0x482680017ff78000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ff78000\",\"0x480280077ff78000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x63a\",\"0x482480017fff8000\",\"0x639\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x346c\",\"0x48127ff37fff8000\",\"0x48307ffe7ff38000\",\"0x48127ff37fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x10780017fff7fff\",\"0xf\",\"0x1104800180018000\",\"0x62b\",\"0x482480017fff8000\",\"0x62a\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x4326\",\"0x48127ff57fff8000\",\"0x48307ffe7ff58000\",\"0x480a7ff67fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ff57fff8000\",\"0x48127ffa7fff8000\",\"0x480a7ff77fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ff98000\",\"0xfffffffffffffffffffffffffffff916\",\"0x400280007ff87fff\",\"0x10780017fff7fff\",\"0x22\",\"0x4825800180007ff9\",\"0x6ea\",\"0x400280007ff87fff\",\"0x482680017ff88000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x48297ffa80007ffb\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xf\",\"0x480280007ffa8000\",\"0x400280007ffd7fff\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x482680017ffa8000\",\"0x1\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x1\",\"0x1104800180018000\",\"0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffe5\",\"0x208b7fff7fff7ffe\",\"0x48127ffd7fff8000\",\"0x482480017ffd8000\",\"0x686\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482680017ff88000\",\"0x1\",\"0x480a7ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffc7fff\",\"0x400380017ffc7ffa\",\"0x480280037ffc8000\",\"0x20680017fff7fff\",\"0x7a\",\"0x480280027ffc8000\",\"0x480280047ffc8000\",\"0x480680017fff8000\",\"0x52c476292b358ba7d29adb58502341b4cc5437d07f67d3e285e085828bc820\",\"0x400280007ffb7fff\",\"0x400380017ffb7ffd\",\"0x480280027ffb8000\",\"0x480080027ffd8000\",\"0x400280037ffb7ffe\",\"0x400280047ffb7fff\",\"0x480280057ffb8000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff97ffc\",\"0x480280017ff97ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff97ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff97ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff97ffd\",\"0x400280027ff97ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff37fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ffb8000\",\"0x6\",\"0x482680017ff98000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280057ffc7fff\",\"0x400280067ffc7ffb\",\"0x400280077ffc7ffc\",\"0x400280087ffc7ffa\",\"0x4802800a7ffc8000\",\"0x20680017fff7fff\",\"0x34\",\"0x480280097ffc8000\",\"0x4802800b7ffc8000\",\"0x482680017ffc8000\",\"0xc\",\"0x48127ffd7fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1\",\"0x48307ffe80007fff\",\"0x20680017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x43414c4c45525f49535f4d495353494e475f524f4c45\",\"0x400080007ffe7fff\",\"0x48127ff37fff8000\",\"0x48127ff97fff8000\",\"0x48127ff07fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x2\",\"0x48127ff37fff8000\",\"0x482480017ff98000\",\"0xb4\",\"0x48127ff07fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x9\",\"0x480280097ffc8000\",\"0x48127ff37fff8000\",\"0x482480017ffe8000\",\"0x456\",\"0x48127ff07fff8000\",\"0x482680017ffc8000\",\"0xd\",\"0x480680017fff8000\",\"0x1\",\"0x4802800b7ffc8000\",\"0x4802800c7ffc8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x15\",\"0x480280027ffc8000\",\"0x1104800180018000\",\"0x55d\",\"0x482480017fff8000\",\"0x55c\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x3520\",\"0x480a7ff97fff8000\",\"0x48307ffe7ff78000\",\"0x480a7ffb7fff8000\",\"0x482680017ffc8000\",\"0x6\",\"0x480680017fff8000\",\"0x1\",\"0x480280047ffc8000\",\"0x480280057ffc8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x2\",\"0x480680017fff8000\",\"0x52c476292b358ba7d29adb58502341b4cc5437d07f67d3e285e085828bc820\",\"0x400280007ffa7fff\",\"0x400380017ffa7ffc\",\"0x480280027ffa8000\",\"0x400280037ffa7fff\",\"0x400380047ffa7ffd\",\"0x480280057ffa8000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff87ffc\",\"0x480280017ff87ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff87ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff87ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff87ffd\",\"0x400280027ff87ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ffa8000\",\"0x6\",\"0x482680017ff88000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffb7fff\",\"0x400380017ffb7ff9\",\"0x400280027ffb7ffc\",\"0x400280037ffb7ffb\",\"0x480280057ffb8000\",\"0x20680017fff7fff\",\"0xd0\",\"0x480280047ffb8000\",\"0x480280067ffb8000\",\"0x482680017ffb8000\",\"0x7\",\"0x48127ffd7fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1\",\"0x48307ffe80007fff\",\"0x20680017fff7fff\",\"0xa6\",\"0x480680017fff8000\",\"0x52c476292b358ba7d29adb58502341b4cc5437d07f67d3e285e085828bc820\",\"0x400080007ff37fff\",\"0x400180017ff37ffc\",\"0x480080027ff38000\",\"0x400080037ff27fff\",\"0x400180047ff27ffd\",\"0x480080057ff28000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007fee7ffc\",\"0x480080017fed7ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027feb7ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007fee7ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017fec7ffd\",\"0x400080027feb7ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1\",\"0x402580017fe78001\",\"0x6\",\"0x482480017fe88000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080007feb7fff\",\"0x400080017feb7ffb\",\"0x400080027feb7ffc\",\"0x400080037feb7ffa\",\"0x400080047feb7ffd\",\"0x480080067feb8000\",\"0x20680017fff7fff\",\"0x62\",\"0x480080057fea8000\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400080077fe77fff\",\"0x400080087fe77ffe\",\"0x4800800a7fe78000\",\"0x20680017fff7fff\",\"0x4d\",\"0x480080097fe68000\",\"0x4800800b7fe58000\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff57fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0xd\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480080027ff58000\",\"0x48127ff57fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ff37fff8000\",\"0x402580017fd58000\",\"0xc\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffc99\",\"0x20680017fff7ffb\",\"0x26\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x456d69744576656e74\",\"0x4002800080007fff\",\"0x4002800180007ffe\",\"0x4002800280007ffa\",\"0x4002800380007ffb\",\"0x4002800480007ffc\",\"0x4002800580007ffd\",\"0x4802800780008000\",\"0x20680017fff7fff\",\"0xf\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0x8\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0xa\",\"0x480680017fff8000\",\"0x1\",\"0x4802800880008000\",\"0x4802800980008000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x2b5c\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480080097fe68000\",\"0x48127ff87fff8000\",\"0x482480017ffe8000\",\"0x4fb0\",\"0x480a80017fff8000\",\"0x482480017fe28000\",\"0xd\",\"0x480680017fff8000\",\"0x1\",\"0x4800800b7fe08000\",\"0x4800800c7fdf8000\",\"0x208b7fff7fff7ffe\",\"0x480080057fea8000\",\"0x48127ffc7fff8000\",\"0x482480017ffe8000\",\"0x797c\",\"0x480a80017fff8000\",\"0x482480017fe68000\",\"0x9\",\"0x480680017fff8000\",\"0x1\",\"0x480080077fe48000\",\"0x480080087fe38000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x45a\",\"0x482480017fff8000\",\"0x459\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xaab4\",\"0x48127fee7fff8000\",\"0x48307ffe7ff48000\",\"0x48127feb7fff8000\",\"0x48127ff07fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x480280047ffb8000\",\"0x1104800180018000\",\"0x444\",\"0x482480017fff8000\",\"0x443\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xae9c\",\"0x48127ff57fff8000\",\"0x48307ffe7ff78000\",\"0x48127ff27fff8000\",\"0x482680017ffb8000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ffb8000\",\"0x480280077ffb8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x2\",\"0x480680017fff8000\",\"0x52c476292b358ba7d29adb58502341b4cc5437d07f67d3e285e085828bc820\",\"0x400280007ffa7fff\",\"0x400380017ffa7ffc\",\"0x480280027ffa8000\",\"0x400280037ffa7fff\",\"0x400380047ffa7ffd\",\"0x480280057ffa8000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff87ffc\",\"0x480280017ff87ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff87ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff87ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff87ffd\",\"0x400280027ff87ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ffa8000\",\"0x6\",\"0x482680017ff88000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffb7fff\",\"0x400380017ffb7ff9\",\"0x400280027ffb7ffc\",\"0x400280037ffb7ffb\",\"0x480280057ffb8000\",\"0x20680017fff7fff\",\"0xd0\",\"0x480280047ffb8000\",\"0x480280067ffb8000\",\"0x482680017ffb8000\",\"0x7\",\"0x48127ffd7fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1\",\"0x48307ffe80007fff\",\"0x20680017fff7fff\",\"0x17\",\"0x1104800180018000\",\"0x3e5\",\"0x482480017fff8000\",\"0x3e4\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xaab4\",\"0x48127fee7fff8000\",\"0x48307ffe7ff48000\",\"0x48127feb7fff8000\",\"0x48127ff07fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x52c476292b358ba7d29adb58502341b4cc5437d07f67d3e285e085828bc820\",\"0x400080007ff37fff\",\"0x400180017ff37ffc\",\"0x480080027ff38000\",\"0x400080037ff27fff\",\"0x400180047ff27ffd\",\"0x480080057ff28000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007fee7ffc\",\"0x480080017fed7ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027feb7ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007fee7ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017fec7ffd\",\"0x400080027feb7ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x402580017fe78001\",\"0x6\",\"0x482480017fe88000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080007feb7fff\",\"0x400080017feb7ffb\",\"0x400080027feb7ffc\",\"0x400080037feb7ffa\",\"0x400080047feb7ffd\",\"0x480080067feb8000\",\"0x20680017fff7fff\",\"0x62\",\"0x480080057fea8000\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400080077fe77fff\",\"0x400080087fe77ffe\",\"0x4800800a7fe78000\",\"0x20680017fff7fff\",\"0x4d\",\"0x480080097fe68000\",\"0x4800800b7fe58000\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff57fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0xb\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480080027ff58000\",\"0x48127ff57fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ff37fff8000\",\"0x402580017fd58000\",\"0xc\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffb6b\",\"0x20680017fff7ffb\",\"0x26\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x456d69744576656e74\",\"0x4002800080007fff\",\"0x4002800180007ffe\",\"0x4002800280007ffa\",\"0x4002800380007ffb\",\"0x4002800480007ffc\",\"0x4002800580007ffd\",\"0x4802800780008000\",\"0x20680017fff7fff\",\"0xf\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0x8\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0xa\",\"0x480680017fff8000\",\"0x1\",\"0x4802800880008000\",\"0x4802800980008000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x2b5c\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480080097fe68000\",\"0x48127ff87fff8000\",\"0x482480017ffe8000\",\"0x4fb0\",\"0x480a80017fff8000\",\"0x482480017fe28000\",\"0xd\",\"0x480680017fff8000\",\"0x1\",\"0x4800800b7fe08000\",\"0x4800800c7fdf8000\",\"0x208b7fff7fff7ffe\",\"0x480080057fea8000\",\"0x48127ffc7fff8000\",\"0x482480017ffe8000\",\"0x797c\",\"0x480a80017fff8000\",\"0x482480017fe68000\",\"0x9\",\"0x480680017fff8000\",\"0x1\",\"0x480080077fe48000\",\"0x480080087fe38000\",\"0x208b7fff7fff7ffe\",\"0x480280047ffb8000\",\"0x1104800180018000\",\"0x32b\",\"0x482480017fff8000\",\"0x32a\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xae9c\",\"0x48127ff57fff8000\",\"0x48307ffe7ff78000\",\"0x48127ff27fff8000\",\"0x482680017ffb8000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ffb8000\",\"0x480280077ffb8000\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x2e9f66c6eea14532c94ad25405a4fcb32faa4969559c128d837caa0ec50a655\",\"0x480680017fff8000\",\"0x3711c9d994faf6055172091cb841fd4831aa743e6f3315163b06a122c841846\",\"0x400280007ffb7ffe\",\"0x400280017ffb7fff\",\"0x480280027ffb8000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff97ffc\",\"0x480280017ff97ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff97ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff97ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff97ffd\",\"0x400280027ff97ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ffb8000\",\"0x3\",\"0x482680017ff98000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffc7fff\",\"0x400380017ffc7ffa\",\"0x400280027ffc7ffc\",\"0x400280037ffc7ffb\",\"0x480280057ffc8000\",\"0x20680017fff7fff\",\"0x86\",\"0x480280047ffc8000\",\"0x480280067ffc8000\",\"0x482680017ffc8000\",\"0x7\",\"0x48127ffd7fff8000\",\"0x20680017fff7ffd\",\"0x66\",\"0x48127fff7fff8000\",\"0x20780017fff7ffd\",\"0x1b\",\"0x1104800180018000\",\"0x2da\",\"0x482480017fff8000\",\"0x2d9\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x8\",\"0x482480017fff8000\",\"0x258be\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x5a45524f5f50524f564953494f4e414c5f474f565f41444d494e\",\"0x400080007ffe7fff\",\"0x48127fef7fff8000\",\"0x48307ffc7ff58000\",\"0x48127fec7fff8000\",\"0x48127ff17fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127ff87fff8000\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x3711c9d994faf6055172091cb841fd4831aa743e6f3315163b06a122c841846\",\"0x480a7ffd7fff8000\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffd72\",\"0x20680017fff7ffd\",\"0x2c\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x3711c9d994faf6055172091cb841fd4831aa743e6f3315163b06a122c841846\",\"0x480680017fff8000\",\"0x3711c9d994faf6055172091cb841fd4831aa743e6f3315163b06a122c841846\",\"0x1104800180018000\",\"0x1dd\",\"0x20680017fff7ffd\",\"0xd\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x251e864ca2a080f55bce5da2452e8cfcafdbc951a3e7fff5023d558452ec228\",\"0x480680017fff8000\",\"0x3711c9d994faf6055172091cb841fd4831aa743e6f3315163b06a122c841846\",\"0x1104800180018000\",\"0x1d1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x29f\",\"0x482480017fff8000\",\"0x29e\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xb496\",\"0x48127ff27fff8000\",\"0x48307ffe7ff28000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x28c\",\"0x482480017fff8000\",\"0x28b\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x16f08\",\"0x48127ff27fff8000\",\"0x48307ffe7ff28000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x279\",\"0x482480017fff8000\",\"0x278\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x8\",\"0x482480017fff8000\",\"0x25986\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x524f4c45535f414c52454144595f494e495449414c495a4544\",\"0x400080007ffe7fff\",\"0x48127ff07fff8000\",\"0x48307ffc7ff58000\",\"0x48127fed7fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480280047ffc8000\",\"0x1104800180018000\",\"0x25f\",\"0x482480017fff8000\",\"0x25e\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x8\",\"0x482480017fff8000\",\"0x25c42\",\"0x48127ff57fff8000\",\"0x48307ffe7ff78000\",\"0x48127ff27fff8000\",\"0x482680017ffc8000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ffc8000\",\"0x480280077ffc8000\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8005\",\"0xe\",\"0x4825800180057ffd\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ffa7ffc\",\"0x480280017ffa7ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ffa7ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x480a7ffd7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ffa7ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ffa7ffd\",\"0x400280027ffa7ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ffa8000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffc7fff\",\"0x400380017ffc7ffb\",\"0x400280027ffc7ffd\",\"0x400280037ffc7ffc\",\"0x480280057ffc8000\",\"0x20680017fff7fff\",\"0x87\",\"0x480280047ffc8000\",\"0x480280067ffc8000\",\"0x482680017ffc8000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x57\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff48000\",\"0x1\",\"0x482480017ff58000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff87fff\",\"0x400080017ff87ffb\",\"0x400080027ff87ffc\",\"0x400080037ff87ffd\",\"0x480080057ff88000\",\"0x20680017fff7fff\",\"0x38\",\"0x480080047ff78000\",\"0x480080067ff68000\",\"0x482480017ff58000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x11\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x40780017fff7fff\",\"0xc\",\"0x482480017fec8000\",\"0x1\",\"0x482480017ff18000\",\"0x6b8\",\"0x48127fef7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fe17fff8000\",\"0x48127feb7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017ff18000\",\"0x3\",\"0x48127ff67fff8000\",\"0x48127ff47fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x1d\",\"0x40780017fff7fff\",\"0xb\",\"0x480080047fec8000\",\"0x48127ff17fff8000\",\"0x482480017ffe8000\",\"0x6a4\",\"0x482480017fe98000\",\"0x8\",\"0x480080067fe88000\",\"0x480080077fe78000\",\"0x10780017fff7fff\",\"0x23\",\"0x40780017fff7fff\",\"0xb\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fe68000\",\"0x3\",\"0x482480017feb8000\",\"0x2d8c\",\"0x48127fe97fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x16\",\"0x480280047ffc8000\",\"0x48127fe67fff8000\",\"0x482480017ffe8000\",\"0x3494\",\"0x482680017ffc8000\",\"0x8\",\"0x480280067ffc8000\",\"0x480280077ffc8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x208b7fff7fff7ffe\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xa\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ffc7fff8000\",\"0x10780017fff7fff\",\"0x8\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x98\",\"0x480080007fff8000\",\"0xa0680017fff8000\",\"0x12\",\"0x4824800180007ffe\",\"0x100000000\",\"0x4844800180008002\",\"0x8000000000000110000000000000000\",\"0x4830800080017ffe\",\"0x480280007ffb7fff\",\"0x482480017ffe8000\",\"0xefffffffffffffde00000000ffffffff\",\"0x480280017ffb7fff\",\"0x400280027ffb7ffb\",\"0x402480017fff7ffb\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7fff\",\"0x78\",\"0x402780017fff7fff\",\"0x1\",\"0x400280007ffb7ffe\",\"0x482480017ffe8000\",\"0xffffffffffffffffffffffff00000000\",\"0x400280017ffb7fff\",\"0x480680017fff8000\",\"0x0\",\"0x48307ff880007ff9\",\"0x48307ffb7ffe8000\",\"0xa0680017fff8000\",\"0x8\",\"0x482480017ffd8000\",\"0x1\",\"0x48307fff80007ffd\",\"0x400280027ffb7fff\",\"0x10780017fff7fff\",\"0x51\",\"0x48307ffe80007ffd\",\"0x400280027ffb7fff\",\"0x48307ff480007ff5\",\"0x48307ffa7ff38000\",\"0x48307ffb7ff28000\",\"0x48307ff580017ffd\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400280037ffb7fff\",\"0x10780017fff7fff\",\"0x2f\",\"0x400280037ffb7fff\",\"0x48307fef80007ff0\",\"0x48307ffe7ff28000\",\"0xa0680017fff8000\",\"0x8\",\"0x482480017ffd8000\",\"0x1\",\"0x48307fff80007ffd\",\"0x400280047ffb7fff\",\"0x10780017fff7fff\",\"0x11\",\"0x48307ffe80007ffd\",\"0x400280047ffb7fff\",\"0x40780017fff7fff\",\"0x3\",\"0x482680017ffb8000\",\"0x5\",\"0x480680017fff8000\",\"0x0\",\"0x48307fea7fe68000\",\"0x48307ff77fe58000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff07fff8000\",\"0x48127ff07fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e646578206f7574206f6620626f756e6473\",\"0x400080007ffe7fff\",\"0x482680017ffb8000\",\"0x5\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x4\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x7533325f737562204f766572666c6f77\",\"0x400080007ffe7fff\",\"0x482680017ffb8000\",\"0x4\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x9\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e646578206f7574206f6620626f756e6473\",\"0x400080007ffe7fff\",\"0x482680017ffb8000\",\"0x3\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0xc\",\"0x482680017ffb8000\",\"0x3\",\"0x480680017fff8000\",\"0x0\",\"0x48127fe67fff8000\",\"0x48127fe67fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x14\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fe67fff8000\",\"0x48127fe67fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x2\",\"0x480680017fff8000\",\"0x2e9f66c6eea14532c94ad25405a4fcb32faa4969559c128d837caa0ec50a655\",\"0x400280007ffa7fff\",\"0x400380017ffa7ffc\",\"0x480280027ffa8000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff87ffc\",\"0x480280017ff87ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff87ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff87ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff87ffd\",\"0x400280027ff87ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ffa8000\",\"0x3\",\"0x482680017ff88000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffb7fff\",\"0x400380017ffb7ff9\",\"0x400280027ffb7ffc\",\"0x400280037ffb7ffb\",\"0x480280057ffb8000\",\"0x20680017fff7fff\",\"0x8d\",\"0x480280047ffb8000\",\"0x480680017fff8000\",\"0x2e9f66c6eea14532c94ad25405a4fcb32faa4969559c128d837caa0ec50a655\",\"0x400080007ffa7fff\",\"0x400180017ffa7ffc\",\"0x480080027ffa8000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff67ffc\",\"0x480080017ff57ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027ff37ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff67ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017ff47ffd\",\"0x400080027ff37ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff67fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280067ffb8000\",\"0x402580017fef8001\",\"0x3\",\"0x482480017ff08000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400280077ffb7fff\",\"0x400280087ffb7ffb\",\"0x400280097ffb7ffc\",\"0x4002800a7ffb7ffa\",\"0x4003800b7ffb7ffd\",\"0x4802800d7ffb8000\",\"0x20680017fff7fff\",\"0x4c\",\"0x4802800c7ffb8000\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x9\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ffc7fff8000\",\"0x48127ff27fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ff37fff8000\",\"0x402780017ffb8000\",\"0xe\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffff846\",\"0x20680017fff7ffb\",\"0x26\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x456d69744576656e74\",\"0x4002800080007fff\",\"0x4002800180007ffe\",\"0x4002800280007ffa\",\"0x4002800380007ffb\",\"0x4002800480007ffc\",\"0x4002800580007ffd\",\"0x4802800780008000\",\"0x20680017fff7fff\",\"0xf\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0x8\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0xa\",\"0x480680017fff8000\",\"0x1\",\"0x4802800880008000\",\"0x4802800980008000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x2b5c\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x4802800c7ffb8000\",\"0x48127ffc7fff8000\",\"0x482480017ffe8000\",\"0x4f4c\",\"0x480a80017fff8000\",\"0x482680017ffb8000\",\"0x10\",\"0x480680017fff8000\",\"0x1\",\"0x4802800e7ffb8000\",\"0x4802800f7ffb8000\",\"0x208b7fff7fff7ffe\",\"0x480280047ffb8000\",\"0x1104800180018000\",\"0x12\",\"0x482480017fff8000\",\"0x11\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x7fbc\",\"0x48127ff67fff8000\",\"0x48307ffe7ff88000\",\"0x48127ff37fff8000\",\"0x482680017ffb8000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ffb8000\",\"0x480280077ffb8000\",\"0x208b7fff7fff7ffe\"],\"bytecode_segment_lengths\":[332,332,332,332,170,168,168,168,168,296,191,272,272,245,245,245,245,146,125,125,170,115,196,272,375,483,375,346,346,115,196,483,346,346,685,167,167,193,194,379,227,764,339,311,137,193,201,204,985,390,227,396,396,263,731,731,224,66,158,152,151,151,310,194,53,150,281,281,204,193,185,209],\"compiler_version\":\"2.10.0\",\"entry_points_by_type\":{\"CONSTRUCTOR\":[{\"builtins\":[\"pedersen\",\"range_check\"],\"offset\":8741,\"selector\":\"0x28ffe4ff0f226a9107253e17a904099aa4f63a02a5621de0576e5aa71bc5194\"}],\"EXTERNAL\":[{\"builtins\":[\"pedersen\",\"range_check\"],\"offset\":3936,\"selector\":\"0xb2ef42a25c95687d1a3e7c2584885fd4058d102e05c44f65cf35988451bc8\"},{\"builtins\":[\"pedersen\",\"range_check\",\"poseidon\"],\"offset\":2002,\"selector\":\"0xc30ffbeb949d3447fd4acd61251803e8ab9c8a777318abb5bd5fbf28015eb\"},{\"builtins\":[\"pedersen\",\"range_check\"],\"offset\":664,\"selector\":\"0x151e58b29179122a728eab07c8847e5baf5802379c5db3a7d57a8263a7bd1d\"},{\"builtins\":[\"pedersen\",\"range_check\"],\"offset\":7566,\"selector\":\"0x41b033f4a31df8067c24d1e9b550a2ce75fd4a29e1147af9752174f0e6cb20\"},{\"builtins\":[\"range_check\"],\"offset\":4577,\"selector\":\"0x4c4fb1ab068f6039d5780c68dd0fa2f8742cceb3426d19667778ca7f3518a9\"},{\"builtins\":[\"range_check\"],\"offset\":7255,\"selector\":\"0x80aa9fdbfaf9615e4afc7f5f722e265daca5ccc655360fa5ccacf9c267936d\"},{\"builtins\":[\"pedersen\",\"range_check\"],\"offset\":5330,\"selector\":\"0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e\"},{\"builtins\":[\"pedersen\",\"range_check\"],\"offset\":4181,\"selector\":\"0x95604234097c6fe6314943092b1aa8fb6ee781cf32ac6d5b78d856f52a540f\"},{\"builtins\":[\"pedersen\",\"range_check\"],\"offset\":996,\"selector\":\"0xd63a78e4cd7fb4c41bc18d089154af78d400a5e837f270baea6cf8db18c8dd\"},{\"builtins\":[\"range_check\"],\"offset\":4747,\"selector\":\"0x1557182e4359a1f0c6301278e8f5b35a776ab58d39892581e357578fb287836\"},{\"builtins\":[\"pedersen\",\"range_check\"],\"offset\":8049,\"selector\":\"0x16cc063b8338363cf388ce7fe1df408bf10f16cd51635d392e21d852fafb683\"},{\"builtins\":[\"pedersen\",\"range_check\"],\"offset\":3201,\"selector\":\"0x183420eb7aafd9caad318b543d9252c94857340f4768ac83cf4b6472f0bf515\"},{\"builtins\":[\"pedersen\",\"range_check\"],\"offset\":8395,\"selector\":\"0x1aaf3e6107dd1349c81543ff4221a326814f77dadcc5810807b74f1a49ded4e\"},{\"builtins\":[\"pedersen\",\"range_check\"],\"offset\":0,\"selector\":\"0x1c67057e2995950900dbf33db0f5fc9904f5a18aae4a3768f721c43efe5d288\"},{\"builtins\":[\"pedersen\",\"range_check\"],\"offset\":6563,\"selector\":\"0x1d13ab0a76d7407b1d5faccd4b3d8a9efe42f3d3c21766431d4fafb30f45bd4\"},{\"builtins\":[\"pedersen\",\"range_check\"],\"offset\":5058,\"selector\":\"0x1e888a1026b19c8c0b57c72d63ed1737106aa10034105b980ba117bd0c29fe1\"},{\"builtins\":[\"pedersen\",\"range_check\",\"poseidon\"],\"offset\":1498,\"selector\":\"0x1fa400a40ac35b4aa2c5383c3bb89afee2a9698b86ebb405cf25a6e63428605\"},{\"builtins\":[\"range_check\"],\"offset\":4452,\"selector\":\"0x216b05c387bab9ac31918a3e61672f4618601f3c598a2f3f2710f37053e1ea4\"},{\"builtins\":[\"pedersen\",\"range_check\"],\"offset\":6188,\"selector\":\"0x219209e083275171774dab1df80982e9df2096516f06319c5c6d71ae0a8480c\"},{\"builtins\":[\"pedersen\",\"range_check\"],\"offset\":3446,\"selector\":\"0x225faa998b63ad3d277e950e8091f07d28a4c45ef6de7f3f7095e89be92d701\"},{\"builtins\":[\"pedersen\",\"range_check\"],\"offset\":3691,\"selector\":\"0x24643b0aa4f24549ae7cd884195db7950c3a79a96cb7f37bde40549723559d9\"},{\"builtins\":[\"pedersen\",\"range_check\"],\"offset\":2657,\"selector\":\"0x25a5317fee78a3601253266ed250be22974a6b6eb116c875a2596585df6a400\"},{\"builtins\":[\"range_check\"],\"offset\":1328,\"selector\":\"0x284a2f635301a0bf3a171bb8e4292667c6c70d23d48b0ae8ec4df336e84bccd\"},{\"builtins\":[\"pedersen\",\"range_check\"],\"offset\":7370,\"selector\":\"0x2e4263afad30923c891518314c3c95dbe830a16874e8abc5777a9a20b54c76e\"},{\"builtins\":[\"pedersen\",\"range_check\"],\"offset\":2466,\"selector\":\"0x302e0454f48778e0ca3a2e714a289c4e8d8e03d614b370130abb1a524a47f22\"},{\"builtins\":[\"pedersen\",\"range_check\"],\"offset\":2170,\"selector\":\"0x30559321b47d576b645ed7bd24089943dd5fd3a359ecdd6fa8f05c1bab67d6b\"},{\"builtins\":[\"pedersen\",\"range_check\",\"poseidon\"],\"offset\":1834,\"selector\":\"0x338dd2002b6f7ac6471742691de72611381e3fc4ce2b0361c29d42cb2d53a90\"},{\"builtins\":[\"pedersen\",\"range_check\",\"poseidon\"],\"offset\":1666,\"selector\":\"0x33fe3600cdfaa48261a8c268c66363562da383d5dd26837ba63b66ebbc04e3c\"},{\"builtins\":[\"pedersen\",\"range_check\"],\"offset\":4862,\"selector\":\"0x35a73cd311a05d46deda634c5ee045db92f811b4e74bca4437fcb5302b7af33\"},{\"builtins\":[\"range_check\"],\"offset\":4327,\"selector\":\"0x361458367e696363fbcc70777d07ebbd2394e89fd0adcaf147faccd1d294d60\"},{\"builtins\":[\"pedersen\",\"range_check\"],\"offset\":5705,\"selector\":\"0x3704ffe8fba161be0e994951751a5033b1462b918ff785c0a636be718dfdb68\"},{\"builtins\":[\"pedersen\",\"range_check\"],\"offset\":2929,\"selector\":\"0x37791de85f8a3be5014988a652f6cf025858f3532706c18f8cf24f2f81800d5\"},{\"builtins\":[\"pedersen\",\"range_check\"],\"offset\":332,\"selector\":\"0x3a07502a2e0e18ad6178ca530615148b9892d000199dbb29e402c41913c3d1a\"},{\"builtins\":[\"pedersen\",\"range_check\"],\"offset\":6909,\"selector\":\"0x3b076186c19fe96221e4dfacd40c519f612eae02e0555e4e115a2a6cf2f1c1f\"}],\"L1_HANDLER\":[]},\"hints\":[[0,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[38,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[42,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[52,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[88,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[90,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[139,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[141,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[170,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[197,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-5,\"register\":\"AP\"}}}}]],[219,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[240,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[276,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[300,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[315,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[332,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[370,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[374,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[384,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[420,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[422,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[471,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[473,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[502,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[529,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-5,\"register\":\"AP\"}}}}]],[551,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[572,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[608,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[632,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[647,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[664,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[702,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[706,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[716,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[752,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[754,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[803,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[805,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[834,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[861,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-5,\"register\":\"AP\"}}}}]],[883,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[904,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[940,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[964,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[979,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[996,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[1034,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[1038,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[1048,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[1084,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[1086,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[1135,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[1137,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[1166,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[1193,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-5,\"register\":\"AP\"}}}}]],[1215,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[1236,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[1272,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[1296,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[1311,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[1328,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[1347,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[1368,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x3336\"},\"rhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}}}}]],[1393,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-5,\"register\":\"FP\"}}}}]],[1401,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"BinOp\":{\"a\":{\"offset\":-3,\"register\":\"AP\"},\"b\":{\"Immediate\":\"0x0\"},\"op\":\"Add\"}},\"rhs\":{\"Immediate\":\"0x10000000000000000\"}}}]],[1405,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000110000000000000000\"},\"value\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"x\":{\"offset\":0,\"register\":\"AP\"},\"y\":{\"offset\":1,\"register\":\"AP\"}}}]],[1423,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[1437,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[1467,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[1482,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[1498,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x23fa\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[1526,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[1552,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}}}}]],[1578,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[1603,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[1620,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[1648,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[1666,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x245e\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[1694,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[1722,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-5,\"register\":\"AP\"}}}}]],[1748,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[1771,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[1788,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[1816,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[1834,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x245e\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[1862,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[1890,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-5,\"register\":\"AP\"}}}}]],[1916,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[1939,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[1956,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[1984,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[2002,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x245e\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[2030,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[2058,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-5,\"register\":\"AP\"}}}}]],[2084,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[2107,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[2124,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[2152,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[2170,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[2218,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[2222,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[2232,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[2248,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[2275,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-5,\"register\":\"AP\"}}}}]],[2293,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[2297,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[2308,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[2335,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-5,\"register\":\"FP\"}}}}]],[2354,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[2393,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[2418,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[2433,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[2449,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[2466,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[2495,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[2520,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}}}}]],[2535,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[2539,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[2550,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[2577,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-5,\"register\":\"FP\"}}}}]],[2581,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[2608,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[2624,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[2640,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[2657,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[2695,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[2699,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[2709,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[2725,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[2752,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-5,\"register\":\"AP\"}}}}]],[2772,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[2776,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[2787,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[2814,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-5,\"register\":\"FP\"}}}}]],[2833,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[2872,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[2897,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[2912,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[2929,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[2967,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[2971,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[2981,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[2997,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[3024,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-5,\"register\":\"AP\"}}}}]],[3044,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[3048,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[3059,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[3086,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-5,\"register\":\"FP\"}}}}]],[3105,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[3144,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[3169,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[3184,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[3201,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[3239,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[3243,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[3253,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[3269,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[3296,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-5,\"register\":\"AP\"}}}}]],[3313,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-5,\"register\":\"FP\"}}}}]],[3342,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[3389,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[3414,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[3429,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[3446,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[3484,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[3488,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[3498,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[3514,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[3541,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-5,\"register\":\"AP\"}}}}]],[3558,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-5,\"register\":\"FP\"}}}}]],[3587,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[3634,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[3659,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[3674,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[3691,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[3729,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[3733,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[3743,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[3759,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[3786,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-5,\"register\":\"AP\"}}}}]],[3803,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-5,\"register\":\"FP\"}}}}]],[3832,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[3879,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[3904,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[3919,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[3936,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[3974,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[3978,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[3988,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[4004,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4031,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-5,\"register\":\"AP\"}}}}]],[4048,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-5,\"register\":\"FP\"}}}}]],[4077,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4124,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4149,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4164,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4181,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[4210,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4237,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-5,\"register\":\"AP\"}}}}]],[4257,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4278,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4294,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4310,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4327,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[4346,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4367,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x2af8\"},\"rhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}}}}]],[4392,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-5,\"register\":\"FP\"}}}}]],[4396,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4421,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4436,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4452,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[4471,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4492,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x2af8\"},\"rhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}}}}]],[4517,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-5,\"register\":\"FP\"}}}}]],[4521,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4546,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4561,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4577,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[4596,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4617,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x3336\"},\"rhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}}}}]],[4642,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-5,\"register\":\"FP\"}}}}]],[4650,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"BinOp\":{\"a\":{\"offset\":-3,\"register\":\"AP\"},\"b\":{\"Immediate\":\"0x0\"},\"op\":\"Add\"}},\"rhs\":{\"Immediate\":\"0x100\"}}}]],[4654,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000110000000000000000\"},\"value\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"x\":{\"offset\":0,\"register\":\"AP\"},\"y\":{\"offset\":1,\"register\":\"AP\"}}}]],[4672,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4686,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4716,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4731,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4747,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[4766,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4787,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x6bc6\"},\"rhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}}}}]],[4809,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4831,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4846,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4862,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[4900,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[4904,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[4914,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[4930,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[4955,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}}}}]],[4977,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[5001,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[5026,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[5041,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[5058,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[5096,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[5100,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[5110,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[5145,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[5149,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[5159,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[5175,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[5202,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-5,\"register\":\"AP\"}}}}]],[5225,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[5249,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[5274,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[5298,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[5313,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[5330,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[5368,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[5372,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[5382,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[5418,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[5420,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[5469,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[5471,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[5500,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[5527,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-5,\"register\":\"AP\"}}}}]],[5544,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-5,\"register\":\"FP\"}}}}]],[5562,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[5613,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[5649,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[5673,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[5688,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[5707,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x398\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[5745,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":3,\"register\":\"FP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[5749,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[5759,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"FP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[5795,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":2,\"register\":\"FP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[5799,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[5809,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":2,\"register\":\"FP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[5845,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[5847,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[5896,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[5898,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[5927,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[5954,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-5,\"register\":\"AP\"}}}}]],[5971,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-5,\"register\":\"FP\"}}}}]],[6003,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[6072,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[6108,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[6132,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[6156,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[6171,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[6188,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[6226,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[6230,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[6240,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[6276,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[6278,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[6327,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[6329,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[6358,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[6385,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-5,\"register\":\"AP\"}}}}]],[6402,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-5,\"register\":\"FP\"}}}}]],[6420,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[6471,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[6507,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[6531,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[6546,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[6563,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[6601,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[6605,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[6615,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[6651,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[6653,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[6702,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[6704,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[6733,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[6760,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-5,\"register\":\"AP\"}}}}]],[6782,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[6817,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[6853,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[6877,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[6892,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[6909,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[6947,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[6951,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[6961,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[6997,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[6999,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[7048,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[7050,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[7079,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[7106,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-5,\"register\":\"AP\"}}}}]],[7128,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[7163,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[7199,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[7223,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[7238,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[7255,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[7274,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[7295,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x6bc6\"},\"rhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}}}}]],[7317,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[7339,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[7354,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[7370,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[7408,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[7412,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[7422,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[7438,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[7463,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}}}}]],[7485,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[7509,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[7534,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[7549,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[7568,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x398\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[7606,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":3,\"register\":\"FP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[7610,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[7620,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"FP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[7656,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":2,\"register\":\"FP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[7660,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[7670,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":2,\"register\":\"FP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[7706,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[7708,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[7757,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[7759,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[7788,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[7815,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-5,\"register\":\"AP\"}}}}]],[7832,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-5,\"register\":\"FP\"}}}}]],[7864,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[7933,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[7969,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[7993,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[8017,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[8032,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[8049,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[8087,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[8091,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[8101,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[8137,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[8139,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[8188,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[8190,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[8219,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[8246,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-5,\"register\":\"AP\"}}}}]],[8268,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[8303,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[8339,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[8363,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[8378,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[8395,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[8433,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[8437,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[8447,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[8483,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[8485,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[8534,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[8536,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[8565,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[8592,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-5,\"register\":\"AP\"}}}}]],[8614,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[8649,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[8685,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[8709,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[8724,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[8741,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x1e6e\"},\"rhs\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[8799,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"BinOp\":{\"a\":{\"offset\":-2,\"register\":\"AP\"},\"b\":{\"Immediate\":\"0x0\"},\"op\":\"Add\"}},\"rhs\":{\"Immediate\":\"0x100\"}}}]],[8803,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000110000000000000000\"},\"value\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"x\":{\"offset\":0,\"register\":\"AP\"},\"y\":{\"offset\":1,\"register\":\"AP\"}}}]],[8849,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[8851,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[8900,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[8902,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[8952,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[8956,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[8966,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[9001,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[9005,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[9015,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[9050,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[9054,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[9064,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[9100,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"BinOp\":{\"a\":{\"offset\":-2,\"register\":\"AP\"},\"b\":{\"Immediate\":\"0x0\"},\"op\":\"Add\"}},\"rhs\":{\"Immediate\":\"0x10000000000000000\"}}}]],[9104,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000110000000000000000\"},\"value\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"x\":{\"offset\":0,\"register\":\"AP\"},\"y\":{\"offset\":1,\"register\":\"AP\"}}}]],[9130,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[9157,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-5,\"register\":\"AP\"}}}}]],[9185,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[9206,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[9231,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[9255,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[9279,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[9303,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[9338,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[9362,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[9377,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[9393,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[9409,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[9430,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[9451,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"a\":{\"offset\":-6,\"register\":\"FP\"},\"b\":{\"Immediate\":\"0x5\"},\"op\":\"Add\"}}}}]],[9459,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[9463,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[9473,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[9507,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[9532,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[9597,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[9618,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"a\":{\"offset\":-6,\"register\":\"FP\"},\"b\":{\"Immediate\":\"0x5\"},\"op\":\"Add\"}}}}]],[9626,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[9630,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[9640,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[9674,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[9699,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[9781,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[9785,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[9795,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[9953,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[9994,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[9998,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[10009,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[10036,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-9,\"register\":\"FP\"}}}}]],[10044,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"BinOp\":{\"a\":{\"offset\":-3,\"register\":\"AP\"},\"b\":{\"Immediate\":\"0x0\"},\"op\":\"Add\"}},\"rhs\":{\"Immediate\":\"0x10000000000000000\"}}}]],[10048,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000110000000000000000\"},\"value\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"x\":{\"offset\":0,\"register\":\"AP\"},\"y\":{\"offset\":1,\"register\":\"AP\"}}}]],[10079,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[10162,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-6,\"register\":\"AP\"}}}}]],[10182,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"a\":{\"offset\":-17,\"register\":\"AP\"},\"b\":{\"Immediate\":\"0x5\"},\"op\":\"Add\"}}}}]],[10190,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"BinOp\":{\"a\":{\"offset\":-3,\"register\":\"AP\"},\"b\":{\"Immediate\":\"0x0\"},\"op\":\"Add\"}},\"rhs\":{\"Immediate\":\"0x10000000000000000\"}}}]],[10194,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000110000000000000000\"},\"value\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"x\":{\"offset\":0,\"register\":\"AP\"},\"y\":{\"offset\":1,\"register\":\"AP\"}}}]],[10213,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"BinOp\":{\"a\":{\"offset\":-11,\"register\":\"AP\"},\"b\":{\"Deref\":{\"offset\":-6,\"register\":\"AP\"}},\"op\":\"Add\"}},\"rhs\":{\"Immediate\":\"0x10000000000000000\"}}}]],[10228,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"BinOp\":{\"a\":{\"offset\":-3,\"register\":\"AP\"},\"b\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"op\":\"Add\"}},\"rhs\":{\"Immediate\":\"0x10000000000000000\"}}}]],[10277,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[10279,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[10308,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":0,\"register\":\"FP\"}}}}]],[10387,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[10414,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[10441,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[10613,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[10615,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[10644,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":0,\"register\":\"FP\"}}}}]],[10774,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-8,\"register\":\"AP\"}}}}]],[10803,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-8,\"register\":\"AP\"}}}}]],[10860,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[10878,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x10000000000000000\"}}}]],[10888,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x10000000000000000\"}}}]],[10896,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[10898,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[10928,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":4,\"register\":\"FP\"}}}}]],[10957,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-7,\"register\":\"AP\"}}}}]],[10961,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[10963,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[10999,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":3,\"register\":\"FP\"}}}}]],[11010,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[11036,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":0,\"register\":\"FP\"}}}}]],[11075,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[11120,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}}}}]],[11207,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[11343,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[11370,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[11459,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[11527,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[11531,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[11542,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[11568,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-12,\"register\":\"FP\"}}}}]],[11605,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[11625,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[11629,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[11640,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[11667,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-21,\"register\":\"AP\"}}}}]],[11693,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[11695,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[11723,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":0,\"register\":\"FP\"}}}}]],[11866,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[11870,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[11881,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[11907,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-12,\"register\":\"FP\"}}}}]],[11957,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[11961,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[11972,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[11999,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-20,\"register\":\"AP\"}}}}]],[12025,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[12027,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[12055,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":0,\"register\":\"FP\"}}}}]],[12181,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[12201,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-4,\"register\":\"FP\"}}}}]],[12216,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"a\":{\"offset\":-4,\"register\":\"FP\"},\"b\":{\"Immediate\":\"0x5\"},\"op\":\"Add\"}}}}]],[12247,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[12304,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"FP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[12308,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[12319,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[12343,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-4,\"register\":\"FP\"}}}}]],[12351,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[12353,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[12387,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-8,\"register\":\"AP\"}}}}]],[12395,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[12397,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[12430,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[12458,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[12500,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[12504,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[12515,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[12541,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-5,\"register\":\"FP\"}}}}]],[12549,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[12551,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[12585,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-8,\"register\":\"AP\"}}}}]],[12593,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[12595,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[12629,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[12657,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[12704,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[12708,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[12719,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[12745,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[12753,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[12755,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[12789,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-8,\"register\":\"AP\"}}}}]],[12797,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[12799,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[12833,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[12861,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[12916,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[12944,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[12964,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[12968,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[12979,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[13006,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-7,\"register\":\"FP\"}}}}]],[13014,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[13016,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[13050,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-8,\"register\":\"AP\"}}}}]],[13058,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[13060,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[13083,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[13109,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[13131,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[13151,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[13155,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[13166,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[13194,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-36,\"register\":\"AP\"}}}}]],[13210,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"a\":{\"offset\":-42,\"register\":\"AP\"},\"b\":{\"Immediate\":\"0x7\"},\"op\":\"Add\"}}}}]],[13219,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[13223,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[13234,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[13261,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"a\":{\"offset\":-58,\"register\":\"AP\"},\"b\":{\"Immediate\":\"0xe\"},\"op\":\"Add\"}}}}]],[13269,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[13271,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[13305,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-8,\"register\":\"AP\"}}}}]],[13313,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[13315,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[13338,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[13364,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[13386,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[13406,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[13410,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[13421,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[13449,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-35,\"register\":\"AP\"}}}}]],[13465,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"a\":{\"offset\":-41,\"register\":\"AP\"},\"b\":{\"Immediate\":\"0x7\"},\"op\":\"Add\"}}}}]],[13469,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[13471,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[13504,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":0,\"register\":\"FP\"}}}}]],[13593,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[13616,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[13659,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[13773,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[13798,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[13845,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[13895,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[13899,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[13910,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[13936,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-7,\"register\":\"FP\"}}}}]],[13944,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[13946,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[13980,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-8,\"register\":\"AP\"}}}}]],[13988,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[13990,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[14039,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[14065,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[14087,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[14142,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[14188,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[14235,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[14291,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[14319,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[14342,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[14346,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[14357,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[14385,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-7,\"register\":\"FP\"}}}}]],[14401,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"a\":{\"offset\":-7,\"register\":\"FP\"},\"b\":{\"Immediate\":\"0x7\"},\"op\":\"Add\"}}}}]],[14405,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[14407,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[14440,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":0,\"register\":\"FP\"}}}}]],[14508,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[14522,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[14526,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[14537,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[14564,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"a\":{\"offset\":-6,\"register\":\"FP\"},\"b\":{\"Immediate\":\"0x5\"},\"op\":\"Add\"}}}}]],[14572,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[14574,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[14608,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-8,\"register\":\"AP\"}}}}]],[14616,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[14618,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[14641,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[14667,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[14689,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[14765,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[14790,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[14837,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[14904,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-6,\"register\":\"FP\"}}}}]],[14918,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[14922,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[14933,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[14960,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"a\":{\"offset\":-6,\"register\":\"FP\"},\"b\":{\"Immediate\":\"0x5\"},\"op\":\"Add\"}}}}]],[14968,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[14970,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[15004,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-8,\"register\":\"AP\"}}}}]],[15012,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[15014,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[15037,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[15063,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[15085,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[15161,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[15186,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[15233,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[15307,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-12,\"register\":\"FP\"}}}}]],[15323,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"a\":{\"offset\":-12,\"register\":\"FP\"},\"b\":{\"Immediate\":\"0x7\"},\"op\":\"Add\"}}}}]],[15339,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"a\":{\"offset\":-12,\"register\":\"FP\"},\"b\":{\"Immediate\":\"0xe\"},\"op\":\"Add\"}}}}]],[15368,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[15395,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-9,\"register\":\"AP\"}}}}]],[15421,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-8,\"register\":\"AP\"}}}}]],[15573,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[15599,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[15625,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[15647,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[15674,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-27,\"register\":\"AP\"}}}}]],[15692,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"a\":{\"offset\":-34,\"register\":\"AP\"},\"b\":{\"Immediate\":\"0x7\"},\"op\":\"Add\"}}}}]],[15701,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[15705,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[15716,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[15743,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"a\":{\"offset\":-50,\"register\":\"AP\"},\"b\":{\"Immediate\":\"0xe\"},\"op\":\"Add\"}}}}]],[15751,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[15753,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[15787,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-8,\"register\":\"AP\"}}}}]],[15795,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[15797,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[15820,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[15846,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[15868,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[15888,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[15892,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[15903,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[15931,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-35,\"register\":\"AP\"}}}}]],[15947,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"a\":{\"offset\":-41,\"register\":\"AP\"},\"b\":{\"Immediate\":\"0x7\"},\"op\":\"Add\"}}}}]],[15951,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[15953,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[15987,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":0,\"register\":\"FP\"}}}}]],[16076,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[16099,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[16142,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[16256,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[16304,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[16330,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[16356,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[16378,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[16405,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-27,\"register\":\"AP\"}}}}]],[16423,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"a\":{\"offset\":-34,\"register\":\"AP\"},\"b\":{\"Immediate\":\"0x7\"},\"op\":\"Add\"}}}}]],[16432,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[16436,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[16447,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[16474,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"a\":{\"offset\":-50,\"register\":\"AP\"},\"b\":{\"Immediate\":\"0xe\"},\"op\":\"Add\"}}}}]],[16482,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[16484,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[16518,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-8,\"register\":\"AP\"}}}}]],[16526,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[16528,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[16551,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[16577,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[16599,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[16619,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[16623,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[16634,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[16662,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-35,\"register\":\"AP\"}}}}]],[16678,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"a\":{\"offset\":-41,\"register\":\"AP\"},\"b\":{\"Immediate\":\"0x7\"},\"op\":\"Add\"}}}}]],[16682,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[16684,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[16718,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":0,\"register\":\"FP\"}}}}]],[16807,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[16830,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[16873,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[16987,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[17065,[{\"TestLessThan\":{\"dst\":{\"offset\":4,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"}}}]],[17069,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":3,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[17079,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}},\"x\":{\"offset\":-1,\"register\":\"AP\"},\"y\":{\"offset\":0,\"register\":\"AP\"}}}]],[17319,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-10,\"register\":\"FP\"}}}}]],[17377,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x816\"},\"rhs\":{\"Deref\":{\"offset\":-5,\"register\":\"AP\"}}}}]],[17402,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[17452,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[17473,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-3,\"register\":\"FP\"}}}}]],[17489,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[17493,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[17504,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[17531,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"a\":{\"offset\":-3,\"register\":\"FP\"},\"b\":{\"Immediate\":\"0x5\"},\"op\":\"Add\"}}}}]],[17555,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[17621,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[17662,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[17666,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[17677,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[17705,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-10,\"register\":\"FP\"}}}}]],[17772,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[17813,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[17817,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[17828,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[17856,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-10,\"register\":\"FP\"}}}}]],[18233,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[18274,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[18278,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[18289,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[18316,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-9,\"register\":\"FP\"}}}}]],[18324,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"BinOp\":{\"a\":{\"offset\":-3,\"register\":\"AP\"},\"b\":{\"Immediate\":\"0x0\"},\"op\":\"Add\"}},\"rhs\":{\"Immediate\":\"0x10000000000000000\"}}}]],[18328,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000110000000000000000\"},\"value\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"x\":{\"offset\":0,\"register\":\"AP\"},\"y\":{\"offset\":1,\"register\":\"AP\"}}}]],[18359,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[18427,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Immediate\":\"0x6ea\"},\"rhs\":{\"Deref\":{\"offset\":-7,\"register\":\"FP\"}}}}]],[18466,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[18484,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-4,\"register\":\"FP\"}}}}]],[18498,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[18502,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[18513,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[18540,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"a\":{\"offset\":-4,\"register\":\"FP\"},\"b\":{\"Immediate\":\"0x5\"},\"op\":\"Add\"}}}}]],[18564,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[18640,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[18644,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[18655,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[18681,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-5,\"register\":\"FP\"}}}}]],[18713,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[18717,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[18728,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[18758,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-21,\"register\":\"AP\"}}}}]],[18767,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"a\":{\"offset\":-25,\"register\":\"AP\"},\"b\":{\"Immediate\":\"0x7\"},\"op\":\"Add\"}}}}]],[18772,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[18774,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[18808,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":0,\"register\":\"FP\"}}}}]],[18921,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[18925,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[18936,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[18962,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-5,\"register\":\"FP\"}}}}]],[19015,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[19019,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[19030,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[19060,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-21,\"register\":\"AP\"}}}}]],[19069,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"a\":{\"offset\":-25,\"register\":\"AP\"},\"b\":{\"Immediate\":\"0x7\"},\"op\":\"Add\"}}}}]],[19074,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[19076,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[19110,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":0,\"register\":\"FP\"}}}}]],[19199,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[19203,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[19214,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[19240,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-4,\"register\":\"FP\"}}}}]],[19263,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[19360,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[19396,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"FP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[19400,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[19411,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[19435,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-4,\"register\":\"FP\"}}}}]],[19443,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[19445,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[19479,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-8,\"register\":\"AP\"}}}}]],[19487,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-3,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[19489,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"offset\":-4,\"register\":\"AP\"}},\"quotient\":{\"offset\":3,\"register\":\"AP\"},\"remainder\":{\"offset\":4,\"register\":\"AP\"},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"}}}]],[19522,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[19550,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[19611,[{\"TestLessThan\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"BinOp\":{\"a\":{\"offset\":-1,\"register\":\"AP\"},\"b\":{\"Immediate\":\"0x0\"},\"op\":\"Add\"}},\"rhs\":{\"Immediate\":\"0x100000000\"}}}]],[19615,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000110000000000000000\"},\"value\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"x\":{\"offset\":0,\"register\":\"AP\"},\"y\":{\"offset\":1,\"register\":\"AP\"}}}]],[19637,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}}}}]],[19651,[{\"TestLessThan\":{\"dst\":{\"offset\":-1,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":0,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x100000000\"}}}]],[19661,[{\"TestLessThanOrEqual\":{\"dst\":{\"offset\":0,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Deref\":{\"offset\":-2,\"register\":\"AP\"}}}}]],[19684,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[19705,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[19726,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[19781,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[19785,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[19796,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[19822,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":-5,\"register\":\"FP\"}}}}]],[19831,[{\"TestLessThan\":{\"dst\":{\"offset\":5,\"register\":\"AP\"},\"lhs\":{\"Deref\":{\"offset\":-1,\"register\":\"AP\"}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"}}}]],[19835,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[19846,[{\"LinearSplit\":{\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"value\":{\"Deref\":{\"offset\":4,\"register\":\"AP\"}},\"x\":{\"offset\":-2,\"register\":\"AP\"},\"y\":{\"offset\":-1,\"register\":\"AP\"}}}]],[19875,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"a\":{\"offset\":-5,\"register\":\"FP\"},\"b\":{\"Immediate\":\"0x7\"},\"op\":\"Add\"}}}}]],[19879,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[19881,[{\"AllocSegment\":{\"dst\":{\"offset\":0,\"register\":\"AP\"}}}]],[19915,[{\"SystemCall\":{\"system\":{\"Deref\":{\"offset\":0,\"register\":\"FP\"}}}}]]],\"prime\":\"0x800000000000011000000000000000000000000000000000000000000000001\"}"
  },
  {
    "path": "crates/cheatnet/src/data/strk_erc20_casm.json",
    "content": "{\"prime\":\"0x800000000000011000000000000000000000000000000000000000000000001\",\"compiler_version\":\"2.10.0\",\"bytecode\":[\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0xab\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x122a\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x7b\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x66\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x5aa2\",\"0x482480017fff8000\",\"0x5aa1\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xca6c\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x23\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x48127fe87fff8000\",\"0x1104800180018000\",\"0x298d\",\"0x20680017fff7ffd\",\"0xd\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x64\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x55a\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xa78\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x95\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x1bf8\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x48127ffb7fff8000\",\"0x482480017ffb8000\",\"0x492\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x5a13\",\"0x482480017fff8000\",\"0x5a12\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0xa0680017fff8000\",\"0x9\",\"0x4824800180007ffd\",\"0x32d2\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff57fff\",\"0x10780017fff7fff\",\"0x5c\",\"0x4824800180007ffd\",\"0x32d2\",\"0x400080007ff67fff\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x6894a7eacac1683e1e290e1df9a86c47bc34cd609052ca3e176955bc0958ee\",\"0x482480017ff38000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffb\",\"0x400280027ffb7ffc\",\"0x400280037ffb7ffd\",\"0x480280057ffb8000\",\"0x20680017fff7fff\",\"0x39\",\"0x480280047ffb8000\",\"0x480280067ffb8000\",\"0x482680017ffb8000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffc\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff57ffc\",\"0x480080017ff47ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff37ffd\",\"0x10780017fff7fff\",\"0x18\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffb\",\"0x480080007ff67ffd\",\"0x480080017ff57ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff47ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x400080007fff7ff7\",\"0x482480017ff38000\",\"0x3\",\"0x482480017ff88000\",\"0x384\",\"0x48127ff67fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4e6f6e20436f6e747261637441646472657373\",\"0x400080007ffe7fff\",\"0x482480017ff18000\",\"0x3\",\"0x48127ff67fff8000\",\"0x48127ff47fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0xa\",\"0x480280047ffb8000\",\"0x48127ffc7fff8000\",\"0x482480017ffe8000\",\"0x712\",\"0x482680017ffb8000\",\"0x8\",\"0x480280067ffb8000\",\"0x480280077ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x21b6\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x15d\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x5e6\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x12d\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x118\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xe4\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xc8\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xa6\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x8a\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x58d1\",\"0x482480017fff8000\",\"0x58d0\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x1cc64\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x4c\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x48127fff7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffd\",\"0x480280037ffb8000\",\"0x20680017fff7fff\",\"0x25\",\"0x480280027ffb8000\",\"0x480280047ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffd7fff8000\",\"0x480a7ff87fff8000\",\"0x482680017ffb8000\",\"0x5\",\"0x480080027ffb8000\",\"0x48127fcb7fff8000\",\"0x48127fd97fff8000\",\"0x48127fe37fff8000\",\"0x1104800180018000\",\"0x2861\",\"0x20680017fff7ffd\",\"0xe\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x482480017ff78000\",\"0x258\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff97fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x10780017fff7fff\",\"0x14\",\"0x480280027ffb8000\",\"0x1104800180018000\",\"0x588e\",\"0x482480017fff8000\",\"0x588d\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x19f14\",\"0x480a7ff87fff8000\",\"0x48127ff47fff8000\",\"0x48307ffd7ff68000\",\"0x482680017ffb8000\",\"0x6\",\"0x480280047ffb8000\",\"0x480280057ffb8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x1ae\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x7f8\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x834\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xe7e\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x119e\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x16bc\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x6\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0xffffffffffffffffffffffffffffe30e\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x234\",\"0x4825800180007ffa\",\"0x1cf2\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x205\",\"0x40137fff7fff8002\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4825800180048002\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x1ef\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48317fff80008002\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480080007fef8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x1bb\",\"0x40137fff7fff8003\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4825800180048003\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x1a5\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48317fff80008003\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x171\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x155\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x133\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x117\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xfc\",\"0x400180007ff68005\",\"0x482480017ff68000\",\"0x1\",\"0x48127ff67fff8000\",\"0x48127ffc7fff8000\",\"0x40137fec7fff8000\",\"0x40137ff77fff8001\",\"0x48307ffd80007ffe\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ffb8000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff87fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xcc\",\"0x400180007fff8004\",\"0x48127ffb7fff8000\",\"0xa0680017fff8000\",\"0x12\",\"0x4825800180008004\",\"0x10000000000000000\",\"0x4844800180008002\",\"0x8000000000000110000000000000000\",\"0x4830800080017ffe\",\"0x480080007fef7fff\",\"0x482480017ffe8000\",\"0xefffffffffffffdeffffffffffffffff\",\"0x480080017fed7fff\",\"0x400080027fec7ffb\",\"0x402480017fff7ffb\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7fff\",\"0xb4\",\"0x402780017fff7fff\",\"0x1\",\"0x400180007ff28004\",\"0x4826800180048000\",\"0xffffffffffffffff0000000000000000\",\"0x400080017ff17fff\",\"0x482480017ff18000\",\"0x2\",\"0x48127ffc7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x82\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff77fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffa7fff8000\",\"0x480080007ff88000\",\"0x1104800180018000\",\"0x275a\",\"0x20680017fff7ffa\",\"0x6b\",\"0x48127ff97fff8000\",\"0x20680017fff7ffc\",\"0x63\",\"0x48127fff7fff8000\",\"0x48307ff980007ffa\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ff27fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x56c4\",\"0x482480017fff8000\",\"0x56c3\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x8\",\"0x482480017fff8000\",\"0x2dc08\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007fea7fff\",\"0x10780017fff7fff\",\"0x2a\",\"0x48307ffe80007ffa\",\"0x400080007feb7fff\",\"0x482480017feb8000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x480a80027fff8000\",\"0x480a80037fff8000\",\"0x480a80007fff8000\",\"0x480a80017fff8000\",\"0x480a80057fff8000\",\"0x480a80047fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x1104800180018000\",\"0x277d\",\"0x20680017fff7ffd\",\"0xd\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x64\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fe78000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127ff77fff8000\",\"0x482480017ffe8000\",\"0x5be\",\"0x10780017fff7fff\",\"0xf\",\"0x480a7ff87fff8000\",\"0x48127ff77fff8000\",\"0x482480017ff78000\",\"0x8de\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x1158\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202336\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017fec8000\",\"0x3\",\"0x482480017ff78000\",\"0x12a2\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff47fff8000\",\"0x482480017ffa8000\",\"0x187e\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202335\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202334\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x1ea0\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x1af4\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x213e\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x217a\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x27c4\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202333\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x2ae4\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x305c\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x337c\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x38f4\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x20b2\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x136\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x5e6\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x106\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0xf1\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xbd\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xa1\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x7f\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x63\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x5512\",\"0x482480017fff8000\",\"0x5511\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x2503a\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x25\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x48127fd27fff8000\",\"0x48127fe07fff8000\",\"0x48127fea7fff8000\",\"0x1104800180018000\",\"0x27d9\",\"0x20680017fff7ffd\",\"0xd\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x64\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x1ae\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x7f8\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x834\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xe7e\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x119e\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x16bc\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x136\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x5e6\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x106\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0xf1\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xbd\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xa1\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x7f\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x63\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x53c6\",\"0x482480017fff8000\",\"0x53c5\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x2503a\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x25\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x48127fd27fff8000\",\"0x48127fe07fff8000\",\"0x48127fea7fff8000\",\"0x1104800180018000\",\"0x2734\",\"0x20680017fff7ffd\",\"0xd\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x64\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x1ae\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x7f8\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x834\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xe7e\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x119e\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x16bc\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x136\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x5e6\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x106\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0xf1\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xbd\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xa1\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x7f\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x63\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x527a\",\"0x482480017fff8000\",\"0x5279\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x2503a\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x25\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x48127fd27fff8000\",\"0x48127fe07fff8000\",\"0x48127fea7fff8000\",\"0x1104800180018000\",\"0x2541\",\"0x20680017fff7ffd\",\"0xd\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x64\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x1ae\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x7f8\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x834\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xe7e\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x119e\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x16bc\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x136\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x5e6\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x106\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0xf1\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xbd\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xa1\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x7f\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x63\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x512e\",\"0x482480017fff8000\",\"0x512d\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x2503a\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x25\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x48127fd27fff8000\",\"0x48127fe07fff8000\",\"0x48127fea7fff8000\",\"0x1104800180018000\",\"0x249c\",\"0x20680017fff7ffd\",\"0xd\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x64\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x1ae\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x7f8\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x834\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xe7e\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x119e\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x16bc\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x95\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x1bf8\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x48127ffb7fff8000\",\"0x482480017ffb8000\",\"0x492\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x507a\",\"0x482480017fff8000\",\"0x5079\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0xa0680017fff8000\",\"0x9\",\"0x4824800180007ffd\",\"0x3336\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff57fff\",\"0x10780017fff7fff\",\"0x5c\",\"0x4824800180007ffd\",\"0x3336\",\"0x400080007ff67fff\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x3fc801c47df4de8d5835f8bfd4d0b8823ba63e5a3f278086901402d680abfc\",\"0x482480017ff38000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffb\",\"0x400280027ffb7ffc\",\"0x400280037ffb7ffd\",\"0x480280057ffb8000\",\"0x20680017fff7fff\",\"0x39\",\"0x480280047ffb8000\",\"0x480280067ffb8000\",\"0x482680017ffb8000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x12\",\"0x4824800180007ffc\",\"0x10000000000000000\",\"0x4844800180008002\",\"0x8000000000000110000000000000000\",\"0x4830800080017ffe\",\"0x480080007ff57fff\",\"0x482480017ffe8000\",\"0xefffffffffffffdeffffffffffffffff\",\"0x480080017ff37fff\",\"0x400080027ff27ffb\",\"0x402480017fff7ffb\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7fff\",\"0x16\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x482480017ffc8000\",\"0xffffffffffffffff0000000000000000\",\"0x400080017ff77fff\",\"0x40780017fff7fff\",\"0x1\",\"0x400080007fff7ffa\",\"0x482480017ff68000\",\"0x2\",\"0x482480017ffb8000\",\"0x55a\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7265553634202d206e6f6e20753634\",\"0x400080007ffe7fff\",\"0x482480017ff08000\",\"0x3\",\"0x48127ff57fff8000\",\"0x48127ff37fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0xa\",\"0x480280047ffb8000\",\"0x48127ffc7fff8000\",\"0x482480017ffe8000\",\"0x776\",\"0x482680017ffb8000\",\"0x8\",\"0x480280067ffb8000\",\"0x480280077ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x21b6\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0xffffffffffffffffffffffffffffdc06\",\"0x400280007ff87fff\",\"0x10780017fff7fff\",\"0x91\",\"0x4825800180007ffa\",\"0x23fa\",\"0x400280007ff87fff\",\"0x482680017ff88000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x1104800180018000\",\"0x2416\",\"0x48127f8e7fff8000\",\"0x20680017fff7ff5\",\"0x7a\",\"0x48127fff7fff8000\",\"0x20680017fff7ff7\",\"0x66\",\"0x48127fff7fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x13\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x48127fee7fff8000\",\"0x480a7ff97fff8000\",\"0x482480017ff98000\",\"0x55a\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x4fc5\",\"0x482480017fff8000\",\"0x4fc4\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x6630\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffb\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007fe77fff\",\"0x10780017fff7fff\",\"0x2d\",\"0x48307ffe80007ffb\",\"0x400080007fe87fff\",\"0x482480017fe88000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff77fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffb7fff8000\",\"0x48127fe87fff8000\",\"0x48127fe87fff8000\",\"0x48127fe87fff8000\",\"0x48127fe87fff8000\",\"0x48127fe87fff8000\",\"0x48127fe87fff8000\",\"0x1104800180018000\",\"0x2499\",\"0x20680017fff7ffd\",\"0x10\",\"0x40780017fff7fff\",\"0x1\",\"0x400080007fff7ffe\",\"0x48127ff97fff8000\",\"0x48127ff67fff8000\",\"0x48127ff87fff8000\",\"0x48127ff57fff8000\",\"0x48127ff77fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff97fff8000\",\"0x482480017ff68000\",\"0xc8\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x482480017fe48000\",\"0x1\",\"0x480a7ff97fff8000\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x48127ff07fff8000\",\"0x480a7ff97fff8000\",\"0x482480017ffa8000\",\"0x686\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480a7ff77fff8000\",\"0x48127ff37fff8000\",\"0x480a7ff97fff8000\",\"0x482480017ffc8000\",\"0x87a\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x482680017ff88000\",\"0x1\",\"0x480a7ff97fff8000\",\"0x482680017ffa8000\",\"0x20ee\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0xffffffffffffffffffffffffffffdba2\",\"0x400280007ff87fff\",\"0x10780017fff7fff\",\"0x91\",\"0x4825800180007ffa\",\"0x245e\",\"0x400280007ff87fff\",\"0x482680017ff88000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x1104800180018000\",\"0x236e\",\"0x48127f8e7fff8000\",\"0x20680017fff7ff5\",\"0x7a\",\"0x48127fff7fff8000\",\"0x20680017fff7ff7\",\"0x66\",\"0x48127fff7fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x13\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x48127fee7fff8000\",\"0x480a7ff97fff8000\",\"0x482480017ff98000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x4f1d\",\"0x482480017fff8000\",\"0x4f1c\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x1e1a4\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007fe67fff\",\"0x10780017fff7fff\",\"0x2b\",\"0x48307ffe80007ffa\",\"0x400080007fe77fff\",\"0x482480017fe78000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff77fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffb7fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x1104800180018000\",\"0x24b1\",\"0x20680017fff7ffd\",\"0xe\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff67fff8000\",\"0x48127ff87fff8000\",\"0x48127ff57fff8000\",\"0x48127ff77fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff97fff8000\",\"0x482480017ff68000\",\"0x64\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x482480017fe38000\",\"0x1\",\"0x480a7ff97fff8000\",\"0x48127ff37fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x48127ff07fff8000\",\"0x480a7ff97fff8000\",\"0x482480017ffa8000\",\"0x6ea\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480a7ff77fff8000\",\"0x48127ff37fff8000\",\"0x480a7ff97fff8000\",\"0x482480017ffc8000\",\"0x8de\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x482680017ff88000\",\"0x1\",\"0x480a7ff97fff8000\",\"0x482680017ffa8000\",\"0x20ee\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0xffffffffffffffffffffffffffffdba2\",\"0x400280007ff87fff\",\"0x10780017fff7fff\",\"0x91\",\"0x4825800180007ffa\",\"0x245e\",\"0x400280007ff87fff\",\"0x482680017ff88000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x1104800180018000\",\"0x22c6\",\"0x48127f8e7fff8000\",\"0x20680017fff7ff5\",\"0x7a\",\"0x48127fff7fff8000\",\"0x20680017fff7ff7\",\"0x66\",\"0x48127fff7fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x13\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x48127fee7fff8000\",\"0x480a7ff97fff8000\",\"0x482480017ff98000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x4e75\",\"0x482480017fff8000\",\"0x4e74\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x5\",\"0x482480017fff8000\",\"0x1ea28\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007fe67fff\",\"0x10780017fff7fff\",\"0x2b\",\"0x48307ffe80007ffa\",\"0x400080007fe77fff\",\"0x482480017fe78000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff77fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffb7fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x1104800180018000\",\"0x2584\",\"0x20680017fff7ffd\",\"0xe\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff67fff8000\",\"0x48127ff87fff8000\",\"0x48127ff57fff8000\",\"0x48127ff77fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff97fff8000\",\"0x482480017ff68000\",\"0x64\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x482480017fe38000\",\"0x1\",\"0x480a7ff97fff8000\",\"0x48127ff37fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x48127ff07fff8000\",\"0x480a7ff97fff8000\",\"0x482480017ffa8000\",\"0x6ea\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480a7ff77fff8000\",\"0x48127ff37fff8000\",\"0x480a7ff97fff8000\",\"0x482480017ffc8000\",\"0x8de\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x482680017ff88000\",\"0x1\",\"0x480a7ff97fff8000\",\"0x482680017ffa8000\",\"0x20ee\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0xffffffffffffffffffffffffffffdba2\",\"0x400280007ff87fff\",\"0x10780017fff7fff\",\"0x91\",\"0x4825800180007ffa\",\"0x245e\",\"0x400280007ff87fff\",\"0x482680017ff88000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x1104800180018000\",\"0x221e\",\"0x48127f8e7fff8000\",\"0x20680017fff7ff5\",\"0x7a\",\"0x48127fff7fff8000\",\"0x20680017fff7ff7\",\"0x66\",\"0x48127fff7fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x13\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x48127fee7fff8000\",\"0x480a7ff97fff8000\",\"0x482480017ff98000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x4dcd\",\"0x482480017fff8000\",\"0x4dcc\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x6\",\"0x482480017fff8000\",\"0x391e8\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007fe67fff\",\"0x10780017fff7fff\",\"0x2b\",\"0x48307ffe80007ffa\",\"0x400080007fe77fff\",\"0x482480017fe78000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff77fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffb7fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x48127fe77fff8000\",\"0x1104800180018000\",\"0x25bf\",\"0x20680017fff7ffd\",\"0xe\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff67fff8000\",\"0x48127ff87fff8000\",\"0x48127ff57fff8000\",\"0x48127ff77fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff97fff8000\",\"0x482480017ff68000\",\"0x64\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x482480017fe38000\",\"0x1\",\"0x480a7ff97fff8000\",\"0x48127ff37fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x48127ff07fff8000\",\"0x480a7ff97fff8000\",\"0x482480017ffa8000\",\"0x6ea\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480a7ff77fff8000\",\"0x48127ff37fff8000\",\"0x480a7ff97fff8000\",\"0x482480017ffc8000\",\"0x8de\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x482680017ff88000\",\"0x1\",\"0x480a7ff97fff8000\",\"0x482680017ffa8000\",\"0x20ee\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x112\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0xfd2\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xf6\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x48127ffc7fff8000\",\"0x480280007ffc8000\",\"0x48307ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffd7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480080007ff78000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffd7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xc8\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007fee7ffc\",\"0x480080017fed7ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027fec7ffd\",\"0x10780017fff7fff\",\"0xb3\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007fef7ffd\",\"0x480080017fee7ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027fed7ffe\",\"0x482480017fed8000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x4cf4\",\"0x482480017fff8000\",\"0x4cf3\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x371e\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x70\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x480680017fff8000\",\"0x52c476292b358ba7d29adb58502341b4cc5437d07f67d3e285e085828bc820\",\"0x400280007ff87fff\",\"0x400280017ff87fe5\",\"0x480280027ff88000\",\"0x400280037ff87fff\",\"0x400280047ff87fea\",\"0x480280057ff88000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080017fec7ffc\",\"0x480080027feb7ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080037fe97ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080017fec7ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080027fea7ffd\",\"0x400080037fe97ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff88000\",\"0x6\",\"0x482480017fe68000\",\"0x4\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffb\",\"0x400280027ffb7ffc\",\"0x400280037ffb7ffa\",\"0x480280057ffb8000\",\"0x20680017fff7fff\",\"0x2d\",\"0x480280047ffb8000\",\"0x480280067ffb8000\",\"0x482680017ffb8000\",\"0x7\",\"0x48127ffd7fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x0\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x1\",\"0x48307ffd80007fff\",\"0x20680017fff7fff\",\"0x7\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017ffb8000\",\"0x64\",\"0x480680017fff8000\",\"0x1\",\"0x400080007ffb7fff\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x48127ffc7fff8000\",\"0x48127ff47fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff67fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480280047ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffd8000\",\"0x5dc\",\"0x482680017ffb8000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ffb8000\",\"0x480280077ffb8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017fec8000\",\"0x3\",\"0x482480017ff88000\",\"0x55a\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff37fff8000\",\"0x482480017ffa8000\",\"0xa78\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0xff0\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0xa9\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x1874\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x8d\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x48127ffc7fff8000\",\"0x480280007ffc8000\",\"0x48307ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ff57fff8000\",\"0x482480017ff98000\",\"0x55a\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x4bfd\",\"0x482480017fff8000\",\"0x4bfc\",\"0x48127ffa7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x3142\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffb\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007fee7fff\",\"0x10780017fff7fff\",\"0x52\",\"0x48307ffe80007ffb\",\"0x400080007fef7fff\",\"0x480680017fff8000\",\"0x2e9f66c6eea14532c94ad25405a4fcb32faa4969559c128d837caa0ec50a655\",\"0x400280007ff87fff\",\"0x400280017ff87ff4\",\"0x480280027ff88000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080017fe97ffc\",\"0x480080027fe87ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080037fe67ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080017fe97ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080027fe77ffd\",\"0x400080037fe67ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff67fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff88000\",\"0x3\",\"0x482480017fe38000\",\"0x4\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffb\",\"0x400280027ffb7ffc\",\"0x400280037ffb7ffa\",\"0x480280057ffb8000\",\"0x20680017fff7fff\",\"0x12\",\"0x480280047ffb8000\",\"0x40780017fff7fff\",\"0x1\",\"0x480280067ffb8000\",\"0x400080007ffe7fff\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ffb7fff8000\",\"0x482680017ffb8000\",\"0x7\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480280047ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffd8000\",\"0x12c\",\"0x482680017ffb8000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ffb8000\",\"0x480280077ffb8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017feb8000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x74e\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0xfa\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x122a\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xca\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0xb5\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x4b17\",\"0x482480017fff8000\",\"0x4b16\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x3782\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x72\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x480680017fff8000\",\"0x52c476292b358ba7d29adb58502341b4cc5437d07f67d3e285e085828bc820\",\"0x480680017fff8000\",\"0x3711c9d994faf6055172091cb841fd4831aa743e6f3315163b06a122c841846\",\"0x400280007ff87ffe\",\"0x400280017ff87fff\",\"0x480280027ff88000\",\"0x400280037ff87fff\",\"0x400280047ff87fe9\",\"0x480280057ff88000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080017feb7ffc\",\"0x480080027fea7ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080037fe87ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080017feb7ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080027fe97ffd\",\"0x400080037fe87ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff47fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff88000\",\"0x6\",\"0x482480017fe58000\",\"0x4\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffb\",\"0x400280027ffb7ffc\",\"0x400280037ffb7ffa\",\"0x480280057ffb8000\",\"0x20680017fff7fff\",\"0x2d\",\"0x480280047ffb8000\",\"0x480280067ffb8000\",\"0x482680017ffb8000\",\"0x7\",\"0x48127ffd7fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x0\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x1\",\"0x48307ffd80007fff\",\"0x20680017fff7fff\",\"0x7\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017ffb8000\",\"0x64\",\"0x480680017fff8000\",\"0x1\",\"0x400080007ffb7fff\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x48127ffc7fff8000\",\"0x48127ff47fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff67fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480280047ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffd8000\",\"0x5dc\",\"0x482680017ffb8000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ffb8000\",\"0x480280077ffb8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x55a\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xa78\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0xfa\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x122a\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xca\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0xb5\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x4a07\",\"0x482480017fff8000\",\"0x4a06\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x3782\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x72\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x480680017fff8000\",\"0x52c476292b358ba7d29adb58502341b4cc5437d07f67d3e285e085828bc820\",\"0x480680017fff8000\",\"0x251e864ca2a080f55bce5da2452e8cfcafdbc951a3e7fff5023d558452ec228\",\"0x400280007ff87ffe\",\"0x400280017ff87fff\",\"0x480280027ff88000\",\"0x400280037ff87fff\",\"0x400280047ff87fe9\",\"0x480280057ff88000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080017feb7ffc\",\"0x480080027fea7ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080037fe87ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080017feb7ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080027fe97ffd\",\"0x400080037fe87ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff47fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff88000\",\"0x6\",\"0x482480017fe58000\",\"0x4\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffb\",\"0x400280027ffb7ffc\",\"0x400280037ffb7ffa\",\"0x480280057ffb8000\",\"0x20680017fff7fff\",\"0x2d\",\"0x480280047ffb8000\",\"0x480280067ffb8000\",\"0x482680017ffb8000\",\"0x7\",\"0x48127ffd7fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x0\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x1\",\"0x48307ffd80007fff\",\"0x20680017fff7fff\",\"0x7\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017ffb8000\",\"0x64\",\"0x480680017fff8000\",\"0x1\",\"0x400080007ffb7fff\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x48127ffc7fff8000\",\"0x48127ff47fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff67fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480280047ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffd8000\",\"0x5dc\",\"0x482680017ffb8000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ffb8000\",\"0x480280077ffb8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x55a\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xa78\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0xdf\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x122a\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xaf\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x9a\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x48f7\",\"0x482480017fff8000\",\"0x48f6\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x9\",\"0x482480017fff8000\",\"0x2413a\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x57\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x48127fff7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffd\",\"0x480280037ffb8000\",\"0x20680017fff7fff\",\"0x30\",\"0x480280027ffb8000\",\"0x480280047ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffd7fff8000\",\"0x480a7ff87fff8000\",\"0x482680017ffb8000\",\"0x5\",\"0x480680017fff8000\",\"0x3711c9d994faf6055172091cb841fd4831aa743e6f3315163b06a122c841846\",\"0x48127fe17fff8000\",\"0x480680017fff8000\",\"0x7\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127fdb7fff8000\",\"0x480080027ff38000\",\"0x1104800180018000\",\"0x23d1\",\"0x20680017fff7ffd\",\"0xe\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x482480017ff78000\",\"0x258\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff97fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x10780017fff7fff\",\"0x14\",\"0x480280027ffb8000\",\"0x1104800180018000\",\"0x48a9\",\"0x482480017fff8000\",\"0x48a8\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x9\",\"0x482480017fff8000\",\"0x213ea\",\"0x480a7ff87fff8000\",\"0x48127ff47fff8000\",\"0x48307ffd7ff68000\",\"0x482680017ffb8000\",\"0x6\",\"0x480280047ffb8000\",\"0x480280057ffb8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x55a\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xa78\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0xdf\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x122a\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xaf\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x9a\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x4802\",\"0x482480017fff8000\",\"0x4801\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x9\",\"0x482480017fff8000\",\"0x24072\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x57\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x48127fff7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffd\",\"0x480280037ffb8000\",\"0x20680017fff7fff\",\"0x30\",\"0x480280027ffb8000\",\"0x480280047ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffd7fff8000\",\"0x480a7ff87fff8000\",\"0x482680017ffb8000\",\"0x5\",\"0x480680017fff8000\",\"0x3711c9d994faf6055172091cb841fd4831aa743e6f3315163b06a122c841846\",\"0x48127fe17fff8000\",\"0x480680017fff8000\",\"0x5\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127fdb7fff8000\",\"0x480080027ff38000\",\"0x1104800180018000\",\"0x242f\",\"0x20680017fff7ffd\",\"0xe\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x482480017ff78000\",\"0x258\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff97fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x10780017fff7fff\",\"0x14\",\"0x480280027ffb8000\",\"0x1104800180018000\",\"0x47b4\",\"0x482480017fff8000\",\"0x47b3\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x9\",\"0x482480017fff8000\",\"0x21322\",\"0x480a7ff87fff8000\",\"0x48127ff47fff8000\",\"0x48307ffd7ff68000\",\"0x482680017ffb8000\",\"0x6\",\"0x480280047ffb8000\",\"0x480280057ffb8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x55a\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xa78\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0xdf\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x122a\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xaf\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x9a\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x470d\",\"0x482480017fff8000\",\"0x470c\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x9\",\"0x482480017fff8000\",\"0x2413a\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x57\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x48127fff7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffd\",\"0x480280037ffb8000\",\"0x20680017fff7fff\",\"0x30\",\"0x480280027ffb8000\",\"0x480280047ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffd7fff8000\",\"0x480a7ff87fff8000\",\"0x482680017ffb8000\",\"0x5\",\"0x480680017fff8000\",\"0x251e864ca2a080f55bce5da2452e8cfcafdbc951a3e7fff5023d558452ec228\",\"0x48127fe17fff8000\",\"0x480680017fff8000\",\"0x3\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127fdb7fff8000\",\"0x480080027ff38000\",\"0x1104800180018000\",\"0x21e7\",\"0x20680017fff7ffd\",\"0xe\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x482480017ff78000\",\"0x258\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff97fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x10780017fff7fff\",\"0x14\",\"0x480280027ffb8000\",\"0x1104800180018000\",\"0x46bf\",\"0x482480017fff8000\",\"0x46be\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x9\",\"0x482480017fff8000\",\"0x213ea\",\"0x480a7ff87fff8000\",\"0x48127ff47fff8000\",\"0x48307ffd7ff68000\",\"0x482680017ffb8000\",\"0x6\",\"0x480280047ffb8000\",\"0x480280057ffb8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x55a\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xa78\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0xdf\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x122a\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xaf\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x9a\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x4618\",\"0x482480017fff8000\",\"0x4617\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x9\",\"0x482480017fff8000\",\"0x24072\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x57\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x48127fff7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffd\",\"0x480280037ffb8000\",\"0x20680017fff7fff\",\"0x30\",\"0x480280027ffb8000\",\"0x480280047ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffd7fff8000\",\"0x480a7ff87fff8000\",\"0x482680017ffb8000\",\"0x5\",\"0x480680017fff8000\",\"0x251e864ca2a080f55bce5da2452e8cfcafdbc951a3e7fff5023d558452ec228\",\"0x48127fe17fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127fdb7fff8000\",\"0x480080027ff38000\",\"0x1104800180018000\",\"0x2245\",\"0x20680017fff7ffd\",\"0xe\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x482480017ff78000\",\"0x258\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff97fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x10780017fff7fff\",\"0x14\",\"0x480280027ffb8000\",\"0x1104800180018000\",\"0x45ca\",\"0x482480017fff8000\",\"0x45c9\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x9\",\"0x482480017fff8000\",\"0x21322\",\"0x480a7ff87fff8000\",\"0x48127ff47fff8000\",\"0x48307ffd7ff68000\",\"0x482680017ffb8000\",\"0x6\",\"0x480280047ffb8000\",\"0x480280057ffb8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x55a\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xa78\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x7c\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x1810\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x60\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x48127ffc7fff8000\",\"0x480280007ffc8000\",\"0x48307ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ff57fff8000\",\"0x482480017ff98000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x454a\",\"0x482480017fff8000\",\"0x4549\",\"0x48127ffa7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x1451e\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007fed7fff\",\"0x10780017fff7fff\",\"0x23\",\"0x48307ffe80007ffa\",\"0x400080007fee7fff\",\"0x482480017fee8000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x48127ff07fff8000\",\"0x1104800180018000\",\"0x22c8\",\"0x20680017fff7ffd\",\"0xd\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x64\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fea8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x7b2\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x68\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x1bf8\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x48127ffb7fff8000\",\"0x482480017ffb8000\",\"0x492\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x44c3\",\"0x482480017fff8000\",\"0x44c2\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0xa0680017fff8000\",\"0x9\",\"0x4824800180007ffd\",\"0x2af8\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff57fff\",\"0x10780017fff7fff\",\"0x2f\",\"0x4824800180007ffd\",\"0x2af8\",\"0x400080007ff67fff\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x341c1bdfd89f69748aa00b5742b03adbffd79b8e80cab5c50d91cd8c2a79be1\",\"0x482480017ff38000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffb\",\"0x400280027ffb7ffc\",\"0x400280037ffb7ffd\",\"0x480280057ffb8000\",\"0x20680017fff7fff\",\"0x11\",\"0x480280047ffb8000\",\"0x40780017fff7fff\",\"0x1\",\"0x480280067ffb8000\",\"0x400080007ffe7fff\",\"0x48127ffa7fff8000\",\"0x48127ffc7fff8000\",\"0x482680017ffb8000\",\"0x7\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480280047ffb8000\",\"0x48127ffc7fff8000\",\"0x482480017ffe8000\",\"0x12c\",\"0x482680017ffb8000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ffb8000\",\"0x480280077ffb8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x21b6\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x68\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x1bf8\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x48127ffb7fff8000\",\"0x482480017ffb8000\",\"0x492\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x4446\",\"0x482480017fff8000\",\"0x4445\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0xa0680017fff8000\",\"0x9\",\"0x4824800180007ffd\",\"0x2af8\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff57fff\",\"0x10780017fff7fff\",\"0x2f\",\"0x4824800180007ffd\",\"0x2af8\",\"0x400080007ff67fff\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0xb6ce5410fca59d078ee9b2a4371a9d684c530d697c64fbef0ae6d5e8f0ac72\",\"0x482480017ff38000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffb\",\"0x400280027ffb7ffc\",\"0x400280037ffb7ffd\",\"0x480280057ffb8000\",\"0x20680017fff7fff\",\"0x11\",\"0x480280047ffb8000\",\"0x40780017fff7fff\",\"0x1\",\"0x480280067ffb8000\",\"0x400080007ffe7fff\",\"0x48127ffa7fff8000\",\"0x48127ffc7fff8000\",\"0x482680017ffb8000\",\"0x7\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480280047ffb8000\",\"0x48127ffc7fff8000\",\"0x482480017ffe8000\",\"0x12c\",\"0x482680017ffb8000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ffb8000\",\"0x480280077ffb8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x21b6\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x95\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x1bf8\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x48127ffb7fff8000\",\"0x482480017ffb8000\",\"0x492\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x43c9\",\"0x482480017fff8000\",\"0x43c8\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0xa0680017fff8000\",\"0x9\",\"0x4824800180007ffd\",\"0x3336\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff57fff\",\"0x10780017fff7fff\",\"0x5c\",\"0x4824800180007ffd\",\"0x3336\",\"0x400080007ff67fff\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1f0d4aa99431d246bac9b8e48c33e888245b15e9678f64f9bdfc8823dc8f979\",\"0x482480017ff38000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffb\",\"0x400280027ffb7ffc\",\"0x400280037ffb7ffd\",\"0x480280057ffb8000\",\"0x20680017fff7fff\",\"0x39\",\"0x480280047ffb8000\",\"0x480280067ffb8000\",\"0x482680017ffb8000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x12\",\"0x4824800180007ffc\",\"0x100\",\"0x4844800180008002\",\"0x8000000000000110000000000000000\",\"0x4830800080017ffe\",\"0x480080007ff57fff\",\"0x482480017ffe8000\",\"0xefffffffffffffde00000000000000ff\",\"0x480080017ff37fff\",\"0x400080027ff27ffb\",\"0x402480017fff7ffb\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7fff\",\"0x16\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x482480017ffc8000\",\"0xffffffffffffffffffffffffffffff00\",\"0x400080017ff77fff\",\"0x40780017fff7fff\",\"0x1\",\"0x400080007fff7ffa\",\"0x482480017ff68000\",\"0x2\",\"0x482480017ffb8000\",\"0x55a\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f72655538202d206e6f6e207538\",\"0x400080007ffe7fff\",\"0x482480017ff08000\",\"0x3\",\"0x48127ff57fff8000\",\"0x48127ff37fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0xa\",\"0x480280047ffb8000\",\"0x48127ffc7fff8000\",\"0x482480017ffe8000\",\"0x776\",\"0x482680017ffb8000\",\"0x8\",\"0x480280067ffb8000\",\"0x480280077ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x21b6\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x5e\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x1bf8\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x48127ffb7fff8000\",\"0x482480017ffb8000\",\"0x492\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x431f\",\"0x482480017fff8000\",\"0x431e\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0xa0680017fff8000\",\"0x9\",\"0x4824800180007ffd\",\"0x6bc6\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff57fff\",\"0x10780017fff7fff\",\"0x25\",\"0x4824800180007ffd\",\"0x6bc6\",\"0x400080007ff67fff\",\"0x482480017ff68000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x110e2f729c9c2b988559994a3daccd838cf52faf88e18101373e67dd061455a\",\"0x1104800180018000\",\"0x2129\",\"0x20680017fff7ffd\",\"0xf\",\"0x40780017fff7fff\",\"0x1\",\"0x400080007fff7ffd\",\"0x400080017fff7ffe\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x2\",\"0x208b7fff7fff7ffe\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x12c\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x21b6\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0xae\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x128e\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x7e\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x69\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x55a\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x427a\",\"0x482480017fff8000\",\"0x4279\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x6e82\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffb\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff37fff\",\"0x10780017fff7fff\",\"0x28\",\"0x48307ffe80007ffb\",\"0x400080007ff47fff\",\"0x482480017ff48000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x3a4e8ec16e258a799fe707996fd5d21d42b29adc1499a370edf7f809d8c458a\",\"0x48127fe87fff8000\",\"0x1104800180018000\",\"0x2142\",\"0x20680017fff7ffd\",\"0x10\",\"0x40780017fff7fff\",\"0x1\",\"0x400080007fff7ffd\",\"0x400080017fff7ffe\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x2\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x12c\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017ff08000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x4f6\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xa14\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0xfa\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x9ec\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xca\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0xb5\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480080007fef8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x81\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x6c\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x4185\",\"0x482480017fff8000\",\"0x4184\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x7012\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x29\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x3c87bf42ed4f01f11883bf54f43d91d2cbbd5fec26d1df9c74c57ae138800a4\",\"0x48127fd97fff8000\",\"0x48127fe67fff8000\",\"0x1104800180018000\",\"0x2113\",\"0x20680017fff7ffd\",\"0x10\",\"0x40780017fff7fff\",\"0x1\",\"0x400080007fff7ffd\",\"0x400080017fff7ffe\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x2\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x12c\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x55a\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xa78\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0xd98\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x12b6\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x161\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x5e6\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x131\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x11c\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xe8\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xcc\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xaa\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x8e\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x4040\",\"0x482480017fff8000\",\"0x403f\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x21962\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x50\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x48127fff7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffd\",\"0x480280037ffb8000\",\"0x20680017fff7fff\",\"0x29\",\"0x480280027ffb8000\",\"0x480280047ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffd7fff8000\",\"0x480a7ff87fff8000\",\"0x482680017ffb8000\",\"0x5\",\"0x480080027ffb8000\",\"0x48127fcb7fff8000\",\"0x48127fd97fff8000\",\"0x48127fe37fff8000\",\"0x1104800180018000\",\"0x208e\",\"0x20680017fff7ffd\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x1\",\"0x400080007ffe7fff\",\"0x48127ff97fff8000\",\"0x48127ff67fff8000\",\"0x482480017ff68000\",\"0x190\",\"0x48127ff77fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff97fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x10780017fff7fff\",\"0x14\",\"0x480280027ffb8000\",\"0x1104800180018000\",\"0x3ff9\",\"0x482480017fff8000\",\"0x3ff8\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x1ec12\",\"0x480a7ff87fff8000\",\"0x48127ff47fff8000\",\"0x48307ffd7ff68000\",\"0x482680017ffb8000\",\"0x6\",\"0x480280047ffb8000\",\"0x480280057ffb8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x1ae\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x7f8\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x834\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xe7e\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x119e\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x16bc\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x4\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0xfffffffffffffffffffffffffffffc68\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x1cb\",\"0x4825800180007ffa\",\"0x398\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x19c\",\"0x40137fff7fff8003\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4825800180048003\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x186\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48317fff80008003\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480080007fef8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x152\",\"0x40137fff7fff8002\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4825800180048002\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x13c\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48317fff80008002\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x108\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xec\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xca\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xae\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x3e95\",\"0x482480017fff8000\",\"0x3e94\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x8\",\"0x482480017fff8000\",\"0x3479c\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x70\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x48127fff7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffd\",\"0x480280037ffb8000\",\"0x20680017fff7fff\",\"0x49\",\"0x480280027ffb8000\",\"0x480280047ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffd7fff8000\",\"0x480a7ff87fff8000\",\"0x482680017ffb8000\",\"0x5\",\"0x480a80037fff8000\",\"0x480080027ffa8000\",\"0x40137fd97fff8000\",\"0x40137fe47fff8001\",\"0x480a80007fff8000\",\"0x480a80017fff8000\",\"0x1104800180018000\",\"0x22ba\",\"0x20680017fff7ffd\",\"0x26\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480a80037fff8000\",\"0x480a80027fff8000\",\"0x480a80007fff8000\",\"0x480a80017fff8000\",\"0x1104800180018000\",\"0x1ed5\",\"0x20680017fff7ffd\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x1\",\"0x400080007ffe7fff\",\"0x48127ff97fff8000\",\"0x48127ff67fff8000\",\"0x482480017ff68000\",\"0x190\",\"0x48127ff77fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff97fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x10780017fff7fff\",\"0x26\",\"0x1104800180018000\",\"0x3e41\",\"0x482480017fff8000\",\"0x3e40\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x1eb4a\",\"0x48127ff47fff8000\",\"0x48127ff17fff8000\",\"0x48307ffd7ff18000\",\"0x48127ff27fff8000\",\"0x48127ff37fff8000\",\"0x48127ff37fff8000\",\"0x10780017fff7fff\",\"0x14\",\"0x480280027ffb8000\",\"0x1104800180018000\",\"0x3e2e\",\"0x482480017fff8000\",\"0x3e2d\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x8\",\"0x482480017fff8000\",\"0x31a4c\",\"0x480a7ff87fff8000\",\"0x48127ff47fff8000\",\"0x48307ffd7ff68000\",\"0x482680017ffb8000\",\"0x6\",\"0x480280047ffb8000\",\"0x480280057ffb8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x1ae\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x7f8\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x834\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xe7e\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202333\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x119e\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x1716\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x1a36\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x1fae\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x20c6\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x161\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x5e6\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x131\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x11c\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xe8\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xcc\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xaa\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x8e\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x3ce6\",\"0x482480017fff8000\",\"0x3ce5\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xe2a4\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x50\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x48127fff7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffd\",\"0x480280037ffb8000\",\"0x20680017fff7fff\",\"0x29\",\"0x480280027ffb8000\",\"0x480280047ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffd7fff8000\",\"0x480a7ff87fff8000\",\"0x482680017ffb8000\",\"0x5\",\"0x480080027ffb8000\",\"0x48127fcb7fff8000\",\"0x48127fd97fff8000\",\"0x48127fe37fff8000\",\"0x1104800180018000\",\"0x2293\",\"0x20680017fff7ffd\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x1\",\"0x400080007ffe7fff\",\"0x48127ff97fff8000\",\"0x48127ff67fff8000\",\"0x482480017ff68000\",\"0x190\",\"0x48127ff77fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff97fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x10780017fff7fff\",\"0x14\",\"0x480280027ffb8000\",\"0x1104800180018000\",\"0x3c9f\",\"0x482480017fff8000\",\"0x3c9e\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xb554\",\"0x480a7ff87fff8000\",\"0x48127ff47fff8000\",\"0x48307ffd7ff68000\",\"0x482680017ffb8000\",\"0x6\",\"0x480280047ffb8000\",\"0x480280057ffb8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x1ae\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x7f8\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x834\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xe7e\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x119e\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x16bc\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x144\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x5e6\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x114\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0xff\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xcb\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xaf\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x8d\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x71\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x3b6f\",\"0x482480017fff8000\",\"0x3b6e\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x156ee\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x33\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x48127fd27fff8000\",\"0x48127fe07fff8000\",\"0x48127fea7fff8000\",\"0x1104800180018000\",\"0x220c\",\"0x20680017fff7ffd\",\"0x1b\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff97fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x1\",\"0x400080007ffc7fff\",\"0x48127ff77fff8000\",\"0x48127ff47fff8000\",\"0x48127ffc7fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff77fff8000\",\"0x482480017ff68000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x2bc\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x1ae\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x7f8\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x834\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xe7e\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x119e\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x16bc\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x144\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x5e6\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x114\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0xff\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xcb\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xaf\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x8d\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x71\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x3a15\",\"0x482480017fff8000\",\"0x3a14\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x156ee\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x33\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x48127fd27fff8000\",\"0x48127fe07fff8000\",\"0x48127fea7fff8000\",\"0x1104800180018000\",\"0x223e\",\"0x20680017fff7ffd\",\"0x1b\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff97fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x1\",\"0x400080007ffc7fff\",\"0x48127ff77fff8000\",\"0x48127ff47fff8000\",\"0x48127ffc7fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff77fff8000\",\"0x482480017ff68000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x2bc\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x1ae\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x7f8\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x834\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xe7e\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x119e\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x16bc\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x5e\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x1bf8\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x48127ffb7fff8000\",\"0x482480017ffb8000\",\"0x492\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x3953\",\"0x482480017fff8000\",\"0x3952\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0xa0680017fff8000\",\"0x9\",\"0x4824800180007ffd\",\"0x6bc6\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff57fff\",\"0x10780017fff7fff\",\"0x25\",\"0x4824800180007ffd\",\"0x6bc6\",\"0x400080007ff67fff\",\"0x482480017ff68000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x110e2f729c9c2b988559994a3daccd838cf52faf88e18101373e67dd061455a\",\"0x1104800180018000\",\"0x175d\",\"0x20680017fff7ffd\",\"0xf\",\"0x40780017fff7fff\",\"0x1\",\"0x400080007fff7ffd\",\"0x400080017fff7ffe\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x2\",\"0x208b7fff7fff7ffe\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x12c\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x21b6\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0xae\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x128e\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x7e\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x69\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x55a\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x38ae\",\"0x482480017fff8000\",\"0x38ad\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x6e82\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffb\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff37fff\",\"0x10780017fff7fff\",\"0x28\",\"0x48307ffe80007ffb\",\"0x400080007ff47fff\",\"0x482480017ff48000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x3a4e8ec16e258a799fe707996fd5d21d42b29adc1499a370edf7f809d8c458a\",\"0x48127fe87fff8000\",\"0x1104800180018000\",\"0x1776\",\"0x20680017fff7ffd\",\"0x10\",\"0x40780017fff7fff\",\"0x1\",\"0x400080007fff7ffd\",\"0x400080017fff7ffe\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x2\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x12c\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017ff08000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x4f6\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xa14\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x4\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0xfffffffffffffffffffffffffffffc68\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x1cb\",\"0x4825800180007ffa\",\"0x398\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x19c\",\"0x40137fff7fff8003\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4825800180048003\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x186\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48317fff80008003\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480080007fef8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x152\",\"0x40137fff7fff8002\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4825800180048002\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x13c\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48317fff80008002\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x108\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xec\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xca\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xae\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x3750\",\"0x482480017fff8000\",\"0x374f\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x8\",\"0x482480017fff8000\",\"0x3479c\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x70\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x48127fff7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffb7fff\",\"0x400280017ffb7ffd\",\"0x480280037ffb8000\",\"0x20680017fff7fff\",\"0x49\",\"0x480280027ffb8000\",\"0x480280047ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffd7fff8000\",\"0x480a7ff87fff8000\",\"0x482680017ffb8000\",\"0x5\",\"0x480a80037fff8000\",\"0x480080027ffa8000\",\"0x40137fd97fff8000\",\"0x40137fe47fff8001\",\"0x480a80007fff8000\",\"0x480a80017fff8000\",\"0x1104800180018000\",\"0x1b75\",\"0x20680017fff7ffd\",\"0x26\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480a80037fff8000\",\"0x480a80027fff8000\",\"0x480a80007fff8000\",\"0x480a80017fff8000\",\"0x1104800180018000\",\"0x1790\",\"0x20680017fff7ffd\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x1\",\"0x400080007ffe7fff\",\"0x48127ff97fff8000\",\"0x48127ff67fff8000\",\"0x482480017ff68000\",\"0x190\",\"0x48127ff77fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff97fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x10780017fff7fff\",\"0x26\",\"0x1104800180018000\",\"0x36fc\",\"0x482480017fff8000\",\"0x36fb\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x1eb4a\",\"0x48127ff47fff8000\",\"0x48127ff17fff8000\",\"0x48307ffd7ff18000\",\"0x48127ff27fff8000\",\"0x48127ff37fff8000\",\"0x48127ff37fff8000\",\"0x10780017fff7fff\",\"0x14\",\"0x480280027ffb8000\",\"0x1104800180018000\",\"0x36e9\",\"0x482480017fff8000\",\"0x36e8\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x8\",\"0x482480017fff8000\",\"0x31a4c\",\"0x480a7ff87fff8000\",\"0x48127ff47fff8000\",\"0x48307ffd7ff68000\",\"0x482680017ffb8000\",\"0x6\",\"0x480280047ffb8000\",\"0x480280057ffb8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x1ae\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x7f8\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x834\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xe7e\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202333\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x119e\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x1716\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x1a36\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x1fae\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x20c6\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x144\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x5e6\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x114\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0xff\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xcb\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xaf\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x8d\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x71\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x35a1\",\"0x482480017fff8000\",\"0x35a0\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x156ee\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x33\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x48127fd27fff8000\",\"0x48127fe07fff8000\",\"0x48127fea7fff8000\",\"0x1104800180018000\",\"0x1c3e\",\"0x20680017fff7ffd\",\"0x1b\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff97fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x1\",\"0x400080007ffc7fff\",\"0x48127ff77fff8000\",\"0x48127ff47fff8000\",\"0x48127ffc7fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff77fff8000\",\"0x482480017ff68000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x2bc\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x1ae\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x7f8\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x834\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xe7e\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x119e\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x16bc\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x144\",\"0x4825800180007ffa\",\"0x0\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x482480017ffe8000\",\"0x5e6\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x114\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0xff\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xcb\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0xaf\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x8d\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x71\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x3447\",\"0x482480017fff8000\",\"0x3446\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x156ee\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x33\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x48127fd27fff8000\",\"0x48127fe07fff8000\",\"0x48127fea7fff8000\",\"0x1104800180018000\",\"0x1c70\",\"0x20680017fff7ffd\",\"0x1b\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff97fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x1\",\"0x400080007ffc7fff\",\"0x48127ff77fff8000\",\"0x48127ff47fff8000\",\"0x48127ffc7fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff77fff8000\",\"0x482480017ff68000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x2bc\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x1ae\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x7f8\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x834\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0xe7e\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x119e\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x16bc\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ffa8000\",\"0xffffffffffffffffffffffffffffe192\",\"0x400280007ff97fff\",\"0x10780017fff7fff\",\"0x297\",\"0x4825800180007ffa\",\"0x1e6e\",\"0x400280007ff97fff\",\"0x482680017ff98000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x27c\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x48127ffc7fff8000\",\"0x480280007ffc8000\",\"0x48307ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x262\",\"0x482480017ffb8000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480080007ff88000\",\"0x48307ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffd7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff77fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffd7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x234\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x12\",\"0x4824800180007ffd\",\"0x100\",\"0x4844800180008002\",\"0x8000000000000110000000000000000\",\"0x4830800080017ffe\",\"0x480080007fe87fff\",\"0x482480017ffe8000\",\"0xefffffffffffffde00000000000000ff\",\"0x480080017fe67fff\",\"0x400080027fe57ffb\",\"0x402480017fff7ffb\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7fff\",\"0x21c\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007feb7ffd\",\"0x482480017ffd8000\",\"0xffffffffffffffffffffffffffffff00\",\"0x400080017fea7fff\",\"0x482480017fea8000\",\"0x2\",\"0x48127ffc7fff8000\",\"0x48307ff680007ff7\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff48000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff17fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x1ea\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x1ce\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48307ff780007ff8\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff58000\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x1ac\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff58003\",\"0x480080017ff48003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ffa\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff07ffd\",\"0x20680017fff7ffe\",\"0x190\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffd7fff8000\",\"0x48127ff07fff8000\",\"0x48127ffa7fff8000\",\"0x48307ff580007ff6\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffc7fff8000\",\"0x482480017ff38000\",\"0x1\",\"0x48127ff37fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480080007ff08000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffc7fff8000\",\"0x48127ff37fff8000\",\"0x48127ff37fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x15f\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff17ffc\",\"0x480080017ff07ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027fef7ffd\",\"0x10780017fff7fff\",\"0x14a\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff27ffd\",\"0x480080017ff17ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff07ffe\",\"0x482480017ff08000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480080007fef8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x116\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0x101\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480080007fef8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xcd\",\"0x48127ffb7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffd\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027ff17ffd\",\"0x10780017fff7fff\",\"0xb8\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffc\",\"0x480080007ff47ffd\",\"0x480080017ff37ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027ff27ffe\",\"0x482480017ff28000\",\"0x3\",\"0x48127ff97fff8000\",\"0x48307ff480007ff5\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482480017ff28000\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x84\",\"0x480080007fff8000\",\"0x48127ffa7fff8000\",\"0xa0680017fff8000\",\"0x12\",\"0x4824800180007ffd\",\"0x10000000000000000\",\"0x4844800180008002\",\"0x8000000000000110000000000000000\",\"0x4830800080017ffe\",\"0x480080007ff27fff\",\"0x482480017ffe8000\",\"0xefffffffffffffdeffffffffffffffff\",\"0x480080017ff07fff\",\"0x400080027fef7ffb\",\"0x402480017fff7ffb\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7fff\",\"0x6c\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff57ffd\",\"0x482480017ffd8000\",\"0xffffffffffffffff0000000000000000\",\"0x400080017ff47fff\",\"0x482480017ff48000\",\"0x2\",\"0x48127ffc7fff8000\",\"0x48307ff680007ff7\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x5be\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x3212\",\"0x482480017fff8000\",\"0x3211\",\"0x48127ffb7fff8000\",\"0x480080007ffe8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0xc\",\"0x482480017fff8000\",\"0x5dd54\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffe80007ffa\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff27fff\",\"0x10780017fff7fff\",\"0x2b\",\"0x48307ffe80007ffa\",\"0x400080007ff37fff\",\"0x482480017ff38000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffb7fff8000\",\"0x48127f917fff8000\",\"0x48127f957fff8000\",\"0x48127f9b7fff8000\",\"0x48127fb67fff8000\",\"0x48127fb67fff8000\",\"0x48127fbb7fff8000\",\"0x48127fc87fff8000\",\"0x48127fd57fff8000\",\"0x48127fe37fff8000\",\"0x1104800180018000\",\"0x1bc1\",\"0x20680017fff7ffd\",\"0xd\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffa7fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x64\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482480017fef8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017fef8000\",\"0x3\",\"0x482480017ff78000\",\"0x384\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x96a\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202338\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0xc8a\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x11a8\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202337\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff18000\",\"0x3\",\"0x482480017ff88000\",\"0x14c8\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x19e6\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202336\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017fef8000\",\"0x3\",\"0x482480017ff88000\",\"0x1d06\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff67fff8000\",\"0x482480017ffa8000\",\"0x2224\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202335\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x2260\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x28aa\",\"0x10780017fff7fff\",\"0xb\",\"0x482480017ff08000\",\"0x3\",\"0x482480017ff88000\",\"0x28e6\",\"0x10780017fff7fff\",\"0x5\",\"0x48127ff87fff8000\",\"0x482480017ffa8000\",\"0x2f30\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202334\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482480017fe58000\",\"0x3\",\"0x482480017ff78000\",\"0x307a\",\"0x10780017fff7fff\",\"0x5\",\"0x48127fee7fff8000\",\"0x482480017ffa8000\",\"0x3660\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202333\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ff57fff8000\",\"0x482480017ff98000\",\"0x3bd8\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4661696c656420746f20646573657269616c697a6520706172616d202331\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x3e30\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x480a7ff87fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x482680017ffa8000\",\"0x2152\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x1104800180018000\",\"0x1c0c\",\"0x20680017fff7ffd\",\"0xa2\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x6894a7eacac1683e1e290e1df9a86c47bc34cd609052ca3e176955bc0958ee\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff87fff\",\"0x400080017ff87ffc\",\"0x400080027ff87ffd\",\"0x400080037ff87ffe\",\"0x480080057ff88000\",\"0x20680017fff7fff\",\"0x81\",\"0x480080047ff78000\",\"0x480080067ff68000\",\"0x482480017ff58000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffc\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480080007fec7ffc\",\"0x480080017feb7ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400080027fea7ffd\",\"0x10780017fff7fff\",\"0x5d\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffb\",\"0x480080007fed7ffd\",\"0x480080017fec7ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400080027feb7ffe\",\"0x482480017feb8000\",\"0x3\",\"0x48127ff97fff8000\",\"0x20680017fff7ff6\",\"0x3e\",\"0x48127fff7fff8000\",\"0x20780017fff7ffd\",\"0x14\",\"0x40780017fff7fff\",\"0x4\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x5a45524f5f41444452455353\",\"0x400080007ffe7fff\",\"0x48127ff77fff8000\",\"0x482480017ff88000\",\"0x2a08\",\"0x48127fe27fff8000\",\"0x48127fed7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x6894a7eacac1683e1e290e1df9a86c47bc34cd609052ca3e176955bc0958ee\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080007ff27fff\",\"0x400080017ff27ffc\",\"0x400080027ff27ffd\",\"0x400080037ff27ffe\",\"0x400180047ff27ffd\",\"0x480080067ff28000\",\"0x20680017fff7fff\",\"0xf\",\"0x480080057ff18000\",\"0x48127ff77fff8000\",\"0x48127ffe7fff8000\",\"0x48127fe27fff8000\",\"0x482480017fed8000\",\"0x7\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x480080057ff18000\",\"0x48127ff77fff8000\",\"0x48127ffe7fff8000\",\"0x48127fe27fff8000\",\"0x482480017fed8000\",\"0x9\",\"0x480680017fff8000\",\"0x1\",\"0x480080077feb8000\",\"0x480080087fea8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x5\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4c4f434b494e475f434f4e54524143545f414c52454144595f534554\",\"0x400080007ffe7fff\",\"0x48127ff77fff8000\",\"0x482480017ff78000\",\"0x2ac6\",\"0x48127fe27fff8000\",\"0x48127fed7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4e6f6e20436f6e747261637441646472657373\",\"0x400080007ffe7fff\",\"0x482480017fe78000\",\"0x3\",\"0x482480017ff58000\",\"0x28fa\",\"0x48127ff37fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0xc\",\"0x40780017fff7fff\",\"0xc\",\"0x480080047feb8000\",\"0x48127fe77fff8000\",\"0x482480017ffe8000\",\"0x2f9e\",\"0x482480017fe88000\",\"0x8\",\"0x480080067fe78000\",\"0x480080077fe68000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fe27fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x17\",\"0x48127fe27fff8000\",\"0x482480017fe28000\",\"0x5c80\",\"0x48127fe27fff8000\",\"0x48127fe27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127fe27fff8000\",\"0x48127fe27fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x6894a7eacac1683e1e290e1df9a86c47bc34cd609052ca3e176955bc0958ee\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ff97fff\",\"0x400380017ff97ff7\",\"0x400280027ff97ffd\",\"0x400280037ff97ffe\",\"0x480280057ff98000\",\"0x20680017fff7fff\",\"0x98\",\"0x480280047ff98000\",\"0x400380067ff98000\",\"0x482680017ff98000\",\"0x7\",\"0x48127ffe7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4825800180048000\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480280007ff67ffc\",\"0x480280017ff67ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400280027ff67ffd\",\"0x10780017fff7fff\",\"0x6d\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48317fff80008000\",\"0x480280007ff67ffd\",\"0x480280017ff67ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400280027ff67ffe\",\"0x482680017ff68000\",\"0x3\",\"0x48127ff97fff8000\",\"0x20780017fff8000\",\"0x1b\",\"0x1104800180018000\",\"0x3017\",\"0x482480017fff8000\",\"0x3016\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x164d6\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4c4f434b494e475f434f4e54524143545f4e4f545f534554\",\"0x400080007ffe7fff\",\"0x48127ff57fff8000\",\"0x48307ffc7ff58000\",\"0x480a7ff87fff8000\",\"0x48127feb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127ffe7fff8000\",\"0x48127ffe7fff8000\",\"0x480a7ff87fff8000\",\"0x48127ff47fff8000\",\"0x480a7ffa7fff8000\",\"0x480a80007fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x1104800180018000\",\"0x1ba4\",\"0x20680017fff7ffd\",\"0x31\",\"0x40780017fff7fff\",\"0x1\",\"0x400180007fff7ffa\",\"0x400180017fff7ffb\",\"0x400180027fff7ffc\",\"0x400180037fff7ffd\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x2b7080bbeb1d6f069b6c264f329194905a30d16c6b2dba4f2d59935c2c3896a\",\"0x48127ffd7fff8000\",\"0x482480017ffc8000\",\"0x4\",\"0x480680017fff8000\",\"0x43616c6c436f6e7472616374\",\"0x400080007ff67fff\",\"0x400080017ff67ffb\",\"0x400180027ff68000\",\"0x400080037ff67ffc\",\"0x400080047ff67ffd\",\"0x400080057ff67ffe\",\"0x480080077ff68000\",\"0x20680017fff7fff\",\"0xf\",\"0x480080067ff58000\",\"0x48127ff17fff8000\",\"0x48127ffe7fff8000\",\"0x48127ff17fff8000\",\"0x482480017ff18000\",\"0xa\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x480080067ff58000\",\"0x48127ff17fff8000\",\"0x48127ffe7fff8000\",\"0x48127ff17fff8000\",\"0x482480017ff18000\",\"0xa\",\"0x480680017fff8000\",\"0x1\",\"0x480080087fef8000\",\"0x480080097fee8000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x2e7c\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2fb9\",\"0x482480017fff8000\",\"0x2fb8\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x162e2\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4e6f6e20436f6e747261637441646472657373\",\"0x400080007ffe7fff\",\"0x482680017ff68000\",\"0x3\",\"0x48307ffc7fef8000\",\"0x48127fed7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x13\",\"0x480280047ff98000\",\"0x1104800180018000\",\"0x2fa0\",\"0x482480017fff8000\",\"0x2f9f\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x169ea\",\"0x480a7ff67fff8000\",\"0x48307ffe7ff78000\",\"0x482680017ff98000\",\"0x8\",\"0x480280067ff98000\",\"0x480280077ff98000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ff87fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ff88000\",\"0xfffffffffffffffffffffffffffff592\",\"0x400280007ff77fff\",\"0x10780017fff7fff\",\"0x49\",\"0x4825800180007ff8\",\"0xa6e\",\"0x400280007ff77fff\",\"0x482680017ff78000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x20780017fff7ffd\",\"0xe\",\"0x48127ffe7fff8000\",\"0x482480017ffe8000\",\"0xad2\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127fff7fff8000\",\"0x48297ff980007ffa\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ff98000\",\"0x1\",\"0x480a7ffa7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ff98000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xf\",\"0x400280007ffc7fff\",\"0x48127ff77fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x482680017ffc8000\",\"0x1\",\"0x4825800180007ffd\",\"0x1\",\"0x1104800180018000\",\"0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffc4\",\"0x208b7fff7fff7ffe\",\"0x48127ff77fff8000\",\"0x482480017ffa8000\",\"0x6ea\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482680017ff78000\",\"0x1\",\"0x480a7ff87fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x4\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ff57fff\",\"0x400380017ff57ff3\",\"0x480280037ff58000\",\"0x20680017fff7fff\",\"0x1ed\",\"0x480280027ff58000\",\"0x480280047ff58000\",\"0x480080007fff8000\",\"0x480080017fff8000\",\"0x482680017ff58000\",\"0x5\",\"0x48127ffb7fff8000\",\"0x48317ffd80017ffb\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff27fff\",\"0x10780017fff7fff\",\"0x1c4\",\"0x400280007ff27fff\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x38bb9518f707d6868da0178f4ac498e320441f8f7e11ff8a35ed4ea8286e693\",\"0x482680017ff28000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff77fff\",\"0x400080017ff77ffb\",\"0x400080027ff77ffc\",\"0x400080037ff77ffd\",\"0x480080057ff78000\",\"0x20680017fff7fff\",\"0x19e\",\"0x480080047ff68000\",\"0x48127ffc7fff8000\",\"0x48127ffe7fff8000\",\"0x480a7ff47fff8000\",\"0x480a7ff77fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x402580017fed8002\",\"0x7\",\"0x400180067fed8003\",\"0x1104800180018000\",\"0x1cb2\",\"0x20680017fff7ffd\",\"0x176\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x537461726b4e6574204d657373616765\",\"0x400080007ffe7fff\",\"0x400180017ffe8003\",\"0x400180027ffe7ff6\",\"0x400080037ffe7ffd\",\"0x48127ffe7fff8000\",\"0x482480017ffd8000\",\"0x4\",\"0x40327ffe80017fff\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff67fff8000\",\"0x4828800180017ffe\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff17fff\",\"0x10780017fff7fff\",\"0x1b\",\"0x400080007ff27fff\",\"0x1104800180018000\",\"0x2ed4\",\"0x482480017fff8000\",\"0x2ed3\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x7\",\"0x482480017fff8000\",\"0x2535a\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x5265717569726573206174206c65617374206f6e6520656c656d656e74\",\"0x400080007ffe7fff\",\"0x482480017fe98000\",\"0x1\",\"0x48307ffc7ff38000\",\"0x48127fe97fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x155\",\"0x482480017ff18000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x48127ff17fff8000\",\"0x48127ff67fff8000\",\"0x48127ff67fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x1104800180018000\",\"0x1cd0\",\"0x20680017fff7ffc\",\"0x129\",\"0x400080007ffb7fff\",\"0x400180017ffb8001\",\"0x480080027ffb8000\",\"0x480680017fff8000\",\"0x15de4ee18ebfb6453b53db283bb13bc3b7d746ca2d79f8163920e1b68d594ee\",\"0x400080037ff97fff\",\"0x400080047ff97ffe\",\"0x480080057ff98000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff27ffc\",\"0x480080017ff17ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027fef7ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff27ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017ff07ffd\",\"0x400080027fef7ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff07fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017fef8000\",\"0x6\",\"0x482480017fec8000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x4002800080027fff\",\"0x4002800180027ffb\",\"0x4002800280027ffc\",\"0x4002800380027ffa\",\"0x4802800580028000\",\"0x20680017fff7fff\",\"0xdf\",\"0x4802800480028000\",\"0x4802800680028000\",\"0x4826800180028000\",\"0x7\",\"0x48127ffd7fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1\",\"0x48307ffe80007fff\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48307ffd80007ffe\",\"0x10780017fff7fff\",\"0x7\",\"0x40780017fff7fff\",\"0x1\",\"0x482480017ffa8000\",\"0x5a\",\"0x48127ffd7fff8000\",\"0x20680017fff7fff\",\"0x1b\",\"0x1104800180018000\",\"0x2e57\",\"0x482480017fff8000\",\"0x2e56\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x5\",\"0x482480017fff8000\",\"0x20f76\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x5349474e45445f524551554553545f414c52454144595f55534544\",\"0x400080007ffe7fff\",\"0x48127fe87fff8000\",\"0x48307ffc7ff48000\",\"0x48127fe57fff8000\",\"0x48127fea7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x15de4ee18ebfb6453b53db283bb13bc3b7d746ca2d79f8163920e1b68d594ee\",\"0x400080007fef7fff\",\"0x400080017fef7fe3\",\"0x480080027fef8000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007feb7ffc\",\"0x480080017fea7ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027fe87ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007feb7ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017fe97ffd\",\"0x400080027fe87ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1\",\"0x402580017fe48000\",\"0x3\",\"0x482480017fe58000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080007fe87fff\",\"0x400080017fe87ffb\",\"0x400080027fe87ffc\",\"0x400080037fe87ffa\",\"0x400080047fe87ffd\",\"0x480080067fe88000\",\"0x20680017fff7fff\",\"0x58\",\"0x480080057fe78000\",\"0x48127ffc7fff8000\",\"0x48127ffe7fff8000\",\"0x482480017fe48000\",\"0x7\",\"0x480a7ff67fff8000\",\"0x48127fd07fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x1104800180018000\",\"0x1c77\",\"0x20680017fff7ffd\",\"0x33\",\"0x4824800180007fff\",\"0x56414c4944\",\"0x48127ffa7fff8000\",\"0x20680017fff7ffe\",\"0x8\",\"0x40780017fff7fff\",\"0x2\",\"0x482480017ffd8000\",\"0x50\",\"0x10780017fff7fff\",\"0x8\",\"0x4824800180007ffd\",\"0x1\",\"0x48127ffe7fff8000\",\"0x20680017fff7ffe\",\"0xe\",\"0x48127fff7fff8000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80007fff8000\",\"0x48127ff47fff8000\",\"0x480a7ff67fff8000\",\"0x480a7ff77fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffd9e\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2de0\",\"0x482480017fff8000\",\"0x2ddf\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x198d4\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x5349474e41545552455f56414c49444154494f4e5f4641494c4544\",\"0x400080007ffe7fff\",\"0x48307ffd7ff68000\",\"0x48127ffd7fff8000\",\"0x482480017ffc8000\",\"0x1\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x6\",\"0x1104800180018000\",\"0x2dc9\",\"0x482480017fff8000\",\"0x2dc8\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x19c1c\",\"0x48307fff7fee8000\",\"0x48127ff07fff8000\",\"0x48127ff07fff8000\",\"0x48127fea7fff8000\",\"0x48127ffc7fff8000\",\"0x480a80007fff8000\",\"0x48127fe97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480080057fe78000\",\"0x1104800180018000\",\"0x2db2\",\"0x482480017fff8000\",\"0x2db1\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x1ddda\",\"0x48127ff57fff8000\",\"0x48307ffe7ff78000\",\"0x480a80007fff8000\",\"0x482480017fdc8000\",\"0x9\",\"0x480680017fff8000\",\"0x1\",\"0x480080077fda8000\",\"0x480080087fd98000\",\"0x208b7fff7fff7ffe\",\"0x4802800480028000\",\"0x1104800180018000\",\"0x2d9d\",\"0x482480017fff8000\",\"0x2d9c\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x5\",\"0x482480017fff8000\",\"0x216e2\",\"0x48127ff57fff8000\",\"0x48307ffe7ff78000\",\"0x48127ff27fff8000\",\"0x4826800180028000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x4802800680028000\",\"0x4802800780028000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2d89\",\"0x482480017fff8000\",\"0x2d88\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x7\",\"0x482480017fff8000\",\"0x247c0\",\"0x48127ff27fff8000\",\"0x48307ffe7ff28000\",\"0x48127ff27fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x10780017fff7fff\",\"0x11\",\"0x1104800180018000\",\"0x2d78\",\"0x482480017fff8000\",\"0x2d77\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x7\",\"0x482480017fff8000\",\"0x25a9e\",\"0x48127ff37fff8000\",\"0x48307ffe7ff38000\",\"0x48127ff37fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a80027fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480080047ff68000\",\"0x1104800180018000\",\"0x2d5f\",\"0x482480017fff8000\",\"0x2d5e\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x8\",\"0x482480017fff8000\",\"0x2792a\",\"0x48127ff57fff8000\",\"0x48307ffe7ff78000\",\"0x480a7ff47fff8000\",\"0x482480017feb8000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480080067fe98000\",\"0x480080077fe88000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2d4b\",\"0x482480017fff8000\",\"0x2d4a\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x8\",\"0x482480017fff8000\",\"0x2a2f6\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x5349474e41545552455f45585049524544\",\"0x400080007ffe7fff\",\"0x482680017ff28000\",\"0x1\",\"0x48307ffc7ff28000\",\"0x480a7ff47fff8000\",\"0x48127fef7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480280027ff58000\",\"0x1104800180018000\",\"0x2d30\",\"0x482480017fff8000\",\"0x2d2f\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x8\",\"0x482480017fff8000\",\"0x2a850\",\"0x480a7ff27fff8000\",\"0x48307ffe7ff78000\",\"0x480a7ff47fff8000\",\"0x482680017ff58000\",\"0x6\",\"0x480680017fff8000\",\"0x1\",\"0x480280047ff58000\",\"0x480280057ff58000\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffa7fff\",\"0x400380017ffa7ff8\",\"0x480280037ffa8000\",\"0x20680017fff7fff\",\"0x8d\",\"0x480280027ffa8000\",\"0x480280047ffa8000\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1390569bb0a3a722eb4228e8700301347da081211d5c2ded2db22ef389551ab\",\"0x480080007ffc8000\",\"0x480080017ffb8000\",\"0x480080027ffa8000\",\"0x480080037ff98000\",\"0x480080047ff88000\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280057ffa7fff\",\"0x400280067ffa7ff7\",\"0x400280077ffa7ff8\",\"0x400280087ffa7ff9\",\"0x4802800a7ffa8000\",\"0x20680017fff7fff\",\"0x5e\",\"0x480280097ffa8000\",\"0x4802800b7ffa8000\",\"0x482680017ffa8000\",\"0xc\",\"0x48127ffd7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffc\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480280007ff77ffc\",\"0x480280017ff77ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400280027ff77ffd\",\"0x10780017fff7fff\",\"0x33\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffb\",\"0x480280007ff77ffd\",\"0x480280017ff77ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400280027ff77ffe\",\"0x48307ff880007ff2\",\"0x482680017ff78000\",\"0x3\",\"0x48127ff87fff8000\",\"0x20680017fff7ffd\",\"0xc\",\"0x48127ffe7fff8000\",\"0x48127ffe7fff8000\",\"0x480a7ff97fff8000\",\"0x48127ff37fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x1104800180018000\",\"0x1ba4\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2cd5\",\"0x482480017fff8000\",\"0x2cd4\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1e9d8\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4d494e5445525f4f4e4c59\",\"0x400080007ffe7fff\",\"0x48127ff57fff8000\",\"0x48307ffc7ff58000\",\"0x480a7ff97fff8000\",\"0x48127fea7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2cbc\",\"0x482480017fff8000\",\"0x2cbb\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1e848\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4e6f6e20436f6e747261637441646472657373\",\"0x400080007ffe7fff\",\"0x482680017ff78000\",\"0x3\",\"0x48307ffc7fef8000\",\"0x48127fed7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x13\",\"0x480280097ffa8000\",\"0x1104800180018000\",\"0x2ca3\",\"0x482480017fff8000\",\"0x2ca2\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1ef5a\",\"0x480a7ff77fff8000\",\"0x48307ffe7ff78000\",\"0x482680017ffa8000\",\"0xd\",\"0x4802800b7ffa8000\",\"0x4802800c7ffa8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ff97fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480280027ffa8000\",\"0x1104800180018000\",\"0x2c89\",\"0x482480017fff8000\",\"0x2c88\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x21f02\",\"0x480a7ff77fff8000\",\"0x48307ffe7ff78000\",\"0x480a7ff97fff8000\",\"0x482680017ffa8000\",\"0x6\",\"0x480680017fff8000\",\"0x1\",\"0x480280047ffa8000\",\"0x480280057ffa8000\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffa7fff\",\"0x400380017ffa7ff8\",\"0x480280037ffa8000\",\"0x20680017fff7fff\",\"0x8d\",\"0x480280027ffa8000\",\"0x480280047ffa8000\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1390569bb0a3a722eb4228e8700301347da081211d5c2ded2db22ef389551ab\",\"0x480080007ffc8000\",\"0x480080017ffb8000\",\"0x480080027ffa8000\",\"0x480080037ff98000\",\"0x480080047ff88000\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280057ffa7fff\",\"0x400280067ffa7ff7\",\"0x400280077ffa7ff8\",\"0x400280087ffa7ff9\",\"0x4802800a7ffa8000\",\"0x20680017fff7fff\",\"0x5e\",\"0x480280097ffa8000\",\"0x4802800b7ffa8000\",\"0x482680017ffa8000\",\"0xc\",\"0x48127ffd7fff8000\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffc\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480280007ff77ffc\",\"0x480280017ff77ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400280027ff77ffd\",\"0x10780017fff7fff\",\"0x33\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffb\",\"0x480280007ff77ffd\",\"0x480280017ff77ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400280027ff77ffe\",\"0x48307ff880007ff2\",\"0x482680017ff78000\",\"0x3\",\"0x48127ff87fff8000\",\"0x20680017fff7ffd\",\"0xc\",\"0x48127ffe7fff8000\",\"0x48127ffe7fff8000\",\"0x480a7ff97fff8000\",\"0x48127ff37fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x1104800180018000\",\"0x1dd8\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2c2e\",\"0x482480017fff8000\",\"0x2c2d\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1e9d8\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4d494e5445525f4f4e4c59\",\"0x400080007ffe7fff\",\"0x48127ff57fff8000\",\"0x48307ffc7ff58000\",\"0x480a7ff97fff8000\",\"0x48127fea7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2c15\",\"0x482480017fff8000\",\"0x2c14\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1e848\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4e6f6e20436f6e747261637441646472657373\",\"0x400080007ffe7fff\",\"0x482680017ff78000\",\"0x3\",\"0x48307ffc7fef8000\",\"0x48127fed7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x13\",\"0x480280097ffa8000\",\"0x1104800180018000\",\"0x2bfc\",\"0x482480017fff8000\",\"0x2bfb\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1ef5a\",\"0x480a7ff77fff8000\",\"0x48307ffe7ff78000\",\"0x482680017ffa8000\",\"0xd\",\"0x4802800b7ffa8000\",\"0x4802800c7ffa8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ff97fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480280027ffa8000\",\"0x1104800180018000\",\"0x2be2\",\"0x482480017fff8000\",\"0x2be1\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x21f02\",\"0x480a7ff77fff8000\",\"0x48307ffe7ff78000\",\"0x480a7ff97fff8000\",\"0x482680017ffa8000\",\"0x6\",\"0x480680017fff8000\",\"0x1\",\"0x480280047ffa8000\",\"0x480280057ffa8000\",\"0x208b7fff7fff7ffe\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xa\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x8\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x98\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffe\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480280007ffb7ffc\",\"0x480280017ffb7ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400280027ffb7ffd\",\"0x10780017fff7fff\",\"0x84\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffd\",\"0x480280007ffb7ffd\",\"0x480280017ffb7ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400280027ffb7ffe\",\"0x482680017ffb8000\",\"0x3\",\"0x48127ff67fff8000\",\"0x48127ff67fff8000\",\"0x1104800180018000\",\"0x2021\",\"0x20680017fff7ff8\",\"0x5e\",\"0x20680017fff7ffb\",\"0x46\",\"0x48307ff980007ffa\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xa\",\"0x482480017ff88000\",\"0x1\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff57fff8000\",\"0x10780017fff7fff\",\"0x8\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x1b\",\"0x480080007fff8000\",\"0x20680017fff7fff\",\"0x6\",\"0x480680017fff8000\",\"0x1\",\"0x10780017fff7fff\",\"0x4\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1\",\"0x48127fef7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127f9e7fff8000\",\"0x48127fee7fff8000\",\"0x48127fee7fff8000\",\"0x48127fee7fff8000\",\"0x48127fee7fff8000\",\"0x48307ff480007ff5\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x3\",\"0x48127fef7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x8\",\"0x48127fef7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fef7fff8000\",\"0x48127fef7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x8\",\"0x48127fef7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127fed7fff8000\",\"0x48127fed7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x56\",\"0x482680017ffb8000\",\"0x3\",\"0x10780017fff7fff\",\"0x5\",\"0x40780017fff7fff\",\"0x5c\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127f9e7fff8000\",\"0x48127f9e7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480a7ff37fff8000\",\"0x480a7ff47fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff67fff8000\",\"0x1104800180018000\",\"0x2063\",\"0x20680017fff7ffd\",\"0x9d\",\"0x1104800180018000\",\"0x2afd\",\"0x482480017fff8000\",\"0x2afc\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x480a7ff67fff8000\",\"0x480080007ffc8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x1104800180018000\",\"0x2091\",\"0x20680017fff7ffc\",\"0x7a\",\"0x480680017fff8000\",\"0x1ac8d354f2e793629cb233a16f10d13cf15b9c45bbc620577c8e1df95ede545\",\"0x400280007ff57fff\",\"0x400280017ff57ffe\",\"0x480280027ff58000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027ff07ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff37ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017ff17ffd\",\"0x400080027ff07ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff17fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff58000\",\"0x3\",\"0x482480017fed8000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ff77fff\",\"0x400280017ff77ffb\",\"0x400280027ff77ffc\",\"0x400280037ff77ffa\",\"0x480280057ff78000\",\"0x20680017fff7fff\",\"0x3b\",\"0x480280047ff78000\",\"0x480280067ff78000\",\"0x482680017ff78000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x12\",\"0x4824800180007ffc\",\"0x10000000000000000\",\"0x4844800180008002\",\"0x8000000000000110000000000000000\",\"0x4830800080017ffe\",\"0x480080007ff57fff\",\"0x482480017ffe8000\",\"0xefffffffffffffdeffffffffffffffff\",\"0x480080017ff37fff\",\"0x400080027ff27ffb\",\"0x402480017fff7ffb\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7fff\",\"0x15\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x482480017ffc8000\",\"0xffffffffffffffff0000000000000000\",\"0x400080017ff77fff\",\"0x482480017ff78000\",\"0x2\",\"0x482480017ffc8000\",\"0x3ca\",\"0x48127ff47fff8000\",\"0x48127fe37fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff47fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7265553634202d206e6f6e20753634\",\"0x400080007ffe7fff\",\"0x482480017ff08000\",\"0x3\",\"0x48127ff57fff8000\",\"0x48127fed7fff8000\",\"0x48127fdc7fff8000\",\"0x48127ff17fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480280047ff78000\",\"0x48127ffc7fff8000\",\"0x482480017ffe8000\",\"0x712\",\"0x48127ff97fff8000\",\"0x48127fe87fff8000\",\"0x482680017ff78000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ff78000\",\"0x480280077ff78000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2a71\",\"0x482480017fff8000\",\"0x2a70\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x346c\",\"0x48127ff37fff8000\",\"0x48307ffe7ff38000\",\"0x48127ff37fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x10780017fff7fff\",\"0xf\",\"0x1104800180018000\",\"0x2a62\",\"0x482480017fff8000\",\"0x2a61\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x4326\",\"0x48127ff57fff8000\",\"0x48307ffe7ff58000\",\"0x480a7ff67fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ff57fff8000\",\"0x48127ffa7fff8000\",\"0x480a7ff77fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x4\",\"0x480a7ff37fff8000\",\"0x480a7ff47fff8000\",\"0x480a7ff57fff8000\",\"0x480a7ff77fff8000\",\"0x1104800180018000\",\"0x155b\",\"0x20680017fff7ffd\",\"0x15f\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400080007ffa7fff\",\"0x400080017ffa7ffe\",\"0x480080037ffa8000\",\"0x20680017fff7fff\",\"0x141\",\"0x480080027ff98000\",\"0x480080047ff88000\",\"0x480080007fff8000\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x3fc801c47df4de8d5835f8bfd4d0b8823ba63e5a3f278086901402d680abfc\",\"0x480080007ffc8000\",\"0x480080017ffb8000\",\"0x480080027ffa8000\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080057fef7fff\",\"0x400080067fef7ff9\",\"0x400080077fef7ffa\",\"0x400080087fef7ffb\",\"0x4800800a7fef8000\",\"0x20680017fff7fff\",\"0x110\",\"0x480080097fee8000\",\"0x4800800b7fed8000\",\"0x482480017fec8000\",\"0xc\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x12\",\"0x4824800180007ffc\",\"0x10000000000000000\",\"0x4844800180008002\",\"0x8000000000000110000000000000000\",\"0x4830800080017ffe\",\"0x480080007fe37fff\",\"0x482480017ffe8000\",\"0xefffffffffffffdeffffffffffffffff\",\"0x480080017fe17fff\",\"0x400080027fe07ffb\",\"0x402480017fff7ffb\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7fff\",\"0xe3\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007fe67ffc\",\"0x482480017ffc8000\",\"0xffffffffffffffff0000000000000000\",\"0x400080017fe57fff\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ff97ff48000\",\"0x4824800180007fff\",\"0x10000000000000000\",\"0x400080027fe17fff\",\"0x10780017fff7fff\",\"0xb9\",\"0x48307ff97ff48001\",\"0x4824800180007fff\",\"0xffffffffffffffff0000000000000000\",\"0x400080027fe17ffe\",\"0x480680017fff8000\",\"0x127500\",\"0x48127ffb7fff8000\",\"0xa0680017fff8000\",\"0x8\",\"0x48307ffd7ffc8000\",\"0x4824800180007fff\",\"0x10000000000000000\",\"0x400080037fdc7fff\",\"0x10780017fff7fff\",\"0x8f\",\"0x48307ffd7ffc8001\",\"0x4824800180007fff\",\"0xffffffffffffffff0000000000000000\",\"0x400080037fdc7ffe\",\"0x482480017fdc8000\",\"0x4\",\"0x48127ffb7fff8000\",\"0x48127fdc7fff8000\",\"0x480a7ff67fff8000\",\"0x48127fef7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127fef7fff8000\",\"0x40137ff37fff8003\",\"0x1104800180018000\",\"0x2022\",\"0x20680017fff7ffd\",\"0x67\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480a80037fff8000\",\"0x1104800180018000\",\"0x20a9\",\"0x40137ffa7fff8002\",\"0x40137ffb7fff8001\",\"0x40137ffc7fff8000\",\"0x20680017fff7ffd\",\"0x49\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff67fff8000\",\"0x48127ff67fff8000\",\"0x480680017fff8000\",\"0x15\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ff37fff8000\",\"0x1104800180018000\",\"0x2127\",\"0x20680017fff7ffb\",\"0x28\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x456d69744576656e74\",\"0x4002800080007fff\",\"0x4002800180007ffe\",\"0x4002800280007ffa\",\"0x4002800380007ffb\",\"0x4002800480007ffc\",\"0x4002800580007ffd\",\"0x4802800780008000\",\"0x20680017fff7fff\",\"0x10\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80027fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0x8\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80027fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0xa\",\"0x480680017fff8000\",\"0x1\",\"0x4802800880008000\",\"0x4802800980008000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x2b5c\",\"0x480a80027fff8000\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x4ef2\",\"0x480a80027fff8000\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2977\",\"0x482480017fff8000\",\"0x2976\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xaeba\",\"0x48127ff27fff8000\",\"0x48307ffe7ff28000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2965\",\"0x482480017fff8000\",\"0x2964\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x10e32\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x7536345f616464204f766572666c6f77\",\"0x400080007ffe7fff\",\"0x482480017fd38000\",\"0x4\",\"0x48307ffc7ff28000\",\"0x48127fd37fff8000\",\"0x480a7ff67fff8000\",\"0x48127fe67fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x294a\",\"0x482480017fff8000\",\"0x2949\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x110d0\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x7536345f616464204f766572666c6f77\",\"0x400080007ffe7fff\",\"0x482480017fd88000\",\"0x3\",\"0x48307ffc7ff28000\",\"0x48127fd87fff8000\",\"0x480a7ff67fff8000\",\"0x48127feb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x292f\",\"0x482480017fff8000\",\"0x292e\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x10e78\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7265553634202d206e6f6e20753634\",\"0x400080007ffe7fff\",\"0x482480017fd78000\",\"0x3\",\"0x48307ffc7fee8000\",\"0x48127fec7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x15\",\"0x40780017fff7fff\",\"0xc\",\"0x480080097fe28000\",\"0x1104800180018000\",\"0x2914\",\"0x482480017fff8000\",\"0x2913\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x11512\",\"0x48127fd77fff8000\",\"0x48307ffe7ff78000\",\"0x482480017fd88000\",\"0xd\",\"0x4800800b7fd78000\",\"0x4800800c7fd68000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fd27fff8000\",\"0x480a7ff67fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x480080027ff98000\",\"0x1104800180018000\",\"0x28f9\",\"0x482480017fff8000\",\"0x28f8\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x14532\",\"0x48127fee7fff8000\",\"0x48307ffe7ff78000\",\"0x48127fee7fff8000\",\"0x480a7ff67fff8000\",\"0x482480017fed8000\",\"0x6\",\"0x480680017fff8000\",\"0x1\",\"0x480080047feb8000\",\"0x480080057fea8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x28e4\",\"0x482480017fff8000\",\"0x28e3\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x16efe\",\"0x48127ff27fff8000\",\"0x48307ffe7ff28000\",\"0x48127ff27fff8000\",\"0x480a7ff67fff8000\",\"0x48127ff17fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x3\",\"0x480a7ff37fff8000\",\"0x480a7ff47fff8000\",\"0x480a7ff57fff8000\",\"0x480a7ff77fff8000\",\"0x1104800180018000\",\"0x13e0\",\"0x20680017fff7ffd\",\"0xc7\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480a7ff67fff8000\",\"0x48127ff87fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffdaf\",\"0x20680017fff7ffd\",\"0xa4\",\"0x48127ff97fff8000\",\"0x20680017fff7ffe\",\"0x18\",\"0x1104800180018000\",\"0x28b4\",\"0x482480017fff8000\",\"0x28b3\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x10f68\",\"0x48127ff07fff8000\",\"0x48307ffe7ff78000\",\"0x48127ff07fff8000\",\"0x48127ff07fff8000\",\"0x48127ff07fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x48127ff77fff8000\",\"0x48127ffe7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x1104800180018000\",\"0x1ed3\",\"0x20680017fff7ffd\",\"0x68\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x1104800180018000\",\"0x1f59\",\"0x40137ffa7fff8002\",\"0x40137ffb7fff8001\",\"0x40137ffc7fff8000\",\"0x20680017fff7ffd\",\"0x49\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff67fff8000\",\"0x48127ff67fff8000\",\"0x480680017fff8000\",\"0x13\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ff37fff8000\",\"0x1104800180018000\",\"0x1fd7\",\"0x20680017fff7ffb\",\"0x28\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x456d69744576656e74\",\"0x4002800080007fff\",\"0x4002800180007ffe\",\"0x4002800280007ffa\",\"0x4002800380007ffb\",\"0x4002800480007ffc\",\"0x4002800580007ffd\",\"0x4802800780008000\",\"0x20680017fff7fff\",\"0x10\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80027fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0x8\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80027fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0xa\",\"0x480680017fff8000\",\"0x1\",\"0x4802800880008000\",\"0x4802800980008000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x2b5c\",\"0x480a80027fff8000\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x4ef2\",\"0x480a80027fff8000\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2827\",\"0x482480017fff8000\",\"0x2826\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xaeba\",\"0x48127ff27fff8000\",\"0x48307ffe7ff28000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2815\",\"0x482480017fff8000\",\"0x2814\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x11030\",\"0x48127ff17fff8000\",\"0x48307ffe7ff18000\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2801\",\"0x482480017fff8000\",\"0x2800\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x3\",\"0x482480017fff8000\",\"0x1778c\",\"0x48127ff27fff8000\",\"0x48307ffe7ff28000\",\"0x48127ff27fff8000\",\"0x480a7ff67fff8000\",\"0x48127ff17fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x9\",\"0x480a7ff37fff8000\",\"0x480a7ff47fff8000\",\"0x480a7ff57fff8000\",\"0x480a7ff77fff8000\",\"0x1104800180018000\",\"0x12fd\",\"0x20680017fff7ffd\",\"0x2e0\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0xcfc0e4c73ce8e46b07c3167ce01ce17e6c2deaaa5b88b977bbb10abe25c9ad\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff87fff\",\"0x400080017ff87ffc\",\"0x400080027ff87ffd\",\"0x400080037ff87ffe\",\"0x480080057ff88000\",\"0x20680017fff7fff\",\"0x2bc\",\"0x480080047ff78000\",\"0x480080067ff68000\",\"0x482480017ff58000\",\"0x7\",\"0x48127ffd7fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1\",\"0x48307ffe80007fff\",\"0x20680017fff7fff\",\"0x28d\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400080007ff87fff\",\"0x400080017ff87ffe\",\"0x480080037ff88000\",\"0x20680017fff7fff\",\"0x26f\",\"0x480080027ff78000\",\"0x480080047ff68000\",\"0x480080007fff8000\",\"0x48127fe67fff8000\",\"0x48127ffc7fff8000\",\"0x48127fe67fff8000\",\"0x480a7ff67fff8000\",\"0x482480017ff08000\",\"0x5\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x400180007ff48006\",\"0x400180017ff48007\",\"0x400180027ff48008\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffc9a\",\"0x20680017fff7ffd\",\"0x245\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x40137ff47fff8005\",\"0x1104800180018000\",\"0x203c\",\"0x40137ffa7fff8001\",\"0x40137ffb7fff8002\",\"0x40137ffc7fff8004\",\"0x20680017fff7ffd\",\"0x21e\",\"0x48127ff97fff8000\",\"0x20780017fff8005\",\"0x1c\",\"0x1104800180018000\",\"0x278c\",\"0x482480017fff8000\",\"0x278b\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1f216\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x554e4b4e4f574e5f494d504c454d454e544154494f4e\",\"0x400080007ffe7fff\",\"0x48127fee7fff8000\",\"0x48307ffc7ff58000\",\"0x480a80017fff8000\",\"0x480a80027fff8000\",\"0x480a80047fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127fff7fff8000\",\"0x4829800580018007\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff37fff\",\"0x10780017fff7fff\",\"0x1dd\",\"0x400080007ff47fff\",\"0x48127ffd7fff8000\",\"0x4828800780017ffa\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080017ff07fff\",\"0x10780017fff7fff\",\"0x1b8\",\"0x400080017ff17fff\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x482480017fef8000\",\"0x2\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x11\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ff37fff8000\",\"0x1104800180018000\",\"0x1ebb\",\"0x20680017fff7ffb\",\"0x186\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x456d69744576656e74\",\"0x4002800080047fff\",\"0x4002800180047ffe\",\"0x4002800280047ffa\",\"0x4002800380047ffb\",\"0x4002800480047ffc\",\"0x4002800580047ffd\",\"0x4802800780048000\",\"0x20680017fff7fff\",\"0x168\",\"0x4802800680048000\",\"0x4826800180048000\",\"0x8\",\"0x48127ffe7fff8000\",\"0x20780017fff7ffd\",\"0x8\",\"0x48127ff37fff8000\",\"0x482480017ffe8000\",\"0x7b0c\",\"0x48127ffc7fff8000\",\"0x10780017fff7fff\",\"0x42\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0xcfc0e4c73ce8e46b07c3167ce01ce17e6c2deaaa5b88b977bbb10abe25c9ad\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080007ff97fff\",\"0x400080017ff97ffb\",\"0x400080027ff97ffc\",\"0x400080037ff97ffd\",\"0x400080047ff97ffe\",\"0x480080067ff98000\",\"0x20680017fff7fff\",\"0x135\",\"0x480080057ff88000\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x48127fea7fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0xf\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ff87fff8000\",\"0x48127ff57fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ff37fff8000\",\"0x402580017fe88003\",\"0x7\",\"0x1104800180018000\",\"0x1e74\",\"0x20680017fff7ffb\",\"0xfd\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x456d69744576656e74\",\"0x4002800080037fff\",\"0x4002800180037ffe\",\"0x4002800280037ffa\",\"0x4002800380037ffb\",\"0x4002800480037ffc\",\"0x4002800580037ffd\",\"0x4802800780038000\",\"0x20680017fff7fff\",\"0xdf\",\"0x4802800680038000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x4826800180038000\",\"0x8\",\"0x40137fff7fff8000\",\"0x20780017fff7ff9\",\"0x67\",\"0x40780017fff7fff\",\"0x1\",\"0x48297ffb80007ffc\",\"0x400080007ffe7fff\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x1104800180018000\",\"0x2049\",\"0x20680017fff7ffd\",\"0x44\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x3ea3b9a8522d36784cb325f9c7e2ec3c9f3e6d63031a6c6b8743cc22412f604\",\"0x480680017fff8000\",\"0x4c69627261727943616c6c\",\"0x4002800080007fff\",\"0x4002800180007ffd\",\"0x4003800280007ffa\",\"0x4002800380007ffe\",\"0x4002800480007ffb\",\"0x4002800580007ffc\",\"0x4802800780008000\",\"0x20680017fff7fff\",\"0xc\",\"0x4802800680008000\",\"0x48127fff7fff8000\",\"0x4826800180008000\",\"0xa\",\"0x480680017fff8000\",\"0x0\",\"0x4802800880008000\",\"0x4802800980008000\",\"0x10780017fff7fff\",\"0xb\",\"0x4802800680008000\",\"0x482480017fff8000\",\"0x64\",\"0x4826800180008000\",\"0xa\",\"0x480680017fff8000\",\"0x1\",\"0x4802800880008000\",\"0x4802800980008000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127ff17fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x10780017fff7fff\",\"0x34\",\"0x1104800180018000\",\"0x26b5\",\"0x482480017fff8000\",\"0x26b4\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xe8d0\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4549435f4c49425f43414c4c5f4641494c4544\",\"0x400080007ffe7fff\",\"0x48127fe87fff8000\",\"0x48307ffc7ff18000\",\"0x480a80017fff8000\",\"0x480a80027fff8000\",\"0x48127fef7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x269b\",\"0x482480017fff8000\",\"0x269a\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x11878\",\"0x48127ff47fff8000\",\"0x48307ffe7ff48000\",\"0x480a80017fff8000\",\"0x480a80027fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffd7fff8000\",\"0x482480017ffd8000\",\"0x3886\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x5265706c616365436c617373\",\"0x400080007ffe7fff\",\"0x400080017ffe7ffd\",\"0x400180027ffe7ff8\",\"0x480080047ffe8000\",\"0x20680017fff7fff\",\"0xe\",\"0x480080037ffd8000\",\"0x48127fff7fff8000\",\"0x482480017ffb8000\",\"0x5\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0xb\",\"0x480080037ffd8000\",\"0x482480017fff8000\",\"0x64\",\"0x482480017ffb8000\",\"0x7\",\"0x480680017fff8000\",\"0x1\",\"0x480080057ff98000\",\"0x480080067ff88000\",\"0x20680017fff7ffd\",\"0x35\",\"0x48127ff57fff8000\",\"0x48127ffa7fff8000\",\"0x480a80017fff8000\",\"0x480a80027fff8000\",\"0x48127ff87fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x1104800180018000\",\"0x1c99\",\"0x20680017fff7ffd\",\"0x12\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x1104800180018000\",\"0x1d1f\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2643\",\"0x482480017fff8000\",\"0x2642\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x5b36\",\"0x48127ff27fff8000\",\"0x48307ffe7ff28000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2631\",\"0x482480017fff8000\",\"0x2630\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xbab8\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x5245504c4143455f434c4153535f484153485f4641494c4544\",\"0x400080007ffe7fff\",\"0x48127fec7fff8000\",\"0x48307ffc7ff18000\",\"0x480a80017fff8000\",\"0x480a80027fff8000\",\"0x48127fef7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x4802800680038000\",\"0x1104800180018000\",\"0x2616\",\"0x482480017fff8000\",\"0x2615\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x12214\",\"0x48307fff7ff88000\",\"0x4826800180038000\",\"0xa\",\"0x4802800880038000\",\"0x4802800980038000\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x4\",\"0x1104800180018000\",\"0x2603\",\"0x482480017fff8000\",\"0x2602\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x14d48\",\"0x48307fff7fef8000\",\"0x480a80037fff8000\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x48127fea7fff8000\",\"0x48127ffb7fff8000\",\"0x480a80017fff8000\",\"0x480a80027fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x480080057ff88000\",\"0x1104800180018000\",\"0x25ea\",\"0x482480017fff8000\",\"0x25e9\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x17354\",\"0x48127fe57fff8000\",\"0x48307ffe7ff78000\",\"0x480a80017fff8000\",\"0x480a80027fff8000\",\"0x482480017fec8000\",\"0x9\",\"0x480680017fff8000\",\"0x1\",\"0x480080077fea8000\",\"0x480080087fe98000\",\"0x208b7fff7fff7ffe\",\"0x4802800680048000\",\"0x1104800180018000\",\"0x25d4\",\"0x482480017fff8000\",\"0x25d3\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x19eb0\",\"0x48307fff7ff88000\",\"0x4826800180048000\",\"0xa\",\"0x4802800880048000\",\"0x4802800980048000\",\"0x10780017fff7fff\",\"0x12\",\"0x40780017fff7fff\",\"0x4\",\"0x1104800180018000\",\"0x25c1\",\"0x482480017fff8000\",\"0x25c0\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1c9e4\",\"0x48307fff7fef8000\",\"0x480a80047fff8000\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x48127fea7fff8000\",\"0x48127ffb7fff8000\",\"0x480a80017fff8000\",\"0x480a80027fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x25a9\",\"0x482480017fff8000\",\"0x25a8\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1eda2\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x494d504c454d454e544154494f4e5f45585049524544\",\"0x400080007ffe7fff\",\"0x482480017fe78000\",\"0x2\",\"0x48307ffc7ff28000\",\"0x480a80017fff8000\",\"0x480a80027fff8000\",\"0x480a80047fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x258e\",\"0x482480017fff8000\",\"0x258d\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1ef78\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4e4f545f454e41424c45445f594554\",\"0x400080007ffe7fff\",\"0x482480017fea8000\",\"0x1\",\"0x48307ffc7ff28000\",\"0x480a80017fff8000\",\"0x480a80027fff8000\",\"0x480a80047fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2573\",\"0x482480017fff8000\",\"0x2572\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1f40a\",\"0x48127ff17fff8000\",\"0x48307ffe7ff18000\",\"0x480a80017fff8000\",\"0x480a80027fff8000\",\"0x480a80047fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x255f\",\"0x482480017fff8000\",\"0x255e\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x3\",\"0x482480017fff8000\",\"0x25cce\",\"0x48127ff17fff8000\",\"0x48307ffe7ff18000\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x208b7fff7fff7ffe\",\"0x480080027ff78000\",\"0x1104800180018000\",\"0x254a\",\"0x482480017fff8000\",\"0x2549\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x2c600\",\"0x48127fe17fff8000\",\"0x48307ffe7ff78000\",\"0x48127fe17fff8000\",\"0x480a7ff67fff8000\",\"0x482480017feb8000\",\"0x6\",\"0x480680017fff8000\",\"0x1\",\"0x480080047fe98000\",\"0x480080057fe88000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2535\",\"0x482480017fff8000\",\"0x2534\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x2eea0\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x46494e414c495a4544\",\"0x400080007ffe7fff\",\"0x48127fe37fff8000\",\"0x48307ffc7ff28000\",\"0x48127fe37fff8000\",\"0x480a7ff67fff8000\",\"0x48127fed7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480080047ff78000\",\"0x1104800180018000\",\"0x251a\",\"0x482480017fff8000\",\"0x2519\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x2f3b4\",\"0x48127fec7fff8000\",\"0x48307ffe7ff78000\",\"0x48127fec7fff8000\",\"0x480a7ff67fff8000\",\"0x482480017feb8000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480080067fe98000\",\"0x480080077fe88000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2505\",\"0x482480017fff8000\",\"0x2504\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x31f10\",\"0x48127ff27fff8000\",\"0x48307ffe7ff28000\",\"0x48127ff27fff8000\",\"0x480a7ff67fff8000\",\"0x48127ff17fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff17fff8000\",\"0x48127ff17fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x2\",\"0x480680017fff8000\",\"0x52c476292b358ba7d29adb58502341b4cc5437d07f67d3e285e085828bc820\",\"0x400280007ff37fff\",\"0x400380017ff37ff5\",\"0x480280027ff38000\",\"0x400280037ff37fff\",\"0x400380047ff37ff6\",\"0x480280057ff38000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff17ffc\",\"0x480280017ff17ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff17ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff17ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff17ffd\",\"0x400280027ff17ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff38000\",\"0x6\",\"0x482680017ff18000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ff47fff\",\"0x400380017ff47ff2\",\"0x400280027ff47ffc\",\"0x400280037ff47ffb\",\"0x480280057ff48000\",\"0x20680017fff7fff\",\"0x10a\",\"0x480280047ff48000\",\"0x480280067ff48000\",\"0x482680017ff48000\",\"0x7\",\"0x48127ffd7fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1\",\"0x48307ffe80007fff\",\"0x20680017fff7fff\",\"0xe0\",\"0x48127ffc7fff8000\",\"0x20780017fff7ff6\",\"0x1b\",\"0x1104800180018000\",\"0x24a3\",\"0x482480017fff8000\",\"0x24a2\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x7\",\"0x482480017fff8000\",\"0x1d100\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x494e56414c49445f4143434f554e545f41444452455353\",\"0x400080007ffe7fff\",\"0x48127feb7fff8000\",\"0x48307ffc7ff58000\",\"0x48127fe87fff8000\",\"0x48127fed7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x2e9f66c6eea14532c94ad25405a4fcb32faa4969559c128d837caa0ec50a655\",\"0x400080007ff27fff\",\"0x400180017ff27ff5\",\"0x480080027ff28000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007fee7ffc\",\"0x480080017fed7ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027feb7ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007fee7ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017fec7ffd\",\"0x400080027feb7ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff67fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017fe88000\",\"0x3\",\"0x482480017fe88000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007feb7fff\",\"0x400080017feb7ffb\",\"0x400080027feb7ffc\",\"0x400080037feb7ffa\",\"0x480080057feb8000\",\"0x20680017fff7fff\",\"0x77\",\"0x480080047fea8000\",\"0x48127ffc7fff8000\",\"0x48127ffe7fff8000\",\"0x48127ff97fff8000\",\"0x482480017fe68000\",\"0x7\",\"0x480080067fe58000\",\"0x1104800180018000\",\"0x1dee\",\"0x20680017fff7ffd\",\"0x5a\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480a7ff57fff8000\",\"0x480a7ff67fff8000\",\"0x1104800180018000\",\"0x1e7a\",\"0x40137ffb7fff8001\",\"0x40137ffc7fff8000\",\"0x20680017fff7ffd\",\"0x45\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x480a7ff77fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ff37fff8000\",\"0x1104800180018000\",\"0x1ba0\",\"0x20680017fff7ffb\",\"0x26\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x456d69744576656e74\",\"0x4002800080007fff\",\"0x4002800180007ffe\",\"0x4002800280007ffa\",\"0x4002800380007ffb\",\"0x4002800480007ffc\",\"0x4002800580007ffd\",\"0x4802800780008000\",\"0x20680017fff7fff\",\"0xf\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0x8\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0xa\",\"0x480680017fff8000\",\"0x1\",\"0x4802800880008000\",\"0x4802800980008000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x2b5c\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x4c36\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x10780017fff7fff\",\"0x26\",\"0x1104800180018000\",\"0x23f5\",\"0x482480017fff8000\",\"0x23f4\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x13510\",\"0x48127ff27fff8000\",\"0x48307ffe7ff28000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x48127ff37fff8000\",\"0x48127ff37fff8000\",\"0x10780017fff7fff\",\"0x14\",\"0x480080047fea8000\",\"0x1104800180018000\",\"0x23e2\",\"0x482480017fff8000\",\"0x23e1\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x6\",\"0x482480017fff8000\",\"0x19dca\",\"0x48127ff57fff8000\",\"0x48307ffe7ff78000\",\"0x48127ff27fff8000\",\"0x482480017fdf8000\",\"0x8\",\"0x480080067fde8000\",\"0x480080077fdd8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x23c8\",\"0x482480017fff8000\",\"0x23c7\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x7\",\"0x482480017fff8000\",\"0x1d2f4\",\"0x48127fee7fff8000\",\"0x48307ffe7ff48000\",\"0x48127feb7fff8000\",\"0x48127ff07fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x480280047ff48000\",\"0x1104800180018000\",\"0x23b2\",\"0x482480017fff8000\",\"0x23b1\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x7\",\"0x482480017fff8000\",\"0x1d6dc\",\"0x48127ff57fff8000\",\"0x48307ffe7ff78000\",\"0x48127ff27fff8000\",\"0x482680017ff48000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ff48000\",\"0x480280077ff48000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x2\",\"0x480680017fff8000\",\"0x52c476292b358ba7d29adb58502341b4cc5437d07f67d3e285e085828bc820\",\"0x400280007ff37fff\",\"0x400380017ff37ff5\",\"0x480280027ff38000\",\"0x400280037ff37fff\",\"0x400380047ff37ff6\",\"0x480280057ff38000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff17ffc\",\"0x480280017ff17ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff17ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff17ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff17ffd\",\"0x400280027ff17ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff38000\",\"0x6\",\"0x482680017ff18000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ff47fff\",\"0x400380017ff47ff2\",\"0x400280027ff47ffc\",\"0x400280037ff47ffb\",\"0x480280057ff48000\",\"0x20680017fff7fff\",\"0xee\",\"0x480280047ff48000\",\"0x480280067ff48000\",\"0x482680017ff48000\",\"0x7\",\"0x48127ffd7fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1\",\"0x48307ffe80007fff\",\"0x20680017fff7fff\",\"0x17\",\"0x1104800180018000\",\"0x2353\",\"0x482480017fff8000\",\"0x2352\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x7\",\"0x482480017fff8000\",\"0x1d22c\",\"0x48127fee7fff8000\",\"0x48307ffe7ff48000\",\"0x48127feb7fff8000\",\"0x48127ff07fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x2e9f66c6eea14532c94ad25405a4fcb32faa4969559c128d837caa0ec50a655\",\"0x400080007ff37fff\",\"0x400180017ff37ff5\",\"0x480080027ff38000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007fef7ffc\",\"0x480080017fee7ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027fec7ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007fef7ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017fed7ffd\",\"0x400080027fec7ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff37fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017fe98000\",\"0x3\",\"0x482480017fe98000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007fec7fff\",\"0x400080017fec7ffb\",\"0x400080027fec7ffc\",\"0x400080037fec7ffa\",\"0x480080057fec8000\",\"0x20680017fff7fff\",\"0x77\",\"0x480080047feb8000\",\"0x48127ffc7fff8000\",\"0x48127ffe7fff8000\",\"0x48127ff97fff8000\",\"0x482480017fe78000\",\"0x7\",\"0x480080067fe68000\",\"0x1104800180018000\",\"0x1ca2\",\"0x20680017fff7ffd\",\"0x5a\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480a7ff57fff8000\",\"0x480a7ff67fff8000\",\"0x1104800180018000\",\"0x1e47\",\"0x40137ffb7fff8001\",\"0x40137ffc7fff8000\",\"0x20680017fff7ffd\",\"0x45\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x480a7ff77fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ff37fff8000\",\"0x1104800180018000\",\"0x1a54\",\"0x20680017fff7ffb\",\"0x26\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x456d69744576656e74\",\"0x4002800080007fff\",\"0x4002800180007ffe\",\"0x4002800280007ffa\",\"0x4002800380007ffb\",\"0x4002800480007ffc\",\"0x4002800580007ffd\",\"0x4802800780008000\",\"0x20680017fff7fff\",\"0xf\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0x8\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0xa\",\"0x480680017fff8000\",\"0x1\",\"0x4802800880008000\",\"0x4802800980008000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x2b5c\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x4c36\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x10780017fff7fff\",\"0x26\",\"0x1104800180018000\",\"0x22a9\",\"0x482480017fff8000\",\"0x22a8\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x13510\",\"0x48127ff27fff8000\",\"0x48307ffe7ff28000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x48127ff37fff8000\",\"0x48127ff37fff8000\",\"0x10780017fff7fff\",\"0x14\",\"0x480080047feb8000\",\"0x1104800180018000\",\"0x2296\",\"0x482480017fff8000\",\"0x2295\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x6\",\"0x482480017fff8000\",\"0x19dca\",\"0x48127ff57fff8000\",\"0x48307ffe7ff78000\",\"0x48127ff27fff8000\",\"0x482480017fe08000\",\"0x8\",\"0x480080067fdf8000\",\"0x480080077fde8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480280047ff48000\",\"0x1104800180018000\",\"0x227b\",\"0x482480017fff8000\",\"0x227a\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x7\",\"0x482480017fff8000\",\"0x1d614\",\"0x48127ff57fff8000\",\"0x48307ffe7ff78000\",\"0x48127ff27fff8000\",\"0x482680017ff48000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ff48000\",\"0x480280077ff48000\",\"0x208b7fff7fff7ffe\",\"0x4825800180007ffd\",\"0x3711c9d994faf6055172091cb841fd4831aa743e6f3315163b06a122c841846\",\"0x20680017fff7fff\",\"0x1b\",\"0x1104800180018000\",\"0x2263\",\"0x482480017fff8000\",\"0x2262\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x13c22\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x474f565f41444d494e5f43414e4e4f545f53454c465f52454d4f5645\",\"0x400080007ffe7fff\",\"0x480a7ff97fff8000\",\"0x48327ffc7ffa8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480a7ffa7fff8000\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffc7fff\",\"0x400280017ffc7ffe\",\"0x480280037ffc8000\",\"0x20680017fff7fff\",\"0x51\",\"0x480280027ffc8000\",\"0x480280047ffc8000\",\"0x48127ffe7fff8000\",\"0x480080007ffe8000\",\"0x480080017ffd8000\",\"0x480080027ffc8000\",\"0x480080037ffb8000\",\"0x480080047ffa8000\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280057ffc7fff\",\"0x400280067ffc7ff9\",\"0x480280087ffc8000\",\"0x20680017fff7fff\",\"0x2d\",\"0x480280077ffc8000\",\"0x480280097ffc8000\",\"0x480080027fff8000\",\"0x48307ff880007fff\",\"0x482680017ffc8000\",\"0xa\",\"0x48127ffb7fff8000\",\"0x20680017fff7ffd\",\"0xb\",\"0x480a7ff97fff8000\",\"0x48127ffe7fff8000\",\"0x480a7ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ff07fff8000\",\"0x1104800180018000\",\"0x1d70\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2221\",\"0x482480017fff8000\",\"0x2220\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0xe3da\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f4e4c595f53454c465f43414e5f52454e4f554e4345\",\"0x400080007ffe7fff\",\"0x480a7ff97fff8000\",\"0x48307ffc7ff58000\",\"0x480a7ffb7fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480280077ffc8000\",\"0x1104800180018000\",\"0x2207\",\"0x482480017fff8000\",\"0x2206\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0xe75e\",\"0x480a7ff97fff8000\",\"0x48307ffe7ff78000\",\"0x480a7ffb7fff8000\",\"0x482680017ffc8000\",\"0xb\",\"0x480680017fff8000\",\"0x1\",\"0x480280097ffc8000\",\"0x4802800a7ffc8000\",\"0x208b7fff7fff7ffe\",\"0x480280027ffc8000\",\"0x1104800180018000\",\"0x21f2\",\"0x482480017fff8000\",\"0x21f1\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x11382\",\"0x480a7ff97fff8000\",\"0x48307ffe7ff78000\",\"0x480a7ffb7fff8000\",\"0x482680017ffc8000\",\"0x6\",\"0x480680017fff8000\",\"0x1\",\"0x480280047ffc8000\",\"0x480280057ffc8000\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8005\",\"0xe\",\"0x4825800180057ffd\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ffa7ffc\",\"0x480280017ffa7ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ffa7ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x480a7ffd7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ffa7ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ffa7ffd\",\"0x400280027ffa7ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ffa8000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffc7fff\",\"0x400380017ffc7ffb\",\"0x400280027ffc7ffd\",\"0x400280037ffc7ffc\",\"0x480280057ffc8000\",\"0x20680017fff7fff\",\"0x87\",\"0x480280047ffc8000\",\"0x480280067ffc8000\",\"0x482680017ffc8000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x57\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff48000\",\"0x1\",\"0x482480017ff58000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff87fff\",\"0x400080017ff87ffb\",\"0x400080027ff87ffc\",\"0x400080037ff87ffd\",\"0x480080057ff88000\",\"0x20680017fff7fff\",\"0x38\",\"0x480080047ff78000\",\"0x480080067ff68000\",\"0x482480017ff58000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x11\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x40780017fff7fff\",\"0xc\",\"0x482480017fec8000\",\"0x1\",\"0x482480017ff18000\",\"0x6b8\",\"0x48127fef7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fe17fff8000\",\"0x48127feb7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017ff18000\",\"0x3\",\"0x48127ff67fff8000\",\"0x48127ff47fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x1d\",\"0x40780017fff7fff\",\"0xb\",\"0x480080047fec8000\",\"0x48127ff17fff8000\",\"0x482480017ffe8000\",\"0x6a4\",\"0x482480017fe98000\",\"0x8\",\"0x480080067fe88000\",\"0x480080077fe78000\",\"0x10780017fff7fff\",\"0x23\",\"0x40780017fff7fff\",\"0xb\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fe68000\",\"0x3\",\"0x482480017feb8000\",\"0x2d8c\",\"0x48127fe97fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x16\",\"0x480280047ffc8000\",\"0x48127fe67fff8000\",\"0x482480017ffe8000\",\"0x3494\",\"0x482680017ffc8000\",\"0x8\",\"0x480280067ffc8000\",\"0x480280077ffc8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x208b7fff7fff7ffe\",\"0x400380007ffa7ffc\",\"0x400380017ffa7ffd\",\"0x480280027ffa8000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff87ffc\",\"0x480280017ff87ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff87ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff87ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff87ffd\",\"0x400280027ff87ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ffa8000\",\"0x3\",\"0x482680017ff88000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffb7fff\",\"0x400380017ffb7ff9\",\"0x400280027ffb7ffc\",\"0x400280037ffb7ffb\",\"0x480280057ffb8000\",\"0x20680017fff7fff\",\"0x89\",\"0x480280047ffb8000\",\"0x480280067ffb8000\",\"0x482680017ffb8000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x58\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff38000\",\"0x1\",\"0x482480017ff58000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff87fff\",\"0x400080017ff87ffb\",\"0x400080027ff87ffc\",\"0x400080037ff87ffd\",\"0x480080057ff88000\",\"0x20680017fff7fff\",\"0x39\",\"0x480080047ff78000\",\"0x480080067ff68000\",\"0x482480017ff58000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x12\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x40780017fff7fff\",\"0xc\",\"0x482480017fec8000\",\"0x1\",\"0x482480017ff18000\",\"0x6b8\",\"0x48127fde7fff8000\",\"0x48127fee7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fe07fff8000\",\"0x48127fea7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017ff18000\",\"0x3\",\"0x48127ff67fff8000\",\"0x48127ff47fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x1d\",\"0x40780017fff7fff\",\"0xb\",\"0x480080047fec8000\",\"0x48127ff17fff8000\",\"0x482480017ffe8000\",\"0x6a4\",\"0x482480017fe98000\",\"0x8\",\"0x480080067fe88000\",\"0x480080077fe78000\",\"0x10780017fff7fff\",\"0x24\",\"0x40780017fff7fff\",\"0xb\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fe68000\",\"0x3\",\"0x482480017feb8000\",\"0x2d8c\",\"0x48127fe97fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fde7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x16\",\"0x480280047ffb8000\",\"0x48127fe67fff8000\",\"0x482480017ffe8000\",\"0x3494\",\"0x482680017ffb8000\",\"0x8\",\"0x480280067ffb8000\",\"0x480280077ffb8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fde7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x400380007ff97ffb\",\"0x400380017ff97ffc\",\"0x480280027ff98000\",\"0x400280037ff97fff\",\"0x400380047ff97ffd\",\"0x480280057ff98000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff77ffc\",\"0x480280017ff77ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff77ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff77ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff77ffd\",\"0x400280027ff77ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff98000\",\"0x6\",\"0x482680017ff78000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffa7fff\",\"0x400380017ffa7ff8\",\"0x400280027ffa7ffc\",\"0x400280037ffa7ffb\",\"0x480280057ffa8000\",\"0x20680017fff7fff\",\"0x89\",\"0x480280047ffa8000\",\"0x480280067ffa8000\",\"0x482680017ffa8000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x58\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff38000\",\"0x1\",\"0x482480017ff58000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff87fff\",\"0x400080017ff87ffb\",\"0x400080027ff87ffc\",\"0x400080037ff87ffd\",\"0x480080057ff88000\",\"0x20680017fff7fff\",\"0x39\",\"0x480080047ff78000\",\"0x480080067ff68000\",\"0x482480017ff58000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x12\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x40780017fff7fff\",\"0xc\",\"0x482480017fec8000\",\"0x1\",\"0x482480017ff18000\",\"0x6b8\",\"0x48127fde7fff8000\",\"0x48127fee7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fe07fff8000\",\"0x48127fea7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017ff18000\",\"0x3\",\"0x48127ff67fff8000\",\"0x48127ff47fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x1d\",\"0x40780017fff7fff\",\"0xb\",\"0x480080047fec8000\",\"0x48127ff17fff8000\",\"0x482480017ffe8000\",\"0x6a4\",\"0x482480017fe98000\",\"0x8\",\"0x480080067fe88000\",\"0x480080077fe78000\",\"0x10780017fff7fff\",\"0x24\",\"0x40780017fff7fff\",\"0xb\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fe68000\",\"0x3\",\"0x482480017feb8000\",\"0x2d8c\",\"0x48127fe97fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fde7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x16\",\"0x480280047ffa8000\",\"0x48127fe67fff8000\",\"0x482480017ffe8000\",\"0x3494\",\"0x482680017ffa8000\",\"0x8\",\"0x480280067ffa8000\",\"0x480280077ffa8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fde7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x2\",\"0x20780017fff7ffa\",\"0x1b\",\"0x1104800180018000\",\"0x1f84\",\"0x482480017fff8000\",\"0x1f83\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x1e23a\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x45524332303a207472616e736665722066726f6d2030\",\"0x400080007ffe7fff\",\"0x480a7ff67fff8000\",\"0x48327ffc7ff78000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480a7ff77fff8000\",\"0x20780017fff7ffb\",\"0x1b\",\"0x1104800180018000\",\"0x1f68\",\"0x482480017fff8000\",\"0x1f67\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x1e172\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x45524332303a207472616e7366657220746f2030\",\"0x400080007ffe7fff\",\"0x480a7ff67fff8000\",\"0x48307ffc7ff58000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x3a4e8ec16e258a799fe707996fd5d21d42b29adc1499a370edf7f809d8c458a\",\"0x400280007ff87fff\",\"0x400380017ff87ffa\",\"0x480280027ff88000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff67ffc\",\"0x480280017ff67ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff67ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff67ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff67ffd\",\"0x400280027ff67ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff67fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff88000\",\"0x3\",\"0x482680017ff68000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ff97fff\",\"0x400280017ff97ffb\",\"0x400280027ff97ffc\",\"0x400280037ff97ffa\",\"0x480280057ff98000\",\"0x20680017fff7fff\",\"0x354\",\"0x480280047ff98000\",\"0x480280067ff98000\",\"0x482680017ff98000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x321\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff28000\",\"0x1\",\"0x482480017ff58000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff87fff\",\"0x400080017ff87ffb\",\"0x400080027ff87ffc\",\"0x400080037ff87ffd\",\"0x480080057ff88000\",\"0x20680017fff7fff\",\"0x2f9\",\"0x480080047ff78000\",\"0x480080067ff68000\",\"0x482480017ff58000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x2c8\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x48287ffd80017ffb\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080017ff57fff\",\"0x40780017fff7fff\",\"0x1\",\"0x482480017ff48000\",\"0x2\",\"0x48127ffb7fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x9\",\"0x482480017ff48000\",\"0x2\",\"0x482480017ffb8000\",\"0xa\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48287ffc80017fe9\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff97fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ffa7fff\",\"0x40780017fff7fff\",\"0x5\",\"0x482480017ff58000\",\"0x1\",\"0x482480017ff58000\",\"0x208\",\"0x48127ff87fff8000\",\"0x48127ff47fff8000\",\"0x10780017fff7fff\",\"0x13\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48307ffe80017ff9\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0x26e\",\"0x400080017ff57fff\",\"0x482480017ff58000\",\"0x2\",\"0x48127ffc7fff8000\",\"0x48127ff97fff8000\",\"0x48127ffc7fff8000\",\"0x20680017fff7ff4\",\"0x258\",\"0x480680017fff8000\",\"0x3a4e8ec16e258a799fe707996fd5d21d42b29adc1499a370edf7f809d8c458a\",\"0x400080007fd87fff\",\"0x400180017fd87ffa\",\"0x480080027fd88000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff67ffc\",\"0x480080017ff57ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027ff37ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff67ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017ff47ffd\",\"0x400080027ff37ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff47fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017fce8000\",\"0x3\",\"0x482480017ff08000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080007fdc7fff\",\"0x400080017fdc7ffb\",\"0x400080027fdc7ffc\",\"0x400080037fdc7ffa\",\"0x400080047fdc7ff0\",\"0x480080067fdc8000\",\"0x20680017fff7fff\",\"0x20a\",\"0x480080057fdb8000\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff68000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080077fd67fff\",\"0x400080087fd67ffc\",\"0x400080097fd67ffd\",\"0x4000800a7fd67ffe\",\"0x4000800b7fd67feb\",\"0x4800800d7fd68000\",\"0x20680017fff7fff\",\"0x1e8\",\"0x4800800c7fd58000\",\"0x480680017fff8000\",\"0x3a4e8ec16e258a799fe707996fd5d21d42b29adc1499a370edf7f809d8c458a\",\"0x400080007ff47fff\",\"0x400180017ff47ffb\",\"0x480080027ff48000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff07ffc\",\"0x480080017fef7ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027fed7ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff07ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017fee7ffd\",\"0x400080027fed7ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff67fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017fea8000\",\"0x3\",\"0x482480017fea8000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x4000800e7fc67fff\",\"0x4000800f7fc67ffb\",\"0x400080107fc67ffc\",\"0x400080117fc67ffa\",\"0x480080137fc68000\",\"0x20680017fff7fff\",\"0x19b\",\"0x480080127fc58000\",\"0x480080147fc48000\",\"0x482480017fc38000\",\"0x15\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x16a\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff28000\",\"0x1\",\"0x482480017ff58000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff87fff\",\"0x400080017ff87ffb\",\"0x400080027ff87ffc\",\"0x400080037ff87ffd\",\"0x480080057ff88000\",\"0x20680017fff7fff\",\"0x144\",\"0x480080047ff78000\",\"0x480080067ff68000\",\"0x482480017ff58000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x115\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x48287ffd7ffb8001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080017ff57fff\",\"0x40780017fff7fff\",\"0x1\",\"0x482480017ff48000\",\"0x2\",\"0x48127ffb7fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x9\",\"0x482480017ff48000\",\"0x2\",\"0x482480017ffb8000\",\"0xa\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48287ffc7fe98001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080007ff97fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ffa7fff\",\"0x40780017fff7fff\",\"0x5\",\"0x482480017ff58000\",\"0x1\",\"0x482480017ff58000\",\"0x208\",\"0x48127ff87fff8000\",\"0x48127ff47fff8000\",\"0x10780017fff7fff\",\"0x13\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48307ffe7ff98001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0xbd\",\"0x400080017ff57fff\",\"0x482480017ff58000\",\"0x2\",\"0x48127ffc7fff8000\",\"0x48127ff97fff8000\",\"0x48127ffc7fff8000\",\"0x20680017fff7ff4\",\"0xa9\",\"0x480680017fff8000\",\"0x3a4e8ec16e258a799fe707996fd5d21d42b29adc1499a370edf7f809d8c458a\",\"0x400080007fd87fff\",\"0x400180017fd87ffb\",\"0x480080027fd88000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff67ffc\",\"0x480080017ff57ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027ff37ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff67ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017ff47ffd\",\"0x400080027ff37ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff47fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x402580017fce8001\",\"0x3\",\"0x482480017ff18000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080007fdd7fff\",\"0x400080017fdd7ffc\",\"0x400080027fdd7ffd\",\"0x400080037fdd7ffb\",\"0x400080047fdd7ff1\",\"0x480080067fdd8000\",\"0x20680017fff7fff\",\"0x64\",\"0x480080057fdc8000\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff78000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080077fd77fff\",\"0x400080087fd77ffc\",\"0x400080097fd77ffd\",\"0x4000800a7fd77ffe\",\"0x4000800b7fd77fec\",\"0x4800800d7fd78000\",\"0x20680017fff7fff\",\"0x4b\",\"0x4800800c7fd68000\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff47fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x19\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ff37fff8000\",\"0x402580017fc68000\",\"0xe\",\"0x1104800180018000\",\"0x14ab\",\"0x20680017fff7ffb\",\"0x26\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x456d69744576656e74\",\"0x4002800080007fff\",\"0x4002800180007ffe\",\"0x4002800280007ffa\",\"0x4002800380007ffb\",\"0x4002800480007ffc\",\"0x4002800580007ffd\",\"0x4802800780008000\",\"0x20680017fff7fff\",\"0xf\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0x8\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0xa\",\"0x480680017fff8000\",\"0x1\",\"0x4802800880008000\",\"0x4802800980008000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x2b5c\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x4800800c7fd68000\",\"0x482480017fff8000\",\"0x4d58\",\"0x482480017fd48000\",\"0x10\",\"0x4800800e7fd38000\",\"0x4800800f7fd28000\",\"0x10780017fff7fff\",\"0xb\",\"0x40780017fff7fff\",\"0x6\",\"0x480080057fd68000\",\"0x482480017fff8000\",\"0x78dc\",\"0x482480017fd48000\",\"0x9\",\"0x480080077fd38000\",\"0x480080087fd28000\",\"0x48127ff27fff8000\",\"0x48127ffb7fff8000\",\"0x480a80017fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x1cee\",\"0x482480017fff8000\",\"0x1ced\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xa8c0\",\"0x48127ff67fff8000\",\"0x48307ffe7ff68000\",\"0x10780017fff7fff\",\"0xf\",\"0x40780017fff7fff\",\"0x3\",\"0x1104800180018000\",\"0x1ce0\",\"0x482480017fff8000\",\"0x1cdf\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xa9ce\",\"0x482480017feb8000\",\"0x2\",\"0x48307ffe7ff28000\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x753235365f616464204f766572666c6f77\",\"0x400080007ffe7fff\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x48127fcd7fff8000\",\"0x48127fdd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x1cc6\",\"0x482480017fff8000\",\"0x1cc5\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xadc0\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017feb8000\",\"0x3\",\"0x48307ffc7ff08000\",\"0x48127fee7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x2b\",\"0x40780017fff7fff\",\"0xb\",\"0x480080047fec8000\",\"0x1104800180018000\",\"0x1cad\",\"0x482480017fff8000\",\"0x1cac\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xb4c8\",\"0x48127feb7fff8000\",\"0x48307ffe7ff88000\",\"0x482480017fe38000\",\"0x8\",\"0x480080067fe28000\",\"0x480080077fe18000\",\"0x10780017fff7fff\",\"0x2b\",\"0x40780017fff7fff\",\"0xb\",\"0x1104800180018000\",\"0x1c9b\",\"0x482480017fff8000\",\"0x1c9a\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xdb4c\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fe08000\",\"0x3\",\"0x48307ffc7fe58000\",\"0x48127fe37fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x13\",\"0x40780017fff7fff\",\"0x16\",\"0x480080127faf8000\",\"0x1104800180018000\",\"0x1c82\",\"0x482480017fff8000\",\"0x1c81\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xe2b8\",\"0x48127fe07fff8000\",\"0x48307ffe7ff88000\",\"0x482480017fa68000\",\"0x16\",\"0x480080147fa58000\",\"0x480080157fa48000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fd87fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x4800800c7fd58000\",\"0x1104800180018000\",\"0x1c6a\",\"0x482480017fff8000\",\"0x1c69\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1159e\",\"0x48307fff7ff88000\",\"0x482480017fcc8000\",\"0x10\",\"0x4800800e7fcb8000\",\"0x4800800f7fca8000\",\"0x10780017fff7fff\",\"0x14\",\"0x40780017fff7fff\",\"0x6\",\"0x480080057fd58000\",\"0x1104800180018000\",\"0x1c56\",\"0x482480017fff8000\",\"0x1c55\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x14122\",\"0x48307fff7ff88000\",\"0x482480017fcc8000\",\"0x9\",\"0x480080077fcb8000\",\"0x480080087fca8000\",\"0x48127feb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fe87fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x1c3e\",\"0x482480017fff8000\",\"0x1c3d\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x3\",\"0x482480017fff8000\",\"0x17368\",\"0x48127ff57fff8000\",\"0x48307ffe7ff58000\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x3\",\"0x1104800180018000\",\"0x1c2e\",\"0x482480017fff8000\",\"0x1c2d\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x3\",\"0x482480017fff8000\",\"0x17476\",\"0x482480017fea8000\",\"0x2\",\"0x48307ffe7ff18000\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x753235365f737562204f766572666c6f77\",\"0x400080007ffe7fff\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x48127fcc7fff8000\",\"0x48127fdc7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x1c12\",\"0x482480017fff8000\",\"0x1c11\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x3\",\"0x482480017fff8000\",\"0x17868\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fea8000\",\"0x3\",\"0x48307ffc7fef8000\",\"0x48127fed7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x2f\",\"0x40780017fff7fff\",\"0xb\",\"0x480080047fec8000\",\"0x1104800180018000\",\"0x1bf7\",\"0x482480017fff8000\",\"0x1bf6\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x3\",\"0x482480017fff8000\",\"0x17f70\",\"0x48127fea7fff8000\",\"0x48307ffe7ff78000\",\"0x482480017fe28000\",\"0x8\",\"0x480080067fe18000\",\"0x480080077fe08000\",\"0x10780017fff7fff\",\"0x2f\",\"0x40780017fff7fff\",\"0xb\",\"0x1104800180018000\",\"0x1be3\",\"0x482480017fff8000\",\"0x1be2\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x3\",\"0x482480017fff8000\",\"0x1a5f4\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fdf8000\",\"0x3\",\"0x48307ffc7fe48000\",\"0x48127fe27fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x15\",\"0x40780017fff7fff\",\"0x16\",\"0x480280047ff98000\",\"0x1104800180018000\",\"0x1bc8\",\"0x482480017fff8000\",\"0x1bc7\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x3\",\"0x482480017fff8000\",\"0x1ad60\",\"0x48127fdf7fff8000\",\"0x48307ffe7ff78000\",\"0x482680017ff98000\",\"0x8\",\"0x480280067ff98000\",\"0x480280077ff98000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fd77fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x3c87bf42ed4f01f11883bf54f43d91d2cbbd5fec26d1df9c74c57ae138800a4\",\"0x400280007ff87fff\",\"0x400380017ff87ffa\",\"0x480280027ff88000\",\"0x400280037ff87fff\",\"0x400380047ff87ffb\",\"0x480280057ff88000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff67ffc\",\"0x480280017ff67ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff67ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff67ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff67ffd\",\"0x400280027ff67ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff88000\",\"0x6\",\"0x482680017ff68000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ff97fff\",\"0x400380017ff97ff7\",\"0x400280027ff97ffc\",\"0x400280037ff97ffb\",\"0x480280057ff98000\",\"0x20680017fff7fff\",\"0x138\",\"0x480280047ff98000\",\"0x480280067ff98000\",\"0x482680017ff98000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x105\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff38000\",\"0x1\",\"0x482480017ff58000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff87fff\",\"0x400080017ff87ffb\",\"0x400080027ff87ffc\",\"0x400080037ff87ffd\",\"0x480080057ff88000\",\"0x20680017fff7fff\",\"0xdd\",\"0x480080047ff78000\",\"0x480080067ff68000\",\"0x482480017ff58000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0xac\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ff17fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ff68000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x48127fed7fff8000\",\"0x48127ff77fff8000\",\"0x4824800180007ffa\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x8\",\"0x40780017fff7fff\",\"0x2\",\"0x482480017ffa8000\",\"0xb4\",\"0x10780017fff7fff\",\"0xa\",\"0x48127ffc7fff8000\",\"0x4824800180007ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x7a\",\"0x48127ffe7fff8000\",\"0x48287ffd80017ffb\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff57fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ff67fff\",\"0x40780017fff7fff\",\"0x1\",\"0x482480017ff58000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x9\",\"0x482480017ff58000\",\"0x1\",\"0x482480017ffb8000\",\"0xa\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48287ffc80017ff3\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff97fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ffa7fff\",\"0x40780017fff7fff\",\"0x5\",\"0x482480017ff58000\",\"0x1\",\"0x482480017ff58000\",\"0x208\",\"0x48127ff87fff8000\",\"0x48127ff47fff8000\",\"0x10780017fff7fff\",\"0x13\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48307ffe80017ff9\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0x23\",\"0x400080017ff57fff\",\"0x482480017ff58000\",\"0x2\",\"0x48127ffc7fff8000\",\"0x48127ff97fff8000\",\"0x48127ffc7fff8000\",\"0x20680017fff7ff4\",\"0xd\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x48127fce7fff8000\",\"0x48127fde7fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x1104800180018000\",\"0xa7\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x1acd\",\"0x482480017fff8000\",\"0x1acc\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xaf14\",\"0x48127ff57fff8000\",\"0x48307ffe7ff58000\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x3\",\"0x1104800180018000\",\"0x1abd\",\"0x482480017fff8000\",\"0x1abc\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xb022\",\"0x482480017fea8000\",\"0x2\",\"0x48307ffe7ff18000\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x753235365f737562204f766572666c6f77\",\"0x400080007ffe7fff\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x48127fc37fff8000\",\"0x48127fd37fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x1aa1\",\"0x482480017fff8000\",\"0x1aa0\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xbba8\",\"0x48127ff27fff8000\",\"0x48307ffe7ff68000\",\"0x48127fda7fff8000\",\"0x48127fea7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x1a8c\",\"0x482480017fff8000\",\"0x1a8b\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xb8c4\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fea8000\",\"0x3\",\"0x48307ffc7fef8000\",\"0x48127fed7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x2f\",\"0x40780017fff7fff\",\"0xb\",\"0x480080047fec8000\",\"0x1104800180018000\",\"0x1a71\",\"0x482480017fff8000\",\"0x1a70\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xbfcc\",\"0x48127fea7fff8000\",\"0x48307ffe7ff78000\",\"0x482480017fe28000\",\"0x8\",\"0x480080067fe18000\",\"0x480080077fe08000\",\"0x10780017fff7fff\",\"0x2f\",\"0x40780017fff7fff\",\"0xb\",\"0x1104800180018000\",\"0x1a5d\",\"0x482480017fff8000\",\"0x1a5c\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xe650\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fdf8000\",\"0x3\",\"0x48307ffc7fe48000\",\"0x48127fe27fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x15\",\"0x40780017fff7fff\",\"0x16\",\"0x480280047ff98000\",\"0x1104800180018000\",\"0x1a42\",\"0x482480017fff8000\",\"0x1a41\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xedbc\",\"0x48127fdf7fff8000\",\"0x48307ffe7ff78000\",\"0x482680017ff98000\",\"0x8\",\"0x480280067ff98000\",\"0x480280077ff98000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fd77fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x2\",\"0x20780017fff7ffa\",\"0x1b\",\"0x1104800180018000\",\"0x1a25\",\"0x482480017fff8000\",\"0x1a24\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xab7c\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x45524332303a20617070726f76652066726f6d2030\",\"0x400080007ffe7fff\",\"0x480a7ff67fff8000\",\"0x48327ffc7ff78000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480a7ff77fff8000\",\"0x20780017fff7ffb\",\"0x1b\",\"0x1104800180018000\",\"0x1a09\",\"0x482480017fff8000\",\"0x1a08\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xaab4\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x45524332303a20617070726f766520746f2030\",\"0x400080007ffe7fff\",\"0x480a7ff67fff8000\",\"0x48307ffc7ff58000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x3c87bf42ed4f01f11883bf54f43d91d2cbbd5fec26d1df9c74c57ae138800a4\",\"0x400280007ff87fff\",\"0x400380017ff87ffa\",\"0x480280027ff88000\",\"0x400280037ff87fff\",\"0x400380047ff87ffb\",\"0x480280057ff88000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff67ffc\",\"0x480280017ff67ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff67ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff67ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff67ffd\",\"0x400280027ff67ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x402780017ff88001\",\"0x6\",\"0x482680017ff68000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400280007ff97fff\",\"0x400280017ff97ffc\",\"0x400280027ff97ffd\",\"0x400280037ff97ffb\",\"0x400380047ff97ffc\",\"0x480280067ff98000\",\"0x20680017fff7fff\",\"0x64\",\"0x480280057ff98000\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff78000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400280077ff97fff\",\"0x400280087ff97ffc\",\"0x400280097ff97ffd\",\"0x4002800a7ff97ffe\",\"0x4003800b7ff97ffd\",\"0x4802800d7ff98000\",\"0x20680017fff7fff\",\"0x4b\",\"0x4802800c7ff98000\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff47fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x17\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ff37fff8000\",\"0x402780017ff98000\",\"0xe\",\"0x1104800180018000\",\"0x1103\",\"0x20680017fff7ffb\",\"0x26\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x456d69744576656e74\",\"0x4002800080007fff\",\"0x4002800180007ffe\",\"0x4002800280007ffa\",\"0x4002800380007ffb\",\"0x4002800480007ffc\",\"0x4002800580007ffd\",\"0x4802800780008000\",\"0x20680017fff7fff\",\"0xf\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0x8\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0xa\",\"0x480680017fff8000\",\"0x1\",\"0x4802800880008000\",\"0x4802800980008000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x2b5c\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x4802800c7ff98000\",\"0x482480017fff8000\",\"0x4d58\",\"0x482680017ff98000\",\"0x10\",\"0x4802800e7ff98000\",\"0x4802800f7ff98000\",\"0x10780017fff7fff\",\"0xb\",\"0x40780017fff7fff\",\"0x6\",\"0x480280057ff98000\",\"0x482480017fff8000\",\"0x78dc\",\"0x482680017ff98000\",\"0x9\",\"0x480280077ff98000\",\"0x480280087ff98000\",\"0x48127ff27fff8000\",\"0x48127ffb7fff8000\",\"0x480a80017fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffa7fff\",\"0x400380017ffa7ff8\",\"0x480280037ffa8000\",\"0x20680017fff7fff\",\"0x172\",\"0x480280027ffa8000\",\"0x480280047ffa8000\",\"0x480080027fff8000\",\"0x480680017fff8000\",\"0x3c87bf42ed4f01f11883bf54f43d91d2cbbd5fec26d1df9c74c57ae138800a4\",\"0x400280007ff97fff\",\"0x400280017ff97ffe\",\"0x480280027ff98000\",\"0x400280037ff97fff\",\"0x400380047ff97ffb\",\"0x480280057ff98000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff77ffc\",\"0x480280017ff77ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff77ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff77ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff77ffd\",\"0x400280027ff77ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff37fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff98000\",\"0x6\",\"0x482680017ff78000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280057ffa7fff\",\"0x400280067ffa7ffb\",\"0x400280077ffa7ffc\",\"0x400280087ffa7ffa\",\"0x4802800a7ffa8000\",\"0x20680017fff7fff\",\"0x11e\",\"0x480280097ffa8000\",\"0x4802800b7ffa8000\",\"0x482680017ffa8000\",\"0xc\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0xeb\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff28000\",\"0x1\",\"0x482480017ff58000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff87fff\",\"0x400080017ff87ffb\",\"0x400080027ff87ffc\",\"0x400080037ff87ffd\",\"0x480080057ff88000\",\"0x20680017fff7fff\",\"0xc3\",\"0x480080047ff78000\",\"0x480080067ff68000\",\"0x482480017ff58000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x92\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x48287ffd7ffb8001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080017ff57fff\",\"0x40780017fff7fff\",\"0x1\",\"0x482480017ff48000\",\"0x2\",\"0x48127ffb7fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x9\",\"0x482480017ff48000\",\"0x2\",\"0x482480017ffb8000\",\"0xa\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48287ffc7fe98001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080007ff97fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ffa7fff\",\"0x40780017fff7fff\",\"0x5\",\"0x482480017ff58000\",\"0x1\",\"0x482480017ff58000\",\"0x208\",\"0x48127ff87fff8000\",\"0x48127ff47fff8000\",\"0x10780017fff7fff\",\"0x13\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48307ffe7ff98001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0x38\",\"0x400080017ff57fff\",\"0x482480017ff58000\",\"0x2\",\"0x48127ffc7fff8000\",\"0x48127ff97fff8000\",\"0x48127ffc7fff8000\",\"0x20680017fff7ff4\",\"0x22\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x48127fd77fff8000\",\"0x48127fe77fff8000\",\"0x48127fc87fff8000\",\"0x480a7ffb7fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffe4e\",\"0x20680017fff7ffd\",\"0xd\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x185e\",\"0x482480017fff8000\",\"0x185d\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xb234\",\"0x48127ff57fff8000\",\"0x48307ffe7ff58000\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x3\",\"0x1104800180018000\",\"0x184e\",\"0x482480017fff8000\",\"0x184d\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xb342\",\"0x482480017fea8000\",\"0x2\",\"0x48307ffe7ff18000\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x753235365f616464204f766572666c6f77\",\"0x400080007ffe7fff\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x48127fcc7fff8000\",\"0x48127fdc7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x1832\",\"0x482480017fff8000\",\"0x1831\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xb734\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fea8000\",\"0x3\",\"0x48307ffc7fef8000\",\"0x48127fed7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x2f\",\"0x40780017fff7fff\",\"0xb\",\"0x480080047fec8000\",\"0x1104800180018000\",\"0x1817\",\"0x482480017fff8000\",\"0x1816\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xbe3c\",\"0x48127fea7fff8000\",\"0x48307ffe7ff78000\",\"0x482480017fe28000\",\"0x8\",\"0x480080067fe18000\",\"0x480080077fe08000\",\"0x10780017fff7fff\",\"0x2f\",\"0x40780017fff7fff\",\"0xb\",\"0x1104800180018000\",\"0x1803\",\"0x482480017fff8000\",\"0x1802\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xe4c0\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fdf8000\",\"0x3\",\"0x48307ffc7fe48000\",\"0x48127fe27fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x15\",\"0x40780017fff7fff\",\"0x16\",\"0x480280097ffa8000\",\"0x1104800180018000\",\"0x17e8\",\"0x482480017fff8000\",\"0x17e7\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xec2c\",\"0x48127fdf7fff8000\",\"0x48307ffe7ff78000\",\"0x482680017ffa8000\",\"0xd\",\"0x4802800b7ffa8000\",\"0x4802800c7ffa8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fd77fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480280027ffa8000\",\"0x1104800180018000\",\"0x17ce\",\"0x482480017fff8000\",\"0x17cd\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x1235e\",\"0x480a7ff77fff8000\",\"0x48307ffe7ff78000\",\"0x480a7ff97fff8000\",\"0x482680017ffa8000\",\"0x6\",\"0x480680017fff8000\",\"0x1\",\"0x480280047ffa8000\",\"0x480280057ffa8000\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffa7fff\",\"0x400380017ffa7ff8\",\"0x480280037ffa8000\",\"0x20680017fff7fff\",\"0x172\",\"0x480280027ffa8000\",\"0x480280047ffa8000\",\"0x480080027fff8000\",\"0x480680017fff8000\",\"0x3c87bf42ed4f01f11883bf54f43d91d2cbbd5fec26d1df9c74c57ae138800a4\",\"0x400280007ff97fff\",\"0x400280017ff97ffe\",\"0x480280027ff98000\",\"0x400280037ff97fff\",\"0x400380047ff97ffb\",\"0x480280057ff98000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff77ffc\",\"0x480280017ff77ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff77ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff77ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff77ffd\",\"0x400280027ff77ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff37fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff98000\",\"0x6\",\"0x482680017ff78000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280057ffa7fff\",\"0x400280067ffa7ffb\",\"0x400280077ffa7ffc\",\"0x400280087ffa7ffa\",\"0x4802800a7ffa8000\",\"0x20680017fff7fff\",\"0x11e\",\"0x480280097ffa8000\",\"0x4802800b7ffa8000\",\"0x482680017ffa8000\",\"0xc\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0xeb\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff28000\",\"0x1\",\"0x482480017ff58000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff87fff\",\"0x400080017ff87ffb\",\"0x400080027ff87ffc\",\"0x400080037ff87ffd\",\"0x480080057ff88000\",\"0x20680017fff7fff\",\"0xc3\",\"0x480080047ff78000\",\"0x480080067ff68000\",\"0x482480017ff58000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x92\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x48287ffd80017ffb\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080017ff57fff\",\"0x40780017fff7fff\",\"0x1\",\"0x482480017ff48000\",\"0x2\",\"0x48127ffb7fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x9\",\"0x482480017ff48000\",\"0x2\",\"0x482480017ffb8000\",\"0xa\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48287ffc80017fe9\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff97fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ffa7fff\",\"0x40780017fff7fff\",\"0x5\",\"0x482480017ff58000\",\"0x1\",\"0x482480017ff58000\",\"0x208\",\"0x48127ff87fff8000\",\"0x48127ff47fff8000\",\"0x10780017fff7fff\",\"0x13\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48307ffe80017ff9\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0x38\",\"0x400080017ff57fff\",\"0x482480017ff58000\",\"0x2\",\"0x48127ffc7fff8000\",\"0x48127ff97fff8000\",\"0x48127ffc7fff8000\",\"0x20680017fff7ff4\",\"0x22\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x48127fd77fff8000\",\"0x48127fe77fff8000\",\"0x48127fc87fff8000\",\"0x480a7ffb7fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffcc2\",\"0x20680017fff7ffd\",\"0xd\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x16d2\",\"0x482480017fff8000\",\"0x16d1\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xb234\",\"0x48127ff57fff8000\",\"0x48307ffe7ff58000\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x3\",\"0x1104800180018000\",\"0x16c2\",\"0x482480017fff8000\",\"0x16c1\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xb342\",\"0x482480017fea8000\",\"0x2\",\"0x48307ffe7ff18000\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x753235365f737562204f766572666c6f77\",\"0x400080007ffe7fff\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x48127fcc7fff8000\",\"0x48127fdc7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x16a6\",\"0x482480017fff8000\",\"0x16a5\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xb734\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fea8000\",\"0x3\",\"0x48307ffc7fef8000\",\"0x48127fed7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x2f\",\"0x40780017fff7fff\",\"0xb\",\"0x480080047fec8000\",\"0x1104800180018000\",\"0x168b\",\"0x482480017fff8000\",\"0x168a\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xbe3c\",\"0x48127fea7fff8000\",\"0x48307ffe7ff78000\",\"0x482480017fe28000\",\"0x8\",\"0x480080067fe18000\",\"0x480080077fe08000\",\"0x10780017fff7fff\",\"0x2f\",\"0x40780017fff7fff\",\"0xb\",\"0x1104800180018000\",\"0x1677\",\"0x482480017fff8000\",\"0x1676\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xe4c0\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fdf8000\",\"0x3\",\"0x48307ffc7fe48000\",\"0x48127fe27fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x15\",\"0x40780017fff7fff\",\"0x16\",\"0x480280097ffa8000\",\"0x1104800180018000\",\"0x165c\",\"0x482480017fff8000\",\"0x165b\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xec2c\",\"0x48127fdf7fff8000\",\"0x48307ffe7ff78000\",\"0x482680017ffa8000\",\"0xd\",\"0x4802800b7ffa8000\",\"0x4802800c7ffa8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fd77fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480280027ffa8000\",\"0x1104800180018000\",\"0x1642\",\"0x482480017fff8000\",\"0x1641\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x1235e\",\"0x480a7ff77fff8000\",\"0x48307ffe7ff78000\",\"0x480a7ff97fff8000\",\"0x482680017ffa8000\",\"0x6\",\"0x480680017fff8000\",\"0x1\",\"0x480280047ffa8000\",\"0x480280057ffa8000\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x341c1bdfd89f69748aa00b5742b03adbffd79b8e80cab5c50d91cd8c2a79be1\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400280007ff47fff\",\"0x400380017ff47ff2\",\"0x400280027ff47ffd\",\"0x400280037ff47ffe\",\"0x400380047ff47ff5\",\"0x480280067ff48000\",\"0x20680017fff7fff\",\"0x11f\",\"0x480280057ff48000\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0xb6ce5410fca59d078ee9b2a4371a9d684c530d697c64fbef0ae6d5e8f0ac72\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400280077ff47fff\",\"0x400280087ff47ffc\",\"0x400280097ff47ffd\",\"0x4002800a7ff47ffe\",\"0x4003800b7ff47ff6\",\"0x4802800d7ff48000\",\"0x20680017fff7fff\",\"0xfd\",\"0x4802800c7ff48000\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1f0d4aa99431d246bac9b8e48c33e888245b15e9678f64f9bdfc8823dc8f979\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x4002800e7ff47fff\",\"0x4002800f7ff47ffc\",\"0x400280107ff47ffd\",\"0x400280117ff47ffe\",\"0x400380127ff47ff7\",\"0x480280147ff48000\",\"0x20680017fff7fff\",\"0xdb\",\"0x480280137ff48000\",\"0x480a7ff17fff8000\",\"0x48127ffe7fff8000\",\"0x480a7ff37fff8000\",\"0x482680017ff48000\",\"0x15\",\"0x480a7ffa7fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x1104800180018000\",\"0x4c3\",\"0x20680017fff7ffd\",\"0xbb\",\"0x48127ffa7fff8000\",\"0x20780017fff7ffb\",\"0x1b\",\"0x1104800180018000\",\"0x15f0\",\"0x482480017fff8000\",\"0x15ef\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0xa\",\"0x482480017fff8000\",\"0x35d7c\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x494e56414c49445f4d494e5445525f41444452455353\",\"0x400080007ffe7fff\",\"0x48127fef7fff8000\",\"0x48307ffc7ff58000\",\"0x48127fef7fff8000\",\"0x48127fef7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1390569bb0a3a722eb4228e8700301347da081211d5c2ded2db22ef389551ab\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080007ff77fff\",\"0x400080017ff77ffc\",\"0x400080027ff77ffd\",\"0x400080037ff77ffe\",\"0x400180047ff77ffb\",\"0x480080067ff78000\",\"0x20680017fff7fff\",\"0x7b\",\"0x480080057ff68000\",\"0x48127ff27fff8000\",\"0x48127ffe7fff8000\",\"0x48127ff27fff8000\",\"0x482480017ff28000\",\"0x7\",\"0x480a7ffc7fff8000\",\"0x1104800180018000\",\"0x1226\",\"0x20680017fff7ffd\",\"0x5f\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x3fc801c47df4de8d5835f8bfd4d0b8823ba63e5a3f278086901402d680abfc\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080007ff87fff\",\"0x400080017ff87ffc\",\"0x400080027ff87ffd\",\"0x400080037ff87ffe\",\"0x400180047ff87ffd\",\"0x480080067ff88000\",\"0x20680017fff7fff\",\"0x3d\",\"0x480080057ff78000\",\"0x48127ff37fff8000\",\"0x48127ffe7fff8000\",\"0x48127ff37fff8000\",\"0x482480017ff38000\",\"0x7\",\"0x1104800180018000\",\"0x12d9\",\"0x20680017fff7ffd\",\"0x29\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x38bb9518f707d6868da0178f4ac498e320441f8f7e11ff8a35ed4ea8286e693\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080007ff87fff\",\"0x400080017ff87ffc\",\"0x400080027ff87ffd\",\"0x400080037ff87ffe\",\"0x400080047ff87ffb\",\"0x480080067ff88000\",\"0x20680017fff7fff\",\"0xf\",\"0x480080057ff78000\",\"0x48127ff37fff8000\",\"0x48127ffe7fff8000\",\"0x48127ff37fff8000\",\"0x482480017ff38000\",\"0x7\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x480080057ff78000\",\"0x48127ff37fff8000\",\"0x48127ffe7fff8000\",\"0x48127ff37fff8000\",\"0x482480017ff38000\",\"0x9\",\"0x480680017fff8000\",\"0x1\",\"0x480080077ff18000\",\"0x480080087ff08000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x2bc0\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480080057ff78000\",\"0x1104800180018000\",\"0x1572\",\"0x482480017fff8000\",\"0x1571\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x70a8\",\"0x48127fed7fff8000\",\"0x48307ffe7ff88000\",\"0x48127fed7fff8000\",\"0x482480017fed8000\",\"0x9\",\"0x480680017fff8000\",\"0x1\",\"0x480080077feb8000\",\"0x480080087fea8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x1560\",\"0x482480017fff8000\",\"0x155f\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x9c68\",\"0x48127ff37fff8000\",\"0x48307ffe7ff38000\",\"0x48127ff37fff8000\",\"0x48127ff37fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff37fff8000\",\"0x48127ff37fff8000\",\"0x208b7fff7fff7ffe\",\"0x480080057ff68000\",\"0x1104800180018000\",\"0x154e\",\"0x482480017fff8000\",\"0x154d\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0xa\",\"0x482480017fff8000\",\"0x332e8\",\"0x48127feb7fff8000\",\"0x48307ffe7ff78000\",\"0x48127feb7fff8000\",\"0x482480017feb8000\",\"0x9\",\"0x480680017fff8000\",\"0x1\",\"0x480080077fe98000\",\"0x480080087fe88000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x153a\",\"0x482480017fff8000\",\"0x1539\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0xa\",\"0x482480017fff8000\",\"0x35f70\",\"0x48127ff27fff8000\",\"0x48307ffe7ff28000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x208b7fff7fff7ffe\",\"0x480280137ff48000\",\"0x1104800180018000\",\"0x1526\",\"0x482480017fff8000\",\"0x1525\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0xc\",\"0x482480017fff8000\",\"0x54e5c\",\"0x48307fff7ff88000\",\"0x482680017ff48000\",\"0x17\",\"0x480280157ff48000\",\"0x480280167ff48000\",\"0x10780017fff7fff\",\"0x24\",\"0x4802800c7ff48000\",\"0x1104800180018000\",\"0x1514\",\"0x482480017fff8000\",\"0x1513\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0xc\",\"0x482480017fff8000\",\"0x57a1c\",\"0x48307fff7ff88000\",\"0x482680017ff48000\",\"0x10\",\"0x4802800e7ff48000\",\"0x4802800f7ff48000\",\"0x10780017fff7fff\",\"0x12\",\"0x480280057ff48000\",\"0x1104800180018000\",\"0x1502\",\"0x482480017fff8000\",\"0x1501\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0xc\",\"0x482480017fff8000\",\"0x5a640\",\"0x48307fff7ff88000\",\"0x482680017ff48000\",\"0x9\",\"0x480280077ff48000\",\"0x480280087ff48000\",\"0x480a7ff17fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ff37fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffd7fff\",\"0x400380017ffd7ffb\",\"0x480280037ffd8000\",\"0x20680017fff7fff\",\"0x7c\",\"0x480280027ffd8000\",\"0x480280047ffd8000\",\"0x480680017fff8000\",\"0x52c476292b358ba7d29adb58502341b4cc5437d07f67d3e285e085828bc820\",\"0x480680017fff8000\",\"0x251e864ca2a080f55bce5da2452e8cfcafdbc951a3e7fff5023d558452ec228\",\"0x400280007ffc7ffe\",\"0x400280017ffc7fff\",\"0x480280027ffc8000\",\"0x480080027ffc8000\",\"0x400280037ffc7ffe\",\"0x400280047ffc7fff\",\"0x480280057ffc8000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ffa7ffc\",\"0x480280017ffa7ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ffa7ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ffa7ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ffa7ffd\",\"0x400280027ffa7ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ffc8000\",\"0x6\",\"0x482680017ffa8000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280057ffd7fff\",\"0x400280067ffd7ffb\",\"0x400280077ffd7ffc\",\"0x400280087ffd7ffa\",\"0x4802800a7ffd8000\",\"0x20680017fff7fff\",\"0x34\",\"0x480280097ffd8000\",\"0x4802800b7ffd8000\",\"0x482680017ffd8000\",\"0xc\",\"0x48127ffd7fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1\",\"0x48307ffe80007fff\",\"0x20680017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f4e4c595f555047524144455f474f5645524e4f52\",\"0x400080007ffe7fff\",\"0x48127ff37fff8000\",\"0x48127ff97fff8000\",\"0x48127ff07fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x2\",\"0x48127ff37fff8000\",\"0x482480017ff98000\",\"0xb4\",\"0x48127ff07fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x9\",\"0x480280097ffd8000\",\"0x48127ff37fff8000\",\"0x482480017ffe8000\",\"0x456\",\"0x48127ff07fff8000\",\"0x482680017ffd8000\",\"0xd\",\"0x480680017fff8000\",\"0x1\",\"0x4802800b7ffd8000\",\"0x4802800c7ffd8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x16\",\"0x480280027ffd8000\",\"0x1104800180018000\",\"0x1466\",\"0x482480017fff8000\",\"0x1465\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x357a\",\"0x480a7ffa7fff8000\",\"0x48307ffe7ff78000\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x6\",\"0x480680017fff8000\",\"0x1\",\"0x480280047ffd8000\",\"0x480280057ffd8000\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x3c87bf42ed4f01f11883bf54f43d91d2cbbd5fec26d1df9c74c57ae138800a4\",\"0x400280007ff87fff\",\"0x400380017ff87ffa\",\"0x480280027ff88000\",\"0x400280037ff87fff\",\"0x400380047ff87ffb\",\"0x480280057ff88000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff67ffc\",\"0x480280017ff67ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff67ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff67ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff67ffd\",\"0x400280027ff67ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff88000\",\"0x6\",\"0x482680017ff68000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ff97fff\",\"0x400380017ff97ff7\",\"0x400280027ff97ffc\",\"0x400280037ff97ffb\",\"0x480280057ff98000\",\"0x20680017fff7fff\",\"0x1c6\",\"0x480280047ff98000\",\"0x480280067ff98000\",\"0x482680017ff98000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x193\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff38000\",\"0x1\",\"0x482480017ff58000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff87fff\",\"0x400080017ff87ffb\",\"0x400080027ff87ffc\",\"0x400080037ff87ffd\",\"0x480080057ff88000\",\"0x20680017fff7fff\",\"0x16b\",\"0x480080047ff78000\",\"0x480080067ff68000\",\"0x482480017ff58000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x13a\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x480680017fff8000\",\"0xffffffffffffffffffffffffffffffff\",\"0x48127ffd7fff8000\",\"0x48287ffd80017ffe\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080017ff37fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080017ff47fff\",\"0x40780017fff7fff\",\"0x1\",\"0x482480017ff38000\",\"0x2\",\"0x48127ffb7fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x9\",\"0x482480017ff38000\",\"0x2\",\"0x482480017ffb8000\",\"0xa\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0xffffffffffffffffffffffffffffffff\",\"0x48287ffc80017fff\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff87fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ff97fff\",\"0x40780017fff7fff\",\"0x5\",\"0x482480017ff48000\",\"0x1\",\"0x482480017ff48000\",\"0x208\",\"0x48127ff87fff8000\",\"0x48127ff37fff8000\",\"0x10780017fff7fff\",\"0x13\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48307ffe80017ff8\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080017ff37fff\",\"0x10780017fff7fff\",\"0xdc\",\"0x400080017ff47fff\",\"0x482480017ff48000\",\"0x2\",\"0x48127ffc7fff8000\",\"0x48127ff97fff8000\",\"0x48127ffc7fff8000\",\"0x20680017fff7ff3\",\"0xc6\",\"0x48127ffd7fff8000\",\"0x48307fe680017ffe\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff87fff\",\"0x10780017fff7fff\",\"0xa5\",\"0x400080007ff97fff\",\"0x482480017ff98000\",\"0x1\",\"0x48127ffc7fff8000\",\"0x48307fe280007ffa\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x9\",\"0x40780017fff7fff\",\"0x3\",\"0x48127ffa7fff8000\",\"0x482480017ffa8000\",\"0x154\",\"0x10780017fff7fff\",\"0xf\",\"0x48127ffe7fff8000\",\"0x48307fd580017ff7\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff97fff\",\"0x10780017fff7fff\",\"0x7d\",\"0x400080007ffa7fff\",\"0x482480017ffa8000\",\"0x1\",\"0x48127ffc7fff8000\",\"0x48287ffd7fdc8001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080007ffb7fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ffc7fff\",\"0x40780017fff7fff\",\"0x1\",\"0x482480017ffb8000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x9\",\"0x482480017ffb8000\",\"0x1\",\"0x482480017ffb8000\",\"0xa\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48287ffc7fca8001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080007ff97fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ffa7fff\",\"0x40780017fff7fff\",\"0x5\",\"0x482480017ff58000\",\"0x1\",\"0x482480017ff58000\",\"0x208\",\"0x48127ff87fff8000\",\"0x48127ff47fff8000\",\"0x10780017fff7fff\",\"0x13\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48307ffe7ff98001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0x23\",\"0x400080017ff57fff\",\"0x482480017ff58000\",\"0x2\",\"0x48127ffc7fff8000\",\"0x48127ff97fff8000\",\"0x48127ffc7fff8000\",\"0x20680017fff7ff4\",\"0xd\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x48127fb87fff8000\",\"0x48127fc87fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffff8fb\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x1320\",\"0x482480017fff8000\",\"0x131f\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xaf14\",\"0x48127ff57fff8000\",\"0x48307ffe7ff58000\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x3\",\"0x1104800180018000\",\"0x1310\",\"0x482480017fff8000\",\"0x130f\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xb022\",\"0x482480017fea8000\",\"0x2\",\"0x48307ffe7ff18000\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x753235365f616464204f766572666c6f77\",\"0x400080007ffe7fff\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x48127fad7fff8000\",\"0x48127fbd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x12f4\",\"0x482480017fff8000\",\"0x12f3\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xbb44\",\"0x482480017ff28000\",\"0x1\",\"0x48307ffe7ff48000\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x6\",\"0x1104800180018000\",\"0x12e3\",\"0x482480017fff8000\",\"0x12e2\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xbed2\",\"0x482480017feb8000\",\"0x1\",\"0x48307ffe7fee8000\",\"0x48127fc47fff8000\",\"0x48127fd47fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x12cd\",\"0x482480017fff8000\",\"0x12cc\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xbfb8\",\"0x48127ff57fff8000\",\"0x48307ffe7ff58000\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x3\",\"0x1104800180018000\",\"0x12bd\",\"0x482480017fff8000\",\"0x12bc\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xc0c6\",\"0x482480017fe98000\",\"0x2\",\"0x48307ffe7ff18000\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x753235365f737562204f766572666c6f77\",\"0x400080007ffe7fff\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x48127fca7fff8000\",\"0x48127fda7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x12a1\",\"0x482480017fff8000\",\"0x12a0\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xc580\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fea8000\",\"0x3\",\"0x48307ffc7fef8000\",\"0x48127fed7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x2f\",\"0x40780017fff7fff\",\"0xb\",\"0x480080047fec8000\",\"0x1104800180018000\",\"0x1286\",\"0x482480017fff8000\",\"0x1285\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xcc88\",\"0x48127fea7fff8000\",\"0x48307ffe7ff78000\",\"0x482480017fe28000\",\"0x8\",\"0x480080067fe18000\",\"0x480080077fe08000\",\"0x10780017fff7fff\",\"0x2f\",\"0x40780017fff7fff\",\"0xb\",\"0x1104800180018000\",\"0x1272\",\"0x482480017fff8000\",\"0x1271\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xf30c\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fdf8000\",\"0x3\",\"0x48307ffc7fe48000\",\"0x48127fe27fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x15\",\"0x40780017fff7fff\",\"0x16\",\"0x480280047ff98000\",\"0x1104800180018000\",\"0x1257\",\"0x482480017fff8000\",\"0x1256\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xfa78\",\"0x48127fdf7fff8000\",\"0x48307ffe7ff78000\",\"0x482680017ff98000\",\"0x8\",\"0x480280067ff98000\",\"0x480280077ff98000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fd77fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x2ab9656e71e13c39f9f290cc5354d2e50a410992032118a1779539be0e4e75\",\"0x400080007ffe7fff\",\"0x400180017ffe7ff9\",\"0x400180027ffe7ffa\",\"0x400180037ffe7ffc\",\"0x400180047ffe7ffd\",\"0x48127ffe7fff8000\",\"0x482480017ffd8000\",\"0x5\",\"0x40327ffe80007fff\",\"0x480680017fff8000\",\"0x0\",\"0x4828800080017fff\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff67fff\",\"0x10780017fff7fff\",\"0x1a\",\"0x400280007ff67fff\",\"0x1104800180018000\",\"0x1224\",\"0x482480017fff8000\",\"0x1223\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xb9a\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x5265717569726573206174206c65617374206f6e6520656c656d656e74\",\"0x400080007ffe7fff\",\"0x482680017ff68000\",\"0x1\",\"0x48327ffc7ff78000\",\"0x480a7ff87fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482680017ff68000\",\"0x1\",\"0x480a7ff77fff8000\",\"0x480a7ff87fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x1104800180018000\",\"0x21\",\"0x20680017fff7ffc\",\"0xf\",\"0x400080007ffb7fff\",\"0x400180017ffb8000\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x190\",\"0x482480017ff98000\",\"0x3\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480080027ff68000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x11f4\",\"0x482480017fff8000\",\"0x11f3\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x0\",\"0x48127ff37fff8000\",\"0x48307ffe7ff38000\",\"0x48127ff37fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x11e4\",\"0x482480017fff8000\",\"0x11e3\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xc62\",\"0xa0680017fff8000\",\"0x8\",\"0x48317ffe80007ff9\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff87fff\",\"0x10780017fff7fff\",\"0x3c\",\"0x48317ffe80007ff9\",\"0x400280007ff87fff\",\"0x482680017ff88000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x48297ffb80007ffc\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffe7fff8000\",\"0x482680017ffb8000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ffb7fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffe7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xf\",\"0x480080007fff8000\",\"0x400380007ffa7ffd\",\"0x400280017ffa7fff\",\"0x48127ff77fff8000\",\"0x48127ff97fff8000\",\"0x482680017ffa8000\",\"0x3\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x480280027ffa8000\",\"0x1104800180018000\",\"0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffcb\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x11ab\",\"0x482480017fff8000\",\"0x11aa\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x7b2\",\"0x48127ff27fff8000\",\"0x48307ffe7ff48000\",\"0x480a7ffa7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480a7ffd7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482680017ff88000\",\"0x1\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x400180007fff7ffb\",\"0x48297ffc80007ffd\",\"0x400080017ffe7fff\",\"0x480a7ff77fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x2\",\"0x1104800180018000\",\"0xae5\",\"0x20680017fff7ffd\",\"0x3e\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x28420862938116cb3bbdbedee07451ccc54d4e9412dbef71142ad1980a30941\",\"0x480680017fff8000\",\"0x43616c6c436f6e7472616374\",\"0x400280007ff97fff\",\"0x400280017ff97ffd\",\"0x400380027ff97ffa\",\"0x400280037ff97ffe\",\"0x400280047ff97ffb\",\"0x400280057ff97ffc\",\"0x480280077ff98000\",\"0x20680017fff7fff\",\"0x25\",\"0x480280067ff98000\",\"0x480280087ff98000\",\"0x480280097ff98000\",\"0x482680017ff98000\",\"0xa\",\"0x48127ffc7fff8000\",\"0x48307ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xc\",\"0x48127ff17fff8000\",\"0x482480017ffd8000\",\"0x190\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480080007ff68000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x52657475726e6564206461746120746f6f2073686f7274\",\"0x400080007ffe7fff\",\"0x48127fef7fff8000\",\"0x48127ffb7fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480280067ff98000\",\"0x48127ff67fff8000\",\"0x482480017ffe8000\",\"0x3e8\",\"0x482680017ff98000\",\"0xa\",\"0x480680017fff8000\",\"0x1\",\"0x480280087ff98000\",\"0x480280097ff98000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x482480017ffb8000\",\"0x2fa8\",\"0x480a7ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x2\",\"0x20780017fff7ffb\",\"0x1b\",\"0x1104800180018000\",\"0x1130\",\"0x482480017fff8000\",\"0x112f\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1e578\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x45524332303a206d696e7420746f2030\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x48327ffc7ff88000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480a7ff77fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffa7fff8000\",\"0x480680017fff8000\",\"0x110e2f729c9c2b988559994a3daccd838cf52faf88e18101373e67dd061455a\",\"0x1104800180018000\",\"0xec7\",\"0x20680017fff7ffd\",\"0x2a4\",\"0x48127ffb7fff8000\",\"0x48287ffd7ffe8001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080007ff67fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ff77fff\",\"0x40780017fff7fff\",\"0x1\",\"0x482480017ff68000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x9\",\"0x482480017ff68000\",\"0x1\",\"0x482480017ffb8000\",\"0xa\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48287ffc7ff68001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080007ff97fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ffa7fff\",\"0x40780017fff7fff\",\"0x5\",\"0x482480017ff58000\",\"0x1\",\"0x482480017ff58000\",\"0x208\",\"0x48127ff87fff8000\",\"0x48127ff47fff8000\",\"0x10780017fff7fff\",\"0x13\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48307ffe7ff98001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0x24d\",\"0x400080017ff57fff\",\"0x482480017ff58000\",\"0x2\",\"0x48127ffc7fff8000\",\"0x48127ff97fff8000\",\"0x48127ffc7fff8000\",\"0x20680017fff7ff4\",\"0x237\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x110e2f729c9c2b988559994a3daccd838cf52faf88e18101373e67dd061455a\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080007fe57fff\",\"0x400080017fe57ffc\",\"0x400080027fe57ffd\",\"0x400080037fe57ffe\",\"0x400080047fe57ffa\",\"0x480080067fe58000\",\"0x20680017fff7fff\",\"0x20d\",\"0x480080057fe48000\",\"0x480680017fff8000\",\"0x110e2f729c9c2b988559994a3daccd838cf52faf88e18101373e67dd061455a\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ffd8000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080077fde7fff\",\"0x400080087fde7ffc\",\"0x400080097fde7ffd\",\"0x4000800a7fde7ffe\",\"0x4000800b7fde7ff4\",\"0x4800800d7fde8000\",\"0x20680017fff7fff\",\"0x1e9\",\"0x4800800c7fdd8000\",\"0x480680017fff8000\",\"0x3a4e8ec16e258a799fe707996fd5d21d42b29adc1499a370edf7f809d8c458a\",\"0x400280007ff97fff\",\"0x400380017ff97ffb\",\"0x480280027ff98000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007fe97ffc\",\"0x480080017fe87ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027fe67ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007fe97ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017fe77ffd\",\"0x400080027fe67ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff67fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff98000\",\"0x3\",\"0x482480017fe38000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x4000800e7fce7fff\",\"0x4000800f7fce7ffb\",\"0x400080107fce7ffc\",\"0x400080117fce7ffa\",\"0x480080137fce8000\",\"0x20680017fff7fff\",\"0x19c\",\"0x480080127fcd8000\",\"0x480080147fcc8000\",\"0x482480017fcb8000\",\"0x15\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x16b\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff28000\",\"0x1\",\"0x482480017ff58000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff87fff\",\"0x400080017ff87ffb\",\"0x400080027ff87ffc\",\"0x400080037ff87ffd\",\"0x480080057ff88000\",\"0x20680017fff7fff\",\"0x145\",\"0x480080047ff78000\",\"0x480080067ff68000\",\"0x482480017ff58000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x116\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x48287ffd7ffb8001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080017ff57fff\",\"0x40780017fff7fff\",\"0x1\",\"0x482480017ff48000\",\"0x2\",\"0x48127ffb7fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x9\",\"0x482480017ff48000\",\"0x2\",\"0x482480017ffb8000\",\"0xa\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48287ffc7fe98001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080007ff97fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ffa7fff\",\"0x40780017fff7fff\",\"0x5\",\"0x482480017ff58000\",\"0x1\",\"0x482480017ff58000\",\"0x208\",\"0x48127ff87fff8000\",\"0x48127ff47fff8000\",\"0x10780017fff7fff\",\"0x13\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48307ffe7ff98001\",\"0xa0680017fff7fff\",\"0x7\",\"0x4824800180007fff\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0xbe\",\"0x400080017ff57fff\",\"0x482480017ff58000\",\"0x2\",\"0x48127ffc7fff8000\",\"0x48127ff97fff8000\",\"0x48127ffc7fff8000\",\"0x20680017fff7ff4\",\"0xaa\",\"0x480680017fff8000\",\"0x3a4e8ec16e258a799fe707996fd5d21d42b29adc1499a370edf7f809d8c458a\",\"0x400080007fd87fff\",\"0x400180017fd87ffb\",\"0x480080027fd88000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff67ffc\",\"0x480080017ff57ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027ff37ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff67ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017ff47ffd\",\"0x400080027ff37ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff47fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x402580017fce8001\",\"0x3\",\"0x482480017ff18000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080007fdd7fff\",\"0x400080017fdd7ffc\",\"0x400080027fdd7ffd\",\"0x400080037fdd7ffb\",\"0x400080047fdd7ff1\",\"0x480080067fdd8000\",\"0x20680017fff7fff\",\"0x65\",\"0x480080057fdc8000\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff78000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080077fd77fff\",\"0x400080087fd77ffc\",\"0x400080097fd77ffd\",\"0x4000800a7fd77ffe\",\"0x4000800b7fd77fec\",\"0x4800800d7fd78000\",\"0x20680017fff7fff\",\"0x4c\",\"0x4800800c7fd68000\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff47fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x19\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ff37fff8000\",\"0x402580017fc68000\",\"0xe\",\"0x1104800180018000\",\"0x705\",\"0x20680017fff7ffb\",\"0x26\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x456d69744576656e74\",\"0x4002800080007fff\",\"0x4002800180007ffe\",\"0x4002800280007ffa\",\"0x4002800380007ffb\",\"0x4002800480007ffc\",\"0x4002800580007ffd\",\"0x4802800780008000\",\"0x20680017fff7fff\",\"0xf\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0x8\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0xa\",\"0x480680017fff8000\",\"0x1\",\"0x4802800880008000\",\"0x4802800980008000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x2b5c\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x4800800c7fd68000\",\"0x482480017fff8000\",\"0x4d58\",\"0x482480017fd48000\",\"0x10\",\"0x4800800e7fd38000\",\"0x4800800f7fd28000\",\"0x10780017fff7fff\",\"0xb\",\"0x40780017fff7fff\",\"0x6\",\"0x480080057fd68000\",\"0x482480017fff8000\",\"0x78dc\",\"0x482480017fd48000\",\"0x9\",\"0x480080077fd38000\",\"0x480080087fd28000\",\"0x48127ff27fff8000\",\"0x48127ffb7fff8000\",\"0x480a80017fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0xf48\",\"0x482480017fff8000\",\"0xf47\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xa8c0\",\"0x48127ff67fff8000\",\"0x48307ffe7ff68000\",\"0x10780017fff7fff\",\"0xf\",\"0x40780017fff7fff\",\"0x3\",\"0x1104800180018000\",\"0xf3a\",\"0x482480017fff8000\",\"0xf39\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xa9ce\",\"0x482480017feb8000\",\"0x2\",\"0x48307ffe7ff28000\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x753235365f616464204f766572666c6f77\",\"0x400080007ffe7fff\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x48127fcd7fff8000\",\"0x48127fdd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0xf20\",\"0x482480017fff8000\",\"0xf1f\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xadc0\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017feb8000\",\"0x3\",\"0x48307ffc7ff08000\",\"0x48127fee7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x2b\",\"0x40780017fff7fff\",\"0xb\",\"0x480080047fec8000\",\"0x1104800180018000\",\"0xf07\",\"0x482480017fff8000\",\"0xf06\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xb4c8\",\"0x48127feb7fff8000\",\"0x48307ffe7ff88000\",\"0x482480017fe38000\",\"0x8\",\"0x480080067fe28000\",\"0x480080077fe18000\",\"0x10780017fff7fff\",\"0x2b\",\"0x40780017fff7fff\",\"0xb\",\"0x1104800180018000\",\"0xef5\",\"0x482480017fff8000\",\"0xef4\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xdb4c\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fe08000\",\"0x3\",\"0x48307ffc7fe58000\",\"0x48127fe37fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x13\",\"0x40780017fff7fff\",\"0x16\",\"0x480080127fb78000\",\"0x1104800180018000\",\"0xedc\",\"0x482480017fff8000\",\"0xedb\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xe2b8\",\"0x48127fe07fff8000\",\"0x48307ffe7ff88000\",\"0x482480017fae8000\",\"0x16\",\"0x480080147fad8000\",\"0x480080157fac8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fd87fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x4800800c7fdd8000\",\"0x1104800180018000\",\"0xec4\",\"0x482480017fff8000\",\"0xec3\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1159e\",\"0x48307fff7ff88000\",\"0x482480017fd48000\",\"0x10\",\"0x4800800e7fd38000\",\"0x4800800f7fd28000\",\"0x10780017fff7fff\",\"0x14\",\"0x40780017fff7fff\",\"0x7\",\"0x480080057fdd8000\",\"0x1104800180018000\",\"0xeb0\",\"0x482480017fff8000\",\"0xeaf\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1417c\",\"0x48307fff7ff88000\",\"0x482480017fd48000\",\"0x9\",\"0x480080077fd38000\",\"0x480080087fd28000\",\"0x48127fe47fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ff97fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0xe98\",\"0x482480017fff8000\",\"0xe97\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x16d1e\",\"0x48127ff57fff8000\",\"0x48307ffe7ff58000\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x3\",\"0x1104800180018000\",\"0xe88\",\"0x482480017fff8000\",\"0xe87\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x16e2c\",\"0x482480017fea8000\",\"0x2\",\"0x48307ffe7ff18000\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x753235365f616464204f766572666c6f77\",\"0x400080007ffe7fff\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x480a7ff97fff8000\",\"0x48127fdb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0xe6c\",\"0x482480017fff8000\",\"0xe6b\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x17a16\",\"0x48127ff37fff8000\",\"0x48307ffe7ff38000\",\"0x480a7ff97fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x2\",\"0x20780017fff7ffb\",\"0x1b\",\"0x1104800180018000\",\"0xe55\",\"0x482480017fff8000\",\"0xe54\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1e578\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x45524332303a206275726e2066726f6d2030\",\"0x400080007ffe7fff\",\"0x480a7ff77fff8000\",\"0x48327ffc7ff88000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480a7ff77fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ffa7fff8000\",\"0x480680017fff8000\",\"0x110e2f729c9c2b988559994a3daccd838cf52faf88e18101373e67dd061455a\",\"0x1104800180018000\",\"0xbec\",\"0x20680017fff7ffd\",\"0x2a4\",\"0x48127ffb7fff8000\",\"0x48287ffd80017ffe\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff67fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ff77fff\",\"0x40780017fff7fff\",\"0x1\",\"0x482480017ff68000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x9\",\"0x482480017ff68000\",\"0x1\",\"0x482480017ffb8000\",\"0xa\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48287ffc80017ff6\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff97fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ffa7fff\",\"0x40780017fff7fff\",\"0x5\",\"0x482480017ff58000\",\"0x1\",\"0x482480017ff58000\",\"0x208\",\"0x48127ff87fff8000\",\"0x48127ff47fff8000\",\"0x10780017fff7fff\",\"0x13\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48307ffe80017ff9\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0x24d\",\"0x400080017ff57fff\",\"0x482480017ff58000\",\"0x2\",\"0x48127ffc7fff8000\",\"0x48127ff97fff8000\",\"0x48127ffc7fff8000\",\"0x20680017fff7ff4\",\"0x237\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x110e2f729c9c2b988559994a3daccd838cf52faf88e18101373e67dd061455a\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080007fe57fff\",\"0x400080017fe57ffc\",\"0x400080027fe57ffd\",\"0x400080037fe57ffe\",\"0x400080047fe57ffa\",\"0x480080067fe58000\",\"0x20680017fff7fff\",\"0x20d\",\"0x480080057fe48000\",\"0x480680017fff8000\",\"0x110e2f729c9c2b988559994a3daccd838cf52faf88e18101373e67dd061455a\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ffd8000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080077fde7fff\",\"0x400080087fde7ffc\",\"0x400080097fde7ffd\",\"0x4000800a7fde7ffe\",\"0x4000800b7fde7ff4\",\"0x4800800d7fde8000\",\"0x20680017fff7fff\",\"0x1e9\",\"0x4800800c7fdd8000\",\"0x480680017fff8000\",\"0x3a4e8ec16e258a799fe707996fd5d21d42b29adc1499a370edf7f809d8c458a\",\"0x400280007ff97fff\",\"0x400380017ff97ffb\",\"0x480280027ff98000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007fe97ffc\",\"0x480080017fe87ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027fe67ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007fe97ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017fe77ffd\",\"0x400080027fe67ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff67fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff98000\",\"0x3\",\"0x482480017fe38000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x4000800e7fce7fff\",\"0x4000800f7fce7ffb\",\"0x400080107fce7ffc\",\"0x400080117fce7ffa\",\"0x480080137fce8000\",\"0x20680017fff7fff\",\"0x19c\",\"0x480080127fcd8000\",\"0x480080147fcc8000\",\"0x482480017fcb8000\",\"0x15\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x16b\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff28000\",\"0x1\",\"0x482480017ff58000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff87fff\",\"0x400080017ff87ffb\",\"0x400080027ff87ffc\",\"0x400080037ff87ffd\",\"0x480080057ff88000\",\"0x20680017fff7fff\",\"0x145\",\"0x480080047ff78000\",\"0x480080067ff68000\",\"0x482480017ff58000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x116\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x48287ffd80017ffb\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080017ff57fff\",\"0x40780017fff7fff\",\"0x1\",\"0x482480017ff48000\",\"0x2\",\"0x48127ffb7fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x9\",\"0x482480017ff48000\",\"0x2\",\"0x482480017ffb8000\",\"0xa\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48287ffc80017fe9\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007ff97fff\",\"0x10780017fff7fff\",\"0xd\",\"0x400080007ffa7fff\",\"0x40780017fff7fff\",\"0x5\",\"0x482480017ff58000\",\"0x1\",\"0x482480017ff58000\",\"0x208\",\"0x48127ff87fff8000\",\"0x48127ff47fff8000\",\"0x10780017fff7fff\",\"0x13\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48307ffe80017ff9\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080017ff47fff\",\"0x10780017fff7fff\",\"0xbe\",\"0x400080017ff57fff\",\"0x482480017ff58000\",\"0x2\",\"0x48127ffc7fff8000\",\"0x48127ff97fff8000\",\"0x48127ffc7fff8000\",\"0x20680017fff7ff4\",\"0xaa\",\"0x480680017fff8000\",\"0x3a4e8ec16e258a799fe707996fd5d21d42b29adc1499a370edf7f809d8c458a\",\"0x400080007fd87fff\",\"0x400180017fd87ffb\",\"0x480080027fd88000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff67ffc\",\"0x480080017ff57ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027ff37ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff67ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017ff47ffd\",\"0x400080027ff37ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff47fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x402580017fce8001\",\"0x3\",\"0x482480017ff18000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080007fdd7fff\",\"0x400080017fdd7ffc\",\"0x400080027fdd7ffd\",\"0x400080037fdd7ffb\",\"0x400080047fdd7ff1\",\"0x480080067fdd8000\",\"0x20680017fff7fff\",\"0x65\",\"0x480080057fdc8000\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff78000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080077fd77fff\",\"0x400080087fd77ffc\",\"0x400080097fd77ffd\",\"0x4000800a7fd77ffe\",\"0x4000800b7fd77fec\",\"0x4800800d7fd78000\",\"0x20680017fff7fff\",\"0x4c\",\"0x4800800c7fd68000\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff47fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x19\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ff37fff8000\",\"0x402580017fc68000\",\"0xe\",\"0x1104800180018000\",\"0x42a\",\"0x20680017fff7ffb\",\"0x26\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x456d69744576656e74\",\"0x4002800080007fff\",\"0x4002800180007ffe\",\"0x4002800280007ffa\",\"0x4002800380007ffb\",\"0x4002800480007ffc\",\"0x4002800580007ffd\",\"0x4802800780008000\",\"0x20680017fff7fff\",\"0xf\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0x8\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0xa\",\"0x480680017fff8000\",\"0x1\",\"0x4802800880008000\",\"0x4802800980008000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x2b5c\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x4800800c7fd68000\",\"0x482480017fff8000\",\"0x4d58\",\"0x482480017fd48000\",\"0x10\",\"0x4800800e7fd38000\",\"0x4800800f7fd28000\",\"0x10780017fff7fff\",\"0xb\",\"0x40780017fff7fff\",\"0x6\",\"0x480080057fd68000\",\"0x482480017fff8000\",\"0x78dc\",\"0x482480017fd48000\",\"0x9\",\"0x480080077fd38000\",\"0x480080087fd28000\",\"0x48127ff27fff8000\",\"0x48127ffb7fff8000\",\"0x480a80017fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0xc6d\",\"0x482480017fff8000\",\"0xc6c\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xa8c0\",\"0x48127ff67fff8000\",\"0x48307ffe7ff68000\",\"0x10780017fff7fff\",\"0xf\",\"0x40780017fff7fff\",\"0x3\",\"0x1104800180018000\",\"0xc5f\",\"0x482480017fff8000\",\"0xc5e\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xa9ce\",\"0x482480017feb8000\",\"0x2\",\"0x48307ffe7ff28000\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x753235365f737562204f766572666c6f77\",\"0x400080007ffe7fff\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x48127fcd7fff8000\",\"0x48127fdd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0xc45\",\"0x482480017fff8000\",\"0xc44\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xadc0\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017feb8000\",\"0x3\",\"0x48307ffc7ff08000\",\"0x48127fee7fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x2b\",\"0x40780017fff7fff\",\"0xb\",\"0x480080047fec8000\",\"0x1104800180018000\",\"0xc2c\",\"0x482480017fff8000\",\"0xc2b\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xb4c8\",\"0x48127feb7fff8000\",\"0x48307ffe7ff88000\",\"0x482480017fe38000\",\"0x8\",\"0x480080067fe28000\",\"0x480080077fe18000\",\"0x10780017fff7fff\",\"0x2b\",\"0x40780017fff7fff\",\"0xb\",\"0x1104800180018000\",\"0xc1a\",\"0x482480017fff8000\",\"0xc19\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xdb4c\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fe08000\",\"0x3\",\"0x48307ffc7fe58000\",\"0x48127fe37fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x13\",\"0x40780017fff7fff\",\"0x16\",\"0x480080127fb78000\",\"0x1104800180018000\",\"0xc01\",\"0x482480017fff8000\",\"0xc00\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xe2b8\",\"0x48127fe07fff8000\",\"0x48307ffe7ff88000\",\"0x482480017fae8000\",\"0x16\",\"0x480080147fad8000\",\"0x480080157fac8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127fd87fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x4800800c7fdd8000\",\"0x1104800180018000\",\"0xbe9\",\"0x482480017fff8000\",\"0xbe8\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1159e\",\"0x48307fff7ff88000\",\"0x482480017fd48000\",\"0x10\",\"0x4800800e7fd38000\",\"0x4800800f7fd28000\",\"0x10780017fff7fff\",\"0x14\",\"0x40780017fff7fff\",\"0x7\",\"0x480080057fdd8000\",\"0x1104800180018000\",\"0xbd5\",\"0x482480017fff8000\",\"0xbd4\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x1417c\",\"0x48307fff7ff88000\",\"0x482480017fd48000\",\"0x9\",\"0x480080077fd38000\",\"0x480080087fd28000\",\"0x48127fe47fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ff97fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0xbbd\",\"0x482480017fff8000\",\"0xbbc\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x16d1e\",\"0x48127ff57fff8000\",\"0x48307ffe7ff58000\",\"0x10780017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x3\",\"0x1104800180018000\",\"0xbad\",\"0x482480017fff8000\",\"0xbac\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x16e2c\",\"0x482480017fea8000\",\"0x2\",\"0x48307ffe7ff18000\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x753235365f737562204f766572666c6f77\",\"0x400080007ffe7fff\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x480a7ff97fff8000\",\"0x48127fdb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0xb91\",\"0x482480017fff8000\",\"0xb90\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x17a16\",\"0x48127ff37fff8000\",\"0x48307ffe7ff38000\",\"0x480a7ff97fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x208b7fff7fff7ffe\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xa\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280007ffc8000\",\"0x10780017fff7fff\",\"0x8\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0xbb\",\"0x20680017fff7fff\",\"0x8a\",\"0x48307ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xa\",\"0x482480017ffb8000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480080007ff88000\",\"0x10780017fff7fff\",\"0x8\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x60\",\"0xa0680017fff8004\",\"0xe\",\"0x4824800180047ffe\",\"0x800000000000000000000000000000000000000000000000000000000000000\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8002\",\"0x480280007ffb7ffc\",\"0x480280017ffb7ffc\",\"0x402480017ffb7ffd\",\"0xffffffffffffffeeffffffffffffffff\",\"0x400280027ffb7ffd\",\"0x10780017fff7fff\",\"0x4c\",\"0x484480017fff8001\",\"0x8000000000000000000000000000000\",\"0x48307fff80007ffd\",\"0x480280007ffb7ffd\",\"0x480280017ffb7ffd\",\"0x402480017ffc7ffe\",\"0xf8000000000000000000000000000000\",\"0x400280027ffb7ffe\",\"0x482680017ffb8000\",\"0x3\",\"0x48127ff67fff8000\",\"0x48127ff67fff8000\",\"0x1104800180018000\",\"0x9ae\",\"0x20680017fff7ffa\",\"0x2a\",\"0x20680017fff7ffd\",\"0xb\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fd27fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x10780017fff7fff\",\"0xc\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffc\",\"0xc\",\"0x48127ff37fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x10780017fff7fff\",\"0x47\",\"0x40780017fff7fff\",\"0x4\",\"0x48127fef7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x10780017fff7fff\",\"0x1f\",\"0x40780017fff7fff\",\"0xd\",\"0x48127fec7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127fea7fff8000\",\"0x48127fea7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x2e\",\"0x482680017ffb8000\",\"0x3\",\"0x10780017fff7fff\",\"0x5\",\"0x40780017fff7fff\",\"0x34\",\"0x480a7ffb7fff8000\",\"0x48127fc77fff8000\",\"0x48127fc77fff8000\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x34\",\"0x4824800180007fcb\",\"0x1\",\"0x20680017fff7fff\",\"0x19\",\"0x480a7ffb7fff8000\",\"0x48127fc67fff8000\",\"0x48127fc67fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x7\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fbe7fff8000\",\"0x48127fbe7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x3c\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fbe7fff8000\",\"0x48127fbe7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x400380007ffd7ff6\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x1\",\"0x20780017fff7ff7\",\"0x21\",\"0x480680017fff8000\",\"0x0\",\"0x400080007ffe7fff\",\"0x400180017ffe7ff8\",\"0x48297ff980007ffa\",\"0x400080027ffd7fff\",\"0x480a7ff47fff8000\",\"0x480a7ff57fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x3\",\"0x1104800180018000\",\"0x3f3\",\"0x20680017fff7ffd\",\"0x8\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x10780017fff7fff\",\"0x13\",\"0x48127ffb7fff8000\",\"0x482480017ffb8000\",\"0x3e8\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x1\",\"0x400080007ffe7fff\",\"0x480a7ff47fff8000\",\"0x482680017ff58000\",\"0xa0a\",\"0x48127ffb7fff8000\",\"0x482480017ffb8000\",\"0x1\",\"0x20780017fff7ffb\",\"0x7\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017ffd8000\",\"0x64\",\"0x480680017fff8000\",\"0x1\",\"0x400080007ffd7fff\",\"0x48127ffa7fff8000\",\"0x48127ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0xa5c\",\"0x482480017fff8000\",\"0xa5b\",\"0x480080007fff8000\",\"0x480080037fff8000\",\"0x482480017fff8000\",\"0xc62\",\"0xa0680017fff8000\",\"0x8\",\"0x48317ffe80007ff6\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400280007ff57fff\",\"0x10780017fff7fff\",\"0x7f\",\"0x48317ffe80007ff6\",\"0x400280007ff57fff\",\"0x482680017ff58000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0x65\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x48127ffc7fff8000\",\"0x480280007ffc8000\",\"0x48307ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xb\",\"0x48127ffd7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff77fff8000\",\"0x10780017fff7fff\",\"0x9\",\"0x48127ffd7fff8000\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x38\",\"0x480080007fff8000\",\"0x48327ff87ff98000\",\"0x48327ffe7ffa8000\",\"0x400280007ff77ffe\",\"0x400280017ff77fff\",\"0x400380027ff77ffb\",\"0x48127ff87fff8000\",\"0x482680017ff78000\",\"0x6\",\"0x480280037ff78000\",\"0x480280047ff78000\",\"0x480280057ff78000\",\"0xa0680017fff8000\",\"0x9\",\"0x4824800180007ffa\",\"0x816\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400080007fe87fff\",\"0x10780017fff7fff\",\"0x12\",\"0x4824800180007ffa\",\"0x816\",\"0x400080007fe97fff\",\"0x482480017fe98000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x48127ff87fff8000\",\"0x480a7ff87fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127ff77fff8000\",\"0x48127feb7fff8000\",\"0x48127feb7fff8000\",\"0x1104800180018000\",\"0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffa9\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482480017fe68000\",\"0x1\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48327ff97ff98000\",\"0x482680017ffa8000\",\"0x1\",\"0x400280007ff77ffe\",\"0x400280017ff77fff\",\"0x400380027ff77ffb\",\"0x48127ff17fff8000\",\"0x482480017ff88000\",\"0x5be\",\"0x482680017ff78000\",\"0x6\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff67fff8000\",\"0x48127ff67fff8000\",\"0x480280037ff78000\",\"0x208b7fff7fff7ffe\",\"0x482680017ff98000\",\"0x1\",\"0x400280007ff77fff\",\"0x400380017ff77ffa\",\"0x400380027ff77ffb\",\"0x48127ffc7fff8000\",\"0x482480017ffc8000\",\"0xad2\",\"0x482680017ff78000\",\"0x6\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480280037ff78000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482680017ff58000\",\"0x1\",\"0x480a7ff67fff8000\",\"0x480a7ff77fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480a7ff27fff8000\",\"0x480a7ff37fff8000\",\"0x480a7ff77fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff67fff8000\",\"0x1104800180018000\",\"0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff15\",\"0x20680017fff7ffd\",\"0x72\",\"0x1104800180018000\",\"0x9ae\",\"0x482480017fff8000\",\"0x9ad\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x480a7ff57fff8000\",\"0x480080007ffc8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x1104800180018000\",\"0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff43\",\"0x20680017fff7ffc\",\"0x4f\",\"0x480680017fff8000\",\"0x1ac8d354f2e793629cb233a16f10d13cf15b9c45bbc620577c8e1df95ede545\",\"0x400280007ff47fff\",\"0x400280017ff47ffe\",\"0x480280027ff48000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027ff07ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff37ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017ff17ffd\",\"0x400080027ff07ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff17fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff48000\",\"0x3\",\"0x482480017fed8000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400280007ff67fff\",\"0x400280017ff67ffb\",\"0x400280027ff67ffc\",\"0x400280037ff67ffa\",\"0x400380047ff67ffd\",\"0x480280067ff68000\",\"0x20680017fff7fff\",\"0x10\",\"0x480280057ff68000\",\"0x48127ffc7fff8000\",\"0x48127ffe7fff8000\",\"0x48127ff97fff8000\",\"0x48127fe87fff8000\",\"0x482680017ff68000\",\"0x7\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x480280057ff68000\",\"0x48127ffc7fff8000\",\"0x48127ffe7fff8000\",\"0x48127ff97fff8000\",\"0x48127fe87fff8000\",\"0x482680017ff68000\",\"0x9\",\"0x480680017fff8000\",\"0x1\",\"0x480280077ff68000\",\"0x480280087ff68000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x94d\",\"0x482480017fff8000\",\"0x94c\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x2dbe\",\"0x48127ff37fff8000\",\"0x48307ffe7ff38000\",\"0x48127ff37fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x10780017fff7fff\",\"0xf\",\"0x1104800180018000\",\"0x93e\",\"0x482480017fff8000\",\"0x93d\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x3c78\",\"0x48127ff57fff8000\",\"0x48307ffe7ff58000\",\"0x480a7ff57fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ff47fff8000\",\"0x48127ffa7fff8000\",\"0x480a7ff67fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480a7ff27fff8000\",\"0x480a7ff37fff8000\",\"0x480a7ff77fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff67fff8000\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffe7e\",\"0x20680017fff7ffd\",\"0x72\",\"0x1104800180018000\",\"0x917\",\"0x482480017fff8000\",\"0x916\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x480a7ff57fff8000\",\"0x480080007ffc8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffeac\",\"0x20680017fff7ffc\",\"0x4f\",\"0x480680017fff8000\",\"0x2a31bbb25d4dfa03fe73a91cbbab880b7c9cc4461880193ae5819ca6bbfe7cc\",\"0x400280007ff47fff\",\"0x400280017ff47ffe\",\"0x480280027ff48000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027ff07ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff37ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017ff17ffd\",\"0x400080027ff07ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff17fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff48000\",\"0x3\",\"0x482480017fed8000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400280007ff67fff\",\"0x400280017ff67ffb\",\"0x400280027ff67ffc\",\"0x400280037ff67ffa\",\"0x400380047ff67ffd\",\"0x480280067ff68000\",\"0x20680017fff7fff\",\"0x10\",\"0x480280057ff68000\",\"0x48127ffc7fff8000\",\"0x48127ffe7fff8000\",\"0x48127ff97fff8000\",\"0x48127fe87fff8000\",\"0x482680017ff68000\",\"0x7\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x480280057ff68000\",\"0x48127ffc7fff8000\",\"0x48127ffe7fff8000\",\"0x48127ff97fff8000\",\"0x48127fe87fff8000\",\"0x482680017ff68000\",\"0x9\",\"0x480680017fff8000\",\"0x1\",\"0x480280077ff68000\",\"0x480280087ff68000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x8b6\",\"0x482480017fff8000\",\"0x8b5\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x2dbe\",\"0x48127ff37fff8000\",\"0x48307ffe7ff38000\",\"0x48127ff37fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x10780017fff7fff\",\"0xf\",\"0x1104800180018000\",\"0x8a7\",\"0x482480017fff8000\",\"0x8a6\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x3c78\",\"0x48127ff57fff8000\",\"0x48307ffe7ff58000\",\"0x480a7ff57fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ff47fff8000\",\"0x48127ffa7fff8000\",\"0x480a7ff67fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x6\",\"0x10b7ff37fff7fff\",\"0x10780017fff7fff\",\"0x11d\",\"0x10780017fff7fff\",\"0x10c\",\"0x10780017fff7fff\",\"0xfb\",\"0x10780017fff7fff\",\"0xea\",\"0x10780017fff7fff\",\"0xd8\",\"0x10780017fff7fff\",\"0xc6\",\"0x10780017fff7fff\",\"0xb4\",\"0x10780017fff7fff\",\"0xa4\",\"0x10780017fff7fff\",\"0x7a\",\"0x10780017fff7fff\",\"0x50\",\"0x10780017fff7fff\",\"0x26\",\"0x10780017fff7fff\",\"0x13\",\"0x480680017fff8000\",\"0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9\",\"0x400280007ffb7fff\",\"0x400380017ffb7ff6\",\"0x400380027ffb7ff7\",\"0x400380007ffd7ff8\",\"0x400380017ffd7ff9\",\"0x482680017ff28000\",\"0x141e\",\"0x480a7ffa7fff8000\",\"0x482680017ffb8000\",\"0x3\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x2\",\"0x10780017fff7fff\",\"0x103\",\"0x480680017fff8000\",\"0x134692b230b9e1ffa39098904722134159652b09c5bc41d88d6698779d228ff\",\"0x400280007ffb7fff\",\"0x400380017ffb7ff6\",\"0x400380027ffb7ff7\",\"0x400380007ffd7ff8\",\"0x400380017ffd7ff9\",\"0x482680017ff28000\",\"0x13ba\",\"0x480a7ffa7fff8000\",\"0x482680017ffb8000\",\"0x3\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x2\",\"0x10780017fff7fff\",\"0xf2\",\"0x480680017fff8000\",\"0x38a81c7fd04bac40e22e3eab2bcb3a09398bba67d0c5a263c6665c9c0b13a3\",\"0x400280007ffb7fff\",\"0x480a7ff17fff8000\",\"0x480a7ff27fff8000\",\"0x480a7ff47fff8000\",\"0x480a7ff57fff8000\",\"0x480a7ff67fff8000\",\"0x480a7ff77fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x400b7ffa7fff8004\",\"0x402780017ffb8005\",\"0x1\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffda6\",\"0x20680017fff7ffd\",\"0xb\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480a80047fff8000\",\"0x480a80057fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x7633a8d8b49c5c6002a1329e2c9791ea2ced86e06e01e17b5d0d1d5312c792\",\"0x400280007ffb7fff\",\"0x480a7ff17fff8000\",\"0x480a7ff27fff8000\",\"0x480a7ff47fff8000\",\"0x480a7ff57fff8000\",\"0x480a7ff67fff8000\",\"0x480a7ff77fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x400b7ffa7fff8002\",\"0x402780017ffb8003\",\"0x1\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffd7e\",\"0x20680017fff7ffd\",\"0xb\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480a80027fff8000\",\"0x480a80037fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x34bb683f971572e1b0f230f3dd40f3dbcee94e0b3e3261dd0a91229a1adc4b7\",\"0x400280007ffb7fff\",\"0x480a7ff17fff8000\",\"0x480a7ff27fff8000\",\"0x480a7ff47fff8000\",\"0x480a7ff57fff8000\",\"0x480a7ff67fff8000\",\"0x480a7ff77fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x400b7ffa7fff8000\",\"0x402780017ffb8001\",\"0x1\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffd56\",\"0x20680017fff7ffd\",\"0xb\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480a80007fff8000\",\"0x480a80017fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0xd1831486d8c46712712653f17d3414869aa50b4c16836d0b3d4afcfeafa024\",\"0x400280007ffb7fff\",\"0x400380007ffd7ff9\",\"0x482680017ff28000\",\"0x14e6\",\"0x480a7ffa7fff8000\",\"0x482680017ffb8000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x1\",\"0x10780017fff7fff\",\"0x6c\",\"0x480680017fff8000\",\"0x9d4a59b844ac9d98627ddba326ab3707a7d7e105fd03c777569d0f61a91f1e\",\"0x400280007ffb7fff\",\"0x400380007ffd7ff7\",\"0x400380017ffd7ff8\",\"0x400380027ffd7ff9\",\"0x482680017ff28000\",\"0x141e\",\"0x480a7ffa7fff8000\",\"0x482680017ffb8000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x3\",\"0x10780017fff7fff\",\"0x5c\",\"0x480680017fff8000\",\"0x2842fd3b01bb0858fef6a2da51cdd9f995c7d36d7625fb68dd5d69fcc0a6d76\",\"0x400280007ffb7fff\",\"0x400380007ffd7ff7\",\"0x400380017ffd7ff8\",\"0x400380027ffd7ff9\",\"0x482680017ff28000\",\"0x141e\",\"0x480a7ffa7fff8000\",\"0x482680017ffb8000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x3\",\"0x10780017fff7fff\",\"0x4c\",\"0x480680017fff8000\",\"0x2b23b0c08c7b22209aea4100552de1b7876a49f04ee5a4d94f83ad24bc4ec1c\",\"0x400280007ffb7fff\",\"0x400380007ffd7ff7\",\"0x400380017ffd7ff8\",\"0x400380027ffd7ff9\",\"0x482680017ff28000\",\"0x141e\",\"0x480a7ffa7fff8000\",\"0x482680017ffb8000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x3\",\"0x10780017fff7fff\",\"0x3c\",\"0x480680017fff8000\",\"0x3ae95723946e49d38f0cf844cef1fb25870e9a74999a4b96271625efa849b4c\",\"0x400280007ffb7fff\",\"0x400380007ffd7ff8\",\"0x400380017ffd7ff9\",\"0x482680017ff28000\",\"0x1482\",\"0x480a7ffa7fff8000\",\"0x482680017ffb8000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x2\",\"0x10780017fff7fff\",\"0x2d\",\"0x480680017fff8000\",\"0x2d8a82390cce552844e57407d23a1e48a38c4b979d525b1673171e503e116ab\",\"0x400280007ffb7fff\",\"0x400380007ffd7ff8\",\"0x400380017ffd7ff9\",\"0x482680017ff28000\",\"0x1482\",\"0x480a7ffa7fff8000\",\"0x482680017ffb8000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x2\",\"0x10780017fff7fff\",\"0x1e\",\"0x480680017fff8000\",\"0x2143175c365244751ccde24dd8f54f934672d6bc9110175c9e58e1e73705531\",\"0x400280007ffb7fff\",\"0x400380007ffd7ff8\",\"0x400380017ffd7ff9\",\"0x482680017ff28000\",\"0x1482\",\"0x480a7ffa7fff8000\",\"0x482680017ffb8000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x2\",\"0x10780017fff7fff\",\"0xf\",\"0x480680017fff8000\",\"0x25e2d538533284b9d61dfe45b9aaa563d33ef8374d9bb26d77a009b8e21f0de\",\"0x400280007ffb7fff\",\"0x400380007ffd7ff8\",\"0x400380017ffd7ff9\",\"0x482680017ff28000\",\"0x14e6\",\"0x480a7ffa7fff8000\",\"0x482680017ffb8000\",\"0x1\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x2\",\"0x480a7ff17fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480a7ff37fff8000\",\"0x480a7ff47fff8000\",\"0x480a7ff87fff8000\",\"0x480a7ff97fff8000\",\"0x480a7ffa7fff8000\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ff77fff8000\",\"0x48127ff67fff8000\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffcb1\",\"0x20680017fff7ffd\",\"0x9d\",\"0x1104800180018000\",\"0x74a\",\"0x482480017fff8000\",\"0x749\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x480a7ff67fff8000\",\"0x480080007ffc8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffcdf\",\"0x20680017fff7ffc\",\"0x7a\",\"0x480680017fff8000\",\"0x2a31bbb25d4dfa03fe73a91cbbab880b7c9cc4461880193ae5819ca6bbfe7cc\",\"0x400280007ff57fff\",\"0x400280017ff57ffe\",\"0x480280027ff58000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff37ffc\",\"0x480080017ff27ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027ff07ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff37ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017ff17ffd\",\"0x400080027ff07ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff17fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ff58000\",\"0x3\",\"0x482480017fed8000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ff77fff\",\"0x400280017ff77ffb\",\"0x400280027ff77ffc\",\"0x400280037ff77ffa\",\"0x480280057ff78000\",\"0x20680017fff7fff\",\"0x3b\",\"0x480280047ff78000\",\"0x480280067ff78000\",\"0x482680017ff78000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x12\",\"0x4824800180007ffc\",\"0x10000000000000000\",\"0x4844800180008002\",\"0x8000000000000110000000000000000\",\"0x4830800080017ffe\",\"0x480080007ff57fff\",\"0x482480017ffe8000\",\"0xefffffffffffffdeffffffffffffffff\",\"0x480080017ff37fff\",\"0x400080027ff27ffb\",\"0x402480017fff7ffb\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7fff\",\"0x15\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x482480017ffc8000\",\"0xffffffffffffffff0000000000000000\",\"0x400080017ff77fff\",\"0x482480017ff78000\",\"0x2\",\"0x482480017ffc8000\",\"0x3ca\",\"0x48127ff47fff8000\",\"0x48127fe37fff8000\",\"0x48127ff87fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff47fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7265553634202d206e6f6e20753634\",\"0x400080007ffe7fff\",\"0x482480017ff08000\",\"0x3\",\"0x48127ff57fff8000\",\"0x48127fed7fff8000\",\"0x48127fdc7fff8000\",\"0x48127ff17fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x482480017ff78000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480280047ff78000\",\"0x48127ffc7fff8000\",\"0x482480017ffe8000\",\"0x712\",\"0x48127ff97fff8000\",\"0x48127fe87fff8000\",\"0x482680017ff78000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ff78000\",\"0x480280077ff78000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x6be\",\"0x482480017fff8000\",\"0x6bd\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x346c\",\"0x48127ff37fff8000\",\"0x48307ffe7ff38000\",\"0x48127ff37fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x10780017fff7fff\",\"0xf\",\"0x1104800180018000\",\"0x6af\",\"0x482480017fff8000\",\"0x6ae\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x4326\",\"0x48127ff57fff8000\",\"0x48307ffe7ff58000\",\"0x480a7ff67fff8000\",\"0x48127ff57fff8000\",\"0x48127ff57fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480a7ff57fff8000\",\"0x48127ffa7fff8000\",\"0x480a7ff77fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff87fff8000\",\"0x48127ff87fff8000\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8000\",\"0x7\",\"0x482680017ff98000\",\"0xfffffffffffffffffffffffffffff916\",\"0x400280007ff87fff\",\"0x10780017fff7fff\",\"0x22\",\"0x4825800180007ff9\",\"0x6ea\",\"0x400280007ff87fff\",\"0x482680017ff88000\",\"0x1\",\"0x48127ffe7fff8000\",\"0x48297ffa80007ffb\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xf\",\"0x480280007ffa8000\",\"0x400280007ffd7fff\",\"0x48127ffc7fff8000\",\"0x48127ffc7fff8000\",\"0x482680017ffa8000\",\"0x1\",\"0x480a7ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x1\",\"0x1104800180018000\",\"0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffe5\",\"0x208b7fff7fff7ffe\",\"0x48127ffd7fff8000\",\"0x482480017ffd8000\",\"0x686\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x4f7574206f6620676173\",\"0x400080007ffe7fff\",\"0x482680017ff88000\",\"0x1\",\"0x480a7ff97fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffc7fff\",\"0x400380017ffc7ffa\",\"0x480280037ffc8000\",\"0x20680017fff7fff\",\"0x7a\",\"0x480280027ffc8000\",\"0x480280047ffc8000\",\"0x480680017fff8000\",\"0x52c476292b358ba7d29adb58502341b4cc5437d07f67d3e285e085828bc820\",\"0x400280007ffb7fff\",\"0x400380017ffb7ffd\",\"0x480280027ffb8000\",\"0x480080027ffd8000\",\"0x400280037ffb7ffe\",\"0x400280047ffb7fff\",\"0x480280057ffb8000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff97ffc\",\"0x480280017ff97ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff97ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff97ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff97ffd\",\"0x400280027ff97ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff37fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ffb8000\",\"0x6\",\"0x482680017ff98000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280057ffc7fff\",\"0x400280067ffc7ffb\",\"0x400280077ffc7ffc\",\"0x400280087ffc7ffa\",\"0x4802800a7ffc8000\",\"0x20680017fff7fff\",\"0x34\",\"0x480280097ffc8000\",\"0x4802800b7ffc8000\",\"0x482680017ffc8000\",\"0xc\",\"0x48127ffd7fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1\",\"0x48307ffe80007fff\",\"0x20680017fff7fff\",\"0x11\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x43414c4c45525f49535f4d495353494e475f524f4c45\",\"0x400080007ffe7fff\",\"0x48127ff37fff8000\",\"0x48127ff97fff8000\",\"0x48127ff07fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x2\",\"0x48127ff37fff8000\",\"0x482480017ff98000\",\"0xb4\",\"0x48127ff07fff8000\",\"0x48127ff57fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x9\",\"0x480280097ffc8000\",\"0x48127ff37fff8000\",\"0x482480017ffe8000\",\"0x456\",\"0x48127ff07fff8000\",\"0x482680017ffc8000\",\"0xd\",\"0x480680017fff8000\",\"0x1\",\"0x4802800b7ffc8000\",\"0x4802800c7ffc8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x15\",\"0x480280027ffc8000\",\"0x1104800180018000\",\"0x5e1\",\"0x482480017fff8000\",\"0x5e0\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0x3520\",\"0x480a7ff97fff8000\",\"0x48307ffe7ff78000\",\"0x480a7ffb7fff8000\",\"0x482680017ffc8000\",\"0x6\",\"0x480680017fff8000\",\"0x1\",\"0x480280047ffc8000\",\"0x480280057ffc8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x2\",\"0x480680017fff8000\",\"0x52c476292b358ba7d29adb58502341b4cc5437d07f67d3e285e085828bc820\",\"0x400280007ffa7fff\",\"0x400380017ffa7ffc\",\"0x480280027ffa8000\",\"0x400280037ffa7fff\",\"0x400380047ffa7ffd\",\"0x480280057ffa8000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff87ffc\",\"0x480280017ff87ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff87ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff87ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff87ffd\",\"0x400280027ff87ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ffa8000\",\"0x6\",\"0x482680017ff88000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffb7fff\",\"0x400380017ffb7ff9\",\"0x400280027ffb7ffc\",\"0x400280037ffb7ffb\",\"0x480280057ffb8000\",\"0x20680017fff7fff\",\"0xd0\",\"0x480280047ffb8000\",\"0x480280067ffb8000\",\"0x482680017ffb8000\",\"0x7\",\"0x48127ffd7fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1\",\"0x48307ffe80007fff\",\"0x20680017fff7fff\",\"0xa6\",\"0x480680017fff8000\",\"0x52c476292b358ba7d29adb58502341b4cc5437d07f67d3e285e085828bc820\",\"0x400080007ff37fff\",\"0x400180017ff37ffc\",\"0x480080027ff38000\",\"0x400080037ff27fff\",\"0x400180047ff27ffd\",\"0x480080057ff28000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007fee7ffc\",\"0x480080017fed7ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027feb7ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007fee7ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017fec7ffd\",\"0x400080027feb7ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1\",\"0x402580017fe78001\",\"0x6\",\"0x482480017fe88000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080007feb7fff\",\"0x400080017feb7ffb\",\"0x400080027feb7ffc\",\"0x400080037feb7ffa\",\"0x400080047feb7ffd\",\"0x480080067feb8000\",\"0x20680017fff7fff\",\"0x62\",\"0x480080057fea8000\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400080077fe77fff\",\"0x400080087fe77ffe\",\"0x4800800a7fe78000\",\"0x20680017fff7fff\",\"0x4d\",\"0x480080097fe68000\",\"0x4800800b7fe58000\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff57fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0xd\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480080027ff58000\",\"0x48127ff57fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ff37fff8000\",\"0x402580017fd58000\",\"0xc\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffc99\",\"0x20680017fff7ffb\",\"0x26\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x456d69744576656e74\",\"0x4002800080007fff\",\"0x4002800180007ffe\",\"0x4002800280007ffa\",\"0x4002800380007ffb\",\"0x4002800480007ffc\",\"0x4002800580007ffd\",\"0x4802800780008000\",\"0x20680017fff7fff\",\"0xf\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0x8\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0xa\",\"0x480680017fff8000\",\"0x1\",\"0x4802800880008000\",\"0x4802800980008000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x2b5c\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480080097fe68000\",\"0x48127ff87fff8000\",\"0x482480017ffe8000\",\"0x4fb0\",\"0x480a80017fff8000\",\"0x482480017fe28000\",\"0xd\",\"0x480680017fff8000\",\"0x1\",\"0x4800800b7fe08000\",\"0x4800800c7fdf8000\",\"0x208b7fff7fff7ffe\",\"0x480080057fea8000\",\"0x48127ffc7fff8000\",\"0x482480017ffe8000\",\"0x797c\",\"0x480a80017fff8000\",\"0x482480017fe68000\",\"0x9\",\"0x480680017fff8000\",\"0x1\",\"0x480080077fe48000\",\"0x480080087fe38000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x4de\",\"0x482480017fff8000\",\"0x4dd\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xaab4\",\"0x48127fee7fff8000\",\"0x48307ffe7ff48000\",\"0x48127feb7fff8000\",\"0x48127ff07fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x480280047ffb8000\",\"0x1104800180018000\",\"0x4c8\",\"0x482480017fff8000\",\"0x4c7\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xae9c\",\"0x48127ff57fff8000\",\"0x48307ffe7ff78000\",\"0x48127ff27fff8000\",\"0x482680017ffb8000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ffb8000\",\"0x480280077ffb8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x2\",\"0x480680017fff8000\",\"0x52c476292b358ba7d29adb58502341b4cc5437d07f67d3e285e085828bc820\",\"0x400280007ffa7fff\",\"0x400380017ffa7ffc\",\"0x480280027ffa8000\",\"0x400280037ffa7fff\",\"0x400380047ffa7ffd\",\"0x480280057ffa8000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff87ffc\",\"0x480280017ff87ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff87ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff87ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff87ffd\",\"0x400280027ff87ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ffa8000\",\"0x6\",\"0x482680017ff88000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffb7fff\",\"0x400380017ffb7ff9\",\"0x400280027ffb7ffc\",\"0x400280037ffb7ffb\",\"0x480280057ffb8000\",\"0x20680017fff7fff\",\"0xd0\",\"0x480280047ffb8000\",\"0x480280067ffb8000\",\"0x482680017ffb8000\",\"0x7\",\"0x48127ffd7fff8000\",\"0x20680017fff7ffd\",\"0x7\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x10780017fff7fff\",\"0x6\",\"0x482480017fff8000\",\"0x64\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x1\",\"0x48307ffe80007fff\",\"0x20680017fff7fff\",\"0x17\",\"0x1104800180018000\",\"0x469\",\"0x482480017fff8000\",\"0x468\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xaab4\",\"0x48127fee7fff8000\",\"0x48307ffe7ff48000\",\"0x48127feb7fff8000\",\"0x48127ff07fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x52c476292b358ba7d29adb58502341b4cc5437d07f67d3e285e085828bc820\",\"0x400080007ff37fff\",\"0x400180017ff37ffc\",\"0x480080027ff38000\",\"0x400080037ff27fff\",\"0x400180047ff27ffd\",\"0x480080057ff28000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007fee7ffc\",\"0x480080017fed7ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027feb7ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007fee7ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017fec7ffd\",\"0x400080027feb7ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x402580017fe78001\",\"0x6\",\"0x482480017fe88000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400080007feb7fff\",\"0x400080017feb7ffb\",\"0x400080027feb7ffc\",\"0x400080037feb7ffa\",\"0x400080047feb7ffd\",\"0x480080067feb8000\",\"0x20680017fff7fff\",\"0x62\",\"0x480080057fea8000\",\"0x48127fff7fff8000\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400080077fe77fff\",\"0x400080087fe77ffe\",\"0x4800800a7fe78000\",\"0x20680017fff7fff\",\"0x4d\",\"0x480080097fe68000\",\"0x4800800b7fe58000\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ff57fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0xb\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480080027ff58000\",\"0x48127ff57fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ff37fff8000\",\"0x402580017fd58000\",\"0xc\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffb6b\",\"0x20680017fff7ffb\",\"0x26\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x456d69744576656e74\",\"0x4002800080007fff\",\"0x4002800180007ffe\",\"0x4002800280007ffa\",\"0x4002800380007ffb\",\"0x4002800480007ffc\",\"0x4002800580007ffd\",\"0x4802800780008000\",\"0x20680017fff7fff\",\"0xf\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0x8\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0xa\",\"0x480680017fff8000\",\"0x1\",\"0x4802800880008000\",\"0x4802800980008000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x2b5c\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x480080097fe68000\",\"0x48127ff87fff8000\",\"0x482480017ffe8000\",\"0x4fb0\",\"0x480a80017fff8000\",\"0x482480017fe28000\",\"0xd\",\"0x480680017fff8000\",\"0x1\",\"0x4800800b7fe08000\",\"0x4800800c7fdf8000\",\"0x208b7fff7fff7ffe\",\"0x480080057fea8000\",\"0x48127ffc7fff8000\",\"0x482480017ffe8000\",\"0x797c\",\"0x480a80017fff8000\",\"0x482480017fe68000\",\"0x9\",\"0x480680017fff8000\",\"0x1\",\"0x480080077fe48000\",\"0x480080087fe38000\",\"0x208b7fff7fff7ffe\",\"0x480280047ffb8000\",\"0x1104800180018000\",\"0x3af\",\"0x482480017fff8000\",\"0x3ae\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xae9c\",\"0x48127ff57fff8000\",\"0x48307ffe7ff78000\",\"0x48127ff27fff8000\",\"0x482680017ffb8000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ffb8000\",\"0x480280077ffb8000\",\"0x208b7fff7fff7ffe\",\"0x480680017fff8000\",\"0x2e9f66c6eea14532c94ad25405a4fcb32faa4969559c128d837caa0ec50a655\",\"0x480680017fff8000\",\"0x3711c9d994faf6055172091cb841fd4831aa743e6f3315163b06a122c841846\",\"0x400280007ffb7ffe\",\"0x400280017ffb7fff\",\"0x480280027ffb8000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff97ffc\",\"0x480280017ff97ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff97ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff97ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff97ffd\",\"0x400280027ff97ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ffb8000\",\"0x3\",\"0x482680017ff98000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffc7fff\",\"0x400380017ffc7ffa\",\"0x400280027ffc7ffc\",\"0x400280037ffc7ffb\",\"0x480280057ffc8000\",\"0x20680017fff7fff\",\"0x86\",\"0x480280047ffc8000\",\"0x480280067ffc8000\",\"0x482680017ffc8000\",\"0x7\",\"0x48127ffd7fff8000\",\"0x20680017fff7ffd\",\"0x66\",\"0x48127fff7fff8000\",\"0x20780017fff7ffd\",\"0x1b\",\"0x1104800180018000\",\"0x35e\",\"0x482480017fff8000\",\"0x35d\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x8\",\"0x482480017fff8000\",\"0x258be\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x5a45524f5f50524f564953494f4e414c5f474f565f41444d494e\",\"0x400080007ffe7fff\",\"0x48127fef7fff8000\",\"0x48307ffc7ff58000\",\"0x48127fec7fff8000\",\"0x48127ff17fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x48127ff87fff8000\",\"0x48127ffe7fff8000\",\"0x48127ff57fff8000\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x3711c9d994faf6055172091cb841fd4831aa743e6f3315163b06a122c841846\",\"0x480a7ffd7fff8000\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffd72\",\"0x20680017fff7ffd\",\"0x2c\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x3711c9d994faf6055172091cb841fd4831aa743e6f3315163b06a122c841846\",\"0x480680017fff8000\",\"0x3711c9d994faf6055172091cb841fd4831aa743e6f3315163b06a122c841846\",\"0x1104800180018000\",\"0x261\",\"0x20680017fff7ffd\",\"0xd\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x480680017fff8000\",\"0x251e864ca2a080f55bce5da2452e8cfcafdbc951a3e7fff5023d558452ec228\",\"0x480680017fff8000\",\"0x3711c9d994faf6055172091cb841fd4831aa743e6f3315163b06a122c841846\",\"0x1104800180018000\",\"0x255\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x323\",\"0x482480017fff8000\",\"0x322\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x2\",\"0x482480017fff8000\",\"0xb496\",\"0x48127ff27fff8000\",\"0x48307ffe7ff28000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x310\",\"0x482480017fff8000\",\"0x30f\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x4\",\"0x482480017fff8000\",\"0x16f08\",\"0x48127ff27fff8000\",\"0x48307ffe7ff28000\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff27fff8000\",\"0x48127ff27fff8000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x2fd\",\"0x482480017fff8000\",\"0x2fc\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x8\",\"0x482480017fff8000\",\"0x25986\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x524f4c45535f414c52454144595f494e495449414c495a4544\",\"0x400080007ffe7fff\",\"0x48127ff07fff8000\",\"0x48307ffc7ff58000\",\"0x48127fed7fff8000\",\"0x48127ff27fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x480280047ffc8000\",\"0x1104800180018000\",\"0x2e3\",\"0x482480017fff8000\",\"0x2e2\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x484480017fff8000\",\"0x8\",\"0x482480017fff8000\",\"0x25c42\",\"0x48127ff57fff8000\",\"0x48307ffe7ff78000\",\"0x48127ff27fff8000\",\"0x482680017ffc8000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ffc8000\",\"0x480280077ffc8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x2\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x1bfc207425a47a5dfa1a50a4f5241203f50624ca5fdf5e18755765416b8e288\",\"0x400080007ffe7fff\",\"0x480680017fff8000\",\"0x544f4b454e5f4c4f434b5f414e445f44454c45474154494f4e\",\"0x400080017ffd7fff\",\"0x480680017fff8000\",\"0x312e302e30\",\"0x400080027ffc7fff\",\"0x48127ffc7fff8000\",\"0x482480017ffb8000\",\"0x3\",\"0x480680017fff8000\",\"0x476574457865637574696f6e496e666f\",\"0x400280007ffd7fff\",\"0x400380017ffd7ffb\",\"0x480280037ffd8000\",\"0x20680017fff7fff\",\"0x5c\",\"0x480280027ffd8000\",\"0x480280047ffd8000\",\"0x480080017fff8000\",\"0x480080067fff8000\",\"0x400080007ff97fff\",\"0x48127ff87fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x40327ffe80007fff\",\"0x480680017fff8000\",\"0x0\",\"0x402780017ffd8001\",\"0x5\",\"0x48127ff97fff8000\",\"0x4828800080017ffe\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400280007ffa7fff\",\"0x10780017fff7fff\",\"0x1b\",\"0x400280007ffa7fff\",\"0x1104800180018000\",\"0x2a1\",\"0x482480017fff8000\",\"0x2a0\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0xb9a\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x5265717569726573206174206c65617374206f6e6520656c656d656e74\",\"0x400080007ffe7fff\",\"0x482680017ffa8000\",\"0x1\",\"0x48307ffc7ff48000\",\"0x480a7ffc7fff8000\",\"0x480a80017fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x482680017ffa8000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x480a7ffc7fff8000\",\"0x48127ff67fff8000\",\"0x48127ff67fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffff09e\",\"0x20680017fff7ffc\",\"0x10\",\"0x400080007ffb7fff\",\"0x400180017ffb8000\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x190\",\"0x482480017ff98000\",\"0x3\",\"0x480a80017fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480080027ff58000\",\"0x208b7fff7fff7ffe\",\"0x1104800180018000\",\"0x26f\",\"0x482480017fff8000\",\"0x26e\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x0\",\"0x48127ff37fff8000\",\"0x48307ffe7ff38000\",\"0x48127ff37fff8000\",\"0x480a80017fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff37fff8000\",\"0x48127ff37fff8000\",\"0x208b7fff7fff7ffe\",\"0x480280027ffd8000\",\"0x1104800180018000\",\"0x25d\",\"0x482480017fff8000\",\"0x25c\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x120c\",\"0x480a7ffa7fff8000\",\"0x48307ffe7ff88000\",\"0x480a7ffc7fff8000\",\"0x482680017ffd8000\",\"0x6\",\"0x480680017fff8000\",\"0x1\",\"0x480280047ffd8000\",\"0x480280057ffd8000\",\"0x208b7fff7fff7ffe\",\"0xa0680017fff8005\",\"0xe\",\"0x4825800180057ffd\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ffa7ffc\",\"0x480280017ffa7ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ffa7ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x480a7ffd7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ffa7ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ffa7ffd\",\"0x400280027ffa7ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ffa8000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffc7fff\",\"0x400380017ffc7ffb\",\"0x400280027ffc7ffd\",\"0x400280037ffc7ffc\",\"0x480280057ffc8000\",\"0x20680017fff7fff\",\"0x87\",\"0x480280047ffc8000\",\"0x480280067ffc8000\",\"0x482680017ffc8000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x57\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x48127ffe7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x482480017ff48000\",\"0x1\",\"0x482480017ff58000\",\"0x1\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400080007ff87fff\",\"0x400080017ff87ffb\",\"0x400080027ff87ffc\",\"0x400080037ff87ffd\",\"0x480080057ff88000\",\"0x20680017fff7fff\",\"0x38\",\"0x480080047ff78000\",\"0x480080067ff68000\",\"0x482480017ff58000\",\"0x7\",\"0x48127ffd7fff8000\",\"0xa0680017fff8000\",\"0x16\",\"0x480080007ff88003\",\"0x480080017ff78003\",\"0x4844800180017ffe\",\"0x100000000000000000000000000000000\",\"0x483080017ffd7ff9\",\"0x482480017fff7ffd\",\"0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001\",\"0x20680017fff7ffc\",\"0x6\",\"0x402480017fff7ffd\",\"0xffffffffffffffffffffffffffffffff\",\"0x10780017fff7fff\",\"0x4\",\"0x402480017ffe7ffd\",\"0xf7ffffffffffffef0000000000000000\",\"0x400080027ff37ffd\",\"0x20680017fff7ffe\",\"0x11\",\"0x402780017fff7fff\",\"0x1\",\"0x400080007ff87ffc\",\"0x40780017fff7fff\",\"0xc\",\"0x482480017fec8000\",\"0x1\",\"0x482480017ff18000\",\"0x6b8\",\"0x48127fef7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fe17fff8000\",\"0x48127feb7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017ff18000\",\"0x3\",\"0x48127ff67fff8000\",\"0x48127ff47fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x10780017fff7fff\",\"0x1d\",\"0x40780017fff7fff\",\"0xb\",\"0x480080047fec8000\",\"0x48127ff17fff8000\",\"0x482480017ffe8000\",\"0x6a4\",\"0x482480017fe98000\",\"0x8\",\"0x480080067fe88000\",\"0x480080077fe78000\",\"0x10780017fff7fff\",\"0x23\",\"0x40780017fff7fff\",\"0xb\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x53746f726555313238202d206e6f6e2075313238\",\"0x400080007ffe7fff\",\"0x482480017fe68000\",\"0x3\",\"0x482480017feb8000\",\"0x2d8c\",\"0x48127fe97fff8000\",\"0x48127ffb7fff8000\",\"0x482480017ffa8000\",\"0x1\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x16\",\"0x480280047ffc8000\",\"0x48127fe67fff8000\",\"0x482480017ffe8000\",\"0x3494\",\"0x482680017ffc8000\",\"0x8\",\"0x480280067ffc8000\",\"0x480280077ffc8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x48127ffb7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ffa7fff8000\",\"0x208b7fff7fff7ffe\",\"0x48297ffc80007ffd\",\"0x20680017fff7fff\",\"0x4\",\"0x10780017fff7fff\",\"0xa\",\"0x482680017ffc8000\",\"0x1\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ffc7fff8000\",\"0x10780017fff7fff\",\"0x8\",\"0x480a7ffc7fff8000\",\"0x480a7ffd7fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x20680017fff7ffe\",\"0x98\",\"0x480080007fff8000\",\"0xa0680017fff8000\",\"0x12\",\"0x4824800180007ffe\",\"0x100000000\",\"0x4844800180008002\",\"0x8000000000000110000000000000000\",\"0x4830800080017ffe\",\"0x480280007ffb7fff\",\"0x482480017ffe8000\",\"0xefffffffffffffde00000000ffffffff\",\"0x480280017ffb7fff\",\"0x400280027ffb7ffb\",\"0x402480017fff7ffb\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7fff\",\"0x78\",\"0x402780017fff7fff\",\"0x1\",\"0x400280007ffb7ffe\",\"0x482480017ffe8000\",\"0xffffffffffffffffffffffff00000000\",\"0x400280017ffb7fff\",\"0x480680017fff8000\",\"0x0\",\"0x48307ff880007ff9\",\"0x48307ffb7ffe8000\",\"0xa0680017fff8000\",\"0x8\",\"0x482480017ffd8000\",\"0x1\",\"0x48307fff80007ffd\",\"0x400280027ffb7fff\",\"0x10780017fff7fff\",\"0x51\",\"0x48307ffe80007ffd\",\"0x400280027ffb7fff\",\"0x48307ff480007ff5\",\"0x48307ffa7ff38000\",\"0x48307ffb7ff28000\",\"0x48307ff580017ffd\",\"0xa0680017fff7fff\",\"0x7\",\"0x482480017fff8000\",\"0x100000000000000000000000000000000\",\"0x400280037ffb7fff\",\"0x10780017fff7fff\",\"0x2f\",\"0x400280037ffb7fff\",\"0x48307fef80007ff0\",\"0x48307ffe7ff28000\",\"0xa0680017fff8000\",\"0x8\",\"0x482480017ffd8000\",\"0x1\",\"0x48307fff80007ffd\",\"0x400280047ffb7fff\",\"0x10780017fff7fff\",\"0x11\",\"0x48307ffe80007ffd\",\"0x400280047ffb7fff\",\"0x40780017fff7fff\",\"0x3\",\"0x482680017ffb8000\",\"0x5\",\"0x480680017fff8000\",\"0x0\",\"0x48307fea7fe68000\",\"0x48307ff77fe58000\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff07fff8000\",\"0x48127ff07fff8000\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e646578206f7574206f6620626f756e6473\",\"0x400080007ffe7fff\",\"0x482680017ffb8000\",\"0x5\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x4\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x7533325f737562204f766572666c6f77\",\"0x400080007ffe7fff\",\"0x482680017ffb8000\",\"0x4\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x9\",\"0x40780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x496e646578206f7574206f6620626f756e6473\",\"0x400080007ffe7fff\",\"0x482680017ffb8000\",\"0x3\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x48127ff97fff8000\",\"0x482480017ff88000\",\"0x1\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0xc\",\"0x482680017ffb8000\",\"0x3\",\"0x480680017fff8000\",\"0x0\",\"0x48127fe67fff8000\",\"0x48127fe67fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x14\",\"0x480a7ffb7fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x48127fe67fff8000\",\"0x48127fe67fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x40780017fff7fff\",\"0x2\",\"0x480680017fff8000\",\"0x2e9f66c6eea14532c94ad25405a4fcb32faa4969559c128d837caa0ec50a655\",\"0x400280007ffa7fff\",\"0x400380017ffa7ffc\",\"0x480280027ffa8000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff87ffc\",\"0x480280017ff87ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400280027ff87ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480280007ff87ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480280017ff87ffd\",\"0x400280027ff87ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x480680017fff8000\",\"0x0\",\"0x482680017ffa8000\",\"0x3\",\"0x482680017ff88000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f7261676552656164\",\"0x400280007ffb7fff\",\"0x400380017ffb7ff9\",\"0x400280027ffb7ffc\",\"0x400280037ffb7ffb\",\"0x480280057ffb8000\",\"0x20680017fff7fff\",\"0x8d\",\"0x480280047ffb8000\",\"0x480680017fff8000\",\"0x2e9f66c6eea14532c94ad25405a4fcb32faa4969559c128d837caa0ec50a655\",\"0x400080007ffa7fff\",\"0x400180017ffa7ffc\",\"0x480080027ffa8000\",\"0xa0680017fff8005\",\"0xe\",\"0x4824800180057ffe\",\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\",\"0x484480017ffe8000\",\"0x110000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff67ffc\",\"0x480080017ff57ffc\",\"0x482480017ffb7ffd\",\"0xffffffffffffffeefffffffffffffeff\",\"0x400080027ff37ffc\",\"0x10780017fff7fff\",\"0x11\",\"0x48127ffe7fff8005\",\"0x484480017ffe8000\",\"0x8000000000000000000000000000000\",\"0x48307ffe7fff8003\",\"0x480080007ff67ffd\",\"0x482480017ffc7ffe\",\"0xf0000000000000000000000000000100\",\"0x480080017ff47ffd\",\"0x400080027ff37ff9\",\"0x402480017ffd7ff9\",\"0xffffffffffffffffffffffffffffffff\",\"0x20680017fff7ffd\",\"0x4\",\"0x402780017fff7fff\",\"0x1\",\"0x48127ff67fff8000\",\"0x480680017fff8000\",\"0x0\",\"0x480280067ffb8000\",\"0x402580017fef8001\",\"0x3\",\"0x482480017ff08000\",\"0x3\",\"0x480680017fff8000\",\"0x53746f726167655772697465\",\"0x400280077ffb7fff\",\"0x400280087ffb7ffb\",\"0x400280097ffb7ffc\",\"0x4002800a7ffb7ffa\",\"0x4003800b7ffb7ffd\",\"0x4802800d7ffb8000\",\"0x20680017fff7fff\",\"0x4c\",\"0x4802800c7ffb8000\",\"0x40780017fff7fff\",\"0x1\",\"0x40780017fff7fff\",\"0x1\",\"0x48127ffa7fff8000\",\"0x48127ffc7fff8000\",\"0x480680017fff8000\",\"0x9\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480a7ffc7fff8000\",\"0x48127ff27fff8000\",\"0x480a7ffd7fff8000\",\"0x48127ff57fff8000\",\"0x48127ff47fff8000\",\"0x48127ff47fff8000\",\"0x48127ff37fff8000\",\"0x402780017ffb8000\",\"0xe\",\"0x1104800180018000\",\"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffff7c2\",\"0x20680017fff7ffb\",\"0x26\",\"0x48127ffa7fff8000\",\"0x480680017fff8000\",\"0x456d69744576656e74\",\"0x4002800080007fff\",\"0x4002800180007ffe\",\"0x4002800280007ffa\",\"0x4002800380007ffb\",\"0x4002800480007ffc\",\"0x4002800580007ffd\",\"0x4802800780008000\",\"0x20680017fff7fff\",\"0xf\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0x8\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x480680017fff8000\",\"0x0\",\"0x208b7fff7fff7ffe\",\"0x4802800680008000\",\"0x48127ff57fff8000\",\"0x48127ffe7fff8000\",\"0x480a80017fff8000\",\"0x4826800180008000\",\"0xa\",\"0x480680017fff8000\",\"0x1\",\"0x4802800880008000\",\"0x4802800980008000\",\"0x208b7fff7fff7ffe\",\"0x48127ff97fff8000\",\"0x482480017ff98000\",\"0x2b5c\",\"0x480a80017fff8000\",\"0x480a80007fff8000\",\"0x480680017fff8000\",\"0x1\",\"0x48127ff97fff8000\",\"0x48127ff97fff8000\",\"0x208b7fff7fff7ffe\",\"0x4802800c7ffb8000\",\"0x48127ffc7fff8000\",\"0x482480017ffe8000\",\"0x4f4c\",\"0x480a80017fff8000\",\"0x482680017ffb8000\",\"0x10\",\"0x480680017fff8000\",\"0x1\",\"0x4802800e7ffb8000\",\"0x4802800f7ffb8000\",\"0x208b7fff7fff7ffe\",\"0x480280047ffb8000\",\"0x1104800180018000\",\"0x12\",\"0x482480017fff8000\",\"0x11\",\"0x480080007fff8000\",\"0x480080007fff8000\",\"0x482480017fff8000\",\"0x7fbc\",\"0x48127ff67fff8000\",\"0x48307ffe7ff88000\",\"0x48127ff37fff8000\",\"0x482680017ffb8000\",\"0x8\",\"0x480680017fff8000\",\"0x1\",\"0x480280067ffb8000\",\"0x480280077ffb8000\",\"0x208b7fff7fff7ffe\"],\"bytecode_segment_lengths\":[193,170,371,588,332,332,332,332,170,168,168,168,168,296,191,272,272,245,245,245,245,146,125,125,170,115,196,272,375,483,375,346,346,115,196,483,346,346,685,180,191,98,521,167,167,193,194,379,227,764,339,311,137,193,201,204,985,390,227,396,396,324,152,532,90,91,85,731,731,224,66,158,151,151,310,194,53,150,281,281,204,132,193,185,209],\"hints\":[[0,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[38,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[42,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[52,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[68,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[95,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[115,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[136,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[161,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[176,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[193,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[212,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[233,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x32d2\"},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[258,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-5}}}}]],[266,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[270,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[280,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[288,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[302,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[332,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[347,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[363,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[401,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[405,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[415,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[451,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[453,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[502,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[504,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[533,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[560,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[577,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-5}}}}]],[595,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[642,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[678,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[702,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[717,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[736,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x1cf2\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[774,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[778,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[788,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"FP\",\"offset\":2}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[824,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":3}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[828,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[838,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"FP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[874,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[876,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[925,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[927,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[988,[{\"TestLessThan\":{\"lhs\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"FP\",\"offset\":4},\"b\":{\"Immediate\":\"0x0\"}}},\"rhs\":{\"Immediate\":\"0x10000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[992,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"scalar\":{\"Immediate\":\"0x8000000000000110000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":0},\"y\":{\"register\":\"AP\",\"offset\":1}}}]],[1036,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1058,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1085,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1112,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1133,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1167,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1191,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1206,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1242,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1266,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1290,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1305,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1322,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1360,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[1364,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[1374,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[1410,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1412,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[1461,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1463,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[1492,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1519,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1541,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1562,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1598,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1622,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1637,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1654,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1692,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[1696,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[1706,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[1742,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1744,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[1793,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1795,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[1824,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1851,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1873,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1894,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1930,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1954,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1969,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[1986,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2024,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[2028,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[2038,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[2074,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2076,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[2125,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2127,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[2156,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2183,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2205,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2226,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2262,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2286,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2301,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2318,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2356,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[2360,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[2370,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[2406,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2408,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[2457,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2459,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[2488,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2515,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2537,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2558,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2594,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2618,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2633,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2650,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2669,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2690,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x3336\"},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2715,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-5}}}}]],[2723,[{\"TestLessThan\":{\"lhs\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"AP\",\"offset\":-3},\"b\":{\"Immediate\":\"0x0\"}}},\"rhs\":{\"Immediate\":\"0x10000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2727,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"scalar\":{\"Immediate\":\"0x8000000000000110000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":0},\"y\":{\"register\":\"AP\",\"offset\":1}}}]],[2745,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2759,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2789,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2804,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2820,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x23fa\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2848,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2874,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2900,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2925,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2942,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2970,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[2988,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x245e\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3016,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3044,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3070,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3093,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3110,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3138,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3156,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x245e\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3184,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3212,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3238,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3261,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3278,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3306,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3324,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x245e\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3352,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3380,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3406,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3429,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3446,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3474,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3492,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3540,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[3544,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[3554,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[3570,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3597,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3615,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[3619,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[3630,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[3657,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-5}}}}]],[3676,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3715,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3740,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3755,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3771,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3788,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3817,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3842,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3857,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[3861,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[3872,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[3899,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-5}}}}]],[3903,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3930,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3946,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3962,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[3979,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4017,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[4021,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[4031,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[4047,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4074,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4094,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[4098,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[4109,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[4136,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-5}}}}]],[4155,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4194,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4219,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4234,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4251,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4289,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[4293,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[4303,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[4319,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4346,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4366,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[4370,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[4381,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[4408,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-5}}}}]],[4427,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4466,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4491,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4506,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4523,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4561,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[4565,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[4575,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[4591,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4618,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4635,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-5}}}}]],[4664,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4711,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4736,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4751,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4768,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4806,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[4810,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[4820,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[4836,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4863,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4880,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-5}}}}]],[4909,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4956,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4981,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[4996,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5013,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5051,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[5055,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[5065,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[5081,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5108,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5125,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-5}}}}]],[5154,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5201,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5226,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5241,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5258,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5296,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[5300,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[5310,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[5326,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5353,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5370,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-5}}}}]],[5399,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5446,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5471,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5486,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5503,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5532,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5559,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5579,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5600,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5616,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5632,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5649,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5668,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5689,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x2af8\"},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5714,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-5}}}}]],[5718,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5743,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5758,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5774,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5793,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5814,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x2af8\"},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5839,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-5}}}}]],[5843,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5868,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5883,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5899,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5918,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5939,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x3336\"},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5964,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-5}}}}]],[5972,[{\"TestLessThan\":{\"lhs\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"AP\",\"offset\":-3},\"b\":{\"Immediate\":\"0x0\"}}},\"rhs\":{\"Immediate\":\"0x100\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[5976,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"scalar\":{\"Immediate\":\"0x8000000000000110000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":0},\"y\":{\"register\":\"AP\",\"offset\":1}}}]],[5994,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6008,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6038,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6053,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6069,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6088,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6109,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x6bc6\"},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6131,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6153,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6168,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6184,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6222,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[6226,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[6236,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[6252,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6277,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6299,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6323,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6348,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6363,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6380,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6418,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[6422,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[6432,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[6467,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[6471,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[6481,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[6497,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6524,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6547,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6571,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6596,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6620,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6635,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6652,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6690,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[6694,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[6704,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[6740,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6742,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[6791,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6793,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[6822,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6849,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6866,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-5}}}}]],[6884,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6935,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6971,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[6995,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[7010,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[7029,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x398\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[7067,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":3}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[7071,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[7081,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"FP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[7117,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[7121,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[7131,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"FP\",\"offset\":2}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[7167,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[7169,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[7218,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[7220,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[7249,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[7276,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[7293,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-5}}}}]],[7325,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[7394,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[7430,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[7454,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[7478,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[7493,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[7510,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[7548,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[7552,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[7562,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[7598,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[7600,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[7649,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[7651,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[7680,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[7707,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[7724,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-5}}}}]],[7742,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[7793,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[7829,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[7853,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[7868,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[7885,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[7923,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[7927,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[7937,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[7973,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[7975,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[8024,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8026,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[8055,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8082,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8104,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8139,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8175,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8199,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8214,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8231,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8269,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[8273,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[8283,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[8319,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8321,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[8370,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8372,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[8401,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8428,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8450,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8485,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8521,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8545,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8560,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8577,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8596,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8617,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x6bc6\"},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8639,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8661,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8676,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8692,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8730,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[8734,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[8744,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[8760,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8785,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8807,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8831,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8856,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8871,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8890,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x398\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[8928,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":3}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[8932,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[8942,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"FP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[8978,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[8982,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[8992,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"FP\",\"offset\":2}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[9028,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[9030,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[9079,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[9081,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[9110,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[9137,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[9154,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-5}}}}]],[9186,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[9255,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[9291,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[9315,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[9339,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[9354,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[9371,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[9409,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[9413,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[9423,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[9459,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[9461,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[9510,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[9512,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[9541,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[9568,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[9590,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[9625,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[9661,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[9685,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[9700,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[9717,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x0\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[9755,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[9759,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[9769,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[9805,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[9807,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[9856,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[9858,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[9887,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[9914,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[9936,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[9971,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[10007,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[10031,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[10046,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[10063,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x1e6e\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[10121,[{\"TestLessThan\":{\"lhs\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"AP\",\"offset\":-2},\"b\":{\"Immediate\":\"0x0\"}}},\"rhs\":{\"Immediate\":\"0x100\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[10125,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"scalar\":{\"Immediate\":\"0x8000000000000110000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":0},\"y\":{\"register\":\"AP\",\"offset\":1}}}]],[10171,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[10173,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[10222,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[10224,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[10274,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[10278,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[10288,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[10323,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[10327,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[10337,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[10372,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[10376,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[10386,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[10422,[{\"TestLessThan\":{\"lhs\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"AP\",\"offset\":-2},\"b\":{\"Immediate\":\"0x0\"}}},\"rhs\":{\"Immediate\":\"0x10000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[10426,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"scalar\":{\"Immediate\":\"0x8000000000000110000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":0},\"y\":{\"register\":\"AP\",\"offset\":1}}}]],[10452,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[10479,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[10507,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[10528,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[10553,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[10577,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[10601,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[10625,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[10660,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[10684,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[10699,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[10715,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[10731,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[10767,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-8}}}}]],[10775,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[10779,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[10789,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[10807,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[10835,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-14}}}}]],[10864,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[10882,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[10940,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-7}}}}]],[10948,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[10952,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[10962,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"FP\",\"offset\":0}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[10985,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[11012,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[11032,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-10}}}}]],[11079,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[11119,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0xa6e\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-8}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[11197,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[11223,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-11}}}}]],[11234,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x10000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[11255,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-9}}}}]],[11274,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[11290,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[11308,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[11342,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[11346,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[11357,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[11384,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":2}}}}]],[11433,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[11453,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[11457,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[11468,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[11498,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-24}}}}]],[11552,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[11701,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[11742,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}}}}]],[11763,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"FP\",\"offset\":-6},\"b\":{\"Immediate\":\"0x5\"}}}}}]],[11771,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[11775,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[11785,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[11819,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[11844,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[11909,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}}}}]],[11930,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"FP\",\"offset\":-6},\"b\":{\"Immediate\":\"0x5\"}}}}}]],[11938,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[11942,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[11952,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[11986,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[12011,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[12093,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[12097,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[12107,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[12265,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[12306,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[12310,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[12321,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[12348,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-9}}}}]],[12356,[{\"TestLessThan\":{\"lhs\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"AP\",\"offset\":-3},\"b\":{\"Immediate\":\"0x0\"}}},\"rhs\":{\"Immediate\":\"0x10000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[12360,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"scalar\":{\"Immediate\":\"0x8000000000000110000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":0},\"y\":{\"register\":\"AP\",\"offset\":1}}}]],[12391,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[12474,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-6}}}}]],[12494,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"AP\",\"offset\":-17},\"b\":{\"Immediate\":\"0x5\"}}}}}]],[12502,[{\"TestLessThan\":{\"lhs\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"AP\",\"offset\":-3},\"b\":{\"Immediate\":\"0x0\"}}},\"rhs\":{\"Immediate\":\"0x10000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[12506,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"scalar\":{\"Immediate\":\"0x8000000000000110000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":0},\"y\":{\"register\":\"AP\",\"offset\":1}}}]],[12525,[{\"TestLessThan\":{\"lhs\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"AP\",\"offset\":-11},\"b\":{\"Deref\":{\"register\":\"AP\",\"offset\":-6}}}},\"rhs\":{\"Immediate\":\"0x10000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[12540,[{\"TestLessThan\":{\"lhs\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"AP\",\"offset\":-3},\"b\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}}}},\"rhs\":{\"Immediate\":\"0x10000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[12589,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[12591,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[12620,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":0}}}}]],[12699,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[12726,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[12753,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[12925,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[12927,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[12956,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":0}}}}]],[13086,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-8}}}}]],[13115,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-8}}}}]],[13172,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[13190,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x10000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[13200,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x10000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[13208,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[13210,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[13240,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":4}}}}]],[13269,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-7}}}}]],[13273,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[13275,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[13311,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":3}}}}]],[13322,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[13348,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":0}}}}]],[13387,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[13432,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}}}}]],[13519,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[13655,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[13682,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[13771,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[13839,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[13843,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[13854,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[13880,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-12}}}}]],[13917,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[13937,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[13941,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[13952,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[13979,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-21}}}}]],[14005,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[14007,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[14035,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":0}}}}]],[14178,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[14182,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[14193,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[14219,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-12}}}}]],[14269,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[14273,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[14284,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[14311,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-20}}}}]],[14337,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[14339,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[14367,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":0}}}}]],[14493,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[14513,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-4}}}}]],[14528,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"FP\",\"offset\":-4},\"b\":{\"Immediate\":\"0x5\"}}}}}]],[14559,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[14616,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[14620,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[14631,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[14655,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-4}}}}]],[14663,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[14665,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[14699,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-8}}}}]],[14707,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[14709,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[14742,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[14770,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[14812,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[14816,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[14827,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[14853,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-5}}}}]],[14861,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[14863,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[14897,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-8}}}}]],[14905,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[14907,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[14941,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[14969,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[15016,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[15020,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[15031,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[15057,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}}}}]],[15065,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[15067,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[15101,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-8}}}}]],[15109,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[15111,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[15145,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[15173,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[15228,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[15256,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[15276,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[15280,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[15291,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[15318,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-7}}}}]],[15326,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[15328,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[15362,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-8}}}}]],[15370,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[15372,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[15395,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[15421,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[15443,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[15463,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[15467,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[15478,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[15506,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-36}}}}]],[15522,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"AP\",\"offset\":-42},\"b\":{\"Immediate\":\"0x7\"}}}}}]],[15531,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[15535,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[15546,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[15573,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"AP\",\"offset\":-58},\"b\":{\"Immediate\":\"0xe\"}}}}}]],[15581,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[15583,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[15617,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-8}}}}]],[15625,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[15627,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[15650,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[15676,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[15698,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[15718,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[15722,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[15733,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[15761,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-35}}}}]],[15777,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"AP\",\"offset\":-41},\"b\":{\"Immediate\":\"0x7\"}}}}}]],[15781,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[15783,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[15816,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":0}}}}]],[15905,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[15928,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[15971,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[16085,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[16110,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[16157,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[16207,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[16211,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[16222,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[16248,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-7}}}}]],[16256,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[16258,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[16292,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-8}}}}]],[16300,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[16302,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[16351,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[16377,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[16399,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[16454,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[16500,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[16547,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[16603,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[16631,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[16654,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[16658,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[16669,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[16697,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-7}}}}]],[16713,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"FP\",\"offset\":-7},\"b\":{\"Immediate\":\"0x7\"}}}}}]],[16717,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[16719,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[16752,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":0}}}}]],[16820,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}}}}]],[16834,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[16838,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[16849,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[16876,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"FP\",\"offset\":-6},\"b\":{\"Immediate\":\"0x5\"}}}}}]],[16884,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[16886,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[16920,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-8}}}}]],[16928,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[16930,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[16953,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[16979,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[17001,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[17077,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[17102,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[17149,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[17216,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-6}}}}]],[17230,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[17234,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[17245,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[17272,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"FP\",\"offset\":-6},\"b\":{\"Immediate\":\"0x5\"}}}}}]],[17280,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[17282,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[17316,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-8}}}}]],[17324,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[17326,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[17349,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[17375,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[17397,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[17473,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[17498,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[17545,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[17619,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-12}}}}]],[17635,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"FP\",\"offset\":-12},\"b\":{\"Immediate\":\"0x7\"}}}}}]],[17651,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"FP\",\"offset\":-12},\"b\":{\"Immediate\":\"0xe\"}}}}}]],[17680,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[17707,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-9}}}}]],[17733,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-8}}}}]],[17758,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-8}}}}]],[17936,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-3}}}}]],[17952,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[17956,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[17967,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[17994,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"FP\",\"offset\":-3},\"b\":{\"Immediate\":\"0x5\"}}}}}]],[18018,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[18092,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[18096,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[18107,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[18133,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-7}}}}]],[18141,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[18143,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[18177,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-8}}}}]],[18185,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[18187,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[18212,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[18240,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[18262,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[18279,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[18304,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[18316,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[18342,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[18364,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[18419,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[18502,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[18527,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[18574,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[18618,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[18634,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[18650,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[18714,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-7}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[18780,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[18797,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[18824,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-7}}}}]],[18848,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[18896,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[18922,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[18948,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[18970,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[18997,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-27}}}}]],[19015,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"AP\",\"offset\":-34},\"b\":{\"Immediate\":\"0x7\"}}}}}]],[19024,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[19028,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[19039,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[19066,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"AP\",\"offset\":-50},\"b\":{\"Immediate\":\"0xe\"}}}}}]],[19074,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[19076,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[19110,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-8}}}}]],[19118,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[19120,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[19143,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[19169,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[19191,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[19211,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[19215,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[19226,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[19254,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-35}}}}]],[19270,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"AP\",\"offset\":-41},\"b\":{\"Immediate\":\"0x7\"}}}}}]],[19274,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[19276,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[19310,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":0}}}}]],[19399,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[19422,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[19465,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[19579,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[19627,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[19653,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[19679,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[19701,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[19728,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-27}}}}]],[19746,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"AP\",\"offset\":-34},\"b\":{\"Immediate\":\"0x7\"}}}}}]],[19755,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[19759,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[19770,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[19797,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"AP\",\"offset\":-50},\"b\":{\"Immediate\":\"0xe\"}}}}}]],[19805,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[19807,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[19841,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-8}}}}]],[19849,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[19851,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[19874,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[19900,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[19922,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[19942,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[19946,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[19957,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[19985,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-35}}}}]],[20001,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"AP\",\"offset\":-41},\"b\":{\"Immediate\":\"0x7\"}}}}}]],[20005,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[20007,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[20041,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":0}}}}]],[20130,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[20153,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[20196,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[20310,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[20388,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x800000000000000000000000000000000000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":4}}}]],[20392,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":3}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[20402,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-1},\"y\":{\"register\":\"AP\",\"offset\":0}}}]],[20642,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-10}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[20700,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x816\"},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-5}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[20725,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[20775,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[20792,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[20833,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[20837,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[20848,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[20876,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-10}}}}]],[20943,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[20984,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[20988,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[20999,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[21027,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-10}}}}]],[21404,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[21445,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[21449,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[21460,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[21487,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-9}}}}]],[21495,[{\"TestLessThan\":{\"lhs\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"AP\",\"offset\":-3},\"b\":{\"Immediate\":\"0x0\"}}},\"rhs\":{\"Immediate\":\"0x10000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[21499,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"scalar\":{\"Immediate\":\"0x8000000000000110000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":0},\"y\":{\"register\":\"AP\",\"offset\":1}}}]],[21530,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[21598,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Immediate\":\"0x6ea\"},\"rhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-7}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[21637,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[21655,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-4}}}}]],[21669,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[21673,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[21684,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[21711,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"FP\",\"offset\":-4},\"b\":{\"Immediate\":\"0x5\"}}}}}]],[21735,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[21811,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[21815,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[21826,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[21852,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-5}}}}]],[21884,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[21888,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[21899,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[21929,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-21}}}}]],[21938,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"AP\",\"offset\":-25},\"b\":{\"Immediate\":\"0x7\"}}}}}]],[21943,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[21945,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[21979,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":0}}}}]],[22092,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[22096,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[22107,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[22133,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-5}}}}]],[22186,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[22190,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[22201,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[22231,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-21}}}}]],[22240,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"AP\",\"offset\":-25},\"b\":{\"Immediate\":\"0x7\"}}}}}]],[22245,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[22247,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[22281,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":0}}}}]],[22370,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[22374,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[22385,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[22411,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-4}}}}]],[22434,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[22531,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[22569,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[22587,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-3}}}}]],[22605,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[22621,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[22699,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"FP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[22703,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[22714,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[22738,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-4}}}}]],[22746,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[22748,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[22782,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"AP\",\"offset\":-8}}}}]],[22790,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-3}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[22792,[{\"DivMod\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-4}},\"rhs\":{\"Immediate\":\"0x100000000000000000000000000000000\"},\"quotient\":{\"register\":\"AP\",\"offset\":3},\"remainder\":{\"register\":\"AP\",\"offset\":4}}}]],[22825,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[22853,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[22914,[{\"TestLessThan\":{\"lhs\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"AP\",\"offset\":-1},\"b\":{\"Immediate\":\"0x0\"}}},\"rhs\":{\"Immediate\":\"0x100000000\"},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[22918,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"scalar\":{\"Immediate\":\"0x8000000000000110000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":0},\"y\":{\"register\":\"AP\",\"offset\":1}}}]],[22940,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[22954,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":0}},\"rhs\":{\"Immediate\":\"0x100000000\"},\"dst\":{\"register\":\"AP\",\"offset\":-1}}}]],[22964,[{\"TestLessThanOrEqual\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-2}},\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[22987,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[23008,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[23029,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[23084,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[23088,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[23099,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[23125,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":-5}}}}]],[23134,[{\"TestLessThan\":{\"lhs\":{\"Deref\":{\"register\":\"AP\",\"offset\":-1}},\"rhs\":{\"Immediate\":\"0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\"},\"dst\":{\"register\":\"AP\",\"offset\":5}}}]],[23138,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x110000000000000000\"},\"max_x\":{\"Immediate\":\"0xffffffffffffffffffffffffffffffff\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[23149,[{\"LinearSplit\":{\"value\":{\"Deref\":{\"register\":\"AP\",\"offset\":4}},\"scalar\":{\"Immediate\":\"0x8000000000000000000000000000000\"},\"max_x\":{\"Immediate\":\"0xfffffffffffffffffffffffffffffffe\"},\"x\":{\"register\":\"AP\",\"offset\":-2},\"y\":{\"register\":\"AP\",\"offset\":-1}}}]],[23178,[{\"SystemCall\":{\"system\":{\"BinOp\":{\"op\":\"Add\",\"a\":{\"register\":\"FP\",\"offset\":-5},\"b\":{\"Immediate\":\"0x7\"}}}}}]],[23182,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[23184,[{\"AllocSegment\":{\"dst\":{\"register\":\"AP\",\"offset\":0}}}]],[23218,[{\"SystemCall\":{\"system\":{\"Deref\":{\"register\":\"FP\",\"offset\":0}}}}]]],\"entry_points_by_type\":{\"EXTERNAL\":[{\"selector\":\"0xb2ef42a25c95687d1a3e7c2584885fd4058d102e05c44f65cf35988451bc8\",\"offset\":5258,\"builtins\":[\"pedersen\",\"range_check\"]},{\"selector\":\"0xc30ffbeb949d3447fd4acd61251803e8ab9c8a777318abb5bd5fbf28015eb\",\"offset\":3324,\"builtins\":[\"pedersen\",\"range_check\",\"poseidon\"]},{\"selector\":\"0x151e58b29179122a728eab07c8847e5baf5802379c5db3a7d57a8263a7bd1d\",\"offset\":1986,\"builtins\":[\"pedersen\",\"range_check\"]},{\"selector\":\"0x41b033f4a31df8067c24d1e9b550a2ce75fd4a29e1147af9752174f0e6cb20\",\"offset\":8888,\"builtins\":[\"pedersen\",\"range_check\"]},{\"selector\":\"0x4c4fb1ab068f6039d5780c68dd0fa2f8742cceb3426d19667778ca7f3518a9\",\"offset\":5899,\"builtins\":[\"range_check\"]},{\"selector\":\"0x80aa9fdbfaf9615e4afc7f5f722e265daca5ccc655360fa5ccacf9c267936d\",\"offset\":8577,\"builtins\":[\"range_check\"]},{\"selector\":\"0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e\",\"offset\":6652,\"builtins\":[\"pedersen\",\"range_check\"]},{\"selector\":\"0x95604234097c6fe6314943092b1aa8fb6ee781cf32ac6d5b78d856f52a540f\",\"offset\":5503,\"builtins\":[\"pedersen\",\"range_check\"]},{\"selector\":\"0xc357e0791efd20abc629024da92179b10fce7f1b3d10edc62ef40a57984697\",\"offset\":363,\"builtins\":[\"pedersen\",\"range_check\"]},{\"selector\":\"0xd4612fb377c4d51f0397aeb18757d3d580a7f22f58d516141cfcce5333b010\",\"offset\":193,\"builtins\":[\"range_check\"]},{\"selector\":\"0xd63a78e4cd7fb4c41bc18d089154af78d400a5e837f270baea6cf8db18c8dd\",\"offset\":2318,\"builtins\":[\"pedersen\",\"range_check\"]},{\"selector\":\"0x1557182e4359a1f0c6301278e8f5b35a776ab58d39892581e357578fb287836\",\"offset\":6069,\"builtins\":[\"range_check\"]},{\"selector\":\"0x16cc063b8338363cf388ce7fe1df408bf10f16cd51635d392e21d852fafb683\",\"offset\":9371,\"builtins\":[\"pedersen\",\"range_check\"]},{\"selector\":\"0x183420eb7aafd9caad318b543d9252c94857340f4768ac83cf4b6472f0bf515\",\"offset\":4523,\"builtins\":[\"pedersen\",\"range_check\"]},{\"selector\":\"0x1aaf3e6107dd1349c81543ff4221a326814f77dadcc5810807b74f1a49ded4e\",\"offset\":9717,\"builtins\":[\"pedersen\",\"range_check\"]},{\"selector\":\"0x1c67057e2995950900dbf33db0f5fc9904f5a18aae4a3768f721c43efe5d288\",\"offset\":1322,\"builtins\":[\"pedersen\",\"range_check\"]},{\"selector\":\"0x1d13ab0a76d7407b1d5faccd4b3d8a9efe42f3d3c21766431d4fafb30f45bd4\",\"offset\":7885,\"builtins\":[\"pedersen\",\"range_check\"]},{\"selector\":\"0x1e888a1026b19c8c0b57c72d63ed1737106aa10034105b980ba117bd0c29fe1\",\"offset\":6380,\"builtins\":[\"pedersen\",\"range_check\"]},{\"selector\":\"0x1fa400a40ac35b4aa2c5383c3bb89afee2a9698b86ebb405cf25a6e63428605\",\"offset\":2820,\"builtins\":[\"pedersen\",\"range_check\",\"poseidon\"]},{\"selector\":\"0x216b05c387bab9ac31918a3e61672f4618601f3c598a2f3f2710f37053e1ea4\",\"offset\":5774,\"builtins\":[\"range_check\"]},{\"selector\":\"0x219209e083275171774dab1df80982e9df2096516f06319c5c6d71ae0a8480c\",\"offset\":7510,\"builtins\":[\"pedersen\",\"range_check\"]},{\"selector\":\"0x225faa998b63ad3d277e950e8091f07d28a4c45ef6de7f3f7095e89be92d701\",\"offset\":4768,\"builtins\":[\"pedersen\",\"range_check\"]},{\"selector\":\"0x24643b0aa4f24549ae7cd884195db7950c3a79a96cb7f37bde40549723559d9\",\"offset\":5013,\"builtins\":[\"pedersen\",\"range_check\"]},{\"selector\":\"0x25a5317fee78a3601253266ed250be22974a6b6eb116c875a2596585df6a400\",\"offset\":3979,\"builtins\":[\"pedersen\",\"range_check\"]},{\"selector\":\"0x2842cf0fb9cd347687a6bfcf564c97b007cc28c3e25566d4b71c8935857767d\",\"offset\":734,\"builtins\":[\"pedersen\",\"range_check\"]},{\"selector\":\"0x284a2f635301a0bf3a171bb8e4292667c6c70d23d48b0ae8ec4df336e84bccd\",\"offset\":2650,\"builtins\":[\"range_check\"]},{\"selector\":\"0x2e4263afad30923c891518314c3c95dbe830a16874e8abc5777a9a20b54c76e\",\"offset\":8692,\"builtins\":[\"pedersen\",\"range_check\"]},{\"selector\":\"0x302e0454f48778e0ca3a2e714a289c4e8d8e03d614b370130abb1a524a47f22\",\"offset\":3788,\"builtins\":[\"pedersen\",\"range_check\"]},{\"selector\":\"0x30559321b47d576b645ed7bd24089943dd5fd3a359ecdd6fa8f05c1bab67d6b\",\"offset\":3492,\"builtins\":[\"pedersen\",\"range_check\"]},{\"selector\":\"0x338dd2002b6f7ac6471742691de72611381e3fc4ce2b0361c29d42cb2d53a90\",\"offset\":3156,\"builtins\":[\"pedersen\",\"range_check\",\"poseidon\"]},{\"selector\":\"0x33fe3600cdfaa48261a8c268c66363562da383d5dd26837ba63b66ebbc04e3c\",\"offset\":2988,\"builtins\":[\"pedersen\",\"range_check\",\"poseidon\"]},{\"selector\":\"0x35a73cd311a05d46deda634c5ee045db92f811b4e74bca4437fcb5302b7af33\",\"offset\":6184,\"builtins\":[\"pedersen\",\"range_check\"]},{\"selector\":\"0x35ba35ba82b63d56c50ba3393af144616a46a2d2a79d13a5db1635a3386bd48\",\"offset\":0,\"builtins\":[\"pedersen\",\"range_check\"]},{\"selector\":\"0x361458367e696363fbcc70777d07ebbd2394e89fd0adcaf147faccd1d294d60\",\"offset\":5649,\"builtins\":[\"range_check\"]},{\"selector\":\"0x3704ffe8fba161be0e994951751a5033b1462b918ff785c0a636be718dfdb68\",\"offset\":7027,\"builtins\":[\"pedersen\",\"range_check\"]},{\"selector\":\"0x37791de85f8a3be5014988a652f6cf025858f3532706c18f8cf24f2f81800d5\",\"offset\":4251,\"builtins\":[\"pedersen\",\"range_check\"]},{\"selector\":\"0x3a07502a2e0e18ad6178ca530615148b9892d000199dbb29e402c41913c3d1a\",\"offset\":1654,\"builtins\":[\"pedersen\",\"range_check\"]},{\"selector\":\"0x3b076186c19fe96221e4dfacd40c519f612eae02e0555e4e115a2a6cf2f1c1f\",\"offset\":8231,\"builtins\":[\"pedersen\",\"range_check\"]}],\"L1_HANDLER\":[],\"CONSTRUCTOR\":[{\"selector\":\"0x28ffe4ff0f226a9107253e17a904099aa4f63a02a5621de0576e5aa71bc5194\",\"offset\":10063,\"builtins\":[\"pedersen\",\"range_check\"]}]}}"
  },
  {
    "path": "crates/cheatnet/src/forking/cache.rs",
    "content": "use anyhow::{Context, Result};\nuse camino::{Utf8Path, Utf8PathBuf};\nuse fs2::FileExt;\nuse regex::Regex;\nuse runtime::starknet::context::SerializableBlockInfo;\nuse serde::{Deserialize, Serialize};\nuse starknet_api::block::{BlockInfo, BlockNumber};\nuse starknet_api::core::{ClassHash, ContractAddress, Nonce};\nuse starknet_api::state::StorageKey;\nuse starknet_rust::core::types::ContractClass;\nuse starknet_types_core::felt::Felt;\nuse std::collections::HashMap;\nuse std::fs;\nuse std::fs::{File, OpenOptions};\nuse std::io::{Read, Seek, Write};\nuse std::string::ToString;\nuse url::Url;\n\n#[must_use]\npub fn cache_version() -> String {\n    env!(\"CARGO_PKG_VERSION\").replace('.', \"_\")\n}\n\n#[derive(Serialize, Deserialize, Debug)]\npub struct ForkCacheContent {\n    cache_version: String,\n    storage_at: HashMap<ContractAddress, HashMap<StorageKey, Felt>>,\n    nonce_at: HashMap<ContractAddress, Nonce>,\n    class_hash_at: HashMap<ContractAddress, ClassHash>,\n    compiled_contract_class: HashMap<ClassHash, ContractClass>,\n    block_info: Option<SerializableBlockInfo>,\n}\n\nimpl Default for ForkCacheContent {\n    fn default() -> Self {\n        Self {\n            cache_version: cache_version(),\n            storage_at: HashMap::default(),\n            nonce_at: HashMap::default(),\n            class_hash_at: HashMap::default(),\n            compiled_contract_class: HashMap::default(),\n            block_info: Option::default(),\n        }\n    }\n}\n\nimpl ForkCacheContent {\n    fn from_str(serialized: &str) -> Self {\n        let cache: Self =\n            serde_json::from_str(serialized).expect(\"Could not deserialize cache from json\");\n\n        assert_eq!(\n            cache.cache_version,\n            cache_version(),\n            \"Expected the Version {}\",\n            cache_version()\n        );\n\n        cache\n    }\n\n    fn extend(&mut self, other: &Self) {\n        // storage_at\n        for (other_contract_address, other_storage) in &other.storage_at {\n            if let Some(self_contract_storage) = self.storage_at.get_mut(other_contract_address) {\n                self_contract_storage.extend(other_storage.clone());\n            } else {\n                self.storage_at\n                    .insert(*other_contract_address, other_storage.clone());\n            }\n        }\n\n        self.nonce_at.extend(other.nonce_at.clone());\n        self.class_hash_at.extend(other.class_hash_at.clone());\n        self.compiled_contract_class\n            .extend(other.compiled_contract_class.clone());\n        if other.block_info.is_some() {\n            self.block_info.clone_from(&other.block_info);\n        }\n    }\n\n    fn compiled_contract_class_map(&self) -> &HashMap<ClassHash, ContractClass> {\n        &self.compiled_contract_class\n    }\n}\n\n#[expect(clippy::to_string_trait_impl)]\nimpl ToString for ForkCacheContent {\n    fn to_string(&self) -> String {\n        serde_json::to_string(self).expect(\"Could not serialize json cache\")\n    }\n}\n\n#[derive(Debug)]\npub struct ForkCache {\n    fork_cache_content: ForkCacheContent,\n    cache_file: Utf8PathBuf,\n}\n\nimpl Drop for ForkCache {\n    fn drop(&mut self) {\n        self.save();\n    }\n}\n\ntrait FileTruncateExtension {\n    fn clear(&mut self) -> Result<()>;\n}\n\nimpl FileTruncateExtension for File {\n    fn clear(&mut self) -> Result<()> {\n        self.set_len(0).context(\"Failed to truncate file\")?;\n        self.rewind().context(\"Failed to rewind file\")?;\n        Ok(())\n    }\n}\n\nimpl ForkCache {\n    pub(crate) fn load_or_new(\n        url: &Url,\n        block_number: BlockNumber,\n        cache_dir: &Utf8Path,\n    ) -> Result<Self> {\n        let cache_file = cache_file_path_from_fork_config(url, block_number, cache_dir)?;\n        let mut file = OpenOptions::new()\n            .write(true)\n            .read(true)\n            .create(true)\n            .truncate(false)\n            .open(&cache_file)\n            .context(\"Could not open cache file\")?;\n\n        let mut cache_file_content = String::new();\n        file.read_to_string(&mut cache_file_content)\n            .context(\"Could not read cache file\")?;\n\n        // File was just created\n        let fork_cache_content = if cache_file_content.is_empty() {\n            ForkCacheContent::default()\n        } else {\n            ForkCacheContent::from_str(cache_file_content.as_str())\n        };\n\n        Ok(ForkCache {\n            fork_cache_content,\n            cache_file,\n        })\n    }\n\n    fn save(&self) {\n        let mut file = OpenOptions::new()\n            .write(true)\n            .read(true)\n            .create(true)\n            .truncate(false)\n            .open(&self.cache_file)\n            .unwrap();\n\n        file.lock_exclusive().expect(\"Could not lock on cache file\");\n\n        let mut cache_file_content = String::new();\n        file.read_to_string(&mut cache_file_content)\n            .expect(\"Should have been able to read the cache\");\n\n        let output = if cache_file_content.is_empty() {\n            self.fork_cache_content.to_string()\n        } else {\n            let mut fs_fork_cache_content = ForkCacheContent::from_str(&cache_file_content);\n            fs_fork_cache_content.extend(&self.fork_cache_content);\n            fs_fork_cache_content.to_string()\n        };\n\n        file.clear().expect(\"Failed to clear file\");\n        file.write_all(output.as_bytes())\n            .expect(\"Could not write cache to file\");\n\n        fs2::FileExt::unlock(&file).unwrap();\n    }\n\n    pub(crate) fn get_storage_at(\n        &self,\n        contract_address: &ContractAddress,\n        key: &StorageKey,\n    ) -> Option<Felt> {\n        self.fork_cache_content\n            .storage_at\n            .get(contract_address)?\n            .get(key)\n            .copied()\n    }\n\n    pub(crate) fn cache_get_storage_at(\n        &mut self,\n        contract_address: ContractAddress,\n        key: StorageKey,\n        value: Felt,\n    ) {\n        self.fork_cache_content\n            .storage_at\n            .entry(contract_address)\n            .or_default()\n            .insert(key, value);\n    }\n\n    pub(crate) fn get_nonce_at(&self, address: &ContractAddress) -> Option<Nonce> {\n        self.fork_cache_content.nonce_at.get(address).copied()\n    }\n\n    pub(crate) fn cache_get_nonce_at(&mut self, contract_address: ContractAddress, nonce: Nonce) {\n        self.fork_cache_content\n            .nonce_at\n            .insert(contract_address, nonce);\n    }\n\n    #[must_use]\n    pub fn get_class_hash_at(&self, contract_address: &ContractAddress) -> Option<ClassHash> {\n        self.fork_cache_content\n            .class_hash_at\n            .get(contract_address)\n            .copied()\n    }\n\n    #[must_use]\n    pub fn compiled_contract_class_map(&self) -> &HashMap<ClassHash, ContractClass> {\n        self.fork_cache_content.compiled_contract_class_map()\n    }\n\n    pub(crate) fn cache_get_class_hash_at(\n        &mut self,\n        contract_address: ContractAddress,\n        class_hash: ClassHash,\n    ) {\n        self.fork_cache_content\n            .class_hash_at\n            .insert(contract_address, class_hash);\n    }\n\n    pub(crate) fn get_compiled_contract_class(\n        &self,\n        class_hash: &ClassHash,\n    ) -> Option<&ContractClass> {\n        self.fork_cache_content\n            .compiled_contract_class\n            .get(class_hash)\n    }\n\n    pub(crate) fn insert_compiled_contract_class(\n        &mut self,\n        class_hash: ClassHash,\n        contract_class: ContractClass,\n    ) -> &ContractClass {\n        self.fork_cache_content\n            .compiled_contract_class\n            .entry(class_hash)\n            .or_insert(contract_class)\n    }\n\n    pub(crate) fn get_block_info(&self) -> Option<BlockInfo> {\n        Some(self.fork_cache_content.block_info.clone()?.into())\n    }\n\n    pub(crate) fn cache_get_block_info(&mut self, block_info: BlockInfo) {\n        self.fork_cache_content.block_info = Some(block_info.into());\n    }\n}\n\nfn cache_file_path_from_fork_config(\n    url: &Url,\n    BlockNumber(block_number): BlockNumber,\n    cache_dir: &Utf8Path,\n) -> Result<Utf8PathBuf> {\n    let re = Regex::new(r\"[^a-zA-Z0-9]\").unwrap();\n\n    // replace non-alphanumeric characters with underscores\n    let sanitized_path = re.replace_all(url.as_str(), \"_\");\n\n    let cache_file_path = cache_dir.join(format!(\n        \"{sanitized_path}_{block_number}_v{}.json\",\n        cache_version()\n    ));\n\n    fs::create_dir_all(cache_file_path.parent().unwrap())\n        .context(\"Fork cache directory could not be created\")?;\n\n    Ok(cache_file_path)\n}\n"
  },
  {
    "path": "crates/cheatnet/src/forking/data.rs",
    "content": "use crate::runtime_extensions::forge_runtime_extension::contracts_data::build_name_selector_map;\nuse starknet_api::core::{ClassHash, EntryPointSelector};\nuse starknet_rust::core::types::ContractClass;\nuse starknet_rust::core::types::contract::AbiEntry;\nuse std::collections::HashMap;\n\n#[derive(Default)]\npub struct ForkData {\n    pub abi: HashMap<ClassHash, Vec<AbiEntry>>,\n    pub selectors: HashMap<EntryPointSelector, String>,\n}\n\nimpl ForkData {\n    /// Creates a new instance of [`ForkData`] from a given `fork_compiled_contract_class`.\n    #[must_use]\n    pub fn new(fork_compiled_contract_class: &HashMap<ClassHash, ContractClass>) -> Self {\n        let abi: HashMap<ClassHash, Vec<AbiEntry>> = fork_compiled_contract_class\n            .iter()\n            .filter_map(|(class_hash, contract_class)| {\n                let ContractClass::Sierra(sierra_class) = contract_class else {\n                    return None;\n                };\n\n                let abi = serde_json::from_str::<Vec<AbiEntry>>(&sierra_class.abi)\n                    .expect(\"this should be valid ABI\");\n\n                Some((*class_hash, abi))\n            })\n            .collect();\n\n        let selectors = abi\n            .values()\n            .flat_map(|abi| build_name_selector_map(abi.clone()))\n            .collect();\n\n        Self { abi, selectors }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/forking/mod.rs",
    "content": "pub mod cache;\npub mod data;\npub mod state;\n"
  },
  {
    "path": "crates/cheatnet/src/forking/state.rs",
    "content": "use crate::forking::cache::ForkCache;\nuse crate::state::BlockInfoReader;\nuse crate::sync_client::SyncClient;\nuse anyhow::{Context, Result};\nuse blockifier::execution::contract_class::{\n    CompiledClassV0, CompiledClassV0Inner, CompiledClassV1, RunnableCompiledClass,\n};\nuse blockifier::state::errors::StateError::{self, StateReadError, UndeclaredClassHash};\nuse blockifier::state::state_api::{StateReader, StateResult};\nuse cairo_lang_utils::bigint::BigUintAsHex;\nuse cairo_vm::types::program::Program;\nuse camino::Utf8Path;\nuse conversions::{FromConv, IntoConv};\nuse flate2::read::GzDecoder;\nuse num_bigint::BigUint;\nuse runtime::starknet::context::SerializableGasPrices;\nuse starknet_api::block::{BlockInfo, BlockNumber, BlockTimestamp, StarknetVersion};\nuse starknet_api::contract_class::SierraVersion;\nuse starknet_api::core::{ChainId, ClassHash, CompiledClassHash, ContractAddress, Nonce};\nuse starknet_api::state::StorageKey;\nuse starknet_rust::core::types::{\n    ContractClass as ContractClassStarknet, MaybePreConfirmedBlockWithTxHashes, StarknetError,\n};\nuse starknet_rust::core::utils::parse_cairo_short_string;\nuse starknet_rust::providers::ProviderError;\nuse starknet_types_core::felt::Felt;\nuse std::cell::{Ref, RefCell};\nuse std::collections::HashMap;\nuse std::io::Read;\nuse std::sync::Arc;\nuse universal_sierra_compiler_api::compile_contract_sierra;\nuse url::Url;\n\n#[derive(Debug)]\npub struct ForkStateReader {\n    client: SyncClient,\n    cache: RefCell<ForkCache>,\n}\n\nimpl ForkStateReader {\n    pub fn new(url: Url, block_number: BlockNumber, cache_dir: &Utf8Path) -> Result<Self> {\n        Ok(ForkStateReader {\n            cache: RefCell::new(\n                ForkCache::load_or_new(&url, block_number, cache_dir)\n                    .context(\"Could not create fork cache\")?,\n            ),\n            client: SyncClient::new(url, block_number),\n        })\n    }\n\n    pub fn chain_id(&self) -> Result<ChainId> {\n        let id = self.client.chain_id()?;\n        let id = parse_cairo_short_string(&id)?;\n        Ok(ChainId::from(id))\n    }\n\n    pub fn compiled_contract_class_map(\n        &self,\n    ) -> Ref<'_, HashMap<ClassHash, ContractClassStarknet>> {\n        Ref::map(self.cache.borrow(), |cache| {\n            cache.compiled_contract_class_map()\n        })\n    }\n}\n\n#[expect(clippy::needless_pass_by_value)]\nfn other_provider_error<T>(boxed: impl ToString) -> Result<T, StateError> {\n    let err_str = boxed.to_string();\n\n    Err(StateReadError(\n        if err_str.contains(\"error sending request\") {\n            \"Unable to reach the node. Check your internet connection and node url\".to_string()\n        } else {\n            format!(\"JsonRpc provider error: {err_str}\")\n        },\n    ))\n}\n\nimpl BlockInfoReader for ForkStateReader {\n    fn get_block_info(&mut self) -> StateResult<BlockInfo> {\n        if let Some(cache_hit) = self.cache.borrow().get_block_info() {\n            return Ok(cache_hit);\n        }\n\n        match self.client.get_block_with_tx_hashes() {\n            Ok(MaybePreConfirmedBlockWithTxHashes::Block(block)) => {\n                let block_info = BlockInfo {\n                    block_number: BlockNumber(block.block_number),\n                    sequencer_address: block.sequencer_address.into_(),\n                    block_timestamp: BlockTimestamp(block.timestamp),\n                    gas_prices: SerializableGasPrices::default().into(),\n                    use_kzg_da: true,\n                    starknet_version: block\n                        .starknet_version\n                        .try_into()\n                        .unwrap_or(StarknetVersion::LATEST),\n                };\n\n                self.cache\n                    .borrow_mut()\n                    .cache_get_block_info(block_info.clone());\n\n                Ok(block_info)\n            }\n            Ok(MaybePreConfirmedBlockWithTxHashes::PreConfirmedBlock(_)) => {\n                unreachable!(\"Preconfirmed block is not be allowed at the configuration level\")\n            }\n            Err(ProviderError::Other(boxed)) => other_provider_error(boxed),\n            Err(err) => Err(StateReadError(format!(\n                \"Unable to get block with tx hashes from fork ({err})\"\n            ))),\n        }\n    }\n}\n\nimpl StateReader for ForkStateReader {\n    fn get_storage_at(\n        &self,\n        contract_address: ContractAddress,\n        key: StorageKey,\n    ) -> StateResult<Felt> {\n        if let Some(cache_hit) = self.cache.borrow().get_storage_at(&contract_address, &key) {\n            return Ok(cache_hit);\n        }\n\n        match self\n            .client\n            .get_storage_at(Felt::from_(contract_address), Felt::from_(*key.0.key()))\n        {\n            Ok(value) => {\n                let value_sf = value.into_();\n                self.cache\n                    .borrow_mut()\n                    .cache_get_storage_at(contract_address, key, value_sf);\n                Ok(value_sf)\n            }\n            Err(ProviderError::Other(boxed)) => other_provider_error(boxed),\n            Err(ProviderError::StarknetError(StarknetError::ContractNotFound)) => {\n                self.cache.borrow_mut().cache_get_storage_at(\n                    contract_address,\n                    key,\n                    Felt::default(),\n                );\n                Ok(Felt::default())\n            }\n            Err(x) => Err(StateReadError(format!(\n                \"Unable to get storage at address: {contract_address:?} and key: {key:?} from fork ({x})\"\n            ))),\n        }\n    }\n\n    fn get_nonce_at(&self, contract_address: ContractAddress) -> StateResult<Nonce> {\n        if let Some(cache_hit) = self.cache.borrow().get_nonce_at(&contract_address) {\n            return Ok(cache_hit);\n        }\n\n        match self.client.get_nonce(Felt::from_(contract_address)) {\n            Ok(nonce) => {\n                let nonce = nonce.into_();\n                self.cache\n                    .borrow_mut()\n                    .cache_get_nonce_at(contract_address, nonce);\n                Ok(nonce)\n            }\n            Err(ProviderError::Other(boxed)) => other_provider_error(boxed),\n            Err(ProviderError::StarknetError(StarknetError::ContractNotFound)) => {\n                self.cache\n                    .borrow_mut()\n                    .cache_get_nonce_at(contract_address, Nonce::default());\n                Ok(Nonce::default())\n            }\n            Err(x) => Err(StateReadError(format!(\n                \"Unable to get nonce at {contract_address:?} from fork ({x})\"\n            ))),\n        }\n    }\n\n    fn get_class_hash_at(&self, contract_address: ContractAddress) -> StateResult<ClassHash> {\n        if let Some(cache_hit) = self.cache.borrow().get_class_hash_at(&contract_address) {\n            return Ok(cache_hit);\n        }\n\n        match self.client.get_class_hash_at(Felt::from_(contract_address)) {\n            Ok(class_hash) => {\n                let class_hash = class_hash.into_();\n                self.cache\n                    .borrow_mut()\n                    .cache_get_class_hash_at(contract_address, class_hash);\n                Ok(class_hash)\n            }\n            Err(ProviderError::StarknetError(StarknetError::ContractNotFound)) => {\n                self.cache\n                    .borrow_mut()\n                    .cache_get_class_hash_at(contract_address, ClassHash::default());\n                Ok(ClassHash::default())\n            }\n            Err(ProviderError::Other(boxed)) => other_provider_error(boxed),\n            Err(x) => Err(StateReadError(format!(\n                \"Unable to get class hash at {contract_address:?} from fork ({x})\"\n            ))),\n        }\n    }\n\n    fn get_compiled_class(&self, class_hash: ClassHash) -> StateResult<RunnableCompiledClass> {\n        let mut cache = self.cache.borrow_mut();\n\n        let contract_class = {\n            if let Some(cache_hit) = cache.get_compiled_contract_class(&class_hash) {\n                Ok(cache_hit)\n            } else {\n                match self.client.get_class(Felt::from_(class_hash)) {\n                    Ok(contract_class) => {\n                        Ok(cache.insert_compiled_contract_class(class_hash, contract_class))\n                    }\n                    Err(ProviderError::StarknetError(StarknetError::ClassHashNotFound)) => {\n                        Err(UndeclaredClassHash(class_hash))\n                    }\n                    Err(ProviderError::Other(boxed)) => other_provider_error(boxed),\n                    Err(x) => Err(StateReadError(format!(\n                        \"Unable to get compiled class at {class_hash} from fork ({x})\"\n                    ))),\n                }\n            }\n        };\n\n        match contract_class? {\n            ContractClassStarknet::Sierra(flattened_class) => {\n                let converted_sierra_program: Vec<BigUintAsHex> = flattened_class\n                    .sierra_program\n                    .iter()\n                    .map(|field_element| BigUintAsHex {\n                        value: BigUint::from_bytes_be(&field_element.to_bytes_be()),\n                    })\n                    .collect();\n\n                let sierra_contract_class = serde_json::json!({\n                    \"sierra_program\": converted_sierra_program,\n                    \"contract_class_version\": \"\",\n                    \"entry_points_by_type\": flattened_class.entry_points_by_type\n                });\n\n                let sierra_version =\n                    SierraVersion::extract_from_program(&flattened_class.sierra_program)\n                        .expect(\"Unable to extract Sierra version from Sierra program\");\n\n                match compile_contract_sierra(&sierra_contract_class) {\n                    Ok(casm_contract_class_raw) => Ok(RunnableCompiledClass::V1(\n                        CompiledClassV1::try_from((casm_contract_class_raw, sierra_version))\n                            .expect(\"Unable to create RunnableCompiledClass::V1\"),\n                    )),\n                    Err(err) => Err(StateReadError(err.to_string())),\n                }\n            }\n            ContractClassStarknet::Legacy(legacy_class) => {\n                let converted_entry_points = serde_json::from_str(\n                    &serde_json::to_string(&legacy_class.entry_points_by_type).unwrap(),\n                )\n                .unwrap();\n\n                let mut decoder = GzDecoder::new(&legacy_class.program[..]);\n                let mut converted_program = String::new();\n                decoder.read_to_string(&mut converted_program).unwrap();\n\n                Ok(RunnableCompiledClass::V0(CompiledClassV0(Arc::new(\n                    CompiledClassV0Inner {\n                        program: Program::from_bytes(converted_program.as_ref(), None)\n                            .expect(\"Unable to load program from converted_program\"),\n                        entry_points_by_type: converted_entry_points,\n                    },\n                ))))\n            }\n        }\n    }\n\n    fn get_compiled_class_hash(&self, _class_hash: ClassHash) -> StateResult<CompiledClassHash> {\n        Err(StateReadError(\n            \"Unable to get compiled class hash from the fork\".to_string(),\n        ))\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/lib.rs",
    "content": "use state::CheatnetState;\n\npub mod constants;\npub mod forking;\npub mod predeployment;\n#[expect(clippy::result_large_err)]\npub mod runtime_extensions;\npub mod state;\npub mod sync_client;\npub mod trace_data;\n"
  },
  {
    "path": "crates/cheatnet/src/predeployment/erc20/constructor_data.rs",
    "content": "use starknet_api::core::ContractAddress;\n\npub struct ERC20ConstructorData {\n    pub name: String,\n    pub symbol: String,\n    pub decimals: u8,\n    pub total_supply: (u128, u128), // (low, high)\n    pub permitted_minter: ContractAddress,\n    pub upgrade_delay: u64,\n}\n"
  },
  {
    "path": "crates/cheatnet/src/predeployment/erc20/eth.rs",
    "content": "use conversions::string::TryFromHexStr;\nuse starknet_api::core::ContractAddress;\n\nuse crate::predeployment::predeployed_contract::PredeployedContract;\n\nuse super::constructor_data::ERC20ConstructorData;\n\npub const ETH_CONTRACT_ADDRESS: &str =\n    \"0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7\";\n\n#[must_use]\npub fn eth_predeployed_contract() -> PredeployedContract {\n    // Compiled with starknet-compile, compiler version: 2.10.0\n    // Fetched with `starknet_getCompiledCasm`\n    let raw_casm = include_str!(\"../../data/eth_erc20_casm.json\");\n\n    let contract_address = ContractAddress::try_from_hex_str(ETH_CONTRACT_ADDRESS).unwrap();\n    let class_hash = TryFromHexStr::try_from_hex_str(\n        \"0x076791ef97c042f81fbf352ad95f39a22554ee8d7927b2ce3c681f3418b5206a\",\n    )\n    .unwrap();\n\n    // All storage values are taken from https://voyager.online/contract/0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d#readStorage\n    // Block 747469\n    let total_supply_low: u128 = 15_000_000_000_000_000_000_000;\n    let permitted_minter = ContractAddress::try_from_hex_str(\n        \"0x4c5772d1914fe6ce891b64eb35bf3522aeae1315647314aac58b01137607f3f\",\n    )\n    .unwrap();\n\n    let constructor_data = ERC20ConstructorData {\n        name: \"ETH\".to_string(),\n        symbol: \"ETH\".to_string(),\n        decimals: 18,\n        total_supply: (total_supply_low, 0),\n        permitted_minter,\n        upgrade_delay: 0,\n    };\n\n    PredeployedContract::erc20(contract_address, class_hash, raw_casm, constructor_data)\n}\n"
  },
  {
    "path": "crates/cheatnet/src/predeployment/erc20/mod.rs",
    "content": "pub mod constructor_data;\npub mod eth;\npub mod predeployed_contract;\npub mod strk;\n"
  },
  {
    "path": "crates/cheatnet/src/predeployment/erc20/predeployed_contract.rs",
    "content": "use crate::{\n    predeployment::predeployed_contract::PredeployedContract,\n    runtime_extensions::forge_runtime_extension::cheatcodes::{\n        generate_random_felt::generate_random_felt,\n        storage::{map_entry_address, storage_key, variable_address},\n    },\n};\nuse conversions::felt::FromShortString;\nuse starknet_api::{\n    core::{ClassHash, ContractAddress},\n    state::StorageKey,\n};\nuse starknet_types_core::felt::Felt;\n\nuse super::constructor_data::ERC20ConstructorData;\n\nimpl PredeployedContract {\n    #[must_use]\n    pub fn erc20(\n        contract_address: ContractAddress,\n        class_hash: ClassHash,\n        raw_casm: &str,\n        constructor_data: ERC20ConstructorData,\n    ) -> Self {\n        let ERC20ConstructorData {\n            name,\n            symbol,\n            decimals,\n            total_supply: (total_supply_low, total_supply_high),\n            permitted_minter,\n            upgrade_delay,\n        } = constructor_data;\n\n        let recipient = generate_random_felt();\n        let recipient_balance_low_address = map_entry_address(\"ERC20_balances\", &[recipient]);\n        let recipient_balance_high_address =\n            StorageKey(recipient_balance_low_address.try_into().unwrap())\n                .next_storage_key()\n                .unwrap();\n\n        let storage_kv_updates = [\n            // name\n            (\n                storage_key(variable_address(\"ERC20_name\")).unwrap(),\n                Felt::from_short_string(&name).unwrap(),\n            ),\n            // symbol\n            (\n                storage_key(variable_address(\"ERC20_symbol\")).unwrap(),\n                Felt::from_short_string(&symbol).unwrap(),\n            ),\n            // decimals\n            (\n                storage_key(variable_address(\"ERC20_decimals\")).unwrap(),\n                Felt::from(decimals),\n            ),\n            // total_supply low\n            (\n                storage_key(variable_address(\"ERC20_total_supply\")).unwrap(),\n                Felt::from(total_supply_low),\n            ),\n            // total_supply high\n            (\n                storage_key(variable_address(\"ERC20_total_supply\"))\n                    .unwrap()\n                    .next_storage_key()\n                    .unwrap(),\n                Felt::from(total_supply_high),\n            ),\n            // recipient balance low\n            (\n                storage_key(recipient_balance_low_address).unwrap(),\n                Felt::from(total_supply_low),\n            ),\n            // recipient balance high\n            (\n                storage_key(**recipient_balance_high_address).unwrap(),\n                Felt::from(total_supply_high),\n            ),\n            // permitted_minter\n            (\n                storage_key(variable_address(\"permitted_minter\")).unwrap(),\n                **permitted_minter,\n            ),\n            // upgrade_delay\n            (\n                storage_key(variable_address(\"upgrade_delay\")).unwrap(),\n                Felt::from(upgrade_delay),\n            ),\n        ]\n        .to_vec();\n\n        Self::new(contract_address, class_hash, raw_casm, storage_kv_updates)\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/predeployment/erc20/strk.rs",
    "content": "use conversions::string::TryFromHexStr;\nuse starknet_api::core::ContractAddress;\n\nuse crate::predeployment::predeployed_contract::PredeployedContract;\n\nuse super::constructor_data::ERC20ConstructorData;\n\npub const STRK_CONTRACT_ADDRESS: &str =\n    \"0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d\";\n\n#[must_use]\npub fn strk_predeployed_contract() -> PredeployedContract {\n    // Compiled with starknet-compile, compiler version: 2.10.0\n    // See: https://github.com/starknet-io/starkgate-contracts/blob/c787ec8e727c45499700d01e4eacd4cbc23a36ea/src/cairo/strk/erc20_lockable.cairo\n    let raw_casm = include_str!(\"../../data/strk_erc20_casm.json\");\n\n    let contract_address = ContractAddress::try_from_hex_str(STRK_CONTRACT_ADDRESS).unwrap();\n    let class_hash = TryFromHexStr::try_from_hex_str(\n        \"0x04ad3c1dc8413453db314497945b6903e1c766495a1e60492d44da9c2a986e4b\",\n    )\n    .unwrap();\n\n    // All storage values are taken from https://voyager.online/contract/0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d#readStorage\n    // Block 747469\n    let total_supply_low: u128 = 60_000_000_000_000_000_000_000_000;\n    let permitted_minter = ContractAddress::try_from_hex_str(\n        \"0x594c1582459ea03f77deaf9eb7e3917d6994a03c13405ba42867f83d85f085d\",\n    )\n    .unwrap();\n\n    let constructor_data = ERC20ConstructorData {\n        name: \"STRK\".to_string(),\n        symbol: \"STRK\".to_string(),\n        decimals: 18,\n        total_supply: (total_supply_low, 0),\n        permitted_minter,\n        upgrade_delay: 0,\n    };\n\n    PredeployedContract::erc20(contract_address, class_hash, raw_casm, constructor_data)\n}\n"
  },
  {
    "path": "crates/cheatnet/src/predeployment/mod.rs",
    "content": "pub mod erc20;\npub mod predeployed_contract;\n"
  },
  {
    "path": "crates/cheatnet/src/predeployment/predeployed_contract.rs",
    "content": "use crate::constants::contract_class;\nuse starknet_api::{\n    contract_class::{ContractClass, SierraVersion},\n    core::{ClassHash, ContractAddress},\n    state::StorageKey,\n};\nuse starknet_types_core::felt::Felt;\n\npub struct PredeployedContract {\n    pub contract_address: ContractAddress,\n    pub class_hash: ClassHash,\n    pub contract_class: ContractClass,\n    pub storage_kv_updates: Vec<(StorageKey, Felt)>,\n}\n\nimpl PredeployedContract {\n    #[must_use]\n    pub fn new(\n        contract_address: ContractAddress,\n        class_hash: ClassHash,\n        raw_casm: &str,\n        storage_kv_updates: Vec<(StorageKey, Felt)>,\n    ) -> Self {\n        let contract_class = contract_class(raw_casm, SierraVersion::LATEST);\n        Self {\n            contract_address,\n            class_hash,\n            contract_class,\n            storage_kv_updates,\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/call_to_blockifier_runtime_extension/execution/cairo1_execution.rs",
    "content": "use crate::runtime_extensions::call_to_blockifier_runtime_extension::CheatnetState;\nuse crate::runtime_extensions::call_to_blockifier_runtime_extension::execution::entry_point::{\n    CallInfoWithExecutionData, ContractClassEntryPointExecutionResult,\n    extract_trace_and_register_errors,\n};\nuse crate::runtime_extensions::cheatable_starknet_runtime_extension::CheatableStarknetRuntimeExtension;\nuse crate::runtime_extensions::common::get_relocated_vm_trace;\nuse blockifier::execution::contract_class::{CompiledClassV1, TrackedResource};\nuse blockifier::execution::entry_point::ExecutableCallEntryPoint;\nuse blockifier::execution::entry_point_execution::{\n    ExecutionRunnerMode, VmExecutionContext, finalize_execution,\n    initialize_execution_context_with_runner_mode, prepare_call_arguments,\n};\nuse blockifier::execution::syscalls::vm_syscall_utils::SyscallUsageMap;\nuse blockifier::{\n    execution::{\n        contract_class::EntryPointV1, entry_point::EntryPointExecutionContext,\n        errors::EntryPointExecutionError, execution_utils::Args,\n    },\n    state::state_api::State,\n};\nuse cairo_vm::vm::errors::cairo_run_errors::CairoRunError;\nuse cairo_vm::{\n    hint_processor::hint_processor_definition::HintProcessor,\n    vm::runners::cairo_runner::{CairoArg, CairoRunner},\n};\nuse runtime::{ExtendedRuntime, StarknetRuntime};\n\n// blockifier/src/execution/cairo1_execution.rs:48 (execute_entry_point_call)\npub(crate) fn execute_entry_point_call_cairo1(\n    call: ExecutableCallEntryPoint,\n    compiled_class_v1: &CompiledClassV1,\n    state: &mut dyn State,\n    cheatnet_state: &mut CheatnetState, // Added parameter\n    context: &mut EntryPointExecutionContext,\n) -> ContractClassEntryPointExecutionResult {\n    let tracked_resource = *context\n        .tracked_resource_stack\n        .last()\n        .expect(\"Unexpected empty tracked resource.\");\n    let entry_point_initial_budget = context.gas_costs().base.entry_point_initial_budget;\n\n    let class_hash = call.class_hash;\n\n    let VmExecutionContext {\n        mut runner,\n        mut syscall_handler,\n        initial_syscall_ptr,\n        entry_point,\n        program_extra_data_length,\n    } = initialize_execution_context_with_runner_mode(\n        call,\n        compiled_class_v1,\n        state,\n        context,\n        ExecutionRunnerMode::Tracing,\n    )?;\n\n    let args = prepare_call_arguments(\n        &syscall_handler.base.call,\n        &mut runner,\n        initial_syscall_ptr,\n        &mut syscall_handler.read_only_segments,\n        &entry_point,\n        entry_point_initial_budget,\n    )?;\n    let n_total_args = args.len();\n\n    // region: Modified blockifier code\n\n    let mut cheatable_runtime = ExtendedRuntime {\n        extension: CheatableStarknetRuntimeExtension { cheatnet_state },\n        extended_runtime: StarknetRuntime {\n            hint_handler: syscall_handler,\n            panic_traceback: None,\n        },\n    };\n\n    // Execute.\n    cheatable_run_entry_point(\n        &mut runner,\n        &mut cheatable_runtime,\n        &entry_point,\n        &args,\n        program_extra_data_length,\n    )\n    .inspect_err(|_| {\n        extract_trace_and_register_errors(\n            class_hash,\n            &mut runner,\n            cheatable_runtime.extension.cheatnet_state,\n        );\n    })?;\n\n    let trace = get_relocated_vm_trace(&mut runner);\n\n    // Syscall usage here is flat, meaning it only includes syscalls from current call\n    let syscall_usage = cheatable_runtime\n        .extended_runtime\n        .hint_handler\n        .base\n        .syscalls_usage\n        .clone();\n\n    let call_info = finalize_execution(\n        runner,\n        cheatable_runtime.extended_runtime.hint_handler,\n        n_total_args,\n        program_extra_data_length,\n        tracked_resource,\n    )?;\n\n    if call_info.execution.failed {\n        // fallback to the last pc in the trace if user did not set `panic-backtrace = true` in `Scarb.toml`\n        let pcs = if let Some(panic_traceback) = cheatable_runtime.extended_runtime.panic_traceback\n        {\n            panic_traceback\n        } else {\n            trace\n                .last()\n                .map(|last| vec![last.pc])\n                .expect(\"trace should have at least one entry\")\n        };\n        cheatable_runtime\n            .extension\n            .cheatnet_state\n            .register_error(class_hash, pcs);\n    }\n    cheatnet_state\n        .trace_data\n        .set_vm_trace_for_current_call(trace);\n\n    // TODO(#4250): Investigate if we can simplify our logic given that syscall usage is now present in `CallInfo`\n    let (syscall_usage_vm_resources, syscall_usage_sierra_gas) = match tracked_resource {\n        TrackedResource::CairoSteps => (syscall_usage, SyscallUsageMap::default()),\n        TrackedResource::SierraGas => (SyscallUsageMap::default(), syscall_usage),\n    };\n\n    Ok(CallInfoWithExecutionData {\n        call_info,\n        syscall_usage_vm_resources,\n        syscall_usage_sierra_gas,\n    })\n    // endregion\n}\n\n// crates/blockifier/src/execution/cairo1_execution.rs:236 (run_entry_point)\npub fn cheatable_run_entry_point(\n    runner: &mut CairoRunner,\n    hint_processor: &mut dyn HintProcessor,\n    entry_point: &EntryPointV1,\n    args: &Args,\n    program_segment_size: usize,\n) -> Result<(), EntryPointExecutionError> {\n    // region: Modified blockifier code\n    // Opposite to blockifier\n    let verify_secure = false;\n    // endregion\n    let args: Vec<&CairoArg> = args.iter().collect();\n\n    runner\n        .run_from_entrypoint(\n            entry_point.pc(),\n            &args,\n            verify_secure,\n            Some(program_segment_size),\n            hint_processor,\n        )\n        .map_err(Box::new)?;\n\n    // region: Modified blockifier code\n    // Relocate trace to then collect it\n    runner\n        .relocate(true, true)\n        .map_err(CairoRunError::from)\n        .map_err(Box::new)?;\n    // endregion\n\n    Ok(())\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/call_to_blockifier_runtime_extension/execution/calls.rs",
    "content": "use crate::runtime_extensions::call_to_blockifier_runtime_extension::CheatnetState;\nuse crate::runtime_extensions::call_to_blockifier_runtime_extension::execution::execution_utils::clear_events_and_messages_from_reverted_call;\nuse blockifier::execution::syscalls::hint_processor::ENTRYPOINT_FAILED_ERROR;\nuse blockifier::execution::{\n    entry_point::{CallEntryPoint, CallType},\n    execution_utils::ReadOnlySegment,\n    syscalls::{\n        hint_processor::{SyscallExecutionError, SyscallHintProcessor, create_retdata_segment},\n        syscall_base::SyscallResult,\n    },\n};\nuse cairo_vm::vm::vm_core::VirtualMachine;\nuse starknet_api::{\n    contract_class::EntryPointType,\n    core::{ClassHash, EntryPointSelector},\n    transaction::fields::Calldata,\n};\nuse starknet_types_core::felt::Felt;\n\nuse super::entry_point::{ExecuteCallEntryPointExtraOptions, execute_call_entry_point};\n\n// blockifier/src/execution/syscalls/hint_processor.rs:541 (execute_inner_call)\npub fn execute_inner_call(\n    call: &mut CallEntryPoint,\n    vm: &mut VirtualMachine,\n    syscall_handler: &mut SyscallHintProcessor<'_>,\n    cheatnet_state: &mut CheatnetState,\n    remaining_gas: &mut u64,\n) -> SyscallResult<ReadOnlySegment> {\n    let revert_idx = syscall_handler.base.context.revert_infos.0.len();\n\n    // region: Modified blockifier code\n    let call_info = execute_call_entry_point(\n        call,\n        syscall_handler.base.state,\n        cheatnet_state,\n        syscall_handler.base.context,\n        remaining_gas,\n        &ExecuteCallEntryPointExtraOptions::default(),\n    )?;\n    // endregion\n\n    let mut raw_retdata = call_info.execution.retdata.0.clone();\n    let failed = call_info.execution.failed;\n    syscall_handler.base.inner_calls.push(call_info);\n\n    if failed {\n        syscall_handler\n            .base\n            .context\n            .revert(revert_idx, syscall_handler.base.state)?;\n\n        // Delete events and l2_to_l1_messages from the reverted call.\n        let reverted_call = syscall_handler.base.inner_calls.last_mut().unwrap();\n        clear_events_and_messages_from_reverted_call(reverted_call);\n\n        raw_retdata\n            .push(Felt::from_hex(ENTRYPOINT_FAILED_ERROR).map_err(SyscallExecutionError::from)?);\n        return Err(SyscallExecutionError::Revert {\n            error_data: raw_retdata,\n        });\n    }\n\n    let retdata_segment = create_retdata_segment(vm, syscall_handler, &raw_retdata)?;\n\n    Ok(retdata_segment)\n}\n\n// blockifier/src/execution/syscalls/hint_processor.rs:577 (execute_library_call)\n#[expect(clippy::too_many_arguments)]\npub fn execute_library_call(\n    syscall_handler: &mut SyscallHintProcessor<'_>,\n    cheatnet_state: &mut CheatnetState,\n    vm: &mut VirtualMachine,\n    class_hash: ClassHash,\n    call_to_external: bool,\n    entry_point_selector: EntryPointSelector,\n    calldata: Calldata,\n    remaining_gas: &mut u64,\n) -> SyscallResult<ReadOnlySegment> {\n    let entry_point_type = if call_to_external {\n        EntryPointType::External\n    } else {\n        EntryPointType::L1Handler\n    };\n    let mut entry_point = CallEntryPoint {\n        class_hash: Some(class_hash),\n        code_address: None,\n        entry_point_type,\n        entry_point_selector,\n        calldata,\n        // The call context remains the same in a library call.\n        storage_address: syscall_handler.storage_address(),\n        caller_address: syscall_handler.caller_address(),\n        call_type: CallType::Delegate,\n        initial_gas: *remaining_gas,\n    };\n\n    execute_inner_call(\n        &mut entry_point,\n        vm,\n        syscall_handler,\n        cheatnet_state,\n        remaining_gas,\n    )\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/call_to_blockifier_runtime_extension/execution/cheated_syscalls.rs",
    "content": "use super::calls::{execute_inner_call, execute_library_call};\nuse super::execution_info::get_cheated_exec_info_ptr;\nuse super::execution_utils::clear_events_and_messages_from_reverted_call;\nuse crate::runtime_extensions::call_to_blockifier_runtime_extension::CheatnetState;\nuse crate::runtime_extensions::call_to_blockifier_runtime_extension::execution::entry_point::execute_constructor_entry_point;\nuse blockifier::context::TransactionContext;\nuse blockifier::execution::common_hints::ExecutionMode;\nuse blockifier::execution::errors::EntryPointExecutionError;\nuse blockifier::execution::execution_utils::ReadOnlySegment;\nuse blockifier::execution::syscalls::hint_processor::create_retdata_segment;\nuse blockifier::execution::syscalls::hint_processor::{\n    INVALID_ARGUMENT, SyscallExecutionError, SyscallHintProcessor,\n};\nuse blockifier::execution::syscalls::syscall_base::SyscallResult;\nuse blockifier::execution::syscalls::vm_syscall_utils::{\n    CallContractRequest, CallContractResponse, DeployRequest, DeployResponse, EmptyRequest,\n    GetBlockHashRequest, GetBlockHashResponse, GetExecutionInfoResponse, LibraryCallRequest,\n    LibraryCallResponse, MetaTxV0Request, MetaTxV0Response, StorageReadRequest,\n    StorageReadResponse, StorageWriteRequest, StorageWriteResponse, SyscallSelector,\n    TryExtractRevert,\n};\nuse blockifier::execution::{call_info::CallInfo, entry_point::ConstructorContext};\nuse blockifier::state::errors::StateError;\nuse blockifier::transaction::objects::{\n    CommonAccountFields, DeprecatedTransactionInfo, TransactionInfo,\n};\nuse blockifier::{\n    execution::entry_point::{\n        CallEntryPoint, CallType, EntryPointExecutionContext, EntryPointExecutionResult,\n    },\n    state::state_api::State,\n};\nuse cairo_vm::Felt252;\nuse cairo_vm::vm::vm_core::VirtualMachine;\nuse conversions::string::TryFromHexStr;\nuse runtime::starknet::constants::TEST_ADDRESS;\nuse starknet_api::abi::abi_utils::selector_from_name;\nuse starknet_api::contract_class::EntryPointType;\nuse starknet_api::core::EntryPointSelector;\nuse starknet_api::transaction::constants::EXECUTE_ENTRY_POINT_NAME;\nuse starknet_api::transaction::fields::TransactionSignature;\nuse starknet_api::transaction::{TransactionHasher, TransactionOptions, signed_tx_version};\nuse starknet_api::{\n    core::{ClassHash, ContractAddress, Nonce, calculate_contract_address},\n    transaction::{\n        InvokeTransactionV0, TransactionVersion,\n        fields::{Calldata, Fee},\n    },\n};\nuse starknet_types_core::felt::Felt;\nuse std::sync::Arc;\n\npub fn get_execution_info_syscall(\n    _request: EmptyRequest,\n    vm: &mut VirtualMachine,\n    syscall_handler: &mut SyscallHintProcessor<'_>,\n    cheatnet_state: &mut CheatnetState,\n    _remaining_gas: &mut u64,\n) -> SyscallResult<GetExecutionInfoResponse> {\n    let execution_info_ptr = syscall_handler.get_or_allocate_execution_info_segment(vm)?;\n\n    let cheated_data = cheatnet_state.get_cheated_data(syscall_handler.storage_address());\n\n    let ptr_cheated_exec_info = get_cheated_exec_info_ptr(vm, execution_info_ptr, &cheated_data);\n\n    Ok(GetExecutionInfoResponse {\n        execution_info_ptr: ptr_cheated_exec_info,\n    })\n}\n\n/// Converts `deploy_syscall` failure into catchable [`SyscallExecutionError::Revert`] error.\nfn convert_deploy_failure_to_revert(\n    syscall_handler: &mut SyscallHintProcessor<'_>,\n    revert_idx: usize,\n    raw_retdata: Vec<Felt>,\n    call_info_was_added: bool,\n) -> SyscallResult<DeployResponse> {\n    syscall_handler\n        .base\n        .context\n        .revert(revert_idx, syscall_handler.base.state)?;\n\n    if call_info_was_added && let Some(reverted_call) = syscall_handler.base.inner_calls.last_mut()\n    {\n        clear_events_and_messages_from_reverted_call(reverted_call);\n    }\n\n    Err(SyscallExecutionError::Revert {\n        error_data: raw_retdata,\n    })\n}\n\n// blockifier/src/execution/syscalls/mod.rs:222 (deploy_syscall)\npub fn deploy_syscall(\n    request: DeployRequest,\n    vm: &mut VirtualMachine,\n    syscall_handler: &mut SyscallHintProcessor<'_>,\n    cheatnet_state: &mut CheatnetState,\n    remaining_gas: &mut u64,\n) -> SyscallResult<DeployResponse> {\n    // Increment the Deploy syscall's linear cost counter by the number of elements in the\n    // constructor calldata\n    syscall_handler.base.increment_syscall_linear_factor_by(\n        &SyscallSelector::Deploy,\n        request.constructor_calldata.0.len(),\n    );\n\n    let deployer_address = syscall_handler.base.call.storage_address;\n    let deployer_address_for_calculation = if request.deploy_from_zero {\n        ContractAddress::default()\n    } else {\n        deployer_address\n    };\n\n    // region: Modified blockifier code\n    let deployed_contract_address =\n        if let Some(contract_address) = cheatnet_state.next_address_for_deployment() {\n            contract_address\n        } else {\n            calculate_contract_address(\n                request.contract_address_salt,\n                request.class_hash,\n                &request.constructor_calldata,\n                deployer_address_for_calculation,\n            )?\n        };\n    // endregion\n\n    let ctor_context = ConstructorContext {\n        class_hash: request.class_hash,\n        code_address: Some(deployed_contract_address),\n        storage_address: deployed_contract_address,\n        caller_address: deployer_address,\n    };\n\n    // Check if this deploy comes from the cheatcode\n    // This allows us to make `deploy_syscall` revertible, only when used via the cheatcode\n    let from_cheatcode = cheatnet_state.take_next_syscall_from_cheatcode();\n\n    let revert_idx = syscall_handler.base.context.revert_infos.0.len();\n\n    let call_info = match execute_deployment(\n        syscall_handler.base.state,\n        cheatnet_state,\n        syscall_handler.base.context,\n        &ctor_context,\n        request.constructor_calldata,\n        remaining_gas,\n    ) {\n        Ok(info) => info,\n        Err(EntryPointExecutionError::ExecutionFailed { error_trace }) if from_cheatcode => {\n            let panic_data = error_trace.last_retdata.0.clone();\n            return convert_deploy_failure_to_revert(\n                syscall_handler,\n                revert_idx,\n                panic_data,\n                false,\n            );\n        }\n        Err(err) => return Err(err.into()),\n    };\n    let failed = call_info.execution.failed;\n    let raw_retdata = call_info.execution.retdata.0.clone();\n    syscall_handler.base.inner_calls.push(call_info);\n\n    if failed && from_cheatcode {\n        // This should be unreachable with the current implementation of `execute_deployment`\n        // This check is kept in case of future changes + to be aligned with revert handling elsewhere.\n        return convert_deploy_failure_to_revert(syscall_handler, revert_idx, raw_retdata, true);\n    }\n\n    let constructor_retdata = create_retdata_segment(vm, syscall_handler, &raw_retdata)?;\n\n    Ok(DeployResponse {\n        contract_address: deployed_contract_address,\n        constructor_retdata,\n    })\n}\n\n// blockifier/src/execution/execution_utils.rs:217 (execute_deployment)\npub fn execute_deployment(\n    state: &mut dyn State,\n    cheatnet_state: &mut CheatnetState,\n    context: &mut EntryPointExecutionContext,\n    ctor_context: &ConstructorContext,\n    constructor_calldata: Calldata,\n    remaining_gas: &mut u64,\n) -> EntryPointExecutionResult<CallInfo> {\n    // Address allocation in the state is done before calling the constructor, so that it is\n    // visible from it.\n    let deployed_contract_address = ctor_context.storage_address;\n    let current_class_hash = state.get_class_hash_at(deployed_contract_address)?;\n    if current_class_hash != ClassHash::default() {\n        return Err(StateError::UnavailableContractAddress(deployed_contract_address).into());\n    }\n\n    state.set_class_hash_at(deployed_contract_address, ctor_context.class_hash)?;\n\n    let call_info = execute_constructor_entry_point(\n        state,\n        cheatnet_state,\n        context,\n        ctor_context,\n        constructor_calldata,\n        remaining_gas,\n    )?;\n\n    Ok(call_info)\n}\n\n// blockifier/src/execution/syscalls/mod.rs:407 (library_call)\npub fn library_call_syscall(\n    request: LibraryCallRequest,\n    vm: &mut VirtualMachine,\n    syscall_handler: &mut SyscallHintProcessor<'_>,\n    cheatnet_state: &mut CheatnetState,\n    remaining_gas: &mut u64,\n) -> SyscallResult<LibraryCallResponse> {\n    let call_to_external = true;\n    let retdata_segment = execute_library_call(\n        syscall_handler,\n        cheatnet_state,\n        vm,\n        request.class_hash,\n        call_to_external,\n        request.function_selector,\n        request.calldata,\n        remaining_gas,\n    )\n    .map_err(|error| match error {\n        SyscallExecutionError::Revert { .. } => error,\n        _ => error.as_lib_call_execution_error(\n            request.class_hash,\n            syscall_handler.storage_address(),\n            request.function_selector,\n        ),\n    })?;\n\n    Ok(LibraryCallResponse {\n        segment: retdata_segment,\n    })\n}\n\n// blockifier/src/execution/syscalls/mod.rs:157 (call_contract)\npub fn call_contract_syscall(\n    request: CallContractRequest,\n    vm: &mut VirtualMachine,\n    syscall_handler: &mut SyscallHintProcessor<'_>,\n    cheatnet_state: &mut CheatnetState,\n    remaining_gas: &mut u64,\n) -> SyscallResult<CallContractResponse> {\n    let storage_address = request.contract_address;\n    let class_hash = syscall_handler\n        .base\n        .state\n        .get_class_hash_at(storage_address)?;\n    let selector = request.function_selector;\n\n    let mut entry_point = CallEntryPoint {\n        class_hash: None,\n        code_address: Some(storage_address),\n        entry_point_type: EntryPointType::External,\n        entry_point_selector: selector,\n        calldata: request.calldata,\n        storage_address,\n        caller_address: syscall_handler.storage_address(),\n        call_type: CallType::Call,\n        initial_gas: *remaining_gas,\n    };\n    let retdata_segment = execute_inner_call(\n        &mut entry_point,\n        vm,\n        syscall_handler,\n        cheatnet_state,\n        remaining_gas,\n    )\n    .map_err(|error| match error {\n        SyscallExecutionError::Revert { .. } => error,\n        _ => error.as_call_contract_execution_error(class_hash, storage_address, selector),\n    })?;\n\n    // region: Modified blockifier code\n    Ok(CallContractResponse {\n        segment: retdata_segment,\n    })\n    // endregion\n}\n\n// blockifier/src/execution/syscalls/hint_processor.rs:637 (meta_tx_v0)\npub fn meta_tx_v0_syscall(\n    request: MetaTxV0Request,\n    vm: &mut VirtualMachine,\n    syscall_handler: &mut SyscallHintProcessor<'_>,\n    cheatnet_state: &mut CheatnetState,\n    remaining_gas: &mut u64,\n) -> SyscallResult<MetaTxV0Response> {\n    let storage_address = request.contract_address;\n    let selector = request.entry_point_selector;\n\n    // region: Modified blockifier code\n    let retdata_segment = meta_tx_v0(\n        syscall_handler,\n        vm,\n        cheatnet_state,\n        storage_address,\n        selector,\n        request.calldata,\n        request.signature,\n        remaining_gas,\n    )?;\n    // endregion\n\n    Ok(MetaTxV0Response {\n        segment: retdata_segment,\n    })\n}\n\n// blockifier/src/execution/syscalls/syscall_base.rs:278 (meta_tx_v0)\n#[allow(clippy::result_large_err, clippy::too_many_arguments)]\nfn meta_tx_v0(\n    syscall_handler: &mut SyscallHintProcessor<'_>,\n    vm: &mut VirtualMachine,\n    cheatnet_state: &mut CheatnetState,\n    contract_address: ContractAddress,\n    entry_point_selector: EntryPointSelector,\n    calldata: Calldata,\n    signature: TransactionSignature,\n    remaining_gas: &mut u64,\n) -> SyscallResult<ReadOnlySegment> {\n    syscall_handler\n        .base\n        .increment_syscall_linear_factor_by(&SyscallSelector::MetaTxV0, calldata.0.len());\n\n    if syscall_handler.base.context.execution_mode == ExecutionMode::Validate {\n        //region: Modified blockifier code\n        unreachable!(\n            \"`ExecutionMode::Validate` should never occur as execution mode is hardcoded to `Execute`\"\n        );\n        // endregion\n    }\n\n    if entry_point_selector != selector_from_name(EXECUTE_ENTRY_POINT_NAME) {\n        return Err(SyscallExecutionError::Revert {\n            error_data: vec![Felt252::from_hex(INVALID_ARGUMENT).unwrap()],\n        });\n    }\n\n    let mut entry_point = CallEntryPoint {\n        class_hash: None,\n        code_address: Some(contract_address),\n        entry_point_type: EntryPointType::External,\n        entry_point_selector,\n        calldata: calldata.clone(),\n        storage_address: contract_address,\n        caller_address: ContractAddress::default(),\n        call_type: CallType::Call,\n        // NOTE: this value might be overridden later on.\n        initial_gas: *remaining_gas,\n    };\n\n    let old_tx_context = syscall_handler.base.context.tx_context.clone();\n    let only_query = old_tx_context.tx_info.only_query();\n\n    // Compute meta-transaction hash.\n    let transaction_hash = InvokeTransactionV0 {\n        max_fee: Fee(0),\n        signature: signature.clone(),\n        contract_address,\n        entry_point_selector,\n        calldata,\n    }\n    .calculate_transaction_hash(\n        &syscall_handler\n            .base\n            .context\n            .tx_context\n            .block_context\n            .chain_info()\n            .chain_id,\n        &signed_tx_version(\n            &TransactionVersion::ZERO,\n            &TransactionOptions { only_query },\n        ),\n    )?;\n\n    let class_hash = syscall_handler\n        .base\n        .state\n        .get_class_hash_at(contract_address)?;\n\n    // Replace `tx_context`.\n    let new_tx_info = TransactionInfo::Deprecated(DeprecatedTransactionInfo {\n        common_fields: CommonAccountFields {\n            transaction_hash,\n            version: TransactionVersion::ZERO,\n            signature,\n            nonce: Nonce(0.into()),\n            sender_address: contract_address,\n            only_query,\n        },\n        max_fee: Fee(0),\n    });\n    syscall_handler.base.context.tx_context = Arc::new(TransactionContext {\n        block_context: old_tx_context.block_context.clone(),\n        tx_info: new_tx_info,\n    });\n\n    // region: Modified blockifier code\n    // No error should be propagated until we restore the old `tx_context`.\n    let retdata_segment = execute_inner_call(\n        &mut entry_point,\n        vm,\n        syscall_handler,\n        cheatnet_state,\n        remaining_gas,\n    )\n    .map_err(|error| {\n        SyscallExecutionError::from_self_or_revert(error.try_extract_revert().map_original(\n            |error| {\n                error.as_call_contract_execution_error(\n                    class_hash,\n                    contract_address,\n                    entry_point_selector,\n                )\n            },\n        ))\n    })?;\n    // endregion\n\n    // Restore the old `tx_context`.\n    syscall_handler.base.context.tx_context = old_tx_context;\n\n    Ok(retdata_segment)\n}\n\n#[expect(clippy::needless_pass_by_value)]\npub fn get_block_hash_syscall(\n    request: GetBlockHashRequest,\n    _vm: &mut VirtualMachine,\n    syscall_handler: &mut SyscallHintProcessor<'_>,\n    cheatnet_state: &mut CheatnetState,\n    _remaining_gas: &mut u64,\n) -> SyscallResult<GetBlockHashResponse> {\n    let contract_address = syscall_handler.storage_address();\n    let block_number = request.block_number.0;\n\n    let block_hash = cheatnet_state.get_block_hash_for_contract(\n        contract_address,\n        block_number,\n        syscall_handler,\n    )?;\n\n    Ok(GetBlockHashResponse { block_hash })\n}\n\n#[expect(clippy::needless_pass_by_value)]\npub fn storage_read(\n    request: StorageReadRequest,\n    _vm: &mut VirtualMachine,\n    syscall_handler: &mut SyscallHintProcessor<'_>,\n    cheatnet_state: &mut CheatnetState,\n    _remaining_gas: &mut u64,\n) -> SyscallResult<StorageReadResponse> {\n    let original_storage_address = syscall_handler.base.call.storage_address;\n    maybe_modify_storage_address(syscall_handler, cheatnet_state)?;\n\n    let value = syscall_handler\n        .base\n        .storage_read(request.address)\n        .inspect_err(|_| {\n            // Restore state on error before bubbling up\n            syscall_handler.base.call.storage_address = original_storage_address;\n        })?;\n\n    // Restore the original storage_address\n    syscall_handler.base.call.storage_address = original_storage_address;\n\n    Ok(StorageReadResponse { value })\n}\n\n#[expect(clippy::needless_pass_by_value)]\npub fn storage_write(\n    request: StorageWriteRequest,\n    _vm: &mut VirtualMachine,\n    syscall_handler: &mut SyscallHintProcessor<'_>,\n    cheatnet_state: &mut CheatnetState,\n    _remaining_gas: &mut u64,\n) -> SyscallResult<StorageWriteResponse> {\n    let original_storage_address = syscall_handler.base.call.storage_address;\n    maybe_modify_storage_address(syscall_handler, cheatnet_state)?;\n\n    syscall_handler\n        .base\n        .storage_write(request.address, request.value)\n        .inspect_err(|_| {\n            // Restore state on error before bubbling up\n            syscall_handler.base.call.storage_address = original_storage_address;\n        })?;\n\n    // Restore the original storage_address\n    syscall_handler.base.call.storage_address = original_storage_address;\n\n    Ok(StorageWriteResponse {})\n}\n\n// This logic is used to modify the storage address to enable using `contract_state_for_testing`\n// inside `interact_with_state` closure cheatcode.\nfn maybe_modify_storage_address(\n    syscall_handler: &mut SyscallHintProcessor<'_>,\n    cheatnet_state: &mut CheatnetState,\n) -> Result<(), StateError> {\n    let contract_address = syscall_handler.storage_address();\n    let test_address =\n        TryFromHexStr::try_from_hex_str(TEST_ADDRESS).expect(\"Failed to parse `TEST_ADDRESS`\");\n\n    if contract_address != test_address {\n        return Ok(());\n    }\n\n    let cheated_data = cheatnet_state.get_cheated_data(contract_address);\n    if let Some(actual_address) = cheated_data.contract_address {\n        let class_hash = syscall_handler\n            .base\n            .state\n            .get_class_hash_at(actual_address)\n            .expect(\"`get_class_hash_at` should never fail\");\n\n        if class_hash == ClassHash::default() {\n            return Err(StateError::StateReadError(format!(\n                \"Failed to interact with contract state because no contract is deployed at address {actual_address}\"\n            )));\n        }\n\n        syscall_handler.base.call.storage_address = actual_address;\n    }\n\n    Ok(())\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/call_to_blockifier_runtime_extension/execution/deprecated/cairo0_execution.rs",
    "content": "use crate::runtime_extensions::call_to_blockifier_runtime_extension::CheatnetState;\nuse crate::runtime_extensions::call_to_blockifier_runtime_extension::execution::entry_point::{\n    CallInfoWithExecutionData, ContractClassEntryPointExecutionResult,\n    extract_trace_and_register_errors,\n};\nuse crate::runtime_extensions::deprecated_cheatable_starknet_extension::DeprecatedCheatableStarknetRuntimeExtension;\nuse crate::runtime_extensions::deprecated_cheatable_starknet_extension::runtime::{\n    DeprecatedExtendedRuntime, DeprecatedStarknetRuntime,\n};\nuse blockifier::execution::contract_class::CompiledClassV0;\nuse blockifier::execution::deprecated_entry_point_execution::{\n    VmExecutionContext, finalize_execution, initialize_execution_context, prepare_call_arguments,\n};\nuse blockifier::execution::entry_point::{EntryPointExecutionContext, ExecutableCallEntryPoint};\nuse blockifier::execution::errors::EntryPointExecutionError;\nuse blockifier::execution::execution_utils::Args;\nuse blockifier::execution::syscalls::vm_syscall_utils::SyscallUsageMap;\nuse blockifier::state::state_api::State;\nuse cairo_vm::hint_processor::hint_processor_definition::HintProcessor;\nuse cairo_vm::vm::runners::cairo_runner::{CairoArg, CairoRunner};\n\n// blockifier/src/execution/deprecated_execution.rs:36 (execute_entry_point_call)\npub(crate) fn execute_entry_point_call_cairo0(\n    call: ExecutableCallEntryPoint,\n    compiled_class_v0: CompiledClassV0,\n    state: &mut dyn State,\n    cheatnet_state: &mut CheatnetState,\n    context: &mut EntryPointExecutionContext,\n) -> ContractClassEntryPointExecutionResult {\n    let VmExecutionContext {\n        mut runner,\n        mut syscall_handler,\n        initial_syscall_ptr,\n        entry_point_pc,\n    } = initialize_execution_context(&call, compiled_class_v0, state, context)?;\n\n    let (implicit_args, args) = prepare_call_arguments(\n        &call,\n        &mut runner,\n        initial_syscall_ptr,\n        &mut syscall_handler.read_only_segments,\n    )?;\n    let n_total_args = args.len();\n\n    // region: Modified blockifier code\n    let cheatable_extension = DeprecatedCheatableStarknetRuntimeExtension { cheatnet_state };\n    let mut cheatable_syscall_handler = DeprecatedExtendedRuntime {\n        extension: cheatable_extension,\n        extended_runtime: DeprecatedStarknetRuntime {\n            hint_handler: syscall_handler,\n        },\n    };\n\n    // Execute.\n    cheatable_run_entry_point(\n        &mut runner,\n        &mut cheatable_syscall_handler,\n        entry_point_pc,\n        &args,\n    )\n    .inspect_err(|_| {\n        extract_trace_and_register_errors(\n            call.class_hash,\n            &mut runner,\n            cheatable_syscall_handler.extension.cheatnet_state,\n        );\n    })?;\n\n    let syscall_usage = cheatable_syscall_handler\n        .extended_runtime\n        .hint_handler\n        .syscalls_usage\n        .clone();\n\n    let execution_result = finalize_execution(\n        runner,\n        cheatable_syscall_handler.extended_runtime.hint_handler,\n        call,\n        implicit_args,\n        n_total_args,\n    )?;\n\n    Ok(CallInfoWithExecutionData {\n        call_info: execution_result,\n        syscall_usage_vm_resources: syscall_usage,\n        syscall_usage_sierra_gas: SyscallUsageMap::default(),\n    })\n    // endregion\n}\n\n// blockifier/src/execution/deprecated_execution.rs:192 (run_entry_point)\npub fn cheatable_run_entry_point(\n    runner: &mut CairoRunner,\n    hint_processor: &mut dyn HintProcessor,\n    entry_point_pc: usize,\n    args: &Args,\n) -> Result<(), EntryPointExecutionError> {\n    // region: Modified blockifier code\n    // Opposite to blockifier\n    let verify_secure = false;\n    // endregion\n    let program_segment_size = None; // Infer size from program.\n    let args: Vec<&CairoArg> = args.iter().collect();\n\n    runner\n        .run_from_entrypoint(\n            entry_point_pc,\n            &args,\n            verify_secure,\n            program_segment_size,\n            hint_processor,\n        )\n        .map_err(Box::new)?;\n\n    Ok(())\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/call_to_blockifier_runtime_extension/execution/deprecated/mod.rs",
    "content": "pub mod cairo0_execution;\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/call_to_blockifier_runtime_extension/execution/entry_point.rs",
    "content": "use super::cairo1_execution::execute_entry_point_call_cairo1;\nuse crate::runtime_extensions::call_to_blockifier_runtime_extension::execution::deprecated::cairo0_execution::execute_entry_point_call_cairo0;\nuse crate::runtime_extensions::call_to_blockifier_runtime_extension::execution::execution_utils::{exit_error_call, resolve_cheated_data_for_call, update_trace_data};\nuse crate::runtime_extensions::call_to_blockifier_runtime_extension::rpc::CallSuccess;\nuse crate::runtime_extensions::call_to_blockifier_runtime_extension::CheatnetState;\nuse crate::runtime_extensions::common::get_relocated_vm_trace;\n#[cfg(feature = \"cairo-native\")]\nuse crate::runtime_extensions::native::execution::execute_entry_point_call_native;\nuse crate::state::CheatStatus;\nuse blockifier::execution::call_info::{CairoPrimitiveCounterMap, CallExecution, ExtendedExecutionResources, Retdata, StorageAccessTracker};\nuse blockifier::execution::contract_class::{RunnableCompiledClass, TrackedResource};\nuse blockifier::execution::entry_point::EntryPointRevertInfo;\nuse blockifier::execution::execution_utils::update_remaining_gas;\nuse blockifier::execution::stack_trace::{\n    extract_trailing_cairo1_revert_trace, Cairo1RevertHeader,\n};\nuse blockifier::execution::syscalls::hint_processor::{\n    ENTRYPOINT_NOT_FOUND_ERROR, OUT_OF_GAS_ERROR,\n};\nuse blockifier::execution::syscalls::vm_syscall_utils::SyscallUsageMap;\nuse blockifier::{\n    execution::{\n        call_info::CallInfo,\n        entry_point::{\n            handle_empty_constructor, CallEntryPoint, CallType, ConstructorContext,\n            EntryPointExecutionContext, EntryPointExecutionResult, FAULTY_CLASS_HASH,\n        },\n        errors::{EntryPointExecutionError, PreExecutionError},\n    },\n    state::state_api::State,\n};\nuse cairo_vm::vm::runners::cairo_runner::CairoRunner;\nuse conversions::FromConv;\nuse shared::vm::VirtualMachineExt;\nuse starknet_api::execution_resources::GasAmount;\nuse starknet_api::{\n    contract_class::EntryPointType,\n    core::ClassHash,\n    transaction::{fields::Calldata, TransactionVersion},\n};\nuse starknet_types_core::felt::Felt;\nuse std::collections::HashSet;\n\npub(crate) type ContractClassEntryPointExecutionResult =\n    Result<CallInfoWithExecutionData, EntryPointExecutionError>;\n\npub(crate) struct CallInfoWithExecutionData {\n    pub call_info: CallInfo,\n    pub syscall_usage_vm_resources: SyscallUsageMap,\n    pub syscall_usage_sierra_gas: SyscallUsageMap,\n}\n\n#[derive(Default)]\npub struct ExecuteCallEntryPointExtraOptions {\n    pub trace_data_handled_by_revert_call: bool,\n}\n\n// blockifier/src/execution/entry_point (CallEntryPoint::execute)\n#[expect(clippy::too_many_lines)]\npub fn execute_call_entry_point(\n    entry_point: &mut CallEntryPoint, // Instead of 'self'\n    state: &mut dyn State,\n    cheatnet_state: &mut CheatnetState,\n    context: &mut EntryPointExecutionContext,\n    remaining_gas: &mut u64,\n    opts: &ExecuteCallEntryPointExtraOptions,\n) -> EntryPointExecutionResult<CallInfo> {\n    // region: Modified blockifier code\n    // We skip recursion depth validation here.\n    if !opts.trace_data_handled_by_revert_call {\n        let cheated_data = resolve_cheated_data_for_call(entry_point, cheatnet_state);\n        cheatnet_state\n            .trace_data\n            .enter_nested_call(entry_point.clone(), cheated_data.clone());\n    }\n\n    if let Some(cheat_status) = get_mocked_function_cheat_status(entry_point, cheatnet_state)\n        && let CheatStatus::Cheated(ret_data, _) = (*cheat_status).clone()\n    {\n        cheat_status.decrement_cheat_span();\n        let ret_data_f252: Vec<Felt> = ret_data.iter().map(|datum| Felt::from_(*datum)).collect();\n        cheatnet_state.trace_data.update_current_call(\n            ExtendedExecutionResources::default(),\n            u64::default(),\n            SyscallUsageMap::default(),\n            SyscallUsageMap::default(),\n            Ok(CallSuccess {\n                ret_data: ret_data_f252,\n            }),\n            &[],\n            vec![],\n            vec![],\n        );\n\n        if !opts.trace_data_handled_by_revert_call {\n            cheatnet_state.trace_data.exit_nested_call();\n        }\n\n        let tracked_resource = *context\n            .tracked_resource_stack\n            .last()\n            .expect(\"Unexpected empty tracked resource.\");\n\n        return Ok(mocked_call_info(\n            entry_point.clone(),\n            ret_data.clone(),\n            tracked_resource,\n        ));\n    }\n    // endregion\n\n    // Validate contract is deployed.\n    let storage_class_hash = state.get_class_hash_at(entry_point.storage_address)?;\n    if storage_class_hash == ClassHash::default() {\n        return Err(\n            PreExecutionError::UninitializedStorageAddress(entry_point.storage_address).into(),\n        );\n    }\n\n    // region: Modified blockifier code\n    let maybe_replacement_class = cheatnet_state\n        .replaced_bytecode_contracts\n        .get(&entry_point.storage_address)\n        .copied();\n    let class_hash = entry_point\n        .class_hash\n        .or(maybe_replacement_class)\n        .unwrap_or(storage_class_hash); // If not given, take the storage contract class hash.\n    // endregion\n\n    let compiled_class = state.get_compiled_class(class_hash)?;\n    let current_tracked_resource = compiled_class.get_current_tracked_resource(context);\n\n    // region: Modified blockifier code\n    cheatnet_state\n        .trace_data\n        .set_class_hash_for_current_call(class_hash);\n    // endregion\n\n    // Hack to prevent version 0 attack on ready (formerly argent) accounts.\n    if context.tx_context.tx_info.version() == TransactionVersion::ZERO\n        && class_hash\n            == ClassHash(Felt::from_hex(FAULTY_CLASS_HASH).expect(\"A class hash must be a felt.\"))\n    {\n        return Err(PreExecutionError::FraudAttempt.into());\n    }\n\n    let contract_class = state.get_compiled_class(class_hash)?;\n\n    context.revert_infos.0.push(EntryPointRevertInfo::new(\n        entry_point.storage_address,\n        class_hash,\n        context.n_emitted_events,\n        context.n_sent_messages_to_l1,\n    ));\n\n    context\n        .tracked_resource_stack\n        .push(current_tracked_resource);\n\n    // Region: Modified blockifier code\n    let entry_point = entry_point.clone().into_executable(class_hash);\n    let result = match contract_class {\n        RunnableCompiledClass::V0(compiled_class_v0) => execute_entry_point_call_cairo0(\n            entry_point.clone(),\n            compiled_class_v0,\n            state,\n            cheatnet_state,\n            context,\n        ),\n        RunnableCompiledClass::V1(compiled_class_v1) => execute_entry_point_call_cairo1(\n            entry_point.clone(),\n            &compiled_class_v1,\n            state,\n            cheatnet_state,\n            context,\n        ),\n        #[cfg(feature = \"cairo-native\")]\n        RunnableCompiledClass::V1Native(native_compiled_class_v1) => {\n            if context.tracked_resource_stack.last() == Some(&TrackedResource::CairoSteps) {\n                execute_entry_point_call_cairo1(\n                    entry_point.clone(),\n                    &native_compiled_class_v1.casm(),\n                    state,\n                    cheatnet_state,\n                    context,\n                )\n            } else {\n                execute_entry_point_call_native(\n                    &entry_point,\n                    &native_compiled_class_v1,\n                    state,\n                    cheatnet_state,\n                    context,\n                )\n            }\n        }\n    };\n    context\n        .tracked_resource_stack\n        .pop()\n        .expect(\"Unexpected empty tracked resource.\");\n\n    match result {\n        Ok(res) => {\n            if res.call_info.execution.failed && !context.versioned_constants().enable_reverts {\n                let err = EntryPointExecutionError::ExecutionFailed {\n                    error_trace: extract_trailing_cairo1_revert_trace(\n                        &res.call_info,\n                        Cairo1RevertHeader::Execution,\n                    ),\n                };\n                exit_error_call(&err, cheatnet_state, &entry_point);\n                return Err(err);\n            }\n            update_remaining_gas(remaining_gas, &res.call_info);\n            update_trace_data(\n                &res.call_info,\n                &res.syscall_usage_vm_resources,\n                &res.syscall_usage_sierra_gas,\n                cheatnet_state,\n            );\n\n            if !opts.trace_data_handled_by_revert_call {\n                cheatnet_state.trace_data.exit_nested_call();\n            }\n\n            Ok(res.call_info)\n        }\n        Err(EntryPointExecutionError::PreExecutionError(err))\n            if context.versioned_constants().enable_reverts =>\n        {\n            let error_code = match err {\n                PreExecutionError::EntryPointNotFound(_)\n                | PreExecutionError::NoEntryPointOfTypeFound(_) => ENTRYPOINT_NOT_FOUND_ERROR,\n                PreExecutionError::InsufficientEntryPointGas => OUT_OF_GAS_ERROR,\n                _ => return Err(err.into()),\n            };\n            Ok(CallInfo {\n                call: entry_point.into(),\n                execution: CallExecution {\n                    retdata: Retdata(vec![Felt::from_hex(error_code).unwrap()]),\n                    failed: true,\n                    gas_consumed: 0,\n                    ..CallExecution::default()\n                },\n                tracked_resource: current_tracked_resource,\n                ..CallInfo::default()\n            })\n        }\n        Err(err) => {\n            exit_error_call(&err, cheatnet_state, &entry_point);\n            Err(err)\n        }\n    }\n    // endregion\n}\n\n// blockifier/src/execution/entry_point (CallEntryPoint::non_reverting_execute)\npub fn non_reverting_execute_call_entry_point(\n    entry_point: &mut CallEntryPoint, // Instead of 'self'\n    state: &mut dyn State,\n    cheatnet_state: &mut CheatnetState,\n    context: &mut EntryPointExecutionContext,\n    remaining_gas: &mut u64,\n) -> EntryPointExecutionResult<CallInfo> {\n    // Region: Modified blockifier code\n    let cheated_data = resolve_cheated_data_for_call(entry_point, cheatnet_state);\n    cheatnet_state\n        .trace_data\n        .enter_nested_call(entry_point.clone(), cheated_data.clone());\n    // endregion\n\n    let execution_result = execute_call_entry_point(\n        entry_point,\n        state,\n        cheatnet_state,\n        context,\n        remaining_gas,\n        &ExecuteCallEntryPointExtraOptions {\n            trace_data_handled_by_revert_call: true,\n        },\n    );\n\n    if let Ok(call_info) = &execution_result {\n        // Update revert gas tracking (for completeness - value will not be used unless the tx\n        // is reverted).\n        context\n            .sierra_gas_revert_tracker\n            .update_with_next_remaining_gas(call_info.tracked_resource, GasAmount(*remaining_gas));\n        // If the execution of the outer call failed, revert the transaction.\n        if call_info.execution.failed {\n            // Region: Modified blockifier code\n            clear_handled_errors(call_info, cheatnet_state);\n            let err = EntryPointExecutionError::ExecutionFailed {\n                error_trace: extract_trailing_cairo1_revert_trace(\n                    call_info,\n                    Cairo1RevertHeader::Execution,\n                ),\n            };\n            // Note: Class hash in the entry point below does not matter, as `exit_error_call` does not update it in the trace.\n            exit_error_call(\n                &err,\n                cheatnet_state,\n                &entry_point\n                    .clone()\n                    .into_executable(entry_point.class_hash.unwrap_or_default()),\n            );\n            return Err(err);\n        }\n        cheatnet_state.trace_data.exit_nested_call();\n        // endregion\n    }\n\n    execution_result\n}\n\n// blockifier/src/execution/entry_point.rs (execute_constructor_entry_point)\npub fn execute_constructor_entry_point(\n    state: &mut dyn State,\n    cheatnet_state: &mut CheatnetState,\n    context: &mut EntryPointExecutionContext,\n    ctor_context: &ConstructorContext,\n    calldata: Calldata,\n    remaining_gas: &mut u64,\n) -> EntryPointExecutionResult<CallInfo> {\n    // Ensure the class is declared (by reading it).\n    let contract_class = state.get_compiled_class(ctor_context.class_hash)?;\n    let Some(constructor_selector) = contract_class.constructor_selector() else {\n        // Contract has no constructor.\n        cheatnet_state\n            .trace_data\n            .add_deploy_without_constructor_node();\n        return handle_empty_constructor(\n            contract_class,\n            context,\n            ctor_context,\n            calldata,\n            *remaining_gas,\n        );\n    };\n\n    let mut constructor_call = CallEntryPoint {\n        class_hash: None,\n        code_address: ctor_context.code_address,\n        entry_point_type: EntryPointType::Constructor,\n        entry_point_selector: constructor_selector,\n        calldata,\n        storage_address: ctor_context.storage_address,\n        caller_address: ctor_context.caller_address,\n        call_type: CallType::Call,\n        initial_gas: *remaining_gas,\n    };\n    // region: Modified blockifier code\n    non_reverting_execute_call_entry_point(\n        &mut constructor_call,\n        state,\n        cheatnet_state,\n        context,\n        remaining_gas,\n    )\n    // endregion\n}\n\nfn get_mocked_function_cheat_status<'a>(\n    call: &CallEntryPoint,\n    cheatnet_state: &'a mut CheatnetState,\n) -> Option<&'a mut CheatStatus<Vec<Felt>>> {\n    if call.call_type == CallType::Delegate {\n        return None;\n    }\n\n    cheatnet_state\n        .mocked_functions\n        .get_mut(&call.storage_address)\n        .and_then(|contract_functions| contract_functions.get_mut(&call.entry_point_selector))\n}\n\nfn mocked_call_info(\n    call: CallEntryPoint,\n    ret_data: Vec<Felt>,\n    tracked_resource: TrackedResource,\n) -> CallInfo {\n    CallInfo {\n        call: CallEntryPoint {\n            class_hash: Some(call.class_hash.unwrap_or_default()),\n            ..call\n        },\n        execution: CallExecution {\n            retdata: Retdata(ret_data),\n            events: vec![],\n            l2_to_l1_messages: vec![],\n            cairo_native: false,\n            failed: false,\n            gas_consumed: 0,\n        },\n        resources: ExtendedExecutionResources::default(),\n        tracked_resource,\n        inner_calls: vec![],\n        storage_access_tracker: StorageAccessTracker::default(),\n        builtin_counters: CairoPrimitiveCounterMap::default(),\n        syscalls_usage: SyscallUsageMap::default(),\n    }\n}\n\npub(crate) fn extract_trace_and_register_errors(\n    class_hash: ClassHash,\n    runner: &mut CairoRunner,\n    cheatnet_state: &mut CheatnetState,\n) {\n    let trace = get_relocated_vm_trace(runner);\n    cheatnet_state\n        .trace_data\n        .set_vm_trace_for_current_call(trace);\n\n    let pcs = runner.vm.get_reversed_pc_traceback();\n    cheatnet_state.register_error(class_hash, pcs);\n}\n\n/// This helper function is used for backtrace to avoid displaying errors that were already handled\n/// It clears the errors for all contracts that failed with a different panic data than the root call\n/// Note: This may not be accurate if a panic was initially handled and then the function panicked\n/// again with the identical panic data\npub(crate) fn clear_handled_errors(root_call: &CallInfo, cheatnet_state: &mut CheatnetState) {\n    let contracts_matching_root_error = get_contracts_with_matching_error(root_call);\n\n    cheatnet_state\n        .encountered_errors\n        .clone()\n        .keys()\n        .for_each(|&class_hash| {\n            if !contracts_matching_root_error.contains(&class_hash) {\n                cheatnet_state.clear_error(class_hash);\n            }\n        });\n}\n\n/// Collects all contracts that have matching error with the root call\nfn get_contracts_with_matching_error(root_call: &CallInfo) -> HashSet<ClassHash> {\n    let mut contracts_matching_root_error = HashSet::new();\n    let mut failed_matching_calls: Vec<&CallInfo> = vec![root_call];\n\n    while let Some(call_info) = failed_matching_calls.pop() {\n        if let Some(class_hash) = call_info.call.class_hash {\n            contracts_matching_root_error.insert(class_hash);\n            failed_matching_calls.extend(get_inner_calls_with_matching_panic_data(\n                call_info,\n                &root_call.execution.retdata.0,\n            ));\n        }\n    }\n\n    contracts_matching_root_error\n}\n\nfn get_inner_calls_with_matching_panic_data<'a>(\n    call_info: &'a CallInfo,\n    root_retdata: &[Felt],\n) -> Vec<&'a CallInfo> {\n    call_info\n        .inner_calls\n        .iter()\n        .filter(|call| call.execution.failed && root_retdata.starts_with(&call.execution.retdata.0))\n        .collect()\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/call_to_blockifier_runtime_extension/execution/execution_info.rs",
    "content": "use crate::state::{CheatedData, CheatedTxInfo};\nuse cairo_vm::{\n    types::relocatable::{MaybeRelocatable, Relocatable},\n    vm::vm_core::VirtualMachine,\n};\nuse conversions::serde::SerializedValue;\nuse conversions::{IntoConv, serde::serialize::SerializeToFeltVec};\nuse starknet_types_core::felt::Felt;\n\nfn get_cheated_block_info_ptr(\n    vm: &mut VirtualMachine,\n    original_block_info: &[MaybeRelocatable],\n    cheated_data: &CheatedData,\n) -> Relocatable {\n    // create a new segment with replaced block info\n    let ptr_cheated_block_info = vm.add_memory_segment();\n\n    let mut new_block_info = original_block_info.to_owned();\n\n    if let Some(block_number) = cheated_data.block_number {\n        new_block_info[0] = MaybeRelocatable::Int(block_number.into());\n    }\n\n    if let Some(block_timestamp) = cheated_data.block_timestamp {\n        new_block_info[1] = MaybeRelocatable::Int(block_timestamp.into());\n    }\n\n    if let Some(sequencer_address) = cheated_data.sequencer_address {\n        new_block_info[2] = MaybeRelocatable::Int(sequencer_address.into_());\n    }\n\n    vm.load_data(ptr_cheated_block_info, &new_block_info)\n        .unwrap();\n    ptr_cheated_block_info\n}\n\nfn get_cheated_tx_info_ptr(\n    vm: &mut VirtualMachine,\n    original_tx_info: &[MaybeRelocatable],\n    cheated_data: &CheatedData,\n) -> Relocatable {\n    // create a new segment with replaced tx info\n    let ptr_cheated_tx_info = vm.add_memory_segment();\n\n    let mut new_tx_info = original_tx_info.to_owned();\n\n    let tx_info_mock = cheated_data.tx_info.clone();\n\n    let CheatedTxInfo {\n        version,\n        account_contract_address,\n        max_fee,\n        signature,\n        transaction_hash,\n        chain_id,\n        nonce,\n        resource_bounds,\n        tip,\n        paymaster_data,\n        nonce_data_availability_mode,\n        fee_data_availability_mode,\n        account_deployment_data,\n        proof_facts,\n    } = tx_info_mock;\n\n    if let Some(version) = version {\n        new_tx_info[0] = MaybeRelocatable::Int(version);\n    }\n    if let Some(account_contract_address) = account_contract_address {\n        new_tx_info[1] = MaybeRelocatable::Int(account_contract_address);\n    }\n    if let Some(max_fee) = max_fee {\n        new_tx_info[2] = MaybeRelocatable::Int(max_fee);\n    }\n\n    if let Some(signature) = signature {\n        let (signature_start_ptr, signature_end_ptr) = add_vec_memory_segment(&signature, vm);\n        new_tx_info[3] = signature_start_ptr.into();\n        new_tx_info[4] = signature_end_ptr.into();\n    }\n\n    if let Some(transaction_hash) = transaction_hash {\n        new_tx_info[5] = MaybeRelocatable::Int(transaction_hash);\n    }\n    if let Some(chain_id) = chain_id {\n        new_tx_info[6] = MaybeRelocatable::Int(chain_id);\n    }\n    if let Some(nonce) = nonce {\n        new_tx_info[7] = MaybeRelocatable::Int(nonce);\n    }\n    if let Some(resource_bounds) = resource_bounds {\n        let (resource_bounds_start_ptr, resource_bounds_end_ptr) = add_vec_memory_segment(\n            &SerializedValue::new(resource_bounds).serialize_to_vec(),\n            vm,\n        );\n        new_tx_info[8] = resource_bounds_start_ptr.into();\n        new_tx_info[9] = resource_bounds_end_ptr.into();\n    }\n    if let Some(tip) = tip {\n        new_tx_info[10] = MaybeRelocatable::Int(tip);\n    }\n    if let Some(paymaster_data) = paymaster_data {\n        let (paymaster_data_start_ptr, paymaster_data_end_ptr) =\n            add_vec_memory_segment(&paymaster_data, vm);\n        new_tx_info[11] = paymaster_data_start_ptr.into();\n        new_tx_info[12] = paymaster_data_end_ptr.into();\n    }\n    if let Some(nonce_data_availability_mode) = nonce_data_availability_mode {\n        new_tx_info[13] = MaybeRelocatable::Int(nonce_data_availability_mode);\n    }\n    if let Some(fee_data_availability_mode) = fee_data_availability_mode {\n        new_tx_info[14] = MaybeRelocatable::Int(fee_data_availability_mode);\n    }\n    if let Some(account_deployment_data) = account_deployment_data {\n        let (account_deployment_data_start_ptr, account_deployment_data_end_ptr) =\n            add_vec_memory_segment(&account_deployment_data, vm);\n        new_tx_info[15] = account_deployment_data_start_ptr.into();\n        new_tx_info[16] = account_deployment_data_end_ptr.into();\n    }\n    if let Some(proof_facts) = proof_facts {\n        let (proof_facts_start_ptr, proof_facts_end_ptr) = add_vec_memory_segment(&proof_facts, vm);\n        new_tx_info[17] = proof_facts_start_ptr.into();\n        new_tx_info[18] = proof_facts_end_ptr.into();\n    }\n\n    vm.load_data(ptr_cheated_tx_info, &new_tx_info).unwrap();\n    ptr_cheated_tx_info\n}\n\npub fn get_cheated_exec_info_ptr(\n    vm: &mut VirtualMachine,\n    execution_info_ptr: Relocatable,\n    cheated_data: &CheatedData,\n) -> Relocatable {\n    let ptr_cheated_exec_info = vm.add_memory_segment();\n\n    // Initialize as old exec_info\n    let mut new_exec_info = vm.get_continuous_range(execution_info_ptr, 5).unwrap();\n    if cheated_data.block_number.is_some()\n        || cheated_data.block_timestamp.is_some()\n        || cheated_data.sequencer_address.is_some()\n    {\n        let data = vm.get_range(execution_info_ptr, 1)[0].clone();\n        if let MaybeRelocatable::RelocatableValue(block_info_ptr) = data.unwrap().into_owned() {\n            let original_block_info = vm.get_continuous_range(block_info_ptr, 3).unwrap();\n\n            let ptr_cheated_block_info =\n                get_cheated_block_info_ptr(vm, &original_block_info, cheated_data);\n            new_exec_info[0] = MaybeRelocatable::RelocatableValue(ptr_cheated_block_info);\n        }\n    }\n\n    if cheated_data.tx_info.is_mocked() {\n        let data = vm.get_range(execution_info_ptr, 2)[1].clone();\n        if let MaybeRelocatable::RelocatableValue(tx_info_ptr) = data.unwrap().into_owned() {\n            let original_tx_info = vm.get_continuous_range(tx_info_ptr, 19).unwrap();\n\n            let ptr_cheated_tx_info = get_cheated_tx_info_ptr(vm, &original_tx_info, cheated_data);\n\n            new_exec_info[1] = MaybeRelocatable::RelocatableValue(ptr_cheated_tx_info);\n        }\n    }\n\n    if let Some(caller_address) = cheated_data.caller_address {\n        new_exec_info[2] = MaybeRelocatable::Int(caller_address.into_());\n    }\n\n    if let Some(contract_address) = cheated_data.contract_address {\n        new_exec_info[3] = MaybeRelocatable::Int(contract_address.into_());\n    }\n\n    vm.load_data(ptr_cheated_exec_info, &new_exec_info).unwrap();\n\n    ptr_cheated_exec_info\n}\n\nfn add_vec_memory_segment(vector: &[Felt], vm: &mut VirtualMachine) -> (Relocatable, Relocatable) {\n    let vector_len = vector.len();\n    let vector_start_ptr = vm.add_memory_segment();\n    let vector_end_ptr = (vector_start_ptr + vector_len).unwrap();\n\n    let vector: Vec<MaybeRelocatable> = vector.iter().map(MaybeRelocatable::from).collect();\n    vm.load_data(vector_start_ptr, &vector).unwrap();\n\n    (vector_start_ptr, vector_end_ptr)\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/call_to_blockifier_runtime_extension/execution/execution_utils.rs",
    "content": "use crate::runtime_extensions::call_to_blockifier_runtime_extension::rpc::{\n    AddressOrClassHash, from_error, from_non_error,\n};\nuse crate::runtime_extensions::common::sum_syscall_usage;\nuse crate::runtime_extensions::forge_runtime_extension::{\n    get_nested_calls_syscalls_sierra_gas, get_nested_calls_syscalls_vm_resources,\n};\nuse crate::state::{CheatedData, CheatnetState};\nuse blockifier::execution::call_info::CallInfo;\nuse blockifier::execution::entry_point::{CallEntryPoint, CallType, ExecutableCallEntryPoint};\nuse blockifier::execution::errors::EntryPointExecutionError;\nuse blockifier::execution::syscalls::vm_syscall_utils::SyscallUsageMap;\n\npub(crate) fn resolve_cheated_data_for_call(\n    entry_point: &mut CallEntryPoint,\n    cheatnet_state: &mut CheatnetState,\n) -> CheatedData {\n    if let CallType::Delegate = entry_point.call_type {\n        // When a delegate call is made directly by a test contract, `top_cheated_data()` will have a default value (all fields set to `None`).\n        // Therefore, we need to get cheated data for the current contract, which is the test contract.\n        if cheatnet_state.trace_data.current_call_stack.size() == 1 {\n            cheatnet_state.get_cheated_data(entry_point.storage_address)\n        } else {\n            cheatnet_state\n                .trace_data\n                .current_call_stack\n                .top_cheated_data()\n                .clone()\n        }\n    } else {\n        let contract_address = entry_point.storage_address;\n        let cheated_data = cheatnet_state.create_cheated_data(contract_address);\n        cheatnet_state.update_cheats(&contract_address);\n        cheated_data\n    }\n}\n\npub(crate) fn update_trace_data(\n    call_info: &CallInfo,\n    syscall_usage_vm_resources: &SyscallUsageMap,\n    syscall_usage_sierra_gas: &SyscallUsageMap,\n    cheatnet_state: &mut CheatnetState,\n) {\n    let nested_syscall_usage_vm_resources =\n        get_nested_calls_syscalls_vm_resources(&cheatnet_state.trace_data.current_call_stack.top());\n    let nested_syscall_usage_sierra_gas =\n        get_nested_calls_syscalls_sierra_gas(&cheatnet_state.trace_data.current_call_stack.top());\n\n    let syscall_usage_vm_resources = sum_syscall_usage(\n        nested_syscall_usage_vm_resources,\n        syscall_usage_vm_resources,\n    );\n    let syscall_usage_sierra_gas =\n        sum_syscall_usage(nested_syscall_usage_sierra_gas, syscall_usage_sierra_gas);\n\n    let signature = cheatnet_state\n        .get_cheated_data(call_info.call.storage_address)\n        .tx_info\n        .signature\n        .unwrap_or_default();\n\n    cheatnet_state.trace_data.update_current_call(\n        call_info.resources.clone(),\n        call_info.execution.gas_consumed,\n        syscall_usage_vm_resources,\n        syscall_usage_sierra_gas,\n        from_non_error(call_info),\n        &call_info.execution.l2_to_l1_messages,\n        signature,\n        call_info.execution.events.clone(),\n    );\n}\n\n/// Clears `events` and `l2_to_l1_messages` from a reverted call and all its inner calls that did not fail.\n/// This is part of `execute_inner_call` function in Blockifier.\n/// <https://github.com/software-mansion-labs/sequencer/blob/v0.16.0-rc.1/crates/blockifier/src/execution/syscalls/syscall_base.rs#L441-L453>\npub(crate) fn clear_events_and_messages_from_reverted_call(reverted_call: &mut CallInfo) {\n    let mut stack: Vec<&mut CallInfo> = vec![reverted_call];\n    while let Some(call_info) = stack.pop() {\n        call_info.execution.events.clear();\n        call_info.execution.l2_to_l1_messages.clear();\n        // Add inner calls that did not fail to the stack.\n        // The events and l2_to_l1_messages of the failed calls were already cleared.\n        stack.extend(\n            call_info\n                .inner_calls\n                .iter_mut()\n                .filter(|call_info| !call_info.execution.failed),\n        );\n    }\n}\n\npub(crate) fn exit_error_call(\n    error: &EntryPointExecutionError,\n    cheatnet_state: &mut CheatnetState,\n    entry_point: &ExecutableCallEntryPoint,\n) {\n    let identifier = match entry_point.call_type {\n        CallType::Call => AddressOrClassHash::ContractAddress(entry_point.storage_address),\n        CallType::Delegate => AddressOrClassHash::ClassHash(entry_point.class_hash),\n    };\n    let trace_data = &mut cheatnet_state.trace_data;\n\n    // In case of a revert, clear all events and messages emitted by the current call.\n    trace_data.clear_current_call_events_and_messages();\n\n    trace_data.update_current_call_result(from_error(error, &identifier));\n    trace_data.exit_nested_call();\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/call_to_blockifier_runtime_extension/execution/mod.rs",
    "content": "pub mod cairo1_execution;\npub mod calls;\npub mod cheated_syscalls;\npub mod deprecated;\npub mod entry_point;\npub mod execution_info;\npub mod execution_utils;\npub mod syscall_hooks;\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/call_to_blockifier_runtime_extension/execution/syscall_hooks.rs",
    "content": "use crate::runtime_extensions::forge_runtime_extension::cheatcodes::spy_messages_to_l1::MessageToL1;\nuse crate::{\n    runtime_extensions::forge_runtime_extension::cheatcodes::spy_events::Event,\n    state::CheatnetState,\n};\nuse blockifier::execution::call_info::OrderedL2ToL1Message;\nuse blockifier::execution::{\n    call_info::OrderedEvent, deprecated_syscalls::hint_processor::DeprecatedSyscallHintProcessor,\n    syscalls::hint_processor::SyscallHintProcessor,\n};\nuse starknet_api::core::ContractAddress;\n\npub trait SyscallHintProcessorExt {\n    fn contract_address(&self) -> ContractAddress;\n    fn last_event(&self) -> &OrderedEvent;\n    fn last_l2_to_l1_message(&self) -> &OrderedL2ToL1Message;\n}\n\nimpl SyscallHintProcessorExt for SyscallHintProcessor<'_> {\n    fn contract_address(&self) -> ContractAddress {\n        self.base\n            .call\n            .code_address\n            .unwrap_or(self.base.call.storage_address)\n    }\n    fn last_event(&self) -> &OrderedEvent {\n        self.base.events.last().unwrap()\n    }\n    fn last_l2_to_l1_message(&self) -> &OrderedL2ToL1Message {\n        self.base.l2_to_l1_messages.last().unwrap()\n    }\n}\n\nimpl SyscallHintProcessorExt for DeprecatedSyscallHintProcessor<'_> {\n    fn contract_address(&self) -> ContractAddress {\n        self.storage_address\n    }\n    fn last_event(&self) -> &OrderedEvent {\n        self.events.last().unwrap()\n    }\n\n    fn last_l2_to_l1_message(&self) -> &OrderedL2ToL1Message {\n        self.l2_to_l1_messages.last().unwrap()\n    }\n}\n\npub fn emit_event_hook(\n    syscall_handler: &impl SyscallHintProcessorExt,\n    cheatnet_state: &mut CheatnetState,\n) {\n    let contract_address = syscall_handler.contract_address();\n    let last_event = syscall_handler.last_event();\n    cheatnet_state\n        .detected_events\n        .push(Event::from_ordered_event(last_event, contract_address));\n}\n\npub fn send_message_to_l1_syscall_hook(\n    syscall_handler: &impl SyscallHintProcessorExt,\n    cheatnet_state: &mut CheatnetState,\n) {\n    let contract_address = syscall_handler.contract_address();\n    let last_message = syscall_handler.last_l2_to_l1_message();\n\n    cheatnet_state\n        .detected_messages_to_l1\n        .push(MessageToL1::from_ordered_message(\n            last_message,\n            contract_address,\n        ));\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/call_to_blockifier_runtime_extension/mod.rs",
    "content": "use std::marker::PhantomData;\n\nuse crate::state::CheatnetState;\nuse blockifier::execution::entry_point::{CallEntryPoint, CallType};\nuse blockifier::execution::syscalls::hint_processor::{\n    OUT_OF_GAS_ERROR, SyscallHintProcessor, create_retdata_segment,\n};\nuse blockifier::execution::syscalls::syscall_base::SyscallResult;\nuse blockifier::execution::syscalls::syscall_executor::SyscallExecutor;\nuse blockifier::execution::syscalls::vm_syscall_utils::{\n    CallContractRequest, CallContractResponse, LibraryCallRequest, LibraryCallResponse, RevertData,\n    SelfOrRevert, SingleSegmentResponse, SyscallExecutorBaseError, SyscallRequestWrapper,\n    SyscallSelector,\n};\nuse blockifier::execution::syscalls::vm_syscall_utils::{\n    SyscallRequest, SyscallResponse, SyscallResponseWrapper,\n};\nuse blockifier::utils::u64_from_usize;\nuse cairo_vm::vm::{errors::hint_errors::HintError, vm_core::VirtualMachine};\nuse runtime::{ExtendedRuntime, ExtensionLogic, SyscallHandlingResult};\nuse starknet_api::contract_class::EntryPointType;\nuse starknet_api::core::ContractAddress;\nuse starknet_api::execution_resources::GasAmount;\nuse starknet_types_core::felt::Felt;\n\nuse crate::runtime_extensions::call_to_blockifier_runtime_extension::rpc::{\n    AddressOrClassHash, call_entry_point,\n};\n\nuse super::cheatable_starknet_runtime_extension::{\n    CheatableStarknetRuntime, CheatableStarknetRuntimeError,\n};\nuse conversions::string::TryFromHexStr;\nuse runtime::starknet::constants::TEST_ADDRESS;\n\npub mod execution;\npub mod panic_parser;\npub mod rpc;\n\npub struct CallToBlockifierExtension<'a> {\n    pub lifetime: &'a PhantomData<()>,\n}\n\npub type CallToBlockifierRuntime<'a> = ExtendedRuntime<CallToBlockifierExtension<'a>>;\n\nimpl<'a> ExtensionLogic for CallToBlockifierExtension<'a> {\n    type Runtime = CheatableStarknetRuntime<'a>;\n\n    fn override_system_call(\n        &mut self,\n        selector: SyscallSelector,\n        vm: &mut VirtualMachine,\n        extended_runtime: &mut Self::Runtime,\n    ) -> Result<SyscallHandlingResult, HintError> {\n        // Warning: Do not add a default (`_`) arm here.\n        // This match must remain exhaustive so that if a new syscall is introduced,\n        // we will explicitly add support for it.\n        match selector {\n            // We execute contract calls and library calls with modified blockifier\n            // This is redirected to drop ForgeRuntimeExtension\n            // and to enable executing outer calls in tests as non-revertible.\n            SyscallSelector::CallContract => {\n                self.execute_syscall(vm, call_contract_syscall, selector, extended_runtime)?;\n\n                Ok(SyscallHandlingResult::Handled)\n            }\n            SyscallSelector::LibraryCall => {\n                self.execute_syscall(vm, library_call_syscall, selector, extended_runtime)?;\n\n                Ok(SyscallHandlingResult::Handled)\n            }\n            SyscallSelector::DelegateCall\n            | SyscallSelector::DelegateL1Handler\n            | SyscallSelector::Deploy\n            | SyscallSelector::EmitEvent\n            | SyscallSelector::GetBlockHash\n            | SyscallSelector::GetBlockNumber\n            | SyscallSelector::GetBlockTimestamp\n            | SyscallSelector::GetCallerAddress\n            | SyscallSelector::GetClassHashAt\n            | SyscallSelector::GetContractAddress\n            | SyscallSelector::GetExecutionInfo\n            | SyscallSelector::GetSequencerAddress\n            | SyscallSelector::GetTxInfo\n            | SyscallSelector::GetTxSignature\n            | SyscallSelector::Keccak\n            | SyscallSelector::KeccakRound\n            | SyscallSelector::Sha256ProcessBlock\n            | SyscallSelector::LibraryCallL1Handler\n            | SyscallSelector::MetaTxV0\n            | SyscallSelector::ReplaceClass\n            | SyscallSelector::Secp256k1Add\n            | SyscallSelector::Secp256k1GetPointFromX\n            | SyscallSelector::Secp256k1GetXy\n            | SyscallSelector::Secp256k1Mul\n            | SyscallSelector::Secp256k1New\n            | SyscallSelector::Secp256r1Add\n            | SyscallSelector::Secp256r1GetPointFromX\n            | SyscallSelector::Secp256r1GetXy\n            | SyscallSelector::Secp256r1Mul\n            | SyscallSelector::Secp256r1New\n            | SyscallSelector::SendMessageToL1\n            | SyscallSelector::StorageRead\n            | SyscallSelector::StorageWrite => Ok(SyscallHandlingResult::Forwarded),\n        }\n    }\n}\n\nfn call_contract_syscall(\n    request: CallContractRequest,\n    vm: &mut VirtualMachine,\n    syscall_handler: &mut SyscallHintProcessor,\n    cheatnet_state: &mut CheatnetState,\n    remaining_gas: &mut u64,\n) -> SyscallResult<CallContractResponse> {\n    let contract_address = request.contract_address;\n\n    let entry_point = CallEntryPoint {\n        class_hash: None,\n        code_address: Some(contract_address),\n        entry_point_type: EntryPointType::External,\n        entry_point_selector: request.function_selector,\n        calldata: request.calldata,\n        storage_address: contract_address,\n        caller_address: TryFromHexStr::try_from_hex_str(TEST_ADDRESS).unwrap(),\n        call_type: CallType::Call,\n        initial_gas: *remaining_gas,\n    };\n\n    let res = call_entry_point(\n        syscall_handler,\n        cheatnet_state,\n        entry_point,\n        &AddressOrClassHash::ContractAddress(contract_address),\n        remaining_gas,\n    )?;\n\n    let segment = create_retdata_segment(vm, syscall_handler, &res.ret_data)?;\n    Ok(CallContractResponse { segment })\n}\n\nfn library_call_syscall(\n    request: LibraryCallRequest,\n    vm: &mut VirtualMachine,\n    syscall_handler: &mut SyscallHintProcessor,\n    cheatnet_state: &mut CheatnetState,\n    remaining_gas: &mut u64,\n) -> SyscallResult<LibraryCallResponse> {\n    let class_hash = request.class_hash;\n\n    let entry_point = CallEntryPoint {\n        class_hash: Some(class_hash),\n        code_address: None,\n        entry_point_type: EntryPointType::External,\n        entry_point_selector: request.function_selector,\n        calldata: request.calldata,\n        storage_address: TryFromHexStr::try_from_hex_str(TEST_ADDRESS).unwrap(),\n        caller_address: ContractAddress::default(),\n        call_type: CallType::Delegate,\n        initial_gas: *remaining_gas,\n    };\n\n    let res = call_entry_point(\n        syscall_handler,\n        cheatnet_state,\n        entry_point,\n        &AddressOrClassHash::ClassHash(class_hash),\n        remaining_gas,\n    )?;\n\n    let segment = create_retdata_segment(vm, syscall_handler, &res.ret_data)?;\n    Ok(LibraryCallResponse { segment })\n}\n\nimpl CallToBlockifierExtension<'_> {\n    // crates/blockifier/src/execution/syscalls/vm_syscall_utils.rs:677 (execute_syscall)\n    #[expect(clippy::unused_self)]\n    fn execute_syscall<Request, Response, ExecuteCallback, Error>(\n        &mut self,\n        vm: &mut VirtualMachine,\n        execute_callback: ExecuteCallback,\n        selector: SyscallSelector,\n        extended_runtime: &mut CheatableStarknetRuntime,\n    ) -> Result<(), Error>\n    where\n        Request: SyscallRequest + std::fmt::Debug,\n        Response: SyscallResponse + std::fmt::Debug,\n        Error: CheatableStarknetRuntimeError,\n        ExecuteCallback: FnOnce(\n            Request,\n            &mut VirtualMachine,\n            &mut SyscallHintProcessor<'_>,\n            &mut CheatnetState,\n            &mut u64, // Remaining gas.\n        ) -> Result<Response, Error>,\n    {\n        // region: Modified blockifier code\n        let syscall_handler = &mut extended_runtime.extended_runtime.hint_handler;\n        let cheatnet_state = &mut *extended_runtime.extension.cheatnet_state;\n\n        // Increment, since the selector was peeked into before\n        syscall_handler.syscall_ptr += 1;\n        syscall_handler.increment_syscall_count_by(&selector, 1);\n        // endregion\n\n        let syscall_gas_cost = syscall_handler\n            .get_gas_cost_from_selector(&selector)\n            .map_err(|error| SyscallExecutorBaseError::GasCost { error, selector })?;\n\n        let SyscallRequestWrapper {\n            gas_counter,\n            request,\n        } = SyscallRequestWrapper::<Request>::read(vm, syscall_handler.get_mut_syscall_ptr())?;\n\n        let syscall_gas_cost =\n            syscall_gas_cost.get_syscall_cost(u64_from_usize(request.get_linear_factor_length()));\n        let syscall_base_cost = syscall_handler.get_syscall_base_gas_cost();\n\n        // Sanity check for preventing underflow.\n        assert!(\n            syscall_gas_cost >= syscall_base_cost,\n            \"Syscall gas cost must be greater than base syscall gas cost\"\n        );\n\n        // Refund `SYSCALL_BASE_GAS_COST` as it was pre-charged.\n        // Note: It is pre-charged by the compiler: https://github.com/starkware-libs/sequencer/blob/v0.15.0-rc.2/crates/blockifier/src/blockifier_versioned_constants.rs#L1057\n        let required_gas = syscall_gas_cost - syscall_base_cost;\n\n        if gas_counter < required_gas {\n            let out_of_gas_error =\n                Felt::from_hex(OUT_OF_GAS_ERROR).map_err(SyscallExecutorBaseError::from)?;\n            let response: SyscallResponseWrapper<SingleSegmentResponse> =\n                SyscallResponseWrapper::Failure {\n                    gas_counter,\n                    revert_data: RevertData::new_normal(vec![out_of_gas_error]),\n                };\n            response.write(vm, syscall_handler.get_mut_syscall_ptr())?;\n\n            return Ok(());\n        }\n\n        let mut remaining_gas = gas_counter - required_gas;\n\n        // TODO(#3681)\n        syscall_handler.update_revert_gas_with_next_remaining_gas(GasAmount(remaining_gas));\n\n        let original_response = execute_callback(\n            request,\n            vm,\n            syscall_handler,\n            cheatnet_state,\n            &mut remaining_gas,\n        );\n\n        let response = match original_response {\n            Ok(response) => SyscallResponseWrapper::Success {\n                gas_counter: remaining_gas,\n                response,\n            },\n            Err(error) => match error.try_extract_revert() {\n                SelfOrRevert::Revert(data) => SyscallResponseWrapper::Failure {\n                    gas_counter: remaining_gas,\n                    revert_data: data,\n                },\n                SelfOrRevert::Original(err) => return Err(err),\n            },\n        };\n\n        response.write(vm, &mut syscall_handler.syscall_ptr)?;\n\n        Ok(())\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/call_to_blockifier_runtime_extension/panic_parser.rs",
    "content": "use conversions::byte_array::ByteArray;\nuse regex::Regex;\nuse starknet_types_core::felt::Felt;\nuse std::sync::LazyLock;\n\n// Regex used to extract panic data from panicking proxy contract\nstatic RE_PROXY_PREFIX: LazyLock<Regex> = LazyLock::new(|| {\n    Regex::new(r\"[\\s\\S]*Execution failed\\. Failure reason:\\nError in contract \\(.+\\):\\n([\\s\\S]*)\\.\")\n        .unwrap()\n});\n\nstatic RE_HEX: LazyLock<Regex> = LazyLock::new(|| Regex::new(\"0x[0-9a-fA-F]+\").unwrap());\n\n// CairoVM returns felts padded to 64 characters after 0x, unlike the spec's 63.\n// This regex (0x[a-fA-F0-9]{0,64}) handles the padded form and is different from the spec.\nstatic RE_ENTRYPOINT: LazyLock<Regex> = LazyLock::new(|| {\n    Regex::new(r\"Entry point EntryPointSelector\\((0x[a-fA-F0-9]{0,64})\\) not found in contract\\.\")\n        .unwrap()\n});\n\nenum PanicDataFormat {\n    ByteArray(Vec<Felt>),\n    Felts(Vec<Felt>),\n    EntryPoint(Vec<Felt>),\n}\n\nimpl From<PanicDataFormat> for Vec<Felt> {\n    fn from(value: PanicDataFormat) -> Self {\n        match value {\n            PanicDataFormat::ByteArray(v)\n            | PanicDataFormat::Felts(v)\n            | PanicDataFormat::EntryPoint(v) => v,\n        }\n    }\n}\n\nfn parse_byte_array(s: &str) -> Option<PanicDataFormat> {\n    if !s.starts_with('\\\"') {\n        return None;\n    }\n\n    let inner = s.trim_matches('\"');\n    let felts = ByteArray::from(inner).serialize_with_magic();\n    Some(PanicDataFormat::ByteArray(felts))\n}\n\nfn parse_felts(s: &str) -> Option<PanicDataFormat> {\n    // Matches `panic_data` when a proxy contract panics, either:\n    // - with a single Felt \"0x\"\n    // - with an array of Felts \"(\"\n    // The difference comes from the `format_panic_data` implementation in `blockifier`.\n    // https://github.com/starkware-libs/sequencer/blob/8211fbf1e2660884c4a9e67ddd93680495afde12/crates/starknet_api/src/execution_utils.rs\n    if !(s.starts_with(\"0x\") || s.starts_with('(')) {\n        return None;\n    }\n\n    let felts: Vec<Felt> = RE_HEX\n        .find_iter(s)\n        .map(|m| Felt::from_hex(m.as_str()).expect(\"Invalid felt in panic data\"))\n        .collect();\n\n    Some(PanicDataFormat::Felts(felts))\n}\n\nfn parse_entrypoint(s: &str) -> Option<PanicDataFormat> {\n    // These felts were chosen from `CairoHintProcessor` in order to be consistent with `cairo-test`:\n    // https://github.com/starkware-libs/cairo/blob/2ad7718591a8d2896fec2b435c509ee5a3da9fad/crates/cairo-lang-runner/src/casm_run/mod.rs#L1055-L1057\n    if RE_ENTRYPOINT.captures(s).is_some() {\n        return Some(PanicDataFormat::EntryPoint(vec![\n            Felt::from_bytes_be_slice(\"ENTRYPOINT_NOT_FOUND\".as_bytes()),\n            Felt::from_bytes_be_slice(\"ENTRYPOINT_FAILED\".as_bytes()),\n        ]));\n    }\n    None\n}\n\n/// Tries to extract panic data from a raw Starknet error string.\npub fn try_extract_panic_data(err: &str) -> Option<Vec<Felt>> {\n    let captures = RE_PROXY_PREFIX.captures(err)?;\n    let raw = captures.get(1)?.as_str();\n\n    parse_byte_array(raw)\n        .or_else(|| parse_felts(raw))\n        .or_else(|| parse_entrypoint(err))\n        .map(Into::into)\n}\n\n#[cfg(test)]\nmod test {\n    use super::*;\n    use cairo_lang_utils::byte_array::BYTE_ARRAY_MAGIC;\n    use conversions::{felt::FromShortString, string::TryFromHexStr};\n    use indoc::indoc;\n    use starknet_types_core::felt::Felt;\n    use test_case::test_case;\n\n    #[test_case(indoc!(r\"\n                    Error at pc=0:366:\n                    Got an exception while executing a hint: Execution failed. Failure reason:\n                    Error in contract (contract address: 0x0033be52b9269700771b680f5905b305864f46e78bfbe79428f4bf7a933fb02f, class hash: 0x031b4bdf7360269d8bc059935f2e44d3ad487cbb781ff57527fd4b5ec13bf659, selector: 0x032e90fe8c4355e4732f08747d73146ef03dcd019ec3498c089dce91cf40aadc):\n                    0x1.\n                    \"\n                ),\n                    Some(&vec![Felt::from(1)]); \"non ascii felt\")]\n    #[test_case(indoc!(r\"\n                    Error at pc=0:366:\n                    Got an exception while executing a hint: Execution failed. Failure reason:\n                    Error in contract (contract address: 0x0033be52b9269700771b680f5905b305864f46e78bfbe79428f4bf7a933fb02f, class hash: 0x031b4bdf7360269d8bc059935f2e44d3ad487cbb781ff57527fd4b5ec13bf659, selector: 0x032e90fe8c4355e4732f08747d73146ef03dcd019ec3498c089dce91cf40aadc):\n                    0x41 ('A').\n                    \"\n                ),\n                    Some(&vec![Felt::from(65)]); \"ascii felt\")]\n    #[test_case(indoc!(r\"\n                    Error at pc=0:366:\n                    Got an exception while executing a hint: Execution failed. Failure reason:\n                    Error in contract (contract address: 0x0033be52b9269700771b680f5905b305864f46e78bfbe79428f4bf7a933fb02f, class hash: 0x031b4bdf7360269d8bc059935f2e44d3ad487cbb781ff57527fd4b5ec13bf659, selector: 0x032e90fe8c4355e4732f08747d73146ef03dcd019ec3498c089dce91cf40aadc):\n                    (0x1, 0x41 ('A'), 0x2, 0x42 ('B')).\n                    \"\n                ),\n                    Some(&vec![Felt::from(1), Felt::from(65), Felt::from(2), Felt::from(66)]); \"mixed felts\")]\n    #[test_case(indoc!(r\"\n                    Got an exception while executing a hint: Execution failed. Failure reason:\n                    Error in contract (contract address: 0x03cda836debfed3f83aa981d7a31733da3ae4f903dde9d833509d2f985d52241, class hash: 0x07ca8b953cb041ee517951d34880631e537682103870b9b018a7b493363b9b63, selector: 0x00a4695e9e8c278609a8e9362d5abe9852a904da970c7de84f0456c777d21137):\n                    (0x54687265652073616420746967657273206174652077686561742e2054776f ('Three sad tigers ate wheat. Two'), 0x2074696765727320776572652066756c6c2e20546865206f74686572207469 (' tigers were full. The other ti'),\n                    0x676572206e6f7420736f206d756368 ('ger not so much')).\n                    \"\n                ),\n                    Some(&vec![Felt::from_hex_unchecked(\"0x54687265652073616420746967657273206174652077686561742e2054776f\"), Felt::from_hex_unchecked(\"0x2074696765727320776572652066756c6c2e20546865206f74686572207469\"), Felt::from_hex_unchecked(\"0x676572206e6f7420736f206d756368\")]); \"felt array\")]\n    fn extracting_plain_panic_data(data: &str, expected: Option<&Vec<Felt>>) {\n        assert_eq!(try_extract_panic_data(data), expected.cloned());\n    }\n\n    #[allow(clippy::needless_pass_by_value)]\n    #[test_case(indoc!(\n                    r#\"\n                    Error at pc=0:107:\n                    Got an exception while executing a hint: Execution failed. Failure reason:\n                    Error in contract (contract address: 0x03cda836debfed3f83aa981d7a31733da3ae4f903dde9d833509d2f985d52241, class hash: 0x07ca8b953cb041ee517951d34880631e537682103870b9b018a7b493363b9b63, selector: 0x00a4695e9e8c278609a8e9362d5abe9852a904da970c7de84f0456c777d21137):\n                    \"wow message is exactly 31 chars\".\n                    \"#\n                ), Some(vec![\n                    Felt::try_from_hex_str(&format!(\"0x{BYTE_ARRAY_MAGIC}\")).unwrap(),\n                    Felt::from(1),\n                    Felt::from_short_string(\"wow message is exactly 31 chars\").unwrap(),\n                    Felt::from(0),\n                    Felt::from(0),\n                ]);\n                \"exactly 31 chars\"\n    )]\n    #[test_case(indoc!(\n                    r#\"\n                    Error at pc=0:107:\n                    Got an exception while executing a hint: Execution failed. Failure reason:\n                    Error in contract (contract address: 0x03cda836debfed3f83aa981d7a31733da3ae4f903dde9d833509d2f985d52241, class hash: 0x07ca8b953cb041ee517951d34880631e537682103870b9b018a7b493363b9b63, selector: 0x00a4695e9e8c278609a8e9362d5abe9852a904da970c7de84f0456c777d21137):\n                    \"\".\n                    \"#\n                ),\n                Some(vec![\n                    Felt::try_from_hex_str(&format!(\"0x{BYTE_ARRAY_MAGIC}\")).unwrap(),\n                    Felt::from(0),\n                    Felt::from(0),\n                    Felt::from(0),\n                ]);\n                \"empty string\"\n    )]\n    #[test_case(indoc!(\n                    r#\"\n                    Error at pc=0:107:\n                    Got an exception while executing a hint: Execution failed. Failure reason:\n                    Error in contract (contract address: 0x03cda836debfed3f83aa981d7a31733da3ae4f903dde9d833509d2f985d52241, class hash: 0x07ca8b953cb041ee517951d34880631e537682103870b9b018a7b493363b9b63, selector: 0x00a4695e9e8c278609a8e9362d5abe9852a904da970c7de84f0456c777d21137):\n                    \"A very long and multiline\n                    thing is also being parsed, and can\n                    also can be very long as you can see\".\n                    \"#\n                ),\n                Some(vec![\n                    Felt::try_from_hex_str(&format!(\"0x{BYTE_ARRAY_MAGIC}\")).unwrap(),\n                    Felt::from(3),\n                    Felt::from_short_string(\"A very long and multiline\\nthing\").unwrap(),\n                    Felt::from_short_string(\" is also being parsed, and can\\n\").unwrap(),\n                    Felt::from_short_string(\"also can be very long as you ca\").unwrap(),\n                    Felt::from_short_string(\"n see\").unwrap(),\n                    Felt::from(5),\n                ]);\n                \"long string\"\n    )]\n    #[test_case(\"Custom Hint Error: Invalid trace: \\\"PANIC DATA\\\"\", None; \"invalid\")]\n    fn extracting_string_panic_data(data: &str, expected: Option<Vec<Felt>>) {\n        assert_eq!(try_extract_panic_data(data), expected);\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/call_to_blockifier_runtime_extension/rpc.rs",
    "content": "use super::CheatnetState;\nuse crate::runtime_extensions::call_to_blockifier_runtime_extension::execution::entry_point::{\n    ExecuteCallEntryPointExtraOptions, clear_handled_errors, execute_call_entry_point,\n};\nuse crate::runtime_extensions::call_to_blockifier_runtime_extension::execution::execution_utils::clear_events_and_messages_from_reverted_call;\nuse crate::runtime_extensions::{\n    call_to_blockifier_runtime_extension::panic_parser::try_extract_panic_data,\n    common::create_execute_calldata,\n};\nuse blockifier::execution::call_info::{CallExecution, ExecutionSummary, Retdata};\nuse blockifier::execution::contract_class::TrackedResource;\nuse blockifier::execution::syscalls::hint_processor::{\n    ENTRYPOINT_FAILED_ERROR_FELT, SyscallExecutionError,\n};\nuse blockifier::execution::syscalls::vm_syscall_utils::SyscallExecutorBaseError;\nuse blockifier::execution::{\n    call_info::CallInfo,\n    entry_point::CallType,\n    errors::{EntryPointExecutionError, PreExecutionError},\n    syscalls::hint_processor::SyscallHintProcessor,\n};\nuse blockifier::execution::{\n    entry_point::CallEntryPoint, syscalls::vm_syscall_utils::SyscallUsageMap,\n};\nuse blockifier::state::errors::StateError;\nuse cairo_vm::vm::errors::hint_errors::HintError;\nuse conversions::{byte_array::ByteArray, serde::serialize::CairoSerialize, string::IntoHexStr};\nuse shared::utils::build_readable_text;\nuse starknet_api::core::EntryPointSelector;\nuse starknet_api::{\n    contract_class::EntryPointType,\n    core::{ClassHash, ContractAddress},\n};\nuse starknet_types_core::felt::Felt;\n\n#[derive(Clone, Debug, Default)]\npub struct UsedResources {\n    pub syscall_usage: SyscallUsageMap,\n    pub execution_summary: ExecutionSummary,\n    pub l1_handler_payload_lengths: Vec<usize>,\n}\n\n#[derive(Debug, CairoSerialize)]\npub struct CallSuccess {\n    pub ret_data: Vec<Felt>,\n}\n\nimpl From<CallFailure> for SyscallExecutionError {\n    fn from(value: CallFailure) -> Self {\n        match value {\n            CallFailure::Recoverable { panic_data } => Self::Revert {\n                error_data: panic_data,\n            },\n            // TODO(#3307):\n            // `SyscallExecutorBaseError::Hint` is chosen arbitrary to enable conversion by `try_extract_revert`\n            // in `execute_syscall` function.\n            // Ideally, we should pass the actual received error instead of a string.\n            CallFailure::Unrecoverable { msg } => Self::SyscallExecutorBase(\n                SyscallExecutorBaseError::Hint(HintError::CustomHint(Box::from(msg.to_string()))),\n            ),\n        }\n    }\n}\n\npub type CallResult = Result<CallSuccess, CallFailure>;\n\n/// Enum representing a possible call failure and its type.\n/// `Recoverable` - Meant to be caught by the user.\n/// `Unrecoverable` - Equivalent of `panic!` in rust.\n#[derive(Debug, Clone, CairoSerialize)]\npub enum CallFailure {\n    Recoverable { panic_data: Vec<Felt> },\n    Unrecoverable { msg: ByteArray },\n}\n\npub enum AddressOrClassHash {\n    ContractAddress(ContractAddress),\n    ClassHash(ClassHash),\n}\n\nimpl CallFailure {\n    /// Maps blockifier-type error, to one that can be put into memory as panic-data (or re-raised)\n    #[must_use]\n    pub fn from_execution_error(\n        err: &EntryPointExecutionError,\n        starknet_identifier: &AddressOrClassHash,\n    ) -> Self {\n        match err {\n            EntryPointExecutionError::ExecutionFailed { error_trace } => {\n                let err_data = error_trace.last_retdata.clone().0;\n\n                let err_data_str = build_readable_text(err_data.as_slice()).unwrap_or_default();\n\n                if err_data_str.contains(\"Failed to deserialize param #\")\n                    || err_data_str.contains(\"Input too long for arguments\")\n                {\n                    CallFailure::Unrecoverable {\n                        msg: ByteArray::from(err_data_str.as_str()),\n                    }\n                } else {\n                    CallFailure::Recoverable {\n                        panic_data: err_data,\n                    }\n                }\n            }\n            EntryPointExecutionError::PreExecutionError(PreExecutionError::EntryPointNotFound(\n                selector,\n            )) => {\n                let selector_hash = selector.into_hex_string();\n                let msg = match starknet_identifier {\n                    AddressOrClassHash::ContractAddress(address) => format!(\n                        \"Entry point selector {selector_hash} not found in contract {}\",\n                        address.into_hex_string()\n                    ),\n                    AddressOrClassHash::ClassHash(class_hash) => format!(\n                        \"Entry point selector {selector_hash} not found for class hash {}\",\n                        class_hash.into_hex_string()\n                    ),\n                };\n\n                let panic_data_felts = ByteArray::from(msg.as_str()).serialize_with_magic();\n\n                CallFailure::Recoverable {\n                    panic_data: panic_data_felts,\n                }\n            }\n            EntryPointExecutionError::PreExecutionError(\n                PreExecutionError::UninitializedStorageAddress(contract_address),\n            ) => {\n                let address_str = contract_address.into_hex_string();\n                let msg = format!(\"Contract not deployed at address: {address_str}\");\n\n                let panic_data_felts = ByteArray::from(msg.as_str()).serialize_with_magic();\n\n                CallFailure::Recoverable {\n                    panic_data: panic_data_felts,\n                }\n            }\n            EntryPointExecutionError::StateError(StateError::StateReadError(msg)) => {\n                CallFailure::Unrecoverable {\n                    msg: ByteArray::from(msg.as_str()),\n                }\n            }\n            error => {\n                let error_string = error.to_string();\n                if let Some(panic_data) = try_extract_panic_data(&error_string) {\n                    CallFailure::Recoverable { panic_data }\n                } else {\n                    CallFailure::Unrecoverable {\n                        msg: ByteArray::from(error_string.as_str()),\n                    }\n                }\n            }\n        }\n    }\n}\n\npub fn from_non_error(call_info: &CallInfo) -> Result<CallSuccess, CallFailure> {\n    let return_data = &call_info.execution.retdata.0;\n\n    if call_info.execution.failed {\n        return Err(CallFailure::Recoverable {\n            panic_data: return_data.clone(),\n        });\n    }\n\n    Ok(CallSuccess {\n        ret_data: return_data.clone(),\n    })\n}\n\npub fn from_error(\n    err: &EntryPointExecutionError,\n    starknet_identifier: &AddressOrClassHash,\n) -> Result<CallSuccess, CallFailure> {\n    Err(CallFailure::from_execution_error(err, starknet_identifier))\n}\n\npub fn call_l1_handler(\n    syscall_handler: &mut SyscallHintProcessor,\n    cheatnet_state: &mut CheatnetState,\n    contract_address: &ContractAddress,\n    entry_point_selector: EntryPointSelector,\n    calldata: &[Felt],\n) -> Result<CallSuccess, CallFailure> {\n    let calldata = create_execute_calldata(calldata);\n    let mut remaining_gas = i64::MAX as u64;\n    let entry_point = CallEntryPoint {\n        class_hash: None,\n        code_address: Some(*contract_address),\n        entry_point_type: EntryPointType::L1Handler,\n        entry_point_selector,\n        calldata,\n        storage_address: *contract_address,\n        caller_address: ContractAddress::default(),\n        call_type: CallType::Call,\n        initial_gas: remaining_gas,\n    };\n\n    call_entry_point(\n        syscall_handler,\n        cheatnet_state,\n        entry_point,\n        &AddressOrClassHash::ContractAddress(*contract_address),\n        &mut remaining_gas,\n    )\n}\n\npub fn call_entry_point(\n    syscall_handler: &mut SyscallHintProcessor,\n    cheatnet_state: &mut CheatnetState,\n    mut entry_point: CallEntryPoint,\n    starknet_identifier: &AddressOrClassHash,\n    remaining_gas: &mut u64,\n) -> Result<CallSuccess, CallFailure> {\n    let revert_idx = syscall_handler.base.context.revert_infos.0.len();\n    let result = execute_call_entry_point(\n        &mut entry_point,\n        syscall_handler.base.state,\n        cheatnet_state,\n        syscall_handler.base.context,\n        remaining_gas,\n        &ExecuteCallEntryPointExtraOptions {\n            trace_data_handled_by_revert_call: false,\n        },\n    )\n    .map_err(|err| CallFailure::from_execution_error(&err, starknet_identifier));\n\n    let call_info = match result {\n        Ok(call_info) => call_info,\n        Err(CallFailure::Recoverable { panic_data }) => {\n            build_failed_call_info(syscall_handler, cheatnet_state, entry_point, &panic_data)\n        }\n        Err(err) => {\n            return Err(err);\n        }\n    };\n\n    let mut raw_retdata = call_info.execution.retdata.0.clone();\n    let failed = call_info.execution.failed;\n    syscall_handler.base.inner_calls.push(call_info.clone());\n\n    if failed {\n        clear_handled_errors(&call_info, cheatnet_state);\n\n        syscall_handler\n            .base\n            .context\n            .revert(revert_idx, syscall_handler.base.state)\n            .expect(\"Failed to revert state\");\n\n        // Delete events and l2_to_l1_messages from the reverted call.\n        let reverted_call = syscall_handler.base.inner_calls.last_mut().unwrap();\n        clear_events_and_messages_from_reverted_call(reverted_call);\n\n        raw_retdata.push(ENTRYPOINT_FAILED_ERROR_FELT);\n        return Err(CallFailure::Recoverable {\n            panic_data: raw_retdata,\n        });\n    }\n\n    Ok(CallSuccess {\n        ret_data: raw_retdata,\n    })\n}\n\nfn build_failed_call_info(\n    syscall_handler: &mut SyscallHintProcessor,\n    cheatnet_state: &CheatnetState,\n    entry_point: CallEntryPoint,\n    panic_data: &[Felt],\n) -> CallInfo {\n    let storage_class_hash = syscall_handler\n        .base\n        .state\n        .get_class_hash_at(entry_point.storage_address)\n        .expect(\"There should be a class hash at the storage address\");\n    let maybe_replacement_class = cheatnet_state\n        .replaced_bytecode_contracts\n        .get(&entry_point.storage_address)\n        .copied();\n    let class_hash = entry_point\n        .class_hash\n        .or(maybe_replacement_class)\n        .unwrap_or(storage_class_hash);\n\n    let current_tracked_resource = syscall_handler\n        .base\n        .state\n        .get_compiled_class(class_hash)\n        .map_or(TrackedResource::SierraGas, |compiled_class| {\n            compiled_class.get_current_tracked_resource(syscall_handler.base.context)\n        });\n\n    CallInfo {\n        call: entry_point.into_executable(class_hash).into(),\n        execution: CallExecution {\n            retdata: Retdata(panic_data.to_vec()),\n            failed: true,\n            ..CallExecution::default()\n        },\n        tracked_resource: current_tracked_resource,\n        ..CallInfo::default()\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/cheatable_starknet_runtime_extension.rs",
    "content": "use crate::runtime_extensions::call_to_blockifier_runtime_extension::execution::{\n    cheated_syscalls, syscall_hooks,\n};\nuse crate::state::CheatnetState;\nuse anyhow::Result;\nuse blockifier::execution::syscalls::hint_processor::OUT_OF_GAS_ERROR;\nuse blockifier::execution::syscalls::hint_processor::SyscallHintProcessor;\nuse blockifier::execution::syscalls::syscall_executor::SyscallExecutor;\nuse blockifier::execution::syscalls::vm_syscall_utils::{\n    RevertData, SelfOrRevert, SyscallExecutorBaseError, SyscallRequest, SyscallRequestWrapper,\n    SyscallResponse, SyscallResponseWrapper, SyscallSelector, TryExtractRevert,\n};\nuse blockifier::utils::u64_from_usize;\nuse cairo_vm::{\n    types::relocatable::Relocatable,\n    vm::{\n        errors::{hint_errors::HintError, vm_errors::VirtualMachineError},\n        vm_core::VirtualMachine,\n    },\n};\nuse runtime::{ExtendedRuntime, ExtensionLogic, StarknetRuntime, SyscallHandlingResult};\nuse starknet_api::execution_resources::GasAmount;\nuse starknet_types_core::felt::Felt;\n\npub struct CheatableStarknetRuntimeExtension<'a> {\n    pub cheatnet_state: &'a mut CheatnetState,\n}\n\npub type CheatableStarknetRuntime<'a> = ExtendedRuntime<CheatableStarknetRuntimeExtension<'a>>;\n\nimpl<'a> ExtensionLogic for CheatableStarknetRuntimeExtension<'a> {\n    type Runtime = StarknetRuntime<'a>;\n\n    fn override_system_call(\n        &mut self,\n        selector: SyscallSelector,\n        vm: &mut VirtualMachine,\n        extended_runtime: &mut Self::Runtime,\n    ) -> Result<SyscallHandlingResult, HintError> {\n        let syscall_handler = &mut extended_runtime.hint_handler;\n\n        // Warning: Do not add a default (`_`) arm here.\n        // This match must remain exhaustive so that if a new syscall is introduced,\n        // we will explicitly add support for it.\n        match selector {\n            SyscallSelector::GetExecutionInfo => Ok(self\n                .execute_syscall(\n                    syscall_handler,\n                    vm,\n                    cheated_syscalls::get_execution_info_syscall,\n                    SyscallSelector::GetExecutionInfo,\n                )\n                .map(|()| SyscallHandlingResult::Handled)?),\n            SyscallSelector::CallContract => Ok(self\n                .execute_syscall(\n                    syscall_handler,\n                    vm,\n                    cheated_syscalls::call_contract_syscall,\n                    SyscallSelector::CallContract,\n                )\n                .map(|()| SyscallHandlingResult::Handled)?),\n            SyscallSelector::LibraryCall => Ok(self\n                .execute_syscall(\n                    syscall_handler,\n                    vm,\n                    cheated_syscalls::library_call_syscall,\n                    SyscallSelector::LibraryCall,\n                )\n                .map(|()| SyscallHandlingResult::Handled)?),\n            SyscallSelector::Deploy => Ok(self\n                .execute_syscall(\n                    syscall_handler,\n                    vm,\n                    cheated_syscalls::deploy_syscall,\n                    SyscallSelector::Deploy,\n                )\n                .map(|()| SyscallHandlingResult::Handled)?),\n            SyscallSelector::GetBlockHash => Ok(self\n                .execute_syscall(\n                    syscall_handler,\n                    vm,\n                    cheated_syscalls::get_block_hash_syscall,\n                    SyscallSelector::GetBlockHash,\n                )\n                .map(|()| SyscallHandlingResult::Handled)?),\n            SyscallSelector::StorageRead => Ok(self\n                .execute_syscall(\n                    syscall_handler,\n                    vm,\n                    cheated_syscalls::storage_read,\n                    SyscallSelector::StorageRead,\n                )\n                .map(|()| SyscallHandlingResult::Handled)?),\n            SyscallSelector::StorageWrite => Ok(self\n                .execute_syscall(\n                    syscall_handler,\n                    vm,\n                    cheated_syscalls::storage_write,\n                    SyscallSelector::StorageWrite,\n                )\n                .map(|()| SyscallHandlingResult::Handled)?),\n            SyscallSelector::MetaTxV0 => Ok(self\n                .execute_syscall(\n                    syscall_handler,\n                    vm,\n                    cheated_syscalls::meta_tx_v0_syscall,\n                    SyscallSelector::MetaTxV0,\n                )\n                .map(|()| SyscallHandlingResult::Handled)?),\n            SyscallSelector::DelegateCall\n            | SyscallSelector::DelegateL1Handler\n            | SyscallSelector::EmitEvent\n            | SyscallSelector::GetBlockNumber\n            | SyscallSelector::GetBlockTimestamp\n            | SyscallSelector::GetCallerAddress\n            | SyscallSelector::GetClassHashAt\n            | SyscallSelector::GetContractAddress\n            | SyscallSelector::GetSequencerAddress\n            | SyscallSelector::GetTxInfo\n            | SyscallSelector::GetTxSignature\n            | SyscallSelector::Keccak\n            | SyscallSelector::KeccakRound\n            | SyscallSelector::Sha256ProcessBlock\n            | SyscallSelector::LibraryCallL1Handler\n            | SyscallSelector::ReplaceClass\n            | SyscallSelector::Secp256k1Add\n            | SyscallSelector::Secp256k1GetPointFromX\n            | SyscallSelector::Secp256k1GetXy\n            | SyscallSelector::Secp256k1Mul\n            | SyscallSelector::Secp256k1New\n            | SyscallSelector::Secp256r1Add\n            | SyscallSelector::Secp256r1GetPointFromX\n            | SyscallSelector::Secp256r1GetXy\n            | SyscallSelector::Secp256r1Mul\n            | SyscallSelector::Secp256r1New\n            | SyscallSelector::SendMessageToL1 => Ok(SyscallHandlingResult::Forwarded),\n        }\n    }\n\n    fn handle_system_call_signal(\n        &mut self,\n        selector: SyscallSelector,\n        _vm: &mut VirtualMachine,\n        extended_runtime: &mut Self::Runtime,\n    ) {\n        let syscall_handler = &extended_runtime.hint_handler;\n        match selector {\n            SyscallSelector::EmitEvent => {\n                syscall_hooks::emit_event_hook(syscall_handler, self.cheatnet_state);\n            }\n            SyscallSelector::SendMessageToL1 => {\n                syscall_hooks::send_message_to_l1_syscall_hook(\n                    syscall_handler,\n                    self.cheatnet_state,\n                );\n            }\n            _ => {}\n        }\n    }\n}\n\npub fn felt_from_ptr_immutable(\n    vm: &VirtualMachine,\n    ptr: &Relocatable,\n) -> Result<Felt, VirtualMachineError> {\n    let felt = vm.get_integer(*ptr)?.into_owned();\n    Ok(felt)\n}\n\npub trait CheatableStarknetRuntimeError: TryExtractRevert + From<SyscallExecutorBaseError> {}\n\nimpl<T> CheatableStarknetRuntimeError for T where\n    T: TryExtractRevert + From<SyscallExecutorBaseError>\n{\n}\n\nimpl CheatableStarknetRuntimeExtension<'_> {\n    // crates/blockifier/src/execution/syscalls/vm_syscall_utils.rs:677 (execute_syscall)\n    fn execute_syscall<Request, Response, ExecuteCallback, Error>(\n        &mut self,\n        syscall_handler: &mut SyscallHintProcessor,\n        vm: &mut VirtualMachine,\n        execute_callback: ExecuteCallback,\n        selector: SyscallSelector,\n    ) -> Result<(), Error>\n    where\n        Request: SyscallRequest + std::fmt::Debug,\n        Response: SyscallResponse + std::fmt::Debug,\n        Error: CheatableStarknetRuntimeError,\n        ExecuteCallback: FnOnce(\n            Request,\n            &mut VirtualMachine,\n            &mut SyscallHintProcessor<'_>,\n            &mut CheatnetState,\n            &mut u64, // Remaining gas.\n        ) -> Result<Response, Error>,\n    {\n        // Increment, since the selector was peeked into before\n        syscall_handler.syscall_ptr += 1;\n        syscall_handler.increment_syscall_count_by(&selector, 1);\n\n        let syscall_gas_cost = syscall_handler\n            .get_gas_cost_from_selector(&selector)\n            .map_err(|error| SyscallExecutorBaseError::GasCost { error, selector })?;\n\n        let SyscallRequestWrapper {\n            gas_counter,\n            request,\n        } = SyscallRequestWrapper::<Request>::read(vm, &mut syscall_handler.syscall_ptr)?;\n\n        let syscall_gas_cost =\n            syscall_gas_cost.get_syscall_cost(u64_from_usize(request.get_linear_factor_length()));\n        let syscall_base_cost = syscall_handler.get_syscall_base_gas_cost();\n\n        // Sanity check for preventing underflow.\n        assert!(\n            syscall_gas_cost >= syscall_base_cost,\n            \"Syscall gas cost must be greater than base syscall gas cost\"\n        );\n\n        // Refund `SYSCALL_BASE_GAS_COST` as it was pre-charged.\n        // Note: It is pre-charged by the compiler: https://github.com/starkware-libs/sequencer/blob/v0.15.0-rc.2/crates/blockifier/src/blockifier_versioned_constants.rs#L1057\n        let required_gas = syscall_gas_cost - syscall_base_cost;\n\n        if gas_counter < required_gas {\n            //  Out of gas failure.\n            let out_of_gas_error = Felt::from_hex(OUT_OF_GAS_ERROR)\n                .expect(\"Failed to parse OUT_OF_GAS_ERROR hex string\");\n            let response: SyscallResponseWrapper<Response> = SyscallResponseWrapper::Failure {\n                gas_counter,\n                revert_data: RevertData::new_normal(vec![out_of_gas_error]),\n            };\n            response.write(vm, &mut syscall_handler.syscall_ptr)?;\n\n            return Ok(());\n        }\n\n        // Execute.\n        let mut remaining_gas = gas_counter - required_gas;\n\n        // TODO(#3681)\n        syscall_handler.update_revert_gas_with_next_remaining_gas(GasAmount(remaining_gas));\n\n        let original_response = execute_callback(\n            request,\n            vm,\n            syscall_handler,\n            self.cheatnet_state,\n            &mut remaining_gas,\n        );\n\n        let response = match original_response {\n            Ok(response) => SyscallResponseWrapper::Success {\n                gas_counter: remaining_gas,\n                response,\n            },\n            Err(error) => match error.try_extract_revert() {\n                SelfOrRevert::Revert(data) => SyscallResponseWrapper::Failure {\n                    gas_counter: remaining_gas,\n                    revert_data: data,\n                },\n                SelfOrRevert::Original(err) => return Err(err),\n            },\n        };\n\n        response.write(vm, &mut syscall_handler.syscall_ptr)?;\n\n        Ok(())\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/common.rs",
    "content": "use blockifier::blockifier_versioned_constants::VersionedConstants;\nuse blockifier::execution::syscalls::vm_syscall_utils::{SyscallSelector, SyscallUsageMap};\nuse blockifier::utils::u64_from_usize;\nuse cairo_vm::vm::runners::cairo_runner::CairoRunner;\nuse cairo_vm::vm::trace::trace_entry::RelocatedTraceEntry;\nuse starknet_api::transaction::fields::Calldata;\nuse starknet_types_core::felt::Felt;\n\n#[must_use]\npub fn create_execute_calldata(calldata: &[Felt]) -> Calldata {\n    Calldata(calldata.to_vec().into())\n}\n\n#[must_use]\npub fn sum_syscall_usage(mut a: SyscallUsageMap, b: &SyscallUsageMap) -> SyscallUsageMap {\n    for (key, value) in b {\n        a.entry(*key).or_default().call_count += value.call_count;\n        a.entry(*key).or_default().linear_factor += value.linear_factor;\n    }\n    a\n}\n\n#[must_use]\npub fn get_syscalls_gas_consumed(\n    syscall_usage: &SyscallUsageMap,\n    versioned_constants: &VersionedConstants,\n) -> u64 {\n    syscall_usage\n        .iter()\n        .map(|(selector, usage)| {\n            let syscall_gas_costs = &versioned_constants.os_constants.gas_costs.syscalls;\n            let syscall_gas_cost = syscall_gas_costs\n                .get_syscall_gas_cost(selector)\n                .unwrap_or_else(|_| {\n                    panic!(\"Failed to get syscall gas cost for selector {selector:?}\")\n                });\n\n            // `linear_factor` is relevant only for `deploy` and `meta_tx_v0` syscalls, for other syscalls it is 0\n            // `base_syscall_cost` makes an assert that `linear_factor` is 0\n            // Hence to get base cost for `deploy` we use `get_syscall_cost` with 0 as `linear_length`\n            // For other syscalls we use `base_syscall_cost`, which is also an additional check that `linear_factor` is always 0 then\n            let base_cost = match selector {\n                SyscallSelector::Deploy | SyscallSelector::MetaTxV0 => {\n                    syscall_gas_cost.get_syscall_cost(0)\n                }\n                _ => syscall_gas_cost.base_syscall_cost(),\n            };\n\n            // We want to calculate `base_cost * call_count + linear_cost * linear_factor`\n            // And it is achieved by calculating `base_cost * (call_count - 1) + base_cost + linear_cost * linear_factor`\n            // There is a field name `linear_factor` used in both `SyscallUsage` and `SyscallGasCost`\n            // In `get_syscall_cost` function `linear_length` parameter is calldata length, hence `SyscallUsage.linear_factor`\n            u64_from_usize(usage.call_count - 1) * base_cost\n                + syscall_gas_cost.get_syscall_cost(u64_from_usize(usage.linear_factor))\n        })\n        .sum()\n}\n\n#[must_use]\npub fn get_relocated_vm_trace(cairo_runner: &mut CairoRunner) -> Vec<RelocatedTraceEntry> {\n    // if vm execution failed, the trace is not relocated so we need to relocate it\n    if cairo_runner.relocated_trace.is_none() {\n        cairo_runner\n            .relocate(true, true)\n            .expect(\"relocation should not fail\");\n    }\n    cairo_runner\n        .relocated_trace\n        .clone()\n        .expect(\"relocated trace should be present\")\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/deprecated_cheatable_starknet_extension/mod.rs",
    "content": "use crate::state::CheatnetState;\nuse blockifier::execution::common_hints::HintExecutionResult;\nuse blockifier::execution::deprecated_syscalls::hint_processor::{\n    DeprecatedSyscallExecutionError, DeprecatedSyscallHintProcessor,\n};\nuse blockifier::execution::deprecated_syscalls::{\n    CallContractRequest, DeployRequest, DeployResponse, DeprecatedSyscallResult,\n    GetBlockNumberResponse, GetBlockTimestampResponse, GetContractAddressResponse,\n    LibraryCallRequest, SyscallRequest, SyscallResponse, WriteResponseResult,\n};\nuse blockifier::execution::entry_point::{CallEntryPoint, CallType, ConstructorContext};\nuse blockifier::execution::execution_utils::{\n    ReadOnlySegment, execute_deployment, write_maybe_relocatable,\n};\nuse blockifier::execution::syscalls::vm_syscall_utils::SyscallSelector;\nuse conversions::FromConv;\n\nuse ::runtime::SyscallHandlingResult;\nuse cairo_vm::types::relocatable::{MaybeRelocatable, Relocatable};\nuse cairo_vm::vm::errors::hint_errors::HintError;\nuse cairo_vm::vm::vm_core::VirtualMachine;\nuse num_traits::ToPrimitive;\nuse starknet_api::block::{BlockNumber, BlockTimestamp};\nuse starknet_api::contract_class::EntryPointType;\nuse starknet_api::core::{\n    ClassHash, ContractAddress, EntryPointSelector, calculate_contract_address,\n};\nuse starknet_api::transaction::fields::Calldata;\nuse starknet_types_core::felt::Felt;\n\nuse self::runtime::{\n    DeprecatedExtendedRuntime, DeprecatedExtensionLogic, DeprecatedStarknetRuntime,\n};\n\nuse super::call_to_blockifier_runtime_extension::execution::entry_point::non_reverting_execute_call_entry_point;\nuse super::call_to_blockifier_runtime_extension::execution::syscall_hooks;\n\npub mod runtime;\n\n#[derive(Debug)]\n// crates/blockifier/src/execution/deprecated_syscalls/mod.rs:147 (SingleSegmentResponse)\n// It is created here because fields in the original structure are private\n// so we cannot create it in call_contract_syscall\npub struct SingleSegmentResponse {\n    pub(crate) segment: ReadOnlySegment,\n}\n// crates/blockifier/src/execution/deprecated_syscalls/mod.rs:151 (SyscallResponse for SingleSegmentResponse)\nimpl SyscallResponse for SingleSegmentResponse {\n    fn write(self, vm: &mut VirtualMachine, ptr: &mut Relocatable) -> WriteResponseResult {\n        write_maybe_relocatable(vm, ptr, self.segment.length)?;\n        write_maybe_relocatable(vm, ptr, self.segment.start_ptr)?;\n        Ok(())\n    }\n}\n\npub struct DeprecatedCheatableStarknetRuntimeExtension<'a> {\n    pub cheatnet_state: &'a mut CheatnetState,\n}\n\npub type DeprecatedCheatableStarknetRuntime<'a> =\n    DeprecatedExtendedRuntime<DeprecatedCheatableStarknetRuntimeExtension<'a>>;\n\nimpl<'a> DeprecatedExtensionLogic for DeprecatedCheatableStarknetRuntimeExtension<'a> {\n    type Runtime = DeprecatedStarknetRuntime<'a>;\n\n    #[allow(clippy::too_many_lines)]\n    fn override_system_call(\n        &mut self,\n        selector: SyscallSelector,\n        vm: &mut VirtualMachine,\n        extended_runtime: &mut Self::Runtime,\n    ) -> Result<SyscallHandlingResult, HintError> {\n        let syscall_handler = &mut extended_runtime.hint_handler;\n        let contract_address = syscall_handler.storage_address;\n\n        // Warning: Do not add a default (`_`) arm here.\n        // This match must remain exhaustive so that if a new syscall is introduced,\n        // we will explicitly add support for it.\n        match selector {\n            SyscallSelector::GetCallerAddress => {\n                if let Some(caller_address) = self\n                    .cheatnet_state\n                    .get_cheated_caller_address(contract_address)\n                {\n                    // Increment, since the selector was peeked into before\n                    syscall_handler.syscall_ptr += 1;\n                    increment_syscall_count(syscall_handler, selector);\n\n                    let response = GetContractAddressResponse {\n                        address: caller_address,\n                    };\n\n                    response.write(vm, &mut syscall_handler.syscall_ptr)?;\n                    Ok(SyscallHandlingResult::Handled)\n                } else {\n                    Ok(SyscallHandlingResult::Forwarded)\n                }\n            }\n            SyscallSelector::GetBlockNumber => {\n                if let Some(block_number) = self\n                    .cheatnet_state\n                    .get_cheated_block_number(contract_address)\n                {\n                    syscall_handler.syscall_ptr += 1;\n                    increment_syscall_count(syscall_handler, selector);\n\n                    let response = GetBlockNumberResponse {\n                        block_number: BlockNumber(block_number.to_u64().unwrap()),\n                    };\n\n                    response.write(vm, &mut syscall_handler.syscall_ptr)?;\n                    Ok(SyscallHandlingResult::Handled)\n                } else {\n                    Ok(SyscallHandlingResult::Forwarded)\n                }\n            }\n            SyscallSelector::GetBlockTimestamp => {\n                if let Some(block_timestamp) = self\n                    .cheatnet_state\n                    .get_cheated_block_timestamp(contract_address)\n                {\n                    syscall_handler.syscall_ptr += 1;\n                    increment_syscall_count(syscall_handler, selector);\n\n                    let response = GetBlockTimestampResponse {\n                        block_timestamp: BlockTimestamp(block_timestamp.to_u64().unwrap()),\n                    };\n\n                    response.write(vm, &mut syscall_handler.syscall_ptr)?;\n                    Ok(SyscallHandlingResult::Handled)\n                } else {\n                    Ok(SyscallHandlingResult::Forwarded)\n                }\n            }\n            SyscallSelector::GetSequencerAddress => {\n                if let Some(sequencer_address) = self\n                    .cheatnet_state\n                    .get_cheated_sequencer_address(contract_address)\n                {\n                    syscall_handler.syscall_ptr += 1;\n                    increment_syscall_count(syscall_handler, selector);\n\n                    syscall_handler.verify_not_in_validate_mode(\"get_sequencer_address\")?;\n\n                    let response = GetContractAddressResponse {\n                        address: sequencer_address,\n                    };\n\n                    response.write(vm, &mut syscall_handler.syscall_ptr)?;\n\n                    Ok(SyscallHandlingResult::Handled)\n                } else {\n                    Ok(SyscallHandlingResult::Forwarded)\n                }\n            }\n            SyscallSelector::DelegateCall => {\n                syscall_handler.syscall_ptr += 1;\n                increment_syscall_count(syscall_handler, selector);\n\n                self.execute_syscall(vm, delegate_call, syscall_handler)?;\n                Ok(SyscallHandlingResult::Handled)\n            }\n            SyscallSelector::LibraryCall => {\n                syscall_handler.syscall_ptr += 1;\n                increment_syscall_count(syscall_handler, selector);\n\n                self.execute_syscall(vm, library_call, syscall_handler)?;\n                Ok(SyscallHandlingResult::Handled)\n            }\n            SyscallSelector::CallContract => {\n                syscall_handler.syscall_ptr += 1;\n                increment_syscall_count(syscall_handler, selector);\n\n                self.execute_syscall(vm, call_contract, syscall_handler)?;\n                Ok(SyscallHandlingResult::Handled)\n            }\n            SyscallSelector::Deploy => {\n                syscall_handler.syscall_ptr += 1;\n                increment_syscall_count(syscall_handler, selector);\n\n                self.execute_syscall(vm, deploy, syscall_handler)?;\n                Ok(SyscallHandlingResult::Handled)\n            }\n            SyscallSelector::DelegateL1Handler\n            | SyscallSelector::EmitEvent\n            | SyscallSelector::GetBlockHash\n            | SyscallSelector::GetClassHashAt\n            | SyscallSelector::GetContractAddress\n            | SyscallSelector::GetExecutionInfo\n            | SyscallSelector::GetTxInfo\n            | SyscallSelector::GetTxSignature\n            | SyscallSelector::Keccak\n            | SyscallSelector::KeccakRound\n            | SyscallSelector::Sha256ProcessBlock\n            | SyscallSelector::LibraryCallL1Handler\n            | SyscallSelector::MetaTxV0\n            | SyscallSelector::ReplaceClass\n            | SyscallSelector::Secp256k1Add\n            | SyscallSelector::Secp256k1GetPointFromX\n            | SyscallSelector::Secp256k1GetXy\n            | SyscallSelector::Secp256k1Mul\n            | SyscallSelector::Secp256k1New\n            | SyscallSelector::Secp256r1Add\n            | SyscallSelector::Secp256r1GetPointFromX\n            | SyscallSelector::Secp256r1GetXy\n            | SyscallSelector::Secp256r1Mul\n            | SyscallSelector::Secp256r1New\n            | SyscallSelector::SendMessageToL1\n            | SyscallSelector::StorageRead\n            | SyscallSelector::StorageWrite => Ok(SyscallHandlingResult::Forwarded),\n        }\n    }\n\n    fn post_syscall_hook(\n        &mut self,\n        selector: &SyscallSelector,\n        extended_runtime: &mut Self::Runtime,\n    ) {\n        let syscall_handler = &extended_runtime.hint_handler;\n        match selector {\n            SyscallSelector::EmitEvent => {\n                syscall_hooks::emit_event_hook(syscall_handler, self.cheatnet_state);\n            }\n            SyscallSelector::SendMessageToL1 => {\n                syscall_hooks::send_message_to_l1_syscall_hook(\n                    syscall_handler,\n                    self.cheatnet_state,\n                );\n            }\n            _ => {}\n        }\n    }\n}\n\nimpl DeprecatedCheatableStarknetRuntimeExtension<'_> {\n    // crates/blockifier/src/execution/deprecated_syscalls/hint_processor.rs:233\n    fn execute_syscall<Request, Response, ExecuteCallback>(\n        &mut self,\n        vm: &mut VirtualMachine,\n        execute_callback: ExecuteCallback,\n        syscall_handler: &mut DeprecatedSyscallHintProcessor,\n    ) -> HintExecutionResult\n    where\n        Request: SyscallRequest,\n        Response: SyscallResponse,\n        ExecuteCallback: FnOnce(\n            Request,\n            &mut VirtualMachine,\n            &mut DeprecatedSyscallHintProcessor,\n            &mut CheatnetState,\n        ) -> DeprecatedSyscallResult<Response>,\n    {\n        let request = Request::read(vm, &mut syscall_handler.syscall_ptr)?;\n\n        let response = execute_callback(request, vm, syscall_handler, self.cheatnet_state)?;\n        response.write(vm, &mut syscall_handler.syscall_ptr)?;\n\n        Ok(())\n    }\n}\n\n// crates/blockifier/src/execution/deprecated_syscalls/hint_processor.rs:264\nfn increment_syscall_count(\n    syscall_handler: &mut DeprecatedSyscallHintProcessor,\n    selector: SyscallSelector,\n) {\n    syscall_handler\n        .syscalls_usage\n        .entry(selector)\n        .or_default()\n        .increment_call_count();\n}\n\n//blockifier/src/execution/deprecated_syscalls/mod.rs:303 (deploy)\nfn deploy(\n    request: DeployRequest,\n    _vm: &mut VirtualMachine,\n    syscall_handler: &mut DeprecatedSyscallHintProcessor<'_>,\n    _cheatnet_state: &mut CheatnetState,\n) -> DeprecatedSyscallResult<DeployResponse> {\n    let deployer_address = syscall_handler.storage_address;\n    let deployer_address_for_calculation = if request.deploy_from_zero {\n        ContractAddress::default()\n    } else {\n        deployer_address\n    };\n    let deployed_contract_address = calculate_contract_address(\n        request.contract_address_salt,\n        request.class_hash,\n        &request.constructor_calldata,\n        deployer_address_for_calculation,\n    )?;\n\n    // Increment the Deploy syscall's linear cost counter by the number of elements in the\n    // constructor calldata.\n    let syscall_usage = syscall_handler\n        .syscalls_usage\n        .get_mut(&SyscallSelector::Deploy)\n        .expect(\"syscalls_usage entry for Deploy must be initialized\");\n    syscall_usage.linear_factor += request.constructor_calldata.0.len();\n\n    let ctor_context = ConstructorContext {\n        class_hash: request.class_hash,\n        code_address: Some(deployed_contract_address),\n        storage_address: deployed_contract_address,\n        caller_address: deployer_address,\n    };\n    let mut remaining_gas = syscall_handler\n        .context\n        .gas_costs()\n        .base\n        .default_initial_gas_cost;\n    let call_info = execute_deployment(\n        syscall_handler.state,\n        syscall_handler.context,\n        ctor_context,\n        request.constructor_calldata,\n        &mut remaining_gas,\n    )?;\n    syscall_handler.inner_calls.push(call_info);\n\n    Ok(DeployResponse {\n        contract_address: deployed_contract_address,\n    })\n}\n\n//blockifier/src/execution/deprecated_syscalls/mod.rs:182 (call_contract)\nfn call_contract(\n    request: CallContractRequest,\n    vm: &mut VirtualMachine,\n    syscall_handler: &mut DeprecatedSyscallHintProcessor<'_>,\n    cheatnet_state: &mut CheatnetState,\n) -> DeprecatedSyscallResult<SingleSegmentResponse> {\n    let storage_address = request.contract_address;\n    // Check that the call is legal if in Validate execution mode.\n    if syscall_handler.is_validate_mode() && syscall_handler.storage_address != storage_address {\n        return Err(\n            DeprecatedSyscallExecutionError::InvalidSyscallInExecutionMode {\n                syscall_name: \"call_contract\".to_string(),\n                execution_mode: syscall_handler.execution_mode(),\n            },\n        );\n    }\n    let mut entry_point = CallEntryPoint {\n        class_hash: None,\n        code_address: Some(storage_address),\n        entry_point_type: EntryPointType::External,\n        entry_point_selector: request.function_selector,\n        calldata: request.calldata,\n        storage_address,\n        caller_address: syscall_handler.storage_address,\n        call_type: CallType::Call,\n        initial_gas: syscall_handler\n            .context\n            .gas_costs()\n            .base\n            .default_initial_gas_cost,\n    };\n    let retdata_segment =\n        execute_inner_call(&mut entry_point, vm, syscall_handler, cheatnet_state)?;\n\n    Ok(SingleSegmentResponse {\n        segment: retdata_segment,\n    })\n}\n\n// blockifier/src/execution/deprecated_syscalls/mod.rs:209 (delegate_call)\nfn delegate_call(\n    request: CallContractRequest,\n    vm: &mut VirtualMachine,\n    syscall_handler: &mut DeprecatedSyscallHintProcessor<'_>,\n    cheatnet_state: &mut CheatnetState,\n) -> DeprecatedSyscallResult<SingleSegmentResponse> {\n    let call_to_external = true;\n    let storage_address = request.contract_address;\n    let class_hash = syscall_handler.state.get_class_hash_at(storage_address)?;\n    let retdata_segment = execute_library_call(\n        syscall_handler,\n        cheatnet_state,\n        vm,\n        class_hash,\n        Some(storage_address),\n        call_to_external,\n        request.function_selector,\n        request.calldata,\n    )?;\n\n    Ok(SingleSegmentResponse {\n        segment: retdata_segment,\n    })\n}\n\n// blockifier/src/execution/deprecated_syscalls/mod.rs:537 (library_call)\nfn library_call(\n    request: LibraryCallRequest,\n    vm: &mut VirtualMachine,\n    syscall_handler: &mut DeprecatedSyscallHintProcessor<'_>,\n    cheatnet_state: &mut CheatnetState,\n) -> DeprecatedSyscallResult<SingleSegmentResponse> {\n    let call_to_external = true;\n    let retdata_segment = execute_library_call(\n        syscall_handler,\n        cheatnet_state,\n        vm,\n        request.class_hash,\n        None,\n        call_to_external,\n        request.function_selector,\n        request.calldata,\n    )?;\n\n    Ok(SingleSegmentResponse {\n        segment: retdata_segment,\n    })\n}\n\n// blockifier/src/execution/deprecated_syscalls/hint_processor.rs:393 (execute_inner_call)\nfn execute_inner_call(\n    call: &mut CallEntryPoint,\n    vm: &mut VirtualMachine,\n    syscall_handler: &mut DeprecatedSyscallHintProcessor<'_>,\n    cheatnet_state: &mut CheatnetState,\n) -> DeprecatedSyscallResult<ReadOnlySegment> {\n    let mut remaining_gas = call.initial_gas;\n    // region: Modified blockifier code\n    let call_info = non_reverting_execute_call_entry_point(\n        call,\n        syscall_handler.state,\n        cheatnet_state,\n        syscall_handler.context,\n        &mut remaining_gas,\n    )?;\n    // endregion\n\n    let retdata = &call_info.execution.retdata.0;\n    let retdata: Vec<MaybeRelocatable> = retdata\n        .iter()\n        .map(|&x| MaybeRelocatable::from(Felt::from_(x)))\n        .collect();\n    let retdata_segment_start_ptr = syscall_handler.read_only_segments.allocate(vm, &retdata)?;\n\n    syscall_handler.inner_calls.push(call_info);\n    Ok(ReadOnlySegment {\n        start_ptr: retdata_segment_start_ptr,\n        length: retdata.len(),\n    })\n}\n\n// blockifier/src/execution/deprecated_syscalls/hint_processor.rs:409 (execute_library_call)\n#[expect(clippy::too_many_arguments)]\nfn execute_library_call(\n    syscall_handler: &mut DeprecatedSyscallHintProcessor<'_>,\n    cheatnet_state: &mut CheatnetState,\n    vm: &mut VirtualMachine,\n    class_hash: ClassHash,\n    code_address: Option<ContractAddress>,\n    call_to_external: bool,\n    entry_point_selector: EntryPointSelector,\n    calldata: Calldata,\n) -> DeprecatedSyscallResult<ReadOnlySegment> {\n    let entry_point_type = if call_to_external {\n        EntryPointType::External\n    } else {\n        EntryPointType::L1Handler\n    };\n    let mut entry_point = CallEntryPoint {\n        class_hash: Some(class_hash),\n        code_address,\n        entry_point_type,\n        entry_point_selector,\n        calldata,\n        // The call context remains the same in a library call.\n        storage_address: syscall_handler.storage_address,\n        caller_address: syscall_handler.caller_address,\n        call_type: CallType::Delegate,\n        initial_gas: syscall_handler\n            .context\n            .gas_costs()\n            .base\n            .default_initial_gas_cost,\n    };\n\n    execute_inner_call(&mut entry_point, vm, syscall_handler, cheatnet_state)\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/deprecated_cheatable_starknet_extension/runtime.rs",
    "content": "use crate::runtime_extensions::cheatable_starknet_runtime_extension::felt_from_ptr_immutable;\nuse anyhow::Result;\nuse blockifier::execution::{\n    deprecated_syscalls::hint_processor::DeprecatedSyscallHintProcessor, hint_code,\n    syscalls::vm_syscall_utils::SyscallSelector,\n};\nuse cairo_vm::{\n    hint_processor::{\n        builtin_hint_processor::{\n            builtin_hint_processor_definition::HintProcessorData, hint_utils::get_ptr_from_var_name,\n        },\n        hint_processor_definition::{HintProcessor, HintProcessorLogic, HintReference},\n    },\n    serde::deserialize_program::ApTracking,\n    types::{exec_scope::ExecutionScopes, relocatable::Relocatable},\n    vm::{\n        errors::{hint_errors::HintError, vm_errors::VirtualMachineError},\n        runners::cairo_runner::{ResourceTracker, RunResources},\n        vm_core::VirtualMachine,\n    },\n};\nuse runtime::{SyscallHandlingResult, SyscallPtrAccess};\nuse starknet_types_core::felt::Felt;\nuse std::sync::Arc;\nuse std::{any::Any, collections::HashMap};\n\npub struct DeprecatedStarknetRuntime<'a> {\n    pub hint_handler: DeprecatedSyscallHintProcessor<'a>,\n}\n\nimpl SyscallPtrAccess for DeprecatedStarknetRuntime<'_> {\n    fn get_mut_syscall_ptr(&mut self) -> &mut Relocatable {\n        &mut self.hint_handler.syscall_ptr\n    }\n}\n\nimpl ResourceTracker for DeprecatedStarknetRuntime<'_> {\n    fn consumed(&self) -> bool {\n        self.hint_handler.context.vm_run_resources.consumed()\n    }\n\n    fn consume_step(&mut self) {\n        self.hint_handler.context.vm_run_resources.consume_step();\n    }\n\n    fn get_n_steps(&self) -> Option<usize> {\n        self.hint_handler.context.vm_run_resources.get_n_steps()\n    }\n\n    fn run_resources(&self) -> &RunResources {\n        self.hint_handler.context.vm_run_resources.run_resources()\n    }\n}\n\nimpl HintProcessorLogic for DeprecatedStarknetRuntime<'_> {\n    fn execute_hint(\n        &mut self,\n        vm: &mut VirtualMachine,\n        exec_scopes: &mut ExecutionScopes,\n        hint_data: &Box<dyn Any>,\n    ) -> Result<(), HintError> {\n        self.hint_handler.execute_hint(vm, exec_scopes, hint_data)\n    }\n\n    fn compile_hint(\n        &self,\n        hint_code: &str,\n        ap_tracking_data: &ApTracking,\n        reference_ids: &HashMap<String, usize>,\n        references: &[HintReference],\n        accessible_scopes: &[String],\n        constants: Arc<HashMap<String, Felt>>,\n    ) -> Result<Box<dyn Any>, VirtualMachineError> {\n        self.hint_handler.compile_hint(\n            hint_code,\n            ap_tracking_data,\n            reference_ids,\n            references,\n            accessible_scopes,\n            constants,\n        )\n    }\n}\n\npub struct DeprecatedExtendedRuntime<Extension: DeprecatedExtensionLogic> {\n    pub extension: Extension,\n    pub extended_runtime: <Extension as DeprecatedExtensionLogic>::Runtime,\n}\n\nimpl<Extension: DeprecatedExtensionLogic> HintProcessorLogic\n    for DeprecatedExtendedRuntime<Extension>\n{\n    fn execute_hint(\n        &mut self,\n        vm: &mut VirtualMachine,\n        exec_scopes: &mut ExecutionScopes,\n        hint_data: &Box<dyn Any>,\n    ) -> Result<(), HintError> {\n        let hint = hint_data\n            .downcast_ref::<HintProcessorData>()\n            .ok_or(HintError::WrongHintData)?;\n        if hint_code::SYSCALL_HINTS.contains(hint.code.as_str()) {\n            return self.execute_syscall_hint(\n                vm,\n                exec_scopes,\n                hint_data,\n                &hint.ids_data,\n                &hint.ap_tracking,\n            );\n        }\n\n        self.extended_runtime\n            .execute_hint(vm, exec_scopes, hint_data)\n    }\n\n    fn compile_hint(\n        &self,\n        hint_code: &str,\n        ap_tracking_data: &ApTracking,\n        reference_ids: &HashMap<String, usize>,\n        references: &[HintReference],\n        accessible_scopes: &[String],\n        constants: Arc<HashMap<String, Felt>>,\n    ) -> Result<Box<dyn Any>, VirtualMachineError> {\n        self.extended_runtime.compile_hint(\n            hint_code,\n            ap_tracking_data,\n            reference_ids,\n            references,\n            accessible_scopes,\n            constants,\n        )\n    }\n}\n\nimpl<Extension: DeprecatedExtensionLogic> DeprecatedExtendedRuntime<Extension> {\n    fn execute_syscall_hint(\n        &mut self,\n        vm: &mut VirtualMachine,\n        exec_scopes: &mut ExecutionScopes,\n        hint_data: &Box<dyn Any>,\n        ids_data: &HashMap<String, HintReference>,\n        ap_tracking: &ApTracking,\n    ) -> Result<(), HintError> {\n        let initial_syscall_ptr = get_ptr_from_var_name(\"syscall_ptr\", vm, ids_data, ap_tracking)?;\n\n        let selector =\n            SyscallSelector::try_from(felt_from_ptr_immutable(vm, &initial_syscall_ptr)?)?;\n\n        if let SyscallHandlingResult::Handled =\n            self.extension\n                .override_system_call(selector, vm, &mut self.extended_runtime)?\n        {\n            Ok(())\n        } else {\n            self.extended_runtime\n                .execute_hint(vm, exec_scopes, hint_data)?;\n\n            self.extension\n                .post_syscall_hook(&selector, &mut self.extended_runtime);\n\n            Ok(())\n        }\n    }\n}\n\nimpl<Extension: DeprecatedExtensionLogic> SyscallPtrAccess\n    for DeprecatedExtendedRuntime<Extension>\n{\n    fn get_mut_syscall_ptr(&mut self) -> &mut Relocatable {\n        self.extended_runtime.get_mut_syscall_ptr()\n    }\n}\n\nimpl<Extension: DeprecatedExtensionLogic> ResourceTracker for DeprecatedExtendedRuntime<Extension> {\n    fn consumed(&self) -> bool {\n        self.extended_runtime.consumed()\n    }\n\n    fn consume_step(&mut self) {\n        self.extended_runtime.consume_step();\n    }\n\n    fn get_n_steps(&self) -> Option<usize> {\n        self.extended_runtime.get_n_steps()\n    }\n\n    fn run_resources(&self) -> &RunResources {\n        self.extended_runtime.run_resources()\n    }\n}\n\npub trait DeprecatedExtensionLogic {\n    type Runtime: HintProcessor + SyscallPtrAccess;\n\n    fn override_system_call(\n        &mut self,\n        _selector: SyscallSelector,\n        _vm: &mut VirtualMachine,\n        _extended_runtime: &mut Self::Runtime,\n    ) -> Result<SyscallHandlingResult, HintError> {\n        Ok(SyscallHandlingResult::Forwarded)\n    }\n\n    fn post_syscall_hook(\n        &mut self,\n        _selector: &SyscallSelector,\n        _extended_runtime: &mut Self::Runtime,\n    );\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/forge_config_extension/config.rs",
    "content": "use conversions::{byte_array::ByteArray, serde::deserialize::CairoDeserialize};\nuse serde::{\n    Deserialize, Deserializer,\n    de::{self, MapAccess, Visitor},\n};\nuse starknet_api::execution_resources::{GasAmount, GasVector};\nuse starknet_types_core::felt::Felt;\nuse std::str::FromStr;\nuse std::{fmt, num::NonZeroU32};\nuse url::Url;\n// available gas\n\n#[derive(Debug, Clone, Copy, CairoDeserialize, PartialEq)]\npub struct RawAvailableResourceBoundsConfig {\n    pub l1_gas: usize,\n    pub l1_data_gas: usize,\n    pub l2_gas: usize,\n}\n\nimpl RawAvailableResourceBoundsConfig {\n    #[must_use]\n    pub fn to_gas_vector(&self) -> GasVector {\n        GasVector {\n            l1_gas: GasAmount(self.l1_gas as u64),\n            l1_data_gas: GasAmount(self.l1_data_gas as u64),\n            l2_gas: GasAmount(self.l2_gas as u64),\n        }\n    }\n\n    #[must_use]\n    pub fn is_zero(&self) -> bool {\n        self.to_gas_vector() == GasVector::ZERO\n    }\n}\n\n// fork\n\n#[derive(Debug, Clone, CairoDeserialize, PartialEq)]\npub enum BlockId {\n    BlockTag,\n    BlockHash(Felt),\n    BlockNumber(u64),\n}\n\nimpl<'de> Deserialize<'de> for BlockId {\n    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>\n    where\n        D: Deserializer<'de>,\n    {\n        struct BlockIdVisitor;\n\n        impl<'de> Visitor<'de> for BlockIdVisitor {\n            type Value = BlockId;\n\n            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {\n                formatter.write_str(\"a map with exactly one of: tag, hash, or number\")\n            }\n\n            fn visit_map<A>(self, mut map: A) -> Result<Self::Value, A::Error>\n            where\n                A: MapAccess<'de>,\n            {\n                let mut block_id = None;\n\n                while let Some(key) = map.next_key::<String>()? {\n                    if block_id.is_some() {\n                        return Err(de::Error::custom(\n                            \"block_id must contain exactly one key: 'tag', 'hash', or 'number'\",\n                        ));\n                    }\n\n                    block_id = Some(match key.as_str() {\n                        \"tag\" => {\n                            let tag = map.next_value::<String>()?;\n                            if tag != \"latest\" {\n                                return Err(de::Error::custom(\n                                    \"block_id.tag can only be equal to latest\",\n                                ));\n                            }\n                            BlockId::BlockTag\n                        }\n                        \"hash\" => BlockId::BlockHash(\n                            Felt::from_str(&map.next_value::<String>()?)\n                                .map_err(de::Error::custom)?,\n                        ),\n                        \"number\" => BlockId::BlockNumber(\n                            map.next_value::<String>()?\n                                .parse()\n                                .map_err(de::Error::custom)?,\n                        ),\n                        unknown => {\n                            return Err(de::Error::unknown_field(\n                                unknown,\n                                &[\"tag\", \"hash\", \"number\"],\n                            ));\n                        }\n                    });\n                }\n\n                block_id.ok_or_else(|| de::Error::missing_field(\"block_id\"))\n            }\n        }\n\n        deserializer.deserialize_map(BlockIdVisitor)\n    }\n}\n\n#[derive(Debug, Clone, CairoDeserialize, PartialEq)]\npub struct InlineForkConfig {\n    pub url: Url,\n    pub block: BlockId,\n}\n\n#[derive(Debug, Clone, CairoDeserialize, PartialEq)]\npub struct OverriddenForkConfig {\n    pub name: ByteArray,\n    pub block: BlockId,\n}\n\n#[derive(Debug, Clone, CairoDeserialize, PartialEq)]\npub enum RawForkConfig {\n    Inline(InlineForkConfig),\n    Named(ByteArray),\n    Overridden(OverriddenForkConfig),\n}\n\n// fuzzer\n\n#[derive(Debug, Clone, CairoDeserialize, PartialEq)]\npub struct RawFuzzerConfig {\n    pub runs: Option<NonZeroU32>,\n    pub seed: Option<u64>,\n}\n\n// should panic\n\n#[derive(Debug, Clone, CairoDeserialize)]\npub enum Expected {\n    ShortString(Felt),\n    ByteArray(ByteArray),\n    Array(Vec<Felt>),\n    Any,\n}\n\n#[derive(Debug, Clone, CairoDeserialize)]\npub struct RawShouldPanicConfig {\n    pub expected: Expected,\n}\n\n// ignore\n\n#[derive(Debug, Clone, CairoDeserialize)]\npub struct RawIgnoreConfig {\n    pub is_ignored: bool,\n}\n\n// disable strk predeployment\n\n#[derive(Debug, Clone, CairoDeserialize)]\npub struct RawPredeployedContractsConfig {\n    pub is_disabled: bool,\n}\n\n// config\n\n#[derive(Debug, Default, Clone)]\npub struct RawForgeConfig {\n    pub fork: Option<RawForkConfig>,\n    pub available_gas: Option<RawAvailableResourceBoundsConfig>,\n    pub ignore: Option<RawIgnoreConfig>,\n    pub should_panic: Option<RawShouldPanicConfig>,\n    pub fuzzer: Option<RawFuzzerConfig>,\n    pub disable_predeployed_contracts: Option<RawPredeployedContractsConfig>,\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/forge_config_extension.rs",
    "content": "use cairo_vm::vm::vm_core::VirtualMachine;\nuse config::RawForgeConfig;\nuse conversions::serde::deserialize::BufferReader;\nuse runtime::{CheatcodeHandlingResult, EnhancedHintError, ExtensionLogic, StarknetRuntime};\n\npub mod config;\n\npub struct ForgeConfigExtension<'a> {\n    pub config: &'a mut RawForgeConfig,\n}\n\n// This runtime extension provides an implementation logic for snforge configuration run.\nimpl<'a> ExtensionLogic for ForgeConfigExtension<'a> {\n    type Runtime = StarknetRuntime<'a>;\n\n    fn handle_cheatcode(\n        &mut self,\n        selector: &str,\n        mut input_reader: BufferReader<'_>,\n        _extended_runtime: &mut Self::Runtime,\n        _vm: &VirtualMachine,\n    ) -> Result<CheatcodeHandlingResult, EnhancedHintError> {\n        macro_rules! config_cheatcode {\n            ( $prop:ident) => {{\n                self.config.$prop = Some(input_reader.read()?);\n\n                Ok(CheatcodeHandlingResult::from_serializable(()))\n            }};\n        }\n\n        match selector {\n            \"set_config_fork\" => config_cheatcode!(fork),\n            \"set_config_available_gas\" => config_cheatcode!(available_gas),\n            \"set_config_ignore\" => config_cheatcode!(ignore),\n            \"set_config_disable_contracts\" => config_cheatcode!(disable_predeployed_contracts),\n            \"set_config_should_panic\" => config_cheatcode!(should_panic),\n            \"set_config_fuzzer\" => config_cheatcode!(fuzzer),\n            \"is_config_mode\" => Ok(CheatcodeHandlingResult::from_serializable(true)),\n            _ => Ok(CheatcodeHandlingResult::Forwarded),\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/forge_runtime_extension/cheatcodes/cheat_account_contract_address.rs",
    "content": "use crate::{\n    runtime_extensions::forge_runtime_extension::cheatcodes::cheat_execution_info::{\n        CheatArguments, ExecutionInfoMockOperations, Operation, TxInfoMockOperations,\n    },\n    state::{CheatSpan, CheatnetState},\n};\nuse starknet_api::core::ContractAddress;\n\nimpl CheatnetState {\n    pub fn cheat_account_contract_address(\n        &mut self,\n        target: ContractAddress,\n        account_contract_address: ContractAddress,\n        span: CheatSpan,\n    ) {\n        self.cheat_execution_info(ExecutionInfoMockOperations {\n            tx_info: TxInfoMockOperations {\n                account_contract_address: Operation::Start(CheatArguments {\n                    value: account_contract_address.into(),\n                    span,\n                    target,\n                }),\n                ..Default::default()\n            },\n            ..Default::default()\n        });\n    }\n\n    pub fn start_cheat_account_contract_address(\n        &mut self,\n        target: ContractAddress,\n        account_contract_address: ContractAddress,\n    ) {\n        self.cheat_account_contract_address(\n            target,\n            account_contract_address,\n            CheatSpan::Indefinite,\n        );\n    }\n\n    pub fn stop_cheat_account_contract_address(&mut self, target: ContractAddress) {\n        self.cheat_execution_info(ExecutionInfoMockOperations {\n            tx_info: TxInfoMockOperations {\n                account_contract_address: Operation::Stop(target),\n                ..Default::default()\n            },\n            ..Default::default()\n        });\n    }\n\n    pub fn start_cheat_account_contract_address_global(\n        &mut self,\n        account_contract_address: ContractAddress,\n    ) {\n        self.cheat_execution_info(ExecutionInfoMockOperations {\n            tx_info: TxInfoMockOperations {\n                account_contract_address: Operation::StartGlobal(account_contract_address.into()),\n                ..Default::default()\n            },\n            ..Default::default()\n        });\n    }\n\n    pub fn stop_cheat_account_contract_address_global(\n        &mut self,\n        account_contract_address: ContractAddress,\n    ) {\n        self.cheat_execution_info(ExecutionInfoMockOperations {\n            tx_info: TxInfoMockOperations {\n                account_contract_address: Operation::StartGlobal(account_contract_address.into()),\n                ..Default::default()\n            },\n            ..Default::default()\n        });\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/forge_runtime_extension/cheatcodes/cheat_block_hash.rs",
    "content": "use crate::CheatnetState;\nuse crate::runtime_extensions::forge_runtime_extension::cheatcodes::cheat_execution_info::{\n    CheatArguments, Operation,\n};\nuse crate::state::CheatSpan;\nuse blockifier::execution::syscalls::hint_processor::SyscallHintProcessor;\nuse blockifier::execution::syscalls::syscall_base::SyscallResult;\nuse starknet_api::block::{BlockHash, BlockNumber};\nuse starknet_api::core::ContractAddress;\nuse starknet_api::hash::StarkHash;\nuse starknet_types_core::felt::Felt;\nuse std::num::NonZeroUsize;\n\nimpl CheatnetState {\n    pub fn cheat_block_hash(&mut self, block_number: u64, operation: Operation<Felt>) {\n        match operation {\n            Operation::Start(args) => {\n                let CheatArguments {\n                    value,\n                    span,\n                    target,\n                } = args;\n                self.block_hash_contracts\n                    .insert((target, block_number), (span, value));\n            }\n            Operation::Stop(contract_address) => {\n                self.block_hash_contracts\n                    .remove(&(contract_address, block_number));\n\n                if let Some((_, except)) = self.global_block_hash.get_mut(&block_number) {\n                    except.push(contract_address);\n                }\n            }\n            Operation::StartGlobal(block_hash) => {\n                self.global_block_hash\n                    .insert(block_number, (block_hash, vec![]));\n\n                self.block_hash_contracts\n                    .retain(|(_, bn), _| *bn != block_number);\n            }\n            Operation::StopGlobal => {\n                self.global_block_hash.remove(&block_number);\n\n                self.block_hash_contracts\n                    .retain(|(_, bn), _| *bn != block_number);\n            }\n            Operation::Retain => {\n                unreachable!(\"Retain operation isn't used for this cheat\")\n            }\n        }\n    }\n\n    pub fn start_cheat_block_hash(\n        &mut self,\n        contract_address: ContractAddress,\n        block_number: u64,\n        block_hash: Felt,\n    ) {\n        self.cheat_block_hash(\n            block_number,\n            Operation::Start(CheatArguments {\n                value: block_hash,\n                span: CheatSpan::Indefinite,\n                target: contract_address,\n            }),\n        );\n    }\n\n    pub fn stop_cheat_block_hash(&mut self, contract_address: ContractAddress, block_number: u64) {\n        self.cheat_block_hash(block_number, Operation::Stop(contract_address));\n    }\n\n    pub fn start_cheat_block_hash_global(&mut self, block_number: u64, block_hash: Felt) {\n        self.cheat_block_hash(block_number, Operation::StartGlobal(block_hash));\n    }\n\n    pub fn stop_cheat_block_hash_global(&mut self, block_number: u64) {\n        self.cheat_block_hash(block_number, Operation::StopGlobal);\n    }\n\n    pub fn get_cheated_block_hash_for_contract(\n        &mut self,\n        contract_address: ContractAddress,\n        block_number: u64,\n    ) -> Option<BlockHash> {\n        if let Some((cheat_span, block_hash)) = self\n            .block_hash_contracts\n            .get(&(contract_address, block_number))\n            .copied()\n        {\n            match cheat_span {\n                CheatSpan::TargetCalls(n) if n.get() == 1 => {\n                    self.block_hash_contracts\n                        .remove(&(contract_address, block_number));\n                }\n                CheatSpan::TargetCalls(num) => {\n                    let calls_number = num.get() - 1;\n                    self.block_hash_contracts.insert(\n                        (contract_address, block_number),\n                        (\n                            CheatSpan::TargetCalls(\n                                NonZeroUsize::new(calls_number)\n                                    .expect(\"`NonZeroUsize` should not be zero after decrement\"),\n                            ),\n                            block_hash,\n                        ),\n                    );\n                }\n                CheatSpan::Indefinite => {}\n            }\n            return Some(BlockHash(StarkHash::from(block_hash)));\n        }\n\n        if let Some((block_hash, except)) = self.global_block_hash.get(&block_number)\n            && !except.contains(&contract_address)\n        {\n            return Some(BlockHash(StarkHash::from(*block_hash)));\n        }\n\n        None\n    }\n\n    pub fn get_block_hash_for_contract(\n        &mut self,\n        contract_address: ContractAddress,\n        block_number: u64,\n        syscall_handler: &mut SyscallHintProcessor,\n    ) -> SyscallResult<BlockHash> {\n        let cheated_block_hash =\n            self.get_cheated_block_hash_for_contract(contract_address, block_number);\n        if let Some(cheated_block_hash) = cheated_block_hash {\n            Ok(cheated_block_hash)\n        } else {\n            Ok(BlockHash(\n                syscall_handler\n                    .base\n                    .get_block_hash(BlockNumber(block_number))?,\n            ))\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/forge_runtime_extension/cheatcodes/cheat_block_number.rs",
    "content": "use super::cheat_execution_info::{\n    BlockInfoMockOperations, CheatArguments, ExecutionInfoMockOperations, Operation,\n};\nuse crate::CheatnetState;\nuse crate::state::CheatSpan;\nuse starknet_api::core::ContractAddress;\n\nimpl CheatnetState {\n    pub fn cheat_block_number(\n        &mut self,\n        contract_address: ContractAddress,\n        block_number: u64,\n        span: CheatSpan,\n    ) {\n        self.cheat_execution_info(ExecutionInfoMockOperations {\n            block_info: BlockInfoMockOperations {\n                block_number: Operation::Start(CheatArguments {\n                    value: block_number,\n                    span,\n                    target: contract_address,\n                }),\n                ..Default::default()\n            },\n            ..Default::default()\n        });\n    }\n\n    pub fn start_cheat_block_number_global(&mut self, block_number: u64) {\n        self.cheat_execution_info(ExecutionInfoMockOperations {\n            block_info: BlockInfoMockOperations {\n                block_number: Operation::StartGlobal(block_number),\n                ..Default::default()\n            },\n            ..Default::default()\n        });\n    }\n\n    pub fn start_cheat_block_number(\n        &mut self,\n        contract_address: ContractAddress,\n        block_number: u64,\n    ) {\n        self.cheat_block_number(contract_address, block_number, CheatSpan::Indefinite);\n    }\n\n    pub fn stop_cheat_block_number(&mut self, contract_address: ContractAddress) {\n        self.cheat_execution_info(ExecutionInfoMockOperations {\n            block_info: BlockInfoMockOperations {\n                block_number: Operation::Stop(contract_address),\n                ..Default::default()\n            },\n            ..Default::default()\n        });\n    }\n\n    pub fn stop_cheat_block_number_global(&mut self) {\n        self.cheat_execution_info(ExecutionInfoMockOperations {\n            block_info: BlockInfoMockOperations {\n                block_number: Operation::StopGlobal,\n                ..Default::default()\n            },\n            ..Default::default()\n        });\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/forge_runtime_extension/cheatcodes/cheat_block_timestamp.rs",
    "content": "use super::cheat_execution_info::{\n    BlockInfoMockOperations, CheatArguments, ExecutionInfoMockOperations, Operation,\n};\nuse crate::CheatnetState;\nuse crate::state::CheatSpan;\nuse starknet_api::core::ContractAddress;\n\nimpl CheatnetState {\n    pub fn cheat_block_timestamp(\n        &mut self,\n        contract_address: ContractAddress,\n        timestamp: u64,\n        span: CheatSpan,\n    ) {\n        self.cheat_execution_info(ExecutionInfoMockOperations {\n            block_info: BlockInfoMockOperations {\n                block_timestamp: Operation::Start(CheatArguments {\n                    value: timestamp,\n                    span,\n                    target: contract_address,\n                }),\n                ..Default::default()\n            },\n            ..Default::default()\n        });\n    }\n\n    pub fn start_cheat_block_timestamp_global(&mut self, timestamp: u64) {\n        self.cheat_execution_info(ExecutionInfoMockOperations {\n            block_info: BlockInfoMockOperations {\n                block_timestamp: Operation::StartGlobal(timestamp),\n                ..Default::default()\n            },\n            ..Default::default()\n        });\n    }\n\n    pub fn start_cheat_block_timestamp(\n        &mut self,\n        contract_address: ContractAddress,\n        timestamp: u64,\n    ) {\n        self.cheat_block_timestamp(contract_address, timestamp, CheatSpan::Indefinite);\n    }\n\n    pub fn stop_cheat_block_timestamp(&mut self, contract_address: ContractAddress) {\n        self.cheat_execution_info(ExecutionInfoMockOperations {\n            block_info: BlockInfoMockOperations {\n                block_timestamp: Operation::Stop(contract_address),\n                ..Default::default()\n            },\n            ..Default::default()\n        });\n    }\n\n    pub fn stop_cheat_block_timestamp_global(&mut self) {\n        self.cheat_execution_info(ExecutionInfoMockOperations {\n            block_info: BlockInfoMockOperations {\n                block_timestamp: Operation::StopGlobal,\n                ..Default::default()\n            },\n            ..Default::default()\n        });\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/forge_runtime_extension/cheatcodes/cheat_caller_address.rs",
    "content": "use super::cheat_execution_info::{CheatArguments, ExecutionInfoMockOperations, Operation};\nuse crate::CheatnetState;\nuse crate::state::CheatSpan;\nuse starknet_api::core::ContractAddress;\n\nimpl CheatnetState {\n    pub fn cheat_caller_address(\n        &mut self,\n        target: ContractAddress,\n        caller_address: ContractAddress,\n        span: CheatSpan,\n    ) {\n        self.cheat_execution_info(ExecutionInfoMockOperations {\n            caller_address: Operation::Start(CheatArguments {\n                value: caller_address,\n                span,\n                target,\n            }),\n            ..Default::default()\n        });\n    }\n\n    pub fn start_cheat_caller_address_global(&mut self, caller_address: ContractAddress) {\n        self.cheat_execution_info(ExecutionInfoMockOperations {\n            caller_address: Operation::StartGlobal(caller_address),\n            ..Default::default()\n        });\n    }\n\n    pub fn start_cheat_caller_address(\n        &mut self,\n        target: ContractAddress,\n        caller_address: ContractAddress,\n    ) {\n        self.cheat_caller_address(target, caller_address, CheatSpan::Indefinite);\n    }\n\n    pub fn stop_cheat_caller_address(&mut self, target: ContractAddress) {\n        self.cheat_execution_info(ExecutionInfoMockOperations {\n            caller_address: Operation::Stop(target),\n            ..Default::default()\n        });\n    }\n\n    pub fn stop_cheat_caller_address_global(&mut self) {\n        self.cheat_execution_info(ExecutionInfoMockOperations {\n            caller_address: Operation::StopGlobal,\n            ..Default::default()\n        });\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/forge_runtime_extension/cheatcodes/cheat_execution_info.rs",
    "content": "use crate::{\n    CheatnetState,\n    state::{CheatSpan, CheatStatus},\n};\nuse conversions::serde::{deserialize::CairoDeserialize, serialize::CairoSerialize};\nuse starknet_api::core::ContractAddress;\nuse starknet_types_core::felt::Felt;\n\n#[derive(CairoDeserialize, Clone, Debug)]\npub struct CheatArguments<T> {\n    pub value: T,\n    pub span: CheatSpan,\n    pub target: ContractAddress,\n}\n\n#[derive(CairoDeserialize, Clone, Default, Debug)]\npub enum Operation<T> {\n    StartGlobal(T),\n    Start(CheatArguments<T>),\n    Stop(ContractAddress),\n    StopGlobal,\n    #[default]\n    Retain,\n}\n\n#[derive(CairoDeserialize, CairoSerialize, Clone, Default, Debug, Eq, PartialEq)]\npub struct ResourceBounds {\n    pub resource: Felt,\n    pub max_amount: u64,\n    pub max_price_per_unit: u128,\n}\n\n#[derive(Clone, Default, Debug, PartialEq, Eq)]\npub struct TxInfoMock {\n    pub version: CheatStatus<Felt>,\n    pub account_contract_address: CheatStatus<Felt>,\n    pub max_fee: CheatStatus<Felt>,\n    pub signature: CheatStatus<Vec<Felt>>,\n    pub transaction_hash: CheatStatus<Felt>,\n    pub chain_id: CheatStatus<Felt>,\n    pub nonce: CheatStatus<Felt>,\n    pub resource_bounds: CheatStatus<Vec<ResourceBounds>>,\n    pub tip: CheatStatus<Felt>,\n    pub paymaster_data: CheatStatus<Vec<Felt>>,\n    pub nonce_data_availability_mode: CheatStatus<Felt>,\n    pub fee_data_availability_mode: CheatStatus<Felt>,\n    pub account_deployment_data: CheatStatus<Vec<Felt>>,\n    pub proof_facts: CheatStatus<Vec<Felt>>,\n}\n\n#[derive(Clone, Default, Debug, PartialEq, Eq)]\npub struct BlockInfoMock {\n    pub block_number: CheatStatus<u64>,\n    pub block_timestamp: CheatStatus<u64>,\n    pub sequencer_address: CheatStatus<ContractAddress>,\n}\n\n#[derive(Clone, Default, Debug)]\npub struct ExecutionInfoMock {\n    pub block_info: BlockInfoMock,\n    pub tx_info: TxInfoMock,\n    pub caller_address: CheatStatus<ContractAddress>,\n    pub contract_address: CheatStatus<ContractAddress>,\n}\n\n#[derive(CairoDeserialize, Clone, Default, Debug)]\npub struct TxInfoMockOperations {\n    pub version: Operation<Felt>,\n    pub account_contract_address: Operation<Felt>,\n    pub max_fee: Operation<Felt>,\n    pub signature: Operation<Vec<Felt>>,\n    pub transaction_hash: Operation<Felt>,\n    pub chain_id: Operation<Felt>,\n    pub nonce: Operation<Felt>,\n    pub resource_bounds: Operation<Vec<ResourceBounds>>,\n    pub tip: Operation<Felt>,\n    pub paymaster_data: Operation<Vec<Felt>>,\n    pub nonce_data_availability_mode: Operation<Felt>,\n    pub fee_data_availability_mode: Operation<Felt>,\n    pub account_deployment_data: Operation<Vec<Felt>>,\n    pub proof_facts: Operation<Vec<Felt>>,\n}\n\n#[derive(CairoDeserialize, Clone, Default, Debug)]\npub struct BlockInfoMockOperations {\n    pub block_number: Operation<u64>,\n    pub block_timestamp: Operation<u64>,\n    pub sequencer_address: Operation<ContractAddress>,\n}\n\n#[derive(CairoDeserialize, Clone, Default, Debug)]\npub struct ExecutionInfoMockOperations {\n    pub block_info: BlockInfoMockOperations,\n    pub tx_info: TxInfoMockOperations,\n    pub caller_address: Operation<ContractAddress>,\n    pub contract_address: Operation<ContractAddress>,\n}\n\nmacro_rules! for_all_fields {\n    ($macro:ident!) => {\n        $macro!(caller_address);\n        $macro!(contract_address);\n\n        $macro!(block_info.block_number);\n        $macro!(block_info.block_timestamp);\n        $macro!(block_info.sequencer_address);\n\n        $macro!(tx_info.version);\n        $macro!(tx_info.account_contract_address);\n        $macro!(tx_info.max_fee);\n        $macro!(tx_info.signature);\n        $macro!(tx_info.transaction_hash);\n        $macro!(tx_info.chain_id);\n        $macro!(tx_info.nonce);\n        $macro!(tx_info.resource_bounds);\n        $macro!(tx_info.tip);\n        $macro!(tx_info.paymaster_data);\n        $macro!(tx_info.nonce_data_availability_mode);\n        $macro!(tx_info.fee_data_availability_mode);\n        $macro!(tx_info.account_deployment_data);\n        $macro!(tx_info.proof_facts);\n    };\n}\n\nimpl CheatnetState {\n    pub fn get_cheated_execution_info_for_contract(\n        &mut self,\n        target: ContractAddress,\n    ) -> &mut ExecutionInfoMock {\n        self.cheated_execution_info_contracts\n            .entry(target)\n            .or_insert_with(|| self.global_cheated_execution_info.clone())\n    }\n\n    pub fn cheat_execution_info(&mut self, execution_info_mock: ExecutionInfoMockOperations) {\n        macro_rules! cheat {\n            ($($path:ident).+) => {\n                match execution_info_mock.$($path).+ {\n                    Operation::Retain => {}\n                    Operation::Start(CheatArguments {\n                        value,\n                        span,\n                        target,\n                    }) => {\n                        let cheated_info = self.get_cheated_execution_info_for_contract(target);\n\n                        cheated_info.$($path).+ = CheatStatus::Cheated(value, span);\n                    }\n                    Operation::Stop(target) => {\n                        let cheated_info = self.get_cheated_execution_info_for_contract(target);\n\n                        cheated_info.$($path).+ = CheatStatus::Uncheated;\n                    }\n                    Operation::StartGlobal(value) => {\n                        self.global_cheated_execution_info.$($path).+ =\n                            CheatStatus::Cheated(value.clone(), CheatSpan::Indefinite);\n\n                        for val in self.cheated_execution_info_contracts.values_mut() {\n                            val.$($path).+ = CheatStatus::Cheated(value.clone(), CheatSpan::Indefinite);\n                        }\n                    }\n                    Operation::StopGlobal => {\n                        self.global_cheated_execution_info.$($path).+ = CheatStatus::Uncheated;\n\n                        for val in self.cheated_execution_info_contracts.values_mut() {\n                            val.$($path).+ = CheatStatus::Uncheated;\n                        }\n                    }\n                };\n            };\n        }\n\n        for_all_fields!(cheat!);\n    }\n\n    pub fn progress_cheated_execution_info(&mut self, address: ContractAddress) {\n        let mocks = self.get_cheated_execution_info_for_contract(address);\n\n        macro_rules! decrement {\n            ($($path:ident).+) => {\n                mocks.$($path).+.decrement_cheat_span();\n            };\n        }\n\n        for_all_fields!(decrement!);\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/forge_runtime_extension/cheatcodes/cheat_sequencer_address.rs",
    "content": "use super::cheat_execution_info::{\n    BlockInfoMockOperations, CheatArguments, ExecutionInfoMockOperations, Operation,\n};\nuse crate::CheatnetState;\nuse crate::state::CheatSpan;\nuse starknet_api::core::ContractAddress;\n\nimpl CheatnetState {\n    pub fn cheat_sequencer_address(\n        &mut self,\n        contract_address: ContractAddress,\n        sequencer_address: ContractAddress,\n        span: CheatSpan,\n    ) {\n        self.cheat_execution_info(ExecutionInfoMockOperations {\n            block_info: BlockInfoMockOperations {\n                sequencer_address: Operation::Start(CheatArguments {\n                    value: sequencer_address,\n                    span,\n                    target: contract_address,\n                }),\n                ..Default::default()\n            },\n            ..Default::default()\n        });\n    }\n\n    pub fn start_cheat_sequencer_address(\n        &mut self,\n        contract_address: ContractAddress,\n        sequencer_address: ContractAddress,\n    ) {\n        self.cheat_sequencer_address(contract_address, sequencer_address, CheatSpan::Indefinite);\n    }\n\n    pub fn start_cheat_sequencer_address_global(&mut self, sequencer_address: ContractAddress) {\n        self.cheat_execution_info(ExecutionInfoMockOperations {\n            block_info: BlockInfoMockOperations {\n                sequencer_address: Operation::StartGlobal(sequencer_address),\n                ..Default::default()\n            },\n            ..Default::default()\n        });\n    }\n\n    pub fn stop_cheat_sequencer_address(&mut self, contract_address: ContractAddress) {\n        self.cheat_execution_info(ExecutionInfoMockOperations {\n            block_info: BlockInfoMockOperations {\n                sequencer_address: Operation::Stop(contract_address),\n                ..Default::default()\n            },\n            ..Default::default()\n        });\n    }\n\n    pub fn stop_cheat_sequencer_address_global(&mut self) {\n        self.cheat_execution_info(ExecutionInfoMockOperations {\n            block_info: BlockInfoMockOperations {\n                sequencer_address: Operation::StopGlobal,\n                ..Default::default()\n            },\n            ..Default::default()\n        });\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/forge_runtime_extension/cheatcodes/declare.rs",
    "content": "use crate::constants::get_current_sierra_version;\nuse crate::runtime_extensions::forge_runtime_extension::{\n    cheatcodes::{CheatcodeError, EnhancedHintError},\n    contracts_data::ContractsData,\n};\nuse anyhow::{Context, Result};\nuse blockifier::execution::contract_class::{CompiledClassV1, RunnableCompiledClass};\n#[cfg(feature = \"cairo-native\")]\nuse blockifier::execution::native::contract_class::NativeCompiledClassV1;\nuse blockifier::state::{errors::StateError, state_api::State};\nuse conversions::IntoConv;\nuse conversions::serde::serialize::CairoSerialize;\nuse scarb_api::StarknetContractArtifacts;\nuse starknet_api::core::{ClassHash, CompiledClassHash};\nuse starknet_rust::core::types::contract::SierraClass;\n\n#[derive(CairoSerialize)]\npub enum DeclareResult {\n    Success(ClassHash),\n    AlreadyDeclared(ClassHash),\n}\n\npub fn declare(\n    state: &mut dyn State,\n    contract_name: &str,\n    contracts_data: &ContractsData,\n) -> Result<DeclareResult, CheatcodeError> {\n    let contract_artifact = contracts_data\n        .get_artifacts(contract_name)\n        .with_context(|| format!(\"Failed to get contract artifact for name = {contract_name}.\"))\n        .map_err(EnhancedHintError::from)?;\n\n    let contract_class = get_contract_class(contract_artifact);\n\n    let class_hash = *contracts_data\n        .get_class_hash(contract_name)\n        .expect(\"Failed to get class hash\");\n\n    match state.get_compiled_class(class_hash) {\n        Err(StateError::UndeclaredClassHash(_)) => {\n            // Class is undeclared; declare it.\n\n            state\n                .set_contract_class(class_hash, contract_class)\n                .map_err(EnhancedHintError::from)?;\n\n            // NOTE: Compiled class hash is being set to 0 here\n            // because it is currently only used in verification\n            // and we haven't found a way to calculate it easily\n            state\n                .set_compiled_class_hash(class_hash, CompiledClassHash::default())\n                .unwrap_or_else(|err| panic!(\"Failed to set compiled class hash: {err:?}\"));\n            Ok(DeclareResult::Success(class_hash))\n        }\n        Err(error) => Err(CheatcodeError::Unrecoverable(EnhancedHintError::State(\n            error,\n        ))),\n        Ok(_) => {\n            // Class is already declared, cannot redeclare\n            // (i.e., make sure the leaf is uninitialized).\n            Ok(DeclareResult::AlreadyDeclared(class_hash))\n        }\n    }\n}\n\npub fn get_class_hash(sierra_class: &SierraClass) -> Result<ClassHash> {\n    Ok(sierra_class.class_hash()?.into_())\n}\n\nfn get_contract_class(contract_artifact: &StarknetContractArtifacts) -> RunnableCompiledClass {\n    let contract_class =\n        CompiledClassV1::try_from((contract_artifact.casm.clone(), get_current_sierra_version()))\n            .expect(\"Failed to read contract class from json\");\n\n    #[cfg(feature = \"cairo-native\")]\n    return match &contract_artifact.executor {\n        None => RunnableCompiledClass::V1(contract_class),\n        Some(executor) => RunnableCompiledClass::V1Native(NativeCompiledClassV1::new(\n            executor.clone(),\n            contract_class,\n        )),\n    };\n    #[cfg(not(feature = \"cairo-native\"))]\n    RunnableCompiledClass::V1(contract_class)\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/forge_runtime_extension/cheatcodes/generate_random_felt.rs",
    "content": "use num_bigint::{BigUint, RandBigInt};\nuse starknet_types_core::felt::Felt;\n\n#[must_use]\npub fn generate_random_felt() -> Felt {\n    let mut rng = rand::thread_rng();\n\n    let random_number: BigUint = rng.gen_biguint(251);\n    Felt::from(random_number)\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/forge_runtime_extension/cheatcodes/get_class_hash.rs",
    "content": "use crate::runtime_extensions::forge_runtime_extension::cheatcodes::{\n    CheatcodeError, EnhancedHintError,\n};\nuse blockifier::state::state_api::State;\nuse starknet_api::core::{ClassHash, ContractAddress};\n\n/// Gets the class hash at the given address.\npub fn get_class_hash(\n    state: &mut dyn State,\n    contract_address: ContractAddress,\n) -> Result<ClassHash, CheatcodeError> {\n    match state.get_class_hash_at(contract_address) {\n        Ok(class_hash) => Ok(class_hash),\n        Err(e) => Err(CheatcodeError::Unrecoverable(EnhancedHintError::State(e))),\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/forge_runtime_extension/cheatcodes/l1_handler_execute.rs",
    "content": "use crate::{\n    runtime_extensions::call_to_blockifier_runtime_extension::rpc::{CallResult, call_l1_handler},\n    state::CheatnetState,\n};\nuse blockifier::execution::syscalls::hint_processor::SyscallHintProcessor;\nuse starknet_api::core::{ContractAddress, EntryPointSelector};\nuse starknet_types_core::felt::Felt;\n\npub fn l1_handler_execute(\n    syscall_handler: &mut SyscallHintProcessor,\n    cheatnet_state: &mut CheatnetState,\n    contract_address: ContractAddress,\n    function_selector: EntryPointSelector,\n    from_address: Felt,\n    payload: &[Felt],\n) -> CallResult {\n    let mut calldata = vec![from_address];\n    calldata.extend_from_slice(payload);\n\n    call_l1_handler(\n        syscall_handler,\n        cheatnet_state,\n        &contract_address,\n        function_selector,\n        calldata.as_slice(),\n    )\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/forge_runtime_extension/cheatcodes/mock_call.rs",
    "content": "use crate::CheatnetState;\nuse crate::state::{CheatSpan, CheatStatus};\nuse starknet_api::core::{ContractAddress, EntryPointSelector};\nuse starknet_types_core::felt::Felt;\nuse std::collections::hash_map::Entry;\n\nimpl CheatnetState {\n    pub fn mock_call(\n        &mut self,\n        contract_address: ContractAddress,\n        function_selector: EntryPointSelector,\n        ret_data: &[Felt],\n        span: CheatSpan,\n    ) {\n        let contract_mocked_functions = self.mocked_functions.entry(contract_address).or_default();\n\n        contract_mocked_functions.insert(\n            function_selector,\n            CheatStatus::Cheated(ret_data.to_vec(), span),\n        );\n    }\n\n    pub fn start_mock_call(\n        &mut self,\n        contract_address: ContractAddress,\n        function_selector: EntryPointSelector,\n        ret_data: &[Felt],\n    ) {\n        self.mock_call(\n            contract_address,\n            function_selector,\n            ret_data,\n            CheatSpan::Indefinite,\n        );\n    }\n\n    pub fn stop_mock_call(\n        &mut self,\n        contract_address: ContractAddress,\n        function_selector: EntryPointSelector,\n    ) {\n        if let Entry::Occupied(mut e) = self.mocked_functions.entry(contract_address) {\n            let contract_mocked_functions = e.get_mut();\n            contract_mocked_functions.remove(&function_selector);\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/forge_runtime_extension/cheatcodes/mod.rs",
    "content": "use crate::runtime_extensions::call_to_blockifier_runtime_extension::rpc::CallFailure;\nuse cairo_vm::vm::errors::hint_errors::HintError;\nuse runtime::EnhancedHintError;\nuse starknet_types_core::felt::Felt;\n\npub mod cheat_account_contract_address;\npub mod cheat_block_hash;\npub mod cheat_block_number;\npub mod cheat_block_timestamp;\npub mod cheat_caller_address;\npub mod cheat_execution_info;\npub mod cheat_sequencer_address;\npub mod declare;\npub mod generate_random_felt;\npub mod get_class_hash;\npub mod l1_handler_execute;\npub mod mock_call;\npub mod precalculate_address;\npub mod replace_bytecode;\npub mod spy_events;\npub mod spy_messages_to_l1;\npub mod storage;\n\n/// A structure used for returning cheatcode errors in tests\n#[derive(Debug)]\npub enum CheatcodeError {\n    Recoverable(Vec<Felt>),           // Return error result in cairo\n    Unrecoverable(EnhancedHintError), // Fail whole test\n}\n\nimpl From<EnhancedHintError> for CheatcodeError {\n    fn from(error: EnhancedHintError) -> Self {\n        CheatcodeError::Unrecoverable(error)\n    }\n}\n\nimpl From<CallFailure> for CheatcodeError {\n    fn from(value: CallFailure) -> Self {\n        match value {\n            CallFailure::Recoverable { panic_data } => CheatcodeError::Recoverable(panic_data),\n            CallFailure::Unrecoverable { msg } => CheatcodeError::Unrecoverable(\n                HintError::CustomHint(Box::from(msg.to_string())).into(),\n            ),\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/forge_runtime_extension/cheatcodes/precalculate_address.rs",
    "content": "use crate::CheatnetState;\nuse crate::runtime_extensions::common::create_execute_calldata;\nuse conversions::IntoConv;\nuse runtime::starknet::constants::TEST_ADDRESS;\nuse starknet_api::core::{ClassHash, ContractAddress, calculate_contract_address};\nuse starknet_types_core::felt::Felt;\n\nimpl CheatnetState {\n    #[must_use]\n    pub fn precalculate_address(\n        &self,\n        class_hash: &ClassHash,\n        calldata: &[Felt],\n    ) -> ContractAddress {\n        let salt = self.get_salt();\n\n        let execute_calldata = create_execute_calldata(calldata);\n        let deployer_address = Felt::from_hex(TEST_ADDRESS).unwrap();\n        calculate_contract_address(\n            salt,\n            *class_hash,\n            &execute_calldata,\n            deployer_address.into_(),\n        )\n        .unwrap()\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/forge_runtime_extension/cheatcodes/replace_bytecode.rs",
    "content": "use crate::CheatnetState;\nuse conversions::serde::serialize::CairoSerialize;\nuse starknet_api::core::{ClassHash, ContractAddress};\n\nimpl CheatnetState {\n    pub fn replace_class_for_contract(\n        &mut self,\n        contract_address: ContractAddress,\n        class_hash: ClassHash,\n    ) {\n        self.replaced_bytecode_contracts\n            .insert(contract_address, class_hash);\n    }\n}\n\n#[derive(CairoSerialize)]\npub enum ReplaceBytecodeError {\n    ContractNotDeployed,\n    UndeclaredClassHash,\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/forge_runtime_extension/cheatcodes/spy_events.rs",
    "content": "use crate::CheatnetState;\nuse blockifier::execution::call_info::OrderedEvent;\nuse conversions::{FromConv, serde::serialize::CairoSerialize};\nuse starknet_api::core::ContractAddress;\nuse starknet_types_core::felt::Felt;\n\n/// Represents an emitted event. It is used in the `CheatnetState` to keep track of events\n/// emitted in the `cheatnet::src::rpc::call_contract`\n#[derive(CairoSerialize, Debug, PartialEq, Clone)]\npub struct Event {\n    pub from: ContractAddress,\n    pub keys: Vec<Felt>,\n    pub data: Vec<Felt>,\n}\n\nimpl Event {\n    #[must_use]\n    pub fn from_ordered_event(\n        ordered_event: &OrderedEvent,\n        contract_address: ContractAddress,\n    ) -> Self {\n        Self {\n            from: contract_address,\n            keys: ordered_event\n                .event\n                .keys\n                .iter()\n                .map(|key| Felt::from_(key.0))\n                .collect(),\n            data: ordered_event\n                .event\n                .data\n                .0\n                .iter()\n                .map(|el| Felt::from_(*el))\n                .collect(),\n        }\n    }\n}\n\nimpl CheatnetState {\n    pub fn get_events(&mut self, event_offset: usize) -> Vec<Event> {\n        self.detected_events[event_offset..].to_vec()\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/forge_runtime_extension/cheatcodes/spy_messages_to_l1.rs",
    "content": "use crate::state::CheatnetState;\nuse blockifier::execution::call_info::OrderedL2ToL1Message;\nuse conversions::serde::serialize::CairoSerialize;\nuse starknet_api::core::{ContractAddress, EthAddress};\nuse starknet_types_core::felt::Felt;\n\n#[derive(CairoSerialize, Clone)]\npub struct MessageToL1 {\n    from_address: ContractAddress,\n    to_address: EthAddress,\n    payload: Vec<Felt>,\n}\n\nimpl MessageToL1 {\n    #[must_use]\n    pub fn from_ordered_message(\n        ordered_message: &OrderedL2ToL1Message,\n        from_address: ContractAddress,\n    ) -> MessageToL1 {\n        Self {\n            from_address,\n            to_address: EthAddress::try_from(ordered_message.message.to_address)\n                .expect(\"this address should be valid\"),\n            payload: ordered_message\n                .message\n                .payload\n                .clone()\n                .0\n                .into_iter()\n                .map(conversions::IntoConv::into_)\n                .collect(),\n        }\n    }\n}\n\nimpl CheatnetState {\n    #[must_use]\n    pub fn get_messages_to_l1(&self, message_offset: usize) -> Vec<MessageToL1> {\n        self.detected_messages_to_l1[message_offset..].to_vec()\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/forge_runtime_extension/cheatcodes/storage.rs",
    "content": "use blockifier::state::state_api::State;\nuse conversions::{FromConv, IntoConv};\nuse starknet_api::core::{ContractAddress, EntryPointSelector, PatriciaKey};\nuse starknet_api::hash::StarkHash;\nuse starknet_api::state::StorageKey;\nuse starknet_rust::core::crypto::pedersen_hash;\nuse starknet_rust::core::utils::get_selector_from_name;\nuse starknet_types_core::felt::Felt;\nuse starknet_types_core::felt::NonZeroFelt;\n\n///\n/// # Arguments\n///\n/// * `blockifier_state`: Blockifier state reader\n/// * `target`: The address of the contract we want to target\n/// * `storage_address`: Storage address of the felt value we want to store\n/// * `value`: A felt value to write at `storage_address`\n///\n/// returns: Result<(), Error> - a result containing the error if `store` failed  \n///\npub fn store(\n    state: &mut dyn State,\n    target: ContractAddress,\n    storage_address: Felt,\n    value: Felt,\n) -> Result<(), anyhow::Error> {\n    state.set_storage_at(target, storage_key(storage_address)?, value.into_())?;\n    Ok(())\n}\n\n///\n/// # Arguments\n///\n/// * `blockifier_state`: Blockifier state reader\n/// * `target`: The address of the contract we want to target\n/// * `storage_address`: Storage address of the felt value we want to load\n///\n/// returns: Result<Vec<Felt>, Error> - a result containing the read data\n///\npub fn load(\n    state: &mut dyn State,\n    target: ContractAddress,\n    storage_address: Felt,\n) -> Result<Felt, anyhow::Error> {\n    Ok(state\n        .get_storage_at(target, storage_key(storage_address)?)?\n        .into_())\n}\n\n/// The address after hashing with pedersen, needs to be taken with a specific modulo value (2^251 - 256)\n/// For details see:\n/// <https://docs.starknet.io/architecture-and-concepts/smart-contracts/contract-storage>\n#[must_use]\nfn normalize_storage_address(address: Felt) -> Felt {\n    let modulus = NonZeroFelt::from_felt_unchecked(Felt::from(2).pow(251_u128) - Felt::from(256));\n    address.mod_floor(&modulus)\n}\n\n#[must_use]\npub fn calculate_variable_address(selector: Felt, key: Option<&[Felt]>) -> Felt {\n    let mut address: Felt = selector.into_();\n    match key {\n        None => address.into_(),\n        Some(key) => {\n            for key_part in key {\n                address = pedersen_hash(&address, &((*key_part).into_()));\n            }\n            normalize_storage_address(address).into_()\n        }\n    }\n}\n\n#[must_use]\npub fn variable_address(var_name: &str) -> Felt {\n    calculate_variable_address(selector_from_name(var_name).into_(), None)\n}\n\n#[must_use]\npub fn selector_from_name(name: &str) -> EntryPointSelector {\n    let selector = get_selector_from_name(name).unwrap();\n    selector.into_()\n}\n\npub fn storage_key(storage_address: Felt) -> Result<StorageKey, anyhow::Error> {\n    Ok(StorageKey(PatriciaKey::try_from(StarkHash::from_(\n        storage_address,\n    ))?))\n}\n\n#[must_use]\npub fn map_entry_address(var_name: &str, key: &[Felt]) -> Felt {\n    calculate_variable_address(selector_from_name(var_name).into_(), Some(key))\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/forge_runtime_extension/contracts_data.rs",
    "content": "use super::cheatcodes::declare::get_class_hash;\nuse anyhow::Result;\nuse bimap::BiMap;\nuse camino::Utf8PathBuf;\nuse conversions::IntoConv;\nuse rayon::iter::{IntoParallelIterator, IntoParallelRefIterator, ParallelIterator};\nuse runtime::starknet::constants::TEST_CONTRACT_CLASS_HASH;\nuse scarb_api::StarknetContractArtifacts;\nuse starknet_api::core::{ClassHash, EntryPointSelector};\nuse starknet_rust::core::types::contract::{AbiEntry, SierraClass};\nuse starknet_rust::core::utils::get_selector_from_name;\nuse starknet_types_core::felt::Felt;\nuse std::collections::HashMap;\n\ntype ContractName = String;\ntype FunctionName = String;\n\n#[derive(Debug, Clone, PartialEq, Default)]\npub struct ContractsData {\n    pub contracts: HashMap<ContractName, ContractData>,\n    pub class_hashes: BiMap<ContractName, ClassHash>,\n    pub selectors: HashMap<EntryPointSelector, FunctionName>,\n}\n\n#[derive(Debug, Clone, PartialEq)]\npub struct ContractData {\n    pub artifacts: StarknetContractArtifacts,\n    pub class_hash: ClassHash,\n    source_sierra_path: Utf8PathBuf,\n}\n\nimpl ContractsData {\n    pub fn try_from(\n        contracts: HashMap<ContractName, (StarknetContractArtifacts, Utf8PathBuf)>,\n    ) -> Result<Self> {\n        let parsed_contracts: HashMap<ContractName, SierraClass> = contracts\n            .par_iter()\n            .map(|(name, (artifact, _))| {\n                Ok((name.clone(), serde_json::from_str(&artifact.sierra)?))\n            })\n            .collect::<Result<_>>()?;\n\n        let class_hashes: Vec<(ContractName, ClassHash)> = parsed_contracts\n            .par_iter()\n            .map(|(name, sierra_class)| Ok((name.clone(), get_class_hash(sierra_class)?)))\n            .collect::<Result<_>>()?;\n        let class_hashes = BiMap::from_iter(class_hashes);\n\n        let contracts = contracts\n            .into_iter()\n            .map(|(name, (artifacts, source_sierra_path))| {\n                let class_hash = *class_hashes.get_by_left(&name).unwrap();\n                (\n                    name,\n                    ContractData {\n                        artifacts,\n                        class_hash,\n                        source_sierra_path,\n                    },\n                )\n            })\n            .collect();\n\n        let selectors = parsed_contracts\n            .into_par_iter()\n            .map(|(_, sierra_class)| build_name_selector_map(sierra_class.abi))\n            .flatten()\n            .collect();\n\n        Ok(ContractsData {\n            contracts,\n            class_hashes,\n            selectors,\n        })\n    }\n\n    #[must_use]\n    pub fn get_artifacts(&self, contract_name: &str) -> Option<&StarknetContractArtifacts> {\n        self.contracts\n            .get(contract_name)\n            .map(|contract| &contract.artifacts)\n    }\n\n    #[must_use]\n    pub fn get_class_hash(&self, contract_name: &str) -> Option<&ClassHash> {\n        self.contracts\n            .get(contract_name)\n            .map(|contract| &contract.class_hash)\n    }\n\n    #[must_use]\n    pub fn get_source_sierra_path(&self, contract_name: &str) -> Option<&Utf8PathBuf> {\n        self.contracts\n            .get(contract_name)\n            .map(|contract| &contract.source_sierra_path)\n    }\n\n    #[must_use]\n    pub fn get_contract_name(&self, class_hash: &ClassHash) -> Option<&ContractName> {\n        self.class_hashes.get_by_right(class_hash)\n    }\n\n    #[must_use]\n    pub fn get_function_name(\n        &self,\n        entry_point_selector: &EntryPointSelector,\n    ) -> Option<&FunctionName> {\n        self.selectors.get(entry_point_selector)\n    }\n\n    #[must_use]\n    pub fn is_fork_class_hash(&self, class_hash: &ClassHash) -> bool {\n        if class_hash.0 == Felt::from_hex_unchecked(TEST_CONTRACT_CLASS_HASH) {\n            false\n        } else {\n            !self.class_hashes.contains_right(class_hash)\n        }\n    }\n}\n\n#[must_use]\npub fn build_name_selector_map(abi: Vec<AbiEntry>) -> HashMap<EntryPointSelector, FunctionName> {\n    let mut selector_map = HashMap::new();\n    for abi_entry in abi {\n        match abi_entry {\n            AbiEntry::Interface(abi_interface) => {\n                for abi_entry in abi_interface.items {\n                    add_simple_abi_entry_to_mapping(abi_entry, &mut selector_map);\n                }\n            }\n            _ => add_simple_abi_entry_to_mapping(abi_entry, &mut selector_map),\n        }\n    }\n    selector_map\n}\n\nfn add_simple_abi_entry_to_mapping(\n    abi_entry: AbiEntry,\n    selector_map: &mut HashMap<EntryPointSelector, FunctionName>,\n) {\n    match abi_entry {\n        AbiEntry::Function(abi_function) | AbiEntry::L1Handler(abi_function) => {\n            selector_map.insert(\n                get_selector_from_name(&abi_function.name).unwrap().into_(),\n                abi_function.name,\n            );\n        }\n        AbiEntry::Constructor(abi_constructor) => {\n            selector_map.insert(\n                get_selector_from_name(&abi_constructor.name)\n                    .unwrap()\n                    .into_(),\n                abi_constructor.name,\n            );\n        }\n        _ => {}\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/forge_runtime_extension/file_operations.rs",
    "content": "use anyhow::{Result, anyhow};\nuse conversions::felt::TryInferFormat;\nuse conversions::{\n    byte_array::ByteArray, serde::serialize::SerializeToFeltVec, string::TryFromDecStr,\n};\nuse flatten_serde_json::flatten;\nuse runtime::EnhancedHintError;\nuse serde_json::{Map, Value};\nuse starknet_types_core::felt::Felt;\nuse std::fs::read_to_string;\n\npub(super) fn read_txt(path: String) -> Result<Vec<Felt>, EnhancedHintError> {\n    Ok(read_to_string(&path)?\n        .lines()\n        .filter(|line| !line.is_empty())\n        .map(str::trim)\n        .map(Felt::infer_format_and_parse)\n        .collect::<Result<Vec<_>, _>>()\n        .map_err(|_| EnhancedHintError::FileParsing { path })?\n        .into_iter()\n        .flatten()\n        .collect())\n}\n\npub(super) fn read_json(path: String) -> Result<Vec<Felt>, EnhancedHintError> {\n    let content = read_to_string(&path)?;\n\n    let json: Map<String, Value> = serde_json::from_str(&content)\n        .map_err(|e| anyhow!(\"Parse JSON error: {e} , in file {path}\"))?;\n    let data = flatten(&json);\n\n    let mut result = vec![];\n    let mut keys: Vec<_> = data.keys().collect();\n\n    keys.sort_by_key(|a| a.to_lowercase());\n\n    keys.into_iter()\n        .try_for_each(|key| value_into_vec(data.get(key).unwrap(), &mut result))\n        .map_err(|_| EnhancedHintError::FileParsing { path })?;\n\n    Ok(result)\n}\n\nfn value_into_vec(value: &Value, output: &mut Vec<Felt>) -> Result<()> {\n    match value {\n        Value::Array(vec) => {\n            output.push(vec.len().into());\n\n            for value in vec {\n                value_into_vec(value, output)?;\n            }\n\n            Ok(())\n        }\n        Value::Number(num) => {\n            output.push(Felt::try_from_dec_str(&num.to_string())?);\n\n            Ok(())\n        }\n        Value::String(string) => {\n            output.extend(ByteArray::from(string.as_str()).serialize_to_vec());\n\n            Ok(())\n        }\n        _ => {\n            unreachable!(\n                \"flatten_serde_json::flatten leaves only numbers string and array of numbers and strings\"\n            );\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::read_json;\n    use conversions::{byte_array::ByteArray, serde::serialize::SerializeToFeltVec};\n    use starknet_types_core::felt::Felt;\n    use std::fs;\n    use tempfile::TempDir;\n\n    fn create_file(content: impl AsRef<[u8]>) -> (TempDir, String) {\n        let temp = TempDir::new().unwrap();\n        let file = format!(\"{}/file.json\", temp.path().to_string_lossy());\n\n        fs::write(&file, content).unwrap();\n\n        (temp, file)\n    }\n\n    #[test]\n    fn test_json_values_sorted_by_keys() {\n        let string = r#\"\n        {\n            \"name\": \"Joh\",\n            \"age\": 43,\n            \"a\": {\n                \"b\": 1,\n                \"c\": 2\n            },\n            \"ab\": 12\n        }\"#;\n        let (_temp, file_path) = create_file(string);\n        let result = read_json(file_path).unwrap();\n        let mut expected_result =\n            vec![Felt::from(1), Felt::from(2), Felt::from(12), Felt::from(43)];\n        expected_result.extend(ByteArray::from(\"Joh\").serialize_to_vec());\n\n        assert_eq!(result, expected_result);\n\n        let string = r#\"\n        {\n            \"ad\": \"string\",\n            \"test\": [\"1\",2,\"3\",4]\n        }\"#;\n        let (_temp, file_path) = create_file(string);\n        let result = read_json(file_path).unwrap();\n        let mut expected_result = ByteArray::from(\"string\").serialize_to_vec();\n        expected_result.push(Felt::from(4));\n        expected_result.extend(ByteArray::from(\"1\").serialize_to_vec());\n        expected_result.push(Felt::from(2));\n        expected_result.extend(ByteArray::from(\"3\").serialize_to_vec());\n        expected_result.push(Felt::from(4));\n\n        assert_eq!(result, expected_result);\n    }\n\n    #[test]\n    fn test_json_values_sorted_by_keys_invalid_data() {\n        let string = r\"\n        [1,2,'3232']\";\n        let (_temp, file_path) = create_file(string);\n        let result = read_json(file_path);\n        assert!(result.is_err());\n\n        let string = r#\"\n        {\n            \"test\": 'invalid json format'\n        }\"#;\n        let (_temp, file_path) = create_file(string);\n        let result = read_json(file_path);\n        assert!(result.is_err());\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/forge_runtime_extension/fuzzer.rs",
    "content": "use anyhow::ensure;\nuse num_bigint::RandBigInt;\nuse rand::prelude::StdRng;\nuse starknet_types_core::felt::Felt;\nuse std::sync::{Arc, Mutex};\n\npub(crate) fn generate_arg(\n    fuzzer_rng: Option<Arc<Mutex<StdRng>>>,\n    min_value: Felt,\n    max_value: Felt,\n) -> anyhow::Result<Felt> {\n    let min_big_int = if min_value > (Felt::MAX + Felt::from(i128::MIN)) && min_value > max_value {\n        // Negative value x is serialized as P + x, where P is the STARK prime number\n        // hence to deserialize and get the actual x we need to subtract P (== Felt::MAX + 1)\n        min_value.to_bigint() - Felt::MAX.to_bigint() - 1\n    } else {\n        min_value.to_bigint()\n    };\n\n    let max_big_int = max_value.to_bigint();\n\n    ensure!(\n        min_big_int <= max_big_int,\n        format!(\n            \"`generate_arg` cheatcode: `min_value` must be <= `max_value`, provided values after deserialization: {min_big_int} and {max_big_int}\"\n        )\n    );\n\n    let value = if let Some(fuzzer_rng) = fuzzer_rng {\n        fuzzer_rng\n            .lock()\n            .expect(\"Failed to acquire lock on fuzzer_rng\")\n            .gen_bigint_range(&min_big_int, &(max_big_int + 1))\n    } else {\n        // `generate_arg` cheatcode can be also used outside the fuzzer context\n        rand::thread_rng().gen_bigint_range(&min_big_int, &(max_big_int + 1))\n    };\n\n    Ok(Felt::from(value))\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/forge_runtime_extension/mod.rs",
    "content": "use self::contracts_data::ContractsData;\nuse crate::runtime_extensions::call_to_blockifier_runtime_extension::rpc::UsedResources;\nuse crate::runtime_extensions::common::sum_syscall_usage;\nuse crate::runtime_extensions::forge_runtime_extension::cheatcodes::replace_bytecode::ReplaceBytecodeError;\nuse crate::runtime_extensions::{\n    call_to_blockifier_runtime_extension::{CallToBlockifierRuntime, rpc::CallFailure},\n    common::get_relocated_vm_trace,\n    forge_runtime_extension::cheatcodes::{\n        CheatcodeError,\n        declare::declare,\n        generate_random_felt::generate_random_felt,\n        get_class_hash::get_class_hash,\n        l1_handler_execute::l1_handler_execute,\n        storage::{calculate_variable_address, load, store},\n    },\n};\nuse crate::trace_data::{CallTrace, CallTraceNode, GasReportData};\nuse anyhow::{Context, Result, anyhow};\nuse blockifier::blockifier_versioned_constants::VersionedConstants;\nuse blockifier::bouncer::extended_execution_resources_to_gas;\nuse blockifier::context::TransactionContext;\nuse blockifier::execution::call_info::{\n    CallInfo, CallSummary, ChargedResources, EventSummary, ExecutionSummary,\n    ExtendedExecutionResources, OrderedEvent,\n};\nuse blockifier::execution::contract_class::TrackedResource;\nuse blockifier::execution::syscalls::vm_syscall_utils::{SyscallSelector, SyscallUsageMap};\nuse blockifier::state::errors::StateError;\nuse blockifier::utils::u64_from_usize;\nuse cairo_vm::vm::runners::cairo_runner::CairoRunner;\nuse cairo_vm::vm::{errors::hint_errors::HintError, vm_core::VirtualMachine};\nuse conversions::byte_array::ByteArray;\nuse conversions::felt::{ToShortString, TryInferFormat};\nuse conversions::serde::SerializedValue;\nuse conversions::serde::deserialize::BufferReader;\nuse conversions::serde::serialize::{CairoSerialize, SerializeToFeltVec};\nuse data_transformer::cairo_types::CairoU256;\nuse rand::prelude::StdRng;\nuse runtime::{\n    CheatcodeHandlingResult, EnhancedHintError, ExtendedRuntime, ExtensionLogic,\n    SyscallHandlingResult,\n};\nuse scarb_oracle_hint_service::OracleHintService;\nuse starknet_api::execution_resources::GasAmount;\nuse starknet_api::versioned_constants_logic::VersionedConstantsTrait;\nuse starknet_api::{contract_class::EntryPointType::L1Handler, core::ClassHash};\nuse starknet_rust::signers::SigningKey;\nuse starknet_types_core::felt::Felt;\nuse std::cell::RefCell;\nuse std::collections::{HashMap, HashSet};\nuse std::rc::Rc;\nuse std::sync::{Arc, Mutex};\n\npub mod cheatcodes;\npub mod contracts_data;\nmod file_operations;\nmod fuzzer;\n\npub type ForgeRuntime<'a> = ExtendedRuntime<ForgeExtension<'a>>;\n\npub struct ForgeExtension<'a> {\n    pub environment_variables: &'a HashMap<String, String>,\n    pub contracts_data: &'a ContractsData,\n    pub fuzzer_rng: Option<Arc<Mutex<StdRng>>>,\n    pub oracle_hint_service: OracleHintService,\n}\n\n// This runtime extension provides an implementation logic for functions from snforge_std library.\nimpl<'a> ExtensionLogic for ForgeExtension<'a> {\n    type Runtime = CallToBlockifierRuntime<'a>;\n\n    // `generic_array` which is a transitive dependency of multiple packages we depend on\n    // now, shows a deprecation warning at asking to upgrade to version 1.x\n    #[expect(clippy::too_many_lines)]\n    fn handle_cheatcode(\n        &mut self,\n        selector: &str,\n        mut input_reader: BufferReader<'_>,\n        extended_runtime: &mut Self::Runtime,\n        vm: &VirtualMachine,\n    ) -> Result<CheatcodeHandlingResult, EnhancedHintError> {\n        if let Some(oracle_selector) = self\n            .oracle_hint_service\n            .accept_cheatcode(selector.as_bytes())\n        {\n            let output = self\n                .oracle_hint_service\n                .execute_cheatcode(oracle_selector, input_reader.into_remaining());\n            let mut reader = BufferReader::new(&output);\n            let deserialized: Result<SerializedValue<Felt>, ByteArray> = reader.read()?;\n            let converted = deserialized\n                .map_err(|error| EnhancedHintError::OracleError { error })\n                .map(|r| r.serialize_to_vec())?;\n\n            return Ok(CheatcodeHandlingResult::Handled(converted));\n        }\n\n        match selector {\n            \"is_config_mode\" => Ok(CheatcodeHandlingResult::from_serializable(false)),\n            \"cheat_execution_info\" => {\n                let execution_info = input_reader.read()?;\n\n                extended_runtime\n                    .extended_runtime\n                    .extension\n                    .cheatnet_state\n                    .cheat_execution_info(execution_info);\n\n                Ok(CheatcodeHandlingResult::from_serializable(()))\n            }\n            \"mock_call\" => {\n                let contract_address = input_reader.read()?;\n                let function_selector = input_reader.read()?;\n                let span = input_reader.read()?;\n\n                let ret_data: Vec<_> = input_reader.read()?;\n\n                extended_runtime\n                    .extended_runtime\n                    .extension\n                    .cheatnet_state\n                    .mock_call(contract_address, function_selector, &ret_data, span);\n                Ok(CheatcodeHandlingResult::from_serializable(()))\n            }\n            \"stop_mock_call\" => {\n                let contract_address = input_reader.read()?;\n                let function_selector = input_reader.read()?;\n\n                extended_runtime\n                    .extended_runtime\n                    .extension\n                    .cheatnet_state\n                    .stop_mock_call(contract_address, function_selector);\n                Ok(CheatcodeHandlingResult::from_serializable(()))\n            }\n            \"replace_bytecode\" => {\n                let contract = input_reader.read()?;\n                let class = input_reader.read()?;\n\n                let is_undeclared = match extended_runtime\n                    .extended_runtime\n                    .extended_runtime\n                    .hint_handler\n                    .base\n                    .state\n                    .get_compiled_class(class)\n                {\n                    Err(StateError::UndeclaredClassHash(_)) => true,\n                    Err(err) => return Err(err.into()),\n                    _ => false,\n                };\n\n                let res = if extended_runtime\n                    .extended_runtime\n                    .extended_runtime\n                    .hint_handler\n                    .base\n                    .state\n                    .get_class_hash_at(contract)?\n                    == ClassHash::default()\n                {\n                    Err(ReplaceBytecodeError::ContractNotDeployed)\n                } else if is_undeclared {\n                    Err(ReplaceBytecodeError::UndeclaredClassHash)\n                } else {\n                    extended_runtime\n                        .extended_runtime\n                        .extension\n                        .cheatnet_state\n                        .replace_class_for_contract(contract, class);\n                    Ok(())\n                };\n\n                Ok(CheatcodeHandlingResult::from_serializable(res))\n            }\n            \"declare\" => {\n                let state = &mut extended_runtime\n                    .extended_runtime\n                    .extended_runtime\n                    .hint_handler\n                    .base\n                    .state;\n\n                let contract_name: String = input_reader.read::<ByteArray>()?.to_string();\n\n                handle_declare_result(declare(*state, &contract_name, self.contracts_data))\n            }\n            // Internal cheatcode used to pass a contract address when calling `deploy_at`.\n            \"set_deploy_at_address\" => {\n                let contract_address = input_reader.read()?;\n\n                let state = &mut *extended_runtime.extended_runtime.extension.cheatnet_state;\n                state.set_next_deploy_at_address(contract_address);\n\n                Ok(CheatcodeHandlingResult::from_serializable(()))\n            }\n            // Internal cheatcode to mark next syscall as coming from cheatcode.\n            \"set_next_syscall_from_cheatcode\" => {\n                let state = &mut *extended_runtime.extended_runtime.extension.cheatnet_state;\n                state.set_next_syscall_from_cheatcode();\n\n                Ok(CheatcodeHandlingResult::from_serializable(()))\n            }\n            \"precalculate_address\" => {\n                let class_hash = input_reader.read()?;\n                let calldata: Vec<_> = input_reader.read()?;\n\n                let contract_address = extended_runtime\n                    .extended_runtime\n                    .extension\n                    .cheatnet_state\n                    .precalculate_address(&class_hash, &calldata);\n\n                Ok(CheatcodeHandlingResult::from_serializable(contract_address))\n            }\n            // Internal cheatcode to guarantee unique salts for each deployment\n            // when deploying via a method of the `ContractClass` struct.\n            \"get_salt\" => {\n                let state = &mut *extended_runtime.extended_runtime.extension.cheatnet_state;\n\n                let salt = state.get_salt();\n                state.increment_deploy_salt_base();\n\n                Ok(CheatcodeHandlingResult::from_serializable(salt))\n            }\n            \"var\" => {\n                let name: String = input_reader.read::<ByteArray>()?.to_string();\n\n                let env_var = self\n                    .environment_variables\n                    .get(&name)\n                    .with_context(|| format!(\"Failed to read from env var = {name}\"))?;\n\n                let parsed_env_var = Felt::infer_format_and_parse(env_var)\n                    .map_err(|_| anyhow!(\"Failed to parse value = {env_var} to felt\"))?;\n\n                Ok(CheatcodeHandlingResult::Handled(parsed_env_var))\n            }\n            \"get_class_hash\" => {\n                let contract_address = input_reader.read()?;\n\n                let state = &mut extended_runtime\n                    .extended_runtime\n                    .extended_runtime\n                    .hint_handler\n                    .base\n                    .state;\n\n                match get_class_hash(*state, contract_address) {\n                    Ok(class_hash) => Ok(CheatcodeHandlingResult::from_serializable(class_hash)),\n                    Err(CheatcodeError::Recoverable(_)) => unreachable!(),\n                    Err(CheatcodeError::Unrecoverable(err)) => Err(err),\n                }\n            }\n            \"l1_handler_execute\" => {\n                let contract_address = input_reader.read()?;\n                let function_selector = input_reader.read()?;\n                let from_address = input_reader.read()?;\n\n                let payload: Vec<_> = input_reader.read()?;\n\n                let cheatnet_runtime = &mut extended_runtime.extended_runtime;\n\n                let syscall_handler = &mut cheatnet_runtime.extended_runtime.hint_handler;\n                match l1_handler_execute(\n                    syscall_handler,\n                    cheatnet_runtime.extension.cheatnet_state,\n                    contract_address,\n                    function_selector,\n                    from_address,\n                    &payload,\n                ) {\n                    Ok(_) => Ok(CheatcodeHandlingResult::from_serializable(0_u8)),\n                    Err(CallFailure::Recoverable { panic_data }) => Ok(\n                        CheatcodeHandlingResult::from_serializable(Err::<(), _>(panic_data)),\n                    ),\n                    Err(CallFailure::Unrecoverable { msg }) => Err(EnhancedHintError::from(\n                        HintError::CustomHint(Box::from(msg.to_string())),\n                    )),\n                }\n            }\n            \"read_txt\" => {\n                let file_path: String = input_reader.read::<ByteArray>()?.to_string();\n                let parsed_content = file_operations::read_txt(file_path)?;\n\n                Ok(CheatcodeHandlingResult::Handled(parsed_content))\n            }\n            \"read_json\" => {\n                let file_path: String = input_reader.read::<ByteArray>()?.to_string();\n                let parsed_content = file_operations::read_json(file_path)?;\n\n                Ok(CheatcodeHandlingResult::Handled(parsed_content))\n            }\n            \"spy_events\" => {\n                let events_offset = extended_runtime\n                    .extended_runtime\n                    .extension\n                    .cheatnet_state\n                    .detected_events\n                    .len();\n\n                Ok(CheatcodeHandlingResult::from_serializable(events_offset))\n            }\n            \"get_events\" => {\n                let events_offset = input_reader.read()?;\n\n                let events = extended_runtime\n                    .extended_runtime\n                    .extension\n                    .cheatnet_state\n                    .get_events(events_offset);\n\n                Ok(CheatcodeHandlingResult::from_serializable(events))\n            }\n            \"spy_messages_to_l1\" => {\n                let messages_offset = extended_runtime\n                    .extended_runtime\n                    .extension\n                    .cheatnet_state\n                    .detected_messages_to_l1\n                    .len();\n\n                Ok(CheatcodeHandlingResult::from_serializable(messages_offset))\n            }\n            \"get_messages_to_l1\" => {\n                let messages_offset = input_reader.read()?;\n\n                let messages = extended_runtime\n                    .extended_runtime\n                    .extension\n                    .cheatnet_state\n                    .get_messages_to_l1(messages_offset);\n\n                Ok(CheatcodeHandlingResult::from_serializable(messages))\n            }\n            \"generate_stark_keys\" => {\n                let key_pair = SigningKey::from_random();\n\n                Ok(CheatcodeHandlingResult::from_serializable((\n                    key_pair.secret_scalar(),\n                    key_pair.verifying_key().scalar(),\n                )))\n            }\n            \"stark_sign_message\" => {\n                let private_key = input_reader.read()?;\n                let message_hash = input_reader.read()?;\n\n                if private_key == Felt::from(0_u8) {\n                    return Ok(CheatcodeHandlingResult::from_serializable(Err::<(), _>(\n                        SignError::InvalidSecretKey,\n                    )));\n                }\n\n                let key_pair = SigningKey::from_secret_scalar(private_key);\n\n                let result = if let Ok(signature) = key_pair.sign(&message_hash) {\n                    Ok((signature.r, signature.s))\n                } else {\n                    Err(SignError::HashOutOfRange)\n                };\n\n                Ok(CheatcodeHandlingResult::from_serializable(result))\n            }\n            \"generate_ecdsa_keys\" => {\n                let curve: Felt = input_reader.read()?;\n                let curve = curve.to_short_string().ok();\n\n                let (signing_key_bytes, x_coordinate_bytes, y_coordinate_bytes) = {\n                    let extract_coordinates_from_verifying_key = |verifying_key: Box<[u8]>| {\n                        let verifying_key = verifying_key.iter().as_slice();\n                        (\n                            verifying_key[1..33].try_into().unwrap(),\n                            verifying_key[33..65].try_into().unwrap(),\n                        )\n                    };\n\n                    match curve.as_deref() {\n                        Some(\"Secp256k1\") => {\n                            let signing_key = k256::ecdsa::SigningKey::random(\n                                &mut k256::elliptic_curve::rand_core::OsRng,\n                            );\n                            let verifying_key = signing_key\n                                .verifying_key()\n                                .to_encoded_point(false)\n                                .to_bytes();\n                            let (x_coordinate, y_coordinate) =\n                                extract_coordinates_from_verifying_key(verifying_key);\n                            (\n                                signing_key.to_bytes().as_slice()[0..32].try_into().unwrap(),\n                                x_coordinate,\n                                y_coordinate,\n                            )\n                        }\n                        Some(\"Secp256r1\") => {\n                            let signing_key = p256::ecdsa::SigningKey::random(\n                                &mut p256::elliptic_curve::rand_core::OsRng,\n                            );\n                            let verifying_key = signing_key\n                                .verifying_key()\n                                .to_encoded_point(false)\n                                .to_bytes();\n                            let (x_coordinate, y_coordinate) =\n                                extract_coordinates_from_verifying_key(verifying_key);\n                            (\n                                signing_key.to_bytes().as_slice()[0..32].try_into().unwrap(),\n                                x_coordinate,\n                                y_coordinate,\n                            )\n                        }\n                        _ => return Ok(CheatcodeHandlingResult::Forwarded),\n                    }\n                };\n\n                Ok(CheatcodeHandlingResult::from_serializable((\n                    CairoU256::from_bytes(&signing_key_bytes),\n                    CairoU256::from_bytes(&x_coordinate_bytes), // bytes of public_key's x-coordinate\n                    CairoU256::from_bytes(&y_coordinate_bytes), // bytes of public_key's y-coordinate\n                )))\n            }\n            \"ecdsa_sign_message\" => {\n                let curve: Felt = input_reader.read()?;\n                let curve = curve.to_short_string().ok();\n                let secret_key: CairoU256 = input_reader.read()?;\n                let msg_hash: CairoU256 = input_reader.read()?;\n\n                let result = {\n                    match curve.as_deref() {\n                        Some(\"Secp256k1\") => {\n                            if let Ok(signing_key) =\n                                k256::ecdsa::SigningKey::from_slice(&secret_key.to_be_bytes())\n                            {\n                                let signature: k256::ecdsa::Signature =\n                                    k256::ecdsa::signature::hazmat::PrehashSigner::sign_prehash(\n                                        &signing_key,\n                                        &msg_hash.to_be_bytes(),\n                                    )\n                                    .unwrap();\n\n                                let signature = signature.normalize_s().unwrap_or(signature);\n\n                                Ok(signature.split_bytes())\n                            } else {\n                                Err(SignError::InvalidSecretKey)\n                            }\n                        }\n                        Some(\"Secp256r1\") => {\n                            if let Ok(signing_key) =\n                                p256::ecdsa::SigningKey::from_slice(&secret_key.to_be_bytes())\n                            {\n                                let signature: p256::ecdsa::Signature =\n                                    p256::ecdsa::signature::hazmat::PrehashSigner::sign_prehash(\n                                        &signing_key,\n                                        &msg_hash.to_be_bytes(),\n                                    )\n                                    .unwrap();\n\n                                let signature = signature.normalize_s().unwrap_or(signature);\n\n                                Ok(signature.split_bytes())\n                            } else {\n                                Err(SignError::InvalidSecretKey)\n                            }\n                        }\n                        _ => return Ok(CheatcodeHandlingResult::Forwarded),\n                    }\n                };\n\n                let result = result.map(|(r_bytes, s_bytes)| {\n                    let r_bytes: [u8; 32] = r_bytes.as_slice()[0..32].try_into().unwrap();\n                    let s_bytes: [u8; 32] = s_bytes.as_slice()[0..32].try_into().unwrap();\n                    (\n                        CairoU256::from_bytes(&r_bytes),\n                        CairoU256::from_bytes(&s_bytes),\n                    )\n                });\n\n                Ok(CheatcodeHandlingResult::from_serializable(result))\n            }\n            \"get_call_trace\" => {\n                let call_trace = &extended_runtime\n                    .extended_runtime\n                    .extension\n                    .cheatnet_state\n                    .trace_data\n                    .current_call_stack\n                    .borrow_full_trace();\n\n                Ok(CheatcodeHandlingResult::from_serializable(call_trace))\n            }\n            \"store\" => {\n                let state = &mut extended_runtime\n                    .extended_runtime\n                    .extended_runtime\n                    .hint_handler\n                    .base\n                    .state;\n                let target = input_reader.read()?;\n                let storage_address = input_reader.read()?;\n                store(*state, target, storage_address, input_reader.read()?)\n                    .context(\"Failed to store\")?;\n\n                Ok(CheatcodeHandlingResult::from_serializable(()))\n            }\n            \"load\" => {\n                let state = &mut extended_runtime\n                    .extended_runtime\n                    .extended_runtime\n                    .hint_handler\n                    .base\n                    .state;\n                let target = input_reader.read()?;\n                let storage_address = input_reader.read()?;\n                let loaded = load(*state, target, storage_address).context(\"Failed to load\")?;\n\n                Ok(CheatcodeHandlingResult::from_serializable(loaded))\n            }\n            \"map_entry_address\" => {\n                let map_selector = input_reader.read()?;\n                let keys: Vec<_> = input_reader.read()?;\n                let map_entry_address = calculate_variable_address(map_selector, Some(&keys));\n\n                Ok(CheatcodeHandlingResult::from_serializable(\n                    map_entry_address,\n                ))\n            }\n            \"generate_random_felt\" => Ok(CheatcodeHandlingResult::from_serializable(\n                generate_random_felt(),\n            )),\n            \"generate_arg\" => {\n                let min_value = input_reader.read()?;\n                let max_value = input_reader.read()?;\n\n                Ok(CheatcodeHandlingResult::from_serializable(\n                    fuzzer::generate_arg(self.fuzzer_rng.clone(), min_value, max_value)?,\n                ))\n            }\n            \"save_fuzzer_arg\" => {\n                let arg = input_reader.read::<ByteArray>()?.to_string();\n                extended_runtime\n                    .extended_runtime\n                    .extension\n                    .cheatnet_state\n                    // Skip first character, which is a snapshot symbol '@'\n                    .update_fuzzer_args(arg[1..].to_string());\n\n                Ok(CheatcodeHandlingResult::from_serializable(()))\n            }\n            \"set_block_hash\" => {\n                let block_number = input_reader.read()?;\n                let operation = input_reader.read()?;\n\n                extended_runtime\n                    .extended_runtime\n                    .extension\n                    .cheatnet_state\n                    .cheat_block_hash(block_number, operation);\n                Ok(CheatcodeHandlingResult::from_serializable(()))\n            }\n            \"get_current_vm_step\" => {\n                // Each contract call is executed in separate VM, hence all VM steps\n                // are calculated as sum of steps from calls + current VM steps.\n                // Since syscalls are added to VM resources after the execution, we need\n                // to include them manually here.\n                let top_call = extended_runtime\n                    .extended_runtime\n                    .extension\n                    .cheatnet_state\n                    .trace_data\n                    .current_call_stack\n                    .top();\n                let vm_steps_from_inner_calls = calculate_vm_steps_from_calls(&top_call);\n                let top_call_syscalls = &extended_runtime\n                    .extended_runtime\n                    .extended_runtime\n                    .hint_handler\n                    .base\n                    .syscalls_usage;\n                let vm_steps_from_syscalls = &VersionedConstants::latest_constants()\n                    .get_additional_os_syscall_resources(top_call_syscalls)\n                    .n_steps;\n                let total_vm_steps =\n                    vm_steps_from_inner_calls + vm_steps_from_syscalls + vm.get_current_step();\n\n                Ok(CheatcodeHandlingResult::from_serializable(total_vm_steps))\n            }\n            _ => Ok(CheatcodeHandlingResult::Forwarded),\n        }\n    }\n\n    fn override_system_call(\n        &mut self,\n        selector: SyscallSelector,\n        _vm: &mut VirtualMachine,\n        _extended_runtime: &mut Self::Runtime,\n    ) -> Result<SyscallHandlingResult, HintError> {\n        match selector {\n            SyscallSelector::ReplaceClass => Err(HintError::CustomHint(Box::from(\n                \"Replace class can't be used in tests\",\n            ))),\n            _ => Ok(SyscallHandlingResult::Forwarded),\n        }\n    }\n}\n\n#[derive(CairoSerialize)]\nenum SignError {\n    InvalidSecretKey,\n    HashOutOfRange,\n}\n\nfn handle_declare_result<T: CairoSerialize>(\n    declare_result: Result<T, CheatcodeError>,\n) -> Result<CheatcodeHandlingResult, EnhancedHintError> {\n    let result = match declare_result {\n        Ok(data) => Ok(data),\n        Err(CheatcodeError::Recoverable(panic_data)) => Err(panic_data),\n        Err(CheatcodeError::Unrecoverable(err)) => return Err(err),\n    };\n\n    Ok(CheatcodeHandlingResult::from_serializable(result))\n}\n\npub fn add_resources_to_top_call(\n    runtime: &mut ForgeRuntime,\n    resources: &ExtendedExecutionResources,\n    tracked_resource: &TrackedResource,\n) {\n    let versioned_constants = runtime\n        .extended_runtime\n        .extended_runtime\n        .extended_runtime\n        .hint_handler\n        .base\n        .context\n        .tx_context\n        .block_context\n        .versioned_constants();\n    let top_call = runtime\n        .extended_runtime\n        .extended_runtime\n        .extension\n        .cheatnet_state\n        .trace_data\n        .current_call_stack\n        .top();\n    let mut top_call = top_call.borrow_mut();\n\n    match tracked_resource {\n        TrackedResource::CairoSteps => top_call.used_execution_resources += resources,\n        TrackedResource::SierraGas => {\n            let builtin_gas_costs = versioned_constants.os_constants.gas_costs.builtins;\n            top_call.gas_consumed += extended_execution_resources_to_gas(\n                resources,\n                &builtin_gas_costs,\n                versioned_constants,\n            )\n            .0;\n        }\n    }\n}\n\npub fn update_top_call_resources(\n    runtime: &mut ForgeRuntime,\n    top_call_tracked_resource: TrackedResource,\n) {\n    // call representing the test code\n    let top_call = runtime\n        .extended_runtime\n        .extended_runtime\n        .extension\n        .cheatnet_state\n        .trace_data\n        .current_call_stack\n        .top();\n\n    let all_execution_resources = add_execution_resources(top_call.clone());\n    let all_sierra_gas_consumed = add_sierra_gas_resources(&top_call);\n\n    // Below syscall usages are cumulative, meaning they include syscalls from their inner calls.\n    let nested_calls_syscalls_vm_resources = get_nested_calls_syscalls_vm_resources(&top_call);\n    let nested_calls_syscalls_sierra_gas = get_nested_calls_syscalls_sierra_gas(&top_call);\n\n    let mut top_call = top_call.borrow_mut();\n    top_call.used_execution_resources = all_execution_resources;\n    top_call.gas_consumed = all_sierra_gas_consumed;\n\n    // Syscall usage here is flat, meaning it only includes syscalls from current call (in this case the top-level call)\n    let top_call_syscalls = runtime\n        .extended_runtime\n        .extended_runtime\n        .extended_runtime\n        .hint_handler\n        .base\n        .syscalls_usage\n        .clone();\n\n    let mut total_syscalls_vm_resources = nested_calls_syscalls_vm_resources.clone();\n    let mut total_syscalls_sierra_gas = nested_calls_syscalls_sierra_gas.clone();\n\n    // Based on the tracked resource of top call, we add the syscall usage to respective totals.\n    match top_call_tracked_resource {\n        TrackedResource::CairoSteps => {\n            total_syscalls_vm_resources =\n                sum_syscall_usage(total_syscalls_vm_resources, &top_call_syscalls);\n        }\n        TrackedResource::SierraGas => {\n            total_syscalls_sierra_gas =\n                sum_syscall_usage(total_syscalls_sierra_gas, &top_call_syscalls);\n        }\n    }\n\n    top_call.used_syscalls_vm_resources = total_syscalls_vm_resources;\n    top_call.used_syscalls_sierra_gas = total_syscalls_sierra_gas;\n}\n\n/// Calculates the total syscall usage from nested calls where the tracked resource is Cairo steps.\npub fn get_nested_calls_syscalls_vm_resources(trace: &Rc<RefCell<CallTrace>>) -> SyscallUsageMap {\n    // Only sum 1-level since these include syscalls from inner calls\n    trace\n        .borrow()\n        .nested_calls\n        .iter()\n        .filter_map(CallTraceNode::extract_entry_point_call)\n        .fold(SyscallUsageMap::new(), |syscalls, trace| {\n            sum_syscall_usage(syscalls, &trace.borrow().used_syscalls_vm_resources)\n        })\n}\n\n/// Calculates the total syscall usage from nested calls where the tracked resource is Sierra gas.\npub fn get_nested_calls_syscalls_sierra_gas(trace: &Rc<RefCell<CallTrace>>) -> SyscallUsageMap {\n    // Only sum 1-level since these include syscalls from inner calls\n    trace\n        .borrow()\n        .nested_calls\n        .iter()\n        .filter_map(CallTraceNode::extract_entry_point_call)\n        .fold(SyscallUsageMap::new(), |syscalls, trace| {\n            sum_syscall_usage(syscalls, &trace.borrow().used_syscalls_sierra_gas)\n        })\n}\n\n// Only top-level is considered relevant since we can't have l1 handlers deeper than 1 level of nesting\nfn get_l1_handlers_payloads_lengths(inner_calls: &[CallInfo]) -> Vec<usize> {\n    inner_calls\n        .iter()\n        .filter_map(|call_info| {\n            if call_info.call.entry_point_type == L1Handler {\n                return Some(call_info.call.calldata.0.len());\n            }\n            None\n        })\n        .collect()\n}\n\npub fn update_top_call_l1_resources(runtime: &mut ForgeRuntime) {\n    let all_l2_l1_message_sizes = runtime\n        .extended_runtime\n        .extended_runtime\n        .extended_runtime\n        .hint_handler\n        .base\n        .l2_to_l1_messages\n        .iter()\n        .map(|ordered_message| ordered_message.message.payload.0.len())\n        .collect();\n\n    // call representing the test code\n    let top_call = runtime\n        .extended_runtime\n        .extended_runtime\n        .extension\n        .cheatnet_state\n        .trace_data\n        .current_call_stack\n        .top();\n    top_call.borrow_mut().used_l1_resources.l2_l1_message_sizes = all_l2_l1_message_sizes;\n}\n\npub fn update_top_call_vm_trace(runtime: &mut ForgeRuntime, cairo_runner: &mut CairoRunner) {\n    let trace_data = &mut runtime\n        .extended_runtime\n        .extended_runtime\n        .extension\n        .cheatnet_state\n        .trace_data;\n\n    if trace_data.is_vm_trace_needed {\n        trace_data.current_call_stack.top().borrow_mut().vm_trace =\n            Some(get_relocated_vm_trace(cairo_runner));\n    }\n}\n\npub fn compute_and_store_execution_summary(trace: &Rc<RefCell<CallTrace>>) {\n    let execution_summary = if trace.borrow().nested_calls.is_empty() {\n        get_execution_summary_without_nested_calls(trace)\n    } else {\n        let mut nested_calls_summaries = vec![];\n        for nested_call in &trace.borrow().nested_calls {\n            if let CallTraceNode::EntryPointCall(nested_call) = nested_call {\n                compute_and_store_execution_summary(nested_call);\n                nested_calls_summaries.push(\n                    nested_call\n                        .borrow()\n                        .gas_report_data\n                        .as_ref()\n                        .expect(\"Gas report data must be set after calling `compute_and_store_execution_summary`\")\n                        .execution_summary\n                        .clone());\n            }\n        }\n        let mut current_call_summary = get_execution_summary_without_nested_calls(trace)\n            + nested_calls_summaries.into_iter().sum();\n\n        // vm_resources and gas_consumed of a call already contain the resources of its inner calls.\n        current_call_summary.charged_resources.extended_vm_resources =\n            trace.borrow().used_execution_resources.clone();\n        current_call_summary.charged_resources.gas_consumed =\n            GasAmount(trace.borrow().gas_consumed);\n        current_call_summary\n    };\n\n    trace.borrow_mut().gas_report_data = Some(GasReportData::new(execution_summary.clone()));\n}\n\n// Based on blockifier/src/execution/call_info.rs (summarize)\nfn get_execution_summary_without_nested_calls(trace: &Rc<RefCell<CallTrace>>) -> ExecutionSummary {\n    let current_call = trace.borrow();\n    ExecutionSummary {\n        charged_resources: ChargedResources {\n            extended_vm_resources: current_call.used_execution_resources.clone(),\n            gas_consumed: GasAmount(current_call.gas_consumed),\n        },\n        l2_to_l1_payload_lengths: current_call.used_l1_resources.l2_l1_message_sizes.clone(),\n        event_summary: {\n            let mut event_summary = EventSummary {\n                n_events: current_call.events.len(),\n                ..Default::default()\n            };\n            for OrderedEvent { event, .. } in &current_call.events {\n                event_summary.total_event_data_size += u64_from_usize(event.data.0.len());\n                event_summary.total_event_keys += u64_from_usize(event.keys.len());\n            }\n            event_summary\n        },\n        // Fields below are not relevant for partial gas calculation.\n        call_summary: CallSummary::default(),\n        executed_class_hashes: HashSet::default(),\n        visited_storage_entries: HashSet::default(),\n    }\n}\n\nfn add_sierra_gas_resources(top_call: &Rc<RefCell<CallTrace>>) -> u64 {\n    let mut gas_consumed = top_call.borrow().gas_consumed;\n    for nested_call in &top_call.borrow().nested_calls {\n        if let CallTraceNode::EntryPointCall(nested_call) = nested_call {\n            gas_consumed += &nested_call.borrow().gas_consumed;\n        }\n    }\n    gas_consumed\n}\n\n#[expect(clippy::needless_pass_by_value)]\nfn add_execution_resources(top_call: Rc<RefCell<CallTrace>>) -> ExtendedExecutionResources {\n    let mut execution_resources = top_call.borrow().used_execution_resources.clone();\n    for nested_call in &top_call.borrow().nested_calls {\n        match nested_call {\n            CallTraceNode::EntryPointCall(nested_call) => {\n                execution_resources += &nested_call.borrow().used_execution_resources;\n            }\n            CallTraceNode::DeployWithoutConstructor => {}\n        }\n    }\n    execution_resources\n}\n\n#[must_use]\npub fn get_all_used_resources(\n    call_info: &CallInfo,\n    trace: &Rc<RefCell<CallTrace>>,\n    transaction_context: &TransactionContext,\n) -> UsedResources {\n    let versioned_constants = transaction_context.block_context.versioned_constants();\n\n    let summary = call_info.summarize(versioned_constants);\n\n    let l1_handler_payload_lengths = get_l1_handlers_payloads_lengths(&call_info.inner_calls);\n\n    // Syscalls are used only for `--detailed-resources` output.\n    let top_call_syscalls = trace.borrow().get_total_used_syscalls();\n\n    UsedResources {\n        syscall_usage: top_call_syscalls,\n        execution_summary: summary,\n        l1_handler_payload_lengths,\n    }\n}\n\nfn calculate_vm_steps_from_calls(top_call: &Rc<RefCell<CallTrace>>) -> usize {\n    top_call\n        .borrow()\n        .nested_calls\n        .iter()\n        .fold(0, |acc, node| match node {\n            CallTraceNode::EntryPointCall(call_trace) => {\n                acc + call_trace\n                    .borrow()\n                    .used_execution_resources\n                    .vm_resources\n                    .n_steps\n            }\n            CallTraceNode::DeployWithoutConstructor => acc,\n        })\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/mod.rs",
    "content": "pub mod call_to_blockifier_runtime_extension;\npub mod cheatable_starknet_runtime_extension;\npub mod common;\npub mod deprecated_cheatable_starknet_extension;\npub mod forge_config_extension;\npub mod forge_runtime_extension;\n#[cfg(feature = \"cairo-native\")]\nmod native;\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/native/call.rs",
    "content": "use crate::runtime_extensions::call_to_blockifier_runtime_extension::execution::entry_point::{\n    ExecuteCallEntryPointExtraOptions, execute_call_entry_point,\n};\nuse crate::runtime_extensions::call_to_blockifier_runtime_extension::execution::execution_utils::clear_events_and_messages_from_reverted_call;\nuse crate::runtime_extensions::native::native_syscall_handler::BaseSyscallResult;\nuse crate::state::CheatnetState;\nuse blockifier::execution::entry_point::CallEntryPoint;\nuse blockifier::execution::syscalls::hint_processor::{\n    ENTRYPOINT_FAILED_ERROR, SyscallExecutionError,\n};\nuse blockifier::execution::syscalls::syscall_base::SyscallHandlerBase;\nuse starknet_types_core::felt::Felt;\n\n// Based on https://github.com/software-mansion-labs/sequencer/blob/57447e3e8897d4e7ce7f3ec8d23af58d5b6bf1a7/crates/blockifier/src/execution/syscalls/syscall_base.rs#L435\npub fn execute_inner_call(\n    // region: Modified blockifier code\n    syscall_handler_base: &mut SyscallHandlerBase,\n    cheatnet_state: &mut CheatnetState,\n    call: &mut CallEntryPoint,\n    remaining_gas: &mut u64,\n) -> BaseSyscallResult<Vec<Felt>> {\n    // endregion\n    let revert_idx = syscall_handler_base.context.revert_infos.0.len();\n\n    // region: Modified blockifier code\n    let call_info = execute_call_entry_point(\n        call,\n        syscall_handler_base.state,\n        cheatnet_state,\n        syscall_handler_base.context,\n        remaining_gas,\n        &ExecuteCallEntryPointExtraOptions {\n            trace_data_handled_by_revert_call: false,\n        },\n    )?;\n    // endregion\n\n    let mut raw_retdata = call_info.execution.retdata.0.clone();\n    let failed = call_info.execution.failed;\n    syscall_handler_base.inner_calls.push(call_info);\n    if failed {\n        syscall_handler_base\n            .context\n            .revert(revert_idx, syscall_handler_base.state)?;\n\n        // Delete events and l2_to_l1_messages from the reverted call.\n        let reverted_call = syscall_handler_base.inner_calls.last_mut().unwrap();\n        clear_events_and_messages_from_reverted_call(reverted_call);\n\n        raw_retdata\n            .push(Felt::from_hex(ENTRYPOINT_FAILED_ERROR).map_err(SyscallExecutionError::from)?);\n        return Err(SyscallExecutionError::Revert {\n            error_data: raw_retdata,\n        });\n    }\n\n    Ok(raw_retdata)\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/native/deploy.rs",
    "content": "use crate::runtime_extensions::call_to_blockifier_runtime_extension::execution::cheated_syscalls::execute_deployment;\nuse crate::runtime_extensions::native::native_syscall_handler::BaseSyscallResult;\nuse crate::state::CheatnetState;\nuse blockifier::execution::call_info::CallInfo;\nuse blockifier::execution::entry_point::ConstructorContext;\nuse blockifier::execution::syscalls::syscall_base::SyscallHandlerBase;\nuse blockifier::execution::syscalls::vm_syscall_utils::SyscallSelector;\nuse starknet_api::core::{ClassHash, ContractAddress, calculate_contract_address};\nuse starknet_api::transaction::fields::{Calldata, ContractAddressSalt};\n\n#[expect(clippy::match_bool)]\n// Copied from blockifer/src/execution/syscalls/syscall_base.rs\npub fn deploy(\n    syscall_handler_base: &mut SyscallHandlerBase,\n    cheatnet_state: &mut CheatnetState,\n    class_hash: ClassHash,\n    contract_address_salt: ContractAddressSalt,\n    constructor_calldata: Calldata,\n    deploy_from_zero: bool,\n    remaining_gas: &mut u64,\n) -> BaseSyscallResult<(ContractAddress, CallInfo)> {\n    syscall_handler_base\n        .increment_syscall_linear_factor_by(&SyscallSelector::Deploy, constructor_calldata.0.len());\n\n    // region: Modified blockifer code\n    // removed code\n    // endregion\n\n    let deployer_address = syscall_handler_base.call.storage_address;\n    let deployer_address_for_calculation = match deploy_from_zero {\n        true => ContractAddress::default(),\n        false => deployer_address,\n    };\n    let deployed_contract_address = calculate_contract_address(\n        contract_address_salt,\n        class_hash,\n        &constructor_calldata,\n        deployer_address_for_calculation,\n    )?;\n\n    let ctor_context = ConstructorContext {\n        class_hash,\n        code_address: Some(deployed_contract_address),\n        storage_address: deployed_contract_address,\n        caller_address: deployer_address,\n    };\n    // region: Modified blockifer code\n    let call_info = execute_deployment(\n        syscall_handler_base.state,\n        cheatnet_state,\n        syscall_handler_base.context,\n        &ctor_context,\n        constructor_calldata,\n        remaining_gas,\n    )?;\n    // endregion\n    Ok((deployed_contract_address, call_info))\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/native/execution.rs",
    "content": "use crate::runtime_extensions::call_to_blockifier_runtime_extension::execution::entry_point::{\n    CallInfoWithExecutionData, ContractClassEntryPointExecutionResult,\n};\nuse crate::runtime_extensions::native::native_syscall_handler::CheatableNativeSyscallHandler;\nuse crate::state::CheatnetState;\nuse blockifier::execution::call_info::{\n    CairoPrimitiveCounterMap, CallExecution, CallInfo, OpcodeName, Retdata,\n    cairo_primitive_counter_map,\n};\nuse blockifier::execution::contract_class::TrackedResource;\nuse blockifier::execution::entry_point::{\n    EntryPointExecutionContext, EntryPointExecutionResult, ExecutableCallEntryPoint,\n};\nuse blockifier::execution::errors::{\n    EntryPointExecutionError, PostExecutionError, PreExecutionError,\n};\nuse blockifier::execution::native::contract_class::NativeCompiledClassV1;\nuse blockifier::execution::native::syscall_handler::NativeSyscallHandler;\nuse blockifier::state::state_api::State;\nuse blockifier::transaction::objects::ExecutionResourcesTraits;\nuse blockifier::utils::add_maps;\nuse cairo_native::execution_result::{BuiltinStats, ContractExecutionResult};\nuse cairo_native::utils::BuiltinCosts;\nuse cairo_vm::types::builtin_name::BuiltinName;\nuse std::collections::HashMap;\nuse std::default::Default;\n\npub(crate) fn execute_entry_point_call_native(\n    call: &ExecutableCallEntryPoint,\n    native_compiled_class_v1: &NativeCompiledClassV1,\n    state: &mut dyn State,\n    cheatnet_state: &mut CheatnetState, // Added parameter\n    context: &mut EntryPointExecutionContext,\n) -> ContractClassEntryPointExecutionResult {\n    let mut syscall_handler = CheatableNativeSyscallHandler {\n        cheatnet_state,\n        native_syscall_handler: &mut NativeSyscallHandler::new(call.clone(), state, context),\n    };\n\n    let call_info = execute_entry_point_call(call, native_compiled_class_v1, &mut syscall_handler)?;\n\n    let syscall_usage = &syscall_handler.native_syscall_handler.base.syscalls_usage;\n\n    Ok(CallInfoWithExecutionData {\n        call_info,\n        // Native execution doesn't support VM resources.\n        // If we got to this point, it means tracked resources are SierraGas.\n        syscall_usage_vm_resources: HashMap::default(),\n        syscall_usage_sierra_gas: syscall_usage.clone(),\n    })\n}\n\n// Based on https://github.com/software-mansion-labs/sequencer/blob/b6d1c0b354d84225ab9c47f8ff28663d22e84d19/crates/blockifier/src/execution/native/entry_point_execution.rs#L20\nfn execute_entry_point_call(\n    call: &ExecutableCallEntryPoint,\n    compiled_class: &NativeCompiledClassV1,\n    // region: Modified blockifier code\n    syscall_handler: &mut CheatableNativeSyscallHandler,\n    // endregion\n) -> EntryPointExecutionResult<CallInfo> {\n    let entry_point = compiled_class.get_entry_point(&call.type_and_selector())?;\n\n    let gas_costs = &syscall_handler\n        .native_syscall_handler\n        .base\n        .context\n        .gas_costs();\n    let builtin_costs = BuiltinCosts {\n        r#const: 1,\n        pedersen: gas_costs.builtins.pedersen,\n        bitwise: gas_costs.builtins.bitwise,\n        ecop: gas_costs.builtins.ecop,\n        poseidon: gas_costs.builtins.poseidon,\n        add_mod: gas_costs.builtins.add_mod,\n        mul_mod: gas_costs.builtins.mul_mod,\n        blake: gas_costs.builtins.blake,\n    };\n\n    // Pre-charge entry point's initial budget to ensure sufficient gas for executing a minimal\n    // entry point code. When redepositing is used, the entry point is aware of this pre-charge\n    // and adjusts the gas counter accordingly if a smaller amount of gas is required.\n    let initial_budget = syscall_handler\n        .native_syscall_handler\n        .base\n        .context\n        .gas_costs()\n        .base\n        .entry_point_initial_budget;\n    let call_initial_gas = syscall_handler\n        .native_syscall_handler\n        .base\n        .call\n        .initial_gas\n        .checked_sub(initial_budget)\n        .ok_or(PreExecutionError::InsufficientEntryPointGas)?;\n\n    let execution_result = compiled_class.executor.run(\n        entry_point.selector.0,\n        &syscall_handler\n            .native_syscall_handler\n            .base\n            .call\n            .calldata\n            .0\n            .clone(),\n        call_initial_gas,\n        Some(builtin_costs),\n        &mut *syscall_handler,\n    );\n\n    syscall_handler.native_syscall_handler.finalize();\n\n    let call_result = execution_result.map_err(EntryPointExecutionError::NativeUnexpectedError)?;\n\n    // TODO(#3790) consider modifying this so it doesn't use take internally\n    if let Some(error) = syscall_handler.unrecoverable_error() {\n        return Err(EntryPointExecutionError::NativeUnrecoverableError(\n            Box::new(error),\n        ));\n    }\n\n    create_callinfo(call_result, syscall_handler)\n}\n\n// Copied from https://github.com/software-mansion-labs/sequencer/blob/b6d1c0b354d84225ab9c47f8ff28663d22e84d19/crates/blockifier/src/execution/native/entry_point_execution.rs#L73\nfn create_callinfo(\n    call_result: ContractExecutionResult,\n    syscall_handler: &mut CheatableNativeSyscallHandler<'_>,\n) -> Result<CallInfo, EntryPointExecutionError> {\n    let remaining_gas = call_result.remaining_gas;\n\n    if remaining_gas > syscall_handler.native_syscall_handler.base.call.initial_gas {\n        return Err(PostExecutionError::MalformedReturnData {\n            error_message: format!(\n                \"Unexpected remaining gas. Used gas is greater than initial gas: {} > {}\",\n                remaining_gas, syscall_handler.native_syscall_handler.base.call.initial_gas\n            ),\n        }\n        .into());\n    }\n\n    let gas_consumed = syscall_handler.native_syscall_handler.base.call.initial_gas - remaining_gas;\n    let vm_resources = CallInfo::summarize_vm_resources(\n        syscall_handler\n            .native_syscall_handler\n            .base\n            .inner_calls\n            .iter(),\n    );\n\n    // Retrieve the builtin counts from the syscall handler\n    let version_constants = syscall_handler\n        .native_syscall_handler\n        .base\n        .context\n        .versioned_constants();\n    let syscall_builtins = version_constants\n        .get_additional_os_syscall_resources(\n            &syscall_handler.native_syscall_handler.base.syscalls_usage,\n        )\n        .filter_unused_builtins()\n        .prover_builtins();\n    let mut entry_point_primitive_counters =\n        builtin_stats_to_primitive_counters(call_result.builtin_stats);\n    add_maps(\n        &mut entry_point_primitive_counters,\n        &cairo_primitive_counter_map(syscall_builtins),\n    );\n\n    Ok(CallInfo {\n        call: syscall_handler\n            .native_syscall_handler\n            .base\n            .call\n            .clone()\n            .into(),\n        execution: CallExecution {\n            retdata: Retdata(call_result.return_values),\n            events: syscall_handler.native_syscall_handler.base.events.clone(),\n            cairo_native: true,\n            l2_to_l1_messages: syscall_handler\n                .native_syscall_handler\n                .base\n                .l2_to_l1_messages\n                .clone(),\n            failed: call_result.failure_flag,\n            gas_consumed,\n        },\n        resources: vm_resources,\n        inner_calls: syscall_handler\n            .native_syscall_handler\n            .base\n            .inner_calls\n            .clone(),\n        storage_access_tracker: syscall_handler\n            .native_syscall_handler\n            .base\n            .storage_access_tracker\n            .clone(),\n        tracked_resource: TrackedResource::SierraGas,\n        builtin_counters: entry_point_primitive_counters,\n        syscalls_usage: syscall_handler\n            .native_syscall_handler\n            .base\n            .syscalls_usage\n            .clone(),\n    })\n}\n\n// Copied from https://github.com/starkware-libs/sequencer/blob/blockifier-v0.18.0-rc.1/crates/blockifier/src/execution/native/entry_point_execution.rs#L130\nfn builtin_stats_to_primitive_counters(stats: BuiltinStats) -> CairoPrimitiveCounterMap {\n    let builtins = [\n        (BuiltinName::range_check, stats.range_check),\n        (BuiltinName::pedersen, stats.pedersen),\n        (BuiltinName::bitwise, stats.bitwise),\n        (BuiltinName::ec_op, stats.ec_op),\n        (BuiltinName::poseidon, stats.poseidon),\n        (BuiltinName::range_check96, stats.range_check96),\n        (BuiltinName::add_mod, stats.add_mod),\n        (BuiltinName::mul_mod, stats.mul_mod),\n    ];\n    let opcodes = [(OpcodeName::blake, stats.blake)];\n\n    builtins\n        .into_iter()\n        .map(|(builtin_name, count)| (builtin_name.into(), count))\n        .chain(\n            opcodes\n                .into_iter()\n                .map(|(opcode_name, count): (OpcodeName, _)| (opcode_name.into(), count)),\n        )\n        .filter(|(_, count)| *count > 0)\n        .collect()\n}\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/native/mod.rs",
    "content": "mod call;\nmod deploy;\npub mod execution;\npub mod native_syscall_handler;\n"
  },
  {
    "path": "crates/cheatnet/src/runtime_extensions/native/native_syscall_handler.rs",
    "content": "use crate::runtime_extensions::forge_runtime_extension::cheatcodes::spy_events::Event;\nuse crate::runtime_extensions::forge_runtime_extension::cheatcodes::spy_messages_to_l1::MessageToL1;\nuse crate::runtime_extensions::native::call::execute_inner_call;\nuse crate::runtime_extensions::native::deploy::deploy;\nuse crate::state::CheatnetState;\nuse blockifier::execution::call_info::Retdata;\nuse blockifier::execution::common_hints::ExecutionMode;\nuse blockifier::execution::entry_point::{CallEntryPoint, CallType};\nuse blockifier::execution::errors::EntryPointExecutionError;\nuse blockifier::execution::native::syscall_handler::NativeSyscallHandler;\nuse blockifier::execution::syscalls::hint_processor::{OUT_OF_GAS_ERROR, SyscallExecutionError};\nuse blockifier::execution::syscalls::vm_syscall_utils::{\n    SelfOrRevert, SyscallExecutorBaseError, SyscallSelector, TryExtractRevert,\n};\nuse blockifier::utils::u64_from_usize;\nuse cairo_native::starknet::{\n    BlockInfo, ExecutionInfo, ExecutionInfoV2, ExecutionInfoV3, ResourceBounds, Secp256k1Point,\n    Secp256r1Point, StarknetSyscallHandler, SyscallResult, TxV2Info, TxV3Info, U256,\n};\nuse num_traits::ToPrimitive;\nuse starknet_api::block::BlockNumber;\nuse starknet_api::contract_class::EntryPointType;\nuse starknet_api::core::{ClassHash, ContractAddress, EntryPointSelector};\nuse starknet_api::execution_resources::GasAmount;\nuse starknet_api::transaction::fields::{Calldata, ContractAddressSalt};\nuse starknet_types_core::felt::Felt;\nuse std::sync::Arc;\n\npub struct CheatableNativeSyscallHandler<'a> {\n    pub native_syscall_handler: &'a mut NativeSyscallHandler<'a>,\n    pub cheatnet_state: &'a mut CheatnetState,\n}\n\npub type BaseSyscallResult<T> = Result<T, SyscallExecutionError>;\n\nimpl CheatableNativeSyscallHandler<'_> {\n    // TODO(#3790) consider modifying this so it doesn't use take\n    pub fn unrecoverable_error(&mut self) -> Option<SyscallExecutionError> {\n        self.native_syscall_handler.unrecoverable_error.take()\n    }\n\n    // Copied from https://github.com/software-mansion-labs/sequencer/blob/b6d1c0b354d84225ab9c47f8ff28663d22e84d19/crates/blockifier/src/execution/native/syscall_handler.rs#L80\n    /// Handles all gas-related logics, syscall usage counting and perform additional checks. In\n    /// native, we need to explicitly call this method at the beginning of each syscall.\n    fn pre_execute_syscall(\n        &mut self,\n        remaining_gas: &mut u64,\n        total_gas_cost: u64,\n        selector: SyscallSelector,\n    ) -> SyscallResult<()> {\n        if self.native_syscall_handler.unrecoverable_error.is_some() {\n            // An unrecoverable error was found in a previous syscall, we return immediately to\n            // accelerate the end of the execution. The returned data is not important\n            return Err(vec![]);\n        }\n\n        // Keccak syscall usages' increments are handled inside its implementation.\n        if !matches!(selector, SyscallSelector::Keccak) {\n            self.native_syscall_handler\n                .base\n                .increment_syscall_count_by(selector, 1);\n        }\n\n        // Refund `SYSCALL_BASE_GAS_COST` as it was pre-charged.\n        let required_gas = total_gas_cost\n            - self\n                .native_syscall_handler\n                .gas_costs()\n                .base\n                .syscall_base_gas_cost;\n\n        if *remaining_gas < required_gas {\n            // Out of gas failure.\n            return Err(vec![\n                Felt::from_hex(OUT_OF_GAS_ERROR)\n                    .expect(\"Failed to parse OUT_OF_GAS_ERROR hex string\"),\n            ]);\n        }\n\n        *remaining_gas -= required_gas;\n\n        // To support sierra gas charge for blockifier revert flow, we track the remaining gas left\n        // before executing a syscall if the current tracked resource is gas.\n        // 1. If the syscall does not run Cairo code (i.e. not library call, not call contract, and\n        //    not a deploy), any failure will not run in the OS, so no need to charge - the value\n        //    before entering the callback is good enough to charge.\n        // 2. If the syscall runs Cairo code, but the tracked resource is steps (and not gas), the\n        //    additional charge of reverted cairo steps will cover the inner cost, and the outer\n        //    cost we track here will be the additional reverted gas.\n        // 3. If the syscall runs Cairo code and the tracked resource is gas, either the inner\n        //    failure will be a Cairo1 revert (and the gas consumed on the call info will override\n        //    the current tracked value), or we will pass through another syscall before failing -\n        //    and by induction (we will reach this point again), the gas will be charged correctly.\n        self.native_syscall_handler\n            .base\n            .context\n            .update_revert_gas_with_next_remaining_gas(GasAmount(*remaining_gas));\n\n        Ok(())\n    }\n\n    // Based on https://github.com/software-mansion-labs/sequencer/blob/b6d1c0b354d84225ab9c47f8ff28663d22e84d19/crates/blockifier/src/execution/native/syscall_handler.rs#L153\n    fn execute_inner_call(\n        &mut self,\n        entry_point: &mut CallEntryPoint,\n        remaining_gas: &mut u64,\n        class_hash: ClassHash,\n        error_wrapper_fn: impl Fn(\n            SyscallExecutionError,\n            ClassHash,\n            ContractAddress,\n            EntryPointSelector,\n        ) -> SyscallExecutionError,\n    ) -> SyscallResult<Retdata> {\n        let entry_point_clone = entry_point.clone();\n        let raw_data = execute_inner_call(\n            &mut self.native_syscall_handler.base,\n            self.cheatnet_state,\n            entry_point,\n            remaining_gas,\n        )\n        .map_err(|e| {\n            self.handle_error(\n                remaining_gas,\n                SyscallExecutionError::from_self_or_revert(e.try_extract_revert().map_original(\n                    |error| {\n                        error_wrapper_fn(\n                            error,\n                            class_hash,\n                            entry_point_clone.storage_address,\n                            entry_point_clone.entry_point_selector,\n                        )\n                    },\n                )),\n            )\n        })?;\n        Ok(Retdata(raw_data))\n    }\n\n    // Copied from https://github.com/software-mansion-labs/sequencer/blob/b6d1c0b354d84225ab9c47f8ff28663d22e84d19/crates/blockifier/src/execution/native/syscall_handler.rs#L124\n    fn handle_error(&mut self, remaining_gas: &mut u64, error: SyscallExecutionError) -> Vec<Felt> {\n        // In case of more than one inner call and because each inner call has their own\n        // syscall handler, if there is an unrecoverable error at call `n` it will create a\n        // `NativeExecutionError`. When rolling back, each call from `n-1` to `1` will also\n        // store the result of a previous `NativeExecutionError` in a `NativeExecutionError`\n        // creating multiple wraps around the same error. This function is meant to prevent that.\n        fn unwrap_native_error(error: SyscallExecutionError) -> SyscallExecutionError {\n            match error {\n                SyscallExecutionError::EntryPointExecutionError(\n                    EntryPointExecutionError::NativeUnrecoverableError(e),\n                ) => *e,\n                _ => error,\n            }\n        }\n\n        match error.try_extract_revert() {\n            SelfOrRevert::Revert(revert_error) => revert_error.error_data,\n            SelfOrRevert::Original(error) => {\n                assert!(\n                    self.native_syscall_handler.unrecoverable_error.is_none(),\n                    \"Trying to set an unrecoverable error twice in Native Syscall Handler\"\n                );\n                self.native_syscall_handler.unrecoverable_error = Some(unwrap_native_error(error));\n                *remaining_gas = 0;\n                vec![]\n            }\n        }\n    }\n}\n\nimpl StarknetSyscallHandler for &mut CheatableNativeSyscallHandler<'_> {\n    fn get_block_hash(\n        &mut self,\n        block_number: u64,\n        remaining_gas: &mut u64,\n    ) -> SyscallResult<Felt> {\n        self.pre_execute_syscall(\n            remaining_gas,\n            self.native_syscall_handler\n                .gas_costs()\n                .syscalls\n                .get_block_hash\n                .base_syscall_cost(),\n            SyscallSelector::GetBlockHash,\n        )?;\n\n        let block_hash = self.cheatnet_state.get_cheated_block_hash_for_contract(\n            self.native_syscall_handler.base.call.storage_address,\n            block_number,\n        );\n\n        if let Some(block_hash) = block_hash {\n            Ok(block_hash.0)\n        } else {\n            match self\n                .native_syscall_handler\n                .base\n                .get_block_hash(BlockNumber(block_number))\n            {\n                Ok(value) => Ok(value),\n                Err(e) => Err(self.handle_error(remaining_gas, e)),\n            }\n        }\n    }\n\n    fn get_execution_info(&mut self, remaining_gas: &mut u64) -> SyscallResult<ExecutionInfo> {\n        self.native_syscall_handler\n            .get_execution_info(remaining_gas)\n    }\n\n    #[expect(clippy::too_many_lines)]\n    fn get_execution_info_v2(&mut self, remaining_gas: &mut u64) -> SyscallResult<ExecutionInfoV2> {\n        // We don't need to call pre_execute_syscall here because the call to `get_execution_info_v2`\n        // on the native syscall handler is does that internally, and we don't want to do it twice.\n\n        let original_data = self\n            .native_syscall_handler\n            .get_execution_info_v2(remaining_gas)?;\n\n        let cheated_data = self\n            .cheatnet_state\n            .get_cheated_data(self.native_syscall_handler.base.call.storage_address);\n\n        let block_number = cheated_data\n            .block_number\n            .unwrap_or(original_data.block_info.block_number);\n        let block_timestamp = cheated_data\n            .block_timestamp\n            .unwrap_or(original_data.block_info.block_timestamp);\n        let sequencer_address = cheated_data.sequencer_address.map_or(\n            original_data.block_info.sequencer_address,\n            std::convert::Into::into,\n        );\n\n        let version = cheated_data\n            .tx_info\n            .version\n            .unwrap_or(original_data.tx_info.version);\n        let account_contract_address = cheated_data\n            .tx_info\n            .account_contract_address\n            .unwrap_or(original_data.tx_info.account_contract_address);\n        let max_fee = cheated_data\n            .tx_info\n            .max_fee\n            .map_or(original_data.tx_info.max_fee, |max_fee| {\n                max_fee.to_u128().unwrap()\n            });\n        let signature = cheated_data\n            .tx_info\n            .signature\n            .unwrap_or(original_data.tx_info.signature);\n        let transaction_hash = cheated_data\n            .tx_info\n            .transaction_hash\n            .unwrap_or(original_data.tx_info.transaction_hash);\n        let chain_id = cheated_data\n            .tx_info\n            .chain_id\n            .unwrap_or(original_data.tx_info.chain_id);\n        let nonce = cheated_data\n            .tx_info\n            .nonce\n            .unwrap_or(original_data.tx_info.nonce);\n        // TODO(#3790) implement conversions\n        let resource_bounds = cheated_data.tx_info.resource_bounds.map_or(\n            original_data.tx_info.resource_bounds,\n            |rb| {\n                rb.iter()\n                    .map(|item| ResourceBounds {\n                        resource: item.resource,\n                        max_amount: item.max_amount,\n                        max_price_per_unit: item.max_price_per_unit,\n                    })\n                    .collect()\n            },\n        );\n        let tip = cheated_data\n            .tx_info\n            .tip\n            .map_or(original_data.tx_info.tip, |tip| tip.to_u128().unwrap());\n        let paymaster_data = cheated_data\n            .tx_info\n            .paymaster_data\n            .unwrap_or(original_data.tx_info.paymaster_data);\n        let nonce_data_availability_mode = cheated_data\n            .tx_info\n            .nonce_data_availability_mode\n            .map_or(original_data.tx_info.nonce_data_availability_mode, |mode| {\n                mode.to_u32().unwrap()\n            });\n        let fee_data_availability_mode = cheated_data\n            .tx_info\n            .fee_data_availability_mode\n            .map_or(original_data.tx_info.fee_data_availability_mode, |mode| {\n                mode.to_u32().unwrap()\n            });\n        let account_deployment_data = cheated_data\n            .tx_info\n            .account_deployment_data\n            .unwrap_or(original_data.tx_info.account_deployment_data);\n\n        let caller_address = cheated_data\n            .caller_address\n            .map_or(original_data.caller_address, std::convert::Into::into);\n        let contract_address = cheated_data\n            .contract_address\n            .map_or(original_data.contract_address, std::convert::Into::into);\n        let entry_point_selector = original_data.entry_point_selector;\n\n        Ok(ExecutionInfoV2 {\n            block_info: BlockInfo {\n                block_number,\n                block_timestamp,\n                sequencer_address,\n            },\n            tx_info: TxV2Info {\n                version,\n                account_contract_address,\n                max_fee,\n                signature,\n                transaction_hash,\n                chain_id,\n                nonce,\n                resource_bounds,\n                tip,\n                paymaster_data,\n                nonce_data_availability_mode,\n                fee_data_availability_mode,\n                account_deployment_data,\n            },\n            caller_address,\n            contract_address,\n            entry_point_selector,\n        })\n    }\n\n    #[expect(clippy::too_many_lines)]\n    fn get_execution_info_v3(&mut self, remaining_gas: &mut u64) -> SyscallResult<ExecutionInfoV3> {\n        // We don't need to call pre_execute_syscall here because the call to `get_execution_info_v3`\n        // on the native syscall handler is does that internally, and we don't want to do it twice.\n\n        let original_data = self\n            .native_syscall_handler\n            .get_execution_info_v3(remaining_gas)?;\n\n        let cheated_data = self\n            .cheatnet_state\n            .get_cheated_data(self.native_syscall_handler.base.call.storage_address);\n\n        let block_number = cheated_data\n            .block_number\n            .unwrap_or(original_data.block_info.block_number);\n        let block_timestamp = cheated_data\n            .block_timestamp\n            .unwrap_or(original_data.block_info.block_timestamp);\n        let sequencer_address = cheated_data.sequencer_address.map_or(\n            original_data.block_info.sequencer_address,\n            std::convert::Into::into,\n        );\n\n        let version = cheated_data\n            .tx_info\n            .version\n            .unwrap_or(original_data.tx_info.version);\n        let account_contract_address = cheated_data\n            .tx_info\n            .account_contract_address\n            .unwrap_or(original_data.tx_info.account_contract_address);\n        let max_fee = cheated_data\n            .tx_info\n            .max_fee\n            .map_or(original_data.tx_info.max_fee, |max_fee| {\n                max_fee.to_u128().unwrap()\n            });\n        let signature = cheated_data\n            .tx_info\n            .signature\n            .unwrap_or(original_data.tx_info.signature);\n        let transaction_hash = cheated_data\n            .tx_info\n            .transaction_hash\n            .unwrap_or(original_data.tx_info.transaction_hash);\n        let chain_id = cheated_data\n            .tx_info\n            .chain_id\n            .unwrap_or(original_data.tx_info.chain_id);\n        let nonce = cheated_data\n            .tx_info\n            .nonce\n            .unwrap_or(original_data.tx_info.nonce);\n        // TODO(#3790) implement conversions\n        let resource_bounds = cheated_data.tx_info.resource_bounds.map_or(\n            original_data.tx_info.resource_bounds,\n            |rb| {\n                rb.iter()\n                    .map(|item| ResourceBounds {\n                        resource: item.resource,\n                        max_amount: item.max_amount,\n                        max_price_per_unit: item.max_price_per_unit,\n                    })\n                    .collect()\n            },\n        );\n        let tip = cheated_data\n            .tx_info\n            .tip\n            .map_or(original_data.tx_info.tip, |tip| tip.to_u128().unwrap());\n        let paymaster_data = cheated_data\n            .tx_info\n            .paymaster_data\n            .unwrap_or(original_data.tx_info.paymaster_data);\n        let nonce_data_availability_mode = cheated_data\n            .tx_info\n            .nonce_data_availability_mode\n            .map_or(original_data.tx_info.nonce_data_availability_mode, |mode| {\n                mode.to_u32().unwrap()\n            });\n        let fee_data_availability_mode = cheated_data\n            .tx_info\n            .fee_data_availability_mode\n            .map_or(original_data.tx_info.fee_data_availability_mode, |mode| {\n                mode.to_u32().unwrap()\n            });\n        let account_deployment_data = cheated_data\n            .tx_info\n            .account_deployment_data\n            .unwrap_or(original_data.tx_info.account_deployment_data);\n\n        let caller_address = cheated_data\n            .caller_address\n            .map_or(original_data.caller_address, std::convert::Into::into);\n        let contract_address = cheated_data\n            .contract_address\n            .map_or(original_data.contract_address, std::convert::Into::into);\n        let entry_point_selector = original_data.entry_point_selector;\n\n        Ok(ExecutionInfoV3 {\n            block_info: BlockInfo {\n                block_number,\n                block_timestamp,\n                sequencer_address,\n            },\n            tx_info: TxV3Info {\n                version,\n                account_contract_address,\n                max_fee,\n                signature,\n                transaction_hash,\n                chain_id,\n                nonce,\n                resource_bounds,\n                tip,\n                paymaster_data,\n                nonce_data_availability_mode,\n                fee_data_availability_mode,\n                account_deployment_data,\n                proof_facts: original_data.tx_info.proof_facts,\n            },\n            caller_address,\n            contract_address,\n            entry_point_selector,\n        })\n    }\n\n    // Based on https://github.com/software-mansion-labs/sequencer/blob/b6d1c0b354d84225ab9c47f8ff28663d22e84d19/crates/blockifier/src/execution/native/syscall_handler.rs#L322\n    fn deploy(\n        &mut self,\n        class_hash: Felt,\n        contract_address_salt: Felt,\n        calldata: &[Felt],\n        deploy_from_zero: bool,\n        remaining_gas: &mut u64,\n    ) -> SyscallResult<(Felt, Vec<Felt>)> {\n        // The cost of deploying a contract is the base cost plus the linear cost of the calldata\n        // len.\n        let total_gas_cost = self\n            .native_syscall_handler\n            .gas_costs()\n            .syscalls\n            .deploy\n            .get_syscall_cost(u64_from_usize(calldata.len()));\n\n        self.pre_execute_syscall(remaining_gas, total_gas_cost, SyscallSelector::Deploy)?;\n\n        // region: Modified blockifier code\n        let (deployed_contract_address, call_info) = deploy(\n            &mut self.native_syscall_handler.base,\n            self.cheatnet_state,\n            ClassHash(class_hash),\n            ContractAddressSalt(contract_address_salt),\n            Calldata(Arc::new(calldata.to_vec())),\n            deploy_from_zero,\n            remaining_gas,\n        )\n        // endregion\n        .map_err(|err| self.handle_error(remaining_gas, err))?;\n\n        let constructor_retdata = call_info.execution.retdata.0[..].to_vec();\n        self.native_syscall_handler.base.inner_calls.push(call_info);\n\n        Ok((Felt::from(deployed_contract_address), constructor_retdata))\n    }\n\n    fn replace_class(&mut self, class_hash: Felt, remaining_gas: &mut u64) -> SyscallResult<()> {\n        self.native_syscall_handler\n            .replace_class(class_hash, remaining_gas)\n    }\n\n    // Based on from https://github.com/software-mansion-labs/sequencer/blob/b6d1c0b354d84225ab9c47f8ff28663d22e84d19/crates/blockifier/src/execution/native/syscall_handler.rs#L399\n    fn library_call(\n        &mut self,\n        class_hash: Felt,\n        function_selector: Felt,\n        calldata: &[Felt],\n        remaining_gas: &mut u64,\n    ) -> SyscallResult<Vec<Felt>> {\n        self.pre_execute_syscall(\n            remaining_gas,\n            self.native_syscall_handler\n                .gas_costs()\n                .syscalls\n                .library_call\n                .base_syscall_cost(),\n            SyscallSelector::LibraryCall,\n        )?;\n\n        let class_hash = ClassHash(class_hash);\n\n        let wrapper_calldata = Calldata(Arc::new(calldata.to_vec()));\n\n        let selector = EntryPointSelector(function_selector);\n\n        let mut entry_point = CallEntryPoint {\n            class_hash: Some(class_hash),\n            code_address: None,\n            entry_point_type: EntryPointType::External,\n            entry_point_selector: selector,\n            calldata: wrapper_calldata,\n            // The call context remains the same in a library call.\n            storage_address: self.native_syscall_handler.base.call.storage_address,\n            caller_address: self.native_syscall_handler.base.call.caller_address,\n            call_type: CallType::Delegate,\n            initial_gas: *remaining_gas,\n        };\n\n        let error_wrapper_function =\n            |e: SyscallExecutionError,\n             class_hash: ClassHash,\n             storage_address: ContractAddress,\n             selector: EntryPointSelector| {\n                e.as_lib_call_execution_error(class_hash, storage_address, selector)\n            };\n\n        Ok(self\n            .execute_inner_call(\n                &mut entry_point,\n                remaining_gas,\n                class_hash,\n                error_wrapper_function,\n            )?\n            .0)\n    }\n\n    // Based on https://github.com/software-mansion-labs/sequencer/blob/b6d1c0b354d84225ab9c47f8ff28663d22e84d19/crates/blockifier/src/execution/native/syscall_handler.rs#L444\n    fn call_contract(\n        &mut self,\n        address: Felt,\n        entry_point_selector: Felt,\n        calldata: &[Felt],\n        remaining_gas: &mut u64,\n    ) -> SyscallResult<Vec<Felt>> {\n        self.pre_execute_syscall(\n            remaining_gas,\n            self.native_syscall_handler\n                .gas_costs()\n                .syscalls\n                .call_contract\n                .base_syscall_cost(),\n            SyscallSelector::CallContract,\n        )?;\n\n        let contract_address = ContractAddress::try_from(address)\n            .map_err(|error| self.handle_error(remaining_gas, error.into()))?;\n\n        let class_hash = self\n            .native_syscall_handler\n            .base\n            .state\n            .get_class_hash_at(contract_address)\n            .map_err(|e| self.handle_error(remaining_gas, e.into()))?;\n        if self.native_syscall_handler.base.context.execution_mode == ExecutionMode::Validate\n            && self.native_syscall_handler.base.call.storage_address != contract_address\n        {\n            let err = SyscallExecutorBaseError::InvalidSyscallInExecutionMode {\n                syscall_name: \"call_contract\".to_string(),\n                execution_mode: self.native_syscall_handler.base.context.execution_mode,\n            };\n            return Err(self.handle_error(remaining_gas, err.into()));\n        }\n        let selector = EntryPointSelector(entry_point_selector);\n        // TODO(#3790) restore blocking\n        // self\n        //     .native_syscall_handler\n        //     .base\n        //     .maybe_block_direct_execute_call(selector)\n        //     .map_err(|e| self.handle_error(remaining_gas, e))?;\n\n        let wrapper_calldata = Calldata(Arc::new(calldata.to_vec()));\n\n        let mut entry_point = CallEntryPoint {\n            class_hash: None,\n            code_address: Some(contract_address),\n            entry_point_type: EntryPointType::External,\n            entry_point_selector: selector,\n            calldata: wrapper_calldata,\n            storage_address: contract_address,\n            caller_address: self.native_syscall_handler.base.call.storage_address,\n            call_type: CallType::Call,\n            initial_gas: *remaining_gas,\n        };\n\n        let error_wrapper_function =\n            |e: SyscallExecutionError,\n             class_hash: ClassHash,\n             storage_address: ContractAddress,\n             selector: EntryPointSelector| {\n                e.as_call_contract_execution_error(class_hash, storage_address, selector)\n            };\n\n        Ok(self\n            .execute_inner_call(\n                &mut entry_point,\n                remaining_gas,\n                class_hash,\n                error_wrapper_function,\n            )?\n            .0)\n    }\n\n    fn storage_read(\n        &mut self,\n        address_domain: u32,\n        address: Felt,\n        remaining_gas: &mut u64,\n    ) -> SyscallResult<Felt> {\n        self.native_syscall_handler\n            .storage_read(address_domain, address, remaining_gas)\n    }\n\n    fn storage_write(\n        &mut self,\n        address_domain: u32,\n        address: Felt,\n        value: Felt,\n        remaining_gas: &mut u64,\n    ) -> SyscallResult<()> {\n        self.native_syscall_handler\n            .storage_write(address_domain, address, value, remaining_gas)\n    }\n\n    fn emit_event(\n        &mut self,\n        keys: &[Felt],\n        data: &[Felt],\n        remaining_gas: &mut u64,\n    ) -> SyscallResult<()> {\n        let syscall_result = self\n            .native_syscall_handler\n            .emit_event(keys, data, remaining_gas);\n\n        if syscall_result.is_ok() {\n            let contract_address = self\n                .native_syscall_handler\n                .base\n                .call\n                // TODO(#3790) why we default to code_address??\n                .code_address\n                .unwrap_or(self.native_syscall_handler.base.call.storage_address);\n            let event = self\n                .native_syscall_handler\n                .base\n                .events\n                .last()\n                .expect(\"Event must have been emitted\");\n            self.cheatnet_state\n                .detected_events\n                .push(Event::from_ordered_event(event, contract_address));\n        }\n\n        syscall_result\n    }\n\n    fn send_message_to_l1(\n        &mut self,\n        to_address: Felt,\n        payload: &[Felt],\n        remaining_gas: &mut u64,\n    ) -> SyscallResult<()> {\n        let syscall_result =\n            self.native_syscall_handler\n                .send_message_to_l1(to_address, payload, remaining_gas);\n\n        if syscall_result.is_ok() {\n            let contract_address = self\n                .native_syscall_handler\n                .base\n                .call\n                // TODO(#3790) why we default to code_address??\n                .code_address\n                .unwrap_or(self.native_syscall_handler.base.call.storage_address);\n            let message = self\n                .native_syscall_handler\n                .base\n                .l2_to_l1_messages\n                .last()\n                .expect(\"Message must have been sent\");\n            self.cheatnet_state\n                .detected_messages_to_l1\n                .push(MessageToL1::from_ordered_message(message, contract_address));\n        }\n\n        syscall_result\n    }\n\n    fn keccak(&mut self, input: &[u64], remaining_gas: &mut u64) -> SyscallResult<U256> {\n        self.native_syscall_handler.keccak(input, remaining_gas)\n    }\n\n    fn secp256k1_new(\n        &mut self,\n        x: U256,\n        y: U256,\n        remaining_gas: &mut u64,\n    ) -> SyscallResult<Option<Secp256k1Point>> {\n        self.native_syscall_handler\n            .secp256k1_new(x, y, remaining_gas)\n    }\n\n    fn secp256k1_add(\n        &mut self,\n        p0: Secp256k1Point,\n        p1: Secp256k1Point,\n        remaining_gas: &mut u64,\n    ) -> SyscallResult<Secp256k1Point> {\n        self.native_syscall_handler\n            .secp256k1_add(p0, p1, remaining_gas)\n    }\n\n    fn secp256k1_mul(\n        &mut self,\n        p: Secp256k1Point,\n        m: U256,\n        remaining_gas: &mut u64,\n    ) -> SyscallResult<Secp256k1Point> {\n        self.native_syscall_handler\n            .secp256k1_mul(p, m, remaining_gas)\n    }\n\n    fn secp256k1_get_point_from_x(\n        &mut self,\n        x: U256,\n        y_parity: bool,\n        remaining_gas: &mut u64,\n    ) -> SyscallResult<Option<Secp256k1Point>> {\n        self.native_syscall_handler\n            .secp256k1_get_point_from_x(x, y_parity, remaining_gas)\n    }\n\n    fn secp256k1_get_xy(\n        &mut self,\n        p: Secp256k1Point,\n        remaining_gas: &mut u64,\n    ) -> SyscallResult<(U256, U256)> {\n        self.native_syscall_handler\n            .secp256k1_get_xy(p, remaining_gas)\n    }\n\n    fn secp256r1_new(\n        &mut self,\n        x: U256,\n        y: U256,\n        remaining_gas: &mut u64,\n    ) -> SyscallResult<Option<Secp256r1Point>> {\n        self.native_syscall_handler\n            .secp256r1_new(x, y, remaining_gas)\n    }\n\n    fn secp256r1_add(\n        &mut self,\n        p0: Secp256r1Point,\n        p1: Secp256r1Point,\n        remaining_gas: &mut u64,\n    ) -> SyscallResult<Secp256r1Point> {\n        self.native_syscall_handler\n            .secp256r1_add(p0, p1, remaining_gas)\n    }\n\n    fn secp256r1_mul(\n        &mut self,\n        p: Secp256r1Point,\n        m: U256,\n        remaining_gas: &mut u64,\n    ) -> SyscallResult<Secp256r1Point> {\n        self.native_syscall_handler\n            .secp256r1_mul(p, m, remaining_gas)\n    }\n\n    fn secp256r1_get_point_from_x(\n        &mut self,\n        x: U256,\n        y_parity: bool,\n        remaining_gas: &mut u64,\n    ) -> SyscallResult<Option<Secp256r1Point>> {\n        self.native_syscall_handler\n            .secp256r1_get_point_from_x(x, y_parity, remaining_gas)\n    }\n\n    fn secp256r1_get_xy(\n        &mut self,\n        p: Secp256r1Point,\n        remaining_gas: &mut u64,\n    ) -> SyscallResult<(U256, U256)> {\n        self.native_syscall_handler\n            .secp256r1_get_xy(p, remaining_gas)\n    }\n\n    fn sha256_process_block(\n        &mut self,\n        state: &mut [u32; 8],\n        block: &[u32; 16],\n        remaining_gas: &mut u64,\n    ) -> SyscallResult<()> {\n        self.native_syscall_handler\n            .sha256_process_block(state, block, remaining_gas)\n    }\n\n    fn get_class_hash_at(\n        &mut self,\n        contract_address: Felt,\n        remaining_gas: &mut u64,\n    ) -> SyscallResult<Felt> {\n        self.native_syscall_handler\n            .get_class_hash_at(contract_address, remaining_gas)\n    }\n\n    // TODO(#3790) Support cheating meta_tx_v0\n    fn meta_tx_v0(\n        &mut self,\n        address: Felt,\n        entry_point_selector: Felt,\n        calldata: &[Felt],\n        signature: &[Felt],\n        remaining_gas: &mut u64,\n    ) -> SyscallResult<Vec<Felt>> {\n        self.native_syscall_handler.meta_tx_v0(\n            address,\n            entry_point_selector,\n            calldata,\n            signature,\n            remaining_gas,\n        )\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/state.rs",
    "content": "use crate::constants::build_test_entry_point;\nuse crate::forking::state::ForkStateReader;\nuse crate::predeployment::erc20::eth::eth_predeployed_contract;\nuse crate::predeployment::erc20::strk::strk_predeployed_contract;\nuse crate::predeployment::predeployed_contract::PredeployedContract;\nuse crate::runtime_extensions::forge_runtime_extension::cheatcodes::cheat_execution_info::{\n    ExecutionInfoMock, ResourceBounds,\n};\nuse crate::runtime_extensions::forge_runtime_extension::cheatcodes::spy_events::Event;\nuse crate::runtime_extensions::forge_runtime_extension::cheatcodes::spy_messages_to_l1::MessageToL1;\nuse crate::trace_data::{CallTrace, NotEmptyCallStack, TraceData};\nuse blockifier::execution::contract_class::RunnableCompiledClass;\nuse blockifier::state::errors::StateError::UndeclaredClassHash;\nuse blockifier::state::state_api::{StateReader, StateResult};\nuse cairo_vm::Felt252;\nuse conversions::serde::deserialize::CairoDeserialize;\nuse conversions::string::TryFromHexStr;\nuse indexmap::IndexMap;\nuse runtime::starknet::constants::TEST_CONTRACT_CLASS_HASH;\nuse runtime::starknet::context::SerializableBlockInfo;\nuse runtime::starknet::state::DictStateReader;\nuse starknet_api::block::BlockInfo;\nuse starknet_api::core::{ChainId, EntryPointSelector};\nuse starknet_api::transaction::fields::ContractAddressSalt;\nuse starknet_api::{\n    core::{ClassHash, CompiledClassHash, ContractAddress, Nonce},\n    state::StorageKey,\n};\nuse starknet_types_core::felt::Felt;\nuse std::cell::RefCell;\nuse std::collections::HashMap;\nuse std::num::NonZeroUsize;\nuse std::rc::Rc;\n\n// Specifies the duration of the cheat\n#[derive(CairoDeserialize, Copy, Clone, Debug, PartialEq, Eq)]\npub enum CheatSpan {\n    Indefinite,\n    TargetCalls(NonZeroUsize),\n}\n\n#[derive(Debug)]\npub struct ExtendedStateReader {\n    pub dict_state_reader: DictStateReader,\n    pub fork_state_reader: Option<ForkStateReader>,\n}\n\nimpl ExtendedStateReader {\n    pub fn predeploy_contracts(&mut self) {\n        // We consider contract as deployed solely based on the fact that the test used forking\n        let is_fork = self.fork_state_reader.is_some();\n        if !is_fork {\n            let contracts = vec![strk_predeployed_contract(), eth_predeployed_contract()];\n            for contract in contracts {\n                self.predeploy_contract(contract);\n            }\n        }\n    }\n\n    fn predeploy_contract(&mut self, contract: PredeployedContract) {\n        let PredeployedContract {\n            contract_address,\n            class_hash,\n            contract_class,\n            storage_kv_updates,\n        } = contract;\n        self.dict_state_reader\n            .address_to_class_hash\n            .insert(contract_address, class_hash);\n\n        self.dict_state_reader\n            .class_hash_to_class\n            .insert(class_hash, contract_class);\n\n        for (key, value) in &storage_kv_updates {\n            let entry = (contract_address, *key);\n            self.dict_state_reader.storage_view.insert(entry, *value);\n        }\n    }\n}\n\npub trait BlockInfoReader {\n    fn get_block_info(&mut self) -> StateResult<BlockInfo>;\n}\n\nimpl BlockInfoReader for ExtendedStateReader {\n    fn get_block_info(&mut self) -> StateResult<BlockInfo> {\n        if let Some(ref mut fork_state_reader) = self.fork_state_reader {\n            return fork_state_reader.get_block_info();\n        }\n\n        Ok(SerializableBlockInfo::default().into())\n    }\n}\n\nimpl StateReader for ExtendedStateReader {\n    fn get_storage_at(\n        &self,\n        contract_address: ContractAddress,\n        key: StorageKey,\n    ) -> StateResult<Felt> {\n        self.dict_state_reader\n            .get_storage_at(contract_address, key)\n            .or_else(|_| {\n                self.fork_state_reader\n                    .as_ref()\n                    .map_or(Ok(Felt252::default()), {\n                        |reader| reader.get_storage_at(contract_address, key)\n                    })\n            })\n    }\n\n    fn get_nonce_at(&self, contract_address: ContractAddress) -> StateResult<Nonce> {\n        self.dict_state_reader\n            .get_nonce_at(contract_address)\n            .or_else(|_| {\n                self.fork_state_reader\n                    .as_ref()\n                    .map_or(Ok(Nonce::default()), {\n                        |reader| reader.get_nonce_at(contract_address)\n                    })\n            })\n    }\n\n    fn get_class_hash_at(&self, contract_address: ContractAddress) -> StateResult<ClassHash> {\n        self.dict_state_reader\n            .get_class_hash_at(contract_address)\n            .or_else(|_| {\n                self.fork_state_reader\n                    .as_ref()\n                    .map_or(Ok(ClassHash::default()), {\n                        |reader| reader.get_class_hash_at(contract_address)\n                    })\n            })\n    }\n\n    fn get_compiled_class(&self, class_hash: ClassHash) -> StateResult<RunnableCompiledClass> {\n        self.dict_state_reader\n            .get_compiled_class(class_hash)\n            .or_else(|_| {\n                self.fork_state_reader\n                    .as_ref()\n                    .map_or(Err(UndeclaredClassHash(class_hash)), |reader| {\n                        reader.get_compiled_class(class_hash)\n                    })\n            })\n    }\n\n    fn get_compiled_class_hash(&self, class_hash: ClassHash) -> StateResult<CompiledClassHash> {\n        Ok(self\n            .dict_state_reader\n            .get_compiled_class_hash(class_hash)\n            .unwrap_or_default())\n    }\n}\n\nimpl ExtendedStateReader {\n    pub fn get_chain_id(&self) -> anyhow::Result<Option<ChainId>> {\n        self.fork_state_reader\n            .as_ref()\n            .map(ForkStateReader::chain_id)\n            .transpose()\n    }\n}\n\n#[derive(Clone, Default, Debug, PartialEq, Eq)]\npub enum CheatStatus<T> {\n    Cheated(T, CheatSpan),\n    #[default]\n    Uncheated,\n}\n\nimpl<T> CheatStatus<T> {\n    pub fn decrement_cheat_span(&mut self) {\n        if let CheatStatus::Cheated(_, CheatSpan::TargetCalls(n)) = self {\n            let calls_number = n.get() - 1;\n\n            if calls_number == 0 {\n                *self = CheatStatus::Uncheated;\n            } else {\n                *n = NonZeroUsize::new(calls_number)\n                    .expect(\"`NonZeroUsize` should not be zero after decrement\");\n            }\n        }\n    }\n\n    pub fn as_value(&self) -> Option<T>\n    where\n        T: Clone,\n    {\n        match self {\n            Self::Cheated(value, _span) => Some(value.clone()),\n            Self::Uncheated => None,\n        }\n    }\n}\n\n#[derive(Clone, Default, Debug, PartialEq, Eq)]\npub struct CheatedTxInfo {\n    pub version: Option<Felt>,\n    pub account_contract_address: Option<Felt>,\n    pub max_fee: Option<Felt>,\n    pub signature: Option<Vec<Felt>>,\n    pub transaction_hash: Option<Felt>,\n    pub chain_id: Option<Felt>,\n    pub nonce: Option<Felt>,\n    pub resource_bounds: Option<Vec<ResourceBounds>>,\n    pub tip: Option<Felt>,\n    pub paymaster_data: Option<Vec<Felt>>,\n    pub nonce_data_availability_mode: Option<Felt>,\n    pub fee_data_availability_mode: Option<Felt>,\n    pub account_deployment_data: Option<Vec<Felt>>,\n    pub proof_facts: Option<Vec<Felt>>,\n}\n\nimpl CheatedTxInfo {\n    #[must_use]\n    pub fn is_mocked(&self) -> bool {\n        self != &CheatedTxInfo::default()\n    }\n}\n\n#[derive(Clone, Default, Debug)]\npub struct CheatedData {\n    pub block_number: Option<u64>,\n    pub block_timestamp: Option<u64>,\n    pub caller_address: Option<ContractAddress>,\n    pub contract_address: Option<ContractAddress>,\n    pub sequencer_address: Option<ContractAddress>,\n    pub tx_info: CheatedTxInfo,\n}\n\npub struct CheatnetState {\n    pub cheated_execution_info_contracts: HashMap<ContractAddress, ExecutionInfoMock>,\n    pub global_cheated_execution_info: ExecutionInfoMock,\n\n    pub mocked_functions:\n        HashMap<ContractAddress, HashMap<EntryPointSelector, CheatStatus<Vec<Felt>>>>,\n    pub replaced_bytecode_contracts: HashMap<ContractAddress, ClassHash>,\n    pub detected_events: Vec<Event>,\n    pub detected_messages_to_l1: Vec<MessageToL1>,\n    pub deploy_salt_base: u32,\n    pub next_deploy_at_address: Option<ContractAddress>,\n    pub next_syscall_from_cheatcode: bool,\n    pub block_info: BlockInfo,\n    pub trace_data: TraceData,\n    pub encountered_errors: EncounteredErrors,\n    pub fuzzer_args: Vec<String>,\n    pub block_hash_contracts: HashMap<(ContractAddress, u64), (CheatSpan, Felt)>,\n    pub global_block_hash: HashMap<u64, (Felt, Vec<ContractAddress>)>,\n}\n\npub type EncounteredErrors = IndexMap<ClassHash, Vec<usize>>;\n\nimpl Default for CheatnetState {\n    fn default() -> Self {\n        let mut test_code_entry_point = build_test_entry_point();\n        test_code_entry_point.class_hash =\n            ClassHash(TryFromHexStr::try_from_hex_str(TEST_CONTRACT_CLASS_HASH).unwrap());\n        let test_call = Rc::new(RefCell::new(CallTrace {\n            entry_point: test_code_entry_point.into(),\n            ..CallTrace::default_successful_call()\n        }));\n        Self {\n            cheated_execution_info_contracts: HashMap::default(),\n            global_cheated_execution_info: ExecutionInfoMock::default(),\n            mocked_functions: HashMap::default(),\n            replaced_bytecode_contracts: HashMap::default(),\n            detected_events: vec![],\n            detected_messages_to_l1: vec![],\n            deploy_salt_base: 0,\n            next_deploy_at_address: None,\n            next_syscall_from_cheatcode: false,\n            block_info: SerializableBlockInfo::default().into(),\n            trace_data: TraceData {\n                current_call_stack: NotEmptyCallStack::from(test_call),\n                is_vm_trace_needed: false,\n            },\n            encountered_errors: IndexMap::default(),\n            fuzzer_args: Vec::default(),\n            block_hash_contracts: HashMap::default(),\n            global_block_hash: HashMap::default(),\n        }\n    }\n}\n\nimpl CheatnetState {\n    #[must_use]\n    pub fn create_cheated_data(&mut self, contract_address: ContractAddress) -> CheatedData {\n        let execution_info = self.get_cheated_execution_info_for_contract(contract_address);\n\n        CheatedData {\n            block_number: execution_info.block_info.block_number.as_value(),\n            block_timestamp: execution_info.block_info.block_timestamp.as_value(),\n            caller_address: execution_info.caller_address.as_value(),\n            contract_address: execution_info.contract_address.as_value(),\n            sequencer_address: execution_info.block_info.sequencer_address.as_value(),\n            tx_info: CheatedTxInfo {\n                version: execution_info.tx_info.version.as_value(),\n                account_contract_address: execution_info\n                    .tx_info\n                    .account_contract_address\n                    .as_value(),\n                max_fee: execution_info.tx_info.max_fee.as_value(),\n                signature: execution_info.tx_info.signature.as_value(),\n                transaction_hash: execution_info.tx_info.transaction_hash.as_value(),\n                chain_id: execution_info.tx_info.chain_id.as_value(),\n                nonce: execution_info.tx_info.nonce.as_value(),\n                resource_bounds: execution_info.tx_info.resource_bounds.as_value(),\n                tip: execution_info.tx_info.tip.as_value(),\n                paymaster_data: execution_info.tx_info.paymaster_data.as_value(),\n                nonce_data_availability_mode: execution_info\n                    .tx_info\n                    .nonce_data_availability_mode\n                    .as_value(),\n                fee_data_availability_mode: execution_info\n                    .tx_info\n                    .fee_data_availability_mode\n                    .as_value(),\n                account_deployment_data: execution_info.tx_info.account_deployment_data.as_value(),\n                proof_facts: execution_info.tx_info.proof_facts.as_value(),\n            },\n        }\n    }\n\n    pub fn get_cheated_data(&mut self, contract_address: ContractAddress) -> CheatedData {\n        let current_call_stack = &mut self.trace_data.current_call_stack;\n\n        // case of cheating the test address itself\n        if current_call_stack.size() == 1 {\n            self.create_cheated_data(contract_address)\n            // do not update the cheats, as the test address cannot be called from the outside\n        } else {\n            current_call_stack.top_cheated_data()\n        }\n    }\n\n    pub fn increment_deploy_salt_base(&mut self) {\n        self.deploy_salt_base += 1;\n    }\n\n    pub fn set_next_deploy_at_address(&mut self, address: ContractAddress) {\n        self.next_deploy_at_address = Some(address);\n    }\n\n    pub fn next_address_for_deployment(&mut self) -> Option<ContractAddress> {\n        self.next_deploy_at_address.take()\n    }\n\n    pub fn set_next_syscall_from_cheatcode(&mut self) {\n        self.next_syscall_from_cheatcode = true;\n    }\n\n    pub fn take_next_syscall_from_cheatcode(&mut self) -> bool {\n        std::mem::take(&mut self.next_syscall_from_cheatcode)\n    }\n\n    #[must_use]\n    pub fn get_salt(&self) -> ContractAddressSalt {\n        ContractAddressSalt(Felt::from(self.deploy_salt_base))\n    }\n\n    #[must_use]\n    pub fn get_cheated_block_number(&mut self, address: ContractAddress) -> Option<u64> {\n        self.get_cheated_execution_info_for_contract(address)\n            .block_info\n            .block_number\n            .as_value()\n    }\n\n    #[must_use]\n    pub fn get_cheated_block_timestamp(&mut self, address: ContractAddress) -> Option<u64> {\n        self.get_cheated_execution_info_for_contract(address)\n            .block_info\n            .block_timestamp\n            .as_value()\n    }\n\n    #[must_use]\n    pub fn get_cheated_sequencer_address(\n        &mut self,\n        address: ContractAddress,\n    ) -> Option<ContractAddress> {\n        self.get_cheated_execution_info_for_contract(address)\n            .block_info\n            .sequencer_address\n            .as_value()\n    }\n\n    #[must_use]\n    pub fn get_cheated_caller_address(\n        &mut self,\n        address: ContractAddress,\n    ) -> Option<ContractAddress> {\n        self.get_cheated_execution_info_for_contract(address)\n            .caller_address\n            .as_value()\n    }\n\n    pub fn update_cheats(&mut self, address: &ContractAddress) {\n        self.progress_cheated_execution_info(*address);\n    }\n\n    pub fn update_fuzzer_args(&mut self, arg: String) {\n        self.fuzzer_args.push(arg);\n    }\n\n    pub fn register_error(&mut self, class_hash: ClassHash, pcs: Vec<usize>) {\n        self.encountered_errors.insert(class_hash, pcs);\n    }\n\n    pub fn clear_error(&mut self, class_hash: ClassHash) {\n        self.encountered_errors.shift_remove(&class_hash);\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/sync_client.rs",
    "content": "use starknet_api::block::BlockNumber;\nuse starknet_rust::core::types::{\n    BlockId, ContractClass, GetStorageAtResult, MaybePreConfirmedBlockWithTxHashes,\n};\nuse starknet_rust::providers::jsonrpc::HttpTransport;\nuse starknet_rust::providers::{JsonRpcClient, Provider, ProviderError};\nuse starknet_types_core::felt::Felt;\nuse tokio::runtime::Runtime;\nuse url::Url;\n\n#[derive(Debug)]\npub struct SyncClient {\n    client: JsonRpcClient<HttpTransport>,\n    block_id: BlockId,\n    runtime: Runtime,\n}\n\nimpl SyncClient {\n    #[must_use]\n    pub fn new(url: Url, block_number: BlockNumber) -> Self {\n        Self {\n            client: JsonRpcClient::new(HttpTransport::new(url)),\n            block_id: BlockId::Number(block_number.0),\n            runtime: Runtime::new().expect(\"Could not instantiate Runtime\"),\n        }\n    }\n\n    pub fn chain_id(&self) -> Result<Felt, ProviderError> {\n        self.sync(self.client.chain_id())\n    }\n\n    pub fn get_block_with_tx_hashes(\n        &self,\n    ) -> Result<MaybePreConfirmedBlockWithTxHashes, ProviderError> {\n        self.sync(self.client.get_block_with_tx_hashes(self.block_id))\n    }\n\n    pub fn get_storage_at(&self, contract_address: Felt, key: Felt) -> Result<Felt, ProviderError> {\n        self.sync(\n            self.client\n                .get_storage_at(contract_address, key, self.block_id, None),\n        )\n        .map(|storage_response| match storage_response {\n            GetStorageAtResult::Value(value) => value,\n            GetStorageAtResult::ValueWithMetadata(result_with_metadata) => {\n                result_with_metadata.value\n            }\n        })\n    }\n\n    pub fn get_nonce(&self, contract_address: Felt) -> Result<Felt, ProviderError> {\n        self.sync(self.client.get_nonce(self.block_id, contract_address))\n    }\n\n    pub fn get_class_hash_at(&self, contract_address: Felt) -> Result<Felt, ProviderError> {\n        self.sync(\n            self.client\n                .get_class_hash_at(self.block_id, contract_address),\n        )\n    }\n\n    pub fn get_class(&self, class_hash: Felt) -> Result<ContractClass, ProviderError> {\n        self.sync(self.client.get_class(self.block_id, class_hash))\n    }\n\n    fn sync<F: Future>(&self, future: F) -> F::Output {\n        self.runtime.block_on(future)\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/src/trace_data.rs",
    "content": "use crate::runtime_extensions::call_to_blockifier_runtime_extension::rpc::{\n    CallResult, CallSuccess,\n};\nuse crate::runtime_extensions::common::sum_syscall_usage;\nuse crate::state::CheatedData;\nuse blockifier::blockifier_versioned_constants::VersionedConstants;\nuse blockifier::execution::call_info::{\n    ExecutionSummary, ExtendedExecutionResources, OrderedEvent, OrderedL2ToL1Message,\n};\nuse blockifier::execution::entry_point::CallEntryPoint;\nuse blockifier::execution::syscalls::vm_syscall_utils::SyscallUsageMap;\nuse cairo_annotations::trace_data::L1Resources;\nuse cairo_vm::vm::trace::trace_entry::RelocatedTraceEntry;\nuse conversions::serde::serialize::{BufferWriter, CairoSerialize};\nuse starknet_api::core::ClassHash;\nuse starknet_api::execution_resources::GasVector;\nuse starknet_api::transaction::fields::GasVectorComputationMode;\nuse starknet_api::versioned_constants_logic::VersionedConstantsTrait;\nuse starknet_types_core::felt::Felt;\nuse std::cell::{OnceCell, Ref, RefCell};\nuse std::rc::Rc;\n\n#[derive(Debug)]\npub struct TraceData {\n    pub current_call_stack: NotEmptyCallStack,\n    pub is_vm_trace_needed: bool,\n}\n\n#[derive(Debug)]\npub struct NotEmptyCallStack(Vec<CallStackElement>);\n\n#[derive(Clone, Debug)]\nstruct CallStackElement {\n    call_trace: Rc<RefCell<CallTrace>>,\n    cheated_data: CheatedData,\n}\n\n/// Tree structure representing trace of a call.\n#[derive(Debug)]\npub struct CallTrace {\n    // only these are serialized\n    pub entry_point: CallEntryPoint,\n    pub nested_calls: Vec<CallTraceNode>,\n    pub result: CallResult,\n    // serialize end\n\n    // These also include resources used by internal calls\n    pub used_execution_resources: ExtendedExecutionResources,\n    pub used_l1_resources: L1Resources,\n    pub used_syscalls_vm_resources: SyscallUsageMap,\n    pub used_syscalls_sierra_gas: SyscallUsageMap,\n    pub vm_trace: Option<Vec<RelocatedTraceEntry>>,\n    pub gas_consumed: u64,\n    pub events: Vec<OrderedEvent>,\n    pub signature: Vec<Felt>,\n\n    // This is updated only once after the entire test execution.\n    pub gas_report_data: Option<GasReportData>,\n}\n\n/// Enum representing a node of a trace of a call.\n#[derive(Clone, Debug)]\npub enum CallTraceNode {\n    EntryPointCall(Rc<RefCell<CallTrace>>),\n    DeployWithoutConstructor,\n}\n\n#[derive(Clone, Debug)]\npub struct GasReportData {\n    pub execution_summary: ExecutionSummary,\n    partial_gas_usage: OnceCell<GasVector>,\n}\n\nimpl TraceData {\n    pub fn enter_nested_call(&mut self, entry_point: CallEntryPoint, cheated_data: CheatedData) {\n        let new_call = Rc::new(RefCell::new(CallTrace {\n            entry_point,\n            ..CallTrace::default_successful_call()\n        }));\n        let current_call = self.current_call_stack.top();\n\n        current_call\n            .borrow_mut()\n            .nested_calls\n            .push(CallTraceNode::EntryPointCall(new_call.clone()));\n\n        self.current_call_stack.push(new_call, cheated_data);\n    }\n\n    pub fn set_class_hash_for_current_call(&mut self, class_hash: ClassHash) {\n        let current_call = self.current_call_stack.top();\n        current_call.borrow_mut().entry_point.class_hash = Some(class_hash);\n    }\n\n    pub fn set_vm_trace_for_current_call(&mut self, vm_trace: Vec<RelocatedTraceEntry>) {\n        let current_call = self.current_call_stack.top();\n        current_call.borrow_mut().vm_trace = Some(vm_trace);\n    }\n\n    pub fn update_current_call_result(&mut self, result: CallResult) {\n        let current_call = self.current_call_stack.top();\n        current_call.borrow_mut().result = result;\n    }\n\n    pub fn clear_current_call_events_and_messages(&mut self) {\n        let current_call = self.current_call_stack.top();\n        current_call.borrow_mut().events.clear();\n        current_call\n            .borrow_mut()\n            .used_l1_resources\n            .l2_l1_message_sizes\n            .clear();\n    }\n\n    #[expect(clippy::too_many_arguments)]\n    pub fn update_current_call(\n        &mut self,\n        execution_resources: ExtendedExecutionResources,\n        gas_consumed: u64,\n        used_syscalls_vm_resources: SyscallUsageMap,\n        used_syscalls_sierra_gas: SyscallUsageMap,\n        result: CallResult,\n        l2_to_l1_messages: &[OrderedL2ToL1Message],\n        signature: Vec<Felt>,\n        events: Vec<OrderedEvent>,\n    ) {\n        let current_call = self.current_call_stack.top();\n        let mut current_call = current_call.borrow_mut();\n\n        current_call.used_execution_resources = execution_resources;\n        current_call.gas_consumed = gas_consumed;\n        current_call.used_syscalls_vm_resources = used_syscalls_vm_resources;\n        current_call.used_syscalls_sierra_gas = used_syscalls_sierra_gas;\n\n        current_call.used_l1_resources.l2_l1_message_sizes = l2_to_l1_messages\n            .iter()\n            .map(|ordered_message| ordered_message.message.payload.0.len())\n            .collect();\n\n        current_call.result = result;\n        current_call.signature = signature;\n        current_call.events = events;\n    }\n\n    pub fn exit_nested_call(&mut self) {\n        self.current_call_stack.pop();\n    }\n\n    pub fn add_deploy_without_constructor_node(&mut self) {\n        let current_call = self.current_call_stack.top();\n\n        current_call\n            .borrow_mut()\n            .nested_calls\n            .push(CallTraceNode::DeployWithoutConstructor);\n    }\n}\n\nimpl NotEmptyCallStack {\n    pub fn from(elem: Rc<RefCell<CallTrace>>) -> Self {\n        NotEmptyCallStack(vec![CallStackElement {\n            call_trace: elem,\n            cheated_data: CheatedData::default(),\n        }])\n    }\n\n    pub fn push(&mut self, elem: Rc<RefCell<CallTrace>>, cheated_data: CheatedData) {\n        self.0.push(CallStackElement {\n            call_trace: elem,\n            cheated_data,\n        });\n    }\n\n    pub fn top(&mut self) -> Rc<RefCell<CallTrace>> {\n        let top_val = self.0.last().unwrap();\n        top_val.call_trace.clone()\n    }\n\n    pub fn top_cheated_data(&mut self) -> CheatedData {\n        let top_val = self.0.last().unwrap();\n        top_val.cheated_data.clone()\n    }\n\n    fn pop(&mut self) -> CallStackElement {\n        assert!(self.0.len() > 1, \"You cannot make NotEmptyCallStack empty\");\n        self.0.pop().unwrap()\n    }\n\n    #[must_use]\n    pub fn size(&self) -> usize {\n        self.0.len()\n    }\n\n    #[must_use]\n    pub fn borrow_full_trace(&self) -> Ref<'_, CallTrace> {\n        self.0.first().unwrap().call_trace.borrow()\n    }\n}\n\nimpl CallTrace {\n    pub(crate) fn default_successful_call() -> Self {\n        Self {\n            entry_point: CallEntryPoint::default(),\n            used_execution_resources: ExtendedExecutionResources::default(),\n            used_l1_resources: L1Resources::default(),\n            used_syscalls_vm_resources: SyscallUsageMap::default(),\n            used_syscalls_sierra_gas: SyscallUsageMap::default(),\n            nested_calls: vec![],\n            result: Ok(CallSuccess { ret_data: vec![] }),\n            vm_trace: None,\n            gas_consumed: u64::default(),\n            events: vec![],\n            signature: vec![],\n            gas_report_data: None,\n        }\n    }\n\n    #[must_use]\n    pub fn get_total_used_syscalls(&self) -> SyscallUsageMap {\n        sum_syscall_usage(\n            self.used_syscalls_vm_resources.clone(),\n            &self.used_syscalls_sierra_gas,\n        )\n    }\n}\n\nimpl CallTraceNode {\n    #[must_use]\n    pub fn extract_entry_point_call(&self) -> Option<&Rc<RefCell<CallTrace>>> {\n        if let CallTraceNode::EntryPointCall(trace) = self {\n            Some(trace)\n        } else {\n            None\n        }\n    }\n}\n\nimpl GasReportData {\n    #[must_use]\n    pub fn new(execution_summary: ExecutionSummary) -> Self {\n        Self {\n            execution_summary,\n            partial_gas_usage: OnceCell::new(),\n        }\n    }\n\n    pub fn get_gas(&self) -> GasVector {\n        *self.partial_gas_usage.get_or_init(|| {\n            self.execution_summary.clone().to_partial_gas_vector(\n                VersionedConstants::latest_constants(),\n                &GasVectorComputationMode::All,\n            )\n        })\n    }\n}\n\nimpl CairoSerialize for CallTrace {\n    fn serialize(&self, output: &mut BufferWriter) {\n        self.entry_point.serialize(output);\n\n        let visible_calls: Vec<_> = self\n            .nested_calls\n            .iter()\n            .filter_map(CallTraceNode::extract_entry_point_call)\n            .collect();\n\n        visible_calls.serialize(output);\n\n        self.result.serialize(output);\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/builtins/mod.rs",
    "content": "mod panic_call;\nmod segment_arena;\n"
  },
  {
    "path": "crates/cheatnet/tests/builtins/panic_call.rs",
    "content": "use crate::common::assertions::assert_panic;\nuse crate::common::call_contract;\nuse crate::common::{deploy_contract, state::create_cached_state};\nuse blockifier::execution::syscalls::hint_processor::ENTRYPOINT_FAILED_ERROR_FELT;\nuse cairo_lang_utils::byte_array::BYTE_ARRAY_MAGIC;\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::storage::selector_from_name;\nuse cheatnet::state::CheatnetState;\nuse conversions::IntoConv;\nuse conversions::felt::FromShortString;\nuse conversions::string::TryFromHexStr;\nuse starknet_types_core::felt::Felt;\nuse test_case::test_case;\n\n#[test]\nfn call_contract_failed() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address =\n        deploy_contract(&mut cached_state, &mut cheatnet_state, \"PanicCall\", &[]);\n\n    let selector = selector_from_name(\"panic_call\");\n\n    let output = call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[Felt::from(420)],\n    );\n\n    assert_panic(\n        output,\n        &[\n            Felt::from_short_string(\"Input too long for arguments\").unwrap(),\n            ENTRYPOINT_FAILED_ERROR_FELT,\n        ],\n    );\n}\n\n#[test]\nfn call_contract_panic() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address =\n        deploy_contract(&mut cached_state, &mut cheatnet_state, \"PanicCall\", &[]);\n\n    let selector = selector_from_name(\"panic_call\");\n\n    let output = call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n\n    assert_panic(\n        output,\n        &[\n            Felt::from_short_string(\"shortstring\").unwrap(),\n            Felt::from(0),\n            Felt::MAX,\n            Felt::from_short_string(\"shortstring2\").unwrap(),\n            ENTRYPOINT_FAILED_ERROR_FELT,\n        ],\n    );\n}\n\n#[test]\nfn call_proxied_contract_bytearray_panic() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let proxy = deploy_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        \"ByteArrayPanickingContractProxy\",\n        &[],\n    );\n    let bytearray_panicking_contract = deploy_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        \"ByteArrayPanickingContract\",\n        &[],\n    );\n\n    let selector = selector_from_name(\"call_bytearray_panicking_contract\");\n\n    let output = call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &proxy,\n        selector,\n        &[bytearray_panicking_contract.into_()],\n    );\n\n    assert_panic(\n        output,\n        &[\n            Felt::try_from_hex_str(&format!(\"0x{BYTE_ARRAY_MAGIC}\")).unwrap(),\n            Felt::from(2),\n            Felt::from_short_string(\"This is a very long\\n and multi \").unwrap(),\n            Felt::from_short_string(\"line string, that will for sure\").unwrap(),\n            Felt::from_short_string(\" saturate the pending_word\").unwrap(),\n            Felt::from(26),\n            ENTRYPOINT_FAILED_ERROR_FELT,\n            ENTRYPOINT_FAILED_ERROR_FELT,\n        ],\n    );\n}\n\n#[test_case(&[Felt::from(1), Felt::from(1)], &[Felt::from(1)])]\n#[test_case(&[Felt::from(1), Felt::from(65)], &[Felt::from(65)])]\n#[test_case(&[Felt::from(4), Felt::from(1), Felt::from(65), Felt::from(2), Felt::from(66)],\n            &[Felt::from(1), Felt::from(65), Felt::from(2), Felt::from(66)])]\nfn call_proxied_contract_felts_panic(input: &[Felt], expected_panic: &[Felt]) {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let proxy = deploy_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        \"ByteArrayPanickingContractProxy\",\n        &[],\n    );\n    let bytearray_panicking_contract = deploy_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        \"ByteArrayPanickingContract\",\n        &[],\n    );\n\n    let selector_felts = selector_from_name(\"call_felts_panicking_contract\");\n\n    let mut contract_call_args = vec![bytearray_panicking_contract.into_()];\n    contract_call_args.extend_from_slice(input);\n\n    let output = call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &proxy,\n        selector_felts,\n        &contract_call_args,\n    );\n\n    assert_panic(\n        output,\n        &[\n            expected_panic,\n            &[ENTRYPOINT_FAILED_ERROR_FELT, ENTRYPOINT_FAILED_ERROR_FELT],\n        ]\n        .concat(),\n    );\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/builtins/segment_arena.rs",
    "content": "use crate::common::assertions::assert_success;\nuse crate::common::call_contract;\nuse crate::common::{deploy_contract, state::create_cached_state};\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::storage::selector_from_name;\nuse cheatnet::state::CheatnetState;\n\n#[test]\nfn segment_arena_simple() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address = deploy_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        \"SegmentArenaUser\",\n        &[],\n    );\n    let selector = selector_from_name(\"interface_function\");\n    let output = call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n\n    assert_success(output, &[]);\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/cheatcodes/cheat_account_contract_address.rs",
    "content": "use std::num::NonZeroUsize;\n\nuse crate::{cheatcodes::test_environment::TestEnvironment, common::assertions::assert_success};\nuse cheatnet::state::CheatSpan;\nuse starknet_api::core::ContractAddress;\nuse starknet_types_core::felt::Felt;\n\ntrait CheatAccountContractAddressTrait {\n    fn cheat_account_contract_address(\n        &mut self,\n        target: ContractAddress,\n        new_address: u128,\n        span: CheatSpan,\n    );\n    fn start_cheat_account_contract_address(&mut self, target: ContractAddress, new_address: u128);\n    fn stop_cheat_account_contract_address(&mut self, target: ContractAddress);\n}\n\nimpl CheatAccountContractAddressTrait for TestEnvironment {\n    fn cheat_account_contract_address(\n        &mut self,\n        target: ContractAddress,\n        new_address: u128,\n        span: CheatSpan,\n    ) {\n        self.cheatnet_state.cheat_account_contract_address(\n            target,\n            ContractAddress::from(new_address),\n            span,\n        );\n    }\n\n    fn start_cheat_account_contract_address(&mut self, target: ContractAddress, new_address: u128) {\n        self.cheatnet_state\n            .start_cheat_account_contract_address(target, ContractAddress::from(new_address));\n    }\n\n    fn stop_cheat_account_contract_address(&mut self, target: ContractAddress) {\n        self.cheatnet_state\n            .stop_cheat_account_contract_address(target);\n    }\n}\n\n#[test]\nfn cheat_account_contract_address_simple() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatTxInfoChecker\", &[]);\n\n    let output = test_env.call_contract(&contract_address, \"get_account_contract_address\", &[]);\n    assert_success(output, &[Felt::from(0)]);\n\n    test_env.start_cheat_account_contract_address(contract_address, 123);\n\n    let output = test_env.call_contract(&contract_address, \"get_account_contract_address\", &[]);\n    assert_success(output, &[Felt::from(123)]);\n}\n\n#[test]\nfn cheat_account_contract_address_stop() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatTxInfoChecker\", &[]);\n\n    test_env.start_cheat_account_contract_address(contract_address, 123);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_account_contract_address\", &[]),\n        &[Felt::from(123)],\n    );\n\n    test_env.stop_cheat_account_contract_address(contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_account_contract_address\", &[]),\n        &[Felt::from(0)],\n    );\n}\n\n#[test]\nfn cheat_account_contract_address_simple_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatTxInfoChecker\", &[]);\n\n    test_env.cheat_account_contract_address(\n        contract_address,\n        123,\n        CheatSpan::TargetCalls(NonZeroUsize::new(2).unwrap()),\n    );\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_account_contract_address\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_account_contract_address\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_account_contract_address\", &[]),\n        &[Felt::from(0)],\n    );\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/cheatcodes/cheat_block_hash.rs",
    "content": "use super::test_environment::TestEnvironment;\nuse crate::common::assertions::assert_success;\nuse crate::common::get_contracts;\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::cheat_execution_info::{\n    CheatArguments, Operation,\n};\nuse cheatnet::state::CheatSpan;\nuse conversions::IntoConv;\nuse starknet_api::core::ContractAddress;\nuse starknet_types_core::felt::Felt;\nuse std::num::NonZeroUsize;\n\nconst DEFAULT_BLOCK_HASH: u64 = 0;\nconst BLOCK_NUMBER: u64 = 123;\n\ntrait CheatBlockHashTrait {\n    fn cheat_block_hash(\n        &mut self,\n        contract_address: ContractAddress,\n        block_number: u64,\n        block_hash: Felt,\n        span: CheatSpan,\n    );\n    fn start_cheat_block_hash(\n        &mut self,\n        contract_address: ContractAddress,\n        block_number: u64,\n        block_hash: Felt,\n    );\n    fn stop_cheat_block_hash(&mut self, contract_address: ContractAddress, block_number: u64);\n}\n\nimpl CheatBlockHashTrait for TestEnvironment {\n    fn cheat_block_hash(\n        &mut self,\n        contract_address: ContractAddress,\n        block_number: u64,\n        block_hash: Felt,\n        span: CheatSpan,\n    ) {\n        self.cheatnet_state.cheat_block_hash(\n            block_number,\n            Operation::Start(CheatArguments {\n                value: block_hash,\n                span,\n                target: contract_address,\n            }),\n        );\n    }\n\n    fn start_cheat_block_hash(\n        &mut self,\n        contract_address: ContractAddress,\n        block_number: u64,\n        block_hash: Felt,\n    ) {\n        self.cheatnet_state\n            .start_cheat_block_hash(contract_address, block_number, block_hash);\n    }\n\n    fn stop_cheat_block_hash(&mut self, contract_address: ContractAddress, block_number: u64) {\n        self.cheatnet_state\n            .stop_cheat_block_hash(contract_address, block_number);\n    }\n}\n\n#[test]\nfn cheat_block_hash_simple() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockHashChecker\", &[]);\n\n    let output =\n        test_env.call_contract(&contract_address, \"get_block_hash\", &[BLOCK_NUMBER.into()]);\n    assert_success(output, &[Felt::from(0)]);\n\n    test_env.start_cheat_block_hash(contract_address, BLOCK_NUMBER, Felt::from(123));\n\n    let output =\n        test_env.call_contract(&contract_address, \"get_block_hash\", &[BLOCK_NUMBER.into()]);\n    assert_success(output, &[Felt::from(123)]);\n}\n\n#[test]\nfn cheat_block_hash_in_constructor() {\n    let mut test_env = TestEnvironment::new();\n    let contracts_data = get_contracts();\n\n    let class_hash = test_env.declare(\"ConstructorCheatBlockHashChecker\", &contracts_data);\n    let precalculated_address = test_env.precalculate_address(&class_hash, &[BLOCK_NUMBER.into()]);\n\n    test_env.start_cheat_block_hash(precalculated_address, BLOCK_NUMBER, Felt::from(123));\n\n    let contract_address = test_env.deploy_wrapper(&class_hash, &[BLOCK_NUMBER.into()]);\n\n    assert_eq!(precalculated_address, contract_address);\n\n    let output = test_env.call_contract(&contract_address, \"get_stored_block_hash\", &[]);\n    assert_success(output, &[Felt::from(123)]);\n}\n\n#[test]\nfn cheat_block_hash_stop() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockHashChecker\", &[]);\n\n    test_env.start_cheat_block_hash(contract_address, BLOCK_NUMBER, Felt::from(123));\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_hash\", &[BLOCK_NUMBER.into()]),\n        &[Felt::from(123)],\n    );\n\n    test_env.stop_cheat_block_hash(contract_address, BLOCK_NUMBER);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_hash\", &[BLOCK_NUMBER.into()]),\n        &[Felt::from(DEFAULT_BLOCK_HASH)],\n    );\n}\n\n#[test]\nfn cheat_block_hash_double() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockHashChecker\", &[]);\n\n    test_env.start_cheat_block_hash(contract_address, BLOCK_NUMBER, Felt::from(123));\n    test_env.start_cheat_block_hash(contract_address, BLOCK_NUMBER, Felt::from(123));\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_hash\", &[BLOCK_NUMBER.into()]),\n        &[Felt::from(123)],\n    );\n\n    test_env.stop_cheat_block_hash(contract_address, BLOCK_NUMBER);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_hash\", &[BLOCK_NUMBER.into()]),\n        &[Felt::from(DEFAULT_BLOCK_HASH)],\n    );\n}\n\n#[test]\nfn cheat_block_hash_proxy() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockHashChecker\", &[]);\n    let proxy_address = test_env.deploy(\"CheatBlockHashCheckerProxy\", &[]);\n    let proxy_selector = \"get_cheated_block_hash\";\n\n    test_env.start_cheat_block_hash(contract_address, BLOCK_NUMBER, Felt::from(123));\n\n    assert_success(\n        test_env.call_contract(\n            &proxy_address,\n            proxy_selector,\n            &[contract_address.into_(), BLOCK_NUMBER.into()],\n        ),\n        &[Felt::from(123)],\n    );\n\n    test_env.stop_cheat_block_hash(contract_address, BLOCK_NUMBER);\n\n    assert_success(\n        test_env.call_contract(\n            &proxy_address,\n            proxy_selector,\n            &[contract_address.into_(), BLOCK_NUMBER.into()],\n        ),\n        &[Felt::from(DEFAULT_BLOCK_HASH)],\n    );\n}\n\n#[test]\nfn cheat_block_hash_library_call() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"CheatBlockHashChecker\", &contracts_data);\n\n    let lib_call_address = test_env.deploy(\"CheatBlockHashCheckerLibCall\", &[]);\n    let lib_call_selector = \"get_block_hash_with_lib_call\";\n\n    test_env.start_cheat_block_hash(lib_call_address, BLOCK_NUMBER, Felt::from(123));\n\n    assert_success(\n        test_env.call_contract(\n            &lib_call_address,\n            lib_call_selector,\n            &[class_hash.into_(), BLOCK_NUMBER.into()],\n        ),\n        &[Felt::from(123)],\n    );\n    test_env.stop_cheat_block_hash(lib_call_address, BLOCK_NUMBER);\n\n    assert_success(\n        test_env.call_contract(\n            &lib_call_address,\n            lib_call_selector,\n            &[class_hash.into_(), BLOCK_NUMBER.into()],\n        ),\n        &[Felt::from(DEFAULT_BLOCK_HASH)],\n    );\n}\n\n#[test]\nfn cheat_block_hash_all_simple() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockHashChecker\", &[]);\n\n    test_env\n        .cheatnet_state\n        .start_cheat_block_hash_global(BLOCK_NUMBER, Felt::from(123));\n\n    let output =\n        test_env.call_contract(&contract_address, \"get_block_hash\", &[BLOCK_NUMBER.into()]);\n    assert_success(output, &[Felt::from(123)]);\n}\n\n#[test]\nfn cheat_block_hash_all_then_one() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockHashChecker\", &[]);\n\n    test_env\n        .cheatnet_state\n        .start_cheat_block_hash_global(BLOCK_NUMBER, Felt::from(321));\n\n    test_env.start_cheat_block_hash(contract_address, BLOCK_NUMBER, Felt::from(123));\n\n    let output =\n        test_env.call_contract(&contract_address, \"get_block_hash\", &[BLOCK_NUMBER.into()]);\n    assert_success(output, &[Felt::from(123)]);\n}\n\n#[test]\nfn cheat_block_hash_one_then_all() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockHashChecker\", &[]);\n\n    test_env.start_cheat_block_hash(contract_address, BLOCK_NUMBER, Felt::from(123));\n\n    test_env\n        .cheatnet_state\n        .start_cheat_block_hash_global(BLOCK_NUMBER, Felt::from(321));\n\n    let output =\n        test_env.call_contract(&contract_address, \"get_block_hash\", &[BLOCK_NUMBER.into()]);\n    assert_success(output, &[Felt::from(321)]);\n}\n\n#[test]\nfn cheat_block_hash_all_stop() {\n    let mut test_env = TestEnvironment::new();\n\n    let cheat_block_hash_checker = test_env.declare(\"CheatBlockHashChecker\", &get_contracts());\n\n    let contract_address = test_env.deploy_wrapper(&cheat_block_hash_checker, &[]);\n\n    test_env\n        .cheatnet_state\n        .start_cheat_block_hash_global(BLOCK_NUMBER, Felt::from(123));\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_hash\", &[BLOCK_NUMBER.into()]),\n        &[Felt::from(123)],\n    );\n\n    test_env\n        .cheatnet_state\n        .stop_cheat_block_hash_global(BLOCK_NUMBER);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_hash\", &[BLOCK_NUMBER.into()]),\n        &[Felt::from(DEFAULT_BLOCK_HASH)],\n    );\n\n    let contract_address = test_env.deploy_wrapper(&cheat_block_hash_checker, &[]);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_hash\", &[BLOCK_NUMBER.into()]),\n        &[Felt::from(DEFAULT_BLOCK_HASH)],\n    );\n}\n\n#[test]\nfn cheat_block_hash_multiple() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"CheatBlockHashChecker\", &contracts_data);\n\n    let contract_address1 = test_env.deploy_wrapper(&class_hash, &[]);\n    let contract_address2 = test_env.deploy_wrapper(&class_hash, &[]);\n\n    test_env.cheatnet_state.start_cheat_block_hash(\n        contract_address1,\n        BLOCK_NUMBER,\n        Felt::from(123),\n    );\n    test_env.cheatnet_state.start_cheat_block_hash(\n        contract_address2,\n        BLOCK_NUMBER,\n        Felt::from(123),\n    );\n\n    assert_success(\n        test_env.call_contract(&contract_address1, \"get_block_hash\", &[BLOCK_NUMBER.into()]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address2, \"get_block_hash\", &[BLOCK_NUMBER.into()]),\n        &[Felt::from(123)],\n    );\n\n    test_env\n        .cheatnet_state\n        .stop_cheat_block_hash(contract_address1, BLOCK_NUMBER);\n    test_env\n        .cheatnet_state\n        .stop_cheat_block_hash(contract_address2, BLOCK_NUMBER);\n\n    assert_success(\n        test_env.call_contract(&contract_address1, \"get_block_hash\", &[BLOCK_NUMBER.into()]),\n        &[Felt::from(DEFAULT_BLOCK_HASH)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address2, \"get_block_hash\", &[BLOCK_NUMBER.into()]),\n        &[Felt::from(DEFAULT_BLOCK_HASH)],\n    );\n}\n\n#[test]\nfn cheat_block_hash_simple_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockHashChecker\", &[]);\n\n    test_env.cheat_block_hash(\n        contract_address,\n        BLOCK_NUMBER,\n        Felt::from(123),\n        CheatSpan::TargetCalls(NonZeroUsize::new(2).unwrap()),\n    );\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_hash\", &[BLOCK_NUMBER.into()]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_hash\", &[BLOCK_NUMBER.into()]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_hash\", &[BLOCK_NUMBER.into()]),\n        &[Felt::from(DEFAULT_BLOCK_HASH)],\n    );\n}\n\n#[test]\nfn cheat_block_hash_proxy_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"CheatBlockHashCheckerProxy\", &contracts_data);\n    let contract_address_1 = test_env.deploy_wrapper(&class_hash, &[]);\n    let contract_address_2 = test_env.deploy_wrapper(&class_hash, &[]);\n\n    test_env.cheat_block_hash(\n        contract_address_1,\n        BLOCK_NUMBER,\n        Felt::from(123),\n        CheatSpan::TargetCalls(NonZeroUsize::new(1).unwrap()),\n    );\n\n    let output = test_env.call_contract(\n        &contract_address_1,\n        \"call_proxy\",\n        &[contract_address_2.into_(), BLOCK_NUMBER.into()],\n    );\n    assert_success(output, &[123.into(), DEFAULT_BLOCK_HASH.into()]);\n}\n\n#[test]\nfn cheat_block_hash_in_constructor_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n\n    let class_hash = test_env.declare(\"ConstructorCheatBlockHashChecker\", &contracts_data);\n    let precalculated_address = test_env.precalculate_address(&class_hash, &[BLOCK_NUMBER.into()]);\n\n    test_env.cheat_block_hash(\n        precalculated_address,\n        BLOCK_NUMBER,\n        Felt::from(123),\n        CheatSpan::TargetCalls(NonZeroUsize::new(2).unwrap()),\n    );\n\n    let contract_address = test_env.deploy_wrapper(&class_hash, &[BLOCK_NUMBER.into()]);\n    assert_eq!(precalculated_address, contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_hash\", &[BLOCK_NUMBER.into()]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_hash\", &[BLOCK_NUMBER.into()]),\n        &[Felt::from(DEFAULT_BLOCK_HASH)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_stored_block_hash\", &[]),\n        &[Felt::from(123)],\n    );\n}\n\n#[test]\nfn cheat_block_hash_no_constructor_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n\n    let class_hash = test_env.declare(\"CheatBlockHashChecker\", &contracts_data);\n    let precalculated_address = test_env.precalculate_address(&class_hash, &[]);\n\n    test_env.cheat_block_hash(\n        precalculated_address,\n        BLOCK_NUMBER,\n        Felt::from(123),\n        CheatSpan::TargetCalls(NonZeroUsize::new(1).unwrap()),\n    );\n\n    let contract_address = test_env.deploy_wrapper(&class_hash, &[]);\n    assert_eq!(precalculated_address, contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_hash\", &[BLOCK_NUMBER.into()]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_hash\", &[BLOCK_NUMBER.into()]),\n        &[Felt::from(DEFAULT_BLOCK_HASH)],\n    );\n}\n\n#[test]\nfn cheat_block_hash_override_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockHashChecker\", &[]);\n\n    test_env.cheat_block_hash(\n        contract_address,\n        BLOCK_NUMBER,\n        Felt::from(123),\n        CheatSpan::TargetCalls(NonZeroUsize::new(2).unwrap()),\n    );\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_hash\", &[BLOCK_NUMBER.into()]),\n        &[Felt::from(123)],\n    );\n\n    test_env.cheat_block_hash(\n        contract_address,\n        BLOCK_NUMBER,\n        Felt::from(321),\n        CheatSpan::Indefinite,\n    );\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_hash\", &[BLOCK_NUMBER.into()]),\n        &[Felt::from(321)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_hash\", &[BLOCK_NUMBER.into()]),\n        &[Felt::from(321)],\n    );\n\n    test_env.stop_cheat_block_hash(contract_address, BLOCK_NUMBER);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_hash\", &[BLOCK_NUMBER.into()]),\n        &[Felt::from(DEFAULT_BLOCK_HASH)],\n    );\n}\n\n#[test]\nfn cheat_block_hash_library_call_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"CheatBlockHashChecker\", &contracts_data);\n    let contract_address = test_env.deploy(\"CheatBlockHashCheckerLibCall\", &[]);\n\n    test_env.cheat_block_hash(\n        contract_address,\n        BLOCK_NUMBER,\n        Felt::from(123),\n        CheatSpan::TargetCalls(NonZeroUsize::new(1).unwrap()),\n    );\n\n    let lib_call_selector = \"get_block_hash_with_lib_call\";\n\n    assert_success(\n        test_env.call_contract(\n            &contract_address,\n            lib_call_selector,\n            &[class_hash.into_(), BLOCK_NUMBER.into()],\n        ),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(\n            &contract_address,\n            lib_call_selector,\n            &[class_hash.into_(), BLOCK_NUMBER.into()],\n        ),\n        &[Felt::from(DEFAULT_BLOCK_HASH)],\n    );\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/cheatcodes/cheat_block_number.rs",
    "content": "use crate::{common::assertions::assert_success, common::get_contracts};\nuse cheatnet::state::CheatSpan;\nuse conversions::IntoConv;\nuse runtime::starknet::context::DEFAULT_BLOCK_NUMBER;\nuse starknet_api::core::ContractAddress;\nuse starknet_types_core::felt::Felt;\nuse std::num::NonZeroUsize;\n\nuse super::test_environment::TestEnvironment;\n\ntrait CheatBlockNumberTrait {\n    fn cheat_block_number(\n        &mut self,\n        contract_address: ContractAddress,\n        block_number: u64,\n        span: CheatSpan,\n    );\n    fn start_cheat_block_number(&mut self, contract_address: ContractAddress, block_number: u64);\n    fn stop_cheat_block_number(&mut self, contract_address: ContractAddress);\n}\n\nimpl CheatBlockNumberTrait for TestEnvironment {\n    fn cheat_block_number(\n        &mut self,\n        contract_address: ContractAddress,\n        block_number: u64,\n        span: CheatSpan,\n    ) {\n        self.cheatnet_state\n            .cheat_block_number(contract_address, block_number, span);\n    }\n\n    fn start_cheat_block_number(&mut self, contract_address: ContractAddress, block_number: u64) {\n        self.cheatnet_state\n            .start_cheat_block_number(contract_address, block_number);\n    }\n\n    fn stop_cheat_block_number(&mut self, contract_address: ContractAddress) {\n        self.cheatnet_state\n            .stop_cheat_block_number(contract_address);\n    }\n}\n\n#[test]\nfn cheat_block_number_simple() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockNumberChecker\", &[]);\n\n    test_env.start_cheat_block_number(contract_address, 123);\n\n    let output = test_env.call_contract(&contract_address, \"get_block_number\", &[]);\n    assert_success(output, &[Felt::from(123)]);\n}\n\n#[test]\nfn cheat_block_number_with_other_syscall() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockNumberChecker\", &[]);\n\n    test_env.start_cheat_block_number(contract_address, 123);\n\n    let output = test_env.call_contract(&contract_address, \"get_block_number_and_emit_event\", &[]);\n    assert_success(output, &[Felt::from(123)]);\n}\n\n#[test]\nfn cheat_block_number_in_constructor() {\n    let mut test_env = TestEnvironment::new();\n    let contracts_data = get_contracts();\n\n    let class_hash = test_env.declare(\"ConstructorCheatBlockNumberChecker\", &contracts_data);\n    let precalculated_address = test_env.precalculate_address(&class_hash, &[]);\n\n    test_env.start_cheat_block_number(precalculated_address, 123);\n\n    let contract_address = test_env.deploy_wrapper(&class_hash, &[]);\n    assert_eq!(precalculated_address, contract_address);\n\n    let output = test_env.call_contract(&contract_address, \"get_stored_block_number\", &[]);\n    assert_success(output, &[Felt::from(123)]);\n}\n\n#[test]\nfn cheat_block_number_stop() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockNumberChecker\", &[]);\n\n    test_env.start_cheat_block_number(contract_address, 123);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_number\", &[]),\n        &[Felt::from(123)],\n    );\n\n    test_env.stop_cheat_block_number(contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_number\", &[]),\n        &[Felt::from(DEFAULT_BLOCK_NUMBER)],\n    );\n}\n\n#[test]\nfn cheat_block_number_double() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockNumberChecker\", &[]);\n\n    test_env.start_cheat_block_number(contract_address, 123);\n    test_env.start_cheat_block_number(contract_address, 123);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_number\", &[]),\n        &[Felt::from(123)],\n    );\n\n    test_env.stop_cheat_block_number(contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_number\", &[]),\n        &[Felt::from(DEFAULT_BLOCK_NUMBER)],\n    );\n}\n\n#[test]\nfn cheat_block_number_proxy() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockNumberChecker\", &[]);\n    let proxy_address = test_env.deploy(\"CheatBlockNumberCheckerProxy\", &[]);\n\n    let proxy_selector = \"get_cheated_block_number\";\n\n    test_env.start_cheat_block_number(contract_address, 123);\n\n    assert_success(\n        test_env.call_contract(&proxy_address, proxy_selector, &[contract_address.into_()]),\n        &[Felt::from(123)],\n    );\n\n    test_env.stop_cheat_block_number(contract_address);\n\n    assert_success(\n        test_env.call_contract(&proxy_address, proxy_selector, &[contract_address.into_()]),\n        &[Felt::from(DEFAULT_BLOCK_NUMBER)],\n    );\n}\n\n#[test]\nfn cheat_block_number_library_call() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"CheatBlockNumberChecker\", &contracts_data);\n\n    let lib_call_address = test_env.deploy(\"CheatBlockNumberCheckerLibCall\", &[]);\n    let lib_call_selector = \"get_block_number_with_lib_call\";\n\n    test_env.start_cheat_block_number(lib_call_address, 123);\n\n    assert_success(\n        test_env.call_contract(&lib_call_address, lib_call_selector, &[class_hash.into_()]),\n        &[Felt::from(123)],\n    );\n    test_env.stop_cheat_block_number(lib_call_address);\n\n    assert_success(\n        test_env.call_contract(&lib_call_address, lib_call_selector, &[class_hash.into_()]),\n        &[Felt::from(DEFAULT_BLOCK_NUMBER)],\n    );\n}\n\n#[test]\nfn cheat_block_number_all_simple() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockNumberChecker\", &[]);\n\n    test_env.cheatnet_state.start_cheat_block_number_global(123);\n\n    let output = test_env.call_contract(&contract_address, \"get_block_number\", &[]);\n    assert_success(output, &[Felt::from(123)]);\n}\n\n#[test]\nfn cheat_block_number_all_then_one() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockNumberChecker\", &[]);\n\n    test_env.cheatnet_state.start_cheat_block_number_global(321);\n    test_env.start_cheat_block_number(contract_address, 123);\n\n    let output = test_env.call_contract(&contract_address, \"get_block_number\", &[]);\n    assert_success(output, &[Felt::from(123)]);\n}\n\n#[test]\nfn cheat_block_number_one_then_all() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockNumberChecker\", &[]);\n\n    test_env.start_cheat_block_number(contract_address, 123);\n    test_env.cheatnet_state.start_cheat_block_number_global(321);\n\n    let output = test_env.call_contract(&contract_address, \"get_block_number\", &[]);\n    assert_success(output, &[Felt::from(321)]);\n}\n\n#[test]\nfn cheat_block_number_all_stop() {\n    let mut test_env = TestEnvironment::new();\n\n    let cheat_block_number_checker = test_env.declare(\"CheatBlockNumberChecker\", &get_contracts());\n    let contract_address = test_env.deploy_wrapper(&cheat_block_number_checker, &[]);\n\n    test_env.cheatnet_state.start_cheat_block_number_global(123);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_number\", &[]),\n        &[Felt::from(123)],\n    );\n\n    test_env.cheatnet_state.stop_cheat_block_number_global();\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_number\", &[]),\n        &[Felt::from(DEFAULT_BLOCK_NUMBER)],\n    );\n\n    let contract_address = test_env.deploy_wrapper(&cheat_block_number_checker, &[]);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_number\", &[]),\n        &[Felt::from(DEFAULT_BLOCK_NUMBER)],\n    );\n}\n\n#[test]\nfn cheat_block_number_multiple() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"CheatBlockNumberChecker\", &contracts_data);\n\n    let contract_address1 = test_env.deploy_wrapper(&class_hash, &[]);\n    let contract_address2 = test_env.deploy_wrapper(&class_hash, &[]);\n\n    test_env\n        .cheatnet_state\n        .start_cheat_block_number(contract_address1, 123);\n    test_env\n        .cheatnet_state\n        .start_cheat_block_number(contract_address2, 123);\n\n    assert_success(\n        test_env.call_contract(&contract_address1, \"get_block_number\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address2, \"get_block_number\", &[]),\n        &[Felt::from(123)],\n    );\n\n    test_env\n        .cheatnet_state\n        .stop_cheat_block_number(contract_address1);\n    test_env\n        .cheatnet_state\n        .stop_cheat_block_number(contract_address2);\n\n    assert_success(\n        test_env.call_contract(&contract_address1, \"get_block_number\", &[]),\n        &[Felt::from(DEFAULT_BLOCK_NUMBER)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address2, \"get_block_number\", &[]),\n        &[Felt::from(DEFAULT_BLOCK_NUMBER)],\n    );\n}\n\n#[test]\nfn cheat_block_number_simple_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockNumberChecker\", &[]);\n\n    test_env.cheat_block_number(\n        contract_address,\n        123,\n        CheatSpan::TargetCalls(NonZeroUsize::new(2).unwrap()),\n    );\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_number\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_number\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_number\", &[]),\n        &[Felt::from(DEFAULT_BLOCK_NUMBER)],\n    );\n}\n\n#[test]\nfn cheat_block_number_proxy_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"CheatBlockNumberCheckerProxy\", &contracts_data);\n    let contract_address_1 = test_env.deploy_wrapper(&class_hash, &[]);\n    let contract_address_2 = test_env.deploy_wrapper(&class_hash, &[]);\n\n    test_env.cheat_block_number(\n        contract_address_1,\n        123,\n        CheatSpan::TargetCalls(NonZeroUsize::new(1).unwrap()),\n    );\n\n    let output = test_env.call_contract(\n        &contract_address_1,\n        \"call_proxy\",\n        &[contract_address_2.into_()],\n    );\n    assert_success(output, &[123.into(), DEFAULT_BLOCK_NUMBER.into()]);\n}\n\n#[test]\nfn cheat_block_number_in_constructor_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n\n    let class_hash = test_env.declare(\"ConstructorCheatBlockNumberChecker\", &contracts_data);\n    let precalculated_address = test_env.precalculate_address(&class_hash, &[]);\n\n    test_env.cheat_block_number(\n        precalculated_address,\n        123,\n        CheatSpan::TargetCalls(NonZeroUsize::new(2).unwrap()),\n    );\n\n    let contract_address = test_env.deploy_wrapper(&class_hash, &[]);\n    assert_eq!(precalculated_address, contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_number\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_number\", &[]),\n        &[Felt::from(DEFAULT_BLOCK_NUMBER)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_stored_block_number\", &[]),\n        &[Felt::from(123)],\n    );\n}\n\n#[test]\nfn cheat_block_number_no_constructor_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n\n    let class_hash = test_env.declare(\"CheatBlockNumberChecker\", &contracts_data);\n    let precalculated_address = test_env.precalculate_address(&class_hash, &[]);\n\n    test_env.cheat_block_number(\n        precalculated_address,\n        123,\n        CheatSpan::TargetCalls(NonZeroUsize::new(1).unwrap()),\n    );\n\n    let contract_address = test_env.deploy_wrapper(&class_hash, &[]);\n    assert_eq!(precalculated_address, contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_number\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_number\", &[]),\n        &[Felt::from(DEFAULT_BLOCK_NUMBER)],\n    );\n}\n\n#[test]\nfn cheat_block_number_override_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockNumberChecker\", &[]);\n\n    test_env.cheat_block_number(\n        contract_address,\n        123,\n        CheatSpan::TargetCalls(NonZeroUsize::new(2).unwrap()),\n    );\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_number\", &[]),\n        &[Felt::from(123)],\n    );\n\n    test_env.cheat_block_number(contract_address, 321, CheatSpan::Indefinite);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_number\", &[]),\n        &[Felt::from(321)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_number\", &[]),\n        &[Felt::from(321)],\n    );\n\n    test_env.stop_cheat_block_number(contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_number\", &[]),\n        &[Felt::from(DEFAULT_BLOCK_NUMBER)],\n    );\n}\n\n#[test]\nfn cheat_block_number_library_call_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"CheatBlockNumberChecker\", &contracts_data);\n    let contract_address = test_env.deploy(\"CheatBlockNumberCheckerLibCall\", &[]);\n\n    test_env.cheat_block_number(\n        contract_address,\n        123,\n        CheatSpan::TargetCalls(NonZeroUsize::new(1).unwrap()),\n    );\n\n    let lib_call_selector = \"get_block_number_with_lib_call\";\n\n    assert_success(\n        test_env.call_contract(&contract_address, lib_call_selector, &[class_hash.into_()]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, lib_call_selector, &[class_hash.into_()]),\n        &[Felt::from(DEFAULT_BLOCK_NUMBER)],\n    );\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/cheatcodes/cheat_block_timestamp.rs",
    "content": "use crate::{common::assertions::assert_success, common::get_contracts};\nuse cheatnet::state::CheatSpan;\nuse conversions::IntoConv;\nuse starknet_api::core::ContractAddress;\nuse starknet_types_core::felt::Felt;\nuse std::num::NonZeroUsize;\n\nuse super::test_environment::TestEnvironment;\n\nconst DEFAULT_BLOCK_TIMESTAMP: u64 = 0;\n\ntrait CheatBlockTimestampTrait {\n    fn cheat_block_timestamp(\n        &mut self,\n        contract_address: ContractAddress,\n        timestamp: u64,\n        span: CheatSpan,\n    );\n    fn start_cheat_block_timestamp(&mut self, contract_address: ContractAddress, timestamp: u64);\n    fn stop_cheat_block_timestamp(&mut self, contract_address: ContractAddress);\n}\n\nimpl CheatBlockTimestampTrait for TestEnvironment {\n    fn cheat_block_timestamp(\n        &mut self,\n        contract_address: ContractAddress,\n        timestamp: u64,\n        span: CheatSpan,\n    ) {\n        self.cheatnet_state\n            .cheat_block_timestamp(contract_address, timestamp, span);\n    }\n\n    fn start_cheat_block_timestamp(&mut self, contract_address: ContractAddress, timestamp: u64) {\n        self.cheatnet_state\n            .start_cheat_block_timestamp(contract_address, timestamp);\n    }\n\n    fn stop_cheat_block_timestamp(&mut self, contract_address: ContractAddress) {\n        self.cheatnet_state\n            .stop_cheat_block_timestamp(contract_address);\n    }\n}\n\n#[test]\nfn cheat_block_timestamp_simple() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockTimestampChecker\", &[]);\n\n    test_env.start_cheat_block_timestamp(contract_address, 123);\n\n    let output = test_env.call_contract(&contract_address, \"get_block_timestamp\", &[]);\n    assert_success(output, &[Felt::from(123)]);\n}\n\n#[test]\nfn cheat_block_timestamp_with_other_syscall() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockTimestampChecker\", &[]);\n\n    test_env.start_cheat_block_timestamp(contract_address, 123);\n    let selector = \"get_block_timestamp_and_emit_event\";\n\n    let output = test_env.call_contract(&contract_address, selector, &[]);\n    assert_success(output, &[Felt::from(123)]);\n}\n\n#[test]\nfn cheat_block_timestamp_in_constructor() {\n    let mut test_env = TestEnvironment::new();\n    let contracts_data = get_contracts();\n\n    let class_hash = test_env.declare(\"ConstructorCheatBlockTimestampChecker\", &contracts_data);\n    let precalculated_address = test_env.precalculate_address(&class_hash, &[]);\n\n    test_env.start_cheat_block_timestamp(precalculated_address, 123);\n\n    let contract_address = test_env.deploy_wrapper(&class_hash, &[]);\n\n    assert_eq!(precalculated_address, contract_address);\n\n    let output = test_env.call_contract(&contract_address, \"get_stored_block_timestamp\", &[]);\n    assert_success(output, &[Felt::from(123)]);\n}\n\n#[test]\nfn cheat_block_timestamp_stop() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockTimestampChecker\", &[]);\n\n    test_env.start_cheat_block_timestamp(contract_address, 123);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_timestamp\", &[]),\n        &[Felt::from(123)],\n    );\n\n    test_env.stop_cheat_block_timestamp(contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_timestamp\", &[]),\n        &[Felt::from(DEFAULT_BLOCK_TIMESTAMP)],\n    );\n}\n\n#[test]\nfn cheat_block_timestamp_double() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockTimestampChecker\", &[]);\n\n    test_env.start_cheat_block_timestamp(contract_address, 123);\n    test_env.start_cheat_block_timestamp(contract_address, 123);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_timestamp\", &[]),\n        &[Felt::from(123)],\n    );\n\n    test_env.stop_cheat_block_timestamp(contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_timestamp\", &[]),\n        &[Felt::from(DEFAULT_BLOCK_TIMESTAMP)],\n    );\n}\n\n#[test]\nfn cheat_block_timestamp_proxy() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockTimestampChecker\", &[]);\n    let proxy_address = test_env.deploy(\"CheatBlockTimestampCheckerProxy\", &[]);\n    let proxy_selector = \"get_cheated_block_timestamp\";\n\n    test_env.start_cheat_block_timestamp(contract_address, 123);\n\n    assert_success(\n        test_env.call_contract(&proxy_address, proxy_selector, &[contract_address.into_()]),\n        &[Felt::from(123)],\n    );\n\n    test_env.stop_cheat_block_timestamp(contract_address);\n\n    assert_success(\n        test_env.call_contract(&proxy_address, proxy_selector, &[contract_address.into_()]),\n        &[Felt::from(DEFAULT_BLOCK_TIMESTAMP)],\n    );\n}\n\n#[test]\nfn cheat_block_timestamp_library_call() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"CheatBlockTimestampChecker\", &contracts_data);\n\n    let lib_call_address = test_env.deploy(\"CheatBlockTimestampCheckerLibCall\", &[]);\n    let lib_call_selector = \"get_block_timestamp_with_lib_call\";\n\n    test_env.start_cheat_block_timestamp(lib_call_address, 123);\n\n    assert_success(\n        test_env.call_contract(&lib_call_address, lib_call_selector, &[class_hash.into_()]),\n        &[Felt::from(123)],\n    );\n    test_env.stop_cheat_block_timestamp(lib_call_address);\n\n    assert_success(\n        test_env.call_contract(&lib_call_address, lib_call_selector, &[class_hash.into_()]),\n        &[Felt::from(DEFAULT_BLOCK_TIMESTAMP)],\n    );\n}\n\n#[test]\nfn cheat_block_timestamp_all_simple() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockTimestampChecker\", &[]);\n\n    test_env\n        .cheatnet_state\n        .start_cheat_block_timestamp_global(123);\n\n    let output = test_env.call_contract(&contract_address, \"get_block_timestamp\", &[]);\n    assert_success(output, &[Felt::from(123)]);\n}\n\n#[test]\nfn cheat_block_timestamp_all_then_one() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockTimestampChecker\", &[]);\n\n    test_env\n        .cheatnet_state\n        .start_cheat_block_timestamp_global(321);\n\n    test_env.start_cheat_block_timestamp(contract_address, 123);\n\n    let output = test_env.call_contract(&contract_address, \"get_block_timestamp\", &[]);\n    assert_success(output, &[Felt::from(123)]);\n}\n\n#[test]\nfn cheat_block_timestamp_one_then_all() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockTimestampChecker\", &[]);\n\n    test_env.start_cheat_block_timestamp(contract_address, 123);\n\n    test_env\n        .cheatnet_state\n        .start_cheat_block_timestamp_global(321);\n\n    let output = test_env.call_contract(&contract_address, \"get_block_timestamp\", &[]);\n    assert_success(output, &[Felt::from(321)]);\n}\n\n#[test]\nfn cheat_block_timestamp_all_stop() {\n    let mut test_env = TestEnvironment::new();\n\n    let cheat_block_timestamp_checker =\n        test_env.declare(\"CheatBlockTimestampChecker\", &get_contracts());\n\n    let contract_address = test_env.deploy_wrapper(&cheat_block_timestamp_checker, &[]);\n\n    test_env\n        .cheatnet_state\n        .start_cheat_block_timestamp_global(123);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_timestamp\", &[]),\n        &[Felt::from(123)],\n    );\n\n    test_env.cheatnet_state.stop_cheat_block_timestamp_global();\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_timestamp\", &[]),\n        &[Felt::from(DEFAULT_BLOCK_TIMESTAMP)],\n    );\n\n    let contract_address = test_env.deploy_wrapper(&cheat_block_timestamp_checker, &[]);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_timestamp\", &[]),\n        &[Felt::from(DEFAULT_BLOCK_TIMESTAMP)],\n    );\n}\n\n#[test]\nfn cheat_block_timestamp_multiple() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"CheatBlockTimestampChecker\", &contracts_data);\n\n    let contract_address1 = test_env.deploy_wrapper(&class_hash, &[]);\n    let contract_address2 = test_env.deploy_wrapper(&class_hash, &[]);\n\n    test_env\n        .cheatnet_state\n        .start_cheat_block_timestamp(contract_address1, 123);\n    test_env\n        .cheatnet_state\n        .start_cheat_block_timestamp(contract_address2, 123);\n\n    assert_success(\n        test_env.call_contract(&contract_address1, \"get_block_timestamp\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address2, \"get_block_timestamp\", &[]),\n        &[Felt::from(123)],\n    );\n\n    test_env\n        .cheatnet_state\n        .stop_cheat_block_timestamp(contract_address1);\n    test_env\n        .cheatnet_state\n        .stop_cheat_block_timestamp(contract_address2);\n\n    assert_success(\n        test_env.call_contract(&contract_address1, \"get_block_timestamp\", &[]),\n        &[Felt::from(DEFAULT_BLOCK_TIMESTAMP)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address2, \"get_block_timestamp\", &[]),\n        &[Felt::from(DEFAULT_BLOCK_TIMESTAMP)],\n    );\n}\n\n#[test]\nfn cheat_block_timestamp_simple_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockTimestampChecker\", &[]);\n\n    test_env.cheat_block_timestamp(\n        contract_address,\n        123,\n        CheatSpan::TargetCalls(NonZeroUsize::new(2).unwrap()),\n    );\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_timestamp\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_timestamp\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_timestamp\", &[]),\n        &[Felt::from(DEFAULT_BLOCK_TIMESTAMP)],\n    );\n}\n\n#[test]\nfn cheat_block_timestamp_proxy_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"CheatBlockTimestampCheckerProxy\", &contracts_data);\n    let contract_address_1 = test_env.deploy_wrapper(&class_hash, &[]);\n    let contract_address_2 = test_env.deploy_wrapper(&class_hash, &[]);\n\n    test_env.cheat_block_timestamp(\n        contract_address_1,\n        123,\n        CheatSpan::TargetCalls(NonZeroUsize::new(1).unwrap()),\n    );\n\n    let output = test_env.call_contract(\n        &contract_address_1,\n        \"call_proxy\",\n        &[contract_address_2.into_()],\n    );\n    assert_success(output, &[123.into(), DEFAULT_BLOCK_TIMESTAMP.into()]);\n}\n\n#[test]\nfn cheat_block_timestamp_in_constructor_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n\n    let class_hash = test_env.declare(\"ConstructorCheatBlockTimestampChecker\", &contracts_data);\n    let precalculated_address = test_env.precalculate_address(&class_hash, &[]);\n\n    test_env.cheat_block_timestamp(\n        precalculated_address,\n        123,\n        CheatSpan::TargetCalls(NonZeroUsize::new(2).unwrap()),\n    );\n\n    let contract_address = test_env.deploy_wrapper(&class_hash, &[]);\n    assert_eq!(precalculated_address, contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_timestamp\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_timestamp\", &[]),\n        &[Felt::from(DEFAULT_BLOCK_TIMESTAMP)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_stored_block_timestamp\", &[]),\n        &[Felt::from(123)],\n    );\n}\n\n#[test]\nfn cheat_block_timestamp_no_constructor_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n\n    let class_hash = test_env.declare(\"CheatBlockTimestampChecker\", &contracts_data);\n    let precalculated_address = test_env.precalculate_address(&class_hash, &[]);\n\n    test_env.cheat_block_timestamp(\n        precalculated_address,\n        123,\n        CheatSpan::TargetCalls(NonZeroUsize::new(1).unwrap()),\n    );\n\n    let contract_address = test_env.deploy_wrapper(&class_hash, &[]);\n    assert_eq!(precalculated_address, contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_timestamp\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_timestamp\", &[]),\n        &[Felt::from(DEFAULT_BLOCK_TIMESTAMP)],\n    );\n}\n\n#[test]\nfn cheat_block_timestamp_override_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockTimestampChecker\", &[]);\n\n    test_env.cheat_block_timestamp(\n        contract_address,\n        123,\n        CheatSpan::TargetCalls(NonZeroUsize::new(2).unwrap()),\n    );\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_timestamp\", &[]),\n        &[Felt::from(123)],\n    );\n\n    test_env.cheat_block_timestamp(contract_address, 321, CheatSpan::Indefinite);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_timestamp\", &[]),\n        &[Felt::from(321)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_timestamp\", &[]),\n        &[Felt::from(321)],\n    );\n\n    test_env.stop_cheat_block_timestamp(contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_block_timestamp\", &[]),\n        &[Felt::from(DEFAULT_BLOCK_TIMESTAMP)],\n    );\n}\n\n#[test]\nfn cheat_block_timestamp_library_call_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"CheatBlockTimestampChecker\", &contracts_data);\n    let contract_address = test_env.deploy(\"CheatBlockTimestampCheckerLibCall\", &[]);\n\n    test_env.cheat_block_timestamp(\n        contract_address,\n        123,\n        CheatSpan::TargetCalls(NonZeroUsize::new(1).unwrap()),\n    );\n\n    let lib_call_selector = \"get_block_timestamp_with_lib_call\";\n\n    assert_success(\n        test_env.call_contract(&contract_address, lib_call_selector, &[class_hash.into_()]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, lib_call_selector, &[class_hash.into_()]),\n        &[Felt::from(DEFAULT_BLOCK_TIMESTAMP)],\n    );\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/cheatcodes/cheat_caller_address.rs",
    "content": "use crate::common::assertions::assert_success;\nuse crate::common::get_contracts;\nuse cairo_lang_starknet_classes::keccak::starknet_keccak;\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::spy_events::Event;\nuse cheatnet::state::CheatSpan;\nuse conversions::IntoConv;\nuse starknet_api::core::ContractAddress;\nuse starknet_types_core::felt::Felt;\nuse std::num::NonZeroUsize;\nuse tempfile::TempDir;\n\nuse super::test_environment::TestEnvironment;\nuse crate::common::state::create_fork_cached_state_at;\nuse conversions::string::TryFromHexStr;\nuse runtime::starknet::constants::TEST_ADDRESS;\n\ntrait CheatCallerAddressTrait {\n    fn cheat_caller_address(\n        &mut self,\n        contract_address: ContractAddress,\n        new_address: u128,\n        span: CheatSpan,\n    );\n    fn start_cheat_caller_address(&mut self, contract_address: ContractAddress, new_address: u128);\n    fn stop_cheat_caller_address(&mut self, contract_address: ContractAddress);\n}\n\nimpl CheatCallerAddressTrait for TestEnvironment {\n    fn cheat_caller_address(\n        &mut self,\n        contract_address: ContractAddress,\n        new_address: u128,\n        span: CheatSpan,\n    ) {\n        self.cheatnet_state.cheat_caller_address(\n            contract_address,\n            ContractAddress::from(new_address),\n            span,\n        );\n    }\n\n    fn start_cheat_caller_address(&mut self, contract_address: ContractAddress, new_address: u128) {\n        self.cheatnet_state\n            .start_cheat_caller_address(contract_address, ContractAddress::from(new_address));\n    }\n\n    fn stop_cheat_caller_address(&mut self, contract_address: ContractAddress) {\n        self.cheatnet_state\n            .stop_cheat_caller_address(contract_address);\n    }\n}\n\n#[test]\nfn cheat_caller_address_simple() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatCallerAddressChecker\", &[]);\n\n    test_env.start_cheat_caller_address(contract_address, 123);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address\", &[]),\n        &[Felt::from(123)],\n    );\n}\n\n#[test]\nfn cheat_caller_address_with_other_syscall() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatCallerAddressChecker\", &[]);\n\n    test_env.start_cheat_caller_address(contract_address, 123);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address_and_emit_event\", &[]),\n        &[Felt::from(123)],\n    );\n}\n\n#[test]\nfn cheat_caller_address_in_constructor() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"ConstructorCheatCallerAddressChecker\", &contracts_data);\n    let precalculated_address = test_env.precalculate_address(&class_hash, &[]);\n\n    test_env.start_cheat_caller_address(precalculated_address, 123);\n\n    let contract_address = test_env.deploy_wrapper(&class_hash, &[]);\n    assert_eq!(precalculated_address, contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_stored_caller_address\", &[]),\n        &[Felt::from(123)],\n    );\n}\n\n#[test]\nfn cheat_caller_address_stop() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatCallerAddressChecker\", &[]);\n\n    test_env.start_cheat_caller_address(contract_address, 123);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address\", &[]),\n        &[Felt::from(123)],\n    );\n\n    test_env.stop_cheat_caller_address(contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address\", &[]),\n        &[TryFromHexStr::try_from_hex_str(TEST_ADDRESS).unwrap()],\n    );\n}\n\n#[test]\nfn cheat_caller_address_double() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatCallerAddressChecker\", &[]);\n\n    test_env.start_cheat_caller_address(contract_address, 111);\n    test_env.start_cheat_caller_address(contract_address, 222);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address\", &[]),\n        &[Felt::from(222)],\n    );\n\n    test_env.stop_cheat_caller_address(contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address\", &[]),\n        &[TryFromHexStr::try_from_hex_str(TEST_ADDRESS).unwrap()],\n    );\n}\n\n#[test]\nfn cheat_caller_address_proxy() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatCallerAddressChecker\", &[]);\n    let proxy_address = test_env.deploy(\"CheatCallerAddressCheckerProxy\", &[]);\n\n    test_env.start_cheat_caller_address(contract_address, 123);\n\n    let selector = \"get_cheated_caller_address\";\n    assert_success(\n        test_env.call_contract(&proxy_address, selector, &[contract_address.into_()]),\n        &[Felt::from(123)],\n    );\n\n    test_env.stop_cheat_caller_address(contract_address);\n\n    assert_success(\n        test_env.call_contract(&proxy_address, selector, &[contract_address.into_()]),\n        &[proxy_address.into_()],\n    );\n}\n\n#[test]\nfn cheat_caller_address_library_call() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"CheatCallerAddressChecker\", &contracts_data);\n    let lib_call_address = test_env.deploy(\"CheatCallerAddressCheckerLibCall\", &[]);\n\n    test_env.start_cheat_caller_address(lib_call_address, 123);\n\n    let lib_call_selector = \"get_caller_address_with_lib_call\";\n    assert_success(\n        test_env.call_contract(&lib_call_address, lib_call_selector, &[class_hash.into_()]),\n        &[Felt::from(123)],\n    );\n\n    test_env.stop_cheat_caller_address(lib_call_address);\n\n    assert_success(\n        test_env.call_contract(&lib_call_address, lib_call_selector, &[class_hash.into_()]),\n        &[TryFromHexStr::try_from_hex_str(TEST_ADDRESS).unwrap()],\n    );\n}\n\n#[test]\nfn cheat_caller_address_all() {\n    let mut test_env = TestEnvironment::new();\n\n    let cheat_caller_address_checker =\n        test_env.declare(\"CheatCallerAddressChecker\", &get_contracts());\n    let contract_address = test_env.deploy_wrapper(&cheat_caller_address_checker, &[]);\n\n    test_env\n        .cheatnet_state\n        .start_cheat_caller_address_global(123_u8.into());\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address\", &[]),\n        &[Felt::from(123)],\n    );\n\n    test_env.cheatnet_state.stop_cheat_caller_address_global();\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address\", &[]),\n        &[TryFromHexStr::try_from_hex_str(TEST_ADDRESS).unwrap()],\n    );\n\n    let contract_address = test_env.deploy_wrapper(&cheat_caller_address_checker, &[]);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address\", &[]),\n        &[TryFromHexStr::try_from_hex_str(TEST_ADDRESS).unwrap()],\n    );\n}\n\n#[test]\nfn cheat_caller_address_multiple() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"CheatCallerAddressChecker\", &contracts_data);\n\n    let contract_address1 = test_env.deploy_wrapper(&class_hash, &[]);\n    let contract_address2 = test_env.deploy_wrapper(&class_hash, &[]);\n\n    test_env.start_cheat_caller_address(contract_address1, 123);\n    test_env.start_cheat_caller_address(contract_address2, 123);\n\n    assert_success(\n        test_env.call_contract(&contract_address1, \"get_caller_address\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address2, \"get_caller_address\", &[]),\n        &[Felt::from(123)],\n    );\n\n    test_env\n        .cheatnet_state\n        .stop_cheat_caller_address(contract_address1);\n    test_env\n        .cheatnet_state\n        .stop_cheat_caller_address(contract_address2);\n\n    assert_success(\n        test_env.call_contract(&contract_address1, \"get_caller_address\", &[]),\n        &[TryFromHexStr::try_from_hex_str(TEST_ADDRESS).unwrap()],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address2, \"get_caller_address\", &[]),\n        &[TryFromHexStr::try_from_hex_str(TEST_ADDRESS).unwrap()],\n    );\n}\n\n#[test]\nfn cheat_caller_address_all_then_one() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatCallerAddressChecker\", &[]);\n\n    test_env\n        .cheatnet_state\n        .start_cheat_caller_address_global(111_u8.into());\n    test_env.start_cheat_caller_address(contract_address, 222);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address\", &[]),\n        &[Felt::from(222)],\n    );\n}\n\n#[test]\nfn cheat_caller_address_one_then_all() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatCallerAddressChecker\", &[]);\n\n    test_env.start_cheat_caller_address(contract_address, 111);\n    test_env\n        .cheatnet_state\n        .start_cheat_caller_address_global(222_u8.into());\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address\", &[]),\n        &[Felt::from(222)],\n    );\n}\n\n#[test]\nfn cheat_caller_address_cairo0_callback() {\n    let temp_dir = TempDir::new().unwrap();\n    let cached_state = create_fork_cached_state_at(53_631, temp_dir.path().to_str().unwrap());\n    let mut test_env = TestEnvironment::new();\n\n    test_env.cached_state = cached_state;\n\n    let contract_address = test_env.deploy(\"Cairo1Contract_v1\", &[]);\n\n    test_env.start_cheat_caller_address(contract_address, 123);\n\n    let expected_caller_address = Felt::from(123);\n\n    assert_success(\n        test_env.call_contract(\n            &contract_address,\n            \"start\",\n            &[\n                // cairo 0 callback contract address\n                Felt::try_from_hex_str(\n                    \"0x18783f6c124c3acc504f300cb6b3a33def439681744d027be8d7fd5d3551565\",\n                )\n                .unwrap(),\n                expected_caller_address,\n            ],\n        ),\n        &[],\n    );\n\n    let events = test_env.cheatnet_state.get_events(0);\n\n    // make sure end() was called by cairo0 contract\n    assert_eq!(\n        events[0],\n        Event {\n            from: contract_address,\n            keys: vec![starknet_keccak(\"End\".as_ref()).into()],\n            data: vec![expected_caller_address]\n        },\n        \"Wrong event\"\n    );\n}\n\n#[test]\nfn cheat_caller_address_simple_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatCallerAddressChecker\", &[]);\n\n    test_env.cheat_caller_address(\n        contract_address,\n        123,\n        CheatSpan::TargetCalls(NonZeroUsize::new(2).unwrap()),\n    );\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address\", &[]),\n        &[TryFromHexStr::try_from_hex_str(TEST_ADDRESS).unwrap()],\n    );\n}\n\n#[test]\nfn cheat_caller_address_proxy_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"CheatCallerAddressCheckerProxy\", &contracts_data);\n\n    let contract_address_1 = test_env.deploy_wrapper(&class_hash, &[]);\n    let contract_address_2 = test_env.deploy_wrapper(&class_hash, &[]);\n\n    test_env.cheat_caller_address(\n        contract_address_1,\n        123,\n        CheatSpan::TargetCalls(NonZeroUsize::new(1).unwrap()),\n    );\n\n    let output = test_env.call_contract(\n        &contract_address_1,\n        \"call_proxy\",\n        &[contract_address_2.into_()],\n    );\n    assert_success(output, &[123.into(), contract_address_2.into_()]);\n}\n\n#[test]\nfn cheat_caller_address_override_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatCallerAddressChecker\", &[]);\n\n    test_env.cheat_caller_address(\n        contract_address,\n        123,\n        CheatSpan::TargetCalls(NonZeroUsize::new(2).unwrap()),\n    );\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address\", &[]),\n        &[Felt::from(123)],\n    );\n\n    test_env.cheat_caller_address(contract_address, 321, CheatSpan::Indefinite);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address\", &[]),\n        &[Felt::from(321)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address\", &[]),\n        &[Felt::from(321)],\n    );\n\n    test_env.stop_cheat_caller_address(contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address\", &[]),\n        &[TryFromHexStr::try_from_hex_str(TEST_ADDRESS).unwrap()],\n    );\n}\n\n#[test]\nfn cheat_caller_address_constructor_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"ConstructorCheatCallerAddressChecker\", &contracts_data);\n    let precalculated_address = test_env.precalculate_address(&class_hash, &[]);\n\n    test_env.cheat_caller_address(\n        precalculated_address,\n        123,\n        CheatSpan::TargetCalls(NonZeroUsize::new(3).unwrap()),\n    );\n\n    let contract_address = test_env.deploy_wrapper(&class_hash, &[]);\n    assert_eq!(precalculated_address, contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_stored_caller_address\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address\", &[]),\n        &[TryFromHexStr::try_from_hex_str(TEST_ADDRESS).unwrap()],\n    );\n}\n\n#[test]\nfn cheat_caller_address_library_call_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"CheatCallerAddressChecker\", &contracts_data);\n    let contract_address = test_env.deploy(\"CheatCallerAddressCheckerLibCall\", &[]);\n\n    test_env.cheat_caller_address(\n        contract_address,\n        123,\n        CheatSpan::TargetCalls(NonZeroUsize::new(1).unwrap()),\n    );\n\n    let lib_call_selector = \"get_caller_address_with_lib_call\";\n\n    assert_success(\n        test_env.call_contract(&contract_address, lib_call_selector, &[class_hash.into_()]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, lib_call_selector, &[class_hash.into_()]),\n        &[TryFromHexStr::try_from_hex_str(TEST_ADDRESS).unwrap()],\n    );\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/cheatcodes/cheat_execution_info.rs",
    "content": "use super::test_environment::TestEnvironment;\nuse crate::common::{assertions::assert_success, get_contracts, recover_data};\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::cheat_execution_info::ResourceBounds;\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::cheat_execution_info::{\n    CheatArguments, ExecutionInfoMockOperations, Operation, TxInfoMockOperations,\n};\nuse cheatnet::state::CheatSpan;\nuse conversions::IntoConv;\nuse conversions::serde::deserialize::{BufferReader, CairoDeserialize};\nuse starknet_api::{core::ContractAddress, transaction::TransactionHash};\nuse starknet_types_core::felt::Felt;\nuse std::num::NonZeroUsize;\n\ntrait CheatTransactionHashTrait {\n    fn cheat_transaction_hash(\n        &mut self,\n        contract_address: ContractAddress,\n        transaction_hash: Felt,\n        span: CheatSpan,\n    );\n    fn start_cheat_transaction_hash(\n        &mut self,\n        contract_address: ContractAddress,\n        transaction_hash: Felt,\n    );\n    fn stop_cheat_transaction_hash(&mut self, contract_address: ContractAddress);\n    fn start_cheat_transaction_hash_global(&mut self, transaction_hash: Felt);\n    fn stop_cheat_transaction_hash_global(&mut self);\n}\nimpl CheatTransactionHashTrait for TestEnvironment {\n    fn cheat_transaction_hash(\n        &mut self,\n        contract_address: ContractAddress,\n        transaction_hash: Felt,\n        span: CheatSpan,\n    ) {\n        let mut execution_info_mock = ExecutionInfoMockOperations::default();\n\n        execution_info_mock.tx_info.transaction_hash = Operation::Start(CheatArguments {\n            value: transaction_hash,\n            span,\n            target: contract_address,\n        });\n\n        self.cheatnet_state\n            .cheat_execution_info(execution_info_mock);\n    }\n\n    fn start_cheat_transaction_hash(\n        &mut self,\n        contract_address: ContractAddress,\n        transaction_hash: Felt,\n    ) {\n        let mut execution_info_mock = ExecutionInfoMockOperations::default();\n\n        execution_info_mock.tx_info.transaction_hash = Operation::Start(CheatArguments {\n            value: transaction_hash,\n            span: CheatSpan::Indefinite,\n            target: contract_address,\n        });\n\n        self.cheatnet_state\n            .cheat_execution_info(execution_info_mock);\n    }\n\n    fn stop_cheat_transaction_hash(&mut self, contract_address: ContractAddress) {\n        let mut execution_info_mock = ExecutionInfoMockOperations::default();\n\n        execution_info_mock.tx_info.transaction_hash = Operation::Stop(contract_address);\n\n        self.cheatnet_state\n            .cheat_execution_info(execution_info_mock);\n    }\n\n    fn start_cheat_transaction_hash_global(&mut self, transaction_hash: Felt) {\n        let mut execution_info_mock = ExecutionInfoMockOperations::default();\n\n        execution_info_mock.tx_info.transaction_hash = Operation::StartGlobal(transaction_hash);\n\n        self.cheatnet_state\n            .cheat_execution_info(execution_info_mock);\n    }\n    fn stop_cheat_transaction_hash_global(&mut self) {\n        let mut execution_info_mock = ExecutionInfoMockOperations::default();\n\n        execution_info_mock.tx_info.transaction_hash = Operation::StopGlobal;\n\n        self.cheatnet_state\n            .cheat_execution_info(execution_info_mock);\n    }\n}\n\ntrait CheatTransactionInfoTrait {\n    fn cheat_transaction_info(&mut self, tx_info_mock: TxInfoMockOperations);\n}\n\nimpl CheatTransactionInfoTrait for TestEnvironment {\n    fn cheat_transaction_info(&mut self, tx_info_mock: TxInfoMockOperations) {\n        let execution_info_mock_operations = ExecutionInfoMockOperations {\n            tx_info: tx_info_mock,\n            ..Default::default()\n        };\n\n        self.cheatnet_state\n            .cheat_execution_info(execution_info_mock_operations);\n    }\n}\n\ntrait TxInfoTrait {\n    fn assert_tx_info(&mut self, contract_address: &ContractAddress, expected_tx_info: &TxInfo);\n    fn get_tx_info(&mut self, contract_address: &ContractAddress) -> TxInfo;\n}\n\nimpl TxInfoTrait for TestEnvironment {\n    fn assert_tx_info(&mut self, contract_address: &ContractAddress, expected_tx_info: &TxInfo) {\n        let tx_info = self.get_tx_info(contract_address);\n        assert_eq!(tx_info, *expected_tx_info);\n    }\n\n    fn get_tx_info(&mut self, contract_address: &ContractAddress) -> TxInfo {\n        let call_result = self.call_contract(contract_address, \"get_tx_info\", &[]);\n        let data = recover_data(call_result);\n        TxInfo::deserialize(&data)\n    }\n}\n\n#[derive(CairoDeserialize, Clone, Default, Debug, PartialEq)]\nstruct TxInfo {\n    pub version: Felt,\n    pub account_contract_address: Felt,\n    pub max_fee: Felt,\n    pub signature: Vec<Felt>,\n    pub transaction_hash: Felt,\n    pub chain_id: Felt,\n    pub nonce: Felt,\n    pub resource_bounds: Vec<ResourceBounds>,\n    pub tip: Felt,\n    pub paymaster_data: Vec<Felt>,\n    pub nonce_data_availability_mode: Felt,\n    pub fee_data_availability_mode: Felt,\n    pub account_deployment_data: Vec<Felt>,\n    pub proof_facts: Vec<Felt>,\n}\n\nimpl TxInfo {\n    fn apply_mock_fields(tx_info_mock: &TxInfoMockOperations, tx_info: &Self) -> Self {\n        macro_rules! clone_field {\n            ($field:ident) => {\n                if let Operation::Start(CheatArguments {\n                    value,\n                    span: CheatSpan::Indefinite,\n                    target: _contract_address,\n                }) = tx_info_mock.$field.clone()\n                {\n                    value\n                } else {\n                    tx_info.$field.clone()\n                }\n            };\n        }\n\n        Self {\n            version: clone_field!(version),\n            account_contract_address: clone_field!(account_contract_address),\n            max_fee: clone_field!(max_fee),\n            signature: clone_field!(signature),\n            transaction_hash: clone_field!(transaction_hash),\n            chain_id: clone_field!(chain_id),\n            nonce: clone_field!(nonce),\n            resource_bounds: clone_field!(resource_bounds),\n            tip: clone_field!(tip),\n            paymaster_data: clone_field!(paymaster_data),\n            nonce_data_availability_mode: clone_field!(nonce_data_availability_mode),\n            fee_data_availability_mode: clone_field!(fee_data_availability_mode),\n            account_deployment_data: clone_field!(account_deployment_data),\n            proof_facts: clone_field!(proof_facts),\n        }\n    }\n\n    fn deserialize(data: &[Felt]) -> Self {\n        BufferReader::new(data).read().unwrap()\n    }\n}\n\n#[test]\nfn cheat_transaction_hash_simple() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatTxInfoChecker\", &[]);\n\n    let tx_info_before = test_env.get_tx_info(&contract_address);\n\n    let transaction_hash = Felt::from(123);\n    let mut expected_tx_info = tx_info_before.clone();\n\n    expected_tx_info.transaction_hash = transaction_hash;\n\n    test_env.start_cheat_transaction_hash(contract_address, transaction_hash);\n\n    test_env.assert_tx_info(&contract_address, &expected_tx_info);\n}\n\n#[test]\nfn start_cheat_execution_info_multiple_times() {\n    fn operation_start<T>(contract_address: ContractAddress, value: T) -> Operation<T> {\n        Operation::Start(CheatArguments {\n            value,\n            span: CheatSpan::Indefinite,\n            target: contract_address,\n        })\n    }\n\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatTxInfoChecker\", &[]);\n\n    let tx_info_before = test_env.get_tx_info(&contract_address);\n\n    let initial_tx_info_mock = TxInfoMockOperations {\n        version: operation_start(contract_address, Felt::from(13)),\n        account_contract_address: operation_start(contract_address, Felt::from(66)),\n        max_fee: operation_start(contract_address, Felt::from(77)),\n        signature: operation_start(contract_address, vec![Felt::from(88), Felt::from(89)]),\n        transaction_hash: operation_start(contract_address, Felt::from(123)),\n        chain_id: operation_start(contract_address, Felt::from(22)),\n        nonce: operation_start(contract_address, Felt::from(33)),\n        resource_bounds: operation_start(\n            contract_address,\n            vec![\n                ResourceBounds {\n                    resource: Felt::from(111),\n                    max_amount: 222,\n                    max_price_per_unit: 333,\n                },\n                ResourceBounds {\n                    resource: Felt::from(444),\n                    max_amount: 555,\n                    max_price_per_unit: 666,\n                },\n            ],\n        ),\n        tip: operation_start(contract_address, Felt::from(777)),\n        paymaster_data: operation_start(\n            contract_address,\n            vec![\n                Felt::from(11),\n                Felt::from(22),\n                Felt::from(33),\n                Felt::from(44),\n            ],\n        ),\n        nonce_data_availability_mode: operation_start(contract_address, Felt::from(55)),\n        fee_data_availability_mode: operation_start(contract_address, Felt::from(66)),\n        account_deployment_data: operation_start(\n            contract_address,\n            vec![Felt::from(777), Felt::from(888), Felt::from(999)],\n        ),\n        proof_facts: operation_start(\n            contract_address,\n            vec![Felt::from(13), Felt::from(14), Felt::from(15)],\n        ),\n    };\n\n    let expected_tx_info = TxInfo::apply_mock_fields(&initial_tx_info_mock, &tx_info_before);\n\n    test_env.cheat_transaction_info(initial_tx_info_mock.clone());\n\n    test_env.assert_tx_info(&contract_address, &expected_tx_info);\n\n    let tx_info_mock = TxInfoMockOperations {\n        version: Operation::Retain,\n        max_fee: Operation::Retain,\n        transaction_hash: Operation::Retain,\n        nonce: Operation::Retain,\n        tip: Operation::Retain,\n        nonce_data_availability_mode: Operation::Retain,\n        account_deployment_data: Operation::Retain,\n        proof_facts: Operation::Retain,\n        ..initial_tx_info_mock\n    };\n\n    let expected_tx_info = TxInfo::apply_mock_fields(&tx_info_mock, &expected_tx_info);\n\n    test_env.cheat_transaction_info(tx_info_mock);\n\n    test_env.assert_tx_info(&contract_address, &expected_tx_info);\n\n    let tx_info_mock = TxInfoMockOperations {\n        account_contract_address: Operation::Retain,\n        signature: Operation::Retain,\n        chain_id: Operation::Retain,\n        resource_bounds: Operation::Retain,\n        paymaster_data: Operation::Retain,\n        fee_data_availability_mode: Operation::Retain,\n        ..initial_tx_info_mock\n    };\n\n    let expected_tx_info = TxInfo::apply_mock_fields(&tx_info_mock, &expected_tx_info);\n\n    test_env.cheat_transaction_info(tx_info_mock);\n\n    test_env.assert_tx_info(&contract_address, &expected_tx_info);\n}\n\n#[test]\nfn cheat_transaction_hash_start_stop() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatTxInfoChecker\", &[]);\n\n    let tx_info_before = test_env.get_tx_info(&contract_address);\n\n    let transaction_hash = Felt::from(123);\n    let mut expected_tx_info = tx_info_before.clone();\n\n    expected_tx_info.transaction_hash = transaction_hash;\n\n    test_env.start_cheat_transaction_hash(contract_address, transaction_hash);\n\n    test_env.assert_tx_info(&contract_address, &expected_tx_info);\n\n    test_env.stop_cheat_transaction_hash(contract_address);\n\n    test_env.assert_tx_info(&contract_address, &tx_info_before);\n}\n\n#[test]\nfn cheat_transaction_hash_stop_no_effect() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatTxInfoChecker\", &[]);\n\n    let tx_info_before = test_env.get_tx_info(&contract_address);\n\n    test_env.stop_cheat_transaction_hash(contract_address);\n\n    test_env.assert_tx_info(&contract_address, &tx_info_before);\n}\n\n#[test]\nfn cheat_transaction_hash_with_other_syscall() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatTxInfoChecker\", &[]);\n\n    let transaction_hash = Felt::from(123);\n\n    test_env.start_cheat_transaction_hash(contract_address, transaction_hash);\n\n    let output = test_env.call_contract(&contract_address, \"get_tx_hash_and_emit_event\", &[]);\n\n    assert_success(output, &[Felt::from(123)]);\n}\n\n#[test]\nfn cheat_transaction_hash_in_constructor() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n\n    let class_hash = test_env.declare(\"TxHashChecker\", &contracts_data);\n    let precalculated_address = test_env.precalculate_address(&class_hash, &[]);\n\n    let transaction_hash = Felt::from(123);\n\n    test_env.start_cheat_transaction_hash(precalculated_address, transaction_hash);\n\n    let contract_address = test_env.deploy_wrapper(&class_hash, &[]);\n\n    assert_eq!(precalculated_address, contract_address);\n\n    let output = test_env.call_contract(&contract_address, \"get_stored_tx_hash\", &[]);\n    assert_success(output, &[Felt::from(123)]);\n}\n\n#[test]\nfn cheat_transaction_hash_proxy() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatTxInfoChecker\", &[]);\n\n    let transaction_hash = Felt::from(123);\n\n    test_env.start_cheat_transaction_hash(contract_address, transaction_hash);\n\n    let output = test_env.call_contract(&contract_address, \"get_transaction_hash\", &[]);\n    assert_success(output, &[Felt::from(123)]);\n\n    let proxy_address = test_env.deploy(\"TxHashCheckerProxy\", &[]);\n\n    let output = test_env.call_contract(\n        &proxy_address,\n        \"get_checkers_tx_hash\",\n        &[contract_address.into_()],\n    );\n\n    assert_success(output, &[Felt::from(123)]);\n}\n\n#[test]\nfn cheat_transaction_hash_library_call() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"CheatTxInfoChecker\", &contracts_data);\n\n    let lib_call_address = test_env.deploy(\"CheatTxInfoCheckerLibCall\", &[]);\n\n    let transaction_hash = Felt::from(123);\n\n    test_env.start_cheat_transaction_hash(lib_call_address, transaction_hash);\n\n    let output = test_env.call_contract(\n        &lib_call_address,\n        \"get_tx_hash_with_lib_call\",\n        &[class_hash.into_()],\n    );\n\n    assert_success(output, &[Felt::from(123)]);\n}\n\n#[test]\nfn cheat_transaction_hash_all_simple() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatTxInfoChecker\", &[]);\n\n    let tx_info_before = test_env.get_tx_info(&contract_address);\n\n    let transaction_hash = Felt::from(123);\n    let mut expected_tx_info = tx_info_before.clone();\n\n    expected_tx_info.transaction_hash = transaction_hash;\n\n    test_env.start_cheat_transaction_hash_global(transaction_hash);\n\n    test_env.assert_tx_info(&contract_address, &expected_tx_info);\n}\n\n#[test]\nfn cheat_transaction_hash_all_then_one() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatTxInfoChecker\", &[]);\n\n    let tx_info_before = test_env.get_tx_info(&contract_address);\n\n    let transaction_hash = Felt::from(321);\n    let mut expected_tx_info = tx_info_before.clone();\n\n    expected_tx_info.transaction_hash = transaction_hash;\n\n    test_env.start_cheat_transaction_hash_global(Felt::from(123));\n\n    test_env.start_cheat_transaction_hash(contract_address, transaction_hash);\n\n    test_env.assert_tx_info(&contract_address, &expected_tx_info);\n}\n\n#[test]\nfn cheat_transaction_hash_one_then_all() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatTxInfoChecker\", &[]);\n\n    let tx_info_before = test_env.get_tx_info(&contract_address);\n\n    let transaction_hash = Felt::from(321);\n    let mut expected_tx_info = tx_info_before.clone();\n\n    expected_tx_info.transaction_hash = transaction_hash;\n\n    test_env.start_cheat_transaction_hash(contract_address, Felt::from(123));\n\n    test_env.start_cheat_transaction_hash_global(transaction_hash);\n\n    test_env.assert_tx_info(&contract_address, &expected_tx_info);\n}\n\n#[test]\nfn cheat_transaction_hash_all_stop() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatTxInfoChecker\", &[]);\n\n    let tx_info_before = test_env.get_tx_info(&contract_address);\n\n    let transaction_hash = Felt::from(123);\n    let expected_tx_info = tx_info_before.clone();\n\n    test_env.start_cheat_transaction_hash_global(transaction_hash);\n\n    test_env.stop_cheat_transaction_hash_global();\n\n    test_env.assert_tx_info(&contract_address, &expected_tx_info);\n}\n\n#[test]\nfn cheat_transaction_hash_multiple() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"CheatTxInfoChecker\", &contracts_data);\n\n    let contract_address_1 = test_env.deploy_wrapper(&class_hash, &[]);\n\n    let contract_address_2 = test_env.deploy_wrapper(&class_hash, &[]);\n\n    let tx_info_before_1 = test_env.get_tx_info(&contract_address_1);\n    let tx_info_before_2 = test_env.get_tx_info(&contract_address_2);\n\n    let transaction_hash = Felt::from(123);\n    let mut expected_tx_info_1 = tx_info_before_1.clone();\n    let mut expected_tx_info_2 = tx_info_before_2.clone();\n\n    expected_tx_info_1.transaction_hash = transaction_hash;\n\n    expected_tx_info_2.transaction_hash = transaction_hash;\n\n    test_env.start_cheat_transaction_hash(contract_address_1, transaction_hash);\n    test_env.start_cheat_transaction_hash(contract_address_2, transaction_hash);\n\n    test_env.assert_tx_info(&contract_address_1, &expected_tx_info_1);\n    test_env.assert_tx_info(&contract_address_2, &expected_tx_info_2);\n\n    test_env.stop_cheat_transaction_hash_global();\n\n    test_env.assert_tx_info(&contract_address_1, &tx_info_before_1);\n    test_env.assert_tx_info(&contract_address_2, &tx_info_before_2);\n}\n\n#[test]\nfn cheat_transaction_hash_simple_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatTxInfoChecker\", &[]);\n\n    let tx_info_before = test_env.get_tx_info(&contract_address);\n    let transaction_hash = Felt::from(123);\n\n    let mut expected_tx_info = tx_info_before.clone();\n    expected_tx_info.transaction_hash = transaction_hash;\n\n    test_env.cheat_transaction_hash(\n        contract_address,\n        transaction_hash,\n        CheatSpan::TargetCalls(NonZeroUsize::new(2).unwrap()),\n    );\n\n    test_env.assert_tx_info(&contract_address, &expected_tx_info);\n    test_env.assert_tx_info(&contract_address, &expected_tx_info);\n    test_env.assert_tx_info(&contract_address, &tx_info_before);\n}\n\n#[test]\nfn cheat_transaction_hash_proxy_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"TxHashCheckerProxy\", &contracts_data);\n    let contract_address_1 = test_env.deploy_wrapper(&class_hash, &[]);\n    let contract_address_2 = test_env.deploy_wrapper(&class_hash, &[]);\n\n    test_env.cheat_transaction_hash(\n        contract_address_1,\n        Felt::from(123),\n        CheatSpan::TargetCalls(NonZeroUsize::new(1).unwrap()),\n    );\n\n    let output = test_env.call_contract(\n        &contract_address_1,\n        \"call_proxy\",\n        &[contract_address_2.into_()],\n    );\n    assert_success(output, &[123.into(), TransactionHash::default().0.into_()]);\n}\n\n#[test]\nfn cheat_transaction_hash_in_constructor_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n\n    let class_hash = test_env.declare(\"TxHashChecker\", &contracts_data);\n    let precalculated_address = test_env.precalculate_address(&class_hash, &[]);\n\n    test_env.cheat_transaction_hash(\n        precalculated_address,\n        Felt::from(123),\n        CheatSpan::TargetCalls(NonZeroUsize::new(2).unwrap()),\n    );\n\n    let contract_address = test_env.deploy_wrapper(&class_hash, &[]);\n    assert_eq!(precalculated_address, contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_transaction_hash\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_transaction_hash\", &[]),\n        &[TransactionHash::default().0.into_()],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_stored_tx_hash\", &[]),\n        &[Felt::from(123)],\n    );\n}\n\n#[test]\nfn cheat_transaction_hash_no_constructor_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n\n    let class_hash = test_env.declare(\"CheatTxInfoChecker\", &contracts_data);\n    let precalculated_address = test_env.precalculate_address(&class_hash, &[]);\n\n    test_env.cheat_transaction_hash(\n        precalculated_address,\n        Felt::from(123),\n        CheatSpan::TargetCalls(NonZeroUsize::new(1).unwrap()),\n    );\n\n    let contract_address = test_env.deploy_wrapper(&class_hash, &[]);\n    assert_eq!(precalculated_address, contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_transaction_hash\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_transaction_hash\", &[]),\n        &[TransactionHash::default().0.into_()],\n    );\n}\n\n#[test]\nfn cheat_transaction_hash_override_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatTxInfoChecker\", &[]);\n\n    let tx_info_before = test_env.get_tx_info(&contract_address);\n    let transaction_hash = Felt::from(123);\n\n    let mut expected_tx_info = tx_info_before.clone();\n    expected_tx_info.transaction_hash = transaction_hash;\n\n    test_env.cheat_transaction_hash(contract_address, transaction_hash, CheatSpan::Indefinite);\n\n    test_env.assert_tx_info(&contract_address, &expected_tx_info);\n\n    let transaction_hash = Felt::from(321);\n\n    expected_tx_info.transaction_hash = transaction_hash;\n\n    test_env.cheat_transaction_hash(\n        contract_address,\n        transaction_hash,\n        CheatSpan::TargetCalls(NonZeroUsize::new(1).unwrap()),\n    );\n\n    test_env.assert_tx_info(&contract_address, &expected_tx_info);\n    test_env.assert_tx_info(&contract_address, &tx_info_before);\n}\n\n#[test]\nfn cheat_transaction_hash_library_call_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"CheatTxInfoChecker\", &contracts_data);\n    let contract_address = test_env.deploy(\"CheatTxInfoCheckerLibCall\", &[]);\n\n    let tx_info_before = test_env.get_tx_info(&contract_address);\n\n    test_env.cheat_transaction_hash(\n        contract_address,\n        Felt::from(123),\n        CheatSpan::TargetCalls(NonZeroUsize::new(1).unwrap()),\n    );\n\n    let lib_call_selector = \"get_tx_hash_with_lib_call\";\n\n    assert_success(\n        test_env.call_contract(&contract_address, lib_call_selector, &[class_hash.into_()]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, lib_call_selector, &[class_hash.into_()]),\n        &[tx_info_before.transaction_hash],\n    );\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/cheatcodes/cheat_sequencer_address.rs",
    "content": "use super::test_environment::TestEnvironment;\nuse crate::{common::assertions::assert_success, common::get_contracts};\nuse cheatnet::state::CheatSpan;\nuse conversions::IntoConv;\nuse conversions::string::TryFromHexStr;\nuse runtime::starknet::context::SEQUENCER_ADDRESS;\nuse starknet_api::core::ContractAddress;\nuse starknet_types_core::felt::Felt;\nuse std::num::NonZeroUsize;\n\ntrait CheatSequencerAddressTrait {\n    fn cheat_sequencer_address(\n        &mut self,\n        contract_address: ContractAddress,\n        sequencer_address: u128,\n        span: CheatSpan,\n    );\n    fn start_cheat_sequencer_address(\n        &mut self,\n        contract_address: ContractAddress,\n        sequencer_address: u128,\n    );\n    fn stop_cheat_sequencer_address(&mut self, contract_address: ContractAddress);\n}\n\nimpl CheatSequencerAddressTrait for TestEnvironment {\n    fn cheat_sequencer_address(\n        &mut self,\n        contract_address: ContractAddress,\n        sequencer_address: u128,\n        span: CheatSpan,\n    ) {\n        self.cheatnet_state.cheat_sequencer_address(\n            contract_address,\n            ContractAddress::from(sequencer_address),\n            span,\n        );\n    }\n\n    fn start_cheat_sequencer_address(\n        &mut self,\n        contract_address: ContractAddress,\n        sequencer_address: u128,\n    ) {\n        self.cheatnet_state.start_cheat_sequencer_address(\n            contract_address,\n            ContractAddress::from(sequencer_address),\n        );\n    }\n\n    fn stop_cheat_sequencer_address(&mut self, contract_address: ContractAddress) {\n        self.cheatnet_state\n            .stop_cheat_sequencer_address(contract_address);\n    }\n}\n\n#[test]\nfn cheat_sequencer_address_simple() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatSequencerAddressChecker\", &[]);\n\n    test_env.start_cheat_sequencer_address(contract_address, 123);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_sequencer_address\", &[]),\n        &[Felt::from(123)],\n    );\n}\n\n#[test]\nfn cheat_sequencer_address_with_other_syscall() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatSequencerAddressChecker\", &[]);\n\n    test_env.start_cheat_sequencer_address(contract_address, 123);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_seq_addr_and_emit_event\", &[]),\n        &[Felt::from(123)],\n    );\n}\n\n#[test]\nfn cheat_sequencer_address_in_constructor() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n\n    let class_hash = test_env.declare(\"ConstructorCheatSequencerAddressChecker\", &contracts_data);\n    let precalculated_address = test_env.precalculate_address(&class_hash, &[]);\n\n    test_env.start_cheat_sequencer_address(precalculated_address, 123);\n\n    let contract_address = test_env.deploy_wrapper(&class_hash, &[]);\n    assert_eq!(precalculated_address, contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_stored_sequencer_address\", &[]),\n        &[Felt::from(123)],\n    );\n}\n\n#[test]\nfn cheat_sequencer_address_stop() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatSequencerAddressChecker\", &[]);\n\n    test_env.start_cheat_sequencer_address(contract_address, 123);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_sequencer_address\", &[]),\n        &[Felt::from(123)],\n    );\n\n    test_env\n        .cheatnet_state\n        .stop_cheat_sequencer_address(contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_sequencer_address\", &[]),\n        &[TryFromHexStr::try_from_hex_str(SEQUENCER_ADDRESS).unwrap()],\n    );\n}\n\n#[test]\nfn cheat_sequencer_address_double() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatSequencerAddressChecker\", &[]);\n\n    test_env.start_cheat_sequencer_address(contract_address, 111);\n    test_env.start_cheat_sequencer_address(contract_address, 222);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_sequencer_address\", &[]),\n        &[Felt::from(222)],\n    );\n\n    test_env.stop_cheat_sequencer_address(contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_sequencer_address\", &[]),\n        &[TryFromHexStr::try_from_hex_str(SEQUENCER_ADDRESS).unwrap()],\n    );\n}\n\n#[test]\nfn cheat_sequencer_address_proxy() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatSequencerAddressChecker\", &[]);\n    let proxy_address = test_env.deploy(\"CheatSequencerAddressCheckerProxy\", &[]);\n\n    test_env.start_cheat_sequencer_address(contract_address, 123);\n\n    let selector = \"get_cheated_sequencer_address\";\n    assert_success(\n        test_env.call_contract(&proxy_address, selector, &[contract_address.into_()]),\n        &[Felt::from(123)],\n    );\n\n    test_env.stop_cheat_sequencer_address(contract_address);\n\n    assert_success(\n        test_env.call_contract(&proxy_address, selector, &[contract_address.into_()]),\n        &[TryFromHexStr::try_from_hex_str(SEQUENCER_ADDRESS).unwrap()],\n    );\n}\n\n#[test]\nfn cheat_sequencer_address_library_call() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"CheatSequencerAddressChecker\", &contracts_data);\n\n    let lib_call_address = test_env.deploy(\"CheatSequencerAddressCheckerLibCall\", &[]);\n    let lib_call_selector = \"get_sequencer_address_with_lib_call\";\n\n    test_env.start_cheat_sequencer_address(lib_call_address, 123);\n\n    assert_success(\n        test_env.call_contract(&lib_call_address, lib_call_selector, &[class_hash.into_()]),\n        &[Felt::from(123)],\n    );\n\n    test_env.stop_cheat_sequencer_address(lib_call_address);\n\n    assert_success(\n        test_env.call_contract(&lib_call_address, lib_call_selector, &[class_hash.into_()]),\n        &[TryFromHexStr::try_from_hex_str(SEQUENCER_ADDRESS).unwrap()],\n    );\n}\n\n#[test]\nfn cheat_sequencer_address_all_simple() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatSequencerAddressChecker\", &[]);\n\n    test_env\n        .cheatnet_state\n        .start_cheat_sequencer_address_global(123_u8.into());\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_sequencer_address\", &[]),\n        &[Felt::from(123)],\n    );\n}\n\n#[test]\nfn cheat_sequencer_address_all_then_one() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatSequencerAddressChecker\", &[]);\n\n    test_env\n        .cheatnet_state\n        .start_cheat_sequencer_address_global(111_u8.into());\n\n    test_env.start_cheat_sequencer_address(contract_address, 222);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_sequencer_address\", &[]),\n        &[Felt::from(222)],\n    );\n}\n\n#[test]\nfn cheat_sequencer_address_one_then_all() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatSequencerAddressChecker\", &[]);\n\n    test_env.start_cheat_sequencer_address(contract_address, 111);\n    test_env\n        .cheatnet_state\n        .start_cheat_sequencer_address_global(222_u8.into());\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_sequencer_address\", &[]),\n        &[Felt::from(222)],\n    );\n}\n\n#[test]\nfn cheat_sequencer_address_all_stop() {\n    let mut test_env = TestEnvironment::new();\n\n    let cheat_sequencer_address_checker =\n        test_env.declare(\"CheatSequencerAddressChecker\", &get_contracts());\n    let contract_address = test_env.deploy_wrapper(&cheat_sequencer_address_checker, &[]);\n\n    test_env\n        .cheatnet_state\n        .start_cheat_sequencer_address_global(123_u8.into());\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_sequencer_address\", &[]),\n        &[Felt::from(123)],\n    );\n\n    test_env\n        .cheatnet_state\n        .stop_cheat_sequencer_address_global();\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_sequencer_address\", &[]),\n        &[TryFromHexStr::try_from_hex_str(SEQUENCER_ADDRESS).unwrap()],\n    );\n\n    let contract_address = test_env.deploy_wrapper(&cheat_sequencer_address_checker, &[]);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_sequencer_address\", &[]),\n        &[TryFromHexStr::try_from_hex_str(SEQUENCER_ADDRESS).unwrap()],\n    );\n}\n\n#[test]\nfn cheat_sequencer_address_multiple() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"CheatSequencerAddressChecker\", &contracts_data);\n\n    let contract_address1 = test_env.deploy_wrapper(&class_hash, &[]);\n    let contract_address2 = test_env.deploy_wrapper(&class_hash, &[]);\n\n    test_env.start_cheat_sequencer_address(contract_address1, 123);\n    test_env.start_cheat_sequencer_address(contract_address2, 123);\n\n    assert_success(\n        test_env.call_contract(&contract_address1, \"get_sequencer_address\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address2, \"get_sequencer_address\", &[]),\n        &[Felt::from(123)],\n    );\n\n    test_env\n        .cheatnet_state\n        .stop_cheat_sequencer_address(contract_address1);\n    test_env\n        .cheatnet_state\n        .stop_cheat_sequencer_address(contract_address2);\n\n    assert_success(\n        test_env.call_contract(&contract_address1, \"get_sequencer_address\", &[]),\n        &[TryFromHexStr::try_from_hex_str(SEQUENCER_ADDRESS).unwrap()],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address2, \"get_sequencer_address\", &[]),\n        &[TryFromHexStr::try_from_hex_str(SEQUENCER_ADDRESS).unwrap()],\n    );\n}\n\n#[test]\nfn cheat_sequencer_address_simple_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatSequencerAddressChecker\", &[]);\n\n    test_env.cheat_sequencer_address(\n        contract_address,\n        123,\n        CheatSpan::TargetCalls(NonZeroUsize::new(2).unwrap()),\n    );\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_sequencer_address\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_sequencer_address\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_sequencer_address\", &[]),\n        &[TryFromHexStr::try_from_hex_str(SEQUENCER_ADDRESS).unwrap()],\n    );\n}\n\n#[test]\nfn cheat_sequencer_address_proxy_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"CheatSequencerAddressCheckerProxy\", &contracts_data);\n    let contract_address_1 = test_env.deploy_wrapper(&class_hash, &[]);\n    let contract_address_2 = test_env.deploy_wrapper(&class_hash, &[]);\n\n    test_env.cheat_sequencer_address(\n        contract_address_1,\n        123,\n        CheatSpan::TargetCalls(NonZeroUsize::new(1).unwrap()),\n    );\n\n    let output = test_env.call_contract(\n        &contract_address_1,\n        \"call_proxy\",\n        &[contract_address_2.into_()],\n    );\n    assert_success(\n        output,\n        &[\n            123.into(),\n            TryFromHexStr::try_from_hex_str(SEQUENCER_ADDRESS).unwrap(),\n        ],\n    );\n}\n\n#[test]\nfn cheat_sequencer_address_in_constructor_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n\n    let class_hash = test_env.declare(\"ConstructorCheatSequencerAddressChecker\", &contracts_data);\n    let precalculated_address = test_env\n        .cheatnet_state\n        .precalculate_address(&class_hash, &[]);\n\n    test_env.cheat_sequencer_address(\n        precalculated_address,\n        123,\n        CheatSpan::TargetCalls(NonZeroUsize::new(2).unwrap()),\n    );\n\n    let contract_address = test_env.deploy_wrapper(&class_hash, &[]);\n    assert_eq!(precalculated_address, contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_sequencer_address\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_sequencer_address\", &[]),\n        &[TryFromHexStr::try_from_hex_str(SEQUENCER_ADDRESS).unwrap()],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_stored_sequencer_address\", &[]),\n        &[Felt::from(123)],\n    );\n}\n\n#[test]\nfn cheat_sequencer_address_no_constructor_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n\n    let class_hash = test_env.declare(\"CheatSequencerAddressChecker\", &contracts_data);\n    let precalculated_address = test_env\n        .cheatnet_state\n        .precalculate_address(&class_hash, &[]);\n\n    test_env.cheat_sequencer_address(\n        precalculated_address,\n        123,\n        CheatSpan::TargetCalls(NonZeroUsize::new(1).unwrap()),\n    );\n\n    let contract_address = test_env.deploy_wrapper(&class_hash, &[]);\n    assert_eq!(precalculated_address, contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_sequencer_address\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_sequencer_address\", &[]),\n        &[TryFromHexStr::try_from_hex_str(SEQUENCER_ADDRESS).unwrap()],\n    );\n}\n\n#[test]\nfn cheat_sequencer_address_override_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatSequencerAddressChecker\", &[]);\n\n    test_env.cheat_sequencer_address(\n        contract_address,\n        123,\n        CheatSpan::TargetCalls(NonZeroUsize::new(2).unwrap()),\n    );\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_sequencer_address\", &[]),\n        &[Felt::from(123)],\n    );\n\n    test_env.cheat_sequencer_address(contract_address, 321, CheatSpan::Indefinite);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_sequencer_address\", &[]),\n        &[Felt::from(321)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_sequencer_address\", &[]),\n        &[Felt::from(321)],\n    );\n\n    test_env.stop_cheat_sequencer_address(contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_sequencer_address\", &[]),\n        &[TryFromHexStr::try_from_hex_str(SEQUENCER_ADDRESS).unwrap()],\n    );\n}\n\n#[test]\nfn cheat_sequencer_address_library_call_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"CheatSequencerAddressChecker\", &contracts_data);\n    let contract_address = test_env.deploy(\"CheatSequencerAddressCheckerLibCall\", &[]);\n\n    test_env.cheat_sequencer_address(\n        contract_address,\n        123,\n        CheatSpan::TargetCalls(NonZeroUsize::new(1).unwrap()),\n    );\n\n    let lib_call_selector = \"get_sequencer_address_with_lib_call\";\n\n    assert_success(\n        test_env.call_contract(&contract_address, lib_call_selector, &[class_hash.into_()]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, lib_call_selector, &[class_hash.into_()]),\n        &[TryFromHexStr::try_from_hex_str(SEQUENCER_ADDRESS).unwrap()],\n    );\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/cheatcodes/declare.rs",
    "content": "use crate::common::assertions::ClassHashAssert;\nuse crate::common::{get_contracts, state::create_cached_state};\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::CheatcodeError;\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::declare::{\n    DeclareResult, declare,\n};\nuse runtime::EnhancedHintError;\n\n#[test]\nfn declare_simple() {\n    let contract_name = \"HelloStarknet\";\n\n    let mut cached_state = create_cached_state();\n\n    let contracts_data = get_contracts();\n\n    let class_hash = declare(&mut cached_state, contract_name, &contracts_data)\n        .unwrap()\n        .unwrap_success();\n    let expected_class_hash = contracts_data.get_class_hash(contract_name).unwrap();\n\n    assert_eq!(class_hash, *expected_class_hash);\n}\n\n#[test]\nfn declare_multiple() {\n    let contract_names = vec![\"HelloStarknet\", \"ConstructorSimple\"];\n\n    let mut cached_state = create_cached_state();\n\n    let contracts_data = get_contracts();\n\n    for contract_name in contract_names {\n        let class_hash = declare(&mut cached_state, contract_name, &contracts_data)\n            .unwrap()\n            .unwrap_success();\n        let expected_class_hash = contracts_data.get_class_hash(contract_name).unwrap();\n        assert_eq!(class_hash, *expected_class_hash);\n    }\n}\n\n#[test]\nfn declare_same_contract() {\n    let contract_name = \"HelloStarknet\";\n\n    let mut cached_state = create_cached_state();\n\n    let contracts_data = get_contracts();\n\n    let class_hash = declare(&mut cached_state, contract_name, &contracts_data)\n        .unwrap()\n        .unwrap_success();\n    let expected_class_hash = contracts_data.get_class_hash(contract_name).unwrap();\n    assert_eq!(class_hash, *expected_class_hash);\n\n    let output = declare(&mut cached_state, contract_name, &contracts_data);\n\n    assert!(\n        matches!(output, Ok(DeclareResult::AlreadyDeclared(class_hash)) if  class_hash == *expected_class_hash)\n    );\n}\n\n#[test]\nfn declare_non_existent() {\n    let contract_name = \"GoodbyeStarknet\";\n\n    let mut cached_state = create_cached_state();\n\n    let contracts_data = get_contracts();\n\n    let output = declare(&mut cached_state, contract_name, &contracts_data);\n\n    assert!(match output {\n        Err(CheatcodeError::Unrecoverable(EnhancedHintError::Anyhow(msg))) => {\n            let msg = msg.to_string();\n            msg.contains(\"Failed\") && msg.contains(contract_name)\n        }\n        _ => false,\n    });\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/cheatcodes/generate_random_felt.rs",
    "content": "use starknet_types_core::felt::Felt;\nuse std::collections::HashSet;\n\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::generate_random_felt::generate_random_felt;\n\n#[test]\nfn test_generate_random_felt_range_and_uniqueness() {\n    let mut random_values = vec![];\n\n    let max_felt: Felt = Felt::MAX;\n\n    for _ in 0..10 {\n        let random_value = generate_random_felt();\n        assert!(random_value < max_felt, \"Value out of range\");\n        random_values.push(random_value);\n    }\n\n    let unique_values: HashSet<_> = random_values.iter().collect();\n    assert!(\n        unique_values.len() > 1,\n        \"Random values should not all be identical.\"\n    );\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/cheatcodes/get_class_hash.rs",
    "content": "use crate::common::assertions::ClassHashAssert;\nuse crate::common::get_contracts;\nuse crate::common::state::create_cached_state;\nuse crate::common::{call_contract, deploy};\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::declare::declare;\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::get_class_hash::get_class_hash;\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::storage::selector_from_name;\nuse cheatnet::state::CheatnetState;\nuse conversions::IntoConv;\n\n#[test]\nfn get_class_hash_simple() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contracts_data = get_contracts();\n    let class_hash = declare(&mut cached_state, \"HelloStarknet\", &contracts_data)\n        .unwrap()\n        .unwrap_success();\n    let contract_address = deploy(&mut cached_state, &mut cheatnet_state, &class_hash, &[]);\n\n    assert_eq!(\n        class_hash,\n        get_class_hash(&mut cached_state, contract_address).unwrap()\n    );\n}\n\n#[test]\nfn get_class_hash_upgrade() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contracts_data = get_contracts();\n    let class_hash = declare(&mut cached_state, \"GetClassHashCheckerUpg\", &contracts_data)\n        .unwrap()\n        .unwrap_success();\n    let contract_address = deploy(&mut cached_state, &mut cheatnet_state, &class_hash, &[]);\n\n    assert_eq!(\n        class_hash,\n        get_class_hash(&mut cached_state, contract_address).unwrap()\n    );\n\n    let hello_starknet_class_hash = declare(&mut cached_state, \"HelloStarknet\", &contracts_data)\n        .unwrap()\n        .unwrap_success();\n\n    let selector = selector_from_name(\"upgrade\");\n    call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[hello_starknet_class_hash.into_()],\n    )\n    .unwrap();\n\n    assert_eq!(\n        hello_starknet_class_hash,\n        get_class_hash(&mut cached_state, contract_address).unwrap()\n    );\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/cheatcodes/library_call.rs",
    "content": "use crate::cheatcodes::test_environment::TestEnvironment;\nuse crate::common::assertions::assert_success;\nuse crate::common::get_contracts;\nuse cheatnet::runtime_extensions::call_to_blockifier_runtime_extension::rpc::CallSuccess;\nuse cheatnet::state::CheatSpan;\nuse conversions::string::TryFromHexStr;\nuse runtime::starknet::constants::TEST_ADDRESS;\nuse starknet_api::core::ContractAddress;\nuse starknet_types_core::felt::Felt;\n\n#[test]\nfn global_cheat_works_with_library_call_from_test() {\n    let mut test_env = TestEnvironment::new();\n    let contracts_data = get_contracts();\n\n    let class_hash = test_env.declare(\"ExampleContract\", &contracts_data);\n    let cheated_caller_address = 123_u8;\n\n    test_env\n        .cheatnet_state\n        .start_cheat_caller_address_global(cheated_caller_address.into());\n\n    assert_success(\n        test_env.library_call_contract(&class_hash, \"get_caller_address\", &[]),\n        &[Felt::from(cheated_caller_address)],\n    );\n\n    assert_success(\n        test_env.library_call_contract(&class_hash, \"get_caller_address\", &[]),\n        &[Felt::from(cheated_caller_address)],\n    );\n\n    test_env.cheatnet_state.stop_cheat_caller_address_global();\n\n    assert_success(\n        test_env.library_call_contract(&class_hash, \"get_caller_address\", &[]),\n        &[ContractAddress::default().into()],\n    );\n}\n\n#[test]\nfn cheat_with_finite_span_works_with_library_call_from_test() {\n    let mut test_env = TestEnvironment::new();\n    let contracts_data = get_contracts();\n\n    let class_hash = test_env.declare(\"ExampleContract\", &contracts_data);\n    let cheated_caller_address = 123_u8;\n\n    test_env.cheatnet_state.cheat_caller_address(\n        ContractAddress::try_from_hex_str(TEST_ADDRESS).unwrap(),\n        cheated_caller_address.into(),\n        CheatSpan::TargetCalls(1.try_into().unwrap()),\n    );\n\n    assert_success(\n        test_env.library_call_contract(&class_hash, \"get_caller_address\", &[]),\n        &[Felt::from(cheated_caller_address)],\n    );\n\n    // Library call doesn't trigger the cheat removal because it's not a contract call\n    // hence after second library call the cheated address is still in effect.\n    assert_success(\n        test_env.library_call_contract(&class_hash, \"get_caller_address\", &[]),\n        &[Felt::from(cheated_caller_address)],\n    );\n\n    test_env\n        .cheatnet_state\n        .stop_cheat_caller_address(ContractAddress::try_from_hex_str(TEST_ADDRESS).unwrap());\n\n    assert_success(\n        test_env.library_call_contract(&class_hash, \"get_caller_address\", &[]),\n        &[ContractAddress::default().into()],\n    );\n}\n\n#[test]\nfn cheat_with_indefinite_span_works_with_library_call_from_test() {\n    let mut test_env = TestEnvironment::new();\n    let contracts_data = get_contracts();\n\n    let class_hash = test_env.declare(\"ExampleContract\", &contracts_data);\n    let cheated_caller_address = 123_u8;\n\n    test_env.cheatnet_state.cheat_caller_address(\n        ContractAddress::try_from_hex_str(TEST_ADDRESS).unwrap(),\n        cheated_caller_address.into(),\n        CheatSpan::Indefinite,\n    );\n\n    assert_success(\n        test_env.library_call_contract(&class_hash, \"get_caller_address\", &[]),\n        &[Felt::from(cheated_caller_address)],\n    );\n\n    assert_success(\n        test_env.library_call_contract(&class_hash, \"get_caller_address\", &[]),\n        &[Felt::from(cheated_caller_address)],\n    );\n\n    test_env\n        .cheatnet_state\n        .stop_cheat_caller_address(ContractAddress::try_from_hex_str(TEST_ADDRESS).unwrap());\n\n    assert_success(\n        test_env.library_call_contract(&class_hash, \"get_caller_address\", &[]),\n        &[ContractAddress::default().into()],\n    );\n}\n\n#[test]\nfn global_cheat_works_with_library_call_from_actual_contract() {\n    let mut test_env = TestEnvironment::new();\n    let contracts_data = get_contracts();\n\n    let contract_address = test_env.deploy(\"ExampleContractLibraryCall\", &[]);\n    let class_hash = test_env.declare(\"ExampleContract\", &contracts_data);\n\n    let cheated_caller_address = 123_u8;\n\n    let set_class_hash_result =\n        test_env.call_contract(&contract_address, \"set_class_hash\", &[class_hash.into()]);\n    assert!(matches!(set_class_hash_result, Ok(CallSuccess { .. })));\n\n    test_env\n        .cheatnet_state\n        .start_cheat_caller_address_global(cheated_caller_address.into());\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address\", &[]),\n        &[Felt::from(cheated_caller_address)],\n    );\n\n    test_env.cheatnet_state.stop_cheat_caller_address_global();\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address\", &[]),\n        &[Felt::try_from_hex_str(TEST_ADDRESS).unwrap()],\n    );\n}\n\n#[test]\nfn cheat_with_finite_span_works_with_library_call_from_actual_contract() {\n    let mut test_env = TestEnvironment::new();\n    let contracts_data = get_contracts();\n\n    let contract_address = test_env.deploy(\"ExampleContractLibraryCall\", &[]);\n    let class_hash = test_env.declare(\"ExampleContract\", &contracts_data);\n\n    let set_class_hash_result =\n        test_env.call_contract(&contract_address, \"set_class_hash\", &[class_hash.into()]);\n    assert!(matches!(set_class_hash_result, Ok(CallSuccess { .. })));\n\n    let cheated_caller_address = 123_u8;\n\n    test_env.cheatnet_state.cheat_caller_address(\n        contract_address,\n        cheated_caller_address.into(),\n        CheatSpan::TargetCalls(1.try_into().unwrap()),\n    );\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address\", &[]),\n        &[Felt::from(cheated_caller_address)],\n    );\n\n    // We made one contract call, so the cheat should be removed now.\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address\", &[]),\n        &[Felt::try_from_hex_str(TEST_ADDRESS).unwrap()],\n    );\n}\n\n#[test]\nfn cheat_with_indefinite_span_works_with_library_call_from_actual_contract() {\n    let mut test_env = TestEnvironment::new();\n    let contracts_data = get_contracts();\n\n    let contract_address = test_env.deploy(\"ExampleContractLibraryCall\", &[]);\n    let class_hash = test_env.declare(\"ExampleContract\", &contracts_data);\n\n    let set_class_hash_result =\n        test_env.call_contract(&contract_address, \"set_class_hash\", &[class_hash.into()]);\n    assert!(matches!(set_class_hash_result, Ok(CallSuccess { .. })));\n\n    let cheated_caller_address = 123_u8;\n\n    test_env.cheatnet_state.cheat_caller_address(\n        contract_address,\n        cheated_caller_address.into(),\n        CheatSpan::Indefinite,\n    );\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address\", &[]),\n        &[Felt::from(cheated_caller_address)],\n    );\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address\", &[]),\n        &[Felt::from(cheated_caller_address)],\n    );\n\n    test_env\n        .cheatnet_state\n        .stop_cheat_caller_address(contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_caller_address\", &[]),\n        &[Felt::try_from_hex_str(TEST_ADDRESS).unwrap()],\n    );\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/cheatcodes/load.rs",
    "content": "use crate::common::get_contracts;\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::storage::{\n    load, map_entry_address, variable_address,\n};\nuse starknet_api::core::ContractAddress;\nuse starknet_types_core::felt::Felt;\n\nuse super::test_environment::TestEnvironment;\n\ntrait LoadTrait {\n    fn load(&mut self, target: ContractAddress, storage_address: Felt) -> Felt;\n}\n\nimpl LoadTrait for TestEnvironment {\n    fn load(&mut self, target: ContractAddress, storage_address: Felt) -> Felt {\n        load(&mut self.cached_state, target, storage_address).unwrap()\n    }\n}\n\n#[test]\nfn load_simple_state() {\n    let mut test_env = TestEnvironment::new();\n    let contracts_data = get_contracts();\n\n    let class_hash = test_env.declare(\"HelloStarknet\", &contracts_data);\n    let contract_address = test_env.deploy_wrapper(&class_hash, &[]);\n\n    test_env\n        .call_contract(&contract_address, \"increase_balance\", &[Felt::from(420)])\n        .unwrap();\n\n    let balance_value = test_env.load(contract_address, variable_address(\"balance\"));\n\n    assert_eq!(\n        balance_value,\n        Felt::from(420),\n        \"Wrong data value was returned: {balance_value}\"\n    );\n}\n\n#[test]\nfn load_state_map_simple_value() {\n    let mut test_env = TestEnvironment::new();\n    let contracts_data = get_contracts();\n\n    let class_hash = test_env.declare(\"MapSimpleValueSimpleKey\", &contracts_data);\n    let contract_address = test_env.deploy_wrapper(&class_hash, &[]);\n\n    let map_key = Felt::from(420);\n    let inserted_value = Felt::from(69);\n    test_env\n        .call_contract(&contract_address, \"insert\", &[map_key, inserted_value])\n        .unwrap();\n\n    let var_address = map_entry_address(\"values\", &[map_key]);\n    let map_value = test_env.load(contract_address, var_address);\n\n    assert_eq!(\n        map_value, inserted_value,\n        \"Wrong data value was returned: {map_value}\"\n    );\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/cheatcodes/meta_tx_v0.rs",
    "content": "use crate::common::assertions::assert_success;\nuse conversions::IntoConv;\nuse starknet_api::core::ContractAddress;\nuse starknet_types_core::felt::Felt;\n\nuse super::test_environment::TestEnvironment;\n\n#[test]\nfn meta_tx_v0_with_cheat_caller_address() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatCallerAddressCheckerMetaTxV0\", &[]);\n\n    test_env\n        .cheatnet_state\n        .start_cheat_caller_address(contract_address, ContractAddress::from(123_u32));\n\n    let meta_contract = test_env.deploy(\"MetaTxV0Test\", &[]);\n\n    let signature = vec![];\n\n    let meta_result = test_env.call_contract(\n        &meta_contract,\n        \"execute_meta_tx_v0\",\n        &[contract_address.into_(), signature.len().into()]\n            .into_iter()\n            .chain(signature)\n            .collect::<Vec<_>>(),\n    );\n\n    assert_success(meta_result, &[Felt::from(123)]);\n}\n\n#[test]\nfn meta_tx_v0_with_cheat_block_number() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockNumberCheckerMetaTxV0\", &[]);\n\n    test_env\n        .cheatnet_state\n        .start_cheat_block_number(contract_address, 999_u64);\n\n    let meta_contract = test_env.deploy(\"MetaTxV0Test\", &[]);\n\n    let signature = vec![];\n\n    let meta_result = test_env.call_contract(\n        &meta_contract,\n        \"execute_meta_tx_v0\",\n        &[contract_address.into_(), signature.len().into()]\n            .into_iter()\n            .chain(signature)\n            .collect::<Vec<_>>(),\n    );\n\n    assert_success(meta_result, &[Felt::from(999)]);\n}\n\n#[test]\nfn meta_tx_v0_with_cheat_block_timestamp() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockTimestampCheckerMetaTxV0\", &[]);\n\n    test_env\n        .cheatnet_state\n        .start_cheat_block_timestamp(contract_address, 1_234_567_890_u64);\n\n    let meta_contract = test_env.deploy(\"MetaTxV0Test\", &[]);\n\n    let signature = vec![];\n\n    let meta_result = test_env.call_contract(\n        &meta_contract,\n        \"execute_meta_tx_v0\",\n        &[contract_address.into_(), signature.len().into()]\n            .into_iter()\n            .chain(signature)\n            .collect::<Vec<_>>(),\n    );\n\n    assert_success(meta_result, &[Felt::from(1_234_567_890_u64)]);\n}\n\n#[test]\nfn meta_tx_v0_with_cheat_sequencer_address() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatSequencerAddressCheckerMetaTxV0\", &[]);\n\n    test_env\n        .cheatnet_state\n        .start_cheat_sequencer_address(contract_address, ContractAddress::from(777_u32));\n\n    let meta_contract = test_env.deploy(\"MetaTxV0Test\", &[]);\n\n    let signature = vec![];\n\n    let meta_result = test_env.call_contract(\n        &meta_contract,\n        \"execute_meta_tx_v0\",\n        &[contract_address.into_(), signature.len().into()]\n            .into_iter()\n            .chain(signature)\n            .collect::<Vec<_>>(),\n    );\n\n    assert_success(meta_result, &[Felt::from(777)]);\n}\n\n#[test]\nfn meta_tx_v0_with_cheat_block_hash() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"CheatBlockHashCheckerMetaTxV0\", &[]);\n\n    let block_number = 100;\n\n    test_env\n        .cheatnet_state\n        .start_cheat_block_hash(contract_address, block_number, Felt::from(555));\n\n    let meta_contract = test_env.deploy(\"MetaTxV0Test\", &[]);\n\n    let signature = vec![];\n\n    let meta_result = test_env.call_contract(\n        &meta_contract,\n        \"execute_meta_tx_v0_get_block_hash\",\n        &[\n            contract_address.into_(),\n            block_number.into(),\n            signature.len().into(),\n        ]\n        .into_iter()\n        .chain(signature)\n        .collect::<Vec<_>>(),\n    );\n\n    assert_success(meta_result, &[Felt::from(555)]);\n}\n\n#[test]\nfn meta_tx_v0_verify_tx_context_modification() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"TxInfoCheckerMetaTxV0\", &[]);\n\n    // Call __execute__ directly, should return original version (3)\n    let direct_execute_result = test_env.call_contract(&contract_address, \"__execute__\", &[]);\n\n    let meta_contract = test_env.deploy(\"MetaTxV0Test\", &[]);\n\n    let signature = vec![];\n\n    let meta_result = test_env.call_contract(\n        &meta_contract,\n        \"execute_meta_tx_v0\",\n        &[contract_address.into_(), signature.len().into()]\n            .into_iter()\n            .chain(signature.clone())\n            .collect::<Vec<_>>(),\n    );\n\n    assert_success(meta_result, &[Felt::ZERO]);\n\n    assert_success(direct_execute_result, &[Felt::from(3_u32)]);\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/cheatcodes/mock_call.rs",
    "content": "use super::test_environment::TestEnvironment;\nuse crate::common::assertions::ClassHashAssert;\nuse crate::common::recover_data;\nuse crate::common::state::create_cached_state;\nuse crate::common::{call_contract, deploy};\nuse crate::{\n    common::assertions::assert_success,\n    common::{deploy_contract, get_contracts},\n};\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::declare::declare;\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::storage::selector_from_name;\nuse cheatnet::state::{CheatSpan, CheatnetState};\nuse conversions::IntoConv;\nuse starknet_api::core::ContractAddress;\nuse starknet_rust::core::utils::get_selector_from_name;\nuse starknet_types_core::felt::Felt;\nuse std::num::NonZeroUsize;\n\ntrait MockCallTrait {\n    fn mock_call(\n        &mut self,\n        contract_address: &ContractAddress,\n        function_name: &str,\n        ret_data: &[u128],\n        span: CheatSpan,\n    );\n    fn stop_mock_call(&mut self, contract_address: &ContractAddress, function_name: &str);\n}\n\nimpl MockCallTrait for TestEnvironment {\n    fn mock_call(\n        &mut self,\n        contract_address: &ContractAddress,\n        function_name: &str,\n        ret_data: &[u128],\n        span: CheatSpan,\n    ) {\n        let ret_data: Vec<Felt> = ret_data.iter().map(|x| Felt::from(*x)).collect();\n        let function_selector = get_selector_from_name(function_name).unwrap();\n        self.cheatnet_state.mock_call(\n            *contract_address,\n            function_selector.into_(),\n            &ret_data,\n            span,\n        );\n    }\n\n    fn stop_mock_call(&mut self, contract_address: &ContractAddress, function_name: &str) {\n        let function_selector = get_selector_from_name(function_name).unwrap();\n        self.cheatnet_state\n            .stop_mock_call(*contract_address, function_selector.into_());\n    }\n}\n\n#[test]\nfn mock_call_simple() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address = deploy_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        \"MockChecker\",\n        &[Felt::from(420)],\n    );\n\n    let selector = selector_from_name(\"get_thing\");\n    let ret_data = [Felt::from(123)];\n\n    cheatnet_state.start_mock_call(contract_address, selector_from_name(\"get_thing\"), &ret_data);\n\n    let output = call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n\n    assert_success(output, &ret_data);\n}\n\n#[test]\nfn mock_call_stop() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address = deploy_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        \"MockChecker\",\n        &[Felt::from(420)],\n    );\n\n    let selector = selector_from_name(\"get_thing\");\n    let ret_data = [Felt::from(123)];\n\n    cheatnet_state.start_mock_call(contract_address, selector_from_name(\"get_thing\"), &ret_data);\n\n    let output = call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n\n    assert_success(output, &ret_data);\n\n    cheatnet_state.stop_mock_call(contract_address, selector_from_name(\"get_thing\"));\n\n    let output = call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n\n    assert_success(output, &[Felt::from(420)]);\n}\n\n#[test]\nfn mock_call_stop_no_start() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address = deploy_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        \"MockChecker\",\n        &[Felt::from(420)],\n    );\n\n    let selector = selector_from_name(\"get_thing\");\n\n    cheatnet_state.stop_mock_call(contract_address, selector_from_name(\"get_thing\"));\n\n    let output = call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n\n    assert_success(output, &[Felt::from(420)]);\n}\n\n#[test]\nfn mock_call_double() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address = deploy_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        \"MockChecker\",\n        &[Felt::from(420)],\n    );\n\n    let selector = selector_from_name(\"get_thing\");\n\n    let ret_data = [Felt::from(123)];\n    cheatnet_state.start_mock_call(contract_address, selector, &ret_data);\n\n    let ret_data = [Felt::from(999)];\n    cheatnet_state.start_mock_call(contract_address, selector, &ret_data);\n\n    let output = call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n\n    assert_success(output, &ret_data);\n\n    cheatnet_state.stop_mock_call(contract_address, selector);\n\n    let output = call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n\n    assert_success(output, &[Felt::from(420)]);\n}\n\n#[test]\nfn mock_call_double_call() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address = deploy_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        \"MockChecker\",\n        &[Felt::from(420)],\n    );\n\n    let selector = selector_from_name(\"get_thing\");\n\n    let ret_data = [Felt::from(123)];\n    cheatnet_state.start_mock_call(contract_address, selector_from_name(\"get_thing\"), &ret_data);\n\n    let output = call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n\n    assert_success(output, &ret_data);\n\n    let output = call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n\n    assert_success(output, &ret_data);\n}\n\n#[test]\nfn mock_call_proxy() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address = deploy_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        \"MockChecker\",\n        &[Felt::from(420)],\n    );\n    let selector = selector_from_name(\"get_thing\");\n\n    let ret_data = [Felt::from(123)];\n    cheatnet_state.start_mock_call(contract_address, selector_from_name(\"get_thing\"), &ret_data);\n\n    let output = call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n\n    assert_success(output, &ret_data);\n\n    let proxy_address = deploy_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        \"MockCheckerProxy\",\n        &[],\n    );\n    let proxy_selector = selector_from_name(\"get_thing_from_contract\");\n    let output = call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &proxy_address,\n        proxy_selector,\n        &[contract_address.into_()],\n    );\n\n    assert_success(output, &ret_data);\n}\n\n#[test]\nfn mock_call_proxy_with_other_syscall() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address = deploy_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        \"MockChecker\",\n        &[Felt::from(420)],\n    );\n    let selector = selector_from_name(\"get_thing\");\n\n    let ret_data = [Felt::from(123)];\n    cheatnet_state.start_mock_call(contract_address, selector_from_name(\"get_thing\"), &ret_data);\n\n    let output = call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n\n    assert_success(output, &ret_data);\n\n    let proxy_address = deploy_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        \"MockCheckerProxy\",\n        &[],\n    );\n    let proxy_selector = selector_from_name(\"get_thing_from_contract_and_emit_event\");\n    let output = call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &proxy_address,\n        proxy_selector,\n        &[contract_address.into_()],\n    );\n\n    assert_success(output, &ret_data);\n}\n\n#[test]\nfn mock_call_inner_call_no_effect() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address = deploy_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        \"MockChecker\",\n        &[Felt::from(420)],\n    );\n\n    let selector = selector_from_name(\"get_thing\");\n    let ret_data = [Felt::from(123)];\n\n    cheatnet_state.start_mock_call(contract_address, selector_from_name(\"get_thing\"), &ret_data);\n\n    let output = call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n\n    assert_success(output, &ret_data);\n\n    let selector = selector_from_name(\"get_thing_wrapper\");\n\n    let output = call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n\n    assert_success(output, &[Felt::from(420)]);\n}\n\n#[test]\nfn mock_call_library_call_no_effect() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contracts_data = get_contracts();\n    let class_hash = declare(&mut cached_state, \"MockChecker\", &contracts_data)\n        .unwrap()\n        .unwrap_success();\n\n    let contract_address = deploy(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &class_hash,\n        &[Felt::from(420)],\n    );\n\n    let lib_call_address = deploy_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        \"MockCheckerLibCall\",\n        &[],\n    );\n\n    let ret_data = [Felt::from(123)];\n    cheatnet_state.start_mock_call(\n        contract_address,\n        selector_from_name(\"get_constant_thing\"),\n        &ret_data,\n    );\n\n    let lib_call_selector = selector_from_name(\"get_constant_thing_with_lib_call\");\n    let output = call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &lib_call_address,\n        lib_call_selector,\n        &[class_hash.into_()],\n    );\n\n    assert_success(output, &[Felt::from(13)]);\n}\n\n#[test]\nfn mock_call_before_deployment() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contracts_data = get_contracts();\n    let class_hash = declare(&mut cached_state, \"MockChecker\", &contracts_data)\n        .unwrap()\n        .unwrap_success();\n\n    let precalculated_address =\n        cheatnet_state.precalculate_address(&class_hash, &[Felt::from(420)]);\n\n    let selector = selector_from_name(\"get_thing\");\n    let ret_data = [Felt::from(123)];\n    cheatnet_state.start_mock_call(\n        precalculated_address,\n        selector_from_name(\"get_thing\"),\n        &ret_data,\n    );\n\n    let contract_address = deploy(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &class_hash,\n        &[Felt::from(420)],\n    );\n\n    assert_eq!(precalculated_address, contract_address);\n\n    let output = call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n\n    assert_success(output, &ret_data);\n}\n\n#[test]\nfn mock_call_not_implemented() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address = deploy_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        \"MockChecker\",\n        &[Felt::from(420)],\n    );\n\n    let selector = selector_from_name(\"get_thing_not_implemented\");\n    let ret_data = [Felt::from(123), Felt::from(123), Felt::from(123)];\n\n    cheatnet_state.start_mock_call(\n        contract_address,\n        selector_from_name(\"get_thing_not_implemented\"),\n        &ret_data,\n    );\n\n    let output = call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n\n    assert_success(output, &ret_data);\n}\n\n#[test]\nfn mock_call_in_constructor() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contracts_data = get_contracts();\n\n    let class_hash = declare(&mut cached_state, \"HelloStarknet\", &contracts_data)\n        .unwrap()\n        .unwrap_success();\n    let balance_contract_address = deploy(&mut cached_state, &mut cheatnet_state, &class_hash, &[]);\n    let ret_data = [Felt::from(223)];\n    cheatnet_state.start_mock_call(\n        balance_contract_address,\n        selector_from_name(\"get_balance\"),\n        &ret_data,\n    );\n\n    let class_hash = declare(&mut cached_state, \"ConstructorMockChecker\", &contracts_data)\n        .unwrap()\n        .unwrap_success();\n    let contract_address = deploy(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &class_hash,\n        &[balance_contract_address.into_()],\n    );\n\n    let selector = selector_from_name(\"get_constructor_balance\");\n\n    let output = call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n    let output_data = recover_data(output);\n    assert_eq!(output_data.len(), 1);\n    assert_eq!(output_data.first().unwrap().clone(), Felt::from(223));\n}\n\n#[test]\nfn mock_call_two_methods() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address = deploy_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        \"MockChecker\",\n        &[Felt::from(420)],\n    );\n\n    let selector1 = selector_from_name(\"get_thing\");\n    let selector2 = selector_from_name(\"get_constant_thing\");\n\n    let ret_data = [Felt::from(123)];\n    cheatnet_state.start_mock_call(contract_address, selector_from_name(\"get_thing\"), &ret_data);\n\n    cheatnet_state.start_mock_call(\n        contract_address,\n        selector_from_name(\"get_constant_thing\"),\n        &ret_data,\n    );\n\n    let output = call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector1,\n        &[],\n    );\n\n    assert_success(output, &ret_data);\n\n    let output = call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector2,\n        &[],\n    );\n\n    assert_success(output, &ret_data);\n}\n\n#[test]\nfn mock_call_nonexisting_contract() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let selector = selector_from_name(\"get_thing\");\n    let ret_data = [Felt::from(123)];\n\n    let contract_address = ContractAddress::from(218_u8);\n\n    cheatnet_state.start_mock_call(contract_address, selector_from_name(\"get_thing\"), &ret_data);\n\n    let output = call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n\n    assert_success(output, &ret_data);\n}\n\n#[test]\nfn mock_call_simple_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"MockChecker\", &[Felt::from(420)]);\n\n    test_env.mock_call(\n        &contract_address,\n        \"get_thing\",\n        &[123],\n        CheatSpan::TargetCalls(NonZeroUsize::new(2).unwrap()),\n    );\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_thing\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_thing\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_thing\", &[]),\n        &[Felt::from(420)],\n    );\n}\n\n#[test]\nfn mock_call_proxy_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"MockChecker\", &[Felt::from(420)]);\n    let proxy_address = test_env.deploy(\"MockCheckerProxy\", &[]);\n\n    test_env.mock_call(\n        &contract_address,\n        \"get_thing\",\n        &[123],\n        CheatSpan::TargetCalls(NonZeroUsize::new(2).unwrap()),\n    );\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_thing\", &[]),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(\n            &proxy_address,\n            \"get_thing_from_contract\",\n            &[contract_address.into_()],\n        ),\n        &[Felt::from(123)],\n    );\n    assert_success(\n        test_env.call_contract(\n            &proxy_address,\n            \"get_thing_from_contract\",\n            &[contract_address.into_()],\n        ),\n        &[Felt::from(420)],\n    );\n}\n\n#[test]\nfn mock_call_in_constructor_with_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n\n    let balance_address = test_env.deploy(\"HelloStarknet\", &[]);\n\n    let class_hash = test_env.declare(\"ConstructorMockChecker\", &contracts_data);\n    let precalculated_address = test_env\n        .cheatnet_state\n        .precalculate_address(&class_hash, &[balance_address.into_()]);\n\n    test_env.mock_call(\n        &balance_address,\n        \"get_balance\",\n        &[111],\n        CheatSpan::TargetCalls(NonZeroUsize::new(2).unwrap()),\n    );\n\n    let contract_address = test_env.deploy_wrapper(&class_hash, &[balance_address.into_()]);\n    assert_eq!(precalculated_address, contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_constructor_balance\", &[]),\n        &[Felt::from(111)],\n    );\n    assert_success(\n        test_env.call_contract(&balance_address, \"get_balance\", &[]),\n        &[Felt::from(111)],\n    );\n    assert_success(\n        test_env.call_contract(&balance_address, \"get_balance\", &[]),\n        &[Felt::from(0)],\n    );\n}\n\n#[test]\nfn mock_call_twice_in_function() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n\n    let class_hash = test_env.declare(\"MockChecker\", &contracts_data);\n    let precalculated_address = test_env\n        .cheatnet_state\n        .precalculate_address(&class_hash, &[111.into()]);\n\n    test_env.mock_call(\n        &precalculated_address,\n        \"get_thing\",\n        &[222],\n        CheatSpan::TargetCalls(NonZeroUsize::new(2).unwrap()),\n    );\n\n    let contract_address = test_env.deploy_wrapper(&class_hash, &[111.into()]);\n    assert_eq!(precalculated_address, contract_address);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_thing\", &[]),\n        &[222.into()],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_thing_twice\", &[]),\n        &[222.into(), 111.into()],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_thing\", &[]),\n        &[111.into()],\n    );\n}\n\n#[test]\nfn mock_call_override_span() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"MockChecker\", &[111.into()]);\n\n    test_env.mock_call(\n        &contract_address,\n        \"get_thing\",\n        &[222],\n        CheatSpan::TargetCalls(NonZeroUsize::new(2).unwrap()),\n    );\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_thing\", &[]),\n        &[Felt::from(222)],\n    );\n\n    test_env.mock_call(\n        &contract_address,\n        \"get_thing\",\n        &[333],\n        CheatSpan::Indefinite,\n    );\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_thing\", &[]),\n        &[Felt::from(333)],\n    );\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_thing\", &[]),\n        &[Felt::from(333)],\n    );\n\n    test_env.stop_mock_call(&contract_address, \"get_thing\");\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_thing\", &[]),\n        &[111.into()],\n    );\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/cheatcodes/mod.rs",
    "content": "mod test_environment;\n\nmod cheat_account_contract_address;\nmod cheat_block_hash;\nmod cheat_block_number;\nmod cheat_block_timestamp;\nmod cheat_caller_address;\nmod cheat_execution_info;\nmod cheat_sequencer_address;\nmod declare;\nmod generate_random_felt;\nmod get_class_hash;\nmod library_call;\nmod load;\nmod meta_tx_v0;\nmod mock_call;\nmod multiple_writes_same_storage;\nmod precalculate_address;\nmod replace_bytecode;\nmod spy_events;\nmod store;\n"
  },
  {
    "path": "crates/cheatnet/tests/cheatcodes/multiple_writes_same_storage.rs",
    "content": "use crate::common::assertions::assert_success;\nuse crate::common::get_contracts;\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::storage::{\n    load, store, variable_address,\n};\nuse starknet_api::core::ContractAddress;\nuse starknet_types_core::felt::Felt;\n\nuse super::test_environment::TestEnvironment;\n\ntrait StoreTrait {\n    fn store(&mut self, target: ContractAddress, storage_address: Felt, value: u128);\n    fn load(&mut self, target: ContractAddress, storage_address: Felt) -> Felt;\n}\n\nimpl StoreTrait for TestEnvironment {\n    fn store(&mut self, target: ContractAddress, storage_address: Felt, value: u128) {\n        store(\n            &mut self.cached_state,\n            target,\n            storage_address,\n            Felt::from(value),\n        )\n        .unwrap();\n    }\n\n    fn load(&mut self, target: ContractAddress, storage_address: Felt) -> Felt {\n        load(&mut self.cached_state, target, storage_address).unwrap()\n    }\n}\n\n#[test]\nfn same_storage_access_call_contract() {\n    let mut test_env = TestEnvironment::new();\n    let contracts_data = get_contracts();\n    let hello_class_hash = test_env.declare(\"HelloStarknet\", &contracts_data);\n    let contract_address_a = test_env.deploy_wrapper(&hello_class_hash, &[]);\n    let contract_address_b = test_env.deploy_wrapper(&hello_class_hash, &[]);\n    assert_ne!(contract_address_b, contract_address_a);\n\n    test_env\n        .call_contract(&contract_address_a, \"increase_balance\", &[Felt::from(420)])\n        .unwrap();\n    let balance_value_a = test_env.call_contract(&contract_address_a, \"get_balance\", &[]);\n    assert_success(balance_value_a, &[Felt::from(420)]);\n\n    let balance_value_b = test_env.call_contract(&contract_address_b, \"get_balance\", &[]);\n    assert_success(balance_value_b, &[Felt::from(0)]);\n\n    test_env\n        .call_contract(&contract_address_b, \"increase_balance\", &[Felt::from(42)])\n        .unwrap();\n\n    let balance_value_b = test_env.call_contract(&contract_address_b, \"get_balance\", &[]);\n    assert_success(balance_value_b, &[Felt::from(42)]);\n\n    let balance_value_a = test_env.call_contract(&contract_address_a, \"get_balance\", &[]);\n    assert_success(balance_value_a, &[Felt::from(420)]);\n}\n\n#[test]\nfn same_storage_access_store() {\n    let mut test_env = TestEnvironment::new();\n    let contracts_data = get_contracts();\n    let hello_class_hash = test_env.declare(\"HelloStarknet\", &contracts_data);\n    let contract_address_a = test_env.deploy_wrapper(&hello_class_hash, &[]);\n    let contract_address_b = test_env.deploy_wrapper(&hello_class_hash, &[]);\n    assert_ne!(contract_address_b, contract_address_a);\n\n    test_env.store(contract_address_a, variable_address(\"balance\"), 450);\n    let balance_value_a = test_env.load(contract_address_a, variable_address(\"balance\"));\n    assert_eq!(balance_value_a, Felt::from(450));\n\n    let balance_value_b = test_env.load(contract_address_b, variable_address(\"balance\"));\n    assert_eq!(balance_value_b, Felt::from(0));\n\n    test_env.store(contract_address_b, variable_address(\"balance\"), 42);\n    let balance_value_b = test_env.load(contract_address_b, variable_address(\"balance\"));\n    assert_eq!(balance_value_b, Felt::from(42));\n\n    let balance_value_a = test_env.load(contract_address_a, variable_address(\"balance\"));\n    assert_eq!(balance_value_a, Felt::from(450));\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/cheatcodes/precalculate_address.rs",
    "content": "use crate::{cheatcodes::test_environment::TestEnvironment, common::get_contracts};\n\n#[test]\nfn precalculate_address_simple() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"HelloStarknet\", &contracts_data);\n\n    let precalculated1 = test_env.precalculate_address(&class_hash, &[]);\n    let actual1 = test_env.deploy_wrapper(&class_hash, &[]);\n\n    let precalculated2 = test_env.precalculate_address(&class_hash, &[]);\n    let actual2 = test_env.deploy_wrapper(&class_hash, &[]);\n\n    assert_eq!(precalculated1, actual1);\n    assert_eq!(precalculated2, actual2);\n    assert_ne!(actual1, actual2);\n}\n\n#[test]\nfn precalculate_address_calldata() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"ConstructorSimple\", &contracts_data);\n\n    let precalculated1 = test_env.precalculate_address(&class_hash, &[111]);\n    let precalculated2 = test_env.precalculate_address(&class_hash, &[222]);\n\n    let actual1 = test_env.deploy_wrapper(&class_hash, &[111.into()]);\n\n    let precalculated2_post_deploy = test_env.precalculate_address(&class_hash, &[222]);\n\n    let actual2 = test_env.deploy_wrapper(&class_hash, &[222.into()]);\n\n    assert_eq!(precalculated1, actual1);\n    assert_ne!(precalculated1, precalculated2);\n    assert_ne!(precalculated2, precalculated2_post_deploy);\n    assert_eq!(precalculated2_post_deploy, actual2);\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/cheatcodes/replace_bytecode.rs",
    "content": "use crate::{\n    cheatcodes::test_environment::TestEnvironment,\n    common::{assertions::assert_success, get_contracts, state::create_fork_cached_state_at},\n};\nuse cheatnet::runtime_extensions::call_to_blockifier_runtime_extension::rpc::CallSuccess;\nuse conversions::string::TryFromHexStr;\nuse num_traits::Zero;\nuse starknet_api::core::{ClassHash, ContractAddress};\nuse starknet_types_core::felt::Felt;\nuse tempfile::TempDir;\n\ntrait ReplaceBytecodeTrait {\n    fn replace_class_for_contract(\n        &mut self,\n        contract_address: ContractAddress,\n        class_hash: ClassHash,\n    );\n}\n\nimpl ReplaceBytecodeTrait for TestEnvironment {\n    fn replace_class_for_contract(\n        &mut self,\n        contract_address: ContractAddress,\n        class_hash: ClassHash,\n    ) {\n        self.cheatnet_state\n            .replace_class_for_contract(contract_address, class_hash);\n    }\n}\n\n#[test]\nfn fork() {\n    let cache_dir = TempDir::new().unwrap();\n    let mut test_env = TestEnvironment::new();\n    test_env.cached_state = create_fork_cached_state_at(53_300, cache_dir.path().to_str().unwrap());\n    let contracts_data = get_contracts();\n\n    let class_hash = test_env.declare(\"ReplaceInFork\", &contracts_data);\n    let contract = TryFromHexStr::try_from_hex_str(\n        \"0x06fdb5ef99e9def44484a3f8540bc42333e321e9b24a397d6bc0c8860bb7da8f\",\n    )\n    .unwrap();\n\n    let output = test_env.call_contract(&contract, \"get_owner\", &[]);\n\n    assert!(matches!(\n        output,\n        Ok(CallSuccess { ret_data, .. }) if ret_data != [Felt::zero()],\n    ));\n\n    test_env.replace_class_for_contract(contract, class_hash);\n\n    let output = test_env.call_contract(&contract, \"get_owner\", &[]);\n\n    assert_success(output, &[Felt::zero()]);\n}\n\n#[test]\nfn override_entrypoint() {\n    let mut test_env = TestEnvironment::new();\n    let contracts_data = get_contracts();\n\n    let class_hash_a = test_env.declare(\"ReplaceBytecodeA\", &contracts_data);\n    let class_hash_b = test_env.declare(\"ReplaceBytecodeB\", &contracts_data);\n    let contract_address = test_env.deploy_wrapper(&class_hash_a, &[]);\n\n    let output = test_env.call_contract(&contract_address, \"get_const\", &[]);\n\n    assert_success(output, &[Felt::from(2137)]);\n\n    test_env.replace_class_for_contract(contract_address, class_hash_b);\n\n    let output = test_env.call_contract(&contract_address, \"get_const\", &[]);\n\n    assert_success(output, &[Felt::from(420)]);\n}\n\n#[test]\nfn keep_storage() {\n    let mut test_env = TestEnvironment::new();\n    let contracts_data = get_contracts();\n\n    let class_hash_a = test_env.declare(\"ReplaceBytecodeA\", &contracts_data);\n    let class_hash_b = test_env.declare(\"ReplaceBytecodeB\", &contracts_data);\n    let contract_address = test_env.deploy_wrapper(&class_hash_a, &[]);\n\n    let output = test_env.call_contract(&contract_address, \"set\", &[456.into()]);\n\n    assert_success(output, &[]);\n\n    let output = test_env.call_contract(&contract_address, \"get\", &[]);\n\n    assert_success(output, &[Felt::from(456)]);\n\n    test_env.replace_class_for_contract(contract_address, class_hash_b);\n\n    let output = test_env.call_contract(&contract_address, \"get\", &[]);\n\n    assert_success(output, &[Felt::from(556)]);\n}\n\n#[test]\nfn allow_setting_original_class() {\n    let mut test_env = TestEnvironment::new();\n    let contracts_data = get_contracts();\n\n    let class_hash_a = test_env.declare(\"ReplaceBytecodeA\", &contracts_data);\n    let class_hash_b = test_env.declare(\"ReplaceBytecodeB\", &contracts_data);\n    let contract_address = test_env.deploy_wrapper(&class_hash_a, &[]);\n\n    test_env.replace_class_for_contract(contract_address, class_hash_b);\n\n    test_env.replace_class_for_contract(contract_address, class_hash_a);\n\n    let output = test_env.call_contract(&contract_address, \"get_const\", &[]);\n\n    assert_success(output, &[Felt::from(2137)]);\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/cheatcodes/spy_events.rs",
    "content": "use crate::cheatcodes::test_environment::TestEnvironment;\nuse crate::common::get_contracts;\nuse crate::common::state::create_fork_cached_state_at;\nuse crate::common::{call_contract, deploy_contract};\nuse cairo_lang_starknet_classes::keccak::starknet_keccak;\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::spy_events::Event;\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::storage::selector_from_name;\nuse cheatnet::state::CheatnetState;\nuse conversions::IntoConv;\nuse conversions::string::TryFromHexStr;\nuse starknet_types_core::felt::Felt;\nuse std::vec;\nuse tempfile::TempDir;\n\ntrait SpyTrait {\n    fn get_events(&mut self, id: usize) -> Vec<Event>;\n}\n\nimpl SpyTrait for TestEnvironment {\n    fn get_events(&mut self, events_offset: usize) -> Vec<Event> {\n        self.cheatnet_state.get_events(events_offset)\n    }\n}\n\n#[test]\nfn spy_events_zero_offset() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"SpyEventsChecker\", &[]);\n\n    test_env\n        .call_contract(&contract_address, \"emit_one_event\", &[Felt::from(123)])\n        .unwrap();\n\n    let events = test_env.get_events(0);\n\n    assert_eq!(events.len(), 1, \"There should be one event\");\n    assert_eq!(\n        events[0],\n        Event {\n            from: contract_address,\n            keys: vec![starknet_keccak(\"FirstEvent\".as_ref()).into()],\n            data: vec![Felt::from(123)]\n        },\n        \"Wrong event\"\n    );\n\n    test_env\n        .call_contract(&contract_address, \"emit_one_event\", &[Felt::from(123)])\n        .unwrap();\n\n    let length = test_env.get_events(0).len();\n    assert_eq!(length, 2, \"There should be one more new event\");\n}\n\n#[test]\nfn spy_events_some_offset() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"SpyEventsChecker\", &[]);\n\n    test_env\n        .call_contract(&contract_address, \"emit_one_event\", &[Felt::from(123)])\n        .unwrap();\n    test_env\n        .call_contract(&contract_address, \"emit_one_event\", &[Felt::from(123)])\n        .unwrap();\n    test_env\n        .call_contract(&contract_address, \"emit_one_event\", &[Felt::from(123)])\n        .unwrap();\n\n    let events = test_env.get_events(2);\n\n    assert_eq!(\n        events.len(),\n        1,\n        \"There should be only one event fetched after accounting for an offset of 2\"\n    );\n    assert_eq!(\n        events[0],\n        Event {\n            from: contract_address,\n            keys: vec![starknet_keccak(\"FirstEvent\".as_ref()).into()],\n            data: vec![Felt::from(123)]\n        },\n        \"Wrong event\"\n    );\n\n    test_env\n        .call_contract(&contract_address, \"emit_one_event\", &[Felt::from(123)])\n        .unwrap();\n\n    let length = test_env.get_events(2).len();\n    assert_eq!(length, 2, \"There should be one more new event\");\n}\n\n#[test]\nfn check_events_order() {\n    let mut test_env = TestEnvironment::new();\n\n    let spy_events_checker_address = test_env.deploy(\"SpyEventsChecker\", &[]);\n    let spy_events_order_checker_address = test_env.deploy(\"SpyEventsOrderChecker\", &[]);\n\n    test_env\n        .call_contract(\n            &spy_events_order_checker_address,\n            \"emit_and_call_another\",\n            &[\n                Felt::from(123),\n                Felt::from(234),\n                Felt::from(345),\n                spy_events_checker_address.into_(),\n            ],\n        )\n        .unwrap();\n\n    let events = test_env.get_events(0);\n\n    assert_eq!(events.len(), 3, \"There should be three events\");\n    assert_eq!(\n        events[0],\n        Event {\n            from: spy_events_order_checker_address,\n            keys: vec![starknet_keccak(\"SecondEvent\".as_ref()).into()],\n            data: vec![Felt::from(123)]\n        },\n        \"Wrong first event\"\n    );\n    assert_eq!(\n        events[1],\n        Event {\n            from: spy_events_checker_address,\n            keys: vec![starknet_keccak(\"FirstEvent\".as_ref()).into()],\n            data: vec![Felt::from(234)]\n        },\n        \"Wrong second event\"\n    );\n    assert_eq!(\n        events[2],\n        Event {\n            from: spy_events_order_checker_address,\n            keys: vec![starknet_keccak(\"ThirdEvent\".as_ref()).into()],\n            data: vec![Felt::from(345)]\n        },\n        \"Wrong third event\"\n    );\n}\n\n#[test]\nfn library_call_emits_event() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"SpyEventsChecker\", &contracts_data);\n    let contract_address = test_env.deploy(\"SpyEventsLibCall\", &[]);\n\n    test_env\n        .call_contract(\n            &contract_address,\n            \"call_lib_call\",\n            &[Felt::from(123), class_hash.into_()],\n        )\n        .unwrap();\n\n    let events = test_env.get_events(0);\n\n    assert_eq!(events.len(), 1, \"There should be one event\");\n    assert_eq!(\n        events[0],\n        Event {\n            from: contract_address,\n            keys: vec![starknet_keccak(\"FirstEvent\".as_ref()).into()],\n            data: vec![Felt::from(123)]\n        },\n        \"Wrong event\"\n    );\n}\n\n#[test]\nfn event_emitted_in_constructor() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"ConstructorSpyEventsChecker\", &[Felt::from(123)]);\n\n    let events = test_env.get_events(0);\n\n    assert_eq!(events.len(), 1, \"There should be one event\");\n    assert_eq!(\n        events[0],\n        Event {\n            from: contract_address,\n            keys: vec![starknet_keccak(\"FirstEvent\".as_ref()).into()],\n            data: vec![Felt::from(123)]\n        },\n        \"Wrong event\"\n    );\n}\n\n#[test]\nfn test_nested_calls() {\n    let mut test_env = TestEnvironment::new();\n\n    let spy_events_checker_address = test_env.deploy(\"SpyEventsChecker\", &[]);\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"SpyEventsCheckerProxy\", &contracts_data);\n\n    let spy_events_checker_proxy_address =\n        test_env.deploy_wrapper(&class_hash, &[spy_events_checker_address.into_()]);\n    let spy_events_checker_top_proxy_address =\n        test_env.deploy_wrapper(&class_hash, &[spy_events_checker_proxy_address.into_()]);\n\n    test_env\n        .call_contract(\n            &spy_events_checker_top_proxy_address,\n            \"emit_one_event\",\n            &[Felt::from(123)],\n        )\n        .unwrap();\n\n    let events = test_env.get_events(0);\n\n    assert_eq!(events.len(), 3, \"There should be three events\");\n    assert_eq!(\n        events[0],\n        Event {\n            from: spy_events_checker_top_proxy_address,\n            keys: vec![starknet_keccak(\"FirstEvent\".as_ref()).into()],\n            data: vec![Felt::from(123)]\n        },\n        \"Wrong first event\"\n    );\n    assert_eq!(\n        events[1],\n        Event {\n            from: spy_events_checker_proxy_address,\n            keys: vec![starknet_keccak(\"FirstEvent\".as_ref()).into()],\n            data: vec![Felt::from(123)]\n        },\n        \"Wrong second event\"\n    );\n    assert_eq!(\n        events[2],\n        Event {\n            from: spy_events_checker_address,\n            keys: vec![starknet_keccak(\"FirstEvent\".as_ref()).into()],\n            data: vec![Felt::from(123)]\n        },\n        \"Wrong third event\"\n    );\n}\n\n#[test]\nfn use_multiple_spies() {\n    let mut test_env = TestEnvironment::new();\n\n    let spy_events_checker_address = test_env.deploy(\"SpyEventsChecker\", &[]);\n\n    let contracts_data = get_contracts();\n    let class_hash = test_env.declare(\"SpyEventsCheckerProxy\", &contracts_data);\n\n    let spy_events_checker_proxy_address =\n        test_env.deploy_wrapper(&class_hash, &[spy_events_checker_address.into_()]);\n    let spy_events_checker_top_proxy_address =\n        test_env.deploy_wrapper(&class_hash, &[spy_events_checker_proxy_address.into_()]);\n\n    // Events emitted in the order of:\n    // - spy_events_checker_top_proxy_address,\n    // - spy_events_checker_proxy_address,\n    // - spy_events_checker_address\n    test_env\n        .call_contract(\n            &spy_events_checker_top_proxy_address,\n            \"emit_one_event\",\n            &[Felt::from(123)],\n        )\n        .unwrap();\n\n    let events1 = test_env.get_events(0);\n    let events2 = test_env.get_events(1);\n    let events3 = test_env.get_events(2);\n\n    assert_eq!(events1.len(), 3, \"There should be one event\");\n    assert_eq!(events2.len(), 2, \"There should be one event\");\n    assert_eq!(events3.len(), 1, \"There should be one event\");\n\n    assert_eq!(\n        events1[0],\n        Event {\n            from: spy_events_checker_top_proxy_address,\n            keys: vec![starknet_keccak(\"FirstEvent\".as_ref()).into()],\n            data: vec![Felt::from(123)]\n        },\n        \"Wrong spy_events_checker_top_proxy event\"\n    );\n    assert_eq!(\n        events2[0],\n        Event {\n            from: spy_events_checker_proxy_address,\n            keys: vec![starknet_keccak(\"FirstEvent\".as_ref()).into()],\n            data: vec![Felt::from(123)]\n        },\n        \"Wrong spy_events_checker_proxy event\"\n    );\n    assert_eq!(\n        events3[0],\n        Event {\n            from: spy_events_checker_address,\n            keys: vec![starknet_keccak(\"FirstEvent\".as_ref()).into()],\n            data: vec![Felt::from(123)]\n        },\n        \"Wrong spy_events_checker event\"\n    );\n}\n\n#[test]\nfn test_emitted_by_emit_events_syscall() {\n    let mut test_env = TestEnvironment::new();\n\n    let contract_address = test_env.deploy(\"SpyEventsChecker\", &[]);\n\n    test_env\n        .call_contract(\n            &contract_address,\n            \"emit_event_syscall\",\n            &[Felt::from(123), Felt::from(456)],\n        )\n        .unwrap();\n\n    let events = test_env.get_events(0);\n\n    assert_eq!(events.len(), 1, \"There should be one event\");\n    assert_eq!(\n        events[0],\n        Event {\n            from: contract_address,\n            keys: vec![Felt::from(123)],\n            data: vec![Felt::from(456)]\n        },\n        \"Wrong spy_events_checker event\"\n    );\n}\n\n#[test]\nfn capture_cairo0_event() {\n    let temp_dir = TempDir::new().unwrap();\n    let mut cached_state = create_fork_cached_state_at(53_626, temp_dir.path().to_str().unwrap());\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address = deploy_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        \"SpyEventsCairo0\",\n        &[],\n    );\n\n    let selector = selector_from_name(\"test_cairo0_event_collection\");\n\n    let cairo0_contract_address =\n        Felt::try_from_hex_str(\"0x2c77ca97586968c6651a533bd5f58042c368b14cf5f526d2f42f670012e10ac\")\n            .unwrap();\n\n    call_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[cairo0_contract_address],\n    )\n    .unwrap();\n\n    let events = cheatnet_state.get_events(0);\n\n    assert_eq!(events.len(), 1, \"There should be one event\");\n\n    assert_eq!(\n        events[0],\n        Event {\n            from: cairo0_contract_address.into_(),\n            keys: vec![starknet_keccak(\"my_event\".as_ref()).into()],\n            data: vec![Felt::from(123_456_789)]\n        },\n        \"Wrong spy_events_checker event\"\n    );\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/cheatcodes/store.rs",
    "content": "use crate::common::assertions::assert_success;\nuse crate::common::get_contracts;\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::storage::{\n    map_entry_address, store, variable_address,\n};\nuse starknet_api::core::ContractAddress;\nuse starknet_types_core::felt::Felt;\n\nuse super::test_environment::TestEnvironment;\n\ntrait StoreTrait {\n    fn store(&mut self, target: ContractAddress, storage_address: Felt, value: u128);\n}\n\nimpl StoreTrait for TestEnvironment {\n    fn store(&mut self, target: ContractAddress, storage_address: Felt, value: u128) {\n        store(\n            &mut self.cached_state,\n            target,\n            storage_address,\n            Felt::from(value),\n        )\n        .unwrap();\n    }\n}\n\n#[test]\nfn store_simple_state() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n\n    let class_hash = test_env.declare(\"HelloStarknet\", &contracts_data);\n    let contract_address = test_env.deploy_wrapper(&class_hash, &[]);\n\n    test_env.store(contract_address, variable_address(\"balance\"), 666);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"get_balance\", &[]),\n        &[Felt::from(666)],\n    );\n}\n\n#[test]\nfn store_state_map_simple_value() {\n    let mut test_env = TestEnvironment::new();\n\n    let contracts_data = get_contracts();\n\n    let class_hash = test_env.declare(\"MapSimpleValueSimpleKey\", &contracts_data);\n\n    let contract_address = test_env.deploy_wrapper(&class_hash, &[]);\n\n    let map_key = Felt::from(420);\n    let inserted_value = 69;\n\n    let entry_address = map_entry_address(\"values\", &[map_key]);\n    test_env.store(contract_address, entry_address, inserted_value);\n\n    assert_success(\n        test_env.call_contract(&contract_address, \"read\", &[map_key]),\n        &[inserted_value.into()],\n    );\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/cheatcodes/test_environment.rs",
    "content": "use crate::common::assertions::ClassHashAssert;\nuse crate::common::{call_contract, deploy, library_call_contract};\nuse crate::common::{deploy_contract, state::create_cached_state};\nuse blockifier::state::cached_state::CachedState;\nuse cheatnet::runtime_extensions::call_to_blockifier_runtime_extension::rpc::CallResult;\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::declare::declare;\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::storage::selector_from_name;\nuse cheatnet::runtime_extensions::forge_runtime_extension::contracts_data::ContractsData;\nuse cheatnet::state::{CheatnetState, ExtendedStateReader};\nuse starknet_api::core::ClassHash;\nuse starknet_api::core::ContractAddress;\nuse starknet_types_core::felt::Felt;\n\npub struct TestEnvironment {\n    pub cached_state: CachedState<ExtendedStateReader>,\n    pub cheatnet_state: CheatnetState,\n}\n\nimpl TestEnvironment {\n    pub fn new() -> Self {\n        let cached_state = create_cached_state();\n\n        Self {\n            cached_state,\n            cheatnet_state: CheatnetState::default(),\n        }\n    }\n\n    pub fn declare(&mut self, contract_name: &str, contracts_data: &ContractsData) -> ClassHash {\n        declare(&mut self.cached_state, contract_name, contracts_data)\n            .unwrap()\n            .unwrap_success()\n    }\n\n    pub fn deploy(&mut self, contract_name: &str, calldata: &[Felt]) -> ContractAddress {\n        deploy_contract(\n            &mut self.cached_state,\n            &mut self.cheatnet_state,\n            contract_name,\n            calldata,\n        )\n    }\n\n    pub fn deploy_wrapper(&mut self, class_hash: &ClassHash, calldata: &[Felt]) -> ContractAddress {\n        deploy(\n            &mut self.cached_state,\n            &mut self.cheatnet_state,\n            class_hash,\n            calldata,\n        )\n    }\n\n    pub fn call_contract(\n        &mut self,\n        contract_address: &ContractAddress,\n        selector: &str,\n        calldata: &[Felt],\n    ) -> CallResult {\n        call_contract(\n            &mut self.cached_state,\n            &mut self.cheatnet_state,\n            contract_address,\n            selector_from_name(selector),\n            calldata,\n        )\n    }\n\n    pub fn library_call_contract(\n        &mut self,\n        class_hash: &ClassHash,\n        selector: &str,\n        calldata: &[Felt],\n    ) -> CallResult {\n        library_call_contract(\n            &mut self.cached_state,\n            &mut self.cheatnet_state,\n            class_hash,\n            selector_from_name(selector),\n            calldata,\n        )\n    }\n\n    pub fn precalculate_address(\n        &mut self,\n        class_hash: &ClassHash,\n        calldata: &[u128],\n    ) -> ContractAddress {\n        let calldata = calldata.iter().map(|x| Felt::from(*x)).collect::<Vec<_>>();\n        self.cheatnet_state\n            .precalculate_address(class_hash, &calldata)\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/common/assertions.rs",
    "content": "use cheatnet::runtime_extensions::call_to_blockifier_runtime_extension::rpc::{\n    CallFailure, CallResult, CallSuccess,\n};\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::declare::DeclareResult;\nuse conversions::byte_array::ByteArray;\nuse starknet_api::core::ClassHash;\nuse starknet_types_core::felt::Felt;\n\n#[inline]\npub fn assert_success(call_contract_output: CallResult, expected_data: &[Felt]) {\n    assert!(matches!(\n        call_contract_output,\n        Ok(CallSuccess { ret_data, .. })\n        if ret_data == expected_data,\n    ));\n}\n\n#[inline]\npub fn assert_panic(call_contract_output: CallResult, expected_data: &[Felt]) {\n    assert!(matches!(\n        call_contract_output,\n        Err(\n            CallFailure::Recoverable { panic_data, .. }\n        )\n        if panic_data == expected_data\n    ));\n}\n\n#[inline]\npub fn assert_error(call_contract_output: CallResult, expected_data: impl Into<ByteArray>) {\n    assert!(matches!(\n        call_contract_output,\n        Err(\n            CallFailure::Unrecoverable { msg, .. }\n        )\n        if msg == expected_data.into(),\n    ));\n}\n\npub trait ClassHashAssert {\n    fn unwrap_success(self) -> ClassHash;\n}\n\nimpl ClassHashAssert for DeclareResult {\n    fn unwrap_success(self) -> ClassHash {\n        match self {\n            DeclareResult::Success(class_hash) => class_hash,\n            DeclareResult::AlreadyDeclared(class_hash) => {\n                panic!(\"Class hash {class_hash} is already declared\")\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/common/cache.rs",
    "content": "use glob::glob;\nuse serde_json::{Map, Value};\nuse std::fs;\nuse std::path::PathBuf;\nuse std::str::FromStr;\n\npub fn read_cache(file_pattern: &str) -> Map<String, Value> {\n    let mut cache_files = glob(file_pattern).unwrap().filter_map(Result::ok);\n\n    let cache_file = match (cache_files.next(), cache_files.next()) {\n        (None, None) => panic!(\"Cache file not found\"),\n        (Some(cache_file), None) => cache_file,\n        _ => panic!(\"Multiple matching cache files found\"),\n    };\n\n    let cache_content = fs::read_to_string(cache_file).expect(\"Could not read cache\");\n    let parsed_cache_content: Value =\n        serde_json::from_str(&cache_content).expect(\"Could not parse cache\");\n    parsed_cache_content\n        .as_object()\n        .expect(\"Parsed cache is not an object\")\n        .clone()\n}\n\npub fn purge_cache(directory: &str) {\n    fs::remove_dir_all(PathBuf::from_str(directory).expect(\"Could not parse cache path\"))\n        .expect(\"Could not remove cache directory\");\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/common/mod.rs",
    "content": "use assertions::ClassHashAssert;\nuse blockifier::execution::call_info::CallInfo;\nuse blockifier::execution::contract_class::TrackedResource;\nuse blockifier::execution::entry_point::{\n    CallEntryPoint, CallType, ConstructorContext, EntryPointExecutionContext,\n    EntryPointExecutionResult,\n};\nuse blockifier::execution::execution_utils::ReadOnlySegments;\nuse blockifier::execution::syscalls::hint_processor::SyscallHintProcessor;\nuse blockifier::state::state_api::State;\nuse cairo_lang_casm::hints::Hint;\nuse cairo_vm::types::relocatable::Relocatable;\nuse cheatnet::runtime_extensions::call_to_blockifier_runtime_extension::execution::cheated_syscalls;\nuse cheatnet::runtime_extensions::call_to_blockifier_runtime_extension::execution::entry_point::{\n    ExecuteCallEntryPointExtraOptions, execute_call_entry_point,\n};\nuse cheatnet::runtime_extensions::call_to_blockifier_runtime_extension::rpc::{\n    AddressOrClassHash, CallSuccess, call_entry_point,\n};\nuse cheatnet::runtime_extensions::call_to_blockifier_runtime_extension::rpc::{\n    CallFailure, CallResult,\n};\nuse cheatnet::runtime_extensions::common::create_execute_calldata;\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::declare::declare;\nuse cheatnet::runtime_extensions::forge_runtime_extension::contracts_data::ContractsData;\nuse cheatnet::state::CheatnetState;\nuse conversions::IntoConv;\nuse conversions::string::TryFromHexStr;\nuse foundry_ui::UI;\nuse runtime::starknet::constants::TEST_ADDRESS;\nuse runtime::starknet::context::build_context;\nuse scarb_api::metadata::metadata_for_dir;\nuse scarb_api::{\n    CompilationOpts, get_contracts_artifacts_and_source_sierra_paths, target_dir_for_workspace,\n};\nuse starknet_api::contract_class::EntryPointType;\nuse starknet_api::core::{ClassHash, ContractAddress, EntryPointSelector};\nuse starknet_api::transaction::fields::Calldata;\nuse starknet_rust::core::utils::get_selector_from_name;\nuse starknet_types_core::felt::Felt;\nuse std::collections::HashMap;\nuse std::sync::Arc;\n\npub mod assertions;\npub mod cache;\npub mod state;\n\n// Helper struct to return both: our custom call result wrapper and actual call info (unless unrecoverable error), allowing tests to check both\npub struct CallResultExtended {\n    pub call_result: CallResult,\n    pub call_info: Option<CallInfo>,\n}\n\nfn build_syscall_hint_processor<'a>(\n    call_entry_point: &CallEntryPoint,\n    state: &'a mut dyn State,\n    entry_point_execution_context: &'a mut EntryPointExecutionContext,\n    hints: &'a HashMap<String, Hint>,\n) -> SyscallHintProcessor<'a> {\n    let class_hash = call_entry_point.class_hash.unwrap_or_default();\n    let call_entry_point = call_entry_point.clone().into_executable(class_hash);\n\n    SyscallHintProcessor::new(\n        state,\n        entry_point_execution_context,\n        Relocatable {\n            segment_index: 0,\n            offset: 0,\n        },\n        call_entry_point,\n        hints,\n        ReadOnlySegments::default(),\n    )\n}\npub fn recover_data(output: CallResult) -> Vec<Felt> {\n    match output {\n        Ok(CallSuccess { ret_data, .. }) => ret_data,\n        Err(failure_type) => match failure_type {\n            CallFailure::Recoverable { panic_data, .. } => panic_data,\n            CallFailure::Unrecoverable { msg, .. } => panic!(\"Call failed with message: {msg}\"),\n        },\n    }\n}\n\npub fn get_contracts() -> ContractsData {\n    let scarb_metadata = metadata_for_dir(\"tests/contracts\").unwrap();\n    let target_dir = target_dir_for_workspace(&scarb_metadata).join(\"dev\");\n\n    let package = scarb_metadata.packages.first().unwrap();\n\n    let ui = UI::default();\n    let contracts = get_contracts_artifacts_and_source_sierra_paths(\n        &target_dir,\n        package,\n        &ui,\n        CompilationOpts {\n            use_test_target_contracts: false,\n            #[cfg(feature = \"cairo-native\")]\n            run_native: true,\n        },\n    )\n    .unwrap();\n    ContractsData::try_from(contracts).unwrap()\n}\n\npub fn deploy_contract(\n    state: &mut dyn State,\n    cheatnet_state: &mut CheatnetState,\n    contract_name: &str,\n    calldata: &[Felt],\n) -> ContractAddress {\n    let contracts_data = get_contracts();\n\n    let class_hash = declare(state, contract_name, &contracts_data)\n        .unwrap()\n        .unwrap_success();\n\n    let mut entry_point_execution_context = build_context(\n        &cheatnet_state.block_info,\n        None,\n        &TrackedResource::SierraGas,\n    );\n    let hints = HashMap::new();\n\n    let mut syscall_hint_processor = build_syscall_hint_processor(\n        &CallEntryPoint::default(),\n        state,\n        &mut entry_point_execution_context,\n        &hints,\n    );\n\n    let (contract_address, _) = deploy_helper(\n        &mut syscall_hint_processor,\n        cheatnet_state,\n        &class_hash,\n        None,\n        calldata,\n    );\n\n    contract_address\n}\n\npub fn deploy(\n    state: &mut dyn State,\n    cheatnet_state: &mut CheatnetState,\n    class_hash: &ClassHash,\n    calldata: &[Felt],\n) -> ContractAddress {\n    let mut entry_point_execution_context = build_context(\n        &cheatnet_state.block_info,\n        None,\n        &TrackedResource::SierraGas,\n    );\n    let hints = HashMap::new();\n\n    let mut syscall_hint_processor = build_syscall_hint_processor(\n        &CallEntryPoint::default(),\n        state,\n        &mut entry_point_execution_context,\n        &hints,\n    );\n\n    let (contract_address, _) = deploy_helper(\n        &mut syscall_hint_processor,\n        cheatnet_state,\n        class_hash,\n        None,\n        calldata,\n    );\n\n    contract_address\n}\n\nfn deploy_helper(\n    syscall_handler: &mut SyscallHintProcessor,\n    cheatnet_state: &mut CheatnetState,\n    class_hash: &ClassHash,\n    contract_address: Option<ContractAddress>,\n    calldata: &[Felt],\n) -> (ContractAddress, Vec<cairo_vm::Felt252>) {\n    let contract_address = contract_address\n        .unwrap_or_else(|| cheatnet_state.precalculate_address(class_hash, calldata));\n    let calldata = Calldata(Arc::new(calldata.to_vec()));\n\n    let ctor_context = ConstructorContext {\n        class_hash: *class_hash,\n        code_address: Some(contract_address),\n        storage_address: contract_address,\n        caller_address: TryFromHexStr::try_from_hex_str(TEST_ADDRESS).unwrap(),\n    };\n\n    let call_info = cheated_syscalls::execute_deployment(\n        syscall_handler.base.state,\n        cheatnet_state,\n        syscall_handler.base.context,\n        &ctor_context,\n        calldata,\n        &mut (i64::MAX as u64),\n    )\n    .unwrap();\n    cheatnet_state.increment_deploy_salt_base();\n\n    let retdata = call_info.execution.retdata.0.clone();\n    syscall_handler.base.inner_calls.push(call_info);\n\n    (contract_address, retdata)\n}\n\n// This does contract call without the transaction layer. This way `call_contract` can return data and modify state.\n// `call` and `invoke` on the transactional layer use such method under the hood.\npub fn call_contract(\n    state: &mut dyn State,\n    cheatnet_state: &mut CheatnetState,\n    contract_address: &ContractAddress,\n    entry_point_selector: EntryPointSelector,\n    calldata: &[Felt],\n) -> CallResult {\n    let calldata = create_execute_calldata(calldata);\n\n    let entry_point = CallEntryPoint {\n        class_hash: None,\n        code_address: Some(*contract_address),\n        entry_point_type: EntryPointType::External,\n        entry_point_selector,\n        calldata,\n        storage_address: *contract_address,\n        caller_address: TryFromHexStr::try_from_hex_str(TEST_ADDRESS).unwrap(),\n        call_type: CallType::Call,\n        initial_gas: i64::MAX as u64,\n    };\n\n    call_entry_point_extended_result(\n        state,\n        cheatnet_state,\n        entry_point,\n        &AddressOrClassHash::ContractAddress(*contract_address),\n    )\n    .call_result\n}\n\n// This executes a library call as from a test contract.\n// `entry_point` below should match `library_call_syscall` entry point, except for `selector` and `calldata`:\n// https://github.com/foundry-rs/starknet-foundry/blob/421a339168a9e0b6502eac4fdc4fdeb0598c72b7/crates/cheatnet/src/runtime_extensions/call_to_blockifier_runtime_extension/mod.rs#L151\npub fn library_call_contract(\n    state: &mut dyn State,\n    cheatnet_state: &mut CheatnetState,\n    class_hash: &ClassHash,\n    entry_point_selector: EntryPointSelector,\n    calldata: &[Felt],\n) -> CallResult {\n    let calldata = create_execute_calldata(calldata);\n    let entry_point = CallEntryPoint {\n        class_hash: Some(*class_hash),\n        code_address: None,\n        entry_point_type: EntryPointType::External,\n        entry_point_selector,\n        calldata,\n        storage_address: TryFromHexStr::try_from_hex_str(TEST_ADDRESS).unwrap(),\n        caller_address: ContractAddress::default(),\n        call_type: CallType::Delegate,\n        initial_gas: i64::MAX as u64,\n    };\n\n    call_entry_point_extended_result(\n        state,\n        cheatnet_state,\n        entry_point,\n        &AddressOrClassHash::ClassHash(*class_hash),\n    )\n    .call_result\n}\n\npub fn call_contract_extended_result(\n    state: &mut dyn State,\n    cheatnet_state: &mut CheatnetState,\n    contract_address: &ContractAddress,\n    entry_point_selector: EntryPointSelector,\n    calldata: &[Felt],\n) -> CallResultExtended {\n    let calldata = create_execute_calldata(calldata);\n\n    let entry_point = CallEntryPoint {\n        class_hash: None,\n        code_address: Some(*contract_address),\n        entry_point_type: EntryPointType::External,\n        entry_point_selector,\n        calldata,\n        storage_address: *contract_address,\n        caller_address: TryFromHexStr::try_from_hex_str(TEST_ADDRESS).unwrap(),\n        call_type: CallType::Call,\n        initial_gas: i64::MAX as u64,\n    };\n\n    call_entry_point_extended_result(\n        state,\n        cheatnet_state,\n        entry_point,\n        &AddressOrClassHash::ContractAddress(*contract_address),\n    )\n}\n\nfn call_entry_point_extended_result(\n    state: &mut dyn State,\n    cheatnet_state: &mut CheatnetState,\n    entry_point: CallEntryPoint,\n    address_or_class_hash: &AddressOrClassHash,\n) -> CallResultExtended {\n    let mut entry_point_execution_context = build_context(\n        &cheatnet_state.block_info,\n        None,\n        &TrackedResource::SierraGas,\n    );\n    let hints = HashMap::new();\n\n    let mut syscall_hint_processor = build_syscall_hint_processor(\n        &entry_point,\n        state,\n        &mut entry_point_execution_context,\n        &hints,\n    );\n\n    let call_result = call_entry_point(\n        &mut syscall_hint_processor,\n        cheatnet_state,\n        entry_point,\n        address_or_class_hash,\n        &mut (i64::MAX as u64),\n    );\n    let call_info = syscall_hint_processor.base.inner_calls.first().cloned();\n\n    CallResultExtended {\n        call_result,\n        call_info,\n    }\n}\n\n// Calls an entry point via `execute_call_entry_point` directly, bypassing the `call_entry_point` wrapper.\n// Unlike `call_entry_point`, this layer does **not** revert state mutations on failure.\n// Therefore, events, messages, and storage changes persist even when the call fails.\npub fn execute_entry_point_without_revert(\n    state: &mut dyn State,\n    cheatnet_state: &mut CheatnetState,\n    contract_address: &ContractAddress,\n    entry_point_selector: EntryPointSelector,\n    calldata: &[Felt],\n    tracked_resource: TrackedResource,\n) -> EntryPointExecutionResult<CallInfo> {\n    let calldata = create_execute_calldata(calldata);\n\n    let mut entry_point = CallEntryPoint {\n        class_hash: None,\n        code_address: Some(*contract_address),\n        entry_point_type: EntryPointType::External,\n        entry_point_selector,\n        calldata,\n        storage_address: *contract_address,\n        caller_address: TryFromHexStr::try_from_hex_str(TEST_ADDRESS).unwrap(),\n        call_type: CallType::Call,\n        initial_gas: i64::MAX as u64,\n    };\n\n    let mut entry_point_execution_context =\n        build_context(&cheatnet_state.block_info, None, &tracked_resource);\n    let hints = HashMap::new();\n\n    let syscall_hint_processor = build_syscall_hint_processor(\n        &entry_point,\n        state,\n        &mut entry_point_execution_context,\n        &hints,\n    );\n\n    execute_call_entry_point(\n        &mut entry_point,\n        syscall_hint_processor.base.state,\n        cheatnet_state,\n        syscall_hint_processor.base.context,\n        &mut (i64::MAX as u64),\n        &ExecuteCallEntryPointExtraOptions::default(),\n    )\n}\n\n#[must_use]\npub fn selector_from_name(name: &str) -> EntryPointSelector {\n    let selector = get_selector_from_name(name).unwrap();\n    selector.into_()\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/common/state.rs",
    "content": "use blockifier::state::cached_state::CachedState;\nuse cheatnet::constants::build_testing_state;\nuse cheatnet::forking::state::ForkStateReader;\nuse cheatnet::state::ExtendedStateReader;\nuse shared::test_utils::node_url::node_rpc_url;\nuse starknet_api::block::BlockNumber;\n\npub fn create_cached_state() -> CachedState<ExtendedStateReader> {\n    CachedState::new(ExtendedStateReader {\n        dict_state_reader: build_testing_state(),\n        fork_state_reader: None,\n    })\n}\n\npub fn create_fork_cached_state(cache_dir: &str) -> CachedState<ExtendedStateReader> {\n    create_fork_cached_state_at(54_060, cache_dir)\n}\n\npub fn create_fork_cached_state_at(\n    block_number: u64,\n    cache_dir: &str,\n) -> CachedState<ExtendedStateReader> {\n    let node_url = node_rpc_url();\n    CachedState::new(ExtendedStateReader {\n        dict_state_reader: build_testing_state(),\n        fork_state_reader: Some(\n            ForkStateReader::new(node_url, BlockNumber(block_number), cache_dir.into()).unwrap(),\n        ),\n    })\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/Scarb.toml",
    "content": "[package]\nname = \"cheatnet_testing_contracts\"\nversion = \"0.1.0\"\n# TODO(#4091): Add edition once Scarb version in .tool-versions is at least 2.17\n\n# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest\n[[target.starknet-contract]]\n\n[dependencies]\nstarknet = \"2.4.0\"\n\n[tool.snforge]\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/bytearray_string_panic_call.cairo",
    "content": "use starknet::ContractAddress;\n\n#[starknet::interface]\ntrait IByteArrayPanickingContract<TContractState> {\n    fn do_panic(self: @TContractState);\n    fn do_panic_felts(self: @TContractState, data: Array<felt252>);\n}\n\n#[starknet::contract]\nmod ByteArrayPanickingContract {\n    use core::panics::panic_with_byte_array;\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl Impl of super::IByteArrayPanickingContract<ContractState> {\n        fn do_panic(self: @ContractState) {\n            let data =\n                \"This is a very long\\n and multi line string, that will for sure saturate the pending_word\";\n\n            panic_with_byte_array(@data);\n        }\n\n        fn do_panic_felts(self: @ContractState, data: Array<felt252>) {\n            panic(data);\n        }\n    }\n}\n\n#[starknet::interface]\ntrait IByteArrayPanickingContractProxy<TContractState> {\n    fn call_bytearray_panicking_contract(self: @TContractState, contract_address: ContractAddress);\n    fn call_felts_panicking_contract(\n        self: @TContractState, contract_address: ContractAddress, data: Array<felt252>,\n    );\n}\n\n#[starknet::contract]\nmod ByteArrayPanickingContractProxy {\n    use starknet::ContractAddress;\n    use super::{IByteArrayPanickingContractDispatcher, IByteArrayPanickingContractDispatcherTrait};\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl Impl of super::IByteArrayPanickingContractProxy<ContractState> {\n        fn call_bytearray_panicking_contract(\n            self: @ContractState, contract_address: ContractAddress,\n        ) {\n            IByteArrayPanickingContractDispatcher { contract_address }.do_panic();\n        }\n\n        fn call_felts_panicking_contract(\n            self: @ContractState, contract_address: ContractAddress, data: Array<felt252>,\n        ) {\n            IByteArrayPanickingContractDispatcher { contract_address }.do_panic_felts(data);\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_block_hash/checker.cairo",
    "content": "#[starknet::interface]\ntrait ICheatBlockHashChecker<TContractState> {\n    fn get_block_hash(ref self: TContractState, block_number: u64) -> felt252;\n}\n\n#[starknet::contract]\nmod CheatBlockHashChecker {\n    use core::starknet::SyscallResultTrait;\n    use starknet::syscalls::get_block_hash_syscall;\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl CheatBlockHashChecker of super::ICheatBlockHashChecker<ContractState> {\n        fn get_block_hash(ref self: ContractState, block_number: u64) -> felt252 {\n            let block_hash = get_block_hash_syscall(block_number).unwrap_syscall();\n\n            block_hash\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_block_hash/checker_library_call.cairo",
    "content": "use starknet::ClassHash;\n\n#[starknet::interface]\ntrait ICheatBlockHashChecker<TContractState> {\n    fn get_block_hash(ref self: TContractState, block_number: u64) -> felt252;\n}\n\n#[starknet::interface]\ntrait ICheatBlockHashCheckerLibCall<TContractState> {\n    fn get_block_hash_with_lib_call(\n        ref self: TContractState, class_hash: ClassHash, block_number: u64,\n    ) -> felt252;\n    fn get_block_hash(ref self: TContractState, block_number: u64) -> felt252;\n}\n\n#[starknet::contract]\nmod CheatBlockHashCheckerLibCall {\n    use core::starknet::SyscallResultTrait;\n    use starknet::ClassHash;\n    use starknet::syscalls::get_block_hash_syscall;\n    use super::{ICheatBlockHashCheckerDispatcherTrait, ICheatBlockHashCheckerLibraryDispatcher};\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl ICheatBlockHashCheckerLibCall of super::ICheatBlockHashCheckerLibCall<ContractState> {\n        fn get_block_hash_with_lib_call(\n            ref self: ContractState, class_hash: ClassHash, block_number: u64,\n        ) -> felt252 {\n            let cheat_block_hash_checker = ICheatBlockHashCheckerLibraryDispatcher { class_hash };\n            cheat_block_hash_checker.get_block_hash(block_number)\n        }\n\n        fn get_block_hash(ref self: ContractState, block_number: u64) -> felt252 {\n            let block_hash = get_block_hash_syscall(block_number).unwrap_syscall();\n\n            block_hash\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_block_hash/checker_meta_tx_v0.cairo",
    "content": "#[starknet::interface]\ntrait ICheatBlockHashCheckerMetaTxV0<TContractState> {\n    fn __execute__(ref self: TContractState, block_number: u64) -> felt252;\n}\n\n#[starknet::contract(account)]\nmod CheatBlockHashCheckerMetaTxV0 {\n    use starknet::SyscallResultTrait;\n    use starknet::syscalls::get_block_hash_syscall;\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl ICheatBlockHashCheckerMetaTxV0 of super::ICheatBlockHashCheckerMetaTxV0<ContractState> {\n        fn __execute__(ref self: ContractState, block_number: u64) -> felt252 {\n            let block_hash = get_block_hash_syscall(block_number).unwrap_syscall();\n\n            block_hash\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_block_hash/checker_proxy.cairo",
    "content": "use starknet::ContractAddress;\n\n#[starknet::interface]\ntrait ICheatBlockHashChecker<TContractState> {\n    fn get_block_hash(ref self: TContractState, block_number: u64) -> felt252;\n}\n\n#[starknet::interface]\ntrait ICheatBlockHashCheckerProxy<TContractState> {\n    fn get_cheated_block_hash(\n        self: @TContractState, address: ContractAddress, block_number: u64,\n    ) -> felt252;\n    fn get_block_hash(self: @TContractState, block_number: u64) -> felt252;\n    fn call_proxy(\n        self: @TContractState, address: ContractAddress, block_number: u64,\n    ) -> (felt252, felt252);\n}\n\n#[starknet::contract]\nmod CheatBlockHashCheckerProxy {\n    use starknet::syscalls::get_block_hash_syscall;\n    use starknet::{ContractAddress, SyscallResultTrait, get_contract_address};\n    use super::{\n        ICheatBlockHashCheckerDispatcher, ICheatBlockHashCheckerDispatcherTrait,\n        ICheatBlockHashCheckerProxyDispatcher, ICheatBlockHashCheckerProxyDispatcherTrait,\n    };\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl ICheatBlockHashCheckerProxy of super::ICheatBlockHashCheckerProxy<ContractState> {\n        fn get_cheated_block_hash(\n            self: @ContractState, address: ContractAddress, block_number: u64,\n        ) -> felt252 {\n            let cheat_block_hash_checker = ICheatBlockHashCheckerDispatcher {\n                contract_address: address,\n            };\n            cheat_block_hash_checker.get_block_hash(block_number)\n        }\n\n        fn get_block_hash(self: @ContractState, block_number: u64) -> felt252 {\n            let block_hash = get_block_hash_syscall(block_number).unwrap_syscall();\n\n            block_hash\n        }\n\n        fn call_proxy(\n            self: @ContractState, address: ContractAddress, block_number: u64,\n        ) -> (felt252, felt252) {\n            let dispatcher = ICheatBlockHashCheckerProxyDispatcher { contract_address: address };\n            let hash = self.get_block_hash(block_number);\n            let res = dispatcher.get_cheated_block_hash(get_contract_address(), block_number);\n            (hash, res)\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_block_hash/constructor_checker.cairo",
    "content": "#[starknet::interface]\ntrait IConstructorCheatBlockHashChecker<TContractState> {\n    fn get_stored_block_hash(ref self: TContractState) -> felt252;\n    fn get_block_hash(ref self: TContractState, block_number: u64) -> felt252;\n}\n\n#[starknet::contract]\nmod ConstructorCheatBlockHashChecker {\n    use starknet::SyscallResultTrait;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n    use starknet::syscalls::get_block_hash_syscall;\n\n    #[storage]\n    struct Storage {\n        blk_hash: felt252,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState, block_number: u64) {\n        let blk_hash = get_block_hash_syscall(block_number).unwrap_syscall();\n        self.blk_hash.write(blk_hash);\n    }\n\n    #[abi(embed_v0)]\n    impl IConstructorCheatBlockHashChecker of super::IConstructorCheatBlockHashChecker<\n        ContractState,\n    > {\n        fn get_stored_block_hash(ref self: ContractState) -> felt252 {\n            self.blk_hash.read()\n        }\n\n        fn get_block_hash(ref self: ContractState, block_number: u64) -> felt252 {\n            let block_hash = get_block_hash_syscall(block_number).unwrap_syscall();\n\n            block_hash\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_block_hash.cairo",
    "content": "mod checker;\nmod checker_library_call;\nmod checker_meta_tx_v0;\nmod checker_proxy;\nmod constructor_checker;\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_block_number/checker.cairo",
    "content": "#[starknet::interface]\ntrait ICheatBlockNumberChecker<TContractState> {\n    fn get_block_number(ref self: TContractState) -> u64;\n    fn get_block_number_and_emit_event(ref self: TContractState) -> u64;\n}\n\n#[starknet::contract]\nmod CheatBlockNumberChecker {\n    use core::box::BoxTrait;\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    enum Event {\n        BlockNumberEmitted: BlockNumberEmitted,\n    }\n\n    #[derive(Drop, starknet::Event)]\n    struct BlockNumberEmitted {\n        block_number: u64,\n    }\n\n    #[abi(embed_v0)]\n    impl ICheatBlockNumberChecker of super::ICheatBlockNumberChecker<ContractState> {\n        fn get_block_number(ref self: ContractState) -> u64 {\n            starknet::get_block_info().unbox().block_number\n        }\n\n        fn get_block_number_and_emit_event(ref self: ContractState) -> u64 {\n            let block_number = starknet::get_block_info().unbox().block_number;\n            self.emit(Event::BlockNumberEmitted(BlockNumberEmitted { block_number }));\n            block_number\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_block_number/checker_library_call.cairo",
    "content": "use starknet::ClassHash;\n\n#[starknet::interface]\ntrait ICheatBlockNumberChecker<TContractState> {\n    fn get_block_number(ref self: TContractState) -> u64;\n}\n\n#[starknet::interface]\ntrait ICheatBlockNumberCheckerLibCall<TContractState> {\n    fn get_block_number_with_lib_call(ref self: TContractState, class_hash: ClassHash) -> u64;\n    fn get_block_number(ref self: TContractState) -> u64;\n}\n\n#[starknet::contract]\nmod CheatBlockNumberCheckerLibCall {\n    use starknet::ClassHash;\n    use super::{ICheatBlockNumberCheckerDispatcherTrait, ICheatBlockNumberCheckerLibraryDispatcher};\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl ICheatBlockNumberCheckerLibCall of super::ICheatBlockNumberCheckerLibCall<ContractState> {\n        fn get_block_number_with_lib_call(ref self: ContractState, class_hash: ClassHash) -> u64 {\n            let cheat_block_number_checker = ICheatBlockNumberCheckerLibraryDispatcher {\n                class_hash,\n            };\n            cheat_block_number_checker.get_block_number()\n        }\n\n        fn get_block_number(ref self: ContractState) -> u64 {\n            starknet::get_block_info().unbox().block_number\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_block_number/checker_meta_tx_v0.cairo",
    "content": "#[starknet::interface]\ntrait ICheatBlockNumberCheckerMetaTxV0<TContractState> {\n    fn __execute__(ref self: TContractState) -> felt252;\n}\n\n#[starknet::contract(account)]\nmod CheatBlockNumberCheckerMetaTxV0 {\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl ICheatBlockNumberCheckerMetaTxV0 of super::ICheatBlockNumberCheckerMetaTxV0<\n        ContractState,\n    > {\n        fn __execute__(ref self: ContractState) -> felt252 {\n            let block_number = starknet::get_block_number();\n            block_number.into()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_block_number/checker_proxy.cairo",
    "content": "use starknet::ContractAddress;\n\n#[starknet::interface]\ntrait ICheatBlockNumberChecker<TContractState> {\n    fn get_block_number(self: @TContractState) -> u64;\n}\n\n#[starknet::interface]\ntrait ICheatBlockNumberCheckerProxy<TContractState> {\n    fn get_cheated_block_number(self: @TContractState, address: ContractAddress) -> u64;\n    fn get_block_number(self: @TContractState) -> u64;\n    fn call_proxy(self: @TContractState, address: ContractAddress) -> (u64, u64);\n}\n\n#[starknet::contract]\nmod CheatBlockNumberCheckerProxy {\n    use starknet::{ContractAddress, get_contract_address};\n    use super::{\n        ICheatBlockNumberCheckerDispatcher, ICheatBlockNumberCheckerDispatcherTrait,\n        ICheatBlockNumberCheckerProxyDispatcher, ICheatBlockNumberCheckerProxyDispatcherTrait,\n    };\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl ICheatBlockNumberCheckerProxy of super::ICheatBlockNumberCheckerProxy<ContractState> {\n        fn get_cheated_block_number(self: @ContractState, address: ContractAddress) -> u64 {\n            let cheat_block_number_checker = ICheatBlockNumberCheckerDispatcher {\n                contract_address: address,\n            };\n            cheat_block_number_checker.get_block_number()\n        }\n\n        fn get_block_number(self: @ContractState) -> u64 {\n            starknet::get_block_info().unbox().block_number\n        }\n\n        fn call_proxy(self: @ContractState, address: ContractAddress) -> (u64, u64) {\n            let dispatcher = ICheatBlockNumberCheckerProxyDispatcher { contract_address: address };\n            let block_number = self.get_block_number();\n            let res = dispatcher.get_cheated_block_number(get_contract_address());\n            (block_number, res)\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_block_number/constructor_checker.cairo",
    "content": "#[starknet::interface]\ntrait IConstructorCheatBlockNumberChecker<TContractState> {\n    fn get_stored_block_number(ref self: TContractState) -> u64;\n    fn get_block_number(ref self: TContractState) -> u64;\n}\n\n#[starknet::contract]\nmod ConstructorCheatBlockNumberChecker {\n    use core::box::BoxTrait;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        blk_nb: u64,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState) {\n        let block_numb = starknet::get_block_info().unbox().block_number;\n        self.blk_nb.write(block_numb);\n    }\n\n    #[abi(embed_v0)]\n    impl IConstructorCheatBlockNumberChecker of super::IConstructorCheatBlockNumberChecker<\n        ContractState,\n    > {\n        fn get_stored_block_number(ref self: ContractState) -> u64 {\n            self.blk_nb.read()\n        }\n\n        fn get_block_number(ref self: ContractState) -> u64 {\n            starknet::get_block_info().unbox().block_number\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_block_number.cairo",
    "content": "mod checker;\nmod checker_library_call;\nmod checker_meta_tx_v0;\nmod checker_proxy;\nmod constructor_checker;\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_block_timestamp/checker.cairo",
    "content": "#[starknet::interface]\ntrait ICheatBlockTimestampChecker<TContractState> {\n    fn get_block_timestamp(ref self: TContractState) -> u64;\n    fn get_block_timestamp_and_emit_event(ref self: TContractState) -> u64;\n    fn get_block_timestamp_and_number(ref self: TContractState) -> (u64, u64);\n}\n\n#[starknet::contract]\nmod CheatBlockTimestampChecker {\n    use core::box::BoxTrait;\n\n    #[storage]\n    struct Storage {}\n\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    enum Event {\n        BlockTimestampEmitted: BlockTimestampEmitted,\n    }\n\n    #[derive(Drop, starknet::Event)]\n    struct BlockTimestampEmitted {\n        block_timestamp: u64,\n    }\n\n\n    #[abi(embed_v0)]\n    impl CheatBlockTimestampChecker of super::ICheatBlockTimestampChecker<ContractState> {\n        fn get_block_timestamp(ref self: ContractState) -> u64 {\n            starknet::get_block_info().unbox().block_timestamp\n        }\n\n        fn get_block_timestamp_and_emit_event(ref self: ContractState) -> u64 {\n            let block_timestamp = starknet::get_block_info().unbox().block_timestamp;\n            self.emit(Event::BlockTimestampEmitted(BlockTimestampEmitted { block_timestamp }));\n            block_timestamp\n        }\n\n        fn get_block_timestamp_and_number(ref self: ContractState) -> (u64, u64) {\n            let block_info = starknet::get_block_info().unbox();\n\n            (block_info.block_timestamp, block_info.block_number)\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_block_timestamp/checker_library_call.cairo",
    "content": "use starknet::ClassHash;\n\n#[starknet::interface]\ntrait ICheatBlockTimestampChecker<TContractState> {\n    fn get_block_timestamp(ref self: TContractState) -> u64;\n}\n\n#[starknet::interface]\ntrait ICheatBlockTimestampCheckerLibCall<TContractState> {\n    fn get_block_timestamp_with_lib_call(ref self: TContractState, class_hash: ClassHash) -> u64;\n    fn get_block_timestamp(ref self: TContractState) -> u64;\n}\n\n#[starknet::contract]\nmod CheatBlockTimestampCheckerLibCall {\n    use starknet::ClassHash;\n    use super::{\n        ICheatBlockTimestampCheckerDispatcherTrait, ICheatBlockTimestampCheckerLibraryDispatcher,\n    };\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl ICheatBlockTimestampCheckerLibCall of super::ICheatBlockTimestampCheckerLibCall<\n        ContractState,\n    > {\n        fn get_block_timestamp_with_lib_call(\n            ref self: ContractState, class_hash: ClassHash,\n        ) -> u64 {\n            let cheat_block_timestamp_checker = ICheatBlockTimestampCheckerLibraryDispatcher {\n                class_hash,\n            };\n            cheat_block_timestamp_checker.get_block_timestamp()\n        }\n\n        fn get_block_timestamp(ref self: ContractState) -> u64 {\n            starknet::get_block_info().unbox().block_timestamp\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_block_timestamp/checker_meta_tx_v0.cairo",
    "content": "#[starknet::interface]\ntrait ICheatBlockTimestampCheckerMetaTxV0<TContractState> {\n    fn __execute__(ref self: TContractState) -> felt252;\n}\n\n#[starknet::contract(account)]\nmod CheatBlockTimestampCheckerMetaTxV0 {\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl ICheatBlockTimestampCheckerMetaTxV0 of super::ICheatBlockTimestampCheckerMetaTxV0<\n        ContractState,\n    > {\n        fn __execute__(ref self: ContractState) -> felt252 {\n            let block_timestamp = starknet::get_block_timestamp();\n            block_timestamp.into()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_block_timestamp/checker_proxy.cairo",
    "content": "use starknet::ContractAddress;\n\n#[starknet::interface]\ntrait ICheatBlockTimestampChecker<TContractState> {\n    fn get_block_timestamp(self: @TContractState) -> u64;\n}\n\n#[starknet::interface]\ntrait ICheatBlockTimestampCheckerProxy<TContractState> {\n    fn get_cheated_block_timestamp(self: @TContractState, address: ContractAddress) -> u64;\n    fn get_block_timestamp(self: @TContractState) -> u64;\n    fn call_proxy(self: @TContractState, address: ContractAddress) -> (u64, u64);\n}\n\n#[starknet::contract]\nmod CheatBlockTimestampCheckerProxy {\n    use starknet::{ContractAddress, get_contract_address};\n    use super::{\n        ICheatBlockTimestampCheckerDispatcher, ICheatBlockTimestampCheckerDispatcherTrait,\n        ICheatBlockTimestampCheckerProxyDispatcher, ICheatBlockTimestampCheckerProxyDispatcherTrait,\n    };\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl ICheatBlockTimestampCheckerProxy of super::ICheatBlockTimestampCheckerProxy<\n        ContractState,\n    > {\n        fn get_cheated_block_timestamp(self: @ContractState, address: ContractAddress) -> u64 {\n            let cheat_block_timestamp_checker = ICheatBlockTimestampCheckerDispatcher {\n                contract_address: address,\n            };\n            cheat_block_timestamp_checker.get_block_timestamp()\n        }\n\n        fn get_block_timestamp(self: @ContractState) -> u64 {\n            starknet::get_block_info().unbox().block_timestamp\n        }\n\n        fn call_proxy(self: @ContractState, address: ContractAddress) -> (u64, u64) {\n            let dispatcher = ICheatBlockTimestampCheckerProxyDispatcher {\n                contract_address: address,\n            };\n            let timestamp = self.get_block_timestamp();\n            let res = dispatcher.get_cheated_block_timestamp(get_contract_address());\n            (timestamp, res)\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_block_timestamp/constructor_checker.cairo",
    "content": "#[starknet::interface]\ntrait IConstructorCheatBlockTimestampChecker<TContractState> {\n    fn get_stored_block_timestamp(ref self: TContractState) -> u64;\n    fn get_block_timestamp(ref self: TContractState) -> u64;\n}\n\n#[starknet::contract]\nmod ConstructorCheatBlockTimestampChecker {\n    use core::box::BoxTrait;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        blk_timestamp: u64,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState) {\n        let blk_timestamp = starknet::get_block_info().unbox().block_timestamp;\n        self.blk_timestamp.write(blk_timestamp);\n    }\n\n    #[abi(embed_v0)]\n    impl IConstructorCheatBlockTimestampChecker of super::IConstructorCheatBlockTimestampChecker<\n        ContractState,\n    > {\n        fn get_stored_block_timestamp(ref self: ContractState) -> u64 {\n            self.blk_timestamp.read()\n        }\n\n        fn get_block_timestamp(ref self: ContractState) -> u64 {\n            starknet::get_block_info().unbox().block_timestamp\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_block_timestamp.cairo",
    "content": "mod checker;\nmod checker_library_call;\nmod checker_meta_tx_v0;\nmod checker_proxy;\nmod constructor_checker;\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_caller_address/checker.cairo",
    "content": "#[starknet::interface]\ntrait ICheatCallerAddressChecker<TContractState> {\n    fn get_caller_address(ref self: TContractState) -> felt252;\n    fn get_caller_address_and_emit_event(ref self: TContractState) -> felt252;\n}\n\n#[starknet::contract]\nmod CheatCallerAddressChecker {\n    use core::option::Option;\n    use core::traits::Into;\n\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    enum Event {\n        CallerAddressEmitted: CallerAddressEmitted,\n    }\n\n    #[derive(Drop, starknet::Event)]\n    struct CallerAddressEmitted {\n        caller_address: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl ICheatCallerAddressChecker of super::ICheatCallerAddressChecker<ContractState> {\n        fn get_caller_address(ref self: ContractState) -> felt252 {\n            starknet::get_caller_address().into()\n        }\n\n        fn get_caller_address_and_emit_event(ref self: ContractState) -> felt252 {\n            let caller_address = starknet::get_caller_address().into();\n            self.emit(Event::CallerAddressEmitted(CallerAddressEmitted { caller_address }));\n            caller_address\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_caller_address/checker_cairo0.cairo",
    "content": "use starknet::ContractAddress;\n\n#[starknet::interface]\ntrait ICairo1Contract<TContractState> {\n    fn start(\n        ref self: TContractState,\n        cairo0_address: ContractAddress,\n        expected_caller_address: ContractAddress,\n    );\n    fn end(ref self: TContractState);\n}\n\n// 0x18783f6c124c3acc504f300cb6b3a33def439681744d027be8d7fd5d3551565\n#[starknet::interface]\ntrait ICairo0Contract<TContractState> {\n    // this function only job is to call `ICairo1Contract::end()`\n    // `contract_address` is `Cairo1Contract_v1` address\n    fn callback(ref self: TContractState, contract_address: felt252);\n}\n\n#[starknet::contract]\nmod Cairo1Contract_v1 {\n    use core::traits::Into;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n    use starknet::{ContractAddress, get_caller_address, get_contract_address};\n    use super::ICairo0ContractDispatcherTrait;\n\n    #[storage]\n    struct Storage {\n        expected_caller_address: ContractAddress,\n    }\n\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    enum Event {\n        End: EndCalled,\n    }\n\n    #[derive(Drop, starknet::Event)]\n    struct EndCalled {\n        expected_caller_address: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl ICairo1ContractImpl of super::ICairo1Contract<ContractState> {\n        fn start(\n            ref self: ContractState,\n            cairo0_address: ContractAddress,\n            expected_caller_address: ContractAddress,\n        ) {\n            let contract_address = get_contract_address();\n\n            let cairo0_contract = super::ICairo0ContractDispatcher {\n                contract_address: cairo0_address,\n            };\n\n            self.expected_caller_address.write(expected_caller_address);\n\n            assert(expected_caller_address == get_caller_address(), 'address should be cheated');\n\n            cairo0_contract.callback(contract_address.into());\n\n            assert(expected_caller_address == get_caller_address(), 'address should be cheated');\n        }\n\n        fn end(ref self: ContractState) {\n            let expected_caller_address = self.expected_caller_address.read();\n\n            assert(expected_caller_address == get_caller_address(), 'should be same');\n\n            self\n                .emit(\n                    Event::End(\n                        EndCalled { expected_caller_address: expected_caller_address.into() },\n                    ),\n                );\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_caller_address/checker_library_call.cairo",
    "content": "use starknet::ClassHash;\n\n#[starknet::interface]\ntrait ICheatCallerAddressChecker<TContractState> {\n    fn get_caller_address(ref self: TContractState) -> felt252;\n}\n\n#[starknet::interface]\ntrait ICheatCallerAddressCheckerLibCall<TContractState> {\n    fn get_caller_address_with_lib_call(ref self: TContractState, class_hash: ClassHash) -> felt252;\n    fn get_caller_address(ref self: TContractState) -> felt252;\n}\n\n#[starknet::contract]\nmod CheatCallerAddressCheckerLibCall {\n    use starknet::ClassHash;\n    use super::{\n        ICheatCallerAddressCheckerDispatcherTrait, ICheatCallerAddressCheckerLibraryDispatcher,\n    };\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl ICheatCallerAddressCheckerLibCall of super::ICheatCallerAddressCheckerLibCall<\n        ContractState,\n    > {\n        fn get_caller_address_with_lib_call(\n            ref self: ContractState, class_hash: ClassHash,\n        ) -> felt252 {\n            let cheat_caller_address_checker = ICheatCallerAddressCheckerLibraryDispatcher {\n                class_hash,\n            };\n            cheat_caller_address_checker.get_caller_address()\n        }\n\n        fn get_caller_address(ref self: ContractState) -> felt252 {\n            starknet::get_caller_address().into()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_caller_address/checker_meta_tx_v0.cairo",
    "content": "#[starknet::interface]\ntrait ICheatCallerAddressCheckerMetaTxV0<TContractState> {\n    fn __execute__(ref self: TContractState) -> felt252;\n}\n\n#[starknet::contract(account)]\nmod CheatCallerAddressCheckerMetaTxV0 {\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl ICheatCallerAddressCheckerMetaTxV0 of super::ICheatCallerAddressCheckerMetaTxV0<\n        ContractState,\n    > {\n        fn __execute__(ref self: ContractState) -> felt252 {\n            starknet::get_caller_address().into()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_caller_address/checker_proxy.cairo",
    "content": "use starknet::ContractAddress;\n\n#[starknet::interface]\ntrait ICheatCallerAddressChecker<TContractState> {\n    fn get_caller_address(self: @TContractState) -> felt252;\n    fn get_caller_address_and_emit_event(self: @TContractState) -> felt252;\n}\n\n#[starknet::interface]\ntrait ICheatCallerAddressCheckerProxy<TContractState> {\n    fn get_cheated_caller_address(self: @TContractState, address: ContractAddress) -> felt252;\n    fn get_caller_address(self: @TContractState) -> felt252;\n    fn call_proxy(self: @TContractState, address: ContractAddress) -> (felt252, felt252);\n}\n\n#[starknet::contract]\nmod CheatCallerAddressCheckerProxy {\n    use starknet::{ContractAddress, get_caller_address, get_contract_address};\n    use super::{\n        ICheatCallerAddressCheckerDispatcher, ICheatCallerAddressCheckerDispatcherTrait,\n        ICheatCallerAddressCheckerProxyDispatcher, ICheatCallerAddressCheckerProxyDispatcherTrait,\n    };\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl ICheatCallerAddressCheckerProxy of super::ICheatCallerAddressCheckerProxy<ContractState> {\n        fn get_cheated_caller_address(self: @ContractState, address: ContractAddress) -> felt252 {\n            let cheat_caller_address_checker = ICheatCallerAddressCheckerDispatcher {\n                contract_address: address,\n            };\n            cheat_caller_address_checker.get_caller_address()\n        }\n\n        fn get_caller_address(self: @ContractState) -> felt252 {\n            starknet::get_caller_address().into()\n        }\n\n        fn call_proxy(self: @ContractState, address: ContractAddress) -> (felt252, felt252) {\n            let dispatcher = ICheatCallerAddressCheckerProxyDispatcher {\n                contract_address: address,\n            };\n            let caller_address: felt252 = get_caller_address().into();\n            let res = dispatcher.get_cheated_caller_address(get_contract_address());\n            (caller_address, res)\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_caller_address/constructor_checker.cairo",
    "content": "use starknet::ContractAddress;\n\n#[starknet::interface]\ntrait IConstructorCheatCallerAddressChecker<TContractState> {\n    fn get_stored_caller_address(ref self: TContractState) -> ContractAddress;\n    fn get_caller_address(ref self: TContractState) -> felt252;\n}\n\n#[starknet::contract]\nmod ConstructorCheatCallerAddressChecker {\n    use starknet::ContractAddress;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        caller_address: ContractAddress,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState) {\n        let address = starknet::get_caller_address();\n        self.caller_address.write(address);\n    }\n\n    #[abi(embed_v0)]\n    impl IConstructorCheatCallerAddressChecker of super::IConstructorCheatCallerAddressChecker<\n        ContractState,\n    > {\n        fn get_stored_caller_address(ref self: ContractState) -> ContractAddress {\n            self.caller_address.read()\n        }\n\n        fn get_caller_address(ref self: ContractState) -> felt252 {\n            starknet::get_caller_address().into()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_caller_address.cairo",
    "content": "mod checker;\nmod checker_cairo0;\nmod checker_library_call;\nmod checker_meta_tx_v0;\nmod checker_proxy;\nmod constructor_checker;\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_sequencer_address/checker.cairo",
    "content": "use starknet::ContractAddress;\n\n#[starknet::interface]\ntrait ICheatSequencerAddressChecker<TContractState> {\n    fn get_sequencer_address(ref self: TContractState) -> ContractAddress;\n    fn get_seq_addr_and_emit_event(ref self: TContractState) -> ContractAddress;\n}\n\n#[starknet::contract]\nmod CheatSequencerAddressChecker {\n    use starknet::ContractAddress;\n\n    #[storage]\n    struct Storage {}\n\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    enum Event {\n        SequencerAddressEmitted: SequencerAddressEmitted,\n    }\n\n    #[derive(Drop, starknet::Event)]\n    struct SequencerAddressEmitted {\n        sequencer_address: ContractAddress,\n    }\n\n    #[abi(embed_v0)]\n    impl ICheatSequencerAddressChecker of super::ICheatSequencerAddressChecker<ContractState> {\n        fn get_sequencer_address(ref self: ContractState) -> ContractAddress {\n            starknet::get_block_info().unbox().sequencer_address\n        }\n\n        fn get_seq_addr_and_emit_event(ref self: ContractState) -> ContractAddress {\n            let sequencer_address = starknet::get_block_info().unbox().sequencer_address;\n            self\n                .emit(\n                    Event::SequencerAddressEmitted(SequencerAddressEmitted { sequencer_address }),\n                );\n            sequencer_address\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_sequencer_address/checker_library_call.cairo",
    "content": "use starknet::{ClassHash, ContractAddress};\n\n#[starknet::interface]\ntrait ICheatSequencerAddressChecker<TContractState> {\n    fn get_sequencer_address(self: @TContractState) -> ContractAddress;\n}\n\n#[starknet::interface]\ntrait ICheatSequencerAddressCheckerLibCall<TContractState> {\n    fn get_sequencer_address_with_lib_call(\n        self: @TContractState, class_hash: ClassHash,\n    ) -> ContractAddress;\n    fn get_sequencer_address(self: @TContractState) -> ContractAddress;\n}\n\n#[starknet::contract]\nmod CheatSequencerAddressCheckerLibCall {\n    use starknet::{ClassHash, ContractAddress};\n    use super::{\n        ICheatSequencerAddressCheckerDispatcherTrait,\n        ICheatSequencerAddressCheckerLibraryDispatcher,\n    };\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl ICheatSequencerAddressCheckerLibCall of super::ICheatSequencerAddressCheckerLibCall<\n        ContractState,\n    > {\n        fn get_sequencer_address_with_lib_call(\n            self: @ContractState, class_hash: ClassHash,\n        ) -> ContractAddress {\n            let sequencer_address_checker = ICheatSequencerAddressCheckerLibraryDispatcher {\n                class_hash,\n            };\n            sequencer_address_checker.get_sequencer_address()\n        }\n\n        fn get_sequencer_address(self: @ContractState) -> ContractAddress {\n            starknet::get_block_info().unbox().sequencer_address\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_sequencer_address/checker_meta_tx_v0.cairo",
    "content": "#[starknet::interface]\ntrait ICheatSequencerAddressCheckerMetaTxV0<TContractState> {\n    fn __execute__(ref self: TContractState) -> felt252;\n}\n\n#[starknet::contract(account)]\nmod CheatSequencerAddressCheckerMetaTxV0 {\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl ICheatSequencerAddressCheckerMetaTxV0 of super::ICheatSequencerAddressCheckerMetaTxV0<\n        ContractState,\n    > {\n        fn __execute__(ref self: ContractState) -> felt252 {\n            let sequencer_address = starknet::get_block_info().unbox().sequencer_address;\n            sequencer_address.into()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_sequencer_address/checker_proxy.cairo",
    "content": "use starknet::ContractAddress;\n\n#[starknet::interface]\ntrait ICheatSequencerAddressChecker<TContractState> {\n    fn get_sequencer_address(self: @TContractState) -> ContractAddress;\n}\n\n#[starknet::interface]\ntrait ICheatSequencerAddressCheckerProxy<TContractState> {\n    fn get_cheated_sequencer_address(\n        self: @TContractState, address: ContractAddress,\n    ) -> ContractAddress;\n    fn get_sequencer_address(self: @TContractState) -> ContractAddress;\n    fn call_proxy(\n        self: @TContractState, address: ContractAddress,\n    ) -> (ContractAddress, ContractAddress);\n}\n\n#[starknet::contract]\nmod CheatSequencerAddressCheckerProxy {\n    use starknet::{ContractAddress, get_contract_address};\n    use super::{\n        ICheatSequencerAddressCheckerDispatcher, ICheatSequencerAddressCheckerDispatcherTrait,\n        ICheatSequencerAddressCheckerProxyDispatcher,\n        ICheatSequencerAddressCheckerProxyDispatcherTrait,\n    };\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl ICheatSequencerAddressCheckerProxy of super::ICheatSequencerAddressCheckerProxy<\n        ContractState,\n    > {\n        fn get_cheated_sequencer_address(\n            self: @ContractState, address: ContractAddress,\n        ) -> ContractAddress {\n            let sequencer_address_checker = ICheatSequencerAddressCheckerDispatcher {\n                contract_address: address,\n            };\n            sequencer_address_checker.get_sequencer_address()\n        }\n\n        fn get_sequencer_address(self: @ContractState) -> ContractAddress {\n            starknet::get_block_info().unbox().sequencer_address\n        }\n\n        fn call_proxy(\n            self: @ContractState, address: ContractAddress,\n        ) -> (ContractAddress, ContractAddress) {\n            let dispatcher = ICheatSequencerAddressCheckerProxyDispatcher {\n                contract_address: address,\n            };\n            let sequencer_address = self.get_sequencer_address();\n            let res = dispatcher.get_cheated_sequencer_address(get_contract_address());\n            (sequencer_address, res)\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_sequencer_address/constructor_checker.cairo",
    "content": "use starknet::ContractAddress;\n\n#[starknet::interface]\ntrait IConstructorCheatSequencerAddressChecker<TContractState> {\n    fn get_stored_sequencer_address(ref self: TContractState) -> ContractAddress;\n    fn get_sequencer_address(self: @TContractState) -> ContractAddress;\n}\n\n#[starknet::contract]\nmod ConstructorCheatSequencerAddressChecker {\n    use core::box::BoxTrait;\n    use starknet::ContractAddress;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        seq_addr: ContractAddress,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState) {\n        let sequencer_address = starknet::get_block_info().unbox().sequencer_address;\n        self.seq_addr.write(sequencer_address);\n    }\n\n    #[abi(embed_v0)]\n    impl IConstructorCheatSequencerAddressChecker of super::IConstructorCheatSequencerAddressChecker<\n        ContractState,\n    > {\n        fn get_stored_sequencer_address(ref self: ContractState) -> ContractAddress {\n            self.seq_addr.read()\n        }\n\n        fn get_sequencer_address(self: @ContractState) -> ContractAddress {\n            starknet::get_block_info().unbox().sequencer_address\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_sequencer_address.cairo",
    "content": "mod checker;\nmod checker_library_call;\nmod checker_meta_tx_v0;\nmod checker_proxy;\nmod constructor_checker;\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_tx_info/constructor_tx_hash_checker.cairo",
    "content": "#[starknet::interface]\ntrait ITxHashChecker<TContractState> {\n    fn get_stored_tx_hash(self: @TContractState) -> felt252;\n    fn get_transaction_hash(self: @TContractState) -> felt252;\n}\n\n#[starknet::contract]\nmod TxHashChecker {\n    use core::box::BoxTrait;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        stored_tx_hash: felt252,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState) {\n        let tx_hash = starknet::get_tx_info().unbox().transaction_hash;\n        self.stored_tx_hash.write(tx_hash);\n    }\n\n    #[abi(embed_v0)]\n    impl ITxHashChecker of super::ITxHashChecker<ContractState> {\n        fn get_stored_tx_hash(self: @ContractState) -> felt252 {\n            self.stored_tx_hash.read()\n        }\n\n        fn get_transaction_hash(self: @ContractState) -> felt252 {\n            starknet::get_tx_info().unbox().transaction_hash\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_tx_info/tx_hash_checker_proxy.cairo",
    "content": "use starknet::ContractAddress;\n\n#[starknet::interface]\ntrait ICheatTxInfoChecker<TContractState> {\n    fn get_transaction_hash(self: @TContractState) -> felt252;\n}\n\n\n#[starknet::interface]\ntrait ITxHashCheckerProxy<TContractState> {\n    fn get_checkers_tx_hash(self: @TContractState, address: ContractAddress) -> felt252;\n    fn get_transaction_hash(self: @TContractState) -> felt252;\n    fn call_proxy(self: @TContractState, address: ContractAddress) -> (felt252, felt252);\n}\n\n#[starknet::contract]\nmod TxHashCheckerProxy {\n    use starknet::{ContractAddress, get_contract_address};\n    use super::{\n        ICheatTxInfoCheckerDispatcher, ICheatTxInfoCheckerDispatcherTrait,\n        ITxHashCheckerProxyDispatcher, ITxHashCheckerProxyDispatcherTrait,\n    };\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl ITxHashCheckerProxy of super::ITxHashCheckerProxy<ContractState> {\n        fn get_checkers_tx_hash(self: @ContractState, address: ContractAddress) -> felt252 {\n            let tx_info_checker = ICheatTxInfoCheckerDispatcher { contract_address: address };\n            tx_info_checker.get_transaction_hash()\n        }\n\n        fn get_transaction_hash(self: @ContractState) -> felt252 {\n            starknet::get_tx_info().unbox().transaction_hash\n        }\n\n        fn call_proxy(self: @ContractState, address: ContractAddress) -> (felt252, felt252) {\n            let dispatcher = ITxHashCheckerProxyDispatcher { contract_address: address };\n            let tx_hash = self.get_transaction_hash();\n            let res = dispatcher.get_checkers_tx_hash(get_contract_address());\n            (tx_hash, res)\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_tx_info/tx_info_checker.cairo",
    "content": "use starknet::ContractAddress;\n\n#[starknet::interface]\ntrait ICheatTxInfoChecker<TContractState> {\n    fn get_account_contract_address(ref self: TContractState) -> ContractAddress;\n    fn get_transaction_hash(self: @TContractState) -> felt252;\n    fn get_tx_hash_and_emit_event(ref self: TContractState) -> felt252;\n    fn get_tx_info(self: @TContractState) -> starknet::info::v3::TxInfo;\n}\n\n#[starknet::contract]\nmod CheatTxInfoChecker {\n    use starknet::syscalls::get_execution_info_v3_syscall;\n    use starknet::{ContractAddress, SyscallResultTrait, get_tx_info};\n\n    #[storage]\n    struct Storage {}\n\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    enum Event {\n        TxHashEmitted: TxHashEmitted,\n    }\n\n    #[derive(Drop, starknet::Event)]\n    struct TxHashEmitted {\n        tx_hash: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl ICheatTxInfoChecker of super::ICheatTxInfoChecker<ContractState> {\n        fn get_transaction_hash(self: @ContractState) -> felt252 {\n            starknet::get_tx_info().unbox().transaction_hash\n        }\n\n        fn get_tx_hash_and_emit_event(ref self: ContractState) -> felt252 {\n            let tx_hash = starknet::get_tx_info().unbox().transaction_hash;\n            self.emit(Event::TxHashEmitted(TxHashEmitted { tx_hash }));\n            tx_hash\n        }\n\n        fn get_tx_info(self: @ContractState) -> starknet::info::v3::TxInfo {\n            let execution_info = get_execution_info_v3_syscall().unwrap_syscall().unbox();\n            execution_info.tx_info.unbox()\n        }\n\n        fn get_account_contract_address(ref self: ContractState) -> ContractAddress {\n            let tx_info = get_tx_info();\n            tx_info.account_contract_address\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_tx_info/tx_info_checker_library_call.cairo",
    "content": "use starknet::ClassHash;\n\n#[starknet::interface]\ntrait ICheatTxInfoChecker<TContractState> {\n    fn get_transaction_hash(self: @TContractState) -> felt252;\n}\n\n#[starknet::interface]\ntrait ICheatTxInfoCheckerLibCall<TContractState> {\n    fn get_tx_hash_with_lib_call(self: @TContractState, class_hash: ClassHash) -> felt252;\n    fn get_tx_info(self: @TContractState) -> starknet::info::v3::TxInfo;\n}\n\n#[starknet::contract]\nmod CheatTxInfoCheckerLibCall {\n    use starknet::syscalls::get_execution_info_v3_syscall;\n    use starknet::{ClassHash, SyscallResultTrait};\n    use super::{ICheatTxInfoCheckerDispatcherTrait, ICheatTxInfoCheckerLibraryDispatcher};\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl ICheatTxInfoCheckerLibCall of super::ICheatTxInfoCheckerLibCall<ContractState> {\n        fn get_tx_hash_with_lib_call(self: @ContractState, class_hash: ClassHash) -> felt252 {\n            let tx_info_checker = ICheatTxInfoCheckerLibraryDispatcher { class_hash };\n            tx_info_checker.get_transaction_hash()\n        }\n\n        fn get_tx_info(self: @ContractState) -> starknet::info::v3::TxInfo {\n            let execution_info = get_execution_info_v3_syscall().unwrap_syscall().unbox();\n            execution_info.tx_info.unbox()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_tx_info/tx_info_checker_meta_tx_v0.cairo",
    "content": "#[starknet::interface]\ntrait ITxInfoCheckerMetaTxV0<TContractState> {\n    fn __execute__(ref self: TContractState) -> felt252;\n}\n\n#[starknet::contract(account)]\nmod TxInfoCheckerMetaTxV0 {\n    use starknet::get_execution_info;\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl ITxInfoCheckerMetaTxV0 of super::ITxInfoCheckerMetaTxV0<ContractState> {\n        fn __execute__(ref self: ContractState) -> felt252 {\n            let execution_info = get_execution_info().unbox();\n            let tx_info = execution_info.tx_info.unbox();\n            tx_info.version\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/cheat_tx_info.cairo",
    "content": "mod constructor_tx_hash_checker;\nmod tx_hash_checker_proxy;\nmod tx_info_checker;\nmod tx_info_checker_library_call;\nmod tx_info_checker_meta_tx_v0;\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/common/constructor_simple.cairo",
    "content": "#[starknet::interface]\ntrait IConstructorSimple<TContractState> {\n    fn add_to_number(ref self: TContractState, number: felt252) -> felt252;\n    fn get_number(self: @TContractState) -> felt252;\n}\n\n#[starknet::contract]\nmod ConstructorSimple {\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        number: felt252,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState, number: felt252) {\n        self.number.write(number);\n    }\n\n    #[abi(embed_v0)]\n    impl ConstructorSimpleImpl of super::IConstructorSimple<ContractState> {\n        fn add_to_number(ref self: ContractState, number: felt252) -> felt252 {\n            let new_number = self.number.read() + number;\n            self.number.write(new_number);\n            new_number\n        }\n\n        fn get_number(self: @ContractState) -> felt252 {\n            self.number.read()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/common/constructor_simple2.cairo",
    "content": "#[starknet::interface]\ntrait IConstructorSimple2<TContractState> {\n    fn add_to_number(ref self: TContractState, number: felt252) -> felt252;\n    fn get_number(self: @TContractState) -> felt252;\n}\n\n#[starknet::contract]\nmod ConstructorSimple2 {\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        number: felt252,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState, number: felt252, number2: felt252) {\n        self.number.write(number + number2);\n    }\n\n    #[abi(embed_v0)]\n    impl ConstructorSimple2Impl of super::IConstructorSimple2<ContractState> {\n        fn add_to_number(ref self: ContractState, number: felt252) -> felt252 {\n            let new_number = self.number.read() + number;\n            self.number.write(new_number);\n            new_number\n        }\n\n        fn get_number(self: @ContractState) -> felt252 {\n            self.number.read()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/common/hello_starknet.cairo",
    "content": "#[starknet::interface]\ntrait IHelloStarknet<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n}\n\n#[starknet::contract]\nmod HelloStarknet {\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl HelloStarknetImpl of super::IHelloStarknet<ContractState> {\n        fn increase_balance(ref self: ContractState, amount: felt252) {\n            assert(amount != 0, 'Amount cannot be 0');\n            self.balance.write(self.balance.read() + amount);\n        }\n\n        fn get_balance(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/common.cairo",
    "content": "mod constructor_simple;\nmod constructor_simple2;\nmod hello_starknet;\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/events/constructor_spy_events_checker.cairo",
    "content": "#[starknet::contract]\nmod ConstructorSpyEventsChecker {\n    #[storage]\n    struct Storage {}\n\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    enum Event {\n        FirstEvent: FirstEvent,\n    }\n\n    #[derive(Drop, starknet::Event)]\n    struct FirstEvent {\n        some_data: felt252,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState, data: felt252) {\n        self.emit(Event::FirstEvent(FirstEvent { some_data: data }));\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/events/spy_events_cairo0.cairo",
    "content": "use starknet::ContractAddress;\n\n// 0x2c77ca97586968c6651a533bd5f58042c368b14cf5f526d2f42f670012e10ac\n#[starknet::interface]\ntrait ICairo0Contract<TContractState> {\n    // this function only job is to emit `my_event` with single felt252 value\n    fn emit_one_cairo0_event(ref self: TContractState, contract_address: felt252);\n}\n\n#[starknet::interface]\ntrait ISpyEventsCairo0<TContractState> {\n    fn test_cairo0_event_collection(ref self: TContractState, cairo0_address: ContractAddress);\n}\n\n#[starknet::contract]\nmod SpyEventsCairo0 {\n    use core::traits::Into;\n    use starknet::ContractAddress;\n    use super::ICairo0ContractDispatcherTrait;\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl ISpyEventsCairo0 of super::ISpyEventsCairo0<ContractState> {\n        fn test_cairo0_event_collection(ref self: ContractState, cairo0_address: ContractAddress) {\n            let cairo0_contract = super::ICairo0ContractDispatcher {\n                contract_address: cairo0_address,\n            };\n\n            cairo0_contract.emit_one_cairo0_event(123456789);\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/events/spy_events_checker.cairo",
    "content": "use starknet::ContractAddress;\n\n#[starknet::interface]\ntrait ISpyEventsChecker<TContractState> {\n    fn do_not_emit(ref self: TContractState);\n    fn emit_one_event(ref self: TContractState, some_data: felt252);\n    fn emit_two_events(\n        ref self: TContractState, some_data: felt252, some_more_data: ContractAddress,\n    );\n    fn emit_three_events(\n        ref self: TContractState,\n        some_data: felt252,\n        some_more_data: ContractAddress,\n        even_more_data: u256,\n    );\n    fn emit_event_syscall(ref self: TContractState, some_key: felt252, some_data: felt252);\n}\n\n#[starknet::contract]\nmod SpyEventsChecker {\n    use starknet::{ContractAddress, SyscallResultTrait};\n\n    #[storage]\n    struct Storage {}\n\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    enum Event {\n        FirstEvent: FirstEvent,\n        SecondEvent: SecondEvent,\n        ThirdEvent: ThirdEvent,\n    }\n\n    #[derive(Drop, starknet::Event)]\n    struct FirstEvent {\n        some_data: felt252,\n    }\n\n    #[derive(Drop, starknet::Event)]\n    struct SecondEvent {\n        some_data: felt252,\n        #[key]\n        some_more_data: ContractAddress,\n    }\n\n    #[derive(Drop, starknet::Event)]\n    struct ThirdEvent {\n        some_data: felt252,\n        some_more_data: ContractAddress,\n        even_more_data: u256,\n    }\n\n    #[abi(embed_v0)]\n    impl ISpyEventsChecker of super::ISpyEventsChecker<ContractState> {\n        fn do_not_emit(ref self: ContractState) {}\n\n        fn emit_one_event(ref self: ContractState, some_data: felt252) {\n            self.emit(Event::FirstEvent(FirstEvent { some_data }));\n        }\n\n        fn emit_two_events(\n            ref self: ContractState, some_data: felt252, some_more_data: ContractAddress,\n        ) {\n            self.emit(Event::FirstEvent(FirstEvent { some_data }));\n            self.emit(Event::SecondEvent(SecondEvent { some_data, some_more_data }));\n        }\n\n        fn emit_three_events(\n            ref self: ContractState,\n            some_data: felt252,\n            some_more_data: ContractAddress,\n            even_more_data: u256,\n        ) {\n            self.emit(Event::FirstEvent(FirstEvent { some_data }));\n            self.emit(Event::SecondEvent(SecondEvent { some_data, some_more_data }));\n            self.emit(Event::ThirdEvent(ThirdEvent { some_data, some_more_data, even_more_data }));\n        }\n\n        fn emit_event_syscall(ref self: ContractState, some_key: felt252, some_data: felt252) {\n            starknet::syscalls::emit_event_syscall(\n                array![some_key].span(), array![some_data].span(),\n            )\n                .unwrap_syscall();\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/events/spy_events_checker_proxy.cairo",
    "content": "use starknet::ContractAddress;\n\n#[starknet::interface]\ntrait ISpyEventsChecker<TContractState> {\n    fn do_not_emit(ref self: TContractState);\n    fn emit_one_event(ref self: TContractState, some_data: felt252);\n    fn emit_two_events(\n        ref self: TContractState, some_data: felt252, some_more_data: ContractAddress,\n    );\n    fn emit_three_events(\n        ref self: TContractState,\n        some_data: felt252,\n        some_more_data: ContractAddress,\n        even_more_data: u256,\n    );\n}\n\n#[starknet::contract]\nmod SpyEventsCheckerProxy {\n    use starknet::ContractAddress;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n    use super::{ISpyEventsCheckerDispatcher, ISpyEventsCheckerDispatcherTrait};\n\n    #[storage]\n    struct Storage {\n        proxied_address: ContractAddress,\n    }\n\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    enum Event {\n        FirstEvent: FirstEvent,\n        SecondEvent: SecondEvent,\n        ThirdEvent: ThirdEvent,\n    }\n\n    #[derive(Drop, starknet::Event)]\n    struct FirstEvent {\n        some_data: felt252,\n    }\n\n    #[derive(Drop, starknet::Event)]\n    struct SecondEvent {\n        some_data: felt252,\n        #[key]\n        some_more_data: ContractAddress,\n    }\n\n    #[derive(Drop, starknet::Event)]\n    struct ThirdEvent {\n        some_data: felt252,\n        some_more_data: ContractAddress,\n        even_more_data: u256,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState, proxied_address: ContractAddress) {\n        self.proxied_address.write(proxied_address);\n    }\n\n    #[abi(embed_v0)]\n    impl ISpyEventsChecker of super::ISpyEventsChecker<ContractState> {\n        fn do_not_emit(ref self: ContractState) {\n            let spy_events_checker = ISpyEventsCheckerDispatcher {\n                contract_address: self.proxied_address.read(),\n            };\n            spy_events_checker.do_not_emit();\n        }\n\n        fn emit_one_event(ref self: ContractState, some_data: felt252) {\n            self.emit(Event::FirstEvent(FirstEvent { some_data }));\n\n            let spy_events_checker = ISpyEventsCheckerDispatcher {\n                contract_address: self.proxied_address.read(),\n            };\n            spy_events_checker.emit_one_event(some_data);\n        }\n\n        fn emit_two_events(\n            ref self: ContractState, some_data: felt252, some_more_data: ContractAddress,\n        ) {\n            self.emit(Event::FirstEvent(FirstEvent { some_data }));\n            self.emit(Event::SecondEvent(SecondEvent { some_data, some_more_data }));\n\n            let spy_events_checker = ISpyEventsCheckerDispatcher {\n                contract_address: self.proxied_address.read(),\n            };\n            spy_events_checker.emit_two_events(some_data, some_more_data);\n        }\n\n        fn emit_three_events(\n            ref self: ContractState,\n            some_data: felt252,\n            some_more_data: ContractAddress,\n            even_more_data: u256,\n        ) {\n            self.emit(Event::FirstEvent(FirstEvent { some_data }));\n            self.emit(Event::SecondEvent(SecondEvent { some_data, some_more_data }));\n            self.emit(Event::ThirdEvent(ThirdEvent { some_data, some_more_data, even_more_data }));\n\n            let spy_events_checker = ISpyEventsCheckerDispatcher {\n                contract_address: self.proxied_address.read(),\n            };\n            spy_events_checker.emit_three_events(some_data, some_more_data, even_more_data);\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/events/spy_events_lib_call.cairo",
    "content": "use starknet::{ClassHash, ContractAddress};\n\n#[starknet::interface]\ntrait ISpyEventsLibCall<TContractState> {\n    fn call_lib_call(ref self: TContractState, data: felt252, class_hash: ClassHash);\n}\n\n#[starknet::contract]\nmod SpyEventsLibCall {\n    use starknet::ClassHash;\n\n    #[starknet::interface]\n    trait ISpyEventsChecker<TContractState> {\n        fn emit_one_event(ref self: TContractState, some_data: felt252);\n    }\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl ISpyEventsLibCallImpl of super::ISpyEventsLibCall<ContractState> {\n        fn call_lib_call(ref self: ContractState, data: felt252, class_hash: ClassHash) {\n            let spy_events_checker = ISpyEventsCheckerLibraryDispatcher { class_hash };\n            spy_events_checker.emit_one_event(data);\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/events/spy_events_order_checker.cairo",
    "content": "use starknet::ContractAddress;\n\n#[starknet::interface]\ntrait ISpyEventsOrderChecker<TContractState> {\n    fn emit_and_call_another(\n        ref self: TContractState,\n        first_data: felt252,\n        second_data: felt252,\n        third_data: felt252,\n        another_contract_address: ContractAddress,\n    );\n}\n\n#[starknet::contract]\nmod SpyEventsOrderChecker {\n    use starknet::ContractAddress;\n\n    #[starknet::interface]\n    trait ISpyEventsChecker<TContractState> {\n        fn emit_one_event(ref self: TContractState, some_data: felt252);\n    }\n\n    #[storage]\n    struct Storage {}\n\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    enum Event {\n        SecondEvent: SecondEvent,\n        ThirdEvent: ThirdEvent,\n    }\n\n    #[derive(Drop, starknet::Event)]\n    struct SecondEvent {\n        data: felt252,\n    }\n\n    #[derive(Drop, starknet::Event)]\n    struct ThirdEvent {\n        data: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl ISpyEventsOrderCheckerImpl of super::ISpyEventsOrderChecker<ContractState> {\n        fn emit_and_call_another(\n            ref self: ContractState,\n            first_data: felt252,\n            second_data: felt252,\n            third_data: felt252,\n            another_contract_address: ContractAddress,\n        ) {\n            self.emit(Event::SecondEvent(SecondEvent { data: first_data }));\n\n            let spy_events_checker = ISpyEventsCheckerDispatcher {\n                contract_address: another_contract_address,\n            };\n            spy_events_checker.emit_one_event(second_data);\n\n            self.emit(Event::ThirdEvent(ThirdEvent { data: third_data }));\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/events.cairo",
    "content": "mod constructor_spy_events_checker;\nmod spy_events_cairo0;\nmod spy_events_checker;\nmod spy_events_checker_proxy;\nmod spy_events_lib_call;\nmod spy_events_order_checker;\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/get_class_hash/get_class_hash_checker.cairo",
    "content": "use starknet::ClassHash;\n\n#[starknet::interface]\ntrait IUpgradeable<T> {\n    fn upgrade(ref self: T, class_hash: ClassHash);\n}\n\n#[starknet::contract]\nmod GetClassHashCheckerUpg {\n    use starknet::ClassHash;\n\n    #[storage]\n    struct Storage {\n        inner: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl IUpgradeableImpl of super::IUpgradeable<ContractState> {\n        fn upgrade(ref self: ContractState, class_hash: ClassHash) {\n            _upgrade(class_hash);\n        }\n    }\n\n    fn _upgrade(class_hash: ClassHash) {\n        match starknet::syscalls::replace_class_syscall(class_hash) {\n            Result::Ok(()) => {},\n            Result::Err(e) => panic(e),\n        };\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/get_class_hash.cairo",
    "content": "mod get_class_hash_checker;\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/lib.cairo",
    "content": "mod bytearray_string_panic_call;\nmod cheat_block_hash;\nmod cheat_block_number;\nmod cheat_block_timestamp;\nmod cheat_caller_address;\nmod cheat_sequencer_address;\nmod cheat_tx_info;\nmod common;\nmod events;\nmod get_class_hash;\nmod library_calls;\nmod meta_tx_v0;\nmod mock;\nmod panic_call;\nmod replace_bytecode;\nmod revert;\nmod segment_arena_user;\nmod starknet;\nmod store_load;\nmod tracked_resources;\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/library_calls.cairo",
    "content": "#[starknet::interface]\npub trait IExampleContract<T> {\n    fn set_class_hash(ref self: T, class_hash: starknet::ClassHash);\n    fn get_caller_address(ref self: T) -> starknet::ContractAddress;\n}\n\n// contract A\n#[starknet::contract]\npub mod ExampleContract {\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl IExampleContractImpl of super::IExampleContract<ContractState> {\n        fn set_class_hash(ref self: ContractState, class_hash: starknet::ClassHash) {}\n\n        fn get_caller_address(ref self: ContractState) -> starknet::ContractAddress {\n            starknet::get_caller_address()\n        }\n    }\n}\n\n\n// contract B to make library call to the class of contract A\n#[starknet::contract]\npub mod ExampleContractLibraryCall {\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n    use super::{IExampleContractDispatcherTrait, IExampleContractLibraryDispatcher};\n\n    #[storage]\n    struct Storage {\n        lib_class_hash: starknet::ClassHash,\n    }\n\n    #[abi(embed_v0)]\n    impl ExampleContract of super::IExampleContract<ContractState> {\n        #[abi(embed_v0)]\n        fn set_class_hash(ref self: ContractState, class_hash: starknet::ClassHash) {\n            self.lib_class_hash.write(class_hash);\n        }\n\n        fn get_caller_address(ref self: ContractState) -> starknet::ContractAddress {\n            IExampleContractLibraryDispatcher { class_hash: self.lib_class_hash.read() }\n                .get_caller_address()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/meta_tx_v0/checker.cairo",
    "content": "#[starknet::interface]\ntrait IMetaTxV0Test<TContractState> {\n    fn execute_meta_tx_v0(\n        self: @TContractState, target: starknet::ContractAddress, signature: Span<felt252>,\n    ) -> felt252;\n    fn execute_meta_tx_v0_get_block_hash(\n        self: @TContractState,\n        target: starknet::ContractAddress,\n        block_number: u64,\n        signature: Span<felt252>,\n    ) -> felt252;\n}\n\n#[starknet::contract]\nmod MetaTxV0Test {\n    use starknet::syscalls::meta_tx_v0_syscall;\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl IMetaTxV0Test of super::IMetaTxV0Test<ContractState> {\n        fn execute_meta_tx_v0(\n            self: @ContractState, target: starknet::ContractAddress, signature: Span<felt252>,\n        ) -> felt252 {\n            let selector = selector!(\"__execute__\");\n            let calldata = array![];\n\n            let result = meta_tx_v0_syscall(target, selector, calldata.span(), signature).unwrap();\n\n            *result.at(0)\n        }\n\n        fn execute_meta_tx_v0_get_block_hash(\n            self: @ContractState,\n            target: starknet::ContractAddress,\n            block_number: u64,\n            signature: Span<felt252>,\n        ) -> felt252 {\n            let selector = selector!(\"__execute__\");\n            let calldata = array![block_number.into()];\n\n            let result = meta_tx_v0_syscall(target, selector, calldata.span(), signature).unwrap();\n\n            *result.at(0)\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/meta_tx_v0.cairo",
    "content": "mod checker;\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/mock/constructor_mock_checker.cairo",
    "content": "#[starknet::interface]\ntrait IConstructorMockChecker<TContractState> {\n    fn get_constructor_balance(ref self: TContractState) -> felt252;\n}\n\n#[starknet::contract]\nmod ConstructorMockChecker {\n    use starknet::ContractAddress;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[starknet::interface]\n    trait IHelloStarknet<TContractState> {\n        fn get_balance(self: @TContractState) -> felt252;\n    }\n\n    #[storage]\n    struct Storage {\n        constructor_balance: felt252,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState, balance_contract_address: ContractAddress) {\n        let hello_starknet = IHelloStarknetDispatcher {\n            contract_address: balance_contract_address,\n        };\n        self.constructor_balance.write(hello_starknet.get_balance());\n    }\n\n    #[abi(embed_v0)]\n    impl IConstructorMockCheckerImpl of super::IConstructorMockChecker<ContractState> {\n        fn get_constructor_balance(ref self: ContractState) -> felt252 {\n            self.constructor_balance.read()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/mock/mock_checker.cairo",
    "content": "#[derive(Serde, Drop)]\nstruct StructThing {\n    item_one: felt252,\n    item_two: felt252,\n}\n\n#[starknet::interface]\ntrait IMockChecker<TContractState> {\n    fn get_thing(ref self: TContractState) -> felt252;\n    fn get_thing_wrapper(ref self: TContractState) -> felt252;\n    fn get_constant_thing(ref self: TContractState) -> felt252;\n    fn get_struct_thing(ref self: TContractState) -> StructThing;\n    fn get_arr_thing(ref self: TContractState) -> Array<StructThing>;\n    fn get_thing_twice(ref self: TContractState) -> (felt252, felt252);\n}\n\n#[starknet::contract]\nmod MockChecker {\n    use core::array::ArrayTrait;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n    use super::{IMockChecker, IMockCheckerDispatcher, IMockCheckerDispatcherTrait, StructThing};\n\n    #[storage]\n    struct Storage {\n        stored_thing: felt252,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState, arg1: felt252) {\n        self.stored_thing.write(arg1)\n    }\n\n    #[abi(embed_v0)]\n    impl IMockCheckerImpl of super::IMockChecker<ContractState> {\n        fn get_thing(ref self: ContractState) -> felt252 {\n            self.stored_thing.read()\n        }\n\n        fn get_thing_wrapper(ref self: ContractState) -> felt252 {\n            self.get_thing()\n        }\n\n        fn get_constant_thing(ref self: ContractState) -> felt252 {\n            13\n        }\n\n        fn get_struct_thing(ref self: ContractState) -> StructThing {\n            StructThing { item_one: 12, item_two: 21 }\n        }\n\n        fn get_arr_thing(ref self: ContractState) -> Array<StructThing> {\n            array![StructThing { item_one: 12, item_two: 21 }]\n        }\n\n        fn get_thing_twice(ref self: ContractState) -> (felt252, felt252) {\n            let contract_address = starknet::get_contract_address();\n            let dispatcher = IMockCheckerDispatcher { contract_address };\n            let a = dispatcher.get_thing();\n            let b = dispatcher.get_thing();\n            (a, b)\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/mock/mock_checker_library_call.cairo",
    "content": "use starknet::ClassHash;\n\n#[starknet::interface]\ntrait IMockChecker<TContractState> {\n    fn get_constant_thing(ref self: TContractState) -> felt252;\n}\n\n#[starknet::interface]\ntrait IMockCheckerLibCall<TContractState> {\n    fn get_constant_thing_with_lib_call(ref self: TContractState, class_hash: ClassHash) -> felt252;\n}\n\n#[starknet::contract]\nmod MockCheckerLibCall {\n    use starknet::ClassHash;\n    use super::{IMockCheckerDispatcherTrait, IMockCheckerLibraryDispatcher};\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl IMockCheckerLibCall of super::IMockCheckerLibCall<ContractState> {\n        fn get_constant_thing_with_lib_call(\n            ref self: ContractState, class_hash: ClassHash,\n        ) -> felt252 {\n            let mock_checker = IMockCheckerLibraryDispatcher { class_hash };\n            mock_checker.get_constant_thing()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/mock/mock_checker_proxy.cairo",
    "content": "use starknet::ContractAddress;\n\n#[starknet::interface]\ntrait IMockChecker<TContractState> {\n    fn get_thing(ref self: TContractState) -> felt252;\n}\n\n\n#[starknet::interface]\ntrait IMockCheckerProxy<TContractState> {\n    fn get_thing_from_contract(ref self: TContractState, address: ContractAddress) -> felt252;\n    fn get_thing_from_contract_and_emit_event(\n        ref self: TContractState, address: ContractAddress,\n    ) -> felt252;\n}\n\n#[starknet::contract]\nmod MockCheckerProxy {\n    use starknet::ContractAddress;\n    use super::{IMockCheckerDispatcher, IMockCheckerDispatcherTrait};\n\n    #[storage]\n    struct Storage {}\n\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    enum Event {\n        ThingEmitted: ThingEmitted,\n    }\n\n    #[derive(Drop, starknet::Event)]\n    struct ThingEmitted {\n        thing: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl IMockCheckerProxy of super::IMockCheckerProxy<ContractState> {\n        fn get_thing_from_contract(ref self: ContractState, address: ContractAddress) -> felt252 {\n            let dispatcher = IMockCheckerDispatcher { contract_address: address };\n            dispatcher.get_thing()\n        }\n\n        fn get_thing_from_contract_and_emit_event(\n            ref self: ContractState, address: ContractAddress,\n        ) -> felt252 {\n            let dispatcher = IMockCheckerDispatcher { contract_address: address };\n            let thing = dispatcher.get_thing();\n            self.emit(Event::ThingEmitted(ThingEmitted { thing }));\n            thing\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/mock.cairo",
    "content": "mod constructor_mock_checker;\nmod mock_checker;\nmod mock_checker_library_call;\nmod mock_checker_proxy;\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/panic_call.cairo",
    "content": "#[starknet::contract]\nmod PanicCall {\n    #[storage]\n    struct Storage {}\n\n    #[external(v0)]\n    fn panic_call(ref self: ContractState) {\n        panic(\n            array![\n                'shortstring', 0, 0x800000000000011000000000000000000000000000000000000000000000000,\n                'shortstring2',\n            ],\n        );\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/replace_bytecode/replace_bytecode_a.cairo",
    "content": "#[starknet::interface]\ntrait IReplaceBytecodeA<TContractState> {\n    fn get(self: @TContractState) -> felt252;\n    fn set(ref self: TContractState, value: felt252);\n    fn get_const(self: @TContractState) -> felt252;\n}\n\n#[starknet::contract]\nmod ReplaceBytecodeA {\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        value: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl IReplaceBytecodeA of super::IReplaceBytecodeA<ContractState> {\n        fn get(self: @ContractState) -> felt252 {\n            self.value.read()\n        }\n\n        fn set(ref self: ContractState, value: felt252) {\n            self.value.write(value);\n        }\n\n        fn get_const(self: @ContractState) -> felt252 {\n            2137\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/replace_bytecode/replace_bytecode_b.cairo",
    "content": "#[starknet::interface]\ntrait IReplaceBytecodeB<TContractState> {\n    fn get(self: @TContractState) -> felt252;\n    fn set(ref self: TContractState, value: felt252);\n    fn get_const(self: @TContractState) -> felt252;\n}\n\n#[starknet::contract]\nmod ReplaceBytecodeB {\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        value: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl IReplaceBytecodeB of super::IReplaceBytecodeB<ContractState> {\n        fn get(self: @ContractState) -> felt252 {\n            self.value.read() + 100\n        }\n\n        fn set(ref self: ContractState, value: felt252) {\n            self.value.write(value + 100);\n        }\n\n        fn get_const(self: @ContractState) -> felt252 {\n            420\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/replace_bytecode/replace_fork.cairo",
    "content": "#[starknet::interface]\ntrait IReplaceInFork<TContractState> {\n    fn get_owner(self: @TContractState) -> felt252;\n}\n\n#[starknet::contract]\nmod ReplaceInFork {\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl IReplaceInFork of super::IReplaceInFork<ContractState> {\n        fn get_owner(self: @ContractState) -> felt252 {\n            0\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/replace_bytecode.cairo",
    "content": "mod replace_bytecode_a;\nmod replace_bytecode_b;\nmod replace_fork;\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/revert.cairo",
    "content": "#[starknet::contract]\nmod Revert {\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n    use starknet::{StorageAddress, SyscallResultTrait, syscalls};\n\n    #[storage]\n    struct Storage {\n        storage_var: felt252,\n    }\n\n    #[external(v0)]\n    fn modify_in_nested_call_and_handle_panic(\n        ref self: ContractState,\n        contract_address: starknet::ContractAddress,\n        new_class_hash: starknet::ClassHash,\n    ) {\n        match syscalls::call_contract_syscall(\n            contract_address,\n            selector!(\"modify_contract_var_and_panic\"),\n            array![new_class_hash.into()].span(),\n        ) {\n            Result::Ok(_) => core::panic_with_felt252('expected revert'),\n            Result::Err(errors) => {\n                let mut error_span = errors.span();\n                assert(*error_span.pop_back().unwrap() == 'ENTRYPOINT_FAILED', 'unexpected error');\n            },\n        }\n        assert(self.storage_var.read() == 0, 'value should not change');\n    }\n\n    #[external(v0)]\n    fn modify_in_top_and_nested_calls_and_panic(ref self: ContractState, key: StorageAddress) {\n        let storage_before = syscalls::storage_read_syscall(0, key).unwrap_syscall();\n        assert(storage_before == 0, 'incorrect storage before');\n\n        // Call `modify_specific_storage` without panic.\n        syscalls::call_contract_syscall(\n            starknet::get_contract_address(),\n            selector!(\"modify_specific_storage\"),\n            array![key.into(), 99, 0].span(),\n        )\n            .unwrap_syscall();\n\n        let storage_after = syscalls::storage_read_syscall(0, key).unwrap_syscall();\n        assert(storage_after == 99, 'incorrect storage after');\n\n        let dummy_span = array![1, 1].span();\n        syscalls::emit_event_syscall(dummy_span, dummy_span).unwrap_syscall();\n        syscalls::send_message_to_l1_syscall(91, dummy_span).unwrap_syscall();\n\n        // Call `modify_specific_storage` with panic.\n        syscalls::call_contract_syscall(\n            starknet::get_contract_address(),\n            selector!(\"modify_specific_storage\"),\n            array![key.into(), 88, 1].span(),\n        )\n            .unwrap_syscall();\n\n        assert(false, 'unreachable');\n    }\n\n    #[external(v0)]\n    fn modify_contract_var_and_panic(ref self: ContractState, class_hash: starknet::ClassHash) {\n        let dummy_span = array![0].span();\n        syscalls::emit_event_syscall(dummy_span, dummy_span).unwrap_syscall();\n        syscalls::replace_class_syscall(class_hash).unwrap_syscall();\n        syscalls::send_message_to_l1_syscall(17, dummy_span).unwrap_syscall();\n\n        self.storage_var.write(987);\n        assert(self.storage_var.read() == 987, 'value should change');\n\n        core::panic_with_felt252('modify_contract_var_and_panic');\n    }\n\n    #[external(v0)]\n    fn modify_specific_storage(\n        ref self: ContractState, key: StorageAddress, new_value: felt252, should_panic: bool,\n    ) {\n        let address_domain = 0;\n        syscalls::storage_write_syscall(address_domain, key, new_value).unwrap_syscall();\n\n        let dummy_span = array![0].span();\n        syscalls::emit_event_syscall(dummy_span, dummy_span).unwrap_syscall();\n        syscalls::send_message_to_l1_syscall(19, dummy_span).unwrap_syscall();\n\n        if should_panic {\n            core::panic_with_felt252('modify_specific_storage');\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/segment_arena_user.cairo",
    "content": "#[starknet::contract]\nmod SegmentArenaUser {\n    use core::dict::Felt252Dict;\n\n    #[storage]\n    struct Storage {}\n\n    #[external(v0)]\n    fn interface_function(ref self: ContractState) {\n        let _felt_dict: Felt252Dict<felt252> = Default::default();\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/starknet/block_info_checker_library_call.cairo",
    "content": "use starknet::{ClassHash, ContractAddress};\n\n#[starknet::interface]\ntrait IBlockInfoChecker<TContractState> {\n    fn read_block_number(ref self: TContractState) -> u64;\n    fn read_block_timestamp(ref self: TContractState) -> u64;\n    fn read_sequencer_address(ref self: TContractState) -> ContractAddress;\n}\n\n#[starknet::interface]\ntrait IBlockInfoCheckerLibCall<TContractState> {\n    fn read_block_number_with_lib_call(ref self: TContractState, class_hash: ClassHash) -> u64;\n    fn read_block_timestamp_with_lib_call(ref self: TContractState, class_hash: ClassHash) -> u64;\n    fn read_sequencer_address_with_lib_call(\n        ref self: TContractState, class_hash: ClassHash,\n    ) -> ContractAddress;\n}\n\n#[starknet::contract]\nmod BlockInfoCheckerLibCall {\n    use starknet::{ClassHash, ContractAddress};\n    use super::{IBlockInfoCheckerDispatcherTrait, IBlockInfoCheckerLibraryDispatcher};\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl IBlockInfoCheckerLibCall of super::IBlockInfoCheckerLibCall<ContractState> {\n        fn read_block_number_with_lib_call(ref self: ContractState, class_hash: ClassHash) -> u64 {\n            let block_info_checker = IBlockInfoCheckerLibraryDispatcher { class_hash };\n            block_info_checker.read_block_number()\n        }\n        fn read_block_timestamp_with_lib_call(\n            ref self: ContractState, class_hash: ClassHash,\n        ) -> u64 {\n            let block_info_checker = IBlockInfoCheckerLibraryDispatcher { class_hash };\n            block_info_checker.read_block_timestamp()\n        }\n        fn read_sequencer_address_with_lib_call(\n            ref self: ContractState, class_hash: ClassHash,\n        ) -> ContractAddress {\n            let block_info_checker = IBlockInfoCheckerLibraryDispatcher { class_hash };\n            block_info_checker.read_sequencer_address()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/starknet/block_info_checker_proxy.cairo",
    "content": "use starknet::ContractAddress;\n\n#[starknet::interface]\ntrait IBlockInfoChecker<TContractState> {\n    fn read_block_number(self: @TContractState) -> u64;\n    fn read_block_timestamp(self: @TContractState) -> u64;\n    fn read_sequencer_address(self: @TContractState) -> ContractAddress;\n}\n\n#[starknet::interface]\ntrait IBlockInfoCheckerProxy<TContractState> {\n    fn read_block_number(ref self: TContractState, address: ContractAddress) -> u64;\n    fn read_block_timestamp(ref self: TContractState, address: ContractAddress) -> u64;\n    fn read_sequencer_address(\n        ref self: TContractState, address: ContractAddress,\n    ) -> ContractAddress;\n}\n\n#[starknet::contract]\nmod BlockInfoCheckerProxy {\n    use starknet::ContractAddress;\n    use super::{IBlockInfoCheckerDispatcher, IBlockInfoCheckerDispatcherTrait};\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl IBlockInfoCheckerProxy of super::IBlockInfoCheckerProxy<ContractState> {\n        fn read_block_number(ref self: ContractState, address: ContractAddress) -> u64 {\n            let block_info_checker = IBlockInfoCheckerDispatcher { contract_address: address };\n            block_info_checker.read_block_number()\n        }\n        fn read_block_timestamp(ref self: ContractState, address: ContractAddress) -> u64 {\n            let block_info_checker = IBlockInfoCheckerDispatcher { contract_address: address };\n            block_info_checker.read_block_timestamp()\n        }\n        fn read_sequencer_address(\n            ref self: ContractState, address: ContractAddress,\n        ) -> ContractAddress {\n            let block_info_checker = IBlockInfoCheckerDispatcher { contract_address: address };\n            block_info_checker.read_sequencer_address()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/starknet/blocker.cairo",
    "content": "use starknet::ContractAddress;\n\n#[starknet::interface]\ntrait IBlocker<TContractState> {\n    fn write_block(ref self: TContractState);\n    fn read_block_number(self: @TContractState) -> u64;\n    fn read_block_timestamp(self: @TContractState) -> u64;\n    fn read_sequencer_address(self: @TContractState) -> ContractAddress;\n    fn read_block_hash(self: @TContractState) -> felt252;\n}\n\n#[starknet::contract]\nmod Blocker {\n    use core::array::ArrayTrait;\n    use core::box::BoxTrait;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n    use starknet::syscalls::get_block_hash_syscall;\n    use starknet::{ContractAddress, SyscallResultTrait, get_block_info};\n\n    #[storage]\n    struct Storage {\n        block_number: u64,\n        block_timestamp: u64,\n        block_hash: felt252,\n        sequencer_address: ContractAddress,\n    }\n\n    #[abi(embed_v0)]\n    impl IBlockerImpl of super::IBlocker<ContractState> {\n        fn write_block(ref self: ContractState) {\n            let block_info = get_block_info().unbox();\n            self.block_number.write(block_info.block_number);\n            self.block_timestamp.write(block_info.block_timestamp);\n            self.sequencer_address.write(block_info.sequencer_address);\n\n            let block_hash = get_block_hash_syscall(block_info.block_number - 10).unwrap_syscall();\n            self.block_hash.write(block_hash);\n        }\n\n        fn read_block_number(self: @ContractState) -> u64 {\n            self.block_number.read()\n        }\n        fn read_block_timestamp(self: @ContractState) -> u64 {\n            self.block_timestamp.read()\n        }\n        fn read_sequencer_address(self: @ContractState) -> ContractAddress {\n            self.sequencer_address.read()\n        }\n        fn read_block_hash(self: @ContractState) -> felt252 {\n            self.block_hash.read()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/starknet/forking_checker.cairo",
    "content": "use starknet::{ClassHash, ContractAddress};\n\n#[starknet::interface]\ntrait IHelloStarknet<TContractState> {\n    fn get_balance(self: @TContractState) -> felt252;\n}\n\n#[starknet::interface]\ntrait IForkingChecker<TContractState> {\n    fn get_balance_call_contract(\n        ref self: TContractState, contract_address: ContractAddress,\n    ) -> felt252;\n    fn get_balance_library_call(ref self: TContractState, class_hash: ClassHash) -> felt252;\n    fn set_balance(ref self: TContractState, new_balance: felt252);\n}\n\n#[starknet::contract]\nmod ForkingChecker {\n    use core::option::OptionTrait;\n    use starknet::storage::StoragePointerWriteAccess;\n    use starknet::{ClassHash, ContractAddress};\n    use super::{\n        IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait, IHelloStarknetLibraryDispatcher,\n    };\n\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState, contract_address: Option<ContractAddress>) {\n        if contract_address.is_some() {\n            let hello_starknet = IHelloStarknetDispatcher {\n                contract_address: contract_address.unwrap(),\n            };\n            self.balance.write(hello_starknet.get_balance());\n        }\n    }\n\n    #[abi(embed_v0)]\n    impl IForkingCheckerImpl of super::IForkingChecker<ContractState> {\n        fn get_balance_call_contract(\n            ref self: ContractState, contract_address: ContractAddress,\n        ) -> felt252 {\n            let hello_starknet = IHelloStarknetDispatcher { contract_address };\n            hello_starknet.get_balance()\n        }\n\n        fn get_balance_library_call(ref self: ContractState, class_hash: ClassHash) -> felt252 {\n            let hello_starknet = IHelloStarknetLibraryDispatcher { class_hash };\n            hello_starknet.get_balance()\n        }\n\n        fn set_balance(ref self: ContractState, new_balance: felt252) {\n            self.balance.write(new_balance);\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/starknet/noncer.cairo",
    "content": "#[starknet::interface]\ntrait INoncer<TContractState> {\n    fn write_nonce(ref self: TContractState);\n    fn read_nonce(self: @TContractState) -> felt252;\n}\n\n#[starknet::contract]\nmod Noncer {\n    use core::array::ArrayTrait;\n    use core::box::BoxTrait;\n    use starknet::get_tx_info;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        nonce: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl INoncerImpl of super::INoncer<ContractState> {\n        fn write_nonce(ref self: ContractState) {\n            let tx_info = get_tx_info().unbox();\n            let nonce = tx_info.nonce;\n            self.nonce.write(nonce);\n        }\n\n        fn read_nonce(self: @ContractState) -> felt252 {\n            self.nonce.read()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/starknet/timestamper.cairo",
    "content": "#[starknet::interface]\ntrait ITimestamper<TContractState> {\n    fn write_timestamp(ref self: TContractState);\n    fn read_timestamp(self: @TContractState) -> u64;\n}\n\n#[starknet::contract]\nmod Timestamper {\n    use core::array::ArrayTrait;\n    use starknet::get_block_timestamp;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        time: u64,\n    }\n\n    #[abi(embed_v0)]\n    impl ITimestamperImpl of super::ITimestamper<ContractState> {\n        fn write_timestamp(ref self: ContractState) {\n            let time = get_block_timestamp();\n            self.time.write(time);\n        }\n\n        fn read_timestamp(self: @ContractState) -> u64 {\n            self.time.read()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/starknet.cairo",
    "content": "mod block_info_checker_library_call;\nmod block_info_checker_proxy;\nmod blocker;\nmod forking_checker;\nmod noncer;\nmod timestamper;\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/store_load/map_simple_value_simple_key.cairo",
    "content": "#[starknet::contract]\nmod MapSimpleValueSimpleKey {\n    use starknet::storage::{Map, StorageMapReadAccess, StoragePathEntry, StoragePointerWriteAccess};\n    #[storage]\n    struct Storage {\n        values: Map<felt252, felt252>,\n    }\n\n    #[external(v0)]\n    fn insert(ref self: ContractState, key: felt252, value: felt252) {\n        self.values.entry(key).write(value);\n    }\n\n    #[external(v0)]\n    fn read(self: @ContractState, key: felt252) -> felt252 {\n        self.values.read(key)\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/store_load.cairo",
    "content": "mod map_simple_value_simple_key;\n"
  },
  {
    "path": "crates/cheatnet/tests/contracts/src/tracked_resources.cairo",
    "content": "// Address of a simple proxy contract that works as a wrapper on the `call_contract_syscall`\n// Deployed to the Sepolia network and compiled with Sierra version 1.6.0\nconst PROXY_CONTRACT_ADDRESS: felt252 =\n    0x004a053601baaed3231638627631caed753b6527484cde2ed2b5b7d57854a902;\n\n#[starknet::contract]\nmod TrackedResources {\n    use starknet::{SyscallResultTrait, get_contract_address, syscalls};\n\n    #[storage]\n    struct Storage {}\n\n    #[external(v0)]\n    fn call_twice(ref self: ContractState) {\n        // Call through proxy\n        syscalls::call_contract_syscall(\n            super::PROXY_CONTRACT_ADDRESS.try_into().unwrap(),\n            selector!(\"call_single\"),\n            array![get_contract_address().try_into().unwrap(), selector!(\"call_internal\"), 0]\n                .span(),\n        )\n            .unwrap_syscall();\n\n        // Call itself directly\n        syscalls::call_contract_syscall(\n            get_contract_address(), selector!(\"call_internal\"), array![].span(),\n        )\n            .unwrap_syscall();\n    }\n\n    #[external(v0)]\n    fn call_internal(ref self: ContractState) {\n        dummy_computations();\n    }\n\n    fn dummy_computations() {\n        1_u8 >= 1_u8;\n        1_u8 & 1_u8;\n\n        core::pedersen::pedersen(1, 2);\n        core::poseidon::hades_permutation(0, 0, 0);\n        core::keccak::keccak_u256s_le_inputs(array![1].span());\n\n        syscalls::get_block_hash_syscall(0x100).unwrap_syscall();\n        syscalls::emit_event_syscall(array![1].span(), array![2].span()).unwrap_syscall();\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/main.rs",
    "content": "use scarb_api::ScarbCommand;\n\nmod builtins;\nmod cheatcodes;\npub(crate) mod common;\nmod starknet;\n\n// Build testing contracts before executing the tests\n#[cfg(test)]\n#[ctor::ctor]\nfn init() {\n    use camino::Utf8PathBuf;\n    let contracts_path = Utf8PathBuf::from(\"tests\").join(\"contracts\");\n\n    let output = ScarbCommand::new()\n        .current_dir(contracts_path)\n        .arg(\"build\")\n        .command()\n        .output()\n        .unwrap();\n    if !output.status.success() {\n        let stderr = String::from_utf8(output.stderr).expect(\"Decoding scarb stderr failed\");\n        let stdout = String::from_utf8(output.stdout).expect(\"Decoding scarb stdout failed\");\n        panic!(\"scarb build failed,\\nstderr: \\n{stderr}\\nstdout: \\n{stdout}\");\n    }\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/starknet/block.rs",
    "content": "use crate::common::call_contract;\nuse crate::common::{\n    assertions::assert_success, deploy_contract, recover_data, state::create_cached_state,\n};\nuse blockifier::state::state_api::State;\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::storage::selector_from_name;\nuse cheatnet::state::CheatnetState;\nuse starknet_api::core::ContractAddress;\nuse starknet_types_core::felt::Felt;\n\nfn check_block(\n    state: &mut dyn State,\n    cheatnet_state: &mut CheatnetState,\n    contract_address: &ContractAddress,\n) -> (Felt, Felt, Felt, Felt) {\n    let write_block = selector_from_name(\"write_block\");\n    let read_block_number = selector_from_name(\"read_block_number\");\n    let read_block_timestamp = selector_from_name(\"read_block_timestamp\");\n    let read_sequencer_address = selector_from_name(\"read_sequencer_address\");\n    let read_block_hash = selector_from_name(\"read_block_hash\");\n\n    let output = call_contract(state, cheatnet_state, contract_address, write_block, &[]);\n\n    assert_success(output, &[]);\n\n    let output = call_contract(\n        state,\n        cheatnet_state,\n        contract_address,\n        read_block_number,\n        &[],\n    );\n\n    let block_number = &recover_data(output)[0];\n\n    let output = call_contract(\n        state,\n        cheatnet_state,\n        contract_address,\n        read_block_timestamp,\n        &[],\n    );\n\n    let block_timestamp = &recover_data(output)[0];\n\n    let output = call_contract(\n        state,\n        cheatnet_state,\n        contract_address,\n        read_sequencer_address,\n        &[],\n    );\n\n    let sequencer_address = &recover_data(output)[0];\n\n    let output = call_contract(\n        state,\n        cheatnet_state,\n        contract_address,\n        read_block_hash,\n        &[],\n    );\n\n    let block_hash = &recover_data(output)[0];\n\n    (\n        *block_number,\n        *block_timestamp,\n        *sequencer_address,\n        *block_hash,\n    )\n}\n\n#[test]\nfn block_does_not_decrease() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address = deploy_contract(&mut cached_state, &mut cheatnet_state, \"Blocker\", &[]);\n\n    let (old_block_number, old_block_timestamp, old_sequencer_address, old_block_hash) =\n        check_block(&mut cached_state, &mut cheatnet_state, &contract_address);\n\n    let (new_block_number, new_block_timestamp, new_sequencer_address, new_block_hash) =\n        check_block(&mut cached_state, &mut cheatnet_state, &contract_address);\n\n    assert!(old_block_number <= new_block_number);\n    assert!(old_block_timestamp <= new_block_timestamp);\n    assert_eq!(old_sequencer_address, new_sequencer_address);\n    assert_eq!(new_block_hash, old_block_hash);\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/starknet/cheat_fork.rs",
    "content": "use crate::common::call_contract;\nuse crate::common::state::create_fork_cached_state;\nuse cheatnet::runtime_extensions::call_to_blockifier_runtime_extension::rpc::CallSuccess;\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::storage::selector_from_name;\nuse cheatnet::state::CheatnetState;\nuse conversions::string::TryFromHexStr;\nuse starknet_api::core::ContractAddress;\nuse starknet_types_core::felt::Felt;\nuse tempfile::TempDir;\nuse test_case::test_case;\n\nconst CAIRO0_TESTER_ADDRESS: &str =\n    \"0x7fec0c04dde6b1cfa7994359313f8b67edd0d8e40e28424437702d3ee48c2a4\";\n\n#[test_case(\"return_caller_address\"; \"when common call\")]\n#[test_case(\"return_proxied_caller_address\"; \"when library call\")]\nfn cheat_caller_address_cairo0_contract(selector: &str) {\n    let cache_dir = TempDir::new().unwrap();\n    let mut cached_fork_state = create_fork_cached_state(cache_dir.path().to_str().unwrap());\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address = ContractAddress::try_from_hex_str(CAIRO0_TESTER_ADDRESS).unwrap();\n\n    let selector = selector_from_name(selector);\n    let output = call_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n\n    let Ok(CallSuccess { ret_data }) = output else {\n        panic!(\"Wrong call output\")\n    };\n    let caller = &ret_data[0];\n\n    cheatnet_state.start_cheat_caller_address(contract_address, ContractAddress::from(123_u128));\n\n    let output = call_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n    let Ok(CallSuccess { ret_data }) = output else {\n        panic!(\"Wrong call output\")\n    };\n    let cheated_caller_address = &ret_data[0];\n\n    cheatnet_state.stop_cheat_caller_address(contract_address);\n\n    let output = call_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n    let Ok(CallSuccess { ret_data }) = output else {\n        panic!(\"Wrong call output\")\n    };\n    let uncheated_caller_address = &ret_data[0];\n\n    assert_eq!(cheated_caller_address, &Felt::from(123));\n    assert_eq!(uncheated_caller_address, caller);\n}\n\n#[test_case(\"return_block_number\"; \"when common call\")]\n#[test_case(\"return_proxied_block_number\"; \"when library call\")]\nfn cheat_block_number_cairo0_contract(selector: &str) {\n    let cache_dir = TempDir::new().unwrap();\n    let mut cached_fork_state = create_fork_cached_state(cache_dir.path().to_str().unwrap());\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address = ContractAddress::try_from_hex_str(CAIRO0_TESTER_ADDRESS).unwrap();\n\n    let selector = selector_from_name(selector);\n    let output = call_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n    let Ok(CallSuccess { ret_data }) = output else {\n        panic!(\"Wrong call output\")\n    };\n    let block_number = &ret_data[0];\n\n    cheatnet_state.start_cheat_block_number(contract_address, 123);\n\n    let output = call_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n    let Ok(CallSuccess { ret_data }) = output else {\n        panic!(\"Wrong call output\")\n    };\n    let cheated_block_number = &ret_data[0];\n\n    cheatnet_state.stop_cheat_block_number(contract_address);\n\n    let output = call_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n    let Ok(CallSuccess { ret_data }) = output else {\n        panic!(\"Wrong call output\")\n    };\n    let uncheated_block_number = &ret_data[0];\n\n    assert_eq!(cheated_block_number, &Felt::from(123));\n    assert_eq!(uncheated_block_number, block_number);\n}\n\n#[test_case(\"return_block_timestamp\"; \"when common call\")]\n#[test_case(\"return_proxied_block_timestamp\"; \"when library call\")]\nfn cheat_block_timestamp_cairo0_contract(selector: &str) {\n    let cache_dir = TempDir::new().unwrap();\n    let mut cached_fork_state = create_fork_cached_state(cache_dir.path().to_str().unwrap());\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address = ContractAddress::try_from_hex_str(CAIRO0_TESTER_ADDRESS).unwrap();\n\n    let selector = selector_from_name(selector);\n    let output = call_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n    let Ok(CallSuccess { ret_data }) = output else {\n        panic!(\"Wrong call output\")\n    };\n    let block_timestamp = &ret_data[0];\n\n    cheatnet_state.start_cheat_block_timestamp(contract_address, 123);\n    let output = call_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n    let Ok(CallSuccess { ret_data }) = output else {\n        panic!(\"Wrong call output\")\n    };\n    let cheated_block_timestamp = &ret_data[0];\n\n    cheatnet_state.stop_cheat_block_timestamp(contract_address);\n\n    let output = call_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n    let Ok(CallSuccess { ret_data }) = output else {\n        panic!(\"Wrong call output\")\n    };\n    let uncheated_block_timestamp = &ret_data[0];\n\n    assert_eq!(cheated_block_timestamp, &Felt::from(123));\n    assert_eq!(uncheated_block_timestamp, block_timestamp);\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/starknet/execution.rs",
    "content": "use crate::common::state::{create_cached_state, create_fork_cached_state_at};\nuse crate::common::{\n    call_contract_extended_result, deploy_contract, execute_entry_point_without_revert,\n    selector_from_name,\n};\nuse blockifier::execution::contract_class::TrackedResource;\nuse blockifier::execution::syscalls::hint_processor::ENTRYPOINT_FAILED_ERROR_FELT;\nuse blockifier::state::state_api::StateReader;\nuse cheatnet::runtime_extensions::call_to_blockifier_runtime_extension::rpc::CallFailure;\nuse cheatnet::state::CheatnetState;\nuse conversions::IntoConv;\nuse conversions::felt::FromShortString;\nuse starknet_api::felt;\nuse starknet_api::state::StorageKey;\nuse starknet_types_core::felt::Felt;\nuse tempfile::TempDir;\n\n#[test]\nfn test_state_reverted_in_nested_call() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address = deploy_contract(&mut cached_state, &mut cheatnet_state, \"Revert\", &[]);\n\n    // Mock contract just to get a class hash, it can be replaced with any other declared contract\n    let mock_contract = deploy_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        \"MockCheckerLibCall\",\n        &[],\n    );\n    let mock_class_hash = cached_state.get_class_hash_at(mock_contract).unwrap();\n\n    let res = execute_entry_point_without_revert(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector_from_name(\"modify_in_nested_call_and_handle_panic\"),\n        &[contract_address.into_(), mock_class_hash.into_()],\n        TrackedResource::SierraGas,\n    )\n    .unwrap();\n\n    assert!(!res.execution.failed);\n    let [inner_call] = &res.inner_calls[..] else {\n        panic!(\"Expected one inner call, got {:?}\", res.inner_calls);\n    };\n    assert_eq!(\n        inner_call.execution.retdata.0,\n        &[Felt::from_short_string(\"modify_contract_var_and_panic\").unwrap()]\n    );\n    assert!(inner_call.execution.events.is_empty());\n    assert!(inner_call.execution.l2_to_l1_messages.is_empty());\n}\n\n#[test]\nfn test_state_not_reverted_in_top_call_when_raw_execution() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    // Mock contract just to get a class hash, it can be replaced with any other declared contract\n    let mock_contract = deploy_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        \"MockCheckerLibCall\",\n        &[],\n    );\n    let mock_class_hash = cached_state.get_class_hash_at(mock_contract).unwrap();\n    let contract_address = deploy_contract(&mut cached_state, &mut cheatnet_state, \"Revert\", &[]);\n\n    // Call via `execute_call_entry_point` directly (no revert on failure) to confirm\n    // that state mutations (events, messages) survive a failed call at this layer.\n    let res = execute_entry_point_without_revert(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector_from_name(\"modify_contract_var_and_panic\"),\n        &[mock_class_hash.into_()],\n        TrackedResource::SierraGas,\n    )\n    .unwrap();\n\n    assert!(res.execution.failed);\n    assert!(res.inner_calls.is_empty());\n\n    assert!(!res.execution.events.is_empty());\n    assert!(!res.execution.l2_to_l1_messages.is_empty());\n}\n\n#[test]\nfn test_state_reverted_in_top_call_when_call_entry_point() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    // Mock contract just to get a class hash, it can be replaced with any other declared contract\n    let mock_contract = deploy_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        \"MockCheckerLibCall\",\n        &[],\n    );\n    let mock_class_hash = cached_state.get_class_hash_at(mock_contract).unwrap();\n    let contract_address = deploy_contract(&mut cached_state, &mut cheatnet_state, \"Revert\", &[]);\n\n    // Call via `call_entry_point`, so the same way contract calls are executed in test bodies.\n    // On failure, it should revert all state mutations.\n    let res = call_contract_extended_result(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector_from_name(\"modify_contract_var_and_panic\"),\n        &[mock_class_hash.into_()],\n    )\n    .call_info\n    .expect(\"Call info should be present\");\n\n    assert!(res.execution.failed);\n    assert!(res.inner_calls.is_empty());\n\n    assert!(res.execution.events.is_empty());\n    assert!(res.execution.l2_to_l1_messages.is_empty());\n    assert_eq!(\n        res.execution.retdata.0,\n        &[Felt::from_short_string(\"modify_contract_var_and_panic\").unwrap()]\n    );\n}\n\n#[test]\nfn test_state_reverted_only_in_failed_nested_call_when_raw_execution() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address = deploy_contract(&mut cached_state, &mut cheatnet_state, \"Revert\", &[]);\n    let storage_key = StorageKey::try_from(felt!(123_u64)).unwrap();\n\n    // Call via `execute_call_entry_point` directly (no revert on failure) to confirm\n    // that state mutations (storage, events, messages) survive a failed call at this layer.\n    let res = execute_entry_point_without_revert(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector_from_name(\"modify_in_top_and_nested_calls_and_panic\"),\n        &[(*storage_key.0).into_()],\n        TrackedResource::SierraGas,\n    )\n    .unwrap();\n\n    assert!(res.execution.failed);\n    let [inner_call, failed_inner_call] = &res.inner_calls[..] else {\n        panic!(\"Expected two inner calls, got {:?}\", res.inner_calls);\n    };\n    // Successful inner call state was not reverted.\n    assert!(!inner_call.execution.failed);\n    assert!(!inner_call.execution.events.is_empty());\n    assert!(!inner_call.execution.l2_to_l1_messages.is_empty());\n\n    // Failed inner call state was reverted by `execute_inner_call` function.\n    assert!(failed_inner_call.execution.failed);\n    assert!(failed_inner_call.execution.events.is_empty());\n    assert!(failed_inner_call.execution.l2_to_l1_messages.is_empty());\n\n    assert!(!res.execution.events.is_empty());\n    assert!(!res.execution.l2_to_l1_messages.is_empty());\n    assert_eq!(\n        res.execution.retdata.0,\n        &[\n            Felt::from_short_string(\"modify_specific_storage\").unwrap(),\n            ENTRYPOINT_FAILED_ERROR_FELT\n        ]\n    );\n\n    let storage_value = cached_state\n        .get_storage_at(contract_address, storage_key)\n        .unwrap();\n    assert_eq!(\n        storage_value,\n        felt!(99_u8),\n        \"Storage should be 99 without revert\"\n    );\n}\n\n#[test]\nfn test_state_reverted_in_top_and_nested_calls_when_call_entry_point() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address = deploy_contract(&mut cached_state, &mut cheatnet_state, \"Revert\", &[]);\n    let storage_key = StorageKey::try_from(felt!(123_u64)).unwrap();\n\n    // Call via `call_entry_point`, so the same way contract calls are executed in test bodies.\n    // On failure, it should revert all state mutations.\n    let res = call_contract_extended_result(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector_from_name(\"modify_in_top_and_nested_calls_and_panic\"),\n        &[(*storage_key.0).into_()],\n    );\n\n    let res_call_info = res.call_info.expect(\"Call info should be present\");\n    assert!(res_call_info.execution.failed);\n    let [inner_call, failed_inner_call] = &res_call_info.inner_calls[..] else {\n        panic!(\n            \"Expected two inner calls, got {:?}\",\n            res_call_info.inner_calls\n        );\n    };\n    // Now state in all nested calls should be reverted.\n    assert!(!inner_call.execution.failed);\n    assert!(inner_call.execution.events.is_empty());\n    assert!(inner_call.execution.l2_to_l1_messages.is_empty());\n    assert!(failed_inner_call.execution.failed);\n    assert!(failed_inner_call.execution.events.is_empty());\n    assert!(failed_inner_call.execution.l2_to_l1_messages.is_empty());\n\n    assert!(res_call_info.execution.events.is_empty());\n    assert!(res_call_info.execution.l2_to_l1_messages.is_empty());\n    assert_eq!(\n        res_call_info.execution.retdata.0,\n        &[\n            Felt::from_short_string(\"modify_specific_storage\").unwrap(),\n            ENTRYPOINT_FAILED_ERROR_FELT\n        ]\n    );\n\n    let CallFailure::Recoverable { panic_data } = res.call_result.as_ref().unwrap_err() else {\n        panic!(\"Expected Recoverable error, got {:?}\", res.call_result);\n    };\n    assert_eq!(\n        panic_data,\n        &[\n            Felt::from_short_string(\"modify_specific_storage\").unwrap(),\n            ENTRYPOINT_FAILED_ERROR_FELT,\n            ENTRYPOINT_FAILED_ERROR_FELT\n        ]\n    );\n\n    let storage_value = cached_state\n        .get_storage_at(contract_address, storage_key)\n        .unwrap();\n    assert_eq!(\n        storage_value,\n        felt!(0_u8),\n        \"Storage should be 0 after revert\"\n    );\n}\n\n#[test]\nfn test_tracked_resources() {\n    let cache_dir = TempDir::new().unwrap();\n    let mut cached_state = create_fork_cached_state_at(782_878, cache_dir.path().to_str().unwrap());\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address = deploy_contract(\n        &mut cached_state,\n        &mut cheatnet_state,\n        \"TrackedResources\",\n        &[],\n    );\n\n    let main_call_info = execute_entry_point_without_revert(\n        &mut cached_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector_from_name(\"call_twice\"),\n        &[],\n        TrackedResource::SierraGas,\n    )\n    .unwrap();\n\n    // `call_twice` from the `TrackedResources` contract\n    assert!(!main_call_info.execution.failed);\n    assert_eq!(main_call_info.inner_calls.len(), 2);\n    assert_eq!(main_call_info.tracked_resource, TrackedResource::SierraGas);\n    assert_ne!(main_call_info.execution.gas_consumed, 0);\n\n    // `call_single` from the forked proxy contract\n    let first_inner_call = main_call_info.inner_calls.first().unwrap();\n    assert_eq!(\n        first_inner_call.tracked_resource,\n        TrackedResource::CairoSteps\n    );\n    assert_eq!(first_inner_call.execution.gas_consumed, 0);\n    assert_ne!(first_inner_call.resources.vm_resources.n_steps, 0);\n    assert_eq!(first_inner_call.inner_calls.len(), 1);\n\n    // `call_internal` from the `TrackedResources` contract\n    let inner_inner_call = first_inner_call.inner_calls.first().unwrap();\n    assert_eq!(\n        inner_inner_call.tracked_resource,\n        TrackedResource::CairoSteps\n    );\n    assert_eq!(inner_inner_call.execution.gas_consumed, 0);\n    assert_ne!(inner_inner_call.resources.vm_resources.n_steps, 0);\n\n    // `call_internal` from the `TrackedResources` contract\n    let second_inner_call = main_call_info.inner_calls.last().unwrap();\n    assert_eq!(\n        second_inner_call.tracked_resource,\n        TrackedResource::SierraGas\n    );\n    assert_ne!(second_inner_call.execution.gas_consumed, 0);\n    assert_eq!(second_inner_call.resources.vm_resources.n_steps, 0);\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/starknet/forking.rs",
    "content": "use crate::common::assertions::{assert_error, assert_panic, assert_success};\nuse crate::common::cache::{purge_cache, read_cache};\nuse crate::common::state::{create_fork_cached_state, create_fork_cached_state_at};\nuse crate::common::{call_contract, deploy_contract};\nuse blockifier::execution::syscalls::hint_processor::ENTRYPOINT_FAILED_ERROR_FELT;\nuse blockifier::state::cached_state::CachedState;\nuse camino::Utf8Path;\nuse cheatnet::constants::build_testing_state;\nuse cheatnet::forking::cache::cache_version;\nuse cheatnet::forking::state::ForkStateReader;\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::storage::selector_from_name;\nuse cheatnet::state::{BlockInfoReader, CheatnetState, ExtendedStateReader};\nuse conversions::byte_array::ByteArray;\nuse conversions::string::TryFromHexStr;\nuse rayon::prelude::{IntoParallelRefIterator, ParallelIterator};\nuse serde_json::Value;\nuse starknet_api::block::BlockNumber;\nuse starknet_api::core::ContractAddress;\nuse starknet_types_core::felt::Felt;\nuse tempfile::TempDir;\n\n#[test]\nfn fork_simple() {\n    let cache_dir = TempDir::new().unwrap();\n    let mut cached_fork_state = create_fork_cached_state(cache_dir.path().to_str().unwrap());\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address = ContractAddress::try_from_hex_str(\n        \"0x202de98471a4fae6bcbabb96cab00437d381abc58b02509043778074d6781e9\",\n    )\n    .unwrap();\n\n    let selector = selector_from_name(\"get_balance\");\n    let output = call_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n    assert_success(output, &[Felt::from(0)]);\n\n    let selector = selector_from_name(\"increase_balance\");\n    call_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[Felt::from(100)],\n    )\n    .unwrap();\n\n    let selector = selector_from_name(\"get_balance\");\n    let output = call_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n    assert_success(output, &[Felt::from(100)]);\n}\n\n#[test]\nfn try_calling_nonexistent_contract() {\n    let cache_dir = TempDir::new().unwrap();\n    let mut cached_fork_state = create_fork_cached_state(cache_dir.path().to_str().unwrap());\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address = ContractAddress::from(1_u8);\n    let selector = selector_from_name(\"get_balance\");\n\n    let output = call_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n\n    let msg = \"Contract not deployed at address: 0x1\";\n    let mut panic_data_felts = ByteArray::from(msg).serialize_with_magic();\n    panic_data_felts.push(ENTRYPOINT_FAILED_ERROR_FELT);\n    assert_panic(output, &panic_data_felts);\n}\n\n#[test]\nfn test_forking_at_block_number() {\n    let cache_dir = TempDir::new().unwrap();\n\n    {\n        let mut cheatnet_state = CheatnetState::default();\n        let mut cached_state_before_delopy =\n            create_fork_cached_state_at(50_000, cache_dir.path().to_str().unwrap());\n\n        let mut cached_state_after_deploy =\n            create_fork_cached_state_at(53_681, cache_dir.path().to_str().unwrap());\n\n        let contract_address = ContractAddress::try_from_hex_str(\n            \"0x202de98471a4fae6bcbabb96cab00437d381abc58b02509043778074d6781e9\",\n        )\n        .unwrap();\n\n        let selector = selector_from_name(\"get_balance\");\n        let output = call_contract(\n            &mut cached_state_before_delopy,\n            &mut cheatnet_state,\n            &contract_address,\n            selector,\n            &[],\n        );\n\n        let msg = \"Contract not deployed at address: 0x202de98471a4fae6bcbabb96cab00437d381abc58b02509043778074d6781e9\";\n        let mut panic_data_felts = ByteArray::from(msg).serialize_with_magic();\n        panic_data_felts.push(ENTRYPOINT_FAILED_ERROR_FELT);\n        assert_panic(output, &panic_data_felts);\n\n        let selector = selector_from_name(\"get_balance\");\n        let output = call_contract(\n            &mut cached_state_after_deploy,\n            &mut cheatnet_state,\n            &contract_address,\n            selector,\n            &[],\n        );\n\n        assert_success(output, &[Felt::from(0)]);\n    }\n\n    purge_cache(cache_dir.path().to_str().unwrap());\n}\n\n#[test]\nfn call_forked_contract_from_other_contract() {\n    let cache_dir = TempDir::new().unwrap();\n    let mut cached_fork_state = create_fork_cached_state(cache_dir.path().to_str().unwrap());\n    let mut cheatnet_state = CheatnetState::default();\n\n    let forked_contract_address =\n        Felt::try_from_hex_str(\"0x202de98471a4fae6bcbabb96cab00437d381abc58b02509043778074d6781e9\")\n            .unwrap();\n\n    let contract_address = deploy_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        \"ForkingChecker\",\n        &[Felt::from(1)],\n    );\n\n    let selector = selector_from_name(\"get_balance_call_contract\");\n    let output = call_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[forked_contract_address],\n    );\n    assert_success(output, &[Felt::from(0)]);\n}\n\n#[test]\nfn library_call_on_forked_class_hash() {\n    let cache_dir = TempDir::new().unwrap();\n    let mut cached_fork_state = create_fork_cached_state(cache_dir.path().to_str().unwrap());\n    let mut cheatnet_state = CheatnetState::default();\n\n    let forked_class_hash = Felt::try_from_hex_str(\n        \"0x06a7eb29ee38b0a0b198e39ed6ad458d2e460264b463351a0acfc05822d61550\",\n    )\n    .unwrap();\n\n    let contract_address = deploy_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        \"ForkingChecker\",\n        &[Felt::from(1)],\n    );\n\n    let selector = selector_from_name(\"get_balance_library_call\");\n    let output = call_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[forked_class_hash],\n    );\n    assert_success(output, &[Felt::from(0)]);\n\n    call_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector_from_name(\"set_balance\"),\n        &[Felt::from(100)],\n    )\n    .unwrap();\n\n    let output = call_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[forked_class_hash],\n    );\n    assert_success(output, &[Felt::from(100)]);\n}\n\n#[test]\nfn call_forked_contract_from_constructor() {\n    let cache_dir = TempDir::new().unwrap();\n    let mut cached_fork_state = create_fork_cached_state(cache_dir.path().to_str().unwrap());\n    let mut cheatnet_state = CheatnetState::default();\n\n    let forked_class_hash = Felt::try_from_hex_str(\n        \"0x06a7eb29ee38b0a0b198e39ed6ad458d2e460264b463351a0acfc05822d61550\",\n    )\n    .unwrap();\n\n    let forked_contract_address =\n        Felt::try_from_hex_str(\"0x202de98471a4fae6bcbabb96cab00437d381abc58b02509043778074d6781e9\")\n            .unwrap();\n\n    let contract_address = deploy_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        \"ForkingChecker\",\n        &[Felt::from(0), forked_contract_address],\n    );\n\n    let selector = selector_from_name(\"get_balance_library_call\");\n    let output = call_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[forked_class_hash],\n    );\n    assert_success(output, &[Felt::from(0)]);\n}\n\n#[test]\nfn call_forked_contract_get_block_info_via_proxy() {\n    let cache_dir = TempDir::new().unwrap();\n    let mut cached_fork_state =\n        create_fork_cached_state_at(53_655, cache_dir.path().to_str().unwrap());\n    let block_info = cached_fork_state.state.get_block_info().unwrap();\n    let mut cheatnet_state = CheatnetState {\n        block_info,\n        ..Default::default()\n    };\n\n    let forked_contract_address =\n        Felt::try_from_hex_str(\"0x3d80c579ad7d83ff46634abe8f91f9d2080c5c076d4f0f59dd810f9b3f01164\")\n            .unwrap();\n\n    let contract_address = deploy_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        \"BlockInfoCheckerProxy\",\n        &[],\n    );\n\n    let selector = selector_from_name(\"read_block_number\");\n    let output = call_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[forked_contract_address],\n    );\n    assert_success(output, &[Felt::from(53_655)]);\n\n    let selector = selector_from_name(\"read_block_timestamp\");\n    let output = call_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[forked_contract_address],\n    );\n    assert_success(output, &[Felt::from(1_711_548_115)]);\n\n    let selector = selector_from_name(\"read_sequencer_address\");\n    let output = call_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[forked_contract_address],\n    );\n    assert_success(\n        output,\n        &[Felt::try_from_hex_str(\n            \"0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8\",\n        )\n        .unwrap()],\n    );\n}\n\n#[test]\nfn call_forked_contract_get_block_info_via_libcall() {\n    let cache_dir = TempDir::new().unwrap();\n    let mut cached_fork_state =\n        create_fork_cached_state_at(53_669, cache_dir.path().to_str().unwrap());\n    let block_info = cached_fork_state.state.get_block_info().unwrap();\n    let mut cheatnet_state = CheatnetState {\n        block_info,\n        ..Default::default()\n    };\n\n    let forked_class_hash = Felt::try_from_hex_str(\n        \"0x04947e141416a51b57a59bc8786b5c0e02751d33e46383fa9cebbf9cf6f30844\",\n    )\n    .unwrap();\n\n    let contract_address = deploy_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        \"BlockInfoCheckerLibCall\",\n        &[],\n    );\n\n    let selector = selector_from_name(\"read_block_number_with_lib_call\");\n    let output = call_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[forked_class_hash],\n    );\n    assert_success(output, &[Felt::from(53_669)]);\n\n    let selector = selector_from_name(\"read_block_timestamp_with_lib_call\");\n    let output = call_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[forked_class_hash],\n    );\n    assert_success(output, &[Felt::from(1_711_551_518)]);\n\n    let selector = selector_from_name(\"read_sequencer_address_with_lib_call\");\n    let output = call_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[forked_class_hash],\n    );\n    assert_success(\n        output,\n        &[Felt::try_from_hex_str(\n            \"0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8\",\n        )\n        .unwrap()],\n    );\n}\n\n#[test]\nfn using_specified_block_nb_is_cached() {\n    let cache_dir = TempDir::new().unwrap();\n    let run_test = || {\n        let mut cached_state =\n            create_fork_cached_state_at(53_669, cache_dir.path().to_str().unwrap());\n        let _ = cached_state.state.get_block_info().unwrap();\n\n        let mut cheatnet_state = CheatnetState::default();\n\n        let contract_address = ContractAddress::try_from_hex_str(\n            \"0x202de98471a4fae6bcbabb96cab00437d381abc58b02509043778074d6781e9\",\n        )\n        .unwrap();\n\n        let selector = selector_from_name(\"get_balance\");\n        let output = call_contract(\n            &mut cached_state,\n            &mut cheatnet_state,\n            &contract_address,\n            selector,\n            &[],\n        );\n\n        assert_success(output, &[Felt::from(0)]);\n    };\n\n    let assert_cache = || {\n        // Assertions\n        let cache = read_cache(\n            cache_dir\n                .path()\n                .join(format!(\"*v{}.json\", cache_version()))\n                .to_str()\n                .unwrap(),\n        );\n        assert_eq!(\n            cache[\"storage_at\"].as_object().unwrap()\n                [\"0x202de98471a4fae6bcbabb96cab00437d381abc58b02509043778074d6781e9\"]\n                .as_object()\n                .unwrap()[\"0x206f38f7e4f15e87567361213c28f235cccdaa1d7fd34c9db1dfe9489c6a091\"],\n            \"0x0\"\n        );\n        assert_eq!(\n            cache[\"class_hash_at\"].as_object().unwrap()[\"0x202de98471a4fae6bcbabb96cab00437d381abc58b02509043778074d6781e9\"],\n            \"0x6a7eb29ee38b0a0b198e39ed6ad458d2e460264b463351a0acfc05822d61550\"\n        );\n\n        match cache[\"compiled_contract_class\"].as_object().unwrap()[\"0x6a7eb29ee38b0a0b198e39ed6ad458d2e460264b463351a0acfc05822d61550\"]\n        {\n            Value::Object(_) => {}\n            _ => panic!(\"The compiled_contract_class entry is not an object\"),\n        }\n\n        assert_eq!(\n            cache[\"block_info\"].as_object().unwrap()[\"block_number\"]\n                .as_u64()\n                .unwrap(),\n            53_669\n        );\n        assert_eq!(\n            cache[\"block_info\"].as_object().unwrap()[\"block_timestamp\"]\n                .as_u64()\n                .unwrap(),\n            1_711_551_518\n        );\n        assert_eq!(\n            cache[\"block_info\"].as_object().unwrap()[\"sequencer_address\"],\n            \"0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8\"\n        );\n    };\n    // 1st run - check whether cache is written\n    run_test();\n    assert_cache();\n    // 2nd run - check whether cache still the same after, as after the 1st\n    run_test();\n    assert_cache();\n\n    purge_cache(cache_dir.path().to_str().unwrap());\n}\n\n#[test]\nfn test_cache_merging() {\n    fn run_test(cache_dir: &str, contract_address: &str, balance: u64) {\n        let mut cached_state = create_fork_cached_state_at(53_680, cache_dir);\n        let _ = cached_state.state.get_block_info().unwrap();\n\n        let mut cheatnet_state = CheatnetState::default();\n\n        let contract_address = ContractAddress::try_from_hex_str(contract_address).unwrap();\n\n        let selector = selector_from_name(\"get_balance\");\n        let output = call_contract(\n            &mut cached_state,\n            &mut cheatnet_state,\n            &contract_address,\n            selector,\n            &[],\n        );\n\n        assert_success(output, &[Felt::from(balance)]);\n    }\n\n    let cache_dir = TempDir::new().unwrap();\n    let contract_1_address = \"0x202de98471a4fae6bcbabb96cab00437d381abc58b02509043778074d6781e9\";\n    let contract_2_address = \"0x4e6e4924e5db5ffe394484860a8f60e5c292d1937fd80040b312aeea921be11\";\n\n    let assert_cache = || {\n        // Assertions\n        let cache = read_cache(\n            cache_dir\n                .path()\n                .join(format!(\"*v{}.json\", cache_version()))\n                .to_str()\n                .unwrap(),\n        );\n\n        let contract_1_class_hash =\n            \"0x6a7eb29ee38b0a0b198e39ed6ad458d2e460264b463351a0acfc05822d61550\";\n        let contract_2_class_hash =\n            \"0x2b08ef708af3e6263e02ce541a0099e7c30bac5a8d3d13e42c25c787fa4163\";\n\n        let balance_storage_address =\n            \"0x206f38f7e4f15e87567361213c28f235cccdaa1d7fd34c9db1dfe9489c6a091\";\n        assert_eq!(\n            cache[\"storage_at\"].as_object().unwrap()[contract_1_address]\n                .as_object()\n                .unwrap()[balance_storage_address],\n            \"0x0\"\n        );\n        assert_eq!(\n            cache[\"storage_at\"].as_object().unwrap()[contract_2_address]\n                .as_object()\n                .unwrap()[balance_storage_address],\n            \"0x0\"\n        );\n\n        assert_eq!(\n            cache[\"class_hash_at\"].as_object().unwrap()[contract_1_address],\n            contract_1_class_hash\n        );\n\n        assert_eq!(\n            cache[\"class_hash_at\"].as_object().unwrap()[contract_2_address],\n            contract_2_class_hash\n        );\n\n        match cache[\"compiled_contract_class\"].as_object().unwrap()[contract_1_class_hash] {\n            Value::Object(_) => {}\n            _ => panic!(\"The compiled_contract_class entry is not an object\"),\n        }\n        match cache[\"compiled_contract_class\"].as_object().unwrap()[contract_2_class_hash] {\n            Value::Object(_) => {}\n            _ => panic!(\"The compiled_contract_class entry is not an object\"),\n        }\n\n        assert_eq!(\n            cache[\"block_info\"].as_object().unwrap()[\"block_number\"]\n                .as_u64()\n                .unwrap(),\n            53_680\n        );\n        assert_eq!(\n            cache[\"block_info\"].as_object().unwrap()[\"block_timestamp\"]\n                .as_u64()\n                .unwrap(),\n            1_711_554_206\n        );\n        assert_eq!(\n            cache[\"block_info\"].as_object().unwrap()[\"sequencer_address\"],\n            \"0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8\"\n        );\n    };\n    let cache_dir_str = cache_dir.path().to_str().unwrap();\n\n    run_test(cache_dir_str, contract_1_address, 0);\n    run_test(cache_dir_str, contract_2_address, 0);\n    assert_cache();\n\n    purge_cache(cache_dir.path().to_str().unwrap());\n\n    // Parallel execution\n    [\n        (cache_dir_str, contract_1_address, 0),\n        (cache_dir_str, contract_2_address, 0),\n    ]\n    .par_iter()\n    .for_each(|param_tpl| run_test(param_tpl.0, param_tpl.1, param_tpl.2));\n\n    assert_cache();\n}\n\n#[test]\nfn test_cached_block_info_merging() {\n    fn run_test(cache_dir: &str, balance: u64, call_get_block_info: bool) {\n        let mut cached_state = create_fork_cached_state_at(53_680, cache_dir);\n        if call_get_block_info {\n            let _ = cached_state.state.get_block_info().unwrap();\n        }\n        let mut cheatnet_state = CheatnetState::default();\n\n        let contract_address = ContractAddress::try_from_hex_str(\n            \"0x202de98471a4fae6bcbabb96cab00437d381abc58b02509043778074d6781e9\",\n        )\n        .unwrap();\n\n        let selector = selector_from_name(\"get_balance\");\n        let output = call_contract(\n            &mut cached_state,\n            &mut cheatnet_state,\n            &contract_address,\n            selector,\n            &[],\n        );\n\n        assert_success(output, &[Felt::from(balance)]);\n    }\n\n    let cache_dir = TempDir::new().unwrap();\n\n    let assert_cached_block_info = |is_block_info_cached: bool| {\n        // Assertions\n        let cache = read_cache(\n            cache_dir\n                .path()\n                .join(format!(\"*v{}.json\", cache_version()))\n                .to_str()\n                .unwrap(),\n        );\n        if is_block_info_cached {\n            assert_eq!(\n                cache[\"block_info\"].as_object().unwrap()[\"block_number\"]\n                    .as_u64()\n                    .unwrap(),\n                53_680\n            );\n            assert_eq!(\n                cache[\"block_info\"].as_object().unwrap()[\"block_timestamp\"]\n                    .as_u64()\n                    .unwrap(),\n                1_711_554_206\n            );\n            assert_eq!(\n                cache[\"block_info\"].as_object().unwrap()[\"sequencer_address\"],\n                \"0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8\"\n            );\n        } else {\n            assert_eq!(cache[\"block_info\"].as_object(), None);\n        }\n    };\n    let cache_dir_str = cache_dir.path().to_str().unwrap();\n\n    run_test(cache_dir_str, 0, false);\n    assert_cached_block_info(false);\n    run_test(cache_dir_str, 0, true);\n    assert_cached_block_info(true);\n    run_test(cache_dir_str, 0, false);\n    assert_cached_block_info(true);\n}\n\n#[test]\nfn test_calling_nonexistent_url() {\n    let temp_dir = TempDir::new().unwrap();\n    let nonexistent_url = \"http://nonexistent-node-address.com\".parse().unwrap();\n    let mut cached_fork_state = CachedState::new(ExtendedStateReader {\n        dict_state_reader: build_testing_state(),\n        fork_state_reader: Some(\n            ForkStateReader::new(\n                nonexistent_url,\n                BlockNumber(1),\n                Utf8Path::from_path(temp_dir.path()).unwrap(),\n            )\n            .unwrap(),\n        ),\n    });\n\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address = ContractAddress::try_from_hex_str(\n        \"0x202de98471a4fae6bcbabb96cab00437d381abc58b02509043778074d6781e9\",\n    )\n    .unwrap();\n\n    let selector = selector_from_name(\"get_balance\");\n    let output = call_contract(\n        &mut cached_fork_state,\n        &mut cheatnet_state,\n        &contract_address,\n        selector,\n        &[],\n    );\n\n    assert_error(\n        output,\n        \"Unable to reach the node. Check your internet connection and node url\",\n    );\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/starknet/mod.rs",
    "content": "// Testing whether Cheatnet's behavior is consistent with Starknet's\nmod block;\nmod cheat_fork;\nmod execution;\nmod forking;\nmod nonce;\nmod timestamp;\n"
  },
  {
    "path": "crates/cheatnet/tests/starknet/nonce.rs",
    "content": "use crate::common::assertions::ClassHashAssert;\nuse crate::common::{call_contract, deploy};\nuse crate::{\n    common::assertions::assert_success,\n    common::{deploy_contract, get_contracts, recover_data, state::create_cached_state},\n};\nuse blockifier::state::state_api::State;\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::declare::declare;\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::storage::selector_from_name;\nuse cheatnet::state::CheatnetState;\nuse starknet_api::core::ContractAddress;\nuse starknet_types_core::felt::Felt;\n// We've decided that the nonce should not change in tests\n// and should remain 0 at all times, this may be revised in the future.\n\nfn check_nonce(\n    state: &mut dyn State,\n    cheatnet_state: &mut CheatnetState,\n    contract_address: &ContractAddress,\n) -> Felt {\n    let write_nonce = selector_from_name(\"write_nonce\");\n    let read_nonce = selector_from_name(\"read_nonce\");\n\n    let output = call_contract(state, cheatnet_state, contract_address, write_nonce, &[]);\n\n    assert_success(output, &[]);\n\n    let output = call_contract(state, cheatnet_state, contract_address, read_nonce, &[]);\n\n    recover_data(output)[0]\n}\n\n#[test]\nfn nonce_transactions() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address = deploy_contract(&mut cached_state, &mut cheatnet_state, \"Noncer\", &[]);\n\n    let old_nonce = check_nonce(&mut cached_state, &mut cheatnet_state, &contract_address);\n    let new_nonce = check_nonce(&mut cached_state, &mut cheatnet_state, &contract_address);\n\n    assert_eq!(old_nonce, Felt::from(0));\n    assert_eq!(old_nonce, new_nonce);\n}\n\n#[test]\nfn nonce_declare_deploy() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address = deploy_contract(&mut cached_state, &mut cheatnet_state, \"Noncer\", &[]);\n\n    let contracts_data = get_contracts();\n\n    let nonce1 = check_nonce(&mut cached_state, &mut cheatnet_state, &contract_address);\n\n    let class_hash = declare(&mut cached_state, \"HelloStarknet\", &contracts_data)\n        .unwrap()\n        .unwrap_success();\n\n    let nonce2 = check_nonce(&mut cached_state, &mut cheatnet_state, &contract_address);\n\n    deploy(&mut cached_state, &mut cheatnet_state, &class_hash, &[]);\n\n    let nonce3 = check_nonce(&mut cached_state, &mut cheatnet_state, &contract_address);\n\n    assert_eq!(nonce1, Felt::from(0));\n    assert_eq!(nonce1, nonce2);\n    assert_eq!(nonce2, nonce3);\n}\n"
  },
  {
    "path": "crates/cheatnet/tests/starknet/timestamp.rs",
    "content": "use crate::common::call_contract;\nuse crate::{\n    common::assertions::assert_success,\n    common::{deploy_contract, recover_data, state::create_cached_state},\n};\nuse blockifier::state::state_api::State;\nuse cheatnet::runtime_extensions::forge_runtime_extension::cheatcodes::storage::selector_from_name;\nuse cheatnet::state::CheatnetState;\nuse starknet_api::core::ContractAddress;\nuse starknet_types_core::felt::Felt;\n\nfn check_timestamp(\n    state: &mut dyn State,\n    cheatnet_state: &mut CheatnetState,\n    contract_address: &ContractAddress,\n) -> Felt {\n    let write_timestamp = selector_from_name(\"write_timestamp\");\n    let read_timestamp = selector_from_name(\"read_timestamp\");\n\n    let output = call_contract(\n        state,\n        cheatnet_state,\n        contract_address,\n        write_timestamp,\n        &[],\n    );\n\n    assert_success(output, &[]);\n\n    let output = call_contract(state, cheatnet_state, contract_address, read_timestamp, &[]);\n    recover_data(output)[0]\n}\n\n#[test]\nfn timestamp_does_not_decrease() {\n    let mut cached_state = create_cached_state();\n    let mut cheatnet_state = CheatnetState::default();\n\n    let contract_address =\n        deploy_contract(&mut cached_state, &mut cheatnet_state, \"Timestamper\", &[]);\n\n    let old_timestamp = check_timestamp(&mut cached_state, &mut cheatnet_state, &contract_address);\n    let new_timestamp = check_timestamp(&mut cached_state, &mut cheatnet_state, &contract_address);\n\n    assert!(old_timestamp <= new_timestamp);\n}\n"
  },
  {
    "path": "crates/configuration/Cargo.toml",
    "content": "[package]\nname = \"configuration\"\nversion = \"1.0.0\"\nedition.workspace = true\n\n[features]\ntesting = []\n\n[dependencies]\nanyhow.workspace = true\nserde_json.workspace = true\nserde.workspace = true\ncamino.workspace = true\ntoml.workspace = true\ntempfile.workspace = true\n\n[dev-dependencies]\nurl.workspace = true\n"
  },
  {
    "path": "crates/configuration/src/core.rs",
    "content": "use crate::Config;\nuse anyhow::anyhow;\nuse serde_json::Number;\nuse std::env;\n\nfn resolve_env_variables(config: serde_json::Value) -> anyhow::Result<serde_json::Value> {\n    match config {\n        serde_json::Value::Object(map) => {\n            let val = map\n                .into_iter()\n                .map(|(k, v)| -> anyhow::Result<(String, serde_json::Value)> {\n                    Ok((k, resolve_env_variables(v)?))\n                })\n                .collect::<anyhow::Result<serde_json::Map<String, serde_json::Value>>>()?;\n            Ok(serde_json::Value::Object(val))\n        }\n        serde_json::Value::Array(val) => {\n            let val = val\n                .into_iter()\n                .map(resolve_env_variables)\n                .collect::<anyhow::Result<Vec<serde_json::Value>>>()?;\n            Ok(serde_json::Value::Array(val))\n        }\n        serde_json::Value::String(val) if val.starts_with('$') => resolve_env_variable(&val),\n        val => Ok(val),\n    }\n}\n\nfn resolve_env_variable(var: &str) -> anyhow::Result<serde_json::Value> {\n    assert!(var.starts_with('$'));\n    let mut initial_value = &var[1..];\n    if initial_value.starts_with('{') && initial_value.ends_with('}') {\n        initial_value = &initial_value[1..initial_value.len() - 1];\n    }\n    let value = env::var(initial_value)?;\n\n    if let Ok(value) = value.parse::<Number>() {\n        return Ok(serde_json::Value::Number(value));\n    }\n    if let Ok(value) = value.parse::<bool>() {\n        return Ok(serde_json::Value::Bool(value));\n    }\n    Ok(serde_json::Value::String(value))\n}\n\nfn get_with_ownership(config: serde_json::Value, key: &str) -> Option<serde_json::Value> {\n    match config {\n        serde_json::Value::Object(mut map) => map.remove(key),\n        _ => None,\n    }\n}\n\nfn get_profile(\n    raw_config: serde_json::Value,\n    tool: &str,\n    profile: &str,\n) -> Option<serde_json::Value> {\n    let profile_name = profile;\n    let tool_config = get_with_ownership(raw_config, tool)\n        .unwrap_or(serde_json::Value::Object(serde_json::Map::new()));\n\n    get_with_ownership(tool_config, profile_name)\n}\n\npub enum Profile {\n    None,\n    Default,\n    Some(String),\n}\n\npub fn load_config<T: Config + Default>(\n    raw_config: serde_json::Value,\n    profile: Profile,\n) -> anyhow::Result<T> {\n    let raw_config_json = match profile {\n        Profile::None => raw_config,\n        Profile::Default => get_profile(raw_config, T::tool_name(), \"default\")\n            .unwrap_or_else(|| serde_json::Value::Object(serde_json::Map::new())),\n        Profile::Some(profile) => get_profile(raw_config, T::tool_name(), &profile)\n            .ok_or_else(|| anyhow!(\"Profile [{profile}] not found in config\"))?,\n    };\n    T::from_raw(resolve_env_variables(raw_config_json)?)\n}\n"
  },
  {
    "path": "crates/configuration/src/lib.rs",
    "content": "use crate::core::Profile;\nuse anyhow::{Context, Result, anyhow};\nuse camino::Utf8PathBuf;\nuse std::fs::File;\nuse std::{env, fs};\nuse toml::Table;\n\npub mod core;\npub mod test_utils;\n\npub const CONFIG_FILENAME: &str = \"snfoundry.toml\";\n\n/// Configuration not associated with any specific package\npub trait Config {\n    #[must_use]\n    fn tool_name() -> &'static str;\n\n    fn from_raw(config: serde_json::Value) -> Result<Self>\n    where\n        Self: Sized;\n}\n\n#[must_use]\npub fn resolve_config_file() -> Utf8PathBuf {\n    find_config_file().unwrap_or_else(|_| {\n        let path = Utf8PathBuf::from(CONFIG_FILENAME);\n        File::create(&path).expect(\"creating file in current directory should be possible\");\n\n        path.canonicalize_utf8()\n            .expect(\"path canonicalize in current directory should be possible\")\n    })\n}\n\npub fn load_config<T: Config + Default>(\n    path: Option<&Utf8PathBuf>,\n    profile: Option<&str>,\n) -> Result<T> {\n    let config_path = path\n        .as_ref()\n        .and_then(|p| search_config_upwards_relative_to(p).ok())\n        .or_else(|| find_config_file().ok());\n\n    match config_path {\n        Some(path) => {\n            let raw_config_toml = fs::read_to_string(path)\n                .context(\"Failed to read snfoundry.toml config file\")?\n                .parse::<Table>()\n                .context(\"Failed to parse snfoundry.toml config file\")?;\n\n            let raw_config_json = serde_json::to_value(raw_config_toml)\n                .context(\"Conversion from TOML value to JSON value should not fail.\")?;\n\n            core::load_config(\n                raw_config_json,\n                profile.map_or_else(|| Profile::Default, |p| Profile::Some(p.to_string())),\n            )\n        }\n        None => Ok(T::default()),\n    }\n}\n\npub fn search_config_upwards_relative_to(current_dir: &Utf8PathBuf) -> Result<Utf8PathBuf> {\n    current_dir\n        .ancestors()\n        .find(|path| fs::metadata(path.join(CONFIG_FILENAME)).is_ok())\n        .map(|path| path.join(CONFIG_FILENAME))\n        .ok_or_else(|| {\n            anyhow!(\n                \"Failed to find snfoundry.toml - not found in current nor any parent directories\"\n            )\n        })\n}\n\npub fn find_config_file() -> Result<Utf8PathBuf> {\n    search_config_upwards_relative_to(&Utf8PathBuf::try_from(\n        env::current_dir().expect(\"Failed to get current directory\"),\n    )?)\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use crate::test_utils::copy_config_to_tempdir;\n    use serde::{Deserialize, Serialize};\n    use std::fs::{self, File};\n    use tempfile::tempdir;\n    use url::Url;\n\n    #[test]\n    fn find_config_in_current_dir() {\n        let tempdir = copy_config_to_tempdir(\"tests/data/stubtool_snfoundry.toml\", None);\n        let path = search_config_upwards_relative_to(\n            &Utf8PathBuf::try_from(tempdir.path().to_path_buf()).unwrap(),\n        )\n        .unwrap();\n        assert_eq!(path, tempdir.path().join(CONFIG_FILENAME));\n    }\n\n    #[test]\n    fn find_config_in_parent_dir() {\n        let tempdir =\n            copy_config_to_tempdir(\"tests/data/stubtool_snfoundry.toml\", Some(\"childdir\"));\n        let path = search_config_upwards_relative_to(\n            &Utf8PathBuf::try_from(tempdir.path().to_path_buf().join(\"childdir\")).unwrap(),\n        )\n        .unwrap();\n        assert_eq!(path, tempdir.path().join(CONFIG_FILENAME));\n    }\n\n    #[test]\n    fn find_config_in_parent_dir_two_levels() {\n        let tempdir = copy_config_to_tempdir(\n            \"tests/data/stubtool_snfoundry.toml\",\n            Some(\"childdir1/childdir2\"),\n        );\n        let path = search_config_upwards_relative_to(\n            &Utf8PathBuf::try_from(tempdir.path().to_path_buf().join(\"childdir1/childdir2\"))\n                .unwrap(),\n        )\n        .unwrap();\n        assert_eq!(path, tempdir.path().join(CONFIG_FILENAME));\n    }\n\n    #[test]\n    fn find_config_in_parent_dir_available_in_multiple_parents() {\n        let tempdir =\n            copy_config_to_tempdir(\"tests/data/stubtool_snfoundry.toml\", Some(\"childdir1\"));\n        fs::copy(\n            \"tests/data/stubtool_snfoundry.toml\",\n            tempdir.path().join(\"childdir1\").join(CONFIG_FILENAME),\n        )\n        .expect(\"Failed to copy config file to temp dir\");\n        let path = search_config_upwards_relative_to(\n            &Utf8PathBuf::try_from(tempdir.path().to_path_buf().join(\"childdir1\")).unwrap(),\n        )\n        .unwrap();\n        assert_eq!(path, tempdir.path().join(\"childdir1\").join(CONFIG_FILENAME));\n    }\n\n    #[test]\n    fn no_config_in_current_nor_parent_dir() {\n        let tempdir = tempdir().expect(\"Failed to create a temporary directory\");\n        assert!(\n            search_config_upwards_relative_to(\n                &Utf8PathBuf::try_from(tempdir.path().to_path_buf()).unwrap()\n            )\n            .is_err(),\n            \"Failed to find snfoundry.toml - not found in current nor any parent directories\"\n        );\n    }\n\n    #[derive(Debug, Default, Serialize, Deserialize)]\n    pub struct StubConfig {\n        pub url: Option<Url>,\n        #[serde(default)]\n        pub account: String,\n    }\n    impl Config for StubConfig {\n        fn tool_name() -> &'static str {\n            \"stubtool\"\n        }\n\n        fn from_raw(config: serde_json::Value) -> Result<Self> {\n            Ok(serde_json::from_value::<Self>(config)?)\n        }\n    }\n    #[test]\n    fn load_config_happy_case_with_profile() {\n        let tempdir = copy_config_to_tempdir(\"tests/data/stubtool_snfoundry.toml\", None);\n        let config = load_config::<StubConfig>(\n            Some(&Utf8PathBuf::try_from(tempdir.path().to_path_buf()).unwrap()),\n            Some(&String::from(\"profile1\")),\n        )\n        .unwrap();\n        assert_eq!(config.account, String::from(\"user3\"));\n        assert_eq!(\n            config.url,\n            Some(Url::parse(\"http://127.0.0.1:5050/rpc\").unwrap())\n        );\n    }\n\n    #[test]\n    fn load_config_happy_case_default_profile() {\n        let tempdir = copy_config_to_tempdir(\"tests/data/stubtool_snfoundry.toml\", None);\n        let config = load_config::<StubConfig>(\n            Some(&Utf8PathBuf::try_from(tempdir.path().to_path_buf()).unwrap()),\n            None,\n        )\n        .unwrap();\n        assert_eq!(config.account, String::from(\"user1\"));\n        assert_eq!(\n            config.url,\n            Some(Url::parse(\"http://127.0.0.1:5055/rpc\").unwrap())\n        );\n    }\n    #[test]\n    fn load_config_invalid_url() {\n        let tempdir = copy_config_to_tempdir(\"tests/data/stubtool_snfoundry.toml\", None);\n        let err = load_config::<StubConfig>(\n            Some(&Utf8PathBuf::try_from(tempdir.path().to_path_buf()).unwrap()),\n            Some(&String::from(\"profile6\")),\n        )\n        .unwrap_err();\n\n        assert!(\n            err.to_string()\n                .contains(\"relative URL without a base: \\\"invalid_url\\\"\")\n        );\n    }\n\n    #[test]\n    fn load_config_not_found() {\n        let tempdir = tempdir().expect(\"Failed to create a temporary directory\");\n        let config = load_config::<StubConfig>(\n            Some(&Utf8PathBuf::try_from(tempdir.path().to_path_buf()).unwrap()),\n            None,\n        )\n        .unwrap();\n\n        assert_eq!(config.account, String::new());\n        assert_eq!(config.url, None);\n    }\n\n    #[derive(Debug, Default, Serialize, Deserialize)]\n    pub struct StubComplexConfig {\n        #[serde(default)]\n        pub url: String,\n        #[serde(default)]\n        pub account: i32,\n        #[serde(default)]\n        pub nested: StubComplexConfigNested,\n    }\n\n    #[derive(Debug, Default, Serialize, Deserialize)]\n    pub struct StubComplexConfigNested {\n        #[serde(\n            default,\n            rename(serialize = \"list-example\", deserialize = \"list-example\")\n        )]\n        list_example: Vec<bool>,\n        #[serde(default, rename(serialize = \"url-nested\", deserialize = \"url-nested\"))]\n        url_nested: f32,\n        #[serde(default, rename(serialize = \"url-alt\", deserialize = \"url-alt\"))]\n        url_alt: String,\n    }\n\n    impl Config for StubComplexConfig {\n        fn tool_name() -> &'static str {\n            \"stubtool\"\n        }\n\n        fn from_raw(config: serde_json::Value) -> Result<Self> {\n            Ok(serde_json::from_value::<Self>(config)?)\n        }\n    }\n\n    #[test]\n    fn empty_config_works() {\n        let temp_dir = tempdir().expect(\"Failed to create a temporary directory\");\n        File::create(temp_dir.path().join(CONFIG_FILENAME)).unwrap();\n\n        load_config::<StubConfig>(\n            Some(&Utf8PathBuf::try_from(temp_dir.path().to_path_buf()).unwrap()),\n            None,\n        )\n        .unwrap();\n    }\n\n    #[test]\n    #[expect(clippy::float_cmp)]\n    fn resolve_env_vars() {\n        let tempdir =\n            copy_config_to_tempdir(\"tests/data/stubtool_snfoundry.toml\", Some(\"childdir1\"));\n        fs::copy(\n            \"tests/data/stubtool_snfoundry.toml\",\n            tempdir.path().join(\"childdir1\").join(CONFIG_FILENAME),\n        )\n        .expect(\"Failed to copy config file to temp dir\");\n        // missing env variables\n        if load_config::<StubConfig>(\n            Some(&Utf8PathBuf::try_from(tempdir.path().to_path_buf()).unwrap()),\n            Some(&String::from(\"with-envs\")),\n        )\n        .is_ok()\n        {\n            panic!(\"Expected failure\");\n        }\n\n        // Present env variables\n\n        // SAFETY: These values are only read here and are not modified by other tests.\n        unsafe {\n            env::set_var(\"VALUE_STRING123132\", \"nfsaufbnsailfbsbksdabfnkl\");\n            env::set_var(\"VALUE_STRING123142\", \"nfsasnsidnnsailfbsbksdabdkdkl\");\n            env::set_var(\"VALUE_INT123132\", \"321312\");\n            env::set_var(\"VALUE_FLOAT123132\", \"321.312\");\n            env::set_var(\"VALUE_BOOL1231321\", \"true\");\n            env::set_var(\"VALUE_BOOL1231322\", \"false\");\n        };\n        let config = load_config::<StubComplexConfig>(\n            Some(&Utf8PathBuf::try_from(tempdir.path().to_path_buf()).unwrap()),\n            Some(&String::from(\"with-envs\")),\n        )\n        .unwrap();\n        assert_eq!(config.url, String::from(\"nfsaufbnsailfbsbksdabfnkl\"));\n        assert_eq!(config.account, 321_312);\n        assert_eq!(config.nested.list_example, vec![true, false]);\n        assert_eq!(config.nested.url_nested, 321.312);\n        assert_eq!(\n            config.nested.url_alt,\n            String::from(\"nfsasnsidnnsailfbsbksdabdkdkl\")\n        );\n    }\n}\n"
  },
  {
    "path": "crates/configuration/src/test_utils.rs",
    "content": "use crate::CONFIG_FILENAME;\nuse std::fs;\nuse tempfile::{TempDir, tempdir};\n\n#[must_use]\npub fn copy_config_to_tempdir(src_path: &str, additional_path: Option<&str>) -> TempDir {\n    let temp_dir = tempdir().expect(\"Failed to create a temporary directory\");\n    if let Some(dir) = additional_path {\n        let path = temp_dir.path().join(dir);\n        fs::create_dir_all(path).expect(\"Failed to create directories in temp dir\");\n    }\n    let temp_dir_file_path = temp_dir.path().join(CONFIG_FILENAME);\n    fs::copy(src_path, temp_dir_file_path).expect(\"Failed to copy config file to temp dir\");\n\n    temp_dir\n}\n"
  },
  {
    "path": "crates/configuration/tests/data/stubtool_snfoundry.toml",
    "content": "[stubtool.default]\nurl = \"http://127.0.0.1:5055/rpc\"\naccounts-file = \"../account-file\"\naccount = \"user1\"\n\n[stubtool.profile1]\nurl = \"http://127.0.0.1:5050/rpc\"\naccount = \"user3\"\n\n[stubtool.profile2]\nurl = \"http://127.0.0.1:5055/rpc\"\naccounts-file = \"../account-file\"\naccount = \"user100\"\n\n[stubtool.profile3]\nurl = \"http://127.0.0.1:5055/rpc\"\naccount = \"/path/to/account.json\"\nkeystore = \"../keystore\"\n\n[stubtool.profile4]\nurl = \"http://127.0.0.1:5055/rpc\"\naccounts-file = \"../account-file\"\naccount = \"user3\"\n\n[stubtool.profile5]\nurl = \"http://127.0.0.1:5055/rpc\"\n\n[stubtool.profile6]\nurl = \"invalid_url\"\naccount = \"user8\"\n\n[stubtool.with-envs]\nurl = \"$VALUE_STRING123132\"\naccount = \"$VALUE_INT123132\"\n\n[stubtool.with-envs.nested]\nlist-example = [ \"$VALUE_BOOL1231321\", \"$VALUE_BOOL1231322\"  ]\nurl-nested = \"$VALUE_FLOAT123132\"\nurl-alt = \"${VALUE_STRING123142}\"\n"
  },
  {
    "path": "crates/conversions/Cargo.toml",
    "content": "[package]\nname = \"conversions\"\nversion = \"1.0.0\"\nedition.workspace = true\n\n[features]\ntesting = []\n\n[dependencies]\nanyhow.workspace = true\nblockifier.workspace = true\nstarknet_api.workspace = true\nstarknet-types-core.workspace = true\ncairo-lang-utils.workspace = true\ncairo-vm.workspace = true\nstarknet-rust.workspace = true\nthiserror.workspace = true\nserde_json.workspace = true\nserde.workspace = true\nnum-traits.workspace = true\nitertools.workspace = true\ncairo-serde-macros = { path = \"cairo-serde-macros\" }\n\n[dev-dependencies]\ntest-case.workspace = true\n"
  },
  {
    "path": "crates/conversions/cairo-serde-macros/Cargo.toml",
    "content": "[package]\nname = \"cairo-serde-macros\"\nversion = \"1.0.0\"\nedition.workspace = true\n\n[lib]\nproc-macro = true\n\n[dependencies]\nsyn = \"2.0.114\"\nquote = \"1.0.45\"\nproc-macro2 = \"1.0.105\"\n"
  },
  {
    "path": "crates/conversions/cairo-serde-macros/src/cairo_deserialize.rs",
    "content": "use proc_macro2::TokenStream;\nuse quote::{quote, quote_spanned};\nuse syn::spanned::Spanned;\nuse syn::{Data, DeriveInput, Fields, GenericParam, Generics, parse_macro_input, parse_quote};\n\n// works by calling `CairoDeserialize::deserialize(reader)` on all fields of struct\n// for enums by reading 1 felt that is then matched on to determine which variant should be used\npub fn derive_deserialize(item: proc_macro::TokenStream) -> proc_macro::TokenStream {\n    let span = item.clone().into();\n    let mut input = parse_macro_input!(item as DeriveInput);\n\n    let name = input.ident;\n    let generics = &mut input.generics;\n    let data = &input.data;\n\n    add_trait_bounds(generics);\n\n    let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();\n\n    let body = create_func_body(data, &span);\n\n    quote! {\n        impl #impl_generics conversions::serde::deserialize::CairoDeserialize for #name #ty_generics #where_clause {\n            fn deserialize(reader: &mut conversions::serde::deserialize::BufferReader<'_>) -> conversions::serde::deserialize::BufferReadResult<Self> {\n                #body\n            }\n        }\n    }\n    .into()\n}\n\nfn add_trait_bounds(generics: &mut Generics) {\n    for param in &mut generics.params {\n        if let GenericParam::Type(type_param) = param {\n            type_param.bounds.push(parse_quote!(\n                conversions::serde::deserialize::CairoDeserialize\n            ));\n        }\n    }\n}\n\n// generate code for struct/enum fields (named and tuple)\nfn call_trait_on_field(fields: &Fields) -> TokenStream {\n    match fields {\n        Fields::Named(fields) => {\n            let recurse = fields.named.iter().map(|f| {\n                let name = &f.ident;\n\n                quote_spanned! {f.span() =>\n                    #name: conversions::serde::deserialize::CairoDeserialize::deserialize(reader)?,\n                }\n            });\n\n            quote! {\n                {#(#recurse)*}\n            }\n        }\n        Fields::Unnamed(fields) => {\n            let recurse = fields.unnamed.iter().map(|f| {\n                quote_spanned! {f.span()=>\n                    conversions::serde::deserialize::CairoDeserialize::deserialize(reader)?\n                }\n            });\n\n            quote! {\n                (#(#recurse),*)\n            }\n        }\n        Fields::Unit => TokenStream::new(),\n    }\n}\n\n// creates code for `CairoDeserialize::deserialize` body\nfn create_func_body(data: &Data, span: &TokenStream) -> TokenStream {\n    match data {\n        Data::Struct(data) => match &data.fields {\n            Fields::Named(_) | Fields::Unnamed(_) => {\n                let fields = call_trait_on_field(&data.fields);\n\n                quote! {\n                    Result::Ok(Self\n                        #fields\n                    )\n                }\n            }\n            Fields::Unit => {\n                quote!(Result::Ok(Self))\n            }\n        },\n        Data::Enum(data) => {\n            // generate match arms by matching on next integer literals (discriminator)\n            // then generate trait calls for variants fields\n            let arms = data.variants.iter().enumerate().map(|(i, variant)| {\n                let name = &variant.ident;\n                let fields = call_trait_on_field(&variant.fields);\n                let lit = syn::parse_str::<syn::LitInt>(&i.to_string()).unwrap();\n\n                quote! {\n                    #lit => Self::#name #fields\n                }\n            });\n\n            quote! {\n                let variant: usize = reader.read()?;\n\n                let this = match variant {\n                    #(#arms,)*\n                    _ => Result::Err(conversions::serde::deserialize::BufferReadError::ParseFailed)?,\n                };\n\n                Result::Ok(this)\n            }\n        }\n        // can not determine which variant should be used\n        // use enum instead\n        Data::Union(_) => syn::Error::new_spanned(\n            span,\n            \"conversions::serde::deserialize::CairoDeserialize can be derived only on structs and enums\",\n        )\n        .into_compile_error(),\n    }\n}\n"
  },
  {
    "path": "crates/conversions/cairo-serde-macros/src/cairo_serialize.rs",
    "content": "use proc_macro2::TokenStream;\nuse quote::{ToTokens, quote, quote_spanned};\nuse syn::spanned::Spanned;\nuse syn::{Data, DeriveInput, Fields, GenericParam, Generics, parse_macro_input, parse_quote};\n\n// works by calling `CairoSerialize::serialize(writer)` on all fields of struct\n// for enums by writing 1 felt that is number of variant, then variant members\npub fn derive_serialize(item: proc_macro::TokenStream) -> proc_macro::TokenStream {\n    let span = item.clone().into();\n    let mut input = parse_macro_input!(item as DeriveInput);\n\n    let name = input.ident;\n    let generics = &mut input.generics;\n    let data = &input.data;\n\n    add_trait_bounds(generics);\n\n    let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();\n\n    let body = create_func_body(data, &span);\n\n    quote! {\n        impl #impl_generics conversions::serde::serialize::CairoSerialize for #name #ty_generics #where_clause {\n            fn serialize(&self, writer: &mut conversions::serde::serialize::BufferWriter) {\n                #body\n            }\n        }\n    }\n    .into()\n}\n\nfn add_trait_bounds(generics: &mut Generics) {\n    for param in &mut generics.params {\n        if let GenericParam::Type(type_param) = param {\n            type_param\n                .bounds\n                .push(parse_quote!(conversions::serde::serialize::CairoSerialize));\n        }\n    }\n}\n\n#[derive(Copy, Clone)]\nenum Item {\n    Struct,\n    Enum,\n}\n\nimpl Item {\n    fn get_prefix(self) -> TokenStream {\n        match self {\n            Self::Struct => quote! (self.),\n            Self::Enum => quote!(),\n        }\n    }\n}\n\n// generate code for struct/enum fields (named and tuple)\nfn call_trait_on_field(fields: &Fields, item: Item) -> TokenStream {\n    let prefix = item.get_prefix();\n    match fields {\n        Fields::Named(fields) => {\n            let recurse = fields.named.iter().map(|f| {\n                let name = &f.ident;\n\n                quote_spanned! {f.span() =>\n                    conversions::serde::serialize::CairoSerialize::serialize(& #prefix #name, writer);\n                }\n            });\n\n            quote! {\n                {#(#recurse)*}\n            }\n        }\n        Fields::Unnamed(unnamed_fields) => {\n            let recurse = unnamed_fields.unnamed.iter().enumerate().map(|(i, f)| {\n                let name = match item {\n                    Item::Struct => {\n                        let prop = syn::parse_str::<syn::LitInt>(&i.to_string()).unwrap();\n\n                        quote! {\n                            #prefix #prop\n                        }\n                    }\n                    Item::Enum => syn::parse_str::<syn::Ident>(&format!(\"field_{i}\"))\n                        .unwrap()\n                        .to_token_stream(),\n                };\n\n                quote_spanned! {f.span()=>\n                    conversions::serde::serialize::CairoSerialize::serialize(& #name, writer);\n                }\n            });\n\n            quote! {\n                #(#recurse),*\n            }\n        }\n        Fields::Unit => TokenStream::new(),\n    }\n}\n\nfn destruct_fields(fields: &Fields) -> TokenStream {\n    match fields {\n        Fields::Named(fields) => {\n            let recurse = fields.named.iter().map(|f| {\n                let name = &f.ident;\n\n                quote_spanned! {f.span() =>\n                    #name\n                }\n            });\n\n            quote! {\n                {#(#recurse),*}\n            }\n        }\n        Fields::Unnamed(fields) => {\n            let recurse = fields.unnamed.iter().enumerate().map(|(i, f)| {\n                let name = syn::parse_str::<syn::Ident>(&format!(\"field_{i}\")).unwrap();\n\n                quote_spanned! {f.span() =>\n                    #name\n                }\n            });\n\n            quote! {\n                (#(#recurse),*)\n            }\n        }\n        Fields::Unit => TokenStream::new(),\n    }\n}\n\n// creates code for `CairoSerialize::serialize` body\nfn create_func_body(data: &Data, span: &TokenStream) -> TokenStream {\n    match data {\n        Data::Struct(data) => {\n            call_trait_on_field(&data.fields, Item::Struct)\n        },\n        Data::Enum(data) => {\n            // generate match arms by matching on next integer literals (discriminator)\n            // then generate trait calls for variants fields\n            let arms = data.variants.iter().enumerate().map(|(i,variant)| {\n                let name = &variant.ident;\n                let calls = call_trait_on_field(&variant.fields, Item::Enum);\n                let destructurization = destruct_fields(&variant.fields);\n                let lit = syn::parse_str::<syn::LitInt>(&format!(\"{i}_u32\")).unwrap();\n\n                quote! {\n                    Self::#name #destructurization => {\n                        conversions::serde::serialize::CairoSerialize::serialize(&#lit, writer);\n                        #calls\n                    }\n                }\n            });\n\n            // empty match does not work with references\n            // and `self` is behind reference\n            if data.variants.is_empty() {\n                quote! {}\n            }else{\n                quote! {\n                    match self {\n                        #(#arms,)*\n                    };\n                }\n            }\n\n        }\n        // can not determine which variant should be used\n        // use enum instead\n        Data::Union(_) => syn::Error::new_spanned(\n            span,\n            \"conversions::serde::serialize::CairoSerialize can be derived only on structs and enums\",\n        )\n        .into_compile_error(),\n    }\n}\n"
  },
  {
    "path": "crates/conversions/cairo-serde-macros/src/lib.rs",
    "content": "mod cairo_deserialize;\nmod cairo_serialize;\n\n#[proc_macro_derive(CairoDeserialize)]\npub fn derive_deserialize(item: proc_macro::TokenStream) -> proc_macro::TokenStream {\n    cairo_deserialize::derive_deserialize(item)\n}\n\n#[proc_macro_derive(CairoSerialize)]\npub fn derive_serialize(item: proc_macro::TokenStream) -> proc_macro::TokenStream {\n    cairo_serialize::derive_serialize(item)\n}\n"
  },
  {
    "path": "crates/conversions/src/byte_array.rs",
    "content": "use crate as conversions; // trick for CairoDeserialize macro\nuse crate::serde::deserialize::{BufferReadError, BufferReadResult, BufferReader};\nuse crate::{serde::serialize::SerializeToFeltVec, string::TryFromHexStr};\nuse cairo_lang_utils::byte_array::{BYTE_ARRAY_MAGIC, BYTES_IN_WORD};\nuse cairo_serde_macros::{CairoDeserialize, CairoSerialize};\nuse starknet_types_core::felt::Felt;\nuse std::fmt;\n\n#[derive(CairoDeserialize, CairoSerialize, Clone, Debug, PartialEq)]\npub struct ByteArray {\n    words: Vec<Felt>,\n    pending_word: Felt,\n    pending_word_len: usize,\n}\n\nimpl From<&str> for ByteArray {\n    fn from(value: &str) -> Self {\n        let chunks = value.as_bytes().chunks_exact(BYTES_IN_WORD);\n        let remainder = chunks.remainder();\n        let pending_word_len = remainder.len();\n\n        let words = chunks.map(Felt::from_bytes_be_slice).collect();\n        let pending_word = Felt::from_bytes_be_slice(remainder);\n\n        Self {\n            words,\n            pending_word,\n            pending_word_len,\n        }\n    }\n}\n\nimpl ByteArray {\n    #[must_use]\n    pub fn serialize_with_magic(&self) -> Vec<Felt> {\n        let mut result = self.serialize_to_vec();\n\n        result.insert(\n            0,\n            Felt::try_from_hex_str(&format!(\"0x{BYTE_ARRAY_MAGIC}\")).unwrap(),\n        );\n\n        result\n    }\n\n    pub fn deserialize_with_magic(value: &[Felt]) -> BufferReadResult<ByteArray> {\n        if value.first() == Some(&Felt::try_from_hex_str(&format!(\"0x{BYTE_ARRAY_MAGIC}\")).unwrap())\n        {\n            BufferReader::new(&value[1..]).read()\n        } else {\n            Err(BufferReadError::ParseFailed)\n        }\n    }\n}\n\nfn extend_full_word_bytes(out: &mut Vec<u8>, word: &Felt) {\n    let buf = word.to_bytes_be();\n    out.extend_from_slice(&buf[1..32]);\n}\n\nfn extend_pending_word_bytes(out: &mut Vec<u8>, word: &Felt, len: usize) {\n    let buf = word.to_bytes_be();\n    out.extend_from_slice(&buf[(32 - len)..32]);\n}\n\nimpl fmt::Display for ByteArray {\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        let mut bytes = Vec::new();\n\n        for word in &self.words {\n            extend_full_word_bytes(&mut bytes, word);\n        }\n\n        extend_pending_word_bytes(&mut bytes, &self.pending_word, self.pending_word_len);\n\n        for b in bytes {\n            match b {\n                // Printable ASCII characters\n                0x20..=0x7E => write!(f, \"{}\", b as char)?,\n                // Common whitespace characters\n                b'\\n' => writeln!(f)?,\n                b'\\r' => write!(f, \"\\r\")?,\n                b'\\t' => write!(f, \"\\t\")?,\n                // Escape all other bytes to avoid panics (important for fuzz tests)\n                _ => write!(f, \"\\\\x{b:02x}\")?,\n            }\n        }\n\n        Ok(())\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use test_case::test_case;\n\n    #[test]\n    fn test_fmt_empty() {\n        let array = ByteArray::from(\"\");\n        assert_eq!(array.to_string(), \"\");\n    }\n\n    #[test]\n    fn test_fmt_single_word() {\n        let array = ByteArray::from(\"Hello\");\n        assert_eq!(array.to_string(), \"Hello\");\n    }\n\n    #[test]\n    fn test_fmt_multiple_words() {\n        let array = ByteArray::from(\"Hello World! This is a test.\");\n        assert_eq!(array.to_string(), \"Hello World! This is a test.\");\n    }\n\n    #[test]\n    fn test_fmt_with_pending_word() {\n        let array = ByteArray::from(\"abc\");\n        assert_eq!(array.to_string(), \"abc\");\n    }\n\n    #[test]\n    fn test_fmt_special_chars() {\n        let special_chars = \"!@#$%^&*()_+-=[]{}|;:,.<>?\";\n        let array = ByteArray::from(special_chars);\n        assert_eq!(array.to_string(), special_chars);\n    }\n\n    #[test_case(\"Hello\\0World\", \"Hello\\\\x00World\"; \"single null byte\")]\n    #[test_case(\"\\0\\0\", \"\\\\x00\\\\x00\"; \"two null bytes\")]\n    #[test_case(\"\\x01\\x02ABC\", \"\\\\x01\\\\x02ABC\"; \"control chars 0x01 0x02\")]\n    #[test_case(\"\\x07Bell\", \"\\\\x07Bell\"; \"bell character\")]\n    #[test_case(\"\\x1fEnd\", \"\\\\x1fEnd\"; \"unit separator\")]\n    #[test_case(\"Line1\\nLine2\", \"Line1\\nLine2\"; \"newline preserved\")]\n    #[test_case(\"Col1\\tCol2\", \"Col1\\tCol2\"; \"tab preserved\")]\n    #[test_case(\"CR\\rLF\", \"CR\\rLF\"; \"carriage return preserved\")]\n    #[test_case(\"A\\x00B\\x01C\", \"A\\\\x00B\\\\x01C\"; \"mixed printable and escaped\")]\n    #[test_case(\"\\x7f\", \"\\\\x7f\"; \"delete character\")]\n    fn test_fmt_escaping_non_printable_bytes(input: &str, expected: &str) {\n        let array = ByteArray::from(input);\n        let output = array.to_string();\n        assert_eq!(output, expected);\n    }\n\n    #[test]\n    fn test_fmt_mixed_ascii() {\n        let mixed = \"Hello\\tWorld\\n123 !@#\";\n        let array = ByteArray::from(mixed);\n        assert_eq!(array.to_string(), mixed);\n    }\n\n    #[test]\n    fn test_fmt_with_newlines() {\n        let with_newlines = \"First line\\nSecond line\\r\\nThird line\";\n        let array = ByteArray::from(with_newlines);\n        assert_eq!(array.to_string(), with_newlines);\n    }\n\n    #[test]\n    fn test_fmt_multiple_newlines() {\n        let multiple_newlines = \"Line1\\n\\n\\nLine2\\n\\nLine3\";\n        let array = ByteArray::from(multiple_newlines);\n        assert_eq!(array.to_string(), multiple_newlines);\n    }\n}\n"
  },
  {
    "path": "crates/conversions/src/class_hash.rs",
    "content": "use crate::{FromConv, IntoConv, from_thru_felt};\nuse conversions::padded_felt::PaddedFelt;\nuse starknet_api::core::{ClassHash, ContractAddress, EntryPointSelector, Nonce};\nuse starknet_types_core::felt::Felt;\n\nimpl FromConv<Felt> for ClassHash {\n    fn from_(value: Felt) -> ClassHash {\n        ClassHash(value.into_())\n    }\n}\n\nfrom_thru_felt!(ContractAddress, ClassHash);\nfrom_thru_felt!(Nonce, ClassHash);\nfrom_thru_felt!(EntryPointSelector, ClassHash);\nfrom_thru_felt!(PaddedFelt, ClassHash);\n"
  },
  {
    "path": "crates/conversions/src/contract_address.rs",
    "content": "use crate::{FromConv, from_thru_felt};\nuse conversions::padded_felt::PaddedFelt;\nuse starknet_api::core::{ClassHash, ContractAddress, EntryPointSelector, Nonce, PatriciaKey};\nuse starknet_api::hash::StarkHash;\nuse starknet_types_core::felt::Felt;\n\nimpl FromConv<Felt> for ContractAddress {\n    fn from_(value: Felt) -> ContractAddress {\n        ContractAddress(PatriciaKey::try_from(StarkHash::from_(value)).unwrap())\n    }\n}\n\nfrom_thru_felt!(ClassHash, ContractAddress);\nfrom_thru_felt!(Nonce, ContractAddress);\nfrom_thru_felt!(EntryPointSelector, ContractAddress);\nfrom_thru_felt!(PaddedFelt, ContractAddress);\n"
  },
  {
    "path": "crates/conversions/src/entrypoint_selector.rs",
    "content": "use crate::{FromConv, IntoConv, from_thru_felt};\nuse starknet_api::core::{ClassHash, ContractAddress, EntryPointSelector, Nonce};\nuse starknet_types_core::felt::Felt;\n\nimpl FromConv<Felt> for EntryPointSelector {\n    fn from_(value: Felt) -> EntryPointSelector {\n        EntryPointSelector(value.into_())\n    }\n}\n\nfrom_thru_felt!(ContractAddress, EntryPointSelector);\nfrom_thru_felt!(Nonce, EntryPointSelector);\nfrom_thru_felt!(ClassHash, EntryPointSelector);\n"
  },
  {
    "path": "crates/conversions/src/eth_address.rs",
    "content": "use crate::FromConv;\nuse starknet_api::core::EthAddress;\nuse starknet_types_core::felt::Felt;\n\nimpl FromConv<Felt> for EthAddress {\n    fn from_(value: Felt) -> EthAddress {\n        EthAddress::try_from(value).expect(\"Conversion of felt to EthAddress failed\")\n    }\n}\n\nimpl FromConv<EthAddress> for Felt {\n    fn from_(value: EthAddress) -> Felt {\n        value.into()\n    }\n}\n"
  },
  {
    "path": "crates/conversions/src/felt.rs",
    "content": "use crate::{\n    FromConv, IntoConv,\n    byte_array::ByteArray,\n    serde::serialize::SerializeToFeltVec,\n    string::{TryFromDecStr, TryFromHexStr},\n};\nuse anyhow::{Context, Result, anyhow, bail};\nuse conversions::padded_felt::PaddedFelt;\nuse starknet_api::core::{ClassHash, ContractAddress, EntryPointSelector, Nonce};\nuse starknet_api::transaction::fields::ContractAddressSalt;\nuse starknet_types_core::felt::Felt;\nuse std::vec;\n\nimpl FromConv<ClassHash> for Felt {\n    fn from_(value: ClassHash) -> Felt {\n        value.0.into_()\n    }\n}\n\nimpl FromConv<ContractAddress> for Felt {\n    fn from_(value: ContractAddress) -> Felt {\n        (*value.0.key()).into_()\n    }\n}\n\nimpl FromConv<ContractAddressSalt> for Felt {\n    fn from_(value: ContractAddressSalt) -> Felt {\n        value.0.into_()\n    }\n}\n\nimpl FromConv<Nonce> for Felt {\n    fn from_(value: Nonce) -> Felt {\n        value.0.into_()\n    }\n}\n\nimpl FromConv<EntryPointSelector> for Felt {\n    fn from_(value: EntryPointSelector) -> Felt {\n        value.0.into_()\n    }\n}\n\nimpl FromConv<PaddedFelt> for Felt {\n    fn from_(value: PaddedFelt) -> Felt {\n        value.0.into_()\n    }\n}\n\nimpl<T> TryFromDecStr for T\nwhere\n    T: FromConv<Felt>,\n{\n    fn try_from_dec_str(value: &str) -> Result<T> {\n        if value.starts_with('-') {\n            bail!(\"Value must not start with -\")\n        }\n\n        Felt::from_dec_str(value)\n            .map(T::from_)\n            .with_context(|| anyhow!(\"Invalid value for string\"))\n    }\n}\n\nimpl<T> TryFromHexStr for T\nwhere\n    T: FromConv<Felt>,\n{\n    fn try_from_hex_str(value: &str) -> Result<T> {\n        if !value.starts_with(\"0x\") {\n            bail!(\"Value must start with 0x\");\n        }\n\n        Felt::from_hex(value)\n            .map(T::from_)\n            .with_context(|| anyhow!(\"Invalid value for string\"))\n    }\n}\n\npub trait FromShortString<T>: Sized {\n    fn from_short_string(short_string: &str) -> Result<T>;\n}\n\nimpl FromShortString<Felt> for Felt {\n    fn from_short_string(short_string: &str) -> Result<Felt> {\n        if short_string.len() <= 31 && short_string.is_ascii() {\n            Ok(Felt::from_bytes_be_slice(short_string.as_bytes()))\n        } else {\n            bail!(\"Value must be ascii and less than 32 bytes long.\")\n        }\n    }\n}\n\n#[derive(Debug)]\npub struct ToStrErr;\n\npub trait ToShortString<T>: Sized {\n    fn to_short_string(&self) -> Result<String, ToStrErr>;\n}\n\nimpl ToShortString<Felt> for Felt {\n    fn to_short_string(&self) -> Result<String, ToStrErr> {\n        let mut as_string = String::default();\n        let mut is_end = false;\n        for byte in self.to_biguint().to_bytes_be() {\n            if byte == 0 {\n                is_end = true;\n            } else if is_end {\n                return Err(ToStrErr);\n            } else if byte.is_ascii_graphic() || byte.is_ascii_whitespace() {\n                as_string.push(byte as char);\n            } else {\n                return Err(ToStrErr);\n            }\n        }\n        Ok(as_string)\n    }\n}\n\npub trait TryInferFormat: Sized {\n    /// Parses value from `hex string`, `dec string`, `quoted cairo shortstring `and `quoted cairo string`\n    fn infer_format_and_parse(value: &str) -> Result<Vec<Self>>;\n}\n\nfn resolve(value: &str) -> String {\n    value[1..value.len() - 1].replace(\"\\\\n\", \"\\n\")\n}\n\nimpl TryInferFormat for Felt {\n    fn infer_format_and_parse(value: &str) -> Result<Vec<Self>> {\n        if value.starts_with('\\'') && value.ends_with('\\'') {\n            let value = resolve(value).replace(\"\\\\'\", \"'\");\n\n            Felt::from_short_string(&value).map(|felt| vec![felt])\n        } else if value.starts_with('\"') && value.ends_with('\"') {\n            let value = resolve(value).replace(\"\\\\\\\"\", \"\\\"\");\n\n            Ok(ByteArray::from(value.as_str()).serialize_to_vec())\n        } else {\n            Felt::try_from_hex_str(value)\n                .or_else(|_| Felt::try_from_dec_str(value))\n                .map(|felt| vec![felt])\n        }\n    }\n}\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    #[test]\n    fn short_string_happy_case() {\n        let felt = Felt::from_hex(\"0x616263646566\").unwrap();\n        assert_eq!(felt.to_short_string().unwrap(), \"abcdef\");\n    }\n\n    #[test]\n    fn short_string_31_characters() {\n        let felt =\n            Felt::from_hex(\"0x4142434445464748494a4b4c4d4e4f505152535455565758595a3132333435\")\n                .unwrap();\n        assert_eq!(\n            felt.to_short_string().unwrap(),\n            \"ABCDEFGHIJKLMNOPQRSTUVWXYZ12345\"\n        );\n    }\n\n    #[test]\n    fn short_string_too_long() {\n        let felt =\n            Felt::from_hex(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\")\n                .unwrap();\n        assert!(felt.to_short_string().is_err());\n    }\n\n    #[test]\n    fn short_string_empty() {\n        let felt = Felt::from_hex(\"0x0\").unwrap();\n        assert_eq!(felt.to_short_string().unwrap(), \"\");\n    }\n\n    #[test]\n    fn short_string_with_whitespace() {\n        let felt = Felt::from_hex(\"0x48656C6C6F20576F726C64\").unwrap();\n        assert_eq!(felt.to_short_string().unwrap(), \"Hello World\");\n    }\n\n    #[test]\n    fn short_string_special_chars() {\n        let felt = Felt::from_hex(\"0x4021233F2A2B5B5D\").unwrap();\n        assert_eq!(felt.to_short_string().unwrap(), \"@!#?*+[]\");\n    }\n\n    #[test]\n    fn short_string_with_numbers() {\n        let felt = Felt::from_hex(\"0x313233343536373839\").unwrap();\n        assert_eq!(felt.to_short_string().unwrap(), \"123456789\");\n    }\n\n    #[test]\n    fn short_string_non_ascii() {\n        let felt = Felt::from_hex(\"0x80\").unwrap();\n        assert!(felt.to_short_string().is_err());\n    }\n\n    #[test]\n    fn short_string_null_byte() {\n        let felt = Felt::from_hex(\"0x00616263\").unwrap();\n        assert_eq!(felt.to_short_string().unwrap(), \"abc\");\n    }\n\n    #[test]\n    fn short_string_null_byte_middle() {\n        let felt = Felt::from_hex(\"0x61006263\").unwrap();\n        assert!(felt.to_short_string().is_err());\n    }\n\n    #[test]\n    fn short_string_null_byte_end() {\n        let felt = Felt::from_hex(\"0x61626300\").unwrap();\n        assert_eq!(felt.to_short_string().unwrap(), \"abc\");\n    }\n}\n"
  },
  {
    "path": "crates/conversions/src/lib.rs",
    "content": "use std::convert::Infallible;\n\npub mod byte_array;\npub mod class_hash;\npub mod contract_address;\npub mod entrypoint_selector;\npub mod eth_address;\npub mod felt;\npub mod non_zero_felt;\npub mod non_zero_u128;\npub mod non_zero_u64;\npub mod nonce;\npub mod padded_felt;\npub mod primitive;\npub mod serde;\npub mod string;\n\nextern crate self as conversions;\n\npub trait FromConv<T>: Sized {\n    fn from_(value: T) -> Self;\n}\n\nimpl<T> FromConv<T> for T {\n    fn from_(value: T) -> Self {\n        value\n    }\n}\n\npub trait IntoConv<T>: Sized {\n    fn into_(self) -> T;\n}\n\n// FromConv implies IntoConv\nimpl<T, U> IntoConv<U> for T\nwhere\n    U: FromConv<T>,\n{\n    #[inline]\n    fn into_(self: T) -> U {\n        U::from_(self)\n    }\n}\n\npub trait TryFromConv<T>: Sized {\n    type Error;\n\n    fn try_from_(value: T) -> Result<Self, Self::Error>;\n}\n\npub trait TryIntoConv<T>: Sized {\n    type Error;\n\n    fn try_into_(self) -> Result<T, Self::Error>;\n}\n\n// TryFromConv implies TryIntoConv\nimpl<T, U> TryIntoConv<U> for T\nwhere\n    U: TryFromConv<T>,\n{\n    type Error = U::Error;\n\n    #[inline]\n    fn try_into_(self) -> Result<U, U::Error> {\n        U::try_from_(self)\n    }\n}\n\n// Infallible conversions are semantically equivalent to fallible conversions\n// with an uninhabited error type.\nimpl<T, U> TryFromConv<U> for T\nwhere\n    U: IntoConv<T>,\n{\n    type Error = Infallible;\n\n    #[inline]\n    fn try_from_(value: U) -> Result<Self, Self::Error> {\n        Ok(U::into_(value))\n    }\n}\n\n#[macro_export]\nmacro_rules! from_thru_felt {\n    ($from:ty, $to:ty) => {\n        impl FromConv<$from> for $to {\n            fn from_(value: $from) -> Self {\n                Self::from_(Felt::from_(value))\n            }\n        }\n    };\n}\n"
  },
  {
    "path": "crates/conversions/src/non_zero_felt.rs",
    "content": "use crate::FromConv;\nuse starknet_types_core::felt::{Felt, NonZeroFelt};\nuse std::num::{NonZeroU64, NonZeroU128};\n\nimpl FromConv<NonZeroU64> for NonZeroFelt {\n    fn from_(value: NonZeroU64) -> Self {\n        NonZeroFelt::try_from(Felt::from(value.get())).unwrap_or_else(|_| {\n            unreachable!(\n                \"NonZeroU64 is always greater than 0, so it should be convertible to NonZeroFelt\"\n            )\n        })\n    }\n}\n\nimpl FromConv<NonZeroU128> for NonZeroFelt {\n    fn from_(value: NonZeroU128) -> Self {\n        NonZeroFelt::try_from(Felt::from(value.get())).unwrap_or_else(|_| {\n            unreachable!(\n                \"NonZeroU128 is always greater than 0, so it should be convertible to NonZeroFelt\"\n            )\n        })\n    }\n}\n"
  },
  {
    "path": "crates/conversions/src/non_zero_u128.rs",
    "content": "use crate::TryFromConv;\nuse starknet_types_core::felt::{Felt, NonZeroFelt};\nuse std::num::{NonZero, NonZeroU128};\n\nimpl TryFromConv<NonZeroFelt> for NonZeroU128 {\n    type Error = String;\n    fn try_from_(value: NonZeroFelt) -> Result<Self, Self::Error> {\n        let value: u128 = Felt::from(value)\n            .try_into()\n            .map_err(|_| \"felt was too large to fit in u128\")?;\n        Ok(NonZero::new(value)\n            .unwrap_or_else(|| unreachable!(\"non zero felt is always greater than 0\")))\n    }\n}\n"
  },
  {
    "path": "crates/conversions/src/non_zero_u64.rs",
    "content": "use crate::TryFromConv;\nuse starknet_types_core::felt::{Felt, NonZeroFelt};\nuse std::num::{NonZero, NonZeroU64};\n\nimpl TryFromConv<NonZeroFelt> for NonZeroU64 {\n    type Error = String;\n    fn try_from_(value: NonZeroFelt) -> Result<Self, Self::Error> {\n        let value: u64 = Felt::from(value)\n            .try_into()\n            .map_err(|_| \"felt was too large to fit in u64\")?;\n        Ok(NonZero::new(value)\n            .unwrap_or_else(|| unreachable!(\"non zero felt is always greater than 0\")))\n    }\n}\n"
  },
  {
    "path": "crates/conversions/src/nonce.rs",
    "content": "use crate::{FromConv, IntoConv, from_thru_felt};\nuse starknet_api::core::{ClassHash, ContractAddress, EntryPointSelector, Nonce};\nuse starknet_types_core::felt::Felt;\n\nimpl FromConv<Felt> for Nonce {\n    fn from_(value: Felt) -> Nonce {\n        Nonce(value.into_())\n    }\n}\n\nfrom_thru_felt!(ClassHash, Nonce);\nfrom_thru_felt!(ContractAddress, Nonce);\nfrom_thru_felt!(EntryPointSelector, Nonce);\n"
  },
  {
    "path": "crates/conversions/src/padded_felt.rs",
    "content": "use crate::FromConv;\nuse cairo_serde_macros::CairoSerialize;\nuse conversions::from_thru_felt;\nuse serde::{Deserialize, Serialize, Serializer};\nuse starknet_api::core::{ClassHash, ContractAddress};\nuse starknet_types_core::felt::Felt;\nuse std::fmt;\nuse std::fmt::{Formatter, LowerHex};\n\n#[derive(Clone, Copy, Debug, PartialEq, Deserialize, CairoSerialize)]\npub struct PaddedFelt(pub Felt);\n\nimpl FromConv<Felt> for PaddedFelt {\n    fn from_(value: Felt) -> Self {\n        Self(value)\n    }\n}\n\nimpl Serialize for PaddedFelt {\n    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>\n    where\n        S: Serializer,\n    {\n        serializer.serialize_str(&format!(\"{:#066x}\", &self.0))\n    }\n}\n\nimpl LowerHex for PaddedFelt {\n    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {\n        write!(f, \"{:#066x}\", self.0)\n    }\n}\n\nfrom_thru_felt!(ClassHash, PaddedFelt);\nfrom_thru_felt!(ContractAddress, PaddedFelt);\n"
  },
  {
    "path": "crates/conversions/src/primitive.rs",
    "content": "use super::TryFromConv;\nuse starknet_types_core::felt::Felt;\nuse thiserror;\n\n#[derive(Debug, thiserror::Error)]\npub enum PrimitiveConversionError {\n    #[error(\"Felt overflow\")]\n    Overflow,\n}\n\n#[macro_export]\nmacro_rules! impl_try_from_felt {\n    ($to:ty) => {\n        impl TryFromConv<Felt> for $to {\n            type Error = PrimitiveConversionError;\n            fn try_from_(value: Felt) -> Result<$to, Self::Error> {\n                if value.ge(&Felt::from(<$to>::MAX)) {\n                    Err(PrimitiveConversionError::Overflow)\n                } else {\n                    Ok(<$to>::from_le_bytes(\n                        value.to_bytes_le()[..size_of::<$to>()].try_into().unwrap(),\n                    ))\n                }\n            }\n        }\n    };\n}\n\nimpl_try_from_felt!(u64);\nimpl_try_from_felt!(u128);\n"
  },
  {
    "path": "crates/conversions/src/serde/deserialize/deserialize_impl.rs",
    "content": "use super::{BufferReadError, BufferReadResult, BufferReader, CairoDeserialize};\nuse crate::{IntoConv, byte_array::ByteArray};\nuse num_traits::cast::ToPrimitive;\nuse starknet_api::core::{ClassHash, ContractAddress, EntryPointSelector, Nonce};\nuse starknet_rust::{core::types::U256, providers::Url};\nuse starknet_types_core::felt::{Felt, NonZeroFelt};\nuse std::num::NonZero;\n\nimpl CairoDeserialize for Url {\n    fn deserialize(reader: &mut BufferReader<'_>) -> BufferReadResult<Self> {\n        let url: String = reader.read::<ByteArray>()?.to_string();\n        Url::parse(&url).map_err(|_| BufferReadError::ParseFailed)\n    }\n}\n\nimpl CairoDeserialize for Felt {\n    fn deserialize(reader: &mut BufferReader<'_>) -> BufferReadResult<Self> {\n        reader.read_felt()\n    }\n}\n\nimpl<T> CairoDeserialize for Vec<T>\nwhere\n    T: CairoDeserialize,\n{\n    fn deserialize(reader: &mut BufferReader<'_>) -> BufferReadResult<Self> {\n        let length: Felt = reader.read()?;\n        let length = length.to_usize().ok_or(BufferReadError::ParseFailed)?;\n\n        let mut result = Vec::with_capacity(length);\n\n        for _ in 0..length {\n            result.push(reader.read()?);\n        }\n\n        Ok(result)\n    }\n}\n\nimpl<T> CairoDeserialize for Option<T>\nwhere\n    T: CairoDeserialize,\n{\n    fn deserialize(reader: &mut BufferReader<'_>) -> BufferReadResult<Self> {\n        let variant: Felt = reader.read()?;\n        let variant = variant.to_usize().ok_or(BufferReadError::ParseFailed)?;\n\n        match variant {\n            0 => Ok(Some(reader.read()?)),\n            1 => Ok(None),\n            _ => Err(BufferReadError::ParseFailed),\n        }\n    }\n}\n\nimpl<T: CairoDeserialize, E: CairoDeserialize> CairoDeserialize for Result<T, E> {\n    fn deserialize(reader: &mut BufferReader<'_>) -> BufferReadResult<Self> {\n        let variant: Felt = reader.read()?;\n        let variant = variant.to_usize().ok_or(BufferReadError::ParseFailed)?;\n\n        match variant {\n            0 => Ok(Ok(reader.read()?)),\n            1 => Ok(Err(reader.read()?)),\n            _ => Err(BufferReadError::ParseFailed),\n        }\n    }\n}\n\nimpl CairoDeserialize for bool {\n    fn deserialize(reader: &mut BufferReader<'_>) -> BufferReadResult<Self> {\n        let num: usize = reader.read()?;\n\n        match num {\n            0 => Ok(false),\n            1 => Ok(true),\n            _ => Err(BufferReadError::ParseFailed),\n        }\n    }\n}\n\nimpl CairoDeserialize for NonZeroFelt {\n    fn deserialize(reader: &mut BufferReader<'_>) -> BufferReadResult<Self> {\n        let felt = reader.read::<Felt>()?;\n        NonZeroFelt::try_from(felt).map_err(|_| BufferReadError::ParseFailed)\n    }\n}\n\nmacro_rules! impl_deserialize_for_nonzero_num_type {\n    ($type:ty) => {\n        impl CairoDeserialize for NonZero<$type> {\n            fn deserialize(reader: &mut BufferReader<'_>) -> BufferReadResult<Self> {\n                let val = <$type>::deserialize(reader)?;\n                NonZero::new(val).ok_or(BufferReadError::ParseFailed)\n            }\n        }\n    };\n}\n\nmacro_rules! impl_deserialize_for_felt_type {\n    ($type:ty) => {\n        impl CairoDeserialize for $type {\n            fn deserialize(reader: &mut BufferReader<'_>) -> BufferReadResult<Self> {\n                Felt::deserialize(reader).map(IntoConv::into_)\n            }\n        }\n    };\n}\n\nmacro_rules! impl_deserialize_for_num_type {\n    ($type:ty) => {\n        impl CairoDeserialize for $type {\n            fn deserialize(reader: &mut BufferReader<'_>) -> BufferReadResult<Self> {\n                let felt = Felt::deserialize(reader)?;\n                felt.try_into().map_err(|_| BufferReadError::ParseFailed)\n            }\n        }\n    };\n}\n\nimpl_deserialize_for_felt_type!(ClassHash);\nimpl_deserialize_for_felt_type!(ContractAddress);\nimpl_deserialize_for_felt_type!(Nonce);\nimpl_deserialize_for_felt_type!(EntryPointSelector);\n\nimpl_deserialize_for_nonzero_num_type!(u32);\nimpl_deserialize_for_nonzero_num_type!(u64);\nimpl_deserialize_for_nonzero_num_type!(u128);\nimpl_deserialize_for_nonzero_num_type!(usize);\n\nimpl_deserialize_for_num_type!(u8);\nimpl_deserialize_for_num_type!(u16);\nimpl_deserialize_for_num_type!(u32);\nimpl_deserialize_for_num_type!(u64);\nimpl_deserialize_for_num_type!(u128);\nimpl_deserialize_for_num_type!(U256);\nimpl_deserialize_for_num_type!(usize);\n\nimpl_deserialize_for_num_type!(i8);\nimpl_deserialize_for_num_type!(i16);\nimpl_deserialize_for_num_type!(i32);\nimpl_deserialize_for_num_type!(i64);\nimpl_deserialize_for_num_type!(i128);\n"
  },
  {
    "path": "crates/conversions/src/serde/deserialize.rs",
    "content": "use starknet_types_core::felt::Felt;\nuse thiserror::Error;\n\npub use cairo_serde_macros::CairoDeserialize;\n\nmod deserialize_impl;\n\n#[derive(Error, Debug)]\npub enum BufferReadError {\n    #[error(\"Read out of bounds\")]\n    EndOfBuffer,\n    #[error(\"Failed to parse while reading\")]\n    ParseFailed,\n}\n\npub type BufferReadResult<T> = Result<T, BufferReadError>;\n\npub struct BufferReader<'a> {\n    buffer: &'a [Felt],\n}\n\npub trait CairoDeserialize: Sized {\n    fn deserialize(reader: &mut BufferReader<'_>) -> BufferReadResult<Self>;\n}\n\nimpl<'a> BufferReader<'a> {\n    #[must_use]\n    pub fn new(buffer: &'a [Felt]) -> Self {\n        Self { buffer }\n    }\n\n    pub fn read_felt(&mut self) -> BufferReadResult<Felt> {\n        let [head, tail @ ..] = self.buffer else {\n            return Err(BufferReadError::EndOfBuffer);\n        };\n        self.buffer = tail;\n        Ok(*head)\n    }\n\n    #[must_use]\n    pub fn into_remaining(self) -> &'a [Felt] {\n        self.buffer\n    }\n\n    pub fn read<T>(&mut self) -> BufferReadResult<T>\n    where\n        T: CairoDeserialize,\n    {\n        T::deserialize(self)\n    }\n}\n"
  },
  {
    "path": "crates/conversions/src/serde/serialize/serialize_impl.rs",
    "content": "use super::{BufferWriter, CairoSerialize};\nuse crate::{IntoConv, byte_array::ByteArray};\nuse blockifier::execution::entry_point::{CallEntryPoint, CallType};\nuse starknet_api::core::EthAddress;\nuse starknet_api::core::{ClassHash, ContractAddress, EntryPointSelector, Nonce};\nuse starknet_api::transaction::fields::{Calldata, ContractAddressSalt};\nuse starknet_rust::core::types::{\n    ContractErrorData, ContractExecutionError, TransactionExecutionErrorData,\n};\nuse starknet_types_core::felt::Felt;\nuse std::{\n    cell::{Ref, RefCell},\n    rc::Rc,\n    sync::Arc,\n};\n\nuse starknet_api::contract_class::EntryPointType;\n\nimpl CairoSerialize for CallEntryPoint {\n    fn serialize(&self, output: &mut BufferWriter) {\n        self.entry_point_type.serialize(output);\n        self.entry_point_selector.serialize(output);\n        self.calldata.serialize(output);\n        self.storage_address.serialize(output);\n        self.caller_address.serialize(output);\n        self.call_type.serialize(output);\n    }\n}\n\nimpl CairoSerialize for ContractErrorData {\n    fn serialize(&self, output: &mut BufferWriter) {\n        self.revert_error.serialize(output);\n    }\n}\n\n// TODO(#3129)\nimpl CairoSerialize for ContractExecutionError {\n    fn serialize(&self, output: &mut BufferWriter) {\n        match &self {\n            // We need to add 0 and 1 because of enum variants serialization\n            ContractExecutionError::Nested(inner) => {\n                0.serialize(output);\n                inner.class_hash.serialize(output);\n                inner.contract_address.serialize(output);\n                inner.selector.serialize(output);\n                inner.error.serialize(output);\n            }\n            ContractExecutionError::Message(msg) => {\n                1.serialize(output);\n                ByteArray::from(msg.as_str()).serialize(output);\n            }\n        }\n    }\n}\n\nimpl CairoSerialize for TransactionExecutionErrorData {\n    fn serialize(&self, output: &mut BufferWriter) {\n        self.transaction_index.serialize(output);\n        self.execution_error.serialize(output);\n    }\n}\n\nimpl CairoSerialize for anyhow::Error {\n    fn serialize(&self, output: &mut BufferWriter) {\n        ByteArray::from(self.to_string().as_str()).serialize(output);\n    }\n}\n\nimpl CairoSerialize for Calldata {\n    fn serialize(&self, output: &mut BufferWriter) {\n        self.0.serialize(output);\n    }\n}\n\nimpl CairoSerialize for EntryPointType {\n    fn serialize(&self, output: &mut BufferWriter) {\n        match self {\n            EntryPointType::Constructor => output.write_felt(0.into()),\n            EntryPointType::External => output.write_felt(1.into()),\n            EntryPointType::L1Handler => output.write_felt(2.into()),\n        }\n    }\n}\n\nimpl CairoSerialize for CallType {\n    fn serialize(&self, output: &mut BufferWriter) {\n        match self {\n            CallType::Call => output.write_felt(0.into()),\n            CallType::Delegate => output.write_felt(1.into()),\n        }\n    }\n}\n\nimpl CairoSerialize for bool {\n    fn serialize(&self, output: &mut BufferWriter) {\n        if *self {\n            Felt::from(1).serialize(output);\n        } else {\n            Felt::from(0).serialize(output);\n        }\n    }\n}\n\nimpl<T> CairoSerialize for Arc<T>\nwhere\n    T: CairoSerialize,\n{\n    fn serialize(&self, output: &mut BufferWriter) {\n        T::serialize(self, output);\n    }\n}\n\nimpl<T> CairoSerialize for Rc<T>\nwhere\n    T: CairoSerialize,\n{\n    fn serialize(&self, output: &mut BufferWriter) {\n        T::serialize(self, output);\n    }\n}\n\nimpl<T> CairoSerialize for RefCell<T>\nwhere\n    T: CairoSerialize,\n{\n    fn serialize(&self, output: &mut BufferWriter) {\n        self.borrow().serialize(output);\n    }\n}\n\nimpl<T> CairoSerialize for Ref<'_, T>\nwhere\n    T: CairoSerialize,\n{\n    fn serialize(&self, output: &mut BufferWriter) {\n        T::serialize(self, output);\n    }\n}\n\nimpl<T> CairoSerialize for Vec<T>\nwhere\n    T: CairoSerialize,\n{\n    fn serialize(&self, output: &mut BufferWriter) {\n        self.len().serialize(output);\n\n        for e in self {\n            e.serialize(output);\n        }\n    }\n}\n\nimpl<T: CairoSerialize, E: CairoSerialize> CairoSerialize for Result<T, E> {\n    fn serialize(&self, output: &mut BufferWriter) {\n        match self {\n            Ok(val) => {\n                output.write_felt(Felt::from(0));\n                val.serialize(output);\n            }\n            Err(err) => {\n                output.write_felt(Felt::from(1));\n                err.serialize(output);\n            }\n        }\n    }\n}\n\nimpl<T: CairoSerialize> CairoSerialize for Option<T> {\n    fn serialize(&self, output: &mut BufferWriter) {\n        match self {\n            Some(val) => {\n                output.write_felt(Felt::from(0));\n                val.serialize(output);\n            }\n            None => output.write_felt(Felt::from(1)),\n        }\n    }\n}\n\nimpl<T> CairoSerialize for &T\nwhere\n    T: CairoSerialize + ?Sized,\n{\n    fn serialize(&self, output: &mut BufferWriter) {\n        T::serialize(self, output);\n    }\n}\n\nmacro_rules! impl_serialize_for_felt_type {\n    ($type:ty) => {\n        impl CairoSerialize for $type {\n            fn serialize(&self, output: &mut BufferWriter) {\n                output.write_felt(self.clone().into_());\n            }\n        }\n    };\n}\n\nmacro_rules! impl_serialize_for_num_type {\n    ($type:ty) => {\n        impl CairoSerialize for $type {\n            fn serialize(&self, output: &mut BufferWriter) {\n                Felt::from(*self).serialize(output);\n            }\n        }\n    };\n}\n\nmacro_rules! impl_serialize_for_tuple {\n    ($($ty:ident),*) => {\n        impl<$( $ty ),*> CairoSerialize for ( $( $ty, )* )\n        where\n        $( $ty: CairoSerialize, )*\n        {\n            #[allow(non_snake_case)]\n            #[allow(unused_variables)]\n            fn serialize(&self, output: &mut BufferWriter) {\n                let ( $( $ty, )* ) = self;\n\n                $( $ty.serialize(output); )*\n            }\n        }\n    };\n}\n\nimpl_serialize_for_felt_type!(Felt);\nimpl_serialize_for_felt_type!(ClassHash);\nimpl_serialize_for_felt_type!(ContractAddress);\nimpl_serialize_for_felt_type!(ContractAddressSalt);\nimpl_serialize_for_felt_type!(Nonce);\nimpl_serialize_for_felt_type!(EntryPointSelector);\nimpl_serialize_for_felt_type!(EthAddress);\n\nimpl_serialize_for_num_type!(u8);\nimpl_serialize_for_num_type!(u16);\nimpl_serialize_for_num_type!(u32);\nimpl_serialize_for_num_type!(u64);\nimpl_serialize_for_num_type!(u128);\nimpl_serialize_for_num_type!(usize);\n\nimpl_serialize_for_num_type!(i8);\nimpl_serialize_for_num_type!(i16);\nimpl_serialize_for_num_type!(i32);\nimpl_serialize_for_num_type!(i64);\nimpl_serialize_for_num_type!(i128);\n\nimpl_serialize_for_tuple!();\nimpl_serialize_for_tuple!(A);\nimpl_serialize_for_tuple!(A, B);\nimpl_serialize_for_tuple!(A, B, C);\nimpl_serialize_for_tuple!(A, B, C, D); // cairo serde supports tuples in range 0 - 4 only\n"
  },
  {
    "path": "crates/conversions/src/serde/serialize.rs",
    "content": "use starknet_types_core::felt::Felt;\n\npub use cairo_serde_macros::CairoSerialize;\n\nmod serialize_impl;\n\npub struct BufferWriter {\n    output: Vec<Felt>,\n}\n\nimpl BufferWriter {\n    fn new() -> Self {\n        Self { output: vec![] }\n    }\n\n    pub fn write_felt(&mut self, felt: Felt) {\n        self.output.push(felt);\n    }\n\n    pub fn write<T>(&mut self, serializable: T)\n    where\n        T: CairoSerialize,\n    {\n        serializable.serialize(self);\n    }\n\n    #[must_use]\n    pub fn to_vec(self) -> Vec<Felt> {\n        self.output\n    }\n}\n\npub trait CairoSerialize {\n    fn serialize(&self, output: &mut BufferWriter);\n}\n\npub trait SerializeToFeltVec {\n    fn serialize_to_vec(&self) -> Vec<Felt>;\n}\n\nimpl<T> SerializeToFeltVec for T\nwhere\n    T: CairoSerialize,\n{\n    fn serialize_to_vec(&self) -> Vec<Felt> {\n        let mut buffer = BufferWriter::new();\n\n        self.serialize(&mut buffer);\n\n        buffer.to_vec()\n    }\n}\n"
  },
  {
    "path": "crates/conversions/src/serde/serialized_value.rs",
    "content": "use conversions::serde::deserialize::{BufferReadResult, BufferReader, CairoDeserialize};\nuse conversions::serde::serialize::{BufferWriter, CairoSerialize};\nuse starknet_types_core::felt::Felt;\n\n/// Represents an already serialized Vec of values.\n///\n/// Use this to omit adding extra felt for the length of the vector during serialization.\n#[derive(Debug)]\npub struct SerializedValue<T>(pub Vec<T>)\nwhere\n    T: CairoSerialize;\n\nimpl<T> SerializedValue<T>\nwhere\n    T: CairoSerialize,\n{\n    #[must_use]\n    pub fn new(vec: Vec<T>) -> Self {\n        Self(vec)\n    }\n}\n\nimpl<T> CairoSerialize for SerializedValue<T>\nwhere\n    T: CairoSerialize,\n{\n    fn serialize(&self, output: &mut BufferWriter) {\n        for e in &self.0 {\n            e.serialize(output);\n        }\n    }\n}\n\nimpl CairoDeserialize for SerializedValue<Felt> {\n    fn deserialize(reader: &mut BufferReader<'_>) -> BufferReadResult<Self> {\n        let mut result: Vec<Felt> = Vec::new();\n        while let Ok(r) = reader.read_felt() {\n            result.push(r);\n        }\n        Ok(Self::new(result))\n    }\n}\n"
  },
  {
    "path": "crates/conversions/src/serde.rs",
    "content": "pub mod deserialize;\npub mod serialize;\npub mod serialized_value;\n\npub use serialized_value::SerializedValue;\n"
  },
  {
    "path": "crates/conversions/src/string.rs",
    "content": "use crate::IntoConv;\nuse anyhow::Result;\nuse starknet_types_core::felt::Felt;\n\npub trait TryFromDecStr {\n    fn try_from_dec_str(str: &str) -> Result<Self>\n    where\n        Self: Sized;\n}\n\npub trait TryFromHexStr {\n    fn try_from_hex_str(str: &str) -> Result<Self>\n    where\n        Self: Sized;\n}\npub trait IntoDecStr {\n    fn into_dec_string(self) -> String;\n}\n\npub trait IntoHexStr {\n    fn into_hex_string(self) -> String;\n}\n\npub trait IntoPaddedHexStr {\n    fn into_padded_hex_str(self) -> String;\n}\n\nimpl<T> IntoDecStr for T\nwhere\n    T: IntoConv<Felt>,\n{\n    fn into_dec_string(self) -> String {\n        self.into_().to_string()\n    }\n}\n\nimpl<T> IntoHexStr for T\nwhere\n    T: IntoConv<Felt>,\n{\n    fn into_hex_string(self) -> String {\n        self.into_().to_hex_string()\n    }\n}\n\nimpl<T> IntoPaddedHexStr for T\nwhere\n    T: IntoConv<Felt>,\n{\n    fn into_padded_hex_str(self) -> String {\n        self.into_().to_fixed_hex_string()\n    }\n}\n"
  },
  {
    "path": "crates/conversions/tests/derive_cairo_deserialize.rs",
    "content": "use conversions::serde::deserialize::{BufferReader, CairoDeserialize};\nuse starknet_types_core::felt::Felt;\n\nmacro_rules! from_felts {\n    ($($exprs:expr),*) => {\n        CairoDeserialize::deserialize(&mut BufferReader::new(&[\n            $(\n                Felt::from($exprs)\n            ),*\n        ])).unwrap()\n    };\n}\n\n#[test]\nfn work_on_struct() {\n    #[derive(CairoDeserialize, Debug, PartialEq, Eq)]\n    struct Foo {\n        a: Felt,\n    }\n\n    let value: Foo = from_felts!(123);\n\n    assert_eq!(value, Foo { a: Felt::from(123) });\n}\n\n#[test]\nfn work_on_empty_struct() {\n    #[derive(CairoDeserialize, Debug, PartialEq, Eq)]\n    struct Foo {}\n\n    let value: Foo = from_felts!();\n\n    assert_eq!(value, Foo {});\n}\n\n#[test]\nfn work_on_tuple_struct() {\n    #[derive(CairoDeserialize, Debug, PartialEq, Eq)]\n    struct Foo(Felt);\n\n    let value: Foo = from_felts!(123);\n\n    assert_eq!(value, Foo(Felt::from(123)));\n}\n\n#[test]\nfn work_on_empty_tuple_struct() {\n    #[derive(CairoDeserialize, Debug, PartialEq, Eq)]\n    struct Foo();\n\n    let value: Foo = from_felts!();\n\n    assert_eq!(value, Foo());\n}\n\n#[test]\nfn work_on_unit_struct() {\n    #[derive(CairoDeserialize, Debug, PartialEq, Eq)]\n    struct Foo;\n\n    let value: Foo = from_felts!();\n\n    assert_eq!(value, Foo);\n}\n\n#[test]\nfn work_on_enum() {\n    #[derive(CairoDeserialize, Debug, PartialEq, Eq)]\n    enum Foo {\n        A,\n        B(Felt),\n        C { a: Felt },\n    }\n\n    let value: Foo = from_felts!(0);\n    assert_eq!(value, Foo::A);\n\n    let value: Foo = from_felts!(1, 123);\n    assert_eq!(value, Foo::B(Felt::from(123)));\n\n    let value: Foo = from_felts!(2, 123);\n    assert_eq!(value, Foo::C { a: Felt::from(123) });\n}\n\n#[test]\n#[should_panic(expected = \"called `Result::unwrap()` on an `Err` value: ParseFailed\")]\n#[allow(unreachable_code)]\nfn fail_on_empty_enum() {\n    #[derive(CairoDeserialize, Debug, PartialEq, Eq)]\n    enum Foo {}\n\n    let _: Foo = from_felts!(0);\n}\n\n#[test]\nfn work_with_nested() {\n    #[derive(CairoDeserialize, Debug, PartialEq, Eq)]\n    enum Foo {\n        A,\n        B(Felt),\n        C { a: Bar },\n    }\n\n    #[derive(CairoDeserialize, Debug, PartialEq, Eq)]\n    struct Bar {\n        a: Felt,\n    }\n\n    let value: Foo = from_felts!(2, 123);\n\n    assert_eq!(\n        value,\n        Foo::C {\n            a: Bar { a: Felt::from(123) }\n        }\n    );\n}\n\n#[test]\n#[should_panic(expected = \"called `Result::unwrap()` on an `Err` value: EndOfBuffer\")]\nfn fail_on_too_short_data() {\n    #[derive(CairoDeserialize, Debug, PartialEq, Eq)]\n    struct Foo {\n        a: Felt,\n        b: Felt,\n    }\n\n    let _: Foo = from_felts!(123);\n}\n"
  },
  {
    "path": "crates/conversions/tests/derive_cairo_serialize.rs",
    "content": "use conversions::serde::serialize::{CairoSerialize, SerializeToFeltVec};\nuse starknet_types_core::felt::Felt;\n\nmacro_rules! from_felts {\n    ($($exprs:expr),*) => {\n        &[\n            $(\n                Felt::from($exprs)\n            ),*\n        ]\n    };\n}\n\n#[test]\nfn work_on_struct() {\n    #[derive(CairoSerialize, Debug, PartialEq, Eq)]\n    struct Foo {\n        a: Felt,\n    }\n\n    let value = from_felts!(123);\n\n    assert_eq!(\n        value,\n        Foo { a: Felt::from(123) }.serialize_to_vec().as_slice()\n    );\n}\n\n#[test]\nfn work_on_empty_struct() {\n    #[derive(CairoSerialize, Debug, PartialEq, Eq)]\n    struct Foo {}\n\n    let value: &[Felt] = from_felts!();\n\n    assert_eq!(value, Foo {}.serialize_to_vec().as_slice());\n}\n\n#[test]\nfn work_on_tuple_struct() {\n    #[derive(CairoSerialize, Debug, PartialEq, Eq)]\n    struct Foo(Felt);\n\n    let value = from_felts!(123);\n\n    assert_eq!(value, Foo(Felt::from(123)).serialize_to_vec().as_slice());\n}\n\n#[test]\nfn work_on_empty_tuple_struct() {\n    #[derive(CairoSerialize, Debug, PartialEq, Eq)]\n    struct Foo();\n\n    let value: &[Felt] = from_felts!();\n\n    assert_eq!(value, Foo().serialize_to_vec().as_slice());\n}\n\n#[test]\nfn work_on_unit_struct() {\n    #[derive(CairoSerialize, Debug, PartialEq, Eq)]\n    struct Foo;\n\n    let value: &[Felt] = from_felts!();\n\n    assert_eq!(value, Foo.serialize_to_vec().as_slice());\n}\n\n#[test]\nfn work_on_enum() {\n    #[derive(CairoSerialize, Debug, PartialEq, Eq)]\n    enum Foo {\n        A,\n        B(Felt),\n        C { a: Felt },\n    }\n\n    let value = from_felts!(0);\n    assert_eq!(value, Foo::A.serialize_to_vec().as_slice());\n\n    let value = from_felts!(1, 123);\n    assert_eq!(value, Foo::B(Felt::from(123)).serialize_to_vec().as_slice());\n\n    let value = from_felts!(2, 123);\n    assert_eq!(\n        value,\n        Foo::C { a: Felt::from(123) }.serialize_to_vec().as_slice()\n    );\n}\n\n#[test]\nfn work_on_empty_enum() {\n    #[derive(CairoSerialize, Debug, PartialEq, Eq)]\n    #[expect(dead_code)]\n    enum Foo {}\n}\n\n#[test]\nfn work_with_nested() {\n    #[derive(CairoSerialize, Debug, PartialEq, Eq)]\n    #[expect(dead_code)]\n    enum Foo {\n        A,\n        B(Felt),\n        C { a: Bar },\n    }\n\n    #[derive(CairoSerialize, Debug, PartialEq, Eq)]\n    struct Bar {\n        a: Felt,\n    }\n\n    let value = from_felts!(2, 123);\n\n    assert_eq!(\n        value,\n        Foo::C {\n            a: Bar { a: Felt::from(123) }\n        }\n        .serialize_to_vec()\n        .as_slice()\n    );\n}\n"
  },
  {
    "path": "crates/conversions/tests/e2e/class_hash.rs",
    "content": "#[cfg(test)]\nmod tests_class_hash {\n    use cairo_vm::utils::PRIME_STR;\n    use conversions::string::{IntoDecStr, TryFromDecStr, TryFromHexStr};\n    use conversions::{FromConv, IntoConv};\n    use starknet_api::core::ClassHash;\n    use starknet_api::core::{ContractAddress, EntryPointSelector, Nonce};\n    use starknet_api::hash::StarkHash;\n    use starknet_types_core::felt::Felt;\n\n    #[test]\n    fn test_class_hash_conversions_happy_case() {\n        let felt = Felt::from_bytes_be(&[1u8; 32]);\n        let class_hash = ClassHash(felt);\n\n        assert_eq!(class_hash, ContractAddress::from_(class_hash).into_());\n        assert_eq!(class_hash, Felt::from_(class_hash).into_());\n        assert_eq!(class_hash, Felt::from_(class_hash).into_());\n        assert_eq!(class_hash, Nonce::from_(class_hash).into_());\n        assert_eq!(class_hash, EntryPointSelector::from_(class_hash).into_());\n        assert_eq!(class_hash, StarkHash::from_(class_hash).into_());\n\n        assert_eq!(\n            class_hash,\n            ClassHash::try_from_dec_str(&class_hash.into_dec_string()).unwrap()\n        );\n    }\n\n    #[test]\n    fn test_class_hash_conversions_zero() {\n        let felt = Felt::ZERO;\n        let class_hash = ClassHash(felt);\n\n        assert_eq!(class_hash, ContractAddress::from_(class_hash).into_());\n        assert_eq!(class_hash, Felt::from_(class_hash).into_());\n        assert_eq!(class_hash, Felt::from_(class_hash).into_());\n        assert_eq!(class_hash, Nonce::from_(class_hash).into_());\n        assert_eq!(class_hash, EntryPointSelector::from_(class_hash).into_());\n        assert_eq!(class_hash, StarkHash::from_(class_hash).into_());\n\n        assert_eq!(\n            class_hash,\n            ClassHash::try_from_dec_str(&class_hash.into_dec_string()).unwrap()\n        );\n    }\n\n    #[test]\n    fn test_class_hash_conversions_limit() {\n        let mut class_hash: ClassHash = Felt::MAX.into_();\n\n        assert_eq!(class_hash, Felt::from_(class_hash).into_());\n        assert_eq!(class_hash, Felt::from_(class_hash).into_());\n        assert_eq!(class_hash, Nonce::from_(class_hash).into_());\n        assert_eq!(class_hash, EntryPointSelector::from_(class_hash).into_());\n        assert_eq!(class_hash, StarkHash::from_(class_hash).into_());\n\n        // PATRICIA_KEY_UPPER_BOUND for contract_address from starknet_api-0.4.1/src/core.rs:156\n        let max_value = \"0x07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe\";\n        class_hash = ClassHash::try_from_hex_str(max_value).unwrap();\n        assert_eq!(class_hash, ContractAddress::from_(class_hash).into_());\n\n        // Unknown source for this value, founded by try and error(cairo-lang-runner-2.2.0/src/short_string.rs).\n        let max_value = \"0x0777777777777777777777777777777777777f7f7f7f7f7f7f7f7f7f7f7f7f7f\";\n        class_hash = ClassHash::try_from_hex_str(max_value).unwrap();\n\n        assert_eq!(\n            class_hash,\n            ClassHash::try_from_dec_str(&class_hash.into_dec_string()).unwrap()\n        );\n    }\n\n    #[test]\n    fn test_class_hash_conversions_out_of_range() {\n        assert!(ClassHash::try_from_hex_str(PRIME_STR).unwrap() == Felt::from(0_u8).into_());\n    }\n}\n"
  },
  {
    "path": "crates/conversions/tests/e2e/contract_address.rs",
    "content": "#[cfg(test)]\nmod tests_contract_address {\n    use cairo_vm::utils::PRIME_STR;\n    use conversions::string::{IntoDecStr, TryFromDecStr, TryFromHexStr};\n    use conversions::{FromConv, IntoConv};\n    use starknet_api::core::{ClassHash, EntryPointSelector, Nonce};\n    use starknet_api::core::{ContractAddress, PatriciaKey};\n    use starknet_api::hash::StarkHash;\n    use starknet_types_core::felt::Felt;\n\n    #[test]\n    fn test_contract_address_conversions_happy_case() {\n        let felt = Felt::from_bytes_be(&[1u8; 32]);\n        let contract_address = ContractAddress(PatriciaKey::try_from(felt).unwrap());\n\n        assert_eq!(contract_address, ClassHash::from_(contract_address).into_(),);\n        assert_eq!(contract_address, Felt::from_(contract_address).into_());\n        assert_eq!(contract_address, Felt::from_(contract_address).into_());\n        assert_eq!(contract_address, Nonce::from_(contract_address).into_());\n        assert_eq!(\n            contract_address,\n            EntryPointSelector::from_(contract_address).into_()\n        );\n        assert_eq!(contract_address, StarkHash::from_(contract_address).into_());\n\n        assert_eq!(\n            contract_address,\n            ContractAddress::try_from_dec_str(&contract_address.into_dec_string()).unwrap()\n        );\n    }\n\n    #[test]\n    fn test_contract_address_conversions_zero() {\n        let felt = Felt::ZERO;\n        let contract_address = ContractAddress(PatriciaKey::try_from(felt).unwrap());\n\n        assert_eq!(contract_address, ClassHash::from_(contract_address).into_(),);\n        assert_eq!(contract_address, Felt::from_(contract_address).into_());\n        assert_eq!(contract_address, Felt::from_(contract_address).into_());\n        assert_eq!(contract_address, Nonce::from_(contract_address).into_());\n        assert_eq!(\n            contract_address,\n            EntryPointSelector::from_(contract_address).into_()\n        );\n        assert_eq!(contract_address, StarkHash::from_(contract_address).into_());\n\n        assert_eq!(\n            contract_address,\n            ContractAddress::try_from_dec_str(&contract_address.into_dec_string()).unwrap()\n        );\n    }\n\n    #[test]\n    fn test_contract_address_conversions_limit() {\n        // PATRICIA_KEY_UPPER_BOUND for contract_address from starknet_api-0.4.1/src/core.rs:156\n        let mut max_value = \"0x07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe\";\n        let mut contract_address = ContractAddress::try_from_hex_str(max_value).unwrap();\n\n        assert_eq!(contract_address, ClassHash::from_(contract_address).into_(),);\n        assert_eq!(contract_address, Felt::from_(contract_address).into_());\n        assert_eq!(contract_address, Felt::from_(contract_address).into_());\n        assert_eq!(contract_address, Nonce::from_(contract_address).into_());\n        assert_eq!(\n            contract_address,\n            EntryPointSelector::from_(contract_address).into_()\n        );\n        assert_eq!(contract_address, StarkHash::from_(contract_address).into_());\n\n        // Unknown source for this value, founded by try and error(cairo-lang-runner-2.2.0/src/short_string.rs).\n        max_value = \"0x0777777777777777777777777777777777777f7f7f7f7f7f7f7f7f7f7f7f7f7f\";\n        contract_address = ContractAddress::try_from_hex_str(max_value).unwrap();\n\n        assert_eq!(\n            contract_address,\n            ContractAddress::try_from_dec_str(&contract_address.into_dec_string()).unwrap()\n        );\n    }\n\n    #[test]\n    fn test_contract_address_conversions_out_of_range() {\n        assert!(ContractAddress::try_from_hex_str(PRIME_STR).unwrap() == Felt::from(0_u8).into_());\n    }\n}\n"
  },
  {
    "path": "crates/conversions/tests/e2e/entrypoint_selector.rs",
    "content": "#[cfg(test)]\nmod tests_entrypoint_selector {\n    use cairo_vm::utils::PRIME_STR;\n    use conversions::string::{IntoDecStr, TryFromDecStr, TryFromHexStr};\n    use conversions::{FromConv, IntoConv};\n    use starknet_api::core::{ClassHash, ContractAddress, EntryPointSelector, Nonce};\n    use starknet_api::hash::StarkHash;\n    use starknet_types_core::felt::Felt;\n\n    #[test]\n    fn test_entrypoint_selector_conversions_happy_case() {\n        let felt = Felt::from_bytes_be(&[1u8; 32]);\n        let entrypoint_selector = EntryPointSelector(felt);\n\n        assert_eq!(\n            entrypoint_selector,\n            ClassHash::from_(entrypoint_selector).into_()\n        );\n        assert_eq!(\n            entrypoint_selector,\n            ContractAddress::from_(entrypoint_selector).into_()\n        );\n        assert_eq!(\n            entrypoint_selector,\n            Felt::from_(entrypoint_selector).into_()\n        );\n        assert_eq!(\n            entrypoint_selector,\n            Felt::from_(entrypoint_selector).into_()\n        );\n        assert_eq!(\n            entrypoint_selector,\n            StarkHash::from_(entrypoint_selector).into_()\n        );\n        assert_eq!(\n            entrypoint_selector,\n            Nonce::from_(entrypoint_selector).into_()\n        );\n\n        assert_eq!(\n            entrypoint_selector,\n            EntryPointSelector::try_from_dec_str(&entrypoint_selector.into_dec_string()).unwrap()\n        );\n    }\n\n    #[test]\n    fn test_entrypoint_selector_conversions_zero() {\n        let felt = Felt::ZERO;\n        let entrypoint_selector = EntryPointSelector(felt);\n\n        assert_eq!(\n            entrypoint_selector,\n            ClassHash::from_(entrypoint_selector).into_()\n        );\n        assert_eq!(\n            entrypoint_selector,\n            ContractAddress::from_(entrypoint_selector).into_()\n        );\n        assert_eq!(\n            entrypoint_selector,\n            Felt::from_(entrypoint_selector).into_()\n        );\n        assert_eq!(\n            entrypoint_selector,\n            Felt::from_(entrypoint_selector).into_()\n        );\n        assert_eq!(\n            entrypoint_selector,\n            StarkHash::from_(entrypoint_selector).into_()\n        );\n        assert_eq!(\n            entrypoint_selector,\n            Nonce::from_(entrypoint_selector).into_()\n        );\n\n        assert_eq!(\n            entrypoint_selector,\n            EntryPointSelector::try_from_dec_str(&entrypoint_selector.into_dec_string()).unwrap()\n        );\n    }\n\n    #[test]\n    fn test_entrypoint_selector_conversions_limit() {\n        let mut entrypoint_selector: EntryPointSelector = Felt::MAX.into_();\n\n        assert_eq!(\n            entrypoint_selector,\n            Felt::from_(entrypoint_selector).into_()\n        );\n        assert_eq!(\n            entrypoint_selector,\n            Felt::from_(entrypoint_selector).into_()\n        );\n        assert_eq!(\n            entrypoint_selector,\n            ClassHash::from_(entrypoint_selector).into_()\n        );\n        assert_eq!(\n            entrypoint_selector,\n            StarkHash::from_(entrypoint_selector).into_()\n        );\n        assert_eq!(\n            entrypoint_selector,\n            Nonce::from_(entrypoint_selector).into_()\n        );\n\n        // PATRICIA_KEY_UPPER_BOUND for contract_address from starknet_api-0.4.1/src/core.rs:156\n        let max_value = \"0x07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe\";\n        entrypoint_selector = EntryPointSelector::try_from_hex_str(max_value).unwrap();\n        assert_eq!(\n            entrypoint_selector,\n            ContractAddress::from_(entrypoint_selector).into_()\n        );\n\n        // Unknown source for this value, founded by try and error(cairo-lang-runner-2.2.0/src/short_string.rs).\n        let max_value = \"0x0777777777777777777777777777777777777f7f7f7f7f7f7f7f7f7f7f7f7f7f\";\n        entrypoint_selector = EntryPointSelector::try_from_hex_str(max_value).unwrap();\n\n        assert_eq!(\n            entrypoint_selector,\n            EntryPointSelector::try_from_dec_str(&entrypoint_selector.into_dec_string()).unwrap()\n        );\n    }\n\n    #[test]\n    fn test_entrypoint_selector_conversions_out_of_range() {\n        assert!(\n            EntryPointSelector::try_from_hex_str(PRIME_STR).unwrap() == Felt::from(0_u8).into_()\n        );\n    }\n}\n"
  },
  {
    "path": "crates/conversions/tests/e2e/felt.rs",
    "content": "#[cfg(test)]\nmod tests_felt {\n    use cairo_vm::utils::PRIME_STR;\n    use conversions::byte_array::ByteArray;\n    use conversions::felt::FromShortString;\n    use conversions::serde::serialize::SerializeToFeltVec;\n    use conversions::string::{IntoDecStr, TryFromDecStr, TryFromHexStr};\n    use conversions::{FromConv, IntoConv};\n    use itertools::chain;\n    use starknet_api::core::{ClassHash, ContractAddress, EntryPointSelector, Nonce};\n    use starknet_api::hash::StarkHash;\n    use starknet_types_core::felt::Felt;\n\n    #[test]\n    fn test_felt_conversions_happy_case() {\n        let felt = Felt::from(1u8);\n\n        assert_eq!(felt, ClassHash::from_(felt).into_());\n        assert_eq!(felt, ContractAddress::from_(felt).into_());\n        assert_eq!(felt, Felt::from_(felt).into_());\n        assert_eq!(felt, Nonce::from_(felt).into_());\n        assert_eq!(felt, EntryPointSelector::from_(felt).into_());\n        assert_eq!(felt, StarkHash::from_(felt).into_());\n\n        assert_eq!(\n            felt,\n            Felt::try_from_dec_str(&felt.into_dec_string()).unwrap()\n        );\n    }\n\n    #[test]\n    fn test_felt_conversions_zero() {\n        let felt = Felt::from(0u8);\n\n        assert_eq!(felt, ClassHash::from_(felt).into_());\n        assert_eq!(felt, ContractAddress::from_(felt).into_());\n        assert_eq!(felt, Felt::from_(felt).into_());\n        assert_eq!(felt, Nonce::from_(felt).into_());\n        assert_eq!(felt, EntryPointSelector::from_(felt).into_());\n        assert_eq!(felt, StarkHash::from_(felt).into_());\n\n        assert_eq!(\n            felt,\n            Felt::try_from_dec_str(&felt.into_dec_string()).unwrap()\n        );\n    }\n\n    #[test]\n    fn test_felt_conversions_limit() {\n        let mut felt = Felt::MAX;\n\n        assert_eq!(felt, Nonce::from_(felt).into_());\n        assert_eq!(felt, EntryPointSelector::from_(felt).into_());\n        assert_eq!(felt, Felt::from_(felt).into_());\n        assert_eq!(felt, ClassHash::from_(felt).into_());\n        assert_eq!(felt, StarkHash::from_(felt).into_());\n\n        // PATRICIA_KEY_UPPER_BOUND for contract_address from starknet_api-0.4.1/src/core.rs:156\n        let max_value = \"0x07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe\";\n        felt = Felt::try_from_hex_str(max_value).unwrap();\n        assert_eq!(felt, ContractAddress::from_(felt).into_());\n\n        // Unknown source for this value, founded by try and error(cairo-lang-runner-2.2.0/src/short_string.rs).\n        let max_value = \"0x0777777777777777777777777777777777777f7f7f7f7f7f7f7f7f7f7f7f7f7f\";\n        felt = Felt::try_from_hex_str(max_value).unwrap();\n\n        assert_eq!(\n            felt,\n            Felt::try_from_dec_str(&felt.into_dec_string()).unwrap()\n        );\n    }\n\n    #[test]\n    fn test_felt_try_from_string_out_of_range() {\n        assert!(Felt::try_from_hex_str(PRIME_STR).unwrap() == Felt::from(0_u8));\n    }\n\n    #[test]\n    fn test_decimal_string() {\n        let felt = Felt::try_from_dec_str(\"123456\").unwrap();\n\n        assert_eq!(felt, Felt::from(123_456));\n    }\n\n    #[test]\n    fn test_from_short_string() {\n        let felt = Felt::from_short_string(\"abc\").unwrap();\n\n        assert_eq!(felt, Felt::from_hex(\"0x616263\").unwrap());\n    }\n\n    #[test]\n    fn test_from_short_string_too_long() {\n        // 32 characters long\n        let shortstring = String::from(\"1234567890123456789012345678901a\");\n\n        assert!(Felt::from_short_string(&shortstring).is_err());\n    }\n\n    #[test]\n    fn test_result_to_felt_vec() {\n        let val: ByteArray = \"a\".into();\n        let serialised_val = vec![Felt::from(0), Felt::from(97), Felt::from(1)];\n\n        let res: Result<ByteArray, ByteArray> = Ok(val.clone());\n        let expected: Vec<Felt> = chain!(vec![Felt::from(0)], serialised_val.clone()).collect();\n        assert_eq!(res.serialize_to_vec(), expected);\n\n        let res: Result<ByteArray, ByteArray> = Err(val);\n        let expected: Vec<Felt> = chain!(vec![Felt::from(1)], serialised_val).collect();\n        assert_eq!(res.serialize_to_vec(), expected);\n    }\n}\n"
  },
  {
    "path": "crates/conversions/tests/e2e/field_elements.rs",
    "content": "#[cfg(test)]\nmod tests_field_elements {\n    use cairo_vm::utils::PRIME_STR;\n    use conversions::string::{IntoDecStr, TryFromDecStr, TryFromHexStr};\n    use conversions::{FromConv, IntoConv};\n    use starknet_api::core::{ClassHash, ContractAddress, EntryPointSelector, Nonce};\n    use starknet_api::hash::StarkHash;\n    use starknet_types_core::felt::Felt;\n\n    #[test]\n    fn test_field_elements_conversions_happy_case() {\n        let field_element = Felt::from(1u8);\n\n        assert_eq!(field_element, ClassHash::from_(field_element).into_());\n        assert_eq!(field_element, ContractAddress::from_(field_element).into_());\n        assert_eq!(field_element, Felt::from_(field_element).into_());\n        assert_eq!(field_element, Nonce::from_(field_element).into_());\n        assert_eq!(\n            field_element,\n            EntryPointSelector::from_(field_element).into_()\n        );\n        assert_eq!(field_element, StarkHash::from_(field_element).into_());\n\n        assert_eq!(\n            field_element,\n            Felt::try_from_dec_str(&field_element.into_dec_string()).unwrap()\n        );\n    }\n\n    #[test]\n    fn test_field_elements_conversions_zero() {\n        let field_element = Felt::from(0u8);\n\n        assert_eq!(field_element, ClassHash::from_(field_element).into_());\n        assert_eq!(field_element, ContractAddress::from_(field_element).into_());\n        assert_eq!(field_element, Felt::from_(field_element).into_());\n        assert_eq!(field_element, Nonce::from_(field_element).into_());\n        assert_eq!(\n            field_element,\n            EntryPointSelector::from_(field_element).into_()\n        );\n        assert_eq!(field_element, StarkHash::from_(field_element).into_());\n\n        assert_eq!(\n            field_element,\n            Felt::try_from_dec_str(&field_element.into_dec_string()).unwrap()\n        );\n    }\n\n    #[test]\n    fn test_field_element_conversions_out_of_range() {\n        assert!(Felt::try_from_hex_str(PRIME_STR).unwrap() == Felt::from(0_u8).into_());\n    }\n}\n"
  },
  {
    "path": "crates/conversions/tests/e2e/mod.rs",
    "content": "mod class_hash;\nmod contract_address;\nmod entrypoint_selector;\nmod felt;\nmod field_elements;\nmod non_zero_felt;\nmod non_zero_u128;\nmod non_zero_u64;\nmod nonce;\nmod padded_felt;\nmod string;\n"
  },
  {
    "path": "crates/conversions/tests/e2e/non_zero_felt.rs",
    "content": "#[cfg(test)]\nmod tests_non_zero_felt {\n    use std::num::{NonZeroU64, NonZeroU128};\n\n    use conversions::FromConv;\n    use starknet_types_core::felt::{Felt, NonZeroFelt};\n\n    #[test]\n    fn test_happy_case() {\n        let non_zero_felt = NonZeroFelt::try_from(Felt::from(1_u8)).unwrap();\n\n        assert_eq!(\n            non_zero_felt,\n            NonZeroFelt::from_(NonZeroU64::new(1).unwrap())\n        );\n        assert_eq!(\n            non_zero_felt,\n            NonZeroFelt::from_(NonZeroU128::new(1).unwrap())\n        );\n    }\n}\n"
  },
  {
    "path": "crates/conversions/tests/e2e/non_zero_u128.rs",
    "content": "#[cfg(test)]\nmod tests_non_zero_u128 {\n    use conversions::TryFromConv;\n    use starknet_types_core::felt::{Felt, NonZeroFelt};\n    use std::num::NonZeroU128;\n\n    #[test]\n    fn test_happy_case() {\n        let non_zero_u128 = NonZeroU128::new(1).unwrap();\n\n        assert_eq!(\n            non_zero_u128,\n            NonZeroU128::try_from_(NonZeroFelt::try_from(Felt::from(1_u8)).unwrap()).unwrap()\n        );\n    }\n\n    #[test]\n    fn test_limit() {\n        let felt = Felt::from_dec_str(&u128::MAX.to_string()).unwrap();\n        let non_zero_felt = NonZeroFelt::try_from(felt).unwrap();\n\n        let result = NonZeroU128::try_from_(non_zero_felt);\n        assert!(result.is_ok());\n        assert_eq!(result.unwrap().get(), u128::MAX);\n    }\n\n    #[test]\n    fn test_felt_too_large() {\n        let large_felt = Felt::TWO.pow(128_u8);\n        let non_zero_felt = NonZeroFelt::try_from(large_felt).unwrap();\n\n        let result = NonZeroU128::try_from_(non_zero_felt);\n        assert!(result.is_err());\n        assert_eq!(result.unwrap_err(), \"felt was too large to fit in u128\");\n    }\n}\n"
  },
  {
    "path": "crates/conversions/tests/e2e/non_zero_u64.rs",
    "content": "#[cfg(test)]\nmod tests_non_zero_u64 {\n    use conversions::TryFromConv;\n    use starknet_types_core::felt::{Felt, NonZeroFelt};\n    use std::num::NonZeroU64;\n\n    #[test]\n    fn test_happy_case() {\n        let non_zero_u64 = NonZeroU64::new(1).unwrap();\n\n        assert_eq!(\n            non_zero_u64,\n            NonZeroU64::try_from_(NonZeroFelt::try_from(Felt::from(1_u8)).unwrap()).unwrap()\n        );\n    }\n\n    #[test]\n    fn test_limit() {\n        let felt = Felt::from_dec_str(&u64::MAX.to_string()).unwrap();\n        let non_zero_felt = NonZeroFelt::try_from(felt).unwrap();\n\n        let result = NonZeroU64::try_from_(non_zero_felt);\n        assert!(result.is_ok());\n        assert_eq!(result.unwrap().get(), u64::MAX);\n    }\n\n    #[test]\n    fn test_felt_too_large() {\n        let large_felt = Felt::TWO.pow(64_u8);\n        let non_zero_felt = NonZeroFelt::try_from(large_felt).unwrap();\n\n        let result = NonZeroU64::try_from_(non_zero_felt);\n        assert!(result.is_err());\n        assert_eq!(result.unwrap_err(), \"felt was too large to fit in u64\");\n    }\n}\n"
  },
  {
    "path": "crates/conversions/tests/e2e/nonce.rs",
    "content": "#[cfg(test)]\nmod tests_nonce {\n    use cairo_vm::utils::PRIME_STR;\n    use conversions::string::{IntoDecStr, TryFromDecStr, TryFromHexStr};\n    use conversions::{FromConv, IntoConv};\n    use starknet_api::core::{ClassHash, ContractAddress, EntryPointSelector, Nonce};\n    use starknet_api::hash::StarkHash;\n    use starknet_types_core::felt::Felt;\n\n    #[test]\n    fn test_nonce_conversions_happy_case() {\n        let felt = Felt::from_bytes_be(&[1u8; 32]);\n        let nonce = Nonce(felt);\n\n        assert_eq!(nonce, ClassHash::from_(nonce).into_());\n        assert_eq!(nonce, ContractAddress::from_(nonce).into_());\n        assert_eq!(nonce, Felt::from_(nonce).into_());\n        assert_eq!(nonce, Felt::from_(nonce).into_());\n        assert_eq!(nonce, StarkHash::from_(nonce).into_());\n        assert_eq!(nonce, EntryPointSelector::from_(nonce).into_());\n\n        assert_eq!(\n            nonce,\n            Nonce::try_from_dec_str(&nonce.into_dec_string()).unwrap()\n        );\n    }\n\n    #[test]\n    fn test_nonce_conversions_zero() {\n        let felt = Felt::ZERO;\n        let nonce = Nonce(felt);\n\n        assert_eq!(nonce, ClassHash::from_(nonce).into_());\n        assert_eq!(nonce, ContractAddress::from_(nonce).into_());\n        assert_eq!(nonce, Felt::from_(nonce).into_());\n        assert_eq!(nonce, Felt::from_(nonce).into_());\n        assert_eq!(nonce, StarkHash::from_(nonce).into_());\n        assert_eq!(nonce, EntryPointSelector::from_(nonce).into_());\n\n        assert_eq!(\n            nonce,\n            Nonce::try_from_dec_str(&nonce.into_dec_string()).unwrap()\n        );\n    }\n\n    #[test]\n    fn test_nonce_conversions_limit() {\n        let mut nonce: Nonce = Felt::MAX.into_();\n\n        assert_eq!(nonce, Felt::from_(nonce).into_());\n        assert_eq!(nonce, Felt::from_(nonce).into_());\n        assert_eq!(nonce, ClassHash::from_(nonce).into_());\n        assert_eq!(nonce, StarkHash::from_(nonce).into_());\n        assert_eq!(nonce, EntryPointSelector::from_(nonce).into_());\n\n        // PATRICIA_KEY_UPPER_BOUND for contract_address from starknet_api-0.4.1/src/core.rs:156\n        let max_value = \"0x07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe\";\n        nonce = Nonce::try_from_hex_str(max_value).unwrap();\n        assert_eq!(nonce, ContractAddress::from_(nonce).into_());\n\n        // Unknown source for this value, founded by try and error(cairo-lang-runner-2.2.0/src/short_string.rs).\n        let max_value = \"0x0777777777777777777777777777777777777f7f7f7f7f7f7f7f7f7f7f7f7f7f\";\n        nonce = Nonce::try_from_hex_str(max_value).unwrap();\n\n        assert_eq!(\n            nonce,\n            Nonce::try_from_dec_str(&nonce.into_dec_string()).unwrap()\n        );\n    }\n\n    #[test]\n    fn test_nonce_conversions_out_of_range() {\n        assert!(Nonce::try_from_hex_str(PRIME_STR).unwrap() == Felt::from(0_u8).into_());\n    }\n}\n"
  },
  {
    "path": "crates/conversions/tests/e2e/padded_felt.rs",
    "content": "#[cfg(test)]\nmod tests {\n    use conversions::padded_felt::PaddedFelt;\n    use conversions::{FromConv, IntoConv};\n    use starknet_api::core::{ClassHash, ContractAddress};\n    use starknet_types_core::felt::Felt;\n\n    #[test]\n    fn test_padded_felt_lower_hex() {\n        let felt = Felt::from_hex(\"0x123\").unwrap();\n        let padded_felt = PaddedFelt(felt);\n\n        assert_eq!(\n            format!(\"{padded_felt:x}\"),\n            \"0x0000000000000000000000000000000000000000000000000000000000000123\".to_string()\n        );\n    }\n\n    #[test]\n    fn test_padded_felt_max() {\n        let felt = Felt::MAX;\n        let padded_felt = PaddedFelt(felt);\n\n        assert_eq!(\n            format!(\"{padded_felt:x}\"),\n            \"0x0800000000000011000000000000000000000000000000000000000000000000\".to_string()\n        );\n    }\n\n    #[test]\n    fn test_padded_felt_conversions_happy_case() {\n        let felt = Felt::from_bytes_be(&[1u8; 32]);\n        let padded_felt = PaddedFelt(felt);\n\n        assert_eq!(padded_felt, ContractAddress::from_(padded_felt).into_());\n        assert_eq!(padded_felt, ClassHash::from_(padded_felt).into_());\n    }\n\n    #[test]\n    fn test_padded_felt_serialize() {\n        let felt = Felt::ONE;\n        let padded_felt = PaddedFelt(felt);\n\n        let serialized = serde_json::to_string(&padded_felt).unwrap();\n        assert_eq!(\n            serialized,\n            \"\\\"0x0000000000000000000000000000000000000000000000000000000000000001\\\"\".to_string()\n        );\n    }\n}\n"
  },
  {
    "path": "crates/conversions/tests/e2e/string.rs",
    "content": "use conversions::string::{IntoDecStr, TryFromDecStr};\nuse starknet_api::core::{ClassHash, ContractAddress, EntryPointSelector, Nonce};\nuse starknet_api::hash::StarkHash;\nuse starknet_types_core::felt::Felt;\n\n#[test]\nfn test_short_strings_conversions_happy_case() {\n    let short_string = \"1\";\n\n    assert_eq!(\n        short_string,\n        (ClassHash::try_from_dec_str(short_string).unwrap()).into_dec_string()\n    );\n    assert_eq!(\n        short_string,\n        (ContractAddress::try_from_dec_str(short_string).unwrap()).into_dec_string()\n    );\n    assert_eq!(\n        short_string,\n        (Felt::try_from_dec_str(short_string).unwrap()).into_dec_string()\n    );\n    assert_eq!(\n        short_string,\n        (Felt::try_from_dec_str(short_string).unwrap()).into_dec_string()\n    );\n    assert_eq!(\n        short_string,\n        (Nonce::try_from_dec_str(short_string).unwrap()).into_dec_string()\n    );\n    assert_eq!(\n        short_string,\n        (EntryPointSelector::try_from_dec_str(short_string).unwrap()).into_dec_string()\n    );\n    assert_eq!(\n        short_string,\n        (StarkHash::try_from_dec_str(short_string).unwrap()).into_dec_string()\n    );\n}\n\n#[test]\nfn test_short_strings_conversions_zero() {\n    let short_string = \"0\";\n\n    assert_eq!(\n        short_string,\n        (ClassHash::try_from_dec_str(short_string).unwrap()).into_dec_string()\n    );\n    assert_eq!(\n        short_string,\n        (ContractAddress::try_from_dec_str(short_string).unwrap()).into_dec_string()\n    );\n    assert_eq!(\n        short_string,\n        (Felt::try_from_dec_str(short_string).unwrap()).into_dec_string()\n    );\n    assert_eq!(\n        short_string,\n        (Felt::try_from_dec_str(short_string).unwrap()).into_dec_string()\n    );\n    assert_eq!(\n        short_string,\n        (Nonce::try_from_dec_str(short_string).unwrap()).into_dec_string()\n    );\n    assert_eq!(\n        short_string,\n        (EntryPointSelector::try_from_dec_str(short_string).unwrap()).into_dec_string()\n    );\n    assert_eq!(\n        short_string,\n        (StarkHash::try_from_dec_str(short_string).unwrap()).into_dec_string()\n    );\n}\n\n#[test]\nfn test_short_string_conversions_limit() {\n    // 31 characters.\n    let short_string = \"1234567890123456789012345678901\";\n\n    assert_eq!(\n        short_string,\n        (ClassHash::try_from_dec_str(short_string).unwrap()).into_dec_string()\n    );\n    assert_eq!(\n        short_string,\n        (Felt::try_from_dec_str(short_string).unwrap()).into_dec_string()\n    );\n    assert_eq!(\n        short_string,\n        (Felt::try_from_dec_str(short_string).unwrap()).into_dec_string()\n    );\n    assert_eq!(\n        short_string,\n        (Nonce::try_from_dec_str(short_string).unwrap()).into_dec_string()\n    );\n    assert_eq!(\n        short_string,\n        (EntryPointSelector::try_from_dec_str(short_string).unwrap()).into_dec_string()\n    );\n    assert_eq!(\n        short_string,\n        (StarkHash::try_from_dec_str(short_string).unwrap()).into_dec_string()\n    );\n    assert_eq!(\n        short_string,\n        (ContractAddress::try_from_dec_str(short_string).unwrap()).into_dec_string()\n    );\n}\n"
  },
  {
    "path": "crates/conversions/tests/main.rs",
    "content": "mod e2e;\n"
  },
  {
    "path": "crates/data-transformer/ARCHITECTURE.md",
    "content": "# Reverse Transformer Architecture\n\n## Overview\n\nThe Reverse Transformer module provides functionality to interpret `Starknet` smart contract calldata and output data\ninto a human-readable, Cairo-like source code format. It parses a low-level flat array of Felt values using known ABI\ndefinitions and produces structured string representations of the corresponding values.\n\nThis process is called reverse transformation and is primarily handled by parsing expressions representing function\nargument types, traversing those types recursively, and reading the correctly typed values from the provided calldata\nbuffer.\n\nReverse transformation relies on processing Cairo-style type paths. These paths can be:\n\n- Non-generic paths (simple types such as u32, felt252, starknet::ContractAddress)\n- Generic paths (parametrized types such as Array<u8>, Span<felt252>, core::Option<u256>)\n\nThe transformer processes these paths by resolving them via ABI metadata into meaningful type definitions, allowing the\ndata buffer to be decoded according to its declared type signature.\n\n## High-Level Flow\n\nThese are the two entry points for this functionality:\n\n- reverse_transform_input\n- reverse_transform_output\n\nBoth functions extract the parameter types (input or output) of a function in the ABI, then reversely transform the list\nof Felt values to their Cairo types.\n\n## Supported Types (Type enum)\n\n| Variant   | Description                                                               |\n|-----------|---------------------------------------------------------------------------|\n| Primitive | Matches raw Cairo-builtins like u32, i128, felt252, ContractAddress, etc. |\n| Struct    | Record-like types with named fields and inner types                       |\n| Enum      | Sum types, each variant might carry data                                  |\n| Sequence  | Repetitive/counted types like Array, Span                                 |\n| Tuple     | Positional group of types                                                 |\n\nAll are internally represented and then formatted using their Display implementation.\n\n## Diagram\n\nThe following flow best describes the process of parsing and transformation:\n\n```mermaid\nflowchart TD\n    A[\"parse\"] --> B[\"transform expression\"]\n    B -->|Tuple| C[\"transform tuple\"]\n    B -->|Path| D[\"transform path \"]\n    B -->|Other| E[\"return Unsupported Type Error\"]\n    D -->|Simple Path| F[\"transform simple path\"]\n    D -->|Generic Path| G[\"transform generic path\"]\n    F --> H{\"is primitive?\"}\n    H -->|Yes| I[\"transform primitive type\"]\n    H -->|No| J[\"find item in abi\"]\n    J --> K{\"item type?\"}\n    K -->|Enum| L[\"transform enum\"]\n    K -->|Struct| M[\"transform struct\"]\n    G --> N[\"read length from buffer\"]\n    N --> O[\"loop: parse\"]\n    O --> P[\"build & Return Type::Sequence\"]\n    C --> Q[\"map: transform expr for each element\"]\n    Q --> R[\"build & Return Type::Tuple\"]\n    M --> S[\"map: parse expr for each field\"]\n    S --> T[\"build & Return Type::Struct\"]\n    L --> U[\"read position from buffer\"]\n    U --> V{\"is unit?\"}\n    V -->|Yes| W[\"build Enum\"]\n    V -->|No| X[\"parse\"]\n    X --> Y[\"build Enum with argument\"]\n```\n\n\n"
  },
  {
    "path": "crates/data-transformer/Cargo.toml",
    "content": "[package]\nname = \"data-transformer\"\nversion = \"1.0.0\"\nedition.workspace = true\n\n[dependencies]\nanyhow.workspace = true\nserde_json.workspace = true\nserde.workspace = true\nstarknet-rust.workspace = true\nstarknet-types-core.workspace = true\ncairo-lang-utils.workspace = true\ncairo-lang-parser.workspace = true\ncairo-lang-syntax.workspace = true\ncairo-lang-diagnostics.workspace = true\ncairo-lang-filesystem.workspace = true\nitertools.workspace = true\nnum-bigint.workspace = true\ntest-case.workspace = true\nthiserror.workspace = true\nconversions = { path = \"../conversions\" }\ncairo-serde-macros = { path = \"../conversions/cairo-serde-macros\" }\n\n[dev-dependencies]\nindoc.workspace = true\nprimitive-types.workspace = true\ntokio.workspace = true\nurl.workspace = true\nshared = { path = \"../shared\" }\n"
  },
  {
    "path": "crates/data-transformer/src/cairo_types/bytes31.rs",
    "content": "use cairo_serde_macros::{CairoDeserialize, CairoSerialize};\nuse starknet_rust::core::types::FromStrError;\nuse starknet_types_core::felt::Felt;\nuse std::str::FromStr;\n\n#[derive(CairoDeserialize, CairoSerialize, Debug, Clone, Copy, PartialEq, Eq)]\npub struct CairoBytes31 {\n    inner: Felt,\n}\n\nimpl CairoBytes31 {\n    pub const MAX: CairoBytes31 = CairoBytes31 {\n        inner: Felt::from_hex_unchecked(\n            \"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\",\n        ),\n    };\n}\n\n#[derive(Clone, Debug, PartialEq, Eq, thiserror::Error)]\npub enum ParseBytes31Error {\n    #[error(\"Failed to parse as Cairo type\")]\n    CairoFromStrError, // `FromStrError` thrown on unsuccessful Felt parsing is useless. We cannot write anything beyond that\n    #[error(\"Number is too large to fit in 31 bytes\")]\n    Overflow,\n}\n\nimpl From<FromStrError> for ParseBytes31Error {\n    fn from(_value: FromStrError) -> Self {\n        ParseBytes31Error::CairoFromStrError\n    }\n}\n\nimpl FromStr for CairoBytes31 {\n    type Err = ParseBytes31Error;\n\n    fn from_str(input: &str) -> Result<Self, Self::Err> {\n        let inner = input.parse::<Felt>()?;\n\n        if inner > CairoBytes31::MAX.inner {\n            return Err(ParseBytes31Error::Overflow);\n        }\n\n        Ok(CairoBytes31 { inner })\n    }\n}\n\nimpl From<CairoBytes31> for Felt {\n    fn from(value: CairoBytes31) -> Self {\n        value.inner\n    }\n}\n"
  },
  {
    "path": "crates/data-transformer/src/cairo_types/helpers.rs",
    "content": "use num_bigint::BigUint;\nuse thiserror;\n\n#[derive(Clone, Debug)]\npub enum RadixInput {\n    Decimal(Box<[u8]>),\n    Hexadecimal(Box<[u8]>),\n}\n\n#[derive(Clone, Debug, PartialEq, Eq, thiserror::Error)]\npub enum ParseRadixError {\n    #[error(\"Input contains invalid digit\")]\n    InvalidString,\n    #[error(transparent)]\n    ParseIntError(#[from] std::num::ParseIntError),\n}\n\nimpl<'input> TryFrom<&'input [u8]> for RadixInput {\n    type Error = ParseRadixError;\n\n    fn try_from(bytes: &'input [u8]) -> Result<Self, Self::Error> {\n        let mut is_hex = false;\n\n        if bytes.len() > 2 {\n            is_hex = bytes[1] == b'x';\n        }\n\n        let result = bytes\n            .iter()\n            .skip_while(|&&byte| byte == b'0' || byte == b'x')\n            .filter(|&&byte| byte != b'_')\n            .map(|&byte| {\n                if byte.is_ascii_digit() {\n                    Ok(byte - b'0')\n                } else if (b'a'..b'g').contains(&byte) {\n                    is_hex = true;\n                    Ok(byte - b'a' + 10)\n                } else if (b'A'..b'G').contains(&byte) {\n                    is_hex = true;\n                    Ok(byte - b'A' + 10)\n                } else {\n                    Err(ParseRadixError::InvalidString)\n                }\n            })\n            .collect::<Result<Box<[u8]>, ParseRadixError>>()?;\n\n        Ok(if is_hex {\n            Self::Hexadecimal(result)\n        } else {\n            Self::Decimal(result)\n        })\n    }\n}\n\nimpl TryFrom<RadixInput> for BigUint {\n    type Error = ParseRadixError;\n\n    fn try_from(value: RadixInput) -> Result<Self, Self::Error> {\n        match value {\n            RadixInput::Decimal(digits) => {\n                BigUint::from_radix_be(&digits, 10).ok_or(ParseRadixError::InvalidString)\n            }\n            RadixInput::Hexadecimal(digits) => {\n                BigUint::from_radix_be(&digits, 16).ok_or(ParseRadixError::InvalidString)\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "crates/data-transformer/src/cairo_types/mod.rs",
    "content": "mod bytes31;\nmod helpers;\nmod u256;\nmod u384;\nmod u512;\nmod u96;\n\npub use bytes31::{CairoBytes31, ParseBytes31Error};\npub use u96::{CairoU96, ParseCairoU96Error};\npub use u256::{CairoU256, ParseCairoU256Error};\npub use u384::{CairoU384, ParseCairoU384Error};\npub use u512::{CairoU512, ParseCairoU512Error};\n"
  },
  {
    "path": "crates/data-transformer/src/cairo_types/u256.rs",
    "content": "use super::helpers::{ParseRadixError, RadixInput};\nuse cairo_serde_macros::{CairoDeserialize, CairoSerialize};\nuse conversions;\nuse num_bigint::BigUint;\nuse std::fmt;\nuse std::fmt::Display;\nuse std::str::FromStr;\nuse thiserror;\n\n#[derive(CairoDeserialize, CairoSerialize, Clone, Copy, Debug, PartialEq, Eq)]\npub struct CairoU256 {\n    low: u128,\n    high: u128,\n}\n\nimpl CairoU256 {\n    #[must_use]\n    pub fn from_bytes(bytes: &[u8; 32]) -> Self {\n        Self {\n            low: u128::from_be_bytes(bytes[16..32].try_into().unwrap()),\n            high: u128::from_be_bytes(bytes[0..16].try_into().unwrap()),\n        }\n    }\n\n    #[must_use]\n    pub fn to_be_bytes(&self) -> [u8; 32] {\n        let mut result = [0; 32];\n\n        result[16..].copy_from_slice(&self.low.to_be_bytes());\n        result[..16].copy_from_slice(&self.high.to_be_bytes());\n\n        result\n    }\n}\n\nimpl Display for CairoU256 {\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        let number = BigUint::from_bytes_be(&self.to_be_bytes());\n        write!(f, \"{number}\")\n    }\n}\n\n#[derive(Clone, Debug, PartialEq, Eq, thiserror::Error)]\npub enum ParseCairoU256Error {\n    #[error(transparent)]\n    InvalidString(#[from] ParseRadixError),\n\n    #[error(\"Number is too large to fit in 32 bytes\")]\n    Overflow,\n}\n\nimpl FromStr for CairoU256 {\n    type Err = ParseCairoU256Error;\n\n    fn from_str(input: &str) -> Result<Self, Self::Err> {\n        let number: BigUint = RadixInput::try_from(input.as_bytes())?.try_into()?;\n        let bytes = number.to_bytes_be();\n\n        if bytes.len() > 32 {\n            return Err(ParseCairoU256Error::Overflow);\n        }\n\n        let mut result = [0u8; 32];\n        let start = 32 - bytes.len();\n        result[start..].copy_from_slice(&bytes);\n\n        Ok(CairoU256::from_bytes(&result))\n    }\n}\n\n// Testing method: compare limbs against `Serde::serialize` output in Cairo\n#[cfg(test)]\nmod tests {\n    use super::CairoU256;\n    use test_case::test_case;\n\n    const BIG_NUMBER_HEX: &str =\n        \"0xde0945c2474d9b33333123e53e37a93f5de4ba0adbf4c0a38afd2afd7d357f2c\";\n    const BIG_NUMBER_DEC: &str =\n        \"100429835467304823721949931582394957675800948774630560463857421711344858922796\";\n\n    const BIG_NUMBER_BYTES: [u8; 32] = [\n        222, 9, 69, 194, 71, 77, 155, 51, 51, 49, 35, 229, 62, 55, 169, 63, 93, 228, 186, 10, 219,\n        244, 192, 163, 138, 253, 42, 253, 125, 53, 127, 44,\n    ];\n\n    const BIG_NUMBER_LIMBS: [u128; 2] = [\n        124_805_820_680_284_125_994_760_982_863_763_832_620,\n        295_136_760_614_571_572_862_546_075_274_463_127_871,\n    ];\n\n    #[test_case(&[0; 32], [0, 0] ; \"zeros\")]\n    #[test_case(&BIG_NUMBER_BYTES, BIG_NUMBER_LIMBS; \"big\")]\n    fn test_happy_case_from_bytes(bytes: &[u8; 32], expected_limbs: [u128; 2]) {\n        let result = CairoU256::from_bytes(bytes);\n\n        assert_eq!([result.low, result.high], expected_limbs);\n    }\n\n    #[test_case(\"0x0\", [0, 0] ; \"zero_hex\")]\n    #[test_case(\"0\", [0, 0] ; \"zero_dec\")]\n    #[test_case(\"0x237abc\", [2_325_180, 0] ; \"small_hex\")]\n    #[test_case(\"237abc\", [2_325_180, 0] ; \"small_hex_no_leading_0x\")]\n    #[test_case(\"2325180\", [2_325_180, 0] ; \"small_dec\")]\n    #[test_case(BIG_NUMBER_HEX, BIG_NUMBER_LIMBS; \"big_hex\")]\n    #[test_case(BIG_NUMBER_DEC, BIG_NUMBER_LIMBS; \"big_dec\")]\n    fn test_happy_case_from_str(encoded: &str, expected_limbs: [u128; 2]) -> anyhow::Result<()> {\n        let result: CairoU256 = encoded.parse()?;\n\n        assert_eq!([result.low, result.high], expected_limbs);\n\n        Ok(())\n    }\n\n    #[test_case([0, 0], \"0\"; \"zero\")]\n    #[test_case([2_325_180, 0], \"2325180\"; \"small\")]\n    #[test_case(BIG_NUMBER_LIMBS, BIG_NUMBER_DEC; \"big\")]\n    fn test_display(limbs: [u128; 2], expected: &str) {\n        let result = CairoU256 {\n            low: limbs[0],\n            high: limbs[1],\n        };\n        assert_eq!(result.to_string(), expected);\n    }\n}\n"
  },
  {
    "path": "crates/data-transformer/src/cairo_types/u384.rs",
    "content": "use super::helpers::{ParseRadixError, RadixInput};\nuse cairo_serde_macros::{CairoDeserialize, CairoSerialize};\nuse num_bigint::BigUint;\nuse std::fmt;\nuse std::fmt::Display;\nuse std::str::FromStr;\n\n#[expect(clippy::struct_field_names)]\n#[derive(CairoDeserialize, CairoSerialize, Clone, Copy, Debug, PartialEq, Eq)]\npub struct CairoU384 {\n    limb_0: u128,\n    limb_1: u128,\n    limb_2: u128,\n    limb_3: u128,\n}\n\nimpl CairoU384 {\n    #[must_use]\n    pub fn from_bytes(bytes: &[u8; 48]) -> Self {\n        fn to_u128(slice: &[u8]) -> u128 {\n            let mut padded = [0u8; 16];\n            padded[4..].copy_from_slice(slice);\n            u128::from_be_bytes(padded)\n        }\n\n        Self {\n            limb_0: to_u128(&bytes[36..48]),\n            limb_1: to_u128(&bytes[24..36]),\n            limb_2: to_u128(&bytes[12..24]),\n            limb_3: to_u128(&bytes[0..12]),\n        }\n    }\n\n    #[must_use]\n    pub fn to_be_bytes(&self) -> [u8; 48] {\n        let mut result = [0; 48];\n\n        result[36..48].copy_from_slice(&self.limb_0.to_be_bytes());\n        result[24..36].copy_from_slice(&self.limb_1.to_be_bytes());\n        result[12..24].copy_from_slice(&self.limb_2.to_be_bytes());\n        result[0..12].copy_from_slice(&self.limb_3.to_be_bytes());\n\n        result\n    }\n}\n\nimpl Display for CairoU384 {\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        let number = BigUint::from_bytes_be(&self.to_be_bytes());\n        write!(f, \"{number}\")\n    }\n}\n\n#[derive(Clone, Debug, PartialEq, Eq, thiserror::Error)]\npub enum ParseCairoU384Error {\n    #[error(transparent)]\n    InvalidString(#[from] ParseRadixError),\n    #[error(\"Number is too large to fit in 48 bytes\")]\n    Overflow,\n}\n\nimpl FromStr for CairoU384 {\n    type Err = ParseCairoU384Error;\n\n    fn from_str(input: &str) -> Result<Self, Self::Err> {\n        let number: BigUint = RadixInput::try_from(input.as_bytes())?.try_into()?;\n        let bytes = number.to_bytes_be();\n\n        if bytes.len() > 48 {\n            return Err(ParseCairoU384Error::Overflow);\n        }\n\n        let mut result = [0u8; 48];\n        let start = 48 - bytes.len();\n        result[start..].copy_from_slice(&bytes);\n\n        Ok(CairoU384::from_bytes(&result))\n    }\n}\n"
  },
  {
    "path": "crates/data-transformer/src/cairo_types/u512.rs",
    "content": "use super::helpers::{ParseRadixError, RadixInput};\nuse cairo_serde_macros::{CairoDeserialize, CairoSerialize};\nuse num_bigint::BigUint;\nuse std::fmt;\nuse std::fmt::Display;\nuse std::str::FromStr;\n\n#[expect(clippy::struct_field_names)]\n#[derive(CairoDeserialize, CairoSerialize, Clone, Copy, Debug, PartialEq, Eq)]\npub struct CairoU512 {\n    limb_0: u128,\n    limb_1: u128,\n    limb_2: u128,\n    limb_3: u128,\n}\n\nimpl CairoU512 {\n    #[must_use]\n    pub fn from_bytes(bytes: &[u8; 64]) -> Self {\n        Self {\n            limb_0: u128::from_be_bytes(bytes[48..64].try_into().unwrap()),\n            limb_1: u128::from_be_bytes(bytes[32..48].try_into().unwrap()),\n            limb_2: u128::from_be_bytes(bytes[16..32].try_into().unwrap()),\n            limb_3: u128::from_be_bytes(bytes[00..16].try_into().unwrap()),\n        }\n    }\n\n    #[must_use]\n    pub fn to_be_bytes(&self) -> [u8; 64] {\n        let mut result = [0; 64];\n\n        result[48..64].copy_from_slice(&self.limb_0.to_be_bytes());\n        result[32..48].copy_from_slice(&self.limb_1.to_be_bytes());\n        result[16..32].copy_from_slice(&self.limb_2.to_be_bytes());\n        result[00..16].copy_from_slice(&self.limb_3.to_be_bytes());\n\n        result\n    }\n}\n\nimpl Display for CairoU512 {\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        let number = BigUint::from_bytes_be(&self.to_be_bytes());\n        write!(f, \"{number}\")\n    }\n}\n\n#[derive(Clone, Debug, PartialEq, Eq, thiserror::Error)]\npub enum ParseCairoU512Error {\n    #[error(transparent)]\n    InvalidString(#[from] ParseRadixError),\n    #[error(\"Number is too large to fit in 64 bytes\")]\n    Overflow,\n}\n\nimpl FromStr for CairoU512 {\n    type Err = ParseCairoU512Error;\n\n    fn from_str(input: &str) -> Result<Self, Self::Err> {\n        let number: BigUint = RadixInput::try_from(input.as_bytes())?.try_into()?;\n        let bytes = number.to_bytes_be();\n\n        if bytes.len() > 64 {\n            return Err(ParseCairoU512Error::Overflow);\n        }\n\n        let mut result = [0u8; 64];\n        let start = 64 - bytes.len();\n        result[start..].copy_from_slice(&bytes);\n\n        Ok(CairoU512::from_bytes(&result))\n    }\n}\n\n// Testing method: compare limbs against `Serde::serialize` output in Cairo\n#[cfg(test)]\nmod tests {\n    use super::CairoU512;\n    use test_case::test_case;\n\n    const BIG_NUMBER_HEX: &str = \"0xec6710e3f6607d8528d37b2b7110c1a65d6482a9bd5cf8d6fe0620ce8972c857960c53c1c06a94c104957f378fa4a3a080b84117d9d093466849643204da84e7\";\n    const BIG_NUMBER_DEC: &str = \"12381408885777547607539348003833063591238452153837122447405738741626823601474822019420743833187140657614799860086984246159941269173037600465935986717263079\";\n\n    const BIG_NUMBER_BYTES: [u8; 64] = [\n        236, 103, 16, 227, 246, 96, 125, 133, 40, 211, 123, 43, 113, 16, 193, 166, 93, 100, 130,\n        169, 189, 92, 248, 214, 254, 6, 32, 206, 137, 114, 200, 87, 150, 12, 83, 193, 192, 106,\n        148, 193, 4, 149, 127, 55, 143, 164, 163, 160, 128, 184, 65, 23, 217, 208, 147, 70, 104,\n        73, 100, 50, 4, 218, 132, 231,\n    ];\n\n    const BIG_NUMBER_LIMBS: [u128; 4] = [\n        171_097_886_328_722_014_390_365_673_661_673_407_719,\n        199_448_205_720_622_237_702_144_553_019_244_848_032,\n        124_140_083_455_263_661_715_169_373_816_437_786_711,\n        314_232_956_161_265_744_462_671_566_462_772_101_542,\n    ];\n\n    #[test_case(&[0; 64], [0, 0, 0, 0] ; \"zeros\")]\n    #[test_case(&BIG_NUMBER_BYTES, BIG_NUMBER_LIMBS; \"big\")]\n    fn test_happy_case_from_bytes(bytes: &[u8; 64], expected_limbs: [u128; 4]) {\n        let result = CairoU512::from_bytes(bytes);\n\n        assert_eq!(\n            [result.limb_0, result.limb_1, result.limb_2, result.limb_3],\n            expected_limbs\n        );\n    }\n\n    #[test_case(\"0x0\", [0, 0, 0, 0] ; \"zero_hex\")]\n    #[test_case(\"0\", [0, 0, 0, 0] ; \"zero_dec\")]\n    #[test_case(\"0x237abc\", [2_325_180, 0, 0, 0] ; \"small_hex\")]\n    #[test_case(\"237abc\", [2_325_180, 0, 0, 0] ; \"small_hex_no_leading_0x\")]\n    #[test_case(\"2325180\", [2_325_180, 0, 0, 0] ; \"small_dec\")]\n    #[test_case(BIG_NUMBER_HEX, BIG_NUMBER_LIMBS; \"big_hex\")]\n    #[test_case(BIG_NUMBER_DEC, BIG_NUMBER_LIMBS; \"big_dec\")]\n    fn test_happy_case_from_str(encoded: &str, expected_limbs: [u128; 4]) -> anyhow::Result<()> {\n        let result: CairoU512 = encoded.parse()?;\n\n        assert_eq!(\n            [result.limb_0, result.limb_1, result.limb_2, result.limb_3],\n            expected_limbs\n        );\n\n        Ok(())\n    }\n\n    #[test_case([0, 0, 0, 0], \"0\"; \"zero\")]\n    #[test_case([2_325_180, 0, 0, 0], \"2325180\"; \"small\")]\n    #[test_case(BIG_NUMBER_LIMBS, BIG_NUMBER_DEC; \"big\")]\n    fn test_display(limbs: [u128; 4], expected: &str) {\n        let number = CairoU512 {\n            limb_0: limbs[0],\n            limb_1: limbs[1],\n            limb_2: limbs[2],\n            limb_3: limbs[3],\n        };\n\n        assert_eq!(number.to_string(), expected);\n    }\n}\n"
  },
  {
    "path": "crates/data-transformer/src/cairo_types/u96.rs",
    "content": "use cairo_serde_macros::{CairoDeserialize, CairoSerialize};\nuse starknet_types_core::felt::Felt;\nuse std::fmt::Display;\nuse std::{\n    fmt,\n    num::{IntErrorKind, ParseIntError},\n    str::FromStr,\n};\n\n#[derive(CairoSerialize, CairoDeserialize, Clone, Copy, Debug, PartialEq, Eq)]\npub struct CairoU96 {\n    inner: u128,\n}\n\nimpl Display for CairoU96 {\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        write!(f, \"{}\", self.inner)\n    }\n}\n\nconst MAX_VALUE: u128 = (2 << 96) - 1;\n\nimpl From<CairoU96> for Felt {\n    fn from(value: CairoU96) -> Self {\n        Felt::from(value.inner)\n    }\n}\n\n#[derive(Clone, Debug, PartialEq, Eq, thiserror::Error)]\npub enum ParseCairoU96Error {\n    #[error(transparent)]\n    InvalidString(#[from] ParseIntError),\n    #[error(\"Number is too large to fit in 24 bytes\")]\n    Overflow,\n}\n\nimpl FromStr for CairoU96 {\n    type Err = ParseCairoU96Error;\n\n    fn from_str(input: &str) -> Result<Self, Self::Err> {\n        let is_hex = input.starts_with(\"0x\") || input.contains(|c: char| c.is_alphabetic());\n\n        let number = if is_hex {\n            u128::from_str_radix(input, 16)\n        } else {\n            u128::from_str(input)\n        }\n        .map_err(|err| {\n            if err.kind() == &IntErrorKind::PosOverflow {\n                ParseCairoU96Error::Overflow\n            } else {\n                err.into()\n            }\n        })?;\n\n        if number > MAX_VALUE {\n            return Err(ParseCairoU96Error::Overflow);\n        }\n\n        Ok(Self { inner: number })\n    }\n}\n"
  },
  {
    "path": "crates/data-transformer/src/lib.rs",
    "content": "pub mod cairo_types;\nmod reverse_transformer;\nmod shared;\nmod transformer;\n\npub use reverse_transformer::{\n    ReverseTransformError, reverse_transform_input, reverse_transform_output,\n};\npub use transformer::transform;\n"
  },
  {
    "path": "crates/data-transformer/src/reverse_transformer/mod.rs",
    "content": "mod transform;\nmod types;\n\nuse crate::reverse_transformer::transform::{ReverseTransformer, TransformationError};\nuse crate::shared::extraction::extract_function_from_selector;\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse starknet_rust::core::types::contract::AbiEntry;\nuse starknet_types_core::felt::Felt;\n\n#[derive(Debug, thiserror::Error)]\npub enum ReverseTransformError {\n    #[error(r#\"Function with selector \"{0:#x}\" not found in ABI of the contract\"#)]\n    FunctionNotFound(Felt),\n    #[error(transparent)]\n    TransformationError(#[from] TransformationError),\n}\n\n/// Transforms a calldata into a Cairo-like string representation of the arguments\npub fn reverse_transform_input(\n    input: &[Felt],\n    abi: &[AbiEntry],\n    function_selector: &Felt,\n) -> Result<String, ReverseTransformError> {\n    let input_types: Vec<_> = extract_function_from_selector(abi, *function_selector)\n        .ok_or(ReverseTransformError::FunctionNotFound(*function_selector))?\n        .inputs\n        .into_iter()\n        .map(|input| input.r#type)\n        .collect();\n\n    reverse_transform(input, abi, &input_types)\n}\n\n/// Transforms a call output into a Cairo-like string representation of the return values\npub fn reverse_transform_output(\n    output: &[Felt],\n    abi: &[AbiEntry],\n    function_selector: &Felt,\n) -> Result<String, ReverseTransformError> {\n    let output_types: Vec<_> = extract_function_from_selector(abi, *function_selector)\n        .ok_or(ReverseTransformError::FunctionNotFound(*function_selector))?\n        .outputs\n        .into_iter()\n        .map(|input| input.r#type)\n        .collect();\n\n    reverse_transform(output, abi, &output_types)\n}\n\nfn reverse_transform(\n    felts: &[Felt],\n    abi: &[AbiEntry],\n    types: &[String],\n) -> Result<String, ReverseTransformError> {\n    let db = SimpleParserDatabase::default();\n    let mut reverse_transformer = ReverseTransformer::new(felts, abi);\n\n    Ok(types\n        .iter()\n        .map(|parameter_type| {\n            Ok(reverse_transformer\n                .parse_and_transform(parameter_type, &db)?\n                .to_string())\n        })\n        .collect::<Result<Vec<String>, TransformationError>>()?\n        .join(\", \"))\n}\n"
  },
  {
    "path": "crates/data-transformer/src/reverse_transformer/transform.rs",
    "content": "use crate::reverse_transformer::types::{\n    Enum, Primitive, Sequence, SequenceType, Struct, StructField, Tuple, Type,\n};\nuse crate::shared::parsing::{ParseError, parse_expression};\nuse crate::shared::path::{PathSplitError, SplitResult, split};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse cairo_lang_syntax::node::ast::{Expr, ExprListParenthesized, ExprPath};\nuse conversions::serde::deserialize::{BufferReadError, BufferReader};\nuse starknet_rust::core::types::contract::{AbiEntry, AbiEnum, AbiStruct};\nuse starknet_types_core::felt::Felt;\n\n/// An error that can occur during the transformation process.\n#[derive(Debug, thiserror::Error)]\npub enum TransformationError {\n    #[error(\"type unsupported by reverse transformer\")]\n    UnsupportedType,\n    #[error(\"reading from buffer failed with error: {0}\")]\n    BufferReaderError(#[from] BufferReadError),\n    #[error(\"{enum_name} enum does not have variant at position {variant_position}\")]\n    NoSuchEnumVariant {\n        enum_name: String,\n        variant_position: usize,\n    },\n    #[error(\"abi is invalid\")]\n    InvalidAbi,\n    #[error(transparent)]\n    ParseError(#[from] ParseError),\n    #[error(transparent)]\n    PathSplitError(#[from] PathSplitError),\n}\n\n/// An error that can occur when trying to transform a primitive type.\n#[derive(Debug, thiserror::Error)]\nenum PrimitiveError {\n    #[error(\"Type {0} is not primitive\")]\n    NotFound(String),\n    #[error(transparent)]\n    BufferReaderError(#[from] BufferReadError),\n}\n\npub struct ReverseTransformer<'a> {\n    abi: &'a [AbiEntry],\n    buffer_reader: BufferReader<'a>,\n}\n\nimpl<'a> ReverseTransformer<'a> {\n    /// Creates a new instance of [`ReverseTransformer`].\n    pub fn new(inputs: &'a [Felt], abi: &'a [AbiEntry]) -> Self {\n        Self {\n            abi,\n            buffer_reader: BufferReader::new(inputs),\n        }\n    }\n\n    /// Parses the given `&str` to an [`Expr`] and then transforms it to a [`Type`].\n    pub fn parse_and_transform(\n        &mut self,\n        expr: &str,\n        db: &SimpleParserDatabase,\n    ) -> Result<Type, TransformationError> {\n        let parsed_expr = parse_expression(expr, db)?;\n        self.transform_expr(&parsed_expr, db)\n    }\n\n    /// Transforms the given [`Expr`] to a [`Type`].\n    fn transform_expr(\n        &mut self,\n        expr: &Expr,\n        db: &SimpleParserDatabase,\n    ) -> Result<Type, TransformationError> {\n        match expr {\n            Expr::Tuple(expr) => self.transform_tuple(expr, db),\n            Expr::Path(expr) => self.transform_path(expr, db),\n            _ => Err(TransformationError::UnsupportedType),\n        }\n    }\n\n    /// Transforms a tuple expression to a [`Type::Tuple`].\n    fn transform_tuple(\n        &mut self,\n        expr: &ExprListParenthesized,\n        db: &SimpleParserDatabase,\n    ) -> Result<Type, TransformationError> {\n        let elements = expr.expressions(db).elements(db).collect::<Vec<_>>();\n        let parsed_exprs = elements\n            .iter()\n            .map(|expr| self.transform_expr(expr, db))\n            .collect::<Result<Vec<_>, TransformationError>>()?;\n\n        Ok(Type::Tuple(Tuple(parsed_exprs)))\n    }\n\n    /// Transforms a [`ExprPath`] to a [`Type`].\n    fn transform_path(\n        &mut self,\n        expr: &ExprPath,\n        db: &SimpleParserDatabase,\n    ) -> Result<Type, TransformationError> {\n        match split(expr, db)? {\n            SplitResult::Simple { splits } => self.transform_simple_path(&splits, db),\n            SplitResult::WithGenericArgs {\n                splits,\n                generic_args,\n            } => self.transform_generic_path(&splits, &generic_args, db),\n        }\n    }\n\n    /// Transforms a generic path to a [`Type::Sequence`].\n    ///\n    /// It first checks if the path is a known sequence type (Array or Span).\n    /// If it is, it reads the length of the sequence from the buffer.\n    /// Then it recursively transforms the elements of the sequence.\n    fn transform_generic_path(\n        &mut self,\n        splits: &[String],\n        generic_args: &str,\n        db: &SimpleParserDatabase,\n    ) -> Result<Type, TransformationError> {\n        let sequence_type = match splits.join(\"::\").as_str() {\n            \"core::array::Array\" => SequenceType::Array,\n            \"core::array::Span\" => SequenceType::Span,\n            _ => return Err(TransformationError::UnsupportedType),\n        };\n\n        let length = self.buffer_reader.read::<usize>()?;\n\n        let sequence = (0..length)\n            .map(|_| self.parse_and_transform(generic_args, db))\n            .collect::<Result<Vec<_>, TransformationError>>()?;\n\n        Ok(Type::Sequence(Sequence {\n            sequence_type,\n            sequence,\n        }))\n    }\n\n    /// Transforms a simple path to a [`Type`].\n    ///\n    /// It first tries to transform it to a primitive type.\n    /// If that fails, it means it is a complex type.\n    /// Then it tries to find the type in the ABI and transform it to the matching representation.\n    fn transform_simple_path(\n        &mut self,\n        parts: &[String],\n        db: &SimpleParserDatabase,\n    ) -> Result<Type, TransformationError> {\n        let name = parts.last().expect(\"path should not be empty\").to_owned();\n\n        match self.transform_primitive_type(&name) {\n            Err(PrimitiveError::NotFound(_)) => (),\n            Ok(primitive) => return Ok(Type::Primitive(primitive)),\n            Err(PrimitiveError::BufferReaderError(error)) => {\n                return Err(TransformationError::BufferReaderError(error));\n            }\n        }\n\n        match find_item(self.abi, parts).ok_or(TransformationError::InvalidAbi)? {\n            AbiStructOrEnum::Enum(enum_abi_definition) => {\n                self.transform_enum(enum_abi_definition, name, db)\n            }\n            AbiStructOrEnum::Struct(struct_type_definition) => {\n                self.transform_struct(struct_type_definition, db)\n            }\n        }\n    }\n\n    /// Transforms to a [`Type::Struct`].\n    ///\n    /// Recursively transforms the fields of the struct and then creates a [`Type::Struct`] instance.\n    fn transform_struct(\n        &mut self,\n        abi_struct: &AbiStruct,\n        db: &SimpleParserDatabase,\n    ) -> Result<Type, TransformationError> {\n        let fields = abi_struct\n            .members\n            .iter()\n            .map(|member| {\n                let value = self.parse_and_transform(&member.r#type, db)?;\n                let name = member.name.clone();\n\n                Ok(StructField { name, value })\n            })\n            .collect::<Result<Vec<_>, TransformationError>>()?;\n\n        let name = abi_struct\n            .name\n            .split(\"::\")\n            .last()\n            .expect(\"path should not be empty\")\n            .to_owned();\n\n        Ok(Type::Struct(Struct { name, fields }))\n    }\n\n    /// Transforms to a [`Type::Enum`].\n    ///\n    /// It first reads the position of the enum variant from the buffer.\n    /// Then it retrieves the variant name and type from the ABI.\n    /// If the variant type is unit, it sets the argument to `None`, else it recursively transforms the variant type.\n    /// Finally, it creates a [`Type::Enum`] instance.\n    fn transform_enum(\n        &mut self,\n        abi_enum: &AbiEnum,\n        name: String,\n        db: &SimpleParserDatabase,\n    ) -> Result<Type, TransformationError> {\n        let position: usize = self.buffer_reader.read()?;\n\n        let variant = abi_enum.variants.get(position).ok_or_else(|| {\n            TransformationError::NoSuchEnumVariant {\n                enum_name: name.clone(),\n                variant_position: position,\n            }\n        })?;\n\n        let enum_variant_type = variant.r#type.as_str();\n        let variant = variant.name.clone();\n\n        let argument = if enum_variant_type == \"()\" {\n            None\n        } else {\n            Some(Box::new(self.parse_and_transform(enum_variant_type, db)?))\n        };\n\n        Ok(Type::Enum(Enum {\n            name,\n            variant,\n            argument,\n        }))\n    }\n\n    /// Transforms a primitive type string to a [`Primitive`].\n    ///\n    /// It matches the type string against known primitive types and reads the corresponding value from the buffer.\n    fn transform_primitive_type(&mut self, type_str: &str) -> Result<Primitive, PrimitiveError> {\n        match type_str {\n            \"bool\" => Ok(Primitive::Bool(self.buffer_reader.read()?)),\n            \"u8\" => Ok(Primitive::U8(self.buffer_reader.read()?)),\n            \"u16\" => Ok(Primitive::U16(self.buffer_reader.read()?)),\n            \"u32\" => Ok(Primitive::U32(self.buffer_reader.read()?)),\n            \"u64\" => Ok(Primitive::U64(self.buffer_reader.read()?)),\n            \"u96\" => Ok(Primitive::U96(self.buffer_reader.read()?)),\n            \"u128\" => Ok(Primitive::U128(self.buffer_reader.read()?)),\n            \"u256\" => Ok(Primitive::U256(self.buffer_reader.read()?)),\n            \"u384\" => Ok(Primitive::U384(self.buffer_reader.read()?)),\n            \"u512\" => Ok(Primitive::U512(self.buffer_reader.read()?)),\n            \"i8\" => Ok(Primitive::I8(self.buffer_reader.read()?)),\n            \"i16\" => Ok(Primitive::I16(self.buffer_reader.read()?)),\n            \"i32\" => Ok(Primitive::I32(self.buffer_reader.read()?)),\n            \"i64\" => Ok(Primitive::I64(self.buffer_reader.read()?)),\n            \"i128\" => Ok(Primitive::I128(self.buffer_reader.read()?)),\n            \"ByteArray\" => Ok(Primitive::ByteArray(self.buffer_reader.read()?)),\n            \"bytes31\" => Ok(Primitive::CairoBytes31(self.buffer_reader.read()?)),\n            \"ContractAddress\" => Ok(Primitive::ContractAddress(self.buffer_reader.read()?)),\n            \"ClassHash\" => Ok(Primitive::ClassHash(self.buffer_reader.read()?)),\n            \"StorageAddress\" => Ok(Primitive::StorageAddress(self.buffer_reader.read()?)),\n            \"EthAddress\" => Ok(Primitive::EthAddress(self.buffer_reader.read()?)),\n            \"felt\" | \"felt252\" => Ok(Primitive::Felt(self.buffer_reader.read()?)),\n            _ => Err(PrimitiveError::NotFound(type_str.to_string())),\n        }\n    }\n}\n\nenum AbiStructOrEnum<'a> {\n    Struct(&'a AbiStruct),\n    Enum(&'a AbiEnum),\n}\n\nfn find_item<'a>(items_from_abi: &'a [AbiEntry], path: &[String]) -> Option<AbiStructOrEnum<'a>> {\n    let path = path.join(\"::\");\n    items_from_abi.iter().find_map(|item| match item {\n        AbiEntry::Struct(abi_struct) if abi_struct.name == path => {\n            Some(AbiStructOrEnum::Struct(abi_struct))\n        }\n        AbiEntry::Enum(abi_enum) if abi_enum.name == path => Some(AbiStructOrEnum::Enum(abi_enum)),\n        _ => None,\n    })\n}\n"
  },
  {
    "path": "crates/data-transformer/src/reverse_transformer/types.rs",
    "content": "use crate::cairo_types::{CairoBytes31, CairoU96, CairoU256, CairoU384, CairoU512};\nuse conversions::byte_array::ByteArray;\nuse starknet_types_core::felt::Felt;\nuse std::fmt;\nuse std::fmt::Display;\n\n/// Types that are supported by the reverse transformer\n#[derive(Debug)]\npub enum Type {\n    Struct(Struct),\n    Sequence(Sequence),\n    Enum(Enum),\n    Primitive(Primitive),\n    Tuple(Tuple),\n}\n\nimpl Display for Type {\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        match self {\n            Type::Struct(value) => write!(f, \"{value}\"),\n            Type::Sequence(value) => write!(f, \"{value}\"),\n            Type::Enum(value) => write!(f, \"{value}\"),\n            Type::Primitive(value) => write!(f, \"{value}\"),\n            Type::Tuple(value) => write!(f, \"{value}\"),\n        }\n    }\n}\n\n/// Primitive types supported by the reverse transformer\n#[derive(Debug)]\npub enum Primitive {\n    Bool(bool),\n    U8(u8),\n    U16(u16),\n    U32(u32),\n    U64(u64),\n    U96(CairoU96),\n    U128(u128),\n    U256(CairoU256),\n    U384(CairoU384),\n    U512(CairoU512),\n    I8(i8),\n    I16(i16),\n    I32(i32),\n    I64(i64),\n    I128(i128),\n    Felt(Felt),\n    CairoBytes31(CairoBytes31),\n    ByteArray(ByteArray),\n    ContractAddress(Felt),\n    ClassHash(Felt),\n    StorageAddress(Felt),\n    EthAddress(Felt),\n}\n\nimpl Display for Primitive {\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        match self {\n            Primitive::Bool(value) => write!(f, \"{value}\"),\n            Primitive::U8(value) => write!(f, \"{value}_u8\"),\n            Primitive::U16(value) => write!(f, \"{value}_u16\"),\n            Primitive::U32(value) => write!(f, \"{value}_u32\"),\n            Primitive::U64(value) => write!(f, \"{value}_u64\"),\n            Primitive::U96(value) => write!(f, \"{value}_96\"),\n            Primitive::U128(value) => write!(f, \"{value}_u128\"),\n            Primitive::U256(value) => write!(f, \"{value}_u256\"),\n            Primitive::U384(value) => write!(f, \"{value}_u384\"),\n            Primitive::U512(value) => write!(f, \"{value}_u512\"),\n            Primitive::I8(value) => write!(f, \"{value}_i8\"),\n            Primitive::I16(value) => write!(f, \"{value}_i16\"),\n            Primitive::I32(value) => write!(f, \"{value}_i32\"),\n            Primitive::I64(value) => write!(f, \"{value}_i64\"),\n            Primitive::I128(value) => write!(f, \"{value}_i128\"),\n            Primitive::Felt(value) => write!(f, \"{value:#x}\"),\n            Primitive::ByteArray(value) => write!(f, \"\\\"{value}\\\"\"),\n            Primitive::ContractAddress(value) => write!(f, \"ContractAddress({value:#x})\"),\n            Primitive::ClassHash(value) => write!(f, \"ClassHash({value:#x})\"),\n            Primitive::StorageAddress(value) => write!(f, \"StorageAddress({value:#x})\"),\n            Primitive::EthAddress(value) => write!(f, \"EthAddress({value:#x})\"),\n            Primitive::CairoBytes31(value) => {\n                let felt = Felt::from(*value);\n                write!(f, \"CairoBytes31({felt:#x})\")\n            }\n        }\n    }\n}\n\n#[derive(Debug)]\npub struct Tuple(pub Vec<Type>);\n\nimpl Display for Tuple {\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        let mut dbg = f.debug_tuple(\"\");\n        for item in &self.0 {\n            dbg.field(&format_args!(\"{item}\"));\n        }\n        dbg.finish()\n    }\n}\n\n#[derive(Debug)]\npub struct StructField {\n    pub name: String,\n    pub value: Type,\n}\n\n#[derive(Debug)]\npub struct Struct {\n    pub name: String,\n    pub fields: Vec<StructField>,\n}\n\nimpl Display for Struct {\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        let mut dbg = f.debug_struct(&self.name);\n        for field in &self.fields {\n            dbg.field(&field.name, &format_args!(\"{}\", field.value));\n        }\n        dbg.finish()\n    }\n}\n\n#[derive(Debug)]\npub struct Enum {\n    pub name: String,\n    pub variant: String,\n    pub argument: Option<Box<Type>>,\n}\n\nimpl Display for Enum {\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        let variant_name = format!(\"{}::{}\", self.name, self.variant);\n\n        if let Some(arg) = &self.argument {\n            let mut dbg = f.debug_tuple(&variant_name);\n            dbg.field(&format_args!(\"{arg}\"));\n            dbg.finish()\n        } else {\n            write!(f, \"{variant_name}\")\n        }\n    }\n}\n\n#[derive(Debug)]\npub enum SequenceType {\n    Array,\n    Span,\n}\n\n#[derive(Debug)]\npub struct Sequence {\n    pub sequence_type: SequenceType,\n    pub sequence: Vec<Type>,\n}\n\nimpl Display for Sequence {\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        write!(f, \"array!\")?;\n\n        let mut list = f.debug_list();\n        for item in &self.sequence {\n            list.entry(&format_args!(\"{item}\"));\n        }\n        list.finish()?;\n\n        if let SequenceType::Span = &self.sequence_type {\n            write!(f, \".span()\")?;\n        }\n\n        Ok(())\n    }\n}\n"
  },
  {
    "path": "crates/data-transformer/src/shared/extraction.rs",
    "content": "use starknet_rust::core::types::contract::{AbiEntry, AbiFunction, StateMutability};\nuse starknet_rust::core::utils::get_selector_from_name;\nuse starknet_types_core::felt::Felt;\n\npub fn extract_function_from_selector(\n    abi: &[AbiEntry],\n    searched_selector: Felt,\n) -> Option<AbiFunction> {\n    const CONSTRUCTOR_AS_SELECTOR: Felt = Felt::from_hex_unchecked(\n        \"0x28ffe4ff0f226a9107253e17a904099aa4f63a02a5621de0576e5aa71bc5194\",\n    );\n\n    search_for_function(abi, searched_selector)\n        // If the user doesn't explicitly define a constructor in the contract,\n        // it won't be present in the ABI. In such cases, an implicit constructor\n        // with no arguments is assumed.\n        .or_else(|| (searched_selector == CONSTRUCTOR_AS_SELECTOR).then(default_constructor))\n}\n\nfn default_constructor() -> AbiFunction {\n    AbiFunction {\n        name: \"constructor\".to_string(),\n        inputs: vec![],\n        outputs: vec![],\n        state_mutability: StateMutability::View,\n    }\n}\n\nfn search_for_function(abi: &[AbiEntry], searched_selector: Felt) -> Option<AbiFunction> {\n    abi.iter().find_map(|entry| match entry {\n        AbiEntry::Function(func) => {\n            let selector = get_selector_from_name(&func.name).ok()?;\n            (selector == searched_selector).then(|| func.clone())\n        }\n        // We treat constructor like a regular function\n        // because it's searched for using Felt entrypoint selector, identically as functions.\n        // Also, we don't need any constructor-specific properties, just argument types.\n        AbiEntry::Constructor(constructor) => {\n            let selector = get_selector_from_name(&constructor.name).ok()?;\n            (selector == searched_selector).then(|| AbiFunction {\n                name: constructor.name.clone(),\n                inputs: constructor.inputs.clone(),\n                outputs: vec![],\n                state_mutability: StateMutability::View,\n            })\n        }\n        AbiEntry::Interface(interface) => search_for_function(&interface.items, searched_selector),\n        _ => None,\n    })\n}\n"
  },
  {
    "path": "crates/data-transformer/src/shared/mod.rs",
    "content": "pub mod extraction;\npub mod parsing;\npub mod path;\n"
  },
  {
    "path": "crates/data-transformer/src/shared/parsing.rs",
    "content": "use cairo_lang_diagnostics::DiagnosticsBuilder;\nuse cairo_lang_filesystem::ids::{FileKind, FileLongId, SmolStrId, VirtualFile};\nuse cairo_lang_parser::parser::Parser;\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse cairo_lang_syntax::node::ast::Expr;\nuse cairo_lang_utils::Intern;\n\n#[derive(Debug, thiserror::Error)]\npub enum ParseError {\n    #[error(\"Invalid Cairo expression found in input calldata \\\"{expr}\\\":\\n{diagnostics}\")]\n    InvalidExpression { expr: String, diagnostics: String },\n}\n\npub fn parse_expression<'a>(\n    source: &'a str,\n    db: &'a SimpleParserDatabase,\n) -> Result<Expr<'a>, ParseError> {\n    let file = FileLongId::Virtual(VirtualFile {\n        parent: None,\n        name: SmolStrId::from(db, \"parser_input\"),\n        content: SmolStrId::from(db, source),\n        code_mappings: [].into(),\n        kind: FileKind::Expr,\n        original_item_removed: false,\n    })\n    .intern(db);\n\n    let mut diagnostics = DiagnosticsBuilder::default();\n    let expression = Parser::parse_file_expr(db, &mut diagnostics, file, source);\n    let diagnostics = diagnostics.build();\n\n    if diagnostics.check_error_free().is_err() {\n        return Err(ParseError::InvalidExpression {\n            expr: source.to_string(),\n            diagnostics: diagnostics.format(db),\n        });\n    }\n\n    Ok(expression)\n}\n"
  },
  {
    "path": "crates/data-transformer/src/shared/path.rs",
    "content": "use cairo_lang_parser::utils::SimpleParserDatabase;\nuse cairo_lang_syntax::node::ast::{\n    Expr, ExprPath, GenericArg, PathSegment, PathSegmentWithGenericArgs,\n};\nuse cairo_lang_syntax::node::{Token, TypedSyntaxNode};\n\n#[derive(Debug, thiserror::Error)]\npub enum PathSplitError {\n    #[error(\"Invalid generic arguments\")]\n    InvalidGenericArgs,\n    #[error(\"Expected exactly one generic argument\")]\n    MoreThanOneGenericArg,\n    #[error(\"Path segment missing\")]\n    PathSegmentMissing,\n}\n\npub enum SplitResult {\n    Simple {\n        splits: Vec<String>,\n    },\n    WithGenericArgs {\n        splits: Vec<String>,\n        generic_args: String,\n    },\n}\n\n/// Splits a path into its segments, and extracts generic arguments if present.\n///\n/// In the case of Cairo-like language constructs such as arrays or spans,\n/// we assume that if there are generic arguments (e.g., `Span<T>`), they\n/// appear at the end of the path. Therefore, by the time we encounter a\n/// segment with generic arguments, all preceding segments have already\n/// been collected.\n///\n/// For example, in a path like `core::array::Array<felt252>`, this function will:\n/// - Collect \"core\", \"array\", and \"Array\" into `splits`\n/// - Extract the generic argument `felt252` from `Array<felt252>`\npub fn split(path: &ExprPath, db: &SimpleParserDatabase) -> Result<SplitResult, PathSplitError> {\n    let mut splits = Vec::new();\n    let elements = path.segments(db).elements(db);\n    let elements_len = elements.len();\n    for (i, p) in elements.enumerate() {\n        match p {\n            PathSegment::Simple(segment) => {\n                splits.push(segment.ident(db).token(db).text(db).to_string(db));\n            }\n            PathSegment::WithGenericArgs(segment) => {\n                splits.push(segment.ident(db).token(db).text(db).to_string(db));\n                let generic_args = extract_generic_args(&segment, db)?;\n\n                let is_last = i == elements_len - 1;\n                return if is_last {\n                    Ok(SplitResult::WithGenericArgs {\n                        splits,\n                        generic_args,\n                    })\n                } else {\n                    Err(PathSplitError::InvalidGenericArgs)\n                };\n            }\n            PathSegment::Missing(_segment) => Err(PathSplitError::PathSegmentMissing)?,\n        }\n    }\n\n    Ok(SplitResult::Simple { splits })\n}\n\nfn extract_generic_args(\n    segment: &PathSegmentWithGenericArgs,\n    db: &SimpleParserDatabase,\n) -> Result<String, PathSplitError> {\n    let generic_args = segment\n        .generic_args(db)\n        .generic_args(db)\n        .elements(db)\n        .map(|arg| match arg {\n            GenericArg::Named(_) => Err(PathSplitError::InvalidGenericArgs),\n            GenericArg::Unnamed(arg) => match arg.value(db) {\n                Expr::Underscore(_) => Err(PathSplitError::InvalidGenericArgs),\n                expr => Ok(expr.as_syntax_node().get_text(db)),\n            },\n        })\n        .collect::<Result<Vec<_>, PathSplitError>>()?;\n\n    let [generic_arg] = generic_args.as_slice() else {\n        return Err(PathSplitError::MoreThanOneGenericArg);\n    };\n\n    Ok(generic_arg.to_string())\n}\n"
  },
  {
    "path": "crates/data-transformer/src/transformer/mod.rs",
    "content": "mod sierra_abi;\n\nuse crate::shared::extraction::extract_function_from_selector;\nuse crate::shared::parsing::parse_expression;\nuse crate::transformer::sierra_abi::build_representation;\nuse anyhow::{Context, Result, bail, ensure};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse cairo_lang_syntax::node::ast::Expr;\nuse conversions::serde::serialize::SerializeToFeltVec;\nuse itertools::Itertools;\nuse starknet_rust::core::types::contract::{AbiEntry, AbiFunction};\nuse starknet_types_core::felt::Felt;\n\n/// Interpret `calldata` as a comma-separated series of expressions in Cairo syntax and serialize it\npub fn transform(calldata: &str, abi: &[AbiEntry], function_selector: &Felt) -> Result<Vec<Felt>> {\n    let function = extract_function_from_selector(abi, *function_selector).with_context(|| {\n        format!(\n            r#\"Function with selector \"{function_selector:#x}\" not found in ABI of the contract\"#\n        )\n    })?;\n\n    let db = SimpleParserDatabase::default();\n\n    let input = convert_to_tuple(calldata);\n    let calldata = split_expressions(&input, &db)?;\n\n    process(calldata, &function, abi, &db).context(\"Error while processing Cairo-like calldata\")\n}\n\nfn split_expressions<'a>(input: &'a str, db: &'a SimpleParserDatabase) -> Result<Vec<Expr<'a>>> {\n    if input.is_empty() {\n        return Ok(Vec::new());\n    }\n    let expr = parse_expression(input, db)?;\n\n    match expr {\n        Expr::Tuple(tuple) => Ok(tuple.expressions(db).elements(db).collect()),\n        Expr::Parenthesized(expr) => Ok(vec![expr.expr(db)]),\n        _ => bail!(\"Wrong calldata format - expected tuple of Cairo expressions\"),\n    }\n}\n\nfn process(\n    calldata: Vec<Expr>,\n    function: &AbiFunction,\n    abi: &[AbiEntry],\n    db: &SimpleParserDatabase,\n) -> Result<Vec<Felt>> {\n    let n_inputs = function.inputs.len();\n    let n_arguments = calldata.len();\n\n    ensure!(\n        n_inputs == n_arguments,\n        \"Invalid number of arguments: passed {n_arguments}, expected {n_inputs}\",\n    );\n\n    function\n        .inputs\n        .iter()\n        .zip(calldata)\n        .map(|(parameter, expr)| {\n            let representation = build_representation(expr, &parameter.r#type, abi, db)?;\n            Ok(representation.serialize_to_vec())\n        })\n        .flatten_ok()\n        .collect::<Result<_>>()\n}\n\nfn convert_to_tuple(calldata: &str) -> String {\n    // We need to convert our comma-separated string of expressions into something that is a valid\n    // Cairo expression, so we can parse it.\n    //\n    // We convert to tuple by wrapping in `()` with a trailing `,` to handle case of a single argument\n    if calldata.is_empty() {\n        return String::new();\n    }\n    format!(\"({calldata},)\")\n}\n"
  },
  {
    "path": "crates/data-transformer/src/transformer/sierra_abi/binary.rs",
    "content": "use crate::transformer::sierra_abi::SupportedCalldataKind;\nuse crate::transformer::sierra_abi::data_representation::AllowedCalldataArgument;\nuse anyhow::{Result, bail, ensure};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse cairo_lang_syntax::node::ast::{\n    BinaryOperator, Expr, ExprBinary, ExprFunctionCall, PathSegment,\n};\nuse cairo_lang_syntax::node::{Terminal, TypedSyntaxNode};\nuse starknet_rust::core::types::contract::AbiEntry;\n\nimpl SupportedCalldataKind for ExprBinary<'_> {\n    fn transform(\n        &self,\n        expected_type: &str,\n        abi: &[AbiEntry],\n        db: &SimpleParserDatabase,\n    ) -> Result<AllowedCalldataArgument> {\n        let op = self.op(db);\n        let lhs = self.lhs(db);\n        let rhs = self.rhs(db);\n\n        if !matches!(op, BinaryOperator::Dot(_)) {\n            let op = op\n                .as_syntax_node()\n                .get_text_without_trivia(db)\n                .to_string(db);\n            bail!(r#\"Invalid operator, expected \".\", got \"{op}\"\"#)\n        }\n\n        let Expr::InlineMacro(lhs) = lhs else {\n            let lhs = lhs\n                .as_syntax_node()\n                .get_text_without_trivia(db)\n                .to_string(db);\n            bail!(r#\"Only \"array![]\" is supported as left-hand side of \".\" operator, got \"{lhs}\"\"#);\n        };\n\n        let Expr::FunctionCall(rhs) = rhs else {\n            let rhs = rhs\n                .as_syntax_node()\n                .get_text_without_trivia(db)\n                .to_string(db);\n            bail!(r#\"Only calling \".span()\" on \"array![]\" is supported, got \"{rhs}\"\"#);\n        };\n\n        assert_is_span(&rhs, db)?;\n        let expected_type = expected_type.replace(\"Span\", \"Array\");\n        lhs.transform(&expected_type, abi, db)\n    }\n}\n\nfn assert_is_span(expr: &ExprFunctionCall, db: &SimpleParserDatabase) -> Result<()> {\n    match expr\n        .path(db)\n        .segments(db)\n        .elements(db)\n        .last()\n        .expect(\"Function call must have a name\")\n    {\n        PathSegment::Simple(simple) => {\n            let function_name = simple.ident(db).text(db).to_string(db);\n            ensure!(\n                function_name == \"span\",\n                r#\"Invalid function name, expected \"span\", got \"{function_name}\"\"#\n            );\n            Ok(())\n        }\n        PathSegment::WithGenericArgs(_) => {\n            bail!(\"Invalid path specified: generic args in function call not supported\")\n        }\n        PathSegment::Missing(_segment) => {\n            bail!(\"Path segment missing\")\n        }\n    }\n}\n"
  },
  {
    "path": "crates/data-transformer/src/transformer/sierra_abi/complex_types.rs",
    "content": "use super::data_representation::{\n    AllowedCalldataArgument, CalldataEnum, CalldataStruct, CalldataStructField, CalldataTuple,\n};\nuse super::parsing::parse_argument_list;\nuse super::{SupportedCalldataKind, build_representation};\nuse crate::shared;\nuse crate::shared::parsing::parse_expression;\nuse crate::shared::path::SplitResult;\nuse anyhow::{Context, Result, bail, ensure};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse cairo_lang_syntax::node::ast::{\n    Expr, ExprFunctionCall, ExprListParenthesized, ExprPath, ExprStructCtorCall,\n    OptionStructArgExpr, StructArg,\n};\nuse cairo_lang_syntax::node::{Terminal, TypedSyntaxNode};\nuse itertools::Itertools;\nuse starknet_rust::core::types::contract::{AbiEntry, AbiEnum, AbiNamedMember, AbiStruct};\nuse std::collections::HashSet;\n\npub trait EnumOrStruct {\n    const VARIANT: &'static str;\n    const VARIANT_CAPITALIZED: &'static str;\n    fn name(&self) -> String;\n}\n\nimpl EnumOrStruct for AbiStruct {\n    const VARIANT: &'static str = \"struct\";\n    const VARIANT_CAPITALIZED: &'static str = \"Struct\";\n\n    fn name(&self) -> String {\n        self.name.clone()\n    }\n}\n\nimpl EnumOrStruct for AbiEnum {\n    const VARIANT: &'static str = \"enum\";\n    const VARIANT_CAPITALIZED: &'static str = \"Enum\";\n\n    fn name(&self) -> String {\n        self.name.clone()\n    }\n}\n\nfn validate_path_argument(\n    param_type: &str,\n    path_argument: &[String],\n    path_argument_joined: &String,\n) -> Result<()> {\n    if *path_argument.last().unwrap() != param_type.split(\"::\").last().unwrap()\n        && path_argument_joined != param_type\n    {\n        bail!(r#\"Invalid argument type, expected \"{param_type}\", got \"{path_argument_joined}\"\"#)\n    }\n    Ok(())\n}\n\nfn split(path: &ExprPath, db: &SimpleParserDatabase) -> Result<Vec<String>> {\n    match shared::path::split(path, db)? {\n        SplitResult::Simple { splits } => Ok(splits),\n        SplitResult::WithGenericArgs { .. } => {\n            bail!(\"Cannot use generic args when specifying struct/enum path\")\n        }\n    }\n}\n\nfn find_all_structs(abi: &[AbiEntry]) -> Vec<&AbiStruct> {\n    abi.iter()\n        .filter_map(|entry| match entry {\n            AbiEntry::Struct(r#struct) => Some(r#struct),\n            _ => None,\n        })\n        .collect()\n}\n\nfn find_enum_variant_position<'a>(\n    variant: &String,\n    path: &[String],\n    abi: &'a [AbiEntry],\n) -> Result<(usize, &'a AbiNamedMember)> {\n    let enums_from_abi = abi\n        .iter()\n        .filter_map(|abi_entry| {\n            if let AbiEntry::Enum(abi_enum) = abi_entry {\n                Some(abi_enum)\n            } else {\n                None\n            }\n        })\n        .collect::<Vec<&AbiEnum>>();\n\n    let enum_abi_definition = find_item_with_path(enums_from_abi, path)?;\n\n    let position_and_enum_variant = enum_abi_definition\n        .variants\n        .iter()\n        .find_position(|item| item.name == *variant)\n        .with_context(|| {\n            format!(\n                r#\"Couldn't find variant \"{}\" in enum \"{}\"\"#,\n                variant,\n                path.join(\"::\")\n            )\n        })?;\n\n    Ok(position_and_enum_variant)\n}\n\n/// Structs and enums in ABI can be searched in the same way. 'item' here refers either to an enum or a struct\nfn find_item_with_path<'item, T: EnumOrStruct>(\n    items_from_abi: Vec<&'item T>,\n    path: &[String],\n) -> Result<&'item T> {\n    // Argument is a module path to an item (module_name::StructName {})\n    if path.len() > 1 {\n        let full_path_item = items_from_abi\n            .into_iter()\n            .find(|x| x.name() == path.join(\"::\"));\n\n        ensure!(\n            full_path_item.is_some(),\n            r#\"{} \"{}\" not found in ABI\"#,\n            T::VARIANT_CAPITALIZED,\n            path.join(\"::\")\n        );\n\n        return Ok(full_path_item.unwrap());\n    }\n\n    // Argument is just the name of the item (Struct {})\n    let mut matching_items_from_abi: Vec<&T> = items_from_abi\n        .into_iter()\n        .filter(|x| x.name().split(\"::\").last() == path.last().map(String::as_str))\n        .collect();\n\n    ensure!(\n        !matching_items_from_abi.is_empty(),\n        r#\"{} \"{}\" not found in ABI\"#,\n        T::VARIANT_CAPITALIZED,\n        path.join(\"::\")\n    );\n\n    ensure!(\n        matching_items_from_abi.len() == 1,\n        r#\"Found more than one {} \"{}\" in ABI, please specify a full path to the item\"#,\n        T::VARIANT,\n        path.join(\"::\")\n    );\n\n    Ok(matching_items_from_abi.pop().unwrap())\n}\n\nfn get_struct_arguments_with_values<'a>(\n    arguments: &'a [StructArg<'a>],\n    db: &'a SimpleParserDatabase,\n) -> Result<Vec<(String, Expr<'a>)>> {\n    arguments\n        .iter()\n        .map(|elem| {\n            match elem {\n                // Holds info about parameter and argument in struct creation, e.g.:\n                // in case of \"Struct { a: 1, b: 2 }\", two separate StructArgSingle hold info\n                // about \"a: 1\" and \"b: 2\" respectively.\n                StructArg::StructArgSingle(whole_arg) => {\n                    match whole_arg.arg_expr(db) {\n                        // It's probably a case of constructor invocation `Struct {a, b}` catching variables `a` and `b` from context\n                        OptionStructArgExpr::Empty(_) => {\n                            bail!(\n                                \"Shorthand arguments are not allowed - used \\\"{ident}\\\", expected \\\"{ident}: value\\\"\",\n                                ident = whole_arg.identifier(db).text(db).to_string(db)\n                            )\n                        }\n                        // Holds info about the argument, e.g.: in case of \"a: 1\" holds info\n                        // about \": 1\"\n                        OptionStructArgExpr::StructArgExpr(arg_value_with_colon) => Ok((\n                            whole_arg.identifier(db).text(db).to_string(db),\n                            arg_value_with_colon.expr(db),\n                        )),\n                    }\n                }\n                StructArg::StructArgTail(_) => {\n                    bail!(\"Struct initialization with \\\"..\\\" operator is not allowed\")\n                }\n            }\n        })\n        .collect()\n}\n\n// Structs\nimpl SupportedCalldataKind for ExprStructCtorCall<'_> {\n    fn transform(\n        &self,\n        expected_type: &str,\n        abi: &[AbiEntry],\n        db: &SimpleParserDatabase,\n    ) -> Result<AllowedCalldataArgument> {\n        let struct_path: Vec<String> = split(&self.path(db), db)?;\n        let struct_path_joined = struct_path.clone().join(\"::\");\n\n        validate_path_argument(expected_type, &struct_path, &struct_path_joined)?;\n\n        let structs_from_abi = find_all_structs(abi);\n        let struct_abi_definition = find_item_with_path(structs_from_abi, &struct_path)?;\n\n        let struct_args = self\n            .arguments(db)\n            .arguments(db)\n            .elements(db)\n            .collect::<Vec<_>>();\n\n        let struct_args_with_values = get_struct_arguments_with_values(&struct_args, db)\n            .context(\"Found invalid expression in struct argument\")?;\n\n        if struct_args_with_values.len() != struct_abi_definition.members.len() {\n            bail!(\n                r#\"Invalid number of struct arguments in struct \"{}\", expected {} arguments, found {}\"#,\n                struct_path_joined,\n                struct_abi_definition.members.len(),\n                struct_args.len()\n            )\n        }\n\n        // validate if all arguments' names have corresponding names in abi\n        if struct_args_with_values\n            .iter()\n            .map(|(arg_name, _)| arg_name.clone())\n            .collect::<HashSet<String>>()\n            != struct_abi_definition\n                .members\n                .iter()\n                .map(|x| x.name.clone())\n                .collect::<HashSet<String>>()\n        {\n            // TODO add message which arguments are invalid (Issue #2549)\n            bail!(\n                r\"Arguments in constructor invocation for struct {expected_type} do not match struct arguments in ABI\",\n            )\n        }\n\n        let fields = struct_args_with_values\n            .into_iter()\n            .map(|(arg_name, expr)| {\n                let abi_entry = struct_abi_definition\n                    .members\n                    .iter()\n                    .find(|&abi_member| abi_member.name == arg_name)\n                    .expect(\"Arg name should be in ABI - it is checked before with HashSets\");\n                Ok(CalldataStructField::new(build_representation(\n                    expr,\n                    &abi_entry.r#type,\n                    abi,\n                    db,\n                )?))\n            })\n            .collect::<Result<Vec<CalldataStructField>>>()?;\n\n        Ok(AllowedCalldataArgument::Struct(CalldataStruct::new(fields)))\n    }\n}\n\n// Unit enum variants\nimpl SupportedCalldataKind for ExprPath<'_> {\n    fn transform(\n        &self,\n        expected_type: &str,\n        abi: &[AbiEntry],\n        db: &SimpleParserDatabase,\n    ) -> Result<AllowedCalldataArgument> {\n        // Enums with no value - Enum::Variant\n        let enum_path_with_variant = split(self, db)?;\n        let (enum_variant_name, enum_path) = enum_path_with_variant.split_last().unwrap();\n        let enum_path_joined = enum_path.join(\"::\");\n\n        validate_path_argument(expected_type, enum_path, &enum_path_joined)?;\n\n        let (enum_position, enum_variant) =\n            find_enum_variant_position(enum_variant_name, enum_path, abi)?;\n\n        if enum_variant.r#type != \"()\" {\n            bail!(r#\"Couldn't find variant \"{enum_variant_name}\" in enum \"{enum_path_joined}\"\"#)\n        }\n\n        Ok(AllowedCalldataArgument::Enum(CalldataEnum::new(\n            enum_position,\n            None,\n        )))\n    }\n}\n\n// Tuple-like enum variants\nimpl SupportedCalldataKind for ExprFunctionCall<'_> {\n    fn transform(\n        &self,\n        expected_type: &str,\n        abi: &[AbiEntry],\n        db: &SimpleParserDatabase,\n    ) -> Result<AllowedCalldataArgument> {\n        // Enums with value - Enum::Variant(10)\n        let enum_path_with_variant = split(&self.path(db), db)?;\n        let (enum_variant_name, enum_path) = enum_path_with_variant.split_last().unwrap();\n        let enum_path_joined = enum_path.join(\"::\");\n\n        validate_path_argument(expected_type, enum_path, &enum_path_joined)?;\n\n        let (enum_position, enum_variant) =\n            find_enum_variant_position(enum_variant_name, enum_path, abi)?;\n\n        let arguments = self.arguments(db).arguments(db);\n        // Enum variant constructor invocation has one argument - an ArgList.\n        // We parse it to a vector of expressions and pop + unwrap safely.\n        let expr = parse_argument_list(&arguments, db)?.pop().unwrap();\n\n        let parsed_expr = build_representation(expr, &enum_variant.r#type, abi, db)?;\n\n        Ok(AllowedCalldataArgument::Enum(CalldataEnum::new(\n            enum_position,\n            Some(Box::new(parsed_expr)),\n        )))\n    }\n}\n\n// Tuples\nimpl SupportedCalldataKind for ExprListParenthesized<'_> {\n    fn transform(\n        &self,\n        expected_type: &str,\n        abi: &[AbiEntry],\n        db: &SimpleParserDatabase,\n    ) -> Result<AllowedCalldataArgument> {\n        let Expr::Tuple(tuple) = parse_expression(expected_type, db)? else {\n            bail!(r#\"Invalid argument type, expected \"{expected_type}\", got tuple\"#);\n        };\n\n        let tuple_types = tuple\n            .expressions(db)\n            .elements(db)\n            .map(|element| match element {\n                Expr::Path(path) => Ok(path.as_syntax_node().get_text(db)),\n                other => bail!(\n                    \"Unexpected expression found in ABI: {}. Contract ABI may be invalid\",\n                    other.as_syntax_node().get_text(db)\n                ),\n            })\n            .collect::<Result<Vec<_>>>()?;\n\n        let parsed_exprs = self\n            .expressions(db)\n            .elements(db)\n            .zip(tuple_types)\n            .map(|(expr, single_param)| build_representation(expr, single_param, abi, db))\n            .collect::<Result<Vec<_>>>()?;\n\n        Ok(AllowedCalldataArgument::Tuple(CalldataTuple::new(\n            parsed_exprs,\n        )))\n    }\n}\n"
  },
  {
    "path": "crates/data-transformer/src/transformer/sierra_abi/data_representation.rs",
    "content": "use crate::cairo_types::{CairoBytes31, CairoU96, CairoU256, CairoU384, CairoU512};\nuse anyhow::{Context, bail};\nuse conversions::felt::FromShortString;\nuse conversions::{\n    byte_array::ByteArray,\n    serde::serialize::{BufferWriter, CairoSerialize},\n};\nuse starknet_types_core::felt::Felt;\nuse std::{any::type_name, str::FromStr};\n\nfn neat_parsing_error_message(value: &str, parsing_type: &str, reason: Option<&str>) -> String {\n    if let Some(message) = reason {\n        format!(r#\"Failed to parse value \"{value}\" into type \"{parsing_type}\": {message}\"#)\n    } else {\n        format!(r#\"Failed to parse value \"{value}\" into type \"{parsing_type}\"\"#)\n    }\n}\n\nfn parse_with_type<T: FromStr>(value: &str) -> anyhow::Result<T>\nwhere\n    <T as FromStr>::Err: std::error::Error + Send + Sync + 'static,\n{\n    value\n        .parse::<T>()\n        .context(neat_parsing_error_message(value, type_name::<T>(), None))\n}\n\n/// A fundamental struct for representing expression types supported by the transformer\n#[derive(Debug)]\npub enum AllowedCalldataArgument {\n    Struct(CalldataStruct),\n    ArrayMacro(CalldataArrayMacro),\n    Enum(CalldataEnum),\n    Primitive(CalldataPrimitive),\n    Tuple(CalldataTuple),\n}\n\nimpl CairoSerialize for AllowedCalldataArgument {\n    fn serialize(&self, output: &mut BufferWriter) {\n        match self {\n            AllowedCalldataArgument::Struct(value) => value.serialize(output),\n            AllowedCalldataArgument::ArrayMacro(value) => value.serialize(output),\n            AllowedCalldataArgument::Enum(value) => value.serialize(output),\n            AllowedCalldataArgument::Primitive(value) => value.serialize(output),\n            AllowedCalldataArgument::Tuple(value) => value.serialize(output),\n        }\n    }\n}\n\n#[derive(Debug)]\npub enum CalldataPrimitive {\n    Bool(bool),\n    U8(u8),\n    U16(u16),\n    U32(u32),\n    U64(u64),\n    U96(CairoU96),\n    U128(u128),\n    U256(CairoU256),\n    U384(CairoU384),\n    U512(CairoU512),\n    I8(i8),\n    I16(i16),\n    I32(i32),\n    I64(i64),\n    I128(i128),\n    Felt(Felt),\n    ByteArray(ByteArray),\n}\n\nimpl CalldataPrimitive {\n    pub(crate) fn try_from_str_with_type(\n        value: &str,\n        type_with_path: &str,\n    ) -> anyhow::Result<Self> {\n        let type_str = type_with_path\n            .split(\"::\")\n            .last()\n            .context(\"Couldn't parse parameter type from ABI\")?;\n\n        // TODO add all corelib types (Issue #2550)\n        match type_str {\n            \"bool\" => Ok(Self::Bool(parse_with_type(value)?)),\n            \"u8\" => Ok(Self::U8(parse_with_type(value)?)),\n            \"u16\" => Ok(Self::U16(parse_with_type(value)?)),\n            \"u32\" => Ok(Self::U32(parse_with_type(value)?)),\n            \"u64\" => Ok(Self::U64(parse_with_type(value)?)),\n            \"u96\" => Ok(Self::U96(parse_with_type(value)?)),\n            \"u128\" => Ok(Self::U128(parse_with_type(value)?)),\n            \"u256\" => Ok(Self::U256(parse_with_type(value)?)),\n            \"u384\" => Ok(Self::U384(parse_with_type(value)?)),\n            \"u512\" => Ok(Self::U512(parse_with_type(value)?)),\n            \"i8\" => Ok(Self::I8(parse_with_type(value)?)),\n            \"i16\" => Ok(Self::I16(parse_with_type(value)?)),\n            \"i32\" => Ok(Self::I32(parse_with_type(value)?)),\n            \"i64\" => Ok(Self::I64(parse_with_type(value)?)),\n            \"i128\" => Ok(Self::I128(parse_with_type(value)?)),\n            \"ByteArray\" => Ok(Self::ByteArray(ByteArray::from(value))),\n            // bytes31 is a helper type defined in Cairo corelib;\n            // (e.g. alexandria_data_structures::bit_array::BitArray uses that)\n            // https://github.com/starkware-libs/cairo/blob/bf48e658b9946c2d5446eeb0c4f84868e0b193b5/corelib/src/bytes_31.cairo#L14\n            // It's actually felt under the hood. Although conversion from felt252 to bytes31 returns Result, it never fails.\n            \"bytes31\" => Ok(Self::Felt(parse_with_type::<CairoBytes31>(value)?.into())),\n            \"shortstring\" => {\n                let felt = Felt::from_short_string(value)?;\n                Ok(Self::Felt(felt))\n            }\n            \"felt252\" | \"felt\" | \"ContractAddress\" | \"ClassHash\" | \"StorageAddress\"\n            | \"EthAddress\" => {\n                let felt = Felt::from_dec_str(value)\n                    .with_context(|| neat_parsing_error_message(value, type_with_path, None))?;\n                Ok(Self::Felt(felt))\n            }\n            _ => {\n                bail!(neat_parsing_error_message(\n                    value,\n                    type_with_path,\n                    Some(&format!(\"unsupported type {type_with_path}\"))\n                ))\n            }\n        }\n    }\n}\n\nimpl CairoSerialize for CalldataPrimitive {\n    // https://docs.starknet.io/architecture-and-concepts/smart-contracts/serialization-of-cairo-types/\n    fn serialize(&self, output: &mut BufferWriter) {\n        match self {\n            CalldataPrimitive::Bool(value) => value.serialize(output),\n            CalldataPrimitive::U8(value) => value.serialize(output),\n            CalldataPrimitive::U16(value) => value.serialize(output),\n            CalldataPrimitive::U32(value) => value.serialize(output),\n            CalldataPrimitive::U64(value) => value.serialize(output),\n            CalldataPrimitive::U96(value) => value.serialize(output),\n            CalldataPrimitive::U128(value) => value.serialize(output),\n            CalldataPrimitive::U256(value) => value.serialize(output),\n            CalldataPrimitive::U384(value) => value.serialize(output),\n            CalldataPrimitive::U512(value) => value.serialize(output),\n            CalldataPrimitive::I8(value) => value.serialize(output),\n            CalldataPrimitive::I16(value) => value.serialize(output),\n            CalldataPrimitive::I32(value) => value.serialize(output),\n            CalldataPrimitive::I64(value) => value.serialize(output),\n            CalldataPrimitive::I128(value) => value.serialize(output),\n            CalldataPrimitive::Felt(value) => value.serialize(output),\n            CalldataPrimitive::ByteArray(value) => value.serialize(output),\n        }\n    }\n}\n\n#[derive(Debug)]\npub struct CalldataTuple(Vec<AllowedCalldataArgument>);\n\nimpl CalldataTuple {\n    pub fn new(arguments: Vec<AllowedCalldataArgument>) -> Self {\n        Self(arguments)\n    }\n}\n\nimpl CairoSerialize for CalldataTuple {\n    fn serialize(&self, output: &mut BufferWriter) {\n        self.0.iter().for_each(|field| field.serialize(output));\n    }\n}\n\n#[derive(Debug, CairoSerialize)]\npub struct CalldataStructField(AllowedCalldataArgument);\n\nimpl CalldataStructField {\n    pub fn new(value: AllowedCalldataArgument) -> Self {\n        Self(value)\n    }\n}\n\n#[derive(Debug)]\npub struct CalldataStruct(Vec<CalldataStructField>);\n\nimpl CalldataStruct {\n    pub fn new(arguments: Vec<CalldataStructField>) -> Self {\n        Self(arguments)\n    }\n}\n\nimpl CairoSerialize for CalldataStruct {\n    // https://docs.starknet.io/architecture-and-concepts/smart-contracts/serialization-of-cairo-types/#serialization_of_structs\n    fn serialize(&self, output: &mut BufferWriter) {\n        self.0.iter().for_each(|field| field.serialize(output));\n    }\n}\n\n#[derive(Debug)]\npub struct CalldataEnum {\n    position: usize,\n    argument: Option<Box<AllowedCalldataArgument>>,\n}\n\nimpl CalldataEnum {\n    pub fn new(position: usize, argument: Option<Box<AllowedCalldataArgument>>) -> Self {\n        Self { position, argument }\n    }\n}\n\nimpl CairoSerialize for CalldataEnum {\n    // https://docs.starknet.io/architecture-and-concepts/smart-contracts/serialization-of-cairo-types/#serialization_of_enums\n    fn serialize(&self, output: &mut BufferWriter) {\n        self.position.serialize(output);\n        if let Some(arg) = &self.argument {\n            arg.serialize(output);\n        }\n    }\n}\n\n#[derive(Debug, CairoSerialize)]\npub struct CalldataArrayMacro(Vec<AllowedCalldataArgument>);\n\nimpl CalldataArrayMacro {\n    pub fn new(arguments: Vec<AllowedCalldataArgument>) -> Self {\n        Self(arguments)\n    }\n}\n"
  },
  {
    "path": "crates/data-transformer/src/transformer/sierra_abi/literals.rs",
    "content": "use super::SupportedCalldataKind;\nuse super::data_representation::{AllowedCalldataArgument, CalldataPrimitive};\nuse anyhow::{Context, Result, bail};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse cairo_lang_syntax::node::Terminal;\nuse cairo_lang_syntax::node::ast::{\n    Expr, ExprUnary, TerminalFalse, TerminalLiteralNumber, TerminalShortString, TerminalString,\n    TerminalTrue, UnaryOperator,\n};\nuse starknet_rust::core::types::contract::AbiEntry;\nuse std::ops::Neg;\n\nimpl SupportedCalldataKind for TerminalLiteralNumber<'_> {\n    fn transform(\n        &self,\n        expected_type: &str,\n        _abi: &[AbiEntry],\n        db: &SimpleParserDatabase,\n    ) -> Result<AllowedCalldataArgument> {\n        let (value, suffix) = self\n            .numeric_value_and_suffix(db)\n            .with_context(|| format!(\"Couldn't parse value: {}\", self.text(db).to_string(db)))?;\n\n        let proper_param_type = match suffix {\n            None => expected_type,\n            Some(ref suffix) => &suffix.to_string(db),\n        };\n\n        Ok(AllowedCalldataArgument::Primitive(\n            CalldataPrimitive::try_from_str_with_type(&value.to_string(), proper_param_type)?,\n        ))\n    }\n}\n\nimpl SupportedCalldataKind for ExprUnary<'_> {\n    fn transform(\n        &self,\n        expected_type: &str,\n        _abi: &[AbiEntry],\n        db: &SimpleParserDatabase,\n    ) -> Result<AllowedCalldataArgument> {\n        let (value, suffix) = match self.expr(db) {\n            Expr::Literal(literal_number) => literal_number\n                .numeric_value_and_suffix(db)\n                .with_context(|| {\n                    format!(\n                        \"Couldn't parse value: {}\",\n                        literal_number.text(db).to_string(db)\n                    )\n                }),\n            _ => bail!(\"Invalid expression with unary operator, only numbers allowed\"),\n        }?;\n\n        let proper_param_type = match suffix {\n            None => expected_type,\n            Some(ref suffix) => &suffix.to_string(db),\n        };\n\n        match self.op(db) {\n            UnaryOperator::Not(_) => {\n                bail!(\"Invalid unary operator in expression !{value} , only - allowed, got !\")\n            }\n            UnaryOperator::Desnap(_) => {\n                bail!(\"Invalid unary operator in expression *{value} , only - allowed, got *\")\n            }\n            UnaryOperator::BitNot(_) => {\n                bail!(\"Invalid unary operator in expression ~{value} , only - allowed, got ~\")\n            }\n            UnaryOperator::At(_) => {\n                bail!(\"Invalid unary operator in expression @{value} , only - allowed, got @\")\n            }\n            UnaryOperator::Reference(_) => {\n                bail!(\"Invalid unary operator in expression &{value} , only - allowed, got &\")\n            }\n            UnaryOperator::Minus(_) => {}\n        }\n\n        Ok(AllowedCalldataArgument::Primitive(\n            CalldataPrimitive::try_from_str_with_type(&value.neg().to_string(), proper_param_type)?,\n        ))\n    }\n}\n\nimpl SupportedCalldataKind for TerminalShortString<'_> {\n    fn transform(\n        &self,\n        expected_type: &str,\n        _abi: &[AbiEntry],\n        db: &SimpleParserDatabase,\n    ) -> Result<AllowedCalldataArgument> {\n        let value = self\n            .string_value(db)\n            .context(\"Invalid shortstring passed as an argument\")?;\n\n        // TODO(#2623) add better handling\n        let expected_type = match expected_type.split(\"::\").last() {\n            Some(\"felt\" | \"felt252\") => \"shortstring\",\n            _ => expected_type,\n        };\n\n        Ok(AllowedCalldataArgument::Primitive(\n            CalldataPrimitive::try_from_str_with_type(&value, expected_type)?,\n        ))\n    }\n}\n\nimpl SupportedCalldataKind for TerminalString<'_> {\n    fn transform(\n        &self,\n        expected_type: &str,\n        _abi: &[AbiEntry],\n        db: &SimpleParserDatabase,\n    ) -> Result<AllowedCalldataArgument> {\n        let value = self\n            .string_value(db)\n            .context(\"Invalid string passed as an argument\")?;\n\n        Ok(AllowedCalldataArgument::Primitive(\n            CalldataPrimitive::try_from_str_with_type(&value, expected_type)?,\n        ))\n    }\n}\n\nimpl SupportedCalldataKind for TerminalTrue<'_> {\n    fn transform(\n        &self,\n        expected_type: &str,\n        _abi: &[AbiEntry],\n        db: &SimpleParserDatabase,\n    ) -> Result<AllowedCalldataArgument> {\n        let value = self.text(db).to_string(db);\n\n        Ok(AllowedCalldataArgument::Primitive(\n            CalldataPrimitive::try_from_str_with_type(&value, expected_type)?,\n        ))\n    }\n}\n\nimpl SupportedCalldataKind for TerminalFalse<'_> {\n    fn transform(\n        &self,\n        expected_type: &str,\n        _abi: &[AbiEntry],\n        db: &SimpleParserDatabase,\n    ) -> Result<AllowedCalldataArgument> {\n        let value = self.text(db).to_string(db);\n\n        Ok(AllowedCalldataArgument::Primitive(\n            CalldataPrimitive::try_from_str_with_type(&value, expected_type)?,\n        ))\n    }\n}\n"
  },
  {
    "path": "crates/data-transformer/src/transformer/sierra_abi/macros.rs",
    "content": "use super::data_representation::{AllowedCalldataArgument, CalldataArrayMacro};\nuse super::parsing::parse_inline_macro;\nuse super::{SupportedCalldataKind, build_representation};\nuse crate::shared::parsing::parse_expression;\nuse crate::transformer::{convert_to_tuple, split_expressions};\nuse anyhow::{Context, Result, bail};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse cairo_lang_syntax::node::TypedSyntaxNode;\nuse cairo_lang_syntax::node::ast::{Expr, ExprInlineMacro, PathSegment, PathSegment::Simple};\nuse itertools::Itertools;\nuse starknet_rust::core::types::contract::AbiEntry;\n\nimpl SupportedCalldataKind for ExprInlineMacro<'_> {\n    fn transform(\n        &self,\n        expected_type: &str,\n        abi: &[AbiEntry],\n        db: &SimpleParserDatabase,\n    ) -> Result<AllowedCalldataArgument> {\n        // array![] calls\n        let parsed_string = convert_to_tuple(&parse_inline_macro(self, db)?);\n        let parsed_exprs = split_expressions(&parsed_string, db)?;\n\n        // We do not expect any other expression in proper ABI\n        let Expr::Path(path) = parse_expression(expected_type, db)? else {\n            bail!(\"Unexpected expression encountered in ABI: {expected_type}. ABI may be invalid\");\n        };\n\n        let type_parameters_from_abi = path\n            .segments(db)\n            .elements(db)\n            .find_map(|element| match element {\n                // We expect exactly one PathSegment::WithGenericArgs. More means that ABI is broken, less means that type other than Array is expected\n                Simple(_) => None,\n                PathSegment::WithGenericArgs(segment) => Some(\n                    segment\n                        .generic_args(db)\n                        .generic_args(db)\n                        .elements(db)\n                        .map(|arg| match arg {\n                            // There shouldn't be expressions like `identifier<T: some-trait-bound>` in the ABI\n                            arg @ cairo_lang_syntax::node::ast::GenericArg::Named(_) => bail!(\n                                \"Unexpected named generic found in ABI: {}. Contract ABI may be invalid\",\n                                arg.as_syntax_node().get_text(db)\n                            ),\n                            cairo_lang_syntax::node::ast::GenericArg::Unnamed(arg) => {\n                                match arg.value(db) {\n                                    Expr::Underscore(expr) => bail!(\n                                        \"Unexpected type with underscore generic placeholder found in ABI: {}. Contract ABI may be invalid\",\n                                        expr.as_syntax_node().get_text(db)\n                                    ),\n                                    expr => Ok(expr.as_syntax_node().get_text(db)),\n                                }\n                            }\n                        })\n                        .collect::<Result<Vec<_>>>(),\n                ),\n                PathSegment::Missing(_segment) => Some(Err(anyhow::anyhow!(\"Path segment missing\")))\n            })\n            .transpose()?\n            .with_context(|| format!(r#\"Invalid argument type, expected \"{expected_type}\", got array\"#))?;\n\n        // Check by string; A proper array type in ABI looks exactly like this\n        if !expected_type.contains(\"core::array::Array\") {\n            bail!(r#\"Expected \"{expected_type}\", got array\"#);\n        }\n\n        // Array should have exactly one type parameter. ABI is invalid otherwise\n        let [element_type] = &type_parameters_from_abi[..] else {\n            let parameters_punctuated = type_parameters_from_abi.into_iter().join(\", \");\n\n            bail!(\n                \"Expected exactly one generic parameter of Array type, got {parameters_punctuated}. Contract ABI may be invalid\",\n            );\n        };\n\n        let arguments = parsed_exprs\n            .into_iter()\n            .map(|arg| build_representation(arg, element_type, abi, db))\n            .collect::<Result<Vec<AllowedCalldataArgument>>>()?;\n\n        Ok(AllowedCalldataArgument::ArrayMacro(\n            CalldataArrayMacro::new(arguments),\n        ))\n    }\n}\n"
  },
  {
    "path": "crates/data-transformer/src/transformer/sierra_abi/mod.rs",
    "content": "use anyhow::{Result, bail};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse cairo_lang_syntax::node::ast::Expr;\nuse data_representation::AllowedCalldataArgument;\nuse starknet_rust::core::types::contract::AbiEntry;\n\nmod binary;\nmod complex_types;\npub(crate) mod data_representation;\nmod literals;\nmod macros;\npub(crate) mod parsing;\n\n/// A main trait that allows particular calldata types to be recognized and transformed\ntrait SupportedCalldataKind {\n    fn transform(\n        &self,\n        expected_type: &str,\n        abi: &[AbiEntry],\n        db: &SimpleParserDatabase,\n    ) -> Result<AllowedCalldataArgument>;\n}\n\n/// A main function that transforms expressions supported by the transformer\n/// to their corresponding serializable struct representations\npub(crate) fn build_representation(\n    expression: Expr<'_>,\n    expected_type: &str,\n    abi: &[AbiEntry],\n    db: &SimpleParserDatabase,\n) -> Result<AllowedCalldataArgument> {\n    match expression {\n        Expr::StructCtorCall(item) => item.transform(expected_type, abi, db),\n        Expr::Literal(item) => item.transform(expected_type, abi, db),\n        Expr::Unary(item) => item.transform(expected_type, abi, db),\n        Expr::ShortString(item) => item.transform(expected_type, abi, db),\n        Expr::String(item) => item.transform(expected_type, abi, db),\n        Expr::True(item) => item.transform(expected_type, abi, db),\n        Expr::False(item) => item.transform(expected_type, abi, db),\n        Expr::Path(item) => item.transform(expected_type, abi, db),\n        Expr::FunctionCall(item) => item.transform(expected_type, abi, db),\n        Expr::InlineMacro(item) => item.transform(expected_type, abi, db),\n        Expr::Tuple(item) => item.transform(expected_type, abi, db),\n        Expr::Binary(item) => item.transform(expected_type, abi, db),\n        Expr::Parenthesized(_)\n        | Expr::Block(_)\n        | Expr::Match(_)\n        | Expr::If(_)\n        | Expr::Loop(_)\n        | Expr::While(_)\n        | Expr::For(_)\n        | Expr::Closure(_)\n        | Expr::ErrorPropagate(_)\n        | Expr::FieldInitShorthand(_)\n        | Expr::Indexed(_)\n        | Expr::FixedSizeArray(_)\n        | Expr::Missing(_)\n        | Expr::Underscore(_) => {\n            bail!(r#\"Invalid argument type: unsupported expression for type \"{expected_type}\"\"#)\n        }\n    }\n}\n"
  },
  {
    "path": "crates/data-transformer/src/transformer/sierra_abi/parsing.rs",
    "content": "use anyhow::{Result, bail};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse cairo_lang_syntax::node::ast::WrappedTokenTree;\nuse cairo_lang_syntax::node::ast::{\n    ArgClause, ArgList, Expr, ExprInlineMacro, Modifier, PathSegment, PathSegment::Simple,\n};\nuse cairo_lang_syntax::node::{Terminal, TypedSyntaxNode};\nuse itertools::Itertools;\n\nfn modifier_syntax_token(item: &Modifier) -> &'static str {\n    match item {\n        Modifier::Ref(_) => \"ref\",\n        Modifier::Mut(_) => \"mut\",\n    }\n}\n\npub fn parse_argument_list<'a>(\n    arguments: &'a ArgList,\n    db: &'a SimpleParserDatabase,\n) -> Result<Vec<Expr<'a>>> {\n    let args_lists = arguments;\n    let arguments = arguments.elements(db);\n\n    if let Some(modifiers) = arguments\n        .map(|arg| arg.modifiers(db).elements(db))\n        .find(|mod_list| mod_list.len() != 0)\n    {\n        let modifiers = modifiers\n            .map(|modifier| modifier_syntax_token(&modifier))\n            .collect_vec();\n\n        match &modifiers[..] {\n            [] => unreachable!(),\n            [single] => bail!(r#\"\"{single}\" modifier is not allowed\"#),\n            [multiple @ .., last] => {\n                bail!(\n                    \"{} and {} modifiers are not allowed\",\n                    multiple.iter().join(\", \"),\n                    last\n                )\n            }\n        }\n    }\n\n    args_lists\n        .elements(db)\n        .map(|arg| match arg.arg_clause(db) {\n            ArgClause::Unnamed(expr) => Ok(expr.value(db)),\n            ArgClause::Named(_) => {\n                bail!(\"Named arguments are not allowed\")\n            }\n            ArgClause::FieldInitShorthand(_) => {\n                bail!(\"Field init shorthands are not allowed\")\n            }\n        })\n        .collect::<Result<Vec<Expr>>>()\n}\n\npub fn parse_inline_macro<'a>(\n    invocation: &'a ExprInlineMacro<'a>,\n    db: &'a SimpleParserDatabase,\n) -> Result<String> {\n    match invocation\n        .path(db)\n        .segments(db)\n        .elements(db)\n        .last()\n        .expect(\"Macro must have a name\")\n    {\n        Simple(simple) => {\n            let macro_name = simple.ident(db).text(db).to_string(db);\n            if macro_name != \"array\" {\n                bail!(r#\"Invalid macro name, expected \"array![]\", got \"{macro_name}\"\"#)\n            }\n        }\n        PathSegment::WithGenericArgs(_) => {\n            bail!(\"Invalid path specified: generic args in array![] macro not supported\")\n        }\n        PathSegment::Missing(_segment) => {\n            bail!(\"Path segment missing\")\n        }\n    }\n\n    match invocation.arguments(db).subtree(db) {\n        WrappedTokenTree::Bracketed(token_tree) => Ok(token_tree\n            .tokens(db)\n            .elements(db)\n            .map(|token| token.as_syntax_node().get_text(db))\n            .collect::<String>()),\n        WrappedTokenTree::Parenthesized(_) | WrappedTokenTree::Braced(_) => {\n            bail!(\"`array` macro supports only square brackets: array![]\")\n        }\n        WrappedTokenTree::Missing(_) => unreachable!(\n            \"If any type of parentheses is missing, then diagnostics have been reported and whole flow should have already been terminated.\"\n        ),\n    }\n}\n"
  },
  {
    "path": "crates/data-transformer/tests/data/data_transformer/Scarb.toml",
    "content": "[package]\nname = \"data_transformer_contract\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html\n\n[dependencies]\nstarknet = \"2.9.4\"\nalexandria_data_structures = \"0.4.0\"\n\n[dev-dependencies]\nsnforge_std = \"0.39.0\"\nassert_macros = \"2.9.4\"\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n\n[tool.scarb]\nallow-prebuilt-plugins = [\"snforge_std\"]\n"
  },
  {
    "path": "crates/data-transformer/tests/data/data_transformer/src/lib.cairo",
    "content": "#[derive(Serde, Drop)]\npub struct SimpleStruct {\n    a: felt252,\n}\n\n#[derive(Serde, Drop)]\npub struct NestedStructWithField {\n    a: SimpleStruct,\n    b: felt252,\n}\n\n#[derive(Serde, Drop)]\npub enum Enum {\n    One: (),\n    Two: u128,\n    Three: NestedStructWithField,\n}\n\n#[derive(Serde, Drop)]\npub struct ComplexStruct {\n    a: NestedStructWithField,\n    b: felt252,\n    c: u8,\n    d: i32,\n    e: Enum,\n    f: ByteArray,\n    g: Array<felt252>,\n    h: u256,\n    i: (i128, u128),\n}\n\n#[derive(Serde, Drop)]\npub struct BitArray {\n    bit: felt252,\n}\n\n#[starknet::interface]\npub trait IDataTransformer<TContractState> {\n    fn simple_fn(ref self: TContractState, a: felt252) -> felt252;\n    fn u256_fn(ref self: TContractState, a: u256) -> u256;\n    fn signed_fn(ref self: TContractState, a: i32) -> i32;\n    fn unsigned_fn(ref self: TContractState, a: u32) -> u32;\n    fn tuple_fn(ref self: TContractState, a: (felt252, u8, Enum)) -> (felt252, u8, Enum);\n    fn complex_fn(\n        ref self: TContractState,\n        arr: Array<Array<felt252>>,\n        one: u8,\n        two: i16,\n        three: ByteArray,\n        four: (felt252, u32),\n        five: bool,\n        six: u256,\n    );\n    fn simple_struct_fn(ref self: TContractState, a: SimpleStruct) -> SimpleStruct;\n    fn nested_struct_fn(\n        ref self: TContractState, a: NestedStructWithField,\n    ) -> NestedStructWithField;\n    fn enum_fn(ref self: TContractState, a: Enum) -> Enum;\n    fn complex_struct_fn(ref self: TContractState, a: ComplexStruct) -> ComplexStruct;\n    fn external_struct_fn(\n        ref self: TContractState, a: BitArray, b: alexandria_data_structures::bit_array::BitArray,\n    ) -> (BitArray, alexandria_data_structures::bit_array::BitArray);\n    fn span_fn(ref self: TContractState, a: Span<felt252>) -> Span<felt252>;\n    fn multiple_signed_fn(ref self: TContractState, a: i32, b: i8);\n    fn no_args_fn(ref self: TContractState);\n}\n\n#[starknet::contract]\nmod DataTransformer {\n    use core::starknet::ContractAddress;\n    use super::*;\n\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState, init_owner: ContractAddress) {}\n\n    #[abi(embed_v0)]\n    impl DataTransformerImpl of super::IDataTransformer<ContractState> {\n        fn simple_fn(ref self: ContractState, a: felt252) -> felt252 {\n            a\n        }\n        fn u256_fn(ref self: ContractState, a: u256) -> u256 {\n            a\n        }\n        fn signed_fn(ref self: ContractState, a: i32) -> i32 {\n            a\n        }\n        fn unsigned_fn(ref self: ContractState, a: u32) -> u32 {\n            a\n        }\n        fn tuple_fn(ref self: ContractState, a: (felt252, u8, Enum)) -> (felt252, u8, Enum) {\n            a\n        }\n        fn complex_fn(\n            ref self: ContractState,\n            arr: Array<Array<felt252>>,\n            one: u8,\n            two: i16,\n            three: ByteArray,\n            four: (felt252, u32),\n            five: bool,\n            six: u256,\n        ) {}\n        fn simple_struct_fn(ref self: ContractState, a: SimpleStruct) -> SimpleStruct {\n            a\n        }\n        fn nested_struct_fn(\n            ref self: ContractState, a: NestedStructWithField,\n        ) -> NestedStructWithField {\n            a\n        }\n        fn enum_fn(ref self: ContractState, a: Enum) -> Enum {\n            a\n        }\n        fn complex_struct_fn(ref self: ContractState, a: ComplexStruct) -> ComplexStruct {\n            a\n        }\n        fn external_struct_fn(\n            ref self: ContractState,\n            a: BitArray,\n            b: alexandria_data_structures::bit_array::BitArray,\n        ) -> (BitArray, alexandria_data_structures::bit_array::BitArray) {\n            (a, b)\n        }\n        fn span_fn(ref self: ContractState, a: Span<felt252>) -> Span<felt252> {\n            a\n        }\n        fn multiple_signed_fn(ref self: ContractState, a: i32, b: i8) {}\n        fn no_args_fn(ref self: ContractState) {}\n    }\n}\n\n#[starknet::contract]\nmod DataTransformerNoConstructor {\n    #[storage]\n    struct Storage {}\n}\n"
  },
  {
    "path": "crates/data-transformer/tests/integration/identity.rs",
    "content": "use crate::integration::get_abi;\nuse data_transformer::{reverse_transform_input, transform};\nuse primitive_types::U256;\nuse starknet_rust::core::utils::get_selector_from_name;\nuse test_case::test_case;\n\n#[test_case(\"1010101_u32\", \"unsigned_fn\"; \"u32\")]\n#[test_case(&format!(\"{}_u32\", u32::MAX), \"unsigned_fn\"; \"u32_max\")]\n#[test_case(\"0x64\", \"simple_fn\"; \"felt252\")]\n#[test_case(&format!(\"{}_u256\", U256::MAX), \"u256_fn\"; \"u256_max\")]\n#[test_case(\"8503_u256\", \"u256_fn\"; \"u256\")]\n#[test_case(\"-273_i32\", \"signed_fn\"; \"i32\")]\n#[test_case(\"-100_i32, -50_i8\", \"multiple_signed_fn\"; \"multiple_signed\")]\n#[test_case(\"(0x859, 1_u8, Enum::One)\", \"tuple_fn\"; \"tuple\")]\n#[test_case(\"(0x7b, 234_u8, Enum::Three(NestedStructWithField { a: SimpleStruct { a: 0x159 }, b: 0x1c8 }))\", \"tuple_fn\"; \"tuple_nested\")]\n#[test_case(\"array![array![0x2137, 0x420], array![0x420, 0x2137]], 8_u8, -270_i16, \\\"hello\\\", (0x2, 100_u32), true, 3_u256\", \"complex_fn\"; \"complex\")]\n#[test_case(\"SimpleStruct { a: 0x12 }\", \"simple_struct_fn\"; \"simple_struct\")]\n#[test_case(\"NestedStructWithField { a: SimpleStruct { a: 0x24 }, b: 0x60 }\", \"nested_struct_fn\"; \"nested_struct\")]\n#[test_case(\"array![0x1, 0x2, 0x3].span()\", \"span_fn\"; \"span\")]\n#[test_case(\"array![].span()\", \"span_fn\"; \"span_empty\")]\n#[test_case(\"Enum::One\", \"enum_fn\"; \"enum_no_data\")]\n#[test_case(\"Enum::Two(128_u128)\", \"enum_fn\"; \"enum_tuple\")]\n#[test_case(\"Enum::Three(NestedStructWithField { a: SimpleStruct { a: 0x7b }, b: 0xea })\", \"enum_fn\"; \"enum_nested\")]\n#[test_case(r#\"ComplexStruct { a: NestedStructWithField { a: SimpleStruct { a: 0x1 }, b: 0x2 }, b: 0x3, c: 4_u8, d: 5_i32, e: Enum::Two(6_u128), f: \"seven\", g: array![0x8, 0x9], h: 10_u256, i: (11_i128, 12_u128) }\"#, \"complex_struct_fn\"; \"complex_struct\")]\n#[test_case(\"\", \"no_args_fn\"; \"no_arguments_function\")]\n#[tokio::test]\nasync fn test_check_for_identity(calldata: &str, selector: &str) {\n    let abi = get_abi().await;\n    let selector = get_selector_from_name(selector).unwrap();\n\n    let felts = transform(calldata, &abi, &selector).unwrap();\n\n    let result = reverse_transform_input(&felts, &abi, &selector).unwrap();\n\n    assert_eq!(result, calldata);\n}\n"
  },
  {
    "path": "crates/data-transformer/tests/integration/mod.rs",
    "content": "use starknet_rust::core::types::contract::AbiEntry;\nuse starknet_rust::core::types::{BlockId, BlockTag, ContractClass};\nuse starknet_rust::providers::jsonrpc::HttpTransport;\nuse starknet_rust::providers::{JsonRpcClient, Provider};\nuse starknet_types_core::felt::Felt;\nuse tokio::sync::OnceCell;\nuse url::Url;\n\nmod identity;\nmod reverse_transformer;\nmod transformer;\n\n/// Class hash of the declared `DataTransformer` contract from `/tests/data/data_transformer`\nconst TEST_CLASS_HASH: Felt =\n    Felt::from_hex_unchecked(\"0x071b56ab58087fd00a0b4ddcdfecb727ae11d1674a4a0f5af7c30f9bb2f7150e\");\n\n/// Class hash of the declared `DataTransformerNoConstructor` contract from `/tests/data/data_transformer`\nconst NO_CONSTRUCTOR_CLASS_HASH: Felt =\n    Felt::from_hex_unchecked(\"0x051d0347d3bfcd87eea5175994f55158a24b003370d8c83d2c430f663eceb08d\");\n\nstatic CLASS: OnceCell<ContractClass> = OnceCell::const_new();\n\nasync fn init_class(class_hash: Felt) -> ContractClass {\n    let client = JsonRpcClient::new(HttpTransport::new(\n        Url::parse(\"http://188.34.188.184:7070/rpc/v0_10\").unwrap(),\n    ));\n\n    client\n        .get_class(BlockId::Tag(BlockTag::Latest), class_hash)\n        .await\n        .unwrap()\n}\n\nasync fn get_abi() -> Vec<AbiEntry> {\n    let class = CLASS.get_or_init(|| init_class(TEST_CLASS_HASH)).await;\n    let ContractClass::Sierra(sierra_class) = class else {\n        panic!(\"Expected Sierra class, but got legacy Sierra class\")\n    };\n\n    serde_json::from_str(sierra_class.abi.as_str()).unwrap()\n}\n"
  },
  {
    "path": "crates/data-transformer/tests/integration/reverse_transformer.rs",
    "content": "use crate::integration::{NO_CONSTRUCTOR_CLASS_HASH, get_abi, init_class};\nuse data_transformer::{reverse_transform_input, reverse_transform_output};\nuse itertools::Itertools;\nuse primitive_types::U256;\nuse starknet_rust::core::types::ContractClass;\nuse starknet_rust::core::types::contract::AbiEntry;\nuse starknet_rust::core::utils::get_selector_from_name;\nuse starknet_types_core::felt::Felt;\n\nasync fn assert_reverse_transformation(\n    input: &[Felt],\n    selector: &str,\n    expected_input: &str,\n    expected_output: Option<&str>,\n) {\n    let abi = get_abi().await;\n    let selector = get_selector_from_name(selector).unwrap();\n    let result = reverse_transform_input(input, &abi, &selector).unwrap();\n    assert_eq!(result, expected_input);\n\n    let result = reverse_transform_output(input, &abi, &selector).unwrap();\n\n    if let Some(expected_output) = expected_output {\n        assert_eq!(result, expected_output);\n    } else {\n        // tests are written in a way that in most case the output is the same as the input\n        // so passing None means we expect the output to be the same as the input\n        assert_eq!(result, expected_input);\n    }\n}\n\n#[tokio::test]\nasync fn test_unsigned() {\n    assert_reverse_transformation(\n        &[Felt::from(1_010_101_u32)],\n        \"unsigned_fn\",\n        \"1010101_u32\",\n        None,\n    )\n    .await;\n}\n\n#[tokio::test]\nasync fn test_felt() {\n    assert_reverse_transformation(\n        &[Felt::from_hex_unchecked(\"0x64\")],\n        \"simple_fn\",\n        \"0x64\",\n        None,\n    )\n    .await;\n}\n\n#[tokio::test]\nasync fn test_u256_max() {\n    assert_reverse_transformation(\n        &[\n            Felt::from_hex_unchecked(\"0xffffffffffffffffffffffffffffffff\"),\n            Felt::from_hex_unchecked(\"0xffffffffffffffffffffffffffffffff\"),\n        ],\n        \"u256_fn\",\n        &format!(\"{}_u256\", U256::MAX),\n        None,\n    )\n    .await;\n}\n\n#[tokio::test]\nasync fn test_u256() {\n    assert_reverse_transformation(\n        &[\n            Felt::from_hex_unchecked(\"0x2137\"),\n            Felt::from_hex_unchecked(\"0x0\"),\n        ],\n        \"u256_fn\",\n        \"8503_u256\",\n        None,\n    )\n    .await;\n}\n\n#[tokio::test]\nasync fn test_signed() {\n    assert_reverse_transformation(&[Felt::from(-273i16)], \"signed_fn\", \"-273_i32\", None).await;\n}\n\n#[tokio::test]\nasync fn test_u32_max() {\n    assert_reverse_transformation(\n        &[Felt::from(u32::MAX)],\n        \"unsigned_fn\",\n        &format!(\"{}_u32\", u32::MAX),\n        None,\n    )\n    .await;\n}\n\n#[tokio::test]\nasync fn test_tuple_enum() {\n    assert_reverse_transformation(\n        &[\n            Felt::from_hex_unchecked(\"0x859\"),\n            Felt::from_hex_unchecked(\"0x1\"),\n            Felt::from_hex_unchecked(\"0x0\"),\n        ],\n        \"tuple_fn\",\n        \"(0x859, 1_u8, Enum::One)\",\n        None,\n    )\n    .await;\n}\n\n#[tokio::test]\nasync fn test_tuple_enum_nested_struct() {\n    assert_reverse_transformation(\n        &[\n            Felt::from(123),\n            Felt::from(234),\n            Felt::from(2),\n            Felt::from(345),\n            Felt::from(456),\n        ],\n        \"tuple_fn\",\n        \"(0x7b, 234_u8, Enum::Three(NestedStructWithField { a: SimpleStruct { a: 0x159 }, b: 0x1c8 }))\",\n        None\n    )\n    .await;\n}\n\n#[tokio::test]\nasync fn test_happy_case_complex_function_cairo_expressions_input() {\n    let max_u256 = U256::max_value().to_string();\n    let expected = format!(\n        \"array![array![0x2137, 0x420], array![0x420, 0x2137]], 8_u8, -270_i16, \\\"some_string\\\", (0x73686f727420737472696e67, 100_u32), true, {max_u256}_u256\"\n    );\n\n    let input = [\n        \"0x2\",\n        \"0x2\",\n        \"0x2137\",\n        \"0x420\",\n        \"0x2\",\n        \"0x420\",\n        \"0x2137\",\n        \"0x8\",\n        \"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffef3\",\n        \"0x0\",\n        \"0x736f6d655f737472696e67\",\n        \"0xb\",\n        \"0x73686f727420737472696e67\",\n        \"0x64\",\n        \"0x1\",\n        \"0xffffffffffffffffffffffffffffffff\",\n        \"0xffffffffffffffffffffffffffffffff\",\n    ]\n    .into_iter()\n    .map(Felt::from_hex_unchecked)\n    .collect_vec();\n\n    assert_reverse_transformation(&input, \"complex_fn\", &expected, Some(\"\")).await;\n}\n\n#[tokio::test]\nasync fn test_simple_struct() {\n    assert_reverse_transformation(\n        &[Felt::from_hex_unchecked(\"0x12\")],\n        \"simple_struct_fn\",\n        \"SimpleStruct { a: 0x12 }\",\n        None,\n    )\n    .await;\n}\n\n#[tokio::test]\nasync fn test_nested_struct() {\n    assert_reverse_transformation(\n        &[\n            Felt::from_hex_unchecked(\"0x24\"),\n            Felt::from_hex_unchecked(\"0x60\"),\n        ],\n        \"nested_struct_fn\",\n        \"NestedStructWithField { a: SimpleStruct { a: 0x24 }, b: 0x60 }\",\n        None,\n    )\n    .await;\n}\n\n#[tokio::test]\nasync fn test_span() {\n    assert_reverse_transformation(\n        &[\n            Felt::from_hex_unchecked(\"0x3\"),\n            Felt::from_hex_unchecked(\"0x1\"),\n            Felt::from_hex_unchecked(\"0x2\"),\n            Felt::from_hex_unchecked(\"0x3\"),\n        ],\n        \"span_fn\",\n        \"array![0x1, 0x2, 0x3].span()\",\n        None,\n    )\n    .await;\n}\n\n#[tokio::test]\nasync fn test_span_empty() {\n    assert_reverse_transformation(&[Felt::ZERO], \"span_fn\", \"array![].span()\", None).await;\n}\n\n#[tokio::test]\nasync fn test_enum() {\n    assert_reverse_transformation(&[Felt::ZERO], \"enum_fn\", \"Enum::One\", None).await;\n}\n\n#[tokio::test]\nasync fn test_enum_tuple() {\n    assert_reverse_transformation(\n        &[\n            Felt::from_hex_unchecked(\"0x1\"),\n            Felt::from_hex_unchecked(\"0x80\"),\n        ],\n        \"enum_fn\",\n        \"Enum::Two(128_u128)\",\n        None,\n    )\n    .await;\n}\n\n#[tokio::test]\nasync fn test_enum_nested_struct() {\n    assert_reverse_transformation(\n        &[\n            Felt::from_hex_unchecked(\"0x2\"),\n            Felt::from_hex_unchecked(\"0x7b\"),\n            Felt::from_hex_unchecked(\"0xea\"),\n        ],\n        \"enum_fn\",\n        \"Enum::Three(NestedStructWithField { a: SimpleStruct { a: 0x7b }, b: 0xea })\",\n        None,\n    )\n    .await;\n}\n\n#[tokio::test]\nasync fn test_complex_struct() {\n    let expected = r#\"ComplexStruct { a: NestedStructWithField { a: SimpleStruct { a: 0x1 }, b: 0x2 }, b: 0x3, c: 4_u8, d: 5_i32, e: Enum::Two(6_u128), f: \"seven\", g: array![0x8, 0x9], h: 10_u256, i: (11_i128, 12_u128) }\"#;\n\n    let input = [\n        // a: NestedStruct\n        Felt::from_hex_unchecked(\"0x1\"),\n        Felt::from_hex_unchecked(\"0x2\"),\n        // b: felt252\n        Felt::from_hex_unchecked(\"0x3\"),\n        // c: u8\n        Felt::from_hex_unchecked(\"0x4\"),\n        // d: i32\n        Felt::from_hex_unchecked(\"0x5\"),\n        // e: Enum\n        Felt::from_hex_unchecked(\"0x1\"),\n        Felt::from_hex_unchecked(\"0x6\"),\n        // f: ByteArray\n        Felt::from_hex_unchecked(\"0x0\"),\n        Felt::from_hex_unchecked(\"0x736576656e\"),\n        Felt::from_hex_unchecked(\"0x5\"),\n        // g: Array\n        Felt::from_hex_unchecked(\"0x2\"),\n        Felt::from_hex_unchecked(\"0x8\"),\n        Felt::from_hex_unchecked(\"0x9\"),\n        // h: u256\n        Felt::from_hex_unchecked(\"0xa\"),\n        Felt::from_hex_unchecked(\"0x0\"),\n        // i: (i128, u128)\n        Felt::from_hex_unchecked(\"0xb\"),\n        Felt::from_hex_unchecked(\"0xc\"),\n    ];\n\n    assert_reverse_transformation(&input, \"complex_struct_fn\", expected, None).await;\n}\n\n#[tokio::test]\nasync fn test_external_type() {\n    let input = [\n        Felt::from_hex_unchecked(\"0x17\"),\n        Felt::from_hex_unchecked(\"0x1\"),\n        Felt::from_hex_unchecked(\"0x0\"),\n        Felt::from_hex_unchecked(\"0x1\"),\n        Felt::from_hex_unchecked(\"0x2\"),\n        Felt::from_hex_unchecked(\"0x3\"),\n    ];\n\n    let expected = \"BitArray { bit: 0x17 }, BitArray { data: array![CairoBytes31(0x0)], current: 0x1, read_pos: 2_u32, write_pos: 3_u32 }\";\n\n    assert_reverse_transformation(\n        &input,\n        \"external_struct_fn\",\n        expected,\n        Some(&format!(\"({expected})\")),\n    )\n    .await;\n}\n\n#[tokio::test]\nasync fn test_constructor() {\n    assert_reverse_transformation(\n        &[Felt::from_hex_unchecked(\"0x123\")],\n        \"constructor\",\n        \"ContractAddress(0x123)\",\n        Some(\"\"),\n    )\n    .await;\n}\n\n#[tokio::test]\nasync fn test_multiple_signed() {\n    assert_reverse_transformation(\n        &[Felt::from(124), Felt::from(97)],\n        \"multiple_signed_fn\",\n        \"124_i32, 97_i8\",\n        Some(\"\"),\n    )\n    .await;\n}\n\n#[tokio::test]\nasync fn test_multiple_signed_min() {\n    assert_reverse_transformation(\n        &[Felt::from(i32::MIN), Felt::from(i8::MIN)],\n        \"multiple_signed_fn\",\n        \"-2147483648_i32, -128_i8\",\n        Some(\"\"),\n    )\n    .await;\n}\n\n#[tokio::test]\nasync fn test_multiple_signed_max() {\n    assert_reverse_transformation(\n        &[Felt::from(i32::MAX), Felt::from(i8::MAX)],\n        \"multiple_signed_fn\",\n        \"2147483647_i32, 127_i8\",\n        Some(\"\"),\n    )\n    .await;\n}\n\n#[tokio::test]\nasync fn test_no_argument_function() {\n    assert_reverse_transformation(&[], \"no_args_fn\", \"\", None).await;\n}\n\n#[tokio::test]\nasync fn test_implicit_contract_constructor() {\n    let class = init_class(NO_CONSTRUCTOR_CLASS_HASH).await;\n    let ContractClass::Sierra(sierra_class) = class else {\n        panic!(\"Expected Sierra class, but got legacy Sierra class\")\n    };\n\n    let abi: Vec<AbiEntry> = serde_json::from_str(sierra_class.abi.as_str()).unwrap();\n\n    let result =\n        reverse_transform_input(&[], &abi, &get_selector_from_name(\"constructor\").unwrap())\n            .unwrap();\n\n    let expected_output = \"\";\n\n    assert_eq!(result, expected_output);\n}\n"
  },
  {
    "path": "crates/data-transformer/tests/integration/transformer.rs",
    "content": "use crate::integration::{NO_CONSTRUCTOR_CLASS_HASH, get_abi, init_class};\nuse core::fmt;\nuse data_transformer::transform;\nuse indoc::indoc;\nuse itertools::Itertools;\nuse primitive_types::U256;\nuse starknet_rust::core::types::contract::AbiEntry;\nuse starknet_rust::core::types::{BlockId, BlockTag, ContractClass};\nuse starknet_rust::core::utils::get_selector_from_name;\nuse starknet_rust::providers::jsonrpc::HttpTransport;\nuse starknet_rust::providers::{JsonRpcClient, Provider};\nuse starknet_types_core::felt::Felt;\nuse std::ops::Not;\nuse test_case::test_case;\n\ntrait Contains<T: fmt::Debug + Eq> {\n    fn assert_contains(&self, value: T);\n}\n\nimpl Contains<&str> for anyhow::Error {\n    fn assert_contains(&self, value: &str) {\n        self.chain()\n            .any(|err| err.to_string().contains(value))\n            .not()\n            .then(|| panic!(\"{value:?}\\nnot found in\\n{self:#?}\"));\n    }\n}\n\nasync fn run_transformer(input: &str, selector: &str) -> anyhow::Result<Vec<Felt>> {\n    let abi = get_abi().await;\n\n    transform(\n        input,\n        &abi,\n        &get_selector_from_name(selector).expect(\"should be valid selector\"),\n    )\n}\n\n#[tokio::test]\nasync fn test_function_not_found() {\n    let selector = \"nonexistent_fn\";\n    let result = run_transformer(\"('some_felt',)\", selector).await;\n\n    result.unwrap_err().assert_contains(\n        format!(\n            r#\"Function with selector \"{:#x}\" not found in ABI of the contract\"#,\n            get_selector_from_name(selector).unwrap()\n        )\n        .as_str(),\n    );\n}\n\n#[tokio::test]\nasync fn test_happy_case_numeric_type_suffix() {\n    let result = run_transformer(\"1010101_u32\", \"unsigned_fn\").await.unwrap();\n\n    let expected_output = [Felt::from(1_010_101_u32)];\n\n    assert_eq!(result, expected_output);\n}\n\n#[tokio::test]\nasync fn test_invalid_numeric_type_suffix() {\n    let result = run_transformer(\"1_u10\", \"simple_fn\").await;\n\n    result\n        .unwrap_err()\n        .assert_contains(r#\"Failed to parse value \"1\" into type \"u10\": unsupported type u10\"#);\n}\n\n#[tokio::test]\nasync fn test_invalid_cairo_expression() {\n    let result = run_transformer(\"(some_invalid_expression:,)\", \"simple_fn\").await;\n\n    result\n        .unwrap_err()\n        .assert_contains(\"Invalid Cairo expression found in input calldata\");\n}\n\n#[tokio::test]\nasync fn test_invalid_argument_number() {\n    let result = run_transformer(\"0x123, 'some_obsolete_argument', 10\", \"simple_fn\").await;\n\n    result\n        .unwrap_err()\n        .assert_contains(\"Invalid number of arguments: passed 3, expected 1\");\n}\n\n#[tokio::test]\nasync fn test_happy_case_simple_cairo_expressions_input() {\n    let result = run_transformer(\"100\", \"simple_fn\").await.unwrap();\n\n    let expected_output = [Felt::from_hex_unchecked(\"0x64\")];\n\n    assert_eq!(result, expected_output);\n}\n\n#[tokio::test]\nasync fn test_happy_case_u256_function_cairo_expressions_input_decimal() {\n    let result = run_transformer(&format!(\"{}_u256\", U256::MAX), \"u256_fn\")\n        .await\n        .unwrap();\n\n    let expected_output = [\n        Felt::from_hex_unchecked(\"0xffffffffffffffffffffffffffffffff\"),\n        Felt::from_hex_unchecked(\"0xffffffffffffffffffffffffffffffff\"),\n    ];\n\n    assert_eq!(result, expected_output);\n}\n\n#[tokio::test]\nasync fn test_happy_case_u256_function_cairo_expressions_input_hex() {\n    let result = run_transformer(\"0x2137_u256\", \"u256_fn\").await.unwrap();\n\n    let expected_output = [\n        Felt::from_hex_unchecked(\"0x2137\"),\n        Felt::from_hex_unchecked(\"0x0\"),\n    ];\n\n    assert_eq!(result, expected_output);\n}\n\n#[tokio::test]\nasync fn test_happy_case_signed_function_cairo_expressions_input() {\n    let result = run_transformer(\"-273\", \"signed_fn\").await.unwrap();\n\n    let expected_output = [Felt::from(-273i16)];\n\n    assert_eq!(result, expected_output);\n}\n\n// Problem: Although transformer fails to process the given input as `i32`, it then succeeds to interpret it as `felt252`\n// Overflow checks will not work for functions having the same serialized and Cairo-like calldata length.\n// User must provide a type suffix or get the invoke-time error\n// Issue #2559\n#[ignore = \"Impossible to pass with the current solution\"]\n#[tokio::test]\nasync fn test_signed_fn_overflow() {\n    let result = run_transformer(&format!(\"({},)\", i32::MAX as u64 + 1), \"signed_fn\").await;\n\n    result\n        .unwrap_err()\n        .assert_contains(r#\"Failed to parse value \"2147483648\" into type \"i32\"\"#);\n}\n\n#[tokio::test]\nasync fn test_signed_fn_overflow_with_type_suffix() {\n    let result = run_transformer(&format!(\"{}_i32\", i32::MAX as u64 + 1), \"signed_fn\").await;\n\n    result\n        .unwrap_err()\n        .assert_contains(r#\"Failed to parse value \"2147483648\" into type \"i32\"\"#);\n}\n\n#[tokio::test]\nasync fn test_happy_case_unsigned_function_cairo_expressions_input() {\n    let result = run_transformer(&format!(\"{}\", u32::MAX), \"unsigned_fn\")\n        .await\n        .unwrap();\n\n    let expected_output = [Felt::from(u32::MAX)];\n\n    assert_eq!(result, expected_output);\n}\n\n#[tokio::test]\nasync fn test_happy_case_tuple_function_cairo_expression_input() {\n    let result = run_transformer(\"(2137_felt252, 1_u8, Enum::One)\", \"tuple_fn\")\n        .await\n        .unwrap();\n\n    let expected_output = [\n        Felt::from_hex_unchecked(\"0x859\"),\n        Felt::from_hex_unchecked(\"0x1\"),\n        Felt::from_hex_unchecked(\"0x0\"),\n    ];\n\n    assert_eq!(result, expected_output);\n}\n\n#[tokio::test]\nasync fn test_happy_case_tuple_function_with_nested_struct_cairo_expression_input() {\n    let result = run_transformer(\n        \"(123, 234, Enum::Three(NestedStructWithField {a: SimpleStruct {a: 345}, b: 456 }))\",\n        \"tuple_fn\",\n    )\n    .await\n    .unwrap();\n\n    let expected_output = [123, 234, 2, 345, 456]\n        .into_iter()\n        .map(Felt::from)\n        .collect_vec();\n\n    assert_eq!(result, expected_output);\n}\n\n#[tokio::test]\nasync fn test_happy_case_complex_function_cairo_expressions_input() {\n    let max_u256 = U256::max_value().to_string();\n\n    let input = format!(\n        \"array![array![0x2137, 0x420], array![0x420, 0x2137]],\n        8_u8,\n        -270,\n        \\\"some_string\\\",\n        ('short string', 100),\n        true,\n        {max_u256}\",\n    );\n\n    let result = run_transformer(&input, \"complex_fn\").await.unwrap();\n\n    // Manually serialized in Cairo\n    let expected_output = [\n        \"0x2\",\n        \"0x2\",\n        \"0x2137\",\n        \"0x420\",\n        \"0x2\",\n        \"0x420\",\n        \"0x2137\",\n        \"0x8\",\n        \"0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffef3\",\n        \"0x0\",\n        \"0x736f6d655f737472696e67\",\n        \"0xb\",\n        \"0x73686f727420737472696e67\",\n        \"0x64\",\n        \"0x1\",\n        \"0xffffffffffffffffffffffffffffffff\",\n        \"0xffffffffffffffffffffffffffffffff\",\n    ]\n    .into_iter()\n    .map(Felt::from_hex_unchecked)\n    .collect_vec();\n\n    assert_eq!(result, expected_output);\n}\n\n#[tokio::test]\nasync fn test_happy_case_simple_struct_function_cairo_expression_input() {\n    let result = run_transformer(\"SimpleStruct {a: 0x12}\", \"simple_struct_fn\")\n        .await\n        .unwrap();\n\n    let expected_output = [Felt::from_hex_unchecked(\"0x12\")];\n\n    assert_eq!(result, expected_output);\n}\n\n#[tokio::test]\nasync fn test_simple_struct_function_invalid_struct_argument() {\n    let result = run_transformer(r#\"SimpleStruct {a: \"string\"}\"#, \"simple_struct_fn\").await;\n\n    result\n        .unwrap_err()\n        .assert_contains(r#\"Failed to parse value \"string\" into type \"core::felt252\"\"#);\n}\n\n#[tokio::test]\nasync fn test_simple_struct_function_invalid_struct_name() {\n    let result = run_transformer(\"InvalidStructName {a: 0x10}\", \"simple_struct_fn\").await;\n\n    result\n        .unwrap_err()\n        .assert_contains(r#\"Invalid argument type, expected \"data_transformer_contract::SimpleStruct\", got \"InvalidStructName\"\"#);\n}\n\n#[test_case(r#\"\"string_argument\"\"#, r#\"Failed to parse value \"string_argument\" into type \"data_transformer_contract::SimpleStruct\"\"# ; \"string\")]\n#[test_case(\"'shortstring'\", r#\"Failed to parse value \"shortstring\" into type \"data_transformer_contract::SimpleStruct\"\"# ; \"shortstring\")]\n#[test_case(\"true\", r#\"Failed to parse value \"true\" into type \"data_transformer_contract::SimpleStruct\"\"# ; \"bool\")]\n#[test_case(\"array![0x1, 2, 0x3, 04]\", r#\"Invalid argument type, expected \"data_transformer_contract::SimpleStruct\", got array\"# ; \"array\")]\n#[test_case(\"(1, array![2], 0x3)\", r#\"Invalid argument type, expected \"data_transformer_contract::SimpleStruct\", got tuple\"# ; \"tuple\")]\n#[test_case(\"My::Enum\", r#\"Invalid argument type, expected \"data_transformer_contract::SimpleStruct\", got \"My\"\"# ; \"enum_variant\")]\n#[test_case(\"core::path::My::Enum(10)\", r#\"Invalid argument type, expected \"data_transformer_contract::SimpleStruct\", got \"core::path::My\"\"# ; \"enum_variant_with_path\")]\n#[tokio::test]\nasync fn test_simple_struct_function_cairo_expression_input_invalid_argument_type(\n    input: &str,\n    error_message: &str,\n) {\n    let result = run_transformer(input, \"simple_struct_fn\").await;\n\n    result.unwrap_err().assert_contains(error_message);\n}\n\n#[tokio::test]\nasync fn test_happy_case_nested_struct_function_cairo_expression_input() {\n    let result = run_transformer(\n        \"NestedStructWithField { a: SimpleStruct { a: 0x24 }, b: 96 }\",\n        \"nested_struct_fn\",\n    )\n    .await\n    .unwrap();\n\n    let expected_output = [\n        Felt::from_hex_unchecked(\"0x24\"),\n        Felt::from_hex_unchecked(\"0x60\"),\n    ];\n\n    assert_eq!(result, expected_output);\n}\n\n#[tokio::test]\nasync fn test_happy_case_span_function_cairo_expression_input() {\n    let result = run_transformer(\"array![1, 2, 3].span()\", \"span_fn\")\n        .await\n        .unwrap();\n\n    let expected_output = [\n        Felt::from_hex_unchecked(\"0x3\"),\n        Felt::from_hex_unchecked(\"0x1\"),\n        Felt::from_hex_unchecked(\"0x2\"),\n        Felt::from_hex_unchecked(\"0x3\"),\n    ];\n\n    assert_eq!(result, expected_output);\n}\n\n#[tokio::test]\nasync fn test_happy_case_empty_span_function_cairo_expression_input() {\n    let result = run_transformer(\"array![].span()\", \"span_fn\").await.unwrap();\n\n    let expected_output = [Felt::from_hex_unchecked(\"0x0\")];\n\n    assert_eq!(result, expected_output);\n}\n\n#[tokio::test]\nasync fn test_span_function_array_input() {\n    let result = run_transformer(\"array![1, 2, 3]\", \"span_fn\").await;\n\n    result\n        .unwrap_err()\n        .assert_contains(r#\"Expected \"core::array::Span::<core::felt252>\", got array\"#);\n}\n\n#[tokio::test]\nasync fn test_span_function_unsupported_method() {\n    let result = run_transformer(\"array![1, 2, 3].into()\", \"span_fn\").await;\n\n    result\n        .unwrap_err()\n        .assert_contains(r#\"Invalid function name, expected \"span\", got \"into\"\"#);\n}\n\n#[tokio::test]\nasync fn test_span_function_unsupported_operator() {\n    let result = run_transformer(\"array![1, 2, 3]*span()\", \"span_fn\").await;\n\n    result\n        .unwrap_err()\n        .assert_contains(r#\"Invalid operator, expected \".\", got \"*\"\"#);\n}\n\n#[tokio::test]\nasync fn test_span_function_unsupported_right_hand_side() {\n    let result = run_transformer(\"array![1, 2, 3].span\", \"span_fn\").await;\n\n    result\n        .unwrap_err()\n        .assert_contains(r#\"Only calling \".span()\" on \"array![]\" is supported, got \"span\"\"#);\n}\n\n#[tokio::test]\nasync fn test_span_function_unsupported_left_hand_side() {\n    let result = run_transformer(\"(1, 2, 3).span\", \"span_fn\").await;\n\n    result.unwrap_err().assert_contains(\n        r#\"Only \"array![]\" is supported as left-hand side of \".\" operator, got \"(1, 2, 3)\"\"#,\n    );\n}\n\n#[tokio::test]\nasync fn test_happy_case_enum_function_empty_variant_cairo_expression_input() {\n    let result = run_transformer(\"Enum::One\", \"enum_fn\").await.unwrap();\n\n    let expected_output = [Felt::ZERO];\n\n    assert_eq!(result, expected_output);\n}\n\n#[tokio::test]\nasync fn test_happy_case_enum_function_one_argument_variant_cairo_expression_input()\n-> anyhow::Result<()> {\n    let abi = get_abi().await;\n\n    let result = transform(\"Enum::Two(128)\", &abi, &get_selector_from_name(\"enum_fn\")?)?;\n\n    let expected_output = [\n        Felt::from_hex_unchecked(\"0x1\"),\n        Felt::from_hex_unchecked(\"0x80\"),\n    ];\n\n    assert_eq!(result, expected_output);\n\n    Ok(())\n}\n\n#[tokio::test]\nasync fn test_happy_case_enum_function_nested_struct_variant_cairo_expression_input() {\n    let result = run_transformer(\n        \"Enum::Three(NestedStructWithField { a: SimpleStruct { a: 123 }, b: 234 })\",\n        \"enum_fn\",\n    )\n    .await\n    .unwrap();\n\n    let expected_output = [\n        Felt::from_hex_unchecked(\"0x2\"),\n        Felt::from_hex_unchecked(\"0x7b\"),\n        Felt::from_hex_unchecked(\"0xea\"),\n    ];\n\n    assert_eq!(result, expected_output);\n}\n\n#[tokio::test]\nasync fn test_enum_function_invalid_variant_cairo_expression_input() {\n    let result = run_transformer(\"Enum::InvalidVariant\", \"enum_fn\").await;\n\n    result\n        .unwrap_err()\n        .assert_contains(r#\"Couldn't find variant \"InvalidVariant\" in enum \"Enum\"\"#);\n}\n\n#[tokio::test]\nasync fn test_happy_case_complex_struct_function_cairo_expression_input() {\n    let data = indoc!(\n        r#\"\n        ComplexStruct {\n            a: NestedStructWithField {\n                a: SimpleStruct { a: 1 },\n                b: 2\n            },\n            b: 3, c: 4, d: 5,\n            e: Enum::Two(6),\n            f: \"seven\",\n            g: array![8, 9],\n            h: 10,\n            i: (11, 12)\n        }\n        \"#\n    );\n\n    let result = run_transformer(data, \"complex_struct_fn\").await.unwrap();\n\n    let expected_output = [\n        // a: NestedStruct\n        Felt::from_hex_unchecked(\"0x1\"),\n        Felt::from_hex_unchecked(\"0x2\"),\n        // b: felt252\n        Felt::from_hex_unchecked(\"0x3\"),\n        // c: u8\n        Felt::from_hex_unchecked(\"0x4\"),\n        // d: i32\n        Felt::from_hex_unchecked(\"0x5\"),\n        // e: Enum\n        Felt::from_hex_unchecked(\"0x1\"),\n        Felt::from_hex_unchecked(\"0x6\"),\n        // f: ByteArray\n        Felt::from_hex_unchecked(\"0x0\"),\n        Felt::from_hex_unchecked(\"0x736576656e\"),\n        Felt::from_hex_unchecked(\"0x5\"),\n        // g: Array\n        Felt::from_hex_unchecked(\"0x2\"),\n        Felt::from_hex_unchecked(\"0x8\"),\n        Felt::from_hex_unchecked(\"0x9\"),\n        // h: u256\n        Felt::from_hex_unchecked(\"0xa\"),\n        Felt::from_hex_unchecked(\"0x0\"),\n        // i: (i128, u128)\n        Felt::from_hex_unchecked(\"0xb\"),\n        Felt::from_hex_unchecked(\"0xc\"),\n    ];\n\n    assert_eq!(result, expected_output);\n}\n\n#[tokio::test]\nasync fn test_external_struct_function_ambiguous_struct_name_cairo_expression_input() {\n    let input = \"\n        BitArray { bit: 23 }, \\\n        BitArray { data: array![0], current: 1, read_pos: 2, write_pos: 3 }\n        \";\n\n    let result = run_transformer(input, \"external_struct_fn\").await;\n\n    result.unwrap_err().assert_contains(\n        r#\"Found more than one struct \"BitArray\" in ABI, please specify a full path to the item\"#,\n    );\n}\n\n#[tokio::test]\nasync fn test_happy_case_external_struct_function_cairo_expression_input() {\n    let input = indoc!(\n            \"\n            data_transformer_contract::BitArray { bit: 23 }, \\\n            alexandria_data_structures::bit_array::BitArray { data: array![0], current: 1, read_pos: 2, write_pos: 3 }\n            \"\n        );\n\n    let result = run_transformer(input, \"external_struct_fn\").await.unwrap();\n\n    let expected_output = [\n        Felt::from_hex_unchecked(\"0x17\"),\n        Felt::from_hex_unchecked(\"0x1\"),\n        Felt::from_hex_unchecked(\"0x0\"),\n        Felt::from_hex_unchecked(\"0x1\"),\n        Felt::from_hex_unchecked(\"0x2\"),\n        Felt::from_hex_unchecked(\"0x3\"),\n    ];\n\n    assert_eq!(result, expected_output);\n}\n\n#[tokio::test]\nasync fn test_external_struct_function_invalid_path_to_external_struct() {\n    let input = indoc!(\n        \"\n        something::BitArray { bit: 23 }, \\\n        BitArray { data: array![0], current: 1, read_pos: 2, write_pos: 3 }\n        \"\n    );\n\n    let result = run_transformer(input, \"external_struct_fn\").await;\n\n    result\n        .unwrap_err()\n        .assert_contains(r#\"Struct \"something::BitArray\" not found in ABI\"#);\n}\n\n#[tokio::test]\nasync fn test_happy_case_contract_constructor() {\n    let result = run_transformer(\"0x123\", \"constructor\").await.unwrap();\n\n    let expected_output = [Felt::from_hex_unchecked(\"0x123\")];\n\n    assert_eq!(result, expected_output);\n}\n\n#[tokio::test]\nasync fn test_happy_case_no_argument_function() {\n    let result = run_transformer(\"\", \"no_args_fn\").await.unwrap();\n\n    let expected_output = [];\n\n    assert_eq!(result, expected_output);\n}\n\n#[tokio::test]\nasync fn test_happy_case_implicit_contract_constructor() {\n    let class = init_class(NO_CONSTRUCTOR_CLASS_HASH).await;\n    let ContractClass::Sierra(sierra_class) = class else {\n        panic!(\"Expected Sierra class, but got legacy Sierra class\")\n    };\n\n    let abi: Vec<AbiEntry> = serde_json::from_str(sierra_class.abi.as_str()).unwrap();\n\n    let result = transform(\"\", &abi, &get_selector_from_name(\"constructor\").unwrap()).unwrap();\n\n    let expected_output = [];\n\n    assert_eq!(result, expected_output);\n}\n\n#[tokio::test]\nasync fn test_external_enum_function_ambiguous_enum_name_cairo_expression_input() {\n    // https://sepolia.voyager.online/class/0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d#code\n    let test_class_hash: Felt = Felt::from_hex_unchecked(\n        \"0x019ea00ebe2d83fb210fbd6f52c302b83c69e3c8c934f9404c87861e9d3aebbc\",\n    );\n\n    let client = JsonRpcClient::new(HttpTransport::new(\n        shared::test_utils::node_url::node_rpc_url(),\n    ));\n\n    let contract_class = client\n        .get_class(BlockId::Tag(BlockTag::Latest), test_class_hash)\n        .await\n        .unwrap();\n\n    let input = \"\n            TransactionState::Init() , \\\n            TransactionState::NotFound()\n            \";\n\n    let ContractClass::Sierra(sierra_class) = contract_class else {\n        panic!(\"Expected Sierra class, but got legacy Sierra class\")\n    };\n\n    let abi: Vec<AbiEntry> = serde_json::from_str(sierra_class.abi.as_str()).unwrap();\n\n    let result = transform(\n        input,\n        &abi,\n        &get_selector_from_name(\"external_enum_fn\").unwrap(),\n    );\n\n    result.unwrap_err().assert_contains(\n        r#\"Found more than one enum \"TransactionState\" in ABI, please specify a full path to the item\"#,\n    );\n}\n"
  },
  {
    "path": "crates/data-transformer/tests/lib.rs",
    "content": "mod integration;\nmod unit;\n"
  },
  {
    "path": "crates/data-transformer/tests/unit/bytes31.rs",
    "content": "use data_transformer::cairo_types::{CairoBytes31, ParseBytes31Error};\nuse starknet_types_core::felt::Felt;\nuse std::str::FromStr;\n\n#[cfg(test)]\nmod tests_bytes31 {\n    use super::*;\n    use test_case::test_case;\n\n    #[test]\n    fn test_happy_case() {\n        let bytes31 = CairoBytes31::from_str(\"0x123456789abcdef\").unwrap();\n        assert_eq!(\n            Felt::from(bytes31),\n            Felt::from_hex_unchecked(\"0x123456789abcdef\")\n        );\n    }\n\n    #[test]\n    fn test_max_value() {\n        let max_bytes31 = CairoBytes31::MAX;\n        let from_str = CairoBytes31::from_str(\n            \"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\",\n        )\n        .unwrap();\n        assert_eq!(max_bytes31, from_str);\n    }\n\n    #[test]\n    fn test_overflow() {\n        let result = CairoBytes31::from_str(\n            \"0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\",\n        );\n        assert!(matches!(result, Err(ParseBytes31Error::Overflow)));\n    }\n\n    #[test_case(\"wrong_string_value\"; \"wrong string value\")]\n    #[test_case(\"\"; \"empty string\")]\n    fn test_invalid_string(input: &str) {\n        let result = CairoBytes31::from_str(input);\n        assert!(matches!(result, Err(ParseBytes31Error::CairoFromStrError)));\n    }\n\n    #[test]\n    fn test_felt_conversion() {\n        let bytes31 = CairoBytes31::from_str(\"0x123\").unwrap();\n        let felt: Felt = bytes31.into();\n        assert_eq!(felt, Felt::from_hex_unchecked(\"0x123\"));\n    }\n\n    #[test]\n    fn test_zero_value() {\n        let bytes31 = CairoBytes31::from_str(\"0x0\").unwrap();\n        assert_eq!(Felt::from(bytes31), Felt::ZERO);\n    }\n\n    #[test]\n    fn test_leading_zeros() {\n        let bytes31 = CairoBytes31::from_str(\"0x000123\").unwrap();\n        assert_eq!(Felt::from(bytes31), Felt::from_hex_unchecked(\"0x123\"));\n    }\n}\n"
  },
  {
    "path": "crates/data-transformer/tests/unit/mod.rs",
    "content": "mod bytes31;\nmod u384;\nmod u96;\n"
  },
  {
    "path": "crates/data-transformer/tests/unit/u384.rs",
    "content": "use data_transformer::cairo_types::CairoU384;\nuse data_transformer::cairo_types::ParseCairoU384Error;\nuse std::str::FromStr;\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    #[test]\n    fn test_from_bytes() {\n        let mut input = [0u8; 48];\n        input[36..48].copy_from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4]); // limb_0\n        input[24..36].copy_from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3]); // limb_1\n        input[12..24].copy_from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2]); // limb_2\n        input[0..12].copy_from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]); // limb_3\n\n        let first = CairoU384::from_bytes(&input);\n        let second = CairoU384::from_bytes(&input);\n        assert_eq!(first, second);\n    }\n\n    #[test]\n    fn test_valid_decimal() {\n        let input = \"123456789\";\n        let result = CairoU384::from_str(input).unwrap();\n        let mut expected = [0u8; 48];\n        expected[44..48].copy_from_slice(&[0x07, 0x5B, 0xCD, 0x15]);\n\n        let expected = CairoU384::from_bytes(&expected);\n        assert_eq!(result, expected);\n    }\n\n    #[test]\n    fn test_valid_hex() {\n        let input = \"0x1234567890abcdef\";\n        let result = CairoU384::from_str(input).unwrap();\n\n        let mut expected = [0u8; 48];\n        expected[40..48].copy_from_slice(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF]);\n\n        let expected = CairoU384::from_bytes(&expected);\n        assert_eq!(result, expected);\n    }\n\n    #[test]\n    fn test_overflow() {\n        let large_hex = \"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\";\n        let result = CairoU384::from_str(large_hex);\n        assert!(matches!(result, Err(ParseCairoU384Error::Overflow)));\n    }\n\n    #[test]\n    fn test_zero_value() {\n        let zero = \"0\";\n        let result = CairoU384::from_str(zero).unwrap();\n        let expected = CairoU384::from_bytes(&[0u8; 48]);\n        assert_eq!(result, expected);\n    }\n\n    #[test]\n    fn test_max_value() {\n        let max_value = \"0xffffffffffffffffffffffffffffffff\";\n        let result = CairoU384::from_str(max_value).unwrap();\n\n        let mut bytes = [0u8; 48];\n        let start = 48 - max_value[2..].len() / 2;\n        bytes[start..].fill(0xFF);\n        let expected = CairoU384::from_bytes(&bytes);\n\n        assert_eq!(result, expected);\n    }\n}\n"
  },
  {
    "path": "crates/data-transformer/tests/unit/u96.rs",
    "content": "#[cfg(test)]\nmod tests_cairo_u96 {\n    use data_transformer::cairo_types::{CairoU96, ParseCairoU96Error};\n    use starknet_types_core::felt::Felt;\n    use std::str::FromStr;\n\n    use test_case::test_case;\n\n    const U96_MAX: u128 = (2u128 << 96) - 1;\n\n    #[test_case(\"0\", 0_u128 ; \"zero\")]\n    #[test_case(\"123\", 123_u128 ; \"small decimal\")]\n    #[test_case(\"1000000\", 1_000_000_u128 ; \"million\")]\n    #[test_case(\"ff\", 0xff_u128 ; \"small hex\")]\n    #[test_case(\"1234abcd\", 0x1234_abcd_u128 ; \"large hex\")]\n    fn test_valid_numbers(input: &str, expected: u128) {\n        let parsed = CairoU96::from_str(input).unwrap();\n        assert_eq!(\n            Felt::from(parsed),\n            Felt::from(expected),\n            \"Failed parsing {input} - expected {expected}\"\n        );\n    }\n\n    #[test]\n    fn test_max_value() {\n        let max_value_str = U96_MAX.to_string();\n        let result = CairoU96::from_str(&max_value_str).unwrap();\n        assert_eq!(Felt::from(result), Felt::from(U96_MAX));\n        let max_value_hex = format!(\"{U96_MAX:x}\");\n        let result_hex = CairoU96::from_str(&max_value_hex).unwrap();\n        assert_eq!(Felt::from(result_hex), Felt::from(U96_MAX));\n    }\n\n    #[test_case(\"\" ; \"empty string\")]\n    #[test_case(\"not_a_number\" ; \"invalid string\")]\n    fn test_invalid_input(input: &str) {\n        assert!(matches!(\n            CairoU96::from_str(input),\n            Err(ParseCairoU96Error::InvalidString(_))\n        ));\n    }\n\n    #[test_case(\"0\", 0_u128 ; \"zero conversion\")]\n    #[test_case(\"123\", 123_u128 ; \"small number conversion\")]\n    #[test_case(\"1000000\", 1_000_000_u128 ; \"million conversion\")]\n    #[test_case(\"ff\", 255_u128 ; \"hex conversion\")]\n    #[test_case(&U96_MAX.to_string(), U96_MAX ; \"max value conversion\")]\n    fn test_felt_conversion(input: &str, expected: u128) {\n        let cairo_u96 = CairoU96::from_str(input).unwrap();\n        assert_eq!(Felt::from(cairo_u96), Felt::from(expected));\n    }\n}\n"
  },
  {
    "path": "crates/debugging/Cargo.toml",
    "content": "[package]\nname = \"debugging\"\nversion = \"1.0.0\"\nedition.workspace = true\n\n[dependencies]\nblockifier.workspace = true\ncairo-lang-sierra.workspace = true\ncairo-lang-sierra-to-casm.workspace = true\ncairo-lang-starknet-classes.workspace = true\ncheatnet = { path = \"../cheatnet\" }\nconsole.workspace = true\ndata-transformer = { path = \"../data-transformer\" }\npaste.workspace = true\nptree.workspace = true\nrayon.workspace = true\nserde_json.workspace = true\nstarknet-types-core.workspace = true\nstarknet-rust.workspace = true\nstarknet_api.workspace = true\nthiserror.workspace = true\n"
  },
  {
    "path": "crates/debugging/src/contracts_data_store.rs",
    "content": "use crate::trace::types::{ContractName, Selector};\nuse cairo_lang_sierra::program::ProgramArtifact;\nuse cairo_lang_starknet_classes::contract_class::ContractClass;\nuse cheatnet::forking::data::ForkData;\nuse cheatnet::runtime_extensions::forge_runtime_extension::contracts_data::ContractsData;\nuse rayon::iter::IntoParallelRefIterator;\nuse rayon::iter::ParallelIterator;\nuse starknet_api::core::{ClassHash, EntryPointSelector};\nuse starknet_rust::core::types::contract::{AbiEntry, SierraClass};\nuse std::collections::HashMap;\n\n/// Data structure containing information about contracts,\n/// including their ABI, names, selectors and programs that will be used to create a [`Trace`](crate::Trace).\npub struct ContractsDataStore {\n    abi: HashMap<ClassHash, Vec<AbiEntry>>,\n    contract_names: HashMap<ClassHash, ContractName>,\n    selectors: HashMap<EntryPointSelector, Selector>,\n    programs: HashMap<ClassHash, ProgramArtifact>,\n}\n\nimpl ContractsDataStore {\n    /// Creates a new instance of [`ContractsDataStore`] from a similar structure from `cheatnet`: [`ContractsData`] and [`ForkData`].\n    #[must_use]\n    pub fn new(contracts_data: &ContractsData, fork_data: &ForkData) -> Self {\n        let contract_names = contracts_data\n            .class_hashes\n            .iter()\n            .map(|(name, class_hash)| (*class_hash, ContractName(name.clone())))\n            .collect();\n\n        let selectors = contracts_data\n            .selectors\n            .iter()\n            .chain(&fork_data.selectors)\n            .map(|(selector, function_name)| (*selector, Selector(function_name.clone())))\n            .collect();\n\n        let abi = contracts_data\n            .contracts\n            .par_iter()\n            .map(|(_, contract_data)| {\n                let sierra = serde_json::from_str::<SierraClass>(&contract_data.artifacts.sierra)\n                    .expect(\"this should be valid `SierraClass`\");\n                (contract_data.class_hash, sierra.abi)\n            })\n            .chain(fork_data.abi.clone())\n            .collect();\n\n        let programs = contracts_data\n            .contracts\n            .par_iter()\n            .map(|(_, contract_data)| {\n                let contract_class =\n                    serde_json::from_str::<ContractClass>(&contract_data.artifacts.sierra)\n                        .expect(\"this should be valid `ContractClass`\");\n\n                let program = contract_class\n                    .extract_sierra_program(false)\n                    .expect(\"extraction should succeed\")\n                    .program;\n\n                let debug_info = contract_class.sierra_program_debug_info;\n\n                let program_artifact = ProgramArtifact {\n                    program,\n                    debug_info,\n                };\n\n                (contract_data.class_hash, program_artifact)\n            })\n            .collect();\n\n        Self {\n            abi,\n            contract_names,\n            selectors,\n            programs,\n        }\n    }\n\n    /// Gets the [`ContractName`] for a given contract [`ClassHash`].\n    #[must_use]\n    pub fn get_contract_name(&self, class_hash: &ClassHash) -> Option<&ContractName> {\n        self.contract_names.get(class_hash)\n    }\n\n    /// Gets the `abi` for a given contract [`ClassHash`] from [`ContractsDataStore`].\n    pub fn get_abi(&self, class_hash: &ClassHash) -> Option<&[AbiEntry]> {\n        self.abi.get(class_hash).map(Vec::as_slice)\n    }\n\n    /// Gets the [`Selector`] in human-readable form for a given [`EntryPointSelector`] from [`ContractsDataStore`].\n    #[must_use]\n    pub fn get_selector(&self, entry_point_selector: &EntryPointSelector) -> Option<&Selector> {\n        self.selectors.get(entry_point_selector)\n    }\n\n    /// Gets the [`ProgramArtifact`] for a given contract [`ClassHash`].\n    #[must_use]\n    pub fn get_program_artifact(&self, class_hash: &ClassHash) -> Option<&ProgramArtifact> {\n        self.programs.get(class_hash)\n    }\n}\n"
  },
  {
    "path": "crates/debugging/src/lib.rs",
    "content": "//! Crate with debugging utilities in forge.\n//!\n//! Currently, the main purpose of this crate is displaying pretty traces.\n//! The entry point for that is the [`Trace`] struct that implements the [`Display`](std::fmt::Display)\n//! which allows for pretty printing of traces.\nmod contracts_data_store;\nmod trace;\nmod tree;\n\npub use contracts_data_store::ContractsDataStore;\npub use trace::components::{Component, Components};\npub use trace::{context::Context, types::ContractName, types::Trace};\n"
  },
  {
    "path": "crates/debugging/src/trace/collect.rs",
    "content": "use crate::contracts_data_store::ContractsDataStore;\nuse crate::trace::types::{\n    CallerAddress, ContractAddress, ContractName, ContractTrace, Gas, Selector, TestName,\n    TraceInfo, TransformedCallResult, TransformedCalldata,\n};\nuse crate::{Context, Trace};\nuse cheatnet::runtime_extensions::call_to_blockifier_runtime_extension::rpc::{\n    CallFailure, CallSuccess,\n};\nuse cheatnet::trace_data::{CallTrace, CallTraceNode};\nuse data_transformer::{reverse_transform_input, reverse_transform_output};\nuse starknet_api::core::ClassHash;\nuse starknet_api::execution_utils::format_panic_data;\nuse starknet_rust::core::types::contract::AbiEntry;\n\npub struct Collector<'a> {\n    call_trace: &'a CallTrace,\n    context: &'a Context,\n}\n\nimpl<'a> Collector<'a> {\n    /// Creates a new [`Collector`] from a given `cheatnet` [`CallTrace`], [`ContractsDataStore`] and [`Verbosity`].\n    #[must_use]\n    pub fn new(call_trace: &'a CallTrace, context: &'a Context) -> Collector<'a> {\n        Collector {\n            call_trace,\n            context,\n        }\n    }\n\n    pub fn collect_trace(&self, test_name: String) -> Trace {\n        Trace {\n            test_name: TestName(test_name),\n            nested_calls: self.collect_nested_calls(),\n        }\n    }\n\n    fn collect_contract_trace(&self) -> ContractTrace {\n        let components = self.context.components();\n        let entry_point = &self.call_trace.entry_point;\n        let nested_calls = self.collect_nested_calls();\n        let contract_name = self.collect_contract_name();\n        let abi = self.collect_abi();\n\n        let trace_info = TraceInfo {\n            contract_name: components.contract_name(contract_name),\n            entry_point_type: components.entry_point_type(entry_point.entry_point_type),\n            calldata: components.calldata_lazy(|| self.collect_transformed_calldata(abi)),\n            contract_address: components\n                .contract_address(ContractAddress(entry_point.storage_address)),\n            caller_address: components.caller_address(CallerAddress(entry_point.caller_address)),\n            call_type: components.call_type(entry_point.call_type),\n            nested_calls,\n            call_result: components.call_result_lazy(|| self.collect_transformed_call_result(abi)),\n            gas: components.gas_lazy(|| self.collect_gas()),\n        };\n\n        ContractTrace {\n            selector: self.collect_selector().clone(),\n            trace_info,\n        }\n    }\n\n    fn collect_nested_calls(&self) -> Vec<ContractTrace> {\n        self.call_trace\n            .nested_calls\n            .iter()\n            .filter_map(CallTraceNode::extract_entry_point_call)\n            .filter_map(|call_trace| {\n                let call_trace = call_trace.borrow();\n\n                // Filter mock calls that have empty class hashes.\n                call_trace.entry_point.class_hash.is_some().then(|| {\n                    Collector {\n                        call_trace: &call_trace,\n                        context: self.context,\n                    }\n                    .collect_contract_trace()\n                })\n            })\n            .collect()\n    }\n\n    fn collect_contract_name(&self) -> ContractName {\n        self.contracts_data_store()\n            .get_contract_name(self.class_hash())\n            .cloned()\n            .unwrap_or_else(|| ContractName(\"forked contract\".to_string()))\n    }\n\n    fn collect_selector(&self) -> &Selector {\n        self.contracts_data_store()\n            .get_selector(&self.call_trace.entry_point.entry_point_selector)\n            .expect(\"`Selector` should be present\")\n    }\n\n    fn collect_abi(&self) -> &[AbiEntry] {\n        self.contracts_data_store()\n            .get_abi(self.class_hash())\n            .expect(\"`ABI` should be present\")\n    }\n\n    fn collect_transformed_calldata(&self, abi: &[AbiEntry]) -> TransformedCalldata {\n        TransformedCalldata(\n            reverse_transform_input(\n                &self.call_trace.entry_point.calldata.0,\n                abi,\n                &self.call_trace.entry_point.entry_point_selector.0,\n            )\n            .expect(\"calldata should be successfully transformed\"),\n        )\n    }\n\n    fn collect_transformed_call_result(&self, abi: &[AbiEntry]) -> TransformedCallResult {\n        TransformedCallResult(match &self.call_trace.result {\n            Ok(CallSuccess { ret_data }) => {\n                let ret_data = reverse_transform_output(\n                    ret_data,\n                    abi,\n                    &self.call_trace.entry_point.entry_point_selector.0,\n                )\n                .expect(\"call result should be successfully transformed\");\n                format_result_message(\"success\", &ret_data)\n            }\n            Err(failure) => match failure {\n                CallFailure::Recoverable { panic_data } => {\n                    format_result_message(\"panic\", &format_panic_data(panic_data))\n                }\n                CallFailure::Unrecoverable { msg } => {\n                    format_result_message(\"error\", &msg.to_string())\n                }\n            },\n        })\n    }\n\n    fn collect_gas(&self) -> Gas {\n        Gas(self\n            .call_trace\n            .gas_report_data\n            .as_ref()\n            .expect(\"Gas report data must be updated after test execution\")\n            .get_gas()\n            .l2_gas)\n    }\n\n    fn class_hash(&self) -> &ClassHash {\n        self.call_trace\n            .entry_point\n            .class_hash\n            .as_ref()\n            .expect(\"Entries with empty class hash are filtered in `collect_nested_calls`\")\n    }\n\n    fn contracts_data_store(&self) -> &ContractsDataStore {\n        self.context.contracts_data_store()\n    }\n}\n\nfn format_result_message(tag: &str, message: &str) -> String {\n    if message.is_empty() {\n        tag.to_string()\n    } else {\n        format!(\"{tag}: {message}\")\n    }\n}\n"
  },
  {
    "path": "crates/debugging/src/trace/components.rs",
    "content": "use crate::trace::types::{\n    CallerAddress, ContractAddress, ContractName, Gas, TransformedCallResult, TransformedCalldata,\n};\nuse blockifier::execution::entry_point::CallType;\nuse paste::paste;\nuse starknet_api::contract_class::EntryPointType;\nuse std::collections::HashSet;\n\n/// Represents a set of [`Component`] that will be included in a trace.\npub struct Components {\n    set: HashSet<Component>,\n}\n\nimpl Components {\n    /// Creates a new [`Components`] instance with the specified set of [`Component`].\n    #[must_use]\n    pub fn new(components: HashSet<Component>) -> Self {\n        Self { set: components }\n    }\n\n    /// Checks if a specific [`Component`] is included in the set.\n    #[must_use]\n    pub fn contains(&self, component: &Component) -> bool {\n        self.set.contains(component)\n    }\n}\n\n/// Components that will be included in the trace.\n#[derive(Debug, Clone, PartialEq, Eq, Hash)]\npub enum Component {\n    /// The name of the contract being called.\n    ContractName,\n    /// The type of the entry point being called (e.g., `External`, `L1Handler`, etc.).\n    EntryPointType,\n    /// The calldata of the call, transformed for display.\n    Calldata,\n    /// The address of the contract being called.\n    ContractAddress,\n    /// The address of the caller contract.\n    CallerAddress,\n    /// The type of the call (e.g., `Call`, `Delegate`, etc.).\n    CallType,\n    /// The result of the call, transformed for display.\n    CallResult,\n    /// The L2 gas used by the call.\n    Gas,\n}\n\nmacro_rules! impl_component_container {\n    // Short form - uses the same name for both the Component variant and the value type\n    ($variant:ident) => {\n        impl_component_container!($variant, $variant);\n    };\n\n    // Full form - Component name and different value type\n    ($variant:ident, $ty:ty) => {\n        paste! {\n            #[doc = concat!(\n                \"Container for a `\", stringify!($ty),\n                \"` that is computed only if `Component::\", stringify!($variant),\n                \"` is included in the [`Components`].\"\n            )]\n            #[derive(Debug, Clone)]\n            pub struct [<$variant Container>] {\n                value: Option<$ty>,\n            }\n\n            impl [<$variant Container>] {\n                #[doc = concat!(\n                    \"Creates a new [`\", stringify!($variant), \"Container`] from a specific value.\\n\\n\",\n                    \"This will store the value only if `Component::\", stringify!($variant), \"` is present in the [`Components`].\"\n                )]\n                #[must_use]\n                pub fn new(components: &Components, value: $ty) -> Self {\n                    Self {\n                        value: components.contains(&Component::$variant).then_some(value),\n                    }\n                }\n\n                #[doc = concat!(\n                    \"Creates a new [`\", stringify!($variant), \"Container`] using a lazy supplier function.\\n\\n\",\n                    \"The function will be called only if `Component::\", stringify!($variant), \"` is present in [`Components`].\"\n                )]\n                #[must_use]\n                pub fn new_lazy(components: &Components, supply_fn: impl FnOnce() -> $ty) -> Self {\n                    Self {\n                        value: components.contains(&Component::$variant).then(supply_fn),\n                    }\n                }\n\n                #[doc = \"Returns a reference to the contained value if it was computed.\\n\\nReturns `None` otherwise.\"]\n                #[must_use]\n                pub fn as_option(&self) -> Option<&$ty> {\n                    self.value.as_ref()\n                }\n            }\n\n            impl Components {\n                #[doc = concat!(\n                    \"Returns a [`\", stringify!($variant), \"Container`] from a direct value.\\n\\n\",\n                    \"The value will only be stored if `Component::\", stringify!($variant), \"` is in the set.\"\n                )]\n                #[must_use]\n                pub fn [<$variant:snake>](&self, value: $ty) -> [<$variant Container>] {\n                    [<$variant Container>]::new(self, value)\n                }\n\n                #[doc = concat!(\n                    \"Returns a [`\", stringify!($variant), \"Container`] using a lazy supplier function.\\n\\n\",\n                    \"The function will only be called if `Component::\", stringify!($variant), \"` is in the set.\"\n                )]\n                pub fn [<$variant:snake _lazy>](&self, supply_fn: impl FnOnce() -> $ty) -> [<$variant Container>] {\n                    [<$variant Container>]::new_lazy(self, supply_fn)\n                }\n            }\n        }\n    };\n}\n\nimpl_component_container!(ContractName);\nimpl_component_container!(EntryPointType);\nimpl_component_container!(Calldata, TransformedCalldata);\nimpl_component_container!(ContractAddress);\nimpl_component_container!(CallerAddress);\nimpl_component_container!(CallType);\nimpl_component_container!(CallResult, TransformedCallResult);\nimpl_component_container!(Gas);\n"
  },
  {
    "path": "crates/debugging/src/trace/context.rs",
    "content": "use crate::Components;\nuse crate::contracts_data_store::ContractsDataStore;\nuse cheatnet::forking::data::ForkData;\nuse cheatnet::runtime_extensions::forge_runtime_extension::contracts_data::ContractsData;\n\n/// Context is a structure that holds the necessary data for creating a [`Trace`](crate::Trace).\npub struct Context {\n    contracts_data_store: ContractsDataStore,\n    components: Components,\n}\n\nimpl Context {\n    /// Creates a new instance of [`Context`] from a given `cheatnet` [`ContractsData`], [`ForkData`] and [`Components`].\n    #[must_use]\n    pub fn new(\n        contracts_data: &ContractsData,\n        fork_data: &ForkData,\n        components: Components,\n    ) -> Self {\n        let contracts_data_store = ContractsDataStore::new(contracts_data, fork_data);\n        Self {\n            contracts_data_store,\n            components,\n        }\n    }\n\n    /// Returns a reference to the [`ContractsDataStore`].\n    #[must_use]\n    pub fn contracts_data_store(&self) -> &ContractsDataStore {\n        &self.contracts_data_store\n    }\n\n    /// Returns a reference to the [`Components`].\n    #[must_use]\n    pub fn components(&self) -> &Components {\n        &self.components\n    }\n}\n"
  },
  {
    "path": "crates/debugging/src/trace/mod.rs",
    "content": "pub mod collect;\npub mod components;\npub mod context;\npub mod types;\n"
  },
  {
    "path": "crates/debugging/src/trace/types.rs",
    "content": "use crate::Context;\nuse crate::trace::collect::Collector;\nuse crate::trace::components::{\n    CallResultContainer, CallTypeContainer, CalldataContainer, CallerAddressContainer,\n    ContractAddressContainer, ContractNameContainer, EntryPointTypeContainer, GasContainer,\n};\nuse crate::tree::TreeSerialize;\nuse cheatnet::trace_data::CallTrace;\nuse starknet_api::core::ContractAddress as ApiContractAddress;\nuse starknet_api::execution_resources::GasAmount as ApiGasAmount;\nuse std::fmt;\nuse std::fmt::Display;\n\n#[derive(Debug, Clone)]\npub struct Trace {\n    pub test_name: TestName,\n    pub nested_calls: Vec<ContractTrace>,\n}\n\n#[derive(Debug, Clone)]\npub struct ContractTrace {\n    pub selector: Selector,\n    pub trace_info: TraceInfo,\n}\n\n#[derive(Debug, Clone)]\npub struct TraceInfo {\n    pub contract_name: ContractNameContainer,\n    pub entry_point_type: EntryPointTypeContainer,\n    pub calldata: CalldataContainer,\n    pub contract_address: ContractAddressContainer,\n    pub caller_address: CallerAddressContainer,\n    pub call_type: CallTypeContainer,\n    pub nested_calls: Vec<ContractTrace>,\n    pub call_result: CallResultContainer,\n    pub gas: GasContainer,\n}\n\n#[derive(Debug, Clone)]\npub struct TransformedCallResult(pub String);\n\n#[derive(Debug, Clone)]\npub struct TransformedCalldata(pub String);\n\n#[derive(Debug, Clone)]\npub struct Selector(pub String);\n\n#[derive(Debug, Clone)]\npub struct TestName(pub String);\n\n#[derive(Debug, Clone)]\npub struct ContractName(pub String);\n\n#[derive(Debug, Clone)]\npub struct ContractAddress(pub ApiContractAddress);\n\n#[derive(Debug, Clone)]\npub struct CallerAddress(pub ApiContractAddress);\n\n#[derive(Debug, Clone)]\npub struct Gas(pub ApiGasAmount);\n\nimpl Trace {\n    /// Creates a new [`Trace`] from a given [`Context`] and a test name.\n    #[must_use]\n    pub fn new(call_trace: &CallTrace, context: &Context, test_name: String) -> Self {\n        Collector::new(call_trace, context).collect_trace(test_name)\n    }\n}\n\nimpl Display for Trace {\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        write!(f, \"{}\", self.serialize())\n    }\n}\n"
  },
  {
    "path": "crates/debugging/src/tree/building/builder.rs",
    "content": "use ptree::TreeBuilder;\nuse ptree::item::StringItem;\n\n/// A wrapper around [`TreeBuilder`] that adds two guard nodes to the tree upon creation and removes them upon building.\npub struct TreeBuilderWithGuard {\n    builder: TreeBuilder,\n}\n\nimpl TreeBuilderWithGuard {\n    /// Creates a new [`TreeBuilderWithGuard`].\n    pub fn new() -> Self {\n        let mut builder = TreeBuilder::new(\"guard\".to_string());\n        builder.begin_child(\"guard\".to_string());\n        Self { builder }\n    }\n\n    /// Add a child to the current item and make the new child current.\n    pub fn begin_child(&mut self, text: String) {\n        self.builder.begin_child(text);\n    }\n\n    /// Add an empty child (leaf item) to the current item.\n    pub fn add_empty_child(&mut self, text: String) {\n        self.builder.add_empty_child(text);\n    }\n\n    /// Finish adding children, and make the current item's parent current.\n    pub fn end_child(&mut self) {\n        self.builder.end_child();\n    }\n\n    /// Finish building the tree and return the top level item, not accounting for the guard nodes.\n    pub fn build(mut self) -> StringItem {\n        let string_item = self.builder.build();\n        extract_guard(extract_guard(string_item))\n    }\n}\n\n/// Extracts the guard node from a [`StringItem`].\nfn extract_guard(mut string_item: StringItem) -> StringItem {\n    assert_eq!(string_item.text, \"guard\");\n    assert_eq!(string_item.children.len(), 1);\n    string_item.children.pop().unwrap_or_else(|| {\n        unreachable!(\"guard is guaranteed to have one child by the assertion above\")\n    })\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    #[test]\n    fn test_happy_path() {\n        let mut builder = TreeBuilderWithGuard::new();\n        builder.add_empty_child(\"leaf\".to_string());\n\n        let tree = builder.build();\n\n        assert_eq!(tree.text, \"leaf\");\n        assert!(tree.children.is_empty());\n    }\n\n    #[test]\n    fn test_two_guards() {\n        let mut builder = TreeBuilderWithGuard::new();\n        let tree = builder.builder.build();\n\n        assert_eq!(tree.text, \"guard\");\n        assert_eq!(tree.children.len(), 1);\n        assert_eq!(tree.children[0].text, \"guard\");\n        assert!(tree.children[0].children.is_empty());\n    }\n}\n"
  },
  {
    "path": "crates/debugging/src/tree/building/mod.rs",
    "content": "pub mod builder;\npub mod node;\n"
  },
  {
    "path": "crates/debugging/src/tree/building/node.rs",
    "content": "use crate::tree::building::builder::TreeBuilderWithGuard;\nuse crate::tree::ui::as_tree_node::AsTreeNode;\nuse crate::tree::ui::display::NodeDisplay;\n\n/// Abstraction over a [`ptree::TreeBuilder`] that automatically ends building a current node when dropped.\n/// # Note\n/// The last node should be at level one when dropped, to not cause overflow.\n/// This is enforced at type level by using [`TreeBuilderWithGuard`] instead of [`ptree::TreeBuilder`].\npub struct Node<'a> {\n    builder: &'a mut TreeBuilderWithGuard,\n}\n\nimpl Drop for Node<'_> {\n    fn drop(&mut self) {\n        self.builder.end_child();\n    }\n}\n\nimpl<'a> Node<'a> {\n    /// Creates a new [`Node`] with a given [`TreeBuilderWithGuard`].\n    pub fn new(builder: &'a mut TreeBuilderWithGuard) -> Self {\n        Node { builder }\n    }\n\n    /// Calls [`AsTreeNode::as_tree_node`] on the given item.\n    /// Utility function to allow chaining.\n    pub fn as_tree_node(&mut self, tree_item: &impl AsTreeNode) {\n        tree_item.as_tree_node(self);\n    }\n\n    /// Creates a child node which parent is the current node and returns handle to created node.\n    #[must_use = \"if you want to create a leaf node use leaf() instead\"]\n    pub fn child_node(&mut self, tree_item: &impl NodeDisplay) -> Node<'_> {\n        self.builder.begin_child(tree_item.display());\n        Node::new(self.builder)\n    }\n\n    /// Creates a leaf node which parent is the current node.\n    pub fn leaf(&mut self, tree_item: &impl NodeDisplay) {\n        self.builder.add_empty_child(tree_item.display());\n    }\n\n    /// Creates a leaf node which parent is the current node if the item is not `None`.\n    pub fn leaf_optional(&mut self, tree_item: Option<&impl NodeDisplay>) {\n        if let Some(tree_item) = tree_item {\n            self.leaf(tree_item);\n        }\n    }\n}\n"
  },
  {
    "path": "crates/debugging/src/tree/mod.rs",
    "content": "mod building;\nmod ui;\n\nuse crate::tree::building::builder::TreeBuilderWithGuard;\nuse crate::tree::building::node::Node;\nuse crate::tree::ui::as_tree_node::AsTreeNode;\nuse ptree::item::StringItem;\n\n/// Serialize a type that implements [`AsTreeNode`] to a string.\npub trait TreeSerialize {\n    fn serialize(&self) -> String;\n}\n\nimpl<T: AsTreeNode> TreeSerialize for T {\n    fn serialize(&self) -> String {\n        let mut builder = TreeBuilderWithGuard::new();\n        Node::new(&mut builder).as_tree_node(self);\n        let string_item = builder.build();\n        write_to_string(&string_item)\n    }\n}\n\n/// Writes a [`StringItem`] to a string.\nfn write_to_string(string_item: &StringItem) -> String {\n    let mut buf = Vec::new();\n    ptree::write_tree(string_item, &mut buf).expect(\"write_tree failed\");\n    String::from_utf8(buf).expect(\"valid UTF-8\")\n}\n"
  },
  {
    "path": "crates/debugging/src/tree/ui/as_tree_node.rs",
    "content": "use crate::trace::types::{ContractTrace, Trace, TraceInfo};\nuse crate::tree::building::node::Node;\n\n/// Trait for adding a type to a tree.\n/// Implementations of this trait should only focus on placements of nodes in a tree not display aspects of them.\n/// Display should be handled by the [`NodeDisplay`](super::display::NodeDisplay) trait.\npub trait AsTreeNode {\n    fn as_tree_node(&self, parent: &mut Node);\n}\n\nimpl AsTreeNode for Trace {\n    fn as_tree_node(&self, parent: &mut Node) {\n        let mut node = parent.child_node(&self.test_name);\n        for nested_call in &self.nested_calls {\n            node.as_tree_node(nested_call);\n        }\n    }\n}\n\nimpl AsTreeNode for ContractTrace {\n    fn as_tree_node(&self, parent: &mut Node) {\n        parent\n            .child_node(&self.selector)\n            .as_tree_node(&self.trace_info);\n    }\n}\n\nimpl AsTreeNode for TraceInfo {\n    fn as_tree_node(&self, parent: &mut Node) {\n        parent.leaf_optional(self.contract_name.as_option());\n        parent.leaf_optional(self.entry_point_type.as_option());\n        parent.leaf_optional(self.calldata.as_option());\n        parent.leaf_optional(self.contract_address.as_option());\n        parent.leaf_optional(self.caller_address.as_option());\n        parent.leaf_optional(self.call_type.as_option());\n        parent.leaf_optional(self.call_result.as_option());\n        parent.leaf_optional(self.gas.as_option());\n        for nested_call in &self.nested_calls {\n            parent.as_tree_node(nested_call);\n        }\n    }\n}\n"
  },
  {
    "path": "crates/debugging/src/tree/ui/display.rs",
    "content": "use crate::trace::types::{\n    CallerAddress, ContractAddress, ContractName, Gas, Selector, TestName, TransformedCallResult,\n    TransformedCalldata,\n};\nuse blockifier::execution::entry_point::CallType;\nuse starknet_api::contract_class::EntryPointType;\nuse starknet_types_core::felt::Felt;\nuse std::fmt::Debug;\n\n/// Trait controlling the display of a node in a tree.\n/// All nodes should have a tag that explains what the node represents\n/// and a pretty string representation of data held by the node.\npub trait NodeDisplay {\n    const TAG: &'static str;\n    fn string_pretty(&self) -> String;\n\n    fn display(&self) -> String {\n        let tag = console::style(Self::TAG).magenta();\n        let content = self.string_pretty();\n        format!(\"[{tag}] {content}\")\n    }\n}\n\nimpl NodeDisplay for TestName {\n    const TAG: &'static str = \"test name\";\n    fn string_pretty(&self) -> String {\n        self.0.clone()\n    }\n}\n\nimpl NodeDisplay for ContractName {\n    const TAG: &'static str = \"contract name\";\n    fn string_pretty(&self) -> String {\n        self.0.clone()\n    }\n}\n\nimpl NodeDisplay for Selector {\n    const TAG: &'static str = \"selector\";\n    fn string_pretty(&self) -> String {\n        self.0.clone()\n    }\n}\n\nimpl NodeDisplay for EntryPointType {\n    const TAG: &'static str = \"entry point type\";\n    fn string_pretty(&self) -> String {\n        string_debug(self)\n    }\n}\n\nimpl NodeDisplay for TransformedCalldata {\n    const TAG: &'static str = \"calldata\";\n    fn string_pretty(&self) -> String {\n        self.0.clone()\n    }\n}\n\nimpl NodeDisplay for ContractAddress {\n    const TAG: &'static str = \"contract address\";\n    fn string_pretty(&self) -> String {\n        string_hex(self.0)\n    }\n}\n\nimpl NodeDisplay for CallerAddress {\n    const TAG: &'static str = \"caller address\";\n    fn string_pretty(&self) -> String {\n        string_hex(self.0)\n    }\n}\n\nimpl NodeDisplay for CallType {\n    const TAG: &'static str = \"call type\";\n    fn string_pretty(&self) -> String {\n        string_debug(self)\n    }\n}\n\nimpl NodeDisplay for TransformedCallResult {\n    const TAG: &'static str = \"call result\";\n    fn string_pretty(&self) -> String {\n        self.0.clone()\n    }\n}\n\nimpl NodeDisplay for Gas {\n    const TAG: &'static str = \"L2 gas\";\n    fn string_pretty(&self) -> String {\n        self.0.to_string()\n    }\n}\n\n/// Helper function to get hex representation\n/// of a type that can be converted to a [`Felt`].\nfn string_hex(data: impl Into<Felt>) -> String {\n    data.into().to_hex_string()\n}\n\n/// Helper function to get debug representation of a type as a string.\n/// Mainly used for enums that hold no data or vectors of felts.\nfn string_debug(data: impl Debug) -> String {\n    format!(\"{data:?}\")\n}\n"
  },
  {
    "path": "crates/debugging/src/tree/ui/mod.rs",
    "content": "pub mod as_tree_node;\npub mod display;\n"
  },
  {
    "path": "crates/docs/Cargo.toml",
    "content": "[package]\nname = \"docs\"\nversion.workspace = true\nedition.workspace = true\nrepository.workspace = true\nlicense.workspace = true\n\n[dependencies]\nregex.workspace = true\nshell-words.workspace = true\nwalkdir.workspace = true\nserde.workspace = true\nserde_json.workspace = true\ntoml_edit.workspace = true\ncamino.workspace = true\ntempfile.workspace = true\nanyhow.workspace = true\nsemver.workspace = true\nscarb-api = { path = \"../scarb-api\" }\n\n[features]\ntesting = []\n"
  },
  {
    "path": "crates/docs/src/lib.rs",
    "content": "#[cfg(feature = \"testing\")]\npub mod snippet;\n#[cfg(feature = \"testing\")]\npub mod validation;\n\n#[cfg(feature = \"testing\")]\npub mod utils;\n"
  },
  {
    "path": "crates/docs/src/snippet.rs",
    "content": "use std::sync::LazyLock;\n\nuse regex::Regex;\nuse scarb_api::version::scarb_version;\nuse semver::VersionReq;\nuse serde::{Deserialize, Serialize};\n\nstatic RE_SNCAST: LazyLock<Regex> = LazyLock::new(|| {\n    Regex::new( r\"(?ms)^(?:<!--\\s*(?P<config>\\{.*?\\})\\s*-->\\n)?```shell\\n\\$ (?P<command>sncast .+?)\\n```(?:\\s*<details>\\n<summary>Output:<\\/summary>\\n\\n```shell\\n(?P<output>[\\s\\S]+?)\\n```[\\s]*<\\/details>)?\").expect(\"Failed to create regex for sncast snippet\")\n});\n\nstatic RE_SNFORGE: LazyLock<Regex> = LazyLock::new(|| {\n    Regex::new( r\"(?ms)^(?:<!--\\s*(?P<config>\\{.*?\\})\\s*-->\\n)?```shell\\n\\$ (?P<command>snforge .+?)\\n```(?:\\s*<details>\\n<summary>Output:<\\/summary>\\n\\n```shell\\n(?P<output>[\\s\\S]+?)\\n```[\\s]*<\\/details>)?\").expect(\"Failed to create regex for snforge snippet\")\n});\n\n#[derive(Clone, Debug)]\npub struct SnippetType(String);\n\nimpl SnippetType {\n    #[must_use]\n    pub fn forge() -> Self {\n        SnippetType(\"snforge\".to_string())\n    }\n\n    #[must_use]\n    pub fn sncast() -> Self {\n        SnippetType(\"sncast\".to_string())\n    }\n\n    #[must_use]\n    pub fn as_str(&self) -> &str {\n        &self.0\n    }\n\n    #[must_use]\n    pub fn get_re(&self) -> &'static Regex {\n        // The regex pattern is used to match the snippet, its config and the output. Example:\n        // <!-- { content of snippet config JSON } -->\n        // ```shell\n        // $ snforge or sncast command with args...\n        // ```\n        // <details>\n        // <summary>Output:</summary>\n        // ```shell\n        // Output of the command...\n        // ```\n        // </details>\n\n        match self.as_str() {\n            \"snforge\" => &RE_SNFORGE,\n            \"sncast\" => &RE_SNCAST,\n            _ => panic!(\"Regex for {} not found\", self.as_str()),\n        }\n    }\n}\n\n#[allow(clippy::struct_excessive_bools)]\n#[derive(Debug, Serialize)]\n#[serde(default)]\npub struct SnippetConfig {\n    pub ignored: bool,\n    pub requires_ledger: bool,\n    pub package_name: Option<String>,\n    pub ignored_output: bool,\n    pub replace_network: bool,\n    pub scarb_version: Option<VersionReq>,\n}\n\n#[allow(clippy::struct_excessive_bools)]\n#[derive(Deserialize)]\n#[serde(default)]\nstruct SnippetConfigProxy {\n    ignored: bool,\n    requires_ledger: bool,\n    package_name: Option<String>,\n    ignored_output: bool,\n    replace_network: bool,\n    scarb_version: Option<VersionReq>,\n}\n\nimpl Default for SnippetConfigProxy {\n    fn default() -> Self {\n        Self {\n            ignored: false,\n            requires_ledger: false,\n            package_name: None,\n            ignored_output: false,\n            replace_network: true,\n            scarb_version: None,\n        }\n    }\n}\n\nimpl Default for SnippetConfig {\n    fn default() -> Self {\n        Self {\n            ignored: false,\n            requires_ledger: false,\n            package_name: None,\n            ignored_output: false,\n            replace_network: true,\n            scarb_version: None,\n        }\n    }\n}\n\nimpl SnippetConfig {\n    fn check_scarb_compatibility(&mut self) {\n        if let Some(ref scarb_version_req) = self.scarb_version {\n            let current_scarb_version = scarb_version().expect(\"Failed to get scarb version\").scarb;\n\n            if !scarb_version_req.matches(&current_scarb_version) {\n                self.ignored = true;\n            }\n        }\n    }\n}\n\nimpl<'de> Deserialize<'de> for SnippetConfig {\n    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>\n    where\n        D: serde::de::Deserializer<'de>,\n    {\n        let proxy = SnippetConfigProxy::deserialize(deserializer)?;\n\n        let mut config = SnippetConfig {\n            ignored: proxy.ignored,\n            requires_ledger: proxy.requires_ledger,\n            package_name: proxy.package_name,\n            ignored_output: proxy.ignored_output,\n            replace_network: proxy.replace_network,\n            scarb_version: proxy.scarb_version,\n        };\n\n        config.check_scarb_compatibility();\n\n        Ok(config)\n    }\n}\n\n#[derive(Debug)]\npub struct Snippet {\n    pub command: String,\n    pub output: Option<String>,\n    pub file_path: String,\n    pub line_start: usize,\n    pub snippet_type: SnippetType,\n    pub config: SnippetConfig,\n}\n\nimpl Snippet {\n    #[must_use]\n    pub fn to_command_args(&self) -> Vec<String> {\n        let cleaned_command = self\n            .command\n            .lines()\n            .collect::<Vec<&str>>()\n            .join(\" \")\n            .replace(\" \\\\\", \"\");\n\n        shell_words::split(&cleaned_command)\n            .expect(\"Failed to parse snippet string\")\n            .into_iter()\n            .map(|arg| arg.trim().to_string())\n            .collect()\n    }\n\n    #[must_use]\n    pub fn capture_package_from_output(&self) -> Option<String> {\n        let re =\n            Regex::new(r\"Collected \\d+ test\\(s\\) from ([a-zA-Z_][a-zA-Z0-9_]*) package\").unwrap();\n\n        re.captures_iter(self.output.as_ref()?)\n            .filter_map(|caps| caps.get(1))\n            .last()\n            .map(|m| m.as_str().to_string())\n    }\n}\n"
  },
  {
    "path": "crates/docs/src/utils.rs",
    "content": "use crate::snippet::Snippet;\nuse anyhow::{Result, anyhow};\nuse camino::Utf8PathBuf;\nuse std::{env, fs, path::PathBuf, str::FromStr};\nuse tempfile::TempDir;\nuse toml_edit::{DocumentMut, value};\n\n#[must_use]\npub fn get_nth_ancestor(levels_up: usize) -> PathBuf {\n    let mut dir = env::current_dir().expect(\"Failed to get the current directory\");\n\n    for _ in 0..levels_up {\n        dir = dir\n            .parent()\n            .expect(\"Failed to navigate to parent directory\")\n            .to_owned();\n    }\n\n    dir\n}\n\npub fn assert_valid_snippet(condition: bool, snippet: &Snippet, err_message: &str) {\n    assert!(\n        condition,\n        \"Found invalid {} snippet in the docs at {}:{}:1\\n{}\",\n        snippet.snippet_type.as_str(),\n        snippet.file_path,\n        snippet.line_start,\n        err_message\n    );\n}\n\npub fn print_snippets_validation_summary(snippets: &[Snippet], tool_name: &str) {\n    let validated_snippets_count = snippets\n        .iter()\n        .filter(|snippet| !snippet.config.ignored)\n        .count();\n    let ignored_snippets_count = snippets.len() - validated_snippets_count;\n\n    println!(\n        \"Finished validation of {tool_name} docs snippets\\nValidated: {validated_snippets_count}, Ignored: {ignored_snippets_count}\"\n    );\n}\n\npub fn print_ignored_snippet_message(snippet: &Snippet) {\n    println!(\n        \"Ignoring {} docs snippet, file: {}:{}:1\",\n        snippet.snippet_type.as_str(),\n        snippet.file_path,\n        snippet.line_start,\n    );\n}\n\nfn get_canonical_path(relative_path: &str) -> Result<String> {\n    Ok(Utf8PathBuf::from_str(relative_path)\n        .map_err(|e| anyhow!(\"Failed to create Utf8PathBuf: {e}\"))?\n        .canonicalize_utf8()\n        .map_err(|e| anyhow!(\"Failed to canonicalize path: {e}\"))?\n        .to_string())\n}\n\npub fn update_scarb_toml_dependencies(temp: &TempDir) -> Result<(), Box<dyn std::error::Error>> {\n    let snforge_std_path = get_canonical_path(\"../../snforge_std\")?;\n    let sncast_std_path = get_canonical_path(\"../../sncast_std\")?;\n    let scarb_toml_path = temp.path().join(\"Scarb.toml\");\n\n    let mut scarb_toml = fs::read_to_string(&scarb_toml_path)\n        .unwrap()\n        .parse::<DocumentMut>()\n        .unwrap();\n\n    scarb_toml[\"dependencies\"][\"sncast_std\"][\"path\"] = value(&sncast_std_path);\n    scarb_toml[\"dev-dependencies\"][\"snforge_std\"][\"path\"] = value(&snforge_std_path);\n\n    fs::write(&scarb_toml_path, scarb_toml.to_string())?;\n\n    Ok(())\n}\n"
  },
  {
    "path": "crates/docs/src/validation.rs",
    "content": "use crate::snippet::{Snippet, SnippetConfig, SnippetType};\nuse regex::Regex;\nuse std::sync::LazyLock;\nuse std::{fs, io, path::Path};\n\nconst EXTENSION: Option<&str> = Some(\"md\");\n\npub fn extract_snippets_from_file(\n    file_path: &Path,\n    snippet_type: &SnippetType,\n) -> io::Result<Vec<Snippet>> {\n    let content = fs::read_to_string(file_path)?;\n    let file_path_str = file_path\n        .to_str()\n        .expect(\"Failed to get file path\")\n        .to_string();\n\n    let snippets = snippet_type\n        .get_re()\n        .captures_iter(&content)\n        .filter_map(|caps| {\n            let match_start = caps.get(0)?.start();\n            let config_str = caps\n                .name(\"config\")\n                .map_or_else(String::new, |m| m.as_str().to_string());\n            let command_match = caps.name(\"command\")?;\n            let output = caps.name(\"output\").map(|m| {\n                static GAS_RE: LazyLock<Regex> =\n                    LazyLock::new(|| Regex::new(r\"gas: (?:~\\d+|\\{.+\\})\").unwrap());\n                static EXECUTION_RESOURCES_RE: LazyLock<Regex> = LazyLock::new(|| {\n                    Regex::new(r\"(steps|memory holes|builtins|syscalls|sierra gas): (\\d+|\\(.+\\))\")\n                        .unwrap()\n                });\n\n                let output = GAS_RE.replace_all(m.as_str(), \"gas: [..]\").to_string();\n                EXECUTION_RESOURCES_RE\n                    .replace_all(output.as_str(), \"${1}: [..]\")\n                    .to_string()\n            });\n\n            let config = if config_str.is_empty() {\n                SnippetConfig::default()\n            } else {\n                serde_json::from_str(&config_str).expect(\"Failed to parse snippet config\")\n            };\n\n            Some(Snippet {\n                command: command_match.as_str().to_string(),\n                output,\n                file_path: file_path_str.clone(),\n                line_start: content[..match_start].lines().count() + 1,\n                snippet_type: snippet_type.clone(),\n                config,\n            })\n        })\n        .collect();\n\n    Ok(snippets)\n}\n\npub fn extract_snippets_from_directory(\n    dir_path: &Path,\n    snippet_type: &SnippetType,\n) -> io::Result<Vec<Snippet>> {\n    let mut all_snippets = Vec::new();\n\n    let files = walkdir::WalkDir::new(dir_path)\n        .into_iter()\n        .map(|entry| entry.expect(\"Failed to read directory\"))\n        .filter(|entry| entry.path().is_file());\n\n    for file in files {\n        let path = file.path();\n\n        if EXTENSION\n            .is_none_or(|ext| path.extension().and_then(|path_ext| path_ext.to_str()) == Some(ext))\n        {\n            let snippets = extract_snippets_from_file(path, snippet_type)?;\n            all_snippets.extend(snippets);\n        }\n    }\n\n    Ok(all_snippets)\n}\n"
  },
  {
    "path": "crates/forge/Cargo.toml",
    "content": "[package]\nname = \"forge\"\nversion.workspace = true\nedition.workspace = true\n\n# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html\n\n[features]\n# This should match `MINIMAL_SCARB_VERSION`\nscarb_2_12_0 = []\nno_scarb_installed = []\nnon_exact_gas_assertions = []\nskip_test_for_only_latest_scarb = []\nrun_test_for_scarb_since_2_13_1 = []\nrun_test_for_scarb_since_2_15_1 = []\ntest_for_multiple_scarb_versions = []\ncairo-native = [\"cheatnet/cairo-native\", \"scarb-api/cairo-native\"]\n\n[dependencies]\nanyhow.workspace = true\nblockifier.workspace = true\ncamino.workspace = true\ninclude_dir.workspace = true\nstarknet_api.workspace = true\nshared.workspace = true\ncheatnet = { path = \"../cheatnet\" }\nconversions = { path = \"../conversions\" }\nconfiguration = { path = \"../configuration\" }\nscarb-api = { path = \"../scarb-api\" }\nforge_runner = { path = \"../forge-runner\" }\nuniversal-sierra-compiler-api = { path = \"../universal-sierra-compiler-api\" }\ncairo-lang-sierra.workspace = true\ncairo-lang-starknet-classes.workspace = true\ncairo-annotations.workspace = true\nstarknet-types-core.workspace = true\nregex.workspace = true\nserde_json.workspace = true\nserde.workspace = true\nstarknet-rust.workspace = true\nreqwest.workspace = true\nnum-bigint.workspace = true\nclap.workspace = true\nclap_complete.workspace = true\nconsole.workspace = true\nrand.workspace = true\nscarb-metadata.workspace = true\nscarb-ui.workspace = true\nsemver.workspace = true\ncairo-vm.workspace = true\n# openssl is being used, please do not remove it!\nopenssl.workspace = true\ntoml_edit.workspace = true\ntokio.workspace = true\nfutures.workspace = true\nurl.workspace = true\nindoc.workspace = true\nderive_more.workspace = true\nfoundry-ui = { path = \"../foundry-ui\" }\nchrono.workspace = true\ntracing-subscriber.workspace = true\ntracing.workspace = true\ntracing-chrome.workspace = true\nrayon.workspace = true\ntempfile.workspace = true\nfs_extra.workspace = true\ncomfy-table.workspace = true\nplotters.workspace = true\ncreate-output-dir.workspace = true\nmimalloc.workspace = true\n\n[[bin]]\nname = \"snforge\"\npath = \"src/main.rs\"\n\n[dev-dependencies]\nassert_fs.workspace = true\nsnapbox.workspace = true\naxum.workspace = true\ncairo-lang-starknet-classes.workspace = true\nwalkdir.workspace = true\ntest-case.workspace = true\nitertools.workspace = true\ninsta.workspace = true\ndocs = { workspace = true, features = [\"testing\"] }\npackages_validation = { path = \"../testing/packages_validation\" }\nproject-root.workspace = true\n"
  },
  {
    "path": "crates/forge/src/block_number_map.rs",
    "content": "use anyhow::{Result, anyhow};\nuse conversions::{IntoConv, string::IntoHexStr};\nuse starknet_api::block::BlockNumber;\nuse starknet_rust::{\n    core::types::{BlockId, MaybePreConfirmedBlockWithTxHashes},\n    providers::{JsonRpcClient, Provider, jsonrpc::HttpTransport},\n};\nuse starknet_types_core::felt::Felt;\nuse std::collections::HashMap;\nuse std::sync::Mutex;\nuse tokio::runtime::Handle;\nuse url::Url;\n\n/// Caches block numbers fetched from RPC nodes, shared across concurrent config passes.\n#[derive(Default)]\npub struct BlockNumberMap {\n    url_to_latest_block_number: Mutex<HashMap<Url, BlockNumber>>,\n    url_and_hash_to_block_number: Mutex<HashMap<(Url, Felt), BlockNumber>>,\n}\n\nimpl BlockNumberMap {\n    pub async fn get_latest_block_number(&self, url: Url) -> Result<BlockNumber> {\n        // Release lock before awaiting.\n        {\n            let map = self.url_to_latest_block_number.lock().unwrap();\n            if let Some(&block_number) = map.get(&url) {\n                return Ok(block_number);\n            }\n        }\n\n        let fetched = fetch_latest_block_number(url.clone()).await?;\n\n        // or_insert avoids overwriting if a concurrent task raced us.\n        let mut map = self.url_to_latest_block_number.lock().unwrap();\n        Ok(*map.entry(url).or_insert(fetched))\n    }\n\n    pub async fn get_block_number_for_hash(&self, url: Url, hash: Felt) -> Result<BlockNumber> {\n        {\n            let map = self.url_and_hash_to_block_number.lock().unwrap();\n            if let Some(&block_number) = map.get(&(url.clone(), hash)) {\n                return Ok(block_number);\n            }\n        }\n\n        let fetched = fetch_block_number_for_hash(url.clone(), hash).await?;\n\n        let mut map = self.url_and_hash_to_block_number.lock().unwrap();\n        Ok(*map.entry((url, hash)).or_insert(fetched))\n    }\n\n    #[must_use]\n    pub fn get_url_to_latest_block_number(&self) -> HashMap<Url, BlockNumber> {\n        self.url_to_latest_block_number.lock().unwrap().clone()\n    }\n}\n\nasync fn fetch_latest_block_number(url: Url) -> Result<BlockNumber> {\n    let client = JsonRpcClient::new(HttpTransport::new(url));\n\n    Ok(Handle::current()\n        .spawn(async move { client.block_number().await })\n        .await?\n        .map(BlockNumber)?)\n}\n\nasync fn fetch_block_number_for_hash(url: Url, block_hash: Felt) -> Result<BlockNumber> {\n    let client = JsonRpcClient::new(HttpTransport::new(url));\n\n    let hash = BlockId::Hash(block_hash.into_());\n\n    match Handle::current()\n        .spawn(async move { client.get_block_with_tx_hashes(hash).await })\n        .await?\n    {\n        Ok(MaybePreConfirmedBlockWithTxHashes::Block(block)) => Ok(BlockNumber(block.block_number)),\n        _ => Err(anyhow!(\n            \"Could not get the block number for block with hash 0x{}\",\n            block_hash.into_hex_string()\n        )),\n    }\n}\n"
  },
  {
    "path": "crates/forge/src/clean.rs",
    "content": "use crate::{CleanArgs, CleanComponent};\nuse anyhow::{Context, Result, ensure};\nuse camino::Utf8PathBuf;\nuse foundry_ui::UI;\nuse scarb_api::metadata::{MetadataOpts, metadata_with_opts};\nuse std::fs;\n\nconst COVERAGE_DIR: &str = \"coverage\";\nconst PROFILE_DIR: &str = \"profile\";\nconst CACHE_DIR: &str = \".snfoundry_cache\";\nconst TRACE_DIR: &str = \"snfoundry_trace\";\n\npub fn clean(args: CleanArgs, ui: &UI) -> Result<()> {\n    let components = if args.clean_components.contains(&CleanComponent::All) {\n        ensure!(\n            args.clean_components.len() == 1,\n            \"The 'all' component cannot be combined with other components\"\n        );\n        vec![\n            CleanComponent::Trace,\n            CleanComponent::Profile,\n            CleanComponent::Cache,\n            CleanComponent::Coverage,\n        ]\n    } else {\n        args.clean_components\n    };\n\n    let scarb_metadata = metadata_with_opts(MetadataOpts {\n        no_deps: true,\n        ..MetadataOpts::default()\n    })?;\n    let workspace_root = scarb_metadata.workspace.root;\n\n    let packages_root: Vec<Utf8PathBuf> = scarb_metadata\n        .packages\n        .into_iter()\n        .map(|package_metadata| package_metadata.root)\n        .collect();\n\n    for component in &components {\n        match component {\n            CleanComponent::Coverage => clean_dirs(&packages_root, COVERAGE_DIR, ui)?,\n            CleanComponent::Profile => clean_dirs(&packages_root, PROFILE_DIR, ui)?,\n            CleanComponent::Cache => clean_dir(&workspace_root, CACHE_DIR, ui)?,\n            CleanComponent::Trace => clean_dir(&workspace_root, TRACE_DIR, ui)?,\n            CleanComponent::All => unreachable!(\"All component should have been handled earlier\"),\n        }\n    }\n\n    Ok(())\n}\n\nfn clean_dirs(root_dirs: &[Utf8PathBuf], dir_name: &str, ui: &UI) -> Result<()> {\n    for root_dir in root_dirs {\n        clean_dir(root_dir, dir_name, ui)?;\n    }\n    Ok(())\n}\nfn clean_dir(dir: &Utf8PathBuf, dir_name: &str, ui: &UI) -> Result<()> {\n    let dir = dir.join(dir_name);\n    if dir.exists() {\n        fs::remove_dir_all(&dir).with_context(|| format!(\"Failed to remove directory: {dir}\"))?;\n        ui.println(&format!(\"Removed directory: {dir}\"));\n    }\n\n    Ok(())\n}\n"
  },
  {
    "path": "crates/forge/src/combine_configs.rs",
    "content": "use crate::TestArgs;\nuse crate::scarb::config::ForgeConfigFromScarb;\nuse camino::Utf8PathBuf;\nuse cheatnet::runtime_extensions::forge_runtime_extension::contracts_data::ContractsData;\nuse forge_runner::forge_config::{\n    ExecutionDataToSave, ForgeConfig, OutputConfig, TestRunnerConfig,\n};\nuse rand::{RngCore, thread_rng};\nuse std::env;\nuse std::num::NonZeroU32;\nuse std::sync::Arc;\n\npub fn combine_configs(\n    args: &TestArgs,\n    contracts_data: ContractsData,\n    cache_dir: Utf8PathBuf,\n    forge_config_from_scarb: &ForgeConfigFromScarb,\n) -> ForgeConfig {\n    let execution_data_to_save = ExecutionDataToSave::from_flags(\n        args.save_trace_data || forge_config_from_scarb.save_trace_data,\n        args.build_profile || forge_config_from_scarb.build_profile,\n        args.coverage || forge_config_from_scarb.coverage,\n        &args.additional_args,\n    );\n\n    ForgeConfig {\n        test_runner_config: Arc::new(TestRunnerConfig {\n            exit_first: args.exit_first || forge_config_from_scarb.exit_first,\n            deterministic_output: args.deterministic_output,\n            fuzzer_runs: args\n                .fuzzer_runs\n                .or(forge_config_from_scarb.fuzzer_runs)\n                .unwrap_or(NonZeroU32::new(256).unwrap()),\n            fuzzer_seed: args\n                .fuzzer_seed\n                .or(forge_config_from_scarb.fuzzer_seed)\n                .unwrap_or_else(|| thread_rng().next_u64()),\n            max_n_steps: args.max_n_steps.or(forge_config_from_scarb.max_n_steps),\n            is_vm_trace_needed: execution_data_to_save.is_vm_trace_needed(),\n            cache_dir,\n            contracts_data,\n            tracked_resource: args.tracked_resource,\n            environment_variables: env::vars().collect(),\n            launch_debugger: args.launch_debugger,\n        }),\n        output_config: Arc::new(OutputConfig {\n            trace_args: args.trace_args.clone(),\n            detailed_resources: args.detailed_resources\n                || forge_config_from_scarb.detailed_resources,\n            execution_data_to_save,\n            gas_report: args.gas_report || forge_config_from_scarb.gas_report,\n        }),\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::combine_configs;\n    use crate::TestArgs;\n    use crate::scarb::config::ForgeConfigFromScarb;\n    use camino::Utf8PathBuf;\n    use cheatnet::runtime_extensions::forge_runtime_extension::contracts_data::ContractsData;\n    use clap::Parser;\n    use forge_runner::debugging::TraceArgs;\n    use forge_runner::forge_config::{\n        ExecutionDataToSave, ForgeConfig, ForgeTrackedResource, OutputConfig, TestRunnerConfig,\n    };\n    use std::num::NonZeroU32;\n    use std::sync::Arc;\n\n    #[test]\n    fn fuzzer_default_seed() {\n        let args = TestArgs::parse_from([\"snforge\"]);\n        let config = combine_configs(\n            &args,\n            ContractsData::default(),\n            Utf8PathBuf::default(),\n            &ForgeConfigFromScarb::default(),\n        );\n        let config2 = combine_configs(\n            &args,\n            ContractsData::default(),\n            Utf8PathBuf::default(),\n            &ForgeConfigFromScarb::default(),\n        );\n\n        assert_ne!(config.test_runner_config.fuzzer_seed, 0);\n        assert_ne!(config2.test_runner_config.fuzzer_seed, 0);\n        assert_ne!(\n            config.test_runner_config.fuzzer_seed,\n            config2.test_runner_config.fuzzer_seed\n        );\n    }\n\n    #[test]\n    fn runner_config_default_arguments() {\n        let args = TestArgs::parse_from([\"snforge\"]);\n        let config = combine_configs(\n            &args,\n            ContractsData::default(),\n            Utf8PathBuf::default(),\n            &ForgeConfigFromScarb::default(),\n        );\n        assert_eq!(\n            config,\n            ForgeConfig {\n                test_runner_config: Arc::new(TestRunnerConfig {\n                    exit_first: false,\n                    deterministic_output: false,\n                    fuzzer_runs: NonZeroU32::new(256).unwrap(),\n                    fuzzer_seed: config.test_runner_config.fuzzer_seed,\n                    max_n_steps: None,\n                    tracked_resource: ForgeTrackedResource::SierraGas,\n                    is_vm_trace_needed: false,\n                    cache_dir: Utf8PathBuf::default(),\n                    contracts_data: ContractsData::default(),\n                    environment_variables: config.test_runner_config.environment_variables.clone(),\n                    launch_debugger: false,\n                }),\n                output_config: Arc::new(OutputConfig {\n                    detailed_resources: false,\n                    execution_data_to_save: ExecutionDataToSave::default(),\n                    trace_args: TraceArgs::default(),\n                    gas_report: false,\n                }),\n            }\n        );\n    }\n\n    #[test]\n    fn runner_config_just_scarb_arguments() {\n        let config_from_scarb = ForgeConfigFromScarb {\n            exit_first: true,\n            fork: vec![],\n            fuzzer_runs: Some(NonZeroU32::new(1234).unwrap()),\n            fuzzer_seed: Some(500),\n            detailed_resources: true,\n            save_trace_data: true,\n            build_profile: true,\n            coverage: true,\n            gas_report: true,\n            max_n_steps: Some(1_000_000),\n            tracked_resource: ForgeTrackedResource::CairoSteps,\n        };\n\n        let args = TestArgs::parse_from([\"snforge\"]);\n        let config = combine_configs(\n            &args,\n            ContractsData::default(),\n            Utf8PathBuf::default(),\n            &config_from_scarb,\n        );\n        assert_eq!(\n            config,\n            ForgeConfig {\n                test_runner_config: Arc::new(TestRunnerConfig {\n                    exit_first: true,\n                    deterministic_output: false,\n                    fuzzer_runs: NonZeroU32::new(1234).unwrap(),\n                    fuzzer_seed: 500,\n                    max_n_steps: Some(1_000_000),\n                    // tracked_resource comes from args only; ForgeConfigFromScarb.tracked_resource\n                    // is not used by combine_configs, so this stays at the args default.\n                    tracked_resource: ForgeTrackedResource::SierraGas,\n                    is_vm_trace_needed: true,\n                    cache_dir: Utf8PathBuf::default(),\n                    contracts_data: ContractsData::default(),\n                    environment_variables: config.test_runner_config.environment_variables.clone(),\n                    launch_debugger: false,\n                }),\n                output_config: Arc::new(OutputConfig {\n                    detailed_resources: true,\n                    execution_data_to_save: ExecutionDataToSave {\n                        trace: true,\n                        profile: true,\n                        coverage: true,\n                        additional_args: vec![],\n                    },\n                    trace_args: TraceArgs::default(),\n                    gas_report: true,\n                }),\n            }\n        );\n    }\n\n    #[test]\n    fn runner_config_argument_precedence() {\n        let config_from_scarb = ForgeConfigFromScarb {\n            exit_first: false,\n            fork: vec![],\n            fuzzer_runs: Some(NonZeroU32::new(1234).unwrap()),\n            fuzzer_seed: Some(1000),\n            detailed_resources: false,\n            save_trace_data: false,\n            build_profile: false,\n            coverage: false,\n            gas_report: false,\n            max_n_steps: Some(1234),\n            tracked_resource: ForgeTrackedResource::SierraGas,\n        };\n        // Note: --build-profile and --coverage conflict in clap, so only one can be used at a time.\n        // We use --save-trace-data + --build-profile here to verify precedence for trace/profile flags.\n        let args = TestArgs::parse_from([\n            \"snforge\",\n            \"--exit-first\",\n            \"--fuzzer-runs\",\n            \"100\",\n            \"--fuzzer-seed\",\n            \"32\",\n            \"--detailed-resources\",\n            \"--save-trace-data\",\n            \"--build-profile\",\n            \"--gas-report\",\n            \"--max-n-steps\",\n            \"1000000\",\n            \"--tracked-resource\",\n            \"cairo-steps\",\n        ]);\n        let config = combine_configs(\n            &args,\n            ContractsData::default(),\n            Utf8PathBuf::default(),\n            &config_from_scarb,\n        );\n\n        assert_eq!(\n            config,\n            ForgeConfig {\n                test_runner_config: Arc::new(TestRunnerConfig {\n                    exit_first: true,\n                    deterministic_output: false,\n                    fuzzer_runs: NonZeroU32::new(100).unwrap(),\n                    fuzzer_seed: 32,\n                    max_n_steps: Some(1_000_000),\n                    tracked_resource: ForgeTrackedResource::CairoSteps,\n                    is_vm_trace_needed: true,\n                    cache_dir: Utf8PathBuf::default(),\n                    contracts_data: ContractsData::default(),\n                    environment_variables: config.test_runner_config.environment_variables.clone(),\n                    launch_debugger: false,\n                }),\n                output_config: Arc::new(OutputConfig {\n                    detailed_resources: true,\n                    execution_data_to_save: ExecutionDataToSave {\n                        trace: true,\n                        profile: true,\n                        coverage: false,\n                        additional_args: vec![],\n                    },\n                    trace_args: TraceArgs::default(),\n                    gas_report: true,\n                }),\n            }\n        );\n    }\n}\n"
  },
  {
    "path": "crates/forge/src/compatibility_check.rs",
    "content": "use anyhow::{Context, Result, anyhow};\nuse foundry_ui::UI;\nuse regex::Regex;\nuse semver::Version;\nuse shared::command::CommandExt;\nuse std::cell::RefCell;\nuse std::process::Command;\n\ntype VersionParser<'a> = dyn Fn(&str) -> Result<Version> + 'a;\n\npub struct Requirement<'a> {\n    pub name: String,\n    pub command: RefCell<Command>,\n    pub version_parser: Box<VersionParser<'a>>,\n    pub helper_text: String,\n    pub minimal_version: Version,\n    pub minimal_recommended_version: Option<Version>,\n    pub maximal_recommended_version: Option<Version>,\n}\n\nimpl Requirement<'_> {\n    // TODO(#3404)\n    fn validate_and_get_output(&self) -> (bool, String) {\n        let version = self.get_version();\n        let mut is_valid;\n\n        let output = if let Ok(version) = version {\n            is_valid = version >= self.minimal_version;\n\n            let is_min_recommended = self.minimal_recommended_version.as_ref().is_none_or(\n                |minimal_recommended_version| {\n                    Self::version_satisfies_min(&version, minimal_recommended_version)\n                },\n            );\n            let is_max_recommended = self.maximal_recommended_version.as_ref().is_none_or(\n                |maximal_recommended_version| {\n                    Self::version_satisfies_max(&version, maximal_recommended_version)\n                },\n            );\n\n            let min_version_to_display = self\n                .minimal_recommended_version\n                .as_ref()\n                .unwrap_or(&self.minimal_version);\n\n            if !is_valid {\n                is_valid = false;\n                format!(\n                    \"❌ {} Version {} doesn't satisfy minimal {}\\n{}\",\n                    self.name, version, min_version_to_display, self.helper_text\n                )\n            } else if !is_min_recommended {\n                format!(\n                    \"⚠️  {} Version {} doesn't satisfy minimal recommended {}\\n{}\",\n                    self.name,\n                    version,\n                    self.minimal_recommended_version.as_ref().unwrap(),\n                    self.helper_text\n                )\n            } else if !is_max_recommended {\n                format!(\n                    \"⚠️  {} Version {} doesn't satisfy maximal recommended {}\\n{}\",\n                    self.name,\n                    version,\n                    self.maximal_recommended_version.as_ref().unwrap(),\n                    self.helper_text\n                )\n            } else {\n                format!(\"✅ {} {}\", self.name, version)\n            }\n        } else {\n            is_valid = false;\n            format!(\n                \"❌ {} is not installed or not added to the PATH\\n{}\\n\",\n                self.name, self.helper_text\n            )\n        };\n\n        (is_valid, output)\n    }\n\n    fn get_version(&self) -> Result<Version> {\n        let version_command_output = self.command.borrow_mut().output_checked()?;\n        let raw_version = String::from_utf8_lossy(&version_command_output.stdout)\n            .trim()\n            .to_string();\n\n        (self.version_parser)(&raw_version)\n    }\n\n    fn version_satisfies_min(version: &Version, required: &Version) -> bool {\n        version >= required\n    }\n\n    fn version_satisfies_max(version: &Version, required: &Version) -> bool {\n        (version.major, version.minor) <= (required.major, required.minor)\n    }\n}\n\npub struct RequirementsChecker<'a> {\n    output_on_success: bool,\n    requirements: Vec<Requirement<'a>>,\n}\n\nimpl<'a> RequirementsChecker<'a> {\n    pub(crate) fn new(output_on_success: bool) -> Self {\n        Self {\n            output_on_success,\n            requirements: Vec::new(),\n        }\n    }\n\n    pub fn add_requirement(&mut self, requirement: Requirement<'a>) {\n        self.requirements.push(requirement);\n    }\n\n    pub fn check(&self, ui: &UI) -> Result<()> {\n        let (validation_output, all_requirements_valid) = self.check_and_prepare_output();\n\n        if self.output_on_success || !all_requirements_valid {\n            ui.println(&validation_output);\n        }\n\n        if all_requirements_valid {\n            Ok(())\n        } else {\n            Err(anyhow!(\"Requirements not satisfied\"))\n        }\n    }\n\n    fn check_and_prepare_output(&self) -> (String, bool) {\n        let mut validation_output = \"Checking requirements\\n\\n\".to_string();\n        let mut all_valid = true;\n\n        for requirement in &self.requirements {\n            let (is_valid, output) = requirement.validate_and_get_output();\n\n            all_valid &= is_valid;\n            validation_output += output.as_str();\n            validation_output += \"\\n\";\n        }\n\n        (validation_output, all_valid)\n    }\n}\n\npub fn create_version_parser<'a>(name: &'a str, pattern: &'a str) -> Box<VersionParser<'a>> {\n    let regex = Regex::new(pattern).unwrap();\n    Box::new(move |raw_version: &str| {\n        let matches = regex.captures(raw_version).with_context(|| {\n            format!(\"Failed to match {name} version from output: {raw_version}\")\n        })?;\n        let version_str = matches\n            .name(\"version\")\n            .with_context(|| format!(\"Failed to parse {name} version\"))?\n            .as_str();\n        Version::parse(version_str).with_context(|| \"Failed to parse version\")\n    })\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use crate::MINIMAL_SCARB_VERSION;\n    use assert_fs::{\n        TempDir,\n        fixture::{FileWriteStr, PathChild},\n    };\n    use scarb_api::ScarbCommand;\n\n    #[test]\n    fn happy_case() {\n        let mut requirements_checker = RequirementsChecker::new(true);\n        requirements_checker.add_requirement(Requirement {\n            name: \"Rust\".to_string(),\n            command: RefCell::new({\n                let mut cmd = Command::new(\"rustc\");\n                cmd.arg(\"--version\");\n                cmd\n            }),\n            version_parser: create_version_parser(\n                \"Rust\",\n                r\"rustc (?<version>[0-9]+.[0-9]+.[0-9]+)\",\n            ),\n            helper_text: \"Follow instructions from https://www.rust-lang.org/tools/install\"\n                .to_string(),\n            minimal_version: Version::new(1, 80, 1),\n            minimal_recommended_version: None,\n            maximal_recommended_version: None,\n        });\n        requirements_checker.add_requirement(Requirement {\n            name: \"Scarb\".to_string(),\n            command: RefCell::new(ScarbCommand::new().arg(\"--version\").command()),\n            minimal_version: MINIMAL_SCARB_VERSION,\n            minimal_recommended_version: Some(Version::new(2, 9, 4)),\n            maximal_recommended_version: None,\n            helper_text: \"Follow instructions from https://docs.swmansion.com/scarb/download.html\"\n                .to_string(),\n            version_parser: create_version_parser(\n                \"Scarb\",\n                r\"scarb (?<version>[0-9]+.[0-9]+.[0-9]+)\",\n            ),\n        });\n        requirements_checker.add_requirement(Requirement {\n            name: \"Universal Sierra Compiler\".to_string(),\n            command: RefCell::new(universal_sierra_compiler_api::version_command().unwrap()),\n            minimal_version: Version::new(2, 0, 0),\n             minimal_recommended_version: None,\n            maximal_recommended_version: None,\n            helper_text: \"Reinstall `snforge` using the same installation method or follow instructions from https://foundry-rs.github.io/starknet-foundry/getting-started/installation.html#universal-sierra-compiler-update\".to_string(),\n            version_parser: create_version_parser(\n                \"Universal Sierra Compiler\",\n                r\"universal-sierra-compiler (?<version>[0-9]+.[0-9]+.[0-9]+)\",\n            ),\n        });\n\n        let (validation_output, is_valid) = requirements_checker.check_and_prepare_output();\n\n        assert!(is_valid);\n        assert!(validation_output.contains(\"✅ Rust\"));\n        assert!(validation_output.contains(\"✅ Scarb\"));\n        assert!(validation_output.contains(\"✅ Universal Sierra Compiler\"));\n    }\n\n    #[test]\n    fn failing_requirements() {\n        let mut requirements_checker = RequirementsChecker::new(true);\n        requirements_checker.add_requirement(Requirement {\n            name: \"Rust\".to_string(),\n            command: RefCell::new({\n                let mut cmd = Command::new(\"rustc\");\n                cmd.arg(\"--version\");\n                cmd\n            }),\n            version_parser: create_version_parser(\n                \"Rust\",\n                r\"rustc (?<version>[0-9]+.[0-9]+.[0-9]+)\",\n            ),\n            helper_text: \"Follow instructions from https://www.rust-lang.org/tools/install\"\n                .to_string(),\n            minimal_version: Version::new(999, 0, 0),\n            minimal_recommended_version: None,\n            maximal_recommended_version: None,\n        });\n\n        let (validation_output, is_valid) = requirements_checker.check_and_prepare_output();\n        assert!(!is_valid);\n        assert!(validation_output.contains(\"❌ Rust Version\"));\n        assert!(validation_output.contains(\"doesn't satisfy minimal 999.0.0\"));\n    }\n\n    #[test]\n    fn warning_requirements() {\n        let mut requirements_checker = RequirementsChecker::new(true);\n        requirements_checker.add_requirement(Requirement {\n            name: \"Scarb\".to_string(),\n            command: RefCell::new(ScarbCommand::new().arg(\"--version\").command()),\n            minimal_version: MINIMAL_SCARB_VERSION,\n            minimal_recommended_version: Some(Version::new(999, 0, 0)),\n            maximal_recommended_version: None,\n            helper_text: \"Follow instructions from https://docs.swmansion.com/scarb/download.html\"\n                .to_string(),\n            version_parser: create_version_parser(\n                \"Scarb\",\n                r\"scarb (?<version>[0-9]+.[0-9]+.[0-9]+)\",\n            ),\n        });\n\n        let (validation_output, is_valid) = requirements_checker.check_and_prepare_output();\n\n        let ui = UI::default();\n        ui.println(&validation_output);\n\n        assert!(is_valid);\n        assert!(validation_output.contains(\"⚠️  Scarb Version\"));\n        assert!(validation_output.contains(\"doesn't satisfy minimal recommended 999.0.0\"));\n    }\n\n    #[test]\n    fn failing_requirements_on_both_minimal_versions_defined() {\n        let mut requirements_checker = RequirementsChecker::new(true);\n        requirements_checker.add_requirement(Requirement {\n            name: \"Scarb\".to_string(),\n            command: RefCell::new(ScarbCommand::new().arg(\"--version\").command()),\n            minimal_version: Version::new(111, 0, 0),\n            minimal_recommended_version: Some(Version::new(999, 0, 0)),\n            maximal_recommended_version: None,\n            helper_text: \"Follow instructions from https://docs.swmansion.com/scarb/download.html\"\n                .to_string(),\n            version_parser: create_version_parser(\n                \"Scarb\",\n                r\"scarb (?<version>[0-9]+.[0-9]+.[0-9]+)\",\n            ),\n        });\n\n        let (validation_output, is_valid) = requirements_checker.check_and_prepare_output();\n\n        assert!(!is_valid);\n        assert!(validation_output.contains(\"❌ Scarb Version\"));\n        assert!(validation_output.contains(\"doesn't satisfy minimal 999.0.0\"));\n    }\n\n    #[test]\n    #[cfg_attr(not(feature = \"no_scarb_installed\"), ignore)]\n    fn failing_tool_not_installed() {\n        let temp_dir = TempDir::new().unwrap();\n        temp_dir\n            .child(\".tool-versions\")\n            .write_str(\"scarb 2.9.9\\n\")\n            .unwrap();\n\n        let mut requirements_checker = RequirementsChecker::new(true);\n        requirements_checker.add_requirement(Requirement {\n            name: \"Scarb\".to_string(),\n            command: RefCell::new(\n                ScarbCommand::new()\n                    .arg(\"--version\")\n                    .current_dir(temp_dir.path())\n                    .command(),\n            ),\n            minimal_version: Version::new(2, 8, 5),\n            minimal_recommended_version: Some(Version::new(2, 9, 4)),\n            maximal_recommended_version: None,\n            helper_text: \"Follow instructions from https://docs.swmansion.com/scarb/download.html\"\n                .to_string(),\n            version_parser: create_version_parser(\n                \"Scarb\",\n                r\"scarb (?<version>[0-9]+.[0-9]+.[0-9]+)\",\n            ),\n        });\n        requirements_checker.add_requirement(Requirement {\n            name: \"Universal Sierra Compiler\".to_string(),\n            command: RefCell::new(universal_sierra_compiler_api::version_command().unwrap()),\n            minimal_version: Version::new(2, 4, 0),\n            minimal_recommended_version: None,\n            maximal_recommended_version: None,\n            helper_text: \"Reinstall `snforge` using the same installation method or follow instructions from https://foundry-rs.github.io/starknet-foundry/getting-started/installation.html#universal-sierra-compiler-update\".to_string(),\n            version_parser: create_version_parser(\n                \"Universal Sierra Compiler\",\n                r\"universal-sierra-compiler (?<version>[0-9]+.[0-9]+.[0-9]+)\",\n            ),\n        });\n\n        let (validation_output, is_valid) = requirements_checker.check_and_prepare_output();\n\n        assert!(!is_valid);\n        assert!(validation_output.contains(\"❌ Scarb is not installed or not added to the PATH\"));\n        assert!(\n            validation_output.contains(\n                \"Follow instructions from https://docs.swmansion.com/scarb/download.html\"\n            )\n        );\n        assert!(validation_output.contains(\"✅ Universal Sierra Compiler\"));\n    }\n\n    #[test]\n    fn warning_maximal_version() {\n        let mut requirements_checker = RequirementsChecker::new(true);\n        requirements_checker.add_requirement(Requirement {\n            name: \"Scarb\".to_string(),\n            command: RefCell::new(ScarbCommand::new().arg(\"--version\").command()),\n            minimal_version: Version::new(2, 8, 0),\n            minimal_recommended_version: Some(Version::new(2, 9, 4)),\n            maximal_recommended_version: Some(Version::new(2, 11, 0)),\n            helper_text: \"Follow instructions from https://docs.swmansion.com/scarb/download.html\"\n                .to_string(),\n            version_parser: create_version_parser(\n                \"Scarb\",\n                r\"scarb (?<version>[0-9]+.[0-9]+.[0-9]+)\",\n            ),\n        });\n\n        let (validation_output, is_valid) = requirements_checker.check_and_prepare_output();\n\n        let ui = UI::default();\n        ui.println(&validation_output);\n\n        assert!(is_valid);\n        assert!(validation_output.contains(\"⚠️  Scarb Version\"));\n        assert!(validation_output.contains(\"doesn't satisfy maximal recommended 2.11.0\"));\n    }\n\n    #[test]\n    fn test_version_satisfies_min() {\n        assert!(Requirement::version_satisfies_min(\n            &Version::new(2, 15, 5),\n            &Version::new(2, 15, 0)\n        ));\n\n        assert!(!Requirement::version_satisfies_min(\n            &Version::new(2, 15, 0),\n            &Version::new(2, 15, 2)\n        ));\n    }\n\n    #[test]\n    fn test_version_satisfies_max() {\n        assert!(Requirement::version_satisfies_max(\n            &Version::new(2, 15, 5),\n            &Version::new(2, 15, 0)\n        ));\n\n        assert!(!Requirement::version_satisfies_max(\n            &Version::new(2, 16, 0),\n            &Version::new(2, 15, 0)\n        ));\n    }\n}\n"
  },
  {
    "path": "crates/forge/src/lib.rs",
    "content": "use crate::compatibility_check::{Requirement, RequirementsChecker, create_version_parser};\nuse anyhow::Result;\nuse camino::Utf8PathBuf;\nuse clap::builder::BoolishValueParser;\nuse clap::{CommandFactory, Parser, Subcommand, ValueEnum};\nuse derive_more::Display;\nuse forge_runner::CACHE_DIR;\nuse forge_runner::debugging::TraceArgs;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse forge_runner::partition::Partition;\nuse foundry_ui::UI;\nuse foundry_ui::components::warning::WarningMessage;\nuse run_tests::workspace::run_for_workspace;\nuse scarb_api::ScarbCommand;\nuse scarb_api::metadata::metadata;\nuse scarb_ui::args::{FeaturesSpec, PackagesFilter, ProfileSpec};\nuse semver::Version;\nuse shared::auto_completions::{Completions, generate_completions};\nuse std::cell::RefCell;\nuse std::ffi::OsString;\nuse std::sync::Arc;\nuse std::{\n    fs,\n    num::{NonZeroU32, NonZeroUsize},\n    thread::available_parallelism,\n};\nuse tokio::runtime::Builder;\n\npub mod block_number_map;\nmod clean;\nmod combine_configs;\nmod compatibility_check;\nmod new;\nmod optimize_inlining;\nmod profile_validation;\npub mod run_tests;\npub mod scarb;\npub mod shared_cache;\npub mod test_filter;\nmod warn;\n\npub const CAIRO_EDITION: &str = \"2024_07\";\n\nconst MINIMAL_SCARB_VERSION: Version = Version::new(2, 12, 0);\nconst MINIMAL_RECOMMENDED_SCARB_VERSION: Version = Version::new(2, 15, 2);\nconst MAXIMAL_RECOMMENDED_SCARB_VERSION: Version = Version::new(2, 17, 0);\nconst MINIMAL_USC_VERSION: Version = Version::new(2, 0, 0);\nconst MINIMAL_SNFORGE_STD_VERSION: Version = Version::new(0, 50, 0);\n\n#[derive(Parser, Debug)]\n#[command(\n    version,\n    help_template = \"\\\n{name} {version}\n{author-with-newline}{about-with-newline}\nUse -h for short descriptions and --help for more details.\n\n{before-help}{usage-heading} {usage}\n\n{all-args}{after-help}\n\",\n    after_help = \"Read the docs: https://foundry-rs.github.io/starknet-foundry/\",\n    after_long_help = \"\\\nRead the docs:\n- Starknet Foundry Book: https://foundry-rs.github.io/starknet-foundry/\n- Cairo Book: https://book.cairo-lang.org/\n- Starknet Book: https://book.starknet.io/\n- Starknet Documentation: https://docs.starknet.io/\n- Scarb Documentation: https://docs.swmansion.com/scarb/docs.html\n\nJoin the community:\n- Follow core developers on X: https://twitter.com/swmansionxyz\n- Get support via Telegram: https://t.me/starknet_foundry_support\n- Or discord: https://discord.gg/starknet-community\n- Or join our general chat (Telegram): https://t.me/starknet_foundry\n\nReport bugs: https://github.com/foundry-rs/starknet-foundry/issues/new/choose\\\n\"\n)]\n#[command(about = \"snforge - a testing tool for Starknet contracts\", long_about = None)]\n#[command(name = \"snforge\")]\npub struct Cli {\n    #[command(subcommand)]\n    subcommand: ForgeSubcommand,\n}\n\n#[derive(Subcommand, Debug)]\nenum ForgeSubcommand {\n    /// Run tests for a project in the current directory\n    Test {\n        #[command(flatten)]\n        args: Box<TestArgs>,\n    },\n    /// Create a new Forge project at <PATH>\n    New {\n        #[command(flatten)]\n        args: NewArgs,\n    },\n    /// Clean `snforge` generated directories\n    Clean {\n        #[command(flatten)]\n        args: CleanArgs,\n    },\n    /// Clean Forge cache directory\n    CleanCache {},\n    /// Check if all `snforge` requirements are installed\n    CheckRequirements,\n    /// Generate completions script\n    Completions(Completions),\n    /// Find optimal inlining-strategy value to minimize gas cost\n    OptimizeInlining {\n        #[command(flatten)]\n        args: Box<optimize_inlining::OptimizeInliningArgs>,\n    },\n}\n\n#[derive(Parser, Debug)]\npub struct CleanArgs {\n    #[arg(num_args = 1.., required = true)]\n    pub clean_components: Vec<CleanComponent>,\n}\n\n#[derive(ValueEnum, Debug, Clone, PartialEq, Eq)]\npub enum CleanComponent {\n    /// Clean the `coverage` directory\n    Coverage,\n    /// Clean the `profile` directory\n    Profile,\n    /// Clean the `.snfoundry_cache` directory\n    Cache,\n    /// Clean the `snfoundry_trace` directory\n    Trace,\n    /// Clean all generated directories\n    All,\n}\n\n#[derive(ValueEnum, Debug, Clone)]\nenum ColorOption {\n    Auto,\n    Always,\n    Never,\n}\n\n#[derive(Parser, Debug)]\n#[expect(clippy::struct_excessive_bools)]\npub struct TestArgs {\n    /// Name used to filter tests\n    test_filter: Option<String>,\n\n    #[command(flatten)]\n    trace_args: TraceArgs,\n\n    /// Run contracts on `cairo-native` instead of the default `cairo-vm`. This will set `tracked-resource` to `sierra-gas`.\n    ///\n    /// Note: Only contracts execution through native is supported, test code itself will still run on `cairo-vm`.\n    #[arg(long)]\n    #[cfg(feature = \"cairo-native\")]\n    run_native: bool,\n\n    /// Use exact matches for `test_filter`\n    #[arg(short, long, conflicts_with = \"partition\", requires = \"test_filter\")]\n    exact: bool,\n\n    /// Skips any tests whose name contains the given SKIP string.\n    #[arg(long)]\n    skip: Vec<String>,\n\n    /// Stop executing tests after the first failed test\n    #[arg(short = 'x', long)]\n    exit_first: bool,\n\n    /// Sort test result outputs by test name, for reproducible outputs (e.g. for snapshot tests).\n    #[arg(long, env = \"SNFORGE_DETERMINISTIC_OUTPUT\", default_value_t = false, hide = true, value_parser = BoolishValueParser::new())]\n    deterministic_output: bool,\n\n    /// Number of fuzzer runs\n    #[arg(short = 'r', long)]\n    fuzzer_runs: Option<NonZeroU32>,\n    /// Seed for the fuzzer\n    #[arg(short = 's', long, env = \"SNFORGE_FUZZER_SEED\")]\n    fuzzer_seed: Option<u64>,\n\n    /// Run only tests marked with `#[ignore]` attribute\n    #[arg(long = \"ignored\")]\n    only_ignored: bool,\n    /// Run all tests regardless of `#[ignore]` attribute\n    #[arg(long, conflicts_with = \"only_ignored\")]\n    include_ignored: bool,\n\n    /// Display more detailed info about used resources\n    #[arg(long)]\n    detailed_resources: bool,\n\n    /// Control when colored output is used\n    #[arg(value_enum, long, default_value_t = ColorOption::Auto, value_name=\"WHEN\")]\n    color: ColorOption,\n\n    /// Run tests that failed during the last run\n    #[arg(long)]\n    rerun_failed: bool,\n\n    /// Save execution traces of all test which have passed and are not fuzz tests\n    #[arg(long)]\n    #[cfg_attr(feature = \"cairo-native\", arg(conflicts_with = \"run_native\"))]\n    save_trace_data: bool,\n\n    /// Build profiles of all tests which have passed and are not fuzz tests using the cairo-profiler\n    #[arg(long, conflicts_with_all = [\"coverage\"])]\n    #[cfg_attr(feature = \"cairo-native\", arg(conflicts_with_all = [\"run_native\", \"coverage\"]))]\n    build_profile: bool,\n\n    /// Generate a coverage report for the executed tests which have passed and are not fuzz tests using the cairo-coverage\n    #[arg(long, conflicts_with_all = [\"build_profile\"])]\n    #[cfg_attr(feature = \"cairo-native\", arg(conflicts_with_all = [\"run_native\", \"build_profile\"]))]\n    coverage: bool,\n\n    /// Number of maximum steps during a single test. For fuzz tests this value is applied to each subtest separately.\n    #[arg(long)]\n    max_n_steps: Option<u32>,\n\n    /// Build contracts separately in the scarb starknet contract target\n    #[arg(long)]\n    no_optimization: bool,\n\n    /// Specify tracked resource type\n    #[arg(long, value_enum, default_value_t)]\n    tracked_resource: ForgeTrackedResource,\n\n    /// Display a table of L2 gas breakdown for each contract and selector\n    #[arg(long)]\n    gas_report: bool,\n\n    /// Divides tests into `TOTAL` partitions and runs partition `INDEX` (1-based), e.g. 1/4\n    #[arg(long, value_name = \"INDEX/TOTAL\")]\n    partition: Option<Partition>,\n\n    /// Maximum number of threads used for test execution\n    #[arg(long)]\n    max_threads: Option<NonZeroUsize>,\n\n    /// Additional arguments for cairo-coverage or cairo-profiler\n    #[arg(last = true)]\n    additional_args: Vec<OsString>,\n\n    #[command(flatten)]\n    scarb_args: ScarbArgs,\n\n    /// Launch the given test in debug mode using `cairo-debugger` crate.\n    ///\n    /// It makes snforge act as a debug adapter, enabling communication with an editor/IDE\n    /// such as `VSCode` over DAP protocol.\n    #[arg(long, requires = \"exact\")]\n    #[cfg_attr(feature = \"cairo-native\", arg(conflicts_with = \"run_native\"))]\n    launch_debugger: bool,\n}\n\nimpl TestArgs {\n    /// Adjust dependent arguments based on related flags.\n    ///\n    /// This function mutates the `TestArgs` instance to enforce logical coherence\n    /// between fields.\n    pub fn normalize(&mut self) {\n        // Force using `SierraGas` as tracked resource when running with `cairo-native`,\n        // as otherwise it would run on vm.\n        #[cfg(feature = \"cairo-native\")]\n        if self.run_native {\n            self.tracked_resource = ForgeTrackedResource::SierraGas;\n        }\n    }\n}\n\n#[derive(Parser, Debug)]\npub struct ScarbArgs {\n    #[command(flatten)]\n    packages_filter: PackagesFilter,\n\n    #[command(flatten)]\n    features: FeaturesSpec,\n\n    #[command(flatten)]\n    profile: ProfileSpec,\n}\n\n#[derive(ValueEnum, Display, Debug, Clone)]\npub enum Template {\n    /// Simple Cairo program with unit tests\n    #[display(\"cairo-program\")]\n    CairoProgram,\n    /// Basic contract with example tests\n    #[display(\"balance-contract\")]\n    BalanceContract,\n    /// ERC20 contract for mock token\n    #[display(\"erc20-contract\")]\n    Erc20Contract,\n}\n\n#[derive(Parser, Debug)]\npub struct NewArgs {\n    /// Path to a location where the new project will be created\n    path: Utf8PathBuf,\n    /// Name of a new project, defaults to the directory name\n    #[arg(short, long)]\n    name: Option<String>,\n    /// Do not initialize a new Git repository\n    #[arg(long)]\n    no_vcs: bool,\n    /// Try to create the project even if the specified directory at <PATH> is not empty, which can result in overwriting existing files\n    #[arg(long)]\n    overwrite: bool,\n    /// Template to use for the new project\n    #[arg(short, long, default_value_t = Template::BalanceContract)]\n    template: Template,\n}\n\npub enum ExitStatus {\n    Success,\n    Failure,\n}\n\n#[tracing::instrument(skip_all, level = \"debug\")]\npub fn main_execution(ui: Arc<UI>) -> Result<ExitStatus> {\n    let cli = Cli::parse();\n\n    match cli.subcommand {\n        ForgeSubcommand::New { args } => {\n            new::new(args)?;\n            Ok(ExitStatus::Success)\n        }\n        ForgeSubcommand::Clean { args } => {\n            clean::clean(args, &ui)?;\n            Ok(ExitStatus::Success)\n        }\n        ForgeSubcommand::CleanCache {} => {\n            ui.println(&WarningMessage::new(\"`snforge clean-cache` is deprecated and will be removed in the future. Use `snforge clean cache` instead\"));\n            let scarb_metadata = metadata()?;\n            let cache_dir = scarb_metadata.workspace.root.join(CACHE_DIR);\n\n            if cache_dir.exists() {\n                fs::remove_dir_all(&cache_dir)?;\n            }\n\n            Ok(ExitStatus::Success)\n        }\n        ForgeSubcommand::Test { mut args } => {\n            args.normalize();\n            check_requirements(false, &ui)?;\n\n            let cores = resolve_thread_count(args.max_threads, &ui);\n            let rt = Builder::new_multi_thread()\n                .max_blocking_threads(cores)\n                .enable_all()\n                .build()?;\n\n            rt.block_on(run_for_workspace(*args, ui))\n        }\n        ForgeSubcommand::CheckRequirements => {\n            check_requirements(true, &ui)?;\n            Ok(ExitStatus::Success)\n        }\n        ForgeSubcommand::Completions(completions) => {\n            generate_completions(completions.shell, &mut Cli::command())?;\n            Ok(ExitStatus::Success)\n        }\n        ForgeSubcommand::OptimizeInlining { args } => {\n            let cores = resolve_thread_count(args.test_args.max_threads, &ui);\n            check_requirements(false, &ui)?;\n            optimize_inlining::optimize_inlining(&args, cores, &ui)\n        }\n    }\n}\n\n#[tracing::instrument(skip_all, level = \"debug\")]\nfn check_requirements(output_on_success: bool, ui: &UI) -> Result<()> {\n    let mut requirements_checker = RequirementsChecker::new(output_on_success);\n    requirements_checker.add_requirement(Requirement {\n        name: \"Scarb\".to_string(),\n        command: RefCell::new(ScarbCommand::new().arg(\"--version\").command()),\n        minimal_version: MINIMAL_SCARB_VERSION,\n        minimal_recommended_version: Some(MINIMAL_RECOMMENDED_SCARB_VERSION),\n        maximal_recommended_version: Some(MAXIMAL_RECOMMENDED_SCARB_VERSION),\n        helper_text: \"Follow instructions from https://docs.swmansion.com/scarb/download.html\"\n            .to_string(),\n        version_parser: create_version_parser(\"Scarb\", r\"scarb (?<version>[0-9]+.[0-9]+.[0-9]+)\"),\n    });\n\n    requirements_checker.add_requirement(Requirement {\n        name: \"Universal Sierra Compiler\".to_string(),\n        command: RefCell::new(universal_sierra_compiler_api::version_command()?),\n        minimal_version: MINIMAL_USC_VERSION,\n        minimal_recommended_version: None,\n        maximal_recommended_version: None,\n        helper_text: \"Reinstall `snforge` using the same installation method or follow instructions from https://foundry-rs.github.io/starknet-foundry/getting-started/installation.html#universal-sierra-compiler-update\".to_string(),\n        version_parser: create_version_parser(\n            \"Universal Sierra Compiler\",\n            r\"universal-sierra-compiler (?<version>[0-9]+.[0-9]+.[0-9]+)\",\n        ),\n    });\n    requirements_checker.check(ui)?;\n\n    Ok(())\n}\n\nfn resolve_thread_count(max_threads: Option<NonZeroUsize>, ui: &UI) -> usize {\n    match (available_parallelism(), max_threads) {\n        (Ok(available_cores), Some(max_threads)) => {\n            let available = available_cores.get();\n            let max = max_threads.get();\n            if max > available {\n                ui.println(&WarningMessage::new(format!(\n                    \"`--max-threads` value ({max}) is greater than the number of available cores ({available})\"\n                )));\n            }\n            max\n        }\n        (Ok(available_cores), None) => available_cores.get(),\n        (Err(_), Some(max_threads)) => {\n            ui.println(&WarningMessage::new(\n                \"Failed to get the number of available cores, using `--max-threads` value\",\n            ));\n            max_threads.get()\n        }\n        (Err(_), None) => {\n            ui.println(&WarningMessage::new(\n                \"Failed to get the number of available cores, defaulting to 1\",\n            ));\n            1\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/src/main.rs",
    "content": "use forge::{ExitStatus, main_execution};\nuse foundry_ui::{UI, components::error::ErrorMessage};\nuse mimalloc::MiMalloc;\nuse std::io::IsTerminal;\nuse std::process::ExitCode;\nuse std::sync::Arc;\nuse std::{env, io};\n\n#[global_allocator]\nstatic GLOBAL: MiMalloc = MiMalloc;\n\nfn main() -> ExitCode {\n    let _guard = init_logging();\n    let ui = Arc::new(UI::default());\n    match main_execution(ui.clone()) {\n        Ok(ExitStatus::Success) => ExitCode::SUCCESS,\n        Ok(ExitStatus::Failure) => ExitCode::from(1),\n        Err(error) => {\n            ui.println(&ErrorMessage::from(error));\n            ExitCode::from(2)\n        }\n    }\n}\n\nfn init_logging() -> Option<impl Drop> {\n    use chrono::Local;\n    use std::fs;\n\n    use std::path::PathBuf;\n    use tracing_chrome::ChromeLayerBuilder;\n    use tracing_subscriber::filter::{EnvFilter, LevelFilter, Targets};\n    use tracing_subscriber::fmt::Layer;\n    use tracing_subscriber::fmt::time::Uptime;\n    use tracing_subscriber::prelude::*;\n\n    let mut guard = None;\n\n    let fmt_layer = Layer::new()\n        .with_writer(io::stderr)\n        .with_ansi(io::stderr().is_terminal())\n        .with_timer(Uptime::default())\n        .with_filter(\n            EnvFilter::builder()\n                .with_default_directive(LevelFilter::WARN.into())\n                .with_env_var(\"SNFORGE_LOG\")\n                .from_env_lossy(),\n        );\n\n    let tracing_profile = env::var(\"SNFORGE_TRACING_PROFILE\").ok().is_some_and(|var| {\n        let s = var.as_str();\n        s == \"true\" || s == \"1\"\n    });\n\n    let profile_layer = if tracing_profile {\n        let mut path = PathBuf::from(format!(\n            \"./snforge-profile-{}.json\",\n            Local::now().to_rfc3339()\n        ));\n\n        // Create the file now, so that we early panic, and `fs::canonicalize` will work.\n        let profile_file = fs::File::create(&path).expect(\"failed to create profile file\");\n\n        // Try to canonicalize the path so that it is easier to find the file from logs.\n        if let Ok(canonical) = fs::canonicalize(&path) {\n            path = canonical;\n        }\n\n        eprintln!(\n            \"`snforge` run will output tracing profile to: {}\",\n            path.display()\n        );\n        eprintln!(\n            \"Open that file with https://ui.perfetto.dev (or chrome://tracing) to analyze it\"\n        );\n\n        let (profile_layer, profile_layer_guard) = ChromeLayerBuilder::new()\n            .writer(profile_file)\n            .include_args(true)\n            .build();\n\n        // Filter out less important logs because they're too verbose,\n        // and with them the profile file quickly grows to several GBs of data.\n        let profile_layer = profile_layer.with_filter(\n            Targets::new()\n                .with_default(LevelFilter::TRACE)\n                .with_target(\"salsa\", LevelFilter::WARN),\n        );\n\n        guard = Some(profile_layer_guard);\n        Some(profile_layer)\n    } else {\n        None\n    };\n\n    tracing::subscriber::set_global_default(\n        tracing_subscriber::registry()\n            .with(fmt_layer)\n            .with(profile_layer),\n    )\n    .expect(\"could not set up global logger\");\n\n    guard\n}\n"
  },
  {
    "path": "crates/forge/src/new.rs",
    "content": "use crate::scarb::config::SCARB_MANIFEST_TEMPLATE_CONTENT;\nuse crate::{CAIRO_EDITION, NewArgs, Template};\nuse anyhow::{Context, Ok, Result, anyhow, bail, ensure};\nuse camino::Utf8PathBuf;\nuse include_dir::{Dir, DirEntry, include_dir};\nuse indoc::formatdoc;\nuse scarb_api::version::scarb_version;\nuse scarb_api::{ScarbCommand, ensure_scarb_available};\nuse semver::Version;\nuse shared::consts::FREE_RPC_PROVIDER_URL;\nuse std::env;\nuse std::fs::{self, OpenOptions};\nuse std::io::Write;\nuse std::path::{Path, PathBuf};\nuse toml_edit::{Array, ArrayOfTables, DocumentMut, Item, Table, Value, value};\n\nconst OZ_INTERFACES_VERSION: Version = Version::new(2, 1, 0);\nconst OZ_TOKEN_VERSION: Version = Version::new(3, 0, 0);\nconst OZ_UTILS_VERSION: Version = Version::new(2, 1, 0);\n\nstatic TEMPLATES_DIR: Dir = include_dir!(\"snforge_templates\");\n\nconst SCARB_WITHOUT_CAIRO_TEST_TEMPLATE: Version = Version::new(2, 13, 0);\n\nstruct Dependency {\n    name: String,\n    version: String,\n    dev: bool,\n}\n\nimpl Dependency {\n    fn add(&self, scarb_manifest_path: &PathBuf) -> Result<()> {\n        let mut cmd = ScarbCommand::new_with_stdio();\n        cmd.manifest_path(scarb_manifest_path).offline().arg(\"add\");\n\n        if self.dev {\n            cmd.arg(\"--dev\");\n        }\n\n        cmd.arg(format!(\"{}@{}\", self.name, self.version))\n            .run()\n            .context(format!(\"Failed to add {} dependency\", self.name))?;\n\n        Ok(())\n    }\n}\n\nstruct TemplateManifestConfig {\n    dependencies: Vec<Dependency>,\n    contract_target: bool,\n    fork_config: bool,\n}\n\nimpl TemplateManifestConfig {\n    fn add_dependencies(&self, scarb_manifest_path: &PathBuf) -> Result<()> {\n        if env::var(\"DEV_DISABLE_SNFORGE_STD_DEPENDENCY\").is_err() {\n            let snforge_version = env!(\"CARGO_PKG_VERSION\");\n            Dependency {\n                name: \"snforge_std\".to_string(),\n                version: snforge_version.to_string(),\n                dev: true,\n            }\n            .add(scarb_manifest_path)?;\n        }\n\n        for dep in &self.dependencies {\n            dep.add(scarb_manifest_path)?;\n        }\n\n        Ok(())\n    }\n\n    fn update_config(&self, scarb_manifest_path: &Path) -> Result<()> {\n        let scarb_toml_content = fs::read_to_string(scarb_manifest_path)?;\n        let mut document = scarb_toml_content\n            .parse::<DocumentMut>()\n            .context(\"invalid document\")?;\n\n        if self.contract_target {\n            add_target_to_toml(&mut document);\n        }\n\n        set_cairo_edition(&mut document, CAIRO_EDITION);\n        add_test_script(&mut document);\n        add_assert_macros(&mut document)?;\n        add_allow_prebuilt_macros(&mut document)?;\n\n        if self.fork_config {\n            add_fork_config(&mut document)?;\n        }\n\n        fs::write(scarb_manifest_path, document.to_string())?;\n\n        Ok(())\n    }\n}\n\nimpl TryFrom<&Template> for TemplateManifestConfig {\n    type Error = anyhow::Error;\n\n    fn try_from(template: &Template) -> Result<Self> {\n        let cairo_version = scarb_version()?.cairo;\n        match template {\n            Template::CairoProgram => Ok(TemplateManifestConfig {\n                dependencies: vec![],\n                contract_target: false,\n                fork_config: false,\n            }),\n            Template::BalanceContract => Ok(TemplateManifestConfig {\n                dependencies: vec![Dependency {\n                    name: \"starknet\".to_string(),\n                    version: cairo_version.to_string(),\n                    dev: false,\n                }],\n                contract_target: true,\n                fork_config: false,\n            }),\n            Template::Erc20Contract => Ok(TemplateManifestConfig {\n                dependencies: vec![\n                    Dependency {\n                        name: \"starknet\".to_string(),\n                        version: cairo_version.to_string(),\n                        dev: false,\n                    },\n                    Dependency {\n                        name: \"openzeppelin_interfaces\".to_string(),\n                        version: OZ_INTERFACES_VERSION.to_string(),\n                        dev: false,\n                    },\n                    Dependency {\n                        name: \"openzeppelin_token\".to_string(),\n                        version: OZ_TOKEN_VERSION.to_string(),\n                        dev: false,\n                    },\n                    Dependency {\n                        name: \"openzeppelin_utils\".to_string(),\n                        version: OZ_UTILS_VERSION.to_string(),\n                        dev: false,\n                    },\n                ],\n                contract_target: true,\n                fork_config: true,\n            }),\n        }\n    }\n}\n\nfn create_snfoundry_manifest(path: &PathBuf) -> Result<()> {\n    fs::write(\n        path,\n        formatdoc! {r#\"\n        # Visit https://foundry-rs.github.io/starknet-foundry/appendix/snfoundry-toml.html\n        # and https://foundry-rs.github.io/starknet-foundry/projects/configuration.html for more information\n\n        # [sncast.default]                                         # Define a profile name\n        # url = \"{default_rpc_url}\" # Url of the RPC provider\n        # accounts-file = \"../account-file\"                        # Path to the file with the account data\n        # account = \"mainuser\"                                     # Account from `accounts_file` or default account file that will be used for the transactions\n        # keystore = \"~/keystore\"                                  # Path to the keystore file\n        # wait-params = {{ timeout = 300, retry-interval = 10 }}   # Wait for submitted transaction parameters\n        # block-explorer = \"Voyager\"                               # Block explorer service used to display links to transaction details\n        # show-explorer-links = true                               # Print links pointing to pages with transaction details in the chosen block explorer\n        \"#,\n            default_rpc_url = FREE_RPC_PROVIDER_URL,\n        },\n    )?;\n\n    Ok(())\n}\n\nfn add_template_to_scarb_manifest(path: &PathBuf) -> Result<()> {\n    if !path.exists() {\n        bail!(\"Scarb.toml not found\");\n    }\n\n    let mut file = OpenOptions::new()\n        .append(true)\n        .open(path)\n        .context(\"Failed to open Scarb.toml\")?;\n\n    file.write_all(SCARB_MANIFEST_TEMPLATE_CONTENT.as_bytes())\n        .context(\"Failed to write to Scarb.toml\")?;\n    Ok(())\n}\n\nfn overwrite_or_copy_template_files(\n    dir: &Dir,\n    template_path: &Path,\n    project_path: &Path,\n    project_name: &str,\n) -> Result<()> {\n    for entry in dir.entries() {\n        let path_without_template_name = entry.path().strip_prefix(template_path)?;\n        let destination = project_path.join(path_without_template_name);\n        match entry {\n            DirEntry::Dir(dir) => {\n                fs::create_dir_all(&destination)?;\n                overwrite_or_copy_template_files(dir, template_path, project_path, project_name)?;\n            }\n            DirEntry::File(file) => {\n                let contents = file.contents();\n                let contents = replace_project_name(contents, project_name)?;\n                fs::write(destination, contents)?;\n            }\n        }\n    }\n\n    Ok(())\n}\n\nfn replace_project_name(contents: &[u8], project_name: &str) -> Result<Vec<u8>> {\n    let contents = std::str::from_utf8(contents).context(\"UTF-8 error\")?;\n    let contents = contents.replace(\"{{ PROJECT_NAME }}\", project_name);\n    Ok(contents.into_bytes())\n}\n\nfn add_test_script(document: &mut DocumentMut) {\n    let mut test = Table::new();\n\n    test.insert(\"test\", value(\"snforge test\"));\n    document.insert(\"scripts\", Item::Table(test));\n}\n\nfn add_target_to_toml(document: &mut DocumentMut) {\n    let mut array_of_tables = ArrayOfTables::new();\n    let mut sierra = Table::new();\n    let mut contract = Table::new();\n    contract.set_implicit(true);\n\n    sierra.insert(\"sierra\", Item::Value(true.into()));\n    array_of_tables.push(sierra);\n    contract.insert(\"starknet-contract\", Item::ArrayOfTables(array_of_tables));\n\n    document.insert(\"target\", Item::Table(contract));\n}\n\nfn set_cairo_edition(document: &mut DocumentMut, cairo_edition: &str) {\n    document[\"package\"][\"edition\"] = value(cairo_edition);\n}\n\nfn add_assert_macros(document: &mut DocumentMut) -> Result<()> {\n    let version = scarb_version()?.cairo;\n\n    document\n        .entry(\"dev-dependencies\")\n        .or_insert(Item::Table(Table::new()))\n        .as_table_mut()\n        .context(\"Failed to get dev-dependencies from Scarb.toml\")?\n        .insert(\"assert_macros\", value(version.to_string()));\n\n    Ok(())\n}\n\nfn add_allow_prebuilt_macros(document: &mut DocumentMut) -> Result<()> {\n    let tool_section = document.entry(\"tool\").or_insert(Item::Table(Table::new()));\n    let tool_table = tool_section\n        .as_table_mut()\n        .context(\"Failed to get tool table from Scarb.toml\")?;\n    tool_table.set_implicit(true);\n\n    let mut scarb_table = Table::new();\n\n    let mut allow_prebuilt_macros = Array::new();\n    allow_prebuilt_macros.push(\"snforge_std\");\n\n    scarb_table.insert(\n        \"allow-prebuilt-plugins\",\n        Item::Value(Value::Array(allow_prebuilt_macros)),\n    );\n\n    tool_table.insert(\"scarb\", Item::Table(scarb_table));\n\n    Ok(())\n}\n\nfn add_fork_config(document: &mut DocumentMut) -> Result<()> {\n    let tool_section = document.entry(\"tool\").or_insert(Item::Table(Table::new()));\n    let tool_table = tool_section\n        .as_table_mut()\n        .context(\"Failed to get tool table from Scarb.toml\")?;\n\n    let mut fork_table = Table::new();\n    fork_table.insert(\"name\", Item::Value(Value::from(\"SEPOLIA_LATEST\")));\n    fork_table.insert(\"url\", Item::Value(Value::from(FREE_RPC_PROVIDER_URL)));\n\n    let mut block_id_table = Table::new();\n    block_id_table.insert(\"tag\", Item::Value(Value::from(\"latest\")));\n    fork_table.insert(\n        \"block_id\",\n        Item::Value(Value::from(block_id_table.into_inline_table())),\n    );\n\n    let mut array_of_tables = ArrayOfTables::new();\n    array_of_tables.push(fork_table);\n\n    let mut fork = Table::new();\n    fork.set_implicit(true);\n    fork.insert(\"fork\", Item::ArrayOfTables(array_of_tables));\n    tool_table.insert(\"snforge\", Item::Table(fork));\n\n    Ok(())\n}\n\nfn extend_gitignore(path: &Path) -> Result<()> {\n    if path.join(\".gitignore\").exists() {\n        let mut file = OpenOptions::new()\n            .append(true)\n            .open(path.join(\".gitignore\"))?;\n        writeln!(file, \".snfoundry_cache/\")?;\n        writeln!(file, \"snfoundry_trace/\")?;\n        writeln!(file, \"coverage/\")?;\n        writeln!(file, \"profile/\")?;\n    }\n    Ok(())\n}\n\npub fn new(\n    NewArgs {\n        path,\n        name,\n        no_vcs,\n        overwrite,\n        template,\n    }: NewArgs,\n) -> Result<()> {\n    ensure_scarb_available()?;\n    if !overwrite {\n        ensure!(\n            !path.exists() || path.read_dir().is_ok_and(|mut i| i.next().is_none()),\n            format!(\n                \"The provided path `{path}` points to a non-empty directory. If you wish to create a project in this directory, use the `--overwrite` flag\"\n            )\n        );\n    }\n    let name = infer_name(name, &path)?;\n    let scarb_version = scarb_version()?.scarb;\n\n    if matches!(template, Template::Erc20Contract) {\n        let min_scarb_version = Version::new(2, 15, 1);\n        ensure!(\n            scarb_version >= min_scarb_version,\n            format!(\n                \"The `erc20-contract` template requires Scarb version {min_scarb_version} or higher. Current Scarb version: {scarb_version}. Please update Scarb to use this template.\"\n            )\n        );\n    }\n\n    fs::create_dir_all(&path)?;\n    let project_path = path.canonicalize()?;\n    let scarb_manifest_path = project_path.join(\"Scarb.toml\");\n    let snfoundry_manifest_path = project_path.join(\"snfoundry.toml\");\n\n    // if there is no Scarb.toml run `scarb init`\n    if !scarb_manifest_path.is_file() {\n        let mut cmd = ScarbCommand::new_with_stdio();\n        cmd.current_dir(&project_path)\n            .args([\"init\", \"--name\", &name]);\n\n        if no_vcs {\n            cmd.arg(\"--no-vcs\");\n        }\n\n        // TODO(#3910)\n        let test_runner = if scarb_version < SCARB_WITHOUT_CAIRO_TEST_TEMPLATE {\n            \"cairo-test\"\n        } else {\n            \"none\"\n        };\n\n        cmd.env(\"SCARB_INIT_TEST_RUNNER\", test_runner)\n            .env(\"SCARB_INIT_EMPTY\", \"true\")\n            .run()\n            .context(\"Failed to initialize a new project\")?;\n\n        // TODO(#3910)\n        if scarb_version < SCARB_WITHOUT_CAIRO_TEST_TEMPLATE {\n            ScarbCommand::new_with_stdio()\n                .current_dir(&project_path)\n                .manifest_path(scarb_manifest_path.clone())\n                .offline()\n                .arg(\"remove\")\n                .arg(\"--dev\")\n                .arg(\"cairo_test\")\n                .run()\n                .context(\"Failed to remove cairo_test dependency\")?;\n        }\n    }\n\n    add_template_to_scarb_manifest(&scarb_manifest_path)?;\n\n    if !snfoundry_manifest_path.is_file() {\n        create_snfoundry_manifest(&snfoundry_manifest_path)?;\n    }\n\n    let template_config = TemplateManifestConfig::try_from(&template)?;\n    template_config.add_dependencies(&scarb_manifest_path)?;\n    template_config.update_config(&scarb_manifest_path)?;\n\n    let template_dir = get_template_dir(&template)?;\n    overwrite_or_copy_template_files(&template_dir, template_dir.path(), &project_path, &name)?;\n\n    extend_gitignore(&project_path)?;\n\n    // Fetch to create lock file.\n    if env::var(\"DEV_USE_OFFLINE_MODE\").is_err() {\n        ScarbCommand::new_with_stdio()\n            .manifest_path(scarb_manifest_path)\n            .arg(\"fetch\")\n            .run()\n            .context(\"Failed to fetch created project\")?;\n    }\n\n    Ok(())\n}\n\nfn infer_name(name: Option<String>, path: &Utf8PathBuf) -> Result<String> {\n    let name = if let Some(name) = name {\n        name\n    } else {\n        let Some(file_name) = path.file_name() else {\n            bail!(\"Cannot infer package name from path: {path}. Please: use the flag `--name`\");\n        };\n        file_name.to_string()\n    };\n\n    Ok(name)\n}\n\nfn get_template_dir(template: &Template) -> Result<Dir<'_>> {\n    let dir_name = match template {\n        Template::CairoProgram => \"cairo_program\",\n        Template::BalanceContract => \"balance_contract\",\n        Template::Erc20Contract => \"erc20_contract\",\n    };\n\n    TEMPLATES_DIR\n        .get_dir(dir_name)\n        .ok_or_else(|| anyhow!(\"Directory {dir_name} not found\"))\n        .cloned()\n}\n"
  },
  {
    "path": "crates/forge/src/optimize_inlining/args.rs",
    "content": "use crate::TestArgs;\nuse anyhow::{Result, ensure};\nuse clap::Parser;\nuse std::num::NonZeroU32;\n\n#[derive(Parser, Debug)]\npub struct OptimizeInliningArgs {\n    /// Minimum inlining-strategy value to test\n    // Arbitrary default value.\n    #[arg(long, default_value = \"0\")]\n    pub min_threshold: u32,\n\n    /// Maximum inlining-strategy value to test\n    // Arbitrary default value.\n    #[arg(long, default_value = \"250\")]\n    pub max_threshold: u32,\n\n    /// Step size for threshold search\n    // Arbitrary default value.\n    #[arg(long, default_value = \"25\")]\n    pub step: NonZeroU32,\n\n    /// Maximum allowed contract file size in bytes\n    // Limits are documented here: https://docs.starknet.io/learn/cheatsheets/chain-info#current-limits\n    #[arg(long, default_value = \"4089446\")]\n    pub max_contract_size: u64,\n\n    /// Maximum allowed length of compiled contract program.\n    // Limits are documented here: https://docs.starknet.io/learn/cheatsheets/chain-info#current-limits\n    #[arg(long, default_value = \"81920\")]\n    pub max_contract_program_len: u64,\n\n    /// Update Scarb.toml with the threshold that minimizes runtime gas cost\n    #[arg(long, conflicts_with = \"size\")]\n    pub gas: bool,\n\n    /// Update Scarb.toml with the threshold that minimizes contract size cost\n    #[arg(long, conflicts_with = \"gas\")]\n    pub size: bool,\n\n    /// Comma-delimited list of contract names or Cairo paths (e.g. `MyContract,pkg::MyOther`)\n    /// to include in contract size checks.\n    #[arg(long, value_delimiter = ',', required = true)]\n    pub contracts: Vec<String>,\n\n    /// Test arguments (same as for `snforge test`)\n    #[command(flatten)]\n    pub test_args: TestArgs,\n}\n\nimpl OptimizeInliningArgs {\n    pub fn validate(&self) -> Result<()> {\n        ensure!(\n            self.test_args.exact,\n            \"optimize-inlining requires using the `--exact` flag\"\n        );\n        ensure!(\n            self.min_threshold <= self.max_threshold,\n            \"min-threshold ({}) must be <= max-threshold ({})\",\n            self.min_threshold,\n            self.max_threshold\n        );\n        Ok(())\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::OptimizeInliningArgs;\n    use clap::Parser;\n\n    #[test]\n    fn validation_fails_without_exact() {\n        let args =\n            OptimizeInliningArgs::parse_from([\"snforge\", \"--contracts\", \"MyContract\", \"test_name\"]);\n        let error = args.validate().unwrap_err().to_string();\n        assert!(error.contains(\"optimize-inlining requires using the `--exact` flag\"));\n    }\n\n    #[test]\n    fn validation_fails_without_test_name() {\n        let args = OptimizeInliningArgs::try_parse_from([\n            \"snforge\",\n            \"--exact\",\n            \"--contracts\",\n            \"MyContract\",\n        ]);\n        let error = args.unwrap_err().to_string();\n        assert!(error.contains(\n            \"error: the following required arguments were not provided:\\n  <TEST_FILTER>\"\n        ));\n    }\n\n    #[test]\n    fn validation_passes_with_single_exact_test_name() {\n        let args = OptimizeInliningArgs::parse_from([\n            \"snforge\",\n            \"--exact\",\n            \"--contracts\",\n            \"MyContract\",\n            \"test_name\",\n        ]);\n        args.validate().unwrap();\n    }\n}\n"
  },
  {
    "path": "crates/forge/src/optimize_inlining/contract_size.rs",
    "content": "use anyhow::{Context, Result, bail};\nuse cairo_lang_starknet_classes::casm_contract_class::CasmContractClass;\nuse cairo_lang_starknet_classes::contract_class::ContractClass;\nuse camino::Utf8PathBuf;\nuse scarb_api::artifacts::deserialized::artifacts_for_package;\nuse std::collections::HashSet;\nuse std::fs;\n\nconst MODULE_PATH_SEPARATOR: &str = \"::\";\n\n#[derive(Debug)]\npub struct ContractSizeInfo {\n    pub contract_id: String,\n    pub artifact_type: ContractArtifactType,\n    pub size: u64,\n    pub felts_count: u64,\n}\n\n#[derive(Debug, Clone, Copy, PartialEq, Eq)]\n// Currently, we price both artifact types with the same weight.\n// Thus, this enum could be completely removed from the source code.\n// Kept for debugging and general code descriptivity.\npub enum ContractArtifactType {\n    Sierra,\n    Casm,\n}\n\npub fn check_and_validate_contract_sizes(\n    starknet_artifacts_paths: &[Utf8PathBuf],\n    max_size: u64,\n    max_felts_count: u64,\n    contracts_filter: &[String],\n) -> Result<(bool, Vec<ContractSizeInfo>)> {\n    let mut sizes = Vec::new();\n    let mut all_valid = true;\n    let mut matched_filters: HashSet<&str> = HashSet::new();\n    let mut available_contracts: Vec<String> = Vec::new();\n\n    for starknet_artifacts_path in starknet_artifacts_paths {\n        let artifacts = artifacts_for_package(starknet_artifacts_path.as_path())?;\n        let artifacts_dir = starknet_artifacts_path\n            .parent()\n            .expect(\"Starknet artifacts path must have a parent\");\n\n        for contract in &artifacts.contracts {\n            available_contracts.push(contract.contract_name.clone());\n\n            let matching_filter = contracts_filter.iter().find(|f| {\n                if contract.contract_name == **f {\n                    return true;\n                }\n                if !f.contains(MODULE_PATH_SEPARATOR) {\n                    return false;\n                }\n                contract.module_path.ends_with(f.as_str())\n            });\n            let Some(filter) = matching_filter else {\n                continue;\n            };\n            matched_filters.insert(filter.as_str());\n\n            let sierra_path = artifacts_dir.join(&contract.artifacts.sierra);\n            let size = get_contract_size(&sierra_path)?;\n            if size > max_size {\n                all_valid = false;\n            }\n            let class: ContractClass = serde_json::from_str(&fs::read_to_string(&sierra_path)?)?;\n            let sierra_felts: u64 = class.sierra_program.len() as u64;\n            if sierra_felts > max_felts_count {\n                all_valid = false;\n            }\n            sizes.push(ContractSizeInfo {\n                contract_id: contract.id.clone(),\n                artifact_type: ContractArtifactType::Sierra,\n                size,\n                felts_count: sierra_felts,\n            });\n\n            if let Some(casm_path) = &contract.artifacts.casm {\n                let casm_path = artifacts_dir.join(casm_path);\n                let size = get_contract_size(&casm_path)?;\n                if size > max_size {\n                    all_valid = false;\n                }\n                let class: CasmContractClass =\n                    serde_json::from_str(&fs::read_to_string(&casm_path)?)?;\n                let casm_felts: u64 = class.bytecode.len() as u64;\n                if casm_felts > max_felts_count {\n                    all_valid = false;\n                }\n                sizes.push(ContractSizeInfo {\n                    contract_id: contract.id.clone(),\n                    artifact_type: ContractArtifactType::Casm,\n                    size,\n                    felts_count: casm_felts,\n                });\n            }\n        }\n    }\n\n    let unmatched: Vec<&str> = contracts_filter\n        .iter()\n        .filter(|f| !matched_filters.contains(f.as_str()))\n        .map(String::as_str)\n        .collect();\n\n    if !unmatched.is_empty() {\n        bail!(\n            \"The following contracts were not found in starknet artifacts: {}. Available contracts: {}\",\n            unmatched.join(\", \"),\n            available_contracts.join(\", \")\n        );\n    }\n\n    Ok((all_valid, sizes))\n}\n\nfn get_contract_size(contract_path: &Utf8PathBuf) -> Result<u64> {\n    let size = fs::metadata(contract_path)\n        .with_context(|| format!(\"Failed to read {contract_path}\"))?\n        .len();\n    Ok(size)\n}\n"
  },
  {
    "path": "crates/forge/src/optimize_inlining/mod.rs",
    "content": "mod args;\nmod contract_size;\nmod optimizer;\nmod paths;\nmod runner;\n\npub use args::OptimizeInliningArgs;\n\nuse crate::ExitStatus;\nuse anyhow::{Context, Result, bail};\nuse camino::Utf8PathBuf;\nuse foundry_ui::UI;\nuse optimizer::Optimizer;\nuse paths::copy_project_to_temp_dir;\nuse scarb_api::manifest::ManifestEditor;\nuse scarb_api::metadata::{MetadataOpts, metadata_with_opts};\nuse std::sync::Arc;\n\npub fn optimize_inlining(\n    args: &OptimizeInliningArgs,\n    cores: usize,\n    ui: &Arc<UI>,\n) -> Result<ExitStatus> {\n    args.validate()?;\n\n    let profile = args.test_args.scarb_args.profile.specified();\n\n    ui.println(&format!(\n        \"Starting inlining strategy optimization...\\n\\\n         Search range: {} to {}, step: {}, max contract size: {} bytes, max felts: {}\",\n        args.min_threshold,\n        args.max_threshold,\n        args.step,\n        args.max_contract_size,\n        args.max_contract_program_len\n    ));\n\n    let original_metadata = metadata_with_opts(MetadataOpts {\n        profile: profile.clone(),\n        ..MetadataOpts::default()\n    })?;\n\n    let workspace_root = &original_metadata.workspace.root;\n    let target_dir = &original_metadata\n        .target_dir\n        .unwrap_or(workspace_root.join(\"target\"));\n\n    let temp_dir = copy_project_to_temp_dir(workspace_root)?;\n    let temp_path = Utf8PathBuf::try_from(temp_dir.path().to_path_buf())\n        .context(\"Temporary directory path is not valid UTF-8\")?;\n\n    let scarb_metadata = metadata_with_opts(MetadataOpts {\n        profile: profile.clone(),\n        current_dir: Some(temp_path.clone().into()),\n        ..MetadataOpts::default()\n    })?;\n\n    let manifest_editor = ManifestEditor::new(&original_metadata.runtime_manifest);\n\n    let mut optimizer = Optimizer::new(args, &scarb_metadata);\n    let optimization_result = optimizer.optimize(args, cores, ui);\n\n    ui.print_blank_line();\n    ui.println(&\"Optimization Results:\".to_string());\n    optimizer.print_results_table(ui);\n\n    let workspace_name = workspace_root\n        .file_name()\n        .map(|n| format!(\"{n}_\"))\n        .unwrap_or_default();\n    let graph_path = target_dir.join(format!(\n        \"{workspace_name}optimization_results_l_{}_h_{}_s_{}.png\",\n        args.min_threshold, args.max_threshold, args.step\n    ));\n    create_output_dir::create_output_dir(target_dir.as_std_path())?;\n    if let Err(e) = optimizer.save_results_graph(&graph_path, ui) {\n        ui.eprintln(&format!(\"Warning: Failed to save graph: {e}\"));\n    }\n\n    match optimization_result {\n        Ok(_) => {\n            let profile_name = profile.unwrap_or_else(|| \"release\".to_string());\n            let optimal = if args.gas {\n                Some(optimizer.find_best_result_by_gas()?)\n            } else if args.size {\n                Some(optimizer.find_best_result_by_contract_size()?)\n            } else {\n                None\n            };\n\n            if let Some(optimal) = optimal {\n                manifest_editor.set_inlining_strategy(optimal.threshold, &profile_name)?;\n                ui.println(&format!(\n                    \"Updated Scarb.toml with inlining-strategy = {}\",\n                    optimal.threshold\n                ));\n            } else {\n                ui.println(\n                    &\"Scarb.toml not modified. Use --gas or --size to apply a threshold.\"\n                        .to_string(),\n                );\n            }\n\n            Ok(ExitStatus::Success)\n        }\n        Err(e) => {\n            bail!(format!(\"Optimization failed: {e}\"));\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/src/optimize_inlining/optimizer.rs",
    "content": "use crate::optimize_inlining::args::OptimizeInliningArgs;\nuse crate::optimize_inlining::runner::{\n    OptimizationIterationResult, TotalGas, compile_default, run_optimization_iteration,\n};\nuse anyhow::{Result, anyhow};\nuse camino::Utf8Path;\nuse comfy_table::modifiers::UTF8_ROUND_CORNERS;\nuse comfy_table::presets::UTF8_FULL;\nuse comfy_table::{Cell, ContentArrangement, Table};\nuse foundry_ui::UI;\nuse plotters::prelude::*;\nuse plotters::style::{FontStyle, register_font};\nuse scarb_api::metadata::Metadata;\nuse std::num::NonZeroU32;\nuse std::sync::Arc;\n\nconst ROBOTO_REGULAR: &[u8] = include_bytes!(\"../../assets/fonts/Roboto-Regular.ttf\");\nconst ROBOTO_FAMILY: &str = \"roboto\";\n\npub struct Optimizer {\n    pub min_threshold: u32,\n    pub max_threshold: u32,\n    pub step: NonZeroU32,\n    pub results: Vec<OptimizationIterationResult>,\n    scarb_metadata: Metadata,\n}\n\npub struct OptimalResult {\n    pub threshold: u32,\n    pub total_gas: TotalGas,\n    pub contract_code_l2_gas: u64,\n}\n\nimpl Optimizer {\n    pub fn new(args: &OptimizeInliningArgs, scarb_metadata: &Metadata) -> Self {\n        Self {\n            min_threshold: args.min_threshold,\n            max_threshold: args.max_threshold,\n            step: args.step,\n            results: Vec::new(),\n            scarb_metadata: scarb_metadata.clone(),\n        }\n    }\n\n    pub fn optimize(\n        &mut self,\n        args: &OptimizeInliningArgs,\n        cores: usize,\n        ui: &Arc<UI>,\n    ) -> Result<OptimalResult> {\n        compile_default(&self.scarb_metadata, ui)?;\n        self.optimize_bruteforce(args, cores, ui)\n    }\n\n    pub fn find_best_result_by_gas(&self) -> Result<OptimalResult> {\n        Ok(self\n            .valid_results()?\n            .into_iter()\n            .min_by(|a, b| {\n                a.total_gas\n                    .l2()\n                    .total_cmp(&b.total_gas.l2())\n                    .then(a.contract_code_l2_gas.cmp(&b.contract_code_l2_gas))\n                    .then(a.threshold.cmp(&b.threshold))\n            })\n            .map(|r| OptimalResult {\n                threshold: r.threshold,\n                total_gas: r.total_gas.clone(),\n                contract_code_l2_gas: r.contract_code_l2_gas,\n            })\n            .expect(\"valid_results must return at least one result\"))\n    }\n\n    pub fn find_best_result_by_contract_size(&self) -> Result<OptimalResult> {\n        Ok(self\n            .valid_results()?\n            .into_iter()\n            .min_by(|a, b| {\n                a.contract_code_l2_gas\n                    .cmp(&b.contract_code_l2_gas)\n                    .then(a.total_gas.l2().total_cmp(&b.total_gas.l2()))\n                    .then(a.threshold.cmp(&b.threshold))\n            })\n            .map(|r| OptimalResult {\n                threshold: r.threshold,\n                total_gas: r.total_gas.clone(),\n                contract_code_l2_gas: r.contract_code_l2_gas,\n            })\n            .expect(\"valid_results must return at least one result\"))\n    }\n\n    pub fn print_results_table(&self, ui: &UI) {\n        let mut sorted_results: Vec<_> = self.results.iter().collect();\n        sorted_results.sort_by_key(|r| r.threshold);\n\n        let mut table = Table::new();\n        table.load_preset(UTF8_FULL);\n        table.apply_modifier(UTF8_ROUND_CORNERS);\n        table.set_content_arrangement(ContentArrangement::Dynamic);\n        table.set_header(vec![\n            Cell::new(\"Threshold\"),\n            Cell::new(\"Total Gas\"),\n            Cell::new(\"Contract Size\"),\n            Cell::new(\"Contract Bytecode L2 Gas\"),\n            Cell::new(\"Status\"),\n        ]);\n\n        for r in sorted_results {\n            let status = if r.tests_passed && r.error.is_none() {\n                \"✓\"\n            } else {\n                \"✗\"\n            };\n            let gas_str = if r.tests_passed && r.error.is_none() {\n                format!(\"{:.0}\", r.total_gas.l2())\n            } else {\n                \"-\".to_string()\n            };\n            table.add_row(vec![\n                Cell::new(r.threshold),\n                Cell::new(gas_str),\n                Cell::new(r.max_contract_size),\n                Cell::new(r.contract_code_l2_gas),\n                Cell::new(status),\n            ]);\n        }\n\n        ui.println(&table.to_string());\n\n        if let Ok(best) = self.find_best_result_by_gas() {\n            ui.print_blank_line();\n            ui.println(&format!(\n                \"Lowest runtime gas cost: threshold={}, gas={:.0}, contract bytecode L2 gas={}\",\n                best.threshold,\n                best.total_gas.l2(),\n                best.contract_code_l2_gas\n            ));\n        }\n        if let Ok(best) = self.find_best_result_by_contract_size() {\n            ui.println(&format!(\n                \"Lowest contract size cost: threshold={}, gas={:.0}, contract bytecode L2 gas={}\",\n                best.threshold,\n                best.total_gas.l2(),\n                best.contract_code_l2_gas\n            ));\n        }\n    }\n\n    #[allow(clippy::too_many_lines)]\n    pub fn save_results_graph(&self, output_path: &Utf8Path, ui: &UI) -> Result<()> {\n        for style in [\n            FontStyle::Normal,\n            FontStyle::Bold,\n            FontStyle::Oblique,\n            FontStyle::Italic,\n        ] {\n            register_font(ROBOTO_FAMILY, style, ROBOTO_REGULAR)\n                .map_err(|_| anyhow!(\"Failed to register bundled Roboto-Regular.ttf font\"))?;\n            register_font(\"sans-serif\", style, ROBOTO_REGULAR)\n                .map_err(|_| anyhow!(\"Failed to register bundled Roboto-Regular.ttf font\"))?;\n        }\n\n        let mut sorted_results = self.valid_results()?;\n\n        if sorted_results.len() < 2 {\n            ui.println(&\"Not enough data points to draw graph (need at least 2)\".to_string());\n            return Ok(());\n        }\n\n        sorted_results.sort_by_key(|r| r.threshold);\n\n        let (max_gas, max_contract_code_l2_gas) = self.get_max_values();\n\n        let gas_points: Vec<(f64, f64)> = sorted_results\n            .iter()\n            .map(|r| (f64::from(r.threshold), r.total_gas.l2() / max_gas))\n            .collect();\n\n        let bytecode_l2_gas_points: Vec<(f64, f64)> = sorted_results\n            .iter()\n            .map(|r| {\n                (f64::from(r.threshold), {\n                    #[allow(clippy::cast_precision_loss)]\n                    let gas = r.contract_code_l2_gas as f64;\n                    gas / max_contract_code_l2_gas\n                })\n            })\n            .collect();\n\n        let x_min = f64::from(self.min_threshold);\n        let x_max = f64::from(self.max_threshold);\n\n        let y_min = gas_points\n            .iter()\n            .chain(bytecode_l2_gas_points.iter())\n            .map(|(_, y)| *y)\n            .fold(f64::MAX, f64::min)\n            * 0.95;\n        let y_max = gas_points\n            .iter()\n            .chain(bytecode_l2_gas_points.iter())\n            .map(|(_, y)| *y)\n            .fold(f64::MIN, f64::max)\n            * 1.05;\n\n        let root = BitMapBackend::new(output_path.as_std_path(), (1920, 1080)).into_drawing_area();\n        root.fill(&WHITE)?;\n\n        let mut chart = ChartBuilder::on(&root)\n            .caption(\"Inlining Optimization Results\", (ROBOTO_FAMILY, 48))\n            .margin(40)\n            .x_label_area_size(80)\n            .y_label_area_size(100)\n            .build_cartesian_2d(x_min..x_max, y_min..y_max)?;\n\n        chart\n            .configure_mesh()\n            .x_desc(\"Threshold\")\n            .y_desc(\"Normalized Value\")\n            .label_style((ROBOTO_FAMILY, 24))\n            .x_label_formatter(&|x| format!(\"{x:.0}\"))\n            .y_label_formatter(&|y| format!(\"{y:.2}\"))\n            .draw()?;\n\n        chart\n            .draw_series(LineSeries::new(gas_points.clone(), RED.stroke_width(3)))?\n            .label(\"Gas\")\n            .legend(|(x, y)| PathElement::new(vec![(x, y), (x + 40, y)], RED.stroke_width(3)));\n\n        chart.draw_series(\n            gas_points\n                .iter()\n                .map(|(x, y)| Circle::new((*x, *y), 8, RED.filled())),\n        )?;\n\n        chart\n            .draw_series(LineSeries::new(\n                bytecode_l2_gas_points.clone(),\n                GREEN.stroke_width(3),\n            ))?\n            .label(\"Contract Bytecode L2 Gas\")\n            .legend(|(x, y)| PathElement::new(vec![(x, y), (x + 40, y)], GREEN.stroke_width(3)));\n\n        chart.draw_series(\n            bytecode_l2_gas_points\n                .iter()\n                .map(|(x, y)| Circle::new((*x, *y), 8, GREEN.filled())),\n        )?;\n\n        chart\n            .configure_series_labels()\n            .label_font((ROBOTO_FAMILY, 24))\n            .legend_area_size(50)\n            .background_style(WHITE.mix(0.8))\n            .border_style(BLACK)\n            .position(SeriesLabelPosition::UpperRight)\n            .draw()?;\n\n        root.present()?;\n\n        ui.print_blank_line();\n        ui.println(&format!(\"Graph saved to: {output_path}\"));\n\n        Ok(())\n    }\n\n    fn optimize_bruteforce(\n        &mut self,\n        args: &OptimizeInliningArgs,\n        cores: usize,\n        ui: &Arc<UI>,\n    ) -> Result<OptimalResult> {\n        let total_iterations = ((self.max_threshold - self.min_threshold) / self.step.get()) + 1;\n        let mut current = self.min_threshold;\n        let mut iteration = 1;\n\n        while current <= self.max_threshold {\n            if !self.results.iter().any(|r| r.threshold == current) {\n                ui.print_blank_line();\n                ui.println(&format!(\n                    \"[{iteration}/{total_iterations}] Testing threshold {current}...\",\n                ));\n\n                let result =\n                    run_optimization_iteration(current, args, &self.scarb_metadata, cores, ui)?;\n\n                if let Some(ref error) = result.error {\n                    ui.println(&format!(\"  ✗ {error}\"));\n                } else {\n                    ui.println(&format!(\n                        \"  ✓ Tests passed, gas: {:.0}, max contract size: {} bytes, contract bytecode L2 gas: {}\",\n                        result.total_gas.l2(),\n                        result.max_contract_size,\n                        result.contract_code_l2_gas\n                    ));\n                }\n\n                self.results.push(result);\n            }\n            current += self.step.get();\n            iteration += 1;\n        }\n\n        self.find_best_result_by_gas()\n    }\n\n    fn valid_results(&self) -> Result<Vec<&OptimizationIterationResult>> {\n        let results: Vec<_> = self\n            .results\n            .iter()\n            .filter(|r| r.tests_passed && r.error.is_none())\n            .collect();\n        if results.is_empty() {\n            return Err(anyhow!(\"No valid optimization results found\"));\n        }\n        Ok(results)\n    }\n\n    fn get_max_values(&self) -> (f64, f64) {\n        let valid_results = self.valid_results().unwrap_or_default();\n\n        let max_gas = valid_results\n            .iter()\n            .map(|r| r.total_gas.l2())\n            .fold(1.0_f64, f64::max);\n        let max_contract_code_l2_gas = valid_results\n            .iter()\n            .map(|r| r.contract_code_l2_gas)\n            .max()\n            .unwrap_or(1);\n\n        #[allow(clippy::cast_precision_loss)]\n        (max_gas, max_contract_code_l2_gas as f64)\n    }\n}\n"
  },
  {
    "path": "crates/forge/src/optimize_inlining/paths.rs",
    "content": "use anyhow::{Context, Result};\nuse camino::{Utf8Component, Utf8Path, Utf8PathBuf};\nuse scarb_api::manifest::overwrite_starknet_contract_target_flags;\nuse std::fs;\nuse toml_edit::{DocumentMut, Item, Value};\n\n// Instead of modifying user project in place (i.e. setting inlining strategy in manifest file), we copy it to a temp dir.\n// Note this operation is not a trivial recursive copy, as we take care to properly handle relative paths as well.\npub(super) fn copy_project_to_temp_dir(\n    workspace_root: &camino::Utf8Path,\n) -> Result<tempfile::TempDir> {\n    let temp_dir = tempfile::TempDir::new().context(\"Failed to create temporary directory\")?;\n\n    let options = fs_extra::dir::CopyOptions::new().content_only(true);\n\n    fs_extra::dir::copy(workspace_root, temp_dir.path(), &options)\n        .context(\"Failed to copy project to temporary directory\")?;\n\n    let copied_workspace_root = Utf8PathBuf::from_path_buf(temp_dir.path().to_path_buf())\n        .map_err(|_| anyhow::anyhow!(\"Temporary directory path is not valid UTF-8\"))?;\n    rewrite_manifest_paths_to_absolute(workspace_root, &copied_workspace_root)?;\n\n    Ok(temp_dir)\n}\n\npub(super) fn rewrite_manifest_paths_to_absolute(\n    original_workspace_root: &Utf8Path,\n    copied_workspace_root: &Utf8Path,\n) -> Result<()> {\n    rewrite_manifest_paths_in_dir(\n        original_workspace_root,\n        copied_workspace_root,\n        copied_workspace_root,\n    )\n}\n\nfn rewrite_manifest_paths_in_dir(\n    original_workspace_root: &Utf8Path,\n    copied_workspace_root: &Utf8Path,\n    dir: &Utf8Path,\n) -> Result<()> {\n    for entry in fs::read_dir(dir)? {\n        let entry = entry?;\n        let path = Utf8PathBuf::from_path_buf(entry.path())\n            .map_err(|_| anyhow::anyhow!(\"Workspace path is not valid UTF-8\"))?;\n\n        if path.is_dir() {\n            rewrite_manifest_paths_in_dir(original_workspace_root, copied_workspace_root, &path)?;\n            continue;\n        }\n\n        if path.file_name() != Some(\"Scarb.toml\") {\n            continue;\n        }\n\n        let relative_manifest_path = path\n            .strip_prefix(copied_workspace_root)\n            .context(\"Copied manifest path is outside copied workspace root\")?;\n        let original_manifest_path = original_workspace_root.join(relative_manifest_path);\n        let original_manifest_dir = original_manifest_path\n            .parent()\n            .context(\"Manifest path has no parent directory\")?;\n\n        rewrite_single_manifest_paths_to_absolute(\n            &path,\n            original_manifest_dir,\n            original_workspace_root,\n        )?;\n    }\n\n    Ok(())\n}\n\nfn rewrite_single_manifest_paths_to_absolute(\n    manifest_path: &Utf8Path,\n    original_manifest_dir: &Utf8Path,\n    original_workspace_root: &Utf8Path,\n) -> Result<()> {\n    let content = fs::read_to_string(manifest_path)?;\n    let mut doc = content\n        .parse::<DocumentMut>()\n        .context(\"Failed to parse copied Scarb.toml\")?;\n\n    let paths_rewritten = rewrite_dependency_paths_to_absolute(\n        &mut doc,\n        original_manifest_dir,\n        original_workspace_root,\n    );\n    let target_flags_overwritten = overwrite_starknet_contract_target_flags(&mut doc);\n\n    if paths_rewritten || target_flags_overwritten {\n        fs::write(manifest_path, doc.to_string())?;\n    }\n\n    Ok(())\n}\n\n// Rewrite path dependencies in package and workspace sections.\nfn rewrite_dependency_paths_to_absolute(\n    doc: &mut DocumentMut,\n    original_manifest_dir: &Utf8Path,\n    original_workspace_root: &Utf8Path,\n) -> bool {\n    let mut changed = false;\n\n    if let Some(workspace_dependencies) = doc\n        .as_table_mut()\n        .get_mut(\"workspace\")\n        .and_then(Item::as_table_mut)\n        .and_then(|workspace| workspace.get_mut(\"dependencies\"))\n    {\n        changed |= rewrite_dependency_table_paths_to_absolute(\n            workspace_dependencies,\n            original_manifest_dir,\n            original_workspace_root,\n        );\n    }\n\n    if let Some(package_dependencies) = doc.as_table_mut().get_mut(\"dependencies\") {\n        changed |= rewrite_dependency_table_paths_to_absolute(\n            package_dependencies,\n            original_manifest_dir,\n            original_workspace_root,\n        );\n    }\n\n    if let Some(package_dependencies) = doc.as_table_mut().get_mut(\"dev-dependencies\") {\n        changed |= rewrite_dependency_table_paths_to_absolute(\n            package_dependencies,\n            original_manifest_dir,\n            original_workspace_root,\n        );\n    }\n\n    changed\n}\n\nfn rewrite_dependency_table_paths_to_absolute(\n    dependencies_item: &mut Item,\n    original_manifest_dir: &Utf8Path,\n    original_workspace_root: &Utf8Path,\n) -> bool {\n    let Some(dependencies_table) = dependencies_item.as_table_mut() else {\n        return false;\n    };\n\n    let mut changed = false;\n    for (_, dependency_item) in dependencies_table.iter_mut() {\n        match dependency_item {\n            Item::Value(Value::InlineTable(inline_table)) => {\n                if let Some(path_value) = inline_table.get_mut(\"path\") {\n                    changed |= rewrite_value_if_relative_path(\n                        path_value,\n                        original_manifest_dir,\n                        original_workspace_root,\n                    );\n                }\n            }\n            Item::Table(dependency_table) => {\n                if let Some(path_item) = dependency_table.get_mut(\"path\")\n                    && let Some(path_value) = path_item.as_value_mut()\n                {\n                    changed |= rewrite_value_if_relative_path(\n                        path_value,\n                        original_manifest_dir,\n                        original_workspace_root,\n                    );\n                }\n            }\n            _ => {}\n        }\n    }\n\n    changed\n}\n\nfn rewrite_value_if_relative_path(\n    value_item: &mut Value,\n    original_manifest_dir: &Utf8Path,\n    original_workspace_root: &Utf8Path,\n) -> bool {\n    match value_item {\n        Value::String(path) => {\n            let path_str = path.value();\n            if let Some(absolute_path) =\n                absolutize_path(path_str, original_manifest_dir, original_workspace_root)\n            {\n                *value_item = Value::from(absolute_path);\n                return true;\n            }\n            false\n        }\n        _ => false,\n    }\n}\n\nfn absolutize_path(\n    path: &str,\n    original_manifest_dir: &Utf8Path,\n    original_workspace_root: &Utf8Path,\n) -> Option<String> {\n    let utf8_path = Utf8Path::new(path);\n    if utf8_path.is_absolute() {\n        None\n    } else {\n        let resolved_path = normalize_utf8_path_lexically(&original_manifest_dir.join(utf8_path));\n        if resolved_path.starts_with(original_workspace_root) {\n            None\n        } else {\n            Some(resolved_path.to_string())\n        }\n    }\n}\n\npub(super) fn normalize_utf8_path_lexically(path: &Utf8PathBuf) -> Utf8PathBuf {\n    let mut normalized_parts: Vec<String> = Vec::new();\n    let mut prefix: Option<String> = None;\n    let is_absolute = path.is_absolute();\n\n    for component in path.components() {\n        match component {\n            Utf8Component::Prefix(prefix_component) => {\n                prefix = Some(prefix_component.as_str().to_string());\n            }\n            Utf8Component::RootDir | Utf8Component::CurDir => {}\n            Utf8Component::ParentDir => {\n                if is_absolute || normalized_parts.last().is_some_and(|part| part != \"..\") {\n                    normalized_parts.pop();\n                } else {\n                    normalized_parts.push(\"..\".to_string());\n                }\n            }\n            Utf8Component::Normal(part) => normalized_parts.push(part.to_string()),\n        }\n    }\n\n    let mut normalized_path = String::new();\n    if let Some(prefix) = prefix {\n        normalized_path.push_str(&prefix);\n    }\n    if is_absolute {\n        normalized_path.push('/');\n    }\n    normalized_path.push_str(&normalized_parts.join(\"/\"));\n\n    if normalized_path.is_empty() {\n        \".\".into()\n    } else {\n        normalized_path.into()\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::{normalize_utf8_path_lexically, rewrite_manifest_paths_to_absolute};\n    use anyhow::{Result, anyhow};\n    use camino::Utf8PathBuf;\n    use indoc::indoc;\n    use std::fs;\n    use toml_edit::DocumentMut;\n\n    #[test]\n    fn rewrites_relative_manifest_paths_to_absolute_with_original_manifest_as_base() -> Result<()> {\n        let temp_dir = tempfile::tempdir()?;\n        let root = Utf8PathBuf::from_path_buf(temp_dir.path().to_path_buf())\n            .map_err(|_| anyhow!(\"Temporary path is not valid UTF-8\"))?;\n\n        let original_workspace = root.join(\"original-workspace\");\n        let copied_workspace = root.join(\"copied-workspace\");\n        let original_package = original_workspace.join(\"crates/package_a\");\n        let copied_package = copied_workspace.join(\"crates/package_a\");\n\n        fs::create_dir_all(&original_package)?;\n        fs::create_dir_all(&copied_package)?;\n\n        let manifest_content = indoc! {r#\"\n            [package]\n            name = \"package_a\"\n            version = \"0.1.0\"\n\n            [workspace]\n\n            [workspace.dependencies]\n            ws_local_dep = { path = \"../ws_dep_b\" }\n            ws_external_dep = { path = \"../../../external/ws_dep_c\" }\n\n            [dependencies]\n            local_dep = { path = \"../dep_b\" }\n            external_dep = { path = \"../../../external/dep_c\" }\n\n            [[target.test]]\n            source-path = \"./tests/tests.cairo\"\n\n            [[target.starknet-contract]]\n            casm = false\n            sierra = false\n        \"#};\n\n        fs::write(original_package.join(\"Scarb.toml\"), manifest_content)?;\n        fs::write(copied_package.join(\"Scarb.toml\"), manifest_content)?;\n\n        rewrite_manifest_paths_to_absolute(&original_workspace, &copied_workspace)?;\n\n        let rewritten_manifest = fs::read_to_string(copied_package.join(\"Scarb.toml\"))?;\n        let rewritten_doc = rewritten_manifest.parse::<DocumentMut>()?;\n\n        let expected_external_dep_path =\n            normalize_utf8_path_lexically(&original_package.join(\"../../../external/dep_c\"))\n                .to_string();\n        let expected_ws_external_dep_path =\n            normalize_utf8_path_lexically(&original_package.join(\"../../../external/ws_dep_c\"))\n                .to_string();\n\n        assert_eq!(\n            rewritten_doc[\"dependencies\"][\"local_dep\"][\"path\"].as_str(),\n            Some(\"../dep_b\")\n        );\n        assert_eq!(\n            rewritten_doc[\"dependencies\"][\"external_dep\"][\"path\"].as_str(),\n            Some(expected_external_dep_path.as_str())\n        );\n        assert_eq!(\n            rewritten_doc[\"workspace\"][\"dependencies\"][\"ws_local_dep\"][\"path\"].as_str(),\n            Some(\"../ws_dep_b\")\n        );\n        assert_eq!(\n            rewritten_doc[\"workspace\"][\"dependencies\"][\"ws_external_dep\"][\"path\"].as_str(),\n            Some(expected_ws_external_dep_path.as_str())\n        );\n        assert_eq!(\n            rewritten_doc[\"target\"][\"test\"][0][\"source-path\"].as_str(),\n            Some(\"./tests/tests.cairo\")\n        );\n        assert_eq!(\n            rewritten_doc[\"target\"][\"starknet-contract\"][0][\"casm\"].as_bool(),\n            Some(true)\n        );\n        assert_eq!(\n            rewritten_doc[\"target\"][\"starknet-contract\"][0][\"sierra\"].as_bool(),\n            Some(true)\n        );\n\n        Ok(())\n    }\n}\n"
  },
  {
    "path": "crates/forge/src/optimize_inlining/runner.rs",
    "content": "use crate::optimize_inlining::args::OptimizeInliningArgs;\nuse crate::optimize_inlining::contract_size::{\n    ContractArtifactType, ContractSizeInfo, check_and_validate_contract_sizes,\n};\nuse crate::run_tests::workspace::execute_workspace;\nuse anyhow::{Context, Result};\nuse blockifier::blockifier_versioned_constants::VersionedConstants;\nuse blockifier::fee::eth_gas_constants::WORD_WIDTH;\nuse camino::{Utf8Path, Utf8PathBuf};\nuse forge_runner::test_case_summary::{AnyTestCaseSummary, TestCaseSummary};\nuse foundry_ui::UI;\nuse indoc::formatdoc;\nuse scarb_api::ScarbCommand;\nuse scarb_api::artifacts::deserialized::artifacts_for_package;\nuse scarb_api::manifest::ManifestEditor;\nuse scarb_api::metadata::{Metadata, MetadataOpts, metadata_with_opts};\nuse scarb_api::{target_dir_for_workspace, test_targets_by_name};\nuse starknet_api::transaction::fields::GasVectorComputationMode;\nuse starknet_api::versioned_constants_logic::VersionedConstantsTrait;\nuse std::collections::{HashMap, HashSet};\nuse std::sync::Arc;\nuse std::{env, fs};\nuse tokio::runtime::Builder;\n\n#[derive(Debug, Clone, Default)]\npub struct TotalGas {\n    pub l1: f64,\n    pub l1_data: f64,\n    pub l2: f64,\n}\n\nimpl TotalGas {\n    pub fn l2(&self) -> f64 {\n        self.l2\n    }\n}\n\n#[derive(Debug, Clone)]\npub struct OptimizationIterationResult {\n    pub threshold: u32,\n    pub total_gas: TotalGas,\n    pub max_contract_size: u64,\n    pub contract_code_l2_gas: u64,\n    pub tests_passed: bool,\n    pub error: Option<String>,\n}\n\npub fn compile_default(scarb_metadata: &Metadata, ui: &Arc<UI>) -> Result<()> {\n    ui.println(&\"Compiling project with default threshold...\".to_string());\n\n    let profile = &scarb_metadata.current_profile;\n\n    ScarbCommand::new_with_stdio()\n        .manifest_path(&scarb_metadata.runtime_manifest)\n        .arg(\"--profile\")\n        .arg(profile)\n        .arg(\"build\")\n        .arg(\"-w\")\n        .arg(\"--test\")\n        .run()\n        .map_err(|e| anyhow::anyhow!(\"Build failed: {e}\"))?;\n\n    let artifacts_dir = target_dir_for_workspace(scarb_metadata).join(profile);\n    let saved_dir = target_dir_for_workspace(scarb_metadata).join(\"inlining_optimizer_artifacts\");\n    fs::create_dir_all(&saved_dir)?;\n    for entry in fs::read_dir(&artifacts_dir).context(\"Failed to read artifacts directory\")? {\n        let entry = entry?;\n        if entry.file_type()?.is_file() {\n            let src_path = Utf8PathBuf::try_from(entry.path())\n                .context(\"Non-UTF-8 path in artifacts directory\")?;\n            let dst_path = saved_dir.join(src_path.file_name().context(\"Missing file name\")?);\n            fs::copy(&src_path, &dst_path)?;\n        }\n    }\n\n    Ok(())\n}\n\npub fn run_optimization_iteration(\n    threshold: u32,\n    args: &OptimizeInliningArgs,\n    scarb_metadata: &Metadata,\n    cores: usize,\n    ui: &Arc<UI>,\n) -> Result<OptimizationIterationResult> {\n    let profile = &scarb_metadata.current_profile;\n\n    let manifest_editor = ManifestEditor::new(&scarb_metadata.workspace.manifest_path);\n    manifest_editor.set_inlining_strategy(threshold, profile)?;\n\n    let build_result = ScarbCommand::new_with_stdio()\n        .manifest_path(&scarb_metadata.runtime_manifest)\n        .arg(\"--profile\")\n        .arg(profile)\n        .arg(\"build\")\n        .arg(\"-w\")\n        .arg(\"--test\")\n        .run();\n\n    if let Err(e) = build_result {\n        return Ok(OptimizationIterationResult {\n            threshold,\n            total_gas: TotalGas::default(),\n            max_contract_size: 0,\n            contract_code_l2_gas: 0,\n            tests_passed: false,\n            error: Some(format!(\"Build failed: {e}\")),\n        });\n    }\n\n    let artifacts_dir = target_dir_for_workspace(scarb_metadata).join(profile);\n\n    let starknet_artifacts_paths =\n        find_test_target_starknet_artifacts(&artifacts_dir, scarb_metadata)?;\n    if starknet_artifacts_paths.is_empty() {\n        return Err(anyhow::anyhow!(\n            \"No starknet_artifacts.json found. Only projects with contracts can be optimized.\"\n        ));\n    }\n\n    let saved_dir = target_dir_for_workspace(scarb_metadata).join(\"inlining_optimizer_artifacts\");\n    let keep_filenames =\n        matching_contract_artifact_filenames(&starknet_artifacts_paths, &args.contracts)?;\n    restore_non_contract_artifacts(&artifacts_dir, &saved_dir, &keep_filenames)\n        .context(\"Failed to restore non-contract artifacts from default build\")?;\n\n    let (sizes_valid, sizes) = check_and_validate_contract_sizes(\n        &starknet_artifacts_paths,\n        args.max_contract_size,\n        args.max_contract_program_len,\n        &args.contracts,\n    )?;\n    let max_contract_size = sizes.iter().map(|s| s.size).max().unwrap_or(0);\n    let contract_code_l2_gas = contract_code_l2_gas(&sizes)?;\n\n    if !sizes_valid {\n        return Ok(OptimizationIterationResult {\n            threshold,\n            total_gas: TotalGas::default(),\n            max_contract_size,\n            contract_code_l2_gas,\n            tests_passed: false,\n            error: Some(formatdoc!(\n                r\"\n                Contract size {max_contract_size} exceeds limit {} or felts {} exceeds limit {}.\n                Try optimizing with lower threshold limit.\n                \",\n                args.max_contract_size,\n                sizes.iter().map(|s| s.felts_count).max().unwrap_or(0),\n                args.max_contract_program_len\n            )),\n        });\n    }\n\n    let test_result = run_tests_with_execute_workspace(\n        scarb_metadata.runtime_manifest.clone().parent().unwrap(),\n        args,\n        cores,\n        ui,\n    )?;\n\n    let tests_passed = test_result.success;\n    let total_gas = if tests_passed {\n        test_result.total_gas\n    } else {\n        TotalGas::default()\n    };\n\n    Ok(OptimizationIterationResult {\n        threshold,\n        total_gas,\n        max_contract_size,\n        contract_code_l2_gas,\n        tests_passed,\n        error: if tests_passed {\n            None\n        } else {\n            Some(\n                test_result\n                    .error\n                    .unwrap_or_else(|| \"Some tests failed\".to_string()),\n            )\n        },\n    })\n}\n\n/// Estimates the L2 data gas cost of deploying contarct code for all project contracts.\n///\n/// This estimation is only concerned with the part of L2 data cost, that depends on the compile contract code size.\n///\n/// We sum Sierra and CASM felt counts per contract, convert felts to bytes\n/// (`felt_count * WORD_WIDTH`), then multiply by the `gas_per_code_byte`\n/// rate from the latest Starknet versioned constants.\n///\n/// See <https://docs.starknet.io/learn/protocol/fees#l2-data> for details.\nfn contract_code_l2_gas(sizes: &[ContractSizeInfo]) -> Result<u64> {\n    let mut felts_by_contract: HashMap<&str, u64> = HashMap::new();\n\n    for size in sizes {\n        if matches!(\n            size.artifact_type,\n            ContractArtifactType::Sierra | ContractArtifactType::Casm\n        ) {\n            *felts_by_contract\n                .entry(size.contract_id.as_str())\n                .or_default() += size.felts_count;\n        }\n    }\n\n    let versioned_constants = VersionedConstants::latest_constants();\n    let gas_per_code_byte = versioned_constants\n        .get_archival_data_gas_costs(&GasVectorComputationMode::All)\n        .gas_per_code_byte;\n    let word_width = u64::try_from(WORD_WIDTH).expect(\"WORD_WIDTH should fit into u64\");\n\n    felts_by_contract\n        .values()\n        .try_fold(0_u64, |total, felt_count| {\n            let code_size_bytes = felt_count\n                .checked_mul(word_width)\n                .context(\"code size in bytes overflowed while calculating L2 gas\")?;\n            let code_l2_gas = (gas_per_code_byte * code_size_bytes).to_integer();\n            total\n                .checked_add(code_l2_gas)\n                .context(\"contract code L2 gas overflowed\")\n        })\n}\n\nstruct TestRunResult {\n    success: bool,\n    total_gas: TotalGas,\n    error: Option<String>,\n}\n\nfn run_tests_with_execute_workspace(\n    root: &Utf8Path,\n    args: &OptimizeInliningArgs,\n    cores: usize,\n    ui: &Arc<UI>,\n) -> Result<TestRunResult> {\n    let rt = Builder::new_multi_thread()\n        .max_blocking_threads(cores)\n        .enable_all()\n        .build()?;\n\n    let original_cwd = env::current_dir()?;\n    env::set_current_dir(root)?;\n\n    let scarb_metadata = metadata_with_opts(MetadataOpts {\n        profile: args.test_args.scarb_args.profile.specified(),\n        ..MetadataOpts::default()\n    })?;\n\n    let result = rt.block_on(execute_workspace(\n        &args.test_args,\n        ui.clone(),\n        &scarb_metadata,\n    ));\n\n    env::set_current_dir(&original_cwd)?;\n\n    match result {\n        Ok(summary) => {\n            let mut all_passed = true;\n            let mut total_gas = TotalGas::default();\n            let mut first_error: Option<String> = None;\n            let mut tests_run = 0u64;\n\n            for test_target in &summary.all_tests {\n                for test_case in &test_target.test_case_summaries {\n                    if test_case.is_failed() {\n                        tests_run += 1;\n                        all_passed = false;\n                        if first_error.is_none() {\n                            first_error = Some(format!(\n                                \"Test '{}' failed\",\n                                test_case.name().unwrap_or(\"unknown\")\n                            ));\n                        }\n                    }\n\n                    if test_case.is_passed() {\n                        tests_run += 1;\n                        let gas = extract_gas_from_summary(test_case);\n                        total_gas.l1 += gas.l1;\n                        total_gas.l1_data += gas.l1_data;\n                        total_gas.l2 += gas.l2;\n                    }\n                }\n            }\n\n            if tests_run == 0 {\n                return Err(anyhow::anyhow!(\n                    \"No tests were executed. The --exact filter did not match any test cases.\"\n                ));\n            }\n\n            Ok(TestRunResult {\n                success: all_passed,\n                total_gas,\n                error: first_error,\n            })\n        }\n        Err(e) => Ok(TestRunResult {\n            success: false,\n            total_gas: TotalGas::default(),\n            error: Some(format!(\"Test execution failed: {e}\")),\n        }),\n    }\n}\n\n#[allow(clippy::cast_precision_loss)]\nfn extract_gas_from_summary(summary: &AnyTestCaseSummary) -> TotalGas {\n    match summary {\n        AnyTestCaseSummary::Single(TestCaseSummary::Passed { gas_info, .. }) => TotalGas {\n            l1: gas_info.gas_used.l1_gas.0 as f64,\n            l1_data: gas_info.gas_used.l1_data_gas.0 as f64,\n            l2: gas_info.gas_used.l2_gas.0 as f64,\n        },\n        AnyTestCaseSummary::Fuzzing(TestCaseSummary::Passed { gas_info, .. }) => TotalGas {\n            l1: gas_info.l1_gas.mean,\n            l1_data: gas_info.l1_data_gas.mean,\n            l2: gas_info.l2_gas.mean,\n        },\n        _ => TotalGas::default(),\n    }\n}\n\nfn matching_contract_artifact_filenames(\n    starknet_artifacts_paths: &[Utf8PathBuf],\n    contracts_filter: &[String],\n) -> Result<HashSet<String>> {\n    let mut filenames = HashSet::new();\n    for starknet_artifacts_path in starknet_artifacts_paths {\n        let artifacts = artifacts_for_package(starknet_artifacts_path.as_path())?;\n        for contract in &artifacts.contracts {\n            let matches = contracts_filter.iter().any(|f| {\n                contract.contract_name == *f\n                    || (f.contains(\"::\") && contract.module_path.ends_with(f.as_str()))\n            });\n            if !matches {\n                continue;\n            }\n            if let Some(name) = contract.artifacts.sierra.file_name() {\n                filenames.insert(name.to_owned());\n            }\n            if let Some(casm) = &contract.artifacts.casm\n                && let Some(name) = casm.file_name()\n            {\n                filenames.insert(name.to_owned());\n            }\n        }\n    }\n    Ok(filenames)\n}\n\nfn restore_non_contract_artifacts(\n    artifacts_dir: &Utf8Path,\n    saved_dir: &Utf8Path,\n    keep_filenames: &HashSet<String>,\n) -> Result<()> {\n    for entry in fs::read_dir(saved_dir).context(\"Failed to read saved artifacts directory\")? {\n        let entry = entry?;\n        if !entry.file_type()?.is_file() {\n            continue;\n        }\n        let filename = entry.file_name();\n        let filename_str = filename.to_string_lossy();\n        if keep_filenames.contains(filename_str.as_ref()) {\n            continue;\n        }\n        let src =\n            Utf8PathBuf::try_from(entry.path()).context(\"Non-UTF-8 path in saved artifacts\")?;\n        let dst = artifacts_dir.join(filename_str.as_ref());\n        fs::copy(&src, &dst)?;\n    }\n    Ok(())\n}\n\nfn find_test_target_starknet_artifacts(\n    artifacts_dir: &camino::Utf8Path,\n    scarb_metadata: &Metadata,\n) -> Result<Vec<Utf8PathBuf>> {\n    let mut paths = Vec::new();\n\n    for package in &scarb_metadata.packages {\n        let test_targets = test_targets_by_name(package);\n        for target_name in test_targets.keys() {\n            let artifact_path =\n                artifacts_dir.join(format!(\"{target_name}.test.starknet_artifacts.json\"));\n            if artifact_path.exists() && has_non_empty_contracts_field(&artifact_path)? {\n                paths.push(artifact_path);\n            }\n        }\n    }\n\n    Ok(paths)\n}\n\nfn has_non_empty_contracts_field(artifact_path: &Utf8Path) -> Result<bool> {\n    let artifacts = artifacts_for_package(artifact_path)\n        .with_context(|| format!(\"Failed to load starknet artifacts from {artifact_path}\"))?;\n    Ok(!artifacts.contracts.is_empty())\n}\n"
  },
  {
    "path": "crates/forge/src/profile_validation/backtrace.rs",
    "content": "use crate::TestArgs;\nuse crate::profile_validation::{check_cairo_profile_entries, get_manifest};\nuse anyhow::ensure;\nuse indoc::formatdoc;\nuse scarb_metadata::Metadata;\n\n/// Checks if backtrace can be generated based on scarb version, profile settings extracted from\n/// the provided [`Metadata`] and if native execution is disabled in the provided [`TestArgs`].\n#[allow(unused_variables)]\npub fn check_backtrace_compatibility(\n    test_args: &TestArgs,\n    scarb_metadata: &Metadata,\n) -> anyhow::Result<()> {\n    #[cfg(feature = \"cairo-native\")]\n    check_if_native_disabled(test_args)?;\n    check_profile(scarb_metadata)?;\n    Ok(())\n}\n\n/// Checks if native execution is disabled in the provided [`TestArgs`].\n#[cfg(feature = \"cairo-native\")]\nfn check_if_native_disabled(test_args: &TestArgs) -> anyhow::Result<()> {\n    ensure!(\n        !test_args.run_native,\n        \"Backtrace generation is not supported with `cairo-native` execution\",\n    );\n    Ok(())\n}\n\n/// Checks if the runtime profile settings in the provided from [`Metadata`] contain the required entries for backtrace generation.\nfn check_profile(scarb_metadata: &Metadata) -> anyhow::Result<()> {\n    const BACKTRACE_REQUIRED_ENTRIES: &[(&str, &str)] = &[\n        (\"unstable-add-statements-functions-debug-info\", \"true\"),\n        (\"unstable-add-statements-code-locations-debug-info\", \"true\"),\n        (\"panic-backtrace\", \"true\"),\n    ];\n\n    let manifest = get_manifest(scarb_metadata)?;\n\n    let has_needed_entries =\n        check_cairo_profile_entries(&manifest, scarb_metadata, BACKTRACE_REQUIRED_ENTRIES);\n\n    ensure!(\n        has_needed_entries,\n        formatdoc! {\n            \"Scarb.toml must have the following Cairo compiler configuration to run backtrace:\n\n            [profile.{profile}.cairo]\n            unstable-add-statements-functions-debug-info = true\n            unstable-add-statements-code-locations-debug-info = true\n            panic-backtrace = true\n            ... other entries ...\n            \",\n            profile = scarb_metadata.current_profile\n        },\n    );\n\n    Ok(())\n}\n"
  },
  {
    "path": "crates/forge/src/profile_validation/coverage.rs",
    "content": "use crate::profile_validation::{check_cairo_profile_entries, get_manifest};\nuse anyhow::ensure;\nuse indoc::formatdoc;\nuse scarb_metadata::Metadata;\n\n/// Checks if coverage can be based on scarb version and profile settings extracted from the provided [`Metadata`].\npub fn check_coverage_compatibility(scarb_metadata: &Metadata) -> anyhow::Result<()> {\n    check_profile(scarb_metadata)\n}\n\n/// Checks if the runtime profile settings in the provided from [`Metadata`] contain the required entries for coverage generation.\nfn check_profile(scarb_metadata: &Metadata) -> anyhow::Result<()> {\n    const CAIRO_COVERAGE_REQUIRED_ENTRIES: &[(&str, &str)] = &[\n        (\"unstable-add-statements-functions-debug-info\", \"true\"),\n        (\"unstable-add-statements-code-locations-debug-info\", \"true\"),\n        (\"inlining-strategy\", \"avoid\"),\n    ];\n\n    let manifest = get_manifest(scarb_metadata)?;\n\n    let has_needed_entries =\n        check_cairo_profile_entries(&manifest, scarb_metadata, CAIRO_COVERAGE_REQUIRED_ENTRIES);\n\n    ensure!(\n        has_needed_entries,\n        formatdoc! {\n            \"Scarb.toml must have the following Cairo compiler configuration to run coverage:\n\n            [profile.{profile}.cairo]\n            unstable-add-statements-functions-debug-info = true\n            unstable-add-statements-code-locations-debug-info = true\n            inlining-strategy = \\\"avoid\\\"\n            ... other entries ...\n            \",\n            profile = scarb_metadata.current_profile\n        },\n    );\n\n    Ok(())\n}\n"
  },
  {
    "path": "crates/forge/src/profile_validation/mod.rs",
    "content": "mod backtrace;\nmod coverage;\n\nuse crate::TestArgs;\nuse crate::profile_validation::backtrace::check_backtrace_compatibility;\nuse crate::profile_validation::coverage::check_coverage_compatibility;\nuse forge_runner::backtrace::is_backtrace_enabled;\nuse scarb_metadata::Metadata;\nuse std::fs;\nuse toml_edit::{DocumentMut, Table};\n\n/// Checks if current profile provided in [`Metadata`] can be used to run coverage and backtrace if applicable.\npub fn check_profile_compatibility(\n    test_args: &TestArgs,\n    scarb_metadata: &Metadata,\n) -> anyhow::Result<()> {\n    if test_args.coverage {\n        check_coverage_compatibility(scarb_metadata)?;\n    }\n    if is_backtrace_enabled() {\n        check_backtrace_compatibility(test_args, scarb_metadata)?;\n    }\n    Ok(())\n}\n\n/// Gets the runtime manifest from the [`Metadata`] and parses it into a [`DocumentMut`].\nfn get_manifest(scarb_metadata: &Metadata) -> anyhow::Result<DocumentMut> {\n    Ok(fs::read_to_string(&scarb_metadata.runtime_manifest)?.parse::<DocumentMut>()?)\n}\n\n/// Check if the Cairo profile entries in the manifest contain the required entries.\nfn check_cairo_profile_entries(\n    manifest: &DocumentMut,\n    scarb_metadata: &Metadata,\n    required_entries: &[(&str, &str)],\n) -> bool {\n    manifest\n        .get(\"profile\")\n        .and_then(|profile| profile.get(&scarb_metadata.current_profile))\n        .and_then(|profile| profile.get(\"cairo\"))\n        .and_then(|cairo| cairo.as_table())\n        .is_some_and(|profile_cairo| {\n            required_entries\n                .iter()\n                .all(|(key, value)| contains_entry_with_value(profile_cairo, key, value))\n        })\n}\n\n/// Check if the table contains an entry with the given key and value.\n/// Accepts only bool and string values.\nfn contains_entry_with_value(table: &Table, key: &str, value: &str) -> bool {\n    table.get(key).is_some_and(|entry| {\n        if let Some(entry) = entry.as_bool() {\n            entry.to_string() == value\n        } else if let Some(entry) = entry.as_str() {\n            entry == value\n        } else {\n            false\n        }\n    })\n}\n"
  },
  {
    "path": "crates/forge/src/run_tests/maat.rs",
    "content": "#[must_use]\npub fn env_ignore_fork_tests() -> bool {\n    std::env::var(\"SNFORGE_IGNORE_FORK_TESTS\").is_ok_and(|v| v == \"1\")\n}\n"
  },
  {
    "path": "crates/forge/src/run_tests/messages/collected_tests_count.rs",
    "content": "use console::style;\nuse foundry_ui::Message;\nuse serde::Serialize;\nuse serde_json::{Value, json};\n\n#[derive(Serialize)]\npub struct CollectedTestsCountMessage {\n    pub tests_num: usize,\n    pub package_name: String,\n}\n\nimpl Message for CollectedTestsCountMessage {\n    fn text(&self) -> String {\n        let full = format!(\n            \"\\n\\nCollected {} test(s) from {} package\",\n            self.tests_num, self.package_name\n        );\n        style(full).bold().to_string()\n    }\n\n    fn json(&self) -> Value {\n        json!(self)\n    }\n}\n"
  },
  {
    "path": "crates/forge/src/run_tests/messages/latest_blocks_numbers.rs",
    "content": "use foundry_ui::Message;\nuse serde::Serialize;\nuse serde_json::{Value, json};\nuse std::{collections::HashMap, fmt::Write};\n\n#[derive(Serialize)]\npub struct LatestBlocksNumbersMessage {\n    url_to_latest_block_number_map: HashMap<url::Url, starknet_api::block::BlockNumber>,\n}\n\nimpl LatestBlocksNumbersMessage {\n    #[must_use]\n    pub fn new(\n        url_to_latest_block_number_map: HashMap<url::Url, starknet_api::block::BlockNumber>,\n    ) -> Self {\n        Self {\n            url_to_latest_block_number_map,\n        }\n    }\n}\n\nimpl Message for LatestBlocksNumbersMessage {\n    fn text(&self) -> String {\n        let mut output = String::new();\n        output = format!(\"{output}\\n\");\n\n        for (url, latest_block_number) in &self.url_to_latest_block_number_map {\n            let _ = writeln!(\n                &mut output,\n                \"Latest block number = {latest_block_number} for url = {url}\"\n            );\n        }\n\n        output\n    }\n\n    fn json(&self) -> Value {\n        json!(self)\n    }\n}\n"
  },
  {
    "path": "crates/forge/src/run_tests/messages/mod.rs",
    "content": "pub mod collected_tests_count;\npub mod latest_blocks_numbers;\npub mod overall_summary;\npub mod partition;\npub mod tests_failure_summary;\npub mod tests_run;\npub mod tests_summary;\n"
  },
  {
    "path": "crates/forge/src/run_tests/messages/overall_summary.rs",
    "content": "use console::style;\nuse forge_runner::test_target_summary::TestTargetSummary;\nuse forge_runner::tests_summary::TestsSummary;\nuse foundry_ui::{Message, components::labeled::LabeledMessage};\nuse serde::Serialize;\nuse serde_json::{Value, json};\n\n#[derive(Serialize)]\npub struct OverallSummaryMessage {\n    summary: TestsSummary,\n}\n\nimpl OverallSummaryMessage {\n    pub const LABEL: &str = \"Tests summary\";\n\n    #[must_use]\n    pub fn new(summaries: &[TestTargetSummary], filtered: Option<usize>) -> Self {\n        Self {\n            summary: TestsSummary::new(summaries, filtered),\n        }\n    }\n}\n\nimpl Message for OverallSummaryMessage {\n    fn text(&self) -> String {\n        let styled_label = style(&Self::LABEL).bold().to_string();\n        LabeledMessage::new(&styled_label, &self.summary.format_summary_message()).text()\n    }\n\n    fn json(&self) -> Value {\n        json!(self)\n    }\n}\n"
  },
  {
    "path": "crates/forge/src/run_tests/messages/partition.rs",
    "content": "use console::style;\nuse forge_runner::partition::Partition;\nuse foundry_ui::{Message, components::labeled::LabeledMessage};\nuse serde::Serialize;\nuse serde_json::{Value, json};\n\n#[derive(Serialize)]\npub struct PartitionFinishedMessage {\n    partition: Partition,\n    included_tests_count: usize,\n    total_tests_count: usize,\n}\n\nimpl PartitionFinishedMessage {\n    #[must_use]\n    pub fn new(\n        partition: Partition,\n        included_tests_count: usize,\n        total_tests_count: usize,\n    ) -> Self {\n        Self {\n            partition,\n            included_tests_count,\n            total_tests_count,\n        }\n    }\n\n    fn summary(&self) -> String {\n        format!(\n            \"{}/{}, included {} out of total {} tests\",\n            self.partition.index(),\n            self.partition.total(),\n            self.included_tests_count,\n            self.total_tests_count,\n        )\n    }\n}\n\nimpl Message for PartitionFinishedMessage {\n    fn text(&self) -> String {\n        let label = style(\"Finished partition run\").bold().to_string();\n        LabeledMessage::new(&label, &self.summary()).text()\n    }\n\n    fn json(&self) -> Value {\n        json!(self)\n    }\n}\n\n#[derive(Serialize)]\npub struct PartitionStartedMessage {\n    partition: Partition,\n}\n\nimpl PartitionStartedMessage {\n    #[must_use]\n    pub fn new(partition: Partition) -> Self {\n        Self { partition }\n    }\n\n    fn summary(&self) -> String {\n        format!(\"{}/{}\", self.partition.index(), self.partition.total())\n    }\n}\n\nimpl Message for PartitionStartedMessage {\n    fn text(&self) -> String {\n        let label = style(\"Running partition run\").bold().to_string();\n        LabeledMessage::new(&label, &self.summary()).text()\n    }\n\n    fn json(&self) -> Value {\n        json!(self)\n    }\n}\n"
  },
  {
    "path": "crates/forge/src/run_tests/messages/tests_failure_summary.rs",
    "content": "use console::style;\nuse forge_runner::test_case_summary::AnyTestCaseSummary;\nuse foundry_ui::Message;\nuse serde::Serialize;\nuse serde_json::{Value, json};\nuse std::fmt::Write;\n\n#[derive(Serialize)]\npub struct TestsFailureSummaryMessage {\n    pub failed_test_names: Vec<String>,\n}\n\nimpl TestsFailureSummaryMessage {\n    #[must_use]\n    pub fn new(all_failed_tests: &[&AnyTestCaseSummary]) -> Self {\n        let failed_test_names = all_failed_tests\n            .iter()\n            .map(|any_test_case_summary| any_test_case_summary.name().unwrap().to_string())\n            .collect();\n\n        Self { failed_test_names }\n    }\n}\n\nimpl Message for TestsFailureSummaryMessage {\n    fn text(&self) -> String {\n        if self.failed_test_names.is_empty() {\n            return String::new();\n        }\n\n        let mut failures = \"\\nFailures:\".to_string();\n        for name in &self.failed_test_names {\n            let _ = write!(&mut failures, \"\\n    {name}\");\n        }\n        style(failures).bold().to_string()\n    }\n\n    fn json(&self) -> Value {\n        json!(self)\n    }\n}\n"
  },
  {
    "path": "crates/forge/src/run_tests/messages/tests_run.rs",
    "content": "use console::style;\nuse forge_runner::package_tests::TestTargetLocation;\nuse foundry_ui::Message;\nuse serde::Serialize;\nuse serde_json::{Value, json};\n\n#[derive(Serialize)]\npub struct TestsRunMessage {\n    test_target_location: TestTargetLocation,\n    tests_num: usize,\n}\n\nimpl TestsRunMessage {\n    #[must_use]\n    pub fn new(test_target_location: TestTargetLocation, tests_num: usize) -> Self {\n        Self {\n            test_target_location,\n            tests_num,\n        }\n    }\n}\n\nimpl Message for TestsRunMessage {\n    fn text(&self) -> String {\n        let dir_name = match self.test_target_location {\n            TestTargetLocation::Lib => \"src\",\n            TestTargetLocation::Tests => \"tests\",\n        };\n        let plain_text = format!(\"Running {} test(s) from {}/\", self.tests_num, dir_name);\n        style(plain_text).bold().to_string()\n    }\n\n    fn json(&self) -> Value {\n        json!(self)\n    }\n}\n"
  },
  {
    "path": "crates/forge/src/run_tests/messages/tests_summary.rs",
    "content": "use console::style;\nuse forge_runner::{test_target_summary::TestTargetSummary, tests_summary::TestsSummary};\nuse foundry_ui::{Message, components::labeled::LabeledMessage};\nuse serde::Serialize;\nuse serde_json::{Value, json};\n\n#[derive(Serialize)]\npub struct TestsSummaryMessage {\n    summary: TestsSummary,\n}\n\nimpl TestsSummaryMessage {\n    pub const LABEL: &str = \"Tests\";\n\n    #[must_use]\n    pub fn new(summaries: &[TestTargetSummary], filtered: Option<usize>) -> Self {\n        Self {\n            summary: TestsSummary::new(summaries, filtered),\n        }\n    }\n}\n\nimpl Message for TestsSummaryMessage {\n    fn text(&self) -> String {\n        let styled_label = style(&Self::LABEL).bold().to_string();\n        LabeledMessage::new(&styled_label, &self.summary.format_summary_message()).text()\n    }\n\n    fn json(&self) -> Value {\n        json!(self)\n    }\n}\n"
  },
  {
    "path": "crates/forge/src/run_tests/package.rs",
    "content": "use super::{\n    resolve_config::resolve_config,\n    test_target::{ExitFirstChannel, TestTargetRunResult, run_for_test_target},\n};\nuse crate::scarb::{\n    config::{ForgeConfigFromScarb, ForkTarget},\n    load_package_config,\n};\nuse crate::{\n    TestArgs,\n    block_number_map::BlockNumberMap,\n    combine_configs::combine_configs,\n    run_tests::messages::{\n        collected_tests_count::CollectedTestsCountMessage, tests_run::TestsRunMessage,\n        tests_summary::TestsSummaryMessage,\n    },\n    shared_cache::FailedTestsCache,\n    test_filter::{NameFilter, TestsFilter},\n    warn::warn_if_incompatible_rpc_version,\n};\nuse anyhow::Result;\nuse camino::{Utf8Path, Utf8PathBuf};\nuse cheatnet::runtime_extensions::forge_runtime_extension::contracts_data::ContractsData;\nuse console::Style;\nuse forge_runner::{\n    forge_config::{ForgeConfig, ForgeTrackedResource},\n    package_tests::{\n        raw::TestTargetRaw,\n        with_config::TestTargetWithConfig,\n        with_config_resolved::{TestCaseWithResolvedConfig, sanitize_test_case_name},\n    },\n    partition::PartitionConfig,\n    running::target::prepare_test_target,\n    scarb::load_test_artifacts,\n    test_case_summary::AnyTestCaseSummary,\n    test_target_summary::TestTargetSummary,\n};\nuse foundry_ui::{UI, components::labeled::LabeledMessage};\nuse scarb_api::{CompilationOpts, get_contracts_artifacts_and_source_sierra_paths};\nuse scarb_metadata::{Metadata, PackageMetadata};\nuse std::sync::Arc;\nuse tokio::task::JoinHandle;\n\npub struct PackageTestResult {\n    summaries: Vec<TestTargetSummary>,\n    filtered: Option<usize>,\n}\n\nimpl PackageTestResult {\n    #[must_use]\n    pub fn new(summaries: Vec<TestTargetSummary>, filtered: Option<usize>) -> Self {\n        Self {\n            summaries,\n            filtered,\n        }\n    }\n\n    #[must_use]\n    pub fn filtered(&self) -> Option<usize> {\n        self.filtered\n    }\n\n    #[must_use]\n    pub fn summaries(self) -> Vec<TestTargetSummary> {\n        self.summaries\n    }\n}\n\npub struct RunForPackageArgs {\n    pub target_handles: Vec<JoinHandle<Result<TestTargetWithConfig>>>,\n    pub tests_filter: TestsFilter,\n    pub forge_config: Arc<ForgeConfig>,\n    pub fork_targets: Vec<ForkTarget>,\n    pub package_name: String,\n    pub package_root: Utf8PathBuf,\n}\n\nimpl RunForPackageArgs {\n    #[tracing::instrument(skip_all, level = \"debug\")]\n    pub fn build(\n        package: PackageMetadata,\n        scarb_metadata: &Metadata,\n        args: &TestArgs,\n        cache_dir: &Utf8PathBuf,\n        artifacts_dir: &Utf8Path,\n        partitioning_config: PartitionConfig,\n        ui: &UI,\n    ) -> Result<RunForPackageArgs> {\n        let mut raw_test_targets = load_test_artifacts(artifacts_dir, &package)?;\n\n        let contracts = get_contracts_artifacts_and_source_sierra_paths(\n            artifacts_dir,\n            &package,\n            ui,\n            CompilationOpts {\n                use_test_target_contracts: !args.no_optimization,\n                #[cfg(feature = \"cairo-native\")]\n                run_native: args.run_native,\n            },\n        )?;\n        let contracts_data = ContractsData::try_from(contracts)?;\n\n        let forge_config_from_scarb =\n            load_package_config::<ForgeConfigFromScarb>(scarb_metadata, &package.id)?;\n        let forge_config = Arc::new(combine_configs(\n            args,\n            contracts_data,\n            cache_dir.clone(),\n            &forge_config_from_scarb,\n        ));\n\n        let tests_filter = TestsFilter::from_flags(\n            args.test_filter.clone(),\n            args.exact,\n            args.skip.clone(),\n            args.only_ignored,\n            args.include_ignored,\n            args.rerun_failed,\n            FailedTestsCache::new(cache_dir),\n            partitioning_config,\n        );\n\n        if args.deterministic_output {\n            raw_test_targets.sort_by_key(|t| t.tests_location);\n        }\n\n        let tracked_resource = forge_config.test_runner_config.tracked_resource;\n\n        let target_handles = raw_test_targets\n            .into_iter()\n            .map(|t| spawn_prepare_test_target(t, tracked_resource))\n            .collect();\n\n        Ok(RunForPackageArgs {\n            target_handles,\n            forge_config,\n            tests_filter,\n            fork_targets: forge_config_from_scarb.fork,\n            package_name: package.name.clone(),\n            package_root: package.root,\n        })\n    }\n}\n\nfn spawn_prepare_test_target(\n    target: TestTargetRaw,\n    tracked_resource: ForgeTrackedResource,\n) -> JoinHandle<Result<TestTargetWithConfig>> {\n    tokio::task::spawn_blocking(move || prepare_test_target(target, &tracked_resource))\n}\n\nfn sum_test_cases_from_test_target(\n    test_cases: &[TestCaseWithResolvedConfig],\n    partitioning_config: &PartitionConfig,\n) -> usize {\n    match partitioning_config {\n        PartitionConfig::Disabled => test_cases.len(),\n        PartitionConfig::Enabled {\n            partition,\n            partition_map,\n        } => test_cases\n            .iter()\n            .filter(|test_case| {\n                let test_assigned_index = partition_map\n                    .get_assigned_index(&sanitize_test_case_name(&test_case.name))\n                    .expect(\"Partition map must contain all test cases\");\n                test_assigned_index == partition.index()\n            })\n            .count(),\n    }\n}\n\n#[tracing::instrument(skip_all, level = \"debug\")]\npub async fn run_for_package(\n    RunForPackageArgs {\n        target_handles,\n        forge_config,\n        tests_filter,\n        fork_targets,\n        package_name,\n        package_root: _,\n    }: RunForPackageArgs,\n    block_number_map: &BlockNumberMap,\n    ui: Arc<UI>,\n    exit_first_channel: &mut ExitFirstChannel,\n) -> Result<PackageTestResult> {\n    // Resolve all targets first so the collected count includes #[ignore] filtering.\n    let mut resolved_targets = vec![];\n    let mut all_tests = 0;\n    let mut not_filtered_total = 0;\n\n    for handle in target_handles {\n        let target_with_config = handle.await??;\n\n        let mut resolved = resolve_config(\n            target_with_config,\n            &fork_targets,\n            block_number_map,\n            &tests_filter,\n        )\n        .await?;\n\n        let all = sum_test_cases_from_test_target(\n            &resolved.test_cases,\n            &tests_filter.partitioning_config,\n        );\n        tests_filter.filter_tests(&mut resolved.test_cases)?;\n        let not_filtered = sum_test_cases_from_test_target(\n            &resolved.test_cases,\n            &tests_filter.partitioning_config,\n        );\n        all_tests += all;\n        not_filtered_total += not_filtered;\n\n        resolved_targets.push(resolved);\n    }\n\n    warn_if_incompatible_rpc_version(&resolved_targets, ui.clone()).await?;\n\n    ui.println(&CollectedTestsCountMessage {\n        tests_num: not_filtered_total,\n        package_name: package_name.clone(),\n    });\n\n    let mut summaries = vec![];\n\n    for resolved in resolved_targets {\n        ui.println(&TestsRunMessage::new(\n            resolved.tests_location,\n            sum_test_cases_from_test_target(\n                &resolved.test_cases,\n                &tests_filter.partitioning_config,\n            ),\n        ));\n\n        let summary = run_for_test_target(\n            resolved,\n            forge_config.clone(),\n            &tests_filter,\n            ui.clone(),\n            exit_first_channel,\n        )\n        .await?;\n\n        let (TestTargetRunResult::Ok(s) | TestTargetRunResult::Interrupted(s)) = summary;\n        summaries.push(s);\n    }\n\n    // TODO(#2574): Bring back \"filtered out\" number in tests summary when running with `--exact` flag\n    let filtered_count = if let NameFilter::ExactMatch(_) = tests_filter.name_filter {\n        None\n    } else {\n        Some(all_tests - not_filtered_total)\n    };\n\n    ui.println(&TestsSummaryMessage::new(&summaries, filtered_count));\n\n    let any_fuzz_test_was_run = summaries.iter().any(|test_target_summary| {\n        test_target_summary\n            .test_case_summaries\n            .iter()\n            .filter(|summary| matches!(summary, AnyTestCaseSummary::Fuzzing(_)))\n            .any(|summary| summary.is_passed() || summary.is_failed())\n    });\n\n    if any_fuzz_test_was_run {\n        ui.println(&LabeledMessage::new(\n            &Style::new().bold().apply_to(\"Fuzzer seed\").to_string(),\n            &forge_config.test_runner_config.fuzzer_seed.to_string(),\n        ));\n    }\n\n    Ok(PackageTestResult::new(summaries, filtered_count))\n}\n"
  },
  {
    "path": "crates/forge/src/run_tests/resolve_config.rs",
    "content": "use super::maat::env_ignore_fork_tests;\nuse crate::{\n    block_number_map::BlockNumberMap, scarb::config::ForkTarget, test_filter::TestsFilter,\n};\nuse anyhow::{Result, anyhow};\nuse cheatnet::runtime_extensions::forge_config_extension::config::{\n    BlockId, InlineForkConfig, OverriddenForkConfig, RawForkConfig,\n};\nuse conversions::byte_array::ByteArray;\nuse forge_runner::{\n    filtering::{FilterResult, TestCaseFilter},\n    package_tests::{\n        with_config::TestTargetWithConfig,\n        with_config_resolved::{\n            ResolvedForkConfig, TestCaseResolvedConfig, TestCaseWithResolvedConfig,\n            TestTargetWithResolvedConfig,\n        },\n    },\n};\nuse starknet_api::block::BlockNumber;\n\n#[tracing::instrument(skip_all, level = \"debug\")]\npub async fn resolve_config(\n    test_target: TestTargetWithConfig,\n    fork_targets: &[ForkTarget],\n    block_number_map: &BlockNumberMap,\n    tests_filter: &TestsFilter,\n) -> Result<TestTargetWithResolvedConfig> {\n    let mut test_cases = Vec::with_capacity(test_target.test_cases.len());\n    let env_ignore_fork_tests = env_ignore_fork_tests();\n\n    for case in test_target.test_cases {\n        let filter_result = tests_filter.filter(&case);\n        let should_be_run = matches!(filter_result, FilterResult::Included);\n\n        test_cases.push(TestCaseWithResolvedConfig::new(\n            &case.name,\n            case.test_details.clone(),\n            TestCaseResolvedConfig {\n                available_gas: case.config.available_gas,\n                ignored: case.config.ignored\n                    || (env_ignore_fork_tests && case.config.fork_config.is_some()),\n                fork_config: if should_be_run {\n                    resolve_fork_config(case.config.fork_config, block_number_map, fork_targets)\n                        .await?\n                } else {\n                    None\n                },\n                expected_result: case.config.expected_result,\n                fuzzer_config: case.config.fuzzer_config,\n                disable_predeployed_contracts: case.config.disable_predeployed_contracts,\n            },\n        ));\n    }\n\n    Ok(TestTargetWithResolvedConfig {\n        tests_location: test_target.tests_location,\n        sierra_program: test_target.sierra_program,\n        sierra_program_path: test_target.sierra_program_path,\n        casm_program: test_target.casm_program,\n        test_cases,\n    })\n}\n\nasync fn resolve_fork_config(\n    fork_config: Option<RawForkConfig>,\n    block_number_map: &BlockNumberMap,\n    fork_targets: &[ForkTarget],\n) -> Result<Option<ResolvedForkConfig>> {\n    let Some(fc) = fork_config else {\n        return Ok(None);\n    };\n\n    let raw_fork_params = replace_id_with_params(fc, fork_targets)?;\n\n    let url = raw_fork_params.url;\n\n    let block_number = match raw_fork_params.block {\n        BlockId::BlockNumber(block_number) => BlockNumber(block_number),\n        BlockId::BlockHash(hash) => {\n            block_number_map\n                .get_block_number_for_hash(url.clone(), hash)\n                .await?\n        }\n        BlockId::BlockTag => {\n            block_number_map\n                .get_latest_block_number(url.clone())\n                .await?\n        }\n    };\n\n    Ok(Some(ResolvedForkConfig { url, block_number }))\n}\n\nfn get_fork_target_from_runner_config<'a>(\n    fork_targets: &'a [ForkTarget],\n    name: &ByteArray,\n) -> Result<&'a ForkTarget> {\n    fork_targets\n        .iter()\n        .find(|fork| fork.name == name.to_string())\n        .ok_or_else(|| {\n            let name = name.to_string();\n            anyhow!(\"Fork configuration named = {name} not found in the Scarb.toml\")\n        })\n}\n\nfn replace_id_with_params(\n    raw_fork_config: RawForkConfig,\n    fork_targets: &[ForkTarget],\n) -> Result<InlineForkConfig> {\n    match raw_fork_config {\n        RawForkConfig::Inline(raw_fork_params) => Ok(raw_fork_params),\n        RawForkConfig::Named(name) => {\n            let fork_target_from_runner_config =\n                get_fork_target_from_runner_config(fork_targets, &name)?;\n\n            let block_id = fork_target_from_runner_config.block_id.clone();\n\n            Ok(InlineForkConfig {\n                url: fork_target_from_runner_config.url.clone(),\n                block: block_id,\n            })\n        }\n        RawForkConfig::Overridden(OverriddenForkConfig { name, block }) => {\n            let fork_target_from_runner_config =\n                get_fork_target_from_runner_config(fork_targets, &name)?;\n\n            let url = fork_target_from_runner_config.url.clone();\n\n            Ok(InlineForkConfig { url, block })\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use crate::shared_cache::FailedTestsCache;\n    use cairo_lang_sierra::program::ProgramArtifact;\n    use cairo_lang_sierra::{ids::GenericTypeId, program::Program};\n    use forge_runner::package_tests::TestTargetLocation;\n    use forge_runner::package_tests::with_config::{TestCaseConfig, TestCaseWithConfig};\n    use forge_runner::partition::PartitionConfig;\n    use forge_runner::{expected_result::ExpectedTestResult, package_tests::TestDetails};\n    use std::sync::Arc;\n    use universal_sierra_compiler_api::compile_raw_sierra;\n    use url::Url;\n\n    fn program_for_testing() -> ProgramArtifact {\n        ProgramArtifact {\n            program: Program {\n                type_declarations: vec![],\n                libfunc_declarations: vec![],\n                statements: vec![],\n                funcs: vec![],\n            },\n            debug_info: None,\n        }\n    }\n\n    fn create_test_case_with_config(\n        name: &str,\n        ignored: bool,\n        fork_config: Option<RawForkConfig>,\n    ) -> TestCaseWithConfig {\n        TestCaseWithConfig {\n            name: name.to_string(),\n            config: TestCaseConfig {\n                available_gas: None,\n                ignored,\n                expected_result: ExpectedTestResult::Success,\n                fork_config,\n                fuzzer_config: None,\n                disable_predeployed_contracts: false,\n            },\n            test_details: TestDetails {\n                sierra_entry_point_statement_idx: 100,\n                parameter_types: vec![\n                    GenericTypeId(\"RangeCheck\".into()),\n                    GenericTypeId(\"GasBuiltin\".into()),\n                ],\n            },\n        }\n    }\n\n    fn create_test_target_with_cases(test_cases: Vec<TestCaseWithConfig>) -> TestTargetWithConfig {\n        TestTargetWithConfig {\n            sierra_program: program_for_testing(),\n            sierra_program_path: Arc::default(),\n            casm_program: Arc::new(\n                compile_raw_sierra(&serde_json::to_value(&program_for_testing().program).unwrap())\n                    .unwrap(),\n            ),\n            test_cases,\n            tests_location: TestTargetLocation::Lib,\n        }\n    }\n\n    fn create_fork_target(name: &str, url: &str, block_id: BlockId) -> ForkTarget {\n        ForkTarget {\n            name: name.to_string(),\n            url: Url::parse(url).expect(\"Should be valid url\"),\n            block_id,\n        }\n    }\n\n    #[tokio::test]\n    async fn to_runnable_non_existent_id() {\n        let mocked_tests = create_test_target_with_cases(vec![create_test_case_with_config(\n            \"crate1::do_thing\",\n            false,\n            Some(RawForkConfig::Named(\"non_existent\".into())),\n        )]);\n\n        let tests_filter = TestsFilter::from_flags(\n            None,\n            false,\n            Vec::new(),\n            false,\n            false,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n\n        assert!(\n            resolve_config(\n                mocked_tests,\n                &[create_fork_target(\n                    \"definitely_non_existing\",\n                    \"https://not_taken.com\",\n                    BlockId::BlockNumber(120)\n                )],\n                &BlockNumberMap::default(),\n                &tests_filter,\n            )\n            .await\n            .is_err()\n        );\n    }\n\n    #[tokio::test]\n    async fn test_ignored_filter_skips_fork_config_resolution() {\n        let ignored_test = create_test_case_with_config(\n            \"ignored_test\",\n            true,\n            Some(RawForkConfig::Named(\"non_existent_fork\".into())),\n        );\n\n        let test_target = create_test_target_with_cases(vec![ignored_test]);\n\n        // Create a filter that excludes ignored tests\n        let tests_filter = TestsFilter::from_flags(\n            None,\n            false,\n            Vec::new(),\n            false,\n            false,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n\n        let resolved = resolve_config(test_target, &[], &BlockNumberMap::default(), &tests_filter)\n            .await\n            .unwrap();\n\n        assert_eq!(resolved.test_cases.len(), 1);\n        assert!(resolved.test_cases[0].config.ignored);\n        assert!(resolved.test_cases[0].config.fork_config.is_none());\n    }\n\n    #[tokio::test]\n    async fn test_non_ignored_filter_resolves_fork_config() {\n        let test_case = create_test_case_with_config(\n            \"valid_test\",\n            false,\n            Some(RawForkConfig::Named(\"valid_fork\".into())),\n        );\n\n        let test_target = create_test_target_with_cases(vec![test_case]);\n\n        let fork_targets = vec![create_fork_target(\n            \"valid_fork\",\n            \"https://example.com\",\n            BlockId::BlockNumber(100),\n        )];\n\n        let tests_filter = TestsFilter::from_flags(\n            None,\n            false,\n            Vec::new(),\n            false,\n            true,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n\n        let resolved = resolve_config(\n            test_target,\n            &fork_targets,\n            &BlockNumberMap::default(),\n            &tests_filter,\n        )\n        .await\n        .unwrap();\n\n        assert_eq!(resolved.test_cases.len(), 1);\n        assert!(!resolved.test_cases[0].config.ignored);\n        assert!(resolved.test_cases[0].config.fork_config.is_some());\n\n        let fork_config = resolved.test_cases[0].config.fork_config.as_ref().unwrap();\n        assert_eq!(fork_config.url.as_str(), \"https://example.com/\");\n        assert_eq!(fork_config.block_number.0, 100);\n    }\n\n    #[tokio::test]\n    async fn test_name_filtered_test_still_resolves_fork_config() {\n        let test_case = create_test_case_with_config(\n            \"filtered_out_test\",\n            false,\n            Some(RawForkConfig::Named(\"valid_fork\".into())),\n        );\n\n        let test_target = create_test_target_with_cases(vec![test_case]);\n\n        let fork_targets = vec![create_fork_target(\n            \"valid_fork\",\n            \"https://example.com\",\n            BlockId::BlockNumber(100),\n        )];\n\n        let tests_filter = TestsFilter::from_flags(\n            Some(\"different_pattern\".to_string()),\n            false,\n            Vec::new(),\n            false,\n            false,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n\n        let resolved = resolve_config(\n            test_target,\n            &fork_targets,\n            &BlockNumberMap::default(),\n            &tests_filter,\n        )\n        .await\n        .unwrap();\n\n        assert_eq!(resolved.test_cases.len(), 1);\n        assert!(!resolved.test_cases[0].config.ignored);\n        assert!(resolved.test_cases[0].config.fork_config.is_some());\n\n        let fork_config = resolved.test_cases[0].config.fork_config.as_ref().unwrap();\n        assert_eq!(fork_config.url.as_str(), \"https://example.com/\");\n        assert_eq!(fork_config.block_number.0, 100);\n    }\n\n    #[tokio::test]\n    async fn test_mixed_scenarios_with_ignored_filter() {\n        let test_cases = vec![\n            create_test_case_with_config(\n                \"ignored_with_valid_fork\",\n                true,\n                Some(RawForkConfig::Named(\"valid_fork\".into())),\n            ),\n            create_test_case_with_config(\n                \"matching_test\",\n                false,\n                Some(RawForkConfig::Named(\"valid_fork\".into())),\n            ),\n            create_test_case_with_config(\n                \"non_matching_test\",\n                false,\n                Some(RawForkConfig::Named(\"valid_fork\".into())),\n            ),\n            create_test_case_with_config(\"no_fork_test\", false, None),\n        ];\n\n        let test_target = create_test_target_with_cases(test_cases);\n        let fork_targets = vec![create_fork_target(\n            \"valid_fork\",\n            \"https://example.com\",\n            BlockId::BlockNumber(200),\n        )];\n\n        let tests_filter = TestsFilter::from_flags(\n            Some(\"matching\".to_string()),\n            false,\n            Vec::new(),\n            false,\n            false,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n\n        let resolved = resolve_config(\n            test_target,\n            &fork_targets,\n            &BlockNumberMap::default(),\n            &tests_filter,\n        )\n        .await\n        .unwrap();\n\n        assert_eq!(resolved.test_cases.len(), 4);\n\n        // Check ignored test - should have no fork config resolved\n        let ignored_test = &resolved.test_cases[0];\n        assert_eq!(ignored_test.name, \"ignored_with_valid_fork\");\n        assert!(ignored_test.config.ignored);\n        assert!(ignored_test.config.fork_config.is_none());\n\n        // Check matching test - should have fork config resolved\n        let matching_test = &resolved.test_cases[1];\n        assert_eq!(matching_test.name, \"matching_test\");\n        assert!(!matching_test.config.ignored);\n        assert!(matching_test.config.fork_config.is_some());\n\n        // Check non-matching test - should still have fork config resolved (name filtering happens later)\n        let non_matching_test = &resolved.test_cases[2];\n        assert_eq!(non_matching_test.name, \"non_matching_test\");\n        assert!(!non_matching_test.config.ignored);\n        assert!(non_matching_test.config.fork_config.is_some());\n\n        // Check no-fork test - should work fine\n        let no_fork_test = &resolved.test_cases[3];\n        assert_eq!(no_fork_test.name, \"no_fork_test\");\n        assert!(!no_fork_test.config.ignored);\n        assert!(no_fork_test.config.fork_config.is_none());\n    }\n\n    #[tokio::test]\n    async fn test_only_ignored_filter_skips_non_ignored_fork_resolution() {\n        let test_cases = vec![\n            create_test_case_with_config(\n                \"ignored_test\",\n                true,\n                Some(RawForkConfig::Named(\"valid_fork\".into())),\n            ),\n            create_test_case_with_config(\n                \"non_ignored_test\",\n                false,\n                Some(RawForkConfig::Named(\"valid_fork\".into())),\n            ),\n        ];\n\n        let test_target = create_test_target_with_cases(test_cases);\n        let fork_targets = vec![create_fork_target(\n            \"valid_fork\",\n            \"https://example.com\",\n            BlockId::BlockNumber(400),\n        )];\n\n        let tests_filter = TestsFilter::from_flags(\n            None,\n            false,\n            Vec::new(),\n            true,\n            false,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n\n        let resolved = resolve_config(\n            test_target,\n            &fork_targets,\n            &BlockNumberMap::default(),\n            &tests_filter,\n        )\n        .await\n        .unwrap();\n\n        assert_eq!(resolved.test_cases.len(), 2);\n\n        // Ignored test should have fork config resolved since it should be run\n        let ignored_test = &resolved.test_cases[0];\n        assert_eq!(ignored_test.name, \"ignored_test\");\n        assert!(ignored_test.config.ignored);\n        assert!(ignored_test.config.fork_config.is_some());\n\n        // Non-ignored test should not have fork config resolved since it won't be run\n        let non_ignored_test = &resolved.test_cases[1];\n        assert_eq!(non_ignored_test.name, \"non_ignored_test\");\n        assert!(!non_ignored_test.config.ignored);\n        assert!(non_ignored_test.config.fork_config.is_none());\n    }\n\n    #[tokio::test]\n    async fn test_include_ignored_filter_resolves_all_fork_configs() {\n        let test_cases = vec![\n            create_test_case_with_config(\n                \"ignored_test\",\n                true,\n                Some(RawForkConfig::Named(\"valid_fork\".into())),\n            ),\n            create_test_case_with_config(\n                \"non_ignored_test\",\n                false,\n                Some(RawForkConfig::Named(\"valid_fork\".into())),\n            ),\n        ];\n\n        let test_target = create_test_target_with_cases(test_cases);\n\n        let fork_targets = vec![create_fork_target(\n            \"valid_fork\",\n            \"https://example.com\",\n            BlockId::BlockNumber(500),\n        )];\n\n        let tests_filter = TestsFilter::from_flags(\n            None,\n            false,\n            Vec::new(),\n            false,\n            true,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n\n        let resolved = resolve_config(\n            test_target,\n            &fork_targets,\n            &BlockNumberMap::default(),\n            &tests_filter,\n        )\n        .await\n        .unwrap();\n\n        assert_eq!(resolved.test_cases.len(), 2);\n\n        for test_case in &resolved.test_cases {\n            assert!(test_case.config.fork_config.is_some());\n            let fork_config = test_case.config.fork_config.as_ref().unwrap();\n            assert_eq!(fork_config.url.as_str(), \"https://example.com/\");\n            assert_eq!(fork_config.block_number.0, 500);\n        }\n\n        let ignored_test = &resolved.test_cases[0];\n        assert_eq!(ignored_test.name, \"ignored_test\");\n        assert!(ignored_test.config.ignored);\n\n        let non_ignored_test = &resolved.test_cases[1];\n        assert_eq!(non_ignored_test.name, \"non_ignored_test\");\n        assert!(!non_ignored_test.config.ignored);\n    }\n\n    #[tokio::test]\n    async fn test_fork_config_resolution_with_inline_config() {\n        let test_case = create_test_case_with_config(\n            \"test_with_inline_fork\",\n            false,\n            Some(RawForkConfig::Inline(InlineForkConfig {\n                url: \"https://inline-fork.com\".parse().unwrap(),\n                block: BlockId::BlockNumber(123),\n            })),\n        );\n\n        let test_target = create_test_target_with_cases(vec![test_case]);\n        let tests_filter = TestsFilter::from_flags(\n            None,\n            false,\n            Vec::new(),\n            false,\n            false,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n\n        let resolved = resolve_config(test_target, &[], &BlockNumberMap::default(), &tests_filter)\n            .await\n            .unwrap();\n\n        assert_eq!(resolved.test_cases.len(), 1);\n\n        let test_case = &resolved.test_cases[0];\n        assert!(!test_case.config.ignored);\n        assert!(test_case.config.fork_config.is_some());\n\n        let fork_config = test_case.config.fork_config.as_ref().unwrap();\n        assert_eq!(fork_config.url.as_str(), \"https://inline-fork.com/\");\n        assert_eq!(fork_config.block_number.0, 123);\n    }\n\n    #[tokio::test]\n    async fn test_overridden_fork_config_resolution() {\n        let test_case = create_test_case_with_config(\n            \"test_with_overridden_fork\",\n            false,\n            Some(RawForkConfig::Overridden(OverriddenForkConfig {\n                name: \"base_fork\".into(),\n                block: BlockId::BlockNumber(999),\n            })),\n        );\n\n        let test_target = create_test_target_with_cases(vec![test_case]);\n        let fork_targets = vec![create_fork_target(\n            \"base_fork\",\n            \"https://base-fork.com\",\n            BlockId::BlockNumber(100),\n        )];\n\n        let tests_filter = TestsFilter::from_flags(\n            None,\n            false,\n            Vec::new(),\n            false,\n            false,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n\n        let resolved = resolve_config(\n            test_target,\n            &fork_targets,\n            &BlockNumberMap::default(),\n            &tests_filter,\n        )\n        .await\n        .unwrap();\n\n        assert_eq!(resolved.test_cases.len(), 1);\n        let test_case = &resolved.test_cases[0];\n        assert!(test_case.config.fork_config.is_some());\n\n        let fork_config = test_case.config.fork_config.as_ref().unwrap();\n        assert_eq!(fork_config.url.as_str(), \"https://base-fork.com/\");\n        assert_eq!(fork_config.block_number.0, 999);\n    }\n\n    #[tokio::test]\n    async fn test_skip_filter_does_not_affect_fork_resolution() {\n        let test_case = create_test_case_with_config(\n            \"test_to_be_skipped\",\n            false,\n            Some(RawForkConfig::Named(\"valid_fork\".into())),\n        );\n\n        let test_target = create_test_target_with_cases(vec![test_case]);\n\n        let fork_targets = vec![create_fork_target(\n            \"valid_fork\",\n            \"https://example.com\",\n            BlockId::BlockNumber(600),\n        )];\n\n        let tests_filter = TestsFilter::from_flags(\n            None,\n            false,\n            vec![\"skipped\".to_string()],\n            false,\n            false,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n\n        let resolved = resolve_config(\n            test_target,\n            &fork_targets,\n            &BlockNumberMap::default(),\n            &tests_filter,\n        )\n        .await\n        .unwrap();\n\n        assert_eq!(resolved.test_cases.len(), 1);\n\n        let test_case = &resolved.test_cases[0];\n        assert!(!test_case.config.ignored);\n        assert!(test_case.config.fork_config.is_some());\n\n        let fork_config = test_case.config.fork_config.as_ref().unwrap();\n        assert_eq!(fork_config.url.as_str(), \"https://example.com/\");\n        assert_eq!(fork_config.block_number.0, 600);\n    }\n}\n"
  },
  {
    "path": "crates/forge/src/run_tests/test_target.rs",
    "content": "use anyhow::Result;\nuse forge_runner::filtering::{ExcludeReason, FilterResult, TestCaseFilter};\nuse forge_runner::messages::TestResultMessage;\nuse forge_runner::{\n    forge_config::ForgeConfig,\n    maybe_generate_coverage, maybe_save_trace_and_profile,\n    package_tests::with_config_resolved::TestTargetWithResolvedConfig,\n    run_for_test_case,\n    test_case_summary::{AnyTestCaseSummary, TestCaseSummary},\n    test_target_summary::TestTargetSummary,\n};\nuse foundry_ui::UI;\nuse futures::{StreamExt, stream::FuturesUnordered};\nuse std::sync::Arc;\nuse tokio::sync::mpsc::{Receiver, Sender, channel};\n\n/// Shared cancellation channel for `--exit-first`.\n///\n/// The channel is created at the workspace level and shared across all packages,\n/// so failure in one package immediately interrupts test cases in all subsequent packages.\npub struct ExitFirstChannel {\n    sender: Sender<()>,\n    receiver: Receiver<()>,\n}\n\nimpl Default for ExitFirstChannel {\n    fn default() -> Self {\n        Self::new()\n    }\n}\n\nimpl ExitFirstChannel {\n    #[must_use]\n    pub fn new() -> Self {\n        let (sender, receiver) = channel(1);\n        Self { sender, receiver }\n    }\n\n    #[must_use]\n    pub fn sender(&self) -> Sender<()> {\n        self.sender.clone()\n    }\n\n    pub fn close(&mut self) {\n        self.receiver.close();\n    }\n}\n\n#[non_exhaustive]\npub enum TestTargetRunResult {\n    Ok(TestTargetSummary),\n    Interrupted(TestTargetSummary),\n}\n\n#[tracing::instrument(skip_all, level = \"debug\")]\npub async fn run_for_test_target(\n    tests: TestTargetWithResolvedConfig,\n    forge_config: Arc<ForgeConfig>,\n    tests_filter: &impl TestCaseFilter,\n    ui: Arc<UI>,\n    exit_first_channel: &mut ExitFirstChannel,\n) -> Result<TestTargetRunResult> {\n    let casm_program = tests.casm_program.clone();\n\n    let mut tasks = FuturesUnordered::new();\n\n    for case in tests.test_cases {\n        let case_name = case.name.clone();\n        let filter_result = tests_filter.filter(&case);\n\n        match filter_result {\n            FilterResult::Excluded(reason) => match reason {\n                ExcludeReason::ExcludedFromPartition => {\n                    tasks.push(tokio::task::spawn(async {\n                        Ok(AnyTestCaseSummary::Single(\n                            TestCaseSummary::ExcludedFromPartition {},\n                        ))\n                    }));\n                }\n                ExcludeReason::Ignored => {\n                    tasks.push(tokio::task::spawn(async {\n                        Ok(AnyTestCaseSummary::Single(TestCaseSummary::Ignored {\n                            name: case_name,\n                        }))\n                    }));\n                }\n            },\n            FilterResult::Included => {\n                tasks.push(run_for_test_case(\n                    Arc::new(case),\n                    casm_program.clone(),\n                    forge_config.clone(),\n                    tests.sierra_program_path.clone(),\n                    exit_first_channel.sender(),\n                ));\n            }\n        }\n    }\n\n    let mut results = vec![];\n    let mut saved_trace_data_paths = vec![];\n    let mut interrupted = false;\n    let deterministic_output = forge_config.test_runner_config.deterministic_output;\n\n    let print_test_result = |result: &AnyTestCaseSummary| {\n        let test_result_message = TestResultMessage::new(\n            result,\n            forge_config.output_config.detailed_resources,\n            forge_config.test_runner_config.tracked_resource,\n        );\n        ui.println(&test_result_message);\n    };\n\n    while let Some(task) = tasks.next().await {\n        let result = task??;\n\n        // Skip printing; Print all results at once in a sorted order once they are available\n        if !deterministic_output && should_print_test_result_message(&result) {\n            print_test_result(&result);\n        }\n\n        let trace_path = maybe_save_trace_and_profile(\n            &result,\n            &forge_config.output_config.execution_data_to_save,\n        )?;\n        if let Some(path) = trace_path {\n            saved_trace_data_paths.push(path);\n        }\n\n        if result.is_failed() && forge_config.test_runner_config.exit_first {\n            interrupted = true;\n            exit_first_channel.close();\n        }\n\n        results.push(result);\n    }\n\n    if deterministic_output {\n        let mut sorted_results: Vec<_> = results\n            .iter()\n            .filter(|r| should_print_test_result_message(r))\n            .collect();\n        sorted_results.sort_by_key(|r| r.name().unwrap_or(\"\"));\n        for result in sorted_results {\n            print_test_result(result);\n        }\n    }\n\n    maybe_generate_coverage(\n        &forge_config.output_config.execution_data_to_save,\n        &saved_trace_data_paths,\n        &ui,\n    )?;\n\n    let summary = TestTargetSummary {\n        test_case_summaries: results,\n    };\n\n    if interrupted {\n        Ok(TestTargetRunResult::Interrupted(summary))\n    } else {\n        Ok(TestTargetRunResult::Ok(summary))\n    }\n}\n\nfn should_print_test_result_message(result: &AnyTestCaseSummary) -> bool {\n    !result.is_interrupted() && !result.is_excluded_from_partition()\n}\n"
  },
  {
    "path": "crates/forge/src/run_tests/workspace.rs",
    "content": "use super::package::RunForPackageArgs;\nuse crate::profile_validation::check_profile_compatibility;\nuse crate::run_tests::messages::latest_blocks_numbers::LatestBlocksNumbersMessage;\nuse crate::run_tests::messages::overall_summary::OverallSummaryMessage;\nuse crate::run_tests::messages::partition::{PartitionFinishedMessage, PartitionStartedMessage};\nuse crate::run_tests::messages::tests_failure_summary::TestsFailureSummaryMessage;\nuse crate::warn::{\n    error_if_snforge_std_not_compatible, warn_if_snforge_std_does_not_match_package_version,\n};\nuse crate::{\n    ColorOption, ExitStatus, TestArgs, block_number_map::BlockNumberMap,\n    run_tests::package::run_for_package, run_tests::test_target::ExitFirstChannel,\n    scarb::build_artifacts_with_scarb, shared_cache::FailedTestsCache,\n};\nuse anyhow::Result;\nuse forge_runner::partition::PartitionConfig;\nuse forge_runner::test_case_summary::AnyTestCaseSummary;\nuse forge_runner::{CACHE_DIR, test_target_summary::TestTargetSummary};\nuse foundry_ui::UI;\nuse scarb_api::metadata::{MetadataOpts, metadata_with_opts};\nuse scarb_api::{\n    metadata::{Metadata, PackageMetadata},\n    packages_from_filter, target_dir_for_workspace,\n};\nuse scarb_ui::args::PackagesFilter;\nuse shared::consts::SNFORGE_TEST_FILTER;\nuse std::env;\nuse std::sync::Arc;\n\n#[derive(Debug)]\npub struct WorkspaceExecutionSummary {\n    pub all_tests: Vec<TestTargetSummary>,\n}\n\n#[tracing::instrument(skip_all, level = \"debug\")]\n#[allow(clippy::too_many_lines)]\npub async fn run_for_workspace(args: TestArgs, ui: Arc<UI>) -> Result<ExitStatus> {\n    let scarb_metadata = metadata_with_opts(MetadataOpts {\n        profile: args.scarb_args.profile.specified(),\n        ..MetadataOpts::default()\n    })?;\n\n    let packages: Vec<PackageMetadata> =\n        packages_from_filter(&scarb_metadata, &args.scarb_args.packages_filter)?;\n\n    let filter = PackagesFilter::generate_for::<Metadata>(packages.iter());\n\n    build_artifacts_with_scarb(\n        filter.clone(),\n        args.scarb_args.features.clone(),\n        args.scarb_args.profile.clone(),\n        args.no_optimization,\n    )?;\n\n    let WorkspaceExecutionSummary { all_tests } =\n        execute_workspace(&args, ui, &scarb_metadata).await?;\n    let has_failures = extract_failed_tests(&all_tests).next().is_some();\n    Ok(if has_failures {\n        ExitStatus::Failure\n    } else {\n        ExitStatus::Success\n    })\n}\n\npub async fn execute_workspace(\n    args: &TestArgs,\n    ui: Arc<UI>,\n    scarb_metadata: &Metadata,\n) -> Result<WorkspaceExecutionSummary> {\n    let deterministic_output = args.deterministic_output;\n    match args.color {\n        // SAFETY: This runs in a single-threaded environment.\n        ColorOption::Always => unsafe { env::set_var(\"CLICOLOR_FORCE\", \"1\") },\n        // SAFETY: This runs in a single-threaded environment.\n        ColorOption::Never => unsafe { env::set_var(\"CLICOLOR\", \"0\") },\n        ColorOption::Auto => (),\n    }\n\n    check_profile_compatibility(args, scarb_metadata)?;\n\n    error_if_snforge_std_not_compatible(scarb_metadata)?;\n    warn_if_snforge_std_does_not_match_package_version(scarb_metadata, &ui)?;\n\n    let packages: Vec<PackageMetadata> =\n        packages_from_filter(scarb_metadata, &args.scarb_args.packages_filter)?;\n\n    let artifacts_dir_path =\n        target_dir_for_workspace(scarb_metadata).join(&scarb_metadata.current_profile);\n\n    if args.exact {\n        let test_filter = args.test_filter.clone();\n        if let Some(last_filter) =\n            test_filter.and_then(|filter| filter.split(\"::\").last().map(String::from))\n        {\n            set_forge_test_filter(last_filter);\n        }\n    }\n\n    let block_number_map = BlockNumberMap::default();\n    let mut all_tests = vec![];\n    let mut total_filtered_count = Some(0);\n    let mut exit_first_channel = ExitFirstChannel::new();\n\n    let workspace_root = &scarb_metadata.workspace.root;\n    let cache_dir = workspace_root.join(CACHE_DIR);\n    let packages_len = packages.len();\n\n    let partitioning_config = get_partitioning_config(args, &ui, &packages, &artifacts_dir_path)?;\n\n    // Spawn config passes for all packages before running any tests so that\n    // compilation overlaps with test execution across packages.\n    let mut all_package_args = Vec::with_capacity(packages.len());\n    for pkg in packages {\n        let cwd = env::current_dir()?;\n        env::set_current_dir(&pkg.root)?;\n        let pkg_args = RunForPackageArgs::build(\n            pkg,\n            scarb_metadata,\n            args,\n            &cache_dir,\n            &artifacts_dir_path,\n            partitioning_config.clone(),\n            &ui,\n        )?;\n        env::set_current_dir(&cwd)?;\n        all_package_args.push(pkg_args);\n    }\n\n    for pkg_args in all_package_args {\n        let cwd = env::current_dir()?;\n        env::set_current_dir(&pkg_args.package_root)?;\n\n        let result = run_for_package(\n            pkg_args,\n            &block_number_map,\n            ui.clone(),\n            &mut exit_first_channel,\n        )\n        .await?;\n\n        let filtered = result.filtered();\n        all_tests.extend(result.summaries());\n        total_filtered_count = calculate_total_filtered_count(total_filtered_count, filtered);\n        env::set_current_dir(&cwd)?;\n    }\n\n    let overall_summary = OverallSummaryMessage::new(&all_tests, total_filtered_count);\n    let mut all_failed_tests: Vec<&AnyTestCaseSummary> = extract_failed_tests(&all_tests).collect();\n    if deterministic_output {\n        all_failed_tests.sort_by(|a, b| a.name().unwrap_or(\"\").cmp(b.name().unwrap_or(\"\")));\n    }\n\n    FailedTestsCache::new(&cache_dir).save_failed_tests(&all_failed_tests)?;\n\n    let url_to_block_number = block_number_map.get_url_to_latest_block_number();\n    if !url_to_block_number.is_empty() {\n        ui.println(&LatestBlocksNumbersMessage::new(url_to_block_number));\n    }\n\n    ui.println(&TestsFailureSummaryMessage::new(&all_failed_tests));\n\n    // Print the overall summary only when testing multiple packages\n    if packages_len > 1 {\n        // Add newline to separate summary from previous output\n        ui.print_blank_line();\n        ui.println(&overall_summary);\n    }\n\n    match partitioning_config {\n        PartitionConfig::Disabled => (),\n        PartitionConfig::Enabled {\n            partition,\n            partition_map,\n        } => {\n            ui.print_blank_line();\n\n            let included = partition_map.included_tests_count(partition.index());\n            let total = partition_map.total_tests_count();\n            ui.println(&PartitionFinishedMessage::new(partition, included, total));\n        }\n    }\n\n    if args.exact {\n        unset_forge_test_filter();\n    }\n\n    Ok(WorkspaceExecutionSummary { all_tests })\n}\n\nfn calculate_total_filtered_count(\n    total_filtered_count: Option<usize>,\n    filtered: Option<usize>,\n) -> Option<usize> {\n    // Calculate filtered test counts across packages. When using `--exact` flag,\n    // `result.filtered_count` is None, so `total_filtered_count` becomes None too.\n    match (total_filtered_count, filtered) {\n        (Some(total), Some(f)) => Some(total + f),\n        _ => None,\n    }\n}\n\nfn get_partitioning_config(\n    args: &TestArgs,\n    ui: &UI,\n    packages: &[PackageMetadata],\n    artifacts_dir_path: &camino::Utf8Path,\n) -> Result<PartitionConfig> {\n    args.partition\n        .map(|partition| {\n            ui.print_blank_line();\n            ui.println(&PartitionStartedMessage::new(partition));\n            PartitionConfig::new(partition, packages, artifacts_dir_path)\n        })\n        .transpose()?\n        .map_or_else(|| Ok(PartitionConfig::Disabled), Ok)\n}\n\n#[tracing::instrument(skip_all, level = \"debug\")]\nfn extract_failed_tests(\n    tests_summaries: &[TestTargetSummary],\n) -> impl Iterator<Item = &AnyTestCaseSummary> {\n    tests_summaries\n        .iter()\n        .flat_map(|summary| &summary.test_case_summaries)\n        .filter(|s| s.is_failed())\n}\n\nfn set_forge_test_filter(test_filter: String) {\n    // SAFETY: This runs in a single-threaded environment.\n    unsafe {\n        env::set_var(SNFORGE_TEST_FILTER, test_filter);\n    };\n}\n\nfn unset_forge_test_filter() {\n    // SAFETY: This runs in a single-threaded environment.\n    unsafe {\n        env::remove_var(SNFORGE_TEST_FILTER);\n    };\n}\n"
  },
  {
    "path": "crates/forge/src/run_tests.rs",
    "content": "pub mod maat;\npub mod messages;\npub mod package;\npub mod resolve_config;\npub mod test_target;\npub mod workspace;\n"
  },
  {
    "path": "crates/forge/src/scarb/config.rs",
    "content": "use anyhow::Result;\nuse cheatnet::runtime_extensions::forge_config_extension::config::BlockId;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse serde::{Deserialize, Deserializer};\nuse std::{collections::HashSet, num::NonZeroU32};\nuse url::Url;\n\npub const SCARB_MANIFEST_TEMPLATE_CONTENT: &str = r#\"\n# Visit https://foundry-rs.github.io/starknet-foundry/appendix/scarb-toml.html for more information\n\n# [tool.snforge]                                             # Define `snforge` tool section\n# exit_first = true                                          # Stop tests execution immediately upon the first failure\n# fuzzer_runs = 1234                                         # Number of runs of the random fuzzer\n# fuzzer_seed = 1111                                         # Seed for the random fuzzer\n\n# [[tool.snforge.fork]]                                      # Used for fork testing\n# name = \"SOME_NAME\"                                         # Fork name\n# url = \"http://your.rpc.url\"                                # Url of the RPC provider\n# block_id.tag = \"latest\"                                    # Block to fork from (block tag)\n\n# [[tool.snforge.fork]]\n# name = \"SOME_SECOND_NAME\"\n# url = \"http://your.second.rpc.url\"                         \n# block_id.number = \"123\"                                    # Block to fork from (block number)\n\n# [[tool.snforge.fork]]\n# name = \"SOME_THIRD_NAME\"\n# url = \"http://your.third.rpc.url\"\n# block_id.hash = \"0x123\"                                    # Block to fork from (block hash)\n\n# [profile.dev.cairo]                                        # Configure Cairo compiler\n# unstable-add-statements-code-locations-debug-info = true   # Should be used if you want to use coverage\n# unstable-add-statements-functions-debug-info = true        # Should be used if you want to use coverage/profiler\n# inlining-strategy = \"avoid\"                                # Should be used if you want to use coverage\n\n# [features]                                                 # Used for conditional compilation\n# enable_for_tests = []                                      # Feature name and list of other features that should be enabled with it\n\"#;\n\n#[expect(clippy::struct_excessive_bools)]\n#[derive(Debug, PartialEq, Default, Deserialize)]\npub struct ForgeConfigFromScarb {\n    /// Should runner exit after first failed test\n    #[serde(default)]\n    pub exit_first: bool,\n    /// How many runs should fuzzer execute\n    pub fuzzer_runs: Option<NonZeroU32>,\n    /// Seed to be used by fuzzer\n    pub fuzzer_seed: Option<u64>,\n    /// Display more detailed info about used resources\n    #[serde(default)]\n    pub detailed_resources: bool,\n    /// Save execution traces of all test which have passed and are not fuzz tests\n    #[serde(default)]\n    pub save_trace_data: bool,\n    /// Build profiles of all tests which have passed and are not fuzz tests\n    #[serde(default)]\n    pub build_profile: bool,\n    /// Generate a coverage report for the executed tests which have passed and are not fuzz tests\n    #[serde(default)]\n    pub coverage: bool,\n    /// Display a table of L2 gas breakdown for each contract and selector\n    #[serde(default)]\n    pub gas_report: bool,\n    /// Fork configuration profiles\n    #[serde(default, deserialize_with = \"validate_forks\")]\n    pub fork: Vec<ForkTarget>,\n    /// Limit of steps\n    pub max_n_steps: Option<u32>,\n    /// Set tracked resource\n    #[serde(default)]\n    pub tracked_resource: ForgeTrackedResource,\n}\n\n#[derive(Debug, PartialEq, Clone, Deserialize)]\npub struct ForkTarget {\n    pub name: String,\n    pub url: Url,\n    pub block_id: BlockId,\n}\n\nfn validate_forks<'de, D>(deserializer: D) -> Result<Vec<ForkTarget>, D::Error>\nwhere\n    D: Deserializer<'de>,\n{\n    // deserialize to Vec<ForkTarget>\n    let fork_targets = Vec::<ForkTarget>::deserialize(deserializer)?;\n\n    let names: Vec<_> = fork_targets.iter().map(|fork| &fork.name).collect();\n    let removed_duplicated_names: HashSet<_> = names.iter().collect();\n    if names.len() != removed_duplicated_names.len() {\n        return Err(serde::de::Error::custom(\"Some fork names are duplicated\"));\n    }\n\n    Ok(fork_targets)\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use serde_json::json;\n    use starknet_types_core::felt::Felt;\n    use test_case::test_case;\n    use url::Url;\n\n    #[test]\n    fn test_fork_target_new_valid_number() {\n        let name = \"TestFork\";\n        let url = \"http://example.com\";\n        let block_id_type = \"number\";\n        let block_id_value = \"123\";\n\n        let json_str = json!({\n            \"name\": name,\n            \"url\": url,\n            \"block_id\": {\n                block_id_type: block_id_value\n            }\n        })\n        .to_string();\n\n        let fork_target = serde_json::from_str::<ForkTarget>(&json_str).unwrap();\n\n        assert_eq!(fork_target.name, name);\n        assert_eq!(fork_target.url, Url::parse(url).unwrap());\n        if let BlockId::BlockNumber(number) = fork_target.block_id {\n            assert_eq!(number, 123);\n        } else {\n            panic!(\"Expected BlockId::BlockNumber\");\n        }\n    }\n\n    #[test]\n    fn test_fork_target_new_valid_hash() {\n        let name = \"TestFork\";\n        let url = \"http://example.com\";\n\n        let json_str = json!({\n            \"name\": name,\n            \"url\": url,\n            \"block_id\": {\n                \"hash\": \"0x1\"\n            }\n        })\n        .to_string();\n\n        let fork_target = serde_json::from_str::<ForkTarget>(&json_str).unwrap();\n\n        assert_eq!(fork_target.name, name);\n        assert_eq!(fork_target.url, Url::parse(url).unwrap());\n        if let BlockId::BlockHash(hash) = fork_target.block_id {\n            assert_eq!(hash, Felt::from_dec_str(\"1\").unwrap());\n        } else {\n            panic!(\"Expected BlockId::BlockHash\");\n        }\n    }\n\n    #[test]\n    fn test_fork_target_new_valid_tag() {\n        let name = \"TestFork\";\n        let url = \"http://example.com\";\n\n        let json_str = json!({\n            \"name\": name,\n            \"url\": url,\n            \"block_id\": {\n                \"tag\": \"latest\"\n            }\n        })\n        .to_string();\n\n        let fork_target = serde_json::from_str::<ForkTarget>(&json_str).unwrap();\n\n        assert_eq!(fork_target.name, name);\n        assert_eq!(fork_target.url, Url::parse(url).unwrap());\n        if let BlockId::BlockTag = fork_target.block_id {\n            // Expected variant\n        } else {\n            panic!(\"Expected BlockId::BlockTag\");\n        }\n    }\n\n    #[test_case(\n        &json!({\n            \"name\": \"TestFork\",\n            \"url\": \"invalid_url\",\n            \"block_id\": {\n                \"number\": \"123\"\n            }\n        }),\n        \"relative URL without a base\";\n        \"Invalid url\"\n    )]\n    #[test_case(\n        &json!({\n            \"name\": \"TestFork\",\n            \"url\": \"http://example.com\",\n            \"block_id\": {\n                \"number\": \"invalid_number\"\n            }\n        }),\n        \"invalid digit found in string\";\n        \"Invalid number\"\n    )]\n    #[test_case(\n        &json!({\n            \"name\": \"TestFork\",\n            \"url\": \"http://example.com\",\n            \"block_id\": {\n                \"hash\": \"invalid_hash\"\n            }\n        }),\n        \"failed to create Felt from string\";\n        \"Invalid hash\"\n    )]\n    fn test_fork_target_invalid_cases(input: &serde_json::Value, expected_error: &str) {\n        let json_str = input.to_string();\n        let result = serde_json::from_str::<ForkTarget>(&json_str);\n        assert!(result.is_err());\n        assert!(result.unwrap_err().to_string().contains(expected_error));\n    }\n}\n"
  },
  {
    "path": "crates/forge/src/scarb.rs",
    "content": "use crate::scarb::config::ForgeConfigFromScarb;\nuse anyhow::{Context, Result, anyhow};\nuse configuration::Config;\nuse configuration::core::Profile;\nuse scarb_api::ScarbCommand;\nuse scarb_metadata::{Metadata, PackageId};\nuse scarb_ui::args::{FeaturesSpec, PackagesFilter, ProfileSpec};\n\npub mod config;\n\nimpl Config for ForgeConfigFromScarb {\n    fn tool_name() -> &'static str {\n        \"snforge\"\n    }\n\n    fn from_raw(config: serde_json::Value) -> Result<Self>\n    where\n        Self: Sized,\n    {\n        serde_json::from_value(config.clone()).context(\"Failed to parse snforge config\")\n    }\n}\n\n/// Loads config for a specific package from the `Scarb.toml` file\n/// # Arguments\n/// * `metadata` - Scarb metadata object\n/// * `package` - Id of the Scarb package\npub fn load_package_config<T: Config + Default>(\n    metadata: &Metadata,\n    package: &PackageId,\n) -> Result<T> {\n    let maybe_raw_metadata = metadata\n        .get_package(package)\n        .ok_or_else(|| anyhow!(\"Failed to find metadata for package = {package}\"))?\n        .tool_metadata(T::tool_name())\n        .cloned();\n\n    match maybe_raw_metadata {\n        Some(raw_metadata) => configuration::core::load_config(raw_metadata, Profile::None),\n        None => Ok(T::default()),\n    }\n}\n\n#[tracing::instrument(skip_all, level = \"debug\")]\npub fn build_artifacts_with_scarb(\n    filter: PackagesFilter,\n    features: FeaturesSpec,\n    profile: ProfileSpec,\n    no_optimization: bool,\n) -> Result<()> {\n    if no_optimization {\n        build_contracts_with_scarb(filter.clone(), features.clone(), profile.clone())?;\n    }\n    build_test_artifacts_with_scarb(filter, features, profile)?;\n    Ok(())\n}\n\nfn build_contracts_with_scarb(\n    filter: PackagesFilter,\n    features: FeaturesSpec,\n    profile: ProfileSpec,\n) -> Result<()> {\n    ScarbCommand::new_with_stdio()\n        .arg(\"build\")\n        .packages_filter(filter)\n        .features(features)\n        .profile(profile)\n        .run()\n        .context(\"Failed to build contracts with Scarb\")?;\n    Ok(())\n}\n\nfn build_test_artifacts_with_scarb(\n    filter: PackagesFilter,\n    features: FeaturesSpec,\n    profile: ProfileSpec,\n) -> Result<()> {\n    ScarbCommand::new_with_stdio()\n        .arg(\"build\")\n        .arg(\"--test\")\n        .packages_filter(filter)\n        .features(features)\n        .profile(profile)\n        .run()\n        .context(\"Failed to build test artifacts with Scarb\")?;\n    Ok(())\n}\n"
  },
  {
    "path": "crates/forge/src/shared_cache.rs",
    "content": "use anyhow::Result;\nuse camino::Utf8PathBuf;\nuse forge_runner::test_case_summary::AnyTestCaseSummary;\nuse std::fs::File;\nuse std::io::{BufRead, BufReader, BufWriter, ErrorKind, Write};\n\n#[derive(Debug, PartialEq, Default, Clone)]\npub struct FailedTestsCache {\n    cache_file: Utf8PathBuf,\n}\n\nconst FILE_WITH_PREV_TESTS_FAILED: &str = \".prev_tests_failed\";\n\nimpl FailedTestsCache {\n    #[must_use]\n    pub fn new(cache_dir: &Utf8PathBuf) -> Self {\n        Self {\n            cache_file: cache_dir.join(FILE_WITH_PREV_TESTS_FAILED),\n        }\n    }\n\n    pub fn load(&self) -> Result<Vec<String>> {\n        let file = match File::open(&self.cache_file) {\n            Ok(file) => file,\n            Err(err) if err.kind() == ErrorKind::NotFound => return Ok(vec![]),\n            Err(err) => Err(err)?,\n        };\n        let buf: BufReader<File> = BufReader::new(file);\n\n        let tests = buf.lines().collect::<Result<Vec<_>, _>>()?;\n\n        Ok(tests)\n    }\n\n    pub fn save_failed_tests(&self, all_failed_tests: &[&AnyTestCaseSummary]) -> Result<()> {\n        std::fs::create_dir_all(self.cache_file.parent().unwrap())?;\n\n        let file = File::create(&self.cache_file)?;\n\n        let mut file = BufWriter::new(file);\n\n        for line in all_failed_tests {\n            let name = line.name().unwrap();\n\n            writeln!(file, \"{name}\")?;\n        }\n        Ok(())\n    }\n}\n"
  },
  {
    "path": "crates/forge/src/test_filter.rs",
    "content": "use crate::shared_cache::FailedTestsCache;\nuse anyhow::Result;\nuse forge_runner::filtering::{ExcludeReason, FilterResult, TestCaseFilter, TestCaseIsIgnored};\nuse forge_runner::package_tests::TestCase;\nuse forge_runner::package_tests::with_config_resolved::{\n    TestCaseWithResolvedConfig, sanitize_test_case_name,\n};\nuse forge_runner::partition::PartitionConfig;\n\n#[derive(Debug, PartialEq)]\n// Specifies what tests should be included\npub struct TestsFilter {\n    // based on name\n    pub(crate) name_filter: NameFilter,\n    // based on `#[ignore]` attribute\n    ignored_filter: IgnoredFilter,\n    // based on `--rerun_failed` flag\n    last_failed_filter: bool,\n    // based on `--skip` flag\n    skip_filter: Vec<String>,\n\n    failed_tests_cache: FailedTestsCache,\n    pub(crate) partitioning_config: PartitionConfig,\n}\n\n#[derive(Debug, PartialEq)]\npub(crate) enum NameFilter {\n    All,\n    Match(String),\n    ExactMatch(String),\n}\n\n#[derive(Debug, PartialEq)]\npub enum IgnoredFilter {\n    IncludeAll,\n    IgnoredOnly,\n    ExcludeIgnored,\n}\n\nimpl TestsFilter {\n    #[must_use]\n    #[expect(clippy::fn_params_excessive_bools)]\n    #[expect(clippy::too_many_arguments)]\n    pub fn from_flags(\n        test_name_filter: Option<String>,\n        exact_match: bool,\n        skip: Vec<String>,\n        only_ignored: bool,\n        include_ignored: bool,\n        rerun_failed: bool,\n        failed_tests_cache: FailedTestsCache,\n        partitioning_config: PartitionConfig,\n    ) -> Self {\n        assert!(\n            !(only_ignored && include_ignored),\n            \"Arguments only_ignored and include_ignored cannot be both true\"\n        );\n\n        let ignored_filter = if include_ignored {\n            IgnoredFilter::IncludeAll\n        } else if only_ignored {\n            IgnoredFilter::IgnoredOnly\n        } else {\n            IgnoredFilter::ExcludeIgnored\n        };\n\n        let name_filter = if exact_match {\n            NameFilter::ExactMatch(\n                test_name_filter\n                    .expect(\"Argument test_name_filter cannot be None with exact_match\"),\n            )\n        } else if let Some(name) = test_name_filter {\n            NameFilter::Match(name)\n        } else {\n            NameFilter::All\n        };\n\n        Self {\n            name_filter,\n            ignored_filter,\n            last_failed_filter: rerun_failed,\n            skip_filter: skip,\n            failed_tests_cache,\n            partitioning_config,\n        }\n    }\n\n    fn is_in_partition(&self, sanitized_name: &str) -> bool {\n        match &self.partitioning_config {\n            PartitionConfig::Disabled => true,\n            PartitionConfig::Enabled {\n                partition,\n                partition_map,\n            } => {\n                let idx = partition_map\n                    .get_assigned_index(sanitized_name)\n                    .expect(\"Partition map must contain all test cases\");\n                idx == partition.index()\n            }\n        }\n    }\n\n    pub(crate) fn filter_tests(\n        &self,\n        test_cases: &mut Vec<TestCaseWithResolvedConfig>,\n    ) -> Result<()> {\n        match &self.name_filter {\n            NameFilter::All => {}\n            NameFilter::Match(filter) => {\n                test_cases.retain(|tc| tc.name.contains(filter));\n            }\n\n            NameFilter::ExactMatch(name) => {\n                test_cases.retain(|tc| tc.name == *name);\n            }\n        }\n\n        if self.last_failed_filter {\n            match self.failed_tests_cache.load()?.as_slice() {\n                [] => {}\n                result => {\n                    test_cases.retain(|tc| result.iter().any(|name| name == &tc.name));\n                }\n            }\n        }\n\n        match self.ignored_filter {\n            // if ExcludeIgnored (default) we filter ignored tests later and display them as ignored\n            IgnoredFilter::IncludeAll | IgnoredFilter::ExcludeIgnored => {}\n            IgnoredFilter::IgnoredOnly => {\n                test_cases.retain(|tc| tc.config.ignored);\n            }\n        }\n\n        if !self.skip_filter.is_empty() {\n            test_cases.retain(|tc| !self.skip_filter.iter().any(|s| tc.name.contains(s)));\n        }\n\n        Ok(())\n    }\n}\n\nimpl TestCaseFilter for TestsFilter {\n    fn filter<T>(&self, test_case: &TestCase<T>) -> FilterResult\n    where\n        T: TestCaseIsIgnored,\n    {\n        // Order of filter checks matters, because we do not want to display a test as ignored if\n        // it was excluded due to partitioning.\n        let sanitized_test_case_name = sanitize_test_case_name(&test_case.name);\n        if !self.is_in_partition(&sanitized_test_case_name) {\n            return FilterResult::Excluded(ExcludeReason::ExcludedFromPartition);\n        }\n\n        let case_ignored = test_case.config.is_ignored();\n\n        match self.ignored_filter {\n            IgnoredFilter::IncludeAll => {}\n            IgnoredFilter::IgnoredOnly => {\n                if !case_ignored {\n                    return FilterResult::Excluded(ExcludeReason::Ignored);\n                }\n            }\n            IgnoredFilter::ExcludeIgnored => {\n                if case_ignored {\n                    return FilterResult::Excluded(ExcludeReason::Ignored);\n                }\n            }\n        }\n        FilterResult::Included\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use crate::shared_cache::FailedTestsCache;\n    use crate::test_filter::TestsFilter;\n    use cairo_lang_sierra::program::Program;\n    use cairo_lang_sierra::program::ProgramArtifact;\n    use forge_runner::expected_result::ExpectedTestResult;\n    use forge_runner::package_tests::with_config_resolved::{\n        TestCaseResolvedConfig, TestCaseWithResolvedConfig, TestTargetWithResolvedConfig,\n    };\n    use forge_runner::package_tests::{TestDetails, TestTargetLocation};\n    use forge_runner::partition::PartitionConfig;\n    use std::sync::Arc;\n    use universal_sierra_compiler_api::compile_raw_sierra;\n\n    fn program_for_testing() -> ProgramArtifact {\n        ProgramArtifact {\n            program: Program {\n                type_declarations: vec![],\n                libfunc_declarations: vec![],\n                statements: vec![],\n                funcs: vec![],\n            },\n            debug_info: None,\n        }\n    }\n\n    #[test]\n    #[should_panic(expected = \"Arguments only_ignored and include_ignored cannot be both true\")]\n    fn from_flags_only_ignored_and_include_ignored_both_true() {\n        let _ = TestsFilter::from_flags(\n            None,\n            false,\n            Vec::new(),\n            true,\n            true,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n    }\n\n    #[test]\n    #[should_panic(expected = \"Argument test_name_filter cannot be None with exact_match\")]\n    fn from_flags_exact_match_true_without_test_filter_name() {\n        let _ = TestsFilter::from_flags(\n            None,\n            true,\n            Vec::new(),\n            false,\n            false,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n    }\n\n    #[test]\n    #[expect(clippy::too_many_lines)]\n    fn filtering_tests() {\n        let mocked_tests = TestTargetWithResolvedConfig {\n            sierra_program: program_for_testing(),\n            sierra_program_path: Arc::default(),\n            casm_program: Arc::new(\n                compile_raw_sierra(&serde_json::to_value(&program_for_testing().program).unwrap())\n                    .unwrap(),\n            ),\n            test_cases: vec![\n                TestCaseWithResolvedConfig {\n                    name: \"crate1::do_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: false,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n                TestCaseWithResolvedConfig {\n                    name: \"crate2::run_other_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: true,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n                TestCaseWithResolvedConfig {\n                    name: \"outer::crate2::execute_next_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: true,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n                TestCaseWithResolvedConfig {\n                    name: \"thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: false,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n            ],\n            tests_location: TestTargetLocation::Lib,\n        };\n\n        let tests_filter = TestsFilter::from_flags(\n            Some(\"do\".to_string()),\n            false,\n            Vec::new(),\n            false,\n            false,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n\n        let mut filtered = mocked_tests.clone();\n\n        tests_filter.filter_tests(&mut filtered.test_cases).unwrap();\n\n        assert_eq!(\n            filtered.test_cases,\n            vec![TestCaseWithResolvedConfig {\n                name: \"crate1::do_thing\".to_string(),\n                test_details: TestDetails::default(),\n\n                config: TestCaseResolvedConfig {\n                    available_gas: None,\n                    ignored: false,\n                    expected_result: ExpectedTestResult::Success,\n                    fork_config: None,\n                    fuzzer_config: None,\n                    disable_predeployed_contracts: false,\n                },\n            },]\n        );\n\n        let tests_filter = TestsFilter::from_flags(\n            Some(\"te2::run\".to_string()),\n            false,\n            Vec::new(),\n            false,\n            false,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n\n        let mut filtered = mocked_tests.clone();\n        tests_filter.filter_tests(&mut filtered.test_cases).unwrap();\n\n        assert_eq!(\n            filtered.test_cases,\n            vec![TestCaseWithResolvedConfig {\n                name: \"crate2::run_other_thing\".to_string(),\n                test_details: TestDetails::default(),\n\n                config: TestCaseResolvedConfig {\n                    available_gas: None,\n                    ignored: true,\n                    expected_result: ExpectedTestResult::Success,\n                    fork_config: None,\n                    fuzzer_config: None,\n                    disable_predeployed_contracts: false,\n                },\n            },]\n        );\n\n        let tests_filter = TestsFilter::from_flags(\n            Some(\"thing\".to_string()),\n            false,\n            Vec::new(),\n            false,\n            false,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n\n        let mut filtered = mocked_tests.clone();\n        tests_filter.filter_tests(&mut filtered.test_cases).unwrap();\n\n        assert_eq!(\n            filtered.test_cases,\n            vec![\n                TestCaseWithResolvedConfig {\n                    name: \"crate1::do_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: false,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n                TestCaseWithResolvedConfig {\n                    name: \"crate2::run_other_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: true,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n                TestCaseWithResolvedConfig {\n                    name: \"outer::crate2::execute_next_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: true,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n                TestCaseWithResolvedConfig {\n                    name: \"thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: false,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n            ]\n        );\n\n        let tests_filter = TestsFilter::from_flags(\n            Some(\"nonexistent\".to_string()),\n            false,\n            Vec::new(),\n            false,\n            false,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n\n        let mut filtered = mocked_tests.clone();\n        tests_filter.filter_tests(&mut filtered.test_cases).unwrap();\n\n        assert_eq!(filtered.test_cases, vec![]);\n\n        let tests_filter = TestsFilter::from_flags(\n            Some(String::new()),\n            false,\n            Vec::new(),\n            false,\n            false,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n\n        let mut filtered = mocked_tests.clone();\n        tests_filter.filter_tests(&mut filtered.test_cases).unwrap();\n\n        assert_eq!(\n            filtered.test_cases,\n            vec![\n                TestCaseWithResolvedConfig {\n                    name: \"crate1::do_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: false,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n                TestCaseWithResolvedConfig {\n                    name: \"crate2::run_other_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: true,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n                TestCaseWithResolvedConfig {\n                    name: \"outer::crate2::execute_next_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: true,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n                TestCaseWithResolvedConfig {\n                    name: \"thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: false,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n            ]\n        );\n    }\n\n    #[test]\n    fn filtering_with_no_tests() {\n        let mocked_tests = TestTargetWithResolvedConfig {\n            sierra_program: program_for_testing(),\n            sierra_program_path: Arc::default(),\n            casm_program: Arc::new(\n                compile_raw_sierra(&serde_json::to_value(&program_for_testing().program).unwrap())\n                    .unwrap(),\n            ),\n            test_cases: vec![],\n            tests_location: TestTargetLocation::Lib,\n        };\n\n        let tests_filter = TestsFilter::from_flags(\n            Some(String::new()),\n            false,\n            Vec::new(),\n            false,\n            false,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n\n        let mut filtered = mocked_tests.clone();\n        tests_filter.filter_tests(&mut filtered.test_cases).unwrap();\n\n        assert_eq!(filtered.test_cases, vec![]);\n\n        let tests_filter = TestsFilter::from_flags(\n            Some(\"thing\".to_string()),\n            false,\n            Vec::new(),\n            false,\n            false,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n\n        let mut filtered = mocked_tests.clone();\n        tests_filter.filter_tests(&mut filtered.test_cases).unwrap();\n\n        assert_eq!(filtered.test_cases, vec![]);\n    }\n\n    #[test]\n    #[expect(clippy::too_many_lines)]\n    fn filtering_with_exact_match() {\n        let mocked_tests = TestTargetWithResolvedConfig {\n            sierra_program: program_for_testing(),\n            sierra_program_path: Arc::default(),\n            casm_program: Arc::new(\n                compile_raw_sierra(&serde_json::to_value(&program_for_testing().program).unwrap())\n                    .unwrap(),\n            ),\n            test_cases: vec![\n                TestCaseWithResolvedConfig {\n                    name: \"crate1::do_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: false,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n                TestCaseWithResolvedConfig {\n                    name: \"crate2::run_other_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: true,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n                TestCaseWithResolvedConfig {\n                    name: \"outer::crate3::run_other_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: true,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n                TestCaseWithResolvedConfig {\n                    name: \"do_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: false,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n            ],\n            tests_location: TestTargetLocation::Tests,\n        };\n\n        let tests_filter = TestsFilter::from_flags(\n            Some(String::new()),\n            true,\n            Vec::new(),\n            false,\n            false,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n\n        let mut filtered = mocked_tests.clone();\n        tests_filter.filter_tests(&mut filtered.test_cases).unwrap();\n\n        assert_eq!(filtered.test_cases, vec![]);\n\n        let tests_filter = TestsFilter::from_flags(\n            Some(\"thing\".to_string()),\n            true,\n            Vec::new(),\n            false,\n            false,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n\n        let mut filtered = mocked_tests.clone();\n        tests_filter.filter_tests(&mut filtered.test_cases).unwrap();\n\n        assert_eq!(filtered.test_cases, vec![]);\n\n        let tests_filter = TestsFilter::from_flags(\n            Some(\"do_thing\".to_string()),\n            true,\n            Vec::new(),\n            false,\n            false,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n\n        let mut filtered = mocked_tests.clone();\n        tests_filter.filter_tests(&mut filtered.test_cases).unwrap();\n\n        assert_eq!(\n            filtered.test_cases,\n            vec![TestCaseWithResolvedConfig {\n                name: \"do_thing\".to_string(),\n                test_details: TestDetails::default(),\n\n                config: TestCaseResolvedConfig {\n                    available_gas: None,\n                    ignored: false,\n                    expected_result: ExpectedTestResult::Success,\n                    fork_config: None,\n                    fuzzer_config: None,\n                    disable_predeployed_contracts: false,\n                },\n            },]\n        );\n\n        let tests_filter = TestsFilter::from_flags(\n            Some(\"crate1::do_thing\".to_string()),\n            true,\n            Vec::new(),\n            false,\n            false,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n\n        let mut filtered = mocked_tests.clone();\n        tests_filter.filter_tests(&mut filtered.test_cases).unwrap();\n\n        assert_eq!(\n            filtered.test_cases,\n            vec![TestCaseWithResolvedConfig {\n                name: \"crate1::do_thing\".to_string(),\n                test_details: TestDetails::default(),\n\n                config: TestCaseResolvedConfig {\n                    available_gas: None,\n                    ignored: false,\n                    expected_result: ExpectedTestResult::Success,\n                    fork_config: None,\n                    fuzzer_config: None,\n                    disable_predeployed_contracts: false,\n                },\n            },]\n        );\n\n        let tests_filter = TestsFilter::from_flags(\n            Some(\"crate3::run_other_thing\".to_string()),\n            true,\n            Vec::new(),\n            false,\n            false,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n\n        let mut filtered = mocked_tests.clone();\n        tests_filter.filter_tests(&mut filtered.test_cases).unwrap();\n\n        assert_eq!(filtered.test_cases, vec![]);\n\n        let tests_filter = TestsFilter::from_flags(\n            Some(\"outer::crate3::run_other_thing\".to_string()),\n            true,\n            Vec::new(),\n            false,\n            false,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n\n        let mut filtered = mocked_tests.clone();\n        tests_filter.filter_tests(&mut filtered.test_cases).unwrap();\n\n        assert_eq!(\n            filtered.test_cases,\n            vec![TestCaseWithResolvedConfig {\n                name: \"outer::crate3::run_other_thing\".to_string(),\n                test_details: TestDetails::default(),\n\n                config: TestCaseResolvedConfig {\n                    available_gas: None,\n                    ignored: true,\n                    expected_result: ExpectedTestResult::Success,\n                    fork_config: None,\n                    fuzzer_config: None,\n                    disable_predeployed_contracts: false,\n                },\n            },]\n        );\n    }\n\n    #[test]\n    fn filtering_with_only_ignored() {\n        let mocked_tests = TestTargetWithResolvedConfig {\n            sierra_program: program_for_testing(),\n            sierra_program_path: Arc::default(),\n            casm_program: Arc::new(\n                compile_raw_sierra(&serde_json::to_value(&program_for_testing().program).unwrap())\n                    .unwrap(),\n            ),\n            test_cases: vec![\n                TestCaseWithResolvedConfig {\n                    name: \"crate1::do_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: false,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n                TestCaseWithResolvedConfig {\n                    name: \"crate2::run_other_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: true,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n                TestCaseWithResolvedConfig {\n                    name: \"outer::crate3::run_other_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: true,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n                TestCaseWithResolvedConfig {\n                    name: \"do_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: false,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n            ],\n            tests_location: TestTargetLocation::Tests,\n        };\n\n        let tests_filter = TestsFilter::from_flags(\n            None,\n            false,\n            Vec::new(),\n            true,\n            false,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n        let mut filtered = mocked_tests;\n        tests_filter.filter_tests(&mut filtered.test_cases).unwrap();\n\n        assert_eq!(\n            filtered.test_cases,\n            vec![\n                TestCaseWithResolvedConfig {\n                    name: \"crate2::run_other_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: true,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n                TestCaseWithResolvedConfig {\n                    name: \"outer::crate3::run_other_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: true,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n            ]\n        );\n    }\n\n    #[test]\n    #[expect(clippy::too_many_lines)]\n    fn filtering_with_include_ignored() {\n        let mocked_tests = TestTargetWithResolvedConfig {\n            sierra_program: program_for_testing(),\n            sierra_program_path: Arc::default(),\n            casm_program: Arc::new(\n                compile_raw_sierra(&serde_json::to_value(&program_for_testing().program).unwrap())\n                    .unwrap(),\n            ),\n            test_cases: vec![\n                TestCaseWithResolvedConfig {\n                    name: \"crate1::do_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: false,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n                TestCaseWithResolvedConfig {\n                    name: \"crate2::run_other_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: true,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n                TestCaseWithResolvedConfig {\n                    name: \"outer::crate3::run_other_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: true,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n                TestCaseWithResolvedConfig {\n                    name: \"do_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: false,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n            ],\n            tests_location: TestTargetLocation::Tests,\n        };\n\n        let tests_filter = TestsFilter::from_flags(\n            None,\n            false,\n            Vec::new(),\n            false,\n            true,\n            false,\n            FailedTestsCache::default(),\n            PartitionConfig::default(),\n        );\n        let mut filtered = mocked_tests;\n        tests_filter.filter_tests(&mut filtered.test_cases).unwrap();\n\n        assert_eq!(\n            filtered.test_cases,\n            vec![\n                TestCaseWithResolvedConfig {\n                    name: \"crate1::do_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: false,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n                TestCaseWithResolvedConfig {\n                    name: \"crate2::run_other_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: true,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n                TestCaseWithResolvedConfig {\n                    name: \"outer::crate3::run_other_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: true,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n                TestCaseWithResolvedConfig {\n                    name: \"do_thing\".to_string(),\n                    test_details: TestDetails::default(),\n\n                    config: TestCaseResolvedConfig {\n                        available_gas: None,\n                        ignored: false,\n                        expected_result: ExpectedTestResult::Success,\n                        fork_config: None,\n                        fuzzer_config: None,\n                        disable_predeployed_contracts: false,\n                    },\n                },\n            ]\n        );\n    }\n}\n"
  },
  {
    "path": "crates/forge/src/warn.rs",
    "content": "use crate::MINIMAL_SNFORGE_STD_VERSION;\nuse anyhow::{Result, anyhow};\nuse forge_runner::package_tests::with_config_resolved::TestTargetWithResolvedConfig;\nuse foundry_ui::UI;\nuse foundry_ui::components::warning::WarningMessage;\nuse scarb_api::package_matches_version_requirement;\nuse scarb_metadata::Metadata;\nuse semver::{Comparator, Op, Version, VersionReq};\nuse shared::rpc::create_rpc_client;\nuse shared::verify_and_warn_if_incompatible_rpc_version;\nuse std::collections::HashSet;\nuse std::env;\nuse std::sync::Arc;\nuse url::Url;\n\npub(crate) async fn warn_if_incompatible_rpc_version(\n    test_targets: &[TestTargetWithResolvedConfig],\n    ui: Arc<UI>,\n) -> Result<()> {\n    let mut urls = HashSet::<Url>::new();\n\n    // collect urls\n    for test_target in test_targets {\n        for fork_config in test_target\n            .test_cases\n            .iter()\n            .filter_map(|tc| tc.config.fork_config.as_ref())\n        {\n            urls.insert(fork_config.url.clone());\n        }\n    }\n\n    let mut handles = Vec::with_capacity(urls.len());\n\n    for url in urls {\n        let ui = ui.clone();\n        handles.push(tokio::spawn(async move {\n            let client = create_rpc_client(&url)?;\n\n            verify_and_warn_if_incompatible_rpc_version(&client, &url, &ui).await\n        }));\n    }\n\n    for handle in handles {\n        handle.await??;\n    }\n\n    Ok(())\n}\n\nfn snforge_std_recommended_version() -> VersionReq {\n    let version = Version::parse(env!(\"CARGO_PKG_VERSION\")).unwrap();\n    let comparator = Comparator {\n        op: Op::Caret,\n        major: version.major,\n        minor: Some(version.minor),\n        patch: Some(version.patch),\n        pre: version.pre,\n    };\n    VersionReq {\n        comparators: vec![comparator],\n    }\n}\n\npub fn error_if_snforge_std_not_compatible(scarb_metadata: &Metadata) -> Result<()> {\n    let snforge_std_version_requirement_comparator = Comparator {\n        op: Op::GreaterEq,\n        major: MINIMAL_SNFORGE_STD_VERSION.major,\n        minor: Some(MINIMAL_SNFORGE_STD_VERSION.minor),\n        patch: Some(MINIMAL_SNFORGE_STD_VERSION.patch),\n        pre: MINIMAL_SNFORGE_STD_VERSION.pre,\n    };\n    let snforge_std_version_requirement = VersionReq {\n        comparators: vec![snforge_std_version_requirement_comparator],\n    };\n\n    if !package_matches_version_requirement(\n        scarb_metadata,\n        \"snforge_std\",\n        &snforge_std_version_requirement,\n    )? {\n        return Err(anyhow!(\n            \"Package snforge_std version does not meet the minimum required version {snforge_std_version_requirement}. Please upgrade snforge_std in Scarb.toml\"\n        ));\n    }\n    Ok(())\n}\n\npub fn warn_if_snforge_std_does_not_match_package_version(\n    scarb_metadata: &Metadata,\n    ui: &UI,\n) -> Result<()> {\n    let snforge_std_version_requirement = snforge_std_recommended_version();\n    if !package_matches_version_requirement(\n        scarb_metadata,\n        \"snforge_std\",\n        &snforge_std_version_requirement,\n    )? {\n        ui.println(&WarningMessage::new(&format!(\n            \"Package snforge_std version does not meet the recommended version requirement {snforge_std_version_requirement}, it might result in unexpected behaviour\"\n        )));\n    }\n    Ok(())\n}\n"
  },
  {
    "path": "crates/forge/tests/data/backtrace_panic/Scarb.toml",
    "content": "[package]\nname = \"backtrace_panic\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html\n\n[dependencies]\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n\n[profile.dev.cairo]\nunstable-add-statements-functions-debug-info = true\nunstable-add-statements-code-locations-debug-info = true\npanic-backtrace = true\n"
  },
  {
    "path": "crates/forge/tests/data/backtrace_panic/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait IOuterContract<TState> {\n    fn outer(self: @TState, contract_address: starknet::ContractAddress);\n}\n\n#[starknet::contract]\npub mod OuterContract {\n    use super::{IInnerContractDispatcher, IInnerContractDispatcherTrait};\n\n    #[storage]\n    pub struct Storage {}\n\n    #[abi(embed_v0)]\n    impl OuterContract of super::IOuterContract<ContractState> {\n        fn outer(self: @ContractState, contract_address: starknet::ContractAddress) {\n            let dispatcher = IInnerContractDispatcher { contract_address };\n            dispatcher.inner();\n        }\n    }\n}\n\n#[starknet::interface]\npub trait IInnerContract<TState> {\n    fn inner(self: @TState);\n}\n\n#[starknet::contract]\npub mod InnerContract {\n    #[storage]\n    pub struct Storage {}\n\n    #[abi(embed_v0)]\n    impl InnerContract of super::IInnerContract<ContractState> {\n        fn inner(self: @ContractState) {\n            inner_call()\n        }\n    }\n\n    fn inner_call() {\n        assert(1 != 1, 'Assert failed');\n    }\n}\n\n#[cfg(test)]\nmod Test {\n    use snforge_std::cheatcodes::contract_class::DeclareResultTrait;\n    use snforge_std::{ContractClassTrait, declare};\n    use super::{IOuterContractDispatcher, IOuterContractDispatcherTrait};\n\n    #[test]\n    fn test_contract_panics() {\n        let contract_inner = declare(\"InnerContract\").unwrap().contract_class();\n        let (contract_address_inner, _) = contract_inner.deploy(@array![]).unwrap();\n\n        let contract_outer = declare(\"OuterContract\").unwrap().contract_class();\n        let (contract_address_outer, _) = contract_outer.deploy(@array![]).unwrap();\n\n        let dispatcher = IOuterContractDispatcher { contract_address: contract_address_outer };\n        dispatcher.outer(contract_address_inner);\n    }\n\n    #[ignore]\n    #[should_panic]\n    #[test]\n    fn test_contract_panics_with_should_panic() {\n        let contract_inner = declare(\"InnerContract\").unwrap().contract_class();\n        let (contract_address_inner, _) = contract_inner.deploy(@array![]).unwrap();\n\n        let contract_outer = declare(\"OuterContract\").unwrap().contract_class();\n        let (contract_address_outer, _) = contract_outer.deploy(@array![]).unwrap();\n\n        let dispatcher = IOuterContractDispatcher { contract_address: contract_address_outer };\n        dispatcher.outer(contract_address_inner);\n    }\n\n    #[test]\n    #[fork(url: \"{{ NODE_RPC_URL }}\", block_number: 806134)]\n    fn test_fork_contract_panics() {\n        // NOTE: This is not exactly the same as InnerContract here, but will return the same error\n        // Class hash needs to be different otherwise it would be found locally in the state\n        let contract_address_inner =\n            0x066eda239a01152a912129fe6b5bf309c9b21e3f583df4e5b7ee8ede1fad820a\n            .try_into()\n            .unwrap();\n\n        let contract_outer = declare(\"OuterContract\").unwrap().contract_class();\n        let (contract_address_outer, _) = contract_outer.deploy(@array![]).unwrap();\n\n        let dispatcher = IOuterContractDispatcher { contract_address: contract_address_outer };\n        dispatcher.outer(contract_address_inner);\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/backtrace_vm_error/Scarb.toml",
    "content": "[package]\nname = \"backtrace_vm_error\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html\n\n[dependencies]\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n\n[profile.dev.cairo]\nunstable-add-statements-functions-debug-info = true\nunstable-add-statements-code-locations-debug-info = true\npanic-backtrace = true\n"
  },
  {
    "path": "crates/forge/tests/data/backtrace_vm_error/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait IOuterContract<TState> {\n    fn outer(self: @TState, contract_address: starknet::ContractAddress);\n}\n\n#[starknet::contract]\npub mod OuterContract {\n    use super::{IInnerContractDispatcher, IInnerContractDispatcherTrait};\n\n    #[storage]\n    pub struct Storage {}\n\n    #[abi(embed_v0)]\n    impl OuterContract of super::IOuterContract<ContractState> {\n        fn outer(self: @ContractState, contract_address: starknet::ContractAddress) {\n            let dispatcher = IInnerContractDispatcher { contract_address };\n            dispatcher.inner();\n        }\n    }\n}\n\n#[starknet::interface]\npub trait IInnerContract<TState> {\n    fn inner(self: @TState);\n}\n\n#[starknet::contract]\npub mod InnerContract {\n    use starknet::syscalls::call_contract_syscall;\n    use starknet::{ContractAddress, SyscallResultTrait};\n\n    #[storage]\n    pub struct Storage {}\n\n    #[abi(embed_v0)]\n    impl InnerContract of super::IInnerContract<ContractState> {\n        fn inner(self: @ContractState) {\n            inner_call()\n        }\n    }\n\n    fn inner_call() {\n        let address: ContractAddress = 0x123.try_into().unwrap();\n        let selector = selector!(\"dummy\");\n        let calldata = array![].span();\n\n        // This fails immediately due to nonexistent address\n        call_contract_syscall(address, selector, calldata).unwrap_syscall();\n    }\n}\n\n#[cfg(test)]\nmod Test {\n    use snforge_std::cheatcodes::contract_class::DeclareResultTrait;\n    use snforge_std::{ContractClassTrait, declare};\n    use super::{IOuterContractDispatcher, IOuterContractDispatcherTrait};\n\n    #[test]\n    fn test_unwrapped_call_contract_syscall() {\n        let contract_inner = declare(\"InnerContract\").unwrap().contract_class();\n        let (contract_address_inner, _) = contract_inner.deploy(@array![]).unwrap();\n\n        let contract_outer = declare(\"OuterContract\").unwrap().contract_class();\n        let (contract_address_outer, _) = contract_outer.deploy(@array![]).unwrap();\n\n        let dispatcher = IOuterContractDispatcher { contract_address: contract_address_outer };\n        dispatcher.outer(contract_address_inner);\n    }\n\n    #[test]\n    #[fork(url: \"{{ NODE_RPC_URL }}\", block_number: 806134)]\n    fn test_fork_unwrapped_call_contract_syscall() {\n        // NOTE: This is not exactly the same as InnerContract here, but will return the same error\n        // Class hash needs to be different otherwise it would be found locally in the state\n        let contract_address_inner =\n            0x01506c04bdb56f2cc9ea1f67fcb086c99df7cec2598ce90e56f1d36fffda1cf4\n            .try_into()\n            .unwrap();\n\n        let contract_outer = declare(\"OuterContract\").unwrap().contract_class();\n        let (contract_address_outer, _) = contract_outer.deploy(@array![]).unwrap();\n\n        let dispatcher = IOuterContractDispatcher { contract_address: contract_address_outer };\n        dispatcher.outer(contract_address_inner);\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_with_lib/Scarb.toml",
    "content": "[package]\nname = \"collection_with_lib\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html\n\n[dependencies]\n# foo = { path = \"vendor/foo\" }\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n"
  },
  {
    "path": "crates/forge/tests/data/collection_with_lib/fob.cairo",
    "content": "// Won't be found by the collector\n\nuse collection_with_lib::fob::fob_impl::fob_fn;\n\n#[test]\nfn test_fob() {\n    assert(fob_fn(0, 1, 10) == 55, fob_fn(0, 1, 10));\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_with_lib/src/fab/fab_impl.cairo",
    "content": "use collection_with_lib::fib::fib_fn;\nuse super::fn_from_above;\n\npub fn fab_fn(a: felt252, b: felt252, n: felt252) -> felt252 {\n    match n {\n        0 => a,\n        _ => fab_fn(b, a + b, n - 1),\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::{fab_fn, fib_fn, fn_from_above};\n\n    #[test]\n    fn test_fab() {\n        assert(fab_fn(0, 1, 10) == 55, fab_fn(0, 1, 10));\n    }\n\n    #[test]\n    fn test_how_does_this_work() {\n        assert(fib_fn(0, 1, 10) == 55, fib_fn(0, 1, 10));\n    }\n\n    #[test]\n    fn test_super() {\n        let one: felt252 = 1;\n        assert(fn_from_above() == one, 1);\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_with_lib/src/fab/fibfabfob.cairo",
    "content": "// Won't be found by the collector\n\nuse collection_with_lib::fab::fab_impl::fab_fn;\nuse collection_with_lib::fib::fib_fn;\nuse collection_with_lib::fob::fob_impl::fob_fn;\n\n#[cfg(test)]\nmod tests {\n    use super::{fab_fn, fib_fn, fob_fb};\n\n    #[test]\n    fn test_fib() {\n        assert(fib_fn(0, 1, 10) == 55, fib_fn(0, 1, 10));\n    }\n\n    #[test]\n    fn test_fob() {\n        assert(fob_fn(0, 1, 10) == 55, fob_fn(0, 1, 10));\n    }\n\n    #[test]\n    fn test_fab() {\n        assert(fab_fn(0, 1, 10) == 55, fab_fn(0, 1, 10));\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_with_lib/src/fab.cairo",
    "content": "pub mod fab_impl;\n\npub fn fn_from_above() -> felt252 {\n    1\n}\n\n#[cfg(test)]\nmod tests {\n    #[test]\n    fn test_simple() {\n        assert(1 == 1, 1);\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_with_lib/src/fib.cairo",
    "content": "use collection_with_lib::fob::fob_impl::fob_fn;\nuse super::fab::fab_impl::fab_fn;\n\npub fn fib_fn(a: felt252, b: felt252, n: felt252) -> felt252 {\n    match n {\n        0 => a,\n        _ => fib_fn(b, a + b, n - 1),\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::{fab_fn, fib_fn, fob_fn};\n\n    #[test]\n    fn test_fib() {\n        assert(fib_fn(0, 1, 10) == 55, fib_fn(0, 1, 10));\n    }\n\n    #[test]\n    fn test_fob_in_fib() {\n        assert(fob_fn(0, 1, 10) == 55, fob_fn(0, 1, 10));\n    }\n\n    #[test]\n    fn test_fab_in_fib() {\n        assert(fab_fn(0, 1, 10) == 55, fab_fn(0, 1, 10));\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_with_lib/src/fob/fibfabfob.cairo",
    "content": "// Won't be found by the collector\n\nuse collection_with_lib::fab::fab_impl::fab_fn;\nuse collection_with_lib::fib::fib_fn;\nuse collection_with_lib::fob::fob_impl::fob_fn;\n\n\n#[cfg(test)]\nmod tests {\n    use super::{fab_fn, fib_fn, fob_fn};\n\n    #[test]\n    fn test_fib() {\n        assert(fib_fn(0, 1, 10) == 55, fib_fn(0, 1, 10));\n    }\n\n    #[test]\n    fn test_fob() {\n        assert(fob_fn(0, 1, 10) == 55, fob_fn(0, 1, 10));\n    }\n\n    #[test]\n    fn test_fab() {\n        assert(fab_fn(0, 1, 10) == 55, fab_fn(0, 1, 10));\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_with_lib/src/fob/fob_impl.cairo",
    "content": "pub fn fob_fn(a: felt252, b: felt252, n: felt252) -> felt252 {\n    match n {\n        0 => a,\n        _ => fob_fn(b, a + b, n - 1),\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::fob_fn;\n\n    #[test]\n    fn test_fob() {\n        assert(fob_fn(0, 1, 10) == 55, fob_fn(0, 1, 10));\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_with_lib/src/fob.cairo",
    "content": "pub mod fob_impl;\n\n#[cfg(test)]\nmod tests {\n    #[test]\n    fn test_simple() {\n        assert(1 == 1, 1);\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_with_lib/src/lib.cairo",
    "content": "pub mod fab;\npub mod fib;\npub mod fob;\nuse fib::fib_fn;\nuse fob::fob_impl::fob_fn;\n\n#[cfg(test)]\nmod tests {\n    use super::{fib_fn, fob_fn};\n    #[test]\n    fn test_simple() {\n        assert(1 == 1, 1);\n    }\n\n    #[test]\n    fn test_fob_in_lib() {\n        assert(fob_fn(0, 1, 10) == 55, fob_fn(0, 1, 10));\n    }\n\n    #[test]\n    fn test_fib_in_lib() {\n        assert(fib_fn(0, 1, 10) == 55, fib_fn(0, 1, 10));\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_with_lib/tests/fab/fab_mod.cairo",
    "content": "use super::fab_fn;\n\n#[test]\nfn test_fab() {\n    assert(fab_fn(0, 1, 10) == 55, fab_fn(0, 1, 10));\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_with_lib/tests/fab.cairo",
    "content": "use collection_with_lib::fab::fab_impl::fab_fn;\n\nmod fab_mod;\n\n#[test]\nfn test_fab() {\n    assert(fab_fn(0, 1, 10) == 55, fab_fn(0, 1, 10));\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_with_lib/tests/fibfabfob.cairo",
    "content": "use collection_with_lib::fab::fab_impl::fab_fn;\nuse collection_with_lib::fib::fib_fn;\nuse collection_with_lib::fob::fob_impl::fob_fn;\n\n#[test]\nfn test_fib() {\n    assert(fib_fn(0, 1, 10) == 55, fib_fn(0, 1, 10));\n}\n\n#[test]\nfn test_fob() {\n    assert(fob_fn(0, 1, 10) == 55, fob_fn(0, 1, 10));\n}\n\n#[test]\nfn test_fab() {\n    assert(fab_fn(0, 1, 10) == 55, fab_fn(0, 1, 10));\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_with_lib/tests/lib.cairo",
    "content": "pub mod fab;\npub mod fibfabfob;\n"
  },
  {
    "path": "crates/forge/tests/data/collection_with_lib/tests/not_found/not_found.cairo",
    "content": "// Won't be found by the collector\n\nuse collection_with_lib::fib::fib_fn;\n\n#[test]\nfn test_fib() {\n    assert(fib_fn(0, 1, 10) == 55, fib_fn(0, 1, 10));\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_with_lib/tests/not_found.cairo",
    "content": "// Won't be found by the collector\n\nuse super::fibfabfob::fab_fn;\n\nmod fab_mod;\n\n#[test]\nfn test_fab() {\n    assert(fab_fn(0, 1, 10) == 55, fab_fn(0, 1, 10));\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_without_lib/Scarb.toml",
    "content": "[package]\nname = \"collection_without_lib\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html\n\n[dependencies]\n# foo = { path = \"vendor/foo\" }\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n"
  },
  {
    "path": "crates/forge/tests/data/collection_without_lib/fob.cairo",
    "content": "// Won't be found by the collector\n\nuse collection_without_lib::fob::fob_impl::fob_fn;\n\n#[test]\nfn test_fob() {\n    assert(fob_fn(0, 1, 10) == 55, fob_fn(0, 1, 10));\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_without_lib/src/fab/fab_impl.cairo",
    "content": "use collection_without_lib::fib::fib_fn;\nuse super::fn_from_above;\n\npub fn fab_fn(a: felt252, b: felt252, n: felt252) -> felt252 {\n    match n {\n        0 => a,\n        _ => fab_fn(b, a + b, n - 1),\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::{fab_fn, fib_fn, fn_from_above};\n\n    #[test]\n    fn test_fab() {\n        assert(fab_fn(0, 1, 10) == 55, fab_fn(0, 1, 10));\n    }\n\n    #[test]\n    fn test_how_does_this_work() {\n        assert(fib_fn(0, 1, 10) == 55, fib_fn(0, 1, 10));\n    }\n\n    #[test]\n    fn test_super() {\n        let one: felt252 = 1;\n        assert(fn_from_above() == one, 1);\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_without_lib/src/fab/fibfabfob.cairo",
    "content": "// Won't be found by the collector\n\nuse collection_without_lib::fab::fab_impl::fab_fn;\nuse collection_without_lib::fib::fib_fn;\nuse collection_without_lib::fob::fob_impl::fob_fn;\n\n#[cfg(test)]\nmod tests {\n    use super::{fab_fn, fib_fn, fob_fb};\n\n    #[test]\n    fn test_fib() {\n        assert(fib_fn(0, 1, 10) == 55, fib_fn(0, 1, 10));\n    }\n\n    #[test]\n    fn test_fob() {\n        assert(fob_fn(0, 1, 10) == 55, fob_fn(0, 1, 10));\n    }\n\n    #[test]\n    fn test_fab() {\n        assert(fab_fn(0, 1, 10) == 55, fab_fn(0, 1, 10));\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_without_lib/src/fab.cairo",
    "content": "pub mod fab_impl;\n\nfn fn_from_above() -> felt252 {\n    1\n}\n\n#[cfg(test)]\nmod tests {\n    #[test]\n    fn test_simple() {\n        assert(1 == 1, 1);\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_without_lib/src/fib.cairo",
    "content": "use collection_without_lib::fob::fob_impl::fob_fn;\nuse super::fab::fab_impl::fab_fn;\n\npub fn fib_fn(a: felt252, b: felt252, n: felt252) -> felt252 {\n    match n {\n        0 => a,\n        _ => fib_fn(b, a + b, n - 1),\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::{fab_fn, fib_fn, fob_fn};\n\n    #[test]\n    fn test_fib() {\n        assert(fib_fn(0, 1, 10) == 55, fib_fn(0, 1, 10));\n    }\n\n    #[test]\n    fn test_fob_in_fib() {\n        assert(fob_fn(0, 1, 10) == 55, fob_fn(0, 1, 10));\n    }\n\n    #[test]\n    fn test_fab_in_fib() {\n        assert(fab_fn(0, 1, 10) == 55, fab_fn(0, 1, 10));\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_without_lib/src/fob/fibfabfob.cairo",
    "content": "// Won't be found by the collector\n\nuse collection_without_lib::fab::fab_impl::fab_fn;\nuse collection_without_lib::fib::fib_fn;\nuse collection_without_lib::fob::fob_impl::fob_fn;\n\n\n#[cfg(test)]\nmod tests {\n    use super::{fab_fn, fib_fn, fob_fn};\n\n    #[test]\n    fn test_fib() {\n        assert(fib_fn(0, 1, 10) == 55, fib_fn(0, 1, 10));\n    }\n\n    #[test]\n    fn test_fob() {\n        assert(fob_fn(0, 1, 10) == 55, fob_fn(0, 1, 10));\n    }\n\n    #[test]\n    fn test_fab() {\n        assert(fab_fn(0, 1, 10) == 55, fab_fn(0, 1, 10));\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_without_lib/src/fob/fob_impl.cairo",
    "content": "pub fn fob_fn(a: felt252, b: felt252, n: felt252) -> felt252 {\n    match n {\n        0 => a,\n        _ => fob_fn(b, a + b, n - 1),\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::fob_fn;\n\n    #[test]\n    fn test_fob() {\n        assert(fob_fn(0, 1, 10) == 55, fob_fn(0, 1, 10));\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_without_lib/src/fob.cairo",
    "content": "pub mod fob_impl;\n\n#[cfg(test)]\nmod tests {\n    #[test]\n    fn test_simple() {\n        assert(1 == 1, 1);\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_without_lib/src/lib.cairo",
    "content": "pub mod fab;\npub mod fib;\npub mod fob;\nuse fib::fib_fn;\nuse fob::fob_impl::fob_fn;\n\n#[cfg(test)]\nmod tests {\n    use super::{fib_fn, fob_fn};\n    #[test]\n    fn test_simple() {\n        assert(1 == 1, 1);\n    }\n\n    #[test]\n    fn test_fob_in_lib() {\n        assert(fob_fn(0, 1, 10) == 55, fob_fn(0, 1, 10));\n    }\n\n    #[test]\n    fn test_fib_in_lib() {\n        assert(fib_fn(0, 1, 10) == 55, fib_fn(0, 1, 10));\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_without_lib/tests/fab/fab_mod.cairo",
    "content": "use super::fab_fn;\n\n#[test]\nfn test_fab() {\n    assert(fab_fn(0, 1, 10) == 55, fab_fn(0, 1, 10));\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_without_lib/tests/fab.cairo",
    "content": "use collection_without_lib::fab::fab_impl::fab_fn;\n\nmod fab_mod;\n\n#[test]\nfn test_fab() {\n    assert(fab_fn(0, 1, 10) == 55, fab_fn(0, 1, 10));\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_without_lib/tests/fibfabfob.cairo",
    "content": "use collection_without_lib::fab::fab_impl::fab_fn;\nuse collection_without_lib::fib::fib_fn;\nuse collection_without_lib::fob::fob_impl::fob_fn;\n\n#[test]\nfn test_fib() {\n    assert(fib_fn(0, 1, 10) == 55, fib_fn(0, 1, 10));\n}\n\n#[test]\nfn test_fob() {\n    assert(fob_fn(0, 1, 10) == 55, fob_fn(0, 1, 10));\n}\n\n#[test]\nfn test_fab() {\n    assert(fab_fn(0, 1, 10) == 55, fab_fn(0, 1, 10));\n}\n"
  },
  {
    "path": "crates/forge/tests/data/collection_without_lib/tests/not_found/not_found.cairo",
    "content": "// Won't be found by the collector\n\nuse super::fab_fn;\n\n#[test]\nfn test_fab() {\n    assert(fab_fn(0, 1, 10) == 55, fab_fn(0, 1, 10));\n}\n"
  },
  {
    "path": "crates/forge/tests/data/component_macros/Scarb.toml",
    "content": "[package]\nname = \"component_macros\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html\n\n[dependencies]\nstarknet = \"2.4.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n"
  },
  {
    "path": "crates/forge/tests/data/component_macros/src/example.cairo",
    "content": "const MINTER_ROLE: felt252 = selector!(\"MINTER_ROLE\");\n\n#[starknet::interface]\npub trait IMyContract<TContractState> {\n    fn mint(ref self: TContractState);\n}\n\n#[starknet::contract]\nmod MyContract {\n    use component_macros::oz_ac_component::{AccessControlComponent, SRC5Component};\n    use starknet::ContractAddress;\n    use super::MINTER_ROLE;\n\n    component!(path: AccessControlComponent, storage: accesscontrol, event: AccessControlEvent);\n    component!(path: SRC5Component, storage: src5, event: SRC5Event);\n\n\n    // AccessControl\n    #[abi(embed_v0)]\n    impl AccessControlImpl =\n        AccessControlComponent::AccessControlImpl<ContractState>;\n    impl AccessControlInternalImpl = AccessControlComponent::InternalImpl<ContractState>;\n\n    // SRC5\n    #[abi(embed_v0)]\n    impl SRC5Impl = SRC5Component::SRC5Impl<ContractState>;\n\n    #[storage]\n    struct Storage {\n        #[substorage(v0)]\n        accesscontrol: AccessControlComponent::Storage,\n        #[substorage(v0)]\n        src5: SRC5Component::Storage,\n    }\n\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    enum Event {\n        #[flat]\n        AccessControlEvent: AccessControlComponent::Event,\n        #[flat]\n        SRC5Event: SRC5Component::Event,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState, minter: ContractAddress) {\n        // AccessControl-related initialization\n        self.accesscontrol.initializer();\n        self.accesscontrol._grant_role(MINTER_ROLE, minter);\n    }\n\n    #[abi(embed_v0)]\n    impl MyContractImpl of super::IMyContract<ContractState> {\n        /// This function can only be called by a minter.\n        fn mint(ref self: ContractState) {\n            self.accesscontrol.assert_only_role(MINTER_ROLE);\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/component_macros/src/lib.cairo",
    "content": "pub mod example;\npub mod oz_ac_component;\n"
  },
  {
    "path": "crates/forge/tests/data/component_macros/src/oz_ac_component.cairo",
    "content": "/// # SRC5 Component\n///\n/// The SRC5 component allows contracts to expose the interfaces they implement.\n#[starknet::component]\npub mod SRC5Component {\n    use starknet::storage::{Map, StorageMapReadAccess, StoragePathEntry, StoragePointerWriteAccess};\n\n    const ISRC5_ID: felt252 = 0x3f918d17e5ee77373b56385708f855659a07f75997f365cf87748628532a055;\n\n    #[starknet::interface]\n    pub trait ISRC5<TState> {\n        fn supports_interface(self: @TState, interface_id: felt252) -> bool;\n    }\n\n\n    #[storage]\n    pub struct Storage {\n        SRC5_supported_interfaces: Map<felt252, bool>,\n    }\n\n    pub mod Errors {\n        pub const INVALID_ID: felt252 = 'SRC5: invalid id';\n    }\n\n    #[embeddable_as(SRC5Impl)]\n    pub impl SRC5<\n        TContractState, +HasComponent<TContractState>,\n    > of ISRC5<ComponentState<TContractState>> {\n        /// Returns whether the contract implements the given interface.\n        fn supports_interface(\n            self: @ComponentState<TContractState>, interface_id: felt252,\n        ) -> bool {\n            if interface_id == ISRC5_ID {\n                return true;\n            }\n            self.SRC5_supported_interfaces.read(interface_id)\n        }\n    }\n\n    #[generate_trait]\n    pub impl InternalImpl<\n        TContractState, +HasComponent<TContractState>,\n    > of InternalTrait<TContractState> {\n        /// Registers the given interface as supported by the contract.\n        fn register_interface(ref self: ComponentState<TContractState>, interface_id: felt252) {\n            self.SRC5_supported_interfaces.entry(interface_id).write(true);\n        }\n\n        /// Deregisters the given interface as supported by the contract.\n        fn deregister_interface(ref self: ComponentState<TContractState>, interface_id: felt252) {\n            assert(interface_id != ISRC5_ID, Errors::INVALID_ID);\n            self.SRC5_supported_interfaces.entry(interface_id).write(true);\n        }\n    }\n}\n\n\n#[starknet::component]\npub mod AccessControlComponent {\n    use starknet::storage::{Map, StorageMapReadAccess, StoragePathEntry, StoragePointerWriteAccess};\n    use starknet::{ContractAddress, get_caller_address};\n    use super::SRC5Component;\n    use super::SRC5Component::InternalTrait as SRC5InternalTrait;\n\n\n    #[starknet::interface]\n    pub trait IAccessControl<TState> {\n        fn has_role(self: @TState, role: felt252, account: ContractAddress) -> bool;\n        fn get_role_admin(self: @TState, role: felt252) -> felt252;\n        fn grant_role(ref self: TState, role: felt252, account: ContractAddress);\n        fn revoke_role(ref self: TState, role: felt252, account: ContractAddress);\n        fn renounce_role(ref self: TState, role: felt252, account: ContractAddress);\n    }\n\n    #[storage]\n    pub struct Storage {\n        AccessControl_role_admin: Map<felt252, felt252>,\n        AccessControl_role_member: Map<(felt252, ContractAddress), bool>,\n    }\n\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    pub enum Event {\n        RoleGranted: RoleGranted,\n        RoleRevoked: RoleRevoked,\n        RoleAdminChanged: RoleAdminChanged,\n    }\n\n    /// Emitted when `account` is granted `role`.\n    ///\n    /// `sender` is the account that originated the contract call, an admin role\n    /// bearer (except if `_grant_role` is called during initialization from the constructor).\n    #[derive(Drop, starknet::Event)]\n    struct RoleGranted {\n        role: felt252,\n        account: ContractAddress,\n        sender: ContractAddress,\n    }\n\n    /// Emitted when `account` is revoked `role`.\n    ///\n    /// `sender` is the account that originated the contract call:\n    ///   - If using `revoke_role`, it is the admin role bearer.\n    ///   - If using `renounce_role`, it is the role bearer (i.e. `account`).\n    #[derive(Drop, starknet::Event)]\n    struct RoleRevoked {\n        role: felt252,\n        account: ContractAddress,\n        sender: ContractAddress,\n    }\n\n    /// Emitted when `new_admin_role` is set as `role`'s admin role, replacing `previous_admin_role`\n    ///\n    /// `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n    /// {RoleAdminChanged} not being emitted signaling this.\n    #[derive(Drop, starknet::Event)]\n    struct RoleAdminChanged {\n        role: felt252,\n        previous_admin_role: felt252,\n        new_admin_role: felt252,\n    }\n\n    pub mod Errors {\n        pub const INVALID_CALLER: felt252 = 'Can only renounce role for self';\n        pub const MISSING_ROLE: felt252 = 'Caller is missing role';\n    }\n\n    #[embeddable_as(AccessControlImpl)]\n    pub impl AccessControl<\n        TContractState,\n        +HasComponent<TContractState>,\n        +SRC5Component::HasComponent<TContractState>,\n        +Drop<TContractState>,\n    > of IAccessControl<ComponentState<TContractState>> {\n        /// Returns whether `account` has been granted `role`.\n        fn has_role(\n            self: @ComponentState<TContractState>, role: felt252, account: ContractAddress,\n        ) -> bool {\n            self.AccessControl_role_member.read((role, account))\n        }\n\n        /// Returns the admin role that controls `role`.\n        fn get_role_admin(self: @ComponentState<TContractState>, role: felt252) -> felt252 {\n            self.AccessControl_role_admin.read(role)\n        }\n\n        /// Grants `role` to `account`.\n        ///\n        /// If `account` had not been already granted `role`, emits a `RoleGranted` event.\n        ///\n        /// Requirements:\n        ///\n        /// - the caller must have `role`'s admin role.\n        fn grant_role(\n            ref self: ComponentState<TContractState>, role: felt252, account: ContractAddress,\n        ) {\n            let admin = self.get_role_admin(role);\n            self.assert_only_role(admin);\n            self._grant_role(role, account);\n        }\n\n        /// Revokes `role` from `account`.\n        ///\n        /// If `account` had been granted `role`, emits a `RoleRevoked` event.\n        ///\n        /// Requirements:\n        ///\n        /// - the caller must have `role`'s admin role.\n        fn revoke_role(\n            ref self: ComponentState<TContractState>, role: felt252, account: ContractAddress,\n        ) {\n            let admin = self.get_role_admin(role);\n            self.assert_only_role(admin);\n            self._revoke_role(role, account);\n        }\n\n        /// Revokes `role` from the calling account.\n        ///\n        /// Roles are often managed via `grant_role` and `revoke_role`: this function's\n        /// purpose is to provide a mechanism for accounts to lose their privileges\n        /// if they are compromised (such as when a trusted device is misplaced).\n        ///\n        /// If the calling account had been revoked `role`, emits a `RoleRevoked`\n        /// event.\n        ///\n        /// Requirements:\n        ///\n        /// - the caller must be `account`.\n        fn renounce_role(\n            ref self: ComponentState<TContractState>, role: felt252, account: ContractAddress,\n        ) {\n            let caller: ContractAddress = get_caller_address();\n            assert(caller == account, Errors::INVALID_CALLER);\n            self._revoke_role(role, account);\n        }\n    }\n\n    const IACCESSCONTROL_ID: felt252 =\n        0x23700be02858dbe2ac4dc9c9f66d0b6b0ed81ec7f970ca6844500a56ff61751;\n\n    #[generate_trait]\n    pub impl InternalImpl<\n        TContractState,\n        +HasComponent<TContractState>,\n        impl SRC5: SRC5Component::HasComponent<TContractState>,\n        +Drop<TContractState>,\n    > of InternalTrait<TContractState> {\n        /// Initializes the contract by registering the IAccessControl interface Id.\n        fn initializer(ref self: ComponentState<TContractState>) {\n            let mut src5_component = get_dep_component_mut!(ref self, SRC5);\n            src5_component.register_interface(IACCESSCONTROL_ID);\n        }\n\n        /// Validates that the caller has the given role. Otherwise it panics.\n        fn assert_only_role(self: @ComponentState<TContractState>, role: felt252) {\n            let caller: ContractAddress = get_caller_address();\n            let authorized: bool = self.has_role(role, caller);\n            assert(authorized, Errors::MISSING_ROLE);\n        }\n\n        /// Attempts to grant `role` to `account`.\n        ///\n        /// Internal function without access restriction.\n        ///\n        /// May emit a `RoleGranted` event.\n        fn _grant_role(\n            ref self: ComponentState<TContractState>, role: felt252, account: ContractAddress,\n        ) {\n            if !self.has_role(role, account) {\n                let caller: ContractAddress = get_caller_address();\n                self.AccessControl_role_member.entry((role, account)).write(true);\n                self.emit(RoleGranted { role, account, sender: caller });\n            }\n        }\n\n        /// Attempts to revoke `role` from `account`.\n        ///\n        /// Internal function without access restriction.\n        ///\n        /// May emit a `RoleRevoked` event.\n        fn _revoke_role(\n            ref self: ComponentState<TContractState>, role: felt252, account: ContractAddress,\n        ) {\n            if self.has_role(role, account) {\n                let caller: ContractAddress = get_caller_address();\n                self.AccessControl_role_member.entry((role, account)).write(false);\n                self.emit(RoleRevoked { role, account, sender: caller });\n            }\n        }\n\n        /// Sets `admin_role` as `role`'s admin role.\n        ///\n        /// Emits a `RoleAdminChanged` event.\n        fn _set_role_admin(\n            ref self: ComponentState<TContractState>, role: felt252, admin_role: felt252,\n        ) {\n            let previous_admin_role: felt252 = self.get_role_admin(role);\n            self.AccessControl_role_admin.entry(role).write(admin_role);\n            self.emit(RoleAdminChanged { role, previous_admin_role, new_admin_role: admin_role });\n        }\n    }\n}\n\n"
  },
  {
    "path": "crates/forge/tests/data/component_macros/tests/test_contract.cairo",
    "content": "use component_macros::example::{IMyContractDispatcher, IMyContractDispatcherTrait};\nuse core::option::OptionTrait;\nuse core::result::ResultTrait;\nuse core::traits::TryInto;\nuse snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::{ContractClassTrait, declare, start_cheat_caller_address};\nuse starknet::ContractAddress;\n\n\n#[test]\nfn test_mint() {\n    let contract = declare(\"MyContract\").unwrap().contract_class();\n    let (address, _) = contract.deploy(@array!['minter']).unwrap();\n    let minter: ContractAddress = 'minter'.try_into().unwrap();\n\n    let dispatcher = IMyContractDispatcher { contract_address: address };\n    start_cheat_caller_address(address, minter);\n    dispatcher.mint();\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contract_state/Scarb.toml",
    "content": "[package]\nname = \"contract_state\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.11.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\nassert_macros = \"2.11.0\"\n\n[[target.starknet-contract]]\n"
  },
  {
    "path": "crates/forge/tests/data/contract_state/src/balance.cairo",
    "content": "#[starknet::interface]\npub trait IHelloStarknetExtended<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: u256);\n    fn get_balance(self: @TContractState) -> u256;\n    fn get_caller_info(self: @TContractState, address: starknet::ContractAddress) -> u256;\n    fn get_balance_at(self: @TContractState, index: u64) -> u256;\n}\n\n\n#[starknet::contract]\npub mod HelloStarknetExtended {\n    use starknet::storage::{\n        Map, MutableVecTrait, StoragePathEntry, StoragePointerReadAccess, StoragePointerWriteAccess,\n        Vec, VecTrait,\n    };\n    use starknet::{ContractAddress, get_caller_address};\n\n    #[derive(starknet::Store)]\n    struct Owner {\n        pub address: ContractAddress,\n        pub name: felt252,\n    }\n\n    #[storage]\n    struct Storage {\n        pub owner: Owner,\n        pub balance: u256,\n        pub balance_records: Vec<u256>,\n        pub callers: Map<ContractAddress, u256>,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState, owner_name: felt252) {\n        self\n            ._set_owner(\n                starknet::get_execution_info().tx_info.account_contract_address, owner_name,\n            );\n        self.balance_records.push(0);\n    }\n\n    #[abi(embed_v0)]\n    impl HelloStarknetExtendedImpl of super::IHelloStarknetExtended<ContractState> {\n        fn increase_balance(ref self: ContractState, amount: u256) {\n            let caller = get_caller_address();\n            let value_before = self.callers.entry(caller).read();\n\n            assert(amount != 0, 'Amount cannot be 0');\n\n            self.balance.write(self.balance.read() + amount);\n            self.callers.entry(caller).write(value_before + amount);\n            self.balance_records.push(self.balance.read());\n        }\n\n        fn get_balance(self: @ContractState) -> u256 {\n            self.balance.read()\n        }\n\n        fn get_caller_info(self: @ContractState, address: ContractAddress) -> u256 {\n            self.callers.entry(address).read()\n        }\n\n        fn get_balance_at(self: @ContractState, index: u64) -> u256 {\n            assert(index < self.balance_records.len(), 'Index out of range');\n            self.balance_records.at(index).read()\n        }\n    }\n\n    #[generate_trait]\n    pub impl InternalFunctions of InternalFunctionsTrait {\n        fn _set_owner(ref self: ContractState, address: ContractAddress, name: felt252) {\n            self.owner.address.write(address);\n            self.owner.name.write(name);\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contract_state/src/lib.cairo",
    "content": "pub mod balance;\npub mod storage_node;\n"
  },
  {
    "path": "crates/forge/tests/data/contract_state/src/storage_node.cairo",
    "content": "#[starknet::interface]\npub trait IStorageNodeContract<TContractState> {\n    fn get_description_at(self: @TContractState, index: u64) -> felt252;\n    fn get_data_at(\n        self: @TContractState, index: u64, address: starknet::ContractAddress, key: u16,\n    ) -> ByteArray;\n}\n\n#[starknet::contract]\npub mod StorageNodeContract {\n    use starknet::ContractAddress;\n    use starknet::storage::{Map, StoragePathEntry, StoragePointerReadAccess};\n\n    #[starknet::storage_node]\n    pub struct RandomData {\n        pub description: felt252,\n        pub data: Map<(ContractAddress, u16), ByteArray>,\n    }\n\n    #[storage]\n    pub struct Storage {\n        pub random_data: Map<u64, RandomData>,\n    }\n\n    #[abi(embed_v0)]\n    impl IStorageNodeContractImpl of super::IStorageNodeContract<ContractState> {\n        fn get_description_at(self: @ContractState, index: u64) -> felt252 {\n            self.random_data.entry(index).description.read()\n        }\n\n        fn get_data_at(\n            self: @ContractState, index: u64, address: ContractAddress, key: u16,\n        ) -> ByteArray {\n            self.random_data.entry(index).data.entry((address, key)).read()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contract_state/tests/test_fork.cairo",
    "content": "#[starknet::interface]\ntrait IMap<TMapState> {\n    fn put(ref self: TMapState, key: felt252, value: felt252);\n    fn get(self: @TMapState, key: felt252) -> felt252;\n}\n\n#[starknet::contract]\nmod Map {\n    use starknet::storage::{Map, StorageMapReadAccess, StoragePathEntry, StoragePointerWriteAccess};\n    #[storage]\n    pub struct Storage {\n        pub storage: Map<felt252, felt252>,\n    }\n\n    #[abi(embed_v0)]\n    impl MapImpl of super::IMap<ContractState> {\n        fn put(ref self: ContractState, key: felt252, value: felt252) {\n            self.storage.entry(key).write(value);\n        }\n\n        fn get(self: @ContractState, key: felt252) -> felt252 {\n            self.storage.read(key)\n        }\n    }\n}\nuse snforge_std::interact_with_state;\nuse starknet::ContractAddress;\nuse starknet::storage::StorageMapWriteAccess;\n\n#[test]\n#[fork(url: \"{{ NODE_RPC_URL }}\", block_number: 900_000)]\nfn test_fork_contract() {\n    let contract_address: ContractAddress =\n        0x00cd8f9ab31324bb93251837e4efb4223ee195454f6304fcfcb277e277653008\n        .try_into()\n        .unwrap();\n    let dispatcher = IMapDispatcher { contract_address };\n\n    assert(dispatcher.get(1) == 2, 'Wrong value');\n\n    interact_with_state(\n        contract_address,\n        || {\n            let mut state = Map::contract_state_for_testing();\n            state.storage.write(1, 13579)\n        },\n    );\n\n    assert(dispatcher.get(1) == 13579, 'Wrong value');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contract_state/tests/test_state.cairo",
    "content": "use contract_state::balance::HelloStarknetExtended::InternalFunctionsTrait;\nuse contract_state::balance::{\n    HelloStarknetExtended, IHelloStarknetExtendedDispatcher, IHelloStarknetExtendedDispatcherTrait,\n};\nuse snforge_std::interact_with_state;\nuse starknet::ContractAddress;\nuse starknet::storage::{\n    MutableVecTrait, StorageMapWriteAccess, StoragePointerReadAccess, StoragePointerWriteAccess,\n};\nuse crate::utils::deploy_contract;\n\n#[test]\nfn test_interact_with_state() {\n    let contract_address = deploy_contract(\"HelloStarknetExtended\", array!['Name']);\n    let dispatcher = IHelloStarknetExtendedDispatcher { contract_address };\n\n    assert(dispatcher.get_balance() == 0, 'Wrong balance');\n\n    interact_with_state(\n        contract_address,\n        || {\n            let mut state = HelloStarknetExtended::contract_state_for_testing();\n            state.balance.write(987);\n        },\n    );\n\n    assert(dispatcher.get_balance() == 987, 'Wrong balance');\n    dispatcher.increase_balance(13);\n    assert(dispatcher.get_balance() == 1000, 'Wrong balance');\n}\n\n#[test]\nfn test_interact_with_state_return() {\n    let contract_address = deploy_contract(\"HelloStarknetExtended\", array!['Name']);\n    let dispatcher = IHelloStarknetExtendedDispatcher { contract_address };\n\n    assert(dispatcher.get_balance() == 0, 'Wrong balance');\n\n    let res = interact_with_state(\n        contract_address,\n        || -> u256 {\n            let mut state = HelloStarknetExtended::contract_state_for_testing();\n            state.balance.write(111);\n            state.balance.read()\n        },\n    );\n\n    assert(res == 111, 'Wrong balance');\n}\n\n#[test]\nfn test_interact_with_initialized_state() {\n    let contract_address = deploy_contract(\"HelloStarknetExtended\", array!['Name']);\n    let dispatcher = IHelloStarknetExtendedDispatcher { contract_address };\n\n    dispatcher.increase_balance(199);\n\n    interact_with_state(\n        contract_address,\n        || {\n            let mut state = HelloStarknetExtended::contract_state_for_testing();\n            assert(state.balance.read() == 199, 'Wrong balance');\n            state.balance.write(1);\n        },\n    );\n\n    assert(dispatcher.get_balance() == 1, 'Wrong balance');\n}\n\n#[test]\nfn test_interact_with_state_vec() {\n    let contract_address = deploy_contract(\"HelloStarknetExtended\", array!['Name']);\n    let dispatcher = IHelloStarknetExtendedDispatcher { contract_address };\n\n    dispatcher.increase_balance(1);\n    dispatcher.increase_balance(1);\n    dispatcher.increase_balance(1);\n\n    interact_with_state(\n        contract_address,\n        || {\n            let mut state = HelloStarknetExtended::contract_state_for_testing();\n            assert(state.balance_records.len() == 4, 'Wrong length');\n            state.balance_records.push(10);\n        },\n    );\n\n    assert(dispatcher.get_balance_at(0) == 0, 'Wrong balance');\n    assert(dispatcher.get_balance_at(2) == 2, 'Wrong balance');\n    assert(dispatcher.get_balance_at(4) == 10, 'Wrong balance');\n}\n\n#[test]\nfn test_interact_with_state_map() {\n    let contract_address = deploy_contract(\"HelloStarknetExtended\", array!['Name']);\n    let dispatcher = IHelloStarknetExtendedDispatcher { contract_address };\n\n    dispatcher.increase_balance(1);\n\n    interact_with_state(\n        contract_address,\n        || {\n            let mut state = HelloStarknetExtended::contract_state_for_testing();\n            state.callers.write(0x123.try_into().unwrap(), 1000);\n            state.callers.write(0x321.try_into().unwrap(), 2000);\n        },\n    );\n\n    assert(\n        dispatcher.get_caller_info(0x123.try_into().unwrap()) == 1000,\n        'Wrong data for address 0x123',\n    );\n    assert(\n        dispatcher.get_caller_info(0x321.try_into().unwrap()) == 2000,\n        'Wrong data for address 0x321',\n    );\n    assert(\n        dispatcher.get_caller_info(0x12345.try_into().unwrap()) == 0,\n        'Wrong data for address 0x12345',\n    );\n}\n\n#[test]\nfn test_interact_with_state_internal_function() {\n    let contract_address = deploy_contract(\"HelloStarknetExtended\", array!['Name']);\n\n    let get_owner = || -> (ContractAddress, felt252) {\n        interact_with_state(\n            contract_address,\n            || -> (ContractAddress, felt252) {\n                let mut state = HelloStarknetExtended::contract_state_for_testing();\n                (state.owner.address.read(), state.owner.name.read())\n            },\n        )\n    };\n    let (owner_address, owner_name) = get_owner();\n    assert(owner_address == 0.try_into().unwrap(), 'Incorrect owner address');\n    assert(owner_name == 'Name', 'Incorrect owner name');\n\n    interact_with_state(\n        contract_address,\n        || {\n            let mut state = HelloStarknetExtended::contract_state_for_testing();\n            state._set_owner(0x777.try_into().unwrap(), 'New name');\n        },\n    );\n    let (owner_address, owner_name) = get_owner();\n\n    assert(owner_address == 0x777.try_into().unwrap(), 'Incorrect owner address');\n    assert(owner_name == 'New name', 'Incorrect owner name');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contract_state/tests/test_storage_node.cairo",
    "content": "use contract_state::storage_node::{\n    IStorageNodeContractDispatcher, IStorageNodeContractDispatcherTrait, StorageNodeContract,\n};\nuse snforge_std::interact_with_state;\nuse starknet::storage::{StoragePathEntry, StoragePointerWriteAccess};\nuse crate::utils::deploy_contract;\n\n#[test]\nfn test_storage_node() {\n    let contract_address = deploy_contract(\"StorageNodeContract\", array![]);\n    let dispatcher = IStorageNodeContractDispatcher { contract_address };\n\n    let contract_to_set = 0x123.try_into().unwrap();\n\n    assert(dispatcher.get_description_at(1) == '', 'Incorrect description');\n    assert(dispatcher.get_data_at(1, contract_to_set, 10) == \"\", 'Incorrect data');\n\n    interact_with_state(\n        contract_address,\n        || {\n            let mut state = StorageNodeContract::contract_state_for_testing();\n\n            state.random_data.entry(1).description.write('Lorem Ipsum');\n            state.random_data.entry(1).data.entry((contract_to_set, 10)).write(\"Verba sine sensu\");\n        },\n    );\n\n    assert(dispatcher.get_description_at(1) == 'Lorem Ipsum', 'Incorrect description');\n    assert(dispatcher.get_data_at(1, contract_to_set, 10) == \"Verba sine sensu\", 'Incorrect data');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contract_state/tests/utils.cairo",
    "content": "use snforge_std::{ContractClassTrait, DeclareResultTrait, declare};\n\npub fn deploy_contract(name: ByteArray, calldata: Array<felt252>) -> starknet::ContractAddress {\n    let contract = declare(name).unwrap().contract_class();\n\n    let (contract_address, _) = contract.deploy(@calldata).unwrap();\n    contract_address\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/block_hash_checker.cairo",
    "content": "use starknet::ContractAddress;\n\n#[starknet::interface]\ntrait BlockHashCheckerInterface<TContractState> {\n    fn write_block(ref self: TContractState);\n    fn read_block_hash(self: @TContractState) -> felt252;\n}\n\n#[starknet::contract]\nmod BlockHashChecker {\n    use core::starknet::SyscallResultTrait;\n    use array::ArrayTrait;\n    use starknet::{get_block_info, get_block_hash_syscall};\n    use box::BoxTrait;\n    use starknet::ContractAddress;\n\n    #[storage]\n    struct Storage {\n        block_hash: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl BlockHashCheckerImpl of super::BlockHashCheckerInterface<ContractState> {\n        fn write_block(ref self: ContractState) {\n            let block_info = get_block_info().unbox();\n\n            let block_hash = get_block_hash_syscall(block_info.block_number - 10).unwrap_syscall();\n            self.block_hash.write(block_hash);\n        }\n\n        fn read_block_hash(self: @ContractState) -> felt252 {\n            self.block_hash.read()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/block_info_checker.cairo",
    "content": "use starknet::ContractAddress;\n\n#[starknet::interface]\ntrait IBlockInfoChecker<TContractState> {\n    fn read_block_number(self: @TContractState) -> u64;\n    fn read_block_timestamp(self: @TContractState) -> u64;\n    fn read_sequencer_address(self: @TContractState) -> ContractAddress;\n}\n\n#[starknet::contract]\nmod BlockInfoChecker {\n    use core::starknet::SyscallResultTrait;\n    use core::array::ArrayTrait;\n    use starknet::get_block_info;\n    use core::box::BoxTrait;\n    use starknet::ContractAddress;\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl IBlockInfoChecker of super::IBlockInfoChecker<ContractState> {\n        fn read_block_number(self: @ContractState) -> u64 {\n            get_block_info().unbox().block_number\n        }\n        fn read_block_timestamp(self: @ContractState) -> u64 {\n            get_block_info().unbox().block_timestamp\n        }\n        fn read_sequencer_address(self: @ContractState) -> ContractAddress {\n            get_block_info().unbox().sequencer_address\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/catching_error.cairo",
    "content": "#[starknet::interface]\npub trait ITop<TContractState> {\n    fn call_panic_contract(\n        self: @TContractState, panic_contract_address: starknet::ContractAddress,\n    );\n}\n\n#[feature(\"safe_dispatcher\")]\n#[starknet::contract]\nmod Top {\n    use super::{INestedSafeDispatcher, INestedSafeDispatcherTrait};\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl TopImpl of super::ITop<ContractState> {\n        fn call_panic_contract(\n            self: @ContractState, panic_contract_address: starknet::ContractAddress,\n        ) {\n            let dispatcher = INestedSafeDispatcher { contract_address: panic_contract_address };\n\n            match dispatcher.do_panic() {\n                Result::Ok(_) => core::panic_with_felt252('Expected panic'),\n                Result::Err(err_data) => {\n                    assert(*err_data.at(0) == 'Panic in Nested contract', 'Incorrect error');\n                },\n            }\n        }\n    }\n}\n\n#[starknet::interface]\npub trait INested<TContractState> {\n    fn do_panic(self: @TContractState);\n}\n\n\n#[starknet::contract]\nmod Nested {\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl NestedImpl of super::INested<ContractState> {\n        fn do_panic(self: @ContractState) {\n            core::panic_with_felt252('Panic in Nested contract');\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/cheat_block_hash_checker.cairo",
    "content": "#[starknet::interface]\ntrait ICheatBlockHashChecker<TContractState> {\n    fn get_block_hash(ref self: TContractState, block_number: u64) -> felt252;\n}\n\n#[starknet::contract]\nmod CheatBlockHashChecker {\n    use core::starknet::SyscallResultTrait;\n    use starknet::syscalls::get_block_hash_syscall;\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl CheatBlockHashChecker of super::ICheatBlockHashChecker<ContractState> {\n        fn get_block_hash(ref self: ContractState, block_number: u64) -> felt252 {\n            let block_hash = get_block_hash_syscall(block_number).unwrap_syscall();\n\n            block_hash\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/cheat_block_number_checker.cairo",
    "content": "#[starknet::interface]\ntrait ICheatBlockNumberChecker<TContractState> {\n    fn get_block_number(ref self: TContractState) -> u64;\n    fn get_block_number_and_emit_event(ref self: TContractState) -> u64;\n}\n\n#[starknet::contract]\nmod CheatBlockNumberChecker {\n    use box::BoxTrait;\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    enum Event {\n        BlockNumberEmitted: BlockNumberEmitted\n    }\n\n    #[derive(Drop, starknet::Event)]\n    struct BlockNumberEmitted {\n        block_number: u64\n    }\n\n    #[abi(embed_v0)]\n    impl ICheatBlockNumberChecker of super::ICheatBlockNumberChecker<ContractState> {\n        fn get_block_number(ref self: ContractState) -> u64 {\n            starknet::get_block_info().unbox().block_number\n        }\n\n        fn get_block_number_and_emit_event(ref self: ContractState) -> u64 {\n            let block_number = starknet::get_block_info().unbox().block_number;\n            self.emit(Event::BlockNumberEmitted(BlockNumberEmitted { block_number }));\n            block_number\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/cheat_block_timestamp_checker.cairo",
    "content": "#[starknet::interface]\ntrait ICheatBlockTimestampChecker<TContractState> {\n    fn get_block_timestamp(ref self: TContractState) -> u64;\n    fn get_block_timestamp_and_emit_event(ref self: TContractState) -> u64;\n    fn get_block_timestamp_and_number(ref self: TContractState) -> (u64, u64);\n}\n\n#[starknet::contract]\nmod CheatBlockTimestampChecker {\n    use box::BoxTrait;\n\n    #[storage]\n    struct Storage {}\n\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    enum Event {\n        BlockTimestampEmitted: BlockTimestampEmitted\n    }\n\n    #[derive(Drop, starknet::Event)]\n    struct BlockTimestampEmitted {\n        block_timestamp: u64\n    }\n\n\n    #[abi(embed_v0)]\n    impl CheatBlockTimestampChecker of super::ICheatBlockTimestampChecker<ContractState> {\n        fn get_block_timestamp(ref self: ContractState) -> u64 {\n            starknet::get_block_info().unbox().block_timestamp\n        }\n\n        fn get_block_timestamp_and_emit_event(ref self: ContractState) -> u64 {\n            let block_timestamp = starknet::get_block_info().unbox().block_timestamp;\n            self.emit(Event::BlockTimestampEmitted(BlockTimestampEmitted { block_timestamp }));\n            block_timestamp\n        }\n\n        fn get_block_timestamp_and_number(ref self: ContractState) -> (u64, u64) {\n            let block_info = starknet::get_block_info().unbox();\n\n            (block_info.block_timestamp, block_info.block_number)\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/cheat_caller_address_checker.cairo",
    "content": "use starknet::ClassHash;\n\n#[starknet::interface]\ntrait ICheatCallerAddressChecker<TContractState> {\n    fn get_caller_address(ref self: TContractState) -> felt252;\n    fn get_caller_address_and_emit_event(ref self: TContractState) -> felt252;\n}\n\n#[starknet::interface]\ntrait ICheatCallerAddressLibraryCallChecker<TContractState> {\n    fn get_caller_address_via_library_call(\n        self: @TContractState, class_hash: ClassHash,\n    ) -> felt252;\n}\n\n#[starknet::contract]\nmod CheatCallerAddressChecker {\n    use box::BoxTrait;\n    use starknet::ContractAddressIntoFelt252;\n    use starknet::ContractAddress;\n    use option::Option;\n    use traits::Into;\n\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    enum Event {\n        CallerAddressEmitted: CallerAddressEmitted\n    }\n\n    #[derive(Drop, starknet::Event)]\n    struct CallerAddressEmitted {\n        caller_address: felt252\n    }\n\n    #[abi(embed_v0)]\n    impl ICheatCallerAddressChecker of super::ICheatCallerAddressChecker<ContractState> {\n        fn get_caller_address(ref self: ContractState) -> felt252 {\n            starknet::get_caller_address().into()\n        }\n\n        fn get_caller_address_and_emit_event(ref self: ContractState) -> felt252 {\n            let caller_address = starknet::get_caller_address().into();\n            self.emit(Event::CallerAddressEmitted(CallerAddressEmitted { caller_address }));\n            caller_address\n        }\n    }\n}\n\n#[starknet::contract]\nmod CheatCallerAddressLibraryCallChecker {\n    use starknet::ClassHash;\n    use super::ICheatCallerAddressCheckerDispatcherTrait;\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl CheatCallerAddressLibraryCallCheckerImpl of super::ICheatCallerAddressLibraryCallChecker<ContractState> {\n        fn get_caller_address_via_library_call(\n            self: @ContractState, class_hash: ClassHash,\n        ) -> felt252 {\n            super::ICheatCallerAddressCheckerLibraryDispatcher { class_hash }.get_caller_address()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/cheat_sequencer_address_checker.cairo",
    "content": "use starknet::ContractAddress;\n\n#[starknet::interface]\ntrait ICheatSequencerAddressChecker<TContractState> {\n    fn get_sequencer_address(ref self: TContractState) -> ContractAddress;\n    fn get_seq_addr_and_emit_event(ref self: TContractState) -> ContractAddress;\n}\n\n#[starknet::contract]\nmod CheatSequencerAddressChecker {\n    use starknet::ContractAddress;\n\n    #[storage]\n    struct Storage {}\n\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    enum Event {\n        SequencerAddressEmitted: SequencerAddressEmitted\n    }\n\n    #[derive(Drop, starknet::Event)]\n    struct SequencerAddressEmitted {\n        sequencer_address: ContractAddress\n    }\n\n    #[abi(embed_v0)]\n    impl ICheatSequencerAddressChecker of super::ICheatSequencerAddressChecker<ContractState> {\n        fn get_sequencer_address(ref self: ContractState) -> ContractAddress {\n            starknet::get_block_info().unbox().sequencer_address\n        }\n\n        fn get_seq_addr_and_emit_event(ref self: ContractState) -> ContractAddress {\n            let sequencer_address = starknet::get_block_info().unbox().sequencer_address;\n            self.emit(Event::SequencerAddressEmitted(SequencerAddressEmitted { sequencer_address }));\n            sequencer_address\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/cheat_tx_info_checker.cairo",
    "content": "use starknet::info::TxInfo;\nuse serde::Serde;\nuse option::OptionTrait;\nuse array::ArrayTrait;\nuse starknet::{ClassHash, ContractAddress};\nuse starknet::info::v3::ResourceBounds;\n\n#[starknet::interface]\ntrait ICheatTxInfoChecker<TContractState> {\n    fn get_tx_hash(self: @TContractState) -> felt252;\n    fn get_nonce(self: @TContractState) -> felt252;\n    fn get_account_contract_address(self: @TContractState) -> ContractAddress;\n    fn get_signature(self: @TContractState) -> Span<felt252>;\n    fn get_version(self: @TContractState) -> felt252;\n    fn get_max_fee(self: @TContractState) -> u128;\n    fn get_chain_id(self: @TContractState) -> felt252;\n    fn get_resource_bounds(self: @TContractState) -> Span<ResourceBounds>;\n    fn get_tip(self: @TContractState) -> u128;\n    fn get_paymaster_data(self: @TContractState) -> Span<felt252>;\n    fn get_nonce_data_availability_mode(self: @TContractState) -> u32;\n    fn get_fee_data_availability_mode(self: @TContractState) -> u32;\n    fn get_account_deployment_data(self: @TContractState) -> Span<felt252>;\n    fn get_proof_facts(self: @TContractState) -> Span<felt252>;\n    fn get_tx_info(self: @TContractState) -> starknet::info::v2::TxInfo;\n    fn get_tx_info_v3(self: @TContractState) -> starknet::info::v3::TxInfo;\n}\n\n#[starknet::interface]\ntrait ICheatBlockNumberChecker<TContractState> {\n    fn get_block_number(ref self: TContractState) -> u64;\n}\n\n#[starknet::interface]\ntrait ICheatBlockTimestampChecker<TContractState> {\n    fn get_block_timestamp(ref self: TContractState) -> u64;\n}\n\n#[starknet::interface]\ntrait ICheatSequencerAddressChecker<TContractState> {\n    fn get_sequencer_address(ref self: TContractState) -> ContractAddress;\n}\n\n#[starknet::interface]\ntrait ICheatExecutionInfoLibraryCallChecker<TContractState> {\n    fn get_block_number_via_library_call(ref self: TContractState, class_hash: ClassHash) -> u64;\n    fn get_block_timestamp_via_library_call(\n        ref self: TContractState, class_hash: ClassHash,\n    ) -> u64;\n    fn get_sequencer_address_via_library_call(\n        ref self: TContractState, class_hash: ClassHash,\n    ) -> ContractAddress;\n    fn get_tx_hash_via_library_call(self: @TContractState, class_hash: ClassHash) -> felt252;\n}\n\n#[starknet::contract]\nmod CheatTxInfoChecker {\n    use serde::Serde;\n    use starknet::info::TxInfo;\n    use box::BoxTrait;\n    use starknet::ContractAddress;\n    use starknet::info::v2::ResourceBounds;\n    use starknet::{SyscallResultTrait, SyscallResult, syscalls::get_execution_info_v2_syscall, syscalls::get_execution_info_v3_syscall};\n\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl ICheatTxInfoChecker of super::ICheatTxInfoChecker<ContractState> {\n        fn get_tx_hash(self: @ContractState) -> felt252 {\n            starknet::get_tx_info().unbox().transaction_hash\n        }\n\n        fn get_nonce(self: @ContractState) -> felt252 {\n            starknet::get_tx_info().unbox().nonce\n        }\n\n        fn get_account_contract_address(self: @ContractState) -> ContractAddress {\n            starknet::get_tx_info().unbox().account_contract_address\n        }\n\n        fn get_signature(self: @ContractState) -> Span<felt252> {\n            starknet::get_tx_info().unbox().signature\n        }\n\n        fn get_version(self: @ContractState) -> felt252 {\n            starknet::get_tx_info().unbox().version\n        }\n\n        fn get_max_fee(self: @ContractState) -> u128 {\n            starknet::get_tx_info().unbox().max_fee\n        }\n\n        fn get_chain_id(self: @ContractState) -> felt252 {\n            starknet::get_tx_info().unbox().chain_id\n        }\n\n        fn get_resource_bounds(self: @ContractState) -> Span<ResourceBounds> {\n            get_tx_info_v2().unbox().resource_bounds\n        }\n\n        fn get_tip(self: @ContractState) -> u128 {\n            get_tx_info_v2().unbox().tip\n        }\n\n        fn get_paymaster_data(self: @ContractState) -> Span<felt252> {\n            get_tx_info_v2().unbox().paymaster_data\n        }\n\n        fn get_nonce_data_availability_mode(self: @ContractState) -> u32 {\n            get_tx_info_v2().unbox().nonce_data_availability_mode\n        }\n\n        fn get_fee_data_availability_mode(self: @ContractState) -> u32 {\n            get_tx_info_v2().unbox().fee_data_availability_mode\n        }\n\n        fn get_account_deployment_data(self: @ContractState) -> Span<felt252> {\n            get_tx_info_v2().unbox().account_deployment_data\n        }\n\n        fn get_proof_facts(self: @ContractState) -> Span<felt252> {\n            get_tx_info_v3().unbox().proof_facts\n        }\n\n        fn get_tx_info(self: @ContractState) -> starknet::info::v2::TxInfo {\n            get_tx_info_v2().unbox()\n        }\n\n        fn get_tx_info_v3(self: @ContractState) -> starknet::info::v3::TxInfo {\n            get_tx_info_v3().unbox()\n        }\n    }\n\n    fn get_execution_info_v2() -> Box<starknet::info::v2::ExecutionInfo> {\n        get_execution_info_v2_syscall().unwrap_syscall()\n    }\n\n    fn get_tx_info_v2() -> Box<starknet::info::v2::TxInfo> {\n        get_execution_info_v2().unbox().tx_info\n    }\n\n    fn get_execution_info_v3() -> Box<starknet::info::v3::ExecutionInfo> {\n        get_execution_info_v3_syscall().unwrap_syscall()\n    }\n\n    fn get_tx_info_v3() -> Box<starknet::info::v3::TxInfo> {\n        get_execution_info_v3().unbox().tx_info\n    }\n}\n\n#[starknet::contract]\nmod CheatExecutionInfoLibraryCallChecker {\n    use starknet::{ClassHash, ContractAddress};\n    use super::{\n        ICheatBlockNumberCheckerDispatcherTrait,\n        ICheatBlockTimestampCheckerDispatcherTrait,\n        ICheatSequencerAddressCheckerDispatcherTrait,\n        ICheatTxInfoCheckerDispatcherTrait,\n    };\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl CheatExecutionInfoLibraryCallCheckerImpl of super::ICheatExecutionInfoLibraryCallChecker<ContractState> {\n        fn get_block_number_via_library_call(\n            ref self: ContractState, class_hash: ClassHash,\n        ) -> u64 {\n            super::ICheatBlockNumberCheckerLibraryDispatcher { class_hash }.get_block_number()\n        }\n\n        fn get_block_timestamp_via_library_call(\n            ref self: ContractState, class_hash: ClassHash,\n        ) -> u64 {\n            super::ICheatBlockTimestampCheckerLibraryDispatcher { class_hash }.get_block_timestamp()\n        }\n\n        fn get_sequencer_address_via_library_call(\n            ref self: ContractState, class_hash: ClassHash,\n        ) -> ContractAddress {\n            super::ICheatSequencerAddressCheckerLibraryDispatcher { class_hash }\n                .get_sequencer_address()\n        }\n\n        fn get_tx_hash_via_library_call(self: @ContractState, class_hash: ClassHash) -> felt252 {\n            super::ICheatTxInfoCheckerLibraryDispatcher { class_hash }.get_tx_hash()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/deploy_checker.cairo",
    "content": "use starknet::ContractAddress;\n\n#[starknet::interface]\ntrait IDeployChecker<TContractState> {\n    fn get_balance(self: @TContractState) -> felt252;\n    fn get_caller(self: @TContractState) -> ContractAddress;\n}\n\n#[starknet::contract]\nmod DeployChecker {\n    use starknet::ContractAddress;\n\n    #[storage]\n    struct Storage {\n        balance: felt252,\n        caller: ContractAddress,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState, balance: felt252) -> (ContractAddress, felt252) {\n        assert(balance != 0, 'Initial balance cannot be 0');\n        self.balance.write(balance);\n        self.caller.write(starknet::get_caller_address());\n        (self.caller.read(), balance)\n    }\n\n    #[abi(embed_v0)]\n    impl DeployCheckerImpl of super::IDeployChecker<ContractState> {\n        fn get_balance(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n\n        fn get_caller(self: @ContractState) -> ContractAddress {\n            self.caller.read()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/dict_using_contract.cairo",
    "content": "#[starknet::contract]\nmod DictUsingContract {\n    use core::num::traits::{One};\n\n    fn unique_count(mut ary: Array<felt252>) -> u32 {\n        let mut dict: Felt252Dict<felt252> = Default::default();\n        let mut counter = 0;\n        // TODO\n        loop {\n            match ary.pop_front() {\n                Option::Some(value) => {\n                    if dict.get(value).is_one() {\n                        continue;\n                    }\n                    dict.insert(value, One::one());\n                    counter += 1;\n                },\n                Option::None => { break; }\n            }\n        };\n        counter\n    }\n\n    #[storage]\n    struct Storage {\n        unique_count: u32\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState, values: Array<felt252>) {\n        self.unique_count.write(unique_count(values.clone()));  // 2 invocations for 2 dict allocations\n        self.unique_count.write(unique_count(values));\n    }\n\n    #[external(v0)]\n    fn get_unique(self: @ContractState) -> u32 {\n        self.unique_count.read()\n    }\n\n    #[external(v0)]\n    fn write_unique(ref self: ContractState, values: Array<felt252>) {\n        self.unique_count.write(unique_count(values.clone()));  // 2 invocations for 2 dict allocations\n        self.unique_count.write(unique_count(values));\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/erc20.cairo",
    "content": "use starknet::ContractAddress;\n\n#[starknet::interface]\ntrait IERC20<TContractState> {\n    fn get_name(self: @TContractState) -> felt252;\n    fn get_symbol(self: @TContractState) -> felt252;\n    fn get_decimals(self: @TContractState) -> u8;\n    fn get_total_supply(self: @TContractState) -> u256;\n    fn balance_of(self: @TContractState, account: ContractAddress) -> u256;\n    fn allowance(self: @TContractState, owner: ContractAddress, spender: ContractAddress) -> u256;\n    fn transfer(ref self: TContractState, recipient: ContractAddress, amount: u256);\n    fn transfer_from(\n        ref self: TContractState, sender: ContractAddress, recipient: ContractAddress, amount: u256\n    );\n    fn approve(ref self: TContractState, spender: ContractAddress, amount: u256);\n    fn increase_allowance(ref self: TContractState, spender: ContractAddress, added_value: u256);\n    fn decrease_allowance(\n        ref self: TContractState, spender: ContractAddress, subtracted_value: u256\n    );\n}\n\n#[starknet::contract]\nmod ERC20 {\n    use starknet::{\n        contract_address_const, get_caller_address, ContractAddress,\n        storage::{\n            StoragePointerWriteAccess, StorageMapReadAccess,\n            StoragePathEntry, Map\n        },\n    };\n    use zeroable::Zeroable;\n\n    #[storage]\n    struct Storage {\n        name: felt252,\n        symbol: felt252,\n        decimals: u8,\n        total_supply: u256,\n        balances: Map<ContractAddress, u256>,\n        allowances: Map<(ContractAddress, ContractAddress), u256>,\n    }\n\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    enum Event {\n        Transfer: Transfer,\n        Approval: Approval,\n    }\n    #[derive(Drop, starknet::Event)]\n    struct Transfer {\n        from: ContractAddress,\n        to: ContractAddress,\n        value: u256,\n    }\n    #[derive(Drop, starknet::Event)]\n    struct Approval {\n        owner: ContractAddress,\n        spender: ContractAddress,\n        value: u256,\n    }\n\n    #[constructor]\n    fn constructor(\n        ref self: ContractState,\n        name_: felt252,\n        symbol_: felt252,\n        decimals_: u8,\n        initial_supply: u256,\n        recipient: ContractAddress\n    ) {\n        self.name.write(name_);\n        self.symbol.write(symbol_);\n        self.decimals.write(decimals_);\n        assert(!recipient.is_zero(), 'ERC20: mint to the 0 address');\n        self.total_supply.write(initial_supply);\n        self.balances.entry(recipient).write(initial_supply);\n        self\n            .emit(\n                Event::Transfer(\n                    Transfer {\n                        from: contract_address_const::<0>(), to: recipient, value: initial_supply\n                    }\n                )\n            );\n    }\n\n    #[abi(embed_v0)]\n    impl IERC20Impl of super::IERC20<ContractState> {\n        fn get_name(self: @ContractState) -> felt252 {\n            self.name.read()\n        }\n\n        fn get_symbol(self: @ContractState) -> felt252 {\n            self.symbol.read()\n        }\n\n        fn get_decimals(self: @ContractState) -> u8 {\n            self.decimals.read()\n        }\n\n        fn get_total_supply(self: @ContractState) -> u256 {\n            self.total_supply.read()\n        }\n\n        fn balance_of(self: @ContractState, account: ContractAddress) -> u256 {\n            self.balances.entry(account).read()\n        }\n\n        fn allowance(\n            self: @ContractState, owner: ContractAddress, spender: ContractAddress\n        ) -> u256 {\n            self.allowances.entry((owner, spender)).read()\n        }\n\n        fn transfer(ref self: ContractState, recipient: ContractAddress, amount: u256) {\n            let sender = get_caller_address();\n            self.transfer_helper(sender, recipient, amount);\n        }\n\n        fn transfer_from(\n            ref self: ContractState,\n            sender: ContractAddress,\n            recipient: ContractAddress,\n            amount: u256\n        ) {\n            let caller = get_caller_address();\n            self.spend_allowance(sender, caller, amount);\n            self.transfer_helper(sender, recipient, amount);\n        }\n\n        fn approve(ref self: ContractState, spender: ContractAddress, amount: u256) {\n            let caller = get_caller_address();\n            self.approve_helper(caller, spender, amount);\n        }\n\n        fn increase_allowance(\n            ref self: ContractState, spender: ContractAddress, added_value: u256\n        ) {\n            let caller = get_caller_address();\n            self\n                .approve_helper(\n                    caller, spender, self.allowances.entry((caller, spender)).read() + added_value\n                );\n        }\n\n        fn decrease_allowance(\n            ref self: ContractState, spender: ContractAddress, subtracted_value: u256\n        ) {\n            let caller = get_caller_address();\n            self\n                .approve_helper(\n                    caller, spender, self.allowances.entry((caller, spender)).read() - subtracted_value\n                );\n        }\n    }\n\n    #[generate_trait]\n    impl StorageImpl of StorageTrait {\n        fn transfer_helper(\n            ref self: ContractState,\n            sender: ContractAddress,\n            recipient: ContractAddress,\n            amount: u256\n        ) {\n            assert(!sender.is_zero(), 'ERC20: transfer from 0');\n            assert(!recipient.is_zero(), 'ERC20: transfer to 0');\n            self.balances.entry(sender).write(self.balances.entry(sender).read() - amount);\n            self.balances.entry(recipient).write(self.balances.entry(recipient).read() + amount);\n            self.emit(Event::Transfer(Transfer { from: sender, to: recipient, value: amount }));\n        }\n\n        fn spend_allowance(\n            ref self: ContractState, owner: ContractAddress, spender: ContractAddress, amount: u256\n        ) {\n            let current_allowance = self.allowances.entry((owner, spender)).read();\n            let ONES_MASK = 0xffffffffffffffffffffffffffffffff_u128;\n            let is_unlimited_allowance = current_allowance.low == ONES_MASK\n                && current_allowance.high == ONES_MASK;\n            if !is_unlimited_allowance {\n                self.approve_helper(owner, spender, current_allowance - amount);\n            }\n        }\n\n        fn approve_helper(\n            ref self: ContractState, owner: ContractAddress, spender: ContractAddress, amount: u256\n        ) {\n            assert(!spender.is_zero(), 'ERC20: approve from 0');\n            self.allowances.entry((owner, spender)).write(amount);\n            self.emit(Event::Approval(Approval { owner, spender, value: amount }));\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/gas_checker.cairo",
    "content": "#[starknet::interface]\ntrait IGasChecker<TContractState> {\n    fn keccak(self: @TContractState, repetitions: u32);\n    fn range_check(self: @TContractState);\n    fn bitwise(self: @TContractState, repetitions: u32);\n    fn pedersen(self: @TContractState);\n    fn poseidon(self: @TContractState);\n    fn ec_op(self: @TContractState, repetitions: u32);\n\n    fn change_balance(ref self: TContractState, new_balance: u64);\n    fn send_l1_message(self: @TContractState);\n    fn emit_event(self: @TContractState, n_keys_and_vals: u32);\n}\n\n#[starknet::contract]\nmod GasChecker {\n    use core::{ec, ec::{EcPoint, EcPointTrait}};\n    use starknet::ContractAddress;\n\n    #[storage]\n    struct Storage {\n        balance: u64,\n    }\n\n    #[abi(embed_v0)]\n    impl IGasCheckerImpl of super::IGasChecker<ContractState> {\n        fn keccak(self: @ContractState, repetitions: u32) {\n            let mut i: u32 = 0;\n            while i < repetitions {\n                keccak::keccak_u256s_le_inputs(array![1].span());\n                i += 1;\n            }\n        }\n\n        fn range_check(self: @ContractState) {\n            // Felt into ContractAddress conversion uses RangeCheck as implicit argument\n            for _ in 0..1000_u16 {\n                let _x: ContractAddress = 1234.try_into().unwrap();\n            }\n        }\n\n        fn bitwise(self: @ContractState, repetitions: u32) {\n            let mut i: u32 = 0;\n            while i < repetitions {\n                1_u8 & 1_u8;\n                2_u8 & 2_u8;\n                i += 1;\n            }\n        }\n\n        fn pedersen(self: @ContractState) {\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n            core::pedersen::pedersen(1, 2);\n        }\n\n        fn poseidon(self: @ContractState) {\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n            core::poseidon::hades_permutation(0, 0, 0);\n        }\n\n        fn ec_op(self: @ContractState, repetitions: u32) {\n            let mut i: u32 = 0;\n            while i < repetitions {\n                EcPointTrait::new_from_x(1).unwrap().mul(2);\n                i += 1;\n            }\n        }\n\n        fn change_balance(ref self: ContractState, new_balance: u64) {\n            self.balance.write(new_balance);\n        }\n\n        fn send_l1_message(self: @ContractState) {\n            starknet::send_message_to_l1_syscall(1, array![1, 2, 3].span()).unwrap();\n        }\n\n        fn emit_event(self: @ContractState, n_keys_and_vals: u32) {\n            let mut keys = array![];\n            let mut values = array![];\n\n            let mut i: u32 = 0;\n            while i < n_keys_and_vals {\n                keys.append('key');\n                values.append(1);\n                i += 1;\n            };\n\n            starknet::emit_event_syscall(keys.span(), values.span()).unwrap();\n        }\n    }\n\n    #[l1_handler]\n    fn handle_l1_message(ref self: ContractState, from_address: felt252) {\n        keccak::keccak_u256s_le_inputs(array![1].span());\n        keccak::keccak_u256s_le_inputs(array![1].span());\n        keccak::keccak_u256s_le_inputs(array![1].span());\n        keccak::keccak_u256s_le_inputs(array![1].span());\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/gas_checker_proxy.cairo",
    "content": "use starknet::{ContractAddress, SyscallResult};\n\n#[starknet::interface]\ntrait IGasChecker<TContractState> {\n    fn send_l1_message(self: @TContractState);\n}\n\n\n#[starknet::interface]\ntrait IGasCheckerProxy<TContractState> {\n    fn send_l1_message_from_gas_checker(self: @TContractState, address: ContractAddress);\n    fn call_other_contract(\n        self: @TContractState,\n        contract_address: ContractAddress,\n        entry_point_selector: felt252,\n        calldata: Array::<felt252>,\n    ) -> SyscallResult<Span<felt252>>;\n}\n\n#[starknet::contract]\nmod GasCheckerProxy {\n    use starknet::{ContractAddress, SyscallResult};\n    use starknet::syscalls::call_contract_syscall;\n    use super::{IGasCheckerDispatcher, IGasCheckerDispatcherTrait};\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl IGasCheckerProxy of super::IGasCheckerProxy<ContractState> {\n        fn send_l1_message_from_gas_checker(self: @ContractState, address: ContractAddress) {\n            let gas_checker = IGasCheckerDispatcher { contract_address: address };\n            gas_checker.send_l1_message()\n        }\n\n        fn call_other_contract(\n            self: @ContractState,\n            contract_address: ContractAddress,\n            entry_point_selector: felt252,\n            calldata: Array::<felt252>,\n        ) -> SyscallResult<Span<felt252>> {\n            call_contract_syscall(contract_address, entry_point_selector, calldata.span())\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/gas_constructor_checker.cairo",
    "content": "#[starknet::contract]\nmod GasConstructorChecker {\n    #[storage]\n    struct Storage {}\n\n    #[constructor]\n    fn constructor(ref self: ContractState, compute_keccak: bool) {\n        if compute_keccak {\n            keccak::keccak_u256s_le_inputs(array![1].span());\n            keccak::keccak_u256s_le_inputs(array![1].span());\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/hello_starknet.cairo",
    "content": "#[starknet::interface]\ntrait IHelloStarknet<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n    fn call_other_contract(\n        self: @TContractState,\n        other_contract_address: felt252,\n        selector: felt252,\n        calldata: Option<Array<felt252>>,\n    ) -> Span<felt252>;\n    fn do_a_panic(self: @TContractState);\n    fn do_a_panic_with(self: @TContractState, panic_data: Array<felt252>);\n    fn do_a_panic_with_bytearray(self: @TContractState);\n}\n\n#[starknet::contract]\nmod HelloStarknet {\n    use array::ArrayTrait;\n    use starknet::{SyscallResultTrait, syscalls};\n\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl IHelloStarknetImpl of super::IHelloStarknet<ContractState> {\n        // Increases the balance by the given amount\n        fn increase_balance(ref self: ContractState, amount: felt252) {\n            self.balance.write(self.balance.read() + amount);\n        }\n\n        // Returns the current balance\n        fn get_balance(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n\n        fn call_other_contract(\n            self: @ContractState,\n            other_contract_address: felt252,\n            selector: felt252,\n            calldata: Option<Array<felt252>>,\n        ) -> Span<felt252> {\n            syscalls::call_contract_syscall(\n                other_contract_address.try_into().unwrap(),\n                selector,\n                match calldata {\n                    Some(data) => data.span(),\n                    None => array![].span(),\n                },\n            )\n                .unwrap_syscall()\n        }\n\n        // Panics\n        fn do_a_panic(self: @ContractState) {\n            let mut arr = ArrayTrait::new();\n            arr.append('PANIC');\n            arr.append('DAYTAH');\n            panic(arr);\n        }\n\n        // Panics with given array data\n        fn do_a_panic_with(self: @ContractState, panic_data: Array<felt252>) {\n            panic(panic_data);\n        }\n\n        // Panics with a bytearray\n        fn do_a_panic_with_bytearray(self: @ContractState) {\n            assert!(\n                false,\n                \"This is a very long\\n and multiline message that is certain to fill the buffer\",\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/hello_starknet_extended.cairo",
    "content": "#[starknet::interface]\npub trait IHelloStarknetExtended<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: u256);\n    fn get_balance(self: @TContractState) -> u256;\n    fn get_caller_info(self: @TContractState, address: starknet::ContractAddress) -> u256;\n    fn get_balance_at(self: @TContractState, index: u64) -> u256;\n}\n\n\n#[starknet::contract]\npub mod HelloStarknetExtended {\n    use starknet::storage::{\n        Map, MutableVecTrait, StoragePathEntry, StoragePointerReadAccess, StoragePointerWriteAccess,\n        Vec, VecTrait,\n    };\n    use starknet::{ContractAddress, get_caller_address};\n\n    #[derive(starknet::Store)]\n    struct Owner {\n        pub address: ContractAddress,\n        pub name: felt252,\n    }\n\n    #[storage]\n    struct Storage {\n        pub owner: Owner,\n        pub balance: u256,\n        pub balance_records: Vec<u256>,\n        pub callers: Map<ContractAddress, u256>,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState, owner_name: felt252) {\n        self\n            ._set_owner(\n                starknet::get_execution_info().tx_info.account_contract_address, owner_name,\n            );\n        self.balance_records.push(0);\n    }\n\n    #[abi(embed_v0)]\n    impl HelloStarknetExtendedImpl of super::IHelloStarknetExtended<ContractState> {\n        fn increase_balance(ref self: ContractState, amount: u256) {\n            let caller = get_caller_address();\n            let value_before = self.callers.entry(caller).read();\n\n            assert(amount != 0, 'Amount cannot be 0');\n\n            self.balance.write(self.balance.read() + amount);\n            self.callers.entry(caller).write(value_before + amount);\n            self.balance_records.push(self.balance.read());\n        }\n\n        fn get_balance(self: @ContractState) -> u256 {\n            self.balance.read()\n        }\n\n        fn get_caller_info(self: @ContractState, address: ContractAddress) -> u256 {\n            self.callers.entry(address).read()\n        }\n\n        fn get_balance_at(self: @ContractState, index: u64) -> u256 {\n            assert(index < self.balance_records.len(), 'Index out of range');\n            self.balance_records.at(index).read()\n        }\n    }\n\n    #[generate_trait]\n    pub impl InternalFunctions of InternalFunctionsTrait {\n        fn _set_owner(ref self: ContractState, address: ContractAddress, name: felt252) {\n            self.owner.address.write(address);\n            self.owner.name.write(name);\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/hello_starknet_for_nested_calls.cairo",
    "content": "#[starknet::interface]\npub trait IHelloStarknet<TContractState> {\n    fn example_function(ref self: TContractState);\n}\n\n#[starknet::contract]\npub mod HelloStarknet {\n    use starknet::SyscallResultTrait;\n    use core::sha256::compute_sha256_u32_array;\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl HelloStarknetImpl of super::IHelloStarknet<ContractState> {\n        fn example_function(ref self: ContractState) {\n            core::keccak::keccak_u256s_le_inputs(array![1].span());\n            let _hash = compute_sha256_u32_array(array![0x68656c6c], 0x6f, 1);\n            starknet::syscalls::get_block_hash_syscall(1).unwrap_syscall();\n            starknet::syscalls::emit_event_syscall(array![1].span(), array![2].span())\n                .unwrap_syscall();\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/keccak_usage.cairo",
    "content": "#[starknet::interface]\ntrait IHelloKeccak<TContractState> {\n    fn run_keccak(ref self: TContractState, input: Array<u64>) -> u256;\n}\n\n#[starknet::contract]\nmod HelloKeccak {\n    use array::ArrayTrait;\n    use starknet::syscalls::keccak_syscall;\n    use starknet::SyscallResultTrait;\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl IHelloKeccakImpl of super::IHelloKeccak<ContractState> {\n        fn run_keccak(ref self: ContractState, input: Array<u64>) -> u256 {\n            keccak_syscall(input.span()).unwrap_syscall()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/l1_handler_execute_checker.cairo",
    "content": "#[derive(Copy, Serde, Drop)]\nstruct L1Data {\n    balance: felt252,\n    token_id: u256\n}\n\n#[starknet::interface]\ntrait IBalanceToken<TContractState> {\n    fn get_balance(self: @TContractState) -> felt252;\n    fn get_token_id(self: @TContractState) -> u256;\n}\n\n#[starknet::contract]\nmod l1_handler_executor {\n\n    use super::{IBalanceToken, L1Data};\n\n    #[storage]\n    struct Storage {\n        l1_caller: felt252,\n        balance: felt252,\n        token_id: u256\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState, l1_caller: felt252) {\n        self.l1_caller.write(l1_caller);\n    }\n\n    #[abi(embed_v0)]\n    impl IBalanceTokenImpl of super::IBalanceToken<ContractState> {\n        // Returns the current balance\n        fn get_balance(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n\n        // Returns the current token id.\n        fn get_token_id(self: @ContractState) -> u256 {\n            self.token_id.read()\n        }\n    }\n\n    #[l1_handler]\n    fn process_l1_message(ref self: ContractState, from_address: felt252, data: L1Data) {\n        assert(from_address == self.l1_caller.read(), 'Unauthorized l1 caller');\n        self.balance.write(data.balance);\n        self.token_id.write(data.token_id);\n    }\n\n    #[l1_handler]\n    fn panicking_l1_handler(ref self: ContractState, from_address: felt252) {\n        panic(array!['custom', 'panic']);\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/message_to_l1_checker.cairo",
    "content": "use starknet::{ContractAddress, EthAddress};\n\n#[starknet::interface]\ntrait IMessageToL1Checker<TContractState> {\n    fn send_message(ref self: TContractState, some_data: Array<felt252>, to_address: EthAddress);\n}\n\n#[starknet::contract]\nmod MessageToL1Checker {\n    use starknet::{ContractAddress, EthAddress, send_message_to_l1_syscall};\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl IMessageToL1Checker of super::IMessageToL1Checker<ContractState> {\n        fn send_message(ref self: ContractState, some_data: Array<felt252>, to_address: EthAddress) {\n            send_message_to_l1_syscall(to_address.into(), some_data.span()).unwrap()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/meta_tx_v0_checkers.cairo",
    "content": "#[starknet::interface]\ntrait ICheckerMetaTxV0<TContractState> {\n    fn __execute__(ref self: TContractState) -> felt252;\n}\n\n#[starknet::contract(account)]\nmod CheatCallerAddressCheckerMetaTxV0 {\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl ICheckerMetaTxV0 of super::ICheckerMetaTxV0<ContractState> {\n        fn __execute__(ref self: ContractState) -> felt252 {\n            starknet::get_caller_address().into()\n        }\n    }\n}\n\n#[starknet::contract(account)]\nmod TxInfoCheckerMetaTxV0 {\n    use starknet::get_execution_info;\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl ITxInfoCheckerMetaTxV0 of super::ICheckerMetaTxV0<ContractState> {\n        fn __execute__(ref self: ContractState) -> felt252 {\n            let execution_info = get_execution_info().unbox();\n            let tx_info = execution_info.tx_info.unbox();\n            tx_info.version\n        }\n    }\n}\n\n#[starknet::interface]\ntrait ICheatBlockHashCheckerMetaTxV0<TContractState> {\n    fn __execute__(ref self: TContractState, block_number: u64) -> felt252;\n}\n\n#[starknet::contract(account)]\nmod CheatBlockHashCheckerMetaTxV0 {\n    use starknet::SyscallResultTrait;\n    use starknet::syscalls::get_block_hash_syscall;\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl ICheatBlockHashCheckerMetaTxV0 of super::ICheatBlockHashCheckerMetaTxV0<ContractState> {\n        fn __execute__(ref self: ContractState, block_number: u64) -> felt252 {\n            let block_hash = get_block_hash_syscall(block_number).unwrap_syscall();\n\n            block_hash\n        }\n    }\n}\n\n#[starknet::interface]\ntrait ISimpleCheckerMetaTxV0<TContractState> {\n    fn __execute__(ref self: TContractState) -> felt252;\n}\n\n#[starknet::contract(account)]\nmod SimpleCheckerMetaTxV0 {\n    use starknet::SyscallResultTrait;\n    use starknet::syscalls::get_block_hash_syscall;\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl ISimpleCheckerMetaTxV0 of super::ISimpleCheckerMetaTxV0<ContractState> {\n        fn __execute__(ref self: ContractState) -> felt252 {\n           1234567890.into()\n        }\n    }\n}\n\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/meta_tx_v0_test.cairo",
    "content": "#[starknet::interface]\ntrait IMetaTxV0Test<TContractState> {\n    fn execute_meta_tx_v0(\n        ref self: TContractState, target: starknet::ContractAddress, signature: Span<felt252>,\n    ) -> felt252;\n    fn execute_meta_tx_v0_get_block_hash(\n        ref self: TContractState,\n        target: starknet::ContractAddress,\n        block_number: u64,\n        signature: Span<felt252>,\n    ) -> felt252;\n}\n\n#[starknet::contract]\nmod MetaTxV0Test {\n    use starknet::syscalls::meta_tx_v0_syscall;\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl IMetaTxV0Test of super::IMetaTxV0Test<ContractState> {\n        fn execute_meta_tx_v0(\n            ref self: ContractState, target: starknet::ContractAddress, signature: Span<felt252>,\n        ) -> felt252 {\n            let selector = selector!(\"__execute__\");\n            let calldata = array![];\n\n            let result = meta_tx_v0_syscall(target, selector, calldata.span(), signature).unwrap();\n\n            *result.at(0)\n        }\n\n        fn execute_meta_tx_v0_get_block_hash(\n            ref self: ContractState,\n            target: starknet::ContractAddress,\n            block_number: u64,\n            signature: Span<felt252>,\n        ) -> felt252 {\n            let selector = selector!(\"__execute__\");\n            let calldata = array![block_number.into()];\n\n            let result = meta_tx_v0_syscall(target, selector, calldata.span(), signature).unwrap();\n\n            *result.at(0)\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/mock_checker.cairo",
    "content": "#[derive(Serde, Drop)]\nstruct StructThing {\n    item_one: felt252,\n    item_two: felt252,\n}\n\n#[starknet::interface]\ntrait IMockChecker<TContractState> {\n    fn get_thing(ref self: TContractState) -> felt252;\n    fn get_thing_wrapper(ref self: TContractState) -> felt252;\n    fn get_constant_thing(ref self: TContractState) -> felt252;\n    fn get_struct_thing(ref self: TContractState) -> StructThing;\n    fn get_arr_thing(ref self: TContractState) -> Array<StructThing>;\n}\n\n#[starknet::contract]\nmod MockChecker {\n    use super::IMockChecker;\n    use super::StructThing;\n    use array::ArrayTrait;\n\n    #[storage]\n    struct Storage {\n        stored_thing: felt252\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState, arg1: felt252) {\n        self.stored_thing.write(arg1)\n    }\n\n    #[abi(embed_v0)]\n    impl IMockCheckerImpl of super::IMockChecker<ContractState> {\n        fn get_thing(ref self: ContractState) -> felt252 {\n            self.stored_thing.read()\n        }\n\n        fn get_thing_wrapper(ref self: ContractState) -> felt252 {\n            self.get_thing()\n        }\n\n        fn get_constant_thing(ref self: ContractState) -> felt252 {\n            13\n        }\n\n        fn get_struct_thing(ref self: ContractState) -> StructThing {\n            StructThing {item_one: 12, item_two: 21}\n        }\n\n        fn get_arr_thing(ref self: ContractState) -> Array<StructThing> {\n            array![StructThing {item_one: 12, item_two: 21}]\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/response_with_2_felts.cairo",
    "content": "#[starknet::interface]\ntrait IResponseWith2Felts<TContractState> {\n    fn get(self: @TContractState) -> Response;\n}\n\n#[derive(Drop, Serde)]\nstruct Response {\n    a: felt252,\n    b: felt252,\n}\n\n#[starknet::contract]\nmod ResponseWith2Felts {\n    use core::array::ArrayTrait;\n    use super::Response;\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl IResponseWith2FeltsImpl of super::IResponseWith2Felts<ContractState> {\n        // Increases the balance by the given amount\n        fn get(self: @ContractState) -> Response {\n            Response { a: 8, b: 43 }\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/reverts_caller.cairo",
    "content": "use starknet::SyscallResultTrait;\n\n#[starknet::interface]\ntrait ICaller<TContractState> {\n    /// Execute test scenario in tests: call entrypoint that modifies storage and panics, then assert that state was reverted\n    fn call(ref self: TContractState);\n}\n\n#[starknet::interface]\ntrait IContract<TContractState> {\n    /// Return storage value\n    fn read_storage(self: @TContractState) -> felt252;\n    /// Write `value` to storage and emits event\n    fn write_storage(ref self: TContractState, value: felt252);\n    /// Write `value` to storage and then panic\n    fn write_storage_and_panic(ref self: TContractState, value: felt252);\n}\n\n#[starknet::contract]\n#[feature(\"safe_dispatcher\")]\nmod Caller {\n    use starknet::ContractAddress;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n    use super::{ICaller, IContractSafeDispatcher, IContractSafeDispatcherTrait};\n\n    #[storage]\n    struct Storage {\n        address: ContractAddress,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState, address: ContractAddress) {\n        self.address.write(address);\n    }\n\n    #[abi(embed_v0)]\n    impl ICallerImpl of ICaller<ContractState> {\n        fn call(ref self: ContractState) {\n            let contract_address = self.address.read();\n            let dispatcher = IContractSafeDispatcher { contract_address };\n\n            dispatcher.write_storage(43).unwrap();\n\n            // Make sure the storage is updated\n            let storage = dispatcher.read_storage().unwrap();\n            assert(storage == 43, 'Incorrect storage');\n\n            // Try modifying storage and handle panic\n            match dispatcher.write_storage_and_panic(1) {\n                Result::Ok(_) => panic!(\"Should have panicked\"),\n                Result::Err(_) => { // handled\n                },\n            }\n\n            // Check storage change was reverted\n            let storage = dispatcher.read_storage().unwrap();\n            assert(storage == 43, 'Storage not reverted');\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/reverts_contract.cairo",
    "content": "#[starknet::interface]\ntrait IContract<TContractState> {\n    /// Return storage value\n    fn read_storage(self: @TContractState) -> felt252;\n    /// Write `value` to storage and emits event\n    fn write_storage(ref self: TContractState, value: felt252);\n    /// Write `value` to storage and then panic\n    fn write_storage_and_panic(ref self: TContractState, value: felt252);\n}\n\n#[starknet::contract]\nmod Contract {\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        value: felt252,\n    }\n\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    pub enum Event {\n        ValueUpdated: ValueUpdated,\n    }\n\n    #[derive(Drop, starknet::Event)]\n    pub struct ValueUpdated {\n        pub old_value: felt252,\n        pub new_value: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl IContractImpl of super::IContract<ContractState> {\n        fn write_storage_and_panic(ref self: ContractState, value: felt252) {\n            self.write_storage(value);\n            panic!(\"Panicked\");\n        }\n\n        fn read_storage(self: @ContractState) -> felt252 {\n            self.value.read()\n        }\n\n        fn write_storage(ref self: ContractState, value: felt252) {\n            let old_value = self.value.read();\n            self.emit(ValueUpdated { old_value, new_value: value});\n            self.value.write(value);\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/reverts_proxy.cairo",
    "content": "use starknet::ContractAddress;\n\n#[starknet::interface]\ntrait IContract<TContractState> {\n    /// Return storage value\n    fn read_storage(self: @TContractState) -> felt252;\n    /// Write `value` to storage and emits event\n    fn write_storage(ref self: TContractState, value: felt252);\n    /// Write `value` to storage and then panic\n    fn write_storage_and_panic(ref self: TContractState, value: felt252);\n}\n\n#[starknet::interface]\n/// Makes calls to nested contract with address `address` \ntrait ILibraryProxy<TContractState> {\n    /// Call on proxied contract unwrapping the syscall result: Return storage value\n    fn library_read_storage(self: @TContractState, address: ContractAddress) -> felt252;\n    /// Call on proxied contract unwrapping the syscall result: Write `value` to storage\n    fn library_write_storage(self: @TContractState, address: ContractAddress, value: felt252);\n    /// Call on proxied contract with safe dispatcher: Write `value` to storage and then handle panic\n    fn library_write_storage_and_panic(self: @TContractState, address: ContractAddress, value: felt252);\n}\n\n#[starknet::interface]\n/// Makes calls to nested contract with safe dispatcher\ntrait ISafeProxy<TContractState> {\n    /// Call on proxied contract with safe dispatcher: Write `value` to storage and then handle panic\n    fn call_write_storage_and_handle_panic(ref self: TContractState, value: felt252);\n}\n\n#[feature(\"safe_dispatcher\")]\n#[starknet::contract]\nmod Proxy {\n    use starknet::{ContractAddress, SyscallResultTrait};\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n    use super::{IContract, ISafeProxy, ILibraryProxy, IContractDispatcher, IContractSafeDispatcher, IContractDispatcherTrait, IContractSafeDispatcherTrait};\n\n    #[storage]\n    struct Storage {\n        address: ContractAddress,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState, address: ContractAddress) {\n        self.address.write(address);\n    }\n\n    #[abi(embed_v0)]\n    impl IProxyImpl of IContract<ContractState> {\n        fn write_storage_and_panic(ref self: ContractState, value: felt252) {\n            let contract_address = self.address.read();\n            let dispatcher = IContractDispatcher { contract_address };\n            let storage = dispatcher.read_storage();\n            assert(storage != 0, 'Storage already modified');\n\n            dispatcher.write_storage(43);\n            let storage = dispatcher.read_storage();\n            assert(storage == 43, 'Incorrect storage value');\n\n            dispatcher.write_storage_and_panic(value);\n\n            // unreachable\n            assert(false, 'Should not execute');\n        }\n\n        fn read_storage(self: @ContractState) -> felt252 {\n            let contract_address = self.address.read();\n            let dispatcher = IContractDispatcher { contract_address };\n            dispatcher.read_storage()\n        }\n\n        fn write_storage(ref self: ContractState, value: felt252) {\n            let contract_address = self.address.read();\n            let dispatcher = IContractDispatcher { contract_address };\n            dispatcher.write_storage(value)\n        }\n    }\n\n    #[abi(embed_v0)]\n    impl ILibraryProxyImpl of ILibraryProxy<ContractState> {\n        fn library_write_storage_and_panic(self: @ContractState, address: ContractAddress, value: felt252) {\n            let dispatcher = IContractDispatcher { contract_address: address };\n            let storage = dispatcher.read_storage();\n            assert(storage != 0, 'Storage already modified');\n\n            dispatcher.write_storage(43);\n            let storage = dispatcher.read_storage();\n            assert(storage == 43, 'Incorrect storage value');\n\n            dispatcher.write_storage_and_panic(value);\n\n            // unreachable\n            assert(false, 'Should not execute');\n        }\n\n        fn library_read_storage(self: @ContractState, address: ContractAddress) -> felt252 {\n            let dispatcher = IContractDispatcher { contract_address: address };\n            dispatcher.read_storage()\n        }\n\n        fn library_write_storage(self: @ContractState, address: ContractAddress, value: felt252) {\n            let dispatcher = IContractDispatcher { contract_address: address };\n            dispatcher.write_storage(value)\n        }\n    }\n\n    #[abi(embed_v0)]\n    impl ISafeProxyImpl of ISafeProxy<ContractState> {\n        fn call_write_storage_and_handle_panic(ref self: ContractState, value: felt252) {\n            let contract_address = self.address.read();\n            let dispatcher = IContractSafeDispatcher { contract_address };\n            let storage = dispatcher.read_storage().unwrap_syscall();\n            assert(storage != 0, 'Storage already modified');\n\n            if let Ok(_) = dispatcher.write_storage_and_panic(value) {\n                panic!(\"Should have panicked\")\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/serding.cairo",
    "content": "#[derive(Drop, Serde)]\nstruct NestedStruct {\n    d: felt252,\n}\n\n#[derive(Drop, Serde)]\nstruct CustomStruct {\n    a: felt252,\n    b: felt252,\n    c: NestedStruct,\n}\n\n#[derive(Drop, Serde)]\nstruct AnotherCustomStruct {\n    e: felt252,\n}\n\n#[starknet::interface]\ntrait ISerding<TContractState> {\n    fn add_multiple_parts(\n        self: @TContractState,\n        custom_struct: CustomStruct,\n        another_struct: AnotherCustomStruct,\n        standalone_arg: felt252\n    ) -> felt252;\n}\n\n#[starknet::contract]\nmod Serding {\n    use super::{CustomStruct, AnotherCustomStruct};\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl SerdingImpl of super::ISerding<ContractState> {\n        fn add_multiple_parts(\n            self: @ContractState,\n            custom_struct: CustomStruct,\n            another_struct: AnotherCustomStruct,\n            standalone_arg: felt252\n        ) -> felt252 {\n            custom_struct.a + custom_struct.b + custom_struct.c.d + another_struct.e + standalone_arg\n        }\n    }\n\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/spy_events_checker.cairo",
    "content": "use starknet::ContractAddress;\n\n// 0x2c77ca97586968c6651a533bd5f58042c368b14cf5f526d2f42f670012e10ac\n#[starknet::interface]\ntrait ICairo0Contract<TContractState> {\n    // this function only job is to emit `my_event` with single felt252 value\n    fn emit_one_cairo0_event(ref self: TContractState, contract_address: felt252);\n}\n\n#[starknet::interface]\ntrait ISpyEventsChecker<TContractState> {\n    fn do_not_emit(ref self: TContractState);\n    fn emit_one_event(ref self: TContractState, some_data: felt252);\n    fn emit_two_events(\n        ref self: TContractState, some_data: felt252, some_more_data: ContractAddress\n    );\n    fn emit_three_events(\n        ref self: TContractState,\n        some_data: felt252,\n        some_more_data: ContractAddress,\n        even_more_data: u256\n    );\n    fn emit_event_syscall(ref self: TContractState, some_key: felt252, some_data: felt252);\n    fn test_cairo0_event_collection(ref self: TContractState, cairo0_address: ContractAddress);\n}\n\n#[starknet::contract]\nmod SpyEventsChecker {\n    use starknet::ContractAddress;\n    use starknet::SyscallResultTrait;\n    use super::ICairo0ContractDispatcherTrait;\n\n    #[storage]\n    struct Storage {}\n\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    enum Event {\n        FirstEvent: FirstEvent,\n        SecondEvent: SecondEvent,\n        ThirdEvent: ThirdEvent,\n    }\n\n    #[derive(Drop, starknet::Event)]\n    struct FirstEvent {\n        some_data: felt252\n    }\n\n    #[derive(Drop, starknet::Event)]\n    struct SecondEvent {\n        some_data: felt252,\n        #[key]\n        some_more_data: ContractAddress\n    }\n\n    #[derive(Drop, starknet::Event)]\n    struct ThirdEvent {\n        some_data: felt252,\n        some_more_data: ContractAddress,\n        even_more_data: u256\n    }\n\n    #[abi(embed_v0)]\n    impl ISpyEventsChecker of super::ISpyEventsChecker<ContractState> {\n        fn do_not_emit(ref self: ContractState) {}\n\n        fn emit_one_event(ref self: ContractState, some_data: felt252) {\n            self.emit(Event::FirstEvent(FirstEvent { some_data }));\n        }\n\n        fn emit_two_events(\n            ref self: ContractState, some_data: felt252, some_more_data: ContractAddress\n        ) {\n            self.emit(Event::FirstEvent(FirstEvent { some_data }));\n            self.emit(Event::SecondEvent(SecondEvent { some_data, some_more_data }));\n        }\n\n        fn emit_three_events(\n            ref self: ContractState,\n            some_data: felt252,\n            some_more_data: ContractAddress,\n            even_more_data: u256\n        ) {\n            self.emit(Event::FirstEvent(FirstEvent { some_data }));\n            self.emit(Event::SecondEvent(SecondEvent { some_data, some_more_data }));\n            self.emit(Event::ThirdEvent(ThirdEvent { some_data, some_more_data, even_more_data }));\n        }\n\n        fn emit_event_syscall(ref self: ContractState, some_key: felt252, some_data: felt252) {\n            starknet::emit_event_syscall(array![some_key].span(), array![some_data].span())\n                .unwrap_syscall();\n        }\n\n        fn test_cairo0_event_collection(ref self: ContractState, cairo0_address: ContractAddress) {\n            let cairo0_contract = super::ICairo0ContractDispatcher {\n                contract_address: cairo0_address\n            };\n\n            cairo0_contract.emit_one_cairo0_event(123456789);\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/storage_tester.cairo",
    "content": "#[starknet::contract]\nmod StorageTester {\n    use starknet::storage::Map;\n\n    #[derive(Serde, Drop, starknet::Store)]\n    struct NestedStructure {\n        c: felt252\n    }\n    #[derive(Serde, Drop, starknet::Store)]\n    struct StoredStructure {\n        a: felt252,\n        b: NestedStructure,\n    }\n\n    #[derive(Serde, Drop, starknet::Store, Hash)]\n    struct NestedKey {\n        c: felt252\n    }\n    #[derive(Serde, Drop, starknet::Store, Hash)]\n    struct StructuredKey {\n        a: felt252,\n        b: NestedKey,\n    }\n\n    #[storage]\n    struct Storage {\n        structure: StoredStructure,\n        felt_to_structure: Map<felt252, StoredStructure>,\n        structure_to_felt: Map<StructuredKey, felt252>,\n        felt_to_felt: Map<felt252, felt252>,\n    }\n\n    #[external(v0)]\n    fn insert_structure(ref self: ContractState, value: StoredStructure) {\n        self.structure.write(value);\n    }\n\n    #[external(v0)]\n    fn read_structure(self: @ContractState) -> StoredStructure {\n        self.structure.read()\n    }\n\n    #[external(v0)]\n    fn insert_felt_to_structure(ref self: ContractState, key: felt252, value: StoredStructure) {\n        self.felt_to_structure.write(key, value);\n    }\n\n    #[external(v0)]\n    fn read_felt_to_structure(self: @ContractState, key: felt252) -> StoredStructure {\n        self.felt_to_structure.read(key)\n    }\n\n    #[external(v0)]\n    fn insert_structure_to_felt(ref self: ContractState, key: StructuredKey, value: felt252) {\n        self.structure_to_felt.write(key, value);\n    }\n\n    #[external(v0)]\n    fn read_structure_to_felt(self: @ContractState, key: StructuredKey) -> felt252 {\n        self.structure_to_felt.read(key)\n    }\n\n    #[external(v0)]\n    fn insert_felt_to_felt(ref self: ContractState, key: felt252, value: felt252) {\n        self.felt_to_felt.write(key, value);\n    }\n\n    #[external(v0)]\n    fn read_felt_to_felt(self: @ContractState, key: felt252) -> felt252 {\n        self.felt_to_felt.read(key)\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/too_many_events.cairo",
    "content": "use starknet::ContractAddress;\n\n#[starknet::interface]\ntrait ITooManyEvents<TContractState> {\n    fn emit_too_many_events(self: @TContractState, count: felt252);\n    fn emit_too_many_keys(self: @TContractState, count: felt252);\n    fn emit_too_many_data(self: @TContractState, count: felt252);\n}\n\n#[starknet::contract]\nmod TooManyEvents {\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl TooManyEventsImpl of super::ITooManyEvents<ContractState> {\n        fn emit_too_many_events(self: @ContractState, mut count: felt252) {\n            while count != 0 {\n                starknet::emit_event_syscall(array![0].span(), array![0].span()).unwrap();\n                count -= 1;\n            };\n        }\n        fn emit_too_many_keys(self: @ContractState, mut count: felt252) {\n            let mut arr = array![];\n            while count != 0 {\n                arr.append(0);\n                count -= 1;\n            };\n\n            starknet::emit_event_syscall(arr.span(), array![0].span()).unwrap();\n        }\n        fn emit_too_many_data(self: @ContractState, mut count: felt252) {\n            let mut arr = array![];\n            while count != 0 {\n                arr.append(0);\n                count -= 1;\n            };\n\n            starknet::emit_event_syscall(array![0].span(), arr.span()).unwrap();\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/trace_dummy.cairo",
    "content": "#[starknet::interface]\ntrait ITraceDummy<T> {\n    fn from_proxy_dummy(ref self: T);\n}\n\n#[starknet::contract]\nmod TraceDummy {\n    #[storage]\n    struct Storage {\n        balance: u8\n    }\n\n    #[abi(embed_v0)]\n    impl ITraceDummyImpl of super::ITraceDummy<ContractState> {\n        fn from_proxy_dummy(ref self: ContractState) {\n            self.balance.write(7);\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/trace_info_checker.cairo",
    "content": "use starknet::{ContractAddress, ClassHash};\n\n#[starknet::interface]\ntrait ITraceInfoProxy<T> {\n    fn with_libcall(self: @T, class_hash: ClassHash) -> felt252;\n    fn regular_call(self: @T, contract_address: ContractAddress) -> felt252;\n    fn with_panic(self: @T, contract_address: ContractAddress);\n    fn call_two(self: @T, checker_address: ContractAddress, dummy_address: ContractAddress);\n}\n\n#[starknet::interface]\ntrait ITraceInfoChecker<T> {\n    fn from_proxy(self: @T, data: felt252) -> felt252;\n    fn panic(self: @T);\n}\n\n#[starknet::contract]\nmod TraceInfoChecker {\n    use super::{ITraceInfoChecker, ITraceInfoProxyDispatcher, ITraceInfoProxyDispatcherTrait};\n    use starknet::{ContractAddress, get_contract_address};\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl ITraceInfoChceckerImpl of ITraceInfoChecker<ContractState> {\n        fn from_proxy(self: @ContractState, data: felt252) -> felt252 {\n            100 + data\n        }\n\n        fn panic(self: @ContractState) {\n            panic_with_felt252('panic');\n        }\n    }\n\n    #[l1_handler]\n    fn handle_l1_message(\n        ref self: ContractState, from_address: felt252, proxy_address: ContractAddress\n    ) -> felt252 {\n        ITraceInfoProxyDispatcher { contract_address: proxy_address }\n            .regular_call(get_contract_address())\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/trace_info_proxy.cairo",
    "content": "use starknet::{ContractAddress, ClassHash};\n\n#[starknet::interface]\ntrait ITraceInfoProxy<T> {\n    fn with_libcall(self: @T, class_hash: ClassHash) -> felt252;\n    fn regular_call(self: @T, contract_address: ContractAddress) -> felt252;\n    fn with_panic(self: @T, contract_address: ContractAddress);\n    fn call_two(self: @T, checker_address: ContractAddress, dummy_address: ContractAddress);\n}\n\n#[starknet::interface]\ntrait ITraceInfoChecker<T> {\n    fn from_proxy(self: @T, data: felt252) -> felt252;\n    fn panic(self: @T);\n}\n\n#[starknet::interface]\ntrait ITraceDummy<T> {\n    fn from_proxy_dummy(ref self: T);\n}\n\n#[starknet::contract]\nmod TraceInfoProxy {\n    use super::{\n        ITraceInfoCheckerDispatcherTrait, ITraceInfoCheckerDispatcher,\n        ITraceInfoCheckerLibraryDispatcher, ITraceInfoProxy,\n        ITraceDummyDispatcher, ITraceDummyDispatcherTrait\n    };\n    use starknet::{ContractAddress, ClassHash};\n\n    #[storage]\n    struct Storage {}\n\n    #[constructor]\n    fn constructor(ref self: ContractState, contract_address: ContractAddress) {\n        ITraceInfoCheckerDispatcher { contract_address }.from_proxy(1);\n    }\n\n    #[abi(embed_v0)]\n    impl ITraceInfoProxyImpl of ITraceInfoProxy<ContractState> {\n        fn regular_call(self: @ContractState, contract_address: ContractAddress) -> felt252 {\n            ITraceInfoCheckerDispatcher { contract_address }.from_proxy(2)\n        }\n\n        fn with_libcall(self: @ContractState, class_hash: ClassHash) -> felt252 {\n            ITraceInfoCheckerLibraryDispatcher { class_hash }.from_proxy(3)\n        }\n\n        fn with_panic(self: @ContractState, contract_address: ContractAddress) {\n            ITraceInfoCheckerDispatcher { contract_address }.panic();\n            // unreachable code to check if we stop executing after panic\n            ITraceInfoCheckerDispatcher { contract_address }.from_proxy(5);\n        }\n\n        fn call_two(\n            self: @ContractState, checker_address: ContractAddress, dummy_address: ContractAddress\n        ) {\n            ITraceInfoCheckerDispatcher { contract_address: checker_address }.from_proxy(42);\n            ITraceDummyDispatcher { contract_address: dummy_address }.from_proxy_dummy();\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/contracts/two_implementations.cairo",
    "content": "#[starknet::interface]\ntrait IReplaceBytecode<TContractState> {\n    fn get(self: @TContractState) -> felt252;\n    fn libcall(self: @TContractState, class_hash: starknet::ClassHash) -> felt252;\n}\n\n#[starknet::interface]\ntrait ILib<TContractState> {\n    fn get(self: @TContractState) -> felt252;\n}\n\n#[starknet::contract]\nmod Lib {\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl ILib of super::ILib<ContractState> {\n        fn get(self: @ContractState) -> felt252 {\n            123456789\n        }\n    }\n}\n\n#[starknet::contract]\nmod ReplaceBytecodeA {\n    use super::{ILibLibraryDispatcher, ILibDispatcherTrait};\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl IReplaceBytecodeA of super::IReplaceBytecode<ContractState> {\n        fn get(self: @ContractState) -> felt252 {\n            2137\n        }\n        fn libcall(self: @ContractState, class_hash: starknet::ClassHash) -> felt252 {\n            let dispatcher = ILibLibraryDispatcher { class_hash };\n            dispatcher.get()\n        }\n    }\n}\n\n#[starknet::contract]\nmod ReplaceBytecodeB {\n    use super::{ILibLibraryDispatcher, ILibDispatcherTrait};\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl IReplaceBytecodeB of super::IReplaceBytecode<ContractState> {\n        fn get(self: @ContractState) -> felt252 {\n            420\n        }\n        fn libcall(self: @ContractState, class_hash: starknet::ClassHash) -> felt252 {\n            let dispatcher = ILibLibraryDispatcher { class_hash };\n            dispatcher.get()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/coverage_project/Scarb.toml",
    "content": "[package]\nname = \"coverage_project\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html\n\n[dependencies]\nstarknet = \"2.4.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[profile.dev.cairo]\nunstable-add-statements-functions-debug-info = true # Comment\nunstable-add-statements-code-locations-debug-info = true\ninlining-strategy= \"avoid\" # Comment\n"
  },
  {
    "path": "crates/forge/tests/data/coverage_project/src/lib.cairo",
    "content": "pub fn increase_by_two(arg: u8) -> u8 {\n    assert(2 == 2, '');\n    increase_by_one(arg + 1)\n}\n\npub fn increase_by_one(arg: u8) -> u8 {\n    assert(1 == 1, '');\n    arg + 1\n}\n"
  },
  {
    "path": "crates/forge/tests/data/coverage_project/tests/lib.cairo",
    "content": "use coverage_project::{increase_by_one, increase_by_two};\n\n\n#[test]\nfn my_test() {\n    assert(increase_by_two(1) == 3, ''); // inlines\n    assert(increase_by_one(1) == 2, ''); // inlines\n}\n"
  },
  {
    "path": "crates/forge/tests/data/debugging/Scarb.toml",
    "content": "[package]\nname = \"debugging\"\nversion = \"0.1.0\"\nedition = \"2023_01\"\n\n[dependencies]\nstarknet = \">=2.8.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n\n[features]\nfuzzer = []\n"
  },
  {
    "path": "crates/forge/tests/data/debugging/src/lib.cairo",
    "content": "use starknet::ContractAddress;\n\n#[derive(Drop, Serde, Clone)]\nstruct RecursiveCall {\n    contract_address: ContractAddress,\n    payload: Array<RecursiveCall>,\n}\n\n#[starknet::interface]\ntrait RecursiveCaller<T> {\n    fn execute_calls(self: @T, calls: Array<RecursiveCall>) -> Array<RecursiveCall>;\n}\n\n#[starknet::interface]\ntrait Failing<TContractState> {\n    fn fail(self: @TContractState, data: Array<felt252>);\n}\n\n#[starknet::contract]\nmod SimpleContract {\n    use core::array::ArrayTrait;\n    use core::traits::Into;\n    use starknet::{ContractAddress, get_contract_address};\n    use super::{\n        Failing, RecursiveCall, RecursiveCaller, RecursiveCallerDispatcher,\n        RecursiveCallerDispatcherTrait,\n    };\n\n\n    #[storage]\n    struct Storage {}\n\n\n    #[abi(embed_v0)]\n    impl RecursiveCallerImpl of RecursiveCaller<ContractState> {\n        fn execute_calls(\n            self: @ContractState, calls: Array<RecursiveCall>,\n        ) -> Array<RecursiveCall> {\n            let mut i = 0;\n            #[cairofmt::skip]\n            while i < calls.len() {\n                let serviced_call = calls.at(i);\n                RecursiveCallerDispatcher {\n                    contract_address: serviced_call.contract_address.clone(),\n                }\n                    .execute_calls(serviced_call.payload.clone());\n                i = i + 1;\n            };\n\n            calls\n        }\n    }\n\n    #[abi(embed_v0)]\n    impl FailingImpl of Failing<ContractState> {\n        fn fail(self: @ContractState, data: Array<felt252>) {\n            panic(data);\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/debugging/tests/test_trace.cairo",
    "content": "use debugging::{\n    FailingDispatcher, FailingDispatcherTrait, RecursiveCall, RecursiveCallerDispatcher,\n    RecursiveCallerDispatcherTrait,\n};\nuse snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::trace::get_call_trace;\nuse snforge_std::{ContractClassTrait, declare};\n\n#[test]\n#[should_panic]\nfn test_debugging_trace_success() {\n    run_test();\n}\n\n#[test]\nfn test_debugging_trace_failure() {\n    run_test();\n}\n\nfn run_test() {\n    let sc = declare(\"SimpleContract\").unwrap().contract_class();\n\n    let (contract_address_A, _) = sc.deploy(@array![]).unwrap();\n    let (contract_address_B, _) = sc.deploy(@array![]).unwrap();\n    let (contract_address_C, _) = sc.deploy(@array![]).unwrap();\n\n    let calls = array![\n        RecursiveCall {\n            contract_address: contract_address_B,\n            payload: array![\n                RecursiveCall { contract_address: contract_address_C, payload: array![] },\n                RecursiveCall { contract_address: contract_address_C, payload: array![] },\n            ],\n        },\n        RecursiveCall { contract_address: contract_address_C, payload: array![] },\n    ];\n\n    RecursiveCallerDispatcher { contract_address: contract_address_A }.execute_calls(calls);\n\n    let failing_dispatcher = FailingDispatcher { contract_address: contract_address_A };\n    failing_dispatcher.fail(array![1, 2, 3, 4, 5]);\n}\n\n#[cfg(feature: 'fuzzer')]\n#[test]\n#[fuzzer]\nfn test_debugging_fuzzer(_x: felt252) {}\n"
  },
  {
    "path": "crates/forge/tests/data/debugging_fork/Scarb.toml",
    "content": "[package]\nname = \"debugging_fork\"\nversion = \"0.1.0\"\nedition = \"2023_01\"\n\n[dependencies]\nstarknet = \">=2.8.0\"\n\n[[target.starknet-contract]]\nsierra = true\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n"
  },
  {
    "path": "crates/forge/tests/data/debugging_fork/src/lib.cairo",
    "content": "use starknet::ContractAddress;\n\n#[derive(Drop, Serde, Clone)]\nstruct RecursiveCall {\n    contract_address: ContractAddress,\n    payload: Array<RecursiveCall>,\n}\n\n// `RecursiveCaller` is implemented in the `debugging` package\n#[starknet::interface]\ntrait RecursiveCaller<T> {\n    fn execute_calls(self: @T, calls: Array<RecursiveCall>) -> Array<RecursiveCall>;\n}\n\n// `Failing` is implemented in the `debugging` package\n#[starknet::interface]\ntrait Failing<TContractState> {\n    fn fail(self: @TContractState, data: Array<felt252>);\n}\n"
  },
  {
    "path": "crates/forge/tests/data/debugging_fork/tests/test_trace.cairo",
    "content": "use debugging_fork::{\n    FailingDispatcher, FailingDispatcherTrait, RecursiveCall, RecursiveCallerDispatcher,\n    RecursiveCallerDispatcherTrait,\n};\nuse snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::trace::get_call_trace;\nuse snforge_std::{ContractClassTrait, declare};\n\n#[test]\n#[should_panic]\n#[fork(url: \"{{ NODE_RPC_URL }}\", block_number: 828912)]\nfn test_debugging_trace_success() {\n    run_test();\n}\n\n#[test]\n#[fork(url: \"{{ NODE_RPC_URL }}\", block_number: 828912)]\nfn test_debugging_trace_failure() {\n    run_test();\n}\n\nfn run_test() {\n    let contract_address_A = 0x05005956a18de174e33378fa9a278dde8a22d0bf823d4bd6f9c9051fe99d04a0\n        .try_into()\n        .unwrap();\n    let contract_address_B = 0x01c6cec47a2ed95320f76e2b50626879737aa57990748db2d9527e867f98bc55\n        .try_into()\n        .unwrap();\n    let contract_address_C = 0x042e631f2785a56bc5bcfd247b16e72d3d957bb8efe136829379a20ac675dbb7\n        .try_into()\n        .unwrap();\n\n    let calls = array![\n        RecursiveCall {\n            contract_address: contract_address_B,\n            payload: array![\n                RecursiveCall { contract_address: contract_address_C, payload: array![] },\n                RecursiveCall { contract_address: contract_address_C, payload: array![] },\n            ],\n        },\n        RecursiveCall { contract_address: contract_address_C, payload: array![] },\n    ];\n\n    RecursiveCallerDispatcher { contract_address: contract_address_A }.execute_calls(calls);\n\n    let failing_dispatcher = FailingDispatcher { contract_address: contract_address_A };\n    failing_dispatcher.fail(array![1, 2, 3, 4, 5]);\n}\n"
  },
  {
    "path": "crates/forge/tests/data/deterministic_output/Scarb.toml",
    "content": "[package]\nname = \"deterministic_output\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n"
  },
  {
    "path": "crates/forge/tests/data/deterministic_output/src/lib.cairo",
    "content": "fn fib(a: felt252, b: felt252, n: felt252) -> felt252 {\n    match n {\n        0 => a,\n        _ => fib(b, a + b, n - 1),\n    }\n}\n\n\n#[cfg(test)]\nmod test {\n    use super::fib;\n\n    #[test]\n    fn second_test_pass_x() {\n        fib(0, 1, 750000);\n        assert(2 == 2, 'simple check');\n    }\n\n    #[test]\n    fn first_test_pass_y() {\n        fib(0, 1, 3);\n        assert(2 == 2, 'simple check');\n    }\n\n    #[test]\n    fn second_test_fail_y() {\n        fib(0, 1, 750000);\n        assert(1 == 2, 'simple check');\n    }\n\n    #[test]\n    fn first_test_fail_x() {\n        fib(0, 1, 3);\n        assert(1 == 2, 'simple check');\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/attributes/.cairofmtignore",
    "content": "tests/\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/attributes/Scarb.toml",
    "content": "[package]\nname = \"attributes\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.9.3\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/attributes/src/lib.cairo",
    "content": "\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/attributes/tests/contract.cairo",
    "content": "use core::array::ArrayTrait;\nuse core::result::ResultTrait;\nuse snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::{ContractClassTrait, declare};\n\n@attrs@\nfn call_and_invoke1(_a: felt252, b: u256) {\n    let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n    let constructor_calldata = @ArrayTrait::new();\n    let (_contract_address1, _) = contract.deploy(constructor_calldata).unwrap()\n}\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/generic/Scarb.toml",
    "content": "[package]\nname = \"generic\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.9.3\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/generic/src/lib.cairo",
    "content": "\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/generic/tests/contract.cairo",
    "content": "fn smallest_element<T, impl TPartialOrd: PartialOrd<T>, impl TCopy: Copy<T>, impl TDrop: Drop<T>>(\n    list: @Array<T>,\n) -> T {\n    let mut smallest = *list[0];\n    let mut index = 1;\n\n    while index < list.len() {\n        if *list[index] < smallest {\n            smallest = *list[index];\n        }\n        index = index + 1;\n    }\n\n    smallest\n}\n\nstruct MyStruct {\n    pub value: felt252,\n}\n\n#[test]\n#[fuzzer]\n#[fork(url: \"http://127.0.0.1:3030\", block_tag: latest)]\n#[ignore]\nfn call_and_invoke(_a: felt252, b: u256) {\n    let list: Array<MyStruct> = array![];\n\n    // We need to specify that we are passing a snapshot of `list` as an argument\n    let s = smallest_element(@list);\n    assert!(s == 3);\n}\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/inline_macros/.cairofmtignore",
    "content": "tests/contract.cairo\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/inline_macros/Scarb.toml",
    "content": "[package]\nname = \"inline_macros\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.9.3\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/inline_macros/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait IHelloStarknet<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n    fn do_a_panic(self: @TContractState);\n    fn do_a_panic_with(self: @TContractState, panic_data: Array<felt252>);\n}\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/inline_macros/tests/contract.cairo",
    "content": "use core::array::ArrayTrait;\nuse core::result::ResultTrait;\nuse inline_macros::{IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait};\nuse snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::{ContractClassTrait, declare};\n\n#[test]\n#[fuzzer]\n#[fork(url: \"http://127.0.0.1:3030\", block_tag: latest)]\n#[ignore]\nfn call_and_invoke(_a: felt252, b: u256) {\n    let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n    let constructor_calldata = @ArrayTrait::new();\n    let (contract_address, _) = contract.deploy(constructor_calldata).unwrap();\n    let dispatcher = IHelloStarknetDispatcher { contract_address };\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 0, 'balance == 0');\n\n    dispatcher.increase_balance(100);\n\n    // Error below\n    print!('balance {}'; balance);\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 100, 'balance == 100');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/multiple/.cairofmtignore",
    "content": "tests/\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/multiple/Scarb.toml",
    "content": "[package]\nname = \"multiple\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.9.3\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/multiple/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait IHelloStarknet<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n    fn do_a_panic(self: @TContractState);\n    fn do_a_panic_with(self: @TContractState, panic_data: Array<felt252>);\n}\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/multiple/tests/contract.cairo",
    "content": "use core::array::ArrayTrait;\nuse core::result::ResultTrait;\nuse multiple::{IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait};\nuse snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::{ContractClassTrait, declare};\n\n#[test]\n#[fuzzer]\n#[fork(url: \"http://127.0.0.1:3030\", block_tag: latest)]\n#[ignore]\nfn call_and_invoke(_a: felt252, b: u256) {\n    let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n    let constructor_calldata = @ArrayTrait::new();\n    let (contract_address, _) = contract.deploy(constructor_calldata).unwrap();\n    let dispatcher = IHelloStarknetDispatcher { contract_address };\n\n    let balance = dispatcher.get_balance();\n    // Error below\n    assert(balance === 0, 'balance == 0');\n\n    dispatcher.increase_balance(100);\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 100, 'balance == 100');\n}\n\n#[test]\n#[fuzzer]\n#[fork(url: \"http://127.0.0.1:3030\", block_tag: latest)]\n#[ignore]\nfn call_and_invoke2(_a: felt252, b: u256) {\n    let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n    let constructor_calldata = @ArrayTrait::new();\n    let (contract_address, _) = contract.deploy(constructor_calldata).unwrap();\n    let dispatcher = IHelloStarknetDispatcher { contract_address };\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 0, 'balance == 0');\n\n    dispatcher.increase_balance(100);\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 100, 'balance == 100');\n}\n\n#[test]\n#[fuzzer]\n#[fork(url: \"http://127.0.0.1:3030\", block_tag: latest)]\n#[ignore]\nfn call_and_invoke3(_a: felt252, b: u256) {\n    let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n    let constructor_calldata = @ArrayTrait::new();\n    let (contract_address, _) = contract.deploy(constructor_calldata).unwrap();\n    let dispatcher = IHelloStarknetDispatcher { contract_address };\n\n    // Error below\n    let balance = dispatcher/get_balance();\n    assert(balance == 0, 'balance == 0');\n\n    dispatcher.increase_balance(100);\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 100, 'balance == 100');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/parameters/.cairofmtignore",
    "content": "tests/\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/parameters/Scarb.toml",
    "content": "[package]\nname = \"parameters\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.9.3\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/parameters/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait IHelloStarknet<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n    fn do_a_panic(self: @TContractState);\n    fn do_a_panic_with(self: @TContractState, panic_data: Array<felt252>);\n}\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/parameters/tests/contract.cairo",
    "content": "use core::array::ArrayTrait;\nuse core::result::ResultTrait;\nuse parameters::{IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait};\nuse snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::{ContractClassTrait, declare};\n\n#[test]\n#[fork(\"TESTNET\")]\nfn call_and_invoke(_a: felt252; b: u256) {\n    let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n    let constructor_calldata = @ArrayTrait::new();\n    let (contract_address, _) = contract.deploy(constructor_calldata).unwrap();\n    let dispatcher = IHelloStarknetDispatcher { contract_address };\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 0, 'balance == 0');\n\n    dispatcher.increase_balance(100);\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 100, 'balance == 100');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/semantic/Scarb.toml",
    "content": "[package]\nname = \"semantic\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.9.3\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/semantic/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait IHelloStarknet<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n    fn do_a_panic(self: @TContractState);\n    fn do_a_panic_with(self: @TContractState, panic_data: Array<felt252>);\n}\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/semantic/tests/contract.cairo",
    "content": "use core::array::ArrayTrait;\nuse core::result::ResultTrait;\nuse semantic::{IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait};\nuse snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::{ContractClassTrait, declare};\n\n#[test]\n#[fuzzer]\n#[fork(url: \"http://127.0.0.1:3030\", block_tag: latest)]\n#[ignore]\nfn call_and_invoke(_a: felt252, b: u256) {\n    let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n    let constructor_calldata = @ArrayTrait::new();\n    let (contract_address, _) = contract.deploy(constructor_calldata).unwrap();\n    let dispatcher = IHelloStarknetDispatcher { contract_address };\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 0, 'balance == 0');\n\n    dispatcher.increase_balance(100);\n    let y = x;\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 100, 'balance == 100');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/syntax/.cairofmtignore",
    "content": "tests/\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/syntax/Scarb.toml",
    "content": "[package]\nname = \"syntax\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.9.3\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/syntax/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait IHelloStarknet<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n    fn do_a_panic(self: @TContractState);\n    fn do_a_panic_with(self: @TContractState, panic_data: Array<felt252>);\n}\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/syntax/tests/contract.cairo",
    "content": "use core::array::ArrayTrait;\nuse core::result::ResultTrait;\nuse syntax::{IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait};\nuse snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::{ContractClassTrait, declare};\n\n#[test]\n#[fuzzer]\n#[fork(url: \"http://127.0.0.1:3030\", block_tag: latest)]\n#[ignore]\nfn call_and_invoke(_a: felt252, b: u256) {\n    let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n    let constructor_calldata = @ArrayTrait::new();\n    let (contract_address, _) = contract.deploy(constructor_calldata),unwrap();\n    let dispatcher = IHelloStarknetDispatcher { contract_address };\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 0, 'balance == 0');\n\n    dispatcher.increase_balance(100);\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 100, 'balance == 100');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/test_case_attr/.cairofmtignore",
    "content": "tests/\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/test_case_attr/Scarb.toml",
    "content": "[package]\nname = \"test_case_attr\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.9.3\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/test_case_attr/src/lib.cairo",
    "content": "\n"
  },
  {
    "path": "crates/forge/tests/data/diagnostics/test_case_attr/tests/basic.cairo",
    "content": "#[test]\n#[test_case(3, 4, 7)]\nfn function_without_params() {\n    let _x = 10;\n}\n\n#[test]\n#[test_case(3, 4, 7)]\nfn function_with_invalid_params_count(x: felt252, y: felt252) {\n    let _x = 10;\n}\n\n#[test]\n#[test_case(name: array![1, 2, 3], 3, 4, 7)]\nfn invalid_name_arg(x: felt252, y: felt252, expected: felt252) {\n    let _x = 10;\n}\n"
  },
  {
    "path": "crates/forge/tests/data/dispatchers/Scarb.toml",
    "content": "[package]\nname = \"dispatchers\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html\n\n[dependencies]\nstarknet = \"2.9.4\"\nassert_macros = \"2.9.4\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n\n[profile.dev.cairo]\nunstable-add-statements-functions-debug-info = true\nunstable-add-statements-code-locations-debug-info = true\npanic-backtrace = true\n"
  },
  {
    "path": "crates/forge/tests/data/dispatchers/src/error_handler.cairo",
    "content": "#[starknet::interface]\npub trait IErrorHandler<TContractState> {\n    fn catch_panic_and_handle(self: @TContractState);\n    fn catch_panic_and_fail(self: @TContractState);\n    fn call_unrecoverable(self: @TContractState);\n}\n\n#[feature(\"safe_dispatcher\")]\n#[starknet::contract]\npub mod ErrorHandler {\n    use core::panic_with_felt252;\n    use starknet::ContractAddress;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n    use crate::failable::{IFailableContractSafeDispatcher, IFailableContractSafeDispatcherTrait};\n\n    #[storage]\n    pub struct Storage {\n        failable_address: ContractAddress,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState, failable_address: ContractAddress) {\n        self.failable_address.write(failable_address);\n    }\n\n\n    #[abi(embed_v0)]\n    impl ErrorHandler of super::IErrorHandler<ContractState> {\n        fn catch_panic_and_handle(self: @ContractState) {\n            let dispatcher = get_safe_dispatcher(self);\n\n            match dispatcher.recoverable_panic() {\n                Result::Ok(_) => panic_with_felt252('Expected panic'),\n                Result::Err(panic_data) => {\n                    assert(*panic_data.at(0) == 'Errare humanum est', 'Incorrect error');\n                    assert(*panic_data.at(1) == 'ENTRYPOINT_FAILED', 'Missing generic error');\n                    assert(panic_data.len() == 2, 'Incorrect error length');\n                },\n            }\n        }\n\n        fn catch_panic_and_fail(self: @ContractState) {\n            let dispatcher = get_safe_dispatcher(self);\n\n            match dispatcher.recoverable_panic() {\n                Result::Ok(_) => panic_with_felt252('Expected panic'),\n                Result::Err(panic_data) => {\n                    assert(*panic_data.at(0) == 'Errare humanum est', 'Incorrect error');\n                    assert(*panic_data.at(1) == 'ENTRYPOINT_FAILED', 'Missing generic error');\n                    assert(panic_data.len() == 2, 'Incorrect error length');\n                },\n            }\n\n            panic_with_felt252('Different panic');\n        }\n\n        fn call_unrecoverable(self: @ContractState) {\n            let dispatcher = get_safe_dispatcher(self);\n            // Unreachable\n\n            if let Result::Ok(_) = dispatcher.unrecoverable_error() {\n                {}\n            }\n        }\n    }\n\n    fn get_safe_dispatcher(self: @ContractState) -> IFailableContractSafeDispatcher {\n        IFailableContractSafeDispatcher { contract_address: self.failable_address.read() }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/dispatchers/src/failable.cairo",
    "content": "#[starknet::interface]\npub trait IFailableContract<TContractState> {\n    fn recoverable_panic(self: @TContractState);\n    fn unrecoverable_error(self: @TContractState);\n}\n\n#[starknet::contract]\npub mod FailableContract {\n    use starknet::SyscallResultTrait;\n    #[storage]\n    pub struct Storage {}\n\n    #[abi(embed_v0)]\n    impl FailableContract of super::IFailableContract<ContractState> {\n        fn recoverable_panic(self: @ContractState) {\n            core::panic_with_felt252('Errare humanum est');\n        }\n\n        fn unrecoverable_error(self: @ContractState) {\n            // Call syscall with nonexistent address should fail immediately\n            starknet::syscalls::call_contract_syscall(\n                0x123.try_into().unwrap(), 0x1, array![].span(),\n            )\n                .unwrap_syscall();\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/dispatchers/src/lib.cairo",
    "content": "pub mod error_handler;\n\npub mod failable;\n"
  },
  {
    "path": "crates/forge/tests/data/dispatchers/tests/test.cairo",
    "content": "use dispatchers::error_handler::{\n    IErrorHandlerDispatcher, IErrorHandlerDispatcherTrait, IErrorHandlerSafeDispatcher,\n    IErrorHandlerSafeDispatcherTrait,\n};\nuse snforge_std::{ContractClassTrait, DeclareResultTrait, declare};\nuse starknet::ContractAddress;\n\nfn deploy_contracts() -> ContractAddress {\n    let failable = declare(\"FailableContract\").unwrap().contract_class();\n    let (failable_address, _) = failable.deploy(@array![]).unwrap();\n\n    let error_handler = declare(\"ErrorHandler\").unwrap().contract_class();\n    let (contract_address, _) = error_handler.deploy(@array![failable_address.into()]).unwrap();\n    contract_address\n}\n\n\n#[test]\nfn test_error_handled_in_contract() {\n    let contract_address = deploy_contracts();\n\n    let dispatcher = IErrorHandlerDispatcher { contract_address };\n\n    dispatcher.catch_panic_and_handle();\n}\n\n#[should_panic(expected: 'Different panic')]\n#[test]\nfn test_handle_and_panic() {\n    let contract_address = deploy_contracts();\n\n    let dispatcher = IErrorHandlerDispatcher { contract_address };\n\n    dispatcher.catch_panic_and_fail();\n}\n\n#[feature(\"safe_dispatcher\")]\n#[test]\nfn test_handle_recoverable_in_test() {\n    let contract_address = deploy_contracts();\n\n    let dispatcher = IErrorHandlerSafeDispatcher { contract_address };\n\n    match dispatcher.catch_panic_and_fail() {\n        Result::Ok(_) => core::panic_with_felt252('Expected panic'),\n        Result::Err(panic_data) => {\n            assert(*panic_data.at(0) == 'Different panic', 'Incorrect error');\n            assert(*panic_data.at(1) == 'ENTRYPOINT_FAILED', 'Missing generic error');\n            assert(panic_data.len() == 2, 'Incorrect error length');\n        },\n    }\n}\n\n#[feature(\"safe_dispatcher\")]\n#[test]\nfn test_unrecoverable_not_possible_to_handle() {\n    let contract_address = deploy_contracts();\n\n    let dispatcher = IErrorHandlerSafeDispatcher { contract_address };\n\n    match dispatcher.call_unrecoverable() {\n        // Unreachable\n        Result::Ok(_) => {},\n        Result::Err(_) => {},\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/duplicated_test_names/Scarb.toml",
    "content": "[package]\nname = \"duplicated_test_names\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "crates/forge/tests/data/duplicated_test_names/src/lib.cairo",
    "content": "\n"
  },
  {
    "path": "crates/forge/tests/data/duplicated_test_names/tests/tests_a.cairo",
    "content": "#[test]\nfn test_simple() {\n    assert(1 == 1, 'simple check');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/duplicated_test_names/tests/tests_b.cairo",
    "content": "#[test]\nfn test_simple() {\n    assert(1 == 1, 'simple check');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/empty/Scarb.toml",
    "content": "[package]\nname = \"empty\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html\n\n[dependencies]\nstarknet = \"2.4.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[profile.custom-profile]\ninherits = \"release\"\n\n[profile.custom-profile.cairo]\nsierra-replace-ids = true\n"
  },
  {
    "path": "crates/forge/tests/data/empty/src/lib.cairo",
    "content": "\n"
  },
  {
    "path": "crates/forge/tests/data/env/Scarb.toml",
    "content": "[package]\nname = \"env\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n"
  },
  {
    "path": "crates/forge/tests/data/env/src/lib.cairo",
    "content": "#[cfg(test)]\nmod tests {\n    use snforge_std::env::var;\n\n    #[test]\n    fn reading_env_vars() {\n        let felt252_value = var(\"FELT_ENV_VAR\");\n        let short_string_value = var(\"STRING_ENV_VAR\");\n        let mut byte_array_value = var(\"BYTE_ARRAY_ENV_VAR\").span();\n\n        assert(felt252_value == array![987654321], 'invalid felt value');\n        assert(short_string_value == array!['abcde'], 'invalid short string value');\n\n        let byte_array = Serde::<ByteArray>::deserialize(ref byte_array_value).unwrap();\n        assert(\n            byte_array == \"that is a very long environment variable that would normally not fit\",\n            'Invalid ByteArray value',\n        )\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/erc20_package/Scarb.toml",
    "content": "[package]\nname = \"erc20_package\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.4.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[tool.snforge]\nexit_first = false\n"
  },
  {
    "path": "crates/forge/tests/data/erc20_package/src/erc20.cairo",
    "content": "use starknet::ContractAddress;\n\n#[starknet::interface]\npub trait IERC20<TContractState> {\n    fn get_name(self: @TContractState) -> felt252;\n    fn get_symbol(self: @TContractState) -> felt252;\n    fn get_decimals(self: @TContractState) -> u8;\n    fn get_total_supply(self: @TContractState) -> u256;\n    fn balance_of(self: @TContractState, account: ContractAddress) -> u256;\n    fn allowance(self: @TContractState, owner: ContractAddress, spender: ContractAddress) -> u256;\n    fn transfer(ref self: TContractState, recipient: ContractAddress, amount: u256);\n    fn transfer_from(\n        ref self: TContractState, sender: ContractAddress, recipient: ContractAddress, amount: u256,\n    );\n    fn approve(ref self: TContractState, spender: ContractAddress, amount: u256);\n    fn increase_allowance(ref self: TContractState, spender: ContractAddress, added_value: u256);\n    fn decrease_allowance(\n        ref self: TContractState, spender: ContractAddress, subtracted_value: u256,\n    );\n}\n\n#[starknet::contract]\npub mod ERC20 {\n    use core::num::traits::zero::Zero;\n    use starknet::storage::{\n        Map, StoragePathEntry, StoragePointerReadAccess, StoragePointerWriteAccess,\n    };\n    use starknet::{ContractAddress, contract_address_const, get_caller_address};\n    #[storage]\n    pub struct Storage {\n        name: felt252,\n        symbol: felt252,\n        decimals: u8,\n        total_supply: u256,\n        balances: Map<ContractAddress, u256>,\n        allowances: Map<(ContractAddress, ContractAddress), u256>,\n    }\n\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    enum Event {\n        Transfer: Transfer,\n        Approval: Approval,\n    }\n    #[derive(Drop, starknet::Event)]\n    struct Transfer {\n        from: ContractAddress,\n        to: ContractAddress,\n        value: u256,\n    }\n    #[derive(Drop, starknet::Event)]\n    struct Approval {\n        owner: ContractAddress,\n        spender: ContractAddress,\n        value: u256,\n    }\n\n    #[constructor]\n    fn constructor(\n        ref self: ContractState,\n        name_: felt252,\n        symbol_: felt252,\n        decimals_: u8,\n        initial_supply: u256,\n        recipient: ContractAddress,\n    ) {\n        self.name.write(name_);\n        self.symbol.write(symbol_);\n        self.decimals.write(decimals_);\n        assert(!recipient.is_zero(), 'ERC20: mint to the 0 address');\n        self.total_supply.write(initial_supply);\n        self.balances.entry(recipient).write(initial_supply);\n        self\n            .emit(\n                Event::Transfer(\n                    Transfer {\n                        from: contract_address_const::<0>(), to: recipient, value: initial_supply,\n                    },\n                ),\n            );\n    }\n\n    #[abi(embed_v0)]\n    pub impl IERC20Impl of super::IERC20<ContractState> {\n        fn get_name(self: @ContractState) -> felt252 {\n            self.name.read()\n        }\n\n        fn get_symbol(self: @ContractState) -> felt252 {\n            self.symbol.read()\n        }\n\n        fn get_decimals(self: @ContractState) -> u8 {\n            self.decimals.read()\n        }\n\n        fn get_total_supply(self: @ContractState) -> u256 {\n            self.total_supply.read()\n        }\n\n        fn balance_of(self: @ContractState, account: ContractAddress) -> u256 {\n            self.balances.entry(account).read()\n        }\n\n        fn allowance(\n            self: @ContractState, owner: ContractAddress, spender: ContractAddress,\n        ) -> u256 {\n            self.allowances.entry((owner, spender)).read()\n        }\n\n        fn transfer(ref self: ContractState, recipient: ContractAddress, amount: u256) {\n            let sender = get_caller_address();\n            self.transfer_helper(sender, recipient, amount);\n        }\n\n        fn transfer_from(\n            ref self: ContractState,\n            sender: ContractAddress,\n            recipient: ContractAddress,\n            amount: u256,\n        ) {\n            let caller = get_caller_address();\n            self.spend_allowance(sender, caller, amount);\n            self.transfer_helper(sender, recipient, amount);\n        }\n\n        fn approve(ref self: ContractState, spender: ContractAddress, amount: u256) {\n            let caller = get_caller_address();\n            self.approve_helper(caller, spender, amount);\n        }\n\n        fn increase_allowance(\n            ref self: ContractState, spender: ContractAddress, added_value: u256,\n        ) {\n            let caller = get_caller_address();\n            self\n                .approve_helper(\n                    caller, spender, self.allowances.entry((caller, spender)).read() + added_value,\n                );\n        }\n\n        fn decrease_allowance(\n            ref self: ContractState, spender: ContractAddress, subtracted_value: u256,\n        ) {\n            let caller = get_caller_address();\n            self\n                .approve_helper(\n                    caller,\n                    spender,\n                    self.allowances.entry((caller, spender)).read() - subtracted_value,\n                );\n        }\n    }\n\n    #[generate_trait]\n    impl StorageImpl of StorageTrait {\n        fn transfer_helper(\n            ref self: ContractState,\n            sender: ContractAddress,\n            recipient: ContractAddress,\n            amount: u256,\n        ) {\n            assert(!sender.is_zero(), 'ERC20: transfer from 0');\n            assert(!recipient.is_zero(), 'ERC20: transfer to 0');\n            self.balances.entry(sender).write(self.balances.entry(sender).read() - amount);\n            self.balances.entry(recipient).write(self.balances.entry(recipient).read() + amount);\n            self.emit(Event::Transfer(Transfer { from: sender, to: recipient, value: amount }));\n        }\n\n        fn spend_allowance(\n            ref self: ContractState, owner: ContractAddress, spender: ContractAddress, amount: u256,\n        ) {\n            let current_allowance = self.allowances.entry((owner, spender)).read();\n            let ONES_MASK = 0xffffffffffffffffffffffffffffffff_u128;\n            let is_unlimited_allowance = current_allowance.low == ONES_MASK\n                && current_allowance.high == ONES_MASK;\n            if !is_unlimited_allowance {\n                self.approve_helper(owner, spender, current_allowance - amount);\n            }\n        }\n\n        fn approve_helper(\n            ref self: ContractState, owner: ContractAddress, spender: ContractAddress, amount: u256,\n        ) {\n            assert(!spender.is_zero(), 'ERC20: approve from 0');\n            self.allowances.entry((owner, spender)).write(amount);\n            self.emit(Event::Approval(Approval { owner, spender, value: amount }));\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/erc20_package/src/lib.cairo",
    "content": "pub mod erc20;\n"
  },
  {
    "path": "crates/forge/tests/data/erc20_package/tests/test_complex.cairo",
    "content": "use erc20_package::erc20::{IERC20Dispatcher, IERC20DispatcherTrait};\nuse snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::{\n    ContractClassTrait, declare, start_cheat_caller_address, stop_cheat_caller_address,\n    test_address,\n};\nuse starknet::ContractAddress;\n\nconst NAME: felt252 = 'TOKEN';\nconst SYMBOL: felt252 = 'TKN';\nconst DECIMALS: u8 = 2;\nconst INITIAL_SUPPLY: u256 = 10;\n\nfn deploy_erc20(\n    name: felt252, symbol: felt252, decimals: u8, initial_supply: u256, recipient: ContractAddress,\n) -> ContractAddress {\n    let contract = declare(\"ERC20\").unwrap().contract_class();\n\n    let mut constructor_calldata: Array<felt252> = array![name, symbol, decimals.into()];\n\n    let mut initial_supply_serialized = array![];\n    initial_supply.serialize(ref initial_supply_serialized);\n\n    constructor_calldata.append_span(initial_supply_serialized.span());\n    constructor_calldata.append(recipient.into());\n\n    let (address, _) = contract.deploy(@constructor_calldata).unwrap();\n    address\n}\n\n// Syscalls from constructor are not counted\n// StorageRead: 22, StorageWrite: 12, EmitEvent: 4, GetExecutionInfo: 3\n#[test]\nfn complex() {\n    let erc20_address = deploy_erc20(NAME, SYMBOL, DECIMALS, INITIAL_SUPPLY, test_address());\n    let dispatcher = IERC20Dispatcher { contract_address: erc20_address };\n\n    let spender: ContractAddress = 123.try_into().unwrap();\n\n    // GetExecutionInfo: 1, StorageRead: 4, StorageWrite: 4, EmitEvent: 1\n    dispatcher.transfer(spender, 2.into());\n\n    // StorageRead: 2\n    let spender_balance = dispatcher.balance_of(spender);\n    assert(spender_balance == 2, 'invalid spender balance');\n\n    start_cheat_caller_address(erc20_address, spender);\n\n    // GetExecutionInfo: 1, StorageRead: 2, StorageWrite: 2, EmitEvent: 1\n    dispatcher.increase_allowance(test_address(), 2);\n\n    // StorageRead: 2\n    let allowance = dispatcher.allowance(spender, test_address());\n    assert(allowance == 2, 'invalid allowance');\n\n    stop_cheat_caller_address(erc20_address);\n\n    // GetExecutionInfo: 1, StorageRead: 6, StorageWrite: 6, EmitEvent: 2\n    dispatcher.transfer_from(spender, test_address(), 2);\n\n    // StorageRead: 2\n    let allowance = dispatcher.allowance(spender, test_address());\n    assert(allowance == 0, 'invalid allowance');\n\n    // StorageRead: 2\n    let spender_balance = dispatcher.balance_of(spender);\n    assert(spender_balance == 0, 'invalid spender balance');\n\n    // StorageRead: 2\n    let balance = dispatcher.balance_of(test_address());\n    assert(balance == INITIAL_SUPPLY, 'invalid balance');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/exit_first/Scarb.toml",
    "content": "[package]\nname = \"exit_first\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.4.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n"
  },
  {
    "path": "crates/forge/tests/data/exit_first/src/lib.cairo",
    "content": "pub fn fib(a: felt252, b: felt252, n: felt252) -> felt252 {\n    match n {\n        0 => a,\n        _ => fib(b, a + b, n - 1),\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/exit_first/tests/ext_function_test.cairo",
    "content": "use exit_first::fib;\n\n#[test]\nfn hard_test() {\n    fib(0, 1, 99999999999999999999999);\n    assert(2 == 2, 'simple check');\n}\n\n#[test]\nfn simple_test() {\n    fib(0, 1, 3);\n    assert(1 == 2, 'simple check');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/features/Scarb.toml",
    "content": "[package]\nname = \"features\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.4.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\n\n[features]\nsnforge_test_only = []\n"
  },
  {
    "path": "crates/forge/tests/data/features/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait IContract<TContractState> {\n    fn response(ref self: TContractState) -> felt252;\n}\n\n#[cfg(feature: 'snforge_test_only')]\n#[starknet::contract]\npub mod MockContract {\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl IContractImpl of super::IContract<ContractState> {\n        fn response(ref self: ContractState) -> felt252 {\n            super::some_func()\n        }\n    }\n}\n\nfn some_func() -> felt252 {\n    1234\n}\n"
  },
  {
    "path": "crates/forge/tests/data/features/tests/test.cairo",
    "content": "use features::{IContractDispatcher, IContractDispatcherTrait};\nuse snforge_std::{ContractClassTrait, DeclareResultTrait, declare};\n\n#[cfg(feature: 'snforge_test_only')]\nfn mock_in_tests() -> felt252 {\n    999\n}\n\n#[test]\nfn test_mock_function() {\n    assert(mock_in_tests() == 999, '');\n}\n\n#[test]\nfn test_mock_contract() {\n    let (contract_address, _) = declare(\"MockContract\")\n        .unwrap()\n        .contract_class()\n        .deploy(@array![])\n        .unwrap();\n    let response_result = IContractDispatcher { contract_address }.response();\n    assert(response_result == 1234, '');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/file_reading/.cairofmtignore",
    "content": "tests/test.cairo"
  },
  {
    "path": "crates/forge/tests/data/file_reading/Scarb.toml",
    "content": "[package]\nname = \"file_reading\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[[target.starknet-contract]]\nsierra = true\n\n[dependencies]\nstarknet = \"2.4.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n"
  },
  {
    "path": "crates/forge/tests/data/file_reading/data/json/invalid.json",
    "content": "231232\n"
  },
  {
    "path": "crates/forge/tests/data/file_reading/data/json/nested_valid.json",
    "content": "{\n    \"b\": {\n        \"d\": 1,\n        \"c\": \"test\",\n        \"e\": {\n            \"a\": 2\n        }\n    },\n    \"a\": 23\n}\n"
  },
  {
    "path": "crates/forge/tests/data/file_reading/data/json/valid.json",
    "content": "{\n    \"b\": \"hello\",\n    \"a\": 1,\n    \"c\": 3,\n    \"d\": 1656,\n    \"e\": \"      \",\n    \"f\": \"hello\\nworld\",\n    \"g\": \"world\",\n    \"h\": 0,\n    \"i\": 3618502788666131213697322783095070105623107215331596699973092056135872020480\n}\n"
  },
  {
    "path": "crates/forge/tests/data/file_reading/data/json/with_array.json",
    "content": "{\n    \"aa\": 2,\n    \"array\": [1, 23, 4, 5],\n    \"string_array\": [\"test\", \"test2\"]\n}\n"
  },
  {
    "path": "crates/forge/tests/data/file_reading/data/negative_number.txt",
    "content": "-1241241"
  },
  {
    "path": "crates/forge/tests/data/file_reading/data/non_ascii.txt",
    "content": "a\n£\n§"
  },
  {
    "path": "crates/forge/tests/data/file_reading/data/valid.txt",
    "content": "1\n'hello'\n3\n\n0x678\n\n'      '\n\n\n'hello\\nworld'\n'world'\n\n\n0\n3618502788666131213697322783095070105623107215331596699973092056135872020480\n\n"
  },
  {
    "path": "crates/forge/tests/data/file_reading/src/lib.cairo",
    "content": "\n"
  },
  {
    "path": "crates/forge/tests/data/file_reading/tests/test.cairo",
    "content": "use core::array::ArrayTrait;\nuse core::option::OptionTrait;\nuse core::serde::Serde;\nuse snforge_std::fs::{FileParser, FileTrait, read_json, read_txt};\n\nfn compare_with_expected_content(content: Array<felt252>) {\n    let expected = array![\n        1, 'hello', 3, 0x678, '      ', 'hello\nworld', 'world', 0,\n        3618502788666131213697322783095070105623107215331596699973092056135872020480,\n    ];\n\n    assert(content.len() == expected.len(), 'lengths not equal');\n    let mut i = 0;\n    while i != content.len() {\n        assert(*content[i] == *expected[i], 'unexpected content');\n        i += 1;\n    };\n}\nfn compare_with_expected_content_json(content: Array<felt252>) {\n    let hello: ByteArray = \"hello\";\n    let hello_world: ByteArray = \"hello\nworld\";\n    let world: ByteArray = \"world\";\n    let spaces: ByteArray = \"      \";\n\n    let mut expected = array![1];\n\n    hello.serialize(ref expected);\n\n    expected.append(3);\n    expected.append(0x678);\n\n    spaces.serialize(ref expected);\n\n    hello_world.serialize(ref expected);\n    world.serialize(ref expected);\n\n    expected.append(0);\n    expected.append(3618502788666131213697322783095070105623107215331596699973092056135872020480);\n\n    assert(content.len() == expected.len(), 'lengths not equal');\n\n    let mut i = 0;\n    while i != content.len() {\n        assert(*content[i] == *expected[i], 'unexpected content');\n        i += 1;\n    };\n}\n\n#[derive(Serde, Drop, PartialEq)]\nstruct A {\n    a: u32,\n    nested_b: B,\n    nested_d: D,\n    f: felt252,\n}\n\n#[derive(Serde, Drop, PartialEq)]\nstruct B {\n    nested_c: C,\n    hex: felt252,\n    spaces: felt252,\n    multiline: felt252,\n}\n\n#[derive(Serde, Drop, PartialEq)]\nstruct C {\n    c: u256,\n}\n\n#[derive(Serde, Drop, PartialEq)]\nstruct D {\n    d: u64,\n    e: u8,\n}\n#[derive(Serde, Drop, PartialEq)]\nstruct E {\n    a: felt252,\n    b: F,\n}\n#[derive(Serde, Drop, PartialEq)]\nstruct F {\n    c: ByteArray,\n    d: u8,\n    e: G,\n}\n#[derive(Serde, Drop, PartialEq)]\nstruct G {\n    c: felt252,\n}\n\n#[derive(Serde, Destruct, Drop)]\nstruct Test {\n    a: u8,\n    array: Array<u32>,\n    string_array: Array<ByteArray>,\n}\n\n#[test]\nfn json_serialization() {\n    let file = FileTrait::new(\"data/json/valid.json\");\n    let content = read_json(@file);\n    compare_with_expected_content_json(content);\n}\n\n#[test]\nfn invalid_json() {\n    let file = FileTrait::new(\"data/json/invalid.json\");\n    read_json(@file);\n    assert(1 == 1, '');\n}\n\n#[test]\nfn json_with_array() {\n    let file = FileTrait::new(\"data/json/with_array.json\");\n    let content = FileParser::<Test>::parse_json(@file).unwrap();\n\n    let string_array = array![\"test\", \"test2\"];\n\n    assert(*content.array[0] == 1, '1');\n    assert(*content.array[1] == 23, '23');\n    assert(content.string_array == string_array, 'string_array');\n}\n\n#[test]\nfn json_deserialization() {\n    let file = FileTrait::new(\"data/json/nested_valid.json\");\n    let content = FileParser::<E>::parse_json(@file).unwrap();\n\n    let mut output_array = ArrayTrait::new();\n    content.serialize(ref output_array);\n    assert(content.a == 23, '');\n    assert(content.b.c == \"test\", '');\n    assert(content.b.e.c == 2, '');\n}\n\n#[test]\nfn json_non_existent() {\n    let file = FileTrait::new(\"data/non_existent.json\");\n    read_json(@file);\n    assert(1 == 1, '');\n}\n\n\n#[test]\nfn valid_content_and_same_content_no_matter_newlines() {\n    let file = FileTrait::new(\"data/valid.txt\");\n    let content = FileParser::<A>::parse_txt(@file).unwrap();\n    let expected = A {\n        a: 1,\n        nested_b: B {\n            nested_c: C { c: u256 { low: 'hello', high: 3 } },\n            hex: 0x678,\n            spaces: '      ',\n            multiline: 'hello\\nworld',\n        },\n        nested_d: D { d: 'world', e: 0 },\n        f: 3618502788666131213697322783095070105623107215331596699973092056135872020480,\n    };\n    assert(content.f == expected.f, '')\n}\n\n#[test]\nfn serialization() {\n    let file = FileTrait::new(\"data/valid.txt\");\n    let content = read_txt(@file);\n    compare_with_expected_content(content);\n}\n\n#[test]\nfn valid_content_different_folder() {\n    let file = FileTrait::new(\"valid_file.txt\");\n    let content = read_txt(@file);\n    let expected = array!['123', '12dsfwe', 124];\n\n    assert(content.len() == expected.len(), 'lengths not equal');\n    let mut i = 0;\n    while i != content.len() {\n        assert(*content[i] == *expected[i], 'unexpected content');\n        i += 1;\n    };\n\n    assert(1 == 1, '');\n}\n\n#[test]\nfn non_existent() {\n    let file = FileTrait::new(\"data/non_existent.txt\");\n    read_txt(@file);\n    assert(1 == 1, '');\n}\n\n#[test]\nfn negative_number() {\n    let file = FileTrait::new(\"data/negative_number.txt\");\n    read_txt(@file);\n    assert(1 == 1, 'negative numbers not allowed');\n}\n\n#[test]\nfn non_ascii() {\n    let file = FileTrait::new(\"data/non_ascii.txt\");\n    read_txt(@file);\n    assert(1 == 1, '');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/file_reading/valid_file.txt",
    "content": "123\n'12dsfwe'\n00124\n"
  },
  {
    "path": "crates/forge/tests/data/forking/.gitignore",
    "content": "!.snfoundry_cache/\n!.snfoundry_cache/*\n"
  },
  {
    "path": "crates/forge/tests/data/forking/.snfoundry_cache/README.md",
    "content": "This is a fabricated cache file with value for storage changed from real `2` to fake `333`.\n\nIt is used to verify if the cache is actually used."
  },
  {
    "path": "crates/forge/tests/data/forking/.snfoundry_cache/http___188_34_188_184_7070_rpc_v0_10_54060_v0_59_0.json",
    "content": "{\"cache_version\":\"0_59_0\",\"storage_at\":{\"0x202de98471a4fae6bcbabb96cab00437d381abc58b02509043778074d6781e9\":{\"0x206f38f7e4f15e87567361213c28f235cccdaa1d7fd34c9db1dfe9489c6a091\":\"0x14d\"}},\"nonce_at\":{},\"class_hash_at\":{\"0x202de98471a4fae6bcbabb96cab00437d381abc58b02509043778074d6781e9\":\"0x6a7eb29ee38b0a0b198e39ed6ad458d2e460264b463351a0acfc05822d61550\"},\"compiled_contract_class\":{\"0x6a7eb29ee38b0a0b198e39ed6ad458d2e460264b463351a0acfc05822d61550\":{\"sierra_program\":[\"0x1\",\"0x3\",\"0x0\",\"0x2\",\"0x1\",\"0x0\",\"0xff\",\"0x1\",\"0x23\",\"0x52616e6765436865636b\",\"0x0\",\"0x4761734275696c74696e\",\"0x66656c74323532\",\"0x4172726179\",\"0x1\",\"0x2\",\"0x536e617073686f74\",\"0x3\",\"0x537472756374\",\"0x1baeba72e79e9db2587cf44fedb2f3700b2075a5e8e39a562584862c4b71f62\",\"0x4\",\"0x2ee1e2b1b89f8c495f200e4956278a4d47395fe262f27b52e5865c9524c08c3\",\"0x456e756d\",\"0x11c6d8087e00642489f92d2821ad6ebd6532ad1a3b6d12833da6d6810391511\",\"0x6\",\"0x753332\",\"0x53797374656d\",\"0x16a4c8d7c05909052238a862d8cc3e7975bf05a07b3a69c6b28951083a6d672\",\"0xa\",\"0x5\",\"0x9931c641b913035ae674b400b61a51476d506bbe8bba2ff8a6272790aba9e6\",\"0xc\",\"0xb\",\"0x4275696c74696e436f737473\",\"0x117f8dd6812873d3aeeacdfe88181a6eb024b50a122679c11870b3b47a1ec88\",\"0x5af52ee38c32146750e2728e3556e24468de85c9684e8215a6a54f774a0eb9\",\"0xf\",\"0x10\",\"0x3a44698eeaa62b837a805b0dfc46b2c1e4f013d3acf9b3c68ff14f08abc709\",\"0x11\",\"0x10203be321c62a7bd4c060d69539c1fbe065baa9e253c74d2cc48be163e259\",\"0x13\",\"0xcc5e86243f861d2d64b08c35db21013e773ac5cf10097946fe0011304886d5\",\"0x15\",\"0x17b6ecc31946835b0d9d92c2dd7a9c14f29af0371571ae74a1b228828b2242\",\"0x17\",\"0x34f9bd7c6cb2dd4263175964ad75f1ff1461ddc332fbfb274e0fb2a5d7ab968\",\"0x18\",\"0x426f78\",\"0x29d7d57c04a880978e7b3689f6218e507f3be17588744b58dc17762447ad0e7\",\"0x1a\",\"0x123a1e81adcc5bd99f099d588eab8cc3de808fcdce58bd37e7e866729f3bcec\",\"0x1c\",\"0x53746f726167654261736541646472657373\",\"0x53746f7261676541646472657373\",\"0x90d0203c41ad646d024845257a6eceb2f8b59b29ce7420dd518053d2edeedc\",\"0x101dc0399934cc08fa0d6f6f2daead4e4a38cabeea1c743e1fc28d2d6e58e99\",\"0x4e6f6e5a65726f\",\"0x85\",\"0x7265766f6b655f61705f747261636b696e67\",\"0x77697468647261775f676173\",\"0x6272616e63685f616c69676e\",\"0x73746f72655f74656d70\",\"0x66756e6374696f6e5f63616c6c\",\"0x656e756d5f6d61746368\",\"0x7\",\"0x7374727563745f6465636f6e737472756374\",\"0x61727261795f6c656e\",\"0x736e617073686f745f74616b65\",\"0x8\",\"0x64726f70\",\"0x7533325f636f6e7374\",\"0x72656e616d65\",\"0x7533325f6571\",\"0x9\",\"0x61727261795f6e6577\",\"0x66656c743235325f636f6e7374\",\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\",\"0x61727261795f617070656e64\",\"0x7374727563745f636f6e737472756374\",\"0x656e756d5f696e6974\",\"0xd\",\"0x6765745f6275696c74696e5f636f737473\",\"0xe\",\"0x77697468647261775f6761735f616c6c\",\"0x12\",\"0x4f7574206f6620676173\",\"0x496e70757420746f6f2073686f727420666f7220617267756d656e7473\",\"0x14\",\"0x16\",\"0x19\",\"0x61727261795f736e617073686f745f706f705f66726f6e74\",\"0x1b\",\"0x6a756d70\",\"0x756e626f78\",\"0x66656c743235325f616464\",\"0x1d\",\"0x50414e4943\",\"0x444159544148\",\"0x64697361626c655f61705f747261636b696e67\",\"0x73746f726167655f626173655f616464726573735f636f6e7374\",\"0x206f38f7e4f15e87567361213c28f235cccdaa1d7fd34c9db1dfe9489c6a091\",\"0x73746f726167655f616464726573735f66726f6d5f62617365\",\"0x1f\",\"0x73746f726167655f726561645f73797363616c6c\",\"0x20\",\"0x73746f726167655f77726974655f73797363616c6c\",\"0x21\",\"0x647570\",\"0x66656c743235325f69735f7a65726f\",\"0x22\",\"0x66656c743235325f737562\",\"0x2fe\",\"0xffffffffffffffff\",\"0x63\",\"0x54\",\"0x24\",\"0x1e\",\"0x25\",\"0x46\",\"0x26\",\"0x27\",\"0x28\",\"0x29\",\"0x2d\",\"0x2e\",\"0x2f\",\"0x30\",\"0x2a\",\"0x2b\",\"0x2c\",\"0x31\",\"0x3f\",\"0x32\",\"0x33\",\"0x34\",\"0x35\",\"0x36\",\"0x37\",\"0x38\",\"0x39\",\"0x3a\",\"0x3b\",\"0x3c\",\"0x3d\",\"0x3e\",\"0x40\",\"0x41\",\"0x42\",\"0x43\",\"0x44\",\"0x45\",\"0x47\",\"0x48\",\"0x49\",\"0x4a\",\"0x4b\",\"0x4c\",\"0x4d\",\"0x4e\",\"0x4f\",\"0x50\",\"0x51\",\"0x52\",\"0x53\",\"0x55\",\"0x56\",\"0x57\",\"0x58\",\"0x59\",\"0x5a\",\"0x5b\",\"0x5c\",\"0x5d\",\"0x5e\",\"0x5f\",\"0xc6\",\"0x90\",\"0xb9\",\"0xb2\",\"0x121\",\"0xf3\",\"0x114\",\"0x10d\",\"0x19d\",\"0x196\",\"0x187\",\"0x157\",\"0x179\",\"0x172\",\"0x60\",\"0x61\",\"0x62\",\"0x64\",\"0x65\",\"0x66\",\"0x67\",\"0x68\",\"0x69\",\"0x1b2\",\"0x1b7\",\"0x1c1\",\"0x1ed\",\"0x1e7\",\"0x203\",\"0x224\",\"0x229\",\"0x245\",\"0x23f\",\"0x6a\",\"0x262\",\"0x6b\",\"0x6c\",\"0x267\",\"0x6d\",\"0x6e\",\"0x6f\",\"0x272\",\"0x70\",\"0x287\",\"0x71\",\"0x72\",\"0x28c\",\"0x73\",\"0x74\",\"0x75\",\"0x297\",\"0x76\",\"0x77\",\"0x78\",\"0x79\",\"0x7a\",\"0x2d7\",\"0x7b\",\"0x7c\",\"0x2af\",\"0x7d\",\"0x7e\",\"0x2cd\",\"0x7f\",\"0x80\",\"0x2c7\",\"0x81\",\"0x2ec\",\"0x82\",\"0x2f8\",\"0x83\",\"0x84\",\"0xd4\",\"0x12f\",\"0x1ab\",\"0x1c8\",\"0x1cc\",\"0x1f5\",\"0x209\",\"0x20f\",\"0x21c\",\"0x24f\",\"0x255\",\"0x278\",\"0x29e\",\"0x2e6\",\"0x2f2\",\"0x1ae7\",\"0x7060f02090e0d02060a0c060b02070a090606080706060502040203020100\",\"0x617061602090e15060d02070a090614060d02090a1302060a021202111006\",\"0x70a18061f061e02090e10061d060d02090a1c061b02070a1a02060a021918\",\"0x62402090e180623062202090e10060d02070a180621062002090e07060d02\",\"0x10062a062902090e07060628180627062602090e250615060d02090a100609\",\"0x2090e090607062f02090e022e022d18062c062b02090e10061c060d02090a\",\"0x60638020606360c0906371506063602350234023332070606310906100630\",\"0x2413d0606363d0606400207063f3d06063e3d06063c0706063b1506063a39\",\"0x606460706063645070644070606431006063e15090637420606360706063e\",\"0x24c4b060636024a4906063606060636060749060748180606471406064707\",\"0x6063e0906063c1f06063e4d060638100906371d0606361d0606471c060647\",\"0x1d06063c4f0706441506063e4e070644020749060748170606471506064709\",\"0x906373d090637090606360706063c2106063a50060638390906371d06063e\",\"0x65318090637250606382706063a52060638140906372306063e5106063842\",\"0x60638060754060748100606470255540606360c0606360207540607480706\",\"0x63a1006063606073906074839060636020739060748070606400706065654\",\"0x606472c06063a58060638490906370257170906371c0606361c06063c1d06\",\"0x20750060748210606471c06063e06074d0607484d06063602074d0607481f\",\"0x37025b510606360607510607485a0706445907064406075006074850060636\",\"0x65c06072506074806075206074852060636020752060748270606474b0906\",\"0x37610606400607610607486106063602076106074802605f060636025e5d07\",\"0x63a1d090637630606400607630607486306063602076306074802621c0906\",\"0x60748026507060664060758060748580606360207580607482c0606472306\",\"0x207510607482306064763060638610606380267060706446606063e020725\",\"0x90609020269060207023910076a150c076907060207060202690602020268\",\"0x66b18066907420610020c0669060c061502423d07690614060c0214066906\",\"0x1c0769064b0642024b06690649063d02490669063d06390202690602070217\",\"0x269064d061402214d0769061f0642021f0669060218020269061c0614021d\",\"0x69072350074b0250066906500649022306690621061702500669061d061702\",\"0x7690627061f022706690607061d0202690618061c02026906020702026c02\",\"0x2a0669062a0623022a0669060250025206690602210202690625064d022551\",\"0x69065806520258066906542c0727022c066906022502540669062a52075102\",\"0x66d0654026306690651061d026106690615062a025f0669060c0615026d06\",\"0x2000669060006580200066906022c020269060207026663615f0c06660669\",\"0x7206610272066906025f020269060207027170076f6e6c07690700150c096d\",\"0x6230276066906730663027506690607061d02740669066e062a0273066906\",\"0x77a0600026c0669066c0615027a7978096906777675740c66027706690618\",\"0x67e066e027e0669060221020269067b066c020269060207027d067c7b0669\",\"0x82067302820669068106720281066906800671020269067f067002807f0769\",\"0x654028606690679061d028506690678062a02840669066c06150283066906\",\"0x69066c061502880669067d065202026906020702878685840c068706690683\",\"0x8a7c890c068b066906880654028a06690679061d027c06690678062a028906\",\"0x623028d0669060278028c06690602210202690618061c020269060207028b\",\"0x26f0669068e8f0727028f0669060225028e0669068d8c0751028d0669068d\",\"0x9306690607061d029206690671062a029106690670061502900669066f0652\",\"0x3d06790202690617064d02026906020702949392910c069406690690065402\",\"0x69695075102960669069606230296066906027a0295066906022102026906\",\"0xc0615029a0669069906520299066906979807270298066906022502970669\",\"0x9b0c069d0669069a0654026b06690607061d029c06690615062a029b066906\",\"0x29f0669060278029e066906022102026906090679020269060207029d6b9c\",\"0x66906a0a1072702a1066906022502a00669069f9e0751029f0669069f0623\",\"0x690607061d02a506690639062a02a406690610061502a3066906a2065202a2\",\"0xc0769070602070602026906020202a7a6a5a40c06a7066906a3065402a606\",\"0x42064202420669063d063d023d06690609063902026906020702391007a815\",\"0x614024b490769061706420217066906021802026906140614021814076906\",\"0x615021c0669061c0649021d0669064b0617021c0669061806170202690649\",\"0x1f022106690607061d0202690602070202a90269071d1c074b020c0669060c\",\"0x6230223066906025002500669060221020269064d064d024d1f0769062106\",\"0x2270669065125072702250669060225025106690623500751022306690623\",\"0x2c0669061f061d025406690615062a022a0669060c06150252066906270652\",\"0x6d0658026d066906022c02026906020702582c542a0c065806690652065402\",\"0x66906025f02026906020702666307aa615f0769076d150c096d026d066906\",\"0x690661062a020269066e067502706e0769066c0674026c0669060006610200\",\"0x27372710969067a79780976027a066906700663027906690607061d027806\",\"0x6690674067b020269060207027506ab74066907730677025f0669065f0615\",\"0x669067d0623020269067b061c027d7b07690676067d027706690602210276\",\"0x67e066e020269067f064d027f7e0769068180077f028106690677067e0280\",\"0x85067302850669068406720284066906830671020269068206700283820769\",\"0x654028906690672061d028806690671062a02870669065f06150286066906\",\"0x69065f0615028a066906750652020269060207027c8988870c067c06690686\",\"0x8d8c8b0c068e0669068a0654028d06690672061d028c06690671062a028b06\",\"0x51026f0669066f0623026f0669060278028f0669060221020269060207028e\",\"0x930669069206520292066906909107270291066906022502900669066f8f07\",\"0x66906930654029606690607061d029506690666062a029406690663061502\",\"0x60278029806690602210202690609067902026906020702979695940c0697\",\"0x9b0727029b0669060225029a06690699980751029906690699062302990669\",\"0x1d029e06690639062a029d066906100615026b0669069c0652029c0669069a\",\"0x602070602026906020202a09f9e9d0c06a00669066b0654029f0669060706\",\"0x420669063d063d023d06690609063902026906020702391007ac150c076907\",\"0x49076906170642021706690602180202690614061402181407690642064202\",\"0x669061c0649021d0669064b0617021c06690618061702026906490614024b\",\"0x690607061d0202690602070202ad0269071d1c074b020c0669060c0615021c\",\"0x66906025002500669060221020269064d064d024d1f07690621061f022106\",\"0x6512507270225066906022502510669062350075102230669062306230223\",\"0x1f061d025406690615062a022a0669060c0615025206690627065202270669\",\"0x6d066906022c02026906020702582c542a0c0658066906520654022c066906\",\"0x5f02026906020702666307ae615f0769076d150c096d026d0669066d065802\",\"0x63020269066e067502706e0769066c0674026c066906000661020006690602\",\"0xaf73066907710681025f0669065f0615027106690672068002720669067006\",\"0x747a07690679066e0279066906022102026906730682020269060207027806\",\"0x7706690676067302760669067506720275066906740671020269067a067002\",\"0x66906770654027e06690607061d027d06690661062a027b0669065f061502\",\"0x2a02810669065f06150280066906780652020269060207027f7e7d7b0c067f\",\"0x20702848382810c0684066906800654028306690607061d02820669066106\",\"0x6868507510286066906860623028606690602780285066906022102026906\",\"0x630615027c0669068906520289066906878807270288066906022502870669\",\"0x8a0c068d0669067c0654028c06690607061d028b06690666062a028a066906\",\"0x28f0669060278028e066906022102026906090679020269060207028d8c8b\",\"0x669066f90072702900669060225026f0669068f8e0751028f0669068f0623\",\"0x690607061d029406690639062a029306690610061502920669069106520291\",\"0xc0769070602070602026906020202969594930c0696066906920654029506\",\"0x90609021706690615062a02180669060c061502026906020702391007b015\",\"0x60207021c06b14b0669071406840214423d09690649171809830249066906\",\"0x639020269060207022106b24d0669071f0686021f1d0769064b0685020269\",\"0x1802026906510614022551076906230642022306690650063d02500669061d\",\"0x17025406690625061702026906520614022a52076906270642022706690602\",\"0x202690602070202b30269072c54074b0254066906540649022c0669062a06\",\"0x20269066d064d026d580769065f061f025f06690607061d020269064d0670\",\"0x2660669066361075102630669066306230263066906025002610669060221\",\"0x700669063d0615026e0669066c0652026c0669066600072702000669060225\",\"0x2737271700c06730669066e0654027206690658061d027106690642062a02\",\"0x7a7907690778423d096d02780669067806580278066906022c020269060207\",\"0x690677067402770669067606610276066906025f02026906020702757407b4\",\"0x807f078702800669064d067e027f0669067d0663020269067b0675027d7b07\",\"0x82020269060207028206b5810669077e06810279066906790615027e066906\",\"0x6710202690684067002858407690683066e02830669060221020269068106\",\"0x2a028906690679061502880669068706730287066906860672028606690685\",\"0x207028b8a7c890c068b066906880654028a06690607061d027c0669067a06\",\"0x7061d028e0669067a062a028d066906790615028c06690682065202026906\",\"0x269064d0670020269060207026f8f8e8d0c066f0669068c0654028f066906\",\"0x92066906919007510291066906910623029106690602780290066906022102\",\"0x6690674061502950669069406520294066906929307270293066906022502\",\"0x999897960c0699066906950654029806690607061d029706690675062a0296\",\"0x6027a029a0669060221020269061d06790202690621064d02026906020702\",\"0x6b0727026b0669060225029c0669069b9a0751029b0669069b0623029b0669\",\"0x1d02a006690642062a029f0669063d0615029e0669069d0652029d0669069c\",\"0x61c065202026906020702a2a1a09f0c06a20669069e065402a10669060706\",\"0xa3065402a606690607061d02a506690642062a02a40669063d061502a30669\",\"0x2b606690602210202690609067902026906020702a7a6a5a40c06a7066906\",\"0x26a066906022502b8066906b7b6075102b7066906b7062302b70669060278\",\"0x6690639062a02bb06690610061502ba066906b9065202b9066906b86a0727\",\"0x606690602063902bebdbcbb0c06be066906ba065402bd06690607061d02bc\",\"0x607067c0215066906090689020269060207020c06bf090707690706068802\",\"0x23d066906028c0202690602070202c006028b023906690615068a02100669\",\"0x14066906100671023906690642068a02100669060c067c02420669063d068d\",\"0x690618068f020269060207021706c11806690739068e021406690614060902\",\"0x61c0691021d066906140609021c0669064b0690024b06690649066f024906\",\"0x4d0692024d066906028c0202690617064d020269060207021f1d07061f0669\",\"0x6066906028c02235007062306690621069102500669061406090221066906\",\"0x695020c066906070694020907070609066906060693020706690602061d02\",\"0x217066906100696021806690606061d021406690602062a0210150769060c\",\"0x67b020269060207024b06c24906690742067702423d390969061718140997\",\"0x2230669063d061d025006690639062a021d066906091c0798021c06690649\",\"0x69a02214d1f096906255123500c9902250669061d06230251066906150696\",\"0x202690654064d02542a07690627069b020269060207025206c32706690721\",\"0x5f0669066d066b026d066906582c079c0258066906028c022c0669062a0661\",\"0x7026663610906660669065f069d02630669064d061d02610669061f062a02\",\"0x69d026e0669064d061d026c0669061f062a020006690652069e0202690602\",\"0x202690609061c0202690615069f02026906020702706e6c09067006690600\",\"0x7806690671069d02730669063d061d027206690639062a02710669064b069e\",\"0x96023d06690606061d023906690602062a0209066906070694027873720906\",\"0x7021806c4140669071006770210150c096906423d39099702420669060906\",\"0x62a024b0669064906a102490669061706a0021706690614067b0202690602\",\"0x69060207021f1d1c09061f0669064b06a2021d06690615061d021c0669060c\",\"0x69064d06a2025006690615061d02210669060c062a024d0669061806a30202\",\"0xc066906028c020906690607060751020706690602066f0223502109062306\",\"0x60221020269060206750210150706100669060c0693021506690609067e02\",\"0x602a50209066906070607510207066906070623020706690602a402060669\",\"0x1007270210066906022502150669060c090751020c0669060c0623020c0669\",\"0x202690602b602420606420669063d06a7023d0669063906a6023906690615\",\"0x6906150689020269060207021006c5150c0769070906880209066906070639\",\"0x202690602070202c606028b024206690639068a023d0669060c067c023906\",\"0x24206690618068a023d06690610067c021806690614068d0214066906028c\",\"0x69060207024b06c74906690742068e021706690617060902170669063d0671\",\"0x66906020615021f0669060221021d0669061c066f021c06690649068f0202\",\"0x69061d062302270669061f067e0225066906170609025106690606062a0223\",\"0x60207025406c82a0669075006840250214d096906522725512315b7025206\",\"0x615025f0669066d066a026d066906582c07b802582c0769062a0685020269\",\"0x69060207026663610906660669065f06b9026306690621062a02610669064d\",\"0x69060006b9026e06690621062a026c0669064d061502000669065406ba0202\",\"0x7106bb0271066906028c020269064b064d02026906020702706e6c09067006\",\"0x2a0279066906020615027806690673066a0273066906721707b80272066906\",\"0x690602250202690602067502747a790906740669067806b9027a0669060606\",\"0x2150606150669060c06a7020c0669060906a6020906690606070727020706\",\"0x64902150669060218020c0669060906bd020906690602bc0202690607069f\",\"0x18144209ca3d39100969070c1506020cc9020c0669060c06be021506690615\",\"0x24b06690639061d024906690610062a02170669063d06cb02026906020702\",\"0x42062a021d0669061806ce0202690602070202cd06028b021c0669061706cc\",\"0x6d0024d0669061c06cf021c0669061d06cc024b06690614061d0249066906\",\"0x22306690621067b020269060207025006d1210669071f0677021f0669064d\",\"0x520669064b061d022706690649062a02250669065106a102510669062306a0\",\"0x49062a02540669065006a3020269060207022a522709062a0669062506a202\",\"0x6906070695026d582c09066d0669065406a202580669064b061d022c066906\",\"0x66906021802390669061006bd021006690602bc0202690615069f02150c07\",\"0xd3144207690709393d060215d202390669063906be023d0669063d0649023d\",\"0x690642062a021c0669064b06d4024b066906028c0202690602070249171809\",\"0x202690602070202d606028b024d0669061c06d5021f06690614061d021d06\",\"0x4d0669062106d5021f06690617061d021d06690618062a02210669064906d7\",\"0x60207022506da5106690750068102500669062306d902230669064d06d802\",\"0x1d062a022a0669065206dd0252066906270c07dc02270669065106db020269\",\"0x26906020702582c540906580669062a06de022c0669061f061d0254066906\",\"0x610669061f061d025f0669061d062a026d0669062506df020269060c069f02\",\"0x61506580215066906022c0202690602b60263615f0906630669066d06de02\",\"0x769060c06e102026906020702423d07e03910076907150602096d02150669\",\"0x60c061c020269060207021806e30269071406e2021006690610061502140c\",\"0x100615024b06690649066a0249066906170707b802170669060906e4020269\",\"0x269060207021f1d1c09061f0669064b06b9021d06690639062a021c066906\",\"0x6690721061002214d07690650060c0250066906070609020269061806e502\",\"0x270c07e8022706690602e7022506690623090751020269060207025106e623\",\"0x67e025f0669064d0609026d06690639062a02580669061006150252066906\",\"0x2c0684022c542a09690663615f6d5815b70263066906520623026106690625\",\"0x700669066e6c07b8026e6c076906660685020269060207020006e966066907\",\"0x669067106b9027306690654062a02720669062a0615027106690670066a02\",\"0x62a027a0669062a061502790669060006ba02026906020702787372090678\",\"0x269060c061c0202690602070275747a0906750669067906b9027406690654\",\"0x6690677066a0277066906764d07b802760669065106bb0202690609067002\",\"0x27f7e7d09067f0669067b06b9027e06690639062a027d066906100615027b\",\"0x690602210202690607067902026906090670020269060c061c020269060207\",\"0x69060225028206690681800751028106690681062302810669060278028006\",\"0x42062a02860669063d061502850669068406ba028406690682830727028306\",\"0x207020706eb060669070206ea028887860906880669068506b90287066906\",\"0x2150606150669060c06a2020c0669060906a102090669060606a002026906\",\"0xa2023d0669063906a302390669060710072702100669060225020269060207\",\"0x60606ee020269060207020706ed060669070206ec02420606420669063d06\",\"0x22502026906020702150606150669060c06a7020c0669060906ef02090669\",\"0x606420669063d06a7023d0669063906a60239066906071007270210066906\",\"0x9070602494206020c154206020c0209070602494206020c154206020c1f42\",\"0xf109070602494206020c154206020cf009070602494206020c154206020cd4\",\"0x420609f4090706024d420609071d42060cf3021042074206f2023915071506\",\"0x6020915060209f70251061d06f60602100907090707f5070602504206091d\",\"0x9071c42060cfa070602504206091c420609f906025106091d07f807060252\",\"0x6fd0250066106fc0c0907060252060209070915060215fb09070602584206\",\"0xfe02510663\"],\"contract_class_version\":\"0.1.0\",\"entry_points_by_type\":{\"CONSTRUCTOR\":[],\"EXTERNAL\":[{\"selector\":\"0x19c909057a1fa4e06e930f9418d432c08c64bd4bcd4be37d96beecaf3098412\",\"function_idx\":3},{\"selector\":\"0x362398bec32bc0ebb411203221a35a0301193a96f317ebe5e40be9f60d15320\",\"function_idx\":0},{\"selector\":\"0x39e11d48192e4333233c7eb19d10ad67c362bb28580c604d67884c85da39695\",\"function_idx\":1},{\"selector\":\"0x3c90fa28d76cca3d1f524541612bd9b88cc064457761e09c93d034edf542da4\",\"function_idx\":2}],\"L1_HANDLER\":[]},\"abi\":\"[{\\\"type\\\": \\\"impl\\\", \\\"name\\\": \\\"IHelloStarknetImpl\\\", \\\"interface_name\\\": \\\"hello_starknet: :hello_starknet: :IHelloStarknet\\\"}, {\\\"type\\\": \\\"interface\\\", \\\"name\\\": \\\"hello_starknet: :hello_starknet: :IHelloStarknet\\\", \\\"items\\\": [{\\\"type\\\": \\\"function\\\", \\\"name\\\": \\\"increase_balance\\\", \\\"inputs\\\": [{\\\"name\\\": \\\"amount\\\", \\\"type\\\": \\\"core: :felt252\\\"}], \\\"outputs\\\": [], \\\"state_mutability\\\": \\\"external\\\"}, {\\\"type\\\": \\\"function\\\", \\\"name\\\": \\\"get_balance\\\", \\\"inputs\\\": [], \\\"outputs\\\": [{\\\"type\\\": \\\"core: :felt252\\\"}], \\\"state_mutability\\\": \\\"view\\\"}, {\\\"type\\\": \\\"function\\\", \\\"name\\\": \\\"do_a_panic\\\", \\\"inputs\\\": [], \\\"outputs\\\": [], \\\"state_mutability\\\": \\\"view\\\"}, {\\\"type\\\": \\\"function\\\", \\\"name\\\": \\\"do_a_panic_with\\\", \\\"inputs\\\": [{\\\"name\\\": \\\"panic_data\\\", \\\"type\\\": \\\"core: :array: :Array: :<core: :felt252>\\\"}], \\\"outputs\\\": [], \\\"state_mutability\\\": \\\"view\\\"}]}, {\\\"type\\\": \\\"event\\\", \\\"name\\\": \\\"hello_starknet: :hello_starknet: :HelloStarknet: :Event\\\", \\\"kind\\\": \\\"enum\\\", \\\"variants\\\": []}]\"}},\"compiled_class_hash\":{}}"
  },
  {
    "path": "crates/forge/tests/data/forking/Scarb.toml",
    "content": "[package]\nname = \"forking\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html\n\n[dependencies]\nstarknet = \"2.4.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n"
  },
  {
    "path": "crates/forge/tests/data/forking/src/lib.cairo",
    "content": "#[cfg(test)]\nmod tests {\n    const CONTRACT_ADDRESS: felt252 =\n        0x202de98471a4fae6bcbabb96cab00437d381abc58b02509043778074d6781e9;\n\n    #[starknet::interface]\n    trait IHelloStarknet<TContractState> {\n        fn increase_balance(ref self: TContractState, amount: felt252);\n        fn get_balance(self: @TContractState) -> felt252;\n    }\n\n    #[test]\n    #[fork(url: \"{{ NODE_RPC_URL }}\", block_number: 54060)]\n    fn test_fork_simple() {\n        let dispatcher = IHelloStarknetDispatcher {\n            contract_address: CONTRACT_ADDRESS.try_into().unwrap(),\n        };\n\n        let balance = dispatcher.get_balance();\n        assert(balance == 0, 'Balance should be 0');\n\n        dispatcher.increase_balance(100);\n\n        let balance = dispatcher.get_balance();\n        assert(balance == 100, 'Balance should be 100');\n    }\n\n    #[test]\n    #[fork(url: \"{{ NODE_RPC_URL }}\", block_number: 0xd32c)]\n    fn test_fork_simple_number_hex() {\n        let dispatcher = IHelloStarknetDispatcher {\n            contract_address: CONTRACT_ADDRESS.try_into().unwrap(),\n        };\n\n        let balance = dispatcher.get_balance();\n        assert(balance == 0, 'Balance should be 0');\n\n        dispatcher.increase_balance(100);\n\n        let balance = dispatcher.get_balance();\n        assert(balance == 100, 'Balance should be 100');\n    }\n\n    #[test]\n    #[fork(\n        url: \"{{ NODE_RPC_URL }}\",\n        block_hash: 0x06ae121e46f5375f93b00475fb130348ae38148e121f84b0865e17542e9485de,\n    )]\n    fn test_fork_simple_hash_hex() {\n        let dispatcher = IHelloStarknetDispatcher {\n            contract_address: CONTRACT_ADDRESS.try_into().unwrap(),\n        };\n\n        let balance = dispatcher.get_balance();\n        assert(balance == 0, 'Balance should be 0');\n\n        dispatcher.increase_balance(100);\n\n        let balance = dispatcher.get_balance();\n        assert(balance == 100, 'Balance should be 100');\n    }\n\n    #[test]\n    #[fork(\n        url: \"{{ NODE_RPC_URL }}\",\n        block_hash: 3021433528476416000728121069095289682281028310523383289416465162415092565470,\n    )]\n    fn test_fork_simple_hash_number() {\n        let dispatcher = IHelloStarknetDispatcher {\n            contract_address: CONTRACT_ADDRESS.try_into().unwrap(),\n        };\n\n        let balance = dispatcher.get_balance();\n        assert(balance == 0, 'Balance should be 0');\n\n        dispatcher.increase_balance(100);\n\n        let balance = dispatcher.get_balance();\n        assert(balance == 100, 'Balance should be 100');\n    }\n\n    #[test]\n    #[fork(url: \"{{ NODE_RPC_URL }}\", block_tag: latest)]\n    fn print_block_number_when_latest() {\n        assert(1 == 1, '');\n    }\n\n    #[test]\n    #[fork(url: \"{{ NODE_RPC_URL }}\", block_number: 785646)]\n    fn test_track_resources() {\n        let dispatcher = IHelloStarknetDispatcher {\n            contract_address: CONTRACT_ADDRESS.try_into().unwrap(),\n        };\n        dispatcher.increase_balance(100);\n        let balance = dispatcher.get_balance();\n        assert(balance == 100, 'Balance should be 100');\n\n        // Default init contract compiled with Sierra version 1.7.0\n        let hello_starknet_updated: starknet::ContractAddress =\n            0x01aeb8ac66ebc01c7db8bb8123d3bbf1867be93604f57c540ad70056c04c4cc4\n            .try_into()\n            .unwrap();\n\n        let dispatcher = IHelloStarknetDispatcher { contract_address: hello_starknet_updated };\n        dispatcher.increase_balance(200);\n        let balance = dispatcher.get_balance();\n        assert(balance == 200, 'Balance should be 200');\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/fuzzing/.cairofmtignore",
    "content": "lib.cairo"
  },
  {
    "path": "crates/forge/tests/data/fuzzing/Scarb.toml",
    "content": "[package]\nname = \"fuzzing\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html\n\n[dependencies]\nstarknet = \"2.4.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n\n[features]\nunimplemented = []\n"
  },
  {
    "path": "crates/forge/tests/data/fuzzing/src/lib.cairo",
    "content": "pub fn adder(a: felt252, b: felt252) -> felt252 {\n    a + b\n}\n\npub fn always_five(a: felt252, b: felt252) -> felt252 {\n    5\n}\n\npub fn fib(a: felt252, b: felt252, n: felt252) -> felt252 {\n    match n {\n        0 => a,\n        _ => fib(b, a + b, n - 1),\n    }\n}\n\n\n#[cfg(test)]\nmod tests {\n    use super::{adder, always_five};\n\n    #[test]\n    #[fuzzer]\n    fn adding() {\n        let result = adder(2, 3);\n        assert(result == 5, '2 + 3 == 5');\n    }\n\n    #[test]\n    #[fuzzer]\n    fn fuzzed_argument(b: felt252) {\n        let result = adder(2, b);\n        assert(result == 2 + b, '2 + b == 2 + b');\n    }\n\n    #[test]\n    #[fuzzer]\n    fn fuzzed_both_arguments(a: felt252, b: felt252) {\n        let result = adder(a, b);\n        assert(result == a + b, 'result == a + b');\n    }\n\n    #[test]\n    #[fuzzer]\n    fn passing() {\n        let result = always_five(2, 3);\n        assert(result == 5, 'result == 5');\n    }\n\n    #[test]\n    #[fuzzer]\n    fn failing_fuzz(a: felt252, b: felt252) {\n        let result = always_five(a, b);\n        assert(result == a + b, 'result == a + b');\n    }\n\n    #[test]\n    #[fuzzer(runs: 10, seed: 100)]\n    fn custom_fuzzer_config(b: felt252) {\n        let result = adder(2, b);\n        assert(result == 2 + b, '2 + b == 2 + b');\n    }\n\n    #[test]\n    #[fuzzer]\n    fn uint8_arg(a: u8) {\n        if a <= 5_u8 {\n            assert(2 == 2, '2 == 2');\n        } else {\n            let x = a - 5_u8;\n            assert(x == a - 5_u8, 'x != a - 5');\n        }\n    }\n\n    #[test]\n    #[fuzzer]\n    fn uint16_arg(a: u16) {\n        if a <= 5_u16 {\n            assert(2 == 2, '2 == 2');\n        } else {\n            let x = a - 5_u16;\n            assert(x == a - 5_u16, 'x != a - 5');\n        }\n    }\n\n    #[test]\n    #[fuzzer]\n    fn uint32_arg(a: u32) {\n        if a <= 5_u32 {\n            assert(2 == 2, '2 == 2');\n        } else {\n            let x = a - 5_u32;\n            assert(x == a - 5_u32, 'x != a - 5');\n        }\n    }\n\n    #[test]\n    #[fuzzer]\n    fn uint64_arg(a: u64) {\n        if a <= 5_u64 {\n            assert(2 == 2, '2 == 2');\n        } else {\n            let x = a - 5_u64;\n            assert(x == a - 5_u64, 'x != a - 5');\n        }\n    }\n\n    #[test]\n    #[fuzzer]\n    fn uint128_arg(a: u128) {\n        if a <= 5_u128 {\n            assert(2 == 2, '2 == 2');\n        } else {\n            let x = a - 5_u128;\n            assert(x == a - 5_u128, 'x != a - 5');\n        }\n    }\n\n    #[test]\n    #[fuzzer]\n    fn uint256_arg(a: u256) {\n        if a <= 5_u256 {\n            assert(2 == 2, '2 == 2');\n        } else {\n            let x = a - 5_u256;\n            assert(x == a - 5_u256, 'x != a - 5');\n        }\n    }\n\n    #[test]\n    #[fuzzer(runs: 256, seed: 100)]\n    fn fuzzed_while_loop(a: u8) {\n        let mut i: u8 = 0;\n        while i != a {\n            i += 1;\n        };\n\n        assert(1 == 1, '');\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/fuzzing/tests/exit_first_fuzz.cairo",
    "content": "use fuzzing::{adder, fib};\n\n\n#[test]\n#[fuzzer]\nfn exit_first_fails_test(b: felt252) {\n    adder(0, 1);\n    assert(1 == 2, '2 + b == 2 + b');\n}\n\n#[test]\n#[fuzzer]\nfn exit_first_hard_test(b: felt252) {\n    fib(0, 1, 30344);\n    assert(2 == 2, 'simple check');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/fuzzing/tests/exit_first_single_fail.cairo",
    "content": "use fuzzing::{adder, fib};\n\n\n#[test]\nfn exit_first_fails_test() {\n    adder(0, 1);\n    assert(1 == 2, '2 + b == 2 + b');\n}\n\n#[test]\n#[fuzzer]\nfn exit_first_hard_test(b: felt252) {\n    fib(0, 1, 30344);\n    assert(2 == 2, 'simple check');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/fuzzing/tests/generate_arg.cairo",
    "content": "use snforge_std::fuzzable::generate_arg;\n\n#[test]\nfn use_generate_arg_outside_fuzzer() {\n    let random: usize = generate_arg(100, 999);\n    assert(99 < random && random < 1000, 'value outside correct range');\n}\n\n\n#[test]\nfn generate_arg_incorrect_range() {\n    generate_arg(101, 100);\n}\n"
  },
  {
    "path": "crates/forge/tests/data/fuzzing/tests/generic_struct.cairo",
    "content": "use snforge_std::fuzzable::Fuzzable;\n\n#[derive(Debug, Drop)]\nstruct Price<T> {\n    amount: T,\n}\n\nimpl FuzzablePriceU64 of Fuzzable<Price<u64>> {\n    fn blank() -> Price<u64> {\n        Price { amount: 0 }\n    }\n\n    fn generate() -> Price<u64> {\n        Price { amount: Fuzzable::generate() }\n    }\n}\n\n#[fuzzer]\n#[test]\nfn test_generic(price: Price<u64>) {\n    assert(price.amount > 0, 'Wrong price');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/fuzzing/tests/incorrect_args.cairo",
    "content": "use fuzzing::adder;\n\n#[derive(Debug, Drop)]\nstruct MyStruct {\n    a: felt252,\n}\n\n#[test]\n#[fuzzer]\nfn correct_args(b: felt252) {\n    let result = adder(2, b);\n    assert(result == 2 + b, '2 + b == 2 + b');\n}\n\n#[cfg(feature: 'unimplemented')]\n#[test]\n#[fuzzer]\nfn incorrect_args(b: felt252, a: MyStruct) {\n    let result = adder(2, b);\n    assert(result == 2 + b, '2 + b == 2 + b');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/fuzzing/tests/multiple_attributes.cairo",
    "content": "use fuzzing::{adder, fib};\n\n#[available_gas(l2_gas: 40000000)]\n#[fuzzer(runs: 50, seed: 123)]\n#[test]\nfn with_available_gas(a: usize) {\n    fib(0, 1, 1000);\n    assert(a >= 0, 'unsigned must be >= 0');\n}\n\n\n#[fuzzer]\n#[test]\n#[should_panic(expected: 'panic message')]\nfn with_should_panic(a: u64) {\n    let b: i128 = a.into();\n    assert(b < 0, 'panic message');\n}\n\n#[available_gas(l2_gas: 5)]\n#[should_panic(expected: 'panic message')]\n#[test]\n#[fuzzer(runs: 300)]\nfn with_both(a: felt252, b: u128) {\n    let sum = adder(a, b.into());\n    assert(sum + 1 == 0, 'panic message');\n}\n\n#[test]\n#[fuzzer(seed: 5)]\n#[ignore]\nfn ignored(a: felt252) {\n    assert(1 == 1, '');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/hello_workspaces/Scarb.toml",
    "content": "[workspace]\nmembers = [\n    \"crates/*\",\n]\n\n[workspace.scripts]\ntest = \"snforge\"\n\n[workspace.tool.snforge]\n\n[workspace.dependencies]\nstarknet = \"2.4.0\"\nsnforge_std = { path = \"../../../../../snforge_std\" }\n\n[workspace.package]\nversion = \"0.1.0\"\n\n[package]\nname = \"hello_workspaces\"\nversion.workspace = true\nedition = \"2024_07\"\n\n[scripts]\ntest.workspace = true\n\n[tool]\nsnforge.workspace = true\n\n[dependencies]\nstarknet.workspace = true\nfibonacci = { path = \"crates/fibonacci\" }\naddition = { path = \"crates/addition\" }\n\n[dev-dependencies]\nsnforge_std.workspace = true\n\n[[target.starknet-contract]]\nsierra = true\n"
  },
  {
    "path": "crates/forge/tests/data/hello_workspaces/crates/addition/Scarb.toml",
    "content": "[package]\nname = \"addition\"\nversion.workspace = true\nedition = \"2024_07\"\n\n[dependencies]\nstarknet.workspace = true\n\n[dev-dependencies]\nsnforge_std.workspace = true\n\n[[target.starknet-contract]]\nsierra = true\n\n[lib]\n"
  },
  {
    "path": "crates/forge/tests/data/hello_workspaces/crates/addition/src/lib.cairo",
    "content": "pub fn add(a: felt252, b: felt252) -> felt252 {\n    a + b\n}\n\n#[starknet::interface]\ntrait IAdditionContract<TContractState> {\n    fn answer(ref self: TContractState) -> felt252;\n}\n\n#[starknet::contract]\nmod AdditionContract {\n    use addition::add;\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl AdditionContractImpl of super::IAdditionContract<ContractState> {\n        fn answer(ref self: ContractState) -> felt252 {\n            add(10, 20)\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::add;\n\n    #[test]\n    fn it_works() {\n        assert(add(2, 3) == 5, 'it works!');\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/hello_workspaces/crates/addition/tests/nested/test_nested.cairo",
    "content": "use super::foo;\n\n#[test]\nfn test_two() {\n    assert(foo() == 2, 'foo() == 2');\n}\n\n#[test]\nfn test_two_and_two() {\n    assert(2 == 2, '2 == 2');\n    assert(2 == 2, '2 == 2');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/hello_workspaces/crates/addition/tests/nested.cairo",
    "content": "use snforge_std::declare;\n\nmod test_nested;\n\nfn foo() -> u8 {\n    2\n}\n\n#[test]\nfn simple_case() {\n    assert(1 == 1, 'simple check');\n}\n\n#[test]\nfn contract_test() {\n    declare(\"AdditionContract\").unwrap();\n}\n"
  },
  {
    "path": "crates/forge/tests/data/hello_workspaces/crates/fibonacci/Scarb.toml",
    "content": "[package]\nname = \"fibonacci\"\nversion.workspace = true\nedition = \"2024_07\"\n\n[scripts]\ntest.workspace = true\n\n[tool]\nsnforge.workspace = true\n\n[dependencies]\naddition = { path = \"../addition\" }\nstarknet.workspace = true\n\n[dev-dependencies]\nsnforge_std.workspace = true\n\n[[target.starknet-contract]]\nsierra = true\nbuild-external-contracts = [\"addition::AdditionContract\"]\n\n[lib]\n"
  },
  {
    "path": "crates/forge/tests/data/hello_workspaces/crates/fibonacci/src/lib.cairo",
    "content": "use addition::add;\n\npub fn fib(a: felt252, b: felt252, n: felt252) -> felt252 {\n    match n {\n        0 => a,\n        _ => fib(b, add(a, b), n - 1),\n    }\n}\n\n#[starknet::contract]\nmod FibonacciContract {\n    use addition::add;\n    use fibonacci::fib;\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    fn answer(ref self: ContractState) -> felt252 {\n        add(fib(0, 1, 16), fib(0, 1, 8))\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use snforge_std::declare;\n    use super::fib;\n\n    #[test]\n    fn it_works() {\n        assert(fib(0, 1, 16) == 987, 'it works!');\n    }\n\n    #[test]\n    fn contract_test() {\n        declare(\"FibonacciContract\").unwrap();\n        declare(\"AdditionContract\").unwrap();\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/hello_workspaces/crates/fibonacci/tests/abc/efg.cairo",
    "content": "#[test]\nfn efg_test() {\n    assert(super::foo() == 1, '');\n}\n\n#[test]\nfn failing_test() {\n    assert(1 == 2, '');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/hello_workspaces/crates/fibonacci/tests/abc.cairo",
    "content": "mod efg;\n\n#[test]\nfn abc_test() {\n    assert(foo() == 1, '');\n}\n\npub fn foo() -> u8 {\n    1\n}\n"
  },
  {
    "path": "crates/forge/tests/data/hello_workspaces/crates/fibonacci/tests/lib.cairo",
    "content": "mod abc;\n\n#[test]\nfn lib_test() {\n    assert(abc::foo() == 1, '');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/hello_workspaces/crates/fibonacci/tests/not_collected.cairo",
    "content": "// should not be collected\n\n#[test]\nfn not_collected() {\n    assert(1 == 1, '');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/hello_workspaces/src/lib.cairo",
    "content": "#[starknet::interface]\ntrait IFibContract<TContractState> {\n    fn answer(ref self: TContractState) -> felt252;\n}\n\n#[starknet::contract]\nmod FibContract {\n    use addition::add;\n    use fibonacci::fib;\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl FibContractImpl of super::IFibContract<ContractState> {\n        fn answer(ref self: ContractState) -> felt252 {\n            add(fib(0, 1, 16), fib(0, 1, 8))\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    #[test]\n    fn test_simple() {\n        assert(1 == 1, 1);\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/hello_workspaces/tests/test_failing.cairo",
    "content": "#[test]\nfn test_failing() {\n    assert(1 == 2, 'failing check');\n}\n\n#[test]\nfn test_another_failing() {\n    assert(2 == 3, 'failing check');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/nonexistent_selector/Scarb.toml",
    "content": "[package]\nname = \"nonexistent_selector\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html\n\n[dependencies]\nstarknet = \"2.4.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "crates/forge/tests/data/nonexistent_selector/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait IMyContract<TState> {\n    fn my_function(self: @TState);\n}\n\n#[starknet::contract]\npub mod MyContract {\n    use starknet::SyscallResultTrait;\n    use starknet::syscalls::call_contract_syscall;\n\n    #[storage]\n    pub struct Storage {}\n\n    #[abi(embed_v0)]\n    impl MyContract of super::IMyContract<ContractState> {\n        fn my_function(self: @ContractState) {\n            let this = starknet::get_contract_address();\n            let selector = selector!(\"nonexistent\");\n            let calldata = array![].span();\n\n            call_contract_syscall(this, selector, calldata).unwrap_syscall();\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/nonexistent_selector/tests/test_contract.cairo",
    "content": "use nonexistent_selector::{IMyContractSafeDispatcher, IMyContractSafeDispatcherTrait};\nuse snforge_std::{ContractClassTrait, DeclareResultTrait, declare};\n\n#[test]\n#[feature(\"safe_dispatcher\")]\nfn test_unwrapped_call_contract_syscall() {\n    let contract = declare(\"MyContract\").unwrap().contract_class();\n    let (contract_address, _) = contract.deploy(@array![]).unwrap();\n\n    let safe_dispatcher = IMyContractSafeDispatcher { contract_address };\n    let res = safe_dispatcher.my_function();\n    match res {\n        Result::Ok(_) => panic!(\"Expected an error\"),\n        Result::Err(err_data) => {\n            assert(*err_data.at(0) == 'ENTRYPOINT_NOT_FOUND', *err_data.at(0));\n        },\n    };\n}\n"
  },
  {
    "path": "crates/forge/tests/data/panic_decoding/Scarb.toml",
    "content": "[package]\nname = \"panic_decoding\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nassert_macros = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n"
  },
  {
    "path": "crates/forge/tests/data/panic_decoding/src/lib.cairo",
    "content": "\n"
  },
  {
    "path": "crates/forge/tests/data/panic_decoding/tests/test_panic_decoding.cairo",
    "content": "use core::array::ArrayTrait;\n\n#[test]\nfn test_simple() {\n    assert(1 == 1, 'simple check');\n}\n\n#[test]\nfn test_panic_decoding() {\n    let max_felt = 3618502788666131213697322783095070105623107215331596699973092056135872020480;\n\n    let mut arr = ArrayTrait::new();\n    arr.append(123);\n    arr.append('aaa');\n    arr.append(max_felt);\n    arr.append(152);\n    arr.append(124);\n    arr.append(149);\n    panic(arr);\n}\n\n#[test]\nfn test_panic_decoding2() {\n    assert(1 == 2, 128);\n}\n\n#[test]\nfn test_simple2() {\n    assert(2 == 2, 'simple check');\n}\n\n#[test]\nfn test_assert_eq() {\n    let x = 5;\n    let y = 6;\n    assert_eq!(x, y);\n}\n\n#[test]\nfn test_assert_eq_message() {\n    let x = 5;\n    let y = 6;\n    assert_eq!(x, y, \"An identifiable and meaningful error message\");\n}\n\n#[test]\nfn test_assert() {\n    let x = false;\n    assert!(x);\n}\n\n#[test]\nfn test_assert_message() {\n    let x = false;\n    assert!(x, \"Another identifiable and meaningful error message\");\n}\n"
  },
  {
    "path": "crates/forge/tests/data/partitioning/.tool-versions",
    "content": "scarb 2.12.0\n"
  },
  {
    "path": "crates/forge/tests/data/partitioning/Scarb.toml",
    "content": "[workspace]\nmembers = [\n    \"crates/package_a\",\n    \"crates/package_b\",\n]\n\n[workspace.dependencies]\nstarknet = \"2.12.0\"\nsnforge_std = { path = \"../../../../../snforge_std\" }\n\n[workspace.package]\nversion = \"0.1.0\"\n\n[package]\nname = \"partitioning\"\nversion.workspace = true\nedition = \"2024_07\"\n\n[dependencies]\nstarknet.workspace = true\npackage_a = { path = \"crates/package_a\" }\npackage_b = { path = \"crates/package_b\" }\n\n[dev-dependencies]\nsnforge_std.workspace = true\n\n[profile.dev.cairo]\nunstable-add-statements-functions-debug-info = true\nunstable-add-statements-code-locations-debug-info = true\ninlining-strategy = \"avoid\"\n"
  },
  {
    "path": "crates/forge/tests/data/partitioning/crates/package_a/Scarb.toml",
    "content": "[package]\nname = \"package_a\"\nversion.workspace = true\nedition = \"2024_07\"\n\n[dependencies]\nstarknet.workspace = true\n\n[dev-dependencies]\nsnforge_std.workspace = true\n"
  },
  {
    "path": "crates/forge/tests/data/partitioning/crates/package_a/src/lib.cairo",
    "content": "#[starknet::contract]\npub mod HelloStarknet {\n    #[storage]\n    struct Storage {}\n}\n\n#[cfg(test)]\nmod tests {\n    #[test]\n    fn test_a() {\n        assert!(1 + 1 == 2);\n    }\n\n    #[test]\n    #[ignore] // Ignored on purpose\n    fn test_b() {\n        assert!(1 + 1 == 2);\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/partitioning/crates/package_a/tests/tests.cairo",
    "content": "#[test]\nfn test_c() {\n    assert!(1 + 1 == 2);\n}\n\n#[test]\nfn test_d() {\n    assert!(1 + 1 == 2);\n}\n"
  },
  {
    "path": "crates/forge/tests/data/partitioning/crates/package_b/Scarb.toml",
    "content": "[package]\nname = \"package_b\"\nversion.workspace = true\nedition = \"2024_07\"\n\n[dependencies]\nstarknet.workspace = true\n\n[dev-dependencies]\nsnforge_std.workspace = true\n"
  },
  {
    "path": "crates/forge/tests/data/partitioning/crates/package_b/src/lib.cairo",
    "content": "#[starknet::contract]\npub mod HelloStarknet {\n    #[storage]\n    struct Storage {}\n}\n\n#[cfg(test)]\nmod tests {\n    #[test]\n    fn test_e() {\n        assert!(1 + 1 == 2);\n    }\n\n    #[test]\n    fn test_f() {\n        assert!(1 + 1 == 2);\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/partitioning/crates/package_b/tests/tests.cairo",
    "content": "#[test]\nfn test_g() {\n    assert!(1 + 1 == 2);\n}\n\n#[test]\nfn test_h() {\n    assert!(1 + 1 == 3); // Failing on purpose\n}\n"
  },
  {
    "path": "crates/forge/tests/data/partitioning/src/lib.cairo",
    "content": "#[starknet::contract]\npub mod HelloStarknet {\n    #[storage]\n    struct Storage {}\n}\n\n#[cfg(test)]\nmod tests {\n    #[test]\n    fn test_i() {\n        assert!(1 + 1 == 2);\n    }\n\n    #[test]\n    fn test_j() {\n        assert!(1 + 1 == 2);\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/partitioning/tests/tests.cairo",
    "content": "#[test]\nfn test_k() {\n    assert!(1 + 1 == 2);\n}\n\n#[test]\nfn test_l() {\n    assert!(1 + 1 == 2);\n}\n\n#[test]\nfn test_m() {\n    assert!(1 + 1 == 2);\n}\n\n"
  },
  {
    "path": "crates/forge/tests/data/runtime_errors_package/Scarb.toml",
    "content": "[package]\nname = \"runtime_errors_package\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.4.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\n\n[tool.snforge]\nexit_first = false\n"
  },
  {
    "path": "crates/forge/tests/data/runtime_errors_package/src/hello_starknet.cairo",
    "content": "#[starknet::interface]\npub trait IHelloStarknet<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n    fn do_a_panic(self: @TContractState);\n    fn do_a_panic_with(self: @TContractState, panic_data: Array<felt252>);\n}\n\n#[starknet::contract]\npub mod HelloStarknet {\n    use core::array::ArrayTrait;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl IHelloStarknetImpl of super::IHelloStarknet<ContractState> {\n        // Increases the balance by the given amount\n        fn increase_balance(ref self: ContractState, amount: felt252) {\n            self.balance.write(self.balance.read() + amount);\n        }\n\n        // Returns the current balance\n        fn get_balance(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n\n        // Panics\n        fn do_a_panic(self: @ContractState) {\n            let mut arr = ArrayTrait::new();\n            arr.append('PANIC');\n            arr.append('DAYTAH');\n            panic(arr);\n        }\n\n        // Panics with given array data\n        fn do_a_panic_with(self: @ContractState, panic_data: Array<felt252>) {\n            panic(panic_data);\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/runtime_errors_package/src/lib.cairo",
    "content": "pub mod hello_starknet;\n\npub fn fib(a: felt252, b: felt252, n: felt252) -> felt252 {\n    match n {\n        0 => a,\n        _ => fib(b, a + b, n - 1),\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::fib;\n\n    #[test]\n    fn test_fib() {\n        assert(fib(0, 1, 10) == 55, fib(0, 1, 10));\n    }\n\n    #[test]\n    #[ignore]\n    fn ignored_test() {\n        assert(1 == 1, 'passing');\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/runtime_errors_package/tests/with_error.cairo",
    "content": "use snforge_std::fs::{FileTrait, read_txt};\n\n#[test]\n#[should_panic(expected: \"No such file or directory\")]\nfn catch_no_such_file() {\n    let file = FileTrait::new(\"no_way_this_file_exists\");\n    let content = read_txt(@file);\n\n    assert!(false);\n}\n"
  },
  {
    "path": "crates/forge/tests/data/should_panic_test/Scarb.toml",
    "content": "[package]\nname = \"should_panic_test\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n"
  },
  {
    "path": "crates/forge/tests/data/should_panic_test/src/lib.cairo",
    "content": "\n"
  },
  {
    "path": "crates/forge/tests/data/should_panic_test/tests/should_panic_test.cairo",
    "content": "use core::array::ArrayTrait;\nuse core::panic_with_felt252;\n\n#[test]\n#[should_panic]\nfn should_panic_no_data() {\n    panic_with_felt252(0);\n}\n\n#[test]\n#[should_panic(expected: ('panic message',))]\nfn should_panic_check_data() {\n    panic_with_felt252('panic message');\n}\n\n#[test]\n#[should_panic(expected: ('panic message', 'second message'))]\nfn should_panic_multiple_messages() {\n    let mut arr = ArrayTrait::new();\n    arr.append('panic message');\n    arr.append('second message');\n    panic(arr);\n}\n\n#[test]\n#[should_panic(expected: (0,))]\nfn should_panic_with_non_matching_data() {\n    panic_with_felt252('failing check');\n}\n\n#[test]\nfn didnt_expect_panic() {\n    panic_with_felt252('unexpected panic');\n}\n\n#[test]\n#[should_panic]\nfn expected_panic_but_didnt() {\n    assert(1 == 1, 'err');\n}\n\n#[test]\n#[should_panic(expected: 'panic message')]\nfn expected_panic_but_didnt_with_expected() {\n    assert(1 == 1, 'err');\n}\n\n#[test]\n#[should_panic(expected: ('panic message', 'second message'))]\nfn expected_panic_but_didnt_with_expected_multiple() {\n    assert(1 == 1, 'err');\n}\n\n#[test]\n#[should_panic(expected: 'panic message')]\nfn should_panic_felt_matching() {\n    assert(1 != 1, 'panic message');\n}\n\n#[test]\n#[should_panic(expected: \"will panicc\")]\nfn should_panic_not_matching_suffix() {\n    panic!(\"This will panic\");\n}\n\n#[test]\n#[should_panic(expected: \"will panic\")]\nfn should_panic_match_suffix() {\n    panic!(\"This will panic\");\n}\n\n\n#[test]\n#[should_panic(expected: ('This will panic',))]\nfn should_panic_byte_array_with_felt() {\n    panic!(\"This will panic\");\n}\n\n#[test]\n#[should_panic(expected: \"This will panic\")]\nfn should_panic_felt_with_byte_array() {\n    panic_with_felt252('This will panic');\n}\n\n#[test]\n#[should_panic(expected: \"This will panic\")]\nfn should_panic_expected_contains_error() {\n    panic!(\"will\");\n}\n\n"
  },
  {
    "path": "crates/forge/tests/data/simple_package/Scarb.toml",
    "content": "[package]\nname = \"simple_package\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.4.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\n\n[tool.snforge]\nexit_first = false\n"
  },
  {
    "path": "crates/forge/tests/data/simple_package/src/hello_starknet.cairo",
    "content": "#[starknet::interface]\npub trait IHelloStarknet<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n    fn do_a_panic(self: @TContractState);\n    fn do_a_panic_with(self: @TContractState, panic_data: Array<felt252>);\n}\n\n#[starknet::contract]\npub mod HelloStarknet {\n    use core::array::ArrayTrait;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl IHelloStarknetImpl of super::IHelloStarknet<ContractState> {\n        // Increases the balance by the given amount\n        fn increase_balance(ref self: ContractState, amount: felt252) {\n            self.balance.write(self.balance.read() + amount);\n        }\n\n        // Returns the current balance\n        fn get_balance(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n\n        // Panics\n        fn do_a_panic(self: @ContractState) {\n            let mut arr = ArrayTrait::new();\n            arr.append('PANIC');\n            arr.append('DAYTAH');\n            panic(arr);\n        }\n\n        // Panics with given array data\n        fn do_a_panic_with(self: @ContractState, panic_data: Array<felt252>) {\n            panic(panic_data);\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/simple_package/src/lib.cairo",
    "content": "pub mod hello_starknet;\n\npub fn fib(a: felt252, b: felt252, n: felt252) -> felt252 {\n    match n {\n        0 => a,\n        _ => fib(b, a + b, n - 1),\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::fib;\n\n    #[test]\n    fn test_fib() {\n        assert(fib(0, 1, 10) == 55, fib(0, 1, 10));\n    }\n\n    #[test]\n    #[ignore]\n    fn ignored_test() {\n        assert(1 == 1, 'passing');\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/simple_package/tests/contract.cairo",
    "content": "use core::array::ArrayTrait;\nuse core::result::ResultTrait;\nuse simple_package::hello_starknet::{IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait};\nuse snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::{ContractClassTrait, declare};\n\n#[test]\nfn call_and_invoke() {\n    let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n    let constructor_calldata = @ArrayTrait::new();\n    let (contract_address, _) = contract.deploy(constructor_calldata).unwrap();\n    let dispatcher = IHelloStarknetDispatcher { contract_address };\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 0, 'balance == 0');\n\n    dispatcher.increase_balance(100);\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 100, 'balance == 100');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/simple_package/tests/ext_function_test.cairo",
    "content": "use simple_package::fib;\n\n#[test]\nfn test_my_test() {\n    assert(fib(0, 1, 10) == 55, fib(0, 1, 10));\n    assert(2 == 2, 'simple check');\n}\n\n#[test]\n#[ignore]\nfn ignored_test() {\n    assert(1 == 2, 'not passing');\n}\n\n#[test]\nfn test_simple() {\n    assert(1 == 1, 'simple check');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/simple_package/tests/test_simple.cairo",
    "content": "#[test]\nfn test_simple() {\n    assert(1 == 1, 'simple check');\n}\n\n#[test]\nfn test_simple2() {\n    assert(3 == 3, 'simple check');\n}\n\n#[test]\nfn test_two() {\n    assert(2 == 2, '2 == 2');\n}\n\n#[test]\nfn test_two_and_two() {\n    assert(2 == 2, '2 == 2');\n    assert(2 == 2, '2 == 2');\n}\n\n#[test]\nfn test_failing() {\n    assert(1 == 2, 'failing check');\n}\n\n#[test]\nfn test_another_failing() {\n    assert(2 == 3, 'failing check');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/simple_package/tests/without_prefix.cairo",
    "content": "#[test]\nfn five() {\n    assert(5 == 5, '5 == 5');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/simple_package_with_cheats/Scarb.toml",
    "content": "[package]\nname = \"simple_package_with_cheats\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.12.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\n\n[tool.snforge]\nexit_first = false\n"
  },
  {
    "path": "crates/forge/tests/data/simple_package_with_cheats/src/lib.cairo",
    "content": "use starknet::{ClassHash, ContractAddress};\n\n#[starknet::interface]\npub trait IHelloStarknet<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n    fn get_block_number(self: @TContractState) -> u64;\n    fn get_block_hash(self: @TContractState) -> felt252;\n}\n\n#[starknet::interface]\npub trait ICheatedConstructor<TContractState> {\n    fn get_stored_block_number(self: @TContractState) -> u64;\n}\n\n#[starknet::contract]\npub mod CheatedConstructor {\n    use starknet::get_block_number;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        block_number: u64,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState) {\n        let block_number = get_block_number();\n        self.block_number.write(block_number);\n    }\n\n    #[abi(embed_v0)]\n    impl ICheatedConstructorImpl of super::ICheatedConstructor<ContractState> {\n        fn get_stored_block_number(self: @ContractState) -> u64 {\n            self.block_number.read()\n        }\n    }\n}\n\n#[starknet::interface]\npub trait IHelloStarknetProxy<TContractState> {\n    fn get_block_number(self: @TContractState) -> u64;\n    fn get_block_number_library_call(self: @TContractState) -> u64;\n    fn deploy_cheated_constructor_contract(\n        ref self: TContractState, class_hash: ClassHash, salt: felt252,\n    ) -> ContractAddress;\n}\n\n#[starknet::contract]\npub mod HelloStarknetProxy {\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n    use starknet::syscalls::{deploy_syscall, get_class_hash_at_syscall};\n    use starknet::{ClassHash, ContractAddress};\n    use crate::{\n        IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait, IHelloStarknetLibraryDispatcher,\n    };\n\n    #[storage]\n    struct Storage {\n        address: ContractAddress,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState, address: ContractAddress) {\n        self.address.write(address);\n    }\n\n    #[abi(embed_v0)]\n    impl IHelloStarknetProxyImpl of super::IHelloStarknetProxy<ContractState> {\n        fn get_block_number(self: @ContractState) -> u64 {\n            let address = self.address.read();\n            let proxied = IHelloStarknetDispatcher { contract_address: address };\n            proxied.get_block_number()\n        }\n\n        fn get_block_number_library_call(self: @ContractState) -> u64 {\n            let address = self.address.read();\n            let class_hash = get_class_hash_at_syscall(address).unwrap();\n            let library_dispatcher = IHelloStarknetLibraryDispatcher { class_hash };\n            library_dispatcher.get_block_number()\n        }\n\n        fn deploy_cheated_constructor_contract(\n            ref self: ContractState, class_hash: ClassHash, salt: felt252,\n        ) -> ContractAddress {\n            let (address, _) = deploy_syscall(class_hash, salt, array![].span(), false).unwrap();\n            address\n        }\n    }\n}\n\n#[starknet::contract]\npub mod HelloStarknet {\n    use core::array::ArrayTrait;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n    use starknet::syscalls::get_block_hash_syscall;\n    use starknet::{SyscallResultTrait, get_block_number};\n\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl IHelloStarknetImpl of super::IHelloStarknet<ContractState> {\n        // Increases the balance by the given amount\n        fn increase_balance(ref self: ContractState, amount: felt252) {\n            self.balance.write(self.balance.read() + amount);\n        }\n\n        // Returns the current balance\n        fn get_balance(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n\n        fn get_block_number(self: @ContractState) -> u64 {\n            get_block_number()\n        }\n\n        fn get_block_hash(self: @ContractState) -> felt252 {\n            get_block_hash_syscall(100).unwrap_syscall()\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/simple_package_with_cheats/tests/contract.cairo",
    "content": "use core::array::ArrayTrait;\nuse core::result::ResultTrait;\nuse simple_package_with_cheats::{\n    ICheatedConstructorDispatcher, ICheatedConstructorDispatcherTrait, IHelloStarknetDispatcher,\n    IHelloStarknetDispatcherTrait, IHelloStarknetProxyDispatcher,\n    IHelloStarknetProxyDispatcherTrait,\n};\nuse snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::{\n    ContractClassTrait, declare, start_cheat_block_hash_global, start_cheat_block_number_global,\n};\nuse starknet::contract_address;\n\n#[test]\nfn call_and_invoke() {\n    let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n    let constructor_calldata = @ArrayTrait::new();\n    let (contract_address, _) = contract.deploy(constructor_calldata).unwrap();\n    let dispatcher = IHelloStarknetDispatcher { contract_address };\n\n    let block_number = dispatcher.get_block_number();\n    println!(\"block number {}\", block_number);\n    // TODO investigate why the default is 2000\n    assert(block_number == 2000, 'block_info == 2000');\n\n    start_cheat_block_number_global(123);\n\n    let block_number = dispatcher.get_block_number();\n    assert(block_number == 123, 'block_info == 123');\n}\n\n#[test]\nfn call_and_invoke_proxy() {\n    let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n    let constructor_calldata = @ArrayTrait::new();\n    let (contract_address, _) = contract.deploy(constructor_calldata).unwrap();\n\n    let proxy_contract = declare(\"HelloStarknetProxy\").unwrap().contract_class();\n    let mut constructor_calldata = ArrayTrait::new();\n    contract_address.serialize(ref constructor_calldata);\n    let (proxy_contract_address, _) = proxy_contract.deploy(@constructor_calldata).unwrap();\n    let dispatcher = IHelloStarknetProxyDispatcher { contract_address: proxy_contract_address };\n\n    let block_number = dispatcher.get_block_number();\n    assert(block_number == 2000, 'block_number == 2000');\n\n    start_cheat_block_number_global(123);\n\n    let block_number = dispatcher.get_block_number();\n    assert(block_number == 123, 'block_number == 123');\n}\n\n#[test]\nfn call_and_invoke_library_call() {\n    let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n    let constructor_calldata = @ArrayTrait::new();\n    let (contract_address, _) = contract.deploy(constructor_calldata).unwrap();\n\n    let proxy_contract = declare(\"HelloStarknetProxy\").unwrap().contract_class();\n    let mut constructor_calldata = ArrayTrait::new();\n    contract_address.serialize(ref constructor_calldata);\n    let (proxy_contract_address, _) = proxy_contract.deploy(@constructor_calldata).unwrap();\n    let dispatcher = IHelloStarknetProxyDispatcher { contract_address: proxy_contract_address };\n\n    let block_number = dispatcher.get_block_number_library_call();\n    assert(block_number == 2000, 'block_number == 2000');\n\n    start_cheat_block_number_global(123);\n\n    let block_number = dispatcher.get_block_number_library_call();\n    assert(block_number == 123, 'block_number == 123');\n}\n\n#[test]\nfn deploy_syscall() {\n    let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n    let constructor_calldata = @ArrayTrait::new();\n    let (contract_address, _) = contract.deploy(constructor_calldata).unwrap();\n\n    let proxy_contract = declare(\"HelloStarknetProxy\").unwrap().contract_class();\n    let mut constructor_calldata = ArrayTrait::new();\n    contract_address.serialize(ref constructor_calldata);\n    let (proxy_contract_address, _) = proxy_contract.deploy(@constructor_calldata).unwrap();\n    let dispatcher = IHelloStarknetProxyDispatcher { contract_address: proxy_contract_address };\n\n    let class_hash = declare(\"CheatedConstructor\").unwrap().contract_class().class_hash;\n\n    let contract_address = dispatcher.deploy_cheated_constructor_contract(*class_hash, 111);\n    let cheated_constructor_dispatcher = ICheatedConstructorDispatcher { contract_address };\n    let block_number = cheated_constructor_dispatcher.get_stored_block_number();\n    assert(block_number == 2000, 'block_number == 2000');\n\n    start_cheat_block_number_global(123);\n\n    let contract_address = dispatcher.deploy_cheated_constructor_contract(*class_hash, 222);\n    let cheated_constructor_dispatcher = ICheatedConstructorDispatcher { contract_address };\n    let block_number = cheated_constructor_dispatcher.get_stored_block_number();\n    assert(block_number == 123, 'block_number == 123');\n}\n\n#[test]\nfn block_hash() {\n    let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n    let constructor_calldata = @ArrayTrait::new();\n    let (contract_address, _) = contract.deploy(constructor_calldata).unwrap();\n    let dispatcher = IHelloStarknetDispatcher { contract_address };\n\n    let block_hash = dispatcher.get_block_hash();\n    assert(block_hash == 0, 'bloch_hash == 0');\n\n    start_cheat_block_hash_global(100, 111);\n\n    let block_hash = dispatcher.get_block_hash();\n    assert(block_hash == 111, 'bloch_hash == 111');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/steps/Scarb.toml",
    "content": "[package]\nname = \"steps\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html\n\n[dependencies]\nstarknet = \"2.4.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n"
  },
  {
    "path": "crates/forge/tests/data/steps/src/lib.cairo",
    "content": "#[cfg(test)]\nmod tests {\n    #[test]\n    fn steps_less_than_10000000() {\n        let mut i = 0;\n\n        while i != 500_000 {\n            i = i + 1;\n            assert(1 + 1 == 2, 'who knows?');\n        }\n    }\n\n\n    #[test]\n    fn steps_more_than_10000000() {\n        let mut i = 0;\n\n        while i != 1_000_000 {\n            i = i + 1;\n            assert(1 + 1 == 2, 'who knows?');\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/targets/custom_target/Scarb.toml",
    "content": "[package]\nname = \"custom_target\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\n\n[[test]]\nname = \"custom_target_integrationtest\"\nkind = \"test\"\nsource-path = \"./tests/tests.cairo\"\ntest-type = \"integration\"\n\n[[test]]\nname = \"custom_target_unittest\"\nkind = \"test\"\ntest-type = \"unit\"\n\n[tool.snforge]\nexit_first = false\n"
  },
  {
    "path": "crates/forge/tests/data/targets/custom_target/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait IHelloStarknet<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n    fn do_a_panic(self: @TContractState);\n    fn do_a_panic_with(self: @TContractState, panic_data: Array<felt252>);\n}\n\n#[starknet::contract]\npub mod HelloStarknet {\n    use core::array::ArrayTrait;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl IHelloStarknetImpl of super::IHelloStarknet<ContractState> {\n        // Increases the balance by the given amount\n        fn increase_balance(ref self: ContractState, amount: felt252) {\n            self.balance.write(self.balance.read() + amount);\n        }\n\n        // Returns the current balance\n        fn get_balance(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n\n        // Panics\n        fn do_a_panic(self: @ContractState) {\n            let mut arr = ArrayTrait::new();\n            arr.append('PANIC');\n            arr.append('DAYTAH');\n            panic(arr);\n        }\n\n        // Panics with given array data\n        fn do_a_panic_with(self: @ContractState, panic_data: Array<felt252>) {\n            panic(panic_data);\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use snforge_std::cheatcodes::contract_class::DeclareResultTrait;\n    use snforge_std::declare;\n\n    #[test]\n    fn declare_contract_from_lib() {\n        let _ = declare(\"HelloStarknet\").unwrap().contract_class();\n        assert(2 == 2, 'Should declare');\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/targets/custom_target/tests/tests.cairo",
    "content": "use core::array::ArrayTrait;\nuse core::result::ResultTrait;\nuse custom_target::{IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait};\nuse snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::{ContractClassTrait, declare};\n\n#[test]\nfn declare_and_call_contract_from_lib() {\n    let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n    let constructor_calldata = @ArrayTrait::new();\n    let (contract_address, _) = contract.deploy(constructor_calldata).unwrap();\n    let dispatcher = IHelloStarknetDispatcher { contract_address };\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 0, 'balance == 0');\n\n    dispatcher.increase_balance(100);\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 100, 'balance != 100');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/targets/custom_target_custom_names/Scarb.toml",
    "content": "[package]\nname = \"custom_target_custom_names\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../../snforge_std\" }\n\n\n[[test]]\nname = \"custom_first\"\nkind = \"my_kind\"\nsource-path = \"./tests/tests.cairo\"\ntest-type = \"integration\"\nbuild-external-contracts = [\"custom_target_custom_names::*\"]\n\n[[test]]\nname = \"custom_second\"\nkind = \"my_other_kind\"\ntest-type = \"unit\"\n\n[tool.snforge]\nexit_first = false\n"
  },
  {
    "path": "crates/forge/tests/data/targets/custom_target_custom_names/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait IHelloStarknet<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n    fn do_a_panic(self: @TContractState);\n    fn do_a_panic_with(self: @TContractState, panic_data: Array<felt252>);\n}\n\n#[starknet::contract]\npub mod HelloStarknet {\n    use core::array::ArrayTrait;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl IHelloStarknetImpl of super::IHelloStarknet<ContractState> {\n        // Increases the balance by the given amount\n        fn increase_balance(ref self: ContractState, amount: felt252) {\n            self.balance.write(self.balance.read() + amount);\n        }\n\n        // Returns the current balance\n        fn get_balance(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n\n        // Panics\n        fn do_a_panic(self: @ContractState) {\n            let mut arr = ArrayTrait::new();\n            arr.append('PANIC');\n            arr.append('DAYTAH');\n            panic(arr);\n        }\n\n        // Panics with given array data\n        fn do_a_panic_with(self: @ContractState, panic_data: Array<felt252>) {\n            panic(panic_data);\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use snforge_std::cheatcodes::contract_class::DeclareResultTrait;\n    use snforge_std::declare;\n\n    #[test]\n    fn declare_contract_from_lib() {\n        let _ = declare(\"HelloStarknet\").unwrap().contract_class();\n        assert(2 == 2, 'Should declare');\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/targets/custom_target_custom_names/tests/tests.cairo",
    "content": "use core::array::ArrayTrait;\nuse core::result::ResultTrait;\nuse custom_target_custom_names::{IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait};\nuse snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::{ContractClassTrait, declare};\n\n#[test]\nfn declare_and_call_contract_from_lib() {\n    let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n    let constructor_calldata = @ArrayTrait::new();\n    let (contract_address, _) = contract.deploy(constructor_calldata).unwrap();\n    let dispatcher = IHelloStarknetDispatcher { contract_address };\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 0, 'balance == 0');\n\n    dispatcher.increase_balance(100);\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 100, 'balance != 100');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/targets/custom_target_only_integration/Scarb.toml",
    "content": "[package]\nname = \"custom_target_only_integration\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\n\n[[test]]\nname = \"custom_first\"\nkind = \"test\"\nsource-path = \"./tests/tests.cairo\"\ntest-type = \"integration\"\nbuild-external-contracts = [\"custom_target_only_integration::*\"]\n\n[tool.snforge]\nexit_first = false\n"
  },
  {
    "path": "crates/forge/tests/data/targets/custom_target_only_integration/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait IHelloStarknet<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n    fn do_a_panic(self: @TContractState);\n    fn do_a_panic_with(self: @TContractState, panic_data: Array<felt252>);\n}\n\n#[starknet::contract]\npub mod HelloStarknet {\n    use core::array::ArrayTrait;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl IHelloStarknetImpl of super::IHelloStarknet<ContractState> {\n        // Increases the balance by the given amount\n        fn increase_balance(ref self: ContractState, amount: felt252) {\n            self.balance.write(self.balance.read() + amount);\n        }\n\n        // Returns the current balance\n        fn get_balance(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n\n        // Panics\n        fn do_a_panic(self: @ContractState) {\n            let mut arr = ArrayTrait::new();\n            arr.append('PANIC');\n            arr.append('DAYTAH');\n            panic(arr);\n        }\n\n        // Panics with given array data\n        fn do_a_panic_with(self: @ContractState, panic_data: Array<felt252>) {\n            panic(panic_data);\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use snforge_std::cheatcodes::contract_class::DeclareResultTrait;\n    use snforge_std::declare;\n\n    #[test]\n    fn declare_contract_from_lib() {\n        let _ = declare(\"HelloStarknet\").unwrap().contract_class();\n        assert(2 == 2, 'Should declare');\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/targets/custom_target_only_integration/tests/tests.cairo",
    "content": "use core::array::ArrayTrait;\nuse core::result::ResultTrait;\nuse custom_target_only_integration::{IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait};\nuse snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::{ContractClassTrait, declare};\n\n#[test]\nfn declare_and_call_contract_from_lib() {\n    let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n    let constructor_calldata = @ArrayTrait::new();\n    let (contract_address, _) = contract.deploy(constructor_calldata).unwrap();\n    let dispatcher = IHelloStarknetDispatcher { contract_address };\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 0, 'balance == 0');\n\n    dispatcher.increase_balance(100);\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 100, 'balance != 100');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/targets/only_integration/Scarb.toml",
    "content": "[package]\nname = \"only_integration\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\n\n[tool.snforge]\nexit_first = false\n"
  },
  {
    "path": "crates/forge/tests/data/targets/only_integration/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait IHelloStarknet<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n    fn do_a_panic(self: @TContractState);\n    fn do_a_panic_with(self: @TContractState, panic_data: Array<felt252>);\n}\n\n#[starknet::contract]\npub mod HelloStarknet {\n    use core::array::ArrayTrait;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl IHelloStarknetImpl of super::IHelloStarknet<ContractState> {\n        // Increases the balance by the given amount\n        fn increase_balance(ref self: ContractState, amount: felt252) {\n            self.balance.write(self.balance.read() + amount);\n        }\n\n        // Returns the current balance\n        fn get_balance(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n\n        // Panics\n        fn do_a_panic(self: @ContractState) {\n            let mut arr = ArrayTrait::new();\n            arr.append('PANIC');\n            arr.append('DAYTAH');\n            panic(arr);\n        }\n\n        // Panics with given array data\n        fn do_a_panic_with(self: @ContractState, panic_data: Array<felt252>) {\n            panic(panic_data);\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/targets/only_integration/tests/tests.cairo",
    "content": "use core::array::ArrayTrait;\nuse core::result::ResultTrait;\nuse only_integration::{IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait};\nuse snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::{ContractClassTrait, declare};\n\n#[test]\nfn declare_and_call_contract_from_lib() {\n    let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n    let constructor_calldata = @ArrayTrait::new();\n    let (contract_address, _) = contract.deploy(constructor_calldata).unwrap();\n    let dispatcher = IHelloStarknetDispatcher { contract_address };\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 0, 'balance == 0');\n\n    dispatcher.increase_balance(100);\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 100, 'balance != 100');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/targets/only_lib_integration/Scarb.toml",
    "content": "[package]\nname = \"only_lib_integration\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\n\n[tool.snforge]\nexit_first = false\n"
  },
  {
    "path": "crates/forge/tests/data/targets/only_lib_integration/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait IHelloStarknet<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n    fn do_a_panic(self: @TContractState);\n    fn do_a_panic_with(self: @TContractState, panic_data: Array<felt252>);\n}\n\n#[starknet::contract]\npub mod HelloStarknet {\n    use core::array::ArrayTrait;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl IHelloStarknetImpl of super::IHelloStarknet<ContractState> {\n        // Increases the balance by the given amount\n        fn increase_balance(ref self: ContractState, amount: felt252) {\n            self.balance.write(self.balance.read() + amount);\n        }\n\n        // Returns the current balance\n        fn get_balance(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n\n        // Panics\n        fn do_a_panic(self: @ContractState) {\n            let mut arr = ArrayTrait::new();\n            arr.append('PANIC');\n            arr.append('DAYTAH');\n            panic(arr);\n        }\n\n        // Panics with given array data\n        fn do_a_panic_with(self: @ContractState, panic_data: Array<felt252>) {\n            panic(panic_data);\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/targets/only_lib_integration/tests/lib.cairo",
    "content": "mod tests;\n"
  },
  {
    "path": "crates/forge/tests/data/targets/only_lib_integration/tests/tests.cairo",
    "content": "use core::result::ResultTrait;\nuse only_lib_integration::{IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait};\nuse snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::{ContractClassTrait, declare};\n\n#[test]\nfn declare_and_call_contract_from_lib() {\n    let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n    let constructor_calldata = @ArrayTrait::new();\n    let (contract_address, _) = contract.deploy(constructor_calldata).unwrap();\n    let dispatcher = IHelloStarknetDispatcher { contract_address };\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 0, 'balance == 0');\n\n    dispatcher.increase_balance(100);\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 100, 'balance != 100');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/targets/only_unit/Scarb.toml",
    "content": "[package]\nname = \"only_unit\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\n\n[tool.snforge]\nexit_first = false\n"
  },
  {
    "path": "crates/forge/tests/data/targets/only_unit/src/lib.cairo",
    "content": "#[starknet::interface]\ntrait IHelloStarknet<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n    fn do_a_panic(self: @TContractState);\n    fn do_a_panic_with(self: @TContractState, panic_data: Array<felt252>);\n}\n\n#[starknet::contract]\nmod HelloStarknet {\n    use core::array::ArrayTrait;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl IHelloStarknetImpl of super::IHelloStarknet<ContractState> {\n        // Increases the balance by the given amount\n        fn increase_balance(ref self: ContractState, amount: felt252) {\n            self.balance.write(self.balance.read() + amount);\n        }\n\n        // Returns the current balance\n        fn get_balance(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n\n        // Panics\n        fn do_a_panic(self: @ContractState) {\n            let mut arr = ArrayTrait::new();\n            arr.append('PANIC');\n            arr.append('DAYTAH');\n            panic(arr);\n        }\n\n        // Panics with given array data\n        fn do_a_panic_with(self: @ContractState, panic_data: Array<felt252>) {\n            panic(panic_data);\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use snforge_std::cheatcodes::contract_class::DeclareResultTrait;\n    use snforge_std::declare;\n\n    #[test]\n    fn declare_contract_from_lib() {\n        let _ = declare(\"HelloStarknet\").unwrap().contract_class();\n        assert(2 == 2, 'Should declare');\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/targets/unit_and_integration/Scarb.toml",
    "content": "[package]\nname = \"unit_and_integration\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\n\n[tool.snforge]\nexit_first = false\n"
  },
  {
    "path": "crates/forge/tests/data/targets/unit_and_integration/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait IHelloStarknet<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n    fn do_a_panic(self: @TContractState);\n    fn do_a_panic_with(self: @TContractState, panic_data: Array<felt252>);\n}\n\n#[starknet::contract]\npub mod HelloStarknet {\n    use core::array::ArrayTrait;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl IHelloStarknetImpl of super::IHelloStarknet<ContractState> {\n        // Increases the balance by the given amount\n        fn increase_balance(ref self: ContractState, amount: felt252) {\n            self.balance.write(self.balance.read() + amount);\n        }\n\n        // Returns the current balance\n        fn get_balance(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n\n        // Panics\n        fn do_a_panic(self: @ContractState) {\n            let mut arr = ArrayTrait::new();\n            arr.append('PANIC');\n            arr.append('DAYTAH');\n            panic(arr);\n        }\n\n        // Panics with given array data\n        fn do_a_panic_with(self: @ContractState, panic_data: Array<felt252>) {\n            panic(panic_data);\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use snforge_std::cheatcodes::contract_class::DeclareResultTrait;\n    use snforge_std::declare;\n\n    #[test]\n    fn declare_contract_from_lib() {\n        let _ = declare(\"HelloStarknet\").unwrap().contract_class();\n        assert(2 == 2, 'Should declare');\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/targets/unit_and_integration/tests/tests.cairo",
    "content": "use core::array::ArrayTrait;\nuse core::result::ResultTrait;\nuse snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::{ContractClassTrait, declare};\nuse unit_and_integration::{IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait};\n\n#[test]\nfn declare_and_call_contract_from_lib() {\n    let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n    let constructor_calldata = @ArrayTrait::new();\n    let (contract_address, _) = contract.deploy(constructor_calldata).unwrap();\n    let dispatcher = IHelloStarknetDispatcher { contract_address };\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 0, 'balance == 0');\n\n    dispatcher.increase_balance(100);\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 100, 'balance != 100');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/targets/unit_and_lib_integration/Scarb.toml",
    "content": "[package]\nname = \"unit_and_lib_integration\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\n\n[tool.snforge]\nexit_first = false\n"
  },
  {
    "path": "crates/forge/tests/data/targets/unit_and_lib_integration/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait IHelloStarknet<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n    fn do_a_panic(self: @TContractState);\n    fn do_a_panic_with(self: @TContractState, panic_data: Array<felt252>);\n}\n\n#[starknet::contract]\nmod HelloStarknet {\n    use core::array::ArrayTrait;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl IHelloStarknetImpl of super::IHelloStarknet<ContractState> {\n        // Increases the balance by the given amount\n        fn increase_balance(ref self: ContractState, amount: felt252) {\n            self.balance.write(self.balance.read() + amount);\n        }\n\n        // Returns the current balance\n        fn get_balance(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n\n        // Panics\n        fn do_a_panic(self: @ContractState) {\n            let mut arr = ArrayTrait::new();\n            arr.append('PANIC');\n            arr.append('DAYTAH');\n            panic(arr);\n        }\n\n        // Panics with given array data\n        fn do_a_panic_with(self: @ContractState, panic_data: Array<felt252>) {\n            panic(panic_data);\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use snforge_std::cheatcodes::contract_class::DeclareResultTrait;\n    use snforge_std::declare;\n\n    #[test]\n    fn declare_contract_from_lib() {\n        let _ = declare(\"HelloStarknet\").unwrap().contract_class();\n        assert(2 == 2, 'Should declare');\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/targets/unit_and_lib_integration/tests/lib.cairo",
    "content": "mod tests;\n"
  },
  {
    "path": "crates/forge/tests/data/targets/unit_and_lib_integration/tests/tests.cairo",
    "content": "use core::array::ArrayTrait;\nuse core::result::ResultTrait;\nuse snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::{ContractClassTrait, declare};\nuse unit_and_lib_integration::{IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait};\n\n#[test]\nfn declare_and_call_contract_from_lib() {\n    let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n    let constructor_calldata = @ArrayTrait::new();\n    let (contract_address, _) = contract.deploy(constructor_calldata).unwrap();\n    let dispatcher = IHelloStarknetDispatcher { contract_address };\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 0, 'balance == 0');\n\n    dispatcher.increase_balance(100);\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 100, 'balance != 100');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/targets/with_features/Scarb.toml",
    "content": "[package]\nname = \"with_features\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\n\n[tool.snforge]\nexit_first = false\n\n[features]\nenable_for_tests = []\n"
  },
  {
    "path": "crates/forge/tests/data/targets/with_features/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait IHelloStarknet<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n    fn do_a_panic(self: @TContractState);\n    fn do_a_panic_with(self: @TContractState, panic_data: Array<felt252>);\n}\n\n#[cfg(feature: 'enable_for_tests')]\npub mod dummy {\n    #[starknet::contract]\n    pub mod HelloStarknet {\n        use core::array::ArrayTrait;\n        use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n        #[storage]\n        struct Storage {\n            balance: felt252,\n        }\n\n        #[abi(embed_v0)]\n        impl IHelloStarknetImpl of with_features::IHelloStarknet<ContractState> {\n            // Increases the balance by the given amount\n            fn increase_balance(ref self: ContractState, amount: felt252) {\n                self.balance.write(self.balance.read() + amount);\n            }\n\n            // Returns the current balance\n            fn get_balance(self: @ContractState) -> felt252 {\n                self.balance.read()\n            }\n\n            // Panics\n            fn do_a_panic(self: @ContractState) {\n                let mut arr = ArrayTrait::new();\n                arr.append('PANIC');\n                arr.append('DAYTAH');\n                panic(arr);\n            }\n\n            // Panics with given array data\n            fn do_a_panic_with(self: @ContractState, panic_data: Array<felt252>) {\n                panic(panic_data);\n            }\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use snforge_std::cheatcodes::contract_class::DeclareResultTrait;\n    use snforge_std::declare;\n\n    #[test]\n    fn declare_contract_from_lib() {\n        let _ = declare(\"HelloStarknet\").unwrap().contract_class();\n        assert(2 == 2, 'Should declare');\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/targets/with_features/tests/tests.cairo",
    "content": "use core::array::ArrayTrait;\nuse core::result::ResultTrait;\nuse snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::{ContractClassTrait, declare};\nuse with_features::{IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait};\n\n#[test]\nfn declare_and_call_contract_from_lib() {\n    let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n    let constructor_calldata = @ArrayTrait::new();\n    let (contract_address, _) = contract.deploy(constructor_calldata).unwrap();\n    let dispatcher = IHelloStarknetDispatcher { contract_address };\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 0, 'balance == 0');\n\n    dispatcher.increase_balance(100);\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 100, 'balance != 100');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/test_case/Scarb.toml",
    "content": "[package]\nname = \"test_case\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.10.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n"
  },
  {
    "path": "crates/forge/tests/data/test_case/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait IValueStorage<TContractState> {\n    fn set_value(ref self: TContractState, value: u128);\n    fn get_value(self: @TContractState) -> u128;\n}\n\n#[starknet::contract]\npub mod ValueStorage {\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        stored_value: u128,\n    }\n\n    #[abi(embed_v0)]\n    impl ValueStorageImpl of super::IValueStorage<ContractState> {\n        fn set_value(ref self: ContractState, value: u128) {\n            self.stored_value.write(value);\n        }\n\n        fn get_value(self: @ContractState) -> u128 {\n            self.stored_value.read()\n        }\n    }\n}\n\npub fn add(a: felt252, b: felt252) -> felt252 {\n    a + b\n}\n\npub fn fib(a: felt252, b: felt252, n: felt252) -> felt252 {\n    match n {\n        0 => a,\n        _ => fib(b, a + b, n - 1),\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/test_case/tests/exit_first.cairo",
    "content": "use test_case::fib;\n\n#[test]\n#[test_case(0, 1, 3)]\n#[test_case(0, 1, 500000)]\nfn test_fib_with_threshold(a: felt252, b: felt252, n: felt252) {\n    let threshold: u256 = 10;\n    let res = fib(a, b, n);\n    let res: u256 = res.try_into().unwrap();\n    assert!(res > threshold, \"result should be greater than threshold\");\n}\n"
  },
  {
    "path": "crates/forge/tests/data/test_case/tests/multiple_attributes.cairo",
    "content": "use test_case::add;\n\n#[test]\n#[test_case(1, 2, 3)]\n#[test_case(3, 4, 7)]\n#[available_gas(l2_gas: 40000000)]\nfn with_available_gas(a: felt252, b: felt252, expected: felt252) {\n    let result = add(a, b);\n    assert!(result == expected);\n}\n\n#[available_gas(l2_gas: 10000)]\n#[test_case(1, 2, 3)]\n#[test_case(3, 4, 7)]\n#[test]\nfn with_available_gas_exceed_limit(a: felt252, b: felt252, expected: felt252) {\n    let result = add(a, b);\n    assert!(result == expected);\n}\n\n\n#[test]\n#[should_panic(expected: 'panic message')]\n#[test_case(1, 2, 3)]\n#[test_case(3, 4, 7)]\nfn with_should_panic(a: felt252, b: felt252, expected: felt252) {\n    let x: i8 = -1;\n    assert(x > 0, 'panic message');\n}\n\n#[test]\n#[test_case(1, 2)]\n#[test_case(3, 4)]\n#[fuzzer]\nfn with_fuzzer(a: felt252, b: felt252) {\n    add(a, b);\n}\n\n#[test_case(1, 2)]\n#[test_case(3, 4)]\n#[test]\n#[fuzzer]\nfn with_fuzzer_different_order(a: felt252, b: felt252) {\n    add(a, b);\n}\n\n#[test]\n#[test_case(1, 2, 3)]\n#[ignore]\n#[test_case(3, 4, 7)]\nfn with_ignore(a: felt252, b: felt252, expected: felt252) {\n    let result = add(a, b);\n    assert!(result == expected);\n}\n"
  },
  {
    "path": "crates/forge/tests/data/test_case/tests/single_attribute.cairo",
    "content": "use test_case::add;\n\n#[test]\n#[test_case(1, 2, 3)]\n#[test_case(3, 4, 7)]\n#[test_case(5, 6, 11)]\nfn simple_addition(a: felt252, b: felt252, expected: felt252) {\n    let result = add(a, b);\n    assert!(result == expected);\n}\n\n#[test]\n#[test_case(name: \"one_and_two\", 1, 2, 3)]\n#[test_case(name: \"three_and_four\", 3, 4, 7)]\n#[test_case(name: \"five_and_six\", 5, 6, 11)]\nfn addition_with_name_arg(a: felt252, b: felt252, expected: felt252) {\n    let result = add(a, b);\n    assert!(result == expected);\n}\n\n"
  },
  {
    "path": "crates/forge/tests/data/test_case/tests/with_deploy.cairo",
    "content": "use snforge_std::{ContractClassTrait, DeclareResultTrait, declare};\nuse test_case::{IValueStorageDispatcher, IValueStorageDispatcherTrait};\n\n#[test]\n#[test_case(100)]\n#[test_case(42)]\n#[test_case(0)]\nfn with_contract_deploy(value: u128) {\n    let contract = declare(\"ValueStorage\").unwrap().contract_class();\n    let (contract_address, _) = contract.deploy(@array![]).unwrap();\n    let dispatcher = IValueStorageDispatcher { contract_address };\n\n    dispatcher.set_value(value);\n    assert!(dispatcher.get_value() == value, \"Value mismatch\");\n}\n\n#[test]\n#[fuzzer]\n#[test_case(123)]\n#[test_case(0)]\nfn with_fuzzer_and_contract_deploy(value: u128) {\n    let contract = declare(\"ValueStorage\").unwrap().contract_class();\n    let (contract_address, _) = contract.deploy(@array![]).unwrap();\n    let dispatcher = IValueStorageDispatcher { contract_address };\n\n    dispatcher.set_value(value);\n    assert!(dispatcher.get_value() == value, \"FAIL\");\n}\n\n"
  },
  {
    "path": "crates/forge/tests/data/trace/Scarb.toml",
    "content": "[package]\nname = \"trace_info\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.4.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n"
  },
  {
    "path": "crates/forge/tests/data/trace/src/lib.cairo",
    "content": "use starknet::ContractAddress;\n\n#[derive(Drop, Serde, Clone)]\npub struct RecursiveCall {\n    pub contract_address: ContractAddress,\n    pub payload: Array<RecursiveCall>,\n}\n\n#[starknet::interface]\npub trait RecursiveCaller<T> {\n    fn execute_calls(self: @T, calls: Array<RecursiveCall>);\n}\n\n#[starknet::interface]\npub trait Failing<TContractState> {\n    fn fail(self: @TContractState, data: Array<felt252>);\n}\n\n#[starknet::contract]\npub mod SimpleContract {\n    use core::array::ArrayTrait;\n    use super::{\n        Failing, RecursiveCall, RecursiveCaller, RecursiveCallerDispatcher,\n        RecursiveCallerDispatcherTrait,\n    };\n\n\n    #[storage]\n    struct Storage {}\n\n\n    #[abi(embed_v0)]\n    impl RecursiveCallerImpl of RecursiveCaller<ContractState> {\n        fn execute_calls(self: @ContractState, calls: Array<RecursiveCall>) {\n            let mut i = 0;\n            while i < calls.len() {\n                let serviced_call = calls.at(i);\n                RecursiveCallerDispatcher {\n                    contract_address: serviced_call.contract_address.clone(),\n                }\n                    .execute_calls(serviced_call.payload.clone());\n                i = i + 1;\n            }\n        }\n    }\n\n    #[abi(embed_v0)]\n    impl FailingImpl of Failing<ContractState> {\n        fn fail(self: @ContractState, data: Array<felt252>) {\n            panic(data);\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/trace/tests/test_trace.cairo",
    "content": "use core::panic_with_felt252;\nuse snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::trace::get_call_trace;\nuse snforge_std::{ContractClassTrait, declare};\nuse trace_info::{\n    FailingSafeDispatcher, FailingSafeDispatcherTrait, RecursiveCall, RecursiveCallerDispatcher,\n    RecursiveCallerDispatcherTrait,\n};\n\n#[test]\n#[feature(\"safe_dispatcher\")]\nfn test_trace() {\n    let sc = declare(\"SimpleContract\").unwrap().contract_class();\n\n    let (contract_address_A, _) = sc.deploy(@array![]).unwrap();\n    let (contract_address_B, _) = sc.deploy(@array![]).unwrap();\n    let (contract_address_C, _) = sc.deploy(@array![]).unwrap();\n\n    let calls = array![\n        RecursiveCall {\n            contract_address: contract_address_B,\n            payload: array![\n                RecursiveCall { contract_address: contract_address_C, payload: array![] },\n                RecursiveCall { contract_address: contract_address_C, payload: array![] },\n            ],\n        },\n        RecursiveCall { contract_address: contract_address_C, payload: array![] },\n    ];\n\n    RecursiveCallerDispatcher { contract_address: contract_address_A }.execute_calls(calls);\n\n    let failing_dispatcher = FailingSafeDispatcher { contract_address: contract_address_A };\n    match failing_dispatcher.fail(array![1, 2, 3, 4, 5]) {\n        Result::Ok(_) => panic_with_felt252('shouldve panicked'),\n        Result::Err(panic_data) => {\n            assert(panic_data == array![1, 2, 3, 4, 5, 0x454e545259504f494e545f4641494c4544], '');\n        },\n    }\n\n    println!(\"{}\", get_call_trace());\n}\n"
  },
  {
    "path": "crates/forge/tests/data/trace_resources/Scarb.toml",
    "content": "[package]\nname = \"trace_resources\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.4.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\n"
  },
  {
    "path": "crates/forge/tests/data/trace_resources/src/empty.cairo",
    "content": "#[starknet::contract]\nmod Empty {\n    #[storage]\n    struct Storage {}\n}\n"
  },
  {
    "path": "crates/forge/tests/data/trace_resources/src/lib.cairo",
    "content": "pub mod empty;\npub mod trace_dummy;\npub mod trace_info_checker;\npub mod trace_info_proxy;\nuse starknet::syscalls::{emit_event_syscall, get_block_hash_syscall, send_message_to_l1_syscall};\nuse starknet::{ClassHash, ContractAddress, SyscallResultTrait, get_contract_address};\n\npub fn use_builtins_and_syscalls(empty_hash: ClassHash, salt: felt252) -> ContractAddress {\n    1_u8 >= 1_u8;\n    1_u8 & 1_u8;\n    core::pedersen::pedersen(1, 2);\n    core::poseidon::hades_permutation(0, 0, 0);\n    let ec_point = core::ec::EcPointTrait::new_from_x(1).unwrap();\n    core::ec::EcPointTrait::mul(ec_point, 2);\n\n    core::keccak::keccak_u256s_le_inputs(array![1].span());\n\n    get_block_hash_syscall(1).unwrap_syscall();\n    starknet::syscalls::deploy_syscall(empty_hash, salt, array![].span(), false).unwrap_syscall();\n    emit_event_syscall(array![1].span(), array![2].span()).unwrap_syscall();\n    send_message_to_l1_syscall(10, array![20, 30].span()).unwrap_syscall();\n    let x = starknet::syscalls::storage_read_syscall(0, 10.try_into().unwrap()).unwrap_syscall();\n    starknet::syscalls::storage_write_syscall(0, 10.try_into().unwrap(), x).unwrap_syscall();\n\n    get_contract_address()\n}\n"
  },
  {
    "path": "crates/forge/tests/data/trace_resources/src/trace_dummy.cairo",
    "content": "#[starknet::interface]\npub trait ITraceDummy<T> {\n    fn from_proxy_dummy(ref self: T, empty_hash: starknet::ClassHash, salt: felt252);\n}\n\n#[starknet::contract]\nmod TraceDummy {\n    use starknet::ClassHash;\n    use super::super::use_builtins_and_syscalls;\n\n    #[storage]\n    struct Storage {\n        balance: u8,\n    }\n\n    #[abi(embed_v0)]\n    impl ITraceDummyImpl of super::ITraceDummy<ContractState> {\n        fn from_proxy_dummy(ref self: ContractState, empty_hash: ClassHash, salt: felt252) {\n            use_builtins_and_syscalls(empty_hash, salt);\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/trace_resources/src/trace_info_checker.cairo",
    "content": "use starknet::ClassHash;\n\n#[starknet::interface]\npub trait ITraceInfoChecker<T> {\n    fn from_proxy(ref self: T, data: felt252, empty_hash: ClassHash, salt: felt252) -> felt252;\n    fn panic(ref self: T, empty_hash: ClassHash, salt: felt252);\n}\n\n#[starknet::contract]\nmod TraceInfoChecker {\n    use core::panic_with_felt252;\n    use starknet::{ClassHash, ContractAddress};\n    use trace_resources::trace_info_proxy::{\n        ITraceInfoProxyDispatcher, ITraceInfoProxyDispatcherTrait,\n    };\n    use super::ITraceInfoChecker;\n    use super::super::use_builtins_and_syscalls;\n\n    #[storage]\n    struct Storage {\n        balance: u8,\n    }\n\n    #[abi(embed_v0)]\n    impl ITraceInfoChceckerImpl of ITraceInfoChecker<ContractState> {\n        fn from_proxy(\n            ref self: ContractState, data: felt252, empty_hash: ClassHash, salt: felt252,\n        ) -> felt252 {\n            use_builtins_and_syscalls(empty_hash, salt);\n\n            100 + data\n        }\n\n        fn panic(ref self: ContractState, empty_hash: ClassHash, salt: felt252) {\n            use_builtins_and_syscalls(empty_hash, salt);\n\n            panic_with_felt252('panic');\n        }\n    }\n\n    #[l1_handler]\n    fn handle_l1_message(\n        ref self: ContractState,\n        from_address: felt252,\n        proxy_address: ContractAddress,\n        empty_hash: ClassHash,\n        salt: felt252,\n    ) -> felt252 {\n        let my_address = use_builtins_and_syscalls(empty_hash, salt);\n\n        ITraceInfoProxyDispatcher { contract_address: proxy_address }\n            .regular_call(my_address, empty_hash, 10 * salt)\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/trace_resources/src/trace_info_proxy.cairo",
    "content": "use starknet::{ClassHash, ContractAddress};\n\n#[starknet::interface]\npub trait ITraceInfoProxy<T> {\n    fn with_libcall(\n        ref self: T, class_hash: ClassHash, empty_hash: ClassHash, salt: felt252,\n    ) -> felt252;\n    fn regular_call(\n        ref self: T, contract_address: ContractAddress, empty_hash: ClassHash, salt: felt252,\n    ) -> felt252;\n    fn with_panic(\n        ref self: T, contract_address: ContractAddress, empty_hash: ClassHash, salt: felt252,\n    );\n    fn call_two(\n        ref self: T,\n        checker_address: ContractAddress,\n        dummy_address: ContractAddress,\n        empty_hash: ClassHash,\n        salt: felt252,\n    );\n}\n\n#[starknet::contract]\nmod TraceInfoProxy {\n    use starknet::{ClassHash, ContractAddress};\n    use trace_resources::trace_dummy::{ITraceDummyDispatcher, ITraceDummyDispatcherTrait};\n    use trace_resources::trace_info_checker::{\n        ITraceInfoCheckerDispatcher, ITraceInfoCheckerDispatcherTrait,\n        ITraceInfoCheckerLibraryDispatcher,\n    };\n    use super::ITraceInfoProxy;\n    use super::super::use_builtins_and_syscalls;\n\n    #[storage]\n    struct Storage {\n        balance: u8,\n    }\n\n    #[constructor]\n    fn constructor(\n        ref self: ContractState,\n        contract_address: ContractAddress,\n        empty_hash: ClassHash,\n        salt: felt252,\n    ) {\n        use_builtins_and_syscalls(empty_hash, salt);\n\n        ITraceInfoCheckerDispatcher { contract_address }.from_proxy(1, empty_hash, 10 * salt);\n    }\n\n    #[abi(embed_v0)]\n    impl ITraceInfoProxyImpl of ITraceInfoProxy<ContractState> {\n        fn regular_call(\n            ref self: ContractState,\n            contract_address: ContractAddress,\n            empty_hash: ClassHash,\n            salt: felt252,\n        ) -> felt252 {\n            use_builtins_and_syscalls(empty_hash, salt);\n\n            ITraceInfoCheckerDispatcher { contract_address }.from_proxy(2, empty_hash, 10 * salt)\n        }\n\n        fn with_libcall(\n            ref self: ContractState, class_hash: ClassHash, empty_hash: ClassHash, salt: felt252,\n        ) -> felt252 {\n            use_builtins_and_syscalls(empty_hash, salt);\n\n            ITraceInfoCheckerLibraryDispatcher { class_hash }.from_proxy(3, empty_hash, 10 * salt)\n        }\n\n        fn with_panic(\n            ref self: ContractState,\n            contract_address: ContractAddress,\n            empty_hash: ClassHash,\n            salt: felt252,\n        ) {\n            use_builtins_and_syscalls(empty_hash, salt);\n\n            ITraceInfoCheckerDispatcher { contract_address }.panic(empty_hash, 10 * salt);\n            // unreachable code to check if we stop executing after panic\n            ITraceInfoCheckerDispatcher { contract_address }.from_proxy(5, empty_hash, 20 * salt);\n        }\n\n        fn call_two(\n            ref self: ContractState,\n            checker_address: ContractAddress,\n            dummy_address: ContractAddress,\n            empty_hash: ClassHash,\n            salt: felt252,\n        ) {\n            ITraceInfoCheckerDispatcher { contract_address: checker_address }\n                .from_proxy(42, empty_hash, 10 * salt);\n\n            use_builtins_and_syscalls(empty_hash, salt);\n\n            ITraceDummyDispatcher { contract_address: dummy_address }\n                .from_proxy_dummy(empty_hash, 20 * salt);\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/trace_resources/tests/lib.cairo",
    "content": "mod test_call;\nmod test_deploy;\nmod test_failed_call;\nmod test_failed_lib_call;\nmod test_l1_handler;\nmod test_lib_call;\n"
  },
  {
    "path": "crates/forge/tests/data/trace_resources/tests/test_call.cairo",
    "content": "use core::clone::Clone;\nuse snforge_std::{ContractClassTrait, DeclareResultTrait, declare};\nuse trace_resources::trace_info_checker::{\n    ITraceInfoCheckerDispatcher, ITraceInfoCheckerDispatcherTrait,\n};\nuse trace_resources::trace_info_proxy::{ITraceInfoProxyDispatcher, ITraceInfoProxyDispatcherTrait};\n\n#[test]\nfn test_call() {\n    let empty_hash = declare(\"Empty\").unwrap().contract_class().class_hash.clone();\n    let proxy = declare(\"TraceInfoProxy\").unwrap().contract_class();\n    let checker = declare(\"TraceInfoChecker\").unwrap().contract_class().clone();\n    let dummy = declare(\"TraceDummy\").unwrap().contract_class();\n\n    trace_resources::use_builtins_and_syscalls(empty_hash, 7);\n\n    let (checker_address, _) = checker.deploy(@array![]).unwrap();\n    let (proxy_address, _) = proxy\n        .deploy(@array![checker_address.into(), empty_hash.into(), 5])\n        .unwrap();\n    let (dummy_address, _) = dummy.deploy(@array![]).unwrap();\n\n    let proxy_dispatcher = ITraceInfoProxyDispatcher { contract_address: proxy_address };\n    proxy_dispatcher.regular_call(checker_address, empty_hash, 1);\n    proxy_dispatcher.with_libcall(checker.class_hash, empty_hash, 2);\n    proxy_dispatcher.call_two(checker_address, dummy_address, empty_hash, 3);\n\n    let chcecker_dispatcher = ITraceInfoCheckerDispatcher { contract_address: checker_address };\n    chcecker_dispatcher.from_proxy(4, empty_hash, 4);\n}\n"
  },
  {
    "path": "crates/forge/tests/data/trace_resources/tests/test_deploy.cairo",
    "content": "use core::clone::Clone;\nuse snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::{ContractClassTrait, declare};\nuse starknet::SyscallResultTrait;\nuse starknet::syscalls::deploy_syscall;\n\n#[test]\nfn test_deploy() {\n    let empty_hash = declare(\"Empty\").unwrap().contract_class().class_hash.clone();\n    let proxy = declare(\"TraceInfoProxy\").unwrap().contract_class().clone();\n    let checker = declare(\"TraceInfoChecker\").unwrap().contract_class();\n\n    trace_resources::use_builtins_and_syscalls(empty_hash, 7);\n\n    let (checker_address, _) = checker.deploy(@array![]).unwrap();\n\n    proxy.deploy(@array![checker_address.into(), empty_hash.into(), 1]).unwrap();\n\n    deploy_syscall(\n        proxy.class_hash, 0, array![checker_address.into(), empty_hash.into(), 2].span(), false,\n    )\n        .unwrap_syscall();\n\n    proxy\n        .deploy_at(@array![checker_address.into(), empty_hash.into(), 3], 123.try_into().unwrap())\n        .unwrap();\n\n    deploy_syscall(\n        proxy.class_hash, 12412, array![checker_address.into(), empty_hash.into(), 4].span(), false,\n    )\n        .unwrap_syscall();\n}\n"
  },
  {
    "path": "crates/forge/tests/data/trace_resources/tests/test_failed_call.cairo",
    "content": "use core::clone::Clone;\nuse core::panic_with_felt252;\nuse snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::{ContractClassTrait, declare};\nuse trace_resources::trace_info_checker::{\n    ITraceInfoCheckerSafeDispatcher, ITraceInfoCheckerSafeDispatcherTrait,\n};\nuse trace_resources::trace_info_proxy::{\n    ITraceInfoProxySafeDispatcher, ITraceInfoProxySafeDispatcherTrait,\n};\n\n#[test]\n#[feature(\"safe_dispatcher\")]\nfn test_failed_call() {\n    let empty_hash = declare(\"Empty\").unwrap().contract_class().class_hash.clone();\n    let proxy = declare(\"TraceInfoProxy\").unwrap().contract_class();\n    let checker = declare(\"TraceInfoChecker\").unwrap().contract_class();\n\n    trace_resources::use_builtins_and_syscalls(empty_hash, 7);\n\n    let (checker_address, _) = checker.deploy(@array![]).unwrap();\n    let (proxy_address, _) = proxy\n        .deploy(@array![checker_address.into(), empty_hash.into(), 1])\n        .unwrap();\n\n    let proxy_dispatcher = ITraceInfoProxySafeDispatcher { contract_address: proxy_address };\n    match proxy_dispatcher.with_panic(checker_address, empty_hash, 2) {\n        Result::Ok(_) => panic_with_felt252('shouldve panicked'),\n        Result::Err(panic_data) => { assert(*panic_data.at(0) == 'panic', *panic_data.at(0)); },\n    }\n\n    let chcecker_dispatcher = ITraceInfoCheckerSafeDispatcher { contract_address: checker_address };\n    match chcecker_dispatcher.panic(empty_hash, 3) {\n        Result::Ok(_) => panic_with_felt252('shouldve panicked'),\n        Result::Err(panic_data) => { assert(*panic_data.at(0) == 'panic', *panic_data.at(0)); },\n    };\n}\n"
  },
  {
    "path": "crates/forge/tests/data/trace_resources/tests/test_failed_lib_call.cairo",
    "content": "use core::clone::Clone;\nuse core::panic_with_felt252;\nuse snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::{ContractClassTrait, declare};\nuse trace_resources::trace_info_checker::{\n    ITraceInfoCheckerSafeDispatcherTrait, ITraceInfoCheckerSafeLibraryDispatcher,\n};\nuse trace_resources::trace_info_proxy::{\n    ITraceInfoProxySafeDispatcherTrait, ITraceInfoProxySafeLibraryDispatcher,\n};\n\n#[test]\n#[feature(\"safe_dispatcher\")]\nfn test_failed_lib_call() {\n    let empty_hash = declare(\"Empty\").unwrap().contract_class().class_hash.clone();\n    let proxy_hash = declare(\"TraceInfoProxy\").unwrap().contract_class().class_hash.clone();\n    let checker = declare(\"TraceInfoChecker\").unwrap().contract_class().clone();\n    let (checker_address, _) = checker.deploy(@array![]).unwrap();\n\n    trace_resources::use_builtins_and_syscalls(empty_hash, 7);\n\n    let proxy_lib_dispatcher = ITraceInfoProxySafeLibraryDispatcher { class_hash: proxy_hash };\n    match proxy_lib_dispatcher.with_panic(checker_address, empty_hash, 1) {\n        Result::Ok(_) => panic_with_felt252('shouldve panicked'),\n        Result::Err(panic_data) => { assert(*panic_data.at(0) == 'panic', *panic_data.at(0)); },\n    }\n\n    let chcecker_lib_dispatcher = ITraceInfoCheckerSafeLibraryDispatcher {\n        class_hash: checker.class_hash,\n    };\n    match chcecker_lib_dispatcher.panic(empty_hash, 2) {\n        Result::Ok(_) => panic_with_felt252('shouldve panicked'),\n        Result::Err(panic_data) => { assert(*panic_data.at(0) == 'panic', *panic_data.at(0)); },\n    };\n}\n"
  },
  {
    "path": "crates/forge/tests/data/trace_resources/tests/test_l1_handler.cairo",
    "content": "use core::clone::Clone;\nuse snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::{ContractClassTrait, L1HandlerTrait, declare};\n\n#[test]\nfn test_l1_handler() {\n    let empty_hash = declare(\"Empty\").unwrap().contract_class().class_hash.clone();\n    let proxy = declare(\"TraceInfoProxy\").unwrap().contract_class();\n    let checker = declare(\"TraceInfoChecker\").unwrap().contract_class();\n\n    trace_resources::use_builtins_and_syscalls(empty_hash, 7);\n\n    let (checker_address, _) = checker.deploy(@array![]).unwrap();\n    let (proxy_address, _) = proxy\n        .deploy(@array![checker_address.into(), empty_hash.into(), 1])\n        .unwrap();\n\n    let mut l1_handler = L1HandlerTrait::new(checker_address, selector!(\"handle_l1_message\"));\n\n    l1_handler.execute(123, array![proxy_address.into(), empty_hash.into(), 2].span()).unwrap();\n}\n"
  },
  {
    "path": "crates/forge/tests/data/trace_resources/tests/test_lib_call.cairo",
    "content": "use core::clone::Clone;\nuse snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::{ContractClassTrait, declare};\nuse trace_resources::trace_info_checker::{\n    ITraceInfoCheckerDispatcherTrait, ITraceInfoCheckerLibraryDispatcher,\n};\nuse trace_resources::trace_info_proxy::{\n    ITraceInfoProxyDispatcherTrait, ITraceInfoProxyLibraryDispatcher,\n};\n\n#[test]\nfn test_lib_call() {\n    let empty_hash = declare(\"Empty\").unwrap().contract_class().class_hash.clone();\n    let proxy_hash = declare(\"TraceInfoProxy\").unwrap().contract_class().class_hash.clone();\n    let checker = declare(\"TraceInfoChecker\").unwrap().contract_class().clone();\n    let dummy = declare(\"TraceDummy\").unwrap().contract_class();\n\n    trace_resources::use_builtins_and_syscalls(empty_hash, 7);\n\n    let (checker_address, _) = checker.deploy(@array![]).unwrap();\n    let (dummy_address, _) = dummy.deploy(@array![]).unwrap();\n\n    let proxy_lib_dispatcher = ITraceInfoProxyLibraryDispatcher { class_hash: proxy_hash };\n\n    proxy_lib_dispatcher.regular_call(checker_address, empty_hash, 1);\n    proxy_lib_dispatcher.with_libcall(checker.class_hash, empty_hash, 2);\n    proxy_lib_dispatcher.call_two(checker_address, dummy_address, empty_hash, 3);\n\n    let chcecker_lib_dispatcher = ITraceInfoCheckerLibraryDispatcher {\n        class_hash: checker.class_hash,\n    };\n\n    chcecker_lib_dispatcher.from_proxy(4, empty_hash, 4);\n}\n"
  },
  {
    "path": "crates/forge/tests/data/virtual_workspace/Scarb.toml",
    "content": "[workspace]\nmembers = [\n    \"dummy_name/*\",\n]\n\n[workspace.scripts]\ntest = \"snforge\"\n\n[workspace.tool.snforge]\nexit_first = true\n\n[workspace.dependencies]\nstarknet = \"2.4.0\"\nsnforge_std = { path = \"../../../../../snforge_std\" }\n\n[workspace.package]\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[scripts]\ntest.workspace = true\n\n[tool]\nsnforge.workspace = true\n\n[[target.starknet-contract]]\n"
  },
  {
    "path": "crates/forge/tests/data/virtual_workspace/dummy_name/fibonacci_virtual/Scarb.toml",
    "content": "[package]\nname = \"fibonacci_virtual\"\nversion.workspace = true\nedition = \"2024_07\"\n\n[scripts]\ntest.workspace = true\n\n[tool]\nsnforge.workspace = true\n\n[dependencies]\nsubtraction = { path = \"../subtraction\" }\nstarknet.workspace = true\n\n[dev-dependencies]\nsnforge_std.workspace = true\n\n[[target.starknet-contract]]\n\nbuild-external-contracts = [\"subtraction::SubtractionContract\"]\n"
  },
  {
    "path": "crates/forge/tests/data/virtual_workspace/dummy_name/fibonacci_virtual/src/lib.cairo",
    "content": "use subtraction::subtract;\n\nfn fib(a: felt252, b: felt252, n: felt252) -> felt252 {\n    match n {\n        0 => a,\n        _ => fib(b, subtract(a, -b), n - 1),\n    }\n}\n\n#[starknet::interface]\ntrait IFibonacciContract<TContractState> {\n    fn answer(ref self: TContractState) -> felt252;\n}\n\n#[starknet::contract]\nmod FibonacciContract {\n    use subtraction::subtract;\n    use super::fib;\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl FibonacciContractImpl of super::IFibonacciContract<ContractState> {\n        fn answer(ref self: ContractState) -> felt252 {\n            subtract(fib(0, 1, 16), fib(0, 1, 8))\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use snforge_std::declare;\n    use super::fib;\n\n    #[test]\n    fn it_works() {\n        assert(fib(0, 1, 16) == 987, 'it works!');\n    }\n\n    #[test]\n    fn contract_test() {\n        declare(\"FibonacciContract\").unwrap();\n        declare(\"SubtractionContract\").unwrap();\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/virtual_workspace/dummy_name/fibonacci_virtual/tests/abc/efg.cairo",
    "content": "#[test]\nfn efg_test() {\n    assert(super::foo() == 1, '');\n}\n\n#[test]\nfn failing_test() {\n    assert(1 == 2, '');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/virtual_workspace/dummy_name/fibonacci_virtual/tests/abc.cairo",
    "content": "mod efg;\n\n#[test]\nfn abc_test() {\n    assert(foo() == 1, '');\n}\n\npub fn foo() -> u8 {\n    1\n}\n"
  },
  {
    "path": "crates/forge/tests/data/virtual_workspace/dummy_name/fibonacci_virtual/tests/lib.cairo",
    "content": "mod abc;\n\n#[test]\nfn lib_test() {\n    assert(abc::foo() == 1, '');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/virtual_workspace/dummy_name/fibonacci_virtual/tests/not_collected.cairo",
    "content": "// should not be collected\n\n#[test]\nfn not_collected() {\n    assert(1 == 1, '');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/virtual_workspace/dummy_name/subtraction/Scarb.toml",
    "content": "[package]\nname = \"subtraction\"\nversion.workspace = true\nedition = \"2024_07\"\n\n[dependencies]\nstarknet.workspace = true\n\n[dev-dependencies]\nsnforge_std.workspace = true\n\n[[target.starknet-contract]]\n\n[lib]\n"
  },
  {
    "path": "crates/forge/tests/data/virtual_workspace/dummy_name/subtraction/src/lib.cairo",
    "content": "pub fn subtract(a: felt252, b: felt252) -> felt252 {\n    a - b\n}\n\n#[starknet::interface]\ntrait ISubtractionContract<TContractState> {\n    fn answer(ref self: TContractState) -> felt252;\n}\n\n#[starknet::contract]\nmod SubtractionContract {\n    use super::subtract;\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl SubtractionContractImpl of super::ISubtractionContract<ContractState> {\n        fn answer(ref self: ContractState) -> felt252 {\n            subtract(10, 20)\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::subtract;\n\n    #[test]\n    fn it_works() {\n        assert(subtract(3, 2) == 1, 'it works!');\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/data/virtual_workspace/dummy_name/subtraction/tests/nested/test_nested.cairo",
    "content": "use super::foo;\n\n#[test]\nfn test_two() {\n    assert(foo() == 2, 'foo() == 2');\n}\n\n#[test]\nfn test_two_and_two() {\n    assert(2 == 2, '2 == 2');\n    assert(2 == 2, '2 == 2');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/virtual_workspace/dummy_name/subtraction/tests/nested.cairo",
    "content": "use snforge_std::declare;\n\nmod test_nested;\n\nfn foo() -> u8 {\n    2\n}\n\n#[test]\nfn simple_case() {\n    assert(1 == 1, 'simple check');\n}\n\n#[test]\nfn contract_test() {\n    declare(\"SubtractionContract\").unwrap();\n}\n"
  },
  {
    "path": "crates/forge/tests/data/virtual_workspace/not_collected.cairo",
    "content": "// This file shouldn't be collected\n\n#[test]\nfn test_simple() {\n    assert(1 == 1, 'simple check');\n}\n"
  },
  {
    "path": "crates/forge/tests/data/wasm_oracles/Scarb.toml",
    "content": "[package]\nname = \"oracles\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\nassets = [\"wasm_oracle.wasm\"]\n\n[dependencies]\noracle = \"1\"\nstarknet = \"2.4.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../../../snforge_std\" }\n"
  },
  {
    "path": "crates/forge/tests/data/wasm_oracles/build-fixtures.sh",
    "content": "#!/usr/bin/env sh\nset -ex\n\n# Run this script to generate wasm fixtures from their sources.\n# Prebuilt fixtures are expected to be committed to the repository.\n\ncd \"$(dirname \"$0\")\"\n\ncargo build --manifest-path=wasm_oracle/Cargo.toml --release --target wasm32-wasip2\ncp wasm_oracle/target/wasm32-wasip2/release/wasm_oracle.wasm .\n"
  },
  {
    "path": "crates/forge/tests/data/wasm_oracles/src/lib.cairo",
    "content": "\n"
  },
  {
    "path": "crates/forge/tests/data/wasm_oracles/tests/test.cairo",
    "content": "use core::panics::panic_with_byte_array;\n\nmod wasm_oracle {\n    pub fn add(left: u64, right: u64) -> oracle::Result<u64> {\n        oracle::invoke(\"wasm:wasm_oracle.wasm\", \"add\", (left, right))\n    }\n\n    pub fn err() -> oracle::Result<Result<ByteArray, ByteArray>> {\n        oracle::invoke(\"wasm:wasm_oracle.wasm\", \"err\", ())\n    }\n\n    pub fn panic() -> oracle::Result<Result<ByteArray, ByteArray>> {\n        oracle::invoke(\"wasm:wasm_oracle.wasm\", \"panic\", ())\n    }\n}\n\n#[test]\nfn add() {\n    assert!(wasm_oracle::add(2, 3) == Ok(5));\n}\n\n#[test]\nfn err() {\n    assert!(wasm_oracle::err() == Ok(Err(\"failed hard\")));\n}\n\n#[should_panic]\n#[test]\nfn panic() {\n    wasm_oracle::panic().unwrap().unwrap();\n}\n\n#[test]\nfn unexpected_panic() {\n    wasm_oracle::panic().unwrap().unwrap();\n}\n\n#[test]\nfn panic_contents() {\n    let err = wasm_oracle::panic().unwrap_err();\n    // Panic with error so we get better error than \"unwrap failed\"\n    panic_with_byte_array(@format!(\"{}\", err))\n}\n"
  },
  {
    "path": "crates/forge/tests/data/wasm_oracles/wasm_oracle/Cargo.toml",
    "content": "[workspace]\n\n[package]\nname = \"wasm_oracle\"\nversion = \"0.1.0\"\nedition = \"2024\"\n\n[lib]\ncrate-type = [\"cdylib\"]\n\n[dependencies]\nwit-bindgen = \"0.46.0\"\n"
  },
  {
    "path": "crates/forge/tests/data/wasm_oracles/wasm_oracle/src/lib.rs",
    "content": "wit_bindgen::generate!({\n    inline: r#\"\n        package testing:oracle;\n\n        world oracle {\n            export add: func(left: u64, right: u64) -> u64;\n            export err: func() -> result<string, string>;\n            export panic: func() -> result<string, string>;\n        }\n    \"#\n});\n\nstruct MyOracle;\n\nimpl Guest for MyOracle {\n    fn add(left: u64, right: u64) -> u64 {\n        left + right\n    }\n\n    fn err() -> Result<String, String> {\n        Err(\"failed hard\".into())\n    }\n\n    fn panic() -> Result<String, String> {\n        panic!(\"panicked\")\n    }\n}\n\nexport!(MyOracle);\n"
  },
  {
    "path": "crates/forge/tests/e2e/backtrace.rs",
    "content": "use super::common::runner::{setup_package, test_runner};\nuse crate::assert_cleaned_output;\nuse assert_fs::TempDir;\nuse assert_fs::fixture::{FileWriteStr, PathChild};\nuse indoc::indoc;\nuse shared::test_utils::output_assert::{AsOutput, assert_stdout_contains};\nuse std::fs;\nuse toml_edit::{DocumentMut, value};\n\n#[test]\nfn test_backtrace_missing_env() {\n    let temp = setup_package(\"backtrace_vm_error\");\n\n    let output = test_runner(&temp).assert().failure();\n\n    assert_stdout_contains(\n        output,\n        indoc! {\n           \"Failure data:\n            Got an exception while executing a hint: Requested contract address 0x0000000000000000000000000000000000000000000000000000000000000123 is not deployed.\n            note: run with `SNFORGE_BACKTRACE=1` environment variable to display a backtrace\"\n        },\n    );\n}\n\n#[cfg_attr(not(feature = \"cairo-native\"), ignore)]\n#[test]\nfn test_backtrace_native_execution() {\n    let temp = setup_package(\"backtrace_vm_error\");\n\n    let output = test_runner(&temp)\n        .arg(\"--run-native\")\n        .env(\"SNFORGE_BACKTRACE\", \"1\")\n        .assert()\n        .code(2);\n\n    assert_stdout_contains(\n        output,\n        \"[ERROR] Backtrace generation is not supported with `cairo-native` execution\\n\",\n    );\n}\n\n#[test]\nfn snap_test_backtrace() {\n    let temp = setup_package(\"backtrace_vm_error\");\n\n    let output = test_runner(&temp)\n        .env(\"SNFORGE_BACKTRACE\", \"1\")\n        .env(\"SNFORGE_DETERMINISTIC_OUTPUT\", \"1\")\n        .assert()\n        .failure();\n\n    assert_cleaned_output!(output);\n}\n\n#[test]\nfn snap_test_backtrace_without_inlines() {\n    let temp = setup_package(\"backtrace_vm_error\");\n    without_inlines(&temp);\n\n    let output = test_runner(&temp)\n        .env(\"SNFORGE_BACKTRACE\", \"1\")\n        .env(\"SNFORGE_DETERMINISTIC_OUTPUT\", \"1\")\n        .assert()\n        .failure();\n\n    assert_cleaned_output!(output);\n}\n\n#[test]\nfn test_wrong_scarb_toml_configuration() {\n    let temp = setup_package(\"backtrace_vm_error\");\n\n    let manifest_path = temp.child(\"Scarb.toml\");\n\n    let mut scarb_toml = fs::read_to_string(&manifest_path)\n        .unwrap()\n        .parse::<DocumentMut>()\n        .unwrap();\n\n    scarb_toml[\"profile\"][\"dev\"][\"cairo\"][\"unstable-add-statements-code-locations-debug-info\"] =\n        value(false);\n\n    manifest_path.write_str(&scarb_toml.to_string()).unwrap();\n\n    let output = test_runner(&temp)\n        .env(\"SNFORGE_BACKTRACE\", \"1\")\n        .assert()\n        .failure();\n\n    assert_stdout_contains(\n        output,\n        indoc! {\n           \"[ERROR] Scarb.toml must have the following Cairo compiler configuration to run backtrace:\n\n            [profile.dev.cairo]\n            unstable-add-statements-functions-debug-info = true\n            unstable-add-statements-code-locations-debug-info = true\n            panic-backtrace = true\n            ... other entries ...\"\n        },\n    );\n}\n\n#[test]\nfn snap_test_backtrace_panic() {\n    let temp = setup_package(\"backtrace_panic\");\n\n    let output = test_runner(&temp)\n        .env(\"SNFORGE_BACKTRACE\", \"1\")\n        .env(\"SNFORGE_DETERMINISTIC_OUTPUT\", \"1\")\n        .assert()\n        .failure();\n\n    assert_cleaned_output!(output);\n}\n\n#[test]\nfn snap_test_backtrace_panic_without_optimizations() {\n    let temp = setup_package(\"backtrace_panic\");\n\n    let manifest_path = temp.child(\"Scarb.toml\");\n\n    let mut scarb_toml = fs::read_to_string(&manifest_path)\n        .unwrap()\n        .parse::<DocumentMut>()\n        .unwrap();\n\n    scarb_toml[\"cairo\"][\"skip-optimizations\"] = value(true);\n    manifest_path.write_str(&scarb_toml.to_string()).unwrap();\n\n    let output = test_runner(&temp)\n        .env(\"SNFORGE_BACKTRACE\", \"1\")\n        .env(\"SNFORGE_DETERMINISTIC_OUTPUT\", \"1\")\n        .assert()\n        .failure();\n\n    assert_cleaned_output!(output);\n}\n\n#[test]\nfn snap_test_backtrace_panic_without_inlines() {\n    let temp = setup_package(\"backtrace_panic\");\n    without_inlines(&temp);\n\n    let output = test_runner(&temp)\n        .env(\"SNFORGE_BACKTRACE\", \"1\")\n        .env(\"SNFORGE_DETERMINISTIC_OUTPUT\", \"1\")\n        .assert()\n        .failure();\n\n    assert_cleaned_output!(output);\n}\n\n#[test]\nfn snap_test_handled_error_not_display() {\n    let temp = setup_package(\"dispatchers\");\n\n    let output = test_runner(&temp)\n        .arg(\"test_handle_and_panic\")\n        .env(\"SNFORGE_BACKTRACE\", \"1\")\n        .env(\"SNFORGE_DETERMINISTIC_OUTPUT\", \"1\")\n        .assert()\n        .success();\n\n    // Error from the `FailableContract` should not appear in the output\n    assert!(\n        !output\n            .as_stdout()\n            .contains(\"error occurred in contract 'FailableContract'\")\n    );\n\n    assert_cleaned_output!(output);\n}\n\nfn without_inlines(temp_dir: &TempDir) {\n    let manifest_path = temp_dir.child(\"Scarb.toml\");\n\n    let mut scarb_toml = fs::read_to_string(&manifest_path)\n        .unwrap()\n        .parse::<DocumentMut>()\n        .unwrap();\n\n    scarb_toml[\"profile\"][\"dev\"][\"cairo\"][\"inlining-strategy\"] = value(\"avoid\");\n\n    manifest_path.write_str(&scarb_toml.to_string()).unwrap();\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/build_profile.rs",
    "content": "use super::common::runner::{setup_package, test_runner};\nuse forge_runner::profiler_api::PROFILE_DIR;\n\n#[test]\nfn simple_package_build_profile() {\n    let temp = setup_package(\"simple_package\");\n\n    test_runner(&temp).arg(\"--build-profile\").assert().code(1);\n\n    assert!(\n        temp.join(PROFILE_DIR)\n            .join(\"simple_package_tests_test_fib.pb.gz\")\n            .is_file()\n    );\n    assert!(\n        !temp\n            .join(PROFILE_DIR)\n            .join(\"simple_package_integrationtest_test_simple_test_failing.pb.gz\")\n            .is_file()\n    );\n    assert!(\n        !temp\n            .join(PROFILE_DIR)\n            .join(\"simple_package_tests_ignored_test.pb.gz\")\n            .is_file()\n    );\n    assert!(\n        temp.join(PROFILE_DIR)\n            .join(\"simple_package_integrationtest_ext_function_test_test_simple.pb.gz\")\n            .is_file()\n    );\n\n    // Check if it doesn't crash in case some data already exists\n    test_runner(&temp).arg(\"--build-profile\").assert().code(1);\n}\n\n#[test]\nfn simple_package_build_profile_and_pass_args() {\n    let temp = setup_package(\"simple_package\");\n\n    test_runner(&temp)\n        .arg(\"--build-profile\")\n        .arg(\"--\")\n        .arg(\"--output-path\")\n        .arg(\"my_file.pb.gz\")\n        .assert()\n        .code(1);\n\n    assert!(temp.join(\"my_file.pb.gz\").is_file());\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/build_trace_data.rs",
    "content": "use super::common::runner::{setup_package, test_runner};\nuse crate::e2e::common::get_trace_from_trace_node;\nuse cairo_annotations::trace_data::{\n    CallTraceNode as ProfilerCallTraceNode, CallTraceV1 as ProfilerCallTrace,\n    VersionedCallTrace as VersionedProfilerCallTrace,\n};\nuse cairo_lang_sierra::program::VersionedProgram;\nuse cairo_lang_starknet_classes::contract_class::ContractClass;\nuse forge_runner::build_trace_data::{TEST_CODE_CONTRACT_NAME, TEST_CODE_FUNCTION_NAME, TRACE_DIR};\nuse std::fs;\n\n#[test]\nfn simple_package_save_trace() {\n    let temp = setup_package(\"simple_package\");\n    test_runner(&temp).arg(\"--save-trace-data\").assert().code(1);\n\n    assert!(\n        temp.join(TRACE_DIR)\n            .join(\"simple_package_tests_test_fib.json\")\n            .exists()\n    );\n    assert!(\n        !temp\n            .join(TRACE_DIR)\n            .join(\"simple_package_integrationtest_test_simple_test_failing.json\")\n            .exists()\n    );\n    assert!(\n        !temp\n            .join(TRACE_DIR)\n            .join(\"simple_package_tests_ignored_test.json\")\n            .exists()\n    );\n    assert!(\n        temp.join(TRACE_DIR)\n            .join(\"simple_package_integrationtest_ext_function_test_test_simple.json\")\n            .exists()\n    );\n\n    let trace_data = fs::read_to_string(\n        temp.join(TRACE_DIR)\n            .join(\"simple_package_integrationtest_ext_function_test_test_simple.json\"),\n    )\n    .unwrap();\n\n    let VersionedProfilerCallTrace::V1(call_trace) =\n        serde_json::from_str(&trace_data).expect(\"Failed to parse call_trace\");\n\n    assert!(call_trace.nested_calls.is_empty());\n\n    // Check if it doesn't crash in case some data already exists\n    test_runner(&temp).arg(\"--save-trace-data\").assert().code(1);\n}\n\n#[test]\nfn trace_has_contract_and_function_names() {\n    let temp = setup_package(\"trace\");\n    test_runner(&temp)\n        .arg(\"--save-trace-data\")\n        .assert()\n        .success();\n\n    let trace_data = fs::read_to_string(\n        temp.join(TRACE_DIR)\n            .join(\"trace_info_integrationtest_test_trace_test_trace.json\"),\n    )\n    .unwrap();\n\n    let call_trace: ProfilerCallTrace =\n        serde_json::from_str(&trace_data).expect(\"Failed to parse call_trace\");\n\n    assert_eq!(\n        call_trace.entry_point.contract_name,\n        Some(String::from(TEST_CODE_CONTRACT_NAME))\n    );\n    assert_eq!(\n        call_trace.entry_point.function_name,\n        Some(String::from(TEST_CODE_FUNCTION_NAME))\n    );\n    assert_contract_and_function_names(get_trace_from_trace_node(&call_trace.nested_calls[3]));\n}\n\nfn assert_contract_and_function_names(trace: &ProfilerCallTrace) {\n    // every call in this package uses the same contract and function\n    assert_eq!(\n        trace.entry_point.contract_name,\n        Some(String::from(\"SimpleContract\"))\n    );\n    assert_eq!(\n        trace.entry_point.function_name,\n        Some(String::from(\"execute_calls\"))\n    );\n\n    for sub_trace_node in &trace.nested_calls {\n        assert_contract_and_function_names(get_trace_from_trace_node(sub_trace_node));\n    }\n}\n\n#[test]\nfn trace_has_cairo_execution_info() {\n    let temp = setup_package(\"trace\");\n    let snapbox = test_runner(&temp);\n\n    snapbox\n        .arg(\"--save-trace-data\")\n        .current_dir(&temp)\n        .assert()\n        .success();\n\n    let trace_data = fs::read_to_string(\n        temp.join(TRACE_DIR)\n            .join(\"trace_info_integrationtest_test_trace_test_trace.json\"),\n    )\n    .unwrap();\n\n    let call_trace: ProfilerCallTrace =\n        serde_json::from_str(&trace_data).expect(\"Failed to parse call_trace\");\n\n    assert_cairo_execution_info_exists(&call_trace);\n}\n\nfn assert_cairo_execution_info_exists(trace: &ProfilerCallTrace) {\n    if let Some(cairo_execution_info) = trace.cairo_execution_info.as_ref() {\n        let sierra_string = fs::read_to_string(&cairo_execution_info.source_sierra_path).unwrap();\n\n        assert!(\n            serde_json::from_str::<VersionedProgram>(&sierra_string).is_ok()\n                || serde_json::from_str::<ContractClass>(&sierra_string).is_ok()\n        );\n    } else {\n        assert_eq!(trace.entry_point.function_name, Some(String::from(\"fail\")));\n    }\n\n    for sub_trace_node in &trace.nested_calls {\n        if let ProfilerCallTraceNode::EntryPointCall(sub_trace) = sub_trace_node {\n            assert_cairo_execution_info_exists(sub_trace);\n        }\n    }\n}\n\n#[test]\nfn trace_has_deploy_with_no_constructor_phantom_nodes() {\n    let temp = setup_package(\"trace\");\n    let snapbox = test_runner(&temp);\n\n    snapbox\n        .arg(\"--save-trace-data\")\n        .current_dir(&temp)\n        .assert()\n        .success();\n\n    let trace_data = fs::read_to_string(\n        temp.join(TRACE_DIR)\n            .join(\"trace_info_integrationtest_test_trace_test_trace.json\"),\n    )\n    .unwrap();\n\n    let call_trace: ProfilerCallTrace =\n        serde_json::from_str(&trace_data).expect(\"Failed to parse call_trace\");\n\n    // 3 first calls are deploys with empty constructors\n    matches!(\n        call_trace.nested_calls[0],\n        cairo_annotations::trace_data::CallTraceNode::DeployWithoutConstructor\n    );\n    matches!(\n        call_trace.nested_calls[1],\n        cairo_annotations::trace_data::CallTraceNode::DeployWithoutConstructor\n    );\n    matches!(\n        call_trace.nested_calls[2],\n        cairo_annotations::trace_data::CallTraceNode::DeployWithoutConstructor\n    );\n}\n\n#[test]\nfn trace_is_produced_even_if_contract_panics() {\n    fn assert_all_execution_info_exists(trace: &ProfilerCallTrace) {\n        assert!(trace.cairo_execution_info.is_some());\n\n        for trace_node in &trace.nested_calls {\n            if let ProfilerCallTraceNode::EntryPointCall(trace) = trace_node {\n                assert_all_execution_info_exists(trace);\n            }\n        }\n    }\n    let temp = setup_package(\"backtrace_panic\");\n    test_runner(&temp)\n        .arg(\"--save-trace-data\")\n        .arg(\"--ignored\")\n        .assert()\n        .success();\n\n    let trace_data = fs::read_to_string(\n        temp.join(TRACE_DIR)\n            .join(\"backtrace_panic_Test_test_contract_panics_with_should_panic.json\"),\n    )\n    .unwrap();\n\n    let call_trace: ProfilerCallTrace = serde_json::from_str(&trace_data).unwrap();\n\n    assert_all_execution_info_exists(&call_trace);\n}\n\n#[test]\nfn trace_contains_human_readable_form_of_selectors_for_forks() {\n    fn assert_selectors_in_trace_exist(trace: &ProfilerCallTrace) {\n        assert!(trace.entry_point.function_name.is_some());\n\n        for trace_node in &trace.nested_calls {\n            if let ProfilerCallTraceNode::EntryPointCall(trace) = trace_node {\n                assert_selectors_in_trace_exist(trace);\n            }\n        }\n    }\n    let temp = setup_package(\"debugging_fork\");\n    test_runner(&temp).arg(\"--save-trace-data\").assert().code(1);\n\n    let trace_data = fs::read_to_string(\n        temp.join(TRACE_DIR)\n            .join(\"debugging_fork_integrationtest_test_trace_test_debugging_trace_success.json\"),\n    )\n    .unwrap();\n\n    let call_trace: ProfilerCallTrace = serde_json::from_str(&trace_data).unwrap();\n    assert_selectors_in_trace_exist(&call_trace);\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/clean.rs",
    "content": "use super::common::runner::{runner, setup_package, test_runner};\nuse assert_fs::TempDir;\nuse camino::Utf8PathBuf;\nuse scarb_api::metadata::{MetadataOpts, metadata_with_opts};\nuse shared::test_utils::output_assert::assert_stdout_contains;\nuse std::path::Path;\n\nconst COVERAGE_DIR: &str = \"coverage\";\nconst PROFILE_DIR: &str = \"profile\";\nconst CACHE_DIR: &str = \".snfoundry_cache\";\nconst TRACE_DIR: &str = \"snfoundry_trace\";\n\n#[expect(clippy::struct_excessive_bools)]\n#[derive(Debug, PartialEq, Eq, Copy, Clone)]\nstruct CleanComponentsState {\n    coverage: bool,\n    profile: bool,\n    cache: bool,\n    trace: bool,\n}\n\n#[test]\n#[cfg_attr(\n    feature = \"cairo-native\",\n    ignore = \"Native doesn't support coverage yet\"\n)]\nfn test_clean_coverage() {\n    let temp_dir = setup_package(\"coverage_project\");\n\n    let clean_components_state = CleanComponentsState {\n        coverage: true,\n        profile: false,\n        cache: true,\n        trace: true,\n    };\n\n    generate_clean_components(clean_components_state, &temp_dir);\n\n    runner(&temp_dir)\n        .arg(\"clean\")\n        .arg(\"coverage\")\n        .arg(\"trace\")\n        .assert()\n        .success();\n\n    let expected_state = CleanComponentsState {\n        coverage: false,\n        profile: false,\n        cache: true,\n        trace: false,\n    };\n\n    assert_eq!(\n        check_clean_components_state(temp_dir.path()),\n        expected_state\n    );\n}\n\n#[test]\n#[cfg_attr(\n    feature = \"cairo-native\",\n    ignore = \"Native doesn't support profiler yet\"\n)]\nfn test_clean_profile() {\n    let temp_dir = setup_package(\"coverage_project\");\n\n    let clean_components_state = CleanComponentsState {\n        coverage: false,\n        profile: true,\n        cache: true,\n        trace: true,\n    };\n\n    generate_clean_components(clean_components_state, &temp_dir);\n\n    runner(&temp_dir)\n        .arg(\"clean\")\n        .arg(\"profile\")\n        .assert()\n        .success();\n\n    let expected_state = CleanComponentsState {\n        coverage: false,\n        profile: false,\n        cache: true,\n        trace: true,\n    };\n\n    assert_eq!(\n        check_clean_components_state(temp_dir.path()),\n        expected_state\n    );\n}\n\n#[test]\nfn test_clean_cache() {\n    let temp_dir = setup_package(\"coverage_project\");\n\n    let clean_components_state = CleanComponentsState {\n        coverage: false,\n        profile: false,\n        cache: true,\n        trace: false,\n    };\n\n    generate_clean_components(clean_components_state, &temp_dir);\n\n    runner(&temp_dir)\n        .arg(\"clean\")\n        .arg(\"cache\")\n        .assert()\n        .success();\n\n    let expected_state = CleanComponentsState {\n        coverage: false,\n        profile: false,\n        cache: false,\n        trace: false,\n    };\n\n    assert_eq!(\n        check_clean_components_state(temp_dir.path()),\n        expected_state\n    );\n}\n\n#[test]\n#[cfg_attr(\n    feature = \"cairo-native\",\n    ignore = \"Native doesn't support trace, coverage and profiler yet\"\n)]\nfn test_clean_all() {\n    let temp_dir = setup_package(\"coverage_project\");\n\n    let clean_components_state = CleanComponentsState {\n        coverage: true,\n        cache: true,\n        trace: true,\n        profile: true,\n    };\n\n    generate_clean_components(clean_components_state, &temp_dir);\n\n    runner(&temp_dir).arg(\"clean\").arg(\"all\").assert().success();\n\n    let expected_state = CleanComponentsState {\n        coverage: false,\n        profile: false,\n        cache: false,\n        trace: false,\n    };\n\n    assert_eq!(\n        check_clean_components_state(temp_dir.path()),\n        expected_state\n    );\n}\n\n#[test]\nfn test_clean_all_and_component() {\n    let temp_dir = setup_package(\"coverage_project\");\n\n    let clean_components_state = CleanComponentsState {\n        coverage: false,\n        cache: true,\n        trace: false,\n        profile: false,\n    };\n    generate_clean_components(clean_components_state, &temp_dir);\n\n    // This command should fail because 'all' cannot be combined with other components\n    let output = runner(&temp_dir)\n        .arg(\"clean\")\n        .arg(\"all\")\n        .arg(\"cache\")\n        .assert()\n        .failure();\n\n    assert_stdout_contains(\n        output,\n        \"[ERROR] The 'all' component cannot be combined with other components\",\n    );\n}\n\nfn generate_clean_components(state: CleanComponentsState, temp_dir: &TempDir) {\n    let run_test_runner = |args: &[&str]| {\n        test_runner(temp_dir).args(args).assert().success();\n    };\n\n    match state {\n        CleanComponentsState {\n            coverage: true,\n            trace: true,\n            cache: true,\n            profile: false,\n        } => run_test_runner(&[\"--coverage\"]),\n        CleanComponentsState {\n            profile: true,\n            trace: true,\n            cache: true,\n            coverage: false,\n        } => run_test_runner(&[\"--build-profile\"]),\n        CleanComponentsState {\n            trace: true,\n            cache: true,\n            profile: false,\n            coverage: false,\n        } => run_test_runner(&[\"--save-trace-data\"]),\n        CleanComponentsState {\n            coverage: false,\n            profile: false,\n            trace: false,\n            cache: true,\n        } => run_test_runner(&[]),\n        CleanComponentsState {\n            coverage: true,\n            profile: true,\n            trace: true,\n            cache: true,\n        } => {\n            run_test_runner(&[\"--coverage\"]);\n            run_test_runner(&[\"--build-profile\"]);\n        }\n        state => {\n            panic!(\"Invalid state: {state:?}\");\n        }\n    }\n\n    assert_eq!(check_clean_components_state(temp_dir.path()), state);\n}\n\nfn check_clean_components_state(path: &Path) -> CleanComponentsState {\n    let scarb_metadata = metadata_with_opts(MetadataOpts {\n        no_deps: true,\n        current_dir: Some(path.into()),\n        ..MetadataOpts::default()\n    })\n    .unwrap();\n\n    let workspace_root = scarb_metadata.workspace.root;\n\n    let packages_root: Vec<_> = scarb_metadata\n        .packages\n        .into_iter()\n        .map(|package_metadata| package_metadata.root)\n        .collect();\n\n    CleanComponentsState {\n        coverage: dirs_exist(&packages_root, COVERAGE_DIR),\n        profile: dirs_exist(&packages_root, PROFILE_DIR),\n        cache: dir_exists(&workspace_root, CACHE_DIR),\n        trace: dir_exists(&workspace_root, TRACE_DIR),\n    }\n}\n\nfn dirs_exist(root_dirs: &[Utf8PathBuf], dir_name: &str) -> bool {\n    root_dirs\n        .iter()\n        .all(|root_dir| dir_exists(root_dir, dir_name))\n}\nfn dir_exists(dir: &Utf8PathBuf, dir_name: &str) -> bool {\n    dir.join(dir_name).exists()\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/code_quality.rs",
    "content": "use camino::Utf8PathBuf;\nuse packages_validation::check_and_lint;\n\n#[test]\nfn validate_snforge_std() {\n    let package_path = Utf8PathBuf::from(\"../../snforge_std\")\n        .canonicalize()\n        .unwrap()\n        .try_into()\n        .unwrap();\n    check_and_lint(&package_path);\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/collection.rs",
    "content": "use super::common::runner::{setup_package, test_runner};\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stdout_contains;\n\n#[test]\nfn collection_with_lib() {\n    let temp = setup_package(\"collection_with_lib\");\n\n    let output = test_runner(&temp).assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 17 test(s) from collection_with_lib package\n        Running 12 test(s) from src/\n        [PASS] collection_with_lib::fab::tests::test_simple [..]\n        [PASS] collection_with_lib::fob::tests::test_simple [..]\n        [PASS] collection_with_lib::tests::test_fib_in_lib [..]\n        [PASS] collection_with_lib::tests::test_simple [..]\n        [PASS] collection_with_lib::fib::tests::test_fab_in_fib [..]\n        [PASS] collection_with_lib::fib::tests::test_fib [..]\n        [PASS] collection_with_lib::fab::fab_impl::tests::test_fab [..]\n        [PASS] collection_with_lib::fib::tests::test_fob_in_fib [..]\n        [PASS] collection_with_lib::tests::test_fob_in_lib [..]\n        [PASS] collection_with_lib::fab::fab_impl::tests::test_super [..]\n        [PASS] collection_with_lib::fob::fob_impl::tests::test_fob [..]\n        [PASS] collection_with_lib::fab::fab_impl::tests::test_how_does_this_work [..]\n        Running 5 test(s) from tests/\n        [PASS] collection_with_lib_tests::fab::fab_mod::test_fab [..]\n        [PASS] collection_with_lib_tests::fibfabfob::test_fob [..]\n        [PASS] collection_with_lib_tests::fab::test_fab [..]\n        [PASS] collection_with_lib_tests::fibfabfob::test_fib [..]\n        [PASS] collection_with_lib_tests::fibfabfob::test_fab [..]\n        Tests: 17 passed, 0 failed, 0 ignored, 0 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn collection_without_lib() {\n    let temp = setup_package(\"collection_without_lib\");\n\n    let output = test_runner(&temp).assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 17 test(s) from collection_without_lib package\n        Running 12 test(s) from src/\n        [PASS] collection_without_lib::fab::tests::test_simple [..]\n        [PASS] collection_without_lib::fab::fab_impl::tests::test_super [..]\n        [PASS] collection_without_lib::tests::test_simple [..]\n        [PASS] collection_without_lib::fab::fab_impl::tests::test_fab [..]\n        [PASS] collection_without_lib::fob::tests::test_simple [..]\n        [PASS] collection_without_lib::fib::tests::test_fob_in_fib [..]\n        [PASS] collection_without_lib::tests::test_fib_in_lib [..]\n        [PASS] collection_without_lib::fib::tests::test_fab_in_fib [..]\n        [PASS] collection_without_lib::tests::test_fob_in_lib [..]\n        [PASS] collection_without_lib::fab::fab_impl::tests::test_how_does_this_work [..]\n        [PASS] collection_without_lib::fob::fob_impl::tests::test_fob [..]\n        [PASS] collection_without_lib::fib::tests::test_fib [..]\n        Running 5 test(s) from tests/\n        [PASS] collection_without_lib_integrationtest::fibfabfob::test_fab [..]\n        [PASS] collection_without_lib_integrationtest::fab::fab_mod::test_fab [..]\n        [PASS] collection_without_lib_integrationtest::fab::test_fab [..]\n        [PASS] collection_without_lib_integrationtest::fibfabfob::test_fob [..]\n        [PASS] collection_without_lib_integrationtest::fibfabfob::test_fib [..]\n        Tests: 17 passed, 0 failed, 0 ignored, 0 filtered out\n        \"},\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/color.rs",
    "content": "use super::common::runner::{setup_package, snforge_test_bin_path};\nuse snapbox::cmd::{Command as SnapboxCommand, OutputAssert};\n\nfn runner_color(value: &str) -> SnapboxCommand {\n    SnapboxCommand::new(snforge_test_bin_path())\n        .arg(\"test\")\n        .arg(\"--color\")\n        .arg(value)\n}\n\nfn is_colored(output: &OutputAssert) -> bool {\n    String::from_utf8(output.get_output().stdout.clone())\n        .unwrap()\n        .contains(\"\\x1b[\")\n}\n\n#[test]\nfn color_always() {\n    let temp = setup_package(\"simple_package\");\n    let snapbox = runner_color(\"always\");\n    let output = snapbox.current_dir(&temp).assert().code(1);\n    assert!(\n        is_colored(&output),\n        \"output expected to be colored but it is not\"\n    );\n}\n\n#[test]\n#[ignore = \"TODO(2356): Fix this test, compiling of snforge_scarb_plugin is causing issues, but only in CI\"]\nfn color_never() {\n    let temp = setup_package(\"simple_package\");\n    let snapbox = runner_color(\"never\");\n    let output = snapbox.current_dir(&temp).assert().code(1);\n    assert!(\n        !is_colored(&output),\n        \"output not expected to be colored but it is\"\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/common/mod.rs",
    "content": "#[cfg(not(feature = \"cairo-native\"))]\nuse cairo_annotations::trace_data::{\n    CallTraceNode as ProfilerCallTraceNode, CallTraceV1 as ProfilerCallTrace,\n};\n\nmod output;\npub mod runner;\n\n#[cfg(not(feature = \"cairo-native\"))]\npub fn get_trace_from_trace_node(trace_node: &ProfilerCallTraceNode) -> &ProfilerCallTrace {\n    if let ProfilerCallTraceNode::EntryPointCall(trace) = trace_node {\n        trace\n    } else {\n        panic!(\"Deploy without constructor node was not expected\")\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/common/output.rs",
    "content": "/// Asserts a cleaned `stdout` snapshot using `insta`, filtered for non-deterministic lines.\n/// Additionally, to ensure deterministic snapshots, tests must be run with:\n/// `SNFORGE_DETERMINISTIC_OUTPUT=1`\n/// Uses the current Scarb version as a snapshot suffix.\n#[macro_export]\nmacro_rules! assert_cleaned_output {\n    ($output:expr) => {{\n        let stdout = String::from_utf8_lossy(&$output.get_output().stdout);\n\n        let scarb_version = scarb_api::version::scarb_version()\n            .expect(\"Failed to get scarb version\")\n            .scarb;\n\n        // Extract the module name from module_path to determine snapshot subdirectory\n        let module_path = module_path!();\n        let snapshot_subdir = module_path\n            .split(\"::\")\n            .last() // Get the last module name (e.g., \"backtrace\" or \"gas_report\")\n            .unwrap_or(\"\");\n\n        insta::with_settings!({\n            snapshot_suffix => scarb_version.to_string(),\n            snapshot_path => format!(\"./snapshots/{}\", snapshot_subdir),\n            filters => vec![\n                (r\"\\x1B\\[[0-?]*[ -/]*[@-~]\", \"\"), // ANSI escape regex - needed for CI\n                (r\"(?m)^\\s*(Compiling|Finished|Blocking).*\", \"\"), // scarb output\n                (r\"(?m)^\\s*(Collected|Running|Tests:|Latest block number).*\", \"\"), // snforge output\n                (r\"(?m)^\\s*(Updating crates\\.io index|warning:.*|This may prevent.*|database is locked.*|Caused by:.*|  Error code.*).*\\n\", \"\"), // cargo warnings and errors\n                (r\"(?m)^\\s*(Downloading crates|Downloaded).*\\n\", \"\"), // cargo download output\n                (r\"at /[^\\s:]+/src/\", \"at [..]\"), // absolute paths in backtrace\n                (r\"Graph saved to: \\/.*\", \"Graph saved to: [..]\") // Inlining optimizer graph saved line\n            ]},\n            {\n                insta::assert_snapshot!(stdout);\n            }\n        );\n    }};\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/common/runner.rs",
    "content": "use crate::utils::{\n    get_assert_macros_version, get_snforge_std_entry, get_std_name, get_std_path,\n    tempdir_with_tool_versions,\n};\nuse assert_fs::TempDir;\nuse assert_fs::fixture::{FileWriteStr, PathChild, PathCopy};\nuse camino::Utf8PathBuf;\nuse indoc::formatdoc;\nuse shared::command::CommandExt;\nuse shared::test_utils::node_url::node_rpc_url;\nuse snapbox::cargo_bin;\nuse snapbox::cmd::Command as SnapboxCommand;\nuse std::path::{Path, PathBuf};\nuse std::process::Command;\nuse std::str::FromStr;\nuse std::{env, fs};\nuse toml_edit::{DocumentMut, value};\nuse walkdir::WalkDir;\n\npub(crate) fn runner<T: AsRef<Path>>(temp_dir: T) -> SnapboxCommand {\n    SnapboxCommand::new(snforge_test_bin_path()).current_dir(temp_dir)\n}\n\n// If ran on CI, we want to get the nextest's built binary\npub fn snforge_test_bin_path() -> PathBuf {\n    if env::var(\"NEXTEST\").unwrap_or(\"0\".to_string()) == \"1\" {\n        let snforge_nextest_env =\n            env::var(\"NEXTEST_BIN_EXE_snforge\").expect(\"No snforge binary for nextest found\");\n        return PathBuf::from(snforge_nextest_env);\n    }\n    cargo_bin!(\"snforge\").to_path_buf()\n}\n\n/// Returns a command that runs `snforge test` in the given temporary directory.\n/// If the `cairo-native` feature is enabled, it adds the `--run-native` flag.\npub(crate) fn test_runner<T: AsRef<Path>>(temp_dir: T) -> SnapboxCommand {\n    if cfg!(feature = \"cairo-native\") {\n        test_runner_native(temp_dir)\n    } else {\n        test_runner_vm(temp_dir)\n    }\n}\n\n/// Returns a command that runs `snforge test --run-native` in the given temporary directory.\n///\n/// This is useful for testing behavior that occurs only when the `--run-native` flag is passed.\n/// If the behavior is not specific to native execution, use `test_runner` instead.\npub(crate) fn test_runner_native<T: AsRef<Path>>(temp_dir: T) -> SnapboxCommand {\n    runner(temp_dir).arg(\"test\").arg(\"--run-native\")\n}\n\n/// Returns a command that runs `snforge test` in the given temporary directory.\n///\n/// This is useful for testing behavior that occurs only in the VM execution.\n/// If the behavior is not specific to VM execution, use `test_runner` instead.\npub(crate) fn test_runner_vm<T: AsRef<Path>>(temp_dir: T) -> SnapboxCommand {\n    runner(temp_dir).arg(\"test\")\n}\n\npub(crate) static BASE_FILE_PATTERNS: &[&str] =\n    &[\"**/*.cairo\", \"**/*.toml\", \"**/data/*.json\", \"**/data/*.txt\"];\n\nfn is_package_from_docs_listings(package: &str) -> bool {\n    let package_path = Path::new(\"../../docs/listings\").join(package);\n    fs::canonicalize(&package_path).is_ok()\n}\n\npub enum Package {\n    Name(String),\n    Path(Utf8PathBuf),\n}\n\npub(crate) fn setup_package_with_file_patterns(\n    package: Package,\n    file_patterns: &[&str],\n) -> TempDir {\n    let temp = tempdir_with_tool_versions().unwrap();\n\n    let package_path = match package {\n        Package::Name(name) => {\n            let is_from_docs_listings = is_package_from_docs_listings(&name);\n            if is_from_docs_listings {\n                Utf8PathBuf::from(format!(\"../../docs/listings/{name}\"))\n            } else {\n                Utf8PathBuf::from(format!(\"tests/data/{name}\"))\n            }\n        }\n        Package::Path(path) => Utf8PathBuf::from(\"tests/data\").join(path),\n    };\n\n    let package_path = package_path\n        .canonicalize_utf8()\n        .unwrap()\n        .to_string()\n        .replace('\\\\', \"/\");\n\n    temp.copy_from(package_path, file_patterns).unwrap();\n\n    let manifest_path = temp.child(\"Scarb.toml\");\n\n    let mut scarb_toml = fs::read_to_string(&manifest_path)\n        .unwrap()\n        .parse::<DocumentMut>()\n        .unwrap();\n\n    let is_workspace = scarb_toml.get(\"workspace\").is_some();\n\n    let snforge_std_path = Utf8PathBuf::from_str(\"../../snforge_std\")\n        .unwrap()\n        .canonicalize_utf8()\n        .unwrap()\n        .to_string()\n        .replace('\\\\', \"/\");\n\n    if is_workspace {\n        scarb_toml[\"workspace\"][\"dependencies\"][\"snforge_std\"][\"path\"] = value(snforge_std_path);\n    } else {\n        scarb_toml[\"dev-dependencies\"][\"snforge_std\"][\"path\"] = value(snforge_std_path);\n    }\n\n    scarb_toml[\"dependencies\"][\"starknet\"] = value(\"2.4.0\");\n    scarb_toml[\"dependencies\"][\"assert_macros\"] =\n        value(get_assert_macros_version().unwrap().to_string());\n    scarb_toml[\"target.starknet-contract\"][\"sierra\"] = value(true);\n\n    manifest_path.write_str(&scarb_toml.to_string()).unwrap();\n\n    replace_node_rpc_url_placeholders(temp.path());\n\n    temp\n}\n\npub(crate) fn setup_package(package_name: &str) -> TempDir {\n    setup_package_with_file_patterns(Package::Name(package_name.to_string()), BASE_FILE_PATTERNS)\n}\n\npub(crate) fn setup_package_at_path(package_path: Utf8PathBuf) -> TempDir {\n    setup_package_with_file_patterns(Package::Path(package_path), BASE_FILE_PATTERNS)\n}\n\nfn replace_node_rpc_url_placeholders(dir_path: &Path) {\n    let url = node_rpc_url();\n    let temp_dir_files = WalkDir::new(dir_path);\n    for entry in temp_dir_files {\n        let entry = entry.unwrap();\n\n        let path = entry.path();\n\n        if path.is_file() && path.extension().is_some_and(|ex| ex == \"cairo\") {\n            let content = fs::read_to_string(path).unwrap();\n\n            let modified_content = content.replace(\"{{ NODE_RPC_URL }}\", url.as_str());\n\n            fs::write(path, modified_content).unwrap();\n        }\n    }\n}\n\npub(crate) fn setup_hello_workspace() -> TempDir {\n    let temp = setup_package_with_file_patterns(\n        Package::Path(Utf8PathBuf::from(\"hello_workspaces\")),\n        &[\"**/*.cairo\", \"**/*.toml\"],\n    );\n\n    let snforge_std_name = get_std_name();\n    let snforge_std_path = get_std_path().unwrap();\n\n    let manifest_path = temp.child(\"Scarb.toml\");\n    manifest_path\n        .write_str(&formatdoc!(\n            r#\"\n                [workspace]\n                members = [\n                    \"crates/*\",\n                ]\n                \n                [workspace.scripts]\n                test = \"snforge\"\n                \n                [workspace.tool.snforge]\n                \n                [workspace.dependencies]\n                starknet = \"2.4.0\"\n                {snforge_std_name} = {{ path = \"{snforge_std_path}\" }}\n                \n                [workspace.package]\n                version = \"0.1.0\"\n                \n                [package]\n                name = \"hello_workspaces\"\n                version.workspace = true\n                \n                [scripts]\n                test.workspace = true\n                \n                [tool]\n                snforge.workspace = true\n                \n                [dependencies]\n                starknet.workspace = true\n                fibonacci = {{ path = \"crates/fibonacci\" }}\n                addition = {{ path = \"crates/addition\" }}\n\n                [dev-dependencies]\n                {snforge_std_name}.workspace = true\n                \"#,\n        ))\n        .unwrap();\n\n    temp\n}\n\npub(crate) fn setup_virtual_workspace() -> TempDir {\n    let temp = setup_package_with_file_patterns(\n        Package::Path(Utf8PathBuf::from(\"virtual_workspace\")),\n        &[\"**/*.cairo\", \"**/*.toml\"],\n    );\n\n    let manifest_path = temp.child(\"Scarb.toml\");\n    manifest_path\n        .write_str(&formatdoc!(\n            r#\"\n                [workspace]\n                members = [\n                    \"dummy_name/*\",\n                ]\n                \n                [workspace.scripts]\n                test = \"snforge\"\n                \n                [workspace.tool.snforge]\n                \n                [workspace.dependencies]\n                starknet = \"2.4.0\"\n                {}\n                \n                [workspace.package]\n                version = \"0.1.0\"\n                \n                [scripts]\n                test.workspace = true\n                \n                [tool]\n                snforge.workspace = true\n                \"#,\n            get_snforge_std_entry().unwrap()\n        ))\n        .unwrap();\n\n    temp\n}\n\n/// In context of GITHUB actions, get the repository name that triggered the workflow run.\n/// Locally returns current branch.\n///\n/// `REPO_NAME` environment variable is expected to be in format `<repo_owner>/<repo_name>.git`.\npub(crate) fn get_remote_url() -> String {\n    let name: &str = \"REPO_NAME\";\n    if let Ok(v) = env::var(name) {\n        v\n    } else {\n        let output = Command::new(\"git\")\n            .args([\"remote\", \"get-url\", \"origin\"])\n            .output_checked()\n            .unwrap();\n\n        let output = String::from_utf8(output.stdout).unwrap();\n\n        if output.trim().starts_with(\"https://github.com/\") {\n            output\n                .trim()\n                .strip_prefix(\"https://github.com/\")\n                .unwrap()\n                .to_string()\n        } else {\n            output\n                .trim()\n                .strip_prefix(\"git@github.com:\")\n                .unwrap()\n                .strip_suffix(\".git\")\n                .unwrap()\n                .to_string()\n        }\n    }\n}\n\n/// In the context of GITHUB actions, get the source branch that triggered the workflow run.\n/// Locally returns current branch.\npub(crate) fn get_current_branch() -> String {\n    let name: &str = \"BRANCH_NAME\";\n    if let Ok(v) = env::var(name) {\n        v\n    } else {\n        let output = Command::new(\"git\")\n            .args([\"rev-parse\", \"--abbrev-ref\", \"HEAD\"])\n            .output_checked()\n            .unwrap();\n\n        String::from_utf8(output.stdout).unwrap().trim().to_string()\n    }\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/completions.rs",
    "content": "use crate::e2e::common::runner::snforge_test_bin_path;\nuse clap::ValueEnum;\nuse clap_complete::Shell;\nuse indoc::formatdoc;\nuse shared::test_utils::output_assert::assert_stdout_contains;\nuse snapbox::cmd::Command;\n\n#[test]\nfn test_happy_case() {\n    for variant in Shell::value_variants() {\n        let shell = variant.to_string();\n        let snapbox = Command::new(snforge_test_bin_path())\n            .arg(\"completions\")\n            .arg(shell.as_str());\n\n        snapbox.assert().success();\n    }\n}\n\n#[test]\nfn test_generate_completions_unsupported_shell() {\n    // SAFETY: Tests run in parallel and share the same environment variables.\n    // However, this modification applies only to this one test.\n    unsafe {\n        std::env::set_var(\"SHELL\", \"/bin/unsupported\");\n    }\n\n    let snapbox = Command::new(snforge_test_bin_path()).arg(\"completions\");\n\n    let output = snapbox.assert().failure();\n\n    assert_stdout_contains(\n        output,\n        formatdoc!(\n            r\"\n            [ERROR] Unsupported shell\n            \"\n        ),\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/components.rs",
    "content": "use super::common::runner::{setup_package, test_runner};\n\n#[test]\nfn contract_components() {\n    let temp = setup_package(\"component_macros\");\n\n    test_runner(&temp).assert().success();\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/contract_artifacts.rs",
    "content": "use crate::e2e::common::runner::{setup_package, test_runner};\nuse assert_fs::fixture::{FileWriteStr, PathChild};\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stdout_contains;\nuse std::fs;\nuse toml_edit::DocumentMut;\n\n#[test]\nfn unit_and_integration() {\n    let temp = setup_package(\"targets/unit_and_integration\");\n    let output = test_runner(&temp).assert().code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n    [..]Compiling[..]\n    [..]Finished[..]\n\n\n    Collected 2 test(s) from unit_and_integration package\n    Running 1 test(s) from tests/\n    [PASS] unit_and_integration_integrationtest::tests::declare_and_call_contract_from_lib (l1_gas: [..], l1_data_gas: [..], l2_gas: [..])\n    Running 1 test(s) from src/\n    [PASS] unit_and_integration::tests::declare_contract_from_lib (l1_gas: [..], l1_data_gas: [..], l2_gas: [..])\n    Tests: 2 passed, 0 failed, 0 ignored, 0 filtered out\n    \"},\n    );\n}\n\n#[test]\nfn unit_and_lib_integration() {\n    let temp = setup_package(\"targets/unit_and_lib_integration\");\n    let output = test_runner(&temp).assert().code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n    [..]Compiling[..]\n    [..]Finished[..]\n\n\n    Collected 2 test(s) from unit_and_lib_integration package\n    Running 1 test(s) from tests/\n    [PASS] unit_and_lib_integration_tests::tests::declare_and_call_contract_from_lib (l1_gas: [..], l1_data_gas: [..], l2_gas: [..])\n    Running 1 test(s) from src/\n    [PASS] unit_and_lib_integration::tests::declare_contract_from_lib (l1_gas: [..], l1_data_gas: [..], l2_gas: [..])\n    Tests: 2 passed, 0 failed, 0 ignored, 0 filtered out\n    \"},\n    );\n}\n\n#[test]\nfn only_integration() {\n    let temp = setup_package(\"targets/only_integration\");\n    let output = test_runner(&temp).assert().code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n    [..]Compiling[..]\n    [..]Finished[..]\n\n\n    Collected 1 test(s) from only_integration package\n    Running 1 test(s) from tests/\n    [PASS] only_integration_integrationtest::tests::declare_and_call_contract_from_lib (l1_gas: [..], l1_data_gas: [..], l2_gas: [..])\n    Running 0 test(s) from src/\n    Tests: 1 passed, 0 failed, 0 ignored, 0 filtered out\n    \"},\n    );\n}\n\n#[test]\nfn only_unit() {\n    let temp = setup_package(\"targets/only_unit\");\n    let output = test_runner(&temp).assert().code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n    [..]Compiling[..]\n    [..]Finished[..]\n\n\n    Collected 1 test(s) from only_unit package\n    Running 1 test(s) from src/\n    [PASS] only_unit::tests::declare_contract_from_lib (l1_gas: [..], l1_data_gas: [..], l2_gas: [..])\n    Tests: 1 passed, 0 failed, 0 ignored, 0 filtered out\n    \"},\n    );\n}\n\n#[test]\nfn only_lib_integration() {\n    let temp = setup_package(\"targets/only_lib_integration\");\n    let output = test_runner(&temp).assert().code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n    [..]Compiling[..]\n    [..]Finished[..]\n\n\n    Collected 1 test(s) from only_lib_integration package\n    Running 1 test(s) from tests/\n    [PASS] only_lib_integration_tests::tests::declare_and_call_contract_from_lib (l1_gas: [..], l1_data_gas: [..], l2_gas: [..])\n    Running 0 test(s) from src/\n    Tests: 1 passed, 0 failed, 0 ignored, 0 filtered out\n    \"},\n    );\n}\n\n#[test]\nfn with_features() {\n    let temp = setup_package(\"targets/with_features\");\n    let output = test_runner(&temp)\n        .arg(\"--features\")\n        .arg(\"enable_for_tests\")\n        .assert()\n        .code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n    [..]Compiling[..]\n    [..]Finished[..]\n\n\n    Collected 2 test(s) from with_features package\n    Running 1 test(s) from tests/\n    [PASS] with_features_integrationtest::tests::declare_and_call_contract_from_lib (l1_gas: [..], l1_data_gas: [..], l2_gas: [..])\n    Running 1 test(s) from src/\n    [PASS] with_features::tests::declare_contract_from_lib (l1_gas: [..], l1_data_gas: [..], l2_gas: [..])\n    Tests: 2 passed, 0 failed, 0 ignored, 0 filtered out\n    \"},\n    );\n}\n\n#[test]\nfn with_features_fails_without_flag() {\n    let temp = setup_package(\"targets/with_features\");\n    let output = test_runner(&temp).assert().code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r#\"\n    [..]Compiling[..]\n    [..]Finished[..]\n\n\n    Collected 2 test(s) from with_features package\n    Running 1 test(s) from tests/\n    [FAIL] with_features_integrationtest::tests::declare_and_call_contract_from_lib\n\n    Failure data:\n        \"Failed to get contract artifact for name = HelloStarknet.\"\n\n    Running 1 test(s) from src/\n    [FAIL] with_features::tests::declare_contract_from_lib\n\n    Failure data:\n        \"Failed to get contract artifact for name = HelloStarknet.\"\n\n    Tests: 0 passed, 2 failed, 0 ignored, 0 filtered out\n\n    Failures:\n        with_features_integrationtest::tests::declare_and_call_contract_from_lib\n        with_features::tests::declare_contract_from_lib\n    \"#},\n    );\n}\n\n#[test]\n// Case: We define custom test target for both unit and integration test types\n// We do not define `build-external-contracts = [\"targets::*\"]` for `integration` target\n// The test still passes because contracts are collected from `unit` target which includes\n// the contracts from package by the default\nfn custom_target() {\n    let temp = setup_package(\"targets/custom_target\");\n    let output = test_runner(&temp).assert().code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n    [..]Compiling[..]\n    [..]Finished[..]\n\n\n    Collected 2 test(s) from custom_target package\n    Running 1 test(s) from tests/\n    [PASS] custom_target_integrationtest::tests::declare_and_call_contract_from_lib (l1_gas: [..], l1_data_gas: [..], l2_gas: [..])\n    Running 1 test(s) from src/\n    [PASS] custom_target::tests::declare_contract_from_lib (l1_gas: [..], l1_data_gas: [..], l2_gas: [..])\n    Tests: 2 passed, 0 failed, 0 ignored, 0 filtered out\n    \"},\n    );\n}\n\n#[test]\n// Case: We define custom test target for both unit and integration test types\n// We do not define `build-external-contracts = [\"targets::*\"]` for `integration` target\n// The test still passes because contracts are collected from `unit` target which includes\n// the contracts from package by the default\nfn custom_target_custom_names() {\n    let temp = setup_package(\"targets/custom_target_custom_names\");\n    let output = test_runner(&temp).assert().code(0);\n\n    // Scarb will use the name of the package for unit tests even if custom\n    // name for the unit test target is defined\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n    [..]Compiling[..]\n    [..]Finished[..]\n\n\n    Collected 2 test(s) from custom_target_custom_names package\n    Running 1 test(s) from tests/\n    [PASS] custom_first::tests::declare_and_call_contract_from_lib (l1_gas: [..], l1_data_gas: [..], l2_gas: [..])\n    Running 1 test(s) from src/\n    [PASS] custom_target_custom_names::tests::declare_contract_from_lib (l1_gas: [..], l1_data_gas: [..], l2_gas: [..])\n    Tests: 2 passed, 0 failed, 0 ignored, 0 filtered out\n    \"},\n    );\n}\n\n#[test]\n// Case: We define custom test target for both unit and integration test types\n// We must `build-external-contracts = [\"targets::*\"]` for `integration` target otherwise\n// they will not be built and included for declaring.\nfn custom_target_only_integration() {\n    let temp = setup_package(\"targets/custom_target_only_integration\");\n    let output = test_runner(&temp).assert().code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n    [..]Compiling[..]\n    [..]Finished[..]\n\n\n    Collected 1 test(s) from custom_target_only_integration package\n    Running 1 test(s) from tests/\n    [PASS] custom_first::tests::declare_and_call_contract_from_lib (l1_gas: [..], l1_data_gas: [..], l2_gas: [..])\n    Tests: 1 passed, 0 failed, 0 ignored, 0 filtered out\n    \"},\n    );\n}\n\n#[test]\n// Case: We define custom test target for integration test type\n// We delete `build-external-contracts = [\"targets::*\"]` for `integration` so the test fails\nfn custom_target_only_integration_without_external() {\n    let temp = setup_package(\"targets/custom_target_only_integration\");\n\n    // Remove `build-external-contracts` from `[[test]]` target\n    let manifest_path = temp.child(\"Scarb.toml\");\n    let mut scarb_toml = fs::read_to_string(&manifest_path)\n        .unwrap()\n        .parse::<DocumentMut>()\n        .unwrap();\n    let test_target = scarb_toml[\"test\"].as_array_of_tables_mut().unwrap();\n    assert_eq!(test_target.len(), 1);\n    let test_target = test_target.get_mut(0).unwrap();\n    test_target.remove(\"build-external-contracts\").unwrap();\n    manifest_path.write_str(&scarb_toml.to_string()).unwrap();\n\n    let output = test_runner(&temp).assert().code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r#\"\n    [..]Compiling[..]\n    [..]Finished[..]\n\n\n    Collected 1 test(s) from custom_target_only_integration package\n    Running 1 test(s) from tests/\n    [FAIL] custom_first::tests::declare_and_call_contract_from_lib\n\n    Failure data:\n        \"Failed to get contract artifact for name = HelloStarknet.\"\n\n    Tests: 0 passed, 1 failed, 0 ignored, 0 filtered out\n    \"#},\n    );\n}\n\n#[test]\nfn simple_package_no_starknet_contract_target() {\n    let temp = setup_package(\"simple_package\");\n\n    let manifest_path = temp.child(\"Scarb.toml\");\n\n    let mut scarb_toml = fs::read_to_string(&manifest_path)\n        .unwrap()\n        .parse::<DocumentMut>()\n        .unwrap();\n\n    scarb_toml.as_table_mut().remove(\"target\");\n    manifest_path.write_str(&scarb_toml.to_string()).unwrap();\n\n    let output = test_runner(&temp).assert().code(1);\n\n    assert!(\n        temp.join(\"target/dev/simple_package_integrationtest.test.starknet_artifacts.json\")\n            .exists()\n    );\n    assert!(\n        temp.join(\n            \"target/dev/simple_package_integrationtest_HelloStarknet.test.contract_class.json\"\n        )\n        .exists()\n    );\n\n    assert!(\n        temp.join(\"target/dev/simple_package_unittest.test.starknet_artifacts.json\")\n            .exists()\n    );\n    assert!(\n        temp.join(\"target/dev/simple_package_unittest_HelloStarknet.test.contract_class.json\")\n            .exists()\n    );\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n    [..]Compiling[..]\n    [..]Finished[..]\n\n\n    Collected 13 test(s) from simple_package package\n    Running 2 test(s) from src/\n    [PASS] simple_package::tests::test_fib [..]\n    [IGNORE] simple_package::tests::ignored_test\n    Running 11 test(s) from tests/\n    [PASS] simple_package_integrationtest::contract::call_and_invoke [..]\n    [PASS] simple_package_integrationtest::ext_function_test::test_my_test [..]\n    [IGNORE] simple_package_integrationtest::ext_function_test::ignored_test\n    [PASS] simple_package_integrationtest::ext_function_test::test_simple [..]\n    [PASS] simple_package_integrationtest::test_simple::test_simple [..]\n    [PASS] simple_package_integrationtest::test_simple::test_simple2 [..]\n    [PASS] simple_package_integrationtest::test_simple::test_two [..]\n    [PASS] simple_package_integrationtest::test_simple::test_two_and_two [..]\n    [FAIL] simple_package_integrationtest::test_simple::test_failing\n\n    Failure data:\n        0x6661696c696e6720636865636b ('failing check')\n\n    [FAIL] simple_package_integrationtest::test_simple::test_another_failing\n\n    Failure data:\n        0x6661696c696e6720636865636b ('failing check')\n\n    [PASS] simple_package_integrationtest::without_prefix::five [..]\n    Tests: 9 passed, 2 failed, 2 ignored, 0 filtered out\n\n    Failures:\n        simple_package_integrationtest::test_simple::test_failing\n        simple_package_integrationtest::test_simple::test_another_failing\n    \"},\n    );\n}\n\n#[test]\nfn no_optimization_flag() {\n    let temp = setup_package(\"erc20_package\");\n    let output = test_runner(&temp)\n        .arg(\"--no-optimization\")\n        .assert()\n        .success();\n\n    assert!(\n        temp.join(\"target/dev/erc20_package_ERC20.contract_class.json\")\n            .exists()\n    );\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 1 test(s) from erc20_package package\n        Running 0 test(s) from src/\n        Running 1 test(s) from tests/\n        [PASS] erc20_package_integrationtest::test_complex::complex[..]\n        Tests: 1 passed, 0 failed, 0 ignored, 0 filtered out\n        \"},\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/coverage.rs",
    "content": "use super::common::runner::{setup_package, test_runner};\nuse assert_fs::fixture::{FileWriteStr, PathChild};\nuse forge_runner::coverage_api::{COVERAGE_DIR, OUTPUT_FILE_NAME};\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stdout_contains;\nuse std::fs;\nuse toml_edit::{DocumentMut, value};\n\n#[test]\nfn test_coverage_project() {\n    let temp = setup_package(\"coverage_project\");\n\n    test_runner(&temp).arg(\"--coverage\").assert().success();\n\n    assert!(temp.join(COVERAGE_DIR).join(OUTPUT_FILE_NAME).is_file());\n\n    // Check if it doesn't crash in case some data already exists\n    test_runner(&temp).arg(\"--coverage\").assert().success();\n}\n\n#[test]\nfn test_coverage_project_and_pass_args() {\n    let temp = setup_package(\"coverage_project\");\n\n    test_runner(&temp)\n        .arg(\"--coverage\")\n        .arg(\"--\")\n        .arg(\"--output-path\")\n        .arg(\"./my_file.lcov\")\n        .assert()\n        .success();\n\n    assert!(temp.join(\"my_file.lcov\").is_file());\n}\n\n#[test]\nfn test_fail_wrong_set_up() {\n    let temp = setup_package(\"coverage_project\");\n\n    let manifest_path = temp.child(\"Scarb.toml\");\n\n    let mut scarb_toml = fs::read_to_string(&manifest_path)\n        .unwrap()\n        .parse::<DocumentMut>()\n        .unwrap();\n\n    scarb_toml[\"profile\"][\"dev\"][\"cairo\"][\"unstable-add-statements-code-locations-debug-info\"] =\n        value(false);\n\n    manifest_path.write_str(&scarb_toml.to_string()).unwrap();\n\n    let output = test_runner(&temp).arg(\"--coverage\").assert().failure();\n\n    assert_stdout_contains(\n        output,\n        indoc! {\n            \"[ERROR] Scarb.toml must have the following Cairo compiler configuration to run coverage:\n\n            [profile.dev.cairo]\n            unstable-add-statements-functions-debug-info = true\n            unstable-add-statements-code-locations-debug-info = true\n            inlining-strategy = \\\"avoid\\\"\n            ... other entries ...\n\n            \"\n        },\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/debugger.rs",
    "content": "use super::common::runner::{setup_package, snforge_test_bin_path, test_runner};\nuse assert_fs::fixture::{FileWriteStr, PathChild};\nuse indoc::formatdoc;\nuse shared::test_utils::output_assert::assert_stdout_contains;\nuse std::fs;\nuse std::io::{BufRead, BufReader};\nuse std::process::{Command, Stdio};\n\n#[test]\nfn test_launch_debugger_waits_for_connection() {\n    let temp = setup_package(\"debugging\");\n\n    let manifest_path = temp.child(\"Scarb.toml\");\n\n    let existing = fs::read_to_string(&manifest_path).unwrap();\n    manifest_path\n        .write_str(&formatdoc!(\n            \"{existing}\n            [profile.dev.cairo]\n            unstable-add-statements-code-locations-debug-info = true\n            unstable-add-statements-functions-debug-info = true\n            add-functions-debug-info = true\n            skip-optimizations = true\",\n        ))\n        .unwrap();\n\n    let mut child = Command::new(snforge_test_bin_path())\n        .args([\n            \"test\",\n            \"debugging_integrationtest::test_trace::test_debugging_trace_success\",\n            \"--exact\",\n            \"--launch-debugger\",\n        ])\n        .current_dir(temp.path())\n        .stdout(Stdio::piped())\n        .stderr(Stdio::piped())\n        .spawn()\n        .expect(\"Failed to spawn snforge process\");\n\n    let found_port_line = BufReader::new(child.stdout.take().unwrap())\n        .lines()\n        .map_while(Result::ok)\n        .any(|line| line.contains(\"DEBUGGER PORT\"));\n\n    child.kill().unwrap();\n    child.wait().unwrap();\n\n    // For debugging purposes if the test fails.\n    let stderr = BufReader::new(child.stderr.take().unwrap())\n        .lines()\n        .map_while(Result::ok)\n        .collect::<Vec<_>>()\n        .join(\"\\n\");\n\n    assert!(\n        found_port_line,\n        \"Expected 'DEBUGGER PORT' in snforge output.\\n\\nstderr:\\n{stderr}\",\n    );\n}\n\n#[test]\nfn test_launch_debugger_fails_for_fuzzer_test() {\n    let temp = setup_package(\"debugging\");\n\n    let output = test_runner(&temp)\n        .args([\n            \"debugging_integrationtest::test_trace::test_debugging_fuzzer\",\n            \"--exact\",\n            \"--launch-debugger\",\n            \"--features\",\n            \"fuzzer\",\n        ])\n        .assert()\n        .code(2);\n\n    assert_stdout_contains(\n        output,\n        \"[ERROR] --launch-debugger is not supported for fuzzer tests\",\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/debugging.rs",
    "content": "use super::common::runner::{setup_package, test_runner};\nuse indoc::{formatdoc, indoc};\nuse shared::test_utils::output_assert::assert_stdout_contains;\n\n#[test]\nfn debugging_trace_custom_components() {\n    let temp = setup_package(\"debugging\");\n\n    let output = test_runner(&temp)\n        .arg(\"--trace-components\")\n        .arg(\"contract-name\")\n        .arg(\"call-result\")\n        .arg(\"call-type\")\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(\n        output,\n        test_output(custom_output_trace_message, \"debugging\"),\n    );\n}\n\n#[test]\nfn debugging_trace_detailed() {\n    let temp = setup_package(\"debugging\");\n\n    let output = test_runner(&temp)\n        .arg(\"--trace-verbosity\")\n        .arg(\"detailed\")\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(\n        output,\n        test_output(detailed_debugging_trace_message, \"debugging\"),\n    );\n}\n\n#[test]\nfn debugging_trace_detailed_fork() {\n    let temp = setup_package(\"debugging_fork\");\n\n    let output = test_runner(&temp)\n        .arg(\"--trace-verbosity\")\n        .arg(\"detailed\")\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(\n        output,\n        test_output(detailed_debugging_trace_message_fork, \"debugging_fork\"),\n    );\n}\n\n#[test]\nfn debugging_trace_standard() {\n    let temp = setup_package(\"debugging\");\n\n    let output = test_runner(&temp)\n        .arg(\"--trace-verbosity\")\n        .arg(\"standard\")\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(\n        output,\n        test_output(standard_debugging_trace_message, \"debugging\"),\n    );\n}\n\n#[test]\nfn debugging_trace_standard_fork() {\n    let temp = setup_package(\"debugging_fork\");\n\n    let output = test_runner(&temp)\n        .arg(\"--trace-verbosity\")\n        .arg(\"standard\")\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(\n        output,\n        test_output(standard_debugging_trace_message_fork, \"debugging_fork\"),\n    );\n}\n\n#[test]\nfn debugging_trace_minimal() {\n    let temp = setup_package(\"debugging\");\n\n    let output = test_runner(&temp)\n        .arg(\"--trace-verbosity\")\n        .arg(\"minimal\")\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(\n        output,\n        test_output(minimal_debugging_trace_message, \"debugging\"),\n    );\n}\n\n#[test]\nfn debugging_trace_minimal_fork() {\n    let temp = setup_package(\"debugging_fork\");\n\n    let output = test_runner(&temp)\n        .arg(\"--trace-verbosity\")\n        .arg(\"minimal\")\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(\n        output,\n        test_output(minimal_debugging_trace_message_fork, \"debugging_fork\"),\n    );\n}\n\n#[test]\nfn debugging_double_flags() {\n    let temp = setup_package(\"debugging\");\n\n    test_runner(&temp)\n        .arg(\"--trace-verbosity\")\n        .arg(\"minimal\")\n        .arg(\"--trace-components\")\n        .arg(\"contract-name\")\n        .assert()\n        .code(2)\n        .stderr_eq(indoc! {\"\n            error: the argument '--trace-verbosity <TRACE_VERBOSITY>' cannot be used with '--trace-components <TRACE_COMPONENTS>...'\n\n            Usage: snforge test --trace-verbosity <TRACE_VERBOSITY> [TEST_FILTER] [-- <ADDITIONAL_ARGS>...]\n\n            For more information, try '--help'.\n        \"});\n}\n\nfn test_output(trace_message_fn: fn(&str, &str) -> String, package_name: &str) -> String {\n    formatdoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n        Collected 2 test(s) from {package_name} package\n        Running 2 test(s) from tests/\n        [FAIL] {package_name}_integrationtest::test_trace::test_debugging_trace_failure\n        Failure data:\n            (0x1, 0x2, 0x3, 0x4, 0x5, 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\n        note: run with `SNFORGE_BACKTRACE=1` environment variable to display a backtrace\n        {debugging_trace_fail}\n\n        [PASS] {package_name}_integrationtest::test_trace::test_debugging_trace_success (l1_gas: ~[..], l1_data_gas: ~[..], l2_gas: ~[..])\n        {debugging_trace_pass}\n\n        Running 0 test(s) from src/\n        Tests: 1 passed, 1 failed, 0 ignored, 0 filtered out\n\n        Failures:\n            {package_name}_integrationtest::test_trace::test_debugging_trace_failure\n        \",\n        debugging_trace_fail = trace_message_fn(\"failure\", package_name),\n        debugging_trace_pass = trace_message_fn(\"success\", package_name)\n    }\n}\n\nfn detailed_debugging_trace_message(test_name: &str, package_name: &str) -> String {\n    formatdoc! {r\"\n        [test name] {package_name}_integrationtest::test_trace::test_debugging_trace_{test_name}\n        ├─ [selector] execute_calls\n        │  ├─ [contract name] SimpleContract\n        │  ├─ [entry point type] External\n        │  ├─ [calldata] array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}]\n        │  ├─ [contract address] [..]\n        │  ├─ [caller address] [..]\n        │  ├─ [call type] Call\n        │  ├─ [call result] success: array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}]\n        │  ├─ [L2 gas] [..]\n        │  ├─ [selector] execute_calls\n        │  │  ├─ [contract name] SimpleContract\n        │  │  ├─ [entry point type] External\n        │  │  ├─ [calldata] array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}]\n        │  │  ├─ [contract address] [..]\n        │  │  ├─ [caller address] [..]\n        │  │  ├─ [call type] Call\n        │  │  ├─ [call result] success: array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}]\n        │  │  ├─ [L2 gas] [..]\n        │  │  ├─ [selector] execute_calls\n        │  │  │  ├─ [contract name] SimpleContract\n        │  │  │  ├─ [entry point type] External\n        │  │  │  ├─ [calldata] array![]\n        │  │  │  ├─ [contract address] [..]\n        │  │  │  ├─ [caller address] [..]\n        │  │  │  ├─ [call type] Call\n        │  │  │  ├─ [call result] success: array![]\n        │  │  │  └─ [L2 gas] [..]\n        │  │  └─ [selector] execute_calls\n        │  │     ├─ [contract name] SimpleContract\n        │  │     ├─ [entry point type] External\n        │  │     ├─ [calldata] array![]\n        │  │     ├─ [contract address] [..]\n        │  │     ├─ [caller address] [..]\n        │  │     ├─ [call type] Call\n        │  │     ├─ [call result] success: array![]\n        │  │     └─ [L2 gas] [..]\n        │  └─ [selector] execute_calls\n        │     ├─ [contract name] SimpleContract\n        │     ├─ [entry point type] External\n        │     ├─ [calldata] array![]\n        │     ├─ [contract address] [..]\n        │     ├─ [caller address] [..]\n        │     ├─ [call type] Call\n        │     ├─ [call result] success: array![]\n        │     └─ [L2 gas] [..]\n        └─ [selector] fail\n           ├─ [contract name] SimpleContract\n           ├─ [entry point type] External\n           ├─ [calldata] array![0x1, 0x2, 0x3, 0x4, 0x5]\n           ├─ [contract address] [..]\n           ├─ [caller address] [..]\n           ├─ [call type] Call\n           ├─ [call result] panic: (0x1, 0x2, 0x3, 0x4, 0x5)\n           └─ [L2 gas] [..]\n        \"}\n}\n\nfn detailed_debugging_trace_message_fork(test_name: &str, package_name: &str) -> String {\n    formatdoc! {r\"\n        [test name] {package_name}_integrationtest::test_trace::test_debugging_trace_{test_name}\n        ├─ [selector] execute_calls\n        │  ├─ [contract name] forked contract\n        │  ├─ [entry point type] External\n        │  ├─ [calldata] array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}]\n        │  ├─ [contract address] [..]\n        │  ├─ [caller address] [..]\n        │  ├─ [call type] Call\n        │  ├─ [call result] success: array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}]\n        │  ├─ [L2 gas] [..]\n        │  ├─ [selector] execute_calls\n        │  │  ├─ [contract name] forked contract\n        │  │  ├─ [entry point type] External\n        │  │  ├─ [calldata] array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}]\n        │  │  ├─ [contract address] [..]\n        │  │  ├─ [caller address] [..]\n        │  │  ├─ [call type] Call\n        │  │  ├─ [call result] success: array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}]\n        │  │  ├─ [L2 gas] [..]\n        │  │  ├─ [selector] execute_calls\n        │  │  │  ├─ [contract name] forked contract\n        │  │  │  ├─ [entry point type] External\n        │  │  │  ├─ [calldata] array![]\n        │  │  │  ├─ [contract address] [..]\n        │  │  │  ├─ [caller address] [..]\n        │  │  │  ├─ [call type] Call\n        │  │  │  ├─ [call result] success: array![]\n        │  │  │  └─ [L2 gas] [..]\n        │  │  └─ [selector] execute_calls\n        │  │     ├─ [contract name] forked contract\n        │  │     ├─ [entry point type] External\n        │  │     ├─ [calldata] array![]\n        │  │     ├─ [contract address] [..]\n        │  │     ├─ [caller address] [..]\n        │  │     ├─ [call type] Call\n        │  │     ├─ [call result] success: array![]\n        │  │     └─ [L2 gas] [..]\n        │  └─ [selector] execute_calls\n        │     ├─ [contract name] forked contract\n        │     ├─ [entry point type] External\n        │     ├─ [calldata] array![]\n        │     ├─ [contract address] [..]\n        │     ├─ [caller address] [..]\n        │     ├─ [call type] Call\n        │     ├─ [call result] success: array![]\n        │     └─ [L2 gas] [..]\n        └─ [selector] fail\n           ├─ [contract name] forked contract\n           ├─ [entry point type] External\n           ├─ [calldata] array![0x1, 0x2, 0x3, 0x4, 0x5]\n           ├─ [contract address] [..]\n           ├─ [caller address] [..]\n           ├─ [call type] Call\n           ├─ [call result] panic: (0x1, 0x2, 0x3, 0x4, 0x5)\n           └─ [L2 gas] [..]\n        \"}\n}\n\nfn standard_debugging_trace_message(test_name: &str, package_name: &str) -> String {\n    formatdoc! {r\"\n        [test name] {package_name}_integrationtest::test_trace::test_debugging_trace_{test_name}\n        ├─ [selector] execute_calls\n        │  ├─ [contract name] SimpleContract\n        │  ├─ [calldata] array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}]\n        │  ├─ [call result] success: array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}]\n        │  ├─ [selector] execute_calls\n        │  │  ├─ [contract name] SimpleContract\n        │  │  ├─ [calldata] array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}]\n        │  │  ├─ [call result] success: array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}]\n        │  │  ├─ [selector] execute_calls\n        │  │  │  ├─ [contract name] SimpleContract\n        │  │  │  ├─ [calldata] array![]\n        │  │  │  └─ [call result] success: array![]\n        │  │  └─ [selector] execute_calls\n        │  │     ├─ [contract name] SimpleContract\n        │  │     ├─ [calldata] array![]\n        │  │     └─ [call result] success: array![]\n        │  └─ [selector] execute_calls\n        │     ├─ [contract name] SimpleContract\n        │     ├─ [calldata] array![]\n        │     └─ [call result] success: array![]\n        └─ [selector] fail\n           ├─ [contract name] SimpleContract\n           ├─ [calldata] array![0x1, 0x2, 0x3, 0x4, 0x5]\n           └─ [call result] panic: (0x1, 0x2, 0x3, 0x4, 0x5)\n        \"}\n}\n\nfn standard_debugging_trace_message_fork(test_name: &str, package_name: &str) -> String {\n    formatdoc! {r\"\n        [test name] {package_name}_integrationtest::test_trace::test_debugging_trace_{test_name}\n        ├─ [selector] execute_calls\n        │  ├─ [contract name] forked contract\n        │  ├─ [calldata] array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}]\n        │  ├─ [call result] success: array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}]\n        │  ├─ [selector] execute_calls\n        │  │  ├─ [contract name] forked contract\n        │  │  ├─ [calldata] array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}]\n        │  │  ├─ [call result] success: array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}]\n        │  │  ├─ [selector] execute_calls\n        │  │  │  ├─ [contract name] forked contract\n        │  │  │  ├─ [calldata] array![]\n        │  │  │  └─ [call result] success: array![]\n        │  │  └─ [selector] execute_calls\n        │  │     ├─ [contract name] forked contract\n        │  │     ├─ [calldata] array![]\n        │  │     └─ [call result] success: array![]\n        │  └─ [selector] execute_calls\n        │     ├─ [contract name] forked contract\n        │     ├─ [calldata] array![]\n        │     └─ [call result] success: array![]\n        └─ [selector] fail\n           ├─ [contract name] forked contract\n           ├─ [calldata] array![0x1, 0x2, 0x3, 0x4, 0x5]\n           └─ [call result] panic: (0x1, 0x2, 0x3, 0x4, 0x5)\n        \"}\n}\n\nfn minimal_debugging_trace_message(test_name: &str, package_name: &str) -> String {\n    formatdoc! {r\"\n        [test name] {package_name}_integrationtest::test_trace::test_debugging_trace_{test_name}\n        ├─ [selector] execute_calls\n        │  ├─ [contract name] SimpleContract\n        │  ├─ [selector] execute_calls\n        │  │  ├─ [contract name] SimpleContract\n        │  │  ├─ [selector] execute_calls\n        │  │  │  └─ [contract name] SimpleContract\n        │  │  └─ [selector] execute_calls\n        │  │     └─ [contract name] SimpleContract\n        │  └─ [selector] execute_calls\n        │     └─ [contract name] SimpleContract\n        └─ [selector] fail\n           └─ [contract name] SimpleContract\n        \"}\n}\n\nfn minimal_debugging_trace_message_fork(test_name: &str, package_name: &str) -> String {\n    formatdoc! {r\"\n        [test name] {package_name}_integrationtest::test_trace::test_debugging_trace_{test_name}\n        ├─ [selector] execute_calls\n        │  ├─ [contract name] forked contract\n        │  ├─ [selector] execute_calls\n        │  │  ├─ [contract name] forked contract\n        │  │  ├─ [selector] execute_calls\n        │  │  │  └─ [contract name] forked contract\n        │  │  └─ [selector] execute_calls\n        │  │     └─ [contract name] forked contract\n        │  └─ [selector] execute_calls\n        │     └─ [contract name] forked contract\n        └─ [selector] fail\n           └─ [contract name] forked contract\n        \"}\n}\n\nfn custom_output_trace_message(test_name: &str, package_name: &str) -> String {\n    formatdoc! {r\"\n        [test name] {package_name}_integrationtest::test_trace::test_debugging_trace_{test_name}\n        ├─ [selector] execute_calls\n        │  ├─ [contract name] SimpleContract\n        │  ├─ [call type] Call\n        │  ├─ [call result] success: array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}]\n        │  ├─ [selector] execute_calls\n        │  │  ├─ [contract name] SimpleContract\n        │  │  ├─ [call type] Call\n        │  │  ├─ [call result] success: array![RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}, RecursiveCall {{ contract_address: ContractAddress([..]), payload: array![] }}]\n        │  │  ├─ [selector] execute_calls\n        │  │  │  ├─ [contract name] SimpleContract\n        │  │  │  ├─ [call type] Call\n        │  │  │  └─ [call result] success: array![]\n        │  │  └─ [selector] execute_calls\n        │  │     ├─ [contract name] SimpleContract\n        │  │     ├─ [call type] Call\n        │  │     └─ [call result] success: array![]\n        │  └─ [selector] execute_calls\n        │     ├─ [contract name] SimpleContract\n        │     ├─ [call type] Call\n        │     └─ [call result] success: array![]\n        └─ [selector] fail\n           ├─ [contract name] SimpleContract\n           ├─ [call type] Call\n           └─ [call result] panic: (0x1, 0x2, 0x3, 0x4, 0x5)\n        \"}\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/docs_snippets_validation.rs",
    "content": "use clap::Parser;\nuse docs::snippet::SnippetType;\nuse docs::utils::{\n    assert_valid_snippet, get_nth_ancestor, print_ignored_snippet_message,\n    print_snippets_validation_summary,\n};\nuse docs::validation::extract_snippets_from_directory;\nuse forge::Cli;\nuse shared::test_utils::output_assert::assert_stdout_contains;\n\nuse super::common::runner::{runner, setup_package};\n\n#[test]\n#[cfg_attr(\n    feature = \"cairo-native\",\n    ignore = \"TODO(#3790): Many snippets show vm resources witch cairo native doesn't support\"\n)]\nfn test_docs_snippets() {\n    let root_dir = get_nth_ancestor(2);\n    let docs_dir = root_dir.join(\"docs/src\");\n\n    let snippet_type = SnippetType::forge();\n\n    let snippets = extract_snippets_from_directory(&docs_dir, &snippet_type)\n        .expect(\"Failed to extract command snippets\");\n\n    for snippet in &snippets {\n        if snippet.config.ignored {\n            print_ignored_snippet_message(snippet);\n            continue;\n        }\n\n        let args = snippet.to_command_args();\n        let mut args: Vec<&str> = args.iter().map(String::as_str).collect();\n\n        let parse_result = Cli::try_parse_from(args.clone());\n        let err_message = if let Err(err) = &parse_result {\n            err.to_string()\n        } else {\n            String::new()\n        };\n\n        assert_valid_snippet(parse_result.is_ok(), snippet, &err_message);\n\n        // Remove \"snforge\" from the args\n        args.remove(0);\n\n        if let Some(snippet_output) = &snippet.output {\n            let package_name = snippet\n                .config\n                .package_name\n                .clone()\n                .or_else(|| snippet.capture_package_from_output())\n                .expect(\"Cannot find package name in command output or snippet config\");\n\n            let temp = setup_package(&package_name);\n            let output = runner(&temp).args(args).assert();\n\n            assert_stdout_contains(output, snippet_output);\n        }\n    }\n\n    print_snippets_validation_summary(&snippets, snippet_type.as_str());\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/env.rs",
    "content": "use super::common::runner::{setup_package, test_runner};\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stdout_contains;\n\n#[test]\nfn env_var_reading() {\n    let temp = setup_package(\"env\");\n\n    let output = test_runner(&temp)\n        .env(\"FELT_ENV_VAR\", \"987654321\")\n        .env(\"STRING_ENV_VAR\", \"'abcde'\")\n        .env(\n            \"BYTE_ARRAY_ENV_VAR\",\n            r#\"\"that is a very long environment variable that would normally not fit\"\"#,\n        )\n        .assert()\n        .code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 1 test(s) from env package\n        Running 1 test(s) from src/\n        [PASS] env::tests::reading_env_vars [..]\n        Tests: 1 passed, 0 failed, 0 ignored, 0 filtered out\n        \"},\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/features.rs",
    "content": "use super::common::runner::{setup_package, test_runner};\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stdout_contains;\n\n#[test]\nfn features() {\n    let temp = setup_package(\"features\");\n\n    let output = test_runner(&temp)\n        .arg(\"--features\")\n        .arg(\"snforge_test_only\")\n        .assert()\n        .code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 2 test(s) from features package\n        Running 0 test(s) from src/\n        Running 2 test(s) from tests/\n        [PASS] features_integrationtest::test::test_mock_function [..]\n        [PASS] features_integrationtest::test::test_mock_contract [..]\n        Tests: 2 passed, 0 failed, 0 ignored, 0 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn compilation_fails_when_no_features_passed() {\n    let temp = setup_package(\"features\");\n\n    let output = test_runner(&temp).assert().failure();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n        error[..] Function not found.\n    \"},\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/fork_warning.rs",
    "content": "use super::common::runner::{setup_package, test_runner};\nuse assert_fs::fixture::{FileWriteStr, PathChild};\nuse axum::{Router, extract::Query, response::Redirect, routing::any};\nuse indoc::formatdoc;\nuse shared::consts::EXPECTED_RPC_VERSION;\nuse shared::test_utils::node_url::node_url;\nuse shared::test_utils::output_assert::assert_stdout_contains;\nuse std::sync::LazyLock;\nuse std::{thread::sleep, time::Duration};\nuse tokio::{\n    net::TcpListener,\n    runtime::{Builder, Runtime},\n};\n\n#[derive(serde::Deserialize)]\nstruct Params {\n    url: String,\n}\n\n// to make one url look like different ones\nfn setup_redirect_server() {\n    static RT: LazyLock<Runtime> =\n        LazyLock::new(|| Builder::new_multi_thread().enable_all().build().unwrap());\n\n    RT.spawn(async {\n        let app = Router::new().route(\n            \"/\",\n            any(|params: Query<Params>| async move { Redirect::permanent(&params.url) }),\n        );\n\n        let listener = TcpListener::bind(\"127.0.0.1:3030\").await.unwrap();\n\n        axum::serve(listener, app).await.unwrap();\n    });\n\n    // if test uses server make it wait for a second before it's ready\n    sleep(Duration::from_secs(1));\n}\n\n#[test]\nfn should_print_warning() {\n    let temp = setup_package(\"empty\");\n    let mut node_url = node_url();\n    node_url.set_path(\"rpc/v0_6\");\n\n    temp.child(\"tests/test.cairo\")\n        .write_str(\n            formatdoc!(\n                r#\"\n                #[fork(url: \"{node_url}\", block_tag: latest)]\n                #[test]\n                fn t1() {{\n                    assert!(false);\n                }}\n            \"#\n            )\n            .as_str(),\n        )\n        .unwrap();\n\n    let output = test_runner(&temp).assert();\n\n    assert_stdout_contains(\n        output,\n        formatdoc!(\n            r\"\n                [..]Compiling[..]\n                [..]Finished[..]\n                [WARNING] RPC node with the url {node_url} uses incompatible version 0.6.0. Expected version: {EXPECTED_RPC_VERSION}\n\n\n                Collected 1 test(s) from empty package\n                Running 0 test(s) from src/\n                Running 1 test(s) from tests/\n                [FAIL] empty_integrationtest::test::t1\n\n                Failure[..]\n                Tests: 0 passed, 1 failed, 0 ignored, 0 filtered out\n\n                Latest block number = [..] for url = {node_url}\n\n                Failures:\n                    empty_integrationtest::test::t1\n            \"\n        ),\n    );\n}\n\n#[test]\nfn should_dedup_urls() {\n    let temp = setup_package(\"empty\");\n    let mut node_url = node_url();\n    node_url.set_path(\"rpc/v0_6\");\n\n    temp.child(\"tests/test.cairo\")\n        .write_str(\n            formatdoc!(\n                r#\"\n                #[fork(url: \"{node_url}\", block_tag: latest)]\n                #[test]\n                fn t1() {{\n                    assert!(false);\n                }}\n                #[fork(url: \"{node_url}\", block_tag: latest)]\n                #[test]\n                fn t2() {{\n                    assert!(false);\n                }}\n            \"#\n            )\n            .as_str(),\n        )\n        .unwrap();\n\n    let output = test_runner(&temp).assert();\n\n    assert_stdout_contains(\n        output,\n        formatdoc!(\n            r\"\n                [..]Compiling[..]\n                [..]Finished[..]\n                [WARNING] RPC node with the url {node_url} uses incompatible version 0.6.0. Expected version: {EXPECTED_RPC_VERSION}\n\n\n                Collected 2 test(s) from empty package\n                Running 0 test(s) from src/\n                Running 2 test(s) from tests/\n                [FAIL] empty_integrationtest::test::t1\n\n                Failure[..]\n                [FAIL] empty_integrationtest::test::t2\n\n                Failure[..]\n                Tests: 0 passed, 2 failed, 0 ignored, 0 filtered out\n\n                Latest block number = [..] for url = {node_url}\n\n                Failures:\n                    empty_integrationtest::test::t1\n                    empty_integrationtest::test::t2\n            \"\n        ),\n    );\n}\n\n#[test]\nfn should_print_foreach() {\n    setup_redirect_server();\n\n    let temp = setup_package(\"empty\");\n    let mut node_url = node_url();\n    node_url.set_path(\"rpc/v0_6\");\n\n    temp.child(\"tests/test.cairo\")\n        .write_str(\n            formatdoc!(\n                r#\"\n                #[fork(url: \"http://127.0.0.1:3030?url={node_url}\", block_tag: latest)]\n                #[test]\n                fn t1() {{\n                    assert!(false);\n                }}\n                #[fork(url: \"{node_url}\", block_tag: latest)]\n                #[test]\n                fn t2() {{\n                    assert!(false);\n                }}\n            \"#\n            )\n            .as_str(),\n        )\n        .unwrap();\n\n    let output = test_runner(&temp).assert();\n\n    assert_stdout_contains(\n        output,\n        formatdoc!(\n            r\"\n                [..]Compiling[..]\n                [..]Finished[..]\n                [WARNING] RPC node with the url http://127.0.0.1:3030/?url={node_url} uses incompatible version 0.6.0. Expected version: {EXPECTED_RPC_VERSION}\n                [WARNING] RPC node with the url {node_url} uses incompatible version 0.6.0. Expected version: {EXPECTED_RPC_VERSION}\n\n\n                Collected 2 test(s) from empty package\n                Running 0 test(s) from src/\n                Running 2 test(s) from tests/\n                [FAIL] empty_integrationtest::test::t1\n\n                Failure[..]\n                [FAIL] empty_integrationtest::test::t2\n\n                Failure[..]\n                Tests: 0 passed, 2 failed, 0 ignored, 0 filtered out\n\n                Latest block number = [..] for url = http://127.0.0.1:3030/?url={node_url}\n                Latest block number = [..] for url = {node_url}\n\n                Failures:\n                    empty_integrationtest::test::t1\n                    empty_integrationtest::test::t2\n            \"\n        ),\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/forking.rs",
    "content": "use super::common::runner::{\n    BASE_FILE_PATTERNS, Package, runner, setup_package_with_file_patterns, test_runner,\n};\nuse forge_runner::CACHE_DIR;\nuse indoc::{formatdoc, indoc};\nuse shared::test_utils::node_url::node_rpc_url;\nuse shared::test_utils::output_assert::assert_stdout_contains;\n\n#[test]\nfn without_cache() {\n    let temp =\n        setup_package_with_file_patterns(Package::Name(\"forking\".to_string()), BASE_FILE_PATTERNS);\n\n    let output = test_runner(&temp)\n        .arg(\"forking::tests::test_fork_simple\")\n        .assert()\n        .code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 4 test(s) from forking package\n        Running 4 test(s) from src/\n        [PASS] forking::tests::test_fork_simple [..]\n        [PASS] forking::tests::test_fork_simple_number_hex [..]\n        [PASS] forking::tests::test_fork_simple_hash_hex [..]\n        [PASS] forking::tests::test_fork_simple_hash_number [..]\n        Tests: 4 passed, 0 failed, 0 ignored, 2 filtered out\n        \"},\n    );\n}\n\n#[test]\n/// The cache file at `forking/$CACHE_DIR` was modified to have different value stored\n/// that this from the real network. We use it to verify that values from cache are actually used.\n///\n/// The test that passed when using data from network, should fail for fabricated data.\nfn with_cache() {\n    let temp = setup_package_with_file_patterns(\n        Package::Name(\"forking\".to_string()),\n        &[BASE_FILE_PATTERNS, &[&format!(\"{CACHE_DIR}/*.json\")]].concat(),\n    );\n\n    let output = test_runner(&temp)\n        .args([\"--exact\", \"forking::tests::test_fork_simple\"])\n        .assert()\n        // if this fails after bumping rpc version change cache file name (name contains url) in tests/data/forking/.snfoundry_cache/\n        .code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 1 test(s) from forking package\n        Running 1 test(s) from src/\n        [FAIL] forking::tests::test_fork_simple\n\n        Failure data:\n            0x42616c616e63652073686f756c642062652030 ('Balance should be 0')\n\n        Tests: 0 passed, 1 failed, 0 ignored, other filtered out\n\n        Failures:\n            forking::tests::test_fork_simple\n        \"},\n    );\n}\n\n#[test]\nfn with_clean_cache() {\n    let temp = setup_package_with_file_patterns(\n        Package::Name(\"forking\".to_string()),\n        &[BASE_FILE_PATTERNS, &[&format!(\"{CACHE_DIR}/*.json\")]].concat(),\n    );\n\n    runner(&temp).arg(\"clean-cache\").assert().code(0);\n\n    let output = test_runner(&temp)\n        .args([\"--exact\", \"forking::tests::test_fork_simple\"])\n        .assert()\n        .code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 1 test(s) from forking package\n        Running 1 test(s) from src/\n        [PASS] forking::tests::test_fork_simple [..]\n        Tests: 1 passed, 0 failed, 0 ignored, other filtered out\n        \"},\n    );\n}\n\n#[test]\nfn printing_latest_block_number() {\n    let temp = setup_package_with_file_patterns(\n        Package::Name(\"forking\".to_string()),\n        &[BASE_FILE_PATTERNS, &[&format!(\"{CACHE_DIR}/*.json\")]].concat(),\n    );\n    let node_rpc_url = node_rpc_url();\n\n    let output = test_runner(&temp)\n        .args([\"--exact\", \"forking::tests::print_block_number_when_latest\"])\n        .assert()\n        .code(0);\n\n    assert_stdout_contains(\n        output,\n        formatdoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 1 test(s) from forking package\n        Running 1 test(s) from src/\n        [PASS] forking::tests::print_block_number_when_latest [..]\n        Tests: 1 passed, 0 failed, 0 ignored, other filtered out\n\n        Latest block number = [..] for url = {node_rpc_url}\n        \"},\n    );\n}\n\n#[test]\nfn with_skip_fork_tests_env() {\n    let temp =\n        setup_package_with_file_patterns(Package::Name(\"forking\".to_string()), BASE_FILE_PATTERNS);\n\n    let output = test_runner(&temp)\n        .env(\"SNFORGE_IGNORE_FORK_TESTS\", \"1\")\n        .arg(\"forking::tests::test_fork_simple\")\n        .assert()\n        .code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 4 test(s) from forking package\n        Running 4 test(s) from src/\n        [IGNORE] forking::tests::test_fork_simple\n        [IGNORE] forking::tests::test_fork_simple_number_hex\n        [IGNORE] forking::tests::test_fork_simple_hash_hex\n        [IGNORE] forking::tests::test_fork_simple_hash_number\n        Tests: 0 passed, 0 failed, 4 ignored, 2 filtered out\n        \"},\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/fuzzing.rs",
    "content": "use super::common::runner::{setup_package, test_runner};\nuse assert_fs::fixture::{FileTouch, FileWriteStr, PathChild};\nuse indoc::indoc;\nuse shared::test_utils::output_assert::{assert_stderr_contains, assert_stdout_contains};\n\n#[test]\nfn fuzzing() {\n    let temp = setup_package(\"fuzzing\");\n\n    let output = test_runner(&temp).arg(\"fuzzing::\").assert().code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 13 test(s) from fuzzing package\n        Running 13 test(s) from src/\n        [PASS] fuzzing::tests::adding [..]\n        [PASS] fuzzing::tests::fuzzed_argument (runs: 256, [..]\n        [PASS] fuzzing::tests::fuzzed_both_arguments (runs: 256, [..]\n        [PASS] fuzzing::tests::passing [..]\n        [FAIL] fuzzing::tests::failing_fuzz (runs: 1, arguments: [[..], [..]])\n\n        Failure data:\n            0x726573756c74203d3d2061202b2062 ('result == a + b')\n\n        [PASS] fuzzing::tests::custom_fuzzer_config (runs: 10, [..]\n        [PASS] fuzzing::tests::uint8_arg (runs: 256, [..]\n        [PASS] fuzzing::tests::fuzzed_while_loop (runs: 256, [..]\n        [PASS] fuzzing::tests::uint16_arg (runs: 256, [..]\n        [PASS] fuzzing::tests::uint32_arg (runs: 256, [..]\n        [PASS] fuzzing::tests::uint64_arg (runs: 256, [..]\n        [PASS] fuzzing::tests::uint128_arg (runs: 256, [..]\n        [PASS] fuzzing::tests::uint256_arg (runs: 256, [..]\n        Running 0 test(s) from tests/\n        Tests: 12 passed, 1 failed, 0 ignored, 12 filtered out\n        Fuzzer seed: [..]\n\n        Failures:\n            fuzzing::tests::failing_fuzz\n        \"},\n    );\n}\n\n#[test]\nfn fuzzing_set_runs() {\n    let temp = setup_package(\"fuzzing\");\n\n    let output = test_runner(&temp)\n        .args([\"fuzzing::\", \"--fuzzer-runs\", \"10\"])\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n        \n        \n        Collected 13 test(s) from fuzzing package\n        Running 13 test(s) from src/\n        [PASS] fuzzing::tests::adding [..]\n        [PASS] fuzzing::tests::fuzzed_argument (runs: 10, [..]\n        [PASS] fuzzing::tests::fuzzed_both_arguments (runs: 10, [..]\n        [PASS] fuzzing::tests::passing [..]\n        [FAIL] fuzzing::tests::failing_fuzz (runs: 1, arguments: [[..], [..]])\n\n        Failure data:\n            0x726573756c74203d3d2061202b2062 ('result == a + b')\n\n        [PASS] fuzzing::tests::custom_fuzzer_config (runs: 10, [..]\n        [PASS] fuzzing::tests::uint8_arg (runs: 10, [..]\n        [PASS] fuzzing::tests::fuzzed_while_loop (runs: 256, [..]\n        [PASS] fuzzing::tests::uint16_arg (runs: 10, [..]\n        [PASS] fuzzing::tests::uint32_arg (runs: 10, [..]\n        [PASS] fuzzing::tests::uint64_arg (runs: 10, [..]\n        [PASS] fuzzing::tests::uint128_arg (runs: 10, [..]\n        [PASS] fuzzing::tests::uint256_arg (runs: 10, [..]\n        Running 0 test(s) from tests/\n        Tests: 12 passed, 1 failed, 0 ignored, 12 filtered out\n        Fuzzer seed: [..]\n\n        Failures:\n            fuzzing::tests::failing_fuzz\n        \"},\n    );\n}\n\n#[test]\nfn fuzzing_set_seed() {\n    let temp = setup_package(\"fuzzing\");\n\n    let output = test_runner(&temp)\n        .args([\"fuzzing::\", \"--fuzzer-seed\", \"1234\"])\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n        \n        \n        Collected 13 test(s) from fuzzing package\n        Running 13 test(s) from src/\n        [PASS] fuzzing::tests::adding [..]\n        [PASS] fuzzing::tests::fuzzed_argument (runs: 256, [..]\n        [PASS] fuzzing::tests::fuzzed_both_arguments (runs: 256, [..]\n        [PASS] fuzzing::tests::passing [..]\n        [FAIL] fuzzing::tests::failing_fuzz (runs: 1, arguments: [[..], [..]])\n\n        Failure data:\n            0x726573756c74203d3d2061202b2062 ('result == a + b')\n\n        [PASS] fuzzing::tests::custom_fuzzer_config (runs: 10, [..]\n        [PASS] fuzzing::tests::uint8_arg (runs: 256, [..]\n        [PASS] fuzzing::tests::fuzzed_while_loop (runs: 256, [..]\n        [PASS] fuzzing::tests::uint16_arg (runs: 256, [..]\n        [PASS] fuzzing::tests::uint32_arg (runs: 256, [..]\n        [PASS] fuzzing::tests::uint64_arg (runs: 256, [..]\n        [PASS] fuzzing::tests::uint128_arg (runs: 256, [..]\n        [PASS] fuzzing::tests::uint256_arg (runs: 256, [..]\n        Running 0 test(s) from tests/\n        Tests: 12 passed, 1 failed, 0 ignored, 12 filtered out\n        Fuzzer seed: 1234\n\n        Failures:\n            fuzzing::tests::failing_fuzz\n        \"},\n    );\n}\n\n#[test]\nfn fuzzing_incorrect_runs() {\n    let temp = setup_package(\"fuzzing\");\n\n    let output = test_runner(&temp)\n        .args([\"fuzzing::\", \"--fuzzer-runs\", \"0\"])\n        .assert()\n        .code(2);\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        error: invalid value '0' for '--fuzzer-runs <FUZZER_RUNS>': number would be zero for non-zero type\n\n        For more information, try '--help'.\n        \"},\n    );\n}\n\n#[test]\nfn fuzzing_incorrect_function_args() {\n    let temp = setup_package(\"fuzzing\");\n\n    let output = test_runner(&temp)\n        .args([\"incorrect_args\", \"--features\", \"unimplemented\"])\n        .assert()\n        .code(2);\n\n    // TODO(#4170): Replace [..] with actual error message when scarb 2.16.0 will be minimal test version.\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        error[..]: Trait has no implementation in context: snforge_std[..]::fuzzable::Fuzzable::<fuzzing_integrationtest::incorrect_args::MyStruct, fuzzing_integrationtest::incorrect_args::MyStructDebug>.\n\n        [ERROR] Failed to build test artifacts with Scarb: `scarb` exited with error\n        \"},\n    );\n}\n\n#[test]\nfn fuzzing_exit_first() {\n    let temp = setup_package(\"fuzzing\");\n\n    let output = test_runner(&temp)\n        .args([\"exit_first_fuzz\", \"-x\"])\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 2 test(s) from fuzzing package\n        Running 2 test(s) from tests/\n        [FAIL] fuzzing_integrationtest::exit_first_fuzz::exit_first_fails_test (runs: 1, arguments: [[..]])\n\n        Failure data:\n            0x32202b2062203d3d2032202b2062 ('2 + b == 2 + b')\n\n        Tests: 0 passed, 1 failed, 0 ignored, 23 filtered out\n        Interrupted execution of 1 test(s).\n\n        Fuzzer seed: [..]\n        Failures:\n            fuzzing_integrationtest::exit_first_fuzz::exit_first_fails_test\n        \"},\n    );\n}\n\n#[test]\nfn fuzzing_exit_first_single_fail() {\n    let temp = setup_package(\"fuzzing\");\n\n    let output = test_runner(&temp)\n        .args([\"exit_first_single_fail\", \"-x\"])\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 2 test(s) from fuzzing package\n        Running 2 test(s) from tests/\n        [FAIL] fuzzing_integrationtest::exit_first_single_fail::exit_first_fails_test\n\n        Failure data:\n            0x32202b2062203d3d2032202b2062 ('2 + b == 2 + b')\n\n        Failures:\n            fuzzing_integrationtest::exit_first_single_fail::exit_first_fails_test\n\n        Tests: 0 passed, 1 failed, 0 ignored, 23 filtered out\n        Interrupted execution of 1 test(s).\n        \"},\n    );\n}\n\n#[test]\nfn fuzzing_multiple_attributes() {\n    let temp = setup_package(\"fuzzing\");\n\n    let output = test_runner(&temp)\n        .arg(\"multiple_attributes\")\n        .assert()\n        .success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 4 test(s) from fuzzing package\n        Running 4 test(s) from tests/\n        [IGNORE] fuzzing_integrationtest::multiple_attributes::ignored\n        [PASS] fuzzing_integrationtest::multiple_attributes::with_should_panic (runs: 256, [..])\n        [PASS] fuzzing_integrationtest::multiple_attributes::with_available_gas (runs: 50, [..])\n        [PASS] fuzzing_integrationtest::multiple_attributes::with_both (runs: 300, [..])\n        Tests: 3 passed, 0 failed, 1 ignored, 21 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn generate_arg_cheatcode() {\n    let temp = setup_package(\"fuzzing\");\n\n    let output = test_runner(&temp).arg(\"generate_arg\").assert().code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r#\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 2 test(s) from fuzzing package\n        Running 2 test(s) from tests/\n        [FAIL] fuzzing_integrationtest::generate_arg::generate_arg_incorrect_range\n\n        Failure data:\n            \"`generate_arg` cheatcode: `min_value` must be <= `max_value`, provided values after deserialization: 101 and 100\"\n\n        [PASS] fuzzing_integrationtest::generate_arg::use_generate_arg_outside_fuzzer (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~[..])\n        Tests: 1 passed, 1 failed, 0 ignored, 23 filtered out\n        \"#},\n    );\n}\n\n#[test]\n#[cfg_attr(\n    feature = \"skip_test_for_only_latest_scarb\",\n    ignore = \"Plugin checks skipped\"\n)]\nfn no_fuzzer_attribute() {\n    let temp = setup_package(\"fuzzing\");\n    let test_file = temp.child(\"tests/no_attribute.cairo\");\n\n    test_file.touch().unwrap();\n    test_file\n        .write_str(indoc! {r\"\n        #[test]\n        fn no_attribute(arg: felt252) {\n            assert(1 == 1, '');\n        }\n        \"})\n        .unwrap();\n\n    let output = test_runner(&temp).assert().code(2);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        error[E2200]: Plugin diagnostic: #[test] function with parameters must have #[fuzzer] or #[test_case] attribute\n         --> [..]no_attribute.cairo:1:1\n        #[test]\n\n        error: could not compile `fuzzing_integrationtest` due to 1 previous error and 1 warning\n        [ERROR] Failed to build test artifacts with Scarb: `scarb` exited with error\n        \"},\n    );\n}\n\n#[test]\nfn fuzz_generic_struct() {\n    let temp = setup_package(\"fuzzing\");\n\n    let output = test_runner(&temp).arg(\"test_generic\").assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 1 test(s) from fuzzing package\n        Running 1 test(s) from tests/\n        [PASS] fuzzing_integrationtest::generic_struct::test_generic ([..])\n        Tests: 1 passed, 0 failed, 0 ignored, 24 filtered out\n        \"},\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/gas_report.rs",
    "content": "use crate::assert_cleaned_output;\nuse crate::e2e::common::runner::{\n    BASE_FILE_PATTERNS, Package, setup_package, setup_package_with_file_patterns, test_runner,\n};\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stdout_contains;\n\n#[test]\nfn snap_basic() {\n    let temp = setup_package(\"simple_package\");\n    let output = test_runner(&temp)\n        .arg(\"--gas-report\")\n        .arg(\"call_and_invoke\")\n        .env(\"SNFORGE_DETERMINISTIC_OUTPUT\", \"1\")\n        .assert()\n        .code(0);\n\n    assert_cleaned_output!(output);\n}\n\n#[test]\nfn snap_recursive_calls() {\n    let temp = setup_package(\"debugging\");\n    let output = test_runner(&temp)\n        .arg(\"--gas-report\")\n        .arg(\"test_debugging_trace_success\")\n        .env(\"SNFORGE_DETERMINISTIC_OUTPUT\", \"1\")\n        .assert()\n        .code(0);\n\n    assert_cleaned_output!(output);\n}\n\n#[test]\nfn snap_multiple_contracts_and_constructor() {\n    let temp = setup_package(\"simple_package_with_cheats\");\n    let output = test_runner(&temp)\n        .arg(\"--gas-report\")\n        .arg(\"call_and_invoke_proxy\")\n        .env(\"SNFORGE_DETERMINISTIC_OUTPUT\", \"1\")\n        .assert()\n        .code(0);\n\n    assert_cleaned_output!(output);\n}\n\n#[test]\nfn snap_fork() {\n    let temp =\n        setup_package_with_file_patterns(Package::Name(\"forking\".to_string()), BASE_FILE_PATTERNS);\n\n    let output = test_runner(&temp)\n        .arg(\"--gas-report\")\n        .arg(\"test_track_resources\")\n        .env(\"SNFORGE_DETERMINISTIC_OUTPUT\", \"1\")\n        .assert()\n        .code(0);\n\n    assert_cleaned_output!(output);\n}\n\n#[test]\nfn no_transactions() {\n    let temp = setup_package(\"simple_package\");\n    let output = test_runner(&temp)\n        .arg(\"--gas-report\")\n        .arg(\"test_fib\")\n        .assert()\n        .code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n    [..]Compiling[..]\n    [..]Finished[..]\n\n\n    Collected 1 test(s) from simple_package package\n    Running 1 test(s) from src/\n    [PASS] simple_package::tests::test_fib (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~[..])\n    No contract gas usage data to display, no contract calls made.\n\n    Running 0 test(s) from tests/\n    Tests: 1 passed, 0 failed, 0 ignored, [..] filtered out\n    \"},\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/io_operations.rs",
    "content": "use super::common::runner::{\n    BASE_FILE_PATTERNS, Package, setup_package_with_file_patterns, test_runner,\n};\nuse assert_fs::fixture::PathChild;\nuse indoc::formatdoc;\nuse shared::test_utils::output_assert::assert_stdout_contains;\n\n#[test]\nfn file_reading() {\n    let temp = setup_package_with_file_patterns(\n        Package::Name(\"file_reading\".to_string()),\n        &[BASE_FILE_PATTERNS, &[\"**/*.txt\", \"**/*.json\"]].concat(),\n    );\n\n    let expected_file_error = \"No such file or directory [..]\";\n\n    let expected = formatdoc! {r#\"\n        [..]Compiling[..]\n        [..]Finished[..]\n        \n        Collected 11 test(s) from file_reading package\n        Running 0 test(s) from src/\n        Running 11 test(s) from tests/\n        [FAIL] file_reading_integrationtest::test::json_non_existent\n        \n        Failure data:\n            \"{}\"\n        \n        [FAIL] file_reading_integrationtest::test::invalid_json\n        \n        Failure data:\n            \"Parse JSON error: invalid type: integer `231232`, expected a map at line 1 column 6 , in file data/json/invalid.json\"\n        \n        [FAIL] file_reading_integrationtest::test::non_existent\n        \n        Failure data:\n            \"{}\"\n        \n        [FAIL] file_reading_integrationtest::test::non_ascii\n        \n        Failure data:\n            \"Failed to parse data/non_ascii.txt file\"\n        \n        [PASS] file_reading_integrationtest::test::valid_content_and_same_content_no_matter_newlines [..]\n        [PASS] file_reading_integrationtest::test::serialization [..]\n        [PASS] file_reading_integrationtest::test::json_with_array [..]\n        [FAIL] file_reading_integrationtest::test::negative_number\n            \"Failed to parse data/negative_number.txt file\"\n        \n        Failure data:\n        \n        [FAIL] file_reading_integrationtest::test::valid_content_different_folder\n        \n        Failure data:\n            0x756e657870656374656420636f6e74656e74 ('unexpected content')\n        \n        [PASS] file_reading_integrationtest::test::json_serialization [..]\n        [PASS] file_reading_integrationtest::test::json_deserialization [..]\n        Tests: 5 passed, 6 failed, 0 ignored, 0 filtered out\n        \n        Failures:\n            file_reading_integrationtest::test::json_non_existent\n            file_reading_integrationtest::test::invalid_json\n            file_reading_integrationtest::test::non_existent\n            file_reading_integrationtest::test::non_ascii\n            file_reading_integrationtest::test::valid_content_different_folder\n            file_reading_integrationtest::test::negative_number\n    \"#, expected_file_error, expected_file_error};\n\n    // run from different directories to make sure cwd is always set to package directory\n    let output = test_runner(&temp).assert().code(1);\n\n    assert_stdout_contains(output, &expected);\n\n    let output = test_runner(&temp)\n        .current_dir(temp.child(\"src\"))\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(output, &expected);\n\n    let output = test_runner(&temp)\n        .current_dir(temp.child(\"data\"))\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(output, &expected);\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/mod.rs",
    "content": "#[cfg(not(feature = \"cairo-native\"))]\nmod backtrace;\n#[cfg(not(feature = \"cairo-native\"))]\nmod build_profile;\n#[cfg(not(feature = \"cairo-native\"))]\nmod build_trace_data;\nmod clean;\nmod code_quality;\nmod collection;\nmod color;\npub(crate) mod common;\nmod completions;\nmod components;\nmod contract_artifacts;\n#[cfg(not(feature = \"cairo-native\"))]\nmod coverage;\n#[cfg(not(feature = \"cairo-native\"))]\nmod debugger;\n#[cfg(not(feature = \"cairo-native\"))]\nmod debugging;\nmod docs_snippets_validation;\nmod env;\nmod features;\nmod fork_warning;\nmod forking;\nmod fuzzing;\nmod gas_report;\nmod io_operations;\nmod new;\nmod optimize_inlining;\nmod oracles;\nmod package_warnings;\nmod partitioning;\nmod plugin_diagnostics;\nmod plugin_versions;\nmod profiles;\nmod requirements;\nmod running;\nmod steps;\nmod templates;\nmod test_case;\nmod trace_print;\n#[cfg(not(feature = \"cairo-native\"))]\nmod trace_resources;\nmod workspaces;\n"
  },
  {
    "path": "crates/forge/tests/e2e/new.rs",
    "content": "use super::common::runner::{runner, snforge_test_bin_path, test_runner};\nuse crate::utils::tempdir_with_tool_versions;\nuse assert_fs::TempDir;\nuse assert_fs::fixture::{FileTouch, PathChild};\nuse forge::CAIRO_EDITION;\nuse forge::Template;\nuse forge::scarb::config::SCARB_MANIFEST_TEMPLATE_CONTENT;\nuse indoc::{formatdoc, indoc};\nuse itertools::Itertools;\nuse regex::Regex;\nuse scarb_api::ScarbCommand;\nuse shared::consts::FREE_RPC_PROVIDER_URL;\nuse shared::test_utils::output_assert::assert_stdout_contains;\nuse snapbox::assert_data_eq;\nuse snapbox::cmd::Command as SnapboxCommand;\nuse std::ffi::OsString;\nuse std::path::{Path, PathBuf};\nuse std::str::FromStr;\nuse std::sync::LazyLock;\nuse std::{env, fs, iter};\nuse test_case::test_case;\nuse toml_edit::{DocumentMut, Formatted, InlineTable, Item, Value};\n\nstatic RE_NEWLINES: LazyLock<Regex> = LazyLock::new(|| Regex::new(r\"\\n{3,}\").unwrap());\n\n#[test_case(&Template::CairoProgram; \"cairo-program\")]\n#[test_case(&Template::BalanceContract; \"balance-contract\")]\n#[cfg_attr(\n    not(feature = \"run_test_for_scarb_since_2_15_1\"),\n    test_case(&Template::Erc20Contract => ignore[\"Skipping test because feature run_test_for_scarb_since_2_15_1 is not enabled\"] (); \"erc20-contract\")\n)]\n#[cfg_attr(\n    feature = \"run_test_for_scarb_since_2_15_1\",\n    test_case(&Template::Erc20Contract; \"erc20-contract\")\n)]\nfn create_new_project_dir_not_exist(template: &Template) {\n    let temp = tempdir_with_tool_versions().unwrap();\n    let project_path = temp.join(\"new\").join(\"project\");\n\n    runner(&temp)\n        .args([\n            \"new\",\n            \"--name\",\n            \"test_name\",\n            \"--template\",\n            template.to_string().as_str(),\n        ])\n        .arg(&project_path)\n        .env(\"DEV_DISABLE_SNFORGE_STD_DEPENDENCY\", \"true\")\n        .assert()\n        .success();\n\n    validate_init(&project_path, false, template);\n}\n\n#[test]\nfn create_new_project_dir_not_empty() {\n    let temp = tempdir_with_tool_versions().unwrap();\n    temp.child(\"empty.txt\").touch().unwrap();\n\n    let output = runner(&temp)\n        .args([\"new\", \"--name\", \"test_name\"])\n        .arg(temp.path())\n        .assert()\n        .code(2);\n\n    assert_stdout_contains(\n        output,\n        indoc!(\n            r\"\n                [ERROR] The provided path [..] points to a non-empty directory. If you wish to create a project in this directory, use the `--overwrite` flag\n            \"\n        ),\n    );\n}\n\n#[test]\nfn create_new_project_dir_exists_and_empty() {\n    let temp = tempdir_with_tool_versions().unwrap();\n    let project_path = temp.join(\"new\").join(\"project\");\n\n    fs::create_dir_all(&project_path).unwrap();\n    assert!(project_path.exists());\n\n    runner(&temp)\n        .args([\"new\", \"--name\", \"test_name\"])\n        .arg(&project_path)\n        .env(\"DEV_DISABLE_SNFORGE_STD_DEPENDENCY\", \"true\")\n        .assert()\n        .success();\n\n    validate_init(&project_path, false, &Template::BalanceContract);\n}\n\n#[test]\nfn init_new_project_from_scarb() {\n    let temp = tempdir_with_tool_versions().unwrap();\n\n    SnapboxCommand::from_std(\n        ScarbCommand::new()\n            .current_dir(temp.path())\n            .args([\"new\", \"test_name\"])\n            .env(\"SCARB_INIT_TEST_RUNNER\", \"starknet-foundry\")\n            .env(\n                \"PATH\",\n                append_to_path_var(snforge_test_bin_path().parent().unwrap()),\n            )\n            .command(),\n    )\n    .assert()\n    .success();\n\n    validate_init(&temp.join(\"test_name\"), true, &Template::BalanceContract);\n}\n\npub fn append_to_path_var(path: &Path) -> OsString {\n    let script_path = iter::once(path.to_path_buf());\n    let os_path = env::var_os(\"PATH\").unwrap();\n    let other_paths = env::split_paths(&os_path);\n    env::join_paths(script_path.chain(other_paths)).unwrap()\n}\n\nfn validate_init(project_path: &PathBuf, validate_snforge_std: bool, template: &Template) {\n    let manifest_path = project_path.join(\"Scarb.toml\");\n    let scarb_toml = fs::read_to_string(manifest_path.clone()).unwrap();\n\n    let expected = get_expected_manifest_content(template, validate_snforge_std);\n    assert_manifest_matches(&expected, &scarb_toml);\n\n    let mut scarb_toml = DocumentMut::from_str(&scarb_toml).unwrap();\n\n    let dependencies = scarb_toml\n        .get_mut(\"dev-dependencies\")\n        .unwrap()\n        .as_table_mut()\n        .unwrap();\n\n    let local_snforge_std = Path::new(\"../../snforge_std\")\n        .canonicalize()\n        .unwrap()\n        .to_str()\n        .unwrap()\n        .to_string();\n\n    let mut snforge_std = InlineTable::new();\n    snforge_std.insert(\"path\", Value::String(Formatted::new(local_snforge_std)));\n\n    dependencies.remove(\"snforge_std\");\n    dependencies.insert(\"snforge_std\", Item::Value(Value::InlineTable(snforge_std)));\n\n    fs::write(manifest_path, scarb_toml.to_string()).unwrap();\n\n    let output = test_runner(TempDir::new().unwrap())\n        .current_dir(project_path)\n        .assert()\n        .success();\n\n    let expected = get_expected_output(template);\n    assert_stdout_contains(output, expected);\n}\n\nfn get_expected_manifest_content(template: &Template, validate_snforge_std: bool) -> String {\n    let snforge_std_assert = if validate_snforge_std {\n        \"\\nsnforge_std = \\\"[..]\\\"\"\n    } else {\n        \"\"\n    };\n\n    let target_contract_entry = \"[[target.starknet-contract]]\\nsierra = true\";\n\n    let fork_config = if let Template::Erc20Contract = template {\n        &formatdoc!(\n            r#\"\n            [[tool.snforge.fork]]\n            name = \"SEPOLIA_LATEST\"\n            url = \"{FREE_RPC_PROVIDER_URL}\"\n            block_id = {{ tag = \"latest\" }}\n        \"#\n        )\n    } else {\n        \"\"\n    };\n\n    let (dependencies, target_contract_entry) = match template {\n        Template::BalanceContract => (\"starknet = \\\"[..]\\\"\", target_contract_entry),\n        Template::Erc20Contract => (\n            \"openzeppelin_interfaces = \\\"[..]\\\"\\nopenzeppelin_token = \\\"[..]\\\"\\nopenzeppelin_utils = \\\"[..]\\\"\\nstarknet = \\\"[..]\\\"\",\n            target_contract_entry,\n        ),\n        Template::CairoProgram => (\"\", \"\"),\n    };\n\n    let allow_prebuild_plugins_assert = r#\"allow-prebuilt-plugins = [\"snforge_std\"]\"#;\n\n    let expected_manifest = formatdoc!(\n        r#\"\n            [package]\n            name = \"test_name\"\n            version = \"0.1.0\"\n            edition = \"{CAIRO_EDITION}\"\n\n            # See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html\n\n            [dependencies]\n            {dependencies}\n\n            [dev-dependencies]{}\n            assert_macros = \"[..]\"\n\n            {target_contract_entry}\n\n            [scripts]\n            test = \"snforge test\"\n\n            [tool.scarb]\n            {allow_prebuild_plugins_assert}\n\n            {fork_config}\n\n            {}\n        \"#,\n        snforge_std_assert,\n        SCARB_MANIFEST_TEMPLATE_CONTENT.trim_end()\n    );\n\n    // Replace 3 or more consecutive newlines with exactly 2 newlines\n    RE_NEWLINES\n        .replace_all(&expected_manifest, \"\\n\\n\")\n        .to_string()\n}\n\nfn get_expected_output(template: &Template) -> &str {\n    match template {\n        Template::CairoProgram => {\n            indoc!(\n                r\"\n                [..]Compiling[..]\n                [..]Finished[..]\n\n                Collected 1 test(s) from test_name package\n                Running 1 test(s) from src/\n                [PASS] test_name::tests::it_works [..]\n                Tests: 1 passed, 0 failed, 0 ignored, 0 filtered out\n                \"\n            )\n        }\n        Template::BalanceContract => {\n            indoc!(\n                r\"\n                [..]Compiling[..]\n                [..]Finished[..]\n\n                Collected 2 test(s) from test_name package\n                Running 0 test(s) from src/\n                Running 2 test(s) from tests/\n                [PASS] test_name_integrationtest::test_contract::test_increase_balance [..]\n                [PASS] test_name_integrationtest::test_contract::test_cannot_increase_balance_with_zero_value [..]\n                Tests: 2 passed, 0 failed, 0 ignored, 0 filtered out\n                \"\n            )\n        }\n        Template::Erc20Contract => {\n            indoc!(\n                r\"\n                [..]Compiling[..]\n                [..]Finished[..]\n\n                Collected 8 test(s) from test_name package\n                Running 8 test(s) from tests/\n                [PASS] test_name_integrationtest::test_erc20::should_panic_transfer [..]\n                [PASS] test_name_integrationtest::test_erc20::test_get_balance [..]\n                [PASS] test_name_integrationtest::test_erc20::test_transfer [..]\n                [PASS] test_name_integrationtest::test_erc20::test_transfer_event [..]\n                [PASS] test_name_integrationtest::test_token_sender::test_multisend [..]\n                [PASS] test_name_integrationtest::test_token_sender::test_single_send_fuzz [..]\n                [PASS] test_name_integrationtest::test_token_sender::test_single_send [..]\n                [PASS] test_name_integrationtest::test_erc20::test_fork_transfer [..]\n                Running 0 test(s) from src/\n                Tests: 8 passed, 0 failed, 0 ignored, 0 filtered out\n                \"\n            )\n        }\n    }\n}\n\n#[test]\nfn create_new_project_and_check_gitignore() {\n    let temp = tempdir_with_tool_versions().unwrap();\n    let project_path = temp.join(\"project\");\n\n    runner(&temp)\n        .env(\"DEV_DISABLE_SNFORGE_STD_DEPENDENCY\", \"true\")\n        .args([\"new\", \"--name\", \"test_name\"])\n        .arg(&project_path)\n        .assert()\n        .success();\n\n    let gitignore_path = project_path.join(\".gitignore\");\n    assert!(gitignore_path.exists(), \".gitignore file should exist\");\n\n    let gitignore_content = fs::read_to_string(gitignore_path).unwrap();\n\n    let expected_gitignore_content = indoc! {\n        r\"\n        target\n        .snfoundry_cache/\n        snfoundry_trace/\n        coverage/\n        profile/\n        \"\n    };\n\n    assert_eq!(gitignore_content, expected_gitignore_content);\n}\n\n/// Asserts that two manifest contents match, ignoring the order of lines.\n///\n/// # Why Line Order Can Vary\n///\n/// Starting from Scarb version 2.13, `scarb init` no longer inserts the `[dev-dependencies]` section.\n/// When tools like `forge new` generate a new project, they insert this section later\n/// in the manifest. As a result, the relative placement of `[dev-dependencies]` and other sections\n/// might differ depending on the version of Scarb used.\nfn assert_manifest_matches(expected: &str, actual: &str) {\n    // TODO(#3910)\n    fn sort_lines(s: &str) -> String {\n        s.lines().sorted().join(\"\\n\")\n    }\n\n    assert_data_eq!(sort_lines(actual), sort_lines(expected));\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/optimize_inlining.rs",
    "content": "use super::common::runner::{runner, setup_package};\nuse crate::assert_cleaned_output;\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stdout_contains;\nuse std::fs;\nuse toml_edit::Document;\n\nfn read_optimization_graph(dir: &std::path::Path, min: u32, max: u32, step: u32) -> Vec<u8> {\n    let workspace_name = dir.file_name().unwrap().to_string_lossy();\n    let filename = format!(\"{workspace_name}_optimization_results_l_{min}_h_{max}_s_{step}.png\");\n    fs::read(dir.join(\"target\").join(&filename))\n        .unwrap_or_else(|e| panic!(\"Failed to read {filename}: {e}\"))\n}\n\n#[test]\nfn snap_optimize_inlining_dry_run() {\n    let temp = setup_package(\"simple_package\");\n\n    let output = runner(&temp)\n        .env(\"SCARB_UI_VERBOSITY\", \"quiet\")\n        .env(\"SNFORGE_DETERMINISTIC_OUTPUT\", \"1\")\n        .arg(\"optimize-inlining\")\n        .arg(\"--exact\")\n        .arg(\"simple_package_integrationtest::contract::call_and_invoke\")\n        .arg(\"--contracts\")\n        .arg(\"HelloStarknet\")\n        .arg(\"--min-threshold\")\n        .arg(\"0\")\n        .arg(\"--max-threshold\")\n        .arg(\"100\")\n        .arg(\"--step\")\n        .arg(\"50\")\n        .assert()\n        .success();\n\n    assert_cleaned_output!(output);\n\n    let graph_bytes = read_optimization_graph(temp.path(), 0, 100, 50);\n    insta::assert_binary_snapshot!(\"optimize_inlining_dry_run.png\", graph_bytes);\n}\n\n#[test]\nfn snap_optimize_inlining_updates_manifest() {\n    let temp = setup_package(\"simple_package\");\n\n    let initial_scarb_toml = fs::read_to_string(temp.path().join(\"Scarb.toml\"))\n        .expect(\"Failed to read initial Scarb.toml\");\n    let initial_scarb_toml =\n        Document::parse(&initial_scarb_toml).expect(\"Failed to parse initial Scarb.toml\");\n\n    let initial_inlining_strategy = initial_scarb_toml\n        .as_table()\n        .get(\"profile\")\n        .and_then(|item| item.as_table())\n        .and_then(|profile| profile.get(\"release\"))\n        .and_then(|item| item.as_table())\n        .and_then(|release| release.get(\"cairo\"))\n        .and_then(|item| item.as_table())\n        .and_then(|cairo| cairo.get(\"inlining-strategy\"))\n        .and_then(toml_edit::Item::as_integer);\n    assert!(\n        initial_inlining_strategy.is_none(),\n        \"inlining-strategy should not be set before optimization\"\n    );\n\n    let output = runner(&temp)\n        .env(\"SCARB_UI_VERBOSITY\", \"quiet\")\n        .env(\"SNFORGE_DETERMINISTIC_OUTPUT\", \"1\")\n        .arg(\"optimize-inlining\")\n        .arg(\"--exact\")\n        .arg(\"simple_package_integrationtest::contract::call_and_invoke\")\n        .arg(\"--contracts\")\n        .arg(\"HelloStarknet\")\n        .arg(\"--gas\")\n        .arg(\"--min-threshold\")\n        .arg(\"0\")\n        .arg(\"--max-threshold\")\n        .arg(\"10\")\n        .arg(\"--step\")\n        .arg(\"10\")\n        .assert()\n        .success();\n\n    assert_cleaned_output!(output);\n\n    let graph_bytes = read_optimization_graph(temp.path(), 0, 10, 10);\n    insta::assert_binary_snapshot!(\"optimize_inlining_updates_manifest.png\", graph_bytes);\n\n    let scarb_toml = fs::read_to_string(temp.path().join(\"Scarb.toml\"))\n        .expect(\"Failed to read updated Scarb.toml\");\n    let scarb_toml = Document::parse(&scarb_toml).expect(\"Failed to parse updated Scarb.toml\");\n\n    let updated_inlining_strategy = scarb_toml\n        .as_table()\n        .get(\"profile\")\n        .and_then(|item| item.as_table())\n        .and_then(|profile| profile.get(\"release\"))\n        .and_then(|item| item.as_table())\n        .and_then(|release| release.get(\"cairo\"))\n        .and_then(|item| item.as_table())\n        .and_then(|cairo| cairo.get(\"inlining-strategy\"))\n        .and_then(toml_edit::Item::as_integer);\n\n    assert_eq!(\n        updated_inlining_strategy,\n        Some(10),\n        \"inlining-strategy should be set to 10 after optimization\"\n    );\n}\n\n#[test]\nfn optimize_inlining_fails_without_contracts() {\n    let temp = setup_package(\"fuzzing\");\n\n    let output = runner(&temp)\n        .arg(\"optimize-inlining\")\n        .arg(\"--exact\")\n        .arg(\"fuzzing::tests::test_fuzz\")\n        .arg(\"--contracts\")\n        .arg(\"SomeContract\")\n        .assert()\n        .failure();\n\n    assert_stdout_contains(\n        output,\n        \"[ERROR] Optimization failed: No starknet_artifacts.json found. Only projects with contracts can be optimized.\",\n    );\n}\n\n#[test]\nfn optimize_inlining_fails_with_nonexistent_contract() {\n    let temp = setup_package(\"simple_package\");\n\n    let output = runner(&temp)\n        .arg(\"optimize-inlining\")\n        .arg(\"--exact\")\n        .arg(\"simple_package_integrationtest::contract::call_and_invoke\")\n        .arg(\"--contracts\")\n        .arg(\"NonExistentContract\")\n        .arg(\"--min-threshold\")\n        .arg(\"0\")\n        .arg(\"--max-threshold\")\n        .arg(\"0\")\n        .arg(\"--step\")\n        .arg(\"1\")\n        .assert()\n        .failure();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [ERROR] Optimization failed: The following contracts were not found in starknet artifacts: NonExistentContract. Available contracts: [..]\n        \"},\n    );\n}\n\n#[test]\nfn optimize_inlining_fails_with_low_max_program_len() {\n    let temp = setup_package(\"simple_package\");\n\n    let output = runner(&temp)\n        .arg(\"optimize-inlining\")\n        .arg(\"--exact\")\n        .arg(\"simple_package_integrationtest::contract::call_and_invoke\")\n        .arg(\"--contracts\")\n        .arg(\"HelloStarknet\")\n        .arg(\"--max-contract-program-len\")\n        .arg(\"1\")\n        .arg(\"--min-threshold\")\n        .arg(\"0\")\n        .arg(\"--max-threshold\")\n        .arg(\"0\")\n        .arg(\"--step\")\n        .arg(\"1\")\n        .assert()\n        .failure();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [1/1] Testing threshold 0...\n        [..]\n          ✗ Contract size [..] exceeds limit [..] or felts [..] exceeds limit 1.\n        Try optimizing with lower threshold limit.\n        [ERROR] Optimization failed: No valid optimization results found\n        \"},\n    );\n}\n\n#[test]\nfn optimize_inlining_fails_when_no_tests_matched() {\n    let temp = setup_package(\"simple_package\");\n\n    let output = runner(&temp)\n        .arg(\"optimize-inlining\")\n        .arg(\"--exact\")\n        .arg(\"simple_package::tests::nonexistent_test\")\n        .arg(\"--contracts\")\n        .arg(\"HelloStarknet\")\n        .arg(\"--min-threshold\")\n        .arg(\"0\")\n        .arg(\"--max-threshold\")\n        .arg(\"0\")\n        .arg(\"--step\")\n        .arg(\"1\")\n        .assert()\n        .failure();\n\n    assert_stdout_contains(\n        output,\n        \"[ERROR] Optimization failed: No tests were executed. The --exact filter did not match any test cases.\",\n    );\n}\n\n#[test]\nfn optimize_inlining_requires_single_exact_test_case() {\n    let temp = setup_package(\"simple_package\");\n\n    let output = runner(&temp)\n        .arg(\"optimize-inlining\")\n        .arg(\"--contracts\")\n        .arg(\"HelloStarknet\")\n        .assert()\n        .failure();\n\n    assert_stdout_contains(\n        output,\n        \"[ERROR] optimize-inlining requires using the `--exact` flag\",\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/oracles.rs",
    "content": "use crate::e2e::common::runner::{\n    BASE_FILE_PATTERNS, Package, setup_package_with_file_patterns, test_runner,\n};\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stdout_contains;\n\n#[cfg_attr(\n    not(feature = \"run_test_for_scarb_since_2_13_1\"),\n    ignore = \"Skipping test because feature skip_test_for_scarb_2_13 enabled\"\n)]\n#[test]\nfn wasm() {\n    let temp = setup_package_with_file_patterns(\n        Package::Name(\"wasm_oracles\".to_string()),\n        &[BASE_FILE_PATTERNS, &[\"*.wasm\"]].concat(),\n    );\n\n    let output = test_runner(&temp)\n        // Output of oracle is different depending on the env, and Intellij sets it automatically\n        .env_remove(\"RUST_BACKTRACE\")\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r#\"\n    [..]Compiling[..]\n    [..]Finished[..]\n\n    Collected 5 test(s) from oracles package\n    Running 5 test(s) from tests/\n    [PASS] oracles_integrationtest::test::err ([..])\n    [PASS] oracles_integrationtest::test::add ([..])\n    [PASS] oracles_integrationtest::test::panic ([..])\n    [FAIL] oracles_integrationtest::test::unexpected_panic\n\n    Failure data:\n        0x526573756c743a3a756e77726170206661696c65642e ('Result::unwrap failed.')\n    [FAIL] oracles_integrationtest::test::panic_contents\n\n    Failure data:\n        \"error while executing at wasm backtrace:\n           [..]\n           [..] wasm_oracle.wasm!panic\n\n        Caused by:\n            wasm trap: wasm `unreachable` instruction executed\"\n\n    Running 0 test(s) from src/\n    Tests: 3 passed, 2 failed, 0 ignored, 0 filtered out\n    \"#},\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/package_warnings.rs",
    "content": "use crate::e2e::common::runner::{get_current_branch, get_remote_url, setup_package};\nuse assert_fs::fixture::{FileWriteStr, PathChild};\nuse indoc::formatdoc;\nuse scarb_api::ScarbCommand;\nuse shared::test_utils::output_assert::AsOutput;\nuse snapbox::cmd::Command as SnapboxCommand;\n\n#[ignore = \"TODO(#4091): Restore this test, verify if scheduled tests work\"]\n#[test]\nfn no_warnings_are_produced() {\n    let temp = setup_package(\"simple_package\");\n\n    let remote_url = get_remote_url().to_lowercase();\n    let branch = get_current_branch();\n    let manifest_path = temp.child(\"Scarb.toml\");\n\n    let snforge_std = format!(\n        r#\"snforge_std = {{ git = \"https://github.com/{remote_url}\", branch = \"{branch}\" }}\"#\n    );\n\n    manifest_path\n        .write_str(&formatdoc!(\n            r#\"\n            [package]\n            name = \"simple_package\"\n            version = \"0.1.0\"\n            edition = \"2024_07\"\n\n            [[target.starknet-contract]]\n\n            [dependencies]\n            starknet = \"2.10.1\"\n            {snforge_std}\n\n            [cairo]\n            allow-warnings = false\n            \"#,\n        ))\n        .unwrap();\n\n    let output = SnapboxCommand::from(\n        ScarbCommand::new()\n            .current_dir(temp.path())\n            .args([\"build\", \"--test\"])\n            .command(),\n    )\n    .assert()\n    .code(0);\n\n    assert!(!output.as_stdout().contains(\"warn:\"));\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/partitioning.rs",
    "content": "use crate::e2e::common::runner::{setup_package, test_runner};\nuse indoc::indoc;\nuse shared::test_utils::output_assert::{assert_stderr_contains, assert_stdout_contains};\n\n#[test]\nfn test_does_not_work_with_exact_flag() {\n    let temp = setup_package(\"simple_package\");\n    let output = test_runner(&temp)\n        .args([\"--partition\", \"3/3\", \"--workspace\", \"--exact\"])\n        .assert()\n        .code(2);\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        error: the argument '--partition <INDEX/TOTAL>' cannot be used with '--exact'\n    \"},\n    );\n}\n\n#[test]\nfn test_whole_workspace_partition_1_2() {\n    let temp = setup_package(\"partitioning\");\n    let output = test_runner(&temp)\n        .args([\"--partition\", \"1/2\", \"--workspace\"])\n        .assert()\n        .code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n        Running partition run: 1/2\n\n        Collected 2 test(s) from package_a package\n        Running 1 test(s) from tests/\n        [PASS] package_a_integrationtest::tests::test_c ([..])\n        Running 1 test(s) from src/\n        [PASS] package_a::tests::test_a ([..])\n        Tests: 2 passed, 0 failed, 0 ignored, 0 filtered out\n\n\n        Collected 2 test(s) from package_b package\n        Running 1 test(s) from src/\n        [PASS] package_b::tests::test_e ([..])\n        Running 1 test(s) from tests/\n        [PASS] package_b_integrationtest::tests::test_g ([..])\n        Tests: 2 passed, 0 failed, 0 ignored, 0 filtered out\n\n\n        Collected 3 test(s) from partitioning package\n        Running 2 test(s) from tests/\n        [PASS] partitioning_integrationtest::tests::test_k ([..])\n        [PASS] partitioning_integrationtest::tests::test_m ([..])\n        Running 1 test(s) from src/\n        [PASS] partitioning::tests::test_i ([..])\n        Tests: 3 passed, 0 failed, 0 ignored, 0 filtered out\n\n\n        Tests summary: 7 passed, 0 failed, 0 ignored, 0 filtered out\n        \n        Finished partition run: 1/2, included 7 out of total 13 tests\n    \"},\n    );\n}\n\n#[test]\nfn test_whole_workspace_partition_2_2() {\n    let temp = setup_package(\"partitioning\");\n    let output = test_runner(&temp)\n        .args([\"--partition\", \"2/2\", \"--workspace\"])\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r#\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n        Running partition run: 2/2\n\n        Collected 2 test(s) from package_a package\n        Running 1 test(s) from tests/\n        [PASS] package_a_integrationtest::tests::test_d ([..])\n        Running 1 test(s) from src/\n        [IGNORE] package_a::tests::test_b\n        Tests: 1 passed, 0 failed, 1 ignored, 0 filtered out\n\n\n        Collected 2 test(s) from package_b package\n        Running 1 test(s) from src/\n        [PASS] package_b::tests::test_f ([..])\n        Running 1 test(s) from tests/\n        [FAIL] package_b_integrationtest::tests::test_h\n\n        Failure data:\n            \"assertion failed: `1 + 1 == 3`.\"\n\n        Tests: 1 passed, 1 failed, 0 ignored, 0 filtered out\n\n\n        Collected 2 test(s) from partitioning package\n        Running 1 test(s) from tests/\n        [PASS] partitioning_integrationtest::tests::test_l ([..])\n        Running 1 test(s) from src/\n        [PASS] partitioning::tests::test_j ([..])\n        Tests: 2 passed, 0 failed, 0 ignored, 0 filtered out\n\n        Failures:\n            package_b_integrationtest::tests::test_h\n\n        Tests summary: 4 passed, 1 failed, 1 ignored, 0 filtered out\n\n        Finished partition run: 2/2, included 6 out of total 13 tests\n    \"#},\n    );\n}\n\n#[test]\nfn test_whole_workspace_partition_1_3() {\n    let temp = setup_package(\"partitioning\");\n    let output = test_runner(&temp)\n        .args([\"--partition\", \"1/3\", \"--workspace\"])\n        .assert()\n        .code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n        Running partition run: 1/3\n\n        Collected 2 test(s) from package_a package\n        Running 1 test(s) from src/\n        [PASS] package_a::tests::test_a ([..])\n        Running 1 test(s) from tests/\n        [PASS] package_a_integrationtest::tests::test_d ([..])\n        Tests: 2 passed, 0 failed, 0 ignored, 0 filtered out\n\n\n        Collected 1 test(s) from package_b package\n        Running 0 test(s) from src/\n        Running 1 test(s) from tests/\n        [PASS] package_b_integrationtest::tests::test_g ([..])\n        Tests: 1 passed, 0 failed, 0 ignored, 0 filtered out\n\n\n        Collected 2 test(s) from partitioning package\n        Running 1 test(s) from src/\n        [PASS] partitioning::tests::test_j ([..])\n        Running 1 test(s) from tests/\n        [PASS] partitioning_integrationtest::tests::test_m ([..])\n        Tests: 2 passed, 0 failed, 0 ignored, 0 filtered out\n\n\n        Tests summary: 5 passed, 0 failed, 0 ignored, 0 filtered out\n\n        Finished partition run: 1/3, included 5 out of total 13 tests\n    \"},\n    );\n}\n\n#[test]\nfn test_whole_workspace_partition_2_3() {\n    let temp = setup_package(\"partitioning\");\n    let output = test_runner(&temp)\n        .args([\"--partition\", \"2/3\", \"--workspace\"])\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r#\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n        Running partition run: 2/3\n\n        Collected 1 test(s) from package_a package\n        Running 0 test(s) from tests/\n        Running 1 test(s) from src/\n        [IGNORE] package_a::tests::test_b\n        Tests: 0 passed, 0 failed, 1 ignored, 0 filtered out\n\n\n        Collected 2 test(s) from package_b package\n        Running 1 test(s) from tests/\n        [FAIL] package_b_integrationtest::tests::test_h\n\n        Failure data:\n            \"assertion failed: `1 + 1 == 3`.\"\n\n        Running 1 test(s) from src/\n        [PASS] package_b::tests::test_e ([..])\n        Tests: 1 passed, 1 failed, 0 ignored, 0 filtered out\n\n\n        Collected 1 test(s) from partitioning package\n        Running 1 test(s) from tests/\n        [PASS] partitioning_integrationtest::tests::test_k ([..])\n        Running 0 test(s) from src/\n        Tests: 1 passed, 0 failed, 0 ignored, 0 filtered out\n\n        Failures:\n            package_b_integrationtest::tests::test_h\n\n        Tests summary: 2 passed, 1 failed, 1 ignored, 0 filtered out\n\n        Finished partition run: 2/3, included 4 out of total 13 tests\n    \"#},\n    );\n}\n\n#[test]\nfn test_whole_workspace_partition_3_3() {\n    let temp = setup_package(\"partitioning\");\n    let output = test_runner(&temp)\n        .args([\"--partition\", \"3/3\", \"--workspace\"])\n        .assert()\n        .code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n        Running partition run: 3/3\n\n        Collected 1 test(s) from package_a package\n        Running 1 test(s) from tests/\n        [PASS] package_a_integrationtest::tests::test_c ([..])\n        Running 0 test(s) from src/\n        Tests: 1 passed, 0 failed, 0 ignored, 0 filtered out\n\n\n        Collected 1 test(s) from package_b package\n        Running 1 test(s) from src/\n        [PASS] package_b::tests::test_f ([..])\n        Running 0 test(s) from tests/\n        Tests: 1 passed, 0 failed, 0 ignored, 0 filtered out\n\n\n        Collected 2 test(s) from partitioning package\n        Running 1 test(s) from tests/\n        [PASS] partitioning_integrationtest::tests::test_l ([..])\n        Running 1 test(s) from src/\n        [PASS] partitioning::tests::test_i ([..])\n        Tests: 2 passed, 0 failed, 0 ignored, 0 filtered out\n\n\n        Tests summary: 4 passed, 0 failed, 0 ignored, 0 filtered out\n\n        Finished partition run: 3/3, included 4 out of total 13 tests\n    \"},\n    );\n}\n\n#[test]\nfn test_works_with_name_filter() {\n    let temp = setup_package(\"partitioning\");\n    let output = test_runner(&temp)\n        .args([\"--partition\", \"1/3\", \"--workspace\", \"test_a\"])\n        .assert()\n        .code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n        Running partition run: 1/3\n\n        Collected 1 test(s) from package_a package\n        Running 0 test(s) from tests/\n        Running 1 test(s) from src/\n        [PASS] package_a::tests::test_a ([..])\n        Tests: 1 passed, 0 failed, 0 ignored, 1 filtered out\n\n\n        Collected 0 test(s) from package_b package\n        Running 0 test(s) from src/\n        Running 0 test(s) from tests/\n        Tests: 0 passed, 0 failed, 0 ignored, 1 filtered out\n\n\n        Collected 0 test(s) from partitioning package\n        Running 0 test(s) from tests/\n        Running 0 test(s) from src/\n        Tests: 0 passed, 0 failed, 0 ignored, 2 filtered out\n\n\n        Tests summary: 1 passed, 0 failed, 0 ignored, 4 filtered out\n\n        Finished partition run: 1/3, included 5 out of total 13 tests\n    \"},\n    );\n}\n\n#[cfg(not(feature = \"cairo-native\"))]\n#[test]\nfn test_works_with_coverage() {\n    let temp = setup_package(\"partitioning\");\n    test_runner(&temp)\n        .args([\"--partition\", \"1/2\", \"--workspace\", \"--coverage\"])\n        .assert()\n        .success();\n\n    assert!(temp.join(\"coverage/coverage.lcov\").is_file());\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/plugin_diagnostics.rs",
    "content": "use crate::e2e::common::runner::setup_package_at_path;\nuse camino::Utf8PathBuf;\nuse indoc::{formatdoc, indoc};\nuse scarb_api::ScarbCommand;\nuse shared::test_utils::output_assert::{assert_stdout_contains, case_assert_stdout_contains};\nuse snapbox::cmd::Command as SnapboxCommand;\nuse std::fs;\n\n#[test]\n#[cfg_attr(\n    feature = \"skip_test_for_only_latest_scarb\",\n    ignore = \"Plugin checks skipped\"\n)]\n#[allow(clippy::too_many_lines)]\nfn syntax() {\n    let temp = setup_package_at_path(Utf8PathBuf::from(\"diagnostics/syntax\"));\n    let output = SnapboxCommand::from_std(\n        ScarbCommand::new()\n            .current_dir(temp.path())\n            .args([\"build\", \"--test\"])\n            .command(),\n    )\n    .assert()\n    .failure();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r#\"\n        error[E1001]: Missing token ';'.\n         --> [..]/tests/contract.cairo:14:70\n            let (contract_address, _) = contract.deploy(constructor_calldata),unwrap();\n                                                                             ^\n        \n        error[E1000]: Skipped tokens. Expected: statement.\n         --> [..]/tests/contract.cairo:14:70\n            let (contract_address, _) = contract.deploy(constructor_calldata),unwrap();\n                                                                             ^\n        \n        error[E1001]: Missing token ';'.\n         --> [..]/tests/contract.cairo:14:70\n            let (contract_address, _) = contract.deploy(constructor_calldata),unwrap();\n                                                                             ^\n        note: this error originates in the attribute macro: `test`\n        \n        error[E1000]: Skipped tokens. Expected: statement.\n         --> [..]/tests/contract.cairo:14:70\n            let (contract_address, _) = contract.deploy(constructor_calldata),unwrap();\n                                                                             ^\n        note: this error originates in the attribute macro: `test`\n        \n        error[E1001]: Missing token ';'.\n         --> [..]/tests/contract.cairo:14:70\n            let (contract_address, _) = contract.deploy(constructor_calldata),unwrap();\n                                                                             ^\n        note: this error originates in the attribute macro: `test`\n        note: this error originates in the attribute macro: `fuzzer`\n        \n        error[E1000]: Skipped tokens. Expected: statement.\n         --> [..]/tests/contract.cairo:14:70\n            let (contract_address, _) = contract.deploy(constructor_calldata),unwrap();\n                                                                             ^\n        note: this error originates in the attribute macro: `test`\n        note: this error originates in the attribute macro: `fuzzer`\n        \n        error[E1001]: Missing token ';'.\n         --> [..]/tests/contract.cairo:14:70\n            let (contract_address, _) = contract.deploy(constructor_calldata),unwrap();\n                                                                             ^\n        note: this error originates in the attribute macro: `test`\n        note: this error originates in the attribute macro: `fuzzer`\n        note: this error originates in the attribute macro: `fork`\n        \n        error[E1000]: Skipped tokens. Expected: statement.\n         --> [..]/tests/contract.cairo:14:70\n            let (contract_address, _) = contract.deploy(constructor_calldata),unwrap();\n                                                                             ^\n        note: this error originates in the attribute macro: `test`\n        note: this error originates in the attribute macro: `fuzzer`\n        note: this error originates in the attribute macro: `fork`\n        \n        error[E2200]: Plugin diagnostic: Failed because of invalid syntax\n         --> [..]/tests/contract.cairo:7:1\n        #[test]\n        ^^^^^^^\n        \n        error[E2200]: Plugin diagnostic: Failed because of invalid syntax\n         --> [..]/tests/contract.cairo:8:1\n        #[fuzzer]\n        ^^^^^^^^^\n        note: this error originates in the attribute macro: `test`\n        \n        error[E2200]: Plugin diagnostic: Failed because of invalid syntax\n         --> [..]/tests/contract.cairo:9:1\n        #[fork(url: \"http://127.0.0.1:3030\", block_tag: latest)]\n        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        note: this error originates in the attribute macro: `test`\n        note: this error originates in the attribute macro: `fuzzer`\n        \n        error[E2200]: Plugin diagnostic: Failed because of invalid syntax\n         --> [..]/tests/contract.cairo:10:1\n        #[ignore]\n        ^^^^^^^^^\n        note: this error originates in the attribute macro: `test`\n        note: this error originates in the attribute macro: `fuzzer`\n        note: this error originates in the attribute macro: `fork`\n        \n        error[E2105]: Unexpected type for tuple pattern. \"core::result::Result::<(core::starknet::contract_address::ContractAddress, core::array::Span::<core::felt252>), core::array::Array::<core::felt252>>\" is not a tuple.\n         --> [..]/tests/contract.cairo:14:9\n            let (contract_address, _) = contract.deploy(constructor_calldata),unwrap();\n                ^^^^^^^^^^^^^^^^^^^^^\n        note: this error originates in the attribute macro: `test`\n        note: this error originates in the attribute macro: `fuzzer`\n        note: this error originates in the attribute macro: `fork`\n        \n        error[E0006]: Function not found.\n         --> [..]/tests/contract.cairo:14:71\n            let (contract_address, _) = contract.deploy(constructor_calldata),unwrap();\n                                                                              ^^^^^^\n        note: this error originates in the attribute macro: `test`\n        note: this error originates in the attribute macro: `fuzzer`\n        note: this error originates in the attribute macro: `fork`\n        \n        error: could not compile `syntax_integrationtest` due to 14 previous errors and 1 warning\n    \"#},\n    );\n}\n\n#[test]\n#[cfg_attr(\n    feature = \"skip_test_for_only_latest_scarb\",\n    ignore = \"Plugin checks skipped\"\n)]\nfn semantic() {\n    let temp = setup_package_at_path(Utf8PathBuf::from(\"diagnostics/semantic\"));\n    let output = SnapboxCommand::from_std(\n        ScarbCommand::new()\n            .current_dir(temp.path())\n            .args([\"build\", \"--test\"])\n            .command(),\n    )\n    .assert()\n    .failure();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        error[E0006]: Identifier not found.\n         --> [..]/tests/contract.cairo:21:13\n            let y = x;\n                    ^\n        note: this error originates in the attribute macro: `test`\n        note: this error originates in the attribute macro: `fuzzer`\n        note: this error originates in the attribute macro: `__fuzzer_config`\n        note: this error originates in the attribute macro: `__fuzzer_wrapper`\n        note: this error originates in the attribute macro: `fork`\n        note: this error originates in the attribute macro: `ignore`\n        note: this error originates in the attribute macro: `__internal_config_statement`\n        \n        warn[E0001]: Unused variable. Consider ignoring by prefixing with `_`.\n         --> [..]/tests/contract.cairo:21:9\n            let y = x;\n                ^\n        note: this error originates in the attribute macro: `test`\n        note: this error originates in the attribute macro: `fuzzer`\n        note: this error originates in the attribute macro: `__fuzzer_config`\n        note: this error originates in the attribute macro: `__fuzzer_wrapper`\n        note: this error originates in the attribute macro: `fork`\n        note: this error originates in the attribute macro: `ignore`\n        note: this error originates in the attribute macro: `__internal_config_statement`\n        \n        error: could not compile `semantic_integrationtest` due to 1 previous error and 2 warnings\n        \"},\n    );\n}\n\n#[test]\n#[cfg_attr(\n    feature = \"skip_test_for_only_latest_scarb\",\n    ignore = \"Plugin checks skipped\"\n)]\nfn parameters() {\n    let temp = setup_package_at_path(Utf8PathBuf::from(\"diagnostics/parameters\"));\n    let output = SnapboxCommand::from_std(\n        ScarbCommand::new()\n            .current_dir(temp.path())\n            .args([\"build\", \"--test\"])\n            .command(),\n    )\n    .assert()\n    .failure();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r#\"\n        error[E1001]: Missing token ','.\n         --> [..]/tests/contract.cairo:9:31\n        fn call_and_invoke(_a: felt252; b: u256) {\n                                      ^\n        \n        error[E1000]: Skipped tokens. Expected: parameter.\n         --> [..]/tests/contract.cairo:9:31\n        fn call_and_invoke(_a: felt252; b: u256) {\n                                      ^\n        \n        error[E1001]: Missing token ','.\n         --> [..]/tests/contract.cairo:9:31\n        fn call_and_invoke(_a: felt252; b: u256) {\n                                      ^\n        note: this error originates in the attribute macro: `test`\n        \n        error[E1000]: Skipped tokens. Expected: parameter.\n         --> [..]/tests/contract.cairo:9:31\n        fn call_and_invoke(_a: felt252; b: u256) {\n                                      ^^\n        note: this error originates in the attribute macro: `test`\n        \n        error[E2200]: Plugin diagnostic: Failed because of invalid syntax\n         --> [..]/tests/contract.cairo:7:1\n        #[test]\n        ^^^^^^^\n        \n        error[E2200]: Plugin diagnostic: Failed because of invalid syntax\n         --> [..]/tests/contract.cairo:8:1\n        #[fork(\"TESTNET\")]\n        ^^^^^^^^^^^^^^^^^^\n        note: this error originates in the attribute macro: `test`\n        \n        error: could not compile `parameters_integrationtest` due to 6 previous errors and 1 warning\n    \"#},\n    );\n}\n\n#[test]\n#[cfg_attr(\n    feature = \"skip_test_for_only_latest_scarb\",\n    ignore = \"Plugin checks skipped\"\n)]\nfn multiple() {\n    let temp = setup_package_at_path(Utf8PathBuf::from(\"diagnostics/multiple\"));\n    let output = SnapboxCommand::from_std(\n        ScarbCommand::new()\n            .current_dir(temp.path())\n            .args([\"build\", \"--test\"])\n            .command(),\n    )\n    .assert()\n    .failure();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r#\"\n        error[E1002]: Missing tokens. Expected an expression.\n         --> [..]/tests/contract.cairo:19:22\n            assert(balance === 0, 'balance == 0');\n                             ^\n        \n        error[E1002]: Missing tokens. Expected an expression.\n         --> [..]/tests/contract.cairo:19:22\n            assert(balance === 0, 'balance == 0');\n                             ^\n        note: this error originates in the attribute macro: `test`\n        \n        error[E1002]: Missing tokens. Expected an expression.\n         --> [..]/tests/contract.cairo:19:22\n            assert(balance === 0, 'balance == 0');\n                             ^\n        note: this error originates in the attribute macro: `test`\n        note: this error originates in the attribute macro: `fuzzer`\n        \n        error[E1002]: Missing tokens. Expected an expression.\n         --> [..]/tests/contract.cairo:19:22\n            assert(balance === 0, 'balance == 0');\n                             ^\n        note: this error originates in the attribute macro: `test`\n        note: this error originates in the attribute macro: `fuzzer`\n        note: this error originates in the attribute macro: `fork`\n        \n        error[E2200]: Plugin diagnostic: Failed because of invalid syntax\n         --> [..]/tests/contract.cairo:7:1\n        #[test]\n        ^^^^^^^\n        \n        error[E2200]: Plugin diagnostic: Failed because of invalid syntax\n         --> [..]/tests/contract.cairo:8:1\n        #[fuzzer]\n        ^^^^^^^^^\n        note: this error originates in the attribute macro: `test`\n        \n        error[E2200]: Plugin diagnostic: Failed because of invalid syntax\n         --> [..]/tests/contract.cairo:9:1\n        #[fork(url: \"http://127.0.0.1:3030\", block_tag: latest)]\n        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        note: this error originates in the attribute macro: `test`\n        note: this error originates in the attribute macro: `fuzzer`\n        \n        error[E2200]: Plugin diagnostic: Failed because of invalid syntax\n         --> [..]/tests/contract.cairo:10:1\n        #[ignore]\n        ^^^^^^^^^\n        note: this error originates in the attribute macro: `test`\n        note: this error originates in the attribute macro: `fuzzer`\n        note: this error originates in the attribute macro: `fork`\n        \n        error[E2000]: Unsupported feature.\n         --> [..]/tests/contract.cairo:19:22\n            assert(balance === 0, 'balance == 0');\n                             ^\n        note: this error originates in the attribute macro: `test`\n        note: this error originates in the attribute macro: `fuzzer`\n        note: this error originates in the attribute macro: `fork`\n        \n        error[E2084]: Invalid left-hand side of assignment.\n         --> [..]/tests/contract.cairo:19:12\n            assert(balance === 0, 'balance == 0');\n                   ^^^^^^^^^^\n        note: this error originates in the attribute macro: `test`\n        note: this error originates in the attribute macro: `fuzzer`\n        note: this error originates in the attribute macro: `fork`\n        \n        error[E0006]: Function not found.\n         --> [..]/tests/contract.cairo:57:30\n            let balance = dispatcher/get_balance();\n                                     ^^^^^^^^^^^\n        note: this error originates in the attribute macro: `test`\n        note: this error originates in the attribute macro: `fuzzer`\n        note: this error originates in the attribute macro: `__fuzzer_config`\n        note: this error originates in the attribute macro: `__fuzzer_wrapper`\n        note: this error originates in the attribute macro: `fork`\n        note: this error originates in the attribute macro: `ignore`\n        note: this error originates in the attribute macro: `__internal_config_statement`\n        \n        error: could not compile `multiple_integrationtest` due to 11 previous errors and 1 warning\n    \"#},\n    );\n}\n\n#[test]\n#[cfg_attr(\n    feature = \"skip_test_for_only_latest_scarb\",\n    ignore = \"Plugin checks skipped\"\n)]\nfn generic() {\n    let temp = setup_package_at_path(Utf8PathBuf::from(\"diagnostics/generic\"));\n    let output = SnapboxCommand::from_std(\n        ScarbCommand::new()\n            .current_dir(temp.path())\n            .args([\"build\", \"--test\"])\n            .command(),\n    )\n    .assert()\n    .failure();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        error[E2311]: Trait has no implementation in context: core::traits::PartialOrd::<generic_integrationtest::contract::MyStruct>.\n         --> [..]/tests/contract.cairo:29:13\n            let s = smallest_element(@list);\n                    ^^^^^^^^^^^^^^^^\n        note: this error originates in the attribute macro: `test`\n        note: this error originates in the attribute macro: `fuzzer`\n        note: this error originates in the attribute macro: `__fuzzer_config`\n        note: this error originates in the attribute macro: `__fuzzer_wrapper`\n        note: this error originates in the attribute macro: `fork`\n        note: this error originates in the attribute macro: `ignore`\n        note: this error originates in the attribute macro: `__internal_config_statement`\n        \n        error: could not compile `generic_integrationtest` due to 1 previous error and 1 warning\n    \"},\n    );\n}\n\n#[test]\n#[cfg_attr(\n    feature = \"skip_test_for_only_latest_scarb\",\n    ignore = \"Plugin checks skipped\"\n)]\nfn inline_macros() {\n    let temp = setup_package_at_path(Utf8PathBuf::from(\"diagnostics/inline_macros\"));\n    let output = SnapboxCommand::from_std(\n        ScarbCommand::new()\n            .current_dir(temp.path())\n            .args([\"build\", \"--test\"])\n            .command(),\n    )\n    .assert()\n    .failure();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        error[E2200]: Plugin diagnostic: Macro cannot be parsed as legacy macro. Expected an argument list wrapped in either parentheses, brackets, or braces.\n         --> [..]/tests/contract.cairo:23:5\n            print!('balance {}'; balance);\n            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        note: this error originates in the attribute macro: `test`\n        note: this error originates in the attribute macro: `fuzzer`\n        note: this error originates in the attribute macro: `__fuzzer_config`\n        note: this error originates in the attribute macro: `__fuzzer_wrapper`\n        note: this error originates in the attribute macro: `fork`\n        note: this error originates in the attribute macro: `ignore`\n        note: this error originates in the attribute macro: `__internal_config_statement`\n        \n        error: could not compile `inline_macros_integrationtest` due to 1 previous error and 1 warning\n    \"},\n    );\n}\n\n#[test]\n#[cfg_attr(\n    feature = \"skip_test_for_only_latest_scarb\",\n    ignore = \"Plugin checks skipped\"\n)]\nfn different_attributes() {\n    fn generate_attributes() -> impl Iterator<Item = String> {\n        let attributes = vec![\n            \"#[fuzzer]\".to_string(),\n            r#\"#[fork(url: \"http://127.0.0.1:3030\", block_tag: latest)]\"#.to_string(),\n            \"#[ignore]\".to_string(),\n            \"#[available_gas(l1_gas: 100, l2_gas: 200, l1_data_gas)]\".to_string(),\n            \"#[should_panic(expected: 'panic message')]\".to_string(),\n        ];\n        attributes.into_iter()\n    }\n\n    for attribute in generate_attributes() {\n        let temp = setup_package_at_path(Utf8PathBuf::from(\"diagnostics/attributes\"));\n        let test_file = temp.join(\"tests/contract.cairo\");\n\n        let test_file_contents = fs::read_to_string(&test_file).unwrap();\n        let test_file_contents = test_file_contents.replace(\"@attrs@\", &attribute);\n        fs::write(&test_file, test_file_contents).unwrap();\n\n        let output = SnapboxCommand::new(\"scarb\")\n            .current_dir(&temp)\n            .args([\"build\", \"--test\"])\n            .assert()\n            .failure();\n        let expected_underline = \"^\".repeat(attribute.len());\n\n        case_assert_stdout_contains(\n            attribute.clone(),\n            output,\n            formatdoc! {r\"\n            error[E1001]: Missing token ';'.\n             --> [..]/tests/contract.cairo:10:81\n                let (_contract_address1, _) = contract.deploy(constructor_calldata).unwrap()\n                                                                                            ^\n            \n            error[E2200]: Plugin diagnostic: Failed because of invalid syntax\n             --> [..]/tests/contract.cairo:6:1\n            {attribute}\n            {expected_underline}\n            \n            error: could not compile `attributes_integrationtest` due to 2 previous errors and 1 warning\n    \"},\n        );\n    }\n}\n\n#[test]\n#[cfg_attr(\n    feature = \"skip_test_for_only_latest_scarb\",\n    ignore = \"Plugin checks skipped\"\n)]\nfn test_case() {\n    let temp = setup_package_at_path(Utf8PathBuf::from(\"diagnostics/test_case_attr\"));\n    let output = SnapboxCommand::from_std(\n        ScarbCommand::new()\n            .current_dir(temp.path())\n            .args([\"build\", \"--test\"])\n            .command(),\n    )\n    .assert()\n    .failure();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        error[E2200]: Plugin diagnostic: #[test_case] The function must have at least one parameter to use #[test_case] attribute\n         --> [..]/tests/basic.cairo:2:1\n        #[test_case(3, 4, 7)]\n        ^^^^^^^^^^^^^^^^^^^^^\n        note: this error originates in the attribute macro: `test`\n\n        error[E2200]: Plugin diagnostic: #[test_case] Expected 2 arguments, but got 3\n        #[test_case(3, 4, 7)]\n        ^^^^^^^^^^^^^^^^^^^^^\n        note: this error originates in the attribute macro: `test`\n\n        error[E2200]: Plugin diagnostic: #[test_case] Only string literals are allowed for 'name' argument.\n        #[test_case(name: array![1, 2, 3], 3, 4, 7)]\n        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        note: this error originates in the attribute macro: `test`\n\n        error: could not compile `test_case_attr_integrationtest` due to 3 previous errors and 1 warning\n    \"},\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/plugin_versions.rs",
    "content": "use crate::e2e::common::runner::{runner, test_runner};\nuse crate::utils::tempdir_with_tool_versions;\nuse camino::Utf8PathBuf;\nuse indoc::{formatdoc, indoc};\nuse scarb_api::ScarbCommand;\nuse shared::test_utils::output_assert::assert_stdout_contains;\nuse snapbox::cmd::Command;\nuse toml_edit::Document;\n\n#[test]\n#[cfg_attr(\n    not(feature = \"test_for_multiple_scarb_versions\"),\n    ignore = \"Multiple scarb versions must be installed\"\n)]\nfn new_with_new_scarb() {\n    let temp = tempdir_with_tool_versions().unwrap();\n    runner(&temp)\n        .env(\"DEV_USE_OFFLINE_MODE\", \"true\")\n        .args([\"new\", \"abc\"])\n        .assert()\n        .success();\n\n    let manifest = temp.path().join(\"abc\").join(\"Scarb.toml\");\n    let manifest = &std::fs::read_to_string(manifest).unwrap();\n    let manifest = Document::parse(manifest).unwrap();\n\n    let snforge_std = manifest\n        .get(\"dev-dependencies\")\n        .unwrap()\n        .get(\"snforge_std\")\n        .unwrap();\n    let snforge_std = snforge_std.as_str().unwrap();\n    assert_eq!(snforge_std, env!(\"CARGO_PKG_VERSION\"));\n}\n\n#[test]\n#[cfg_attr(\n    not(feature = \"test_for_multiple_scarb_versions\"),\n    ignore = \"Multiple scarb versions must be installed\"\n)]\nfn new_with_minimal_scarb() {\n    let temp = tempdir_with_tool_versions().unwrap();\n    Command::new(\"asdf\")\n        .current_dir(&temp)\n        .args([\"set\", \"scarb\", \"2.12.0\"])\n        .assert()\n        .success();\n    runner(&temp)\n        .env(\"DEV_USE_OFFLINE_MODE\", \"true\")\n        .args([\"new\", \"abc\"])\n        .assert()\n        .success();\n\n    let manifest = temp.path().join(\"abc\").join(\"Scarb.toml\");\n    let manifest = &std::fs::read_to_string(manifest).unwrap();\n    let manifest = Document::parse(manifest).unwrap();\n\n    let snforge_std = manifest\n        .get(\"dev-dependencies\")\n        .unwrap()\n        .get(\"snforge_std\")\n        .unwrap();\n    let snforge_std = snforge_std.as_str().unwrap();\n    assert_eq!(snforge_std, env!(\"CARGO_PKG_VERSION\"));\n}\n\n#[test]\n#[cfg_attr(\n    not(feature = \"test_for_multiple_scarb_versions\"),\n    ignore = \"Multiple scarb versions must be installed\"\n)]\nfn new_scarb_new_macros() {\n    let temp = tempdir_with_tool_versions().unwrap();\n    runner(&temp)\n        .env(\"DEV_DISABLE_SNFORGE_STD_DEPENDENCY\", \"true\")\n        .args([\"new\", \"abc\"])\n        .assert()\n        .success();\n    let snforge_std = Utf8PathBuf::from(\"../../snforge_std\")\n        .canonicalize_utf8()\n        .unwrap();\n    ScarbCommand::new()\n        .current_dir(temp.path().join(\"abc\"))\n        .args([\"add\", \"snforge_std\", \"--path\", snforge_std.as_str()])\n        .command()\n        .output()\n        .unwrap();\n\n    let output = test_runner(temp.join(\"abc\")).assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n            [..]Compiling[..]\n            [..]Finished[..]\n\n            Collected 2 test(s) from abc package\n            Running 0 test(s) from src/\n            Running 2 test(s) from tests/\n            [PASS] abc_integrationtest::test_contract::test_cannot_increase_balance_with_zero_value (l1_gas: ~[..], l1_data_gas: ~[..], l2_gas: ~[..])\n            [PASS] abc_integrationtest::test_contract::test_increase_balance (l1_gas: ~[..], l1_data_gas: ~192, l2_gas: ~[..])\n            Tests: 2 passed, 0 failed, 0 ignored, 0 filtered out\n        \"},\n    );\n}\n\n#[test]\n#[cfg_attr(\n    not(feature = \"test_for_multiple_scarb_versions\"),\n    ignore = \"Multiple scarb versions must be installed\"\n)]\nfn new_scarb_old_macros() {\n    let temp = tempdir_with_tool_versions().unwrap();\n    runner(&temp)\n        .env(\"DEV_DISABLE_SNFORGE_STD_DEPENDENCY\", \"true\")\n        .args([\"new\", \"abc\"])\n        .assert()\n        .success();\n    ScarbCommand::new()\n        .current_dir(temp.path().join(\"abc\"))\n        .args([\"add\", \"snforge_std@0.44.0\"])\n        .command()\n        .output()\n        .unwrap();\n\n    let output = test_runner(temp.join(\"abc\")).assert().failure();\n\n    assert_stdout_contains(\n        output,\n        formatdoc! {r\"\n            [ERROR] Package snforge_std version does not meet the minimum required version >=0.50.0. Please upgrade snforge_std in Scarb.toml\n        \", },\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/profiles.rs",
    "content": "use super::common::runner::{setup_package, test_runner};\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stdout_contains;\n\n#[test]\nfn release() {\n    let temp = setup_package(\"empty\");\n\n    let output = test_runner(&temp).arg(\"--release\").assert().code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished `release` profile target(s) in [..]\n\n\n        Collected 0 test(s) from empty package\n        Tests: 0 passed, 0 failed, 0 ignored, 0 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn custom() {\n    let temp = setup_package(\"empty\");\n\n    let output = test_runner(&temp)\n        .args([\"--profile\", \"custom-profile\"])\n        .assert()\n        .code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished `custom-profile` profile target(s) in [..]\n\n\n        Collected 0 test(s) from empty package\n        Tests: 0 passed, 0 failed, 0 ignored, 0 filtered out\n        \"},\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/requirements.rs",
    "content": "use crate::e2e::common::runner::{runner, setup_package};\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stdout_contains;\n\n#[test]\nfn happy_path() {\n    let temp = setup_package(\"simple_package\");\n    let output = runner(&temp).arg(\"check-requirements\").assert();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n    Checking requirements\n\n    ✅ Scarb [..]\n    ✅ Universal Sierra Compiler [..]\n\n    \"},\n    );\n}\n\n#[test]\n#[cfg_attr(not(feature = \"scarb_2_12_0\"), ignore)]\nfn test_warning_on_scarb_version_below_recommended() {\n    let temp = setup_package(\"simple_package\");\n    let output = runner(&temp).arg(\"check-requirements\").assert();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n    Checking requirements\n\n    ⚠️  Scarb Version 2.12.0 doesn't satisfy minimal recommended [..]\n    ✅ Universal Sierra Compiler [..]\n    \"},\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/running.rs",
    "content": "use super::common::runner::{\n    get_current_branch, get_remote_url, setup_package, test_runner, test_runner_native,\n};\nuse crate::utils::get_snforge_std_entry;\nuse assert_fs::fixture::{FileWriteStr, PathChild};\nuse indoc::{formatdoc, indoc};\nuse shared::test_utils::output_assert::{AsOutput, assert_stdout, assert_stdout_contains};\nuse std::fs;\nuse toml_edit::{DocumentMut, value};\n\n#[test]\nfn simple_package() {\n    let temp = setup_package(\"simple_package\");\n    let output = test_runner(&temp).assert().code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n    [..]Compiling[..]\n    [..]Finished[..]\n\n\n    Collected 13 test(s) from simple_package package\n    Running 2 test(s) from src/\n    [PASS] simple_package::tests::test_fib [..]\n    [IGNORE] simple_package::tests::ignored_test\n    Running 11 test(s) from tests/\n    [PASS] simple_package_integrationtest::contract::call_and_invoke [..]\n    [PASS] simple_package_integrationtest::ext_function_test::test_my_test [..]\n    [IGNORE] simple_package_integrationtest::ext_function_test::ignored_test\n    [PASS] simple_package_integrationtest::ext_function_test::test_simple [..]\n    [PASS] simple_package_integrationtest::test_simple::test_simple [..]\n    [PASS] simple_package_integrationtest::test_simple::test_simple2 [..]\n    [PASS] simple_package_integrationtest::test_simple::test_two [..]\n    [PASS] simple_package_integrationtest::test_simple::test_two_and_two [..]\n    [FAIL] simple_package_integrationtest::test_simple::test_failing\n\n    Failure data:\n        0x6661696c696e6720636865636b ('failing check')\n\n    [FAIL] simple_package_integrationtest::test_simple::test_another_failing\n\n    Failure data:\n        0x6661696c696e6720636865636b ('failing check')\n\n    [PASS] simple_package_integrationtest::without_prefix::five [..]\n    Tests: 9 passed, 2 failed, 2 ignored, 0 filtered out\n\n    Failures:\n        simple_package_integrationtest::test_simple::test_failing\n        simple_package_integrationtest::test_simple::test_another_failing\n    \"},\n    );\n}\n\n#[cfg_attr(\n    not(feature = \"cairo-native\"),\n    ignore = \"Requires cairo-native feature\"\n)]\n#[test]\nfn simple_package_native() {\n    let temp = setup_package(\"simple_package\");\n    let output = test_runner_native(&temp).assert().code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n    [..]Compiling[..]\n    [..]Finished[..]\n\n\n    Collected 13 test(s) from simple_package package\n    Running 2 test(s) from src/\n    [PASS] simple_package::tests::test_fib [..]\n    [IGNORE] simple_package::tests::ignored_test\n    Running 11 test(s) from tests/\n    [PASS] simple_package_integrationtest::contract::call_and_invoke [..]\n    [PASS] simple_package_integrationtest::ext_function_test::test_my_test [..]\n    [IGNORE] simple_package_integrationtest::ext_function_test::ignored_test\n    [PASS] simple_package_integrationtest::ext_function_test::test_simple [..]\n    [PASS] simple_package_integrationtest::test_simple::test_simple [..]\n    [PASS] simple_package_integrationtest::test_simple::test_simple2 [..]\n    [PASS] simple_package_integrationtest::test_simple::test_two [..]\n    [PASS] simple_package_integrationtest::test_simple::test_two_and_two [..]\n    [FAIL] simple_package_integrationtest::test_simple::test_failing\n\n    Failure data:\n        0x6661696c696e6720636865636b ('failing check')\n\n    [FAIL] simple_package_integrationtest::test_simple::test_another_failing\n\n    Failure data:\n        0x6661696c696e6720636865636b ('failing check')\n\n    [PASS] simple_package_integrationtest::without_prefix::five [..]\n    Tests: 9 passed, 2 failed, 2 ignored, 0 filtered out\n\n    Failures:\n        simple_package_integrationtest::test_simple::test_failing\n        simple_package_integrationtest::test_simple::test_another_failing\n    \"},\n    );\n}\n\n#[test]\nfn simple_package_with_cheats() {\n    let temp = setup_package(\"simple_package_with_cheats\");\n    let output = test_runner(&temp).assert().code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n    [..]Compiling[..]\n    [..]Finished[..]\n\n\n    Collected 5 test(s) from simple_package_with_cheats package\n    Running 0 test(s) from src/\n    Running 5 test(s) from tests/\n    [PASS] simple_package_with_cheats_integrationtest::contract::call_and_invoke [..]\n    [PASS] simple_package_with_cheats_integrationtest::contract::call_and_invoke_proxy [..]\n    [PASS] simple_package_with_cheats_integrationtest::contract::call_and_invoke_library_call [..]\n    [PASS] simple_package_with_cheats_integrationtest::contract::deploy_syscall [..]\n    [PASS] simple_package_with_cheats_integrationtest::contract::block_hash [..]\n    Tests: 5 passed, 0 failed, 0 ignored, 0 filtered out\n    \"},\n    );\n}\n\n#[test]\nfn simple_package_with_git_dependency() {\n    let temp = setup_package(\"simple_package\");\n\n    let remote_url = get_remote_url().to_lowercase();\n    let branch = get_current_branch();\n    let manifest_path = temp.child(\"Scarb.toml\");\n\n    let snforge_std = format!(\n        r#\"snforge_std = {{ git = \"https://github.com/{remote_url}\", branch = \"{branch}\" }}\"#\n    );\n\n    manifest_path\n        .write_str(&formatdoc!(\n            r#\"\n            [package]\n            name = \"simple_package\"\n            version = \"0.1.0\"\n\n            [[target.starknet-contract]]\n\n            [dependencies]\n            starknet = \"2.6.4\"\n            {snforge_std}\n            \"#,\n        ))\n        .unwrap();\n\n    let output = test_runner(&temp).assert().code(1);\n\n    assert_stdout_contains(\n        output,\n        formatdoc!(\n            r\"\n        [..]Updating git repository https://github.com/{}\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 13 test(s) from simple_package package\n        Running 2 test(s) from src/\n        [PASS] simple_package::tests::test_fib [..]\n        [IGNORE] simple_package::tests::ignored_test\n        Running 11 test(s) from tests/\n        [PASS] simple_package_integrationtest::contract::call_and_invoke [..]\n        [PASS] simple_package_integrationtest::ext_function_test::test_my_test [..]\n        [IGNORE] simple_package_integrationtest::ext_function_test::ignored_test\n        [PASS] simple_package_integrationtest::ext_function_test::test_simple [..]\n        [PASS] simple_package_integrationtest::test_simple::test_simple [..]\n        [PASS] simple_package_integrationtest::test_simple::test_simple2 [..]\n        [PASS] simple_package_integrationtest::test_simple::test_two [..]\n        [PASS] simple_package_integrationtest::test_simple::test_two_and_two [..]\n        [FAIL] simple_package_integrationtest::test_simple::test_failing\n\n        Failure data:\n            0x6661696c696e6720636865636b ('failing check')\n\n        [FAIL] simple_package_integrationtest::test_simple::test_another_failing\n\n        Failure data:\n            0x6661696c696e6720636865636b ('failing check')\n\n        [PASS] simple_package_integrationtest::without_prefix::five [..]\n        Tests: 9 passed, 2 failed, 2 ignored, 0 filtered out\n\n        Failures:\n            simple_package_integrationtest::test_simple::test_failing\n            simple_package_integrationtest::test_simple::test_another_failing\n        \",\n            remote_url.trim_end_matches(\".git\")\n        ),\n    );\n}\n\n#[test]\nfn with_failing_scarb_build() {\n    let temp = setup_package(\"simple_package\");\n    temp.child(\"src/lib.cairo\")\n        .write_str(indoc!(\n            r\"\n                mod hello_starknet;\n                mods erc20;\n            \"\n        ))\n        .unwrap();\n\n    let output = test_runner(&temp).arg(\"--no-optimization\").assert().code(2);\n\n    assert_stdout_contains(\n        output,\n        indoc!(\n            r\"\n                [ERROR] Failed to build contracts with Scarb: `scarb` exited with error\n            \"\n        ),\n    );\n}\n\n#[test]\nfn with_filter() {\n    let temp = setup_package(\"simple_package\");\n\n    let output = test_runner(&temp).arg(\"two\").assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 2 test(s) from simple_package package\n        Running 2 test(s) from tests/\n        [PASS] simple_package_integrationtest::test_simple::test_two [..]\n        [PASS] simple_package_integrationtest::test_simple::test_two_and_two [..]\n        Tests: 2 passed, 0 failed, 0 ignored, 11 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn with_filter_matching_module() {\n    let temp = setup_package(\"simple_package\");\n\n    let output = test_runner(&temp)\n        .arg(\"ext_function_test::\")\n        .assert()\n        .success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 3 test(s) from simple_package package\n        Running 3 test(s) from tests/\n        [PASS] simple_package_integrationtest::ext_function_test::test_my_test [..]\n        [IGNORE] simple_package_integrationtest::ext_function_test::ignored_test\n        [PASS] simple_package_integrationtest::ext_function_test::test_simple [..]\n        Tests: 2 passed, 0 failed, 1 ignored, 10 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn with_exact_filter() {\n    let temp = setup_package(\"simple_package\");\n\n    let output = test_runner(&temp)\n        .arg(\"simple_package_integrationtest::test_simple::test_two\")\n        .arg(\"--exact\")\n        .assert()\n        .success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 1 test(s) from simple_package package\n        Running 0 test(s) from src/\n        Running 1 test(s) from tests/\n        [PASS] simple_package_integrationtest::test_simple::test_two [..]\n        Tests: 1 passed, 0 failed, 0 ignored, other filtered out\n        \"},\n    );\n}\n\n#[test]\nfn with_skip_filter_matching_module() {\n    let temp = setup_package(\"simple_package\");\n\n    let output = test_runner(&temp)\n        .arg(\"--skip\")\n        .arg(\"simple_package\")\n        .assert()\n        .success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 0 test(s) from simple_package package\n        Running 0 test(s) from src/\n        Running 0 test(s) from tests/\n        Tests: 0 passed, 0 failed, 0 ignored, 13 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn with_skip_filter_matching_full_module_path() {\n    let temp = setup_package(\"simple_package\");\n\n    let output = test_runner(&temp)\n        .arg(\"--skip\")\n        .arg(\"simple_package_integrationtest::test_simple::test_two_and_two\")\n        .assert()\n        .failure();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n        \n        Collected 12 test(s) from simple_package package\n        Running 10 test(s) from tests/\n        [IGNORE] simple_package_integrationtest::ext_function_test::ignored_test\n        [PASS] simple_package_integrationtest::ext_function_test::test_simple [..]\n        [PASS] simple_package_integrationtest::without_prefix::five [..]\n        [PASS] simple_package_integrationtest::test_simple::test_simple2 [..]\n        [PASS] simple_package_integrationtest::test_simple::test_two [..]\n        [FAIL] simple_package_integrationtest::test_simple::test_another_failing\n        \n        Failure data:\n            0x6661696c696e6720636865636b ('failing check')\n        \n        [PASS] simple_package_integrationtest::ext_function_test::test_my_test [..]\n        [FAIL] simple_package_integrationtest::test_simple::test_failing\n        \n        Failure data:\n            0x6661696c696e6720636865636b ('failing check')\n        \n        [PASS] simple_package_integrationtest::test_simple::test_simple [..]\n        [PASS] simple_package_integrationtest::contract::call_and_invoke [..]\n        Running 2 test(s) from src/\n        [IGNORE] simple_package::tests::ignored_test\n        [PASS] simple_package::tests::test_fib [..]\n        Tests: 8 passed, 2 failed, 2 ignored, 1 filtered out\n        \n        Failures:\n            simple_package_integrationtest::test_simple::test_another_failing\n            simple_package_integrationtest::test_simple::test_failing\n        \"},\n    );\n}\n\n#[test]\nfn with_skip_filter_matching_test_name() {\n    let temp = setup_package(\"simple_package\");\n\n    let output = test_runner(&temp)\n        .arg(\"--skip\")\n        .arg(\"failing\")\n        .assert()\n        .success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 11 test(s) from simple_package package\n        Running 9 test(s) from tests/\n        [IGNORE] simple_package_integrationtest::ext_function_test::ignored_test\n        [PASS] simple_package_integrationtest::test_simple::test_two [..]\n        [PASS] simple_package_integrationtest::test_simple::test_two_and_two [..]\n        [PASS] simple_package_integrationtest::test_simple::test_simple2 [..]\n        [PASS] simple_package_integrationtest::ext_function_test::test_simple [..]\n        [PASS] simple_package_integrationtest::without_prefix::five [..]\n        [PASS] simple_package_integrationtest::ext_function_test::test_my_test [..]\n        [PASS] simple_package_integrationtest::test_simple::test_simple [..]\n        [PASS] simple_package_integrationtest::contract::call_and_invoke [..]\n        Running 2 test(s) from src/\n        [IGNORE] simple_package::tests::ignored_test\n        [PASS] simple_package::tests::test_fib [..]\n        Tests: 9 passed, 0 failed, 2 ignored, 2 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn with_skip_filter_matching_multiple_test_name() {\n    let temp = setup_package(\"simple_package\");\n\n    let output = test_runner(&temp)\n        .arg(\"--skip\")\n        .arg(\"failing\")\n        .arg(\"--skip\")\n        .arg(\"two\")\n        .assert()\n        .success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 9 test(s) from simple_package package\n        Running 7 test(s) from tests/\n        [IGNORE] simple_package_integrationtest::ext_function_test::ignored_test\n        [PASS] simple_package_integrationtest::test_simple::test_simple2 [..]\n        [PASS] simple_package_integrationtest::ext_function_test::test_simple [..]\n        [PASS] simple_package_integrationtest::without_prefix::five [..]\n        [PASS] simple_package_integrationtest::ext_function_test::test_my_test [..]\n        [PASS] simple_package_integrationtest::test_simple::test_simple [..]\n        [PASS] simple_package_integrationtest::contract::call_and_invoke [..]\n        Running 2 test(s) from src/\n        [IGNORE] simple_package::tests::ignored_test\n        [PASS] simple_package::tests::test_fib [..]\n        Tests: 7 passed, 0 failed, 2 ignored, 4 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn with_exact_filter_and_duplicated_test_names() {\n    let temp = setup_package(\"duplicated_test_names\");\n\n    let output = test_runner(&temp)\n        .arg(\"duplicated_test_names_integrationtest::tests_a::test_simple\")\n        .arg(\"--exact\")\n        .assert()\n        .success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 1 test(s) from duplicated_test_names package\n        Running 0 test(s) from src/\n        Running 1 test(s) from tests/\n        [PASS] duplicated_test_names_integrationtest::tests_a::test_simple [..]\n        Tests: 1 passed, 0 failed, 0 ignored, other filtered out\n        \"},\n    );\n}\n\n#[test]\nfn with_non_matching_filter() {\n    let temp = setup_package(\"simple_package\");\n\n    let output = test_runner(&temp).arg(\"qwerty\").assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 0 test(s) from simple_package package\n        Running 0 test(s) from src/\n        Running 0 test(s) from tests/\n        Tests: 0 passed, 0 failed, 0 ignored, 13 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn with_ignored_flag() {\n    let temp = setup_package(\"simple_package\");\n\n    let output = test_runner(&temp).arg(\"--ignored\").assert().code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 2 test(s) from simple_package package\n        Running 1 test(s) from src/\n        [PASS] simple_package::tests::ignored_test [..]\n        Running 1 test(s) from tests/\n        [FAIL] simple_package_integrationtest::ext_function_test::ignored_test\n\n        Failure data:\n            0x6e6f742070617373696e67 ('not passing')\n\n        Tests: 1 passed, 1 failed, 0 ignored, 11 filtered out\n\n        Failures:\n            simple_package_integrationtest::ext_function_test::ignored_test\n        \"},\n    );\n}\n\n#[test]\nfn with_include_ignored_flag() {\n    let temp = setup_package(\"simple_package\");\n\n    let output = test_runner(&temp).arg(\"--include-ignored\").assert().code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 13 test(s) from simple_package package\n        Running 2 test(s) from src/\n        [PASS] simple_package::tests::test_fib [..]\n        [PASS] simple_package::tests::ignored_test [..]\n        Running 11 test(s) from tests/\n        [PASS] simple_package_integrationtest::contract::call_and_invoke [..]\n        [PASS] simple_package_integrationtest::ext_function_test::test_my_test [..]\n        [FAIL] simple_package_integrationtest::ext_function_test::ignored_test\n\n        Failure data:\n            0x6e6f742070617373696e67 ('not passing')\n\n        [PASS] simple_package_integrationtest::ext_function_test::test_simple [..]\n        [PASS] simple_package_integrationtest::test_simple::test_simple [..]\n        [PASS] simple_package_integrationtest::test_simple::test_simple2 [..]\n        [PASS] simple_package_integrationtest::test_simple::test_two [..]\n        [PASS] simple_package_integrationtest::test_simple::test_two_and_two [..]\n        [FAIL] simple_package_integrationtest::test_simple::test_failing\n\n        Failure data:\n            0x6661696c696e6720636865636b ('failing check')\n\n        [FAIL] simple_package_integrationtest::test_simple::test_another_failing\n\n        Failure data:\n            0x6661696c696e6720636865636b ('failing check')\n\n        [PASS] simple_package_integrationtest::without_prefix::five [..]\n        Tests: 10 passed, 3 failed, 0 ignored, 0 filtered out\n\n        Failures:\n            simple_package_integrationtest::ext_function_test::ignored_test\n            simple_package_integrationtest::test_simple::test_failing\n            simple_package_integrationtest::test_simple::test_another_failing\n        \"},\n    );\n}\n\n#[test]\nfn with_ignored_flag_and_filter() {\n    let temp = setup_package(\"simple_package\");\n\n    let output = test_runner(&temp)\n        .arg(\"--ignored\")\n        .arg(\"ext_function_test::ignored_test\")\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 1 test(s) from simple_package package\n        Running 0 test(s) from src/\n        Running 1 test(s) from tests/\n        [FAIL] simple_package_integrationtest::ext_function_test::ignored_test\n\n        Failure data:\n            0x6e6f742070617373696e67 ('not passing')\n\n        Tests: 0 passed, 1 failed, 0 ignored, 12 filtered out\n\n        Failures:\n            simple_package_integrationtest::ext_function_test::ignored_test\n        \"},\n    );\n}\n\n#[test]\nfn with_include_ignored_flag_and_filter() {\n    let temp = setup_package(\"simple_package\");\n\n    let output = test_runner(&temp)\n        .arg(\"--include-ignored\")\n        .arg(\"ignored_test\")\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 2 test(s) from simple_package package\n        Running 1 test(s) from src/\n        [PASS] simple_package::tests::ignored_test [..]\n        Running 1 test(s) from tests/\n        [FAIL] simple_package_integrationtest::ext_function_test::ignored_test\n\n        Failure data:\n            0x6e6f742070617373696e67 ('not passing')\n\n        Tests: 1 passed, 1 failed, 0 ignored, 11 filtered out\n\n        Failures:\n            simple_package_integrationtest::ext_function_test::ignored_test\n        \"},\n    );\n}\n\n#[test]\nfn with_rerun_failed_flag_without_cache() {\n    let temp = setup_package(\"simple_package\");\n\n    let output = test_runner(&temp).arg(\"--rerun-failed\").assert().code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 13 test(s) from simple_package package\n        Running 2 test(s) from src/\n        [PASS] simple_package::tests::test_fib [..]\n        Running 11 test(s) from tests/\n        [PASS] simple_package_integrationtest::contract::call_and_invoke [..]\n        [PASS] simple_package_integrationtest::ext_function_test::test_my_test [..]\n\n        [PASS] simple_package_integrationtest::ext_function_test::test_simple [..]\n        [PASS] simple_package_integrationtest::test_simple::test_simple [..]\n        [PASS] simple_package_integrationtest::test_simple::test_simple2 [..]\n        [PASS] simple_package_integrationtest::test_simple::test_two [..]\n        [PASS] simple_package_integrationtest::test_simple::test_two_and_two [..]\n        [FAIL] simple_package_integrationtest::test_simple::test_failing\n\n        Failure data:\n            0x6661696c696e6720636865636b ('failing check')\n\n        [FAIL] simple_package_integrationtest::test_simple::test_another_failing\n\n        [PASS] simple_package_integrationtest::without_prefix::five [..]\n        Failures:\n            simple_package_integrationtest::test_simple::test_failing\n            simple_package_integrationtest::test_simple::test_another_failing\n        [IGNORE] simple_package::tests::ignored_test\n        [IGNORE] simple_package_integrationtest::ext_function_test::ignored_test\n        Tests: 9 passed, 2 failed, 2 ignored, 0 filtered out\n        Failure data:\n            0x6661696c696e6720636865636b ('failing check')\n\n        \"},\n    );\n}\n\n#[test]\nfn with_rerun_failed_flag_and_name_filter() {\n    let temp = setup_package(\"simple_package\");\n\n    test_runner(&temp).assert().code(1);\n\n    let output = test_runner(&temp)\n        .arg(\"--rerun-failed\")\n        .arg(\"test_another_failing\")\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n        Collected 1 test(s) from simple_package package\n        Running 1 test(s) from tests/\n        [FAIL] simple_package_integrationtest::test_simple::test_another_failing\n\n        Failure data:\n            0x6661696c696e6720636865636b ('failing check')\n\n        Tests: 0 passed, 1 failed, 0 ignored, 12 filtered out\n\n        Failures:\n            simple_package_integrationtest::test_simple::test_another_failing\n\n        \"},\n    );\n}\n\n#[test]\nfn with_rerun_failed_flag() {\n    let temp = setup_package(\"simple_package\");\n\n    test_runner(&temp).assert().code(1);\n\n    let output = test_runner(&temp).arg(\"--rerun-failed\").assert().code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n        Collected 2 test(s) from simple_package package\n        Running 0 test(s) from src/\n        Running 2 test(s) from tests/\n        [FAIL] simple_package_integrationtest::test_simple::test_another_failing\n\n        Failure data:\n            0x6661696c696e6720636865636b ('failing check')\n\n        [FAIL] simple_package_integrationtest::test_simple::test_failing\n\n        Failure data:\n            0x6661696c696e6720636865636b ('failing check')\n\n        Tests: 0 passed, 2 failed, 0 ignored, 11 filtered out\n\n        Failures:\n            simple_package_integrationtest::test_simple::test_another_failing\n            simple_package_integrationtest::test_simple::test_failing\n\n        \"},\n    );\n}\n\n#[test]\nfn with_panic_data_decoding() {\n    let temp = setup_package(\"panic_decoding\");\n\n    let output = test_runner(&temp).assert().code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r#\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 8 test(s) from panic_decoding package\n        Running 8 test(s) from tests/\n        [FAIL] panic_decoding_integrationtest::test_panic_decoding::test_panic_decoding2\n\n        Failure data:\n            0x80\n\n        [FAIL] panic_decoding_integrationtest::test_panic_decoding::test_assert\n\n        Failure data:\n            \"assertion failed: `x`.\"\n\n        [FAIL] panic_decoding_integrationtest::test_panic_decoding::test_panic_decoding\n\n        Failure data:\n            (0x7b ('{'), 0x616161 ('aaa'), 0x800000000000011000000000000000000000000000000000000000000000000, 0x98, 0x7c ('|'), 0x95)\n\n        [PASS] panic_decoding_integrationtest::test_panic_decoding::test_simple2 (l1_gas: [..], l1_data_gas: [..], l2_gas: [..])\n        [PASS] panic_decoding_integrationtest::test_panic_decoding::test_simple (l1_gas: [..], l1_data_gas: [..], l2_gas: [..])\n        [FAIL] panic_decoding_integrationtest::test_panic_decoding::test_assert_eq\n\n        Failure data:\n            \"assertion `x == y` failed.\n            x: 5\n            y: 6\"\n\n        [FAIL] panic_decoding_integrationtest::test_panic_decoding::test_assert_message\n\n        Failure data:\n            \"Another identifiable and meaningful error message\"\n\n        [FAIL] panic_decoding_integrationtest::test_panic_decoding::test_assert_eq_message\n\n        Failure data:\n            \"assertion `x == y` failed: An identifiable and meaningful error message\n            x: 5\n            y: 6\"\n\n        Tests: 2 passed, 6 failed, 0 ignored, 0 filtered out\n\n        Failures:\n            panic_decoding_integrationtest::test_panic_decoding::test_panic_decoding2\n            panic_decoding_integrationtest::test_panic_decoding::test_assert\n            panic_decoding_integrationtest::test_panic_decoding::test_panic_decoding\n            panic_decoding_integrationtest::test_panic_decoding::test_assert_eq\n            panic_decoding_integrationtest::test_panic_decoding::test_assert_message\n            panic_decoding_integrationtest::test_panic_decoding::test_assert_eq_message\n        \"#},\n    );\n}\n\n#[test]\nfn with_exit_first() {\n    let temp = setup_package(\"exit_first\");\n    let scarb_path = temp.child(\"Scarb.toml\");\n\n    scarb_path\n        .write_str(&formatdoc!(\n            r#\"\n            [package]\n            name = \"exit_first\"\n            version = \"0.1.0\"\n\n            [dependencies]\n            starknet = \"2.4.0\"\n            {}\n\n            [tool.snforge]\n            exit_first = true\n            \"#,\n            get_snforge_std_entry().unwrap()\n        ))\n        .unwrap();\n\n    let output = test_runner(&temp).assert().code(1);\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 2 test(s) from exit_first package\n        Running 2 test(s) from tests/\n        [FAIL] exit_first_integrationtest::ext_function_test::simple_test\n\n        Failure data:\n            0x73696d706c6520636865636b ('simple check')\n\n        Tests: 0 passed, 1 failed, 0 ignored, 0 filtered out\n        Interrupted execution of 1 test(s).\n\n        Failures:\n            exit_first_integrationtest::ext_function_test::simple_test\n        \"},\n    );\n}\n\n#[test]\nfn with_exit_first_flag() {\n    let temp = setup_package(\"exit_first\");\n\n    let output = test_runner(&temp).arg(\"--exit-first\").assert().code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 2 test(s) from exit_first package\n        Running 2 test(s) from tests/\n        [FAIL] exit_first_integrationtest::ext_function_test::simple_test\n        Failure data:\n            0x73696d706c6520636865636b ('simple check')\n\n        Tests: 0 passed, 1 failed, 0 ignored, 0 filtered out\n        Interrupted execution of 1 test(s).\n\n        Failures:\n            exit_first_integrationtest::ext_function_test::simple_test\n        \"},\n    );\n}\n\n#[test]\nfn should_panic() {\n    let temp = setup_package(\"should_panic_test\");\n\n    let output = test_runner(&temp).assert().code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! { r\"\n        Collected 14 test(s) from should_panic_test package\n        Running 0 test(s) from src/\n        Running 14 test(s) from tests/\n        [FAIL] should_panic_test_integrationtest::should_panic_test::didnt_expect_panic\n\n        Failure data:\n            0x756e65787065637465642070616e6963 ('unexpected panic')\n\n        [FAIL] should_panic_test_integrationtest::should_panic_test::should_panic_expected_contains_error\n\n        Failure data:\n            Incorrect panic data\n            Actual:    [0x46a6158a16a947e5916b2a2ca68501a45e93d7110e81aa2d6438b1c57c879a3, 0x0, 0x77696c6c, 0x4] (will)\n            Expected:  [0x46a6158a16a947e5916b2a2ca68501a45e93d7110e81aa2d6438b1c57c879a3, 0x0, 0x546869732077696c6c2070616e6963, 0xf] (This will panic)\n\n        [FAIL] should_panic_test_integrationtest::should_panic_test::should_panic_byte_array_with_felt\n\n        Failure data:\n            Incorrect panic data\n            Actual:    [0x46a6158a16a947e5916b2a2ca68501a45e93d7110e81aa2d6438b1c57c879a3, 0x0, 0x546869732077696c6c2070616e6963, 0xf] (This will panic)\n            Expected:  [0x546869732077696c6c2070616e6963] (This will panic)\n\n        [FAIL] should_panic_test_integrationtest::should_panic_test::expected_panic_but_didnt_with_expected_multiple\n\n        Failure data:\n            Expected to panic, but no panic occurred\n            Expected panic data:  [0x70616e6963206d657373616765, 0x7365636f6e64206d657373616765] (panic message, second message)\n\n        [FAIL] should_panic_test_integrationtest::should_panic_test::expected_panic_but_didnt\n\n        Failure data:\n            Expected to panic, but no panic occurred\n\n        [PASS] should_panic_test_integrationtest::should_panic_test::should_panic_no_data (l1_gas: [..], l1_data_gas: [..], l2_gas: [..])\n\n        [PASS] should_panic_test_integrationtest::should_panic_test::should_panic_check_data (l1_gas: [..], l1_data_gas: [..], l2_gas: [..])\n        [FAIL] should_panic_test_integrationtest::should_panic_test::should_panic_not_matching_suffix\n\n        Failure data:\n            Incorrect panic data\n            Actual:    [0x46a6158a16a947e5916b2a2ca68501a45e93d7110e81aa2d6438b1c57c879a3, 0x0, 0x546869732077696c6c2070616e6963, 0xf] (This will panic)\n            Expected:  [0x46a6158a16a947e5916b2a2ca68501a45e93d7110e81aa2d6438b1c57c879a3, 0x0, 0x77696c6c2070616e696363, 0xb] (will panicc)\n\n        [PASS] should_panic_test_integrationtest::should_panic_test::should_panic_match_suffix (l1_gas: [..], l1_data_gas: [..], l2_gas: [..])\n        [PASS] should_panic_test_integrationtest::should_panic_test::should_panic_felt_matching (l1_gas: [..], l1_data_gas: [..], l2_gas: [..])\n        [FAIL] should_panic_test_integrationtest::should_panic_test::should_panic_felt_with_byte_array\n\n        Failure data:\n            Incorrect panic data\n            Actual:    [0x546869732077696c6c2070616e6963] (This will panic)\n            Expected:  [0x46a6158a16a947e5916b2a2ca68501a45e93d7110e81aa2d6438b1c57c879a3, 0x0, 0x546869732077696c6c2070616e6963, 0xf] (This will panic)\n\n        [PASS] should_panic_test_integrationtest::should_panic_test::should_panic_multiple_messages (l1_gas: [..], l1_data_gas: [..], l2_gas: [..])\n        [FAIL] should_panic_test_integrationtest::should_panic_test::expected_panic_but_didnt_with_expected\n\n        Failure data:\n            Expected to panic, but no panic occurred\n            Expected panic data:  [0x70616e6963206d657373616765] (panic message)\n\n        [FAIL] should_panic_test_integrationtest::should_panic_test::should_panic_with_non_matching_data\n\n        Failure data:\n            Incorrect panic data\n            Actual:    [0x6661696c696e6720636865636b] (failing check)\n            Expected:  [0x0] ()\n\n        Tests: 5 passed, 9 failed, 0 ignored, 0 filtered out\n\n        Failures:\n            should_panic_test_integrationtest::should_panic_test::didnt_expect_panic\n            should_panic_test_integrationtest::should_panic_test::should_panic_expected_contains_error\n            should_panic_test_integrationtest::should_panic_test::should_panic_byte_array_with_felt\n            should_panic_test_integrationtest::should_panic_test::expected_panic_but_didnt_with_expected_multiple\n            should_panic_test_integrationtest::should_panic_test::expected_panic_but_didnt\n            should_panic_test_integrationtest::should_panic_test::should_panic_not_matching_suffix\n            should_panic_test_integrationtest::should_panic_test::should_panic_felt_with_byte_array\n            should_panic_test_integrationtest::should_panic_test::expected_panic_but_didnt_with_expected\n            should_panic_test_integrationtest::should_panic_test::should_panic_with_non_matching_data\n        \"},\n    );\n}\n\n#[ignore = \"TODO Restore this test once there are at least 2 versions supporting v2 macros\"]\n#[test]\n// #[cfg_attr(feature = \"skip_test_for_only_latest_scarb\", ignore = \"Plugin checks skipped\")]\nfn incompatible_snforge_std_version_warning() {\n    let temp = setup_package(\"steps\");\n    let manifest_path = temp.child(\"Scarb.toml\");\n\n    let mut scarb_toml = fs::read_to_string(&manifest_path)\n        .unwrap()\n        .parse::<DocumentMut>()\n        .unwrap();\n    scarb_toml[\"dev-dependencies\"][\"snforge_std\"] = value(\"0.45.0\");\n    manifest_path.write_str(&scarb_toml.to_string()).unwrap();\n\n    let output = test_runner(&temp).assert().failure();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [WARNING] Package snforge_std version does not meet the recommended version requirement ^0.[..], [..]\n        [..]Compiling[..]\n        [..]Finished[..]\n\n        Collected 2 test(s) from steps package\n        Running 2 test(s) from src/\n        [PASS] steps::tests::steps_less_than_10000000 [..]\n        [FAIL] steps::tests::steps_more_than_10000000\n\n        Failure data:\n            Could not reach the end of the program. RunResources has no remaining steps.\n            Suggestion: Consider using the flag `--max-n-steps` to increase allowed limit of steps\n\n        Tests: 1 passed, 1 failed, 0 ignored, 0 filtered out\n\n        Failures:\n            steps::tests::steps_more_than_10000000\n        \"},\n    );\n}\n\n#[test]\nfn incompatible_snforge_std_version_error() {\n    let temp = setup_package(\"steps\");\n    let manifest_path = temp.child(\"Scarb.toml\");\n\n    let mut scarb_toml = fs::read_to_string(&manifest_path)\n        .unwrap()\n        .parse::<DocumentMut>()\n        .unwrap();\n    scarb_toml[\"dev-dependencies\"][\"snforge_std\"] = value(\"0.42.0\");\n    scarb_toml[\"dev-dependencies\"][\"snforge_scarb_plugin\"] = value(\"0.42.0\");\n    manifest_path.write_str(&scarb_toml.to_string()).unwrap();\n\n    let output = test_runner(&temp).assert().failure();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [ERROR] Package snforge_std version does not meet the minimum required version >=0.50.0. Please upgrade snforge_std in Scarb.toml\n        \"},\n    );\n}\n\n#[test]\n#[cfg_attr(\n    feature = \"cairo-native\",\n    ignore = \"Native runner does not support vm resources tracking\"\n)]\nfn detailed_resources_flag_cairo_steps() {\n    let temp = setup_package(\"erc20_package\");\n    let output = test_runner(&temp)\n        .arg(\"--detailed-resources\")\n        .arg(\"--tracked-resource\")\n        .arg(\"cairo-steps\")\n        .assert()\n        .success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 1 test(s) from erc20_package package\n        Running 0 test(s) from src/\n        Running 1 test(s) from tests/\n        [PASS] erc20_package_integrationtest::test_complex::complex[..]\n                steps: [..]\n                memory holes: [..]\n                builtins: ([..])\n                syscalls: ([..])\n                events: (count: [..], keys: [..], data size: [..])\n                messages: ([..])\n        Tests: 1 passed, 0 failed, 0 ignored, 0 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn detailed_resources_flag() {\n    let temp = setup_package(\"erc20_package\");\n    let output = test_runner(&temp)\n        .arg(\"--detailed-resources\")\n        .assert()\n        .success();\n\n    // Extra check to ensure that the output does not contain VM resources\n    assert!(!output.as_stdout().contains(\"steps:\"));\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n        Collected 1 test(s) from erc20_package package\n        Running 0 test(s) from src/\n        Running 1 test(s) from tests/\n        [PASS] erc20_package_integrationtest::test_complex::complex[..]\n                sierra gas: [..]\n                syscalls: ([..])\n                events: (count: [..], keys: [..], data size: [..])\n                messages: ([..])\n        Tests: 1 passed, 0 failed, 0 ignored, 0 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn detailed_resources_mixed_resources() {\n    let temp = setup_package(\"forking\");\n    let output = test_runner(&temp)\n        .arg(\"test_track_resources\")\n        .arg(\"--detailed-resources\")\n        .arg(\"--tracked-resource\")\n        .arg(\"sierra-gas\")\n        .assert()\n        .success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n        Collected 1 test(s) from forking package\n        Running 1 test(s) from src/\n        [PASS] forking::tests::test_track_resources [..]\n                sierra gas: [..]\n                syscalls: ([..])\n                events: ([..])\n                messages: ([..])\n                steps: [..]\n                memory holes: [..]\n                builtins: (Builtin(range_check): [..])\n\n        Tests: 1 passed, 0 failed, 0 ignored, [..] filtered out\n        \"},\n    );\n}\n\n#[test]\nfn catch_runtime_errors() {\n    let temp = setup_package(\"runtime_errors_package\");\n    let output = test_runner(&temp).assert();\n\n    assert_stdout_contains(\n        output,\n        formatdoc!(\n            r\"\n                [..]Compiling[..]\n                [..]Finished[..]\n                [PASS] runtime_errors_package_integrationtest::with_error::catch_no_such_file [..]\n            \"\n        ),\n    );\n}\n\n#[test]\nfn call_nonexistent_selector() {\n    let temp = setup_package(\"nonexistent_selector\");\n\n    let output = test_runner(&temp).assert().code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        Collected 1 test(s) from nonexistent_selector package\n        Running 0 test(s) from src/\n        Running 1 test(s) from tests/\n        [PASS] nonexistent_selector_integrationtest::test_contract::test_unwrapped_call_contract_syscall [..]\n        Tests: 1 passed, 0 failed, 0 ignored, 0 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn exact_printing_pass() {\n    let temp = setup_package(\"deterministic_output\");\n\n    let output = test_runner(&temp).arg(\"pass\").assert().code(0);\n\n    assert_stdout(\n        output,\n        indoc! {r\"\n        Collected 2 test(s) from deterministic_output package\n        Running 2 test(s) from src/\n        [PASS] deterministic_output::test::first_test_pass_y [..]\n        [PASS] deterministic_output::test::second_test_pass_x [..]\n        Tests: 2 passed, 0 failed, 0 ignored, 2 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn exact_printing_fail() {\n    let temp = setup_package(\"deterministic_output\");\n\n    let output = test_runner(&temp).arg(\"fail\").assert().code(1);\n\n    assert_stdout(\n        output,\n        indoc! {r\"\n        Collected 2 test(s) from deterministic_output package\n        Running 2 test(s) from src/\n        [FAIL] deterministic_output::test::first_test_fail_x\n\n        Failure data:\n            0x73696d706c6520636865636b ('simple check')\n\n        [FAIL] deterministic_output::test::second_test_fail_y\n\n        Failure data:\n            0x73696d706c6520636865636b ('simple check')\n\n        Tests: 0 passed, 2 failed, 0 ignored, 2 filtered out\n\n        Failures:\n            deterministic_output::test::first_test_fail_x\n            deterministic_output::test::second_test_fail_y\n        \"},\n    );\n}\n\n#[test]\nfn exact_printing_mixed() {\n    let temp = setup_package(\"deterministic_output\");\n\n    let output = test_runner(&temp).arg(\"x\").assert().code(1);\n\n    assert_stdout(\n        output,\n        indoc! {r\"\n        Collected 2 test(s) from deterministic_output package\n        Running 2 test(s) from src/\n        [FAIL] deterministic_output::test::first_test_fail_x\n\n        Failure data:\n            0x73696d706c6520636865636b ('simple check')\n\n        [PASS] deterministic_output::test::second_test_pass_x [..]\n        Tests: 1 passed, 1 failed, 0 ignored, 2 filtered out\n\n        Failures:\n            deterministic_output::test::first_test_fail_x\n        \"},\n    );\n}\n\n#[test]\n#[cfg_attr(\n    feature = \"cairo-native\",\n    ignore = \"Native runner does not support panic backtrace yet\"\n)]\nfn dispatchers() {\n    let temp = setup_package(\"dispatchers\");\n\n    let output = test_runner(&temp).assert().code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        Collected 4 test(s) from dispatchers package\n        Running 0 test(s) from src/\n        Running 4 test(s) from tests/\n        [FAIL] dispatchers_integrationtest::test::test_unrecoverable_not_possible_to_handle\n        Failure data:\n        Got an exception while executing a hint: Requested contract address [..] is not deployed.\n\n        [PASS] dispatchers_integrationtest::test::test_error_handled_in_contract [..]\n        [PASS] dispatchers_integrationtest::test::test_handle_and_panic [..]\n        [PASS] dispatchers_integrationtest::test::test_handle_recoverable_in_test [..]\n        Tests: 3 passed, 1 failed, 0 ignored, 0 filtered out\n\n        Failures:\n            dispatchers_integrationtest::test::test_unrecoverable_not_possible_to_handle\n        \"},\n    );\n}\n\n#[test]\nfn test_interact_with_state() {\n    let temp = setup_package(\"contract_state\");\n    let output = test_runner(&temp).assert().code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n    [..]Compiling[..]\n    [..]Finished[..]\n\n    Collected 8 test(s) from contract_state package\n    Running 0 test(s) from src/\n    Running 8 test(s) from tests/\n    [PASS] contract_state_integrationtest::test_storage_node::test_storage_node [..]\n    [PASS] contract_state_integrationtest::test_state::test_interact_with_state_return [..]\n    [PASS] contract_state_integrationtest::test_state::test_interact_with_state_internal_function [..]\n    [PASS] contract_state_integrationtest::test_state::test_interact_with_initialized_state [..]\n    [PASS] contract_state_integrationtest::test_state::test_interact_with_state [..]\n    [PASS] contract_state_integrationtest::test_state::test_interact_with_state_map [..]\n    [PASS] contract_state_integrationtest::test_state::test_interact_with_state_vec [..]\n    [PASS] contract_state_integrationtest::test_fork::test_fork_contract [..]\n    Tests: 8 passed, 0 failed, 0 ignored, 0 filtered out\n    \"},\n    );\n}\n\n#[test]\nfn max_threads_exceeds_available_prints_warning() {\n    let temp = setup_package(\"simple_package\");\n    let output = test_runner(&temp).args([\"--max-threads\", \"256\"]).assert();\n\n    assert_stdout_contains(\n        output,\n        \"[WARNING] `--max-threads` value (256) is greater than the number of available cores ([..])\",\n    );\n}\n\n#[test]\nfn max_threads_within_available_no_warning() {\n    let temp = setup_package(\"simple_package\");\n    let output = test_runner(&temp)\n        .args([\"--max-threads\", \"1\"])\n        .assert()\n        .code(1);\n\n    assert!(!output.as_stdout().contains(\"[WARNING]\"));\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/backtrace/main__e2e__backtrace__snap_test_backtrace@2.15.2.snap",
    "content": "---\nsource: crates/forge/tests/e2e/backtrace.rs\nexpression: stdout\n---\n[FAIL] backtrace_vm_error::Test::test_fork_unwrapped_call_contract_syscall\n\nFailure data:\n    Got an exception while executing a hint: Hint Error: Error at pc=0:86:\nGot an exception while executing a hint: Error at pc=0:86:\nGot an exception while executing a hint: Requested contract address 0x0000000000000000000000000000000000000000000000000000000000000123 is not deployed.\n\n\n\nerror occurred in forked contract with class hash: 0x1a92e0ec431585e5c19b98679e582ebc07d43681ba1cc9c55dcb5ba0ce721a1\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: (inlined) backtrace_vm_error::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   1: (inlined) backtrace_vm_error::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   2: backtrace_vm_error::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n[FAIL] backtrace_vm_error::Test::test_unwrapped_call_contract_syscall\n\nFailure data:\n    Got an exception while executing a hint: Hint Error: Error at pc=0:86:\nGot an exception while executing a hint: Error at pc=0:57:\nGot an exception while executing a hint: Requested contract address 0x0000000000000000000000000000000000000000000000000000000000000123 is not deployed.\n\n\n\nerror occurred in contract 'InnerContract'\nstack backtrace:\n   0: (inlined) backtrace_vm_error::InnerContract::inner_call\n       at [..]lib.cairo:48:9\n   1: (inlined) backtrace_vm_error::InnerContract::InnerContract::inner\n       at [..]lib.cairo:38:13\n   2: backtrace_vm_error::InnerContract::__wrapper__InnerContract__inner\n       at [..]lib.cairo:35:5\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: (inlined) backtrace_vm_error::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   1: (inlined) backtrace_vm_error::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   2: backtrace_vm_error::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n\nFailures:\n    backtrace_vm_error::Test::test_fork_unwrapped_call_contract_syscall\n    backtrace_vm_error::Test::test_unwrapped_call_contract_syscall\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/backtrace/main__e2e__backtrace__snap_test_backtrace@2.16.0.snap",
    "content": "---\nsource: crates/forge/tests/e2e/backtrace.rs\nexpression: stdout\n---\n[FAIL] backtrace_vm_error::Test::test_fork_unwrapped_call_contract_syscall\n\nFailure data:\n    Got an exception while executing a hint: Hint Error: Error at pc=0:86:\nGot an exception while executing a hint: Error at pc=0:86:\nGot an exception while executing a hint: Requested contract address 0x0000000000000000000000000000000000000000000000000000000000000123 is not deployed.\n\n\n\nerror occurred in forked contract with class hash: 0x1a92e0ec431585e5c19b98679e582ebc07d43681ba1cc9c55dcb5ba0ce721a1\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: (inlined) backtrace_vm_error::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   1: (inlined) backtrace_vm_error::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   2: backtrace_vm_error::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n[FAIL] backtrace_vm_error::Test::test_unwrapped_call_contract_syscall\n\nFailure data:\n    Got an exception while executing a hint: Hint Error: Error at pc=0:86:\nGot an exception while executing a hint: Error at pc=0:57:\nGot an exception while executing a hint: Requested contract address 0x0000000000000000000000000000000000000000000000000000000000000123 is not deployed.\n\n\n\nerror occurred in contract 'InnerContract'\nstack backtrace:\n   0: (inlined) backtrace_vm_error::InnerContract::inner_call\n       at [..]lib.cairo:48:9\n   1: (inlined) backtrace_vm_error::InnerContract::InnerContract::inner\n       at [..]lib.cairo:38:13\n   2: backtrace_vm_error::InnerContract::__wrapper__InnerContract__inner\n       at [..]lib.cairo:35:5\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: (inlined) backtrace_vm_error::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   1: (inlined) backtrace_vm_error::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   2: backtrace_vm_error::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n\nFailures:\n    backtrace_vm_error::Test::test_fork_unwrapped_call_contract_syscall\n    backtrace_vm_error::Test::test_unwrapped_call_contract_syscall\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/backtrace/main__e2e__backtrace__snap_test_backtrace@2.16.1.snap",
    "content": "---\nsource: crates/forge/tests/e2e/backtrace.rs\nexpression: stdout\n---\n\n\n[FAIL] backtrace_vm_error::Test::test_fork_unwrapped_call_contract_syscall\n\nFailure data:\n    Got an exception while executing a hint: Hint Error: Error at pc=0:86:\nGot an exception while executing a hint: Error at pc=0:86:\nGot an exception while executing a hint: Requested contract address 0x0000000000000000000000000000000000000000000000000000000000000123 is not deployed.\n\n\n\nerror occurred in forked contract with class hash: 0x1a92e0ec431585e5c19b98679e582ebc07d43681ba1cc9c55dcb5ba0ce721a1\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: (inlined) backtrace_vm_error::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   1: (inlined) backtrace_vm_error::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   2: backtrace_vm_error::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n[FAIL] backtrace_vm_error::Test::test_unwrapped_call_contract_syscall\n\nFailure data:\n    Got an exception while executing a hint: Hint Error: Error at pc=0:86:\nGot an exception while executing a hint: Error at pc=0:57:\nGot an exception while executing a hint: Requested contract address 0x0000000000000000000000000000000000000000000000000000000000000123 is not deployed.\n\n\n\nerror occurred in contract 'InnerContract'\nstack backtrace:\n   0: (inlined) backtrace_vm_error::InnerContract::inner_call\n       at [..]lib.cairo:48:9\n   1: (inlined) backtrace_vm_error::InnerContract::InnerContract::inner\n       at [..]lib.cairo:38:13\n   2: backtrace_vm_error::InnerContract::__wrapper__InnerContract__inner\n       at [..]lib.cairo:35:5\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: (inlined) backtrace_vm_error::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   1: (inlined) backtrace_vm_error::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   2: backtrace_vm_error::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n\nFailures:\n    backtrace_vm_error::Test::test_fork_unwrapped_call_contract_syscall\n    backtrace_vm_error::Test::test_unwrapped_call_contract_syscall\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/backtrace/main__e2e__backtrace__snap_test_backtrace@2.17.0.snap",
    "content": "---\nsource: crates/forge/tests/e2e/backtrace.rs\nexpression: stdout\n---\n\n\n[FAIL] backtrace_vm_error::Test::test_fork_unwrapped_call_contract_syscall\n\nFailure data:\n    Got an exception while executing a hint: Hint Error: Error at pc=0:86:\nGot an exception while executing a hint: Error at pc=0:86:\nGot an exception while executing a hint: Requested contract address 0x0000000000000000000000000000000000000000000000000000000000000123 is not deployed.\n\n\n\nerror occurred in forked contract with class hash: 0x1a92e0ec431585e5c19b98679e582ebc07d43681ba1cc9c55dcb5ba0ce721a1\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: (inlined) backtrace_vm_error::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   1: (inlined) backtrace_vm_error::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   2: backtrace_vm_error::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n[FAIL] backtrace_vm_error::Test::test_unwrapped_call_contract_syscall\n\nFailure data:\n    Got an exception while executing a hint: Hint Error: Error at pc=0:86:\nGot an exception while executing a hint: Error at pc=0:57:\nGot an exception while executing a hint: Requested contract address 0x0000000000000000000000000000000000000000000000000000000000000123 is not deployed.\n\n\n\nerror occurred in contract 'InnerContract'\nstack backtrace:\n   0: (inlined) backtrace_vm_error::InnerContract::inner_call\n       at [..]lib.cairo:48:9\n   1: (inlined) backtrace_vm_error::InnerContract::InnerContract::inner\n       at [..]lib.cairo:38:13\n   2: backtrace_vm_error::InnerContract::__wrapper__InnerContract__inner\n       at [..]lib.cairo:35:5\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: (inlined) backtrace_vm_error::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   1: (inlined) backtrace_vm_error::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   2: backtrace_vm_error::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n\nFailures:\n    backtrace_vm_error::Test::test_fork_unwrapped_call_contract_syscall\n    backtrace_vm_error::Test::test_unwrapped_call_contract_syscall\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/backtrace/main__e2e__backtrace__snap_test_backtrace_panic@2.15.2.snap",
    "content": "---\nsource: crates/forge/tests/e2e/backtrace.rs\nexpression: stdout\n---\n[FAIL] backtrace_panic::Test::test_contract_panics\n\nFailure data:\n    (0x417373657274206661696c6564 ('Assert failed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\nerror occurred in contract 'InnerContract'\nstack backtrace:\n   0: core::panic_with_const_felt252\n       at [..]lib.cairo:364:5\n   1: core::panic_with_const_felt252\n       at [..]lib.cairo:364:5\n   2: backtrace_panic::InnerContract::__wrapper__InnerContract__inner\n       at [..]lib.cairo:32:5\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: backtrace_panic::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n[IGNORE] backtrace_panic::Test::test_contract_panics_with_should_panic\n[FAIL] backtrace_panic::Test::test_fork_contract_panics\n\nFailure data:\n    (0x417373657274206661696c6564 ('Assert failed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\nerror occurred in forked contract with class hash: 0x554cb276fb5eb0788344f5431b9a166e2f445d8a91c7aef79d8c77e7eede956\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: backtrace_panic::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n\nFailures:\n    backtrace_panic::Test::test_contract_panics\n    backtrace_panic::Test::test_fork_contract_panics\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/backtrace/main__e2e__backtrace__snap_test_backtrace_panic@2.16.0.snap",
    "content": "---\nsource: crates/forge/tests/e2e/backtrace.rs\nexpression: stdout\n---\n[FAIL] backtrace_panic::Test::test_contract_panics\n\nFailure data:\n    (0x417373657274206661696c6564 ('Assert failed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\nerror occurred in contract 'InnerContract'\nstack backtrace:\n   0: core::panic_with_const_felt252\n       at [..]lib.cairo:360:5\n   1: core::panic_with_const_felt252\n       at [..]lib.cairo:360:5\n   2: backtrace_panic::InnerContract::__wrapper__InnerContract__inner\n       at [..]lib.cairo:32:5\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: backtrace_panic::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n[IGNORE] backtrace_panic::Test::test_contract_panics_with_should_panic\n[FAIL] backtrace_panic::Test::test_fork_contract_panics\n\nFailure data:\n    (0x417373657274206661696c6564 ('Assert failed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\nerror occurred in forked contract with class hash: 0x554cb276fb5eb0788344f5431b9a166e2f445d8a91c7aef79d8c77e7eede956\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: backtrace_panic::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n\nFailures:\n    backtrace_panic::Test::test_contract_panics\n    backtrace_panic::Test::test_fork_contract_panics\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/backtrace/main__e2e__backtrace__snap_test_backtrace_panic@2.16.1.snap",
    "content": "---\nsource: crates/forge/tests/e2e/backtrace.rs\nexpression: stdout\n---\n\n\n[FAIL] backtrace_panic::Test::test_contract_panics\n\nFailure data:\n    (0x417373657274206661696c6564 ('Assert failed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\nerror occurred in contract 'InnerContract'\nstack backtrace:\n   0: core::panic_with_const_felt252\n       at [..]lib.cairo:360:5\n   1: core::panic_with_const_felt252\n       at [..]lib.cairo:360:5\n   2: backtrace_panic::InnerContract::__wrapper__InnerContract__inner\n       at [..]lib.cairo:32:5\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: backtrace_panic::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n[IGNORE] backtrace_panic::Test::test_contract_panics_with_should_panic\n[FAIL] backtrace_panic::Test::test_fork_contract_panics\n\nFailure data:\n    (0x417373657274206661696c6564 ('Assert failed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\nerror occurred in forked contract with class hash: 0x554cb276fb5eb0788344f5431b9a166e2f445d8a91c7aef79d8c77e7eede956\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: backtrace_panic::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n\nFailures:\n    backtrace_panic::Test::test_contract_panics\n    backtrace_panic::Test::test_fork_contract_panics\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/backtrace/main__e2e__backtrace__snap_test_backtrace_panic@2.17.0.snap",
    "content": "---\nsource: crates/forge/tests/e2e/backtrace.rs\nexpression: stdout\n---\n\n\n[FAIL] backtrace_panic::Test::test_contract_panics\n\nFailure data:\n    (0x417373657274206661696c6564 ('Assert failed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\nerror occurred in contract 'InnerContract'\nstack backtrace:\n   0: core::panic_with_const_felt252\n       at [..]lib.cairo:360:5\n   1: core::panic_with_const_felt252\n       at [..]lib.cairo:360:5\n   2: backtrace_panic::InnerContract::__wrapper__InnerContract__inner\n       at [..]lib.cairo:32:5\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: backtrace_panic::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n[IGNORE] backtrace_panic::Test::test_contract_panics_with_should_panic\n[FAIL] backtrace_panic::Test::test_fork_contract_panics\n\nFailure data:\n    (0x417373657274206661696c6564 ('Assert failed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\nerror occurred in forked contract with class hash: 0x554cb276fb5eb0788344f5431b9a166e2f445d8a91c7aef79d8c77e7eede956\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: backtrace_panic::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n\nFailures:\n    backtrace_panic::Test::test_contract_panics\n    backtrace_panic::Test::test_fork_contract_panics\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/backtrace/main__e2e__backtrace__snap_test_backtrace_panic_without_inlines@2.15.2.snap",
    "content": "---\nsource: crates/forge/tests/e2e/backtrace.rs\nexpression: stdout\n---\n[FAIL] backtrace_panic::Test::test_contract_panics\n\nFailure data:\n    (0x417373657274206661696c6564 ('Assert failed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\nerror occurred in contract 'InnerContract'\nstack backtrace:\n   0: core::array_inline_macro\n       at [..]lib.cairo:350:11\n   1: core::assert\n       at [..]lib.cairo:377:9\n   2: backtrace_panic::InnerContract::inner_call\n       at [..]lib.cairo:40:9\n   3: backtrace_panic::InnerContract::unsafe_new_contract_state\n       at [..]lib.cairo:29:5\n   4: backtrace_panic::InnerContract::__wrapper__InnerContract__inner\n       at [..]lib.cairo:32:5\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: core::starknet::SyscallResultTraitImpl::unwrap_syscall\n       at [..]starknet.cairo:135:52\n   1: backtrace_panic::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   2: backtrace_panic::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   3: backtrace_panic::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n[IGNORE] backtrace_panic::Test::test_contract_panics_with_should_panic\n[FAIL] backtrace_panic::Test::test_fork_contract_panics\n\nFailure data:\n    (0x417373657274206661696c6564 ('Assert failed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\nerror occurred in forked contract with class hash: 0x554cb276fb5eb0788344f5431b9a166e2f445d8a91c7aef79d8c77e7eede956\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: core::starknet::SyscallResultTraitImpl::unwrap_syscall\n       at [..]starknet.cairo:135:52\n   1: backtrace_panic::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   2: backtrace_panic::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   3: backtrace_panic::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n\nFailures:\n    backtrace_panic::Test::test_contract_panics\n    backtrace_panic::Test::test_fork_contract_panics\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/backtrace/main__e2e__backtrace__snap_test_backtrace_panic_without_inlines@2.16.0.snap",
    "content": "---\nsource: crates/forge/tests/e2e/backtrace.rs\nexpression: stdout\n---\n[FAIL] backtrace_panic::Test::test_contract_panics\n\nFailure data:\n    (0x417373657274206661696c6564 ('Assert failed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\nerror occurred in contract 'InnerContract'\nstack backtrace:\n   0: core::array_inline_macro\n       at [..]lib.cairo:346:11\n   1: core::assert\n       at [..]lib.cairo:373:9\n   2: backtrace_panic::InnerContract::inner_call\n       at [..]lib.cairo:40:9\n   3: backtrace_panic::InnerContract::unsafe_new_contract_state\n       at [..]lib.cairo:29:5\n   4: backtrace_panic::InnerContract::__wrapper__InnerContract__inner\n       at [..]lib.cairo:32:5\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: core::starknet::SyscallResultTraitImpl::unwrap_syscall\n       at [..]starknet.cairo:135:52\n   1: backtrace_panic::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   2: backtrace_panic::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   3: backtrace_panic::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n[IGNORE] backtrace_panic::Test::test_contract_panics_with_should_panic\n[FAIL] backtrace_panic::Test::test_fork_contract_panics\n\nFailure data:\n    (0x417373657274206661696c6564 ('Assert failed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\nerror occurred in forked contract with class hash: 0x554cb276fb5eb0788344f5431b9a166e2f445d8a91c7aef79d8c77e7eede956\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: core::starknet::SyscallResultTraitImpl::unwrap_syscall\n       at [..]starknet.cairo:135:52\n   1: backtrace_panic::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   2: backtrace_panic::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   3: backtrace_panic::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n\nFailures:\n    backtrace_panic::Test::test_contract_panics\n    backtrace_panic::Test::test_fork_contract_panics\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/backtrace/main__e2e__backtrace__snap_test_backtrace_panic_without_inlines@2.16.1.snap",
    "content": "---\nsource: crates/forge/tests/e2e/backtrace.rs\nexpression: stdout\n---\n\n\n[FAIL] backtrace_panic::Test::test_contract_panics\n\nFailure data:\n    (0x417373657274206661696c6564 ('Assert failed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\nerror occurred in contract 'InnerContract'\nstack backtrace:\n   0: core::array_inline_macro\n       at [..]lib.cairo:346:11\n   1: core::assert\n       at [..]lib.cairo:373:9\n   2: backtrace_panic::InnerContract::inner_call\n       at [..]lib.cairo:40:9\n   3: backtrace_panic::InnerContract::unsafe_new_contract_state\n       at [..]lib.cairo:29:5\n   4: backtrace_panic::InnerContract::__wrapper__InnerContract__inner\n       at [..]lib.cairo:32:5\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: core::starknet::SyscallResultTraitImpl::unwrap_syscall\n       at [..]starknet.cairo:135:52\n   1: backtrace_panic::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   2: backtrace_panic::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   3: backtrace_panic::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n[IGNORE] backtrace_panic::Test::test_contract_panics_with_should_panic\n[FAIL] backtrace_panic::Test::test_fork_contract_panics\n\nFailure data:\n    (0x417373657274206661696c6564 ('Assert failed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\nerror occurred in forked contract with class hash: 0x554cb276fb5eb0788344f5431b9a166e2f445d8a91c7aef79d8c77e7eede956\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: core::starknet::SyscallResultTraitImpl::unwrap_syscall\n       at [..]starknet.cairo:135:52\n   1: backtrace_panic::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   2: backtrace_panic::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   3: backtrace_panic::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n\nFailures:\n    backtrace_panic::Test::test_contract_panics\n    backtrace_panic::Test::test_fork_contract_panics\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/backtrace/main__e2e__backtrace__snap_test_backtrace_panic_without_inlines@2.17.0.snap",
    "content": "---\nsource: crates/forge/tests/e2e/backtrace.rs\nexpression: stdout\n---\n\n\n[FAIL] backtrace_panic::Test::test_contract_panics\n\nFailure data:\n    (0x417373657274206661696c6564 ('Assert failed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\nerror occurred in contract 'InnerContract'\nstack backtrace:\n   0: core::array_inline_macro\n       at [..]lib.cairo:346:11\n   1: core::assert\n       at [..]lib.cairo:373:9\n   2: backtrace_panic::InnerContract::inner_call\n       at [..]lib.cairo:40:9\n   3: backtrace_panic::InnerContract::unsafe_new_contract_state\n       at [..]lib.cairo:29:5\n   4: backtrace_panic::InnerContract::__wrapper__InnerContract__inner\n       at [..]lib.cairo:32:5\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: core::starknet::SyscallResultTraitImpl::unwrap_syscall\n       at [..]starknet.cairo:135:52\n   1: backtrace_panic::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   2: backtrace_panic::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   3: backtrace_panic::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n[IGNORE] backtrace_panic::Test::test_contract_panics_with_should_panic\n[FAIL] backtrace_panic::Test::test_fork_contract_panics\n\nFailure data:\n    (0x417373657274206661696c6564 ('Assert failed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\nerror occurred in forked contract with class hash: 0x554cb276fb5eb0788344f5431b9a166e2f445d8a91c7aef79d8c77e7eede956\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: core::starknet::SyscallResultTraitImpl::unwrap_syscall\n       at [..]starknet.cairo:135:52\n   1: backtrace_panic::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   2: backtrace_panic::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   3: backtrace_panic::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n\nFailures:\n    backtrace_panic::Test::test_contract_panics\n    backtrace_panic::Test::test_fork_contract_panics\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/backtrace/main__e2e__backtrace__snap_test_backtrace_panic_without_optimizations@2.15.2.snap",
    "content": "---\nsource: crates/forge/tests/e2e/backtrace.rs\nexpression: stdout\n---\n[FAIL] backtrace_panic::Test::test_contract_panics\n\nFailure data:\n    (0x417373657274206661696c6564 ('Assert failed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\nerror occurred in contract 'InnerContract'\nstack backtrace:\n   0: core::array_inline_macro\n       at [..]lib.cairo:350:11\n   1: core::assert\n       at [..]lib.cairo:377:9\n   2: backtrace_panic::InnerContract::inner_call\n       at [..]lib.cairo:40:9\n   3: backtrace_panic::InnerContract::unsafe_new_contract_state\n       at [..]lib.cairo:29:5\n   4: backtrace_panic::InnerContract::__wrapper__InnerContract__inner\n       at [..]lib.cairo:32:5\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: core::starknet::SyscallResultTraitImpl::unwrap_syscall\n       at [..]starknet.cairo:135:52\n   1: backtrace_panic::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   2: backtrace_panic::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   3: backtrace_panic::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n[IGNORE] backtrace_panic::Test::test_contract_panics_with_should_panic\n[FAIL] backtrace_panic::Test::test_fork_contract_panics\n\nFailure data:\n    (0x417373657274206661696c6564 ('Assert failed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\nerror occurred in forked contract with class hash: 0x554cb276fb5eb0788344f5431b9a166e2f445d8a91c7aef79d8c77e7eede956\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: core::starknet::SyscallResultTraitImpl::unwrap_syscall\n       at [..]starknet.cairo:135:52\n   1: backtrace_panic::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   2: backtrace_panic::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   3: backtrace_panic::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n\nFailures:\n    backtrace_panic::Test::test_contract_panics\n    backtrace_panic::Test::test_fork_contract_panics\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/backtrace/main__e2e__backtrace__snap_test_backtrace_panic_without_optimizations@2.16.0.snap",
    "content": "---\nsource: crates/forge/tests/e2e/backtrace.rs\nexpression: stdout\n---\n\n\n[FAIL] backtrace_panic::Test::test_contract_panics\n\nFailure data:\n    (0x417373657274206661696c6564 ('Assert failed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\nerror occurred in contract 'InnerContract'\nstack backtrace:\n   0: core::array_inline_macro\n       at [..]lib.cairo:346:11\n   1: core::assert\n       at [..]lib.cairo:373:9\n   2: backtrace_panic::InnerContract::inner_call\n       at [..]lib.cairo:40:9\n   3: backtrace_panic::InnerContract::unsafe_new_contract_state\n       at [..]lib.cairo:29:5\n   4: backtrace_panic::InnerContract::__wrapper__InnerContract__inner\n       at [..]lib.cairo:32:5\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: core::starknet::SyscallResultTraitImpl::unwrap_syscall\n       at [..]starknet.cairo:135:52\n   1: backtrace_panic::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   2: backtrace_panic::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   3: backtrace_panic::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n[IGNORE] backtrace_panic::Test::test_contract_panics_with_should_panic\n[FAIL] backtrace_panic::Test::test_fork_contract_panics\n\nFailure data:\n    (0x417373657274206661696c6564 ('Assert failed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\nerror occurred in forked contract with class hash: 0x554cb276fb5eb0788344f5431b9a166e2f445d8a91c7aef79d8c77e7eede956\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: core::starknet::SyscallResultTraitImpl::unwrap_syscall\n       at [..]starknet.cairo:135:52\n   1: backtrace_panic::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   2: backtrace_panic::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   3: backtrace_panic::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n\nFailures:\n    backtrace_panic::Test::test_contract_panics\n    backtrace_panic::Test::test_fork_contract_panics\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/backtrace/main__e2e__backtrace__snap_test_backtrace_panic_without_optimizations@2.16.1.snap",
    "content": "---\nsource: crates/forge/tests/e2e/backtrace.rs\nexpression: stdout\n---\n\n\n[FAIL] backtrace_panic::Test::test_contract_panics\n\nFailure data:\n    (0x417373657274206661696c6564 ('Assert failed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\nerror occurred in contract 'InnerContract'\nstack backtrace:\n   0: core::array_inline_macro\n       at [..]lib.cairo:346:11\n   1: core::assert\n       at [..]lib.cairo:373:9\n   2: backtrace_panic::InnerContract::inner_call\n       at [..]lib.cairo:40:9\n   3: backtrace_panic::InnerContract::unsafe_new_contract_state\n       at [..]lib.cairo:29:5\n   4: backtrace_panic::InnerContract::__wrapper__InnerContract__inner\n       at [..]lib.cairo:32:5\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: core::starknet::SyscallResultTraitImpl::unwrap_syscall\n       at [..]starknet.cairo:135:52\n   1: backtrace_panic::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   2: backtrace_panic::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   3: backtrace_panic::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n[IGNORE] backtrace_panic::Test::test_contract_panics_with_should_panic\n[FAIL] backtrace_panic::Test::test_fork_contract_panics\n\nFailure data:\n    (0x417373657274206661696c6564 ('Assert failed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\nerror occurred in forked contract with class hash: 0x554cb276fb5eb0788344f5431b9a166e2f445d8a91c7aef79d8c77e7eede956\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: core::starknet::SyscallResultTraitImpl::unwrap_syscall\n       at [..]starknet.cairo:135:52\n   1: backtrace_panic::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   2: backtrace_panic::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   3: backtrace_panic::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n\nFailures:\n    backtrace_panic::Test::test_contract_panics\n    backtrace_panic::Test::test_fork_contract_panics\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/backtrace/main__e2e__backtrace__snap_test_backtrace_panic_without_optimizations@2.17.0.snap",
    "content": "---\nsource: crates/forge/tests/e2e/backtrace.rs\nexpression: stdout\n---\n\n\n[FAIL] backtrace_panic::Test::test_contract_panics\n\nFailure data:\n    (0x417373657274206661696c6564 ('Assert failed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\nerror occurred in contract 'InnerContract'\nstack backtrace:\n   0: core::array_inline_macro\n       at [..]lib.cairo:346:11\n   1: core::assert\n       at [..]lib.cairo:373:9\n   2: backtrace_panic::InnerContract::inner_call\n       at [..]lib.cairo:40:9\n   3: backtrace_panic::InnerContract::unsafe_new_contract_state\n       at [..]lib.cairo:29:5\n   4: backtrace_panic::InnerContract::__wrapper__InnerContract__inner\n       at [..]lib.cairo:32:5\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: core::starknet::SyscallResultTraitImpl::unwrap_syscall\n       at [..]starknet.cairo:135:52\n   1: backtrace_panic::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   2: backtrace_panic::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   3: backtrace_panic::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n[IGNORE] backtrace_panic::Test::test_contract_panics_with_should_panic\n[FAIL] backtrace_panic::Test::test_fork_contract_panics\n\nFailure data:\n    (0x417373657274206661696c6564 ('Assert failed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\nerror occurred in forked contract with class hash: 0x554cb276fb5eb0788344f5431b9a166e2f445d8a91c7aef79d8c77e7eede956\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: core::starknet::SyscallResultTraitImpl::unwrap_syscall\n       at [..]starknet.cairo:135:52\n   1: backtrace_panic::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   2: backtrace_panic::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   3: backtrace_panic::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n\nFailures:\n    backtrace_panic::Test::test_contract_panics\n    backtrace_panic::Test::test_fork_contract_panics\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/backtrace/main__e2e__backtrace__snap_test_backtrace_without_inlines@2.15.2.snap",
    "content": "---\nsource: crates/forge/tests/e2e/backtrace.rs\nexpression: stdout\n---\n[FAIL] backtrace_vm_error::Test::test_fork_unwrapped_call_contract_syscall\n\nFailure data:\n    Got an exception while executing a hint: Hint Error: Error at pc=0:280:\nGot an exception while executing a hint: Error at pc=0:86:\nGot an exception while executing a hint: Requested contract address 0x0000000000000000000000000000000000000000000000000000000000000123 is not deployed.\n\nCairo traceback (most recent call last):\nUnknown location (pc=0:50)\nUnknown location (pc=0:207)\n\n\nerror occurred in forked contract with class hash: 0x1a92e0ec431585e5c19b98679e582ebc07d43681ba1cc9c55dcb5ba0ce721a1\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: backtrace_vm_error::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   1: backtrace_vm_error::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   2: backtrace_vm_error::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n[FAIL] backtrace_vm_error::Test::test_unwrapped_call_contract_syscall\n\nFailure data:\n    Got an exception while executing a hint: Hint Error: Error at pc=0:280:\nGot an exception while executing a hint: Error at pc=0:184:\nGot an exception while executing a hint: Requested contract address 0x0000000000000000000000000000000000000000000000000000000000000123 is not deployed.\nCairo traceback (most recent call last):\nUnknown location (pc=0:43)\nUnknown location (pc=0:133)\n\nCairo traceback (most recent call last):\nUnknown location (pc=0:50)\nUnknown location (pc=0:207)\n\n\nerror occurred in contract 'InnerContract'\nstack backtrace:\n   0: backtrace_vm_error::InnerContract::inner_call\n       at [..]lib.cairo:48:9\n   1: backtrace_vm_error::InnerContract::InnerContract::inner\n       at [..]lib.cairo:38:13\n   2: backtrace_vm_error::InnerContract::__wrapper__InnerContract__inner\n       at [..]lib.cairo:35:5\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: backtrace_vm_error::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   1: backtrace_vm_error::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   2: backtrace_vm_error::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n\nFailures:\n    backtrace_vm_error::Test::test_fork_unwrapped_call_contract_syscall\n    backtrace_vm_error::Test::test_unwrapped_call_contract_syscall\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/backtrace/main__e2e__backtrace__snap_test_backtrace_without_inlines@2.16.0.snap",
    "content": "---\nsource: crates/forge/tests/e2e/backtrace.rs\nexpression: stdout\n---\n[FAIL] backtrace_vm_error::Test::test_fork_unwrapped_call_contract_syscall\n\nFailure data:\n    Got an exception while executing a hint: Hint Error: Error at pc=0:280:\nGot an exception while executing a hint: Error at pc=0:86:\nGot an exception while executing a hint: Requested contract address 0x0000000000000000000000000000000000000000000000000000000000000123 is not deployed.\n\nCairo traceback (most recent call last):\nUnknown location (pc=0:50)\nUnknown location (pc=0:207)\n\n\nerror occurred in forked contract with class hash: 0x1a92e0ec431585e5c19b98679e582ebc07d43681ba1cc9c55dcb5ba0ce721a1\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: backtrace_vm_error::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   1: backtrace_vm_error::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   2: backtrace_vm_error::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n[FAIL] backtrace_vm_error::Test::test_unwrapped_call_contract_syscall\n\nFailure data:\n    Got an exception while executing a hint: Hint Error: Error at pc=0:280:\nGot an exception while executing a hint: Error at pc=0:184:\nGot an exception while executing a hint: Requested contract address 0x0000000000000000000000000000000000000000000000000000000000000123 is not deployed.\nCairo traceback (most recent call last):\nUnknown location (pc=0:43)\nUnknown location (pc=0:133)\n\nCairo traceback (most recent call last):\nUnknown location (pc=0:50)\nUnknown location (pc=0:207)\n\n\nerror occurred in contract 'InnerContract'\nstack backtrace:\n   0: backtrace_vm_error::InnerContract::inner_call\n       at [..]lib.cairo:48:9\n   1: backtrace_vm_error::InnerContract::InnerContract::inner\n       at [..]lib.cairo:38:13\n   2: backtrace_vm_error::InnerContract::__wrapper__InnerContract__inner\n       at [..]lib.cairo:35:5\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: backtrace_vm_error::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   1: backtrace_vm_error::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   2: backtrace_vm_error::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n\nFailures:\n    backtrace_vm_error::Test::test_fork_unwrapped_call_contract_syscall\n    backtrace_vm_error::Test::test_unwrapped_call_contract_syscall\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/backtrace/main__e2e__backtrace__snap_test_backtrace_without_inlines@2.16.1.snap",
    "content": "---\nsource: crates/forge/tests/e2e/backtrace.rs\nexpression: stdout\n---\n\n\n[FAIL] backtrace_vm_error::Test::test_fork_unwrapped_call_contract_syscall\n\nFailure data:\n    Got an exception while executing a hint: Hint Error: Error at pc=0:280:\nGot an exception while executing a hint: Error at pc=0:86:\nGot an exception while executing a hint: Requested contract address 0x0000000000000000000000000000000000000000000000000000000000000123 is not deployed.\n\nCairo traceback (most recent call last):\nUnknown location (pc=0:50)\nUnknown location (pc=0:207)\n\n\nerror occurred in forked contract with class hash: 0x1a92e0ec431585e5c19b98679e582ebc07d43681ba1cc9c55dcb5ba0ce721a1\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: backtrace_vm_error::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   1: backtrace_vm_error::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   2: backtrace_vm_error::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n[FAIL] backtrace_vm_error::Test::test_unwrapped_call_contract_syscall\n\nFailure data:\n    Got an exception while executing a hint: Hint Error: Error at pc=0:280:\nGot an exception while executing a hint: Error at pc=0:184:\nGot an exception while executing a hint: Requested contract address 0x0000000000000000000000000000000000000000000000000000000000000123 is not deployed.\nCairo traceback (most recent call last):\nUnknown location (pc=0:43)\nUnknown location (pc=0:133)\n\nCairo traceback (most recent call last):\nUnknown location (pc=0:50)\nUnknown location (pc=0:207)\n\n\nerror occurred in contract 'InnerContract'\nstack backtrace:\n   0: backtrace_vm_error::InnerContract::inner_call\n       at [..]lib.cairo:48:9\n   1: backtrace_vm_error::InnerContract::InnerContract::inner\n       at [..]lib.cairo:38:13\n   2: backtrace_vm_error::InnerContract::__wrapper__InnerContract__inner\n       at [..]lib.cairo:35:5\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: backtrace_vm_error::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   1: backtrace_vm_error::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   2: backtrace_vm_error::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n\nFailures:\n    backtrace_vm_error::Test::test_fork_unwrapped_call_contract_syscall\n    backtrace_vm_error::Test::test_unwrapped_call_contract_syscall\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/backtrace/main__e2e__backtrace__snap_test_backtrace_without_inlines@2.17.0.snap",
    "content": "---\nsource: crates/forge/tests/e2e/backtrace.rs\nexpression: stdout\n---\n\n\n[FAIL] backtrace_vm_error::Test::test_fork_unwrapped_call_contract_syscall\n\nFailure data:\n    Got an exception while executing a hint: Hint Error: Error at pc=0:280:\nGot an exception while executing a hint: Error at pc=0:86:\nGot an exception while executing a hint: Requested contract address 0x0000000000000000000000000000000000000000000000000000000000000123 is not deployed.\n\nCairo traceback (most recent call last):\nUnknown location (pc=0:50)\nUnknown location (pc=0:207)\n\n\nerror occurred in forked contract with class hash: 0x1a92e0ec431585e5c19b98679e582ebc07d43681ba1cc9c55dcb5ba0ce721a1\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: backtrace_vm_error::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   1: backtrace_vm_error::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   2: backtrace_vm_error::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n[FAIL] backtrace_vm_error::Test::test_unwrapped_call_contract_syscall\n\nFailure data:\n    Got an exception while executing a hint: Hint Error: Error at pc=0:280:\nGot an exception while executing a hint: Error at pc=0:184:\nGot an exception while executing a hint: Requested contract address 0x0000000000000000000000000000000000000000000000000000000000000123 is not deployed.\nCairo traceback (most recent call last):\nUnknown location (pc=0:43)\nUnknown location (pc=0:133)\n\nCairo traceback (most recent call last):\nUnknown location (pc=0:50)\nUnknown location (pc=0:207)\n\n\nerror occurred in contract 'InnerContract'\nstack backtrace:\n   0: backtrace_vm_error::InnerContract::inner_call\n       at [..]lib.cairo:48:9\n   1: backtrace_vm_error::InnerContract::InnerContract::inner\n       at [..]lib.cairo:38:13\n   2: backtrace_vm_error::InnerContract::__wrapper__InnerContract__inner\n       at [..]lib.cairo:35:5\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: backtrace_vm_error::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   1: backtrace_vm_error::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   2: backtrace_vm_error::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:13:5\n\n\nFailures:\n    backtrace_vm_error::Test::test_fork_unwrapped_call_contract_syscall\n    backtrace_vm_error::Test::test_unwrapped_call_contract_syscall\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/backtrace/main__e2e__backtrace__snap_test_handled_error_not_display@2.15.2.snap",
    "content": "---\nsource: crates/forge/tests/e2e/backtrace.rs\nexpression: stdout\n---\n\n\n\n[PASS] dispatchers_integrationtest::test::test_handle_and_panic (l1_gas: ~0, l1_data_gas: ~288, l2_gas: ~1028560)\n\nerror occurred in contract 'ErrorHandler'\nstack backtrace:\n   0: core::panic_with_const_felt252\n       at [..]lib.cairo:364:5\n   1: core::panic_with_const_felt252\n       at [..]lib.cairo:364:5\n   2: dispatchers::error_handler::ErrorHandler::ErrorHandler::catch_panic_and_fail\n       at [..]error_handler.cairo:50:21\n   3: dispatchers::error_handler::ErrorHandler::__wrapper__ErrorHandler__catch_panic_and_fail\n       at [..]error_handler.cairo:27:5\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/backtrace/main__e2e__backtrace__snap_test_handled_error_not_display@2.16.0.snap",
    "content": "---\nsource: crates/forge/tests/e2e/backtrace.rs\nexpression: stdout\n---\n\n\n\n[PASS] dispatchers_integrationtest::test::test_handle_and_panic (l1_gas: ~0, l1_data_gas: ~288, l2_gas: ~1028560)\n\nerror occurred in contract 'ErrorHandler'\nstack backtrace:\n   0: core::panic_with_const_felt252\n       at [..]lib.cairo:360:5\n   1: core::panic_with_const_felt252\n       at [..]lib.cairo:360:5\n   2: dispatchers::error_handler::ErrorHandler::ErrorHandler::catch_panic_and_fail\n       at [..]error_handler.cairo:50:21\n   3: dispatchers::error_handler::ErrorHandler::__wrapper__ErrorHandler__catch_panic_and_fail\n       at [..]error_handler.cairo:27:5\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/backtrace/main__e2e__backtrace__snap_test_handled_error_not_display@2.16.1.snap",
    "content": "---\nsource: crates/forge/tests/e2e/backtrace.rs\nexpression: stdout\n---\n\n\n\n[PASS] dispatchers_integrationtest::test::test_handle_and_panic (l1_gas: ~0, l1_data_gas: ~288, l2_gas: ~1028560)\n\nerror occurred in contract 'ErrorHandler'\nstack backtrace:\n   0: core::panic_with_const_felt252\n       at [..]lib.cairo:360:5\n   1: core::panic_with_const_felt252\n       at [..]lib.cairo:360:5\n   2: dispatchers::error_handler::ErrorHandler::ErrorHandler::catch_panic_and_fail\n       at [..]error_handler.cairo:50:21\n   3: dispatchers::error_handler::ErrorHandler::__wrapper__ErrorHandler__catch_panic_and_fail\n       at [..]error_handler.cairo:27:5\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/backtrace/main__e2e__backtrace__snap_test_handled_error_not_display@2.17.0.snap",
    "content": "---\nsource: crates/forge/tests/e2e/backtrace.rs\nexpression: stdout\n---\n\n\n\n[PASS] dispatchers_integrationtest::test::test_handle_and_panic (l1_gas: ~0, l1_data_gas: ~288, l2_gas: ~1028560)\n\nerror occurred in contract 'ErrorHandler'\nstack backtrace:\n   0: core::panic_with_const_felt252\n       at [..]lib.cairo:360:5\n   1: core::panic_with_const_felt252\n       at [..]lib.cairo:360:5\n   2: dispatchers::error_handler::ErrorHandler::ErrorHandler::catch_panic_and_fail\n       at [..]error_handler.cairo:50:21\n   3: dispatchers::error_handler::ErrorHandler::__wrapper__ErrorHandler__catch_panic_and_fail\n       at [..]error_handler.cairo:27:5\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/gas_report/main__e2e__gas_report__snap_basic@2.15.2.snap",
    "content": "---\nsource: crates/forge/tests/e2e/gas_report.rs\nexpression: stdout\n---\n\n\n\n[PASS] simple_package_integrationtest::contract::call_and_invoke (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~974690)\n╭------------------------+-------+-------+-------+---------+---------╮\n| HelloStarknet Contract |       |       |       |         |         |\n+====================================================================+\n| Function Name          | Min   | Max   | Avg   | Std Dev | # Calls |\n|------------------------+-------+-------+-------+---------+---------|\n| get_balance            | 21410 | 21410 | 21410 | 0       | 2       |\n|------------------------+-------+-------+-------+---------+---------|\n| increase_balance       | 67980 | 67980 | 67980 | 0       | 1       |\n╰------------------------+-------+-------+-------+---------+---------╯\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/gas_report/main__e2e__gas_report__snap_basic@2.16.0.snap",
    "content": "---\nsource: crates/forge/tests/e2e/gas_report.rs\nexpression: stdout\n---\n\n\n\n[PASS] simple_package_integrationtest::contract::call_and_invoke (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~974690)\n╭------------------------+-------+-------+-------+---------+---------╮\n| HelloStarknet Contract |       |       |       |         |         |\n+====================================================================+\n| Function Name          | Min   | Max   | Avg   | Std Dev | # Calls |\n|------------------------+-------+-------+-------+---------+---------|\n| get_balance            | 21410 | 21410 | 21410 | 0       | 2       |\n|------------------------+-------+-------+-------+---------+---------|\n| increase_balance       | 67980 | 67980 | 67980 | 0       | 1       |\n╰------------------------+-------+-------+-------+---------+---------╯\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/gas_report/main__e2e__gas_report__snap_basic@2.16.1.snap",
    "content": "---\nsource: crates/forge/tests/e2e/gas_report.rs\nexpression: stdout\n---\n\n\n\n[PASS] simple_package_integrationtest::contract::call_and_invoke (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~974690)\n╭------------------------+-------+-------+-------+---------+---------╮\n| HelloStarknet Contract |       |       |       |         |         |\n+====================================================================+\n| Function Name          | Min   | Max   | Avg   | Std Dev | # Calls |\n|------------------------+-------+-------+-------+---------+---------|\n| get_balance            | 21410 | 21410 | 21410 | 0       | 2       |\n|------------------------+-------+-------+-------+---------+---------|\n| increase_balance       | 67980 | 67980 | 67980 | 0       | 1       |\n╰------------------------+-------+-------+-------+---------+---------╯\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/gas_report/main__e2e__gas_report__snap_basic@2.17.0.snap",
    "content": "---\nsource: crates/forge/tests/e2e/gas_report.rs\nexpression: stdout\n---\n\n\n\n[PASS] simple_package_integrationtest::contract::call_and_invoke (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~974690)\n╭------------------------+-------+-------+-------+---------+---------╮\n| HelloStarknet Contract |       |       |       |         |         |\n+====================================================================+\n| Function Name          | Min   | Max   | Avg   | Std Dev | # Calls |\n|------------------------+-------+-------+-------+---------+---------|\n| get_balance            | 21410 | 21410 | 21410 | 0       | 2       |\n|------------------------+-------+-------+-------+---------+---------|\n| increase_balance       | 67980 | 67980 | 67980 | 0       | 1       |\n╰------------------------+-------+-------+-------+---------+---------╯\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/gas_report/main__e2e__gas_report__snap_fork@2.15.2.snap",
    "content": "---\nsource: crates/forge/tests/e2e/gas_report.rs\nexpression: stdout\n---\n\n\n[PASS] forking::tests::test_track_resources (l1_gas: ~0, l1_data_gas: ~320, l2_gas: ~1403270)\n╭---------------------------+-------+-------+-------+---------+---------╮\n| forked contract           |       |       |       |         |         |\n| (class hash: 0x06a7…1550) |       |       |       |         |         |\n+=======================================================================+\n| Function Name             | Min   | Max   | Avg   | Std Dev | # Calls |\n|---------------------------+-------+-------+-------+---------+---------|\n| get_balance               | 40000 | 40000 | 40000 | 0       | 1       |\n|---------------------------+-------+-------+-------+---------+---------|\n| increase_balance          | 80000 | 80000 | 80000 | 0       | 1       |\n╰---------------------------+-------+-------+-------+---------+---------╯\n\n╭---------------------------+-------+-------+-------+---------+---------╮\n| forked contract           |       |       |       |         |         |\n| (class hash: 0x07aa…af4b) |       |       |       |         |         |\n+=======================================================================+\n| Function Name             | Min   | Max   | Avg   | Std Dev | # Calls |\n|---------------------------+-------+-------+-------+---------+---------|\n| get_balance               | 21910 | 21910 | 21910 | 0       | 1       |\n|---------------------------+-------+-------+-------+---------+---------|\n| increase_balance          | 68880 | 68880 | 68880 | 0       | 1       |\n╰---------------------------+-------+-------+-------+---------+---------╯\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/gas_report/main__e2e__gas_report__snap_fork@2.16.0.snap",
    "content": "---\nsource: crates/forge/tests/e2e/gas_report.rs\nexpression: stdout\n---\n\n\n[PASS] forking::tests::test_track_resources (l1_gas: ~0, l1_data_gas: ~320, l2_gas: ~1403270)\n╭---------------------------+-------+-------+-------+---------+---------╮\n| forked contract           |       |       |       |         |         |\n| (class hash: 0x06a7…1550) |       |       |       |         |         |\n+=======================================================================+\n| Function Name             | Min   | Max   | Avg   | Std Dev | # Calls |\n|---------------------------+-------+-------+-------+---------+---------|\n| get_balance               | 40000 | 40000 | 40000 | 0       | 1       |\n|---------------------------+-------+-------+-------+---------+---------|\n| increase_balance          | 80000 | 80000 | 80000 | 0       | 1       |\n╰---------------------------+-------+-------+-------+---------+---------╯\n\n╭---------------------------+-------+-------+-------+---------+---------╮\n| forked contract           |       |       |       |         |         |\n| (class hash: 0x07aa…af4b) |       |       |       |         |         |\n+=======================================================================+\n| Function Name             | Min   | Max   | Avg   | Std Dev | # Calls |\n|---------------------------+-------+-------+-------+---------+---------|\n| get_balance               | 21910 | 21910 | 21910 | 0       | 1       |\n|---------------------------+-------+-------+-------+---------+---------|\n| increase_balance          | 68880 | 68880 | 68880 | 0       | 1       |\n╰---------------------------+-------+-------+-------+---------+---------╯\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/gas_report/main__e2e__gas_report__snap_fork@2.16.1.snap",
    "content": "---\nsource: crates/forge/tests/e2e/gas_report.rs\nexpression: stdout\n---\n\n\n[PASS] forking::tests::test_track_resources (l1_gas: ~0, l1_data_gas: ~320, l2_gas: ~1403270)\n╭---------------------------+-------+-------+-------+---------+---------╮\n| forked contract           |       |       |       |         |         |\n| (class hash: 0x06a7…1550) |       |       |       |         |         |\n+=======================================================================+\n| Function Name             | Min   | Max   | Avg   | Std Dev | # Calls |\n|---------------------------+-------+-------+-------+---------+---------|\n| get_balance               | 40000 | 40000 | 40000 | 0       | 1       |\n|---------------------------+-------+-------+-------+---------+---------|\n| increase_balance          | 80000 | 80000 | 80000 | 0       | 1       |\n╰---------------------------+-------+-------+-------+---------+---------╯\n\n╭---------------------------+-------+-------+-------+---------+---------╮\n| forked contract           |       |       |       |         |         |\n| (class hash: 0x07aa…af4b) |       |       |       |         |         |\n+=======================================================================+\n| Function Name             | Min   | Max   | Avg   | Std Dev | # Calls |\n|---------------------------+-------+-------+-------+---------+---------|\n| get_balance               | 21910 | 21910 | 21910 | 0       | 1       |\n|---------------------------+-------+-------+-------+---------+---------|\n| increase_balance          | 68880 | 68880 | 68880 | 0       | 1       |\n╰---------------------------+-------+-------+-------+---------+---------╯\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/gas_report/main__e2e__gas_report__snap_fork@2.17.0.snap",
    "content": "---\nsource: crates/forge/tests/e2e/gas_report.rs\nexpression: stdout\n---\n\n\n[PASS] forking::tests::test_track_resources (l1_gas: ~0, l1_data_gas: ~320, l2_gas: ~1403270)\n╭---------------------------+-------+-------+-------+---------+---------╮\n| forked contract           |       |       |       |         |         |\n| (class hash: 0x06a7…1550) |       |       |       |         |         |\n+=======================================================================+\n| Function Name             | Min   | Max   | Avg   | Std Dev | # Calls |\n|---------------------------+-------+-------+-------+---------+---------|\n| get_balance               | 40000 | 40000 | 40000 | 0       | 1       |\n|---------------------------+-------+-------+-------+---------+---------|\n| increase_balance          | 80000 | 80000 | 80000 | 0       | 1       |\n╰---------------------------+-------+-------+-------+---------+---------╯\n\n╭---------------------------+-------+-------+-------+---------+---------╮\n| forked contract           |       |       |       |         |         |\n| (class hash: 0x07aa…af4b) |       |       |       |         |         |\n+=======================================================================+\n| Function Name             | Min   | Max   | Avg   | Std Dev | # Calls |\n|---------------------------+-------+-------+-------+---------+---------|\n| get_balance               | 21910 | 21910 | 21910 | 0       | 1       |\n|---------------------------+-------+-------+-------+---------+---------|\n| increase_balance          | 68880 | 68880 | 68880 | 0       | 1       |\n╰---------------------------+-------+-------+-------+---------+---------╯\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/gas_report/main__e2e__gas_report__snap_multiple_contracts_and_constructor@2.15.2.snap",
    "content": "---\nsource: crates/forge/tests/e2e/gas_report.rs\nexpression: stdout\n---\n\n\n\n[PASS] simple_package_with_cheats_integrationtest::contract::call_and_invoke_proxy (l1_gas: ~0, l1_data_gas: ~288, l2_gas: ~1334740)\n╭------------------------+-------+-------+-------+---------+---------╮\n| HelloStarknet Contract |       |       |       |         |         |\n+====================================================================+\n| Function Name          | Min   | Max   | Avg   | Std Dev | # Calls |\n|------------------------+-------+-------+-------+---------+---------|\n| get_block_number       | 15780 | 15780 | 15780 | 0       | 2       |\n╰------------------------+-------+-------+-------+---------+---------╯\n\n╭-----------------------------+--------+--------+--------+---------+---------╮\n| HelloStarknetProxy Contract |        |        |        |         |         |\n+============================================================================+\n| Function Name               | Min    | Max    | Avg    | Std Dev | # Calls |\n|-----------------------------+--------+--------+--------+---------+---------|\n| constructor                 | 49620  | 49620  | 49620  | 0       | 1       |\n|-----------------------------+--------+--------+--------+---------+---------|\n| get_block_number            | 133350 | 133350 | 133350 | 0       | 2       |\n╰-----------------------------+--------+--------+--------+---------+---------╯\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/gas_report/main__e2e__gas_report__snap_multiple_contracts_and_constructor@2.16.0.snap",
    "content": "---\nsource: crates/forge/tests/e2e/gas_report.rs\nexpression: stdout\n---\n\n\n\n[PASS] simple_package_with_cheats_integrationtest::contract::call_and_invoke_proxy (l1_gas: ~0, l1_data_gas: ~288, l2_gas: ~1334740)\n╭------------------------+-------+-------+-------+---------+---------╮\n| HelloStarknet Contract |       |       |       |         |         |\n+====================================================================+\n| Function Name          | Min   | Max   | Avg   | Std Dev | # Calls |\n|------------------------+-------+-------+-------+---------+---------|\n| get_block_number       | 15780 | 15780 | 15780 | 0       | 2       |\n╰------------------------+-------+-------+-------+---------+---------╯\n\n╭-----------------------------+--------+--------+--------+---------+---------╮\n| HelloStarknetProxy Contract |        |        |        |         |         |\n+============================================================================+\n| Function Name               | Min    | Max    | Avg    | Std Dev | # Calls |\n|-----------------------------+--------+--------+--------+---------+---------|\n| constructor                 | 49620  | 49620  | 49620  | 0       | 1       |\n|-----------------------------+--------+--------+--------+---------+---------|\n| get_block_number            | 133350 | 133350 | 133350 | 0       | 2       |\n╰-----------------------------+--------+--------+--------+---------+---------╯\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/gas_report/main__e2e__gas_report__snap_multiple_contracts_and_constructor@2.16.1.snap",
    "content": "---\nsource: crates/forge/tests/e2e/gas_report.rs\nexpression: stdout\n---\n\n\n\n[PASS] simple_package_with_cheats_integrationtest::contract::call_and_invoke_proxy (l1_gas: ~0, l1_data_gas: ~288, l2_gas: ~1334740)\n╭------------------------+-------+-------+-------+---------+---------╮\n| HelloStarknet Contract |       |       |       |         |         |\n+====================================================================+\n| Function Name          | Min   | Max   | Avg   | Std Dev | # Calls |\n|------------------------+-------+-------+-------+---------+---------|\n| get_block_number       | 15780 | 15780 | 15780 | 0       | 2       |\n╰------------------------+-------+-------+-------+---------+---------╯\n\n╭-----------------------------+--------+--------+--------+---------+---------╮\n| HelloStarknetProxy Contract |        |        |        |         |         |\n+============================================================================+\n| Function Name               | Min    | Max    | Avg    | Std Dev | # Calls |\n|-----------------------------+--------+--------+--------+---------+---------|\n| constructor                 | 49620  | 49620  | 49620  | 0       | 1       |\n|-----------------------------+--------+--------+--------+---------+---------|\n| get_block_number            | 133350 | 133350 | 133350 | 0       | 2       |\n╰-----------------------------+--------+--------+--------+---------+---------╯\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/gas_report/main__e2e__gas_report__snap_multiple_contracts_and_constructor@2.17.0.snap",
    "content": "---\nsource: crates/forge/tests/e2e/gas_report.rs\nexpression: stdout\n---\n\n\n\n[PASS] simple_package_with_cheats_integrationtest::contract::call_and_invoke_proxy (l1_gas: ~0, l1_data_gas: ~288, l2_gas: ~1334740)\n╭------------------------+-------+-------+-------+---------+---------╮\n| HelloStarknet Contract |       |       |       |         |         |\n+====================================================================+\n| Function Name          | Min   | Max   | Avg   | Std Dev | # Calls |\n|------------------------+-------+-------+-------+---------+---------|\n| get_block_number       | 15780 | 15780 | 15780 | 0       | 2       |\n╰------------------------+-------+-------+-------+---------+---------╯\n\n╭-----------------------------+--------+--------+--------+---------+---------╮\n| HelloStarknetProxy Contract |        |        |        |         |         |\n+============================================================================+\n| Function Name               | Min    | Max    | Avg    | Std Dev | # Calls |\n|-----------------------------+--------+--------+--------+---------+---------|\n| constructor                 | 49620  | 49620  | 49620  | 0       | 1       |\n|-----------------------------+--------+--------+--------+---------+---------|\n| get_block_number            | 133350 | 133350 | 133350 | 0       | 2       |\n╰-----------------------------+--------+--------+--------+---------+---------╯\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/gas_report/main__e2e__gas_report__snap_recursive_calls@2.15.2.snap",
    "content": "---\nsource: crates/forge/tests/e2e/gas_report.rs\nexpression: stdout\n---\n[PASS] debugging_integrationtest::test_trace::test_debugging_trace_success (l1_gas: ~0, l1_data_gas: ~288, l2_gas: ~1382600)\n╭-------------------------+-------+--------+--------+---------+---------╮\n| SimpleContract Contract |       |        |        |         |         |\n+=======================================================================+\n| Function Name           | Min   | Max    | Avg    | Std Dev | # Calls |\n|-------------------------+-------+--------+--------+---------+---------|\n| execute_calls           | 11660 | 609380 | 184000 | 235987  | 5       |\n|-------------------------+-------+--------+--------+---------+---------|\n| fail                    | 17950 | 17950  | 17950  | 0       | 1       |\n╰-------------------------+-------+--------+--------+---------+---------╯\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/gas_report/main__e2e__gas_report__snap_recursive_calls@2.16.0.snap",
    "content": "---\nsource: crates/forge/tests/e2e/gas_report.rs\nexpression: stdout\n---\n[PASS] debugging_integrationtest::test_trace::test_debugging_trace_success (l1_gas: ~0, l1_data_gas: ~288, l2_gas: ~1382600)\n╭-------------------------+-------+--------+--------+---------+---------╮\n| SimpleContract Contract |       |        |        |         |         |\n+=======================================================================+\n| Function Name           | Min   | Max    | Avg    | Std Dev | # Calls |\n|-------------------------+-------+--------+--------+---------+---------|\n| execute_calls           | 11660 | 609380 | 184000 | 235987  | 5       |\n|-------------------------+-------+--------+--------+---------+---------|\n| fail                    | 17950 | 17950  | 17950  | 0       | 1       |\n╰-------------------------+-------+--------+--------+---------+---------╯\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/gas_report/main__e2e__gas_report__snap_recursive_calls@2.16.1.snap",
    "content": "---\nsource: crates/forge/tests/e2e/gas_report.rs\nexpression: stdout\n---\n\n\n[PASS] debugging_integrationtest::test_trace::test_debugging_trace_success (l1_gas: ~0, l1_data_gas: ~288, l2_gas: ~1382600)\n╭-------------------------+-------+--------+--------+---------+---------╮\n| SimpleContract Contract |       |        |        |         |         |\n+=======================================================================+\n| Function Name           | Min   | Max    | Avg    | Std Dev | # Calls |\n|-------------------------+-------+--------+--------+---------+---------|\n| execute_calls           | 11660 | 609380 | 184000 | 235987  | 5       |\n|-------------------------+-------+--------+--------+---------+---------|\n| fail                    | 17950 | 17950  | 17950  | 0       | 1       |\n╰-------------------------+-------+--------+--------+---------+---------╯\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/gas_report/main__e2e__gas_report__snap_recursive_calls@2.17.0.snap",
    "content": "---\nsource: crates/forge/tests/e2e/gas_report.rs\nexpression: stdout\n---\n\n\n\n[PASS] debugging_integrationtest::test_trace::test_debugging_trace_success (l1_gas: ~0, l1_data_gas: ~288, l2_gas: ~1382600)\n╭-------------------------+-------+--------+--------+---------+---------╮\n| SimpleContract Contract |       |        |        |         |         |\n+=======================================================================+\n| Function Name           | Min   | Max    | Avg    | Std Dev | # Calls |\n|-------------------------+-------+--------+--------+---------+---------|\n| execute_calls           | 11660 | 609380 | 184000 | 235987  | 5       |\n|-------------------------+-------+--------+--------+---------+---------|\n| fail                    | 17950 | 17950  | 17950  | 0       | 1       |\n╰-------------------------+-------+--------+--------+---------+---------╯\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/main__e2e__optimize_inlining__optimize_inlining_dry_run.snap",
    "content": "---\nsource: crates/forge/tests/e2e/optimize_inlining.rs\nexpression: graph_bytes\nextension: png\nsnapshot_kind: binary\n---\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/main__e2e__optimize_inlining__optimize_inlining_updates_manifest.snap",
    "content": "---\nsource: crates/forge/tests/e2e/optimize_inlining.rs\nexpression: graph_bytes\nextension: png\nsnapshot_kind: binary\n---\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/optimize_inlining/main__e2e__optimize_inlining__snap_optimize_inlining_dry_run@2.15.2.snap",
    "content": "---\nsource: crates/forge/tests/e2e/optimize_inlining.rs\nexpression: stdout\n---\nStarting inlining strategy optimization...\nSearch range: 0 to 100, step: 50, max contract size: 4089446 bytes, max felts: 81920\n\n\n[1/3] Testing threshold 0...\n\n\n\n[PASS] simple_package_integrationtest::contract::call_and_invoke (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~1009130)\n\n\n  ✓ Tests passed, gas: 1009130, max contract size: 52390 bytes, contract bytecode L2 gas: 49725440\n\n[2/3] Testing threshold 50...\n\n\n\n[PASS] simple_package_integrationtest::contract::call_and_invoke (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~975690)\n\n\n  ✓ Tests passed, gas: 975690, max contract size: 21760 bytes, contract bytecode L2 gas: 27033600\n\n[3/3] Testing threshold 100...\n\n\n\n[PASS] simple_package_integrationtest::contract::call_and_invoke (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~974690)\n\n\n  ✓ Tests passed, gas: 974690, max contract size: 19732 bytes, contract bytecode L2 gas: 25559040\n\nOptimization Results:\n╭───────────┬───────────┬───────────────┬──────────────────────────┬────────╮\n│ Threshold ┆ Total Gas ┆ Contract Size ┆ Contract Bytecode L2 Gas ┆ Status │\n╞═══════════╪═══════════╪═══════════════╪══════════════════════════╪════════╡\n│ 0         ┆ 1009130   ┆ 52390         ┆ 49725440                 ┆ ✓      │\n├╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤\n│ 50        ┆ 975690    ┆ 21760         ┆ 27033600                 ┆ ✓      │\n├╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤\n│ 100       ┆ 974690    ┆ 19732         ┆ 25559040                 ┆ ✓      │\n╰───────────┴───────────┴───────────────┴──────────────────────────┴────────╯\n\nLowest runtime gas cost: threshold=100, gas=974690, contract bytecode L2 gas=25559040\nLowest contract size cost: threshold=100, gas=974690, contract bytecode L2 gas=25559040\n\nGraph saved to: [..]\nScarb.toml not modified. Use --gas or --size to apply a threshold.\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/optimize_inlining/main__e2e__optimize_inlining__snap_optimize_inlining_dry_run@2.16.0.snap",
    "content": "---\nsource: crates/forge/tests/e2e/optimize_inlining.rs\nexpression: stdout\n---\nStarting inlining strategy optimization...\nSearch range: 0 to 100, step: 50, max contract size: 4089446 bytes, max felts: 81920\n\n\n[1/3] Testing threshold 0...\n\n\n\n[PASS] simple_package_integrationtest::contract::call_and_invoke (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~1009130)\n\n\n  ✓ Tests passed, gas: 1009130, max contract size: 52391 bytes, contract bytecode L2 gas: 49725440\n\n[2/3] Testing threshold 50...\n\n\n\n[PASS] simple_package_integrationtest::contract::call_and_invoke (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~975690)\n\n\n  ✓ Tests passed, gas: 975690, max contract size: 21761 bytes, contract bytecode L2 gas: 27033600\n\n[3/3] Testing threshold 100...\n\n\n\n[PASS] simple_package_integrationtest::contract::call_and_invoke (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~974690)\n\n\n  ✓ Tests passed, gas: 974690, max contract size: 19733 bytes, contract bytecode L2 gas: 25559040\n\nOptimization Results:\n╭───────────┬───────────┬───────────────┬──────────────────────────┬────────╮\n│ Threshold ┆ Total Gas ┆ Contract Size ┆ Contract Bytecode L2 Gas ┆ Status │\n╞═══════════╪═══════════╪═══════════════╪══════════════════════════╪════════╡\n│ 0         ┆ 1009130   ┆ 52391         ┆ 49725440                 ┆ ✓      │\n├╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤\n│ 50        ┆ 975690    ┆ 21761         ┆ 27033600                 ┆ ✓      │\n├╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤\n│ 100       ┆ 974690    ┆ 19733         ┆ 25559040                 ┆ ✓      │\n╰───────────┴───────────┴───────────────┴──────────────────────────┴────────╯\n\nLowest runtime gas cost: threshold=100, gas=974690, contract bytecode L2 gas=25559040\nLowest contract size cost: threshold=100, gas=974690, contract bytecode L2 gas=25559040\n\nGraph saved to: [..]\nScarb.toml not modified. Use --gas or --size to apply a threshold.\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/optimize_inlining/main__e2e__optimize_inlining__snap_optimize_inlining_dry_run@2.16.1.snap",
    "content": "---\nsource: crates/forge/tests/e2e/optimize_inlining.rs\nexpression: stdout\n---\nStarting inlining strategy optimization...\nSearch range: 0 to 100, step: 50, max contract size: 4089446 bytes, max felts: 81920\n\n\n[1/3] Testing threshold 0...\n\n\n\n[PASS] simple_package_integrationtest::contract::call_and_invoke (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~1009130)\n\n\n  ✓ Tests passed, gas: 1009130, max contract size: 52391 bytes, contract bytecode L2 gas: 49725440\n\n[2/3] Testing threshold 50...\n\n\n\n[PASS] simple_package_integrationtest::contract::call_and_invoke (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~975690)\n\n\n  ✓ Tests passed, gas: 975690, max contract size: 21761 bytes, contract bytecode L2 gas: 27033600\n\n[3/3] Testing threshold 100...\n\n\n\n[PASS] simple_package_integrationtest::contract::call_and_invoke (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~974690)\n\n\n  ✓ Tests passed, gas: 974690, max contract size: 19733 bytes, contract bytecode L2 gas: 25559040\n\nOptimization Results:\n╭───────────┬───────────┬───────────────┬──────────────────────────┬────────╮\n│ Threshold ┆ Total Gas ┆ Contract Size ┆ Contract Bytecode L2 Gas ┆ Status │\n╞═══════════╪═══════════╪═══════════════╪══════════════════════════╪════════╡\n│ 0         ┆ 1009130   ┆ 52391         ┆ 49725440                 ┆ ✓      │\n├╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤\n│ 50        ┆ 975690    ┆ 21761         ┆ 27033600                 ┆ ✓      │\n├╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤\n│ 100       ┆ 974690    ┆ 19733         ┆ 25559040                 ┆ ✓      │\n╰───────────┴───────────┴───────────────┴──────────────────────────┴────────╯\n\nLowest runtime gas cost: threshold=100, gas=974690, contract bytecode L2 gas=25559040\nLowest contract size cost: threshold=100, gas=974690, contract bytecode L2 gas=25559040\n\nGraph saved to: [..]\nScarb.toml not modified. Use --gas or --size to apply a threshold.\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/optimize_inlining/main__e2e__optimize_inlining__snap_optimize_inlining_dry_run@2.17.0.snap",
    "content": "---\nsource: crates/forge/tests/e2e/optimize_inlining.rs\nexpression: stdout\n---\nStarting inlining strategy optimization...\nSearch range: 0 to 100, step: 50, max contract size: 4089446 bytes, max felts: 81920\n\n\n[1/3] Testing threshold 0...\n\n\n\n[PASS] simple_package_integrationtest::contract::call_and_invoke (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~1009130)\n\n\n  ✓ Tests passed, gas: 1009130, max contract size: 52391 bytes, contract bytecode L2 gas: 49725440\n\n[2/3] Testing threshold 50...\n\n\n\n[PASS] simple_package_integrationtest::contract::call_and_invoke (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~975690)\n\n\n  ✓ Tests passed, gas: 975690, max contract size: 21761 bytes, contract bytecode L2 gas: 27033600\n\n[3/3] Testing threshold 100...\n\n\n\n[PASS] simple_package_integrationtest::contract::call_and_invoke (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~974690)\n\n\n  ✓ Tests passed, gas: 974690, max contract size: 19733 bytes, contract bytecode L2 gas: 25559040\n\nOptimization Results:\n╭───────────┬───────────┬───────────────┬──────────────────────────┬────────╮\n│ Threshold ┆ Total Gas ┆ Contract Size ┆ Contract Bytecode L2 Gas ┆ Status │\n╞═══════════╪═══════════╪═══════════════╪══════════════════════════╪════════╡\n│ 0         ┆ 1009130   ┆ 52391         ┆ 49725440                 ┆ ✓      │\n├╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤\n│ 50        ┆ 975690    ┆ 21761         ┆ 27033600                 ┆ ✓      │\n├╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤\n│ 100       ┆ 974690    ┆ 19733         ┆ 25559040                 ┆ ✓      │\n╰───────────┴───────────┴───────────────┴──────────────────────────┴────────╯\n\nLowest runtime gas cost: threshold=100, gas=974690, contract bytecode L2 gas=25559040\nLowest contract size cost: threshold=100, gas=974690, contract bytecode L2 gas=25559040\n\nGraph saved to: [..]\nScarb.toml not modified. Use --gas or --size to apply a threshold.\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/optimize_inlining/main__e2e__optimize_inlining__snap_optimize_inlining_updates_manifest@2.15.2.snap",
    "content": "---\nsource: crates/forge/tests/e2e/optimize_inlining.rs\nexpression: stdout\n---\nStarting inlining strategy optimization...\nSearch range: 0 to 10, step: 10, max contract size: 4089446 bytes, max felts: 81920\n\n\n[1/2] Testing threshold 0...\n\n\n\n[PASS] simple_package_integrationtest::contract::call_and_invoke (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~1009130)\n\n\n  ✓ Tests passed, gas: 1009130, max contract size: 52390 bytes, contract bytecode L2 gas: 49725440\n\n[2/2] Testing threshold 10...\n\n\n\n[PASS] simple_package_integrationtest::contract::call_and_invoke (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~984990)\n\n\n  ✓ Tests passed, gas: 984990, max contract size: 29545 bytes, contract bytecode L2 gas: 34897920\n\nOptimization Results:\n╭───────────┬───────────┬───────────────┬──────────────────────────┬────────╮\n│ Threshold ┆ Total Gas ┆ Contract Size ┆ Contract Bytecode L2 Gas ┆ Status │\n╞═══════════╪═══════════╪═══════════════╪══════════════════════════╪════════╡\n│ 0         ┆ 1009130   ┆ 52390         ┆ 49725440                 ┆ ✓      │\n├╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤\n│ 10        ┆ 984990    ┆ 29545         ┆ 34897920                 ┆ ✓      │\n╰───────────┴───────────┴───────────────┴──────────────────────────┴────────╯\n\nLowest runtime gas cost: threshold=10, gas=984990, contract bytecode L2 gas=34897920\nLowest contract size cost: threshold=10, gas=984990, contract bytecode L2 gas=34897920\n\nGraph saved to: [..]\nUpdated Scarb.toml with inlining-strategy = 10\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/optimize_inlining/main__e2e__optimize_inlining__snap_optimize_inlining_updates_manifest@2.16.0.snap",
    "content": "---\nsource: crates/forge/tests/e2e/optimize_inlining.rs\nexpression: stdout\n---\nStarting inlining strategy optimization...\nSearch range: 0 to 10, step: 10, max contract size: 4089446 bytes, max felts: 81920\n\n\n[1/2] Testing threshold 0...\n\n\n\n[PASS] simple_package_integrationtest::contract::call_and_invoke (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~1009130)\n\n\n  ✓ Tests passed, gas: 1009130, max contract size: 52391 bytes, contract bytecode L2 gas: 49725440\n\n[2/2] Testing threshold 10...\n\n\n\n[PASS] simple_package_integrationtest::contract::call_and_invoke (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~984990)\n\n\n  ✓ Tests passed, gas: 984990, max contract size: 29546 bytes, contract bytecode L2 gas: 34897920\n\nOptimization Results:\n╭───────────┬───────────┬───────────────┬──────────────────────────┬────────╮\n│ Threshold ┆ Total Gas ┆ Contract Size ┆ Contract Bytecode L2 Gas ┆ Status │\n╞═══════════╪═══════════╪═══════════════╪══════════════════════════╪════════╡\n│ 0         ┆ 1009130   ┆ 52391         ┆ 49725440                 ┆ ✓      │\n├╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤\n│ 10        ┆ 984990    ┆ 29546         ┆ 34897920                 ┆ ✓      │\n╰───────────┴───────────┴───────────────┴──────────────────────────┴────────╯\n\nLowest runtime gas cost: threshold=10, gas=984990, contract bytecode L2 gas=34897920\nLowest contract size cost: threshold=10, gas=984990, contract bytecode L2 gas=34897920\n\nGraph saved to: [..]\nUpdated Scarb.toml with inlining-strategy = 10\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/optimize_inlining/main__e2e__optimize_inlining__snap_optimize_inlining_updates_manifest@2.16.1.snap",
    "content": "---\nsource: crates/forge/tests/e2e/optimize_inlining.rs\nexpression: stdout\n---\nStarting inlining strategy optimization...\nSearch range: 0 to 10, step: 10, max contract size: 4089446 bytes, max felts: 81920\n\n\n[1/2] Testing threshold 0...\n\n\n\n[PASS] simple_package_integrationtest::contract::call_and_invoke (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~1009130)\n\n\n  ✓ Tests passed, gas: 1009130, max contract size: 52391 bytes, contract bytecode L2 gas: 49725440\n\n[2/2] Testing threshold 10...\n\n\n\n[PASS] simple_package_integrationtest::contract::call_and_invoke (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~984990)\n\n\n  ✓ Tests passed, gas: 984990, max contract size: 29546 bytes, contract bytecode L2 gas: 34897920\n\nOptimization Results:\n╭───────────┬───────────┬───────────────┬──────────────────────────┬────────╮\n│ Threshold ┆ Total Gas ┆ Contract Size ┆ Contract Bytecode L2 Gas ┆ Status │\n╞═══════════╪═══════════╪═══════════════╪══════════════════════════╪════════╡\n│ 0         ┆ 1009130   ┆ 52391         ┆ 49725440                 ┆ ✓      │\n├╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤\n│ 10        ┆ 984990    ┆ 29546         ┆ 34897920                 ┆ ✓      │\n╰───────────┴───────────┴───────────────┴──────────────────────────┴────────╯\n\nLowest runtime gas cost: threshold=10, gas=984990, contract bytecode L2 gas=34897920\nLowest contract size cost: threshold=10, gas=984990, contract bytecode L2 gas=34897920\n\nGraph saved to: [..]\nUpdated Scarb.toml with inlining-strategy = 10\n"
  },
  {
    "path": "crates/forge/tests/e2e/snapshots/optimize_inlining/main__e2e__optimize_inlining__snap_optimize_inlining_updates_manifest@2.17.0.snap",
    "content": "---\nsource: crates/forge/tests/e2e/optimize_inlining.rs\nexpression: stdout\n---\nStarting inlining strategy optimization...\nSearch range: 0 to 10, step: 10, max contract size: 4089446 bytes, max felts: 81920\n\n\n[1/2] Testing threshold 0...\n\n\n\n[PASS] simple_package_integrationtest::contract::call_and_invoke (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~1009130)\n\n\n  ✓ Tests passed, gas: 1009130, max contract size: 52391 bytes, contract bytecode L2 gas: 49725440\n\n[2/2] Testing threshold 10...\n\n\n\n[PASS] simple_package_integrationtest::contract::call_and_invoke (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~984990)\n\n\n  ✓ Tests passed, gas: 984990, max contract size: 29546 bytes, contract bytecode L2 gas: 34897920\n\nOptimization Results:\n╭───────────┬───────────┬───────────────┬──────────────────────────┬────────╮\n│ Threshold ┆ Total Gas ┆ Contract Size ┆ Contract Bytecode L2 Gas ┆ Status │\n╞═══════════╪═══════════╪═══════════════╪══════════════════════════╪════════╡\n│ 0         ┆ 1009130   ┆ 52391         ┆ 49725440                 ┆ ✓      │\n├╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤\n│ 10        ┆ 984990    ┆ 29546         ┆ 34897920                 ┆ ✓      │\n╰───────────┴───────────┴───────────────┴──────────────────────────┴────────╯\n\nLowest runtime gas cost: threshold=10, gas=984990, contract bytecode L2 gas=34897920\nLowest contract size cost: threshold=10, gas=984990, contract bytecode L2 gas=34897920\n\nGraph saved to: [..]\nUpdated Scarb.toml with inlining-strategy = 10\n"
  },
  {
    "path": "crates/forge/tests/e2e/steps.rs",
    "content": "use super::common::runner::{setup_package, test_runner};\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stdout_contains;\n\n// TODO(#2806)\n\n#[test]\nfn should_allow_less_than_default() {\n    let temp = setup_package(\"steps\");\n\n    let output = test_runner(&temp)\n        .args([\"--max-n-steps\", \"100000\"])\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc!(\n            r\"\n                [..]Compiling[..]\n                [..]Finished[..]\n\n                Collected 2 test(s) from steps package\n                Running 2 test(s) from src/\n                [FAIL] steps::tests::steps_less_than_10000000\n\n                Failure data:\n                    Could not reach the end of the program. RunResources has no remaining steps.\n                    Suggestion: Consider using the flag `--max-n-steps` to increase allowed limit of steps\n\n                [FAIL] steps::tests::steps_more_than_10000000\n\n                Failure data:\n                    Could not reach the end of the program. RunResources has no remaining steps.\n                    Suggestion: Consider using the flag `--max-n-steps` to increase allowed limit of steps\n\n                Tests: 0 passed, 2 failed, 0 ignored, 0 filtered out\n\n                Failures:\n                    steps::tests::steps_less_than_10000000\n                    steps::tests::steps_more_than_10000000\n            \"\n        ),\n    );\n}\n#[test]\n// 10_000_000 is blockifier limit we want to omit\nfn should_allow_more_than_10m() {\n    let temp = setup_package(\"steps\");\n\n    let output = test_runner(&temp)\n        .args([\"--max-n-steps\", \"15000100\"])\n        .assert()\n        .code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc!(\n            r\"\n                [..]Compiling[..]\n                [..]Finished[..]\n\n                Collected 2 test(s) from steps package\n                Running 2 test(s) from src/\n                [PASS] steps::tests::steps_more_than_10000000 [..]\n                [PASS] steps::tests::steps_less_than_10000000 [..]\n                Tests: 2 passed, 0 failed, 0 ignored, 0 filtered out\n            \"\n        ),\n    );\n}\n#[test]\nfn should_default_to_10m() {\n    let temp = setup_package(\"steps\");\n\n    let output = test_runner(&temp).assert().code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc!(\n            r\"\n            [..]Compiling[..]\n            [..]Finished[..]\n\n            Collected 2 test(s) from steps package\n            Running 2 test(s) from src/\n            [PASS] steps::tests::steps_less_than_10000000 (l1_gas: ~[..], l1_data_gas: ~[..], l2_gas: ~[..])\n            [FAIL] steps::tests::steps_more_than_10000000\n\n            Failure data:\n                Could not reach the end of the program. RunResources has no remaining steps.\n                Suggestion: Consider using the flag `--max-n-steps` to increase allowed limit of steps\n\n            Tests: 1 passed, 1 failed, 0 ignored, 0 filtered out\n\n            Failures:\n                steps::tests::steps_more_than_10000000\n            \"\n        ),\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/templates.rs",
    "content": "use super::common::runner::runner;\nuse crate::utils::tempdir_with_tool_versions;\nuse assert_fs::prelude::PathChild;\nuse camino::Utf8PathBuf;\nuse forge::Template;\nuse packages_validation::check_and_lint;\nuse scarb_api::ScarbCommand;\nuse std::fs;\nuse std::process::Stdio;\nuse test_case::test_case;\nuse toml_edit::DocumentMut;\n\n#[test_case(&Template::CairoProgram; \"cairo-program\")]\n#[test_case(&Template::BalanceContract; \"balance-contract\")]\n#[test_case(&Template::Erc20Contract; \"erc20-contract\")]\n#[cfg_attr(not(feature = \"run_test_for_scarb_since_2_15_1\"), ignore)]\nfn validate_templates(template: &Template) {\n    let temp_dir = tempdir_with_tool_versions().expect(\"Unable to create a temporary directory\");\n    let package_name = format!(\"{}_test\", template.to_string().replace('-', \"_\"));\n    let snforge_std = Utf8PathBuf::from(\"../../snforge_std\")\n        .canonicalize_utf8()\n        .unwrap();\n\n    runner(&temp_dir)\n        .env(\"DEV_DISABLE_SNFORGE_STD_DEPENDENCY\", \"true\")\n        .args([\n            \"new\",\n            \"--template\",\n            template.to_string().as_str(),\n            &package_name,\n        ])\n        .assert()\n        .success();\n\n    let package_path = temp_dir.child(package_name);\n    let package_path = Utf8PathBuf::from_path_buf(package_path.to_path_buf())\n        .expect(\"Failed to convert to Utf8PathBuf\");\n\n    let scarb_add = ScarbCommand::new()\n        .current_dir(&package_path)\n        .args([\n            \"add\",\n            \"snforge_std\",\n            \"--dev\",\n            \"--path\",\n            snforge_std.as_str(),\n        ])\n        .command()\n        .stdout(Stdio::inherit())\n        .stderr(Stdio::inherit())\n        .spawn()\n        .expect(\"Failed to run scarb add\")\n        .wait()\n        .expect(\"Failed to wait for scarb add\");\n    assert!(scarb_add.success(), \"Failed to add snforge_std to package\");\n\n    // Overwrite Scarb.toml with `allow-warnings = false`\n    let scarb_toml_path = package_path.join(\"Scarb.toml\");\n    let mut scarb_toml = fs::read_to_string(&scarb_toml_path)\n        .unwrap()\n        .parse::<DocumentMut>()\n        .unwrap();\n    scarb_toml[\"cairo\"][\"allow-warnings\"] = toml_edit::value(false);\n    fs::write(&scarb_toml_path, scarb_toml.to_string()).expect(\"Failed to write to Scarb.toml\");\n\n    check_and_lint(&package_path);\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/test_case.rs",
    "content": "use super::common::runner::{setup_package, test_runner};\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stdout_contains;\n\n#[test]\n#[cfg_attr(\n    feature = \"skip_test_for_only_latest_scarb\",\n    ignore = \"Plugin checks skipped\"\n)]\nfn simple_addition() {\n    let temp = setup_package(\"test_case\");\n\n    let output = test_runner(&temp).arg(\"simple_addition\").assert().code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 3 test(s) from test_case package\n        Running 3 test(s) from tests/\n        [PASS] test_case_integrationtest::single_attribute::simple_addition_1_2_3 [..]\n        [PASS] test_case_integrationtest::single_attribute::simple_addition_3_4_7 [..]\n        [PASS] test_case_integrationtest::single_attribute::simple_addition_5_6_11 [..]\n        Running 0 test(s) from src/\n        Tests: 3 passed, 0 failed, 0 ignored, [..] filtered out\n        \"},\n    );\n}\n\n#[test]\n#[cfg_attr(\n    feature = \"skip_test_for_only_latest_scarb\",\n    ignore = \"Plugin checks skipped\"\n)]\nfn with_exit_first_flag() {\n    let temp = setup_package(\"test_case\");\n\n    let output = test_runner(&temp)\n        .arg(\"test_fib_with_threshold\")\n        .arg(\"--exit-first\")\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r#\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 2 test(s) from test_case package\n        Running 2 test(s) from tests/\n        [FAIL] test_case_integrationtest::exit_first::test_fib_with_threshold_0_1_3\n\n        Failure data:\n            \"result should be greater than threshold\"\n\n        Tests: 0 passed, 1 failed, 0 ignored, [..] filtered out\n        Interrupted execution of 1 test(s).\n\n        Failures:\n            test_case_integrationtest::exit_first::test_fib_with_threshold_0_1_3\n        \"#},\n    );\n}\n\n#[test]\n#[cfg_attr(\n    feature = \"skip_test_for_only_latest_scarb\",\n    ignore = \"Plugin checks skipped\"\n)]\nfn with_multiple_attributes() {\n    let temp = setup_package(\"test_case\");\n\n    let output = test_runner(&temp)\n        .arg(\"multiple_attributes\")\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [IGNORE] test_case_integrationtest::multiple_attributes::with_ignore_3_4_7\n        [IGNORE] test_case_integrationtest::multiple_attributes::with_ignore_1_2_3\n        [PASS] test_case_integrationtest::multiple_attributes::with_available_gas_3_4_7 [..]\n        [PASS] test_case_integrationtest::multiple_attributes::with_fuzzer_3_4 [..]\n        [PASS] test_case_integrationtest::multiple_attributes::with_fuzzer_different_order_3_4 [..]\n        [FAIL] test_case_integrationtest::multiple_attributes::with_available_gas_exceed_limit_3_4_7\n\n        Failure data:\n        \tTest cost exceeded the available gas. Consumed [..]\n        [PASS] test_case_integrationtest::multiple_attributes::with_available_gas_1_2_3 [..]\n        [PASS] test_case_integrationtest::multiple_attributes::with_should_panic_3_4_7 [..]\n        [PASS] test_case_integrationtest::multiple_attributes::with_should_panic_1_2_3 [..]\n        [FAIL] test_case_integrationtest::multiple_attributes::with_available_gas_exceed_limit_1_2_3\n\n        Failure data:\n        \tTest cost exceeded the available gas. Consumed [..]\n        [PASS] test_case_integrationtest::multiple_attributes::with_fuzzer_1_2 [..]\n        [PASS] test_case_integrationtest::multiple_attributes::with_fuzzer [..]\n        [PASS] test_case_integrationtest::multiple_attributes::with_fuzzer_different_order_1_2 [..]\n        [PASS] test_case_integrationtest::multiple_attributes::with_fuzzer_different_order [..]\n        Running 0 test(s) from src/\n        Tests: 10 passed, 2 failed, 2 ignored, [..] filtered out\n        Fuzzer seed: [..]\n\n        Failures:\n            test_case_integrationtest::multiple_attributes::with_available_gas_exceed_limit_3_4_7\n            test_case_integrationtest::multiple_attributes::with_available_gas_exceed_limit_1_2_3\n        \"},\n    );\n}\n\n#[test]\n#[cfg_attr(\n    feature = \"skip_test_for_only_latest_scarb\",\n    ignore = \"Plugin checks skipped\"\n)]\nfn addition_with_name_arg() {\n    let temp = setup_package(\"test_case\");\n\n    let output = test_runner(&temp)\n        .arg(\"addition_with_name_arg\")\n        .assert()\n        .code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 3 test(s) from test_case package\n        Running 3 test(s) from tests/\n        [PASS] test_case_integrationtest::single_attribute::addition_with_name_arg_one_and_two [..]\n        [PASS] test_case_integrationtest::single_attribute::addition_with_name_arg_three_and_four [..]\n        [PASS] test_case_integrationtest::single_attribute::addition_with_name_arg_five_and_six [..]\n        Running 0 test(s) from src/\n        Tests: 3 passed, 0 failed, 0 ignored, [..] filtered out\n        \"},\n    );\n}\n\n#[test]\n#[cfg_attr(\n    feature = \"skip_test_for_only_latest_scarb\",\n    ignore = \"Plugin checks skipped\"\n)]\nfn with_contract_deploy() {\n    let temp = setup_package(\"test_case\");\n\n    let output = test_runner(&temp)\n        .arg(\"with_contract_deploy\")\n        .assert()\n        .code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 3 test(s) from test_case package\n        Running 3 test(s) from tests/\n        [PASS] test_case_integrationtest::with_deploy::with_contract_deploy_100 [..]\n        [PASS] test_case_integrationtest::with_deploy::with_contract_deploy_42 [..]\n        [PASS] test_case_integrationtest::with_deploy::with_contract_deploy_0 [..]\n        Running 0 test(s) from src/\n        Tests: 3 passed, 0 failed, 0 ignored, [..] filtered out\n        \"},\n    );\n}\n\n#[test]\n#[cfg_attr(\n    feature = \"skip_test_for_only_latest_scarb\",\n    ignore = \"Plugin checks skipped\"\n)]\nfn with_fuzzer_and_contract_deploy() {\n    let temp = setup_package(\"test_case\");\n\n    let output = test_runner(&temp)\n        .arg(\"with_fuzzer_and_contract_deploy\")\n        .assert()\n        .code(0);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 3 test(s) from test_case package\n        Running 3 test(s) from tests/\n        [PASS] test_case_integrationtest::with_deploy::with_fuzzer_and_contract_deploy_123 [..]\n        [PASS] test_case_integrationtest::with_deploy::with_fuzzer_and_contract_deploy_0 [..]\n        [PASS] test_case_integrationtest::with_deploy::with_fuzzer_and_contract_deploy [..]\n        Running 0 test(s) from src/\n        Tests: 3 passed, 0 failed, 0 ignored, [..] filtered out\n        Fuzzer seed: [..]\n        \"},\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/trace_print.rs",
    "content": "use super::common::runner::{setup_package, test_runner};\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stdout_contains;\n\n#[test]\nfn trace_info_print() {\n    let temp = setup_package(\"trace\");\n\n    let output = test_runner(&temp).assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n        Collected 1 test(s) from trace_info package\n        Running 0 test(s) from src/\n        Running 1 test(s) from tests/\n        Entry point type: External\n        Selector: [..]\n        Calldata: []\n        Storage address: [..]\n        Caller address: 0\n        Call type: Call\n        Nested Calls: [\n            (\n                Entry point type: External\n                Selector: [..]\n                Calldata: [..]\n                Storage address: [..]\n                Caller address: [..]\n                Call type: Call\n                Nested Calls: [\n                    (\n                        Entry point type: External\n                        Selector: [..]\n                        Calldata: [..]\n                        Storage address: [..]\n                        Caller address: [..]\n                        Call type: Call\n                        Nested Calls: [\n                            (\n                                Entry point type: External\n                                Selector: [..]\n                                Calldata: [0]\n                                Storage address: [..]\n                                Caller address: [..]\n                                Call type: Call\n                                Nested Calls: []\n                                Call Result: Success: []\n                            ),\n                            (\n                                Entry point type: External\n                                Selector: [..]\n                                Calldata: [0]\n                                Storage address: [..]\n                                Caller address: [..]\n                                Call type: Call\n                                Nested Calls: []\n                                Call Result: Success: []\n                            )\n                        ]\n                        Call Result: Success: []\n                    ),\n                    (\n                        Entry point type: External\n                        Selector: [..]\n                        Calldata: [0]\n                        Storage address: [..]\n                        Caller address: [..]\n                        Call type: Call\n                        Nested Calls: []\n                        Call Result: Success: []\n                    )\n                ]\n                Call Result: Success: []\n            ),\n            (\n                Entry point type: External\n                Selector: 1423007881864269398513176851135908567621420218646181695002463829511917924133\n                Calldata: [5, 1, 2, 3, 4, 5]\n                Storage address: [..]\n                Caller address: 469394814521890341860918960550914\n                Call type: Call\n                Nested Calls: []\n                Call Result: Failure: [1, 2, 3, 4, 5]\n            )\n        ]\n        Call Result: Success: []\n        \n        [PASS] trace_info_integrationtest::test_trace::test_trace (l1_gas: [..], l1_data_gas: [..], l2_gas: [..])\n        Tests: 1 passed, 0 failed, 0 ignored, 0 filtered out\n        \"},\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/trace_resources.rs",
    "content": "use super::common::runner::{setup_package, test_runner};\nuse crate::e2e::common::get_trace_from_trace_node;\nuse assert_fs::TempDir;\nuse cairo_annotations::trace_data::{\n    CallTraceNode as ProfilerCallTraceNode, CallTraceV1 as ProfilerCallTrace,\n    DeprecatedSyscallSelector::{\n        CallContract, Deploy, EmitEvent, GetBlockHash, GetExecutionInfo, Keccak, LibraryCall,\n        SendMessageToL1, StorageRead, StorageWrite,\n    },\n    ExecutionResources as ProfilerExecutionResources, SyscallUsage,\n    VersionedCallTrace as VersionedProfilerCallTrace,\n};\nuse forge_runner::build_trace_data::TRACE_DIR;\nuse std::{collections::HashMap, fs};\n\n#[test]\nfn trace_resources_call() {\n    assert_vm_resources_for_test(\"test_call\", check_call);\n}\n\n#[test]\nfn trace_resources_deploy() {\n    assert_vm_resources_for_test(\"test_deploy\", check_deploy);\n}\n\n#[test]\nfn trace_resources_l1_handler() {\n    assert_vm_resources_for_test(\"test_l1_handler\", check_l1_handler);\n}\n\n#[test]\nfn trace_resources_lib_call() {\n    assert_vm_resources_for_test(\"test_lib_call\", check_libcall);\n}\n\n#[test]\n#[ignore = \"TODO(#1657)\"]\nfn trace_resources_failed_call() {\n    assert_vm_resources_for_test(\"test_failed_call\", |_| ());\n}\n\n#[test]\n#[ignore = \"TODO(#1657)\"]\nfn trace_resources_failed_lib_call() {\n    assert_vm_resources_for_test(\"test_failed_lib_call\", |_| ());\n}\n\nfn assert_vm_resources_for_test(\n    test_name: &str,\n    check_not_easily_unifiable_syscalls: fn(&ProfilerCallTrace),\n) {\n    let temp = setup_package(\"trace_resources\");\n\n    test_runner(&temp)\n        .arg(test_name)\n        .arg(\"--save-trace-data\")\n        .arg(\"--tracked-resource\")\n        .arg(\"cairo-steps\")\n        .assert()\n        .success();\n\n    let VersionedProfilerCallTrace::V1(call_trace) = deserialize_call_trace(test_name, &temp);\n    check_vm_resources_and_easily_unifiable_syscalls(&call_trace);\n    // test Deploy, CallContract and LibraryCall syscalls as their counts cannot be unified as easily as the rest\n    check_not_easily_unifiable_syscalls(&call_trace);\n}\n\nfn deserialize_call_trace(test_name: &str, temp_dir: &TempDir) -> VersionedProfilerCallTrace {\n    let trace_data = fs::read_to_string(temp_dir.join(TRACE_DIR).join(format!(\n        \"trace_resources_tests_{test_name}_{test_name}.json\"\n    )))\n    .unwrap();\n    serde_json::from_str(&trace_data).expect(\"Failed to parse call trace\")\n}\n\nfn check_vm_resources_and_easily_unifiable_syscalls(\n    call_trace: &ProfilerCallTrace,\n) -> &ProfilerExecutionResources {\n    let mut child_resources = vec![];\n    for call_node in &call_trace.nested_calls {\n        if let cairo_annotations::trace_data::CallTraceNode::EntryPointCall(call) = call_node {\n            child_resources.push(check_vm_resources_and_easily_unifiable_syscalls(call));\n        }\n    }\n\n    let mut sum_child_resources = ProfilerExecutionResources::default();\n    for resource in child_resources {\n        sum_child_resources += resource;\n    }\n\n    let current_resources = &call_trace.cumulative_resources;\n    assert!(is_greater_eq_than(current_resources, &sum_child_resources));\n\n    let mut resource_diff = current_resources.clone();\n    resource_diff -= &sum_child_resources;\n\n    assert_correct_diff_for_builtins_and_easily_unifiable_syscalls(&resource_diff);\n    assert_l2_l1_messages(call_trace);\n\n    current_resources\n}\n\nfn assert_correct_diff_for_builtins_and_easily_unifiable_syscalls(\n    resource_diff: &ProfilerExecutionResources,\n) {\n    for syscall in [\n        EmitEvent,\n        GetBlockHash,\n        GetExecutionInfo,\n        StorageWrite,\n        StorageRead,\n        SendMessageToL1,\n        Keccak,\n    ] {\n        assert_eq!(\n            resource_diff\n                .clone()\n                .syscall_counter\n                .unwrap()\n                .get(&syscall)\n                .unwrap_or_else(|| panic!(\"Expected resource diff to contain {syscall:?}\"))\n                .call_count,\n            1,\n            \"Incorrect diff for {syscall:?}\"\n        );\n    }\n\n    for builtin in [\n        \"poseidon_builtin\",\n        \"ec_op_builtin\",\n        \"bitwise_builtin\",\n        \"pedersen_builtin\",\n    ] {\n        assert_eq!(\n            *resource_diff\n                .vm_resources\n                .builtin_instance_counter\n                .get(builtin)\n                .unwrap_or_else(|| panic!(\"Expected resource diff to contain {builtin:?}\")),\n            1,\n            \"Incorrect diff for {builtin:?}\"\n        );\n    }\n}\n\nfn assert_l2_l1_messages(call_trace: &ProfilerCallTrace) {\n    assert_eq!(\n        call_trace.used_l1_resources.l2_l1_message_sizes.len(),\n        1,\n        \"Every call should have one message\"\n    );\n    assert_eq!(\n        call_trace.used_l1_resources.l2_l1_message_sizes,\n        vec![2],\n        \"Message should have payload of length 2\"\n    );\n}\n\n// When sth fails in the functions below, and you didn't change anything in the cairo code it is a BUG.\n// If you changed the corresponding cairo code count the expected occurrences of syscalls manually first, then assert them.\n// TL;DR: DON't mindlessly change numbers to fix the tests if they ever fail.\nfn check_call(test_call_trace: &ProfilerCallTrace) {\n    assert_not_easily_unifiable_syscalls(test_call_trace, 14, 8, 1);\n\n    let regular_call = get_trace_from_trace_node(&test_call_trace.nested_calls[4]);\n    assert_not_easily_unifiable_syscalls(regular_call, 2, 1, 0);\n\n    let from_proxy = get_trace_from_trace_node(&regular_call.nested_calls[1]);\n    assert_not_easily_unifiable_syscalls(from_proxy, 1, 0, 0);\n\n    let with_libcall = get_trace_from_trace_node(&test_call_trace.nested_calls[5]);\n    assert_not_easily_unifiable_syscalls(with_libcall, 2, 0, 1);\n\n    let from_proxy = get_trace_from_trace_node(&with_libcall.nested_calls[1]);\n    assert_not_easily_unifiable_syscalls(from_proxy, 1, 0, 0);\n\n    let call_two = get_trace_from_trace_node(&test_call_trace.nested_calls[6]);\n    assert_not_easily_unifiable_syscalls(call_two, 3, 2, 0);\n\n    let from_proxy = get_trace_from_trace_node(&call_two.nested_calls[0]);\n    assert_not_easily_unifiable_syscalls(from_proxy, 1, 0, 0);\n\n    let from_proxy_dummy = get_trace_from_trace_node(&call_two.nested_calls[2]);\n    assert_not_easily_unifiable_syscalls(from_proxy_dummy, 1, 0, 0);\n\n    let from_proxy = get_trace_from_trace_node(&test_call_trace.nested_calls[7]);\n    assert_not_easily_unifiable_syscalls(from_proxy, 1, 0, 0);\n}\n\nfn check_deploy(test_call_trace: &ProfilerCallTrace) {\n    assert_not_easily_unifiable_syscalls(test_call_trace, 14, 4, 0);\n\n    for deploy_proxy_node in &test_call_trace.nested_calls {\n        if let ProfilerCallTraceNode::EntryPointCall(deploy_proxy) = deploy_proxy_node {\n            assert_not_easily_unifiable_syscalls(deploy_proxy, 2, 1, 0);\n\n            let from_proxy = get_trace_from_trace_node(&deploy_proxy.nested_calls[1]);\n            assert_not_easily_unifiable_syscalls(from_proxy, 1, 0, 0);\n        }\n    }\n}\n\nfn check_l1_handler(test_call_trace: &ProfilerCallTrace) {\n    assert_not_easily_unifiable_syscalls(test_call_trace, 8, 3, 0);\n\n    let handle_l1 = get_trace_from_trace_node(&test_call_trace.nested_calls[3]);\n    assert_not_easily_unifiable_syscalls(handle_l1, 3, 2, 0);\n\n    let regular_call = get_trace_from_trace_node(&handle_l1.nested_calls[1]);\n    assert_not_easily_unifiable_syscalls(regular_call, 2, 1, 0);\n\n    let from_proxy = get_trace_from_trace_node(&regular_call.nested_calls[1]);\n    assert_not_easily_unifiable_syscalls(from_proxy, 1, 0, 0);\n}\n\nfn check_libcall(test_call_trace: &ProfilerCallTrace) {\n    assert_not_easily_unifiable_syscalls(test_call_trace, 11, 3, 5);\n\n    let regular_call = get_trace_from_trace_node(&test_call_trace.nested_calls[3]);\n\n    assert_not_easily_unifiable_syscalls(regular_call, 2, 1, 0);\n\n    let from_proxy = get_trace_from_trace_node(&regular_call.nested_calls[1]);\n    assert_not_easily_unifiable_syscalls(from_proxy, 1, 0, 0);\n\n    let with_libcall = get_trace_from_trace_node(&test_call_trace.nested_calls[4]);\n    assert_not_easily_unifiable_syscalls(with_libcall, 2, 0, 1);\n\n    let call_two = get_trace_from_trace_node(&test_call_trace.nested_calls[5]);\n    assert_not_easily_unifiable_syscalls(call_two, 3, 2, 0);\n\n    let from_proxy = get_trace_from_trace_node(&call_two.nested_calls[0]);\n    assert_not_easily_unifiable_syscalls(from_proxy, 1, 0, 0);\n\n    let from_proxy_dummy = get_trace_from_trace_node(&call_two.nested_calls[2]);\n    assert_not_easily_unifiable_syscalls(from_proxy_dummy, 1, 0, 0);\n\n    let from_proxy = get_trace_from_trace_node(&test_call_trace.nested_calls[6]);\n    assert_not_easily_unifiable_syscalls(from_proxy, 1, 0, 0);\n}\n\nfn assert_not_easily_unifiable_syscalls(\n    call: &ProfilerCallTrace,\n    deploy_count: usize,\n    call_contract_count: usize,\n    library_call_count: usize,\n) {\n    let syscall_counter = &call.cumulative_resources.syscall_counter;\n\n    let expected_counts: HashMap<_, _> = [\n        (Deploy, deploy_count),\n        (CallContract, call_contract_count),\n        (LibraryCall, library_call_count),\n    ]\n    .into_iter()\n    .filter(|(_key, val)| *val > 0)\n    .collect();\n\n    for key in [Deploy, CallContract, LibraryCall] {\n        assert_eq!(\n            syscall_counter\n                .clone()\n                .unwrap()\n                .get(&key)\n                .unwrap_or(&SyscallUsage::default())\n                .call_count,\n            expected_counts.get(&key).copied().unwrap_or(0),\n            \"Incorrect count for {key:?}\"\n        );\n    }\n}\n\nfn is_greater_eq_than(\n    left: &ProfilerExecutionResources,\n    right: &ProfilerExecutionResources,\n) -> bool {\n    // Check VM resources\n    if left.vm_resources.n_steps < right.vm_resources.n_steps\n        || left.vm_resources.n_memory_holes < right.vm_resources.n_memory_holes\n    {\n        return false;\n    }\n    let left_builtin_counter = &left.vm_resources.builtin_instance_counter;\n    let right_builtin_counter = &right.vm_resources.builtin_instance_counter;\n    for (builtin, count) in right_builtin_counter {\n        let left_count = left_builtin_counter.get(builtin).unwrap_or(&0);\n        if left_count < count {\n            return false;\n        }\n    }\n\n    // Check gas consumed\n    if let (Some(left_gas), Some(right_gas)) = (left.gas_consumed, right.gas_consumed) {\n        if left_gas < right_gas {\n            return false;\n        }\n    } else if right.gas_consumed.is_some() && left.gas_consumed.is_none() {\n        return false;\n    }\n\n    // Check syscall counter\n    if let (Some(left_syscalls), Some(right_syscalls)) =\n        (&left.syscall_counter, &right.syscall_counter)\n    {\n        for (syscall, usage) in right_syscalls {\n            match left_syscalls.get(syscall) {\n                Some(left_usage) => {\n                    if left_usage.call_count < usage.call_count\n                        || left_usage.linear_factor < usage.linear_factor\n                    {\n                        return false;\n                    }\n                }\n                None => return false,\n            }\n        }\n    } else if right.syscall_counter.is_some() && left.syscall_counter.is_none() {\n        return false;\n    }\n\n    true\n}\n"
  },
  {
    "path": "crates/forge/tests/e2e/workspaces.rs",
    "content": "use super::common::runner::{setup_hello_workspace, setup_virtual_workspace, test_runner};\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stdout_contains;\nuse std::path::PathBuf;\n\n#[test]\nfn root_workspace_without_arguments() {\n    let temp = setup_hello_workspace();\n\n    let output = test_runner(&temp).assert().code(1);\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 3 test(s) from hello_workspaces package\n        Running 1 test(s) from src/\n        [PASS] hello_workspaces::tests::test_simple [..]\n        Running 2 test(s) from tests/\n        [FAIL] hello_workspaces_integrationtest::test_failing::test_failing\n        \n        Failure data:\n            0x6661696c696e6720636865636b ('failing check')\n        \n        [FAIL] hello_workspaces_integrationtest::test_failing::test_another_failing\n\n        Failure data:\n            0x6661696c696e6720636865636b ('failing check')\n        \n        Tests: 1 passed, 2 failed, 0 ignored, 0 filtered out\n        \n        Failures:\n            hello_workspaces_integrationtest::test_failing::test_failing\n            hello_workspaces_integrationtest::test_failing::test_another_failing\n        \"},\n    );\n}\n\n#[test]\nfn root_workspace_specific_package() {\n    let temp = setup_hello_workspace();\n\n    let output = test_runner(&temp)\n        .args([\"--package\", \"addition\"])\n        .assert()\n        .success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 5 test(s) from addition package\n        Running 1 test(s) from src/\n        [PASS] addition::tests::it_works [..]\n        Running 4 test(s) from tests/\n        [PASS] addition_integrationtest::nested::simple_case [..]\n        [PASS] addition_integrationtest::nested::contract_test [..]\n        [PASS] addition_integrationtest::nested::test_nested::test_two [..]\n        [PASS] addition_integrationtest::nested::test_nested::test_two_and_two [..]\n        Tests: 5 passed, 0 failed, 0 ignored, 0 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn root_workspace_specific_package2() {\n    let temp = setup_hello_workspace();\n\n    let output = test_runner(&temp)\n        .args([\"--package\", \"fibonacci\"])\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 6 test(s) from fibonacci package\n        Running 2 test(s) from src/\n        [PASS] fibonacci::tests::it_works [..]\n        [PASS] fibonacci::tests::contract_test [..]\n        Running 4 test(s) from tests/\n        [PASS] fibonacci_tests::lib_test [..]\n        [PASS] fibonacci_tests::abc::abc_test [..]\n        [PASS] fibonacci_tests::abc::efg::efg_test [..]\n        [FAIL] fibonacci_tests::abc::efg::failing_test\n\n        Failure data:\n            0x0 ('')\n\n        Tests: 5 passed, 1 failed, 0 ignored, 0 filtered out\n\n        Failures:\n            fibonacci_tests::abc::efg::failing_test\n        \"},\n    );\n}\n\n#[test]\nfn root_workspace_specific_package_and_name() {\n    let temp = setup_hello_workspace();\n\n    let output = test_runner(&temp)\n        .args([\"simple\", \"--package\", \"addition\"])\n        .assert()\n        .success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 1 test(s) from addition package\n        Running 0 test(s) from src/\n        Running 1 test(s) from tests/\n        [PASS] addition_integrationtest::nested::simple_case [..]\n        Tests: 1 passed, 0 failed, 0 ignored, 4 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn root_workspace_specify_root_package() {\n    let temp = setup_hello_workspace();\n\n    let output = test_runner(&temp)\n        .args([\"--package\", \"hello_workspaces\"])\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 3 test(s) from hello_workspaces package\n        Running 1 test(s) from src/\n        [PASS] hello_workspaces::tests::test_simple [..]\n        Running 2 test(s) from tests/\n        [FAIL] hello_workspaces_integrationtest::test_failing::test_failing\n\n        Failure data:\n            0x6661696c696e6720636865636b ('failing check')\n\n        [FAIL] hello_workspaces_integrationtest::test_failing::test_another_failing\n\n        Failure data:\n            0x6661696c696e6720636865636b ('failing check')\n\n        Tests: 1 passed, 2 failed, 0 ignored, 0 filtered out\n\n        Failures:\n            hello_workspaces_integrationtest::test_failing::test_failing\n            hello_workspaces_integrationtest::test_failing::test_another_failing\n        \"},\n    );\n}\n\n#[test]\nfn root_workspace_inside_nested_package() {\n    let temp = setup_hello_workspace();\n\n    let output = test_runner(&temp)\n        .current_dir(temp.join(\"crates/addition\"))\n        .assert()\n        .success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 5 test(s) from addition package\n        Running 1 test(s) from src/\n        [PASS] addition::tests::it_works [..]\n        Running 4 test(s) from tests/\n        [PASS] addition_integrationtest::nested::simple_case [..]\n        [PASS] addition_integrationtest::nested::contract_test [..]\n        [PASS] addition_integrationtest::nested::test_nested::test_two [..]\n        [PASS] addition_integrationtest::nested::test_nested::test_two_and_two [..]\n        Tests: 5 passed, 0 failed, 0 ignored, 0 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn root_workspace_for_entire_workspace() {\n    let temp = setup_hello_workspace();\n\n    let output = test_runner(&temp).arg(\"--workspace\").assert().code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 5 test(s) from addition package\n        Running 1 test(s) from src/\n        [PASS] addition::tests::it_works [..]\n        Running 4 test(s) from tests/\n        [PASS] addition_integrationtest::nested::simple_case [..]\n        [PASS] addition_integrationtest::nested::contract_test [..]\n        [PASS] addition_integrationtest::nested::test_nested::test_two [..]\n        [PASS] addition_integrationtest::nested::test_nested::test_two_and_two [..]\n        Tests: 5 passed, 0 failed, 0 ignored, 0 filtered out\n\n\n        Collected 6 test(s) from fibonacci package\n        Running 2 test(s) from src/\n        [PASS] fibonacci::tests::it_works [..]\n        [PASS] fibonacci::tests::contract_test [..]\n        Running 4 test(s) from tests/\n        [PASS] fibonacci_tests::lib_test [..]\n        [PASS] fibonacci_tests::abc::abc_test [..]\n        [PASS] fibonacci_tests::abc::efg::efg_test [..]\n        [FAIL] fibonacci_tests::abc::efg::failing_test\n\n        Failure data:\n            0x0 ('')\n\n        Tests: 5 passed, 1 failed, 0 ignored, 0 filtered out\n\n\n        Collected 3 test(s) from hello_workspaces package\n        Running 1 test(s) from src/\n        [PASS] hello_workspaces::tests::test_simple [..]\n        Running 2 test(s) from tests/\n        [FAIL] hello_workspaces_integrationtest::test_failing::test_failing\n\n        Failure data:\n            0x6661696c696e6720636865636b ('failing check')\n\n        [FAIL] hello_workspaces_integrationtest::test_failing::test_another_failing\n\n        Failure data:\n            0x6661696c696e6720636865636b ('failing check')\n\n        Tests: 1 passed, 2 failed, 0 ignored, 0 filtered out\n\n        Failures:\n            fibonacci_tests::abc::efg::failing_test\n            hello_workspaces_integrationtest::test_failing::test_failing\n            hello_workspaces_integrationtest::test_failing::test_another_failing\n\n        Tests summary: 11 passed, 3 failed, 0 ignored, 0 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn root_workspace_for_entire_workspace_inside_package() {\n    let temp = setup_hello_workspace();\n\n    let output = test_runner(&temp)\n        .current_dir(temp.join(\"crates/fibonacci\"))\n        .arg(\"--workspace\")\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 5 test(s) from addition package\n        Running 1 test(s) from src/\n        [PASS] addition::tests::it_works [..]\n        Running 4 test(s) from tests/\n        [PASS] addition_integrationtest::nested::simple_case [..]\n        [PASS] addition_integrationtest::nested::contract_test [..]\n        [PASS] addition_integrationtest::nested::test_nested::test_two [..]\n        [PASS] addition_integrationtest::nested::test_nested::test_two_and_two [..]\n        Tests: 5 passed, 0 failed, 0 ignored, 0 filtered out\n\n\n        Collected 6 test(s) from fibonacci package\n        Running 2 test(s) from src/\n        [PASS] fibonacci::tests::it_works [..]\n        [PASS] fibonacci::tests::contract_test [..]\n        Running 4 test(s) from tests/\n        [PASS] fibonacci_tests::lib_test [..]\n        [PASS] fibonacci_tests::abc::abc_test [..]\n        [PASS] fibonacci_tests::abc::efg::efg_test [..]\n        [FAIL] fibonacci_tests::abc::efg::failing_test\n\n        Failure data:\n            0x0 ('')\n\n        Tests: 5 passed, 1 failed, 0 ignored, 0 filtered out\n\n\n        Collected 3 test(s) from hello_workspaces package\n        Running 1 test(s) from src/\n        [PASS] hello_workspaces::tests::test_simple [..]\n        Running 2 test(s) from tests/\n        [FAIL] hello_workspaces_integrationtest::test_failing::test_failing\n\n        Failure data:\n            0x6661696c696e6720636865636b ('failing check')\n\n        [FAIL] hello_workspaces_integrationtest::test_failing::test_another_failing\n\n        Failure data:\n            0x6661696c696e6720636865636b ('failing check')\n\n        Tests: 1 passed, 2 failed, 0 ignored, 0 filtered out\n\n        Failures:\n            fibonacci_tests::abc::efg::failing_test\n            hello_workspaces_integrationtest::test_failing::test_failing\n            hello_workspaces_integrationtest::test_failing::test_another_failing\n\n        Tests summary: 11 passed, 3 failed, 0 ignored, 0 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn root_workspace_for_entire_workspace_and_specific_package() {\n    let temp = setup_hello_workspace();\n\n    let result = test_runner(&temp)\n        .args([\"--workspace\", \"--package\", \"addition\"])\n        .assert()\n        .code(2);\n\n    let stderr = String::from_utf8_lossy(&result.get_output().stderr);\n\n    assert!(stderr.contains(\"the argument '--workspace' cannot be used with '--package <SPEC>'\"));\n}\n\n#[test]\nfn root_workspace_missing_package() {\n    let temp = setup_hello_workspace();\n\n    let result = test_runner(&temp)\n        .args([\"--package\", \"missing_package\"])\n        .assert()\n        .code(2);\n\n    let stdout = String::from_utf8_lossy(&result.get_output().stdout);\n\n    assert!(stdout.contains(\"Failed to find any packages matching the specified filter\"));\n}\n\n#[test]\nfn virtual_workspace_without_arguments() {\n    let temp = setup_virtual_workspace();\n    let snapbox = test_runner(&temp);\n\n    let output = snapbox.current_dir(&temp).assert().code(1);\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 6 test(s) from fibonacci_virtual package\n        Running 2 test(s) from src/\n        [PASS] fibonacci_virtual::tests::it_works [..]\n        [PASS] fibonacci_virtual::tests::contract_test [..]\n        Running 4 test(s) from tests/\n        [PASS] fibonacci_virtual_tests::lib_test [..]\n        [PASS] fibonacci_virtual_tests::abc::abc_test [..]\n        [PASS] fibonacci_virtual_tests::abc::efg::efg_test [..]\n        [FAIL] fibonacci_virtual_tests::abc::efg::failing_test\n\n        Failure data:\n            0x0 ('')\n\n        Tests: 5 passed, 1 failed, 0 ignored, 0 filtered out\n\n\n        Collected 5 test(s) from subtraction package\n        Running 1 test(s) from src/\n        [PASS] subtraction::tests::it_works [..]\n        Running 4 test(s) from tests/\n        [PASS] subtraction_integrationtest::nested::simple_case [..]\n        [PASS] subtraction_integrationtest::nested::contract_test [..]\n        [PASS] subtraction_integrationtest::nested::test_nested::test_two [..]\n        [PASS] subtraction_integrationtest::nested::test_nested::test_two_and_two [..]\n        Tests: 5 passed, 0 failed, 0 ignored, 0 filtered out\n\n        Failures:\n            fibonacci_virtual_tests::abc::efg::failing_test\n\n        Tests summary: 10 passed, 1 failed, 0 ignored, 0 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn virtual_workspace_specify_package() {\n    let temp = setup_virtual_workspace();\n    let snapbox = test_runner(&temp).arg(\"--package\").arg(\"subtraction\");\n\n    let output = snapbox.current_dir(&temp).assert().success();\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 5 test(s) from subtraction package\n        Running 1 test(s) from src/\n        [PASS] subtraction::tests::it_works [..]\n        Running 4 test(s) from tests/\n        [PASS] subtraction_integrationtest::nested::simple_case [..]\n        [PASS] subtraction_integrationtest::nested::contract_test [..]\n        [PASS] subtraction_integrationtest::nested::test_nested::test_two [..]\n        [PASS] subtraction_integrationtest::nested::test_nested::test_two_and_two [..]\n        Tests: 5 passed, 0 failed, 0 ignored, 0 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn virtual_workspace_specific_package2() {\n    let temp = setup_virtual_workspace();\n    let snapbox = test_runner(&temp).arg(\"--package\").arg(\"fibonacci_virtual\");\n\n    let output = snapbox.current_dir(&temp).assert().code(1);\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 6 test(s) from fibonacci_virtual package\n        Running 2 test(s) from src/\n        [PASS] fibonacci_virtual::tests::it_works [..]\n        [PASS] fibonacci_virtual::tests::contract_test [..]\n        Running 4 test(s) from tests/\n        [PASS] fibonacci_virtual_tests::lib_test [..]\n        [PASS] fibonacci_virtual_tests::abc::abc_test [..]\n        [PASS] fibonacci_virtual_tests::abc::efg::efg_test [..]\n        [FAIL] fibonacci_virtual_tests::abc::efg::failing_test\n\n        Failure data:\n            0x0 ('')\n\n        Tests: 5 passed, 1 failed, 0 ignored, 0 filtered out\n\n        Failures:\n            fibonacci_virtual_tests::abc::efg::failing_test\n        \"},\n    );\n}\n\n#[test]\nfn virtual_workspace_specific_package_and_name() {\n    let temp = setup_virtual_workspace();\n    let snapbox = test_runner(&temp)\n        .arg(\"simple\")\n        .arg(\"--package\")\n        .arg(\"subtraction\");\n\n    let output = snapbox.current_dir(&temp).assert().success();\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 1 test(s) from subtraction package\n        Running 0 test(s) from src/\n        Running 1 test(s) from tests/\n        [PASS] subtraction_integrationtest::nested::simple_case [..]\n        Tests: 1 passed, 0 failed, 0 ignored, 4 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn virtual_workspace_inside_nested_package() {\n    let temp = setup_virtual_workspace();\n    let package_dir = temp.join(PathBuf::from(\"dummy_name/subtraction\"));\n\n    let snapbox = test_runner(&temp);\n\n    let output = snapbox.current_dir(package_dir).assert().success();\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 5 test(s) from subtraction package\n        Running 1 test(s) from src/\n        [PASS] subtraction::tests::it_works [..]\n        Running 4 test(s) from tests/\n        [PASS] subtraction_integrationtest::nested::simple_case [..]\n        [PASS] subtraction_integrationtest::nested::contract_test [..]\n        [PASS] subtraction_integrationtest::nested::test_nested::test_two [..]\n        [PASS] subtraction_integrationtest::nested::test_nested::test_two_and_two [..]\n        Tests: 5 passed, 0 failed, 0 ignored, 0 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn virtual_workspace_for_entire_workspace() {\n    let temp = setup_virtual_workspace();\n    let snapbox = test_runner(&temp);\n\n    let output = snapbox.current_dir(&temp).assert().code(1);\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 6 test(s) from fibonacci_virtual package\n        Running 2 test(s) from src/\n        [PASS] fibonacci_virtual::tests::it_works [..]\n        [PASS] fibonacci_virtual::tests::contract_test [..]\n        Running 4 test(s) from tests/\n        [PASS] fibonacci_virtual_tests::lib_test [..]\n        [PASS] fibonacci_virtual_tests::abc::abc_test [..]\n        [PASS] fibonacci_virtual_tests::abc::efg::efg_test [..]\n        [FAIL] fibonacci_virtual_tests::abc::efg::failing_test\n\n        Failure data:\n            0x0 ('')\n\n        Tests: 5 passed, 1 failed, 0 ignored, 0 filtered out\n\n\n        Collected 5 test(s) from subtraction package\n        Running 1 test(s) from src/\n        [PASS] subtraction::tests::it_works [..]\n        Running 4 test(s) from tests/\n        [PASS] subtraction_integrationtest::nested::simple_case [..]\n        [PASS] subtraction_integrationtest::nested::contract_test [..]\n        [PASS] subtraction_integrationtest::nested::test_nested::test_two [..]\n        [PASS] subtraction_integrationtest::nested::test_nested::test_two_and_two [..]\n        Tests: 5 passed, 0 failed, 0 ignored, 0 filtered out\n\n        Failures:\n            fibonacci_virtual_tests::abc::efg::failing_test\n\n        Tests summary: 10 passed, 1 failed, 0 ignored, 0 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn virtual_workspace_for_entire_workspace_inside_package() {\n    let temp = setup_virtual_workspace();\n    let package_dir = temp.join(PathBuf::from(\"dummy_name/fibonacci_virtual\"));\n\n    let snapbox = test_runner(&temp).arg(\"--workspace\");\n    let output = snapbox.current_dir(package_dir).assert().code(1);\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 6 test(s) from fibonacci_virtual package\n        Running 2 test(s) from src/\n        [PASS] fibonacci_virtual::tests::it_works [..]\n        [PASS] fibonacci_virtual::tests::contract_test [..]\n        Running 4 test(s) from tests/\n        [PASS] fibonacci_virtual_tests::lib_test [..]\n        [PASS] fibonacci_virtual_tests::abc::abc_test [..]\n        [PASS] fibonacci_virtual_tests::abc::efg::efg_test [..]\n        [FAIL] fibonacci_virtual_tests::abc::efg::failing_test\n\n        Failure data:\n            0x0 ('')\n\n        Tests: 5 passed, 1 failed, 0 ignored, 0 filtered out\n\n\n        Collected 5 test(s) from subtraction package\n        Running 1 test(s) from src/\n        [PASS] subtraction::tests::it_works [..]\n        Running 4 test(s) from tests/\n        [PASS] subtraction_integrationtest::nested::simple_case [..]\n        [PASS] subtraction_integrationtest::nested::contract_test [..]\n        [PASS] subtraction_integrationtest::nested::test_nested::test_two [..]\n        [PASS] subtraction_integrationtest::nested::test_nested::test_two_and_two [..]\n        Tests: 5 passed, 0 failed, 0 ignored, 0 filtered out\n\n        Failures:\n            fibonacci_virtual_tests::abc::efg::failing_test\n\n        Tests summary: 10 passed, 1 failed, 0 ignored, 0 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn virtual_workspace_for_entire_workspace_and_specific_package() {\n    let temp = setup_virtual_workspace();\n    let snapbox = test_runner(&temp)\n        .arg(\"--workspace\")\n        .arg(\"--package\")\n        .arg(\"subtraction\");\n\n    let result = snapbox.current_dir(&temp).assert().code(2);\n\n    let stderr = String::from_utf8_lossy(&result.get_output().stderr);\n\n    assert!(stderr.contains(\"the argument '--workspace' cannot be used with '--package <SPEC>'\"));\n}\n\n#[test]\nfn virtual_workspace_missing_package() {\n    let temp = setup_virtual_workspace();\n    let snapbox = test_runner(&temp).arg(\"--package\").arg(\"missing_package\");\n\n    let result = snapbox.current_dir(&temp).assert().code(2);\n\n    let stdout = String::from_utf8_lossy(&result.get_output().stdout);\n\n    assert!(stdout.contains(\"Failed to find any packages matching the specified filter\"));\n}\n\n#[test]\nfn root_workspace_for_entire_workspace_with_filter() {\n    let temp = setup_hello_workspace();\n\n    let output = test_runner(&temp)\n        .args([\"--workspace\", \"simple\"])\n        .assert()\n        .success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 1 test(s) from addition package\n        Running 0 test(s) from src/\n        Running 1 test(s) from tests/\n        [PASS] addition_integrationtest::nested::simple_case [..]\n        Tests: 1 passed, 0 failed, 0 ignored, 4 filtered out\n\n\n        Collected 0 test(s) from fibonacci package\n        Running 0 test(s) from src/\n        Running 0 test(s) from tests/\n        Tests: 0 passed, 0 failed, 0 ignored, 6 filtered out\n\n\n        Collected 1 test(s) from hello_workspaces package\n        Running 1 test(s) from src/\n        [PASS] hello_workspaces::tests::test_simple [..]\n        Running 0 test(s) from tests/\n        Tests: 1 passed, 0 failed, 0 ignored, 2 filtered out\n\n\n        Tests summary: 2 passed, 0 failed, 0 ignored, 12 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn virtual_workspace_for_entire_workspace_with_filter() {\n    let temp = setup_virtual_workspace();\n\n    let output = test_runner(&temp).arg(\"simple\").assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 0 test(s) from fibonacci_virtual package\n        Running 0 test(s) from src/\n        Running 0 test(s) from tests/\n        Tests: 0 passed, 0 failed, 0 ignored, 6 filtered out\n\n\n        Collected 1 test(s) from subtraction package\n        Running 0 test(s) from src/\n        Running 1 test(s) from tests/\n        [PASS] subtraction_integrationtest::nested::simple_case [..]\n        Tests: 1 passed, 0 failed, 0 ignored, 4 filtered out\n\n\n        Tests summary: 1 passed, 0 failed, 0 ignored, 10 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn root_workspace_multiple_package_arguments() {\n    let temp = setup_hello_workspace();\n\n    let result = test_runner(&temp)\n        .args([\"--package\", \"addition\", \"--package\", \"fibonacci\"])\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(\n        result,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 5 test(s) from addition package\n        Running 1 test(s) from src/\n        [PASS] addition::tests::it_works [..]\n        Running 4 test(s) from tests/\n        [PASS] addition_integrationtest::nested::simple_case [..]\n        [PASS] addition_integrationtest::nested::contract_test [..]\n        [PASS] addition_integrationtest::nested::test_nested::test_two [..]\n        [PASS] addition_integrationtest::nested::test_nested::test_two_and_two [..]\n        Tests: 5 passed, 0 failed, 0 ignored, 0 filtered out\n\n\n        Collected 6 test(s) from fibonacci package\n        Running 2 test(s) from src/\n        [PASS] fibonacci::tests::it_works [..]\n        [PASS] fibonacci::tests::contract_test [..]\n        Running 4 test(s) from tests/\n        [PASS] fibonacci_tests::lib_test [..]\n        [PASS] fibonacci_tests::abc::abc_test [..]\n        [PASS] fibonacci_tests::abc::efg::efg_test [..]\n        [FAIL] fibonacci_tests::abc::efg::failing_test\n\n        Failure data:\n            0x0 ('')\n\n        Tests: 5 passed, 1 failed, 0 ignored, 0 filtered out\n\n        Failures:\n            fibonacci_tests::abc::efg::failing_test\n\n        Tests summary: 10 passed, 1 failed, 0 ignored, 0 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn virtual_workspace_multiple_package_arguments() {\n    let temp = setup_virtual_workspace();\n\n    let result = test_runner(&temp)\n        .args([\"--package\", \"fibonacci_virtual\", \"--package\", \"subtraction\"])\n        .assert()\n        .code(1);\n\n    assert_stdout_contains(\n        result,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 6 test(s) from fibonacci_virtual package\n        Running 2 test(s) from src/\n        [PASS] fibonacci_virtual::tests::it_works [..]\n        [PASS] fibonacci_virtual::tests::contract_test [..]\n        Running 4 test(s) from tests/\n        [PASS] fibonacci_virtual_tests::lib_test [..]\n        [PASS] fibonacci_virtual_tests::abc::abc_test [..]\n        [PASS] fibonacci_virtual_tests::abc::efg::efg_test [..]\n        [FAIL] fibonacci_virtual_tests::abc::efg::failing_test\n\n        Failure data:\n            0x0 ('')\n\n        Tests: 5 passed, 1 failed, 0 ignored, 0 filtered out\n\n\n        Collected 5 test(s) from subtraction package\n        Running 1 test(s) from src/\n        [PASS] subtraction::tests::it_works [..]\n        Running 4 test(s) from tests/\n        [PASS] subtraction_integrationtest::nested::simple_case [..]\n        [PASS] subtraction_integrationtest::nested::contract_test [..]\n        [PASS] subtraction_integrationtest::nested::test_nested::test_two [..]\n        [PASS] subtraction_integrationtest::nested::test_nested::test_two_and_two [..]\n        Tests: 5 passed, 0 failed, 0 ignored, 0 filtered out\n\n        Failures:\n            fibonacci_virtual_tests::abc::efg::failing_test\n\n        Tests summary: 10 passed, 1 failed, 0 ignored, 0 filtered out\n        \"},\n    );\n}\n\n#[test]\nfn root_workspace_for_entire_workspace_with_exact() {\n    let temp = setup_hello_workspace();\n\n    let output = test_runner(&temp)\n        .args([\n            \"--workspace\",\n            \"--exact\",\n            \"hello_workspaces::tests::test_simple\",\n        ])\n        .assert()\n        .success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Compiling[..]\n        [..]Finished[..]\n\n\n        Collected 0 test(s) from addition package\n        Running 0 test(s) from src/\n        Running 0 test(s) from tests/\n        Tests: 0 passed, 0 failed, 0 ignored, other filtered out\n        \n        \n        Collected 0 test(s) from fibonacci package\n        Running 0 test(s) from src/\n        Running 0 test(s) from tests/\n        Tests: 0 passed, 0 failed, 0 ignored, other filtered out\n        \n        \n        Collected 1 test(s) from hello_workspaces package\n        Running 1 test(s) from src/\n        [PASS] hello_workspaces::tests::test_simple [..]\n        Running 0 test(s) from tests/\n        Tests: 1 passed, 0 failed, 0 ignored, other filtered out\n        \n\n        Tests summary: 1 passed, 0 failed, 0 ignored, other filtered out\n        \"},\n    );\n}\n\n#[test]\nfn exit_first_stops_execution_after_one_failure_in_workspace() {\n    let temp = setup_hello_workspace();\n\n    let output = test_runner(&temp)\n        .args([\"--workspace\", \"--exit-first\"])\n        .assert()\n        .code(1);\n\n    // Note that the output is not deterministic, so we only assert specific parts of it.\n    // The most important is that there is exactly 1 failed test in the summary.\n    // This test also relies on the execution order of packages, so that\n    // the fibonacci package is executed before the hello_workspaces package.\n    // In general, we don't control it, as the order of execution depends on the order returned by the `scarb metadata` command.\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n            Collected 5 test(s) from addition package\n            Running 1 test(s) from src/\n            Running 4 test(s) from tests/\n\n            Collected 6 test(s) from fibonacci package\n            Running 4 test(s) from tests/\n            Running 2 test(s) from src/\n            [FAIL] fibonacci_tests::abc::efg::failing_test\n            Tests: [..] passed, 1 failed, 0 ignored, 0 filtered out\n\n            Collected 3 test(s) from hello_workspaces package\n            Running 2 test(s) from tests/\n            Running 1 test(s) from src/\n            Tests: 0 passed, 0 failed, 0 ignored, 0 filtered out\n            Interrupted execution of [..] test(s).\n\n            Failures:\n                fibonacci_tests::abc::efg::failing_test\n\n            Tests summary: [..] passed, 1 failed, 0 ignored, 0 filtered out\n            Interrupted execution of [..] test(s).\n        \"},\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/available_gas.rs",
    "content": "use crate::utils::runner::{assert_case_output_contains, assert_failed, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\n\n#[test]\nfn correct_available_gas() {\n    let test = crate::utils::test_case!(indoc!(\n        r\"\n            #[test]\n            #[available_gas(l2_gas: 440000)]\n            fn keccak_cost() {\n                keccak::keccak_u256s_le_inputs(array![1].span());\n            }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn available_gas_exceeded() {\n    let test = crate::utils::test_case!(indoc!(\n        r\"\n            #[test]\n            #[available_gas(l2_gas: 5)]\n            fn keccak_cost() {\n                keccak::keccak_u256s_le_inputs(array![1].span());\n            }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_failed(&result);\n    assert_case_output_contains(\n        &result,\n        \"keccak_cost\",\n        \"Test cost exceeded the available gas. Consumed l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~240000\",\n    );\n}\n\n#[test]\nfn available_gas_fuzzing() {\n    let test = crate::utils::test_case!(indoc!(\n        r\"\n            #[test]\n            #[available_gas(l2_gas: 40000000)]\n            #[fuzzer]\n            fn keccak_cost(x: u256) {\n                keccak::keccak_u256s_le_inputs(array![x].span());\n            }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/builtins.rs",
    "content": "use crate::utils::runner::assert_passed;\nuse crate::utils::running_tests::run_test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\n\n#[test]\nfn builtin_test() {\n    let test = crate::utils::test_case!(indoc!(\n        r\"\n        use core::{\n            pedersen::Pedersen, RangeCheck, integer::Bitwise, ec::EcOp, poseidon::Poseidon,\n            SegmentArena, gas::GasBuiltin, starknet::System\n        };\n        use core::circuit::{RangeCheck96, AddMod, MulMod};\n\n        #[test]\n        fn test_builtins() {\n            core::internal::require_implicit::<Pedersen>();\n            core::internal::require_implicit::<RangeCheck>();\n            core::internal::require_implicit::<Bitwise>();\n            core::internal::require_implicit::<EcOp>();\n            core::internal::require_implicit::<Poseidon>();\n            core::internal::require_implicit::<SegmentArena>();\n            core::internal::require_implicit::<GasBuiltin>();\n            core::internal::require_implicit::<System>();\n            core::internal::require_implicit::<RangeCheck96>();\n            core::internal::require_implicit::<AddMod>();\n            core::internal::require_implicit::<MulMod>();\n        }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/cheat_block_hash.rs",
    "content": "use crate::utils::runner::{Contract, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\nuse std::path::Path;\n\n#[test]\nfn cheat_block_hash_basic() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use starknet::get_block_info;\n            use snforge_std::{ CheatSpan, declare, ContractClassTrait, DeclareResultTrait, cheat_block_hash, start_cheat_block_hash, stop_cheat_block_hash, start_cheat_block_hash_global, stop_cheat_block_hash_global};\n\n            #[starknet::interface]\n            trait ICheatBlockHashChecker<TContractState> {\n                fn get_block_hash(ref self: TContractState, block_number: u64) -> felt252;\n            }\n            fn deploy_cheat_block_hash_checker()  -> ICheatBlockHashCheckerDispatcher {\n                let contract = declare(\"CheatBlockHashChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                ICheatBlockHashCheckerDispatcher { contract_address }\n            }\n\n            const BLOCK_NUMBER: u64 = 123;\n\n            #[test]\n            fn test_cheat_block_hash() {\n                let cheat_block_hash_checker = deploy_cheat_block_hash_checker();\n                let old_block_hash = cheat_block_hash_checker.get_block_hash(BLOCK_NUMBER);\n\n                start_cheat_block_hash(cheat_block_hash_checker.contract_address, BLOCK_NUMBER, 1234);\n\n                let new_block_hash = cheat_block_hash_checker.get_block_hash(BLOCK_NUMBER);\n\n                assert(new_block_hash == 1234, 'Wrong block hash');\n\n                stop_cheat_block_hash(cheat_block_hash_checker.contract_address, BLOCK_NUMBER);\n\n                let new_block_hash = cheat_block_hash_checker.get_block_hash(BLOCK_NUMBER);\n\n                assert(new_block_hash == old_block_hash, 'hash did not change back')\n            }\n\n            #[test]\n            fn cheat_block_hash_multiple() {\n                let contract = declare(\"CheatBlockHashChecker\").unwrap().contract_class();\n\n                let (contract_address1, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let (contract_address2, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n\n                let cheat_block_hash_checker1 = ICheatBlockHashCheckerDispatcher { contract_address: contract_address1 };\n                let cheat_block_hash_checker2 = ICheatBlockHashCheckerDispatcher { contract_address: contract_address2 };\n\n                let old_block_hash1 = cheat_block_hash_checker1.get_block_hash(BLOCK_NUMBER);\n                let old_block_hash2 = cheat_block_hash_checker2.get_block_hash(BLOCK_NUMBER);\n\n                start_cheat_block_hash(cheat_block_hash_checker1.contract_address, BLOCK_NUMBER, 1234);\n                start_cheat_block_hash(cheat_block_hash_checker2.contract_address, BLOCK_NUMBER, 1234);\n\n                let new_block_hash1 = cheat_block_hash_checker1.get_block_hash(BLOCK_NUMBER);\n                let new_block_hash2 = cheat_block_hash_checker2.get_block_hash(BLOCK_NUMBER);\n\n                assert(new_block_hash1 == 1234, 'Wrong block hash #1');\n                assert(new_block_hash2 == 1234, 'Wrong block hash #2');\n\n                stop_cheat_block_hash(cheat_block_hash_checker1.contract_address, BLOCK_NUMBER);\n                stop_cheat_block_hash(cheat_block_hash_checker2.contract_address, BLOCK_NUMBER);\n\n                let new_block_hash1 = cheat_block_hash_checker1.get_block_hash(BLOCK_NUMBER);\n                let new_block_hash2 = cheat_block_hash_checker2.get_block_hash(BLOCK_NUMBER);\n\n                assert(new_block_hash1 == old_block_hash1, 'not stopped #1');\n                assert(new_block_hash2 == old_block_hash2, 'not stopped #2');\n            }\n\n            #[test]\n            fn cheat_block_hash_all_stop_one() {\n                let cheat_block_hash_checker = deploy_cheat_block_hash_checker();\n                let old_block_hash = cheat_block_hash_checker.get_block_hash(BLOCK_NUMBER);\n\n                start_cheat_block_hash_global(BLOCK_NUMBER, 1234);\n\n                let new_block_hash = cheat_block_hash_checker.get_block_hash(BLOCK_NUMBER);\n\n                assert(new_block_hash == 1234, 'Wrong block hash');\n\n                stop_cheat_block_hash(cheat_block_hash_checker.contract_address, BLOCK_NUMBER);\n\n                let new_block_hash = cheat_block_hash_checker.get_block_hash(BLOCK_NUMBER);\n\n                assert(new_block_hash == old_block_hash, 'hash did not change back')\n            }\n\n            #[test]\n            fn cheat_block_hash_all() {\n                let contract = declare(\"CheatBlockHashChecker\").unwrap().contract_class();\n\n                let (contract_address1, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let (contract_address2, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n\n                let cheat_block_hash_checker1 = ICheatBlockHashCheckerDispatcher { contract_address: contract_address1 };\n                let cheat_block_hash_checker2 = ICheatBlockHashCheckerDispatcher { contract_address: contract_address2 };\n\n                let old_block_hash1 = cheat_block_hash_checker1.get_block_hash(BLOCK_NUMBER);\n                let old_block_hash2 = cheat_block_hash_checker2.get_block_hash(BLOCK_NUMBER);\n\n                start_cheat_block_hash_global(BLOCK_NUMBER, 1234);\n\n                let new_block_hash1 = cheat_block_hash_checker1.get_block_hash(BLOCK_NUMBER);\n                let new_block_hash2 = cheat_block_hash_checker2.get_block_hash(BLOCK_NUMBER);\n\n                assert(new_block_hash1 == 1234, 'Wrong block hash #1');\n                assert(new_block_hash2 == 1234, 'Wrong block hash #2');\n\n                stop_cheat_block_hash_global(BLOCK_NUMBER);\n\n                let new_block_hash1 = cheat_block_hash_checker1.get_block_hash(BLOCK_NUMBER);\n                let new_block_hash2 = cheat_block_hash_checker2.get_block_hash(BLOCK_NUMBER);\n\n                assert(new_block_hash1 == old_block_hash1, 'Wrong block hash #1');\n                assert(new_block_hash2 == old_block_hash2, 'Wrong block hash #2');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"CheatBlockHashChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_block_hash_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn cheat_block_hash_complex() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, start_cheat_block_hash, stop_cheat_block_hash, start_cheat_block_hash_global };\n\n            #[starknet::interface]\n            trait ICheatBlockHashChecker<TContractState> {\n                fn get_block_hash(ref self: TContractState, block_number: u64) -> felt252;\n            }\n\n            fn deploy_cheat_block_hash_checker()  -> ICheatBlockHashCheckerDispatcher {\n                let contract = declare(\"CheatBlockHashChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                ICheatBlockHashCheckerDispatcher { contract_address }\n            }\n\n            const BLOCK_NUMBER: u64 = 123;\n\n            #[test]\n            fn cheat_block_hash_complex() {\n                let contract = declare(\"CheatBlockHashChecker\").unwrap().contract_class();\n\n                let (contract_address1, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let (contract_address2, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n\n                let cheat_block_hash_checker1 = ICheatBlockHashCheckerDispatcher { contract_address: contract_address1 };\n                let cheat_block_hash_checker2 = ICheatBlockHashCheckerDispatcher { contract_address: contract_address2 };\n\n                let old_block_hash2 = cheat_block_hash_checker2.get_block_hash(BLOCK_NUMBER);\n\n                start_cheat_block_hash_global(BLOCK_NUMBER, 123);\n\n                let new_block_hash1 = cheat_block_hash_checker1.get_block_hash(BLOCK_NUMBER);\n                let new_block_hash2 = cheat_block_hash_checker2.get_block_hash(BLOCK_NUMBER);\n\n                assert(new_block_hash1 == 123, 'Wrong block hash #1');\n                assert(new_block_hash2 == 123, 'Wrong block hash #2');\n\n                start_cheat_block_hash(cheat_block_hash_checker1.contract_address, BLOCK_NUMBER, 456);\n\n                let new_block_hash1 = cheat_block_hash_checker1.get_block_hash(BLOCK_NUMBER);\n                let new_block_hash2 = cheat_block_hash_checker2.get_block_hash(BLOCK_NUMBER);\n\n                assert(new_block_hash1 == 456, 'Wrong block hash #3');\n                assert(new_block_hash2 == 123, 'Wrong block hash #4');\n\n                start_cheat_block_hash(cheat_block_hash_checker1.contract_address, BLOCK_NUMBER, 789);\n                start_cheat_block_hash(cheat_block_hash_checker2.contract_address, BLOCK_NUMBER, 789);\n\n                let new_block_hash1 = cheat_block_hash_checker1.get_block_hash(BLOCK_NUMBER);\n                let new_block_hash2 = cheat_block_hash_checker2.get_block_hash(BLOCK_NUMBER);\n\n                assert(new_block_hash1 == 789, 'Wrong block hash #5');\n                assert(new_block_hash2 == 789, 'Wrong block hash #6');\n\n                stop_cheat_block_hash(cheat_block_hash_checker2.contract_address, BLOCK_NUMBER);\n\n                let new_block_hash1 = cheat_block_hash_checker1.get_block_hash(BLOCK_NUMBER);\n                let new_block_hash2 = cheat_block_hash_checker2.get_block_hash(BLOCK_NUMBER);\n\n                assert(new_block_hash1 == 789, 'Wrong block hash #7');\n                assert(new_block_hash2 == old_block_hash2, 'Wrong block hash #8');\n            }\n\n        \"#\n        ),\n        Contract::from_code_path(\n            \"CheatBlockHashChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_block_hash_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn cheat_block_hash_with_span() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{ declare, CheatSpan, ContractClassTrait, DeclareResultTrait, cheat_block_hash, stop_cheat_block_hash, test_address};\n            use starknet::SyscallResultTrait;\n\n            #[starknet::interface]\n            trait ICheatBlockHashChecker<TContractState> {\n                fn get_block_hash(ref self: TContractState, block_number: u64) -> felt252;\n            }\n\n            fn deploy_cheat_block_hash_checker()  -> ICheatBlockHashCheckerDispatcher {\n                let contract = declare(\"CheatBlockHashChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                ICheatBlockHashCheckerDispatcher { contract_address }\n            }\n\n            const BLOCK_NUMBER: u64 = 123;\n\n            #[test]\n            fn test_cheat_block_hash_once() {\n                let old_block_hash = get_block_hash(BLOCK_NUMBER);\n                let dispatcher = deploy_cheat_block_hash_checker();\n                let target_block_hash = 123;\n\n                cheat_block_hash(dispatcher.contract_address, BLOCK_NUMBER, target_block_hash, CheatSpan::TargetCalls(1));\n\n                let block_hash = dispatcher.get_block_hash(BLOCK_NUMBER);\n\n                assert_eq!(block_hash, target_block_hash.into());\n\n                let block_hash = dispatcher.get_block_hash(BLOCK_NUMBER);\n\n                assert_eq!(block_hash, old_block_hash.into());\n            }\n            #[test]\n            fn test_cheat_block_hash_twice() {\n                let old_block_hash = get_block_hash(BLOCK_NUMBER);\n                let dispatcher = deploy_cheat_block_hash_checker();\n                let target_block_hash = 123;\n\n                cheat_block_hash(dispatcher.contract_address, BLOCK_NUMBER, target_block_hash, CheatSpan::TargetCalls(2));\n\n                let block_hash = dispatcher.get_block_hash(BLOCK_NUMBER);\n\n                assert_eq!(block_hash, target_block_hash.into());\n\n                let block_hash = dispatcher.get_block_hash(BLOCK_NUMBER);\n\n                assert_eq!(block_hash, target_block_hash.into());\n\n                let block_hash = dispatcher.get_block_hash(BLOCK_NUMBER);\n\n                assert_eq!(block_hash, old_block_hash.into());\n            }\n            #[test]\n            fn test_cheat_block_hash_test_address() {\n                let old_block_hash = get_block_hash(BLOCK_NUMBER);\n                let target_block_hash = 123;\n\n                cheat_block_hash(test_address(), BLOCK_NUMBER, target_block_hash, CheatSpan::TargetCalls(1));\n\n                let block_hash = get_block_hash(BLOCK_NUMBER);\n\n                assert_eq!(block_hash, target_block_hash.into());\n\n                stop_cheat_block_hash(test_address(), BLOCK_NUMBER);\n\n                let block_hash = get_block_hash(BLOCK_NUMBER);\n\n                assert_eq!(block_hash, old_block_hash.into());\n            }\n\n            fn get_block_hash(block_number: u64) -> felt252 {\n                starknet::syscalls::get_block_hash_syscall(block_number).unwrap_syscall()\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"CheatBlockHashChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_block_hash_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/cheat_block_number.rs",
    "content": "use crate::utils::runner::{Contract, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\nuse std::path::Path;\n\n#[test]\nfn cheat_block_number_basic() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use result::ResultTrait;\n            use array::ArrayTrait;\n            use option::OptionTrait;\n            use traits::TryInto;\n            use starknet::ContractAddress;\n            use starknet::Felt252TryIntoContractAddress;\n            use snforge_std::{\n                declare, ContractClassTrait, DeclareResultTrait, start_cheat_block_number,\n                stop_cheat_block_number, stop_cheat_block_number_global, start_cheat_block_number_global\n            };\n\n            #[starknet::interface]\n            trait ICheatBlockNumberChecker<TContractState> {\n                fn get_block_number(ref self: TContractState) -> u64;\n            }\n\n            #[test]\n            fn test_stop_cheat_block_number() {\n                let contract = declare(\"CheatBlockNumberChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = ICheatBlockNumberCheckerDispatcher { contract_address };\n\n                let old_block_number = dispatcher.get_block_number();\n\n                start_cheat_block_number(contract_address, 234);\n\n                let new_block_number = dispatcher.get_block_number();\n                assert(new_block_number == 234, 'Wrong block number');\n\n                stop_cheat_block_number(contract_address);\n\n                let new_block_number = dispatcher.get_block_number();\n                assert(new_block_number == old_block_number, 'Block num did not change back');\n            }\n\n            #[test]\n            fn test_cheat_block_number_multiple() {\n                let contract = declare(\"CheatBlockNumberChecker\").unwrap().contract_class();\n\n                let (contract_address1, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let (contract_address2, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n\n                let cheat_block_number_checker1 = ICheatBlockNumberCheckerDispatcher { contract_address: contract_address1 };\n                let cheat_block_number_checker2 = ICheatBlockNumberCheckerDispatcher { contract_address: contract_address2 };\n\n                let old_block_number2 = cheat_block_number_checker2.get_block_number();\n\n                start_cheat_block_number(cheat_block_number_checker1.contract_address, 123);\n\n                let new_block_number1 = cheat_block_number_checker1.get_block_number();\n                let new_block_number2 = cheat_block_number_checker2.get_block_number();\n\n                assert(new_block_number1 == 123, 'Wrong block number #1');\n                assert(new_block_number2 == old_block_number2, 'Wrong block number #2');\n\n                stop_cheat_block_number(cheat_block_number_checker2.contract_address);\n\n                let new_block_number1 = cheat_block_number_checker1.get_block_number();\n                let new_block_number2 = cheat_block_number_checker2.get_block_number();\n\n                assert(new_block_number1 == 123, 'Wrong block number #1');\n                assert(new_block_number2 == old_block_number2, 'Wrong block number #2');\n            }\n\n            #[test]\n            fn test_cheat_block_number_all() {\n                let contract = declare(\"CheatBlockNumberChecker\").unwrap().contract_class();\n\n                let (contract_address1, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let (contract_address2, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n\n                let cheat_block_number_checker1 = ICheatBlockNumberCheckerDispatcher { contract_address: contract_address1 };\n                let cheat_block_number_checker2 = ICheatBlockNumberCheckerDispatcher { contract_address: contract_address2 };\n\n                let old_block_number1 = cheat_block_number_checker1.get_block_number();\n                let old_block_number2 = cheat_block_number_checker2.get_block_number();\n\n                start_cheat_block_number_global(123);\n\n                let new_block_number1 = cheat_block_number_checker1.get_block_number();\n                let new_block_number2 = cheat_block_number_checker2.get_block_number();\n\n                assert(new_block_number1 == 123, 'Wrong block number #1');\n                assert(new_block_number2 == 123, 'Wrong block number #2');\n\n                stop_cheat_block_number_global();\n\n                let new_block_number1 = cheat_block_number_checker1.get_block_number();\n                let new_block_number2 = cheat_block_number_checker2.get_block_number();\n\n                assert(new_block_number1 == old_block_number1, 'CheatBlockNumber not stopped #1');\n                assert(new_block_number2 == old_block_number2, 'CheatBlockNumber not stopped #2');\n            }\n\n            #[test]\n            fn test_cheat_block_number_all_stop_one() {\n                let contract = declare(\"CheatBlockNumberChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = ICheatBlockNumberCheckerDispatcher { contract_address };\n\n                let old_block_number = dispatcher.get_block_number();\n\n                start_cheat_block_number_global(234);\n\n                let new_block_number = dispatcher.get_block_number();\n                assert(new_block_number == 234, 'Wrong block number');\n\n                stop_cheat_block_number(contract_address);\n\n                let new_block_number = dispatcher.get_block_number();\n                assert(new_block_number == old_block_number, 'Block num did not change back');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"CheatBlockNumberChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_block_number_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn cheat_block_number_complex() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use result::ResultTrait;\n            use array::ArrayTrait;\n            use option::OptionTrait;\n            use traits::TryInto;\n            use starknet::ContractAddress;\n            use starknet::Felt252TryIntoContractAddress;\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, start_cheat_block_number, stop_cheat_block_number, start_cheat_block_number_global, stop_cheat_block_number_global };\n\n            #[starknet::interface]\n            trait ICheatBlockNumberChecker<TContractState> {\n                fn get_block_number(ref self: TContractState) -> u64;\n            }\n\n            fn deploy_cheat_block_number_checker()  -> ICheatBlockNumberCheckerDispatcher {\n                let contract = declare(\"CheatBlockNumberChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                ICheatBlockNumberCheckerDispatcher { contract_address }\n            }\n\n            #[test]\n            fn cheat_block_number_complex() {\n                let contract = declare(\"CheatBlockNumberChecker\").unwrap().contract_class();\n\n                let (contract_address1, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let (contract_address2, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n\n                let cheat_block_number_checker1 = ICheatBlockNumberCheckerDispatcher { contract_address: contract_address1 };\n                let cheat_block_number_checker2 = ICheatBlockNumberCheckerDispatcher { contract_address: contract_address2 };\n\n                let old_block_number2 = cheat_block_number_checker2.get_block_number();\n\n                start_cheat_block_number_global(123);\n\n                let new_block_number1 = cheat_block_number_checker1.get_block_number();\n                let new_block_number2 = cheat_block_number_checker2.get_block_number();\n\n                assert(new_block_number1 == 123, 'Wrong block number #1');\n                assert(new_block_number2 == 123, 'Wrong block number #2');\n\n                start_cheat_block_number(cheat_block_number_checker1.contract_address, 456);\n\n                let new_block_number1 = cheat_block_number_checker1.get_block_number();\n                let new_block_number2 = cheat_block_number_checker2.get_block_number();\n\n                assert(new_block_number1 == 456, 'Wrong block number #3');\n                assert(new_block_number2 == 123, 'Wrong block number #4');\n\n                start_cheat_block_number(cheat_block_number_checker1.contract_address, 789);\n                start_cheat_block_number(cheat_block_number_checker2.contract_address, 789);\n\n                let new_block_number1 = cheat_block_number_checker1.get_block_number();\n                let new_block_number2 = cheat_block_number_checker2.get_block_number();\n\n                assert(new_block_number1 == 789, 'Wrong block number #5');\n                assert(new_block_number2 == 789, 'Wrong block number #6');\n\n                stop_cheat_block_number(cheat_block_number_checker2.contract_address);\n\n                let new_block_number1 = cheat_block_number_checker1.get_block_number();\n                let new_block_number2 = cheat_block_number_checker2.get_block_number();\n\n                assert(new_block_number1 == 789, 'Wrong block number #7');\n                assert(new_block_number2 == old_block_number2, 'Wrong block number #8');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"CheatBlockNumberChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_block_number_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn cheat_block_number_with_span() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use result::ResultTrait;\n            use array::ArrayTrait;\n            use option::OptionTrait;\n            use traits::TryInto;\n            use starknet::ContractAddress;\n            use starknet::Felt252TryIntoContractAddress;\n            use snforge_std::{ test_address, declare, ContractClassTrait, DeclareResultTrait, cheat_block_number, start_cheat_block_number, stop_cheat_block_number, CheatSpan };\n\n            #[starknet::interface]\n            trait ICheatBlockNumberChecker<TContractState> {\n                fn get_block_number(ref self: TContractState) -> felt252;\n            }\n\n            fn deploy_cheat_block_number_checker() -> ICheatBlockNumberCheckerDispatcher {\n                let (contract_address, _) = declare(\"CheatBlockNumberChecker\").unwrap().contract_class().deploy(@ArrayTrait::new()).unwrap();\n                ICheatBlockNumberCheckerDispatcher { contract_address }\n            }\n\n            #[test]\n            fn test_cheat_block_number_once() {\n                let old_block_number = get_block_number();\n\n                let dispatcher = deploy_cheat_block_number_checker();\n\n                let target_block_number = 123;\n\n                cheat_block_number(dispatcher.contract_address, target_block_number, CheatSpan::TargetCalls(1));\n\n                let block_number = dispatcher.get_block_number();\n                assert_eq!(block_number, target_block_number.into());\n\n                let block_number = dispatcher.get_block_number();\n                assert_eq!(block_number, old_block_number.into());\n            }\n\n            #[test]\n            fn test_cheat_block_number_twice() {\n                let old_block_number = get_block_number();\n\n                let dispatcher = deploy_cheat_block_number_checker();\n\n                let target_block_number = 123;\n\n                cheat_block_number(dispatcher.contract_address, target_block_number, CheatSpan::TargetCalls(2));\n\n                let block_number = dispatcher.get_block_number();\n                assert_eq!(block_number, target_block_number.into());\n\n                let block_number = dispatcher.get_block_number();\n                assert_eq!(block_number, target_block_number.into());\n\n                let block_number = dispatcher.get_block_number();\n                assert_eq!(block_number, old_block_number.into());\n            }\n\n            #[test]\n            fn test_cheat_block_number_test_address() {\n                let old_block_number = get_block_number();\n\n                let target_block_number = 123;\n\n                cheat_block_number(test_address(), target_block_number, CheatSpan::TargetCalls(1));\n\n                let block_number = get_block_number();\n                assert_eq!(block_number, target_block_number.into());\n\n                let block_number = get_block_number();\n                assert_eq!(block_number, target_block_number.into());\n\n                stop_cheat_block_number(test_address());\n\n                let block_number = get_block_number();\n                assert_eq!(block_number, old_block_number.into());\n            }\n\n            fn get_block_number() -> u64 {\n                starknet::get_block_info().unbox().block_number\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"CheatBlockNumberChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_block_number_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/cheat_block_timestamp.rs",
    "content": "use crate::utils::runner::{Contract, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\nuse std::path::Path;\n\n#[test]\nfn cheat_block_timestamp_basic() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use result::ResultTrait;\n            use array::ArrayTrait;\n            use option::OptionTrait;\n            use traits::TryInto;\n            use traits::Into;\n            use starknet::ContractAddress;\n            use starknet::Felt252TryIntoContractAddress;\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, start_cheat_block_timestamp, stop_cheat_block_timestamp, start_cheat_block_number, start_cheat_block_timestamp_global, stop_cheat_block_timestamp_global };\n\n            #[starknet::interface]\n            trait ICheatBlockTimestampChecker<TContractState> {\n                fn get_block_timestamp(ref self: TContractState) -> u64;\n                fn get_block_timestamp_and_emit_event(ref self: TContractState) -> u64;\n                fn get_block_timestamp_and_number(ref self: TContractState) -> (u64, u64);\n            }\n\n            fn deploy_cheat_block_timestamp_checker()  -> ICheatBlockTimestampCheckerDispatcher {\n                let contract = declare(\"CheatBlockTimestampChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                ICheatBlockTimestampCheckerDispatcher { contract_address }\n            }\n\n            #[test]\n            fn test_cheat_block_timestamp() {\n                let cheat_block_timestamp_checker = deploy_cheat_block_timestamp_checker();\n\n                let old_block_timestamp = cheat_block_timestamp_checker.get_block_timestamp();\n\n                start_cheat_block_timestamp(cheat_block_timestamp_checker.contract_address, 123);\n\n                let new_block_timestamp = cheat_block_timestamp_checker.get_block_timestamp();\n                assert(new_block_timestamp == 123, 'Wrong block timestamp');\n\n                stop_cheat_block_timestamp(cheat_block_timestamp_checker.contract_address);\n\n                let new_block_timestamp = cheat_block_timestamp_checker.get_block_timestamp();\n                assert(new_block_timestamp == old_block_timestamp, 'Timestamp did not change back')\n            }\n\n            #[test]\n            fn cheat_block_timestamp_all_stop_one() {\n                let cheat_block_timestamp_checker = deploy_cheat_block_timestamp_checker();\n\n                let old_block_timestamp = cheat_block_timestamp_checker.get_block_timestamp();\n\n                start_cheat_block_timestamp_global(123);\n\n                let new_block_timestamp = cheat_block_timestamp_checker.get_block_timestamp();\n                assert(new_block_timestamp == 123, 'Wrong block timestamp');\n\n                stop_cheat_block_timestamp(cheat_block_timestamp_checker.contract_address);\n\n                let new_block_timestamp = cheat_block_timestamp_checker.get_block_timestamp();\n                assert(new_block_timestamp == old_block_timestamp, 'Timestamp did not change back')\n            }\n\n            #[test]\n            fn cheat_block_timestamp_multiple() {\n                let contract = declare(\"CheatBlockTimestampChecker\").unwrap().contract_class();\n\n                let (contract_address1, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let (contract_address2, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n\n                let cheat_block_timestamp_checker1 = ICheatBlockTimestampCheckerDispatcher { contract_address: contract_address1 };\n                let cheat_block_timestamp_checker2 = ICheatBlockTimestampCheckerDispatcher { contract_address: contract_address2 };\n\n                let old_block_timestamp1 = cheat_block_timestamp_checker1.get_block_timestamp();\n                let old_block_timestamp2 = cheat_block_timestamp_checker2.get_block_timestamp();\n\n                start_cheat_block_timestamp(cheat_block_timestamp_checker1.contract_address, 123);\n                start_cheat_block_timestamp(cheat_block_timestamp_checker2.contract_address, 123);\n\n                let new_block_timestamp1 = cheat_block_timestamp_checker1.get_block_timestamp();\n                let new_block_timestamp2 = cheat_block_timestamp_checker2.get_block_timestamp();\n\n                assert(new_block_timestamp1 == 123, 'Wrong block timestamp #1');\n                assert(new_block_timestamp2 == 123, 'Wrong block timestamp #2');\n\n                stop_cheat_block_timestamp(cheat_block_timestamp_checker1.contract_address);\n                stop_cheat_block_timestamp(cheat_block_timestamp_checker2.contract_address);\n\n                let new_block_timestamp1 = cheat_block_timestamp_checker1.get_block_timestamp();\n                let new_block_timestamp2 = cheat_block_timestamp_checker2.get_block_timestamp();\n\n                assert(new_block_timestamp1 == old_block_timestamp1, 'not stopped #1');\n                assert(new_block_timestamp2 == old_block_timestamp2, 'not stopped #2');\n            }\n\n            #[test]\n            fn cheat_block_timestamp_all() {\n                let contract = declare(\"CheatBlockTimestampChecker\").unwrap().contract_class();\n\n                let (contract_address1, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let (contract_address2, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n\n                let cheat_block_timestamp_checker1 = ICheatBlockTimestampCheckerDispatcher { contract_address: contract_address1 };\n                let cheat_block_timestamp_checker2 = ICheatBlockTimestampCheckerDispatcher { contract_address: contract_address2 };\n\n                let old_block_timestamp1 = cheat_block_timestamp_checker1.get_block_timestamp();\n                let old_block_timestamp2 = cheat_block_timestamp_checker2.get_block_timestamp();\n\n                start_cheat_block_timestamp_global(123);\n\n                let new_block_timestamp1 = cheat_block_timestamp_checker1.get_block_timestamp();\n                let new_block_timestamp2 = cheat_block_timestamp_checker2.get_block_timestamp();\n\n                assert(new_block_timestamp1 == 123, 'Wrong block timestamp #1');\n                assert(new_block_timestamp2 == 123, 'Wrong block timestamp #2');\n\n                stop_cheat_block_timestamp_global();\n\n                let new_block_timestamp1 = cheat_block_timestamp_checker1.get_block_timestamp();\n                let new_block_timestamp2 = cheat_block_timestamp_checker2.get_block_timestamp();\n\n                assert(new_block_timestamp1 == old_block_timestamp1, 'Wrong block timestamp #1');\n                assert(new_block_timestamp2 == old_block_timestamp2, 'Wrong block timestamp #2');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"CheatBlockTimestampChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_block_timestamp_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn cheat_block_timestamp_complex() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use result::ResultTrait;\n            use array::ArrayTrait;\n            use option::OptionTrait;\n            use traits::TryInto;\n            use traits::Into;\n            use starknet::ContractAddress;\n            use starknet::Felt252TryIntoContractAddress;\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, start_cheat_block_timestamp, stop_cheat_block_timestamp, start_cheat_block_number, start_cheat_block_timestamp_global };\n\n            #[starknet::interface]\n            trait ICheatBlockTimestampChecker<TContractState> {\n                fn get_block_timestamp(ref self: TContractState) -> u64;\n                fn get_block_timestamp_and_emit_event(ref self: TContractState) -> u64;\n                fn get_block_timestamp_and_number(ref self: TContractState) -> (u64, u64);\n            }\n\n            fn deploy_cheat_block_timestamp_checker()  -> ICheatBlockTimestampCheckerDispatcher {\n                let contract = declare(\"CheatBlockTimestampChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                ICheatBlockTimestampCheckerDispatcher { contract_address }\n            }\n\n            #[test]\n            fn cheat_block_timestamp_complex() {\n                let contract = declare(\"CheatBlockTimestampChecker\").unwrap().contract_class();\n\n                let (contract_address1, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let (contract_address2, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n\n                let cheat_block_timestamp_checker1 = ICheatBlockTimestampCheckerDispatcher { contract_address: contract_address1 };\n                let cheat_block_timestamp_checker2 = ICheatBlockTimestampCheckerDispatcher { contract_address: contract_address2 };\n\n                let old_block_timestamp2 = cheat_block_timestamp_checker2.get_block_timestamp();\n\n                start_cheat_block_timestamp_global(123);\n\n                let new_block_timestamp1 = cheat_block_timestamp_checker1.get_block_timestamp();\n                let new_block_timestamp2 = cheat_block_timestamp_checker2.get_block_timestamp();\n\n                assert(new_block_timestamp1 == 123, 'Wrong block timestamp #1');\n                assert(new_block_timestamp2 == 123, 'Wrong block timestamp #2');\n\n                start_cheat_block_timestamp(cheat_block_timestamp_checker1.contract_address, 456);\n\n                let new_block_timestamp1 = cheat_block_timestamp_checker1.get_block_timestamp();\n                let new_block_timestamp2 = cheat_block_timestamp_checker2.get_block_timestamp();\n\n                assert(new_block_timestamp1 == 456, 'Wrong block timestamp #3');\n                assert(new_block_timestamp2 == 123, 'Wrong block timestamp #4');\n\n                start_cheat_block_timestamp(cheat_block_timestamp_checker1.contract_address, 789);\n                start_cheat_block_timestamp(cheat_block_timestamp_checker2.contract_address, 789);\n\n                let new_block_timestamp1 = cheat_block_timestamp_checker1.get_block_timestamp();\n                let new_block_timestamp2 = cheat_block_timestamp_checker2.get_block_timestamp();\n\n                assert(new_block_timestamp1 == 789, 'Wrong block timestamp #5');\n                assert(new_block_timestamp2 == 789, 'Wrong block timestamp #6');\n\n                stop_cheat_block_timestamp(cheat_block_timestamp_checker2.contract_address);\n\n                let new_block_timestamp1 = cheat_block_timestamp_checker1.get_block_timestamp();\n                let new_block_timestamp2 = cheat_block_timestamp_checker2.get_block_timestamp();\n\n                assert(new_block_timestamp1 == 789, 'Wrong block timestamp #7');\n                assert(new_block_timestamp2 == old_block_timestamp2, 'Wrong block timestamp #8');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"CheatBlockTimestampChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_block_timestamp_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn cheat_block_timestamp_with_span() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use result::ResultTrait;\n            use array::ArrayTrait;\n            use option::OptionTrait;\n            use traits::TryInto;\n            use starknet::ContractAddress;\n            use starknet::Felt252TryIntoContractAddress;\n            use snforge_std::{ test_address, declare, ContractClassTrait, DeclareResultTrait, cheat_block_timestamp, start_cheat_block_timestamp, stop_cheat_block_timestamp, CheatSpan };\n\n            #[starknet::interface]\n            trait ICheatBlockTimestampChecker<TContractState> {\n                fn get_block_timestamp(ref self: TContractState) -> felt252;\n            }\n\n            fn deploy_cheat_block_timestamp_checker() -> ICheatBlockTimestampCheckerDispatcher {\n                let (contract_address, _) = declare(\"CheatBlockTimestampChecker\").unwrap().contract_class().deploy(@ArrayTrait::new()).unwrap();\n                ICheatBlockTimestampCheckerDispatcher { contract_address }\n            }\n\n            #[test]\n            fn test_cheat_block_timestamp_once() {\n                let old_block_timestamp = get_block_timestamp();\n\n                let dispatcher = deploy_cheat_block_timestamp_checker();\n\n                let target_block_timestamp = 123;\n\n                cheat_block_timestamp(dispatcher.contract_address, target_block_timestamp, CheatSpan::TargetCalls(1));\n\n                let block_timestamp = dispatcher.get_block_timestamp();\n                assert_eq!(block_timestamp, target_block_timestamp.into());\n\n                let block_timestamp = dispatcher.get_block_timestamp();\n                assert_eq!(block_timestamp, old_block_timestamp.into());\n            }\n\n            #[test]\n            fn test_cheat_block_timestamp_twice() {\n                let old_block_timestamp = get_block_timestamp();\n\n                let dispatcher = deploy_cheat_block_timestamp_checker();\n\n                let target_block_timestamp = 123;\n\n                cheat_block_timestamp(dispatcher.contract_address, target_block_timestamp, CheatSpan::TargetCalls(2));\n\n                let block_timestamp = dispatcher.get_block_timestamp();\n                assert_eq!(block_timestamp, target_block_timestamp.into());\n\n                let block_timestamp = dispatcher.get_block_timestamp();\n                assert_eq!(block_timestamp, target_block_timestamp.into());\n\n                let block_timestamp = dispatcher.get_block_timestamp();\n                assert_eq!(block_timestamp, old_block_timestamp.into());\n            }\n\n            #[test]\n            fn test_cheat_block_timestamp_test_address() {\n                let old_block_timestamp = get_block_timestamp();\n\n                let target_block_timestamp = 123;\n\n                cheat_block_timestamp(test_address(), target_block_timestamp, CheatSpan::TargetCalls(1));\n\n                let block_timestamp = get_block_timestamp();\n                assert_eq!(block_timestamp, target_block_timestamp.into());\n\n                let block_timestamp = get_block_timestamp();\n                assert_eq!(block_timestamp, target_block_timestamp.into());\n\n                stop_cheat_block_timestamp(test_address());\n\n                let block_timestamp = get_block_timestamp();\n                assert_eq!(block_timestamp, old_block_timestamp.into());\n            }\n\n            fn get_block_timestamp() -> u64 {\n                starknet::get_block_info().unbox().block_timestamp\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"CheatBlockTimestampChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_block_timestamp_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/cheat_caller_address.rs",
    "content": "use crate::utils::runner::{Contract, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\nuse std::path::Path;\n\n#[test]\nfn cheat_caller_address() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use result::ResultTrait;\n            use array::ArrayTrait;\n            use option::OptionTrait;\n            use traits::TryInto;\n            use starknet::ContractAddress;\n            use starknet::Felt252TryIntoContractAddress;\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, start_cheat_caller_address, stop_cheat_caller_address, stop_cheat_caller_address_global, start_cheat_caller_address_global };\n\n            #[starknet::interface]\n            trait ICheatCallerAddressChecker<TContractState> {\n                fn get_caller_address(ref self: TContractState) -> felt252;\n            }\n\n            #[test]\n            fn test_stop_cheat_caller_address() {\n                let contract = declare(\"CheatCallerAddressChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = ICheatCallerAddressCheckerDispatcher { contract_address };\n\n                let target_caller_address: felt252 = 123;\n                let target_caller_address: ContractAddress = target_caller_address.try_into().unwrap();\n\n                let old_caller_address = dispatcher.get_caller_address();\n\n                start_cheat_caller_address(contract_address, target_caller_address);\n\n                let new_caller_address = dispatcher.get_caller_address();\n                assert(new_caller_address == 123, 'Wrong caller address');\n\n                stop_cheat_caller_address(contract_address);\n\n                let new_caller_address = dispatcher.get_caller_address();\n                assert(old_caller_address == new_caller_address, 'Address did not change back');\n            }\n\n            #[test]\n            fn test_cheat_caller_address_all() {\n                let contract = declare(\"CheatCallerAddressChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = ICheatCallerAddressCheckerDispatcher { contract_address };\n\n                let target_caller_address: felt252 = 123;\n                let target_caller_address: ContractAddress = target_caller_address.try_into().unwrap();\n\n                let old_caller_address = dispatcher.get_caller_address();\n\n                start_cheat_caller_address_global(target_caller_address);\n\n                let new_caller_address = dispatcher.get_caller_address();\n                assert(new_caller_address == 123, 'Wrong caller address');\n\n                stop_cheat_caller_address_global();\n\n                let new_caller_address = dispatcher.get_caller_address();\n                assert(new_caller_address == old_caller_address, 'Wrong caller address');\n            }\n\n            #[test]\n            fn test_cheat_caller_address_all_stop_one() {\n                let contract = declare(\"CheatCallerAddressChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = ICheatCallerAddressCheckerDispatcher { contract_address };\n\n                let target_caller_address: felt252 = 123;\n                let target_caller_address: ContractAddress = target_caller_address.try_into().unwrap();\n\n                let old_caller_address = dispatcher.get_caller_address();\n\n                start_cheat_caller_address_global(target_caller_address);\n\n                let new_caller_address = dispatcher.get_caller_address();\n                assert(new_caller_address == 123, 'Wrong caller address');\n\n                stop_cheat_caller_address(contract_address);\n\n                let new_caller_address = dispatcher.get_caller_address();\n                assert(old_caller_address == new_caller_address, 'Address did not change back');\n            }\n\n            #[test]\n            fn test_cheat_caller_address_multiple() {\n                let contract = declare(\"CheatCallerAddressChecker\").unwrap().contract_class();\n\n                let (contract_address1, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let (contract_address2, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n\n                let dispatcher1 = ICheatCallerAddressCheckerDispatcher { contract_address: contract_address1 };\n                let dispatcher2 = ICheatCallerAddressCheckerDispatcher { contract_address: contract_address2 };\n\n                let target_caller_address: felt252 = 123;\n                let target_caller_address: ContractAddress = target_caller_address.try_into().unwrap();\n\n                let old_caller_address1 = dispatcher1.get_caller_address();\n                let old_caller_address2 = dispatcher2.get_caller_address();\n\n                start_cheat_caller_address(contract_address1, target_caller_address);\n                start_cheat_caller_address(contract_address2, target_caller_address);\n\n                let new_caller_address1 = dispatcher1.get_caller_address();\n                let new_caller_address2 = dispatcher2.get_caller_address();\n\n                assert(new_caller_address1 == 123, 'Wrong caller address #1');\n                assert(new_caller_address2 == 123, 'Wrong caller address #2');\n\n                stop_cheat_caller_address(contract_address1);\n                stop_cheat_caller_address(contract_address2);\n\n                let new_caller_address1 = dispatcher1.get_caller_address();\n                let new_caller_address2 = dispatcher2.get_caller_address();\n\n                assert(old_caller_address1 == new_caller_address1, 'Address did not change back #1');\n                assert(old_caller_address2 == new_caller_address2, 'Address did not change back #2');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"CheatCallerAddressChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_caller_address_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn cheat_caller_address_with_span() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use result::ResultTrait;\n            use array::ArrayTrait;\n            use option::OptionTrait;\n            use traits::TryInto;\n            use starknet::ContractAddress;\n            use starknet::Felt252TryIntoContractAddress;\n            use snforge_std::{ test_address, declare, ContractClassTrait, DeclareResultTrait, cheat_caller_address, start_cheat_caller_address, stop_cheat_caller_address, CheatSpan };\n\n            #[starknet::interface]\n            trait ICheatCallerAddressChecker<TContractState> {\n                fn get_caller_address(ref self: TContractState) -> felt252;\n            }\n\n            fn deploy_cheat_caller_address_checker() -> ICheatCallerAddressCheckerDispatcher {\n                let (contract_address, _) = declare(\"CheatCallerAddressChecker\").unwrap().contract_class().deploy(@ArrayTrait::new()).unwrap();\n                ICheatCallerAddressCheckerDispatcher { contract_address }\n            }\n\n            #[test]\n            fn test_cheat_caller_address_once() {\n                let dispatcher = deploy_cheat_caller_address_checker();\n\n                let target_caller_address: ContractAddress = 123.try_into().unwrap();\n\n                cheat_caller_address(dispatcher.contract_address, target_caller_address, CheatSpan::TargetCalls(1));\n\n                let caller_address = dispatcher.get_caller_address();\n                assert(caller_address == target_caller_address.into(), 'Wrong caller address');\n\n                let caller_address = dispatcher.get_caller_address();\n                assert(caller_address == test_address().into(), 'Address did not change back');\n            }\n\n            #[test]\n            fn test_cheat_caller_address_twice() {\n                let dispatcher = deploy_cheat_caller_address_checker();\n\n                let target_caller_address: ContractAddress = 123.try_into().unwrap();\n\n                cheat_caller_address(dispatcher.contract_address, target_caller_address, CheatSpan::TargetCalls(2));\n\n                let caller_address = dispatcher.get_caller_address();\n                assert(caller_address == target_caller_address.into(), 'Wrong caller address');\n\n                let caller_address = dispatcher.get_caller_address();\n                assert(caller_address == target_caller_address.into(), 'Wrong caller address');\n\n                let caller_address = dispatcher.get_caller_address();\n                assert(caller_address == test_address().into(), 'Address did not change back');\n            }\n\n            #[test]\n            fn test_cheat_caller_address_test_address() {\n                let old_caller_address = starknet::get_caller_address();\n\n                let target_caller_address: ContractAddress = 123.try_into().unwrap();\n\n                cheat_caller_address(test_address(), target_caller_address, CheatSpan::TargetCalls(1));\n\n                let caller_address = starknet::get_caller_address();\n                assert(caller_address == target_caller_address, 'Wrong caller address');\n\n                let caller_address = starknet::get_caller_address();\n                assert(caller_address == target_caller_address, 'Wrong caller address');\n\n                stop_cheat_caller_address(test_address());\n\n                let caller_address = starknet::get_caller_address();\n                assert(caller_address == old_caller_address, 'Wrong caller address');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"CheatCallerAddressChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_caller_address_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n/// Verify that a cheat applied to `test_address()` is visible inside a library call made\n/// directly from test code.\n#[test]\nfn cheat_caller_address_direct_library_call_from_test() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use starknet::ContractAddress;\n            use snforge_std::{\n                declare, ContractClassTrait, DeclareResultTrait,\n                start_cheat_caller_address, stop_cheat_caller_address, test_address,\n            };\n\n            #[starknet::interface]\n            trait ICheatCallerAddressChecker<TContractState> {\n                fn get_caller_address(ref self: TContractState) -> felt252;\n            }\n\n            #[test]\n            fn test_cheat_applied_to_test_address_is_visible_in_library_call() {\n                let class_hash = *declare(\"CheatCallerAddressChecker\").unwrap().contract_class().class_hash;\n                let lib_dispatcher = ICheatCallerAddressCheckerLibraryDispatcher { class_hash };\n\n                let original_caller = lib_dispatcher.get_caller_address();\n                assert(original_caller == 0.try_into().unwrap(), 'Caller should be 0');\n\n                let target_caller: ContractAddress = 123.try_into().unwrap();\n                start_cheat_caller_address(test_address(), target_caller);\n\n                let caller = lib_dispatcher.get_caller_address();\n                assert(caller == 123, 'Wrong caller address');\n\n                stop_cheat_caller_address(test_address());\n\n                let caller = lib_dispatcher.get_caller_address();\n                assert(caller == original_caller, 'Caller did not reset');\n            }\n            \"#\n        ),\n        Contract::from_code_path(\n            \"CheatCallerAddressChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_caller_address_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n\n    assert_passed(&result);\n}\n\n/// Verify that a global cheat is visible inside a library call made directly from test code.\n#[test]\nfn cheat_caller_address_global_direct_library_call_from_test() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use starknet::ContractAddress;\n            use snforge_std::{\n                declare, ContractClassTrait, DeclareResultTrait,\n                start_cheat_caller_address_global, stop_cheat_caller_address_global,\n            };\n\n            #[starknet::interface]\n            trait ICheatCallerAddressChecker<TContractState> {\n                fn get_caller_address(ref self: TContractState) -> felt252;\n            }\n\n            #[test]\n            fn test_global_cheat_is_visible_in_library_call() {\n                let class_hash = *declare(\"CheatCallerAddressChecker\").unwrap().contract_class().class_hash;\n                let lib_dispatcher = ICheatCallerAddressCheckerLibraryDispatcher { class_hash };\n\n                let original_caller = lib_dispatcher.get_caller_address();\n                assert(original_caller == 0.try_into().unwrap(), 'Caller should be 0');\n\n                let target_caller: ContractAddress = 456.try_into().unwrap();\n                start_cheat_caller_address_global(target_caller);\n\n                let caller = lib_dispatcher.get_caller_address();\n                assert(caller == 456, 'Wrong caller address');\n\n                stop_cheat_caller_address_global();\n\n                let caller = lib_dispatcher.get_caller_address();\n                assert(caller == original_caller, 'Caller did not reset');\n            }\n            \"#\n        ),\n        Contract::from_code_path(\n            \"CheatCallerAddressChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_caller_address_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n\n    assert_passed(&result);\n}\n\n/// Verify that a cheat applied to `test_address()` is visible when the library call is made\n/// via the raw `library_call_syscall` directly from test code.\n#[test]\nfn cheat_caller_address_via_syscall_from_test() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use starknet::ContractAddress;\n            use starknet::{library_call_syscall, SyscallResultTrait};\n            use snforge_std::{\n                declare, ContractClassTrait, DeclareResultTrait,\n                start_cheat_caller_address, stop_cheat_caller_address, test_address,\n            };\n\n            #[test]\n            fn test_cheat_via_syscall_is_visible_in_library_call() {\n                let class_hash = *declare(\"CheatCallerAddressChecker\").unwrap().contract_class().class_hash;\n\n                let original_caller = *library_call_syscall(\n                    class_hash, selector!(\"get_caller_address\"), array![].span(),\n                ).unwrap_syscall()[0];\n\n                let target_caller: ContractAddress = 123.try_into().unwrap();\n                start_cheat_caller_address(test_address(), target_caller);\n\n                let caller = *library_call_syscall(\n                    class_hash, selector!(\"get_caller_address\"), array![].span(),\n                ).unwrap_syscall()[0];\n                assert(caller == 123, 'Wrong caller address');\n\n                stop_cheat_caller_address(test_address());\n\n                let caller = *library_call_syscall(\n                    class_hash, selector!(\"get_caller_address\"), array![].span(),\n                ).unwrap_syscall()[0];\n                assert(caller == original_caller, 'Caller did not reset');\n            }\n            \"#\n        ),\n        Contract::from_code_path(\n            \"CheatCallerAddressChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_caller_address_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n\n    assert_passed(&result);\n}\n\n/// Verify that a cheat applied to `test_address()` is visible when the library call is made\n/// via the safe library dispatcher directly from test code.\n#[test]\nfn cheat_caller_address_via_safe_dispatcher_from_test() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use starknet::ContractAddress;\n            use snforge_std::{\n                declare, ContractClassTrait, DeclareResultTrait,\n                start_cheat_caller_address, stop_cheat_caller_address, test_address,\n            };\n\n            #[starknet::interface]\n            trait ICheatCallerAddressChecker<TContractState> {\n                fn get_caller_address(ref self: TContractState) -> felt252;\n            }\n\n            #[test]\n            #[feature(\"safe_dispatcher\")]\n            fn test_cheat_via_safe_dispatcher_is_visible_in_library_call() {\n                let class_hash = *declare(\"CheatCallerAddressChecker\").unwrap().contract_class().class_hash;\n                let safe_lib_dispatcher = ICheatCallerAddressCheckerSafeLibraryDispatcher { class_hash };\n\n                let original_caller = safe_lib_dispatcher.get_caller_address().unwrap();\n\n                let target_caller: ContractAddress = 123.try_into().unwrap();\n                start_cheat_caller_address(test_address(), target_caller);\n\n                let caller = safe_lib_dispatcher.get_caller_address().unwrap();\n                assert(caller == 123, 'Wrong caller address');\n\n                stop_cheat_caller_address(test_address());\n\n                let caller = safe_lib_dispatcher.get_caller_address().unwrap();\n                assert(caller == original_caller, 'Caller did not reset');\n            }\n            \"#\n        ),\n        Contract::from_code_path(\n            \"CheatCallerAddressChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_caller_address_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n\n    assert_passed(&result);\n}\n\n/// Verify that a cheat applied to a contract address is visible when that contract internally\n/// makes a library call.\n#[test]\nfn cheat_caller_address_library_call_from_contract() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use starknet::ContractAddress;\n            use snforge_std::{\n                declare, ContractClassTrait, DeclareResultTrait,\n                start_cheat_caller_address, stop_cheat_caller_address, test_address,\n            };\n\n            #[starknet::interface]\n            trait ICheatCallerAddressLibraryCallChecker<TContractState> {\n                fn get_caller_address_via_library_call(\n                    self: @TContractState, class_hash: starknet::ClassHash,\n                ) -> felt252;\n            }\n\n            #[test]\n            fn test_cheat_applied_to_contract_is_visible_in_its_library_call() {\n                let checker_class_hash = *declare(\"CheatCallerAddressChecker\").unwrap().contract_class().class_hash;\n\n                let proxy = declare(\"CheatCallerAddressLibraryCallChecker\").unwrap().contract_class();\n                let (proxy_address, _) = proxy.deploy(@array![]).unwrap();\n                let proxy_dispatcher = ICheatCallerAddressLibraryCallCheckerDispatcher {\n                    contract_address: proxy_address,\n                };\n\n                let target_caller: ContractAddress = 789.try_into().unwrap();\n                start_cheat_caller_address(proxy_address, target_caller);\n\n                let caller = proxy_dispatcher.get_caller_address_via_library_call(checker_class_hash);\n                assert(caller == 789, 'Wrong caller address');\n\n                stop_cheat_caller_address(proxy_address);\n\n                let caller = proxy_dispatcher.get_caller_address_via_library_call(checker_class_hash);\n                assert(caller == test_address().into(), 'Caller did not reset');\n            }\n            \"#\n        ),\n        Contract::from_code_path(\n            \"CheatCallerAddressChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_caller_address_checker.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"CheatCallerAddressLibraryCallChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_caller_address_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/cheat_execution_info.rs",
    "content": "use crate::utils::runner::{Contract, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\nuse std::path::Path;\n\n#[test]\nfn start_and_stop_cheat_transaction_hash_single_attribute() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use result::ResultTrait;\n            use box::BoxTrait;\n            use starknet::info::TxInfo;\n            use serde::Serde;\n            use starknet::ContractAddress;\n            use array::SpanTrait;\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, start_cheat_transaction_hash, start_cheat_transaction_hash_global, stop_cheat_transaction_hash };\n            use starknet::info::v2::ResourceBounds;\n\n            #[starknet::interface]\n            trait ICheatTxInfoChecker<TContractState> {\n                fn get_tx_info(ref self: TContractState) -> starknet::info::v2::TxInfo;\n            }\n\n            #[test]\n            fn start_cheat_transaction_hash_single_attribute() {\n                let contract = declare(\"CheatTxInfoChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = ICheatTxInfoCheckerDispatcher { contract_address };\n\n                let tx_info_before = dispatcher.get_tx_info();\n\n                start_cheat_transaction_hash(contract_address, 421);\n\n                let mut expected_tx_info = tx_info_before;\n                expected_tx_info.transaction_hash = 421;\n\n                assert_tx_info(dispatcher.get_tx_info(), expected_tx_info);\n\n                stop_cheat_transaction_hash(contract_address);\n\n                assert_tx_info(dispatcher.get_tx_info(), tx_info_before);\n            }\n\n            #[test]\n            fn test_cheat_transaction_hash_all_stop_one() {\n                let contract = declare(\"CheatTxInfoChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = ICheatTxInfoCheckerDispatcher { contract_address };\n\n                let tx_info_before = dispatcher.get_tx_info();\n\n                start_cheat_transaction_hash_global(421);\n\n                let mut expected_tx_info = tx_info_before;\n                expected_tx_info.transaction_hash = 421;\n\n                assert_tx_info(dispatcher.get_tx_info(), expected_tx_info);\n\n                stop_cheat_transaction_hash(contract_address);\n\n                assert_tx_info(dispatcher.get_tx_info(), tx_info_before);\n            }\n\n            fn assert_tx_info(tx_info: starknet::info::v2::TxInfo, expected_tx_info: starknet::info::v2::TxInfo) {\n                assert(tx_info.version == expected_tx_info.version, 'Invalid version');\n                assert(tx_info.account_contract_address == expected_tx_info.account_contract_address, 'Invalid account_contract_addr');\n                assert(tx_info.max_fee == expected_tx_info.max_fee, 'Invalid max_fee');\n                assert(tx_info.signature == expected_tx_info.signature, 'Invalid signature');\n                assert(tx_info.transaction_hash == expected_tx_info.transaction_hash, 'Invalid transaction_hash');\n                assert(tx_info.chain_id == expected_tx_info.chain_id, 'Invalid chain_id');\n                assert(tx_info.nonce == expected_tx_info.nonce, 'Invalid nonce');\n\n                let mut resource_bounds = array![];\n                tx_info.resource_bounds.serialize(ref resource_bounds);\n\n                let mut expected_resource_bounds = array![];\n                expected_tx_info.resource_bounds.serialize(ref expected_resource_bounds);\n\n                assert(resource_bounds == expected_resource_bounds, 'Invalid resource bounds');\n\n                assert(tx_info.tip == expected_tx_info.tip, 'Invalid tip');\n                assert(tx_info.paymaster_data == expected_tx_info.paymaster_data, 'Invalid paymaster_data');\n                assert(tx_info.nonce_data_availability_mode == expected_tx_info.nonce_data_availability_mode, 'Invalid nonce_data_av_mode');\n                assert(tx_info.fee_data_availability_mode == expected_tx_info.fee_data_availability_mode, 'Invalid fee_data_av_mode');\n                assert(tx_info.account_deployment_data == expected_tx_info.account_deployment_data, 'Invalid account_deployment_data');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"CheatTxInfoChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_tx_info_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n// TODO(#2765): Test below was intended to test private `ExecutionInfoMock` and `cheat_execution_info`\n#[test]\n#[expect(clippy::too_many_lines)]\nfn start_cheat_execution_info_all_per_contract() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use array::SpanTrait;\n            use option::OptionTrait;\n            use result::ResultTrait;\n            use serde::Serde;\n            use snforge_std::{\n                ContractClassTrait, DeclareResultTrait, declare, start_cheat_account_contract_address,\n                start_cheat_account_deployment_data, start_cheat_chain_id,\n                start_cheat_fee_data_availability_mode, start_cheat_max_fee, start_cheat_nonce,\n                start_cheat_nonce_data_availability_mode, start_cheat_paymaster_data, start_cheat_proof_facts,\n                start_cheat_resource_bounds, start_cheat_signature, start_cheat_tip,\n                start_cheat_transaction_hash, start_cheat_transaction_version,\n            };\n            use starknet::info::TxInfo;\n            use starknet::info::v3::ResourceBounds;\n            use starknet::{ContractAddress, ContractAddressIntoFelt252, Felt252TryIntoContractAddress};\n            use traits::Into;\n\n            #[starknet::interface]\n            trait ICheatTxInfoChecker<TContractState> {\n                fn get_tx_hash(ref self: TContractState) -> felt252;\n                fn get_nonce(ref self: TContractState) -> felt252;\n                fn get_account_contract_address(ref self: TContractState) -> ContractAddress;\n                fn get_signature(ref self: TContractState) -> Span<felt252>;\n                fn get_version(ref self: TContractState) -> felt252;\n                fn get_max_fee(ref self: TContractState) -> u128;\n                fn get_chain_id(ref self: TContractState) -> felt252;\n                fn get_resource_bounds(ref self: TContractState) -> Span<ResourceBounds>;\n                fn get_tip(ref self: TContractState) -> u128;\n                fn get_paymaster_data(ref self: TContractState) -> Span<felt252>;\n                fn get_nonce_data_availability_mode(ref self: TContractState) -> u32;\n                fn get_fee_data_availability_mode(ref self: TContractState) -> u32;\n                fn get_account_deployment_data(ref self: TContractState) -> Span<felt252>;\n                fn get_proof_facts(self: @TContractState) -> Span<felt252>;\n            }\n\n            #[test]\n            fn start_cheat_execution_info_all_attributes_mocked() {\n                let contract = declare(\"CheatTxInfoChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = ICheatTxInfoCheckerDispatcher { contract_address };\n\n                start_cheat_nonce(contract_address, 411);\n                start_cheat_account_contract_address(contract_address, 422.try_into().unwrap());\n                start_cheat_transaction_version(contract_address, 433);\n                start_cheat_transaction_hash(contract_address, 444);\n                start_cheat_chain_id(contract_address, 455);\n                start_cheat_max_fee(contract_address, 466);\n                start_cheat_signature(contract_address, array![477, 478].span());\n                start_cheat_resource_bounds(\n                    contract_address,\n                    array![\n                        ResourceBounds { resource: 55, max_amount: 66, max_price_per_unit: 77 },\n                        ResourceBounds { resource: 111, max_amount: 222, max_price_per_unit: 333 },\n                    ]\n                        .span(),\n                );\n                start_cheat_tip(contract_address, 123);\n                start_cheat_paymaster_data(contract_address, array![22, 33, 44].span());\n                start_cheat_nonce_data_availability_mode(contract_address, 99);\n                start_cheat_fee_data_availability_mode(contract_address, 88);\n                start_cheat_account_deployment_data(contract_address, array![111, 222].span());\n                start_cheat_proof_facts(contract_address, array![19, 38, 57, 76].span());\n\n                let nonce = dispatcher.get_nonce();\n                assert(nonce == 411, 'Invalid nonce');\n\n                let account_contract_address: felt252 = dispatcher.get_account_contract_address().into();\n                assert(account_contract_address == 422, 'Invalid account address');\n\n                let version = dispatcher.get_version();\n                assert(version == 433, 'Invalid version');\n\n                let transaction_hash = dispatcher.get_tx_hash();\n                assert(transaction_hash == 444, 'Invalid tx hash');\n\n                let chain_id = dispatcher.get_chain_id();\n                assert(chain_id == 455, 'Invalid chain_id');\n\n                let max_fee = dispatcher.get_max_fee();\n                assert(max_fee == 466_u128, 'Invalid max_fee');\n\n                let signature = dispatcher.get_signature();\n                assert(signature.len() == 2, 'Invalid signature len');\n                assert(*signature.at(0) == 477, 'Invalid signature el[0]');\n                assert(*signature.at(1) == 478, 'Invalid signature el[1]');\n\n                let resource_bounds = dispatcher.get_resource_bounds();\n                assert(resource_bounds.len() == 2, 'Invalid resource_bounds len');\n                assert(*resource_bounds.at(0).resource == 55, 'Invalid resource_bounds[0][0]');\n                assert(*resource_bounds.at(0).max_amount == 66, 'Invalid resource_bounds[0][1]');\n                assert(*resource_bounds.at(0).max_price_per_unit == 77, 'Invalid resource_bounds[0][2]');\n                assert(*resource_bounds.at(1).resource == 111, 'Invalid resource_bounds[1][0]');\n                assert(*resource_bounds.at(1).max_amount == 222, 'Invalid resource_bounds[1][1]');\n                assert(*resource_bounds.at(1).max_price_per_unit == 333, 'Invalid resource_bounds[1][2]');\n\n                let tip = dispatcher.get_tip();\n                assert(tip == 123, 'Invalid tip');\n\n                let paymaster_data = dispatcher.get_paymaster_data();\n                assert(paymaster_data == array![22, 33, 44].span(), 'Invalid paymaster_data');\n\n                let nonce_data_availability_mode = dispatcher.get_nonce_data_availability_mode();\n                assert(nonce_data_availability_mode == 99, 'Invalid nonce data');\n\n                let fee_data_availability_mode = dispatcher.get_fee_data_availability_mode();\n                assert(fee_data_availability_mode == 88, 'Invalid fee data');\n\n                let account_deployment_data = dispatcher.get_account_deployment_data();\n                assert(account_deployment_data == array![111, 222].span(), 'Invalid account deployment');\n\n                let proof_facts = dispatcher.get_proof_facts();\n                assert(proof_facts == array![19, 38, 57, 76].span(), 'Invalid proof facts');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"CheatTxInfoChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_tx_info_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn start_cheat_transaction_hash_cancel_mock_by_setting_attribute_to_none() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use result::ResultTrait;\n            use box::BoxTrait;\n            use starknet::info::TxInfo;\n            use serde::Serde;\n            use starknet::ContractAddress;\n            use array::SpanTrait;\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, start_cheat_transaction_hash, stop_cheat_transaction_hash, CheatSpan };\n            use starknet::info::v3::ResourceBounds;\n\n            #[starknet::interface]\n            trait ICheatTxInfoChecker<TContractState> {\n                fn get_tx_info_v3(ref self: TContractState) -> starknet::info::v3::TxInfo;\n            }\n\n            #[test]\n            fn start_cheat_transaction_hash_cancel_mock_by_setting_attribute_to_none() {\n                let contract = declare(\"CheatTxInfoChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = ICheatTxInfoCheckerDispatcher { contract_address };\n\n                let tx_info_before_mock = dispatcher.get_tx_info_v3();\n\n                start_cheat_transaction_hash(contract_address, 421);\n\n                let mut expected_tx_info = tx_info_before_mock;\n                expected_tx_info.transaction_hash = 421;\n\n                assert_tx_info(dispatcher.get_tx_info_v3(), expected_tx_info);\n\n                stop_cheat_transaction_hash(contract_address);\n\n                assert_tx_info(dispatcher.get_tx_info_v3(), tx_info_before_mock);\n            }\n\n            fn assert_tx_info(tx_info: starknet::info::v3::TxInfo, expected_tx_info: starknet::info::v3::TxInfo) {\n                assert(tx_info.version == expected_tx_info.version, 'Invalid version');\n                assert(tx_info.account_contract_address == expected_tx_info.account_contract_address, 'Invalid account_contract_addr');\n                assert(tx_info.max_fee == expected_tx_info.max_fee, 'Invalid max_fee');\n                assert(tx_info.signature == expected_tx_info.signature, 'Invalid signature');\n                assert(tx_info.transaction_hash == expected_tx_info.transaction_hash, 'Invalid transaction_hash');\n                assert(tx_info.chain_id == expected_tx_info.chain_id, 'Invalid chain_id');\n                assert(tx_info.nonce == expected_tx_info.nonce, 'Invalid nonce');\n\n                let mut resource_bounds = array![];\n                tx_info.resource_bounds.serialize(ref resource_bounds);\n\n                let mut expected_resource_bounds = array![];\n                expected_tx_info.resource_bounds.serialize(ref expected_resource_bounds);\n\n                assert(resource_bounds == expected_resource_bounds, 'Invalid resource bounds');\n\n                assert(tx_info.tip == expected_tx_info.tip, 'Invalid tip');\n                assert(tx_info.paymaster_data == expected_tx_info.paymaster_data, 'Invalid paymaster_data');\n                assert(tx_info.nonce_data_availability_mode == expected_tx_info.nonce_data_availability_mode, 'Invalid nonce_data_av_mode');\n                assert(tx_info.fee_data_availability_mode == expected_tx_info.fee_data_availability_mode, 'Invalid fee_data_av_mode');\n                assert(tx_info.account_deployment_data == expected_tx_info.account_deployment_data, 'Invalid account_deployment_data');\n                assert(tx_info.proof_facts == expected_tx_info.proof_facts, 'Invalid proof_facts');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"CheatTxInfoChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_tx_info_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn start_cheat_transaction_hash_multiple() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use result::ResultTrait;\n            use option::OptionTrait;\n            use starknet::info::TxInfo;\n            use serde::Serde;\n            use traits::Into;\n            use starknet::ContractAddress;\n            use starknet::ContractAddressIntoFelt252;\n            use array::SpanTrait;\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, start_cheat_transaction_hash, CheatSpan};\n\n            #[starknet::interface]\n            trait ICheatTxInfoChecker<TContractState> {\n                fn get_tx_hash(ref self: TContractState) -> felt252;\n            }\n\n            #[test]\n            fn start_cheat_transaction_hash_multiple() {\n                let contract = declare(\"CheatTxInfoChecker\").unwrap().contract_class();\n\n                let (contract_address_1, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher_1 = ICheatTxInfoCheckerDispatcher { contract_address: contract_address_1 };\n\n                let (contract_address_2, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher_2 = ICheatTxInfoCheckerDispatcher { contract_address: contract_address_2 };\n\n                start_cheat_transaction_hash(contract_address_1, 421);\n                start_cheat_transaction_hash(contract_address_2, 421);\n\n                let transaction_hash = dispatcher_1.get_tx_hash();\n                assert(transaction_hash == 421, 'Invalid tx hash');\n\n                let transaction_hash = dispatcher_2.get_tx_hash();\n                assert(transaction_hash == 421, 'Invalid tx hash');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"CheatTxInfoChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_tx_info_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n// TODO(#2765): Test below was intended to test private `ExecutionInfoMock` and `cheat_execution_info`\n#[test]\n#[expect(clippy::too_many_lines)]\nfn start_cheat_execution_info_all_global() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use array::SpanTrait;\n            use option::OptionTrait;\n            use result::ResultTrait;\n            use serde::Serde;\n            use snforge_std::{\n                ContractClassTrait, DeclareResultTrait, declare, start_cheat_account_contract_address_global,\n                start_cheat_account_deployment_data_global, start_cheat_chain_id_global,\n                start_cheat_fee_data_availability_mode_global, start_cheat_max_fee_global,\n                start_cheat_nonce_data_availability_mode_global, start_cheat_nonce_global,\n                start_cheat_paymaster_data_global, start_cheat_proof_facts_global,\n                start_cheat_resource_bounds_global, start_cheat_signature_global, start_cheat_tip_global,\n                start_cheat_transaction_hash_global, start_cheat_transaction_version_global,\n            };\n            use starknet::info::TxInfo;\n            use starknet::info::v2::ResourceBounds;\n            use starknet::{ContractAddress, ContractAddressIntoFelt252};\n            use traits::Into;\n\n            #[starknet::interface]\n            trait ICheatTxInfoChecker<TContractState> {\n                fn get_tx_hash(self: @TContractState) -> felt252;\n                fn get_nonce(self: @TContractState) -> felt252;\n                fn get_account_contract_address(self: @TContractState) -> ContractAddress;\n                fn get_signature(self: @TContractState) -> Span<felt252>;\n                fn get_version(self: @TContractState) -> felt252;\n                fn get_max_fee(self: @TContractState) -> u128;\n                fn get_chain_id(self: @TContractState) -> felt252;\n                fn get_resource_bounds(self: @TContractState) -> Span<ResourceBounds>;\n                fn get_tip(self: @TContractState) -> u128;\n                fn get_paymaster_data(self: @TContractState) -> Span<felt252>;\n                fn get_nonce_data_availability_mode(self: @TContractState) -> u32;\n                fn get_fee_data_availability_mode(self: @TContractState) -> u32;\n                fn get_account_deployment_data(self: @TContractState) -> Span<felt252>;\n                fn get_proof_facts(self: @TContractState) -> Span<felt252>;\n                fn get_tx_info(self: @TContractState) -> starknet::info::v2::TxInfo;\n                fn get_tx_info_v3(self: @TContractState) -> starknet::info::v3::TxInfo;\n            }\n\n            #[test]\n            fn start_cheat_execution_info_all_one_param() {\n                let contract = declare(\"CheatTxInfoChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = ICheatTxInfoCheckerDispatcher { contract_address };\n\n                start_cheat_transaction_hash_global(421);\n\n                let transaction_hash = dispatcher.get_tx_hash();\n                assert(transaction_hash == 421, 'Invalid tx hash');\n            }\n\n            #[test]\n            fn start_cheat_execution_info_all_multiple_params() {\n                let contract = declare(\"CheatTxInfoChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = ICheatTxInfoCheckerDispatcher { contract_address };\n\n                start_cheat_nonce_global(411);\n                start_cheat_account_contract_address_global(422.try_into().unwrap());\n                start_cheat_transaction_version_global(433);\n                start_cheat_transaction_hash_global(444);\n                start_cheat_chain_id_global(455);\n                start_cheat_max_fee_global(466_u128);\n                start_cheat_signature_global(array![477, 478].span());\n                start_cheat_resource_bounds_global(\n                    array![\n                        ResourceBounds { resource: 55, max_amount: 66, max_price_per_unit: 77 },\n                        ResourceBounds { resource: 111, max_amount: 222, max_price_per_unit: 333 },\n                    ]\n                        .span(),\n                );\n                start_cheat_tip_global(123);\n                start_cheat_paymaster_data_global(array![22, 33, 44].span());\n                start_cheat_nonce_data_availability_mode_global(99);\n                start_cheat_fee_data_availability_mode_global(88);\n                start_cheat_account_deployment_data_global(array![111, 222].span());\n                start_cheat_proof_facts_global(array![999, 1001].span());\n\n                let nonce = dispatcher.get_nonce();\n                assert(nonce == 411, 'Invalid nonce');\n\n                let account_contract_address: felt252 = dispatcher.get_account_contract_address().into();\n                assert(account_contract_address == 422, 'Invalid account address');\n\n                let version = dispatcher.get_version();\n                assert(version == 433, 'Invalid version');\n\n                let transaction_hash = dispatcher.get_tx_hash();\n                assert(transaction_hash == 444, 'Invalid tx hash');\n\n                let chain_id = dispatcher.get_chain_id();\n                assert(chain_id == 455, 'Invalid chain_id');\n\n                let max_fee = dispatcher.get_max_fee();\n                assert(max_fee == 466_u128, 'Invalid max_fee');\n\n                let signature = dispatcher.get_signature();\n                assert(signature.len() == 2, 'Invalid signature len');\n                assert(*signature.at(0) == 477, 'Invalid signature el[0]');\n                assert(*signature.at(1) == 478, 'Invalid signature el[1]');\n\n                let resource_bounds = dispatcher.get_resource_bounds();\n                assert(resource_bounds.len() == 2, 'Invalid resource_bounds len');\n                assert(*resource_bounds.at(0).resource == 55, 'Invalid resource_bounds[0][0]');\n                assert(*resource_bounds.at(0).max_amount == 66, 'Invalid resource_bounds[0][1]');\n                assert(*resource_bounds.at(0).max_price_per_unit == 77, 'Invalid resource_bounds[0][2]');\n                assert(*resource_bounds.at(1).resource == 111, 'Invalid resource_bounds[1][0]');\n                assert(*resource_bounds.at(1).max_amount == 222, 'Invalid resource_bounds[1][1]');\n                assert(*resource_bounds.at(1).max_price_per_unit == 333, 'Invalid resource_bounds[1][2]');\n\n                let tip = dispatcher.get_tip();\n                assert(tip == 123, 'Invalid tip');\n\n                let paymaster_data = dispatcher.get_paymaster_data();\n                assert(paymaster_data == array![22, 33, 44].span(), 'Invalid paymaster_data');\n\n                let nonce_data_availability_mode = dispatcher.get_nonce_data_availability_mode();\n                assert(nonce_data_availability_mode == 99, 'Invalid nonce data');\n\n                let fee_data_availability_mode = dispatcher.get_fee_data_availability_mode();\n                assert(fee_data_availability_mode == 88, 'Invalid fee data');\n\n                let account_deployment_data = dispatcher.get_account_deployment_data();\n                assert(account_deployment_data == array![111, 222].span(), 'Invalid account deployment');\n\n                let proof_facts = dispatcher.get_proof_facts();\n                assert(proof_facts == array![999, 1001].span(), 'Invalid proof facts');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"CheatTxInfoChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_tx_info_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn start_cheat_transaction_hash_complex() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use result::ResultTrait;\n            use option::OptionTrait;\n            use starknet::info::TxInfo;\n            use serde::Serde;\n            use traits::Into;\n            use starknet::ContractAddress;\n            use starknet::ContractAddressIntoFelt252;\n            use array::SpanTrait;\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, start_cheat_transaction_hash, start_cheat_transaction_hash_global, CheatSpan };\n\n            #[starknet::interface]\n            trait ICheatTxInfoChecker<TContractState> {\n                fn get_tx_hash(ref self: TContractState) -> felt252;\n            }\n\n            #[test]\n            fn start_cheat_transaction_hash_complex() {\n                let contract = declare(\"CheatTxInfoChecker\").unwrap().contract_class();\n                let (contract_address_1, _) = contract.deploy(@array![]).unwrap();\n                let (contract_address_2, _) = contract.deploy(@array![]).unwrap();\n\n                let dispatcher_1 = ICheatTxInfoCheckerDispatcher { contract_address: contract_address_1 };\n                let dispatcher_2 = ICheatTxInfoCheckerDispatcher { contract_address: contract_address_2 };\n\n                start_cheat_transaction_hash_global(421);\n\n                let transaction_hash_1 = dispatcher_1.get_tx_hash();\n                let transaction_hash_2 = dispatcher_2.get_tx_hash();\n                assert(transaction_hash_1 == 421, 'Invalid tx hash');\n                assert(transaction_hash_2 == 421, 'Invalid tx hash');\n\n                start_cheat_transaction_hash(contract_address_2, 621);\n\n                let transaction_hash_1 = dispatcher_1.get_tx_hash();\n                let transaction_hash_2 = dispatcher_2.get_tx_hash();\n                assert(transaction_hash_1 == 421, 'Invalid tx hash');\n                assert(transaction_hash_2 == 621, 'Invalid tx hash');\n\n                start_cheat_transaction_hash(contract_address_1, 821);\n                start_cheat_transaction_hash(contract_address_2, 821);\n\n                let transaction_hash_1 = dispatcher_1.get_tx_hash();\n                let transaction_hash_2 = dispatcher_2.get_tx_hash();\n                assert(transaction_hash_1 == 821, 'Invalid tx hash');\n                assert(transaction_hash_2 == 821, 'Invalid tx hash');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"CheatTxInfoChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_tx_info_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn cheat_transaction_hash_with_span() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use result::ResultTrait;\n            use box::BoxTrait;\n            use starknet::info::TxInfo;\n            use serde::Serde;\n            use starknet::ContractAddress;\n            use array::SpanTrait;\n            use snforge_std::{ test_address, declare, ContractClassTrait, DeclareResultTrait, cheat_transaction_hash, stop_cheat_transaction_hash, CheatSpan };\n            use starknet::info::v2::ResourceBounds;\n            use starknet::syscalls::get_execution_info_v2_syscall;\n            use starknet::SyscallResultTrait;\n\n            #[starknet::interface]\n            trait ICheatTxInfoChecker<TContractState> {\n                fn get_tx_info(ref self: TContractState) -> starknet::info::v2::TxInfo;\n            }\n\n            fn deploy_cheat_transaction_hash_checker() -> ICheatTxInfoCheckerDispatcher {\n                let (contract_address, _) = declare(\"CheatTxInfoChecker\").unwrap().contract_class().deploy(@ArrayTrait::new()).unwrap();\n                ICheatTxInfoCheckerDispatcher { contract_address }\n            }\n\n            fn assert_tx_info(tx_info: starknet::info::v2::TxInfo, expected_tx_info: starknet::info::v2::TxInfo) {\n                assert(tx_info.version == expected_tx_info.version, 'Invalid version');\n                assert(tx_info.account_contract_address == expected_tx_info.account_contract_address, 'Invalid account_contract_addr');\n                assert(tx_info.max_fee == expected_tx_info.max_fee, 'Invalid max_fee');\n                assert(tx_info.signature == expected_tx_info.signature, 'Invalid signature');\n                assert(tx_info.transaction_hash == expected_tx_info.transaction_hash, 'Invalid transaction_hash');\n                assert(tx_info.chain_id == expected_tx_info.chain_id, 'Invalid chain_id');\n                assert(tx_info.nonce == expected_tx_info.nonce, 'Invalid nonce');\n\n                let mut resource_bounds = array![];\n                tx_info.resource_bounds.serialize(ref resource_bounds);\n\n                let mut expected_resource_bounds = array![];\n                expected_tx_info.resource_bounds.serialize(ref expected_resource_bounds);\n\n                assert(resource_bounds == expected_resource_bounds, 'Invalid resource bounds');\n\n                assert(tx_info.tip == expected_tx_info.tip, 'Invalid tip');\n                assert(tx_info.paymaster_data == expected_tx_info.paymaster_data, 'Invalid paymaster_data');\n                assert(tx_info.nonce_data_availability_mode == expected_tx_info.nonce_data_availability_mode, 'Invalid nonce_data_av_mode');\n                assert(tx_info.fee_data_availability_mode == expected_tx_info.fee_data_availability_mode, 'Invalid fee_data_av_mode');\n                assert(tx_info.account_deployment_data == expected_tx_info.account_deployment_data, 'Invalid account_deployment_data');\n            }\n\n            #[test]\n            fn test_cheat_transaction_hash_once() {\n                let dispatcher = deploy_cheat_transaction_hash_checker();\n\n                let tx_info_before = dispatcher.get_tx_info();\n\n                cheat_transaction_hash(dispatcher.contract_address, 421, CheatSpan::TargetCalls(1));\n\n                let mut expected_tx_info = tx_info_before;\n                expected_tx_info.transaction_hash = 421;\n\n                assert_tx_info(dispatcher.get_tx_info(), expected_tx_info);\n                assert_tx_info(dispatcher.get_tx_info(), tx_info_before);\n            }\n\n            #[test]\n            fn test_cheat_transaction_hash_twice() {\n                let dispatcher = deploy_cheat_transaction_hash_checker();\n\n                let tx_info_before = dispatcher.get_tx_info();\n\n                cheat_transaction_hash(dispatcher.contract_address, 421, CheatSpan::TargetCalls(2));\n\n                let mut expected_tx_info = tx_info_before;\n                expected_tx_info.transaction_hash = 421;\n\n                assert_tx_info(dispatcher.get_tx_info(), expected_tx_info);\n                assert_tx_info(dispatcher.get_tx_info(), expected_tx_info);\n                assert_tx_info(dispatcher.get_tx_info(), tx_info_before);\n            }\n\n            #[test]\n            fn test_cheat_transaction_hash_test_address() {\n                let tx_info_before = get_execution_info_v2_syscall().unwrap_syscall().unbox().tx_info.unbox();\n\n                cheat_transaction_hash(test_address(), 421,CheatSpan::TargetCalls(1) );\n\n                let mut expected_tx_info = tx_info_before;\n                expected_tx_info.transaction_hash = 421;\n\n                let tx_info = get_execution_info_v2_syscall().unwrap_syscall().unbox().tx_info.unbox();\n                assert_tx_info(tx_info, expected_tx_info);\n\n                stop_cheat_transaction_hash(test_address());\n\n                let tx_info = get_execution_info_v2_syscall().unwrap_syscall().unbox().tx_info.unbox();\n                assert_tx_info(tx_info, tx_info_before);\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"CheatTxInfoChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_tx_info_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n/// Verify that `block_number`, `block_timestamp`, `sequencer_address` and `transaction_hash` cheats\n/// applied to `test_address()` are visible inside library calls made directly from test code.\n#[test]\n#[allow(clippy::too_many_lines)]\nfn cheat_execution_info_direct_library_call_from_test() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use starknet::ContractAddress;\n            use snforge_std::{\n                declare, ContractClassTrait, DeclareResultTrait, test_address,\n                start_cheat_block_number, stop_cheat_block_number,\n                start_cheat_block_timestamp, stop_cheat_block_timestamp,\n                start_cheat_sequencer_address, stop_cheat_sequencer_address,\n                start_cheat_transaction_hash, stop_cheat_transaction_hash,\n            };\n\n            #[starknet::interface]\n            trait ICheatBlockNumberChecker<TContractState> {\n                fn get_block_number(ref self: TContractState) -> u64;\n            }\n\n            #[starknet::interface]\n            trait ICheatBlockTimestampChecker<TContractState> {\n                fn get_block_timestamp(ref self: TContractState) -> u64;\n            }\n\n            #[starknet::interface]\n            trait ICheatSequencerAddressChecker<TContractState> {\n                fn get_sequencer_address(ref self: TContractState) -> ContractAddress;\n            }\n\n            #[starknet::interface]\n            trait ICheatTxInfoChecker<TContractState> {\n                fn get_tx_hash(self: @TContractState) -> felt252;\n            }\n\n            #[test]\n            fn test_cheat_block_number_direct_library_call_from_test() {\n                let class_hash = *declare(\"CheatBlockNumberChecker\").unwrap().contract_class().class_hash;\n                let lib_dispatcher = ICheatBlockNumberCheckerLibraryDispatcher { class_hash };\n\n                let original = lib_dispatcher.get_block_number();\n\n                start_cheat_block_number(test_address(), 1234_u64);\n\n                let cheated = lib_dispatcher.get_block_number();\n                assert(cheated == 1234, 'Wrong block number');\n\n                stop_cheat_block_number(test_address());\n\n                let restored = lib_dispatcher.get_block_number();\n                assert(restored == original, 'Block number not restored');\n            }\n\n            #[test]\n            fn test_cheat_block_timestamp_direct_library_call_from_test() {\n                let class_hash = *declare(\"CheatBlockTimestampChecker\").unwrap().contract_class().class_hash;\n                let lib_dispatcher = ICheatBlockTimestampCheckerLibraryDispatcher { class_hash };\n\n                let original = lib_dispatcher.get_block_timestamp();\n\n                start_cheat_block_timestamp(test_address(), 9999_u64);\n\n                let cheated = lib_dispatcher.get_block_timestamp();\n                assert(cheated == 9999, 'Wrong block timestamp');\n\n                stop_cheat_block_timestamp(test_address());\n\n                let restored = lib_dispatcher.get_block_timestamp();\n                assert(restored == original, 'Block timestamp not restored');\n            }\n\n            #[test]\n            fn test_cheat_sequencer_address_direct_library_call_from_test() {\n                let class_hash = *declare(\"CheatSequencerAddressChecker\").unwrap().contract_class().class_hash;\n                let lib_dispatcher = ICheatSequencerAddressCheckerLibraryDispatcher { class_hash };\n\n                let original = lib_dispatcher.get_sequencer_address();\n\n                let target_sequencer: ContractAddress = 42.try_into().unwrap();\n                start_cheat_sequencer_address(test_address(), target_sequencer);\n\n                let cheated = lib_dispatcher.get_sequencer_address();\n                assert(cheated == target_sequencer, 'Wrong sequencer address');\n\n                stop_cheat_sequencer_address(test_address());\n\n                let restored = lib_dispatcher.get_sequencer_address();\n                assert(restored == original, 'Sequencer address not restored');\n            }\n\n            #[test]\n            fn test_cheat_transaction_hash_direct_library_call_from_test() {\n                let class_hash = *declare(\"CheatTxInfoChecker\").unwrap().contract_class().class_hash;\n                let lib_dispatcher = ICheatTxInfoCheckerLibraryDispatcher { class_hash };\n\n                let original = lib_dispatcher.get_tx_hash();\n\n                start_cheat_transaction_hash(test_address(), 0xdeadbeef);\n\n                let cheated = lib_dispatcher.get_tx_hash();\n                assert(cheated == 0xdeadbeef, 'Wrong tx hash');\n\n                stop_cheat_transaction_hash(test_address());\n\n                let restored = lib_dispatcher.get_tx_hash();\n                assert(restored == original, 'Tx hash not restored');\n            }\n            \"#\n        ),\n        Contract::from_code_path(\n            \"CheatBlockNumberChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_block_number_checker.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"CheatBlockTimestampChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_block_timestamp_checker.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"CheatSequencerAddressChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_sequencer_address_checker.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"CheatTxInfoChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_tx_info_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n\n    assert_passed(&result);\n}\n\n/// Verify that cheats applied to a contract address are visible when that contract internally\n/// makes library calls. Tests `block_number`, `block_timestamp`, `sequencer_address` and `tx_hash`.\n#[test]\n#[allow(clippy::too_many_lines)]\nfn cheat_execution_info_library_call_from_contract() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use starknet::ContractAddress;\n            use snforge_std::{\n                declare, ContractClassTrait, DeclareResultTrait, test_address,\n                start_cheat_block_number, stop_cheat_block_number,\n                start_cheat_block_timestamp, stop_cheat_block_timestamp,\n                start_cheat_sequencer_address, stop_cheat_sequencer_address,\n                start_cheat_transaction_hash, stop_cheat_transaction_hash,\n            };\n\n            #[starknet::interface]\n            trait ICheatExecutionInfoLibraryCallChecker<TContractState> {\n                fn get_block_number_via_library_call(\n                    ref self: TContractState, class_hash: starknet::ClassHash,\n                ) -> u64;\n                fn get_block_timestamp_via_library_call(\n                    ref self: TContractState, class_hash: starknet::ClassHash,\n                ) -> u64;\n                fn get_sequencer_address_via_library_call(\n                    ref self: TContractState, class_hash: starknet::ClassHash,\n                ) -> ContractAddress;\n                fn get_tx_hash_via_library_call(\n                    self: @TContractState, class_hash: starknet::ClassHash,\n                ) -> felt252;\n            }\n\n            fn deploy_proxy() -> (ICheatExecutionInfoLibraryCallCheckerDispatcher, ContractAddress) {\n                let proxy = declare(\"CheatExecutionInfoLibraryCallChecker\").unwrap().contract_class();\n                let (proxy_address, _) = proxy.deploy(@array![]).unwrap();\n                (ICheatExecutionInfoLibraryCallCheckerDispatcher { contract_address: proxy_address }, proxy_address)\n            }\n\n            #[test]\n            fn test_cheat_block_number_library_call_from_contract() {\n                let block_number_class_hash = *declare(\"CheatBlockNumberChecker\").unwrap().contract_class().class_hash;\n                let (proxy, proxy_address) = deploy_proxy();\n\n                let original = proxy.get_block_number_via_library_call(block_number_class_hash);\n\n                start_cheat_block_number(proxy_address, 5678_u64);\n\n                let cheated = proxy.get_block_number_via_library_call(block_number_class_hash);\n                assert(cheated == 5678, 'Wrong block number');\n\n                stop_cheat_block_number(proxy_address);\n\n                let restored = proxy.get_block_number_via_library_call(block_number_class_hash);\n                assert(restored == original, 'Block number not restored');\n            }\n\n            #[test]\n            fn test_cheat_block_timestamp_library_call_from_contract() {\n                let class_hash = *declare(\"CheatBlockTimestampChecker\").unwrap().contract_class().class_hash;\n                let (proxy, proxy_address) = deploy_proxy();\n\n                let original = proxy.get_block_timestamp_via_library_call(class_hash);\n\n                start_cheat_block_timestamp(proxy_address, 7777_u64);\n\n                let cheated = proxy.get_block_timestamp_via_library_call(class_hash);\n                assert(cheated == 7777, 'Wrong block timestamp');\n\n                stop_cheat_block_timestamp(proxy_address);\n\n                let restored = proxy.get_block_timestamp_via_library_call(class_hash);\n                assert(restored == original, 'Block timestamp not restored');\n            }\n\n            #[test]\n            fn test_cheat_sequencer_address_library_call_from_contract() {\n                let class_hash = *declare(\"CheatSequencerAddressChecker\").unwrap().contract_class().class_hash;\n                let (proxy, proxy_address) = deploy_proxy();\n\n                let original = proxy.get_sequencer_address_via_library_call(class_hash);\n\n                let target_sequencer: ContractAddress = 99.try_into().unwrap();\n                start_cheat_sequencer_address(proxy_address, target_sequencer);\n\n                let cheated = proxy.get_sequencer_address_via_library_call(class_hash);\n                assert(cheated == target_sequencer, 'Wrong sequencer address');\n\n                stop_cheat_sequencer_address(proxy_address);\n\n                let restored = proxy.get_sequencer_address_via_library_call(class_hash);\n                assert(restored == original, 'Sequencer address not restored');\n            }\n\n            #[test]\n            fn test_cheat_transaction_hash_library_call_from_contract() {\n                let class_hash = *declare(\"CheatTxInfoChecker\").unwrap().contract_class().class_hash;\n                let (proxy, proxy_address) = deploy_proxy();\n\n                let original = proxy.get_tx_hash_via_library_call(class_hash);\n\n                start_cheat_transaction_hash(proxy_address, 0xcafebabe);\n\n                let cheated = proxy.get_tx_hash_via_library_call(class_hash);\n                assert(cheated == 0xcafebabe, 'Wrong tx hash');\n\n                stop_cheat_transaction_hash(proxy_address);\n\n                let restored = proxy.get_tx_hash_via_library_call(class_hash);\n                assert(restored == original, 'Tx hash not restored');\n            }\n            \"#\n        ),\n        Contract::from_code_path(\n            \"CheatBlockNumberChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_block_number_checker.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"CheatBlockTimestampChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_block_timestamp_checker.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"CheatSequencerAddressChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_sequencer_address_checker.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"CheatTxInfoChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_tx_info_checker.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"CheatExecutionInfoLibraryCallChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_tx_info_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/cheat_fork.rs",
    "content": "use crate::utils::runner::assert_passed;\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::formatdoc;\nuse shared::test_utils::node_url::node_rpc_url;\n\n#[test]\nfn cheat_caller_address_cairo0_contract() {\n    let test = test_case!(formatdoc!(\n        r#\"\n            use starknet::{{class_hash::Felt252TryIntoClassHash, SyscallResultTrait}};\n            use snforge_std::{{start_cheat_caller_address, stop_cheat_caller_address, test_address}};\n\n            const CAIRO0_CLASS_HASH: felt252 = 0x029c0caff0aef71bd089d58b25bcc5c23458d080b2d1b75e423de86f95176818;\n            const LIB_CALL_SELECTOR: felt252 = 219972792400094465318120350250971259539342451068659710037080072200128459645;\n\n            #[test]\n            #[fork(url: \"{}\", block_number: 54060)]\n            fn cheat_caller_address_cairo0_contract() {{\n                let caller = starknet::library_call_syscall(\n                    CAIRO0_CLASS_HASH.try_into().unwrap(),\n                    LIB_CALL_SELECTOR,\n                    array![].span(),\n                ).unwrap_syscall()[0];\n\n                start_cheat_caller_address(test_address(), 123.try_into().unwrap());\n\n                let cheated_caller_address = starknet::library_call_syscall(\n                    CAIRO0_CLASS_HASH.try_into().unwrap(),\n                    LIB_CALL_SELECTOR,\n                    array![].span(),\n                ).unwrap_syscall()[0];\n\n                stop_cheat_caller_address(test_address());\n\n                let uncheated_caller_address = starknet::library_call_syscall(\n                    CAIRO0_CLASS_HASH.try_into().unwrap(),\n                    LIB_CALL_SELECTOR,\n                    array![].span(),\n                ).unwrap_syscall()[0];\n\n                assert(*cheated_caller_address == 123, 'does not work');\n                assert(uncheated_caller_address == caller, 'does not work');\n            }}\n        \"#,\n        node_rpc_url(),\n    )\n    .as_str());\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn cheat_block_number_cairo0_contract() {\n    let test = test_case!(formatdoc!(\n        r#\"\n            use starknet::{{class_hash::Felt252TryIntoClassHash, SyscallResultTrait}};\n            use snforge_std::{{start_cheat_block_number, stop_cheat_block_number, test_address}};\n\n            const CAIRO0_CLASS_HASH: felt252 = 0x029c0caff0aef71bd089d58b25bcc5c23458d080b2d1b75e423de86f95176818;\n            const LIB_CALL_SELECTOR: felt252 = 1043360521069001059812816533306435120284814797591254795559962622467917544215;\n\n            #[test]\n            #[fork(url: \"{}\", block_number: 54060)]\n            fn cheat_block_number_cairo0_contract() {{\n                let block_number = starknet::library_call_syscall(\n                    CAIRO0_CLASS_HASH.try_into().unwrap(),\n                    LIB_CALL_SELECTOR,\n                    array![].span(),\n                ).unwrap_syscall()[0];\n\n                start_cheat_block_number(test_address(), 123);\n\n                let cheated_block_number = starknet::library_call_syscall(\n                    CAIRO0_CLASS_HASH.try_into().unwrap(),\n                    LIB_CALL_SELECTOR,\n                    array![].span(),\n                ).unwrap_syscall()[0];\n\n                stop_cheat_block_number(test_address());\n\n                let uncheated_block_number = starknet::library_call_syscall(\n                    CAIRO0_CLASS_HASH.try_into().unwrap(),\n                    LIB_CALL_SELECTOR,\n                    array![].span(),\n                ).unwrap_syscall()[0];\n\n                assert(*cheated_block_number == 123, 'does not work');\n                assert(uncheated_block_number == block_number, 'does not work');\n            }}\n        \"#,\n        node_rpc_url(),\n    )\n    .as_str());\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn cheat_block_timestamp_cairo0_contract() {\n    let test = test_case!(formatdoc!(\n        r#\"\n            use starknet::{{class_hash::Felt252TryIntoClassHash, SyscallResultTrait}};\n            use snforge_std::{{start_cheat_block_timestamp, stop_cheat_block_timestamp, test_address}};\n\n            const CAIRO0_CLASS_HASH: felt252 = 0x029c0caff0aef71bd089d58b25bcc5c23458d080b2d1b75e423de86f95176818;\n            const LIB_CALL_SELECTOR: felt252 = 1104673410415683966349700971986586038248888383055081852378797598061780438342;\n\n            #[test]\n            #[fork(url: \"{}\", block_number: 54060)]\n            fn cheat_block_timestamp_cairo0_contract() {{\n                let block_timestamp = starknet::library_call_syscall(\n                    CAIRO0_CLASS_HASH.try_into().unwrap(),\n                    LIB_CALL_SELECTOR,\n                    array![].span(),\n                ).unwrap_syscall()[0];\n\n                start_cheat_block_timestamp(\n                    test_address(), 123\n                );\n\n                let cheated_block_timestamp = starknet::library_call_syscall(\n                    CAIRO0_CLASS_HASH.try_into().unwrap(),\n                    LIB_CALL_SELECTOR,\n                    array![].span(),\n                ).unwrap_syscall()[0];\n\n                stop_cheat_block_timestamp(test_address());\n\n                let uncheated_block_timestamp = starknet::library_call_syscall(\n                    CAIRO0_CLASS_HASH.try_into().unwrap(),\n                    LIB_CALL_SELECTOR,\n                    array![].span(),\n                ).unwrap_syscall()[0];\n\n                assert(*cheated_block_timestamp == 123, 'does not work');\n                assert(uncheated_block_timestamp == block_timestamp, 'does not work');\n            }}\n        \"#,\n        node_rpc_url(),\n    )\n    .as_str());\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn mock_call_cairo0_contract() {\n    let test = test_case!(\n        formatdoc!(\n            r#\"\n            use starknet::{{contract_address_const}};\n            use snforge_std::{{start_mock_call, stop_mock_call}};\n\n            #[starknet::interface]\n            trait IERC20<TContractState> {{\n                fn name(self: @TContractState) -> felt252;\n            }}\n\n            #[test]\n            #[fork(url: \"{}\", block_number: 54060)]\n            fn mock_call_cairo0_contract() {{\n                let eth_dispatcher = IERC20Dispatcher {{\n                    contract_address: contract_address_const::<\n                        0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7\n                    >()\n                }};\n\n                assert(eth_dispatcher.name() == 'Ether', 'invalid name');\n\n                start_mock_call(eth_dispatcher.contract_address, selector!(\"name\"), 'NotEther');\n\n                assert(eth_dispatcher.name() == 'NotEther', 'invalid mocked name');\n\n                stop_mock_call(eth_dispatcher.contract_address, selector!(\"name\"));\n\n                assert(eth_dispatcher.name() == 'Ether', 'invalid name after mock');\n            }}\n        \"#,\n            node_rpc_url(),\n        )\n        .as_str()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn store_load_cairo0_contract() {\n    let test = test_case!(formatdoc!(\n        r#\"\n            use starknet::{{contract_address_const}};\n            use snforge_std::{{store, load}};\n\n            #[starknet::interface]\n            trait IERC20<TContractState> {{\n                fn name(self: @TContractState) -> felt252;\n            }}\n\n            #[test]\n            #[fork(url: \"{}\", block_number: 54060)]\n            fn mock_call_cairo0_contract() {{\n                let eth_dispatcher = IERC20Dispatcher {{\n                    contract_address: contract_address_const::<\n                        0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7\n                    >()\n                }};\n\n                assert(eth_dispatcher.name() == 'Ether', 'invalid name');\n\n                let name = load(eth_dispatcher.contract_address, selector!(\"ERC20_name\"), 1);\n\n                assert(name == array!['Ether'], 'invalid load value');\n\n                store(eth_dispatcher.contract_address, selector!(\"ERC20_name\"), array!['NotEther'].span());\n\n                assert(eth_dispatcher.name() == 'NotEther', 'invalid store name');\n                \n                let name = load(eth_dispatcher.contract_address, selector!(\"ERC20_name\"), 1);\n                \n                assert(name == array!['NotEther'], 'invalid load2 name');\n            }}\n        \"#,\n        node_rpc_url(),\n    )\n    .as_str());\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/cheat_sequencer_address.rs",
    "content": "use crate::utils::runner::{Contract, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\nuse std::path::Path;\n\n#[test]\nfn cheat_sequencer_address_basic() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use result::ResultTrait;\n            use array::ArrayTrait;\n            use option::OptionTrait;\n            use traits::TryInto;\n            use starknet::ContractAddress;\n            use starknet::Felt252TryIntoContractAddress;\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, start_cheat_sequencer_address, start_cheat_sequencer_address_global, stop_cheat_sequencer_address_global, stop_cheat_sequencer_address };\n\n            #[starknet::interface]\n            trait ICheatSequencerAddressChecker<TContractState> {\n                fn get_sequencer_address(ref self: TContractState) -> ContractAddress;\n            }\n\n            #[test]\n            fn test_stop_cheat_sequencer_address() {\n                let contract = declare(\"CheatSequencerAddressChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = ICheatSequencerAddressCheckerDispatcher { contract_address };\n\n                let old_sequencer_address = dispatcher.get_sequencer_address();\n\n                start_cheat_sequencer_address(contract_address, 234.try_into().unwrap());\n\n                let new_sequencer_address = dispatcher.get_sequencer_address();\n                assert(new_sequencer_address == 234.try_into().unwrap(), 'Wrong sequencer address');\n\n                stop_cheat_sequencer_address(contract_address);\n\n                let new_sequencer_address = dispatcher.get_sequencer_address();\n                assert(new_sequencer_address == old_sequencer_address, 'Sequencer addr did not revert');\n            }\n\n            #[test]\n            fn test_cheat_sequencer_address_multiple() {\n                let contract = declare(\"CheatSequencerAddressChecker\").unwrap().contract_class();\n\n                let (contract_address1, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let (contract_address2, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n\n                let cheat_sequencer_address_checker1 = ICheatSequencerAddressCheckerDispatcher { contract_address: contract_address1 };\n                let cheat_sequencer_address_checker2 = ICheatSequencerAddressCheckerDispatcher { contract_address: contract_address2 };\n\n                let old_seq_addr1 = cheat_sequencer_address_checker1.get_sequencer_address();\n                let old_seq_addr2 = cheat_sequencer_address_checker2.get_sequencer_address();\n\n                start_cheat_sequencer_address(cheat_sequencer_address_checker1.contract_address, 123.try_into().unwrap());\n                start_cheat_sequencer_address(cheat_sequencer_address_checker2.contract_address, 123.try_into().unwrap());\n\n                let new_seq_addr1 = cheat_sequencer_address_checker1.get_sequencer_address();\n                let new_seq_addr2 = cheat_sequencer_address_checker2.get_sequencer_address();\n\n                assert(new_seq_addr1 == 123.try_into().unwrap(), 'Wrong seq addr #1');\n                assert(new_seq_addr2 == 123.try_into().unwrap(), 'Wrong seq addr #2');\n\n                stop_cheat_sequencer_address(cheat_sequencer_address_checker1.contract_address);\n                stop_cheat_sequencer_address(cheat_sequencer_address_checker2.contract_address);\n\n                let new_seq_addr1 = cheat_sequencer_address_checker1.get_sequencer_address();\n                let new_seq_addr2 = cheat_sequencer_address_checker2.get_sequencer_address();\n\n                assert(new_seq_addr1 == old_seq_addr1, 'not stopped #1');\n                assert(new_seq_addr2 == old_seq_addr2, 'not stopped #2');\n            }\n            #[test]\n            fn test_cheat_sequencer_address_all() {\n                let contract = declare(\"CheatSequencerAddressChecker\").unwrap().contract_class();\n\n                let (contract_address1, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let (contract_address2, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n\n                let cheat_sequencer_address_checker1 = ICheatSequencerAddressCheckerDispatcher { contract_address: contract_address1 };\n                let cheat_sequencer_address_checker2 = ICheatSequencerAddressCheckerDispatcher { contract_address: contract_address2 };\n\n                let old_seq_addr1 = cheat_sequencer_address_checker1.get_sequencer_address();\n                let old_seq_addr2 = cheat_sequencer_address_checker2.get_sequencer_address();\n\n                start_cheat_sequencer_address_global(123.try_into().unwrap());\n\n                let new_seq_addr1 = cheat_sequencer_address_checker1.get_sequencer_address();\n                let new_seq_addr2 = cheat_sequencer_address_checker2.get_sequencer_address();\n\n                assert(new_seq_addr1 == 123.try_into().unwrap(), 'Wrong seq addr #1');\n                assert(new_seq_addr2 == 123.try_into().unwrap(), 'Wrong seq addr #2');\n\n                stop_cheat_sequencer_address_global();\n\n                let new_seq_addr1 = cheat_sequencer_address_checker1.get_sequencer_address();\n                let new_seq_addr2 = cheat_sequencer_address_checker2.get_sequencer_address();\n\n                assert(new_seq_addr1 == old_seq_addr1, 'Wrong seq addr #1');\n                assert(new_seq_addr2 == old_seq_addr2, 'Wrong seq addr #2');\n            }\n\n            #[test]\n            fn test_cheat_sequencer_address_all_stop_one() {\n                let contract = declare(\"CheatSequencerAddressChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = ICheatSequencerAddressCheckerDispatcher { contract_address };\n\n                let target_seq_addr: felt252 = 123;\n                let target_seq_addr: ContractAddress = target_seq_addr.try_into().unwrap();\n\n                let old_seq_addr = dispatcher.get_sequencer_address();\n\n                start_cheat_sequencer_address_global(target_seq_addr);\n\n                let new_seq_addr = dispatcher.get_sequencer_address();\n                assert(new_seq_addr == 123.try_into().unwrap(), 'Wrong seq addr');\n\n                stop_cheat_sequencer_address(contract_address);\n\n                let new_seq_addr = dispatcher.get_sequencer_address();\n                assert(old_seq_addr == new_seq_addr, 'Address did not change back');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"CheatSequencerAddressChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_sequencer_address_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn cheat_sequencer_address_complex() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use result::ResultTrait;\n            use array::ArrayTrait;\n            use option::OptionTrait;\n            use traits::TryInto;\n            use starknet::ContractAddress;\n            use starknet::Felt252TryIntoContractAddress;\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, start_cheat_sequencer_address, start_cheat_sequencer_address_global, stop_cheat_sequencer_address };\n\n            #[starknet::interface]\n            trait ICheatSequencerAddressChecker<TContractState> {\n                fn get_sequencer_address(ref self: TContractState) -> ContractAddress;\n            }\n\n            #[test]\n            fn test_cheat_sequencer_address_complex() {\n                let contract = declare(\"CheatSequencerAddressChecker\").unwrap().contract_class();\n\n                let (contract_address1, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let (contract_address2, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n\n                let cheat_sequencer_address_checker1 = ICheatSequencerAddressCheckerDispatcher { contract_address: contract_address1 };\n                let cheat_sequencer_address_checker2 = ICheatSequencerAddressCheckerDispatcher { contract_address: contract_address2 };\n\n                let old_seq_addr2 = cheat_sequencer_address_checker2.get_sequencer_address();\n\n                start_cheat_sequencer_address_global(123.try_into().unwrap());\n\n                let new_seq_addr1 = cheat_sequencer_address_checker1.get_sequencer_address();\n                let new_seq_addr2 = cheat_sequencer_address_checker2.get_sequencer_address();\n\n                assert(new_seq_addr1 == 123.try_into().unwrap(), 'Wrong seq addr #1');\n                assert(new_seq_addr2 == 123.try_into().unwrap(), 'Wrong seq addr #2');\n\n                start_cheat_sequencer_address(cheat_sequencer_address_checker1.contract_address, 456.try_into().unwrap());\n\n                let new_seq_addr1 = cheat_sequencer_address_checker1.get_sequencer_address();\n                let new_seq_addr2 = cheat_sequencer_address_checker2.get_sequencer_address();\n\n                assert(new_seq_addr1 == 456.try_into().unwrap(), 'Wrong seq addr #3');\n                assert(new_seq_addr2 == 123.try_into().unwrap(), 'Wrong seq addr #4');\n\n                start_cheat_sequencer_address(cheat_sequencer_address_checker1.contract_address, 789.try_into().unwrap());\n                start_cheat_sequencer_address(cheat_sequencer_address_checker2.contract_address, 789.try_into().unwrap());\n\n                let new_seq_addr1 = cheat_sequencer_address_checker1.get_sequencer_address();\n                let new_seq_addr2 = cheat_sequencer_address_checker2.get_sequencer_address();\n\n                assert(new_seq_addr1 == 789.try_into().unwrap(), 'Wrong seq addr #5');\n                assert(new_seq_addr2 == 789.try_into().unwrap(), 'Wrong seq addr #6');\n\n                stop_cheat_sequencer_address(cheat_sequencer_address_checker2.contract_address);\n\n                let new_seq_addr1 = cheat_sequencer_address_checker1.get_sequencer_address();\n                let new_seq_addr2 = cheat_sequencer_address_checker2.get_sequencer_address();\n\n                assert(new_seq_addr1 == 789.try_into().unwrap(), 'Wrong seq addr #7');\n                assert(new_seq_addr2 == old_seq_addr2, 'Wrong seq addr #8');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"CheatSequencerAddressChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_sequencer_address_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn cheat_sequencer_address_with_span() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use result::ResultTrait;\n            use array::ArrayTrait;\n            use option::OptionTrait;\n            use traits::TryInto;\n            use starknet::ContractAddress;\n            use starknet::Felt252TryIntoContractAddress;\n            use snforge_std::{ test_address, declare, ContractClassTrait, DeclareResultTrait, cheat_sequencer_address, start_cheat_sequencer_address, stop_cheat_sequencer_address, CheatSpan };\n\n            #[starknet::interface]\n            trait ICheatSequencerAddressChecker<TContractState> {\n                fn get_sequencer_address(ref self: TContractState) -> felt252;\n            }\n\n            fn deploy_cheat_sequencer_address_checker() -> ICheatSequencerAddressCheckerDispatcher {\n                let (contract_address, _) = declare(\"CheatSequencerAddressChecker\").unwrap().contract_class().deploy(@ArrayTrait::new()).unwrap();\n                ICheatSequencerAddressCheckerDispatcher { contract_address }\n            }\n\n            #[test]\n            fn test_cheat_sequencer_address_once() {\n                let old_sequencer_address = get_sequencer_address();\n\n                let dispatcher = deploy_cheat_sequencer_address_checker();\n\n                let target_sequencer_address: ContractAddress = 123.try_into().unwrap();\n\n                cheat_sequencer_address(dispatcher.contract_address, target_sequencer_address, CheatSpan::TargetCalls(1));\n\n                let sequencer_address = dispatcher.get_sequencer_address();\n                assert(sequencer_address == target_sequencer_address.into(), 'Wrong sequencer address');\n\n                let sequencer_address = dispatcher.get_sequencer_address();\n                assert(sequencer_address == old_sequencer_address.into(), 'Address did not change back');\n            }\n\n            #[test]\n            fn test_cheat_sequencer_address_twice() {\n                let old_sequencer_address = get_sequencer_address();\n\n                let dispatcher = deploy_cheat_sequencer_address_checker();\n\n                let target_sequencer_address: ContractAddress = 123.try_into().unwrap();\n\n                cheat_sequencer_address(dispatcher.contract_address, target_sequencer_address, CheatSpan::TargetCalls(2));\n\n                let sequencer_address = dispatcher.get_sequencer_address();\n                assert(sequencer_address == target_sequencer_address.into(), 'Wrong sequencer address');\n\n                let sequencer_address = dispatcher.get_sequencer_address();\n                assert(sequencer_address == target_sequencer_address.into(), 'Wrong sequencer address');\n\n                let sequencer_address = dispatcher.get_sequencer_address();\n                assert(sequencer_address == old_sequencer_address.into(), 'Address did not change back');\n            }\n\n            #[test]\n            fn test_cheat_sequencer_address_test_address() {\n                let old_sequencer_address = get_sequencer_address();\n\n                let target_sequencer_address: ContractAddress = 123.try_into().unwrap();\n\n                cheat_sequencer_address(test_address(), target_sequencer_address, CheatSpan::TargetCalls(1));\n\n                let sequencer_address = get_sequencer_address();\n                assert(sequencer_address == target_sequencer_address, 'Wrong sequencer address');\n\n                let sequencer_address = get_sequencer_address();\n                assert(sequencer_address == target_sequencer_address, 'Wrong sequencer address');\n\n                stop_cheat_sequencer_address(test_address());\n\n                let sequencer_address = get_sequencer_address();\n                assert(sequencer_address == old_sequencer_address, 'Wrong sequencer address');\n            }\n\n            fn get_sequencer_address() -> ContractAddress {\n                starknet::get_block_info().unbox().sequencer_address\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"CheatSequencerAddressChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_sequencer_address_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/config.rs",
    "content": "use crate::e2e::common::runner::setup_package;\nuse assert_fs::TempDir;\nuse assert_fs::fixture::{FileWriteStr, PathChild};\nuse cheatnet::runtime_extensions::forge_config_extension::config::BlockId;\nuse forge::scarb::config::{ForgeConfigFromScarb, ForkTarget};\nuse forge::scarb::load_package_config;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::{formatdoc, indoc};\nuse scarb_api::metadata::metadata_for_dir;\nuse scarb_metadata::PackageId;\nuse std::{env, fs};\n\nfn setup_package_with_toml() -> TempDir {\n    let temp = setup_package(\"simple_package\");\n\n    let manifest_path = temp.child(\"Scarb.toml\");\n    let manifest_contents = fs::read_to_string(&manifest_path).unwrap();\n    let manifest_contents = formatdoc!(\n        r#\"\n        {manifest_contents}\n\n        [[tool.snforge.fork]]\n        name = \"FIRST_FORK_NAME\"\n        url = \"http://some.rpc.url\"\n        block_id.number = \"1\"\n\n        [[tool.snforge.fork]]\n        name = \"SECOND_FORK_NAME\"\n        url = \"http://some.rpc.url\"\n        block_id.hash = \"0xa\"\n\n        [[tool.snforge.fork]]\n        name = \"THIRD_FORK_NAME\"\n        url = \"http://some.rpc.url\"\n        block_id.hash = \"10\"\n\n        [[tool.snforge.fork]]\n        name = \"FOURTH_FORK_NAME\"\n        url = \"http://some.rpc.url\"\n        block_id.tag = \"latest\"\n    \"#\n    );\n    manifest_path.write_str(manifest_contents.as_str()).unwrap();\n\n    temp\n}\n\n#[test]\nfn get_forge_config_for_package() {\n    let temp = setup_package_with_toml();\n    let scarb_metadata = metadata_for_dir(temp.path()).unwrap();\n\n    let config = load_package_config::<ForgeConfigFromScarb>(\n        &scarb_metadata,\n        &scarb_metadata.workspace.members[0],\n    )\n    .unwrap();\n\n    assert_eq!(\n        config,\n        ForgeConfigFromScarb {\n            exit_first: false,\n            fork: vec![\n                ForkTarget {\n                    name: \"FIRST_FORK_NAME\".to_string(),\n                    url: \"http://some.rpc.url\".parse().expect(\"Should be valid url\"),\n                    block_id: BlockId::BlockNumber(1),\n                },\n                ForkTarget {\n                    name: \"SECOND_FORK_NAME\".to_string(),\n                    url: \"http://some.rpc.url\".parse().expect(\"Should be valid url\"),\n                    block_id: BlockId::BlockHash(0xa.into()),\n                },\n                ForkTarget {\n                    name: \"THIRD_FORK_NAME\".to_string(),\n                    url: \"http://some.rpc.url\".parse().expect(\"Should be valid url\"),\n                    block_id: BlockId::BlockHash(10.into()),\n                },\n                ForkTarget {\n                    name: \"FOURTH_FORK_NAME\".to_string(),\n                    url: \"http://some.rpc.url\".parse().expect(\"Should be valid url\"),\n                    block_id: BlockId::BlockTag,\n                },\n            ],\n            fuzzer_runs: None,\n            fuzzer_seed: None,\n            max_n_steps: None,\n            tracked_resource: ForgeTrackedResource::SierraGas,\n            detailed_resources: false,\n            save_trace_data: false,\n            build_profile: false,\n            coverage: false,\n            gas_report: false,\n        }\n    );\n}\n\n#[test]\nfn get_forge_config_for_package_err_on_invalid_package() {\n    let temp = setup_package_with_toml();\n    let scarb_metadata = metadata_for_dir(temp.path()).unwrap();\n\n    let result = load_package_config::<ForgeConfigFromScarb>(\n        &scarb_metadata,\n        &PackageId::from(String::from(\"12345679\")),\n    );\n    let err = result.unwrap_err();\n\n    assert!(\n        err.to_string()\n            .contains(\"Failed to find metadata for package\")\n    );\n}\n\n#[test]\nfn get_forge_config_for_package_default_on_missing_config() {\n    let temp = setup_package_with_toml();\n    let content = indoc!(\n        r#\"\n            [package]\n            name = \"simple_package\"\n            version = \"0.1.0\"\n            \"#\n    );\n    temp.child(\"Scarb.toml\").write_str(content).unwrap();\n\n    let scarb_metadata = metadata_for_dir(temp.path()).unwrap();\n\n    let config = load_package_config::<ForgeConfigFromScarb>(\n        &scarb_metadata,\n        &scarb_metadata.workspace.members[0],\n    )\n    .unwrap();\n\n    assert_eq!(config, ForgeConfigFromScarb::default());\n}\n\n#[test]\nfn get_forge_config_for_package_fails_on_same_fork_name() {\n    let temp = setup_package_with_toml();\n    let content = indoc!(\n        r#\"\n            [package]\n            name = \"simple_package\"\n            version = \"0.1.0\"\n\n            [[tool.snforge.fork]]\n            name = \"SAME_NAME\"\n            url = \"http://some.rpc.url\"\n            block_id.number = \"1\"\n\n            [[tool.snforge.fork]]\n            name = \"SAME_NAME\"\n            url = \"http://some.rpc.url\"\n            block_id.hash = \"1\"\n            \"#\n    );\n    temp.child(\"Scarb.toml\").write_str(content).unwrap();\n\n    let scarb_metadata = metadata_for_dir(temp.path()).unwrap();\n    let err = load_package_config::<ForgeConfigFromScarb>(\n        &scarb_metadata,\n        &scarb_metadata.workspace.members[0],\n    )\n    .unwrap_err();\n    assert!(format!(\"{err:?}\").contains(\"Some fork names are duplicated\"));\n}\n\n#[test]\nfn get_forge_config_for_package_fails_on_multiple_block_id() {\n    let temp = setup_package_with_toml();\n    let content = indoc!(\n        r#\"\n            [package]\n            name = \"simple_package\"\n            version = \"0.1.0\"\n\n            [[tool.snforge.fork]]\n            name = \"SAME_NAME\"\n            url = \"http://some.rpc.url\"\n            block_id.number = \"1\"\n            block_id.hash = \"2\"\n            \"#\n    );\n    temp.child(\"Scarb.toml\").write_str(content).unwrap();\n\n    let scarb_metadata = metadata_for_dir(temp.path()).unwrap();\n    let err = load_package_config::<ForgeConfigFromScarb>(\n        &scarb_metadata,\n        &scarb_metadata.workspace.members[0],\n    )\n    .unwrap_err();\n    assert!(\n        format!(\"{err:?}\")\n            .contains(\"block_id must contain exactly one key: 'tag', 'hash', or 'number'\")\n    );\n}\n\n#[test]\nfn get_forge_config_for_package_fails_on_wrong_block_id() {\n    let temp = setup_package_with_toml();\n    let content = indoc!(\n        r#\"\n            [package]\n            name = \"simple_package\"\n            version = \"0.1.0\"\n\n            [[tool.snforge.fork]]\n            name = \"SAME_NAME\"\n            url = \"http://some.rpc.url\"\n            block_id.wrong_variant = \"1\"\n            \"#\n    );\n    temp.child(\"Scarb.toml\").write_str(content).unwrap();\n\n    let scarb_metadata = metadata_for_dir(temp.path()).unwrap();\n\n    let err = load_package_config::<ForgeConfigFromScarb>(\n        &scarb_metadata,\n        &scarb_metadata.workspace.members[0],\n    )\n    .unwrap_err();\n    assert!(\n        format!(\"{err:?}\")\n            .contains(\"unknown field `wrong_variant`, expected one of `tag`, `hash`, `number`\")\n    );\n}\n\n#[test]\nfn get_forge_config_for_package_fails_on_wrong_block_tag() {\n    let temp = setup_package_with_toml();\n    let content = indoc!(\n        r#\"\n            [package]\n            name = \"simple_package\"\n            version = \"0.1.0\"\n\n            [[tool.snforge.fork]]\n            name = \"SAME_NAME\"\n            url = \"http://some.rpc.url\"\n            block_id.tag = \"Preconfirmed\"\n            \"#\n    );\n    temp.child(\"Scarb.toml\").write_str(content).unwrap();\n\n    let scarb_metadata = metadata_for_dir(temp.path()).unwrap();\n\n    let err = load_package_config::<ForgeConfigFromScarb>(\n        &scarb_metadata,\n        &scarb_metadata.workspace.members[0],\n    )\n    .unwrap_err();\n    assert!(format!(\"{err:?}\").contains(\"block_id.tag can only be equal to latest\"));\n}\n\n#[test]\nfn get_forge_config_for_package_with_block_tag() {\n    let temp = setup_package_with_toml();\n    let content = indoc!(\n        r#\"\n            [package]\n            name = \"simple_package\"\n            version = \"0.1.0\"\n\n            [[tool.snforge.fork]]\n            name = \"SAME_NAME\"\n            url = \"http://some.rpc.url\"\n            block_id.tag = \"latest\"\n            \"#\n    );\n    temp.child(\"Scarb.toml\").write_str(content).unwrap();\n\n    let scarb_metadata = metadata_for_dir(temp.path()).unwrap();\n\n    let forge_config = load_package_config::<ForgeConfigFromScarb>(\n        &scarb_metadata,\n        &scarb_metadata.workspace.members[0],\n    )\n    .unwrap();\n    assert_eq!(forge_config.fork[0].block_id, BlockId::BlockTag);\n}\n\n#[test]\nfn get_forge_config_resolves_env_variables() {\n    let temp = setup_package_with_toml();\n    let content = indoc!(\n        r#\"\n            [package]\n            name = \"simple_package\"\n            version = \"0.1.0\"\n\n            [[tool.snforge.fork]]\n            name = \"ENV_URL_FORK\"\n            url = \"$ENV_URL_FORK234980670176\"\n            block_id.number = \"1\"\n            \"#\n    );\n    temp.child(\"Scarb.toml\").write_str(content).unwrap();\n\n    let scarb_metadata = metadata_for_dir(temp.path()).unwrap();\n\n    // SAFETY: This value is only read here and is not modified by other tests.\n    unsafe {\n        env::set_var(\"ENV_URL_FORK234980670176\", \"http://some.rpc.url_from_env\");\n    }\n    let config = load_package_config::<ForgeConfigFromScarb>(\n        &scarb_metadata,\n        &scarb_metadata.workspace.members[0],\n    )\n    .unwrap();\n\n    assert_eq!(\n        config,\n        ForgeConfigFromScarb {\n            exit_first: false,\n            fork: vec![ForkTarget {\n                name: \"ENV_URL_FORK\".to_string(),\n                url: \"http://some.rpc.url_from_env\"\n                    .parse()\n                    .expect(\"Should be valid url\"),\n                block_id: BlockId::BlockNumber(1),\n            }],\n            fuzzer_runs: None,\n            fuzzer_seed: None,\n            max_n_steps: None,\n            tracked_resource: ForgeTrackedResource::SierraGas,\n            detailed_resources: false,\n            save_trace_data: false,\n            build_profile: false,\n            coverage: false,\n            gas_report: false,\n        }\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/declare.rs",
    "content": "use crate::utils::runner::{Contract, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\nuse std::path::Path;\n\n#[test]\nfn simple_declare() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use core::clone::Clone;\n        use snforge_std::cheatcodes::contract_class::DeclareResultTrait;\n        use result::ResultTrait;\n        use traits::Into;\n        use starknet::ClassHashIntoFelt252;\n        use snforge_std::declare;\n\n        #[test]\n        fn simple_declare() {\n            assert(1 == 1, 'simple check');\n            let contract = declare(\"HelloStarknet\").unwrap().contract_class().clone();\n            assert(contract.class_hash.into() != 0, 'proper class hash');\n        }\n        \"#\n        ),\n        Contract::new(\n            \"HelloStarknet\",\n            indoc!(\n                r\"\n                #[starknet::interface]\n                trait IHelloStarknet<TContractState> {\n                    fn increase_balance(ref self: TContractState, amount: felt252);\n                    fn decrease_balance(ref self: TContractState, amount: felt252);\n                }\n\n                #[starknet::contract]\n                mod HelloStarknet {\n                    #[storage]\n                    struct Storage {\n                        balance: felt252,\n                    }\n        \n                    // Increases the balance by the given amount\n                    #[abi(embed_v0)]\n                    impl HelloStarknetImpl of super::IHelloStarknet<ContractState> {\n                        fn increase_balance(ref self: ContractState, amount: felt252) {\n                            self.balance.write(self.balance.read() + amount);\n                        }\n\n                        // Decreases the balance by the given amount.\n                        fn decrease_balance(ref self: ContractState, amount: felt252) {\n                            self.balance.write(self.balance.read() - amount);\n                        }\n                    }\n                }\n                \"\n            )\n        )\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn declare_simple() {\n    let contract = Contract::from_code_path(\n        \"HelloStarknet\".to_string(),\n        Path::new(\"tests/data/contracts/hello_starknet.cairo\"),\n    )\n    .unwrap();\n\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use core::clone::Clone;\n        use result::ResultTrait;\n        use traits::Into;\n        use starknet::ClassHashIntoFelt252;\n        use snforge_std::{declare, DeclareResultTrait};\n\n        #[test]\n        fn declare_simple() {\n            assert(1 == 1, 'simple check');\n            let contract = declare(\"HelloStarknet\").unwrap().contract_class().clone();\n            let class_hash = contract.class_hash.into();\n            assert(class_hash != 0, 'proper class hash');\n        }\n        \"#\n        ),\n        contract\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn redeclare() {\n    let contract = Contract::from_code_path(\n        \"HelloStarknet\".to_string(),\n        Path::new(\"tests/data/contracts/hello_starknet.cairo\"),\n    )\n    .unwrap();\n\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use core::clone::Clone;\n        use result::ResultTrait;\n        use traits::Into;\n        use starknet::ClassHashIntoFelt252;\n        use snforge_std::{declare, DeclareResultTrait, DeclareResult};\n\n        #[test]\n        fn redeclare() {\n            assert(1 == 1, 'simple check');\n            let contract = match declare(\"HelloStarknet\") {\n                Result::Ok(result) => result.contract_class().clone(),\n                Result::Err(_) => panic!(\"Failed to declare contract\"),\n            };\n            let class_hash = contract.class_hash.into();\n            assert(class_hash != 0, 'proper class hash');\n            match declare(\"HelloStarknet\").unwrap() {\n                DeclareResult::AlreadyDeclared(_) => {},\n                _ => panic!(\"Contract redeclared\")\n            }\n        }\n        \"#\n        ),\n        contract\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/deploy.rs",
    "content": "use crate::utils::runner::{Contract, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\nuse std::path::Path;\n\n#[test]\nfn deploy_syscall_check() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use core::clone::Clone;\n        use snforge_std::{declare, test_address, DeclareResultTrait};\n        use starknet::{SyscallResult, deploy_syscall};\n\n        #[starknet::interface]\n        trait IDeployChecker<T> {\n            fn get_balance(self: @T) -> felt252;\n            fn get_caller(self: @T) -> starknet::ContractAddress;\n        }\n\n        #[test]\n        fn deploy_syscall_check() {\n            let contract = declare(\"DeployChecker\").unwrap().contract_class().clone();\n            let salt = 1;\n            let calldata = array![10];\n\n            let (contract_address, span) = deploy_syscall(contract.class_hash, salt, calldata.span(), false).unwrap();\n            assert(*span[0] == test_address().into() && *span[1] == 10, 'constructor return mismatch');\n\n            let dispatcher = IDeployCheckerDispatcher { contract_address };\n            assert(dispatcher.get_balance() == 10, 'balance mismatch');\n            assert(dispatcher.get_caller() == test_address(), 'caller mismatch');\n\n            let (contract_address_from_zero, _) = deploy_syscall(contract.class_hash, salt, calldata.span(), true).unwrap();\n            assert(contract_address != contract_address_from_zero, 'deploy from zero no effect');\n        }\n    \"#\n        ),\n        Contract::from_code_path(\n            \"DeployChecker\".to_string(),\n            Path::new(\"tests/data/contracts/deploy_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn constructor_retdata_span() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use result::ResultTrait;\n        use snforge_std::{ declare, ContractClass, ContractClassTrait, DeclareResultTrait };\n        use array::ArrayTrait;\n\n        #[test]\n        fn constructor_retdata_span() {\n            let contract = declare(\"ConstructorRetdata\").unwrap().contract_class();\n\n            let (_contract_address, retdata) = contract.deploy(@ArrayTrait::new()).unwrap();\n            assert_eq!(retdata, array![3, 2, 3, 4].span());\n        }\n    \"#\n        ),\n        Contract::new(\n            \"ConstructorRetdata\",\n            indoc!(\n                r\"\n                #[starknet::contract]\n                mod ConstructorRetdata {\n                    use array::ArrayTrait;\n                \n                    #[storage]\n                    struct Storage {}\n                \n                    #[constructor]\n                    fn constructor(ref self: ContractState) -> Span<felt252> {\n                        array![2, 3, 4].span()\n                    }\n                }\n                \"\n            )\n        )\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn constructor_retdata_felt() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use result::ResultTrait;\n        use snforge_std::{ declare, ContractClass, ContractClassTrait, DeclareResultTrait };\n        use array::ArrayTrait;\n\n        #[test]\n        fn constructor_retdata_felt() {\n            let contract = declare(\"ConstructorRetdata\").unwrap().contract_class();\n\n            let (_contract_address, retdata) = contract.deploy(@ArrayTrait::new()).unwrap();\n            assert_eq!(retdata, array![5].span());\n        }\n    \"#\n        ),\n        Contract::new(\n            \"ConstructorRetdata\",\n            indoc!(\n                r\"\n                #[starknet::contract]\n                mod ConstructorRetdata {\n                    use array::ArrayTrait;\n                \n                    #[storage]\n                    struct Storage {}\n                \n                    #[constructor]\n                    fn constructor(ref self: ContractState) -> felt252 {\n                        5\n                    }\n                }\n                \"\n            )\n        )\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn constructor_retdata_struct() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use result::ResultTrait;\n        use snforge_std::{ declare, ContractClass, ContractClassTrait, DeclareResultTrait };\n        use array::ArrayTrait;\n\n        #[test]\n        fn constructor_retdata_struct() {\n            let contract = declare(\"ConstructorRetdata\").unwrap().contract_class();\n\n            let (_contract_address, retdata) = contract.deploy(@ArrayTrait::new()).unwrap();\n            assert_eq!(retdata, array![0, 6, 2, 7, 8, 9].span());\n        }\n    \"#\n        ),\n        Contract::new(\n            \"ConstructorRetdata\",\n            indoc!(\n                r\"\n                #[starknet::contract]\n                mod ConstructorRetdata {\n                    use array::ArrayTrait;\n                \n                    #[storage]\n                    struct Storage {}\n                \n                    #[derive(Serde, Drop)]\n                    struct Retdata {\n                        a: felt252,\n                        b: Span<felt252>,\n                        c: felt252,\n                    }\n\n                    #[constructor]\n                    fn constructor(ref self: ContractState) -> Option<Retdata> {\n                        Option::Some(\n                            Retdata {\n                                a: 6,\n                                b: array![7, 8].span(),\n                                c: 9\n                            }\n                        )\n                    }\n                }\n                \"\n            )\n        )\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn deploy_twice() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use snforge_std::{ContractClassTrait, DeclareResultTrait, declare};\n\n        #[test]\n        fn deploy_twice() {\n            let contract = declare(\"DeployChecker\").unwrap().contract_class();\n            let constructor_calldata = array![1];\n\n            let (contract_address_1, _) = contract.deploy(@constructor_calldata).unwrap();\n            let (contract_address_2, _) = contract.deploy(@constructor_calldata).unwrap();\n\n            assert(contract_address_1 != contract_address_2, 'Addresses should differ');\n        }\n    \"#\n        ),\n        Contract::from_code_path(\n            \"DeployChecker\".to_string(),\n            Path::new(\"tests/data/contracts/deploy_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn verify_precalculate_address() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use snforge_std::{ContractClassTrait, DeclareResultTrait, declare};\n\n        #[test]\n        fn precalculate_and_deploy() {\n            let contract = declare(\"DeployChecker\").unwrap().contract_class();\n            let constructor_calldata = array![1234];\n\n            let precalculated_address = contract.precalculate_address(@constructor_calldata);\n\n            let (contract_address, _) = contract.deploy(@constructor_calldata).unwrap();\n\n            assert(precalculated_address == contract_address, 'Addresses should not differ');\n        }\n    \"#\n        ),\n        Contract::from_code_path(\n            \"DeployChecker\".to_string(),\n            Path::new(\"tests/data/contracts/deploy_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn deploy_constructor_panic_catchable() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use snforge_std::{declare, ContractClassTrait, DeclareResultTrait};\n\n        #[test]\n        fn deploy_constructor_panic_returns_error_in_result() {\n            let contract = declare(\"DeployChecker\").unwrap().contract_class();\n            let constructor_calldata = array![0];\n            \n            let result = contract.deploy(@constructor_calldata);\n\n            match result {\n                Result::Ok(_) => panic!(\"Expected deployment to fail\"),\n                Result::Err(panic_data) => {\n                    assert!(*panic_data.at(0) == 'Initial balance cannot be 0', \"Wrong panic message\");\n                }\n            }\n        }\n    \"#\n        ),\n        Contract::from_code_path(\n            \"DeployChecker\".to_string(),\n            Path::new(\"tests/data/contracts/deploy_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n    assert_passed(&result);\n}\n\n#[test]\nfn deploy_constructor_panic_catchable_via_should_panic() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use snforge_std::{ContractClassTrait, DeclareResultTrait, declare};\n        use starknet::SyscallResultTrait;\n\n        #[test]\n        #[should_panic(expected: 'Initial balance cannot be 0')]\n        fn deploy_constructor_panic_should_be_catchable() {\n            let contract = declare(\"DeployChecker\").unwrap().contract_class();\n            let constructor_calldata = array![0];\n            \n            contract.deploy(@constructor_calldata).unwrap_syscall();\n        }\n    \"#\n        ),\n        Contract::from_code_path(\n            \"DeployChecker\".to_string(),\n            Path::new(\"tests/data/contracts/deploy_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/deploy_at.rs",
    "content": "use crate::utils::runner::{Contract, assert_case_output_contains, assert_failed, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\nuse std::path::Path;\n\n#[test]\nfn deploy_at_correct_address() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n        use starknet::ContractAddress;\n\n        #[starknet::interface]\n        trait IProxy<TContractState> {\n            fn get_caller_address(ref self: TContractState, checker_address: ContractAddress) -> felt252;\n        }\n\n        #[test]\n        fn deploy_at_correct_address() {\n            let contract = declare(\"CheatCallerAddressChecker\").unwrap().contract_class();\n            let (cheat_caller_address_checker, _) = contract.deploy(@array![]).unwrap();\n\n            let contract = declare(\"Proxy\").unwrap().contract_class();\n            let deploy_at_address = 123;\n\n            let (contract_address, _) = contract.deploy_at(@array![], deploy_at_address.try_into().unwrap()).unwrap();\n            assert(deploy_at_address == contract_address.into(), 'addresses should be the same');\n\n            let real_address = IProxyDispatcher{ contract_address }.get_caller_address(cheat_caller_address_checker);\n            assert(real_address == contract_address.into(), 'addresses should be the same');\n        }\n    \"#\n        ),\n        Contract::new(\n            \"Proxy\",\n            indoc!(\n                r\"\n                use starknet::ContractAddress;\n\n                #[starknet::interface]\n                trait IProxy<TContractState> {\n                    fn get_caller_address(ref self: TContractState, checker_address: ContractAddress) -> felt252;\n                }\n\n                #[starknet::contract]\n                mod Proxy {\n                    use starknet::ContractAddress;\n                                                    \n                    #[storage]\n                    struct Storage {}\n\n                    #[starknet::interface]\n                    trait ICheatCallerAddressChecker<TContractState> {\n                        fn get_caller_address(ref self: TContractState) -> felt252;\n                    }\n                \n                    #[abi(embed_v0)]\n                    impl ProxyImpl of super::IProxy<ContractState> {\n                        fn get_caller_address(ref self: ContractState, checker_address: ContractAddress) -> felt252 {\n                            ICheatCallerAddressCheckerDispatcher{ contract_address: checker_address}.get_caller_address()\n                        }\n                    }\n                }\n            \"\n            )\n        ),\n        Contract::from_code_path(\n            \"CheatCallerAddressChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_caller_address_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn deploy_two_at_the_same_address() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n        use starknet::ContractAddress;\n\n        #[test]\n        fn deploy_two_at_the_same_address() {\n            let contract_address = 123;\n\n            let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n            let (real_address, _) = contract.deploy_at(@array![], contract_address.try_into().unwrap()).unwrap();\n            assert(real_address.into() == contract_address, 'addresses should be the same');\n            contract.deploy_at(@array![], contract_address.try_into().unwrap()).unwrap();\n        }\n    \"#\n        ),\n        Contract::from_code_path(\n            \"HelloStarknet\".to_string(),\n            Path::new(\"tests/data/contracts/hello_starknet.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_failed(&result);\n    assert_case_output_contains(\n        &result,\n        \"deploy_two_at_the_same_address\",\n        \"Deployment failed: contract already deployed at address 0x000000000000000000000000000000000000000000000000000000000000007b\",\n    );\n}\n\n#[test]\nfn fail_to_deploy_at_0() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n\n        #[test]\n        fn deploy_at_0() {\n            let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n            contract.deploy_at(@array![], 0.try_into().unwrap()).unwrap();\n        }\n    \"#\n        ),\n        Contract::from_code_path(\n            \"HelloStarknet\".to_string(),\n            Path::new(\"tests/data/contracts/hello_starknet.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_failed(&result);\n    assert_case_output_contains(\n        &result,\n        \"deploy_at_0\",\n        \"Cannot deploy contract at address 0\",\n    );\n}\n\n#[test]\nfn deploy_at_constructor_panic_catchable_via_should_panic() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use snforge_std::{ContractClassTrait, DeclareResultTrait, declare};\n        use starknet::{SyscallResultTrait, ContractAddress};\n\n        #[test]\n        #[should_panic(expected: 'Initial balance cannot be 0')]\n        fn deploy_at_constructor_panic_should_be_catchable() {\n            let contract = declare(\"DeployChecker\").unwrap().contract_class();\n            let constructor_calldata = array![0];\n            let deploy_at_address = 123;\n            \n            contract.deploy_at(@constructor_calldata, deploy_at_address.try_into().unwrap()).unwrap_syscall();\n        }\n    \"#\n        ),\n        Contract::from_code_path(\n            \"DeployChecker\".to_string(),\n            Path::new(\"tests/data/contracts/deploy_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/dict.rs",
    "content": "use crate::utils::runner::{Contract, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\nuse std::path::Path;\n\n#[test]\nfn using_dict() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use result::ResultTrait;\n        use snforge_std::{ declare, ContractClass, ContractClassTrait, DeclareResultTrait };\n        use array::ArrayTrait;\n\n        #[starknet::interface]\n        trait IDictUsingContract<TContractState> {\n            fn get_unique(self: @TContractState) -> u8;\n            fn write_unique(self: @TContractState, values: Array<felt252>);\n        }\n\n        #[test]\n        fn using_dict() {\n            let contract = declare(\"DictUsingContract\").unwrap().contract_class();\n            let numbers = array![1, 2, 3, 3, 3, 3 ,3, 4, 4, 4, 4, 4, 5, 5, 5, 5];\n            let mut inputs: Array<felt252> = array![];\n            numbers.serialize(ref inputs);\n\n            let (contract_address, _) = contract.deploy(@inputs).unwrap();\n            let dispatcher = IDictUsingContractDispatcher { contract_address };\n\n            let unq = dispatcher.get_unique();\n            assert(unq == 5, 'wrong unique count');\n\n            numbers.serialize(ref inputs);\n            dispatcher.write_unique(array![1, 2, 3, 3, 3, 3 ,3, 4, 4, 4, 4, 4]);\n\n            let unq = dispatcher.get_unique();\n            assert(unq == 4, 'wrong unique count');\n        }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"DictUsingContract\".to_string(),\n            Path::new(\"tests/data/contracts/dict_using_contract.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/dispatchers.rs",
    "content": "use crate::utils::runner::{Contract, assert_case_output_contains, assert_failed, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\nuse std::path::Path;\n\n#[test]\nfn simple_call_and_invoke() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use array::ArrayTrait;\n        use result::ResultTrait;\n        use option::OptionTrait;\n        use traits::TryInto;\n        use starknet::ContractAddress;\n        use starknet::Felt252TryIntoContractAddress;\n        use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n\n        #[starknet::interface]\n        trait IHelloStarknet<TContractState> {\n            fn increase_balance(ref self: TContractState, amount: felt252);\n            fn get_balance(self: @TContractState) -> felt252;\n            fn do_a_panic(self: @TContractState);\n            fn do_a_panic_with(self: @TContractState, panic_data: Array<felt252>);\n        }\n\n        #[test]\n        fn simple_call_and_invoke() {\n            let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n            let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n            let dispatcher = IHelloStarknetDispatcher { contract_address };\n\n            let balance = dispatcher.get_balance();\n            assert(balance == 0, 'balance == 0');\n\n            dispatcher.increase_balance(100);\n\n            let balance = dispatcher.get_balance();\n            assert(balance == 100, 'balance == 100');\n        }\n    \"#\n        ),\n        Contract::from_code_path(\n            \"HelloStarknet\".to_string(),\n            Path::new(\"tests/data/contracts/hello_starknet.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn advanced_types() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use array::ArrayTrait;\n        use result::ResultTrait;\n        use option::OptionTrait;\n        use traits::TryInto;\n        use starknet::ContractAddress;\n        use starknet::Felt252TryIntoContractAddress;\n        use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, start_cheat_caller_address };\n\n        #[starknet::interface]\n        trait IERC20<TContractState> {\n            fn get_name(self: @TContractState) -> felt252;\n            fn get_symbol(self: @TContractState) -> felt252;\n            fn get_decimals(self: @TContractState) -> u8;\n            fn get_total_supply(self: @TContractState) -> u256;\n            fn balance_of(self: @TContractState, account: ContractAddress) -> u256;\n            fn allowance(self: @TContractState, owner: ContractAddress, spender: ContractAddress) -> u256;\n            fn transfer(ref self: TContractState, recipient: ContractAddress, amount: u256);\n            fn transfer_from(\n                ref self: TContractState, sender: ContractAddress, recipient: ContractAddress, amount: u256\n            );\n            fn approve(ref self: TContractState, spender: ContractAddress, amount: u256);\n            fn increase_allowance(ref self: TContractState, spender: ContractAddress, added_value: u256);\n            fn decrease_allowance(\n                ref self: TContractState, spender: ContractAddress, subtracted_value: u256\n            );\n        }\n\n        #[test]\n        fn advanced_types() {\n            let mut calldata = ArrayTrait::new();\n            calldata.append('token');   // name\n            calldata.append('TKN');     // symbol\n            calldata.append(18);        // decimals\n            calldata.append(1111);      // initial supply low\n            calldata.append(0);         // initial supply high\n            calldata.append(1234);      // recipient\n\n            let contract = declare(\"ERC20\").unwrap().contract_class();\n            let (contract_address, _) = contract.deploy(@calldata).unwrap();\n            let dispatcher = IERC20Dispatcher { contract_address };\n            let user_address: ContractAddress = 1234.try_into().unwrap();\n            let other_user_address: ContractAddress = 9999.try_into().unwrap();\n\n            let balance = dispatcher.balance_of(user_address);\n            assert(balance == 1111_u256, 'balance == 1111');\n\n            start_cheat_caller_address(contract_address, user_address);\n            dispatcher.transfer(other_user_address, 1000_u256);\n\n            let balance = dispatcher.balance_of(user_address);\n            assert(balance == 111_u256, 'balance == 111');\n            let balance = dispatcher.balance_of(other_user_address);\n            assert(balance == 1000_u256, 'balance == 1000');\n        }\n    \"#\n        ),\n        Contract::from_code_path(\n            \"ERC20\".to_string(),\n            Path::new(\"tests/data/contracts/erc20.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn handling_errors() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use array::ArrayTrait;\n        use result::ResultTrait;\n        use option::OptionTrait;\n        use traits::TryInto;\n        use starknet::ContractAddress;\n        use starknet::Felt252TryIntoContractAddress;\n        use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n        use starknet::contract_address_const;\n\n        #[starknet::interface]\n        trait IHelloStarknet<TContractState> {\n            fn increase_balance(ref self: TContractState, amount: felt252);\n            fn get_balance(self: @TContractState) -> felt252;\n            fn do_a_panic(self: @TContractState);\n            fn do_a_panic_with(self: @TContractState, panic_data: Array<felt252>);\n        }\n\n        #[test]\n        #[feature(\"safe_dispatcher\")]\n        fn handling_execution_errors() {\n            let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n            let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n            let safe_dispatcher = IHelloStarknetSafeDispatcher { contract_address };\n\n            match safe_dispatcher.do_a_panic() {\n                Result::Ok(_) => panic_with_felt252('shouldve panicked'),\n                Result::Err(panic_data) => {\n                    assert(*panic_data.at(0) == 'PANIC', *panic_data.at(0));\n                    assert(*panic_data.at(1) == 'DAYTAH', *panic_data.at(1));\n                }\n            };\n\n            let mut panic_data = ArrayTrait::new();\n            panic_data.append('capybara');\n\n            match safe_dispatcher.do_a_panic_with(panic_data) {\n                Result::Ok(_) => panic_with_felt252('shouldve panicked'),\n                Result::Err(panic_data) => {\n                    assert(panic_data.len() == 2, 'Wrong panic_data len');\n                    assert(*panic_data.at(0) == 'capybara', *panic_data.at(0));\n                    assert(*panic_data.at(1) == 'ENTRYPOINT_FAILED', *panic_data.at(1));\n                }\n            };\n\n            match safe_dispatcher.do_a_panic_with(ArrayTrait::new()) {\n                Result::Ok(_) => panic_with_felt252('shouldve panicked'),\n                Result::Err(panic_data) => {\n                    assert(panic_data.len() == 1, 'Should be generic panic');\n                    assert(*panic_data.at(0) == 'ENTRYPOINT_FAILED', *panic_data.at(0));\n                }\n            };\n        }\n\n        #[test]\n        #[feature(\"safe_dispatcher\")]\n        fn handling_missing_contract_error() {\n            let safe_dispatcher = IHelloStarknetSafeDispatcher {\n                contract_address: contract_address_const::<371937219379012>()\n            };\n\n            match safe_dispatcher.do_a_panic() {\n                Result::Ok(_) => panic_with_felt252('shouldve panicked'),\n                Result::Err(_) => {\n                    // Would be nice to assert the error here once it is possible in cairo\n                }\n            };\n        }\n    \"#\n        ),\n        Contract::from_code_path(\n            \"HelloStarknet\".to_string(),\n            Path::new(\"tests/data/contracts/hello_starknet.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn handling_bytearray_based_errors() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use starknet::ContractAddress;\n        use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n        use snforge_std::byte_array::try_deserialize_bytearray_error;\n        use core::byte_array::BYTE_ARRAY_MAGIC;\n\n        #[starknet::interface]\n        trait IHelloStarknet<TContractState> {\n            fn do_a_panic_with_bytearray(self: @TContractState);\n            fn do_a_panic_with(self: @TContractState, args: Array<felt252>);\n        }\n\n        #[test]\n        #[feature(\"safe_dispatcher\")]\n        fn handling_errors() {\n            let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n            let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n            let safe_dispatcher = IHelloStarknetSafeDispatcher { contract_address };\n\n            let panic_data = safe_dispatcher.do_a_panic_with_bytearray().unwrap_err();\n            let str_err = try_deserialize_bytearray_error(panic_data.span()).expect('wrong format');\n            assert(\n                str_err == \"This is a very long\\n and multiline message that is certain to fill the buffer\",\n                'wrong string received'\n            );\n\n           // Not a bytearray\n           let panic_data = safe_dispatcher.do_a_panic_with(array![123, 321]).unwrap_err();\n           try_deserialize_bytearray_error(panic_data.span()).expect_err('Parsing unexpectedy succeeded');\n\n           // Malformed bytearray\n           let panic_data = safe_dispatcher.do_a_panic_with(array![BYTE_ARRAY_MAGIC, 321]).unwrap_err();\n           try_deserialize_bytearray_error(panic_data.span()).expect_err('Parsing unexpectedy succeeded');\n        }\n    \"#\n        ),\n        Contract::from_code_path(\n            \"HelloStarknet\".to_string(),\n            Path::new(\"tests/data/contracts/hello_starknet.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn serding() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use array::ArrayTrait;\n        use result::ResultTrait;\n        use option::OptionTrait;\n        use traits::TryInto;\n        use starknet::ContractAddress;\n        use starknet::Felt252TryIntoContractAddress;\n        use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n\n        #[derive(Drop, Serde)]\n        struct NestedStruct {\n            d: felt252,\n        }\n\n        #[derive(Drop, Serde)]\n        struct CustomStruct {\n            a: felt252,\n            b: felt252,\n            c: NestedStruct,\n        }\n\n        #[derive(Drop, Serde)]\n        struct AnotherCustomStruct {\n            e: felt252,\n        }\n\n        #[starknet::interface]\n        trait ISerding<T> {\n            fn add_multiple_parts(\n                self: @T,\n                custom_struct: CustomStruct,\n                another_struct: AnotherCustomStruct,\n                standalone_arg: felt252\n            ) -> felt252;\n        }\n\n        #[test]\n        fn serding() {\n            let contract = declare(\"Serding\").unwrap().contract_class();\n            let (contract_address, _) = contract.deploy( @ArrayTrait::new()).unwrap();\n\n            let dispatcher = ISerdingDispatcher {\n                contract_address\n            };\n\n            let ns = NestedStruct { d: 1 };\n            let cs = CustomStruct { a: 2, b: 3, c: ns };\n            let acs = AnotherCustomStruct { e: 4 };\n            let standalone_arg = 5;\n\n            let result = dispatcher.add_multiple_parts(cs, acs, standalone_arg);\n\n            assert(result == 1 + 2 + 3 + 4 + 5, 'Invalid sum');\n        }\n    \"#\n        ),\n        Contract::from_code_path(\n            \"Serding\".to_string(),\n            Path::new(\"tests/data/contracts/serding.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\n#[expect(clippy::too_many_lines)]\nfn proxy_storage() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use array::ArrayTrait;\n        use result::ResultTrait;\n        use option::OptionTrait;\n        use traits::TryInto;\n        use starknet::ContractAddress;\n        use starknet::Felt252TryIntoContractAddress;\n        use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n\n\n        #[derive(Drop, Serde, PartialEq, Copy)]\n        struct NestedStruct {\n            d: felt252,\n        }\n\n        #[derive(Drop, Serde, PartialEq, Copy)]\n        struct CustomStruct {\n            a: felt252,\n            b: felt252,\n            c: NestedStruct,\n        }\n\n        fn deploy_contract(name: ByteArray) -> ContractAddress {\n            let contract = declare(name).unwrap().contract_class();\n            let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n            contract_address\n        }\n\n\n        #[starknet::interface]\n        trait ICaller<T> {\n            fn call_executor(\n                self: @T, executor_address: starknet::ContractAddress, custom_struct: CustomStruct\n            ) -> felt252;\n        }\n\n        #[starknet::interface]\n        trait IExecutor<T> {\n            fn read_storage(ref self: T) -> CustomStruct;\n        }\n\n        #[test]\n        fn proxy_storage() {\n            let caller_address = deploy_contract(\"Caller\");\n            let executor_address = deploy_contract(\"Executor\");\n\n            let caller_dispatcher = ICallerDispatcher { contract_address: caller_address };\n            let executor_dispatcher = IExecutorDispatcher { contract_address: executor_address };\n\n            let ns = NestedStruct { d: 6 };\n            let cs = CustomStruct { a: 2, b: 3, c: ns };\n\n            let result = caller_dispatcher.call_executor(executor_address, cs);\n\n            assert(result == 6 + 5, 'Invalid result');\n\n            let storage_after = executor_dispatcher.read_storage();\n\n            assert(storage_after == cs, 'Invalid storage');\n        }\n    \"#\n        ),\n        Contract::new(\n            \"Caller\",\n            indoc!(\n                r\"\n            use starknet::ContractAddress;\n\n            #[derive(Drop, Serde, starknet::Store)]\n            struct NestedStruct {\n                d: felt252,\n            }\n\n            #[derive(Drop, Serde, starknet::Store)]\n            struct CustomStruct {\n                a: felt252,\n                b: felt252,\n                c: NestedStruct,\n            }\n\n            #[starknet::interface]\n            trait ICaller<TContractState> {\n                fn call_executor(\n                    self: @TContractState,\n                    executor_address: ContractAddress,\n                    custom_struct: CustomStruct\n                ) -> felt252;\n            }\n\n            #[starknet::contract]\n            mod Caller {\n                use super::CustomStruct;\n                use result::ResultTrait;\n                use starknet::ContractAddress;\n\n                #[starknet::interface]\n                trait IExecutor<T> {\n                    fn store_and_add_5(self: @T, custom_struct: CustomStruct) -> felt252;\n                }\n\n                #[storage]\n                struct Storage {}\n\n                #[abi(embed_v0)]\n                impl CallerImpl of super::ICaller<ContractState> {\n                    fn call_executor(\n                        self: @ContractState,\n                        executor_address: ContractAddress,\n                        custom_struct: CustomStruct\n                    ) -> felt252 {\n                        let safe_dispatcher = IExecutorDispatcher { contract_address: executor_address };\n                        safe_dispatcher.store_and_add_5(custom_struct)\n                    }\n                }\n            }\n            \"\n            )\n        ),\n        Contract::new(\n            \"Executor\",\n            indoc!(\n                r\"\n            #[derive(Drop, Serde, starknet::Store)]\n            struct NestedStruct {\n                d: felt252,\n            }\n\n            #[derive(Drop, Serde, starknet::Store)]\n            struct CustomStruct {\n                a: felt252,\n                b: felt252,\n                c: NestedStruct,\n            }\n\n            #[starknet::interface]\n            trait IExecutor<TContractState> {\n                fn store_and_add_5(ref self: TContractState, custom_struct: CustomStruct) -> felt252;\n                fn read_storage(ref self: TContractState) -> CustomStruct;\n            }\n\n            #[starknet::contract]\n            mod Executor {\n                use super::CustomStruct;\n                #[storage]\n                struct Storage {\n                    thing: CustomStruct\n                }\n\n                #[abi(embed_v0)]\n                impl ExecutorImpl of super::IExecutor<ContractState> {\n                    fn store_and_add_5(ref self: ContractState, custom_struct: CustomStruct) -> felt252 {\n                        self.thing.write(custom_struct);\n                        5 + self.thing.read().c.d\n                    }\n\n                    fn read_storage(ref self: ContractState) -> CustomStruct {\n                        self.thing.read()\n                    }\n                }\n            }\n            \"\n            )\n        )\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn proxy_dispatcher_panic() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use snforge_std::DeclareResultTrait;\n        use starknet::ContractAddress;\n        use snforge_std::{ declare, ContractClassTrait };\n        use core::panic_with_felt252;\n\n        fn deploy_contract(name: ByteArray, constructor_calldata: @Array<felt252>) -> ContractAddress {\n            let contract = declare(name).unwrap().contract_class();\n            let (contract_address, _) = contract.deploy(constructor_calldata).unwrap();\n            contract_address\n        }\n\n        #[starknet::interface]\n        trait ICaller<T> {\n            fn invoke_executor(ref self: T);\n        }\n\n        #[test]\n        fn proxy_dispatcher_panic() {\n            let executor_address = deploy_contract(\"Executor\", @ArrayTrait::new());\n            let caller_constructor_calldata: Array<felt252> = array![executor_address.into()];\n            let caller_address = deploy_contract(\"Caller\", @caller_constructor_calldata);\n\n            let caller_dispatcher = ICallerSafeDispatcher { contract_address: caller_address };\n\n            match caller_dispatcher.invoke_executor() {\n                Result::Ok(_) => panic_with_felt252('should have panicked'),\n                Result::Err(x) => assert(*x.at(0) == 'panic_msg', 'wrong panic msg')\n            }\n        }\n    \"#\n        ),\n        Contract::new(\n            \"Caller\",\n            indoc!(\n                r\"\n            #[starknet::interface]\n            trait ICaller<TContractState> {\n                fn invoke_executor(\n                    self: @TContractState,\n                );\n            }\n\n            #[starknet::contract]\n            mod Caller {\n                use starknet::ContractAddress;\n\n                #[starknet::interface]\n                trait IExecutor<T> {\n                    fn invoke_with_panic(self: @T);\n                }\n\n                #[storage]\n                struct Storage {\n                    executor_address: ContractAddress\n                }\n\n                #[constructor]\n                fn constructor(ref self: ContractState, executor_address: ContractAddress) {\n                    self.executor_address.write(executor_address);\n                }\n\n                #[abi(embed_v0)]\n                impl CallerImpl of super::ICaller<ContractState> {\n                    fn invoke_executor(\n                        self: @ContractState,\n                    ) {\n                        let dispatcher = IExecutorDispatcher { contract_address: self.executor_address.read() };\n                        dispatcher.invoke_with_panic()\n                    }\n                }\n            }\n            \"\n            )\n        ),\n        Contract::new(\n            \"Executor\",\n            indoc!(\n                r\"\n            #[starknet::interface]\n            trait IExecutor<TContractState> {\n                fn invoke_with_panic(ref self: TContractState);\n            }\n\n            #[starknet::contract]\n            mod Executor {\n                use core::panic_with_felt252;\n\n                #[storage]\n                struct Storage {}\n\n                #[abi(embed_v0)]\n                impl ExecutorImpl of super::IExecutor<ContractState> {\n                    fn invoke_with_panic(ref self: ContractState) {\n                        panic_with_felt252('panic_msg');\n                    }\n                }\n            }\n            \"\n            )\n        )\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn nonexistent_method_call() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use array::ArrayTrait;\n        use result::ResultTrait;\n        use option::OptionTrait;\n        use traits::TryInto;\n        use traits::Into;\n        use starknet::ContractAddress;\n        use starknet::Felt252TryIntoContractAddress;\n        use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n\n\n        fn deploy_contract(name: ByteArray, constructor_calldata: @Array<felt252>) -> ContractAddress {\n            let contract = declare(name).unwrap().contract_class();\n            let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n            contract_address\n        }\n\n        #[starknet::interface]\n        trait ICaller<T> {\n            fn invoke_nonexistent(ref self: T);\n        }\n\n        #[test]\n        fn nonexistent_method_call() {\n            let contract_address = deploy_contract(\"Contract\", @ArrayTrait::new());\n\n            let caller_dispatcher = ICallerDispatcher { contract_address };\n            caller_dispatcher.invoke_nonexistent();\n        }\n    \"#\n        ),\n        Contract::new(\n            \"Contract\",\n            indoc!(\n                r\"\n            #[starknet::contract]\n            mod Contract {\n                #[storage]\n                struct Storage {\n                }\n            }\n            \"\n            )\n        )\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_failed(&result);\n    assert_case_output_contains(\n        &result,\n        \"nonexistent_method_call\",\n        \"0x454e545259504f494e545f4e4f545f464f554e44 ('ENTRYPOINT_NOT_FOUND')\",\n    );\n}\n\n#[test]\nfn nonexistent_libcall_function() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use core::clone::Clone;\n        use array::ArrayTrait;\n        use result::ResultTrait;\n        use option::OptionTrait;\n        use traits::TryInto;\n        use traits::Into;\n        use starknet::ContractAddress;\n        use starknet::Felt252TryIntoContractAddress;\n        use starknet::ClassHash;\n        use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n\n        fn deploy_contract(name: ByteArray) -> ContractAddress {\n            let contract = declare(name).unwrap().contract_class();\n            let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n            contract_address\n        }\n\n        #[starknet::interface]\n        trait IContract<T> {\n            fn invoke_nonexistent_libcall_from_contract(ref self: T, class_hash: ClassHash);\n        }\n\n        #[test]\n        fn nonexistent_libcall_function() {\n            let class = declare(\"Contract\").unwrap().contract_class().clone();\n            let contract_address = deploy_contract(\"LibCaller\");\n\n            let dispatcher = IContractDispatcher { contract_address };\n            dispatcher.invoke_nonexistent_libcall_from_contract(class.class_hash);\n        }\n        \"#\n        ),\n        Contract::new(\n            \"LibCaller\",\n            indoc!(\n                r\"\n                use starknet::ClassHash;\n\n                #[starknet::interface]\n                trait IContract<TContractState> {\n                    fn invoke_nonexistent_libcall_from_contract(ref self: TContractState, class_hash: ClassHash);\n                }\n\n                #[starknet::contract]\n                mod LibCaller {\n                    use starknet::ClassHash;\n                    use result::ResultTrait;\n                    use array::ArrayTrait;\n\n                    #[storage]\n                    struct Storage {}\n\n                    #[starknet::interface]\n                    trait ICaller<T> {\n                        fn invoke_nonexistent(ref self: T);\n                    }\n\n                    #[abi(embed_v0)]\n                    impl ContractImpl of super::IContract<ContractState> {\n                        fn invoke_nonexistent_libcall_from_contract(ref self: ContractState, class_hash: ClassHash) {\n                            let lib_dispatcher = ICallerLibraryDispatcher { class_hash };\n\n                            lib_dispatcher.invoke_nonexistent();\n                        }\n                    }\n                }\n                \"\n            )\n        ),\n        Contract::new(\n            \"Contract\",\n            indoc!(\n                r\"\n            #[starknet::contract]\n            mod Contract {\n                #[storage]\n                struct Storage {\n                }\n            }\n            \"\n            )\n        )\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_failed(&result);\n\n    assert_case_output_contains(\n        &result,\n        \"nonexistent_libcall_function\",\n        \"0x454e545259504f494e545f4e4f545f464f554e44 ('ENTRYPOINT_NOT_FOUND')\",\n    );\n}\n\n#[test]\nfn undeclared_class_call() {\n    let test = test_case!(indoc!(\n        r\"\n        use starknet::ContractAddress;\n        use traits::TryInto;\n        use option::OptionTrait;\n\n        #[starknet::interface]\n        trait IContract<T> {\n            fn invoke_nonexistent(ref self: T);\n        }\n\n        #[test]\n        fn undeclared_class_call() {\n            let dispatcher = IContractDispatcher { contract_address: 5.try_into().unwrap() };\n            dispatcher.invoke_nonexistent();\n        }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_failed(&result);\n    assert_case_output_contains(\n        &result,\n        \"undeclared_class_call\",\n        \"Contract not deployed at address: 0x5\",\n    );\n}\n\n#[test]\nfn nonexistent_class_libcall() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use array::ArrayTrait;\n        use result::ResultTrait;\n        use option::OptionTrait;\n        use starknet::ContractAddress;\n        use starknet::ClassHash;\n        use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n\n        fn deploy_contract(name: ByteArray) -> ContractAddress {\n            let contract = declare(name).unwrap().contract_class();\n            let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n            contract_address\n        }\n\n        #[starknet::interface]\n        trait IContract<T> {\n            fn invoke_nonexistent_libcall_from_contract(ref self: T);\n        }\n\n        #[test]\n        fn test_nonexistent_libcall() {\n            let contract_address = deploy_contract(\"LibCaller\");\n            let dispatcher = IContractDispatcher { contract_address };\n            dispatcher.invoke_nonexistent_libcall_from_contract();\n        }\n        \"#\n        ),\n        Contract::new(\n            \"LibCaller\",\n            indoc!(\n                r\"\n                #[starknet::interface]\n                trait IContract<TContractState> {\n                    fn invoke_nonexistent_libcall_from_contract(ref self: TContractState);\n                }\n\n                #[starknet::contract]\n                mod LibCaller {\n                    use starknet::class_hash::class_hash_try_from_felt252;\n                    use starknet::ClassHash;\n                    use result::ResultTrait;\n                    use array::ArrayTrait;\n                    use traits::TryInto;\n                    use option::OptionTrait;\n\n                    #[storage]\n                    struct Storage {}\n\n                    #[starknet::interface]\n                    trait ICaller<T> {\n                        fn invoke_nonexistent(ref self: T);\n                    }\n\n                    #[abi(embed_v0)]\n                    impl ContractImpl of super::IContract<ContractState> {\n                        fn invoke_nonexistent_libcall_from_contract(ref self: ContractState) {\n                            let target_class_hash: ClassHash = class_hash_try_from_felt252(5_felt252).unwrap();\n                            let lib_dispatcher = ICallerLibraryDispatcher { class_hash: target_class_hash  };\n                            lib_dispatcher.invoke_nonexistent();\n                        }\n                    }\n                }\n                \"\n            )\n        ),\n        Contract::new(\n            \"Contract\",\n            indoc!(\n                r\"\n            #[starknet::contract]\n            mod Contract {\n                #[storage]\n                struct Storage {\n                }\n            }\n            \"\n            )\n        )\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_failed(&result);\n    assert_case_output_contains(&result, \"test_nonexistent_libcall\", \"Class with hash\");\n    assert_case_output_contains(&result, \"test_nonexistent_libcall\", \"is not declared.\");\n}\n\n#[test]\nfn dispatcher_in_nested_call() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use snforge_std::{ContractClassTrait, DeclareResultTrait, declare};\n        use starknet::ContractAddress;\n\n        #[starknet::interface]\n        pub trait ITop<TContractState> {\n            fn call_panic_contract(\n                self: @TContractState, panic_contract_address: starknet::ContractAddress,\n            );\n        }\n\n        fn deploy_contracts() -> (ContractAddress, ContractAddress) {\n            let contract = declare(\"Top\").unwrap().contract_class();\n            let (top_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n\n            let contract = declare(\"Nested\").unwrap().contract_class();\n            let (nested_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n\n            (top_address, nested_address)\n        }\n\n        #[test]\n        fn test_error_handled_inside_contract() {\n            let (top_address, nested_address) = deploy_contracts();\n\n            let dispatcher = ITopDispatcher { contract_address: top_address };\n\n            dispatcher.call_panic_contract(nested_address);\n        }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"Top\".to_string(),\n            Path::new(\"tests/data/contracts/catching_error.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"Nested\".to_string(),\n            Path::new(\"tests/data/contracts/catching_error.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/env.rs",
    "content": "use crate::utils::running_tests::run_test_case;\nuse crate::utils::{\n    runner::{assert_case_output_contains, assert_failed, assert_passed},\n    test_case,\n};\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\nuse num_bigint::BigUint;\nuse starknet_types_core::felt::Felt;\n\n#[test]\nfn read_short_string() {\n    let mut test = test_case!(indoc!(\n        r#\"\n        use snforge_std::env::var;\n\n        #[test]\n        fn read_short_string() {\n            let result = var(\"MY_ENV_VAR\");\n            assert(result == array!['env_var_value'], 'failed reading env var');\n        }\n    \"#\n    ));\n    test.set_env(\"MY_ENV_VAR\", \"'env_var_value'\");\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn read_felt252() {\n    let mut test = test_case!(indoc!(\n        r#\"\n        use snforge_std::env::var;\n\n        #[test]\n        fn read_felt252() {\n            let result = var(\"MY_ENV_VAR\");\n            assert(result == array![1234567], 'failed reading env var');\n        }\n    \"#\n    ));\n    test.set_env(\"MY_ENV_VAR\", \"1234567\");\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn read_bytearray() {\n    let mut test = test_case!(indoc!(\n        r#\"\n        use snforge_std::env::var;\n\n        #[test]\n        fn read_bytearray() {\n            let mut result = var(\"MY_ENV_VAR\").span();\n            let result_bytearray = Serde::<ByteArray>::deserialize(ref result).unwrap();\n            assert(result_bytearray == \"very long string literal very very long very very long\", 'failed reading env var');\n        }\n    \"#\n    ));\n    test.set_env(\n        \"MY_ENV_VAR\",\n        r#\"\"very long string literal very very long very very long\"\"#,\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn read_overflow_felt252() {\n    let mut test = test_case!(indoc!(\n        r#\"\n        use snforge_std::env::var;\n\n        #[test]\n        fn read_overflow_felt252() {\n            let result = var(\"MY_ENV_VAR\");\n            assert(result == array![1], '');\n        }\n    \"#\n    ));\n\n    let value = (Felt::prime() + BigUint::from(1_u32)).to_string();\n    test.set_env(\"MY_ENV_VAR\", &value);\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn read_invalid_short_string() {\n    let mut test = test_case!(indoc!(\n        r#\"\n        use snforge_std::env::var;\n\n        #[test]\n        fn read_invalid_short_string() {\n            var(\"MY_ENV_VAR\");\n        }\n    \"#\n    ));\n\n    let value =\n        \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\";\n    test.set_env(\"MY_ENV_VAR\", value);\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_failed(&result);\n    assert_case_output_contains(\n        &result,\n        \"read_invalid_short_string\",\n        &format!(\"Failed to parse value = {value} to felt\"),\n    );\n}\n\n#[test]\nfn read_non_existent() {\n    let test = test_case!(indoc!(\n        r#\"\n        use snforge_std::env::var;\n\n        #[test]\n        fn read_invalid_short_string() {\n            var(\"MY_ENV_VAR\");\n        }\n    \"#\n    ));\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_failed(&result);\n    assert_case_output_contains(\n        &result,\n        \"read_invalid_short_string\",\n        \"Failed to read from env var = MY_ENV_VAR\",\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/fuzzing.rs",
    "content": "use crate::utils::runner::{TestCase, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse forge_runner::test_case_summary::{AnyTestCaseSummary, TestCaseSummary};\nuse indoc::indoc;\n\nconst ALLOWED_ERROR: f64 = 0.05;\n\n#[test]\nfn fuzzed_argument() {\n    let test = test_case!(indoc!(\n        r\"\n        fn adder(a: felt252, b: felt252) -> felt252 {\n            a + b\n        }\n\n        #[test]\n        #[fuzzer]\n        fn fuzzed_argument(b: felt252) {\n            let result = adder(2, b);\n            assert(result == 2 + b, '2 + b == 2 + b');\n        }\n    \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn fuzzer_different_types() {\n    let test = test_case!(indoc!(\n        r\"\n        #[test]\n        #[fuzzer]\n        fn fuzzer_different_types(a: u256) {\n            if a <= 5_u256 {\n                assert(2 == 2, '2 == 2');\n            } else {\n                let x = a - 5_u256;\n                assert(x == a - 5_u256, 'x != a - 5');\n            }\n        }\n    \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn fuzzed_while_loop() {\n    let test = test_case!(indoc!(\n        r\"\n        #[test]\n        #[fuzzer(runs: 256, seed: 100)]\n        fn fuzzed_while_loop(a: u8) {\n            let mut i: u8 = 0;\n            while i != a {\n                i += 1;\n            };\n\n            assert(1 == 1, '');\n        }\n    \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    let test_target_summary = TestCase::find_test_result(&result);\n    let AnyTestCaseSummary::Fuzzing(TestCaseSummary::Passed { gas_info, .. }) =\n        &test_target_summary.test_case_summaries[0]\n    else {\n        panic!()\n    };\n\n    // TODO (#2926)\n    assert_eq!(gas_info.l1_gas.min, 0);\n    assert_eq!(gas_info.l1_gas.max, 0);\n    assert!(gas_info.l1_gas.mean < ALLOWED_ERROR);\n    assert!(gas_info.l1_gas.std_deviation < ALLOWED_ERROR);\n    assert_eq!(gas_info.l1_data_gas.min, 0);\n    assert_eq!(gas_info.l1_data_gas.max, 0);\n    assert!(gas_info.l1_data_gas.mean < ALLOWED_ERROR);\n    assert!(gas_info.l1_data_gas.std_deviation < ALLOWED_ERROR);\n    // different scarbs yield different results here, we do not care about the values that much\n    assert!(gas_info.l2_gas.min < gas_info.l2_gas.max);\n    assert!(gas_info.l2_gas.mean > 0.0);\n    assert!(gas_info.l2_gas.std_deviation > 0.0);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/gas.rs",
    "content": "use crate::utils::runner::{Contract, assert_gas, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::{formatdoc, indoc};\nuse scarb_api::version::scarb_version;\nuse semver::Version;\nuse shared::test_utils::node_url::node_rpc_url;\nuse starknet_api::execution_resources::{GasAmount, GasVector};\nuse std::path::Path;\n\n// all calculations are based on formulas from\n// https://docs.starknet.io/architecture-and-concepts/fees/#overall_fee\n// important info from this link regarding gas calculations:\n// 1 cairo step = 0.0025 L1 gas = 100 L2 gas\n// 1 sierra gas = 1 l2 gas\n// Costs of syscalls (if provided) are taken from versioned_constants (blockifier)\n// In Sierra gas tests, only the most significant costs are considered\n// Asserted values should be slightly greater than the computed values,\n// but must remain within a reasonable range\n\n#[test]\nfn declare_cost_is_omitted_cairo_steps() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::declare;\n\n            #[test]\n            fn declare_cost_is_omitted() {\n                declare(\"GasChecker\").unwrap();\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"GasChecker\".to_string(),\n            Path::new(\"tests/data/contracts/gas_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n    // 1 = cost of 230 steps (because int(0.0025 * 230) = 1)\n    //      -> as stated in the top comment, 1 cairo step = 0.0025 L1 gas = 100 L2 gas\n    //         0.0025 * 230 = 0,575 (BUT rounding up to 1, since this is as little as possible)\n    //         since 230 steps = 1 gas, to convert this to l2 gas we need to multiply by 40000 (100/0.0025)\n    // 0 l1_gas + 0 l1_data_gas + 1 * (100 / 0.0025) l2 gas\n    assert_gas(\n        &result,\n        \"declare_cost_is_omitted\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(0),\n            l2_gas: GasAmount(40000),\n        },\n    );\n}\n\n#[test]\nfn deploy_syscall_cost_cairo_steps() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{declare, DeclareResultTrait};\n            use starknet::syscalls::deploy_syscall;\n\n            #[test]\n            fn deploy_syscall_cost() {\n                let contract = declare(\"GasConstructorChecker\").unwrap().contract_class().clone();\n                let (address, _) = deploy_syscall(contract.class_hash, 0, array![1].span(), false).unwrap();\n                assert(address != 0.try_into().unwrap(), 'wrong deployed addr');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"GasConstructorChecker\".to_string(),\n            Path::new(\"tests/data/contracts/gas_constructor_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n    // l = 1 (updated contract class)\n    // n = 1 (unique contracts updated - in this case it's the new contract address)\n    // ( l + n * 2 ) * felt_size_in_bytes(32) = 96 (total l1 data cost)\n    // 11 = cost of 2 keccak builtins from constructor (because int(5.12 * 2) = 11)\n    // 0 l1_gas + 96 l1_data_gas + 11 * (100 / 0.0025) l2 gas\n    assert_gas(\n        &result,\n        \"deploy_syscall_cost\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(96),\n            l2_gas: GasAmount(440_000),\n        },\n    );\n}\n\n#[test]\nfn snforge_std_deploy_cost_cairo_steps() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n\n            #[test]\n            fn deploy_cost() {\n                let contract = declare(\"GasConstructorChecker\").unwrap().contract_class();\n                let (address, _) = contract.deploy(@array![1]).unwrap();\n                assert(address != 0.try_into().unwrap(), 'wrong deployed addr');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"GasConstructorChecker\".to_string(),\n            Path::new(\"tests/data/contracts/gas_constructor_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n    // 96 = gas cost of onchain data (deploy cost)\n    // 11 = cost of 2 keccak builtins = 11 (because int(5.12 * 2) = 11)\n    // 0 l1_gas + 96 l1_data_gas + 11 * (100 / 0.0025) l2 gas\n    assert_gas(\n        &result,\n        \"deploy_cost\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(96),\n            l2_gas: GasAmount(440_000),\n        },\n    );\n}\n\n#[test]\nfn keccak_cost_cairo_steps() {\n    let test = test_case!(indoc!(\n        r\"\n            #[test]\n            fn keccak_cost() {\n                keccak::keccak_u256s_le_inputs(array![1].span());\n            }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n    // 6 = cost of 1 keccak builtin (because int(5.12 * 1) = 6)\n    // 0 l1_gas + 0 l1_data_gas + 6 * (100 / 0.0025) l2 gas\n    assert_gas(\n        &result,\n        \"keccak_cost\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(0),\n            l2_gas: GasAmount(240_000),\n        },\n    );\n}\n\n#[test]\nfn contract_keccak_cost_cairo_steps() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n\n            #[starknet::interface]\n            trait IGasChecker<TContractState> {\n                fn keccak(self: @TContractState, repetitions: u32);\n            }\n\n            #[test]\n            fn contract_keccak_cost() {\n                let contract = declare(\"GasChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = IGasCheckerDispatcher { contract_address };\n\n                dispatcher.keccak(7);\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"GasChecker\".to_string(),\n            Path::new(\"tests/data/contracts/gas_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n    assert_passed(&result);\n    // 96 = cost of deploy (see snforge_std_deploy_cost test)\n    // 26 = cost of 5 keccak builtins (because int(5.12 * 7) = 36)\n    // 0 l1_gas + 96 l1_data_gas + 36 * (100 / 0.0025) l2 gas\n    assert_gas(\n        &result,\n        \"contract_keccak_cost\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(96),\n            l2_gas: GasAmount(1_440_000),\n        },\n    );\n}\n\n#[test]\nfn range_check_cost_cairo_steps() {\n    let test = test_case!(indoc!(\n        r\"\n            #[test]\n            fn range_check_cost() {\n                assert(1_u8 >= 1_u8, 'error message');\n            }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n    // 1 = cost of 1 range check builtin (because int(0.04 * 1) = 1)\n    // 0 l1_gas + 0 l1_data_gas + 1 * (100 / 0.0025) l2 gas\n    assert_gas(\n        &result,\n        \"range_check_cost\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(0),\n            l2_gas: GasAmount(40000),\n        },\n    );\n}\n\n#[test]\nfn contract_range_check_cost_cairo_steps() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n\n            #[starknet::interface]\n            trait IGasChecker<TContractState> {\n                fn range_check(self: @TContractState);\n            }\n\n            #[test]\n            fn contract_range_check_cost() {\n                let contract = declare(\"GasChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = IGasCheckerDispatcher { contract_address };\n\n                dispatcher.range_check();\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"GasChecker\".to_string(),\n            Path::new(\"tests/data/contracts/gas_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n\n    let scarb_version = scarb_version().expect(\"Failed to get scarb version\").scarb;\n\n    // TODO(#4087): Remove this when bumping minimal recommended Scarb version to 2.14.0\n    if scarb_version >= Version::new(2, 14, 0) {\n        // 96 = cost of deploy (see snforge_std_deploy_cost test)\n        // 43 = cost of 1052 range check builtins (because int(0.04 * 1052) = 43)\n        // 0 l1_gas + 96 l1_data_gas + 43 * (100 / 0.0025) l2 gas\n        assert_gas(\n            &result,\n            \"contract_range_check_cost\",\n            GasVector {\n                l1_gas: GasAmount(0),\n                l1_data_gas: GasAmount(96),\n                l2_gas: GasAmount(1_720_000),\n            },\n        );\n    } else {\n        assert_gas(\n            &result,\n            \"contract_range_check_cost\",\n            GasVector {\n                l1_gas: GasAmount(0),\n                l1_data_gas: GasAmount(96),\n                l2_gas: GasAmount(6_520_000),\n            },\n        );\n    }\n}\n\n#[test]\nfn bitwise_cost_cairo_steps() {\n    let test = test_case!(indoc!(\n        r\"\n            #[test]\n            fn bitwise_cost() {\n                let _bitwise = 1_u8 & 1_u8;\n                assert(1 == 1, 'error message');\n            }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n    // 1 = cost of 1 bitwise builtin, because int(0.16 * 1) = 1\n    // 0 l1_gas + 0 l1_data_gas + 1 * (100 / 0.0025) l2 gas\n    assert_gas(\n        &result,\n        \"bitwise_cost\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(0),\n            l2_gas: GasAmount(40000),\n        },\n    );\n}\n\n/// We have to use 6 bitwise operations in the `bitwise` function to exceed steps cost\n#[test]\nfn contract_bitwise_cost_cairo_steps() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n\n            #[starknet::interface]\n            trait IGasChecker<TContractState> {\n                fn bitwise(self: @TContractState, repetitions: u32);\n            }\n\n            #[test]\n            fn contract_bitwise_cost() {\n                let contract = declare(\"GasChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = IGasCheckerDispatcher { contract_address };\n\n                dispatcher.bitwise(300);\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"GasChecker\".to_string(),\n            Path::new(\"tests/data/contracts/gas_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n    // 96 = cost of deploy l1 cost (see snforge_std_deploy_cost test)\n    // 96 = cost of 600 bitwise builtins (because int(0.16 * 600) = 96)\n    // 0 l1_gas + 96 l1_data_gas + 96 * (100 / 0.0025) l2 gas\n    assert_gas(\n        &result,\n        \"contract_bitwise_cost\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(96),\n            l2_gas: GasAmount(3_840_000),\n        },\n    );\n}\n\n#[test]\nfn pedersen_cost_cairo_steps() {\n    let test = test_case!(indoc!(\n        r\"\n            #[test]\n            fn pedersen_cost() {\n                core::pedersen::pedersen(1, 2);\n                assert(1 == 1, 'error message');\n            }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n    // 1 = cost of 1 pedersen builtin (because int(0.16 * 1) = 1)\n    // 0 l1_gas + 0 l1_data_gas + 1 * (100 / 0.0025) l2 gas\n    assert_gas(\n        &result,\n        \"pedersen_cost\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(0),\n            l2_gas: GasAmount(40000),\n        },\n    );\n}\n\n/// We have to use 12 pedersen operations in the `pedersen` function to exceed steps cost\n#[test]\nfn contract_pedersen_cost_cairo_steps() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n\n            #[starknet::interface]\n            trait IGasChecker<TContractState> {\n                fn pedersen(self: @TContractState);\n            }\n\n            #[test]\n            fn contract_pedersen_cost() {\n                let contract = declare(\"GasChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = IGasCheckerDispatcher { contract_address };\n\n                dispatcher.pedersen();\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"GasChecker\".to_string(),\n            Path::new(\"tests/data/contracts/gas_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n    // 96 = cost of deploy (see snforge_std_deploy_cost test)\n    // 10 = cost of 125 pedersen builtins (because int(0.08 * 125) = 10)\n    // 0 l1_gas + 96 l1_data_gas + 10 * (100 / 0.0025) l2 gas\n    assert_gas(\n        &result,\n        \"contract_pedersen_cost\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(96),\n            l2_gas: GasAmount(400_000),\n        },\n    );\n}\n\n#[test]\nfn poseidon_cost_cairo_steps() {\n    let test = test_case!(indoc!(\n        r\"\n            #[test]\n            fn poseidon_cost() {\n                core::poseidon::hades_permutation(0, 0, 0);\n                assert(1 == 1, 'error message');\n            }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n    // 1 = cost of 1 poseidon builtin (because int(0.08 * 1) = 1)\n    // 0 l1_gas + 0 l1_data_gas + 1 * (100 / 0.0025) l2 gas\n    assert_gas(\n        &result,\n        \"poseidon_cost\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(0),\n            l2_gas: GasAmount(40000),\n        },\n    );\n}\n\n/// We have to use 12 poseidon operations in the `poseidon` function to exceed steps cost\n#[test]\nfn contract_poseidon_cost_cairo_steps() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n\n            #[starknet::interface]\n            trait IGasChecker<TContractState> {\n                fn poseidon(self: @TContractState);\n            }\n\n            #[test]\n            fn contract_poseidon_cost() {\n                let contract = declare(\"GasChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = IGasCheckerDispatcher { contract_address };\n\n                dispatcher.poseidon();\n                dispatcher.poseidon();\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"GasChecker\".to_string(),\n            Path::new(\"tests/data/contracts/gas_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n    // 96 = cost of deploy (see snforge_std_deploy_cost test)\n    // 13 = cost of 160 poseidon builtins (because int(0.08 * 160) = 13)\n    // 0 l1_gas + 96 l1_data_gas + 13 * (100 / 0.0025) l2 gas\n    assert_gas(\n        &result,\n        \"contract_poseidon_cost\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(96),\n            l2_gas: GasAmount(520_000),\n        },\n    );\n}\n\n#[test]\nfn ec_op_cost_cairo_steps() {\n    let test = test_case!(indoc!(\n        r\"\n            use core::{ec, ec::{EcPoint, EcPointTrait}};\n\n            #[test]\n            fn ec_op_cost() {\n                EcPointTrait::new_from_x(1).unwrap().mul(2);\n                assert(1 == 1, 'error message');\n            }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n    // 3 = cost of 1 ec_op builtin (because int(2.56 * 1) = 3)\n    // 0 l1_gas + 0 l1_data_gas + 3 * (100 / 0.0025) l2 gas\n    assert_gas(\n        &result,\n        \"ec_op_cost\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(0),\n            l2_gas: GasAmount(120_000),\n        },\n    );\n}\n\n#[test]\nfn contract_ec_op_cost_cairo_steps() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n\n            #[starknet::interface]\n            trait IGasChecker<TContractState> {\n                fn ec_op(self: @TContractState, repetitions: u32);\n            }\n\n            #[test]\n            fn contract_ec_op_cost() {\n                let contract = declare(\"GasChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = IGasCheckerDispatcher { contract_address };\n\n                dispatcher.ec_op(10);\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"GasChecker\".to_string(),\n            Path::new(\"tests/data/contracts/gas_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n    // 96 = cost of deploy (see snforge_std_deploy_cost test)\n    // 26 = cost of 10 ec_op builtins (because int(2.56 * 10) = 26)\n    // 0 l1_gas + 96 l1_data_gas + 26 * (100 / 0.0025) l2 gas\n    assert_gas(\n        &result,\n        \"contract_ec_op_cost\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(96),\n            l2_gas: GasAmount(1_040_000),\n        },\n    );\n}\n\n#[test]\nfn storage_write_cost_cairo_steps() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n\n            #[starknet::interface]\n            trait IGasChecker<TContractState> {\n                fn change_balance(ref self: TContractState, new_balance: u64);\n            }\n\n            #[test]\n            fn storage_write_cost() {\n                let contract = declare(\"GasChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = IGasCheckerDispatcher { contract_address };\n\n                dispatcher.change_balance(1);\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"GasChecker\".to_string(),\n            Path::new(\"tests/data/contracts/gas_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n    // 2853 * 0.0025 = 7.13 ~ 8 = gas cost of steps\n    // 96 = gas cost of deployment\n    // storage_updates(1) * 2 * 32 = 64\n    // storage updates from zero value(1) * 32 = 32 (https://community.starknet.io/t/starknet-v0-13-4-pre-release-notes/115257#p-2358763-da-costs-27)\n    // allocation cost: 402_000 l2 gas\n    // 0 l1_gas + (96 + 64 + 32) l1_data_gas + 8 * (100 / 0.0025) + 402_000 l2 gas\n    assert_gas(\n        &result,\n        \"storage_write_cost\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(192),\n            l2_gas: GasAmount(722_000),\n        },\n    );\n}\n\n#[test]\nfn storage_write_from_test_cost_cairo_steps() {\n    let test = test_case!(indoc!(\n        r\"\n        #[starknet::contract]\n        mod Contract {\n            #[storage]\n            struct Storage {\n                balance: felt252,\n            }\n        }\n\n\n        #[test]\n        fn storage_write_from_test_cost() {\n            let mut state = Contract::contract_state_for_testing();\n            state.balance.write(10);\n        }\n    \"\n    ),);\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n    // 521 * 0.0025 = 1.3025 ~ 2 = gas cost of steps\n    // n = unique contracts updated\n    // m = values updated\n    // So, as per formula:\n    // n(1) * 2 * 32 = 64\n    // m(1) * 2 * 32 = 64\n    // storage updates from zero value(1) * 32 = 32 (https://community.starknet.io/t/starknet-v0-13-4-pre-release-notes/115257#p-2358763-da-costs-27)\n    // allocation cost: 402_000 l2 gas\n    // 0 l1_gas + (64 + 64 + 32) l1_data_gas + 2 * (100 / 0.0025) + 402_000 l2 gas\n    assert_gas(\n        &result,\n        \"storage_write_from_test_cost\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(160),\n            l2_gas: GasAmount(482_000),\n        },\n    );\n}\n\n#[test]\nfn multiple_storage_writes_cost_cairo_steps() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n\n            #[starknet::interface]\n            trait IGasChecker<TContractState> {\n                fn change_balance(ref self: TContractState, new_balance: u64);\n            }\n\n            #[test]\n            fn multiple_storage_writes_cost() {\n                let contract = declare(\"GasChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = IGasCheckerDispatcher { contract_address };\n\n                dispatcher.change_balance(1);\n                dispatcher.change_balance(1);\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"GasChecker\".to_string(),\n            Path::new(\"tests/data/contracts/gas_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n    // 4264 * 0.0025 = 10.66 ~ 11 = gas cost of steps\n    // l = number of class hash updates\n    // n = unique contracts updated\n    // m = unique(!) values updated\n    // So, as per formula:\n    // n(1) * 2 * 32 = 64\n    // m(1) * 2 * 32 = 64\n    // l(1) * 32 = 32\n    // storage updates from zero value(1) * 32 = 32 (https://community.starknet.io/t/starknet-v0-13-4-pre-release-notes/115257#p-2358763-da-costs-27)\n    // allocation cost: 402_000 l2 gas\n    // 0 l1_gas + (64 + 64 + 32 + 32) l1_data_gas + 11 * (100 / 0.0025) + 402_000 l2 gas\n    assert_gas(\n        &result,\n        \"multiple_storage_writes_cost\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(192),\n            l2_gas: GasAmount(842_000),\n        },\n    );\n}\n\n#[test]\nfn l1_message_cost_cairo_steps() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n\n            #[starknet::interface]\n            trait IGasChecker<TContractState> {\n                fn send_l1_message(self: @TContractState);\n            }\n\n            #[test]\n            fn l1_message_cost() {\n                let contract = declare(\"GasChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = IGasCheckerDispatcher { contract_address };\n\n                dispatcher.send_l1_message();\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"GasChecker\".to_string(),\n            Path::new(\"tests/data/contracts/gas_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n    // 2614 * 0.0025 = 6.535 ~ 7 = gas cost of steps\n    // 96 = gas cost of deployment\n    // 29524 = gas cost of onchain data\n    // 29524 l1_gas + 96 l1_data_gas + 7 * (100 / 0.0025) l2 gas\n    assert_gas(\n        &result,\n        \"l1_message_cost\",\n        GasVector {\n            l1_gas: GasAmount(29524),\n            l1_data_gas: GasAmount(96),\n            l2_gas: GasAmount(280_000),\n        },\n    );\n}\n\n#[test]\nfn l1_message_from_test_cost_cairo_steps() {\n    let test = test_case!(indoc!(\n        r\"\n        #[test]\n        fn l1_message_from_test_cost() {\n            starknet::send_message_to_l1_syscall(1, array![1].span()).unwrap();\n        }\n    \"\n    ),);\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n    // 224 * 0.0025 = 0.56 ~ 1 = gas cost of steps\n    // 26764 = gas cost of onchain data\n    // 26764 l1_gas + 0 l1_data_gas + 1 * (100 / 0.0025) l2 gas\n    assert_gas(\n        &result,\n        \"l1_message_from_test_cost\",\n        GasVector {\n            l1_gas: GasAmount(26764),\n            l1_data_gas: GasAmount(0),\n            l2_gas: GasAmount(40000),\n        },\n    );\n}\n\n#[test]\nfn l1_message_cost_for_proxy_cairo_steps() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use starknet::ContractAddress;\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n\n            #[starknet::interface]\n            trait IGasCheckerProxy<TContractState> {\n                fn send_l1_message_from_gas_checker(\n                    self: @TContractState,\n                    address: ContractAddress\n                );\n            }\n\n            #[test]\n            fn l1_message_cost_for_proxy() {\n                let contract = declare(\"GasChecker\").unwrap().contract_class();\n                let (gas_checker_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n\n                let contract = declare(\"GasCheckerProxy\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = IGasCheckerProxyDispatcher { contract_address };\n\n                dispatcher.send_l1_message_from_gas_checker(gas_checker_address);\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"GasChecker\".to_string(),\n            Path::new(\"tests/data/contracts/gas_checker.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"GasCheckerProxy\".to_string(),\n            Path::new(\"tests/data/contracts/gas_checker_proxy.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n    // (4960 steps + 28 memory holes) * 0.0025 = 12.47 ~ 13 = gas cost of steps\n    // l = number of class hash updates\n    // n = unique contracts updated\n    // So, as per formula:\n    // n(2) * 2 * 32 = 128\n    // l(2) * 32 = 64\n    // 29524 = gas cost of message\n    // 29524 l1_gas + (128 + 64) l1_data_gas + 13 * (100 / 0.0025) l2 gas\n    assert_gas(\n        &result,\n        \"l1_message_cost_for_proxy\",\n        GasVector {\n            l1_gas: GasAmount(29524),\n            l1_data_gas: GasAmount(192),\n            l2_gas: GasAmount(520_000),\n        },\n    );\n}\n\n#[test]\nfn l1_handler_cost_cairo_steps() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, L1HandlerTrait };\n\n            #[test]\n            fn l1_handler_cost() {\n                let contract = declare(\"GasChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@array![]).unwrap();\n\n                let mut l1_handler = L1HandlerTrait::new(contract_address, selector!(\"handle_l1_message\"));\n\n                l1_handler.execute(123, array![].span()).unwrap();\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"GasChecker\".to_string(),\n            Path::new(\"tests/data/contracts/gas_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n    assert_passed(&result);\n    // 96 = gas cost of onchain data (deploy cost)\n    // int(5.12 * 4) = 21 = keccak cost from l1 handler\n    // in this test, l1_handler_payload_size = 6\n    // 15923 = 12251 (gas used for processing L1<>L2 messages on L1) + 3672 (SHARP gas, 6 * 612)\n    // https://github.com/starkware-libs/sequencer/blob/028db0341378147037b5e7236d8e136e4ca7c30d/crates/blockifier/src/fee/resources.rs#L338-L340\n    // 12251 = 3072 (6 * 512, 512 is gas per memory word) +\n    //         + 4179 (cost of `ConsumedMessageToL2` event for payload with length 6:\n    //              -> 375 const opcode cost\n    //              -> 4 * 375 topics cost (fromAddress, toAddress, selector and 1 default)\n    //              -> 9 * 256 data array cost (payload length, nonce and 2 required solidity params for array)\n    //         + 5000 (gas per counter decrease, fixed cost of L1 -> L2 message)\n    //\n    // 15923 l1_gas + 96 l1_data_gas + 21 * (100 / 0.0025) l2 gas\n    assert_gas(\n        &result,\n        \"l1_handler_cost\",\n        GasVector {\n            l1_gas: GasAmount(15923),\n            l1_data_gas: GasAmount(96),\n            l2_gas: GasAmount(840_000),\n        },\n    );\n}\n\n#[test]\nfn events_cost_cairo_steps() {\n    let test = test_case!(indoc!(\n        r\"\n            use starknet::syscalls::emit_event_syscall;\n            #[test]\n            fn events_cost() {\n                let mut keys = array![];\n                let mut values =  array![];\n\n                let mut i: u32 = 0;\n                while i < 50 {\n                    keys.append('key');\n                    values.append(1);\n                    i += 1;\n                };\n\n                emit_event_syscall(keys.span(), values.span()).unwrap();\n            }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n    // 105 range_check_builtin = 105 * 0.04 = 4.2 = ~5\n    // 768_000 gas for 50 events\n    //      512_000 = 10_240 * 50 (gas from 50 event keys)\n    //      256_000 = 5120 * 50 (gas from 50 event data)\n    // 0 l1_gas + 0 l1_data_gas + ((5) * (100 / 0.0025) + 768_000) l2 gas\n    assert_gas(\n        &result,\n        \"events_cost\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(0),\n            l2_gas: GasAmount(968_000),\n        },\n    );\n}\n\n#[test]\nfn events_contract_cost_cairo_steps() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n\n            #[starknet::interface]\n            trait IGasChecker<TContractState> {\n                fn emit_event(ref self: TContractState, n_keys_and_vals: u32);\n            }\n\n            #[test]\n            fn event_emission_cost() {\n                let (contract_address, _) = declare(\"GasChecker\").unwrap().contract_class().deploy(@array![]).unwrap();\n                let dispatcher = IGasCheckerDispatcher { contract_address };\n\n                dispatcher.emit_event(50);\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"GasChecker\",\n            Path::new(\"tests/data/contracts/gas_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n    assert_passed(&result);\n    // (3736 steps + 14 memory holes) * 0.0025 = 9.375 ~ 10 = gas cost of steps\n    // 96 = gas cost of onchain data (deploy cost)\n    // 768_000 gas for 50 events\n    //      512_000 = 10_240 * 50 (gas from 50 event keys)\n    //      256_000 = 5120 * 50 (gas from 50 event data)\n    // 0 l1_gas + 96 l1_data_gas + (10 * (100 / 0.0025) + 768_000) l2 gas\n    assert_gas(\n        &result,\n        \"event_emission_cost\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(96),\n            l2_gas: GasAmount(1_168_000),\n        },\n    );\n}\n\n#[test]\nfn nested_call_cost_cairo_steps() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{ContractClassTrait, DeclareResultTrait, declare};\n            use starknet::{ContractAddress, SyscallResult};\n\n            #[starknet::interface]\n            trait IGasCheckerProxy<TContractState> {\n                fn call_other_contract(\n                    self: @TContractState,\n                    contract_address: ContractAddress,\n                    entry_point_selector: felt252,\n                    calldata: Array::<felt252>,\n                ) -> SyscallResult<Span<felt252>>;\n            }\n\n            fn deploy_contract(name: ByteArray) -> ContractAddress {\n                let contract = declare(name).unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                contract_address\n            }\n\n            #[test]\n            fn test_call_other_contract() {\n                let contract_address_a = deploy_contract(\"GasCheckerProxy\");\n                let contract_address_b = deploy_contract(\"GasCheckerProxy\");\n                let hello_starknet_address = deploy_contract(\"HelloStarknet\");\n\n                let dispatcher_a = IGasCheckerProxyDispatcher { contract_address: contract_address_a };\n                let _ = dispatcher_a\n                    .call_other_contract(\n                        contract_address_b,\n                        selector!(\"call_other_contract\"),\n                        array![hello_starknet_address.into(), selector!(\"example_function\"), 0],\n                    );\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"HelloStarknet\".to_string(),\n            Path::new(\"tests/data/contracts/hello_starknet_for_nested_calls.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"GasCheckerProxy\".to_string(),\n            Path::new(\"tests/data/contracts/gas_checker_proxy.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n    // int(1121 * 0.16) = 180 = gas cost of bitwise builtins\n    // 96 * 3 = gas cost of onchain data (deploy cost)\n    // ~1 gas for 1 event key\n    // ~1 gas for 1 event data\n    // 0 l1_gas + (96 * 3) l1_data_gas + 180 * (100 / 0.0025) + 1 * 10240 + 1 * 5120 l2 gas\n    assert_gas(\n        &result,\n        \"test_call_other_contract\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(288),\n            l2_gas: GasAmount(7_215_360),\n        },\n    );\n}\n\n#[test]\nfn nested_call_cost_in_forked_contract_cairo_steps() {\n    let test = test_case!(\n        formatdoc!(\n            r#\"\n            use snforge_std::{{ContractClassTrait, DeclareResultTrait, declare}};\n            use starknet::{{ContractAddress, SyscallResult}};\n\n            #[starknet::interface]\n            trait IGasCheckerProxy<TContractState> {{\n                fn call_other_contract(\n                    self: @TContractState,\n                    contract_address: ContractAddress,\n                    entry_point_selector: felt252,\n                    calldata: Array::<felt252>,\n                ) -> SyscallResult<Span<felt252>>;\n            }}\n\n            fn deploy_contract(name: ByteArray) -> ContractAddress {{\n                let contract = declare(name).unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                contract_address\n            }}\n\n            #[test]\n            #[fork(url: \"{}\", block_number: 861_389)]\n            fn test_call_other_contract_fork() {{\n                let contract_address_a = deploy_contract(\"GasCheckerProxy\");\n                let contract_address_b = deploy_contract(\"GasCheckerProxy\");\n                let hello_starknet_address: ContractAddress = 0x07f01bbebed8dfeb60944bd9273e2bd844e39b0106eb6ca05edaeee95a817c64.try_into().unwrap();\n\n                let dispatcher_a = IGasCheckerProxyDispatcher {{ contract_address: contract_address_a }};\n                let _ = dispatcher_a\n                    .call_other_contract(\n                        contract_address_b,\n                        selector!(\"call_other_contract\"),\n                        array![hello_starknet_address.into(), selector!(\"example_function\"), 0],\n                    );\n            }}\n        \"#,\n            node_rpc_url()\n        ).as_str(),\n        Contract::from_code_path(\n            \"HelloStarknet\".to_string(),\n            Path::new(\"tests/data/contracts/hello_starknet_for_nested_calls.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"GasCheckerProxy\".to_string(),\n            Path::new(\"tests/data/contracts/gas_checker_proxy.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n    // int(1121 * 0.16) = 180 = gas cost of bitwise builtins\n    // 96 * 2 = gas cost of onchain data (deploy cost)\n    // ~1 gas for 1 event key\n    // ~1 gas for 1 event data\n    // 0 l1_gas + (96 * 2) l1_data_gas + 180 * (100 / 0.0025) + 1 * 10240 + 1 * 5120 l2 gas\n    assert_gas(\n        &result,\n        \"test_call_other_contract_fork\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(192),\n            l2_gas: GasAmount(7_215_360),\n        },\n    );\n}\n\n#[test]\nfn empty_test_sierra_gas() {\n    let test = test_case!(indoc!(\n        r\"\n            #[test]\n            fn empty_test() {}\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n    assert_passed(&result);\n\n    assert_gas(\n        &result,\n        \"empty_test\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(0),\n            l2_gas: GasAmount(13_840),\n        },\n    );\n}\n\n#[test]\nfn declare_cost_is_omitted_sierra_gas() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::declare;\n            #[test]\n            fn declare_cost_is_omitted() {\n                declare(\"GasChecker\").unwrap();\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"GasChecker\".to_string(),\n            Path::new(\"tests/data/contracts/gas_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n\n    assert_passed(&result);\n\n    assert_gas(\n        &result,\n        \"declare_cost_is_omitted\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(0),\n            l2_gas: GasAmount(25_350),\n        },\n    );\n}\n\n#[test]\nfn deploy_syscall_cost_sierra_gas() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{declare, DeclareResultTrait};\n            use starknet::syscalls::deploy_syscall;\n            #[test]\n            fn deploy_syscall_cost() {\n                let contract = declare(\"GasConstructorChecker\").unwrap().contract_class().clone();\n                let (address, _) = deploy_syscall(contract.class_hash, 0, array![0].span(), false).unwrap();\n                assert(address != 0.try_into().unwrap(), 'wrong deployed addr');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"GasConstructorChecker\".to_string(),\n            Path::new(\"tests/data/contracts/gas_constructor_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n\n    assert_passed(&result);\n    // l = 1 (updated contract class)\n    // n = 1 (unique contracts updated - in this case it's the new contract address)\n    // ( l + n * 2 ) * felt_size_in_bytes(32) = 96 (total l1 data cost)\n    //\n    // 151_970 = cost of 1 deploy syscall (because 1 * (1173 + 8) * 100 + (7 + 1) * 4050 + 21 * 70)\n    //      -> 1 deploy syscall costs 1132 cairo steps, 7 pedersen and 18 range check builtins\n    //      -> 1 calldata element costs 8 cairo steps and 1 pedersen\n    //      -> 1 pedersen costs 4050, 1 range check costs 70\n    //\n    // 96 l1_data_gas\n    // l2 gas > 151_970\n    assert_gas(\n        &result,\n        \"deploy_syscall_cost\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(96),\n            l2_gas: GasAmount(184_360),\n        },\n    );\n}\n\n#[test]\nfn snforge_std_deploy_cost_sierra_gas() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n            #[test]\n            fn deploy_cost() {\n                let contract = declare(\"GasConstructorChecker\").unwrap().contract_class();\n                let (address, _) = contract.deploy(@array![0]).unwrap();\n                assert(address != 0.try_into().unwrap(), 'wrong deployed addr');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"GasConstructorChecker\".to_string(),\n            Path::new(\"tests/data/contracts/gas_constructor_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n\n    assert_passed(&result);\n    // 96 = gas cost of onchain data (see `deploy_syscall_cost_sierra_gas` test)\n    // 151_970 = cost of 1 deploy syscall (see `deploy_syscall_cost_sierra_gas` test)\n    //\n    // 96 l1_data_gas\n    // l2 gas > 151_970\n    assert_gas(\n        &result,\n        \"deploy_cost\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(96),\n            l2_gas: GasAmount(190_800),\n        },\n    );\n}\n\n#[test]\nfn keccak_cost_sierra_gas() {\n    let test = test_case!(indoc!(\n        r\"\n            #[test]\n            fn keccak_cost() {\n                keccak::keccak_u256s_le_inputs(array![1].span());\n            }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n\n    assert_passed(&result);\n    // Note: To calculate the gas cost of the keccak syscall, we need to include the cost of keccak round\n    // https://github.com/starkware-libs/sequencer/blob/028db0341378147037b5e7236d8e136e4ca7c30d/crates/blockifier/src/execution/syscalls/syscall_executor.rs#L190\n    // 10_000 = cost of 1 keccak syscall (1 * 100 * 100)\n    //      -> 1 keccak syscall costs 100 cairo steps\n    // 171_707 = cost of 1 keccak round syscall (136_189 + 3498 + 3980 + 28_100)\n    //      -> 1 keccak builtin costs 136_189\n    //      -> 6 bitwise builtin cost 6 * 583 = 3498\n    //      -> 56 range check builtins cost 56 * 70 = 3980\n    //      -> 281 steps cost 281 * 100 = 28_100\n    //\n    // l2 gas > 181_707\n    assert_gas(\n        &result,\n        \"keccak_cost\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(0),\n            l2_gas: GasAmount(226_727),\n        },\n    );\n}\n\n#[test]\nfn contract_keccak_cost_sierra_gas() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n            #[starknet::interface]\n            trait IGasChecker<TContractState> {\n                fn keccak(self: @TContractState, repetitions: u32);\n            }\n            #[test]\n            fn contract_keccak_cost() {\n                let contract = declare(\"GasChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = IGasCheckerDispatcher { contract_address };\n                dispatcher.keccak(5);\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"GasChecker\".to_string(),\n            Path::new(\"tests/data/contracts/gas_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n\n    assert_passed(&result);\n    // 96 = gas cost of onchain data (see `deploy_syscall_cost_sierra_gas` test)\n    // 147_120 = cost of 1 deploy syscall (see `deploy_syscall_cost_sierra_gas` test)\n    // 908_535 = 5 * 181_707 = cost of 5 keccak syscall (see `keccak_cost_sierra_gas` test)\n    // 91_560 = cost of 1 call contract syscall (because 1 * 903 * 100 + 18 * 70)\n    //      -> 1 call contract syscall costs 903 cairo steps and 18 range check builtins\n    //      -> 1 range check costs 70\n    //\n    // 96 l1_data_gas\n    // l2 gas > 1_147_215 (= 147_120 + 908_535 + 91_560)\n    assert_gas(\n        &result,\n        \"contract_keccak_cost\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(96),\n            l2_gas: GasAmount(1_353_025),\n        },\n    );\n}\n\n#[test]\nfn storage_write_cost_sierra_gas() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n            #[starknet::interface]\n            trait IGasChecker<TContractState> {\n                fn change_balance(ref self: TContractState, new_balance: u64);\n            }\n            #[test]\n            fn storage_write_cost() {\n                let contract = declare(\"GasChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = IGasCheckerDispatcher { contract_address };\n                dispatcher.change_balance(1);\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"GasChecker\".to_string(),\n            Path::new(\"tests/data/contracts/gas_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n\n    assert_passed(&result);\n    // 96 = gas cost of onchain data (see `deploy_syscall_cost_sierra_gas` test)\n    // 64 = storage_updates(1) * 2 * 32\n    // 32 = storage updates from zero value(1) * 32 (https://community.starknet.io/t/starknet-v0-13-4-pre-release-notes/115257#p-2358763-da-costs-27)\n    // allocation cost: 402_000 l2 gas\n    // 147_120 = cost of 1 deploy syscall (see `deploy_syscall_cost_sierra_gas` test)\n    // 91_560 = cost of 1 call contract syscall (see `contract_keccak_cost_sierra_gas` test)\n    // 44_970 = cost of 1 storage write syscall (because 1 * 449 * 100 + 1 * 70 = 9670)\n    //      -> 1 storage write syscall costs 449 cairo steps and 1 range check builtin\n    //      -> 1 range check costs 70\n    //\n    // (96 + 64 + 32 =) 192 l1_data_gas\n    // l2 gas > 685_650 = (147_120 + 91_560 + 44_970 + 402_000)\n    assert_gas(\n        &result,\n        \"storage_write_cost\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(192),\n            l2_gas: GasAmount(726_320),\n        },\n    );\n}\n\n#[test]\nfn multiple_storage_writes_cost_sierra_gas() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n            #[starknet::interface]\n            trait IGasChecker<TContractState> {\n                fn change_balance(ref self: TContractState, new_balance: u64);\n            }\n            #[test]\n            fn multiple_storage_writes_cost() {\n                let contract = declare(\"GasChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = IGasCheckerDispatcher { contract_address };\n                dispatcher.change_balance(1);\n                dispatcher.change_balance(1);\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"GasChecker\".to_string(),\n            Path::new(\"tests/data/contracts/gas_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n\n    assert_passed(&result);\n    // 64 = n(1) * 2 * 32\n    // 64 = m(1) * 2 * 32\n    // 32 = l(1) * 32\n    //      -> l = number of class hash updates\n    //      -> n = unique contracts updated\n    //      -> m = unique(!) values updated\n    // 32 = storage updates from zero value(1) * 32 (https://community.starknet.io/t/starknet-v0-13-4-pre-release-notes/115257#p-2358763-da-costs-27)\n    // 147_120 = cost of 1 deploy syscall (see `deploy_syscall_cost_sierra_gas` test)\n    // 183_120 = 2 * 91_560 = cost of 2 call contract syscalls (see `contract_keccak_cost_sierra_gas` test)\n    // 89_940 = cost of 2 storage write syscall (see `storage_write_cost_sierra_gas` test)\n    // allocation cost: 402_000 l2 gas\n    // 192 = (64 + 64 + 32 + 32) l1_data_gas\n    // l2 gas > 822_180 (= 147_120 + 183_120 + 89_940 + 402_000)\n    assert_gas(\n        &result,\n        \"multiple_storage_writes_cost\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(192),\n            l2_gas: GasAmount(868_730),\n        },\n    );\n}\n\n#[test]\nfn l1_message_cost_sierra_gas() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n            #[starknet::interface]\n            trait IGasChecker<TContractState> {\n                fn send_l1_message(self: @TContractState);\n            }\n            #[test]\n            fn l1_message_cost() {\n                let contract = declare(\"GasChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = IGasCheckerDispatcher { contract_address };\n                dispatcher.send_l1_message();\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"GasChecker\".to_string(),\n            Path::new(\"tests/data/contracts/gas_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n\n    assert_passed(&result);\n    // 29_524 = gas cost of l2 -> l1 message (payload length 3)\n    // The calculation below covers L1 costs related to the state updates and emitting the event `LogMessageToL1`.\n    // https://github.com/starkware-libs/sequencer/blob/028db0341378147037b5e7236d8e136e4ca7c30d/crates/blockifier/src/fee/resources.rs#L338-L340\n    //      -> (3 + 3) * 1124 = state update costs\n    //      -> 375 const opcode cost\n    //      -> 3 * 375 = 1225 topics cost of `LogMessageToL1` event (fromAddress, toAddress and 1 default)\n    //      -> 5 * 256 = 1280 data array cost (payload length + 2 required solidity params for array)\n    //      -> 20_000 l1 storage write cost\n    // 96 = gas cost of onchain data (see `deploy_syscall_cost_sierra_gas` test)\n    // 147_120 = cost of 1 deploy syscall (see `deploy_syscall_cost_sierra_gas` test)\n    // 91_560 = cost of 1 call contract syscall (see `contract_keccak_cost_sierra_gas` test)\n    // 14_470 = cost of 1 SendMessageToL1 syscall (because 1 * 144 * 100 + 1 * 70 )\n    //      -> 1 storage write syscall costs 144 cairo steps and 1 range check builtin\n    //      -> 1 range check costs 70\n    //\n    // 29_524 l1_gas\n    // 96 l1_data_gas\n    // l2 gas > 253_150 (= 147_120 + 91_560 + 14_470)\n    assert_gas(\n        &result,\n        \"l1_message_cost\",\n        GasVector {\n            l1_gas: GasAmount(29_524),\n            l1_data_gas: GasAmount(96),\n            l2_gas: GasAmount(293_180),\n        },\n    );\n}\n\n#[test]\nfn l1_message_cost_for_proxy_sierra_gas() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use starknet::ContractAddress;\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n            #[starknet::interface]\n            trait IGasCheckerProxy<TContractState> {\n                fn send_l1_message_from_gas_checker(\n                    self: @TContractState,\n                    address: ContractAddress\n                );\n            }\n            #[test]\n            fn l1_message_cost_for_proxy() {\n                let contract = declare(\"GasChecker\").unwrap().contract_class();\n                let (gas_checker_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let contract = declare(\"GasCheckerProxy\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = IGasCheckerProxyDispatcher { contract_address };\n                dispatcher.send_l1_message_from_gas_checker(gas_checker_address);\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"GasChecker\".to_string(),\n            Path::new(\"tests/data/contracts/gas_checker.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"GasCheckerProxy\".to_string(),\n            Path::new(\"tests/data/contracts/gas_checker_proxy.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n\n    assert_passed(&result);\n    // 29_524 = gas cost of l2 -> l1 message (see `l1_message_cost_sierra_gas` test)\n    // 128 = n(2) * 2 * 32\n    // 64 = l(2) * 32\n    //      -> l = number of class hash updates\n    //      -> n = unique contracts updated\n    // 294_240 = 2 * 147_120 = cost of 2 deploy syscall (see `deploy_syscall_cost_sierra_gas` test)\n    // 183_120 = 2 * 91_560 = cost of 2 call contract syscalls (see `multiple_storage_writes_cost_sierra_gas` test)\n    // 14_470 = cost of 1 SendMessageToL1 syscall (see `l1_message_cost_sierra_gas` test)\n    //\n    // 29_524 l1_gas\n    // (128 + 64 =) 192 l1_data_gas\n    // l2 gas > 491_830 (= 294_240 + 183_120 + 14_470)\n    assert_gas(\n        &result,\n        \"l1_message_cost_for_proxy\",\n        GasVector {\n            l1_gas: GasAmount(29_524),\n            l1_data_gas: GasAmount(192),\n            l2_gas: GasAmount(557_260),\n        },\n    );\n}\n\n#[test]\nfn events_cost_sierra_gas() {\n    let test = test_case!(indoc!(\n        r\"\n            use starknet::syscalls::emit_event_syscall;\n            #[test]\n            fn events_cost() {\n                let mut keys = array![];\n                let mut values =  array![];\n                let mut i: u32 = 0;\n                while i < 10 {\n                    keys.append('key');\n                    values.append(1);\n                    i += 1;\n                };\n                emit_event_syscall(keys.span(), values.span()).unwrap();\n            }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n\n    assert_passed(&result);\n    // 102_400 = 10 * 10_240\n    //      -> we emit 50 keys, each taking up 1 felt of space\n    //      -> L2 gas cost for event key is 10240 gas/felt\n    // 51_200 = 10 * 5120\n    //      -> we emit 50 keys, each having 1 felt of data\n    //      -> L2 gas cost for event data is 5120 gas/felt\n    // 10_000 = cost of 1 emit event syscall (because 1 * 61 * 100 + 1 * 70 = 6170)\n    //      -> 1 emit event syscall costs 61 cairo steps and 1 range check builtin\n    //      -> 1 range check costs 70\n    //      -> the minimum total cost is `syscall_base_gas_cost`, which is pre-charged by the compiler (atm it is 100 * 100)\n    //\n    // l2 gas > 163_600 (= 102_400 + 51_200 + 10_000)\n    assert_gas(\n        &result,\n        \"events_cost\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(0),\n            l2_gas: GasAmount(205_510),\n        },\n    );\n}\n\n#[test]\nfn events_contract_cost_sierra_gas() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n            #[starknet::interface]\n            trait IGasChecker<TContractState> {\n                fn emit_event(ref self: TContractState, n_keys_and_vals: u32);\n            }\n            #[test]\n            fn event_emission_cost() {\n                let (contract_address, _) = declare(\"GasChecker\").unwrap().contract_class().deploy(@array![]).unwrap();\n                let dispatcher = IGasCheckerDispatcher { contract_address };\n                dispatcher.emit_event(10);\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"GasChecker\",\n            Path::new(\"tests/data/contracts/gas_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n    assert_passed(&result);\n    // 96 = gas cost of onchain data (see `deploy_syscall_cost_sierra_gas` test)\n    // 102_400 = event keys cost (see `events_cost_sierra_gas` test)\n    // 51_200 = event data cost (see `events_cost_sierra_gas` test)\n    // 10_000 = cost of 1 emit event syscall (see `events_cost_sierra_gas` test)\n    // 147_120 = cost of 1 deploy syscall (see `deploy_syscall_cost_sierra_gas` test)\n    // 91_560 = cost of 1 call contract syscall (see `contract_keccak_cost_sierra_gas` test)\n    // 159_810 = reported consumed sierra gas\n    //\n    // 96 l1_data_gas\n    // l2 gas > 402_280 (= 102_400 + 51_200 + 10_000 + 147_120 + 91_560)\n    assert_gas(\n        &result,\n        \"event_emission_cost\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(96),\n            l2_gas: GasAmount(471_090),\n        },\n    );\n}\n\n#[test]\nfn nested_call_cost_sierra_gas() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{ContractClassTrait, DeclareResultTrait, declare};\n            use starknet::{ContractAddress, SyscallResult};\n            #[starknet::interface]\n            trait IGasCheckerProxy<TContractState> {\n                fn call_other_contract(\n                    self: @TContractState,\n                    contract_address: ContractAddress,\n                    entry_point_selector: felt252,\n                    calldata: Array::<felt252>,\n                ) -> SyscallResult<Span<felt252>>;\n            }\n            fn deploy_contract(name: ByteArray) -> ContractAddress {\n                let contract = declare(name).unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                contract_address\n            }\n            #[test]\n            fn test_call_other_contract() {\n                let contract_address_a = deploy_contract(\"GasCheckerProxy\");\n                let contract_address_b = deploy_contract(\"GasCheckerProxy\");\n                let hello_starknet_address = deploy_contract(\"HelloStarknet\");\n                let dispatcher_a = IGasCheckerProxyDispatcher { contract_address: contract_address_a };\n                let _ = dispatcher_a\n                    .call_other_contract(\n                        contract_address_b,\n                        selector!(\"call_other_contract\"),\n                        array![hello_starknet_address.into(), selector!(\"example_function\"), 0],\n                    );\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"HelloStarknet\".to_string(),\n            Path::new(\"tests/data/contracts/hello_starknet_for_nested_calls.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"GasCheckerProxy\".to_string(),\n            Path::new(\"tests/data/contracts/gas_checker_proxy.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n\n    assert_passed(&result);\n    // 10_240 = event keys cost (see `events_cost_sierra_gas` test)\n    // 5120 = event data cost (see `events_cost_sierra_gas` test)\n    // 10_000 = cost of 1 emit event syscall (see `events_cost_sierra_gas` test)\n    // 181_707 = cost of 1 keccak syscall (see `keccak_cost_sierra_gas` test)\n    // 10_840 = cost of 1 get block hash syscall (107 * 100 + 2 * 70)\n    // 441_360 = 3 * 147_120 = cost of 3 deploy syscall (see `deploy_syscall_cost_sierra_gas` test)\n    // 274_680 = 3 * 91_560 = cost of 3 call contract syscall (see `contract_keccak_cost_sierra_gas` test)\n    // 841_295 = cost of 1 sha256_process_block_syscall syscall (1867 * 100 + 1115 * 583 + 65 * 70)\n    //\n    // 288 l1_data_gas\n    // l2 gas > 1_775_242 (= 10_240 + 5120 + 10_000 + 181_707 + 10_840 + 441_360 + 274_680 + 841_295)\n    assert_gas(\n        &result,\n        \"test_call_other_contract\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(288),\n            l2_gas: GasAmount(1_940_292),\n        },\n    );\n}\n\n#[test]\nfn nested_call_cost_in_forked_contract_sierra_gas() {\n    let test = test_case!(\n        formatdoc!(\n            r#\"\n            use snforge_std::{{ContractClassTrait, DeclareResultTrait, declare}};\n            use starknet::{{ContractAddress, SyscallResult}};\n            #[starknet::interface]\n            trait IGasCheckerProxy<TContractState> {{\n                fn call_other_contract(\n                    self: @TContractState,\n                    contract_address: ContractAddress,\n                    entry_point_selector: felt252,\n                    calldata: Array::<felt252>,\n                ) -> SyscallResult<Span<felt252>>;\n            }}\n            fn deploy_contract(name: ByteArray) -> ContractAddress {{\n                let contract = declare(name).unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                contract_address\n            }}\n            #[test]\n            #[fork(url: \"{}\", block_number: 861_389)]\n            fn test_call_other_contract_fork() {{\n                let contract_address_a = deploy_contract(\"GasCheckerProxy\");\n                let contract_address_b = deploy_contract(\"GasCheckerProxy\");\n                let hello_starknet_address: ContractAddress = 0x07f01bbebed8dfeb60944bd9273e2bd844e39b0106eb6ca05edaeee95a817c64.try_into().unwrap();\n                let dispatcher_a = IGasCheckerProxyDispatcher {{ contract_address: contract_address_a }};\n                let _ = dispatcher_a\n                    .call_other_contract(\n                        contract_address_b,\n                        selector!(\"call_other_contract\"),\n                        array![hello_starknet_address.into(), selector!(\"example_function\"), 0],\n                    );\n            }}\n        \"#,\n        node_rpc_url()\n        ).as_str(),\n        Contract::from_code_path(\n            \"HelloStarknet\".to_string(),\n            Path::new(\"tests/data/contracts/hello_starknet_for_nested_calls.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"GasCheckerProxy\".to_string(),\n            Path::new(\"tests/data/contracts/gas_checker_proxy.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n\n    assert_passed(&result);\n    // 10_240 = event keys cost (see `events_cost_sierra_gas` test)\n    // 5120 = event data cost (see `events_cost_sierra_gas` test)\n    // 10_000 = cost of 1 emit event syscall (see `events_cost_sierra_gas` test)\n    // 181_707 = cost of 1 keccak syscall (see `keccak_cost_sierra_gas` test)\n    // 10_840 = cost of 1 get block hash syscall (107 * 100 + 2 * 70)\n    // 294_240 = 2 * 147_120 = cost of 2 deploy syscall (see `deploy_syscall_cost_sierra_gas` test)\n    // 274_680 = 3 * 91_560 = cost of 3 call contract syscall (see `contract_keccak_cost_sierra_gas` test)\n    // 841_295 = cost of 1 sha256_process_block_syscall syscall (1867 * 100 + 1115 * 583 + 65 * 70)\n    //\n    // 192 l1_data_gas\n    // l2 gas > 1_628_122 (= 10_240 + 5120 + 10_000 + 181_707 + 10_840 + 294_240 + 274_680 + 841_295)\n    assert_gas(\n        &result,\n        \"test_call_other_contract_fork\",\n        GasVector {\n            l1_gas: GasAmount(0),\n            l1_data_gas: GasAmount(192),\n            l2_gas: GasAmount(1_812_052),\n        },\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/generate_random_felt.rs",
    "content": "use crate::utils::runner::assert_passed;\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\n\n#[test]\nfn simple_generate_random_felt() {\n    let test = test_case!(indoc!(\n        r\"\n        use snforge_std::generate_random_felt;\n\n        #[test]\n        fn simple_generate_random_felt() {\n            let mut random_values = array![];\n            let mut unique_values = array![];\n            let mut i = 10;\n\n        while i != 0 {\n            let random_value = generate_random_felt();\n            random_values.append(random_value);\n            i -= 1;\n        };\n\n        for element in random_values.span() {\n            let mut k = 0; \n\n            while k != random_values.len() {\n                if element != random_values.at(k) {\n                    unique_values.append(element);\n                };\n                k += 1;\n            };\n        };\n\n        assert(unique_values.len() > 1, 'Identical values');\n        }\n        \"\n    ),);\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/get_available_gas.rs",
    "content": "use crate::utils::runner::{Contract, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\nuse std::path::Path;\n\n#[test]\nfn test_get_available_gas() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{declare, DeclareResultTrait, ContractClassTrait};\n\n            #[test]\n            fn check_available_gas() {\n                let contract = declare(\"HelloStarknet\").unwrap().contract_class().clone();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n\n                let gas_before = core::testing::get_available_gas();\n                core::gas::withdraw_gas().unwrap();\n\n                starknet::syscalls::call_contract_syscall(\n                    contract_address, selector!(\"increase_balance\"), array![10].span(),\n                ).unwrap();\n\n                let gas_after = core::testing::get_available_gas();\n                core::gas::withdraw_gas().unwrap();\n\n                let gas_diff = gas_before - gas_after;\n\n                // call_contract syscall: 91_560 gas\n                // storage_write syscall: 44_970 gas\n                // storage_read syscall: 18_070 gas\n                let min_expected_gas = 91_560 + 44_970 + 18_070;\n\n                // Check that gas used is above the expected minimum\n                assert(gas_diff > min_expected_gas, 'Incorrect gas');\n\n                // Allow an arbitrary margin of 10_000 gas\n                assert(min_expected_gas + 10_000 > gas_diff, 'Incorrect gas');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"HelloStarknet\".to_string(),\n            Path::new(\"tests/data/contracts/hello_starknet.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/get_class_hash.rs",
    "content": "use crate::utils::runner::{Contract, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\nuse std::path::Path;\n\n#[test]\nfn get_class_hash_cheatcode() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use core::clone::Clone;\n            use array::ArrayTrait;\n            use result::ResultTrait;\n            use snforge_std::{ declare, ContractClassTrait, get_class_hash, DeclareResultTrait };\n\n            #[test]\n            fn get_class_hash_cheatcode() {\n                let contract = declare(\"HelloStarknet\").unwrap().contract_class().clone();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                assert(get_class_hash(contract_address) == contract.class_hash, 'Incorrect class hash');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"HelloStarknet\".to_string(),\n            Path::new(\"tests/data/contracts/hello_starknet.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/get_current_vm_step.rs",
    "content": "use crate::utils::runner::{Contract, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\nuse std::path::Path;\n\n#[test]\nfn test_get_current_vm_step() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::testing::get_current_vm_step;\n            use snforge_std::{ContractClassTrait, DeclareResultTrait, declare};\n\n\n            const STEPS_MARGIN: u32 = 100;\n\n            // 1173 = cost of 1 deploy syscall without calldata\n            // https://github.com/starkware-libs/sequencer/blob/b29c0e8c61f7b2340209e256cf87dfe9f2c811aa/crates/blockifier/resources/blockifier_versioned_constants_0_14_1.json#L185\n            const DEPLOY_SYSCALL_STEPS: u32 = 1173;\n\n            // 903 = steps of 1 call contract syscall\n            // https://github.com/starkware-libs/sequencer/blob/b29c0e8c61f7b2340209e256cf87dfe9f2c811aa/crates/blockifier/resources/blockifier_versioned_constants_0_14_1.json#L162\n            const CALL_CONTRACT_SYSCALL_STEPS: u32 = 903;\n\n            // 90 = steps of 1 call storage read syscall\n            // https://github.com/starkware-libs/sequencer/blob/b29c0e8c61f7b2340209e256cf87dfe9f2c811aa/crates/blockifier/resources/blockifier_versioned_constants_0_14_1.json#L406\n            const STORAGE_READ_SYSCALL_STEPS: u32 = 90;\n\n            #[test]\n            fn check_current_vm_step() {\n                let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n                let step_a = get_current_vm_step();\n\n                let (contract_address_a, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let (contract_address_b, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                // Sycalls between step_a and step_b:\n                // top call: 2 x deploy syscall\n                // inner call: -/-\n                let step_b = get_current_vm_step();\n\n                let expected_steps_taken = 2 * DEPLOY_SYSCALL_STEPS + 130; // 130 are steps from VM\n                let expected_lower = expected_steps_taken + step_a - STEPS_MARGIN;\n                let expected_upper = expected_steps_taken + step_a + STEPS_MARGIN;\n                assert!(\n                    expected_lower <= step_b && step_b <= expected_upper,\n                    \"step_b ({step_b}) not in [{expected_lower}, {expected_upper}]\",\n                );\n\n                let dispatcher_a = IHelloStarknetDispatcher { contract_address: contract_address_a };\n\n                // contract A calls `get_balance` from contract B\n                let _balance = dispatcher_a\n                    .call_other_contract(\n                        contract_address_b.try_into().unwrap(), selector!(\"get_balance\"), None,\n                    );\n\n                // Sycalls between step_b and step_c:\n                // top call: 1 x call contract syscall\n                // inner calls: 1 x storage read syscall, 1 x call contract syscall\n                let step_c = get_current_vm_step();\n\n                let expected_steps_taken = 2 * CALL_CONTRACT_SYSCALL_STEPS\n                    + 1 * STORAGE_READ_SYSCALL_STEPS\n                    + 277; // 277 are steps from VM\n                let expected_lower = expected_steps_taken + step_b - STEPS_MARGIN;\n                let expected_upper = expected_steps_taken + step_b + STEPS_MARGIN;\n                assert!(\n                    expected_lower <= step_c && step_c <= expected_upper,\n                    \"step_c ({step_c}) not in [{expected_lower}, {expected_upper}]\",\n                );\n            }\n\n            #[starknet::interface]\n            pub trait IHelloStarknet<TContractState> {\n                fn get_balance(self: @TContractState) -> felt252;\n                fn call_other_contract(\n                    self: @TContractState,\n                    other_contract_address: felt252,\n                    selector: felt252,\n                    calldata: Option<Array<felt252>>,\n                ) -> Span<felt252>;\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"HelloStarknet\".to_string(),\n            Path::new(\"tests/data/contracts/hello_starknet.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/interact_with_state.rs",
    "content": "use crate::utils::runner::{Contract, assert_case_output_contains, assert_failed, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\n\n#[test]\nfn get_contract_address_in_interact_with_state() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use snforge_std::{\n            ContractClassTrait, DeclareResultTrait, declare, interact_with_state, test_address,\n        };\n        use starknet::{ContractAddress, get_contract_address};\n\n        #[starknet::interface]\n        trait IEmpty<TContractState> {\n            fn get_address(ref self: TContractState) -> ContractAddress;\n        }\n\n        #[test]\n        fn test_contract_address_set_correctly() {\n            let contract = declare(\"Empty\").unwrap().contract_class();\n            let (contract_address, _) = contract.deploy(@array![]).unwrap();\n            let (other_empty_contract, _) = contract.deploy(@array![]).unwrap();\n            let dispatcher = IEmptyDispatcher { contract_address };\n            let other_dispatcher = IEmptyDispatcher { contract_address: other_empty_contract };\n\n            let assert_eq_addresses = |a: ContractAddress, b: ContractAddress| {\n                assert(a == b, 'Incorrect address');\n            };\n\n            assert_eq_addresses(dispatcher.get_address(), contract_address);\n            assert_eq_addresses(get_contract_address(), test_address());\n\n            interact_with_state(\n                contract_address,\n                || {\n                    assert_eq_addresses(dispatcher.get_address(), contract_address);\n                    assert_eq_addresses(get_contract_address(), contract_address);\n\n                    // Make sure other contracts are not modified\n                    assert_eq_addresses(other_dispatcher.get_address(), other_empty_contract);\n                },\n            );\n\n            // Make sure `get_contract_address` was modified only for the `interact_with_state` execution\n            assert_eq_addresses(dispatcher.get_address(), contract_address);\n            assert_eq_addresses(get_contract_address(), test_address());\n        }\n            \"#\n        ),\n        Contract::new(\n            \"Empty\",\n            indoc!(\n                r\"\n            #[starknet::interface]\n            trait IEmpty<TContractState> {\n                fn get_address(ref self: TContractState) -> starknet::ContractAddress;\n            }\n\n            #[starknet::contract]\n            mod Empty {\n                #[storage]\n                struct Storage {}\n\n                #[abi(embed_v0)]\n                impl EmptyImpl of super::IEmpty<ContractState> {\n                    fn get_address(ref self: ContractState) -> starknet::ContractAddress {\n                        starknet::get_contract_address()\n                    }\n                }\n            }\n            \"\n            )\n        )\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn raise_error_if_non_existent_address() {\n    let test = test_case!(indoc!(\n        r\"\n        use snforge_std::interact_with_state;\n\n        #[starknet::contract]\n        mod SingleFelt {\n            #[storage]\n            pub struct Storage {\n                pub field: felt252,\n            }\n        }\n\n        #[test]\n        fn test_single_felt() {\n            interact_with_state(\n                0x123.try_into().unwrap(),\n                || {\n                    let mut state = SingleFelt::contract_state_for_testing();\n                    state.field.write(1);\n                },\n            )\n        }\n            \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_failed(&result);\n    assert_case_output_contains(\n        &result,\n        \"test_single_felt\",\n        \"Failed to interact with contract state because no contract is deployed at address 0x0000000000000000000000000000000000000000000000000000000000000123\",\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/l1_handler_executor.rs",
    "content": "use crate::utils::runner::{Contract, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\nuse std::path::Path;\n\n#[test]\nfn l1_handler_execute() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            #[derive(Copy, Serde, Drop)]\n            struct L1Data {\n                balance: felt252,\n                token_id: u256\n            }\n\n            #[starknet::interface]\n            trait IBalanceToken<TContractState> {\n                fn get_balance(self: @TContractState) -> felt252;\n                fn get_token_id(self: @TContractState) -> u256;\n            }\n\n            use serde::Serde;\n            use array::{ArrayTrait, SpanTrait};\n            use core::result::ResultTrait;\n            use snforge_std::{declare, ContractClassTrait, DeclareResultTrait, L1Handler, L1HandlerTrait};\n            use starknet::contract_address_const;\n\n            #[test]\n            fn l1_handler_execute() {\n                let calldata = array![0x123];\n\n                let contract = declare(\"l1_handler_executor\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@calldata).unwrap();\n\n                let l1_data = L1Data {\n                    balance: 42,\n                    token_id: 8888_u256,\n                };\n\n                let mut payload: Array<felt252> = ArrayTrait::new();\n                l1_data.serialize(ref payload);\n\n                let mut l1_handler = L1HandlerTrait::new(\n                    contract_address,\n                    selector!(\"process_l1_message\")\n                );\n\n                l1_handler.execute(0x123, payload.span()).unwrap();\n\n                let dispatcher = IBalanceTokenDispatcher { contract_address };\n                assert(dispatcher.get_balance() == 42, dispatcher.get_balance());\n                assert(dispatcher.get_token_id() == 8888_u256, 'Invalid token id');\n            }\n\n            #[test]\n            fn l1_handler_execute_panicking() {\n                let calldata = array![0x123];\n\n                let contract = declare(\"l1_handler_executor\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@calldata).unwrap();\n\n\n                let mut l1_handler = L1HandlerTrait::new(\n                    contract_address,\n                    selector!(\"panicking_l1_handler\")\n                );\n\n                match l1_handler.execute(0x123, array![].span()) {\n                    Result::Ok(_) => panic_with_felt252('should have panicked'),\n                    Result::Err(panic_data) => {\n                        assert(*panic_data.at(0) == 'custom', 'Wrong 1st panic datum');\n                        assert(*panic_data.at(1) == 'panic', 'Wrong 2nd panic datum');\n                    },\n                }\n            }\n\n            #[test]\n            fn l1_handler_function_missing() {\n                let calldata = array![0x123];\n\n                let contract = declare(\"l1_handler_executor\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@calldata).unwrap();\n\n\n                let mut l1_handler = L1HandlerTrait::new(\n                    contract_address,\n                    selector!(\"this_does_not_exist\")\n                );\n\n                match l1_handler.execute(0x123, array![].span()){\n                    Result::Ok(_) => panic_with_felt252('should have panicked'),\n                    Result::Err(_) => {\n                        // Would be nice to assert the error here once it is be possible in cairo\n                    },\n                }\n            }\n\n            #[test]\n            #[should_panic]\n            fn l1_handler_contract_missing() {\n                let dispatcher = IBalanceTokenDispatcher { contract_address: contract_address_const::<421984739218742310>() };\n                dispatcher.get_balance();\n\n                let mut l1_handler = L1HandlerTrait::new(\n                    contract_address_const::<421984739218742310>(),\n                    selector!(\"process_l1_message\")\n                );\n\n                l1_handler.execute(0x123, array![].span());\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"l1_handler_executor\".to_string(),\n            Path::new(\"tests/data/contracts/l1_handler_execute_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/message_to_l1.rs",
    "content": "use crate::utils::runner::{Contract, assert_case_output_contains, assert_failed, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\nuse std::path::Path;\n\n#[test]\nfn spy_messages_to_l1_simple() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use array::ArrayTrait;\n            use result::ResultTrait;\n            use starknet::{ContractAddress, EthAddress};\n            use snforge_std::{\n                declare, ContractClassTrait, DeclareResultTrait,\n                spy_messages_to_l1,\n                MessageToL1, MessageToL1SpyAssertionsTrait\n            };\n\n            #[starknet::interface]\n            trait IMessageToL1Checker<TContractState> {\n                fn send_message(ref self: TContractState, some_data: Array<felt252>, to_address: EthAddress);\n            }\n\n            fn deploy_message_to_l1_checker()  -> IMessageToL1CheckerDispatcher {\n               let declared = declare(\"MessageToL1Checker\").unwrap().contract_class();\n               let (contract_address, _) = declared.deploy(@array![]).unwrap();\n\n               IMessageToL1CheckerDispatcher { contract_address }\n            }\n\n            #[test]\n            fn spy_messages_to_l1_simple() {\n               let message_to_l1_checker = deploy_message_to_l1_checker();\n\n               let mut spy = spy_messages_to_l1();\n               message_to_l1_checker.send_message(\n                    array![123, 321, 420],\n                    0x123.try_into().unwrap()\n               );\n\n               spy.assert_sent(\n                    @array![\n                        (\n                            message_to_l1_checker.contract_address,\n                            MessageToL1 {\n                                to_address: 0x123.try_into().unwrap(),\n                                payload: array![123, 321, 420]\n                            }\n                        )\n                    ]\n               );\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"MessageToL1Checker\".to_string(),\n            Path::new(\"tests/data/contracts/message_to_l1_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn spy_messages_to_l1_fails() {\n    let test = test_case!(indoc!(\n        r\"\n            use array::ArrayTrait;\n            use result::ResultTrait;\n            use starknet::ContractAddress;\n            use snforge_std::{\n                declare, ContractClassTrait, \n                spy_messages_to_l1, \n                MessageToL1, MessageToL1SpyAssertionsTrait\n            };\n            \n\n            #[test]\n            fn assert_sent_fails() {\n                let mut spy = spy_messages_to_l1();\n                spy.assert_sent(\n                    @array![\n                        (\n                            0x123.try_into().unwrap(),\n                            MessageToL1 {\n                                to_address: 0x123.try_into().unwrap(), \n                                payload: array![0x123, 0x420]\n                            }\n                        )\n                    ]\n               );\n            }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_failed(&result);\n    assert_case_output_contains(\n        &result,\n        \"assert_sent_fails\",\n        \"Message with matching data and\",\n    );\n    assert_case_output_contains(\n        &result,\n        \"assert_sent_fails\",\n        \"receiver was not emitted from\",\n    );\n}\n\n#[test]\nfn expect_three_messages_while_two_sent() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use array::ArrayTrait;\n            use result::ResultTrait;\n            use starknet::{ContractAddress, EthAddress};\n            use snforge_std::{\n                declare, ContractClassTrait, DeclareResultTrait,\n                spy_messages_to_l1,\n                MessageToL1, MessageToL1SpyAssertionsTrait\n            };\n\n            #[starknet::interface]\n            trait IMessageToL1Checker<TContractState> {\n                fn send_message(ref self: TContractState, some_data: Array<felt252>, to_address: EthAddress);\n            }\n\n            fn deploy_message_to_l1_checker()  -> IMessageToL1CheckerDispatcher {\n               let declared = declare(\"MessageToL1Checker\").unwrap().contract_class();\n               let (contract_address, _) = declared.deploy(@array![]).unwrap();\n\n               IMessageToL1CheckerDispatcher { contract_address }\n            }\n\n            #[test]\n            fn expect_three_messages_while_two_were_sent() {\n               let message_to_l1_checker = deploy_message_to_l1_checker();\n\n               let mut spy = spy_messages_to_l1();\n               message_to_l1_checker.send_message(\n                    array![123, 321, 420],\n                    0x123.try_into().unwrap()\n               );\n               message_to_l1_checker.send_message(\n                    array![420, 123, 321],\n                    0x321.try_into().unwrap()\n               );\n\n               spy.assert_sent(\n                    @array![\n                        (\n                            message_to_l1_checker.contract_address,\n                            MessageToL1 {\n                                to_address: 0x123.try_into().unwrap(),\n                                payload: array![123, 321, 420]\n                            }\n                        ),\n                        (\n                            message_to_l1_checker.contract_address,\n                            MessageToL1 {\n                                to_address: 0x321.try_into().unwrap(),\n                                payload: array![420, 123, 321]\n                            }\n                        ),\n                        (\n                            message_to_l1_checker.contract_address,\n                            MessageToL1 {\n                                to_address: 0x456.try_into().unwrap(),\n                                payload: array![567, 8910, 111213]\n                            }\n                        ),\n                    ]\n               );\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"MessageToL1Checker\".to_string(),\n            Path::new(\"tests/data/contracts/message_to_l1_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_failed(&result);\n    assert_case_output_contains(\n        &result,\n        \"expect_three_messages_while_two_were_sent\",\n        \"Message with matching data and\",\n    );\n    assert_case_output_contains(\n        &result,\n        \"expect_three_messages_while_two_were_sent\",\n        \"receiver was not emitted\",\n    );\n}\n\n#[test]\nfn expect_two_messages_while_three_sent() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use array::ArrayTrait;\n            use starknet::{ContractAddress, EthAddress};\n            use snforge_std::{\n                ContractClassTrait, DeclareResultTrait, declare, spy_messages_to_l1,\n                MessageToL1, MessageToL1SpyAssertionsTrait\n            };\n            use traits::Into;\n\n            #[starknet::interface]\n            trait IMessageToL1Checker<TContractState> {\n                fn send_message(ref self: TContractState, some_data: Array<felt252>, to_address: EthAddress);\n            }\n\n            fn deploy_message_to_l1_checker()  -> IMessageToL1CheckerDispatcher {\n               let declared = declare(\"MessageToL1Checker\").unwrap().contract_class();\n               let (contract_address, _) = declared.deploy(@array![]).unwrap();\n\n               IMessageToL1CheckerDispatcher { contract_address }\n            }\n\n            #[test]\n            fn expect_two_messages_while_three_sent() {\n               let message_to_l1_checker = deploy_message_to_l1_checker();\n\n               let mut spy = spy_messages_to_l1();\n               message_to_l1_checker.send_message(\n                    array![123, 321, 420],\n                    0x123.try_into().unwrap()\n               );\n               message_to_l1_checker.send_message(\n                    array![420, 123, 321],\n                    0x321.try_into().unwrap()\n               );\n               message_to_l1_checker.send_message(\n                    array![567, 8910, 111213],\n                    0x456.try_into().unwrap()\n               );\n\n               spy.assert_sent(\n                    @array![\n                        (\n                            message_to_l1_checker.contract_address,\n                            MessageToL1 {\n                                to_address: 0x123.try_into().unwrap(),\n                                payload: array![123, 321, 420]\n                            }\n                        ),\n                        (\n                            message_to_l1_checker.contract_address,\n                            MessageToL1 {\n                                to_address: 0x321.try_into().unwrap(),\n                                payload: array![420, 123, 321]\n                            }\n                        )\n                    ]\n               );\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"MessageToL1Checker\".to_string(),\n            Path::new(\"tests/data/contracts/message_to_l1_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn message_sent_but_wrong_data_asserted() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use array::ArrayTrait;\n            use starknet::{ContractAddress, EthAddress};\n            use snforge_std::{\n                declare, ContractClassTrait, DeclareResultTrait,\n                spy_messages_to_l1,\n                MessageToL1, MessageToL1SpyAssertionsTrait\n            };\n\n            #[starknet::interface]\n            trait IMessageToL1Checker<TContractState> {\n                fn send_message(ref self: TContractState, some_data: Array<felt252>, to_address: EthAddress);\n            }\n\n            fn deploy_message_to_l1_checker()  -> IMessageToL1CheckerDispatcher {\n               let declared = declare(\"MessageToL1Checker\").unwrap().contract_class();\n               let (contract_address, _) = declared.deploy(@array![]).unwrap();\n\n               IMessageToL1CheckerDispatcher { contract_address }\n            }\n\n            #[test]\n            fn message_sent_but_wrong_data_asserted() {\n               let message_to_l1_checker = deploy_message_to_l1_checker();\n\n               let mut spy = spy_messages_to_l1();\n               message_to_l1_checker.send_message(\n                    array![123, 321, 420],\n                    0x123.try_into().unwrap()\n               );\n\n               spy.assert_sent(\n                    @array![\n                        (\n                            message_to_l1_checker.contract_address,\n                            MessageToL1 {\n                                to_address: 0x123.try_into().unwrap(),\n                                payload: array![420, 321, 123]\n                            }\n                        )\n                    ]\n               );\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"MessageToL1Checker\".to_string(),\n            Path::new(\"tests/data/contracts/message_to_l1_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_failed(&result);\n    assert_case_output_contains(\n        &result,\n        \"message_sent_but_wrong_data_asserted\",\n        \"Message with matching data and\",\n    );\n    assert_case_output_contains(\n        &result,\n        \"message_sent_but_wrong_data_asserted\",\n        \"receiver was not emitted from\",\n    );\n}\n\n#[test]\nfn assert_not_sent_pass() {\n    let test = test_case!(\n        indoc!(\n            r\"\n            use array::ArrayTrait;\n            use starknet::{ContractAddress, EthAddress};\n            use snforge_std::{\n                declare, spy_messages_to_l1,\n                MessageToL1, MessageToL1SpyAssertionsTrait\n            };\n\n            #[test]\n            fn assert_not_sent_pass() {\n               let mut spy = spy_messages_to_l1();\n               spy.assert_not_sent(\n                    @array![\n                        (\n                            0x123.try_into().unwrap(),\n                            MessageToL1 {\n                                to_address: 0x123.try_into().unwrap(),\n                                payload: ArrayTrait::new()\n                            }\n                        )\n                     ]\n                );\n            }\n        \"\n        ),\n        Contract::from_code_path(\n            \"MessageToL1Checker\".to_string(),\n            Path::new(\"tests/data/contracts/message_to_l1_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn assert_not_sent_fails() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use array::ArrayTrait;\n            use starknet::{ContractAddress, EthAddress};\n            use snforge_std::{\n                ContractClassTrait, DeclareResultTrait, declare, spy_messages_to_l1,\n                MessageToL1, MessageToL1SpyAssertionsTrait\n            };\n\n            #[starknet::interface]\n            trait IMessageToL1Checker<TContractState> {\n                fn send_message(ref self: TContractState, some_data: Array<felt252>, to_address: EthAddress);\n            }\n\n            fn deploy_message_to_l1_checker()  -> IMessageToL1CheckerDispatcher {\n               let declared = declare(\"MessageToL1Checker\").unwrap().contract_class();\n               let (contract_address, _) = declared.deploy(@array![]).unwrap();\n\n               IMessageToL1CheckerDispatcher { contract_address }\n            }\n\n            #[test]\n            fn assert_not_sent_fails() {\n               let message_to_l1_checker = deploy_message_to_l1_checker();\n\n               let mut spy = spy_messages_to_l1();\n               message_to_l1_checker.send_message(\n                    array![123, 321, 420],\n                    0x123.try_into().unwrap()\n               );\n\n               spy.assert_not_sent(\n                    @array![\n                        (\n                            message_to_l1_checker.contract_address,\n                            MessageToL1 {\n                                to_address: 0x123.try_into().unwrap(),\n                                payload: array![123, 321, 420]\n                            }\n                        )\n                    ]\n               );\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"MessageToL1Checker\".to_string(),\n            Path::new(\"tests/data/contracts/message_to_l1_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_failed(&result);\n    assert_case_output_contains(\n        &result,\n        \"assert_not_sent_fails\",\n        \"Message with matching data and\",\n    );\n    assert_case_output_contains(&result, \"assert_not_sent_fails\", \"receiver was sent from\");\n}\n\n#[test]\nfn test_filtering() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use array::ArrayTrait;\n            use result::ResultTrait;\n            use starknet::{ContractAddress, EthAddress};\n            use snforge_std::{\n                declare, ContractClassTrait, DeclareResultTrait, spy_messages_to_l1,\n                MessageToL1, MessageToL1SpyAssertionsTrait, MessageToL1FilterTrait, MessageToL1SpyTrait\n            };\n\n\n            fn deploy_message_to_l1_checkers()  -> (IMessageToL1CheckerDispatcher, IMessageToL1CheckerDispatcher) {\n               let declared = declare(\"MessageToL1Checker\").unwrap().contract_class();\n               let (contract_address_1, _) = declared.deploy(@array![]).unwrap();\n               let (contract_address_2, _) = declared.deploy(@array![]).unwrap();\n\n               (\n                    IMessageToL1CheckerDispatcher { contract_address: contract_address_1 },\n                    IMessageToL1CheckerDispatcher { contract_address: contract_address_2 }\n               )\n            }\n\n            #[starknet::interface]\n            trait IMessageToL1Checker<TContractState> {\n                fn send_message(ref self: TContractState, some_data: Array<felt252>, to_address: EthAddress);\n            }\n\n            #[test]\n            fn filter_events() {\n                let (first_dispatcher, second_dispatcher) = deploy_message_to_l1_checkers();\n                let first_address = first_dispatcher.contract_address;\n                let second_address = second_dispatcher.contract_address;\n\n                let mut spy = spy_messages_to_l1();\n                // assert(spy._message_offset == 0, 'Message offset should be 0'); TODO(#2765)\n\n                first_dispatcher.send_message(\n                    array![123, 421, 420],\n                    0x123.try_into().unwrap()\n                 );\n                second_dispatcher.send_message(\n                    array![123, 124, 420],\n                    0x125.try_into().unwrap()\n                );\n\n                let messages_from_first_address = spy.get_messages().sent_by(first_address);\n                let messages_from_second_address = spy.get_messages().sent_by(second_address);\n\n                let (from, message) = messages_from_first_address.messages.at(0);\n                assert!(from == @first_address, \"Sent from wrong address\");\n                assert!(message.payload.len() == 3, \"There should be 3 items in the data\");\n                assert!(*message.payload.at(1) == 421, \"Expected 421 in payload\");\n\n                let (from, message) = messages_from_second_address.messages.at(0);\n                assert!(from == @second_address, \"Sent from wrong address\");\n                assert!(message.payload.len() == 3, \"There should be 3 items in the data\");\n                assert!(*message.payload.at(1) == 124, \"Expected 124 in payload\");\n            }\n        \"#,\n        ),\n        Contract::from_code_path(\n            \"MessageToL1Checker\".to_string(),\n            Path::new(\"tests/data/contracts/message_to_l1_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/meta_tx_v0.rs",
    "content": "use crate::utils::runner::{Contract, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\nuse std::path::Path;\n\n#[test]\nfn check_meta_tx_v0_syscall_work_without_cheats() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use result::ResultTrait;\n            use array::ArrayTrait;\n            use option::OptionTrait;\n            use traits::TryInto;\n            use starknet::ContractAddress;\n            use snforge_std::{\n                declare, ContractClassTrait, DeclareResultTrait\n            };\n\n            #[starknet::interface]\n            trait IMetaTxV0Test<TContractState> {\n                fn execute_meta_tx_v0(\n                    ref self: TContractState,\n                    target: starknet::ContractAddress,\n                    signature: Span<felt252>,\n                ) -> felt252;\n            }\n\n            #[test]\n            fn test_meta_tx_v0_verify_tx_context_modification() {\n                let checker_contract = declare(\"SimpleCheckerMetaTxV0\").unwrap().contract_class();\n                let (checker_address, _) = checker_contract.deploy(@ArrayTrait::new()).unwrap();\n\n                let meta_contract = declare(\"MetaTxV0Test\").unwrap().contract_class();\n                let (meta_address, _) = meta_contract.deploy(@ArrayTrait::new()).unwrap();\n                let meta_dispatcher = IMetaTxV0TestDispatcher { contract_address: meta_address };\n\n                let mut signature = ArrayTrait::new();\n\n                let result = meta_dispatcher.execute_meta_tx_v0(checker_address, signature.span());\n\n                assert(result == 1234567890, 'Result should be 1234567890');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"SimpleCheckerMetaTxV0\".to_string(),\n            Path::new(\"tests/data/contracts/meta_tx_v0_checkers.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"MetaTxV0Test\".to_string(),\n            Path::new(\"tests/data/contracts/meta_tx_v0_test.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n    assert_passed(&result);\n}\n\n#[test]\nfn meta_tx_v0_with_cheat_caller_address() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use result::ResultTrait;\n            use array::ArrayTrait;\n            use option::OptionTrait;\n            use traits::TryInto;\n            use starknet::ContractAddress;\n            use starknet::Felt252TryIntoContractAddress;\n            use snforge_std::{\n                declare, ContractClassTrait, DeclareResultTrait, start_cheat_caller_address,\n                stop_cheat_caller_address\n            };\n\n            #[starknet::interface]\n            trait IMetaTxV0Test<TContractState> {\n                fn execute_meta_tx_v0(\n                    ref self: TContractState,\n                    target: starknet::ContractAddress,\n                    signature: Span<felt252>,\n                ) -> felt252;\n            }\n\n            #[test]\n            fn test_meta_tx_v0_with_cheat_caller_address() {\n                let checker_contract = declare(\"CheatCallerAddressCheckerMetaTxV0\").unwrap().contract_class();\n                let (checker_address, _) = checker_contract.deploy(@ArrayTrait::new()).unwrap();\n\n                let meta_contract = declare(\"MetaTxV0Test\").unwrap().contract_class();\n                let (meta_address, _) = meta_contract.deploy(@ArrayTrait::new()).unwrap();\n                let meta_dispatcher = IMetaTxV0TestDispatcher { contract_address: meta_address };\n\n                let signature = ArrayTrait::new();\n\n                let old_caller = meta_dispatcher.execute_meta_tx_v0(checker_address, signature.span());\n            \n                let cheated_address: ContractAddress = 123.try_into().unwrap();\n                start_cheat_caller_address(checker_address, cheated_address);\n\n                let meta_result = meta_dispatcher.execute_meta_tx_v0(checker_address, signature.span());\n\n                assert(meta_result == cheated_address.into(), 'Should see cheated addr');\n\n                stop_cheat_caller_address(checker_address);\n\n                let meta_result = meta_dispatcher.execute_meta_tx_v0(checker_address, signature.span());\n\n                assert(meta_result == old_caller, 'Caller should revert back');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"CheatCallerAddressCheckerMetaTxV0\".to_string(),\n            Path::new(\"tests/data/contracts/meta_tx_v0_checkers.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"MetaTxV0Test\".to_string(),\n            Path::new(\"tests/data/contracts/meta_tx_v0_test.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n    assert_passed(&result);\n}\n\n#[cfg_attr(\n    feature = \"cairo-native\",\n    ignore = \"Cheats in `meta_tx_v0` are not supported on `cairo-native`\"\n)]\n#[test]\nfn meta_tx_v0_with_cheat_block_hash() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use result::ResultTrait;\n            use array::ArrayTrait;\n            use option::OptionTrait;\n            use traits::TryInto;\n            use starknet::ContractAddress;\n            use snforge_std::{\n                declare, ContractClassTrait, DeclareResultTrait, start_cheat_block_hash,\n                stop_cheat_block_hash\n            };\n\n            #[starknet::interface]\n            trait IMetaTxV0Test<TContractState> {\n                fn execute_meta_tx_v0_get_block_hash(\n                    ref self: TContractState,\n                    target: starknet::ContractAddress,\n                    block_number: u64,\n                    signature: Span<felt252>,\n                ) -> felt252;\n            }\n\n            #[test]\n            fn test_meta_tx_v0_with_cheat_block_hash() {\n                let checker_contract = declare(\"CheatBlockHashCheckerMetaTxV0\").unwrap().contract_class();\n                let (checker_address, _) = checker_contract.deploy(@ArrayTrait::new()).unwrap();\n\n                let meta_contract = declare(\"MetaTxV0Test\").unwrap().contract_class();\n                let (meta_address, _) = meta_contract.deploy(@ArrayTrait::new()).unwrap();\n                let meta_dispatcher = IMetaTxV0TestDispatcher { contract_address: meta_address };\n\n                let block_number = 100;\n                let signature = ArrayTrait::new();\n\n                let old_block_hash = meta_dispatcher.execute_meta_tx_v0_get_block_hash(checker_address, block_number, signature.span());\n\n                let cheated_hash = 555;\n                start_cheat_block_hash(checker_address, block_number, cheated_hash);\n\n                let meta_result = meta_dispatcher.execute_meta_tx_v0_get_block_hash(checker_address, block_number, signature.span());\n\n                assert(meta_result == cheated_hash, 'Should see cheated hash');\n\n                stop_cheat_block_hash(checker_address, block_number);\n\n                let new_block_hash = meta_dispatcher.execute_meta_tx_v0_get_block_hash(checker_address, block_number, signature.span());\n                assert(new_block_hash == old_block_hash, 'Block hash should revert back');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"CheatBlockHashCheckerMetaTxV0\".to_string(),\n            Path::new(\"tests/data/contracts/meta_tx_v0_checkers.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"MetaTxV0Test\".to_string(),\n            Path::new(\"tests/data/contracts/meta_tx_v0_test.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n    assert_passed(&result);\n}\n\n#[test]\nfn meta_tx_v0_verify_tx_context_modification() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use result::ResultTrait;\n            use array::ArrayTrait;\n            use option::OptionTrait;\n            use traits::TryInto;\n            use starknet::ContractAddress;\n            use snforge_std::{\n                declare, ContractClassTrait, DeclareResultTrait\n            };\n\n            #[starknet::interface]\n            trait IMetaTxV0Test<TContractState> {\n                fn execute_meta_tx_v0(\n                    ref self: TContractState,\n                    target: starknet::ContractAddress,\n                    signature: Span<felt252>,\n                ) -> felt252;\n            }\n\n            #[starknet::interface]\n            trait ITxInfoCheckerMetaTxV0<TContractState> {\n                fn __execute__(ref self: TContractState) -> felt252;\n            }\n\n            #[test]\n            fn test_meta_tx_v0_verify_tx_context_modification() {\n                let checker_contract = declare(\"TxInfoCheckerMetaTxV0\").unwrap().contract_class();\n                let (checker_address, _) = checker_contract.deploy(@ArrayTrait::new()).unwrap();\n                let checker_dispatcher = ITxInfoCheckerMetaTxV0Dispatcher { contract_address: checker_address };\n\n                let meta_contract = declare(\"MetaTxV0Test\").unwrap().contract_class();\n                let (meta_address, _) = meta_contract.deploy(@ArrayTrait::new()).unwrap();\n                let meta_dispatcher = IMetaTxV0TestDispatcher { contract_address: meta_address };\n\n                let direct_version = checker_dispatcher.__execute__();\n\n                let mut signature = ArrayTrait::new();\n\n                let meta_version = meta_dispatcher.execute_meta_tx_v0(checker_address, signature.span());\n\n                assert(meta_version == 0, 'Meta tx version should be 0');\n\n                assert(direct_version == 3, 'Direct call version should be 3');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"TxInfoCheckerMetaTxV0\".to_string(),\n            Path::new(\"tests/data/contracts/meta_tx_v0_checkers.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"MetaTxV0Test\".to_string(),\n            Path::new(\"tests/data/contracts/meta_tx_v0_test.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/mock_call.rs",
    "content": "use crate::utils::runner::{Contract, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\nuse std::path::Path;\n\n#[test]\nfn mock_call_simple() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use result::ResultTrait;\n        use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, start_mock_call, stop_mock_call };\n\n        #[starknet::interface]\n        trait IMockChecker<TContractState> {\n            fn get_thing(ref self: TContractState) -> felt252;\n        }\n\n        #[test]\n        fn mock_call_simple() {\n            let calldata = array![420];\n\n            let contract = declare(\"MockChecker\").unwrap().contract_class();\n            let (contract_address, _) = contract.deploy(@calldata).unwrap();\n\n            let dispatcher = IMockCheckerDispatcher { contract_address };\n\n            let mock_ret_data = 421;\n\n            start_mock_call(contract_address, selector!(\"get_thing\"), mock_ret_data);\n            let thing = dispatcher.get_thing();\n            assert(thing == 421, 'Incorrect thing');\n\n            stop_mock_call(contract_address, selector!(\"get_thing\"));\n            let thing = dispatcher.get_thing();\n            assert(thing == 420, 'Incorrect thing');\n        }\n\n        #[test]\n        fn mock_call_simple_before_dispatcher_created() {\n            let calldata = array![420];\n\n            let contract = declare(\"MockChecker\").unwrap().contract_class();\n            let (contract_address, _) = contract.deploy(@calldata).unwrap();\n\n            let mock_ret_data = 421;\n            start_mock_call(contract_address, selector!(\"get_thing\"), mock_ret_data);\n\n            let dispatcher = IMockCheckerDispatcher { contract_address };\n            let thing = dispatcher.get_thing();\n\n            assert(thing == 421, 'Incorrect thing');\n        }\n    \"#\n        ),\n        Contract::from_code_path(\n            \"MockChecker\".to_string(),\n            Path::new(\"tests/data/contracts/mock_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n    assert_passed(&result);\n}\n\n#[test]\nfn mock_call_complex_types() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use result::ResultTrait;\n        use array::ArrayTrait;\n        use serde::Serde;\n        use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, start_mock_call };\n\n        #[starknet::interface]\n        trait IMockChecker<TContractState> {\n            fn get_struct_thing(ref self: TContractState) -> StructThing;\n            fn get_arr_thing(ref self: TContractState) -> Array<StructThing>;\n        }\n\n        #[derive(Serde, Drop)]\n        struct StructThing {\n            item_one: felt252,\n            item_two: felt252,\n        }\n\n        #[test]\n        fn start_mock_call_return_struct() {\n            let calldata = array![420];\n\n            let contract = declare(\"MockChecker\").unwrap().contract_class();\n            let (contract_address, _) = contract.deploy(@calldata).unwrap();\n\n            let dispatcher = IMockCheckerDispatcher { contract_address };\n\n            let mock_ret_data = StructThing {item_one: 412, item_two: 421};\n            start_mock_call(contract_address, selector!(\"get_struct_thing\"), mock_ret_data);\n\n            let thing: StructThing = dispatcher.get_struct_thing();\n\n            assert(thing.item_one == 412, 'thing.item_one');\n            assert(thing.item_two == 421, 'thing.item_two');\n        }\n\n        #[test]\n        fn start_mock_call_return_arr() {\n            let calldata = array![420];\n\n            let contract = declare(\"MockChecker\").unwrap().contract_class();\n            let (contract_address, _) = contract.deploy(@calldata).unwrap();\n\n            let dispatcher = IMockCheckerDispatcher { contract_address };\n\n            let mock_ret_data =  array![ StructThing {item_one: 112, item_two: 121}, StructThing {item_one: 412, item_two: 421} ];\n            start_mock_call(contract_address, selector!(\"get_arr_thing\"), mock_ret_data);\n\n            let things: Array<StructThing> = dispatcher.get_arr_thing();\n\n            let thing = things.at(0);\n            assert(*thing.item_one == 112, 'thing1.item_one');\n            assert(*thing.item_two == 121, 'thing1.item_two');\n\n            let thing = things.at(1);\n            assert(*thing.item_one == 412, 'thing2.item_one');\n            assert(*thing.item_two == 421, 'thing2.item_two');\n        }\n    \"#\n        ),\n        Contract::from_code_path(\n            \"MockChecker\".to_string(),\n            Path::new(\"tests/data/contracts/mock_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n    assert_passed(&result);\n}\n\n#[test]\nfn mock_calls() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use result::ResultTrait;\n        use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, mock_call, start_mock_call, stop_mock_call };\n\n        #[starknet::interface]\n        trait IMockChecker<TContractState> {\n            fn get_thing(ref self: TContractState) -> felt252;\n        }\n\n        #[test]\n        fn mock_call_one() {\n            let calldata = array![420];\n\n            let contract = declare(\"MockChecker\").unwrap().contract_class();\n            let (contract_address, _) = contract.deploy(@calldata).unwrap();\n\n            let dispatcher = IMockCheckerDispatcher { contract_address };\n\n            let mock_ret_data = 421;\n\n            mock_call(contract_address, selector!(\"get_thing\"), mock_ret_data, 1);\n\n            let thing = dispatcher.get_thing();\n            assert_eq!(thing, 421);\n\n            let thing = dispatcher.get_thing();\n            assert_eq!(thing, 420);\n        }\n\n        #[test]\n        fn mock_call_twice() {\n            let calldata = array![420];\n\n            let contract = declare(\"MockChecker\").unwrap().contract_class();\n            let (contract_address, _) = contract.deploy(@calldata).unwrap();\n\n            let dispatcher = IMockCheckerDispatcher { contract_address };\n\n            let mock_ret_data = 421;\n\n            mock_call(contract_address, selector!(\"get_thing\"), mock_ret_data, 2);\n\n            let thing = dispatcher.get_thing();\n            assert_eq!(thing, 421);\n\n            let thing = dispatcher.get_thing();\n            assert_eq!(thing, 421);\n\n            let thing = dispatcher.get_thing();\n            assert_eq!(thing, 420);\n        }\n    \"#\n        ),\n        Contract::from_code_path(\n            \"MockChecker\".to_string(),\n            Path::new(\"tests/data/contracts/mock_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/mod.rs",
    "content": "mod available_gas;\nmod builtins;\nmod cheat_block_hash;\nmod cheat_block_number;\nmod cheat_block_timestamp;\nmod cheat_caller_address;\nmod cheat_execution_info;\nmod cheat_fork;\nmod cheat_sequencer_address;\nmod config;\nmod declare;\nmod deploy;\nmod deploy_at;\nmod dict;\nmod dispatchers;\nmod env;\nmod fuzzing;\nmod gas;\nmod generate_random_felt;\nmod get_available_gas;\nmod get_class_hash;\nmod get_current_vm_step;\nmod interact_with_state;\nmod l1_handler_executor;\nmod message_to_l1;\nmod meta_tx_v0;\nmod mock_call;\nmod precalculate_address;\nmod pure_cairo;\nmod replace_bytecode;\nmod resources;\nmod reverts;\nmod runtime;\nmod set_balance;\nmod setup_fork;\nmod should_panic;\nmod signing;\nmod spy_events;\nmod store_load;\nmod syscalls;\nmod test_state;\nmod too_many_events;\nmod trace;\n"
  },
  {
    "path": "crates/forge/tests/integration/precalculate_address.rs",
    "content": "use crate::utils::runner::{Contract, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\nuse std::path::Path;\n\n#[test]\nfn precalculate_address() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use result::ResultTrait;\n        use snforge_std::{ declare, ContractClass, ContractClassTrait, DeclareResultTrait };\n        use array::ArrayTrait;\n        use traits::Into;\n        use traits::TryInto;\n        use starknet::ContractAddressIntoFelt252;\n\n        #[test]\n        fn precalculate_address() {\n            let mut calldata = ArrayTrait::new();\n\n            let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n            let contract_address_pre = contract.precalculate_address(@calldata);\n            let (contract_address, _) = contract.deploy(@calldata).unwrap();\n            let contract_address_pre2 = contract.precalculate_address(@calldata);\n            let (contract_address2, _) = contract.deploy(@calldata).unwrap();\n\n            assert(contract_address_pre == contract_address, 'must be eq');\n            assert(contract_address_pre2 == contract_address2, 'must be eq');\n            assert(contract_address != contract_address2, 'must be different');\n        }\n    \"#\n        ),\n        Contract::from_code_path(\n            \"HelloStarknet\".to_string(),\n            Path::new(\"tests/data/contracts/hello_starknet.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/pure_cairo.rs",
    "content": "use crate::utils::running_tests::run_test_case;\nuse crate::utils::{\n    runner::{assert_failed, assert_passed},\n    test_case,\n};\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\n\n#[test]\nfn simple() {\n    let test = test_case!(indoc!(\n        r\"#[test]\n        fn simple() {\n            assert(2 == 2, '2 == 2');\n        }\n    \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn failing() {\n    let test = test_case!(indoc!(\n        r\"#[test]\n        fn failing() {\n            assert(2 == 3, '2 == 3');\n        }\n    \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_failed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/replace_bytecode.rs",
    "content": "use crate::utils::runner::{Contract, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\nuse std::path::Path;\n\n#[test]\nfn override_entrypoint() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use core::clone::Clone;\n            use snforge_std::{declare, replace_bytecode, ContractClassTrait, DeclareResultTrait};\n\n            #[starknet::interface]\n            trait IReplaceBytecode<TContractState> {\n                fn get(self: @TContractState) -> felt252;\n            }\n\n            #[test]\n            fn override_entrypoint() {\n                let contract = declare(\"ReplaceBytecodeA\").unwrap().contract_class();\n                let contract_b_class = declare(\"ReplaceBytecodeB\").unwrap().contract_class().class_hash.clone();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = IReplaceBytecodeDispatcher { contract_address };\n\n                assert(dispatcher.get() == 2137, '');\n\n                replace_bytecode(contract_address, contract_b_class);\n\n                assert(dispatcher.get() == 420, '');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"ReplaceBytecodeA\",\n            Path::new(\"tests/data/contracts/two_implementations.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"ReplaceBytecodeB\",\n            Path::new(\"tests/data/contracts/two_implementations.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn libcall_in_cheated() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use core::clone::Clone;\n            use snforge_std::{declare, replace_bytecode, ContractClassTrait, DeclareResultTrait};\n\n            #[starknet::interface]\n            trait IReplaceBytecode<TContractState> {\n                fn libcall(self: @TContractState, class_hash: starknet::ClassHash) -> felt252;\n            }\n\n            #[starknet::interface]\n            trait ILib<TContractState> {\n                fn get(self: @TContractState) -> felt252;\n            }\n\n            #[test]\n            fn override_entrypoint() {\n                let contract = declare(\"ReplaceBytecodeA\").unwrap().contract_class();\n                let contract_b_class = declare(\"ReplaceBytecodeB\").unwrap().contract_class().clone().class_hash;\n                let lib = declare(\"Lib\").unwrap().contract_class().clone().class_hash;\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = IReplaceBytecodeDispatcher { contract_address };\n\n                assert(dispatcher.libcall(lib) == 123456789, '');\n\n                replace_bytecode(contract_address, contract_b_class);\n\n                assert(dispatcher.libcall(lib) == 123456789, '');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"Lib\",\n            Path::new(\"tests/data/contracts/two_implementations.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"ReplaceBytecodeA\",\n            Path::new(\"tests/data/contracts/two_implementations.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"ReplaceBytecodeB\",\n            Path::new(\"tests/data/contracts/two_implementations.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn contract_not_deployed() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use core::clone::Clone;\n            use snforge_std::{declare, replace_bytecode, ReplaceBytecodeError, DeclareResultTrait};\n            use starknet::{ClassHash, contract_address_const};\n\n            #[test]\n            fn contract_not_deployed() {\n                let class_hash = declare(\"ReplaceBytecodeA\").unwrap().contract_class().clone().class_hash;\n\n                let non_existing_contract_address = contract_address_const::<0x2>();\n                match replace_bytecode(non_existing_contract_address, class_hash) {\n                    Result::Ok(()) => {\n                        panic!(\"Wrong return type\");\n                    },\n                    Result::Err(err) => {\n                        assert(err == ReplaceBytecodeError::ContractNotDeployed(()), 'Wrong error type');\n                    }\n                }\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"ReplaceBytecodeA\",\n            Path::new(\"tests/data/contracts/two_implementations.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn class_hash_not_declared() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{declare, ContractClassTrait, replace_bytecode, ReplaceBytecodeError, DeclareResultTrait};\n            use starknet::{ClassHash, contract_address_const};\n\n            #[test]\n            fn class_hash_not_declared() {\n                let contract = declare(\"ReplaceBytecodeA\").unwrap().contract_class();\n                let undeclared_class_hash: ClassHash = 0x5.try_into().unwrap();\n                let (contract_address, _) = contract.deploy(@array![]).unwrap();\n\n                match replace_bytecode(contract_address, undeclared_class_hash) {\n                    Result::Ok(()) => {\n                        panic!(\"Wrong return type\");\n                    },\n                    Result::Err(err) => {\n                        assert(err == ReplaceBytecodeError::UndeclaredClassHash(()), 'Wrong error type');\n                    }\n                }\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"ReplaceBytecodeA\",\n            Path::new(\"tests/data/contracts/two_implementations.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/resources.rs",
    "content": "use crate::utils::runner::{Contract, assert_builtin, assert_passed, assert_syscall};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse blockifier::execution::syscalls::vm_syscall_utils::SyscallSelector;\nuse cairo_vm::types::builtin_name::BuiltinName;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\nuse std::path::Path;\n\n#[test]\nfn builtins_count() {\n    let test = test_case!(indoc!(\n        r\"\n            #[test]\n            fn empty() {}\n\n            #[test]\n            fn range_check() {\n                assert((1_u8 + 1_u8) >= 1_u8, 'error message');\n            }\n\n            #[test]\n            fn bitwise() {\n                let _bitwise = 1_u8 & 1_u8;\n                assert(1 == 1, 'error message');\n            }\n\n            #[test]\n            fn pedersen() {\n                core::pedersen::pedersen(1, 2);\n                assert(1 == 1, 'error message');\n            }\n\n            #[test]\n            fn poseidon() {\n                core::poseidon::hades_permutation(0, 0, 0);\n                assert(1 == 1, 'error message');\n            }\n\n            #[test]\n            fn ec_op() {\n                let ec_point = core::ec::EcPointTrait::new_from_x(1).unwrap();\n                core::ec::EcPointTrait::mul(ec_point, 2);\n                assert(1 == 1, 'error message');\n            }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n\n    // No ECDSA and Keccak builtins\n    assert_builtin(&result, \"empty\", BuiltinName::range_check, 4);\n    assert_builtin(&result, \"range_check\", BuiltinName::range_check, 4);\n    assert_builtin(&result, \"bitwise\", BuiltinName::bitwise, 1);\n    assert_builtin(&result, \"pedersen\", BuiltinName::pedersen, 1);\n    assert_builtin(&result, \"poseidon\", BuiltinName::poseidon, 1);\n    assert_builtin(&result, \"ec_op\", BuiltinName::ec_op, 1);\n}\n\n#[test]\nfn syscalls_count() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use core::clone::Clone;\n            use starknet::syscalls::{\n                call_contract_syscall, keccak_syscall, deploy_syscall, get_block_hash_syscall, emit_event_syscall,\n                send_message_to_l1_syscall, get_execution_info_syscall, get_execution_info_v2_syscall,\n                get_execution_info_v3_syscall, SyscallResult\n            };\n            use starknet::SyscallResultTrait;\n            use snforge_std::{declare, ContractClass, ContractClassTrait, DeclareResultTrait};\n\n            #[test]\n            fn keccak() {\n                let input = array![1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17];\n                keccak_syscall(input.span()).unwrap_syscall();\n            }\n\n            #[test]\n            fn deploy() {\n                let contract = declare(\"HelloStarknet\").unwrap().contract_class().clone();\n                deploy_syscall(contract.class_hash, 0, array![].span(), false).unwrap_syscall();\n            }\n\n            #[test]\n            fn storage_read() {\n                let contract = declare(\"HelloStarknet\").unwrap().contract_class().clone();\n                let (address, _) = deploy_syscall(contract.class_hash, 0, array![].span(), false)\n                    .unwrap_syscall();\n\n                call_contract_syscall(address, selector!(\"get_balance\"), array![].span()).unwrap_syscall();\n            }\n\n            #[test]\n            fn storage_write() {\n                let contract = declare(\"HelloStarknet\").unwrap().contract_class().clone();\n                let (address, _) = deploy_syscall(contract.class_hash, 0, array![].span(), false)\n                    .unwrap_syscall();\n\n                call_contract_syscall(address, selector!(\"increase_balance\"), array![123].span())\n                    .unwrap_syscall();\n            }\n\n            #[test]\n            fn get_block_hash() {\n                get_block_hash_syscall(1).unwrap_syscall();\n            }\n\n            #[test]\n            fn get_execution_info() {\n                get_execution_info_syscall().unwrap_syscall();\n            }\n\n            #[test]\n            fn get_execution_info_v2() {\n                get_execution_info_v2_syscall().unwrap_syscall();\n            }\n\n            #[test]\n            fn get_execution_info_v3() {\n                get_execution_info_v3_syscall().unwrap_syscall();\n            }\n\n            #[test]\n            fn send_message_to_l1() {\n                send_message_to_l1_syscall(1, array![1].span()).unwrap_syscall();\n            }\n\n            #[test]\n            fn emit_event() {\n                emit_event_syscall(array![1].span(), array![2].span()).unwrap_syscall();\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"HelloStarknet\".to_string(),\n            Path::new(\"tests/data/contracts/hello_starknet.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n\n    assert_syscall(&result, \"keccak\", SyscallSelector::Keccak, 1);\n    assert_syscall(&result, \"deploy\", SyscallSelector::Deploy, 1);\n    assert_syscall(&result, \"storage_read\", SyscallSelector::StorageRead, 1);\n    assert_syscall(&result, \"storage_write\", SyscallSelector::StorageWrite, 1);\n    assert_syscall(&result, \"get_block_hash\", SyscallSelector::GetBlockHash, 1);\n    assert_syscall(\n        &result,\n        \"get_execution_info\",\n        SyscallSelector::GetExecutionInfo,\n        1,\n    );\n    assert_syscall(\n        &result,\n        \"get_execution_info_v2\",\n        SyscallSelector::GetExecutionInfo,\n        1,\n    );\n    assert_syscall(\n        &result,\n        \"get_execution_info_v3\",\n        SyscallSelector::GetExecutionInfo,\n        1,\n    );\n    assert_syscall(\n        &result,\n        \"send_message_to_l1\",\n        SyscallSelector::SendMessageToL1,\n        1,\n    );\n    assert_syscall(&result, \"emit_event\", SyscallSelector::EmitEvent, 1);\n}\n\n#[test]\nfn accumulate_syscalls() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n\n            #[starknet::interface]\n            trait IGasChecker<TContractState> {\n                fn change_balance(ref self: TContractState, new_balance: u64);\n            }\n\n            #[test]\n            fn single_write() {\n                let contract = declare(\"GasChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = IGasCheckerDispatcher { contract_address };\n\n                dispatcher.change_balance(1);\n            }\n\n            #[test]\n            fn double_write() {\n                let contract = declare(\"GasChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = IGasCheckerDispatcher { contract_address };\n\n                dispatcher.change_balance(1);\n                dispatcher.change_balance(2);\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"GasChecker\".to_string(),\n            Path::new(\"tests/data/contracts/gas_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n    assert_syscall(&result, \"single_write\", SyscallSelector::StorageWrite, 1);\n    assert_syscall(&result, \"double_write\", SyscallSelector::StorageWrite, 2);\n}\n\n#[test]\nfn estimation_includes_os_resources() {\n    let test = test_case!(indoc!(\n        \"\n            use starknet::{SyscallResultTrait, StorageAddress};\n\n            #[test]\n            fn syscall_storage_write() {\n                let storage_address: StorageAddress = 10.try_into().unwrap();\n                starknet::storage_write_syscall(0, storage_address, 10).unwrap_syscall();\n                starknet::storage_write_syscall(0, storage_address, 10).unwrap_syscall();\n                starknet::storage_write_syscall(0, storage_address, 10).unwrap_syscall();\n                assert(1 == 1, 'haha');\n            }\n\n            #[test]\n            fn syscall_storage_write_baseline() {\n                let _storage_address: StorageAddress = 10.try_into().unwrap();\n                // starknet::storage_write_syscall(0, storage_address, 10).unwrap_syscall();\n                // starknet::storage_write_syscall(0, storage_address, 10).unwrap_syscall();\n                // starknet::storage_write_syscall(0, storage_address, 10).unwrap_syscall();\n                assert(1 == 1, 'haha');\n            }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n    assert_passed(&result);\n    // Cost of storage write in builtins is 1 range check and 89 steps\n    // Steps are pretty hard to verify so this test is based on range check diff\n\n    assert_builtin(\n        &result,\n        \"syscall_storage_write\",\n        BuiltinName::range_check,\n        10,\n    );\n    assert_builtin(\n        &result,\n        \"syscall_storage_write_baseline\",\n        BuiltinName::range_check,\n        7,\n    );\n}\n\n#[test]\nfn deploy_with_constructor_calldata() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n            use starknet::syscalls::deploy_syscall;\n\n            #[test]\n            fn deploy_with_syscall() {\n                let contract = declare(\"DeployChecker\").unwrap().contract_class().clone();\n                let (address, _) = deploy_syscall(contract.class_hash, 0, array![100].span(), false).unwrap();\n                assert(address != 0.try_into().unwrap(), 'Incorrect deployed address');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"DeployChecker\".to_string(),\n            Path::new(\"tests/data/contracts/deploy_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n    assert_passed(&result);\n\n    assert_syscall(&result, \"deploy_with_syscall\", SyscallSelector::Deploy, 1);\n    // As of Starknet v0.13.5, deploy syscall uses constant 7 pedersen builtins + 1 additional as calldata factor in this case\n    // https://github.com/starkware-libs/sequencer/blob/b9d99e118ad23664cda984505414d49c3cb6b19f/crates/blockifier/resources/blockifier_versioned_constants_0_13_5.json#L166\n    assert_builtin(&result, \"deploy_with_syscall\", BuiltinName::pedersen, 8);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/reverts.rs",
    "content": "use crate::utils::runner::{Contract, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\n\n#[test]\nfn storage_is_reverted_in_test_call() {\n    let test = test_case!(\n        indoc! {\n            r#\"\n        use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n\n        #[starknet::interface]\n        trait IContract<TContractState> {\n            fn read_storage(self: @TContractState) -> felt252;\n            fn write_storage(ref self: TContractState, value: felt252);\n            fn write_storage_and_panic(ref self: TContractState, value: felt252);\n        }\n\n        #[test]\n        #[feature(\"safe_dispatcher\")]\n        fn test_call_storage_is_reverted() {\n            let contract = declare(\"Contract\").unwrap().contract_class();\n            let (contract_address, _) = contract.deploy(@array![]).unwrap();\n            let dispatcher = IContractSafeDispatcher { contract_address }; \n\n            dispatcher.write_storage(5).unwrap();\n            // Make sure storage value was written correctly\n            let storage = dispatcher.read_storage().unwrap();\n            assert_eq!(storage, 5, \"Incorrect storage value\");\n            \n            // Call storage modification and handle panic\n            match dispatcher.write_storage_and_panic(11) {\n                Result::Ok(_) => panic!(\"Should have panicked\"),\n                Result::Err(_) => {\n                    // handled\n                },\n            }\n            \n            // Check storage change was reverted\n            let storage = dispatcher.read_storage().unwrap();\n            assert_eq!(storage, 5, \"Storage was not reverted\");\n        }\n            \"#\n        },\n        Contract::from_code_path(\"Contract\", \"tests/data/contracts/reverts_contract.cairo\")\n            .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n    assert_passed(&result);\n}\n\n#[test]\nfn storage_is_reverted_in_proxy_call() {\n    let test = test_case!(\n        indoc! {\n            r#\"\n        use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n\n        #[starknet::interface]\n        trait IProxy<TContractState> {\n            fn read_storage(self: @TContractState) -> felt252;\n            fn write_storage(ref self: TContractState, value: felt252);\n            fn write_storage_and_panic(ref self: TContractState, value: felt252);\n        }\n\n        #[test]\n        #[feature(\"safe_dispatcher\")]\n        fn test_call_storage_is_reverted() {\n            let contract = declare(\"Contract\").unwrap().contract_class();\n            let (contract_address, _) = contract.deploy(@array![]).unwrap();\n\n            let contract_proxy = declare(\"Proxy\").unwrap().contract_class();\n            let mut calldata = array![];\n            contract_address.serialize(ref calldata);\n            let (contract_address_proxy, _) = contract_proxy.deploy(@calldata).unwrap();\n\n            let dispatcher = IProxySafeDispatcher { contract_address: contract_address_proxy };\n\n            dispatcher.write_storage(5).unwrap();\n            // Make sure storage value was written correctly\n            let storage = dispatcher.read_storage().unwrap();\n            assert_eq!(storage, 5, \"Incorrect storage value\");\n\n            // Try modifying storage and handle panic\n            match dispatcher.write_storage_and_panic(1) {\n                Result::Ok(_) => panic!(\"Should have panicked\"),\n                Result::Err(_panic_data) => {\n                    // handled\n                },\n            }\n\n            // Check storage change was reverted\n            let storage = dispatcher.read_storage().unwrap();\n            assert_eq!(storage, 5, \"Storage was not reverted\");\n        }\n            \"#\n        },\n        Contract::from_code_path(\"Proxy\", \"tests/data/contracts/reverts_proxy.cairo\").unwrap(),\n        Contract::from_code_path(\"Contract\", \"tests/data/contracts/reverts_contract.cairo\")\n            .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n    assert_passed(&result);\n}\n\n#[test]\nfn storage_is_reverted_in_safe_proxy_call() {\n    let test = test_case!(\n        indoc! {\n            r#\"\n        use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n\n        #[starknet::interface]\n        trait ISafeProxy<TContractState> {\n            fn read_storage(self: @TContractState) -> felt252;\n            fn write_storage(ref self: TContractState, value: felt252);\n            fn call_write_storage_and_handle_panic(ref self: TContractState, value: felt252);\n        }\n\n        #[test]\n        #[feature(\"safe_dispatcher\")]\n        fn test_call_storage_is_reverted() {\n            let contract = declare(\"Contract\").unwrap().contract_class();\n            let (contract_address, _) = contract.deploy(@array![]).unwrap();\n\n            let contract_proxy = declare(\"Proxy\").unwrap().contract_class();\n            let mut calldata = array![];\n            contract_address.serialize(ref calldata);\n            let (contract_address_proxy, _) = contract_proxy.deploy(@calldata).unwrap();\n\n            let dispatcher = ISafeProxyDispatcher { contract_address: contract_address_proxy };\n\n            dispatcher.write_storage(5);\n            // Make sure storage value was written correctly\n            let storage = dispatcher.read_storage();\n            assert_eq!(storage, 5, \"Incorrect storage value\");\n\n            dispatcher.call_write_storage_and_handle_panic(123);\n\n            // Check storage change was reverted\n            let storage = dispatcher.read_storage();\n            assert_eq!(storage, 5, \"Storage was not reverted\");\n        }\n            \"#\n        },\n        Contract::from_code_path(\"Proxy\", \"tests/data/contracts/reverts_proxy.cairo\").unwrap(),\n        Contract::from_code_path(\"Contract\", \"tests/data/contracts/reverts_contract.cairo\")\n            .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n    assert_passed(&result);\n}\n\n#[test]\nfn storage_is_reverted_in_inner_call() {\n    let test = test_case!(\n        indoc! {\n            r#\"\n        use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n\n        #[starknet::interface]\n        trait ICaller<TContractState> {\n            fn call(ref self: TContractState);\n        }\n\n        #[test]\n        #[feature(\"safe_dispatcher\")]\n        fn test_call_storage_is_reverted() {\n            let contract = declare(\"Contract\").unwrap().contract_class();\n            let (contract_address, _) = contract.deploy(@array![]).unwrap();\n\n            let contract_proxy = declare(\"Caller\").unwrap().contract_class();\n            let mut calldata = array![];\n            contract_address.serialize(ref calldata);\n            let (contract_address_caller, _) = contract_proxy.deploy(@calldata).unwrap();\n\n            let dispatcher = ICallerDispatcher { contract_address: contract_address_caller };\n            dispatcher.call();\n        }\n            \"#\n        },\n        Contract::from_code_path(\"Caller\", \"tests/data/contracts/reverts_caller.cairo\").unwrap(),\n        Contract::from_code_path(\"Contract\", \"tests/data/contracts/reverts_contract.cairo\")\n            .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n    assert_passed(&result);\n}\n\n#[test]\nfn storage_is_reverted_in_library_call() {\n    let test = test_case!(\n        indoc! {\n            r#\"\n        use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait };\n        use starknet::ContractAddress;\n\n        #[starknet::interface]\n        trait ILibraryProxy<TContractState> {\n            fn library_read_storage(self: @TContractState, address: ContractAddress) -> felt252;\n            fn library_write_storage(self: @TContractState, address: ContractAddress, value: felt252);\n            fn library_write_storage_and_panic(self: @TContractState, address: ContractAddress, value: felt252);\n        }\n\n        #[test]\n        #[feature(\"safe_dispatcher\")]\n        fn test_library_call_storage_is_reverted() {\n            let contract = declare(\"Contract\").unwrap().contract_class();\n            let (contract_address, _) = contract.deploy(@array![]).unwrap();\n\n            let contract_proxy = declare(\"Proxy\").unwrap().contract_class();\n\n            let dispatcher = ILibraryProxySafeLibraryDispatcher { class_hash: *contract_proxy.class_hash };\n\n            dispatcher.library_write_storage(contract_address, 5).unwrap();\n            // Make sure storage value was written correctly\n            let storage = dispatcher.library_read_storage(contract_address).unwrap();\n            assert_eq!(storage, 5, \"Incorrect storage value\");\n\n            // Call storage modification and handle panic\n            match dispatcher.library_write_storage_and_panic(contract_address, 11) {\n                Result::Ok(_) => panic!(\"Should have panicked\"),\n                Result::Err(_) => {\n                    // handled\n                },\n            }\n\n            // Check storage change was reverted\n            let storage = dispatcher.library_read_storage(contract_address).unwrap();\n            assert_eq!(storage, 5, \"Storage was not reverted\");\n        }\n            \"#\n        },\n        Contract::from_code_path(\"Contract\", \"tests/data/contracts/reverts_contract.cairo\")\n            .unwrap(),\n        Contract::from_code_path(\"Proxy\", \"tests/data/contracts/reverts_proxy.cairo\").unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/runtime.rs",
    "content": "use crate::utils::runner::{assert_case_output_contains, assert_failed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\n\n#[test]\nfn missing_cheatcode_error() {\n    let test = test_case!(indoc!(\n        r\"\n            use starknet::testing::cheatcode;\n            use array::ArrayTrait;\n\n            #[test]\n            fn missing_cheatcode_error() {\n                cheatcode::<'not_existing123'>(array![1, 2].span());\n                assert(1==1, 'nothing')\n            }\n        \"\n    ));\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n    assert_failed(&result);\n    assert_case_output_contains(\n        &result,\n        \"missing_cheatcode_error\",\n        indoc!(\n            r\"\n            Function `not_existing123` is not supported in this runtime\n            Check if used library (`snforge_std` or `sncast_std`) is compatible with used binary, probably one of them is not updated\n        \"\n        ),\n    );\n}\n#[test]\nfn cairo_test_cheatcode_error() {\n    let test = test_case!(indoc!(\n        r\"\n            use starknet::testing::cheatcode;\n            use array::ArrayTrait;\n\n            #[test]\n            fn missing_cheatcode_error() {\n                cheatcode::<'set_version'>(array![1, 2].span());\n                assert(1==1, 'nothing')\n            }\n        \"\n    ));\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n    assert_failed(&result);\n    assert_case_output_contains(\n        &result,\n        \"missing_cheatcode_error\",\n        indoc!(\n            r\"\n            Function `set_version` is not supported in this runtime\n            Check if functions are imported from `snforge_std`/`sncast_std` NOT from `starknet::testing`\n        \"\n        ),\n    );\n}\n\n#[test]\n#[ignore = \"TODO(#2765)\"]\nfn cheatcode_invalid_args() {\n    let test = test_case!(indoc!(\n        r\"\n            use starknet::testing::cheatcode;\n            use snforge_std::_cheatcode::handle_cheatcode;\n\n            #[test]\n            fn cheatcode_invalid_args() {\n                handle_cheatcode(cheatcode::<'replace_bytecode'>(array![].span()));\n                assert(true,'');\n            }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_case_output_contains(\n        &result,\n        \"cheatcode_invalid_args\",\n        indoc!(\n            r#\"\n                \"Reading from buffer failed, this can be caused by calling starknet::testing::cheatcode with invalid arguments.\n                    Probably `snforge_std`/`sncast_std` version is incompatible, check above for incompatibility warning.\n                    \"\n            \"#\n        ),\n    );\n    assert_failed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/set_balance.rs",
    "content": "use crate::utils::runner::{Contract, assert_case_output_contains, assert_failed, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case as utils_test_case;\nuse cheatnet::predeployment::erc20::eth::ETH_CONTRACT_ADDRESS;\nuse cheatnet::predeployment::erc20::strk::STRK_CONTRACT_ADDRESS;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::{formatdoc, indoc};\nuse shared::test_utils::node_url::node_rpc_url;\nuse std::path::Path;\nuse test_case::test_case;\n\n#[test_case(\"STRK\";\"strk\")]\n#[test_case(\"ETH\";\"eth\")]\nfn test_set_balance_predefined_token(token: &str) {\n    let test = utils_test_case!(\n        formatdoc!(\n            r#\"\n            use snforge_std::{{set_balance, Token, TokenTrait}};\n            use starknet::{{ContractAddress, syscalls, SyscallResultTrait}};\n\n            fn get_balance(contract_address: ContractAddress, token: Token) -> Span<felt252> {{\n                let mut calldata: Array<felt252> = array![contract_address.into()];\n                let balance = syscalls::call_contract_syscall(\n                    token.contract_address(), selector!(\"balance_of\"), calldata.span(),\n                )\n                    .unwrap_syscall();\n                balance\n            }}\n\n            #[test]\n            fn test_set_balance_predefined_token() {{\n                let contract_address: ContractAddress = 0x123.try_into().unwrap();\n\n                let balance_before = get_balance(contract_address, Token::{token});\n                assert_eq!(balance_before, array![0, 0].span(), \"Balance should be 0\");\n\n                set_balance(contract_address, 10, Token::{token});\n\n                let balance_after = get_balance(contract_address, Token::{token});\n                assert_eq!(balance_after, array![10, 0].span(), \"Balance should be 10\");\n        }}\n        \"#\n        )\n        .as_str(),\n        Contract::from_code_path(\n            \"HelloStarknet\",\n            Path::new(\"tests/data/simple_package/src/hello_starknet.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn test_set_balance_custom_token() {\n    let test = utils_test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{declare, set_balance, Token, TokenTrait, CustomToken, ContractClassTrait, DeclareResultTrait,};\n            use starknet::{ContractAddress, syscalls, SyscallResultTrait};\n\n            fn deploy_contract(\n                name: ByteArray, constructor_calldata: Array<felt252>,\n            ) -> ContractAddress {\n                let contract = declare(name).unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@constructor_calldata).unwrap();\n                contract_address\n            }\n\n            fn get_balance(contract_address: ContractAddress, token: Token) -> Span<felt252> {\n                let mut calldata: Array<felt252> = array![contract_address.into()];\n                let balance = syscalls::call_contract_syscall(\n                    token.contract_address(), selector!(\"balance_of\"), calldata.span(),\n                )\n                    .unwrap_syscall();\n                balance\n            }\n\n            #[test]\n            fn test_set_balance_custom_token() {\n                let contract_address: ContractAddress = 0x123.try_into().unwrap();\n\n                let constructor_calldata: Array<felt252> = array![\n                    'CustomToken'.into(), 'CT'.into(), 18.into(), 1_000_000_000.into(), 0.into(), 123.into(),\n                ];\n                let token_address = deploy_contract(\"ERC20\", constructor_calldata);\n                let custom_token = Token::Custom(\n                    CustomToken {\n                        contract_address: token_address, balances_variable_selector: selector!(\"balances\"),\n                    },\n                );\n\n                let balance_before = get_balance(contract_address, custom_token);\n                assert_eq!(balance_before, array![0, 0].span(), \"Balance should be 0\");\n\n                set_balance(contract_address, 10, custom_token);\n\n                let balance_after = get_balance(contract_address, custom_token);\n                assert_eq!(balance_after, array![10, 0].span(), \"Balance should be 10\");\n            }\n        \"#\n        ),\n        Contract::from_code_path(\"ERC20\", Path::new(\"tests/data/contracts/erc20.cairo\"),).unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test_case(\"STRK\";\"strk\")]\n#[test_case(\"ETH\";\"eth\")]\nfn test_set_balance_big_amount(token: &str) {\n    let test = utils_test_case!(\n        format!(\n            r#\"\n            use core::num::traits::Pow;\n            use snforge_std::{{set_balance, Token, TokenTrait}};\n            use starknet::{{ContractAddress, syscalls, SyscallResultTrait}};\n\n            fn get_balance(contract_address: ContractAddress, token: Token) -> Span<felt252> {{\n                let mut calldata: Array<felt252> = array![contract_address.into()];\n                let balance = syscalls::call_contract_syscall(\n                    token.contract_address(), selector!(\"balance_of\"), calldata.span(),\n                )\n                    .unwrap_syscall();\n                balance\n            }}\n\n            #[test]\n            fn test_set_balance_big_amount() {{\n                let contract_address: ContractAddress = 0x123.try_into().unwrap();\n\n                let balance_before = get_balance(contract_address, Token::{token});\n                assert_eq!(balance_before, array![0, 0].span(), \"Balance should be 0\");\n\n                set_balance(contract_address, (10.pow(50_u32)).try_into().unwrap(), Token::{token});\n\n                let balance_after = get_balance(contract_address, Token::{token});\n                assert_eq!(\n                    balance_after,\n                    array![194599656488044247630319707454198251520, 293873587705].span(),\n                    \"Balance should should be 10^50\",\n                );\n            }}\n        \"#\n        )\n        .as_str(),\n        Contract::from_code_path(\n            \"HelloStarknet\".to_string(),\n            Path::new(\"tests/data/simple_package/src/hello_starknet.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test_case(\"STRK\", [109_394_843_313_476_728_397_u128, 0];\"strk\")]\n#[test_case(\"ETH\", [24_969_862_322_663_205, 0];\"eth\")]\nfn test_set_balance_with_fork(token: &str, balance_before: [u128; 2]) {\n    let balance_before_low = balance_before[0];\n    let balance_before_high = balance_before[1];\n    let test = utils_test_case!(\n        formatdoc!(\n            r#\"\n            use snforge_std::{{set_balance, Token, TokenTrait}};\n            use starknet::{{ContractAddress, syscalls, SyscallResultTrait}};\n\n            fn get_balance(contract_address: ContractAddress, token: Token) -> Span<felt252> {{\n                let mut calldata: Array<felt252> = array![contract_address.into()];\n                let balance = syscalls::call_contract_syscall(\n                    token.contract_address(), selector!(\"balance_of\"), calldata.span(),\n                )\n                    .unwrap_syscall();\n                balance\n        }}\n\n            #[fork(url: \"{}\", block_number: 715_593)]\n            #[test]\n            fn test_set_balance_strk_with_fork() {{\n                let contract_address: ContractAddress =\n                    0x0585dd8cab667ca8415fac8bead99c78947079aa72d9120140549a6f2edc4128\n                    .try_into()\n                    .unwrap();\n\n                let balance_before = get_balance(contract_address, Token::{token});\n                assert_eq!(balance_before, array![{balance_before_low}, {balance_before_high}].span());\n\n                set_balance(contract_address, 10, Token::{token});\n\n                let balance_after = get_balance(contract_address, Token::{token});\n                assert_eq!(balance_after, array![10, 0].span(), \"Balance should should be 10\");\n        }}\n        \"#,\n            node_rpc_url(),\n        )\n        .as_str(),\n        Contract::from_code_path(\n            \"HelloStarknet\".to_string(),\n            Path::new(\"tests/data/simple_package/src/hello_starknet.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test_case(\"STRK\", STRK_CONTRACT_ADDRESS; \"strk\")]\n#[test_case(\"ETH\", ETH_CONTRACT_ADDRESS; \"eth\")]\nfn test_set_balance_with_disabled_predeployment(token: &str, contract_address: &str) {\n    let test = utils_test_case!(\n        formatdoc!(\n            r#\"\n            use snforge_std::{{Token, TokenTrait}};\n            use starknet::{{ContractAddress, syscalls, SyscallResultTrait}};\n\n            fn get_balance(contract_address: ContractAddress, token: Token) -> Span<felt252> {{\n                let mut calldata: Array<felt252> = array![contract_address.into()];\n                let balance = syscalls::call_contract_syscall(\n                    token.contract_address(), selector!(\"balance_of\"), calldata.span(),\n                )\n                    .unwrap_syscall();\n                balance\n            }}\n\n            #[test]\n            #[disable_predeployed_contracts]\n            fn test_set_balance_strk_with_disabled_predeployment() {{\n                let contract_address: ContractAddress = 0x123.try_into().unwrap();\n                get_balance(contract_address, Token::{});\n            }}\n        \"#,\n            token\n        )\n        .as_str(),\n        Contract::from_code_path(\n            \"HelloStarknet\".to_string(),\n            Path::new(\"tests/data/simple_package/src/hello_starknet.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_failed(&result);\n\n    let asserted_msg = format!(\"Contract not deployed at address: {contract_address}\");\n    assert_case_output_contains(\n        &result,\n        \"test_set_balance_strk_with_disabled_predeployment\",\n        &asserted_msg,\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/setup_fork.rs",
    "content": "use cheatnet::runtime_extensions::forge_config_extension::config::BlockId;\nuse forge_runner::partition::PartitionConfig;\nuse foundry_ui::UI;\nuse indoc::{formatdoc, indoc};\nuse std::num::NonZeroU32;\nuse std::path::Path;\nuse std::sync::Arc;\n\nuse camino::Utf8PathBuf;\nuse forge::block_number_map::BlockNumberMap;\nuse forge::run_tests::package::run_for_package;\nuse forge::run_tests::test_target::ExitFirstChannel;\nuse forge::scarb::config::ForkTarget;\nuse forge::test_filter::TestsFilter;\nuse tempfile::tempdir;\nuse tokio::runtime::Runtime;\n\nuse crate::utils::runner::{Contract, assert_case_output_contains, assert_failed, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse cheatnet::runtime_extensions::forge_runtime_extension::contracts_data::ContractsData;\nuse forge::run_tests::package::RunForPackageArgs;\nuse forge::shared_cache::FailedTestsCache;\nuse forge_runner::CACHE_DIR;\nuse forge_runner::debugging::TraceArgs;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse forge_runner::forge_config::{\n    ExecutionDataToSave, ForgeConfig, OutputConfig, TestRunnerConfig,\n};\nuse forge_runner::running::target::prepare_test_target;\nuse forge_runner::scarb::load_test_artifacts;\nuse scarb_api::ScarbCommand;\nuse scarb_api::metadata::metadata_for_dir;\nuse shared::test_utils::node_url::node_rpc_url;\n\n#[test]\nfn fork_simple_decorator() {\n    let test = test_case!(formatdoc!(\n        r#\"\n            use result::ResultTrait;\n            use array::ArrayTrait;\n            use option::OptionTrait;\n            use traits::TryInto;\n            use starknet::ContractAddress;\n            use starknet::Felt252TryIntoContractAddress;\n            use starknet::contract_address_const;\n\n            #[starknet::interface]\n            trait IHelloStarknet<TContractState> {{\n                fn increase_balance(ref self: TContractState, amount: felt252);\n                fn get_balance(self: @TContractState) -> felt252;\n            }}\n\n            #[test]\n            #[fork(url: \"{}\", block_number: 54060)]\n            fn fork_simple_decorator() {{\n                let dispatcher = IHelloStarknetDispatcher {{\n                    contract_address: contract_address_const::<0x202de98471a4fae6bcbabb96cab00437d381abc58b02509043778074d6781e9>()\n                }};\n\n                let balance = dispatcher.get_balance();\n                assert(balance == 0, 'Balance should be 0');\n\n                dispatcher.increase_balance(100);\n\n                let balance = dispatcher.get_balance();\n                assert(balance == 100, 'Balance should be 100');\n            }}\n        \"#,\n        node_rpc_url()\n    ).as_str());\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[expect(clippy::too_many_lines)]\n#[test]\nfn fork_aliased_decorator() {\n    let test = test_case!(indoc!(\n        r#\"\n            use result::ResultTrait;\n            use array::ArrayTrait;\n            use option::OptionTrait;\n            use traits::TryInto;\n            use starknet::ContractAddress;\n            use starknet::Felt252TryIntoContractAddress;\n            use starknet::contract_address_const;\n\n            #[starknet::interface]\n            trait IHelloStarknet<TContractState> {\n                fn increase_balance(ref self: TContractState, amount: felt252);\n                fn get_balance(self: @TContractState) -> felt252;\n            }\n\n            #[test]\n            #[fork(\"FORK_NAME_FROM_SCARB_TOML\")]\n            fn fork_aliased_decorator() {\n                let dispatcher = IHelloStarknetDispatcher {\n                    contract_address: contract_address_const::<0x202de98471a4fae6bcbabb96cab00437d381abc58b02509043778074d6781e9>()\n                };\n\n                let balance = dispatcher.get_balance();\n                assert(balance == 0, 'Balance should be 0');\n\n                dispatcher.increase_balance(100);\n\n                let balance = dispatcher.get_balance();\n                assert(balance == 100, 'Balance should be 100');\n            }\n        \"#\n    ));\n\n    let rt = Runtime::new().expect(\"Could not instantiate Runtime\");\n\n    ScarbCommand::new_with_stdio()\n        .current_dir(test.path().unwrap())\n        .arg(\"build\")\n        .arg(\"--test\")\n        .run()\n        .unwrap();\n\n    let metadata = metadata_for_dir(test.path().unwrap()).unwrap();\n\n    let package = metadata\n        .packages\n        .iter()\n        .find(|p| p.name == \"test_package\")\n        .unwrap();\n\n    let raw_test_targets =\n        load_test_artifacts(&test.path().unwrap().join(\"target/dev\"), package).unwrap();\n\n    let ui = Arc::new(UI::default());\n    let result = rt\n        .block_on(async {\n            let target_handles = raw_test_targets\n                .into_iter()\n                .map(|t| {\n                    tokio::task::spawn_blocking(move || {\n                        prepare_test_target(t, &ForgeTrackedResource::CairoSteps)\n                    })\n                })\n                .collect();\n            run_for_package(\n                RunForPackageArgs {\n                    target_handles,\n                    package_name: \"test_package\".to_string(),\n                    package_root: Utf8PathBuf::default(),\n                    tests_filter: TestsFilter::from_flags(\n                        None,\n                        false,\n                        Vec::new(),\n                        false,\n                        false,\n                        false,\n                        FailedTestsCache::default(),\n                        PartitionConfig::default(),\n                    ),\n                    forge_config: Arc::new(ForgeConfig {\n                        test_runner_config: Arc::new(TestRunnerConfig {\n                            exit_first: false,\n                            deterministic_output: false,\n                            fuzzer_runs: NonZeroU32::new(256).unwrap(),\n                            fuzzer_seed: 12345,\n                            max_n_steps: None,\n                            is_vm_trace_needed: false,\n                            cache_dir: Utf8PathBuf::from_path_buf(tempdir().unwrap().keep())\n                                .unwrap()\n                                .join(CACHE_DIR),\n                            contracts_data: ContractsData::try_from(test.contracts(&ui).unwrap())\n                                .unwrap(),\n                            tracked_resource: ForgeTrackedResource::CairoSteps,\n                            environment_variables: test.env().clone(),\n                            launch_debugger: false,\n                        }),\n                        output_config: Arc::new(OutputConfig {\n                            detailed_resources: false,\n                            execution_data_to_save: ExecutionDataToSave::default(),\n                            trace_args: TraceArgs::default(),\n                            gas_report: false,\n                        }),\n                    }),\n                    fork_targets: vec![ForkTarget {\n                        name: \"FORK_NAME_FROM_SCARB_TOML\".to_string(),\n                        url: node_rpc_url().as_str().parse().unwrap(),\n                        block_id: BlockId::BlockTag,\n                    }],\n                },\n                &BlockNumberMap::default(),\n                ui,\n                &mut ExitFirstChannel::default(),\n            )\n            .await\n        })\n        .expect(\"Runner fail\")\n        .summaries();\n\n    assert_passed(&result);\n}\n\n#[test]\nfn fork_aliased_decorator_overrding() {\n    let test = test_case!(indoc!(\n        r#\"\n            use starknet::syscalls::get_execution_info_syscall;\n\n            #[test]\n            #[fork(\"FORK_NAME_FROM_SCARB_TOML\", block_number: 2137)]\n            fn test_get_block_number() {\n                let execution_info = get_execution_info_syscall().unwrap().deref();\n                let block_info = execution_info.block_info.deref();\n                let block_number = block_info.block_number;\n\n                assert(block_number == 2137, 'Invalid block');\n            }\n        \"#\n    ));\n\n    let rt = Runtime::new().expect(\"Could not instantiate Runtime\");\n\n    ScarbCommand::new_with_stdio()\n        .current_dir(test.path().unwrap())\n        .arg(\"build\")\n        .arg(\"--test\")\n        .run()\n        .unwrap();\n\n    let metadata = metadata_for_dir(test.path().unwrap()).unwrap();\n\n    let package = metadata\n        .packages\n        .iter()\n        .find(|p| p.name == \"test_package\")\n        .unwrap();\n\n    let raw_test_targets =\n        load_test_artifacts(&test.path().unwrap().join(\"target/dev\"), package).unwrap();\n\n    let ui = Arc::new(UI::default());\n    let result = rt\n        .block_on(async {\n            let target_handles = raw_test_targets\n                .into_iter()\n                .map(|t| {\n                    tokio::task::spawn_blocking(move || {\n                        prepare_test_target(t, &ForgeTrackedResource::CairoSteps)\n                    })\n                })\n                .collect();\n            run_for_package(\n                RunForPackageArgs {\n                    target_handles,\n                    package_name: \"test_package\".to_string(),\n                    package_root: Utf8PathBuf::default(),\n                    tests_filter: TestsFilter::from_flags(\n                        None,\n                        false,\n                        Vec::new(),\n                        false,\n                        false,\n                        false,\n                        FailedTestsCache::default(),\n                        PartitionConfig::default(),\n                    ),\n                    forge_config: Arc::new(ForgeConfig {\n                        test_runner_config: Arc::new(TestRunnerConfig {\n                            exit_first: false,\n                            deterministic_output: false,\n                            fuzzer_runs: NonZeroU32::new(256).unwrap(),\n                            fuzzer_seed: 12345,\n                            max_n_steps: None,\n                            is_vm_trace_needed: false,\n                            cache_dir: Utf8PathBuf::from_path_buf(tempdir().unwrap().keep())\n                                .unwrap()\n                                .join(CACHE_DIR),\n                            contracts_data: ContractsData::try_from(test.contracts(&ui).unwrap())\n                                .unwrap(),\n                            tracked_resource: ForgeTrackedResource::CairoSteps,\n                            environment_variables: test.env().clone(),\n                            launch_debugger: false,\n                        }),\n                        output_config: Arc::new(OutputConfig {\n                            detailed_resources: false,\n                            execution_data_to_save: ExecutionDataToSave::default(),\n                            trace_args: TraceArgs::default(),\n                            gas_report: false,\n                        }),\n                    }),\n                    fork_targets: vec![ForkTarget {\n                        name: \"FORK_NAME_FROM_SCARB_TOML\".to_string(),\n                        url: node_rpc_url().as_str().parse().unwrap(),\n                        block_id: BlockId::BlockNumber(12_341_234),\n                    }],\n                },\n                &BlockNumberMap::default(),\n                ui,\n                &mut ExitFirstChannel::default(),\n            )\n            .await\n        })\n        .expect(\"Runner fail\")\n        .summaries();\n\n    assert_passed(&result);\n}\n\n#[test]\nfn fork_cairo0_contract() {\n    let test = test_case!(formatdoc!(\n        r#\"\n            use starknet::contract_address_const;\n\n            #[starknet::interface]\n            trait IERC20Camel<TState> {{\n                fn totalSupply(self: @TState) -> u256;\n            }}\n\n            #[test]\n            #[fork(url: \"{}\", block_number: 54060)]\n            fn fork_cairo0_contract() {{\n                let contract_address = contract_address_const::<0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7>();\n\n                let dispatcher = IERC20CamelDispatcher {{ contract_address }};\n\n                let total_supply = dispatcher.totalSupply();\n                assert(total_supply == 88730316280408105750094, 'Wrong total supply');\n            }}\n        \"#,\n        node_rpc_url()\n    ).as_str());\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn get_block_info_in_forked_block() {\n    let test = test_case!(formatdoc!(\n        r#\"\n            use starknet::ContractAddress;\n            use starknet::ContractAddressIntoFelt252;\n            use starknet::contract_address_const;\n            use snforge_std::{{ declare, ContractClassTrait, DeclareResultTrait }};\n\n            #[starknet::interface]\n            trait IBlockInfoChecker<TContractState> {{\n                fn read_block_number(self: @TContractState) -> u64;\n                fn read_block_timestamp(self: @TContractState) -> u64;\n                fn read_sequencer_address(self: @TContractState) -> ContractAddress;\n            }}\n\n            #[test]\n            #[fork(url: \"{node_rpc_url}\", block_number: 54060)]\n            fn test_fork_get_block_info_contract_on_testnet() {{\n                let dispatcher = IBlockInfoCheckerDispatcher {{\n                    contract_address: contract_address_const::<0x3d80c579ad7d83ff46634abe8f91f9d2080c5c076d4f0f59dd810f9b3f01164>()\n                }};\n\n                let timestamp = dispatcher.read_block_timestamp();\n                assert(timestamp == 1711645884, timestamp.into());\n                let block_number = dispatcher.read_block_number();\n                assert(block_number == 54060, block_number.into());\n\n                let expected_sequencer_addr = contract_address_const::<0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8>();\n                let sequencer_addr = dispatcher.read_sequencer_address();\n                assert(sequencer_addr == expected_sequencer_addr, sequencer_addr.into());\n            }}\n\n            #[test]\n            #[fork(url: \"{node_rpc_url}\", block_number: 54060)]\n            fn test_fork_get_block_info_test_state() {{\n                let block_info = starknet::get_block_info().unbox();\n                assert(block_info.block_timestamp == 1711645884, block_info.block_timestamp.into());\n                assert(block_info.block_number == 54060, block_info.block_number.into());\n                let expected_sequencer_addr = contract_address_const::<0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8>();\n                assert(block_info.sequencer_address == expected_sequencer_addr, block_info.sequencer_address.into());\n            }}\n\n            #[test]\n            #[fork(url: \"{node_rpc_url}\", block_number: 54060)]\n            fn test_fork_get_block_info_contract_deployed() {{\n                let contract = declare(\"BlockInfoChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = IBlockInfoCheckerDispatcher {{ contract_address }};\n\n                let timestamp = dispatcher.read_block_timestamp();\n                assert(timestamp == 1711645884, timestamp.into());\n                let block_number = dispatcher.read_block_number();\n                assert(block_number == 54060, block_number.into());\n\n                let expected_sequencer_addr = contract_address_const::<0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8>();\n                let sequencer_addr = dispatcher.read_sequencer_address();\n                assert(sequencer_addr == expected_sequencer_addr, sequencer_addr.into());\n            }}\n\n            #[test]\n            #[fork(url: \"{node_rpc_url}\", block_tag: latest)]\n            fn test_fork_get_block_info_latest_block() {{\n                let block_info = starknet::get_block_info().unbox();\n                assert(block_info.block_timestamp > 1711645884, block_info.block_timestamp.into());\n                assert(block_info.block_number > 54060, block_info.block_number.into());\n            }}\n\n            #[test]\n            #[fork(url: \"{node_rpc_url}\", block_hash: 0x06ae121e46f5375f93b00475fb130348ae38148e121f84b0865e17542e9485de)]\n            fn test_fork_get_block_info_block_hash() {{\n                let block_info = starknet::get_block_info().unbox();\n                assert(block_info.block_timestamp == 1711645884, block_info.block_timestamp.into());\n                assert(block_info.block_number == 54060, block_info.block_number.into());\n                let expected_sequencer_addr = contract_address_const::<0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8>();\n                assert(block_info.sequencer_address == expected_sequencer_addr, block_info.sequencer_address.into());\n            }}\n\n            #[test]\n            #[fork(url: \"{node_rpc_url}\", block_hash: 3021433528476416000728121069095289682281028310523383289416465162415092565470)]\n            fn test_fork_get_block_info_block_hash_with_number() {{\n                let block_info = starknet::get_block_info().unbox();\n                assert(block_info.block_timestamp == 1711645884, block_info.block_timestamp.into());\n                assert(block_info.block_number == 54060, block_info.block_number.into());\n                let expected_sequencer_addr = contract_address_const::<0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8>();\n                assert(block_info.sequencer_address == expected_sequencer_addr, block_info.sequencer_address.into());\n            }}\n        \"#,\n        node_rpc_url = node_rpc_url()\n    ).as_str(),\n    Contract::from_code_path(\n        \"BlockInfoChecker\".to_string(),\n        Path::new(\"tests/data/contracts/block_info_checker.cairo\"),\n    ).unwrap());\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn fork_get_block_info_fails() {\n    let test = test_case!(\n        formatdoc!(\n            r#\"\n            #[test]\n            #[fork(url: \"{}\", block_number: 999999999999)]\n            fn fork_get_block_info_fails() {{\n                starknet::get_block_info();\n            }}\n        \"#,\n            node_rpc_url()\n        )\n        .as_str()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_failed(&result);\n    assert_case_output_contains(\n        &result,\n        \"fork_get_block_info_fails\",\n        \"Unable to get block with tx hashes from fork\",\n    );\n}\n\n#[test]\n// found in: https://github.com/foundry-rs/starknet-foundry/issues/1175\nfn incompatible_abi() {\n    let test = test_case!(formatdoc!(\n        r#\"\n            #[derive(Serde)]\n            struct Response {{\n                payload: felt252,\n                // there is second field on chain\n            }}\n\n            #[starknet::interface]\n            trait IResponseWith2Felts<State> {{\n                fn get(self: @State) -> Response;\n            }}\n\n            #[test]\n            #[fork(url: \"{}\", block_tag: latest)]\n            fn test_forking_functionality() {{\n                let gov_contract_addr: starknet::ContractAddress = 0x66e4b798c66160bd5fd04056938e5c9f65d67f183dfab9d7d0d2ed9413276fe.try_into().unwrap();\n                let dispatcher = IResponseWith2FeltsDispatcher {{ contract_address: gov_contract_addr }};\n                let propdetails = dispatcher.get();\n                assert(propdetails.payload == 8, 'payload not match');\n            }}\n        \"#,\n        node_rpc_url()\n    )\n    .as_str());\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/should_panic.rs",
    "content": "use forge_runner::forge_config::ForgeTrackedResource;\nuse std::path::Path;\n\nuse crate::utils::runner::{Contract, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse indoc::indoc;\n\n#[test]\nfn should_panic() {\n    let test = test_case!(indoc!(\n        r\"\n            use array::ArrayTrait;\n\n            #[test]\n            #[should_panic]\n            fn should_panic_with_no_expected_data() {\n                panic_with_felt252(0);\n            }\n\n            #[test]\n            #[should_panic(expected: ('panic message', ))]\n            fn should_panic_check_data() {\n                panic_with_felt252('panic message');\n            }\n\n            #[test]\n            #[should_panic(expected: ('panic message', 'second message',))]\n            fn should_panic_multiple_messages(){\n                let mut arr = ArrayTrait::new();\n                arr.append('panic message');\n                arr.append('second message');\n                panic(arr);\n            }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn should_panic_unknown_entry_point() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use array::ArrayTrait;\n            use starknet::{call_contract_syscall, ContractAddress, Felt252TryIntoContractAddress};\n            use result::ResultTrait;\n\n            use snforge_std::{declare, ContractClass, ContractClassTrait, DeclareResultTrait};\n\n            #[test]\n            #[should_panic]\n            fn should_panic_with_no_expected_data() {\n                let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n\n                match call_contract_syscall(\n                    contract_address,\n                    'inexistent_entry_point',\n                    ArrayTrait::<felt252>::new().span()\n                ) {\n                    Result::Ok(_) => panic_with_felt252('Expected an error'),\n                    Result::Err(err) => panic(err),\n                };\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"HelloStarknet\".to_string(),\n            Path::new(\"tests/data/contracts/hello_starknet.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/signing.rs",
    "content": "use crate::utils::running_tests::run_test_case;\nuse crate::utils::{runner::assert_passed, test_case};\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\n\n#[test]\nfn test_stark_sign_msg_hash_range() {\n    let test = test_case!(indoc!(\n        r\"\n            use snforge_std::signature::{KeyPairTrait, SignError};\n            use snforge_std::signature::stark_curve::{StarkCurveKeyPairImpl, StarkCurveSignerImpl, StarkCurveVerifierImpl};\n            \n            const UPPER_BOUND: felt252 = 0x800000000000000000000000000000000000000000000000000000000000000;\n\n            #[test]\n            fn valid_range() {\n                let key_pair = KeyPairTrait::<felt252, felt252>::generate();\n                \n                let msg_hash = UPPER_BOUND - 1;\n                let (r, s): (felt252, felt252) = key_pair.sign(msg_hash).unwrap();\n            \n                let is_valid = key_pair.verify(msg_hash, (r, s));\n                assert(is_valid, 'Signature should be valid');\n            }\n\n            #[test]\n            fn invalid_range() {\n                let key_pair = KeyPairTrait::<felt252, felt252>::generate();\n                \n                // message_hash should be smaller than UPPER_BOUND\n                // https://github.com/starkware-libs/crypto-cpp/blob/78e3ed8dc7a0901fe6d62f4e99becc6e7936adfd/src/starkware/crypto/ecdsa.cc#L65\n                let msg_hash = UPPER_BOUND;\n                assert(key_pair.sign(msg_hash).unwrap_err() == SignError::HashOutOfRange, '');\n            }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn test_stark_curve() {\n    let test = test_case!(indoc!(\n        r\"\n        use snforge_std::signature::KeyPairTrait;\n        use snforge_std::signature::stark_curve::{StarkCurveKeyPairImpl, StarkCurveSignerImpl, StarkCurveVerifierImpl};\n        \n        #[test]\n        fn simple_signing_flow() {\n            let key_pair = KeyPairTrait::<felt252, felt252>::generate();\n            \n            let msg_hash = 0xbadc0ffee;\n            let (r, s): (felt252, felt252) = key_pair.sign(msg_hash).unwrap();\n        \n            let is_valid = key_pair.verify(msg_hash, (r, s));\n            assert(is_valid, 'Signature should be valid');\n        \n            let key_pair2 = KeyPairTrait::<felt252, felt252>::from_secret_key(key_pair.secret_key);\n            assert(key_pair.secret_key == key_pair2.secret_key, 'Secret keys should be equal');\n            assert(key_pair.public_key == key_pair2.public_key, 'Public keys should be equal');\n        }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn test_secp256k1_curve() {\n    let test = test_case!(indoc!(\n        r\"\n            use snforge_std::signature::KeyPairTrait;\n            use snforge_std::signature::secp256k1_curve::{Secp256k1CurveKeyPairImpl, Secp256k1CurveSignerImpl, Secp256k1CurveVerifierImpl};\n            use starknet::secp256k1::{Secp256k1Point, Secp256k1PointImpl};\n            use core::starknet::SyscallResultTrait;\n\n            #[test]\n            fn simple_signing_flow() {\n                let key_pair = KeyPairTrait::<u256, Secp256k1Point>::generate();\n                \n                let msg_hash = 0xbadc0ffee;\n                let (r, s): (u256, u256) = key_pair.sign(msg_hash).unwrap();\n            \n                let is_valid = key_pair.verify(msg_hash, (r, s));\n                assert(is_valid, 'Signature should be valid');\n            \n                let key_pair2 = KeyPairTrait::<u256, Secp256k1Point>::from_secret_key(key_pair.secret_key);\n                assert(key_pair.secret_key == key_pair2.secret_key, 'Secret keys should be equal');\n                assert(key_pair.public_key.get_coordinates().unwrap_syscall() == key_pair2.public_key.get_coordinates().unwrap_syscall(), 'Public keys should be equal');\n            }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn test_secp256r1_curve() {\n    let test = test_case!(indoc!(\n        r\"\n            use snforge_std::signature::KeyPairTrait;\n            use snforge_std::signature::secp256r1_curve::{Secp256r1CurveKeyPairImpl, Secp256r1CurveSignerImpl, Secp256r1CurveVerifierImpl};\n            use starknet::secp256r1::{Secp256r1Point, Secp256r1PointImpl};\n            use core::starknet::SyscallResultTrait;\n\n            #[test]\n            fn simple_signing_flow() {\n                let key_pair = KeyPairTrait::<u256, Secp256r1Point>::generate();\n                \n                let msg_hash = 0xbadc0ffee;\n                let (r, s): (u256, u256) = key_pair.sign(msg_hash).unwrap();\n            \n                let is_valid = key_pair.verify(msg_hash, (r, s));\n                assert(is_valid, 'Signature should be valid');\n            \n                let key_pair2 = KeyPairTrait::<u256, Secp256r1Point>::from_secret_key(key_pair.secret_key);\n                assert(key_pair.secret_key == key_pair2.secret_key, 'Secret keys should be equal');\n                assert(key_pair.public_key.get_coordinates().unwrap_syscall() == key_pair2.public_key.get_coordinates().unwrap_syscall(), 'Public keys should be equal');\n            }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn test_secp256_curves() {\n    let test = test_case!(indoc!(\n        r\"\n            use snforge_std::signature::KeyPairTrait;\n            use snforge_std::signature::secp256k1_curve::{Secp256k1CurveKeyPairImpl, Secp256k1CurveSignerImpl, Secp256k1CurveVerifierImpl};\n            use snforge_std::signature::secp256r1_curve::{Secp256r1CurveKeyPairImpl, Secp256r1CurveSignerImpl, Secp256r1CurveVerifierImpl};\n            use starknet::secp256k1::{Secp256k1Point, Secp256k1PointImpl};\n            use starknet::secp256r1::{Secp256r1Point, Secp256r1PointImpl};\n            use core::starknet::SyscallResultTrait;\n\n            #[test]\n            fn secp256_curves() {\n                let secret_key = 554433;\n\n                let key_pair_k1 = KeyPairTrait::<u256, Secp256k1Point>::from_secret_key(secret_key);\n                let key_pair_r1 = KeyPairTrait::<u256, Secp256r1Point>::from_secret_key(secret_key);\n                \n                assert(key_pair_k1.secret_key == key_pair_r1.secret_key, 'Secret keys should equal');\n                assert(key_pair_k1.public_key.get_coordinates().unwrap_syscall() != key_pair_r1.public_key.get_coordinates().unwrap_syscall(), 'Public keys should be different');\n\n                let msg_hash: u256 = 0xbadc0ffee;\n\n                let sig_k1 = key_pair_k1.sign(msg_hash).unwrap();\n                let sig_r1 = key_pair_r1.sign(msg_hash).unwrap();\n                \n                assert(sig_k1 != sig_r1, 'Signatures should be different');\n\n                assert(key_pair_k1.verify(msg_hash, sig_k1) == true, 'Signature should be valid');\n                assert(key_pair_r1.verify(msg_hash, sig_r1) == true, 'Signature should be valid');\n                \n                assert(key_pair_k1.verify(msg_hash, sig_r1) == false, 'Signature should be invalid');\n                assert(key_pair_r1.verify(msg_hash, sig_k1) == false, 'Signature should be invalid');\n            }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn test_stark_secp256k1_curves() {\n    let test = test_case!(indoc!(\n        r\"\n            use snforge_std::signature::KeyPairTrait;\n            use snforge_std::signature::stark_curve::{StarkCurveKeyPairImpl, StarkCurveSignerImpl, StarkCurveVerifierImpl};\n            use snforge_std::signature::secp256k1_curve::{Secp256k1CurveKeyPairImpl, Secp256k1CurveSignerImpl, Secp256k1CurveVerifierImpl};\n            use starknet::secp256k1::{Secp256k1Point, Secp256k1PointImpl};\n            use core::starknet::SyscallResultTrait;\n            \n            #[test]\n            fn stark_secp256k1_curves() {\n                let secret_key = 554433;\n            \n                let key_pair_stark = KeyPairTrait::<felt252, felt252>::from_secret_key(secret_key);\n                let key_pair_secp256k1 = KeyPairTrait::<u256, Secp256k1Point>::from_secret_key(secret_key.into());\n                \n                assert(key_pair_stark.secret_key.into() == key_pair_secp256k1.secret_key, 'Secret keys should equal');\n            \n                let (pk_x_secp256k1, _pk_y_secp256k1) = key_pair_secp256k1.public_key.get_coordinates().unwrap_syscall();\n            \n                assert(key_pair_stark.public_key.into() != pk_x_secp256k1, 'Public keys should be different');\n            \n                let msg_hash = 0xbadc0ffee;\n            \n                let (r_stark, s_stark): (felt252, felt252) = key_pair_stark.sign(msg_hash).unwrap();\n                let (r_secp256k1, s_secp256k1): (u256, u256) = key_pair_secp256k1.sign(msg_hash.into()).unwrap();\n                \n                assert(r_stark.into() != r_secp256k1, 'Signatures should be different');\n                assert(s_stark.into() != s_secp256k1, 'Signatures should be different');\n            \n                assert(key_pair_stark.verify(msg_hash, (r_stark, s_stark)) == true, 'Signature should be valid');\n                assert(key_pair_secp256k1.verify(msg_hash.into(), (r_secp256k1, s_secp256k1)) == true, 'Signature should be valid');\n                \n                assert(key_pair_secp256k1.verify(msg_hash.into(), (r_stark.into(), s_stark.into())) == false, 'Signature should be invalid');\n            }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn test_invalid_secret_key() {\n    let test = test_case!(indoc!(\n        r\"\n            use snforge_std::signature::{KeyPair, KeyPairTrait, SignError};\n            use snforge_std::signature::stark_curve::{StarkCurveKeyPairImpl, StarkCurveSignerImpl};\n            use snforge_std::signature::secp256k1_curve::{Secp256k1CurveKeyPairImpl, Secp256k1CurveSignerImpl};\n            use snforge_std::signature::secp256r1_curve::{Secp256r1CurveKeyPairImpl, Secp256r1CurveSignerImpl};\n            use starknet::secp256k1::{Secp256k1Impl, Secp256k1Point};\n            use starknet::secp256r1::{Secp256r1Impl, Secp256r1Point};\n            \n            #[test]\n            #[should_panic(expected: ('invalid secret_key', ))]\n            fn from_secret_key_stark() {\n                KeyPairTrait::<felt252, felt252>::from_secret_key(0);\n            }\n            \n            #[test]\n            #[should_panic(expected: ('invalid secret_key', ))]\n            fn from_secret_key_secp256k1() {\n                KeyPairTrait::<u256, Secp256k1Point>::from_secret_key(0);\n            }\n            \n            #[test]\n            #[should_panic(expected: ('invalid secret_key', ))]\n            fn from_secret_key_secp256r1() {\n                KeyPairTrait::<u256, Secp256r1Point>::from_secret_key(0);\n            }\n            \n            #[test]\n            fn sign_stark() {\n                let key_pair = KeyPair { secret_key: 0, public_key: 0x321 } ;\n                assert(key_pair.sign(123).unwrap_err() == SignError::InvalidSecretKey, '');\n            }\n            \n            #[test]\n            fn sign_secp256k1() {\n                let generator = Secp256k1Impl::get_generator_point();\n                let key_pair = KeyPair { secret_key: 0, public_key: generator } ;\n                assert(key_pair.sign(123).unwrap_err() == SignError::InvalidSecretKey, '');\n            }\n            \n            #[test]\n            fn sign_secp256r1() {\n                let generator = Secp256r1Impl::get_generator_point();\n                let key_pair = KeyPair { secret_key: 0, public_key: generator } ;\n                assert(key_pair.sign(123).unwrap_err() == SignError::InvalidSecretKey, '');\n            }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/spy_events.rs",
    "content": "use crate::utils::runner::{Contract, assert_case_output_contains, assert_failed, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::{formatdoc, indoc};\nuse shared::test_utils::node_url::node_rpc_url;\nuse std::path::Path;\n\n#[test]\nfn spy_events_simple() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use array::ArrayTrait;\n            use result::ResultTrait;\n            use starknet::ContractAddress;\n            use snforge_std::{\n                declare, ContractClassTrait, DeclareResultTrait, spy_events, Event,\n                EventSpy, EventSpyTrait, EventSpyAssertionsTrait, EventsFilterTrait\n            };\n\n            #[starknet::interface]\n            trait ISpyEventsChecker<TContractState> {\n                fn emit_one_event(ref self: TContractState, some_data: felt252);\n            }\n\n            #[starknet::contract]\n            mod SpyEventsChecker {\n                use starknet::ContractAddress;\n\n                #[storage]\n                struct Storage {}\n\n                #[event]\n                #[derive(Drop, starknet::Event)]\n                enum Event {\n                    FirstEvent: FirstEvent\n                }\n\n                #[derive(Drop, starknet::Event)]\n                struct FirstEvent {\n                    some_data: felt252\n                }\n            }\n\n            #[test]\n            fn spy_events_simple() {\n                let contract = declare(\"SpyEventsChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = ISpyEventsCheckerDispatcher { contract_address };\n\n                let mut spy = spy_events();\n                // assert(spy._event_offset == 0, 'Event offset should be 0'); TODO(#2765)\n                dispatcher.emit_one_event(123);\n\n                spy.assert_emitted(@array![\n                    (\n                        contract_address,\n                        SpyEventsChecker::Event::FirstEvent(\n                            SpyEventsChecker::FirstEvent { some_data: 123 }\n                        )\n                    )\n                ]);\n                assert(spy.get_events().events.len() == 1, 'There should be one event');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"SpyEventsChecker\".to_string(),\n            Path::new(\"tests/data/contracts/spy_events_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn assert_emitted_fails() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use array::ArrayTrait;\n            use result::ResultTrait;\n            use starknet::ContractAddress;\n            use snforge_std::{\n                declare, DeclareResultTrait, ContractClassTrait, spy_events, Event,\n                EventSpy, EventSpyTrait, EventSpyAssertionsTrait, EventsFilterTrait\n            };\n\n            #[starknet::interface]\n            trait ISpyEventsChecker<TContractState> {\n                fn do_not_emit(ref self: TContractState);\n            }\n\n            #[starknet::contract]\n            mod SpyEventsChecker {\n                use starknet::ContractAddress;\n\n                #[storage]\n                struct Storage {}\n\n                #[event]\n                #[derive(Drop, starknet::Event)]\n                enum Event {\n                    FirstEvent: FirstEvent\n                }\n\n                #[derive(Drop, starknet::Event)]\n                struct FirstEvent {\n                    some_data: felt252\n                }\n            }\n\n            #[test]\n            fn assert_emitted_fails() {\n                let contract = declare(\"SpyEventsChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = ISpyEventsCheckerDispatcher { contract_address };\n\n                let mut spy = spy_events();\n                dispatcher.do_not_emit();\n\n                spy.assert_emitted(@array![\n                    (\n                        contract_address,\n                        SpyEventsChecker::Event::FirstEvent(\n                            SpyEventsChecker::FirstEvent { some_data: 123 }\n                        )\n                    )\n                ]);\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"SpyEventsChecker\".to_string(),\n            Path::new(\"tests/data/contracts/spy_events_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_failed(&result);\n    assert_case_output_contains(\n        &result,\n        \"assert_emitted_fails\",\n        \"Event with matching data and\",\n    );\n    assert_case_output_contains(&result, \"assert_emitted_fails\", \"keys was not emitted\");\n}\n\n#[test]\nfn expect_three_events_while_two_emitted() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use array::ArrayTrait;\n            use result::ResultTrait;\n            use traits::Into;\n            use starknet::contract_address_const;\n            use starknet::ContractAddress;\n            use snforge_std::{\n                declare, ContractClassTrait, DeclareResultTrait, spy_events, Event,\n                EventSpy, EventSpyTrait, EventSpyAssertionsTrait, EventsFilterTrait\n            };\n\n            #[starknet::interface]\n            trait ISpyEventsChecker<TContractState> {\n                fn emit_two_events(ref self: TContractState, some_data: felt252, some_more_data: ContractAddress);\n            }\n\n            #[starknet::contract]\n            mod SpyEventsChecker {\n                use starknet::ContractAddress;\n\n                #[storage]\n                struct Storage {}\n\n                #[event]\n                #[derive(Drop, starknet::Event)]\n                enum Event {\n                    FirstEvent: FirstEvent,\n                    SecondEvent: SecondEvent,\n                    ThirdEvent: ThirdEvent,\n                }\n\n                #[derive(Drop, starknet::Event)]\n                struct FirstEvent {\n                    some_data: felt252\n                }\n\n                #[derive(Drop, starknet::Event)]\n                struct SecondEvent {\n                    some_data: felt252,\n                    #[key]\n                    some_more_data: ContractAddress\n                }\n\n                #[derive(Drop, starknet::Event)]\n                struct ThirdEvent {\n                    some_data: felt252,\n                    some_more_data: ContractAddress,\n                    even_more_data: u256\n                }\n            }\n\n            #[test]\n            fn expect_three_events_while_two_emitted() {\n                let contract = declare(\"SpyEventsChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@array![]).unwrap();\n                let dispatcher = ISpyEventsCheckerDispatcher { contract_address };\n\n                let some_data = 456;\n                let some_more_data = contract_address_const::<789>();\n                let even_more_data = 0;\n\n                let mut spy = spy_events();\n                dispatcher.emit_two_events(some_data, some_more_data);\n\n                spy.assert_emitted(@array![\n                    (\n                        contract_address,\n                        SpyEventsChecker::Event::FirstEvent(\n                            SpyEventsChecker::FirstEvent { some_data }\n                        )\n                    ),\n                    (\n                        contract_address,\n                        SpyEventsChecker::Event::SecondEvent(\n                            SpyEventsChecker::SecondEvent { some_data, some_more_data }\n                        )\n                    ),\n                    (\n                        contract_address,\n                        SpyEventsChecker::Event::ThirdEvent(\n                            SpyEventsChecker::ThirdEvent { some_data, some_more_data, even_more_data }\n                        )\n                    )\n                ]);\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"SpyEventsChecker\".to_string(),\n            Path::new(\"tests/data/contracts/spy_events_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_failed(&result);\n    assert_case_output_contains(\n        &result,\n        \"expect_three_events_while_two_emitted\",\n        \"Event with matching data and\",\n    );\n    assert_case_output_contains(\n        &result,\n        \"expect_three_events_while_two_emitted\",\n        \"keys was not emitted\",\n    );\n}\n\n#[test]\nfn expect_two_events_while_three_emitted() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use array::ArrayTrait;\n            use result::ResultTrait;\n            use traits::Into;\n            use starknet::contract_address_const;\n            use starknet::ContractAddress;\n            use snforge_std::{\n                declare, ContractClassTrait, DeclareResultTrait, spy_events, Event,\n                EventSpy, EventSpyTrait, EventSpyAssertionsTrait, EventsFilterTrait\n            };\n\n            #[starknet::interface]\n            trait ISpyEventsChecker<TContractState> {\n                fn emit_three_events(\n                    ref self: TContractState,\n                    some_data: felt252,\n                    some_more_data: ContractAddress,\n                    even_more_data: u256\n                );\n            }\n\n            #[starknet::contract]\n            mod SpyEventsChecker {\n                use starknet::ContractAddress;\n\n                #[storage]\n                struct Storage {}\n\n                #[event]\n                #[derive(Drop, starknet::Event)]\n                enum Event {\n                    FirstEvent: FirstEvent,\n                    ThirdEvent: ThirdEvent,\n                }\n\n                #[derive(Drop, starknet::Event)]\n                struct FirstEvent {\n                    some_data: felt252\n                }\n\n                #[derive(Drop, starknet::Event)]\n                struct ThirdEvent {\n                    some_data: felt252,\n                    some_more_data: ContractAddress,\n                    even_more_data: u256\n                }\n            }\n\n            #[test]\n            fn expect_two_events_while_three_emitted() {\n                let contract = declare(\"SpyEventsChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@array![]).unwrap();\n                let dispatcher = ISpyEventsCheckerDispatcher { contract_address };\n\n                let some_data = 456;\n                let some_more_data = contract_address_const::<789>();\n                let even_more_data = u256 { low: 1, high: 0 };\n\n                let mut spy = spy_events();\n                dispatcher.emit_three_events(some_data, some_more_data, even_more_data);\n\n                spy.assert_emitted(@array![\n                    (\n                        contract_address,\n                        SpyEventsChecker::Event::FirstEvent(\n                            SpyEventsChecker::FirstEvent { some_data }\n                        ),\n                    ),\n                    (\n                        contract_address,\n                        SpyEventsChecker::Event::ThirdEvent(\n                            SpyEventsChecker::ThirdEvent { some_data, some_more_data, even_more_data }\n                        )\n                    )\n                ]);\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"SpyEventsChecker\".to_string(),\n            Path::new(\"tests/data/contracts/spy_events_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn event_emitted_wrong_data_asserted() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use array::ArrayTrait;\n            use result::ResultTrait;\n            use starknet::ContractAddress;\n            use snforge_std::{\n                declare, ContractClassTrait, DeclareResultTrait, spy_events, Event,\n                EventSpy, EventSpyTrait, EventSpyAssertionsTrait, EventsFilterTrait\n            };\n\n            #[starknet::interface]\n            trait ISpyEventsChecker<TContractState> {\n                fn emit_one_event(ref self: TContractState, some_data: felt252);\n            }\n\n            #[starknet::contract]\n            mod SpyEventsChecker {\n                use starknet::ContractAddress;\n\n                #[storage]\n                struct Storage {}\n\n                #[event]\n                #[derive(Drop, starknet::Event)]\n                enum Event {\n                    FirstEvent: FirstEvent\n                }\n\n                #[derive(Drop, starknet::Event)]\n                struct FirstEvent {\n                    some_data: felt252\n                }\n            }\n\n            #[test]\n            fn event_emitted_wrong_data_asserted() {\n                let contract = declare(\"SpyEventsChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = ISpyEventsCheckerDispatcher { contract_address };\n\n                let mut spy = spy_events();\n                dispatcher.emit_one_event(123);\n\n                spy.assert_emitted(@array![\n                    (\n                        contract_address,\n                        SpyEventsChecker::Event::FirstEvent(\n                            SpyEventsChecker::FirstEvent { some_data: 124 }\n                        ),\n                    )\n                ]);\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"SpyEventsChecker\".to_string(),\n            Path::new(\"tests/data/contracts/spy_events_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_failed(&result);\n    assert_case_output_contains(\n        &result,\n        \"event_emitted_wrong_data_asserted\",\n        \"Event with matching data and\",\n    );\n    assert_case_output_contains(\n        &result,\n        \"event_emitted_wrong_data_asserted\",\n        \"keys was not emitted from\",\n    );\n}\n\n#[test]\nfn emit_unnamed_event() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use array::ArrayTrait;\n            use result::ResultTrait;\n            use traits::Into;\n            use starknet::contract_address_const;\n            use starknet::ContractAddress;\n            use snforge_std::{\n                declare, ContractClassTrait, DeclareResultTrait, spy_events, Event,\n                EventSpy, EventSpyTrait, EventSpyAssertionsTrait, EventsFilterTrait\n            };\n\n            #[starknet::interface]\n            trait ISpyEventsChecker<TContractState> {\n                fn emit_event_syscall(ref self: TContractState, some_key: felt252, some_data: felt252);\n            }\n\n            #[test]\n            fn emit_unnamed_event() {\n                let contract = declare(\"SpyEventsChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@array![]).unwrap();\n                let dispatcher = ISpyEventsCheckerDispatcher { contract_address };\n\n                let mut spy = spy_events();\n                dispatcher.emit_event_syscall(123, 456);\n\n                spy.assert_emitted(@array![\n                    (\n                        contract_address,\n                        Event { keys: array![123], data: array![456] }\n                    )\n                ]);\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"SpyEventsChecker\".to_string(),\n            Path::new(\"tests/data/contracts/spy_events_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn assert_not_emitted_pass() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use array::ArrayTrait;\n            use result::ResultTrait;\n            use starknet::ContractAddress;\n            use snforge_std::{\n                declare, ContractClassTrait, DeclareResultTrait, spy_events, Event,\n                EventSpy, EventSpyTrait, EventSpyAssertionsTrait, EventsFilterTrait\n            };\n\n            #[starknet::interface]\n            trait ISpyEventsChecker<TContractState> {\n                fn do_not_emit(ref self: TContractState);\n            }\n\n            #[starknet::contract]\n            mod SpyEventsChecker {\n                use starknet::ContractAddress;\n\n                #[storage]\n                struct Storage {}\n\n                #[event]\n                #[derive(Drop, starknet::Event)]\n                enum Event {\n                    FirstEvent: FirstEvent,\n                }\n\n                #[derive(Drop, starknet::Event)]\n                struct FirstEvent {\n                    some_data: felt252\n                }\n            }\n\n            #[test]\n            fn assert_not_emitted_pass() {\n                let contract = declare(\"SpyEventsChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = ISpyEventsCheckerDispatcher { contract_address };\n\n                let mut spy = spy_events();\n                dispatcher.do_not_emit();\n\n                spy.assert_not_emitted(@array![\n                    (\n                        contract_address,\n                        SpyEventsChecker::Event::FirstEvent(\n                            SpyEventsChecker::FirstEvent { some_data: 123 }\n                        )\n                    )\n                ]);\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"SpyEventsChecker\".to_string(),\n            Path::new(\"tests/data/contracts/spy_events_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn assert_not_emitted_fails() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use array::ArrayTrait;\n            use result::ResultTrait;\n            use starknet::ContractAddress;\n            use snforge_std::{\n                declare, DeclareResultTrait, ContractClassTrait, spy_events, Event,\n                EventSpy, EventSpyTrait, EventSpyAssertionsTrait, EventsFilterTrait\n            };\n\n            #[starknet::interface]\n            trait ISpyEventsChecker<TContractState> {\n                fn emit_one_event(ref self: TContractState, some_data: felt252);\n            }\n\n            #[starknet::contract]\n            mod SpyEventsChecker {\n                use starknet::ContractAddress;\n\n                #[storage]\n                struct Storage {}\n\n                #[event]\n                #[derive(Drop, starknet::Event)]\n                enum Event {\n                    FirstEvent: FirstEvent\n                }\n\n                #[derive(Drop, starknet::Event)]\n                struct FirstEvent {\n                    some_data: felt252\n                }\n            }\n\n            #[test]\n            fn assert_not_emitted_fails() {\n                let contract = declare(\"SpyEventsChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = ISpyEventsCheckerDispatcher { contract_address };\n\n                let mut spy = spy_events();\n                dispatcher.emit_one_event(123);\n\n                spy.assert_not_emitted(@array![\n                    (\n                        contract_address,\n                        SpyEventsChecker::Event::FirstEvent(\n                            SpyEventsChecker::FirstEvent { some_data: 123 }\n                        )\n                    )\n                ]);\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"SpyEventsChecker\".to_string(),\n            Path::new(\"tests/data/contracts/spy_events_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_failed(&result);\n    assert_case_output_contains(\n        &result,\n        \"assert_not_emitted_fails\",\n        \"Event with matching data and\",\n    );\n    assert_case_output_contains(&result, \"assert_not_emitted_fails\", \"keys was emitted\");\n}\n\n#[test]\nfn capture_cairo0_event() {\n    let test = test_case!(\n        formatdoc!(\n            r#\"\n            use array::ArrayTrait;\n            use result::ResultTrait;\n            use starknet::{{ContractAddress, contract_address_const}};\n            use snforge_std::{{\n                declare, ContractClassTrait, DeclareResultTrait, spy_events, Event,\n                EventSpy, EventSpyTrait, EventSpyAssertionsTrait, EventsFilterTrait\n            }};\n\n            #[starknet::interface]\n            trait ISpyEventsChecker<TContractState> {{\n                fn emit_one_event(ref self: TContractState, some_data: felt252);\n                fn test_cairo0_event_collection(ref self: TContractState, cairo0_address: felt252);\n            }}\n\n            #[starknet::contract]\n            mod SpyEventsChecker {{\n                use starknet::ContractAddress;\n\n                #[storage]\n                struct Storage {{}}\n\n                #[event]\n                #[derive(Drop, starknet::Event)]\n                enum Event {{\n                    FirstEvent: FirstEvent,\n                    my_event: Cairo0Event,\n                }}\n\n                #[derive(Drop, starknet::Event)]\n                struct FirstEvent {{\n                    some_data: felt252\n                }}\n\n                #[derive(Drop, starknet::Event)]\n                struct Cairo0Event {{\n                    some_data: felt252\n                }}\n            }}\n\n            #[test]\n            #[fork(url: \"{}\", block_tag: latest)]\n            fn capture_cairo0_event() {{\n                let cairo0_contract_address = contract_address_const::<0x2c77ca97586968c6651a533bd5f58042c368b14cf5f526d2f42f670012e10ac>();\n                let contract = declare(\"SpyEventsChecker\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = ISpyEventsCheckerDispatcher {{ contract_address }};\n\n                let mut spy = spy_events();\n\n                dispatcher.test_cairo0_event_collection(cairo0_contract_address.into());\n                dispatcher.emit_one_event(420);\n                dispatcher.test_cairo0_event_collection(cairo0_contract_address.into());\n\n                spy.assert_emitted(@array![\n                    (\n                        cairo0_contract_address,\n                        SpyEventsChecker::Event::my_event(\n                            SpyEventsChecker::Cairo0Event {{\n                                some_data: 123456789\n                            }}\n                        )\n                    ),\n                    (\n                        contract_address,\n                        SpyEventsChecker::Event::FirstEvent(\n                            SpyEventsChecker::FirstEvent {{\n                                some_data: 420\n                            }}\n                        )\n                    ),\n                    (\n                        cairo0_contract_address,\n                        SpyEventsChecker::Event::my_event(\n                            SpyEventsChecker::Cairo0Event {{\n                                some_data: 123456789\n                            }}\n                        )\n                    )\n                ]);\n            }}\n        \"#,\n            node_rpc_url()\n        ).as_str(),\n        Contract::from_code_path(\n            \"SpyEventsChecker\".to_string(),\n            Path::new(\"tests/data/contracts/spy_events_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn test_filtering() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use array::ArrayTrait;\n            use result::ResultTrait;\n            use starknet::ContractAddress;\n            use snforge_std::{\n                declare, ContractClassTrait, DeclareResultTrait, spy_events, Event,\n                EventSpy, EventSpyTrait, EventSpyAssertionsTrait, EventsFilterTrait\n            };\n\n            #[starknet::interface]\n            trait ISpyEventsChecker<TContractState> {\n                fn emit_one_event(ref self: TContractState, some_data: felt252);\n            }\n\n            #[starknet::contract]\n            mod SpyEventsChecker {\n                use starknet::ContractAddress;\n\n                #[storage]\n                struct Storage {}\n\n                #[event]\n                #[derive(Drop, starknet::Event)]\n                enum Event {\n                    FirstEvent: FirstEvent\n                }\n\n                #[derive(Drop, starknet::Event)]\n                struct FirstEvent {\n                    some_data: felt252\n                }\n            }\n\n            #[test]\n            fn filter_events() {\n                let contract = declare(\"SpyEventsChecker\").unwrap().contract_class();\n                let (first_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let (second_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n\n                let first_dispatcher = ISpyEventsCheckerDispatcher { contract_address: first_address };\n                let second_dispatcher = ISpyEventsCheckerDispatcher { contract_address: second_address };\n\n                let mut spy = spy_events();\n                // assert(spy._event_offset == 0, 'Event offset should be 0'); TODO(#2765)\n\n                first_dispatcher.emit_one_event(123);\n                second_dispatcher.emit_one_event(234);\n\n                let events_from_first_address = spy.get_events().emitted_by(first_address);\n                let events_from_second_address = spy.get_events().emitted_by(second_address);\n\n                let (from, event) = events_from_first_address.events.at(0);\n                assert(from == @first_address, 'Emitted from wrong address');\n                assert(event.keys.len() == 1, 'There should be one key');\n                assert(event.keys.at(0) == @selector!(\"FirstEvent\"), 'Wrong event name');\n                assert(event.data.len() == 1, 'There should be one data');\n\n                let (from, event) = events_from_second_address.events.at(0);\n                assert(from == @second_address, 'Emitted from wrong address');\n                assert(event.keys.len() == 1, 'There should be one key');\n                assert(event.keys.at(0) == @selector!(\"FirstEvent\"), 'Wrong event name');\n                assert(event.data.len() == 1, 'There should be one data');\n            }\n        \"#,\n        ),\n        Contract::from_code_path(\n            \"SpyEventsChecker\".to_string(),\n            Path::new(\"tests/data/contracts/spy_events_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/store_load.rs",
    "content": "use crate::utils::runner::{Contract, assert_case_output_contains, assert_failed, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::{formatdoc, indoc};\nuse shared::test_utils::node_url::node_rpc_url;\nuse std::path::Path;\n\n#[test]\nfn store_load_simple() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use starknet::ContractAddress;\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, store, load };\n\n            #[starknet::interface]\n            trait IHelloStarknet<TContractState> {\n                fn get_balance(ref self: TContractState) -> felt252;\n                fn increase_balance(ref self: TContractState, amount: felt252);\n            }\n\n            fn deploy_contract() -> IHelloStarknetDispatcher {\n                let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@array![]).unwrap();\n                IHelloStarknetDispatcher { contract_address }\n            }\n\n            #[test]\n            fn store_balance() {\n                let deployed = deploy_contract();\n                store(deployed.contract_address, selector!(\"balance\"), array![420].span());\n\n                let stored_balance = deployed.get_balance();\n                assert(stored_balance == 420, 'wrong balance stored');\n            }\n\n            #[test]\n            fn load_balance() {\n                let deployed = deploy_contract();\n                deployed.increase_balance(421);\n\n                let loaded = load(deployed.contract_address, selector!(\"balance\"), 1);\n                assert(*loaded.at(0) == 421, 'wrong balance stored');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"HelloStarknet\".to_string(),\n            Path::new(\"tests/data/contracts/hello_starknet.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn store_load_wrong_selector() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use starknet::ContractAddress;\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, store, load };\n\n            #[starknet::interface]\n            trait IHelloStarknet<TContractState> {\n                fn get_balance(ref self: TContractState) -> felt252;\n                fn increase_balance(ref self: TContractState, amount: felt252);\n            }\n\n            fn deploy_contract() -> IHelloStarknetDispatcher {\n                let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@array![]).unwrap();\n                IHelloStarknetDispatcher { contract_address }\n            }\n\n            #[test]\n            fn store_load_wrong_selector() {\n                let deployed = deploy_contract();\n                store(deployed.contract_address, selector!(\"i_made_a_typo\"), array![420].span());\n\n                let stored_balance = deployed.get_balance();\n                assert(stored_balance == 0, 'wrong balance stored'); // No change expected\n\n                let loaded = load(deployed.contract_address, selector!(\"i_made_a_typo\"), 1);\n                 // Even though non-existing var selector is called, memory should be set\n                assert(*loaded.at(0) == 420, 'wrong storage value');\n\n                // Uninitialized memory is expected on wrong selector\n                let loaded = load(deployed.contract_address, selector!(\"i_made_another_typo\"), 1);\n                assert(*loaded.at(0) == 0, 'wrong storage value');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"HelloStarknet\".to_string(),\n            Path::new(\"tests/data/contracts/hello_starknet.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn store_load_wrong_data_length() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use starknet::ContractAddress;\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, store, load };\n\n            #[starknet::interface]\n            trait IHelloStarknet<TContractState> {\n                fn get_balance(ref self: TContractState) -> felt252;\n                fn increase_balance(ref self: TContractState, amount: felt252);\n            }\n\n            fn deploy_contract() -> IHelloStarknetDispatcher {\n                let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@array![]).unwrap();\n                IHelloStarknetDispatcher { contract_address }\n            }\n\n            #[test]\n            fn store_load_wrong_data_length() {\n                let deployed = deploy_contract();\n\n                let stored_balance = deployed.get_balance();\n                assert(stored_balance == 0, 'wrong balance stored'); // No change expected\n                deployed.increase_balance(420);\n\n                let loaded = load(deployed.contract_address, selector!(\"balance\"), 2);\n                 // Even though wrong length is called, the first felt will be correct and second one uninitialized\n                assert(*loaded.at(0) == 420, 'wrong storage value');\n                assert(*loaded.at(1) == 0, 'wrong storage value');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"HelloStarknet\".to_string(),\n            Path::new(\"tests/data/contracts/hello_starknet.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn store_load_max_boundaries_input() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use starknet::ContractAddress;\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, store, load };\n\n            #[starknet::interface]\n            trait IHelloStarknet<TContractState> {\n                fn get_balance(ref self: TContractState) -> felt252;\n                fn increase_balance(ref self: TContractState, amount: felt252);\n            }\n\n            fn deploy_contract() -> IHelloStarknetDispatcher {\n                let contract = declare(\"HelloStarknet\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@array![]).unwrap();\n                IHelloStarknetDispatcher { contract_address }\n            }\n\n            const MAX_STORAGE: felt252 = 3618502788666131106986593281521497120414687020801267626233049500247285301248;\n\n            #[test]\n            fn load_boundaries_max() {\n                let deployed = deploy_contract();\n                load(\n                    deployed.contract_address,\n                    MAX_STORAGE + 1,\n                    1\n                );\n            }\n\n            #[test]\n            fn store_boundaries_max() {\n                let deployed = deploy_contract();\n                store(\n                    deployed.contract_address,\n                    MAX_STORAGE + 1,\n                    array![420].span()\n                );\n            }\n\n            #[test]\n            fn load_boundaries_max_overflow() {\n                let deployed = deploy_contract();\n                load(\n                    deployed.contract_address,\n                    MAX_STORAGE - 1,\n                    5\n                );\n            }\n\n            #[test]\n            fn store_boundaries_max_overflow() {\n                let deployed = deploy_contract();\n                store(\n                    deployed.contract_address,\n                    MAX_STORAGE - 1,\n                    array![420, 421, 422].span()\n                );\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"HelloStarknet\".to_string(),\n            Path::new(\"tests/data/contracts/hello_starknet.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_failed(&result);\n    assert_case_output_contains(\n        &result,\n        \"load_boundaries_max\",\n        \"storage_address out of range\",\n    );\n    assert_case_output_contains(\n        &result,\n        \"store_boundaries_max\",\n        \"storage_address out of range\",\n    );\n    assert_case_output_contains(\n        &result,\n        \"load_boundaries_max_overflow\",\n        \"storage_address out of range\",\n    );\n    assert_case_output_contains(\n        &result,\n        \"store_boundaries_max_overflow\",\n        \"storage_address out of range\",\n    );\n}\n\n#[test]\nfn store_load_structure() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use starknet::ContractAddress;\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, store, load };\n\n            #[derive(Serde, Copy, Drop, starknet::Store)]\n            struct NestedStructure {\n                c: felt252\n            }\n            #[derive(Serde, Copy, Drop, starknet::Store)]\n            struct StoredStructure {\n                a: felt252,\n                b: NestedStructure,\n            }\n\n            impl ToSerialized of Into<StoredStructure, Span<felt252>> {\n                fn into(self: StoredStructure) -> Span<felt252> {\n                    let mut serialized_struct: Array<felt252> = self.into();\n                    serialized_struct.span()\n                }\n            }\n\n            impl ToArray of Into<StoredStructure, Array<felt252>> {\n                fn into(self: StoredStructure) -> Array<felt252> {\n                    let mut serialized_struct: Array<felt252> = array![];\n                    self.serialize(ref serialized_struct);\n                    serialized_struct\n                }\n            }\n\n            #[starknet::interface]\n            trait IStorageTester<TContractState> {\n                fn insert_structure(ref self: TContractState, value: StoredStructure);\n                fn read_structure(self: @TContractState) -> StoredStructure;\n            }\n\n            fn deploy_contract() -> IStorageTesterDispatcher {\n                let contract = declare(\"StorageTester\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@array![]).unwrap();\n                IStorageTesterDispatcher { contract_address }\n            }\n\n            #[test]\n            fn store_structure() {\n                let deployed = deploy_contract();\n                let stored_structure = StoredStructure { a: 123, b: NestedStructure { c: 420 } };\n\n                store(deployed.contract_address, selector!(\"structure\"), stored_structure.into());\n\n                let stored_structure = deployed.read_structure();\n                assert(stored_structure.a == 123, 'wrong stored_structure.a');\n                assert(stored_structure.b.c == 420, 'wrong stored_structure.b.c');\n            }\n\n            #[test]\n            fn load_structure() {\n                let deployed = deploy_contract();\n                let stored_structure = StoredStructure { a: 123, b: NestedStructure { c: 420 } };\n\n                deployed.insert_structure(stored_structure);\n\n                let loaded = load(\n                    deployed.contract_address,\n                    selector!(\"structure\"),\n                    starknet::Store::<StoredStructure>::size().into()\n                );\n                assert(loaded == stored_structure.into(), 'wrong structure stored');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"StorageTester\".to_string(),\n            Path::new(\"tests/data/contracts/storage_tester.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn store_load_felt_to_structure() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use starknet::ContractAddress;\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, store, load, map_entry_address };\n\n            #[derive(Serde, Copy, Drop, starknet::Store)]\n            struct NestedStructure {\n                c: felt252\n            }\n            #[derive(Serde, Copy, Drop, starknet::Store)]\n            struct StoredStructure {\n                a: felt252,\n                b: NestedStructure,\n            }\n\n            impl ToSerialized of Into<StoredStructure, Span<felt252>> {\n                fn into(self: StoredStructure) -> Span<felt252> {\n                    let mut serialized_struct: Array<felt252> = self.into();\n                    serialized_struct.span()\n                }\n            }\n\n            impl ToArray of Into<StoredStructure, Array<felt252>> {\n                  fn into(self: StoredStructure) -> Array<felt252> {\n                      let mut serialized_struct: Array<felt252> = array![];\n                      self.serialize(ref serialized_struct);\n                      serialized_struct\n                  }\n            }\n\n            #[starknet::interface]\n            trait IStorageTester<TContractState> {\n                fn insert_felt_to_structure(ref self: TContractState, key: felt252, value: StoredStructure);\n                fn read_felt_to_structure(self: @TContractState, key: felt252) -> StoredStructure;\n            }\n\n            fn deploy_contract() -> IStorageTesterDispatcher {\n                let contract = declare(\"StorageTester\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@array![]).unwrap();\n                IStorageTesterDispatcher { contract_address }\n            }\n\n            #[test]\n            fn store_felt_to_structure() {\n                let deployed = deploy_contract();\n                let stored_structure = StoredStructure { a: 123, b: NestedStructure { c: 420 } };\n\n                store(\n                    deployed.contract_address,\n                    map_entry_address(selector!(\"felt_to_structure\"), array![421].span()),\n                    stored_structure.into(),\n                );\n\n                let read_structure = deployed.read_felt_to_structure(421);\n                assert(read_structure.a == stored_structure.a, 'wrong stored_structure.a');\n                assert(read_structure.b.c == stored_structure.b.c, 'wrong stored_structure.b.c');\n            }\n\n            #[test]\n            fn load_felt_to_structure() {\n                let deployed = deploy_contract();\n                let stored_structure = StoredStructure { a: 123, b: NestedStructure { c: 420 } };\n\n                deployed.insert_felt_to_structure(421, stored_structure);\n\n                let loaded = load(\n                    deployed.contract_address,\n                    map_entry_address(selector!(\"felt_to_structure\"), array![421].span()),\n                    starknet::Store::<StoredStructure>::size().into()\n                );\n                assert(loaded == stored_structure.into(), 'wrong structure stored');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"StorageTester\".to_string(),\n            Path::new(\"tests/data/contracts/storage_tester.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn store_load_structure_to_felt() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use starknet::ContractAddress;\n            use snforge_std::{ declare, ContractClassTrait, store, load, map_entry_address, DeclareResultTrait };\n            \n            #[derive(Serde, Copy, Drop, starknet::Store, Hash)]\n            struct NestedKey {\n                c: felt252\n            }\n            #[derive(Serde, Copy, Drop, starknet::Store, Hash)]\n            struct StructuredKey {\n                a: felt252,\n                b: NestedKey,\n            }\n\n            impl ToSerialized of Into<StructuredKey, Span<felt252>> {\n                fn into(self: StructuredKey) -> Span<felt252> {\n                    let mut serialized_struct: Array<felt252> = array![];\n                    self.serialize(ref serialized_struct);\n                    serialized_struct.span()\n                }\n            }\n\n            #[starknet::interface]\n            trait IStorageTester<TContractState> {\n                fn insert_structure_to_felt(ref self: TContractState, key: StructuredKey, value: felt252);\n                fn read_structure_to_felt(self: @TContractState, key: StructuredKey) -> felt252;\n            }\n\n            fn deploy_contract() -> IStorageTesterDispatcher {\n                let contract = declare(\"StorageTester\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@array![]).unwrap();\n                IStorageTesterDispatcher { contract_address }\n            }\n\n            #[test]\n            fn store_structure_to_felt() {\n                let deployed = deploy_contract();\n                let map_key = StructuredKey {a: 420, b: NestedKey { c: 421 }};\n                store(\n                    deployed.contract_address,\n                    map_entry_address(selector!(\"structure_to_felt\"), map_key.into()),\n                    array![123].span()\n                );\n\n                let stored_felt = deployed.read_structure_to_felt(map_key);\n                assert(stored_felt == 123, 'wrong stored_felt');\n            }\n\n            #[test]\n            fn load_structure_to_felt() {\n                let deployed = deploy_contract();\n                let map_key = StructuredKey { a: 420, b: NestedKey { c: 421 } };\n\n                deployed.insert_structure_to_felt(map_key, 123);\n\n                let loaded = load(\n                    deployed.contract_address,\n                    map_entry_address(selector!(\"structure_to_felt\"), map_key.into()),\n                    1\n                );\n                assert(loaded == array![123], 'wrong felt stored');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"StorageTester\".to_string(),\n            Path::new(\"tests/data/contracts/storage_tester.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn store_load_felt_to_felt() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use starknet::ContractAddress;\n            use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, store, load, map_entry_address };\n\n            #[starknet::interface]\n            trait IStorageTester<TContractState> {\n                fn insert_felt_to_felt(ref self: TContractState, key: felt252, value: felt252);\n                fn read_felt_to_felt(self: @TContractState, key: felt252) -> felt252;\n            }\n\n            fn deploy_contract() -> IStorageTesterDispatcher {\n                let contract = declare(\"StorageTester\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@array![]).unwrap();\n                IStorageTesterDispatcher { contract_address }\n            }\n\n            #[test]\n            fn store_felt_to_felt() {\n                let deployed = deploy_contract();\n                store(\n                    deployed.contract_address,\n                    map_entry_address(selector!(\"felt_to_felt\"), array![420].span()),\n                    array![123].span()\n                );\n\n                let stored_felt = deployed.read_felt_to_felt(420);\n                assert(stored_felt == 123, 'wrong stored_felt');\n            }\n\n            #[test]\n            fn load_felt_to_felt() {\n                let deployed = deploy_contract();\n                deployed.insert_felt_to_felt(420, 123);\n\n                let loaded = load(\n                    deployed.contract_address,\n                    map_entry_address(selector!(\"felt_to_felt\"), array![420].span()),\n                    1\n                );\n                assert(loaded == array![123], 'wrong felt stored');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"StorageTester\".to_string(),\n            Path::new(\"tests/data/contracts/storage_tester.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn fork_store_load() {\n    let test = test_case!(formatdoc!(\n        r#\"\n            use starknet::{{ ContractAddress, contract_address_const }};\n            use snforge_std::{{ load, store }};\n\n            #[starknet::interface]\n            trait IHelloStarknet<TContractState> {{\n                fn increase_balance(ref self: TContractState, amount: felt252);\n                fn get_balance(self: @TContractState) -> felt252;\n            }}\n\n            #[test]\n            #[fork(url: \"{}\", block_number: 54060)]\n            fn fork_simple_decorator() {{\n                let dispatcher = IHelloStarknetDispatcher {{\n                    contract_address: contract_address_const::<0x202de98471a4fae6bcbabb96cab00437d381abc58b02509043778074d6781e9>()\n                }};\n\n                let balance = dispatcher.get_balance();\n                assert(balance == 0, 'Balance should be 0');\n                let result = load(dispatcher.contract_address, selector!(\"balance\"), 1);\n                assert(*result.at(0) == 0, 'Wrong balance loaded');\n                \n                store(dispatcher.contract_address, selector!(\"balance\"), array![100].span());\n\n                let balance = dispatcher.get_balance();\n                assert(balance == 100, 'Balance should be 100');\n            }}\n        \"#,\n        node_rpc_url()\n    ).as_str());\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/syscalls.rs",
    "content": "use crate::utils::runner::{Contract, assert_case_output_contains, assert_failed, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\nuse std::path::Path;\n\n#[test]\n#[expect(clippy::too_many_lines)]\nfn library_call_syscall_is_usable() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use core::clone::Clone;\n        use starknet::ContractAddress;\n        use starknet::ClassHash;\n        use snforge_std::{ declare, DeclareResultTrait, ContractClassTrait };\n\n        #[starknet::interface]\n        trait ICaller<TContractState> {\n            fn call_add_two(\n                self: @TContractState, class_hash: ClassHash, number: felt252\n            ) -> felt252;\n        }\n\n        #[starknet::interface]\n        trait IExecutor<TContractState> {\n            fn add_two(ref self: TContractState, number: felt252) -> felt252;\n            fn get_thing(self: @TContractState) -> felt252;\n        }\n\n        fn deploy_contract(name: ByteArray) -> ContractAddress {\n            let contract = declare(name).unwrap().contract_class();\n            let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n            contract_address\n        }\n\n        #[test]\n        fn library_call_syscall_is_usable() {\n            let caller_address = deploy_contract(\"Caller\");\n            let caller_safe_dispatcher = ICallerDispatcher {\n                contract_address: caller_address\n            };\n\n            let executor_contract = declare(\"Executor\").unwrap().contract_class();\n            let executor_class_hash = executor_contract.class_hash.clone();\n\n            let (executor_address, _) = executor_contract.deploy(@ArrayTrait::new()).unwrap();\n            let executor_safe_dispatcher = IExecutorDispatcher {\n                contract_address: executor_address\n            };\n            let thing = executor_safe_dispatcher.get_thing();\n            assert(thing == 5, 'invalid thing');\n\n            let result = caller_safe_dispatcher.call_add_two(executor_class_hash, 420);\n            assert(result == 422, 'invalid result');\n\n            let thing = executor_safe_dispatcher.get_thing();\n            assert(thing == 5, 'invalid thing');\n        }\n        \"#\n        ),\n        Contract::new(\n            \"Caller\",\n            indoc!(\n                r\"\n                use starknet::ClassHash;\n\n                #[starknet::interface]\n                trait ICaller<TContractState> {\n                    fn call_add_two(\n                        self: @TContractState, class_hash: ClassHash, number: felt252\n                    ) -> felt252;\n                }\n\n                #[starknet::contract]\n                mod Caller {\n                    use result::ResultTrait;\n                    use starknet::ClassHash;\n                    use starknet::library_call_syscall;\n\n                    #[starknet::interface]\n                    trait IExecutor<TContractState> {\n                        fn add_two(ref self: TContractState, number: felt252) -> felt252;\n                    }\n\n                    #[storage]\n                    struct Storage {}\n\n                    #[abi(embed_v0)]\n                    impl CallerImpl of super::ICaller<ContractState> {\n                        fn call_add_two(\n                            self: @ContractState, class_hash: ClassHash, number: felt252\n                        ) -> felt252 {\n                            let safe_lib_dispatcher = IExecutorLibraryDispatcher { class_hash };\n                            safe_lib_dispatcher.add_two(number)\n                        }\n                    }\n                }\n                \"\n            )\n        ),\n        Contract::new(\n            \"Executor\",\n            indoc!(\n                r\"\n                #[starknet::interface]\n                trait IExecutor<TContractState> {\n                    fn add_two(ref self: TContractState, number: felt252) -> felt252;\n                    fn get_thing(self: @TContractState) -> felt252;\n                }\n\n                #[starknet::contract]\n                mod Executor {\n                    #[storage]\n                    struct Storage {\n                        thing: felt252\n                    }\n\n                    #[constructor]\n                    fn constructor(ref self: ContractState) {\n                        assert(self.thing.read() == 0, 'default value should be 0');\n                        self.thing.write(5);\n                    }\n\n                    #[abi(embed_v0)]\n                    impl ExecutorImpl of super::IExecutor<ContractState> {\n                        fn add_two(ref self: ContractState, number: felt252) -> felt252 {\n                            self.thing.write(10);\n                            number + 2\n                        }\n\n                        fn get_thing(self: @ContractState) -> felt252 {\n                            self.thing.read()\n                        }\n                    }\n                }\n                \"\n            )\n        )\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn keccak_syscall_is_usable() {\n    let test = test_case!(indoc!(\n        r\"\n        use array::ArrayTrait;\n        use starknet::syscalls::keccak_syscall;\n        use starknet::SyscallResultTrait;\n\n        #[test]\n        fn keccak_syscall_is_usable() {\n            let input = array![1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17];\n            assert(\n                @keccak_syscall(input.span()).unwrap_syscall()\n                == @u256 { low: 0xec687be9c50d2218388da73622e8fdd5, high: 0xd2eb808dfba4703c528d145dfe6571af },\n                'Wrong hash value'\n            );\n        }\n    \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn keccak_syscall_too_small_input() {\n    let test = test_case!(indoc!(\n        r\"\n        use array::ArrayTrait;\n        use starknet::syscalls::keccak_syscall;\n        use starknet::SyscallResultTrait;\n\n        #[test]\n        fn keccak_syscall_too_small_input() {\n            let input = array![1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];\n            assert(\n                @keccak_syscall(input.span()).unwrap_syscall()\n                == @u256 { low: 0xec687be9c50d2218388da73622e8fdd5, high: 0xd2eb808dfba4703c528d145dfe6571af },\n                'Wrong hash value'\n            );\n        }\n    \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_case_output_contains(\n        &result,\n        \"keccak_syscall_too_small_input\",\n        \"Invalid input length\",\n    );\n\n    assert_failed(&result);\n}\n\n#[test]\nfn cairo_keccak_is_usable() {\n    let test = test_case!(indoc!(\n        r\"\n        use array::ArrayTrait;\n        use keccak::cairo_keccak;\n\n        #[test]\n        fn cairo_keccak_is_usable() {\n            let mut input = array![\n                0x0000000000000001,\n                0x0000000000000002,\n                0x0000000000000003,\n                0x0000000000000004,\n                0x0000000000000005,\n                0x0000000000000006,\n                0x0000000000000007,\n                0x0000000000000008,\n                0x0000000000000009,\n                0x000000000000000a,\n                0x000000000000000b,\n                0x000000000000000c,\n                0x000000000000000d,\n                0x000000000000000e,\n                0x000000000000000f,\n                0x0000000000000010,\n                0x0000000000000011\n            ];\n\n            let res = keccak::cairo_keccak(ref input, 0, 0);\n\n            assert(@res.low == @0x5d291eebae35b254ff50ec1fc57832e8, 'Wrong hash low');\n            assert(@res.high == @0x210740d45b1fe2ac908a497ef45509f5, 'Wrong hash high');\n        }\n    \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn keccak_syscall_in_contract() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use result::ResultTrait;\n            use array::ArrayTrait;\n            use option::OptionTrait;\n            use traits::TryInto;\n            use starknet::ContractAddress;\n            use snforge_std::{ declare, DeclareResultTrait, ContractClassTrait };\n\n            #[starknet::interface]\n            trait IHelloKeccak<TContractState> {\n                fn run_keccak(ref self: TContractState, input: Array<u64>) -> u256;\n            }\n\n            #[test]\n            fn keccak_syscall_in_contract() {\n                let contract = declare(\"HelloKeccak\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = IHelloKeccakDispatcher { contract_address };\n\n                let res = dispatcher.run_keccak(array![1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]);\n                assert(\n                    res == u256 { low: 0xec687be9c50d2218388da73622e8fdd5, high: 0xd2eb808dfba4703c528d145dfe6571af },\n                    'Wrong hash value'\n                );\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"HelloKeccak\".to_string(),\n            Path::new(\"tests/data/contracts/keccak_usage.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn compare_keccak_from_contract_with_plain_keccak() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use result::ResultTrait;\n            use array::ArrayTrait;\n            use option::OptionTrait;\n            use traits::TryInto;\n            use starknet::ContractAddress;\n            use starknet::syscalls::keccak_syscall;\n            use starknet::SyscallResultTrait;\n            use snforge_std::{ declare, DeclareResultTrait, ContractClassTrait };\n\n            #[starknet::interface]\n            trait IHelloKeccak<TContractState> {\n                fn run_keccak(ref self: TContractState, input: Array<u64>) -> u256;\n            }\n\n            #[test]\n            fn compare_keccak_from_contract_with_plain_keccak() {\n                let contract = declare(\"HelloKeccak\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n                let dispatcher = IHelloKeccakDispatcher { contract_address };\n\n                let input = array![1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17];\n                let keccak = keccak_syscall(input.span()).unwrap_syscall();\n                let contract_keccak = dispatcher.run_keccak(input);\n\n                assert(contract_keccak == keccak, 'Keccaks dont match');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"HelloKeccak\".to_string(),\n            Path::new(\"tests/data/contracts/keccak_usage.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/test_state.rs",
    "content": "use crate::utils::runner::{Contract, assert_case_output_contains, assert_failed, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\nuse std::path::Path;\n\n#[test]\nfn storage_access_from_tests() {\n    let test = test_case!(indoc!(\n        r\"\n        #[starknet::contract]\n        mod Contract {\n            #[storage]\n            struct Storage {\n                balance: felt252, \n            }\n            \n            #[generate_trait]\n            impl InternalImpl of InternalTrait {\n                fn internal_function(self: @ContractState) -> felt252 {\n                    self.balance.read()\n                }\n            }\n        }\n\n\n        #[test]\n        fn storage_access_from_tests() {\n            let mut state = Contract::contract_state_for_testing();\n            state.balance.write(10);\n            \n            let value = Contract::InternalImpl::internal_function(@state);\n            assert(value == 10, 'Incorrect storage value');\n        }\n    \"\n    ),);\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn simple_syscalls() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use starknet::info::{get_execution_info, TxInfo};\n        use result::ResultTrait;\n        use box::BoxTrait;\n        use serde::Serde;\n        use starknet::{ContractAddress, get_block_hash_syscall};\n        use array::SpanTrait;\n        use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, test_address };\n\n        #[starknet::interface]\n        trait ICheatTxInfoChecker<TContractState> {\n            fn get_tx_hash(ref self: TContractState) -> felt252;\n            fn get_nonce(ref self: TContractState) -> felt252;\n            fn get_account_contract_address(ref self: TContractState) -> ContractAddress;\n            fn get_signature(ref self: TContractState) -> Span<felt252>;\n            fn get_version(ref self: TContractState) -> felt252;\n            fn get_max_fee(ref self: TContractState) -> u128;\n            fn get_chain_id(ref self: TContractState) -> felt252;\n        }\n        #[starknet::interface]\n        trait ICheatBlockNumberChecker<TContractState> {\n            fn get_block_number(ref self: TContractState) -> u64;\n        }\n\n        #[starknet::interface]\n        trait ICheatBlockTimestampChecker<TContractState> {\n            fn get_block_timestamp(ref self: TContractState) -> u64;\n        }\n\n        #[starknet::interface]\n        trait ICheatSequencerAddressChecker<TContractState> {\n            fn get_sequencer_address(ref self: TContractState) -> ContractAddress;\n        }\n\n        #[test]\n        fn simple_syscalls() {\n            let exec_info = get_execution_info().unbox();\n            assert(exec_info.caller_address.into() == 0, 'Incorrect caller address');\n            assert(exec_info.contract_address == test_address(), exec_info.contract_address.into());\n            // Hash of TEST_CASE_SELECTOR\n            assert(exec_info.entry_point_selector.into() == 655947323460646800722791151288222075903983590237721746322261907338444055163, 'Incorrect entry point selector');\n\n            let block_info = exec_info.block_info.unbox();\n\n            let contract_cheat_block_number = declare(\"CheatBlockNumberChecker\").unwrap().contract_class();\n            let (contract_address_cheat_block_number, _) = contract_cheat_block_number.deploy(@ArrayTrait::new()).unwrap();\n            let dispatcher_cheat_block_number = ICheatBlockNumberCheckerDispatcher { contract_address: contract_address_cheat_block_number };\n\n            let contract_cheat_block_timestamp = declare(\"CheatBlockTimestampChecker\").unwrap().contract_class();\n            let (contract_address_cheat_block_timestamp, _) = contract_cheat_block_timestamp.deploy(@ArrayTrait::new()).unwrap();\n            let dispatcher_cheat_block_timestamp = ICheatBlockTimestampCheckerDispatcher { contract_address: contract_address_cheat_block_timestamp };\n\n            let contract_cheat_sequencer_address = declare(\"CheatSequencerAddressChecker\").unwrap().contract_class();\n            let (contract_address_cheat_sequencer_address, _) = contract_cheat_sequencer_address.deploy(@ArrayTrait::new()).unwrap();\n            let dispatcher_cheat_sequencer_address = ICheatSequencerAddressCheckerDispatcher { contract_address: contract_address_cheat_sequencer_address };\n\n            assert(dispatcher_cheat_block_number.get_block_number() == block_info.block_number, 'Invalid block number');\n            assert(dispatcher_cheat_block_timestamp.get_block_timestamp() == block_info.block_timestamp, 'Invalid block timestamp');\n            assert(dispatcher_cheat_sequencer_address.get_sequencer_address() == block_info.sequencer_address, 'Invalid sequencer address');\n\n            let contract = declare(\"CheatTxInfoChecker\").unwrap().contract_class();\n            let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n            let dispatcher = ICheatTxInfoCheckerDispatcher { contract_address };\n\n            let tx_info = exec_info.tx_info.unbox();\n            assert(tx_info.version == dispatcher.get_version(), 'Incorrect version');\n            assert(tx_info.account_contract_address == dispatcher.get_account_contract_address(), 'Incorrect acc_address');\n            assert(tx_info.max_fee == dispatcher.get_max_fee(), 'Incorrect max fee');\n            assert(tx_info.signature == dispatcher.get_signature(), 'Incorrect signature');\n            assert(tx_info.transaction_hash == dispatcher.get_tx_hash(), 'Incorrect transaction_hash');\n            assert(tx_info.chain_id == dispatcher.get_chain_id(), 'Incorrect chain_id');\n            assert(tx_info.nonce == dispatcher.get_nonce(), 'Incorrect nonce');\n        }\n    \"#\n        ),\n        Contract::from_code_path(\n            \"CheatTxInfoChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_tx_info_checker.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"CheatBlockNumberChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_block_number_checker.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"CheatBlockTimestampChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_block_timestamp_checker.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"CheatSequencerAddressChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_sequencer_address_checker.cairo\")\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn get_block_hash_syscall_in_dispatcher() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use starknet::info::{get_execution_info, TxInfo};\n        use result::ResultTrait;\n        use box::BoxTrait;\n        use serde::Serde;\n        use starknet::{ContractAddress, get_block_hash_syscall};\n        use array::SpanTrait;\n        use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, test_address };\n\n        #[starknet::interface]\n        trait BlockHashChecker<TContractState> {\n            fn write_block(ref self: TContractState);\n            fn read_block_hash(self: @TContractState) -> felt252;\n        }\n\n        #[test]\n        fn get_block_hash_syscall_in_dispatcher() {\n            let block_hash_checker = declare(\"BlockHashChecker\").unwrap().contract_class();\n            let (block_hash_checker_address, _) = block_hash_checker.deploy(@ArrayTrait::new()).unwrap();\n            let block_hash_checker_dispatcher = BlockHashCheckerDispatcher { contract_address: block_hash_checker_address };\n\n            block_hash_checker_dispatcher.write_block();\n\n            let stored_blk_hash = block_hash_checker_dispatcher.read_block_hash();\n            assert(stored_blk_hash == 0, 'Wrong stored blk hash');\n        }\n    \"#\n        ),\n        Contract::from_code_path(\n            \"BlockHashChecker\".to_string(),\n            Path::new(\"tests/data/contracts/block_hash_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn library_calls() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use core::clone::Clone;\n        use result::ResultTrait;\n        use starknet::{ ClassHash, library_call_syscall, ContractAddress };\n        use snforge_std::{ declare, DeclareResultTrait };\n\n        #[starknet::interface]\n        trait ILibraryContract<TContractState> {\n            fn get_value(\n                self: @TContractState,\n            ) -> felt252;\n\n            fn set_value(\n                ref self: TContractState,\n                number: felt252\n            );\n        }\n\n        #[test]\n        fn library_calls() {\n            let class_hash = declare(\"LibraryContract\").unwrap().contract_class().class_hash.clone();\n            let lib_dispatcher = ILibraryContractLibraryDispatcher { class_hash };\n            let value = lib_dispatcher.get_value();\n            assert(value == 0, 'Incorrect state');\n            lib_dispatcher.set_value(10);\n            let value = lib_dispatcher.get_value();\n            assert(value == 10, 'Incorrect state');\n        }\n    \"#\n        ),\n        Contract::new(\n            \"LibraryContract\",\n            indoc!(\n                r\"\n                #[starknet::interface]\n                trait ILibraryContract<TContractState> {\n                    fn get_value(\n                            self: @TContractState,\n                        ) -> felt252;\n                    fn set_value(\n                        ref self: TContractState,\n                        number: felt252\n                    );\n                }\n\n                #[starknet::contract]\n                mod LibraryContract {\n                    use result::ResultTrait;\n                    use starknet::ClassHash;\n                    use starknet::library_call_syscall;\n\n                    #[storage]\n                    struct Storage {\n                        value: felt252\n                    }\n\n                    #[abi(embed_v0)]\n                    impl LibraryContractImpl of super::ILibraryContract<ContractState> {\n                        fn get_value(\n                            self: @ContractState,\n                        ) -> felt252 {\n                           self.value.read()\n                        }\n\n                        fn set_value(\n                            ref self: ContractState,\n                            number: felt252\n                        ) {\n                           self.value.write(number);\n                        }\n                    }\n                }\n                \"\n            )\n        )\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn disabled_syscalls() {\n    let test = test_case!(\n        indoc!(\n            r\"\n        use result::ResultTrait;\n        use starknet::{ClassHash, deploy_syscall, replace_class_syscall, get_block_hash_syscall};\n        use snforge_std::declare;\n        \n        #[test]\n        fn disabled_syscalls() {\n            let value : ClassHash = 'xd'.try_into().unwrap();\n            replace_class_syscall(value).unwrap();\n        }\n    \"\n        ),\n        Contract::from_code_path(\n            \"HelloStarknet\".to_string(),\n            Path::new(\"tests/data/contracts/hello_starknet.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_failed(&result);\n    assert_case_output_contains(\n        &result,\n        \"disabled_syscalls\",\n        \"Replace class can't be used in tests\",\n    );\n}\n\n#[test]\nfn get_block_hash() {\n    let test = test_case!(indoc!(\n        r\"\n        use result::ResultTrait;\n        use box::BoxTrait;\n        use starknet::{get_block_hash_syscall, get_block_info};\n\n        #[test]\n        fn get_block_hash() {\n            let block_info = get_block_info().unbox();\n            let hash = get_block_hash_syscall(block_info.block_number - 10).unwrap();\n            assert(hash == 0, 'Hash not zero');\n        }\n    \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn cant_call_test_contract() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use result::ResultTrait;\n        use starknet::{ClassHash, ContractAddress, deploy_syscall, replace_class_syscall, get_block_hash_syscall};\n        use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, test_address };\n\n        #[starknet::interface]\n        trait ICallsBack<TContractState> {\n            fn call_back(ref self: TContractState, address: ContractAddress);\n        }\n\n        #[test]\n        fn cant_call_test_contract() {\n            let contract = declare(\"CallsBack\").unwrap().contract_class();\n            let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n            let dispatcher = ICallsBackDispatcher { contract_address: contract_address };\n            dispatcher.call_back(test_address());\n        }\n    \"#\n        ),\n        Contract::new(\n            \"CallsBack\",\n            indoc!(\n                r\"\n                use starknet::ContractAddress;\n\n                #[starknet::interface]\n                trait ICallsBack<TContractState> {\n                    fn call_back(ref self: TContractState, address: ContractAddress);\n                }\n\n                #[starknet::contract]\n                mod CallsBack {\n                    use result::ResultTrait;\n                    use starknet::ClassHash;\n                    use starknet::{library_call_syscall, ContractAddress};\n\n                    #[storage]\n                    struct Storage {\n                    }\n\n                    #[starknet::interface]\n                    trait IDontExist<TContractState> {\n                        fn test_calling_test_fails(ref self: TContractState);\n                    }\n        \n\n                    #[abi(embed_v0)]\n                    impl CallsBackImpl of super::ICallsBack<ContractState> {\n                        fn call_back(ref self: ContractState, address: ContractAddress) {\n                            let dispatcher = IDontExistDispatcher{contract_address: address};\n                            dispatcher.test_calling_test_fails();\n                        }\n                    }\n                }\n                \"\n            )\n        )\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_failed(&result);\n    assert_case_output_contains(&result, \"cant_call_test_contract\", \"ENTRYPOINT_NOT_FOUND\");\n}\n\n#[test]\nfn storage_access_default_values() {\n    let test = test_case!(indoc!(\n        r\"\n        #[starknet::contract]\n        mod Contract {\n         use starknet::storage::{\n            StoragePointerWriteAccess, StorageMapReadAccess, StoragePathEntry, Map };\n            #[derive(starknet::Store, Drop)]\n            struct CustomStruct {\n                a: felt252,\n                b: felt252,\n            }\n            #[storage]\n            struct Storage {\n                balance: felt252,\n                legacy_map: Map<felt252, felt252>,\n                custom_struct: CustomStruct,\n            }\n        }\n\n\n        #[test]\n        fn storage_access_default_values() {\n            let mut state = Contract::contract_state_for_testing();\n            let default_felt252 = state.balance.read();\n            assert(default_felt252 == 0, 'Incorrect storage value');\n\n            let default_map_value = state.legacy_map.read(22);\n            assert(default_map_value == 0, 'Incorrect map value');\n\n            let default_custom_struct = state.custom_struct.read();\n            assert(default_custom_struct.a == 0, 'Invalid cs.a value');\n            assert(default_custom_struct.b == 0, 'Invalid cs.b value');\n        }\n    \"\n    ),);\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn simple_cheatcodes() {\n    let test = test_case!(indoc!(\n        r\"\n        use result::ResultTrait;\n        use box::BoxTrait;\n        use serde::Serde;\n        use starknet::ContractAddress;\n        use array::SpanTrait;\n        use starknet::ContractAddressIntoFelt252;\n        use snforge_std::{\n            start_cheat_sequencer_address, stop_cheat_sequencer_address,\n            start_cheat_caller_address, stop_cheat_caller_address,\n            start_cheat_block_number, stop_cheat_block_number,\n            start_cheat_block_timestamp, stop_cheat_block_timestamp,\n            start_cheat_transaction_hash, stop_cheat_transaction_hash,\n            test_address, CheatSpan\n        };\n        use starknet::{\n            SyscallResultTrait, SyscallResult, syscalls::get_execution_info_v2_syscall,\n        };\n\n        #[test]\n        fn cheat_caller_address_test_state() {\n            let test_address: ContractAddress = test_address();\n            let caller_addr_before = starknet::get_caller_address();\n            let target_caller_address: ContractAddress = (123_felt252).try_into().unwrap();\n\n            start_cheat_caller_address(test_address, target_caller_address);\n            let caller_addr_after = starknet::get_caller_address();\n            assert(caller_addr_after==target_caller_address, caller_addr_after.into());\n\n            stop_cheat_caller_address(test_address);\n            let caller_addr_after = starknet::get_caller_address();\n            assert(caller_addr_after==caller_addr_before, caller_addr_before.into());\n        }\n\n        #[test]\n        fn cheat_block_number_test_state() {\n            let test_address: ContractAddress = test_address();\n            let old_block_number = starknet::get_block_info().unbox().block_number;\n\n            start_cheat_block_number(test_address, 234);\n            let new_block_number = starknet::get_block_info().unbox().block_number;\n            assert(new_block_number == 234, 'Wrong block number');\n\n            stop_cheat_block_number(test_address);\n            let new_block_number = starknet::get_block_info().unbox().block_number;\n            assert(new_block_number == old_block_number, 'Block num did not change back');\n        }\n\n        #[test]\n        fn cheat_block_timestamp_test_state() {\n            let test_address: ContractAddress = test_address();\n            let old_block_timestamp = starknet::get_block_info().unbox().block_timestamp;\n\n            start_cheat_block_timestamp(test_address, 123);\n            let new_block_timestamp = starknet::get_block_info().unbox().block_timestamp;\n            assert(new_block_timestamp == 123, 'Wrong block timestamp');\n\n            stop_cheat_block_timestamp(test_address);\n            let new_block_timestamp = starknet::get_block_info().unbox().block_timestamp;\n            assert(new_block_timestamp == old_block_timestamp, 'Timestamp did not change back')\n        }\n\n        #[test]\n        fn cheat_sequencer_address_test_state() {\n            let test_address: ContractAddress = test_address();\n            let old_sequencer_address = starknet::get_block_info().unbox().sequencer_address;\n\n            start_cheat_sequencer_address(test_address, 123.try_into().unwrap());\n            let new_sequencer_address = starknet::get_block_info().unbox().sequencer_address;\n            assert(new_sequencer_address == 123.try_into().unwrap(), 'Wrong sequencer address');\n\n            stop_cheat_sequencer_address(test_address);\n            let new_sequencer_address = starknet::get_block_info().unbox().sequencer_address;\n            assert(new_sequencer_address == old_sequencer_address, 'Sequencer addr did not revert')\n        }\n\n        #[test]\n        fn transaction_hash_test_state() {\n            let test_address: ContractAddress = test_address();\n            let old_tx_info = starknet::get_tx_info().unbox();\n            let old_tx_info_v2 = get_tx_info_v2().unbox();\n\n            start_cheat_transaction_hash(test_address, 421);\n\n            let new_tx_info = starknet::get_tx_info().unbox();\n            let new_tx_info_v2 = get_tx_info_v2().unbox();\n\n            assert(new_tx_info.nonce == old_tx_info.nonce, 'Wrong nonce');\n            assert(new_tx_info_v2.tip == old_tx_info_v2.tip, 'Wrong tip');\n            assert(new_tx_info.transaction_hash == 421, 'Wrong transaction_hash');\n\n            stop_cheat_transaction_hash(test_address);\n            \n            let new_tx_info = starknet::get_tx_info().unbox();\n            let new_tx_info_v2 = get_tx_info_v2().unbox();\n\n            assert(new_tx_info.nonce == old_tx_info.nonce, 'Wrong nonce');\n            assert(new_tx_info_v2.tip == old_tx_info_v2.tip, 'Wrong tip');\n            assert(\n                new_tx_info.transaction_hash == old_tx_info.transaction_hash,\n                'Wrong transaction_hash'\n            )\n        }\n\n        fn get_execution_info_v2() -> Box<starknet::info::v2::ExecutionInfo> {\n            get_execution_info_v2_syscall().unwrap_syscall()\n        }\n\n        fn get_tx_info_v2() -> Box<starknet::info::v2::TxInfo> {\n            get_execution_info_v2().unbox().tx_info\n        }\n    \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn spy_events_simple() {\n    let test = test_case!(indoc!(\n        r\"\n            use array::ArrayTrait;\n            use result::ResultTrait;\n            use starknet::SyscallResultTrait;\n            use starknet::ContractAddress;\n            use snforge_std::{\n                declare, ContractClassTrait, spy_events, Event, EventSpy,\n                EventSpyTrait, EventSpyAssertionsTrait, EventsFilterTrait, test_address\n            };\n\n            #[test]\n            fn spy_events_simple() {\n                let contract_address = test_address();\n                let mut spy = spy_events();\n                // assert(spy._event_offset == 0, 'Events offset should be 0'); TODO(#2765)\n\n                starknet::emit_event_syscall(array![1234].span(), array![2345].span()).unwrap_syscall();\n\n                spy.assert_emitted(@array![\n                    (\n                        contract_address,\n                        Event { keys: array![1234], data: array![2345] }\n                    )\n                ]);\n            }\n        \"\n    ),);\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn spy_struct_events() {\n    let test = test_case!(indoc!(\n        r\"\n            use array::ArrayTrait;\n            use snforge_std::{\n                declare, ContractClassTrait, spy_events, EventSpy,\n                EventSpyTrait, EventSpyAssertionsTrait, EventsFilterTrait, test_address\n            };\n\n            #[starknet::interface]\n            trait IEmitter<TContractState> {\n              fn emit_event(ref self: TContractState);\n            }\n                \n            #[starknet::contract]\n            mod Emitter {\n                use result::ResultTrait;\n                use starknet::ClassHash;\n                \n                #[event]\n                #[derive(Drop, starknet::Event)]\n                enum Event {\n                    ThingEmitted: ThingEmitted\n                }\n                \n                #[derive(Drop, starknet::Event)]\n                struct ThingEmitted {\n                    thing: felt252\n                }\n    \n                #[storage]\n                struct Storage {}\n\n                #[abi(embed_v0)]\n                impl EmitterImpl of super::IEmitter<ContractState> {\n                    fn emit_event(\n                        ref self: ContractState,\n                    ) {\n                        self.emit(Event::ThingEmitted(ThingEmitted { thing: 420 }));\n                    }\n                }\n            }\n\n            #[test]\n            fn spy_struct_events() {\n                let contract_address = test_address();\n                let mut spy = spy_events();\n                \n                let mut testing_state = Emitter::contract_state_for_testing();\n                Emitter::EmitterImpl::emit_event(ref testing_state);\n\n                spy.assert_emitted(\n                    @array![\n                        (\n                            contract_address,\n                            Emitter::Event::ThingEmitted(Emitter::ThingEmitted { thing: 420 })\n                        )\n                    ]\n                )\n            }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn inconsistent_syscall_pointers() {\n    let test = test_case!(indoc!(\n        r#\"\n        use starknet::ContractAddress;\n        use starknet::info::get_block_number;\n        use snforge_std::start_mock_call;\n\n        #[starknet::interface]\n        trait IContract<TContractState> {\n            fn get_value(self: @TContractState, arg: ContractAddress) -> u128;\n        }\n\n        #[test]\n        fn inconsistent_syscall_pointers() {\n            // verifies if SyscallHandler.syscal_ptr is incremented correctly when calling a contract\n            let address = 'address'.try_into().unwrap();\n            start_mock_call(address, selector!(\"get_value\"), 55);\n            let contract = IContractDispatcher { contract_address: address };\n            contract.get_value(address);\n            get_block_number();\n        }\n    \"#\n    ),);\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn caller_address_in_called_contract() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n        use result::ResultTrait;\n        use array::ArrayTrait;\n        use option::OptionTrait;\n        use traits::TryInto;\n        use starknet::ContractAddress;\n        use starknet::Felt252TryIntoContractAddress;\n        use snforge_std::{ declare, ContractClassTrait, DeclareResultTrait, test_address };\n\n        #[starknet::interface]\n        trait ICheatCallerAddressChecker<TContractState> {\n            fn get_caller_address(ref self: TContractState) -> felt252;\n        }\n\n        #[starknet::interface]\n        trait IConstructorCheatCallerAddressChecker<TContractState> {\n            fn get_stored_caller_address(ref self: TContractState) -> ContractAddress;\n        }\n\n        #[test]\n        fn caller_address_in_called_contract() {\n            let cheat_caller_address_checker = declare(\"CheatCallerAddressChecker\").unwrap().contract_class();\n            let (contract_address_cheat_caller_address_checker, _) = cheat_caller_address_checker.deploy(@ArrayTrait::new()).unwrap();\n            let dispatcher_cheat_caller_address_checker = ICheatCallerAddressCheckerDispatcher { contract_address: contract_address_cheat_caller_address_checker };\n\n            assert(dispatcher_cheat_caller_address_checker.get_caller_address() == test_address().into(), 'Incorrect caller address');\n\n\n            let constructor_cheat_caller_address_checker = declare(\"ConstructorCheatCallerAddressChecker\").unwrap().contract_class();\n            let (contract_address_constructor_cheat_caller_address_checker, _) = constructor_cheat_caller_address_checker.deploy(@ArrayTrait::new()).unwrap();\n            let dispatcher_constructor_cheat_caller_address_checker = IConstructorCheatCallerAddressCheckerDispatcher { contract_address: contract_address_constructor_cheat_caller_address_checker };\n\n            assert(dispatcher_constructor_cheat_caller_address_checker.get_stored_caller_address() == test_address(), 'Incorrect caller address');\n\n        }\n    \"#\n        ),\n        Contract::from_code_path(\n            \"CheatCallerAddressChecker\".to_string(),\n            Path::new(\"tests/data/contracts/cheat_caller_address_checker.cairo\"),\n        )\n        .unwrap(),\n        Contract::new(\n            \"ConstructorCheatCallerAddressChecker\",\n            indoc!(\n                r\"\n            use starknet::ContractAddress;\n\n            #[starknet::interface]\n            trait IConstructorCheatCallerAddressChecker<TContractState> {\n                fn get_stored_caller_address(ref self: TContractState) -> ContractAddress;\n            }\n\n            #[starknet::contract]\n            mod ConstructorCheatCallerAddressChecker {\n                use starknet::ContractAddress;\n\n                #[storage]\n                struct Storage {\n                    caller_address: ContractAddress,\n                }\n\n                #[constructor]\n                fn constructor(ref self: ContractState) {\n                    let address = starknet::get_caller_address();\n                    self.caller_address.write(address);\n                }\n\n                #[abi(embed_v0)]\n                impl IConstructorCheatCallerAddressChecker of super::IConstructorCheatCallerAddressChecker<ContractState> {\n                    fn get_stored_caller_address(ref self: ContractState) -> ContractAddress {\n                        self.caller_address.read()\n                    }\n                }\n            }\n        \"\n            )\n        )\n    );\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\nfn felt252_dict_usage() {\n    let test = test_case!(indoc!(\n        r\"\n        #[starknet::contract]\n        mod DictUsingContract {\n            use core::num::traits::{One};\n            \n            fn unique_count(mut ary: Array<felt252>) -> u32 {\n                let mut dict: Felt252Dict<felt252> = Default::default();\n                let mut counter = 0;\n                // TODO\n                loop {\n                    match ary.pop_front() {\n                        Option::Some(value) => {\n                            if dict.get(value).is_one() {\n                                continue;\n                            }\n                            dict.insert(value, One::one());\n                            counter += 1;\n                        },\n                        Option::None => { break; }\n                    }\n                };\n                counter\n            }\n\n            #[storage]\n            struct Storage {\n                unique_count: u32\n            }\n        \n            #[constructor]\n            fn constructor(ref self: ContractState, values: Array<felt252>) {\n                self.unique_count.write(unique_count(values));\n            }\n        \n            #[external(v0)]\n            fn get_unique(self: @ContractState) -> u32 {\n                self.unique_count.read()\n            }\n            #[external(v0)]\n            fn write_unique(ref self: ContractState, values: Array<felt252>) {\n                self.unique_count.write(unique_count(values));\n            }\n        }\n        \n        #[test]\n        fn test_dict_in_constructor() {\n            let mut testing_state = DictUsingContract::contract_state_for_testing();\n            DictUsingContract::constructor(\n                ref testing_state, \n                array![1, 2, 3, 3, 3, 3 ,3, 4, 4, 4, 4, 4, 5, 5, 5, 5]\n            );\n            \n            assert(DictUsingContract::get_unique(@testing_state) == 5_u32, 'wrong unq ctor');\n            \n            DictUsingContract::write_unique(\n                ref testing_state, \n                array![1, 2, 3, 3, 3, 3 ,3, 4, 4, 4, 4, 4]\n            );\n            \n            assert(DictUsingContract::get_unique(@testing_state) == 4_u32, ' wrote wrong unq');\n        }\n        \"\n    ));\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/too_many_events.rs",
    "content": "use crate::utils::runner::{Contract, assert_case_output_contains, assert_failed, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse blockifier::blockifier_versioned_constants::{EventLimits, VersionedConstants};\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::formatdoc;\nuse starknet_api::versioned_constants_logic::VersionedConstantsTrait;\nuse std::path::Path;\n\n#[test]\nfn ok_events() {\n    let EventLimits {\n        max_data_length,\n        max_keys_length,\n        max_n_emitted_events,\n    } = VersionedConstants::latest_constants().tx_event_limits;\n\n    let test = test_case!(\n        &formatdoc!(\n            r#\"\n            use starknet::ContractAddress;\n            use snforge_std::{{ declare, ContractClassTrait, DeclareResultTrait, store, load }};\n\n            #[starknet::interface]\n            trait ITooManyEvents<TContractState> {{\n                fn emit_too_many_events(self: @TContractState, count: felt252);\n                fn emit_too_many_keys(self: @TContractState, count: felt252);\n                fn emit_too_many_data(self: @TContractState, count: felt252);\n            }}\n\n            fn deploy_contract() -> ITooManyEventsDispatcher {{\n                let contract = declare(\"TooManyEvents\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@array![]).unwrap();\n                ITooManyEventsDispatcher {{ contract_address }}\n            }}\n\n            #[test]\n            fn emit_ok_many_events() {{\n                let deployed = deploy_contract();\n\n                deployed.emit_too_many_events({max_n_emitted_events});\n\n                assert(1 == 1, '');\n            }}\n            #[test]\n            fn emit_ok_many_keys() {{\n                let deployed = deploy_contract();\n\n                deployed.emit_too_many_keys({max_keys_length});\n\n                assert(1 == 1, '');\n            }}\n            #[test]\n            fn emit_ok_many_data() {{\n                let deployed = deploy_contract();\n\n                deployed.emit_too_many_data({max_data_length});\n\n                assert(1 == 1, '');\n            }}\n        \"#\n        ),\n        Contract::from_code_path(\n            \"TooManyEvents\".to_string(),\n            Path::new(\"tests/data/contracts/too_many_events.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n\n    assert_passed(&result);\n}\n#[test]\nfn too_many_events() {\n    let EventLimits {\n        max_data_length,\n        max_keys_length,\n        max_n_emitted_events,\n    } = VersionedConstants::latest_constants().tx_event_limits;\n\n    let emit_too_many_events = max_n_emitted_events + 1;\n    let emit_too_many_keys = max_keys_length + 1;\n    let emit_too_many_data = max_data_length + 1;\n\n    let test = test_case!(\n        &formatdoc!(\n            r#\"\n            use starknet::ContractAddress;\n            use snforge_std::{{ declare, ContractClassTrait, DeclareResultTrait, store, load }};\n\n            #[starknet::interface]\n            trait ITooManyEvents<TContractState> {{\n                fn emit_too_many_events(self: @TContractState, count: felt252);\n                fn emit_too_many_keys(self: @TContractState, count: felt252);\n                fn emit_too_many_data(self: @TContractState, count: felt252);\n            }}\n\n            fn deploy_contract() -> ITooManyEventsDispatcher {{\n                let contract = declare(\"TooManyEvents\").unwrap().contract_class();\n                let (contract_address, _) = contract.deploy(@array![]).unwrap();\n                ITooManyEventsDispatcher {{ contract_address }}\n            }}\n\n            #[test]\n            fn emit_too_many_events() {{\n                let deployed = deploy_contract();\n\n                deployed.emit_too_many_events({emit_too_many_events});\n\n                assert(1 == 1, '');\n            }}\n            #[test]\n            fn emit_too_many_keys() {{\n                let deployed = deploy_contract();\n\n                deployed.emit_too_many_keys({emit_too_many_keys});\n\n                assert(1 == 1, '');\n            }}\n            #[test]\n            fn emit_too_many_data() {{\n                let deployed = deploy_contract();\n\n                deployed.emit_too_many_data({emit_too_many_data});\n\n                assert(1 == 1, '');\n            }}\n        \"#\n        ),\n        Contract::from_code_path(\n            \"TooManyEvents\".to_string(),\n            Path::new(\"tests/data/contracts/too_many_events.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::SierraGas);\n\n    assert_failed(&result);\n    assert_case_output_contains(\n        &result,\n        \"emit_too_many_events\",\n        &format!(\n            \"Exceeded the maximum number of events, number events: {emit_too_many_events}, max number events: {max_n_emitted_events}.\"\n        ),\n    );\n    assert_case_output_contains(\n        &result,\n        \"emit_too_many_data\",\n        &format!(\n            \"Exceeded the maximum data length, data length: {emit_too_many_data}, max data length: {max_data_length}.\"\n        ),\n    );\n    assert_case_output_contains(\n        &result,\n        \"emit_too_many_keys\",\n        &format!(\n            \"Exceeded the maximum keys length, keys length: {emit_too_many_keys}, max keys length: {max_keys_length}.\"\n        ),\n    );\n}\n"
  },
  {
    "path": "crates/forge/tests/integration/trace.rs",
    "content": "use crate::utils::runner::{Contract, assert_passed};\nuse crate::utils::running_tests::run_test_case;\nuse crate::utils::test_case;\nuse forge_runner::forge_config::ForgeTrackedResource;\nuse indoc::indoc;\nuse std::path::Path;\n\n#[test]\n#[expect(clippy::too_many_lines)]\nfn trace_deploy() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use core::clone::Clone;\n            use snforge_std::{declare, ContractClassTrait, DeclareResultTrait, test_address, test_selector};\n            use snforge_std::trace::{CallEntryPoint, CallType, EntryPointType, get_call_trace, CallTrace, CallResult};\n\n            use starknet::{SyscallResultTrait, deploy_syscall, ContractAddress};\n\n            #[test]\n            fn test_deploy_trace_info() {\n                let proxy = declare(\"TraceInfoProxy\").unwrap().contract_class().clone();\n                let checker = declare(\"TraceInfoChecker\").unwrap().contract_class();\n\n                let (checker_address, _) = checker.deploy(@array![]).unwrap();\n\n                let (proxy_address1, _) = proxy.deploy(@array![checker_address.into()]).unwrap();\n\n                let (proxy_address2, _) = deploy_syscall(\n                    proxy.class_hash, 0, array![checker_address.into()].span(), false\n                )\n                    .unwrap_syscall();\n\n                let (proxy_address_3, _) = proxy\n                    .deploy_at(@array![checker_address.into()], 123.try_into().unwrap())\n                    .unwrap();\n\n                assert_trace(\n                    get_call_trace(), proxy_address1, proxy_address2, proxy_address_3, checker_address\n                );\n            }\n\n            fn assert_trace(\n                trace: CallTrace,\n                proxy_address1: ContractAddress,\n                proxy_address2: ContractAddress,\n                proxy_address3: ContractAddress,\n                checker_address: ContractAddress\n            ) {\n                let expected_trace = CallTrace {\n                    entry_point: CallEntryPoint {\n                        entry_point_type: EntryPointType::External,\n                        entry_point_selector: test_selector(),\n                        calldata: array![],\n                        contract_address: test_address(),\n                        caller_address: 0.try_into().unwrap(),\n                        call_type: CallType::Call,\n                    },\n                    nested_calls: array![\n                        CallTrace {\n                            entry_point: CallEntryPoint {\n                                entry_point_type: EntryPointType::Constructor,\n                                entry_point_selector: selector!(\"constructor\"),\n                                calldata: array![checker_address.into()],\n                                contract_address: proxy_address1,\n                                caller_address: test_address(),\n                                call_type: CallType::Call,\n                            },\n                            nested_calls: array![\n                                CallTrace {\n                                    entry_point: CallEntryPoint {\n                                        entry_point_type: EntryPointType::External,\n                                        entry_point_selector: selector!(\"from_proxy\"),\n                                        calldata: array![1],\n                                        contract_address: checker_address,\n                                        caller_address: proxy_address1,\n                                        call_type: CallType::Call,\n                                    },\n                                    nested_calls: array![],\n                                    result: CallResult::Success(array![101])\n                                }\n                            ],\n                            result: CallResult::Success(array![])\n                        },\n                        CallTrace {\n                            entry_point: CallEntryPoint {\n                                entry_point_type: EntryPointType::Constructor,\n                                entry_point_selector: selector!(\"constructor\"),\n                                calldata: array![checker_address.into()],\n                                contract_address: proxy_address2,\n                                caller_address: test_address(),\n                                call_type: CallType::Call,\n                            },\n                            nested_calls: array![\n                                CallTrace {\n                                    entry_point: CallEntryPoint {\n                                        entry_point_type: EntryPointType::External,\n                                        entry_point_selector: selector!(\"from_proxy\"),\n                                        calldata: array![1],\n                                        contract_address: checker_address,\n                                        caller_address: proxy_address2,\n                                        call_type: CallType::Call,\n                                    },\n                                    nested_calls: array![],\n                                    result: CallResult::Success(array![101])\n                                }\n                            ],\n                            result: CallResult::Success(array![])\n                        },\n                        CallTrace {\n                            entry_point: CallEntryPoint {\n                                entry_point_type: EntryPointType::Constructor,\n                                entry_point_selector: selector!(\"constructor\"),\n                                calldata: array![checker_address.into()],\n                                contract_address: proxy_address3,\n                                caller_address: test_address(),\n                                call_type: CallType::Call,\n                            },\n                            nested_calls: array![\n                                CallTrace {\n                                    entry_point: CallEntryPoint {\n                                        entry_point_type: EntryPointType::External,\n                                        entry_point_selector: selector!(\"from_proxy\"),\n                                        calldata: array![1],\n                                        contract_address: checker_address,\n                                        caller_address: proxy_address3,\n                                        call_type: CallType::Call,\n                                    },\n                                    nested_calls: array![],\n                                    result: CallResult::Success(array![101])\n                                }\n                            ],\n                            result: CallResult::Success(array![])\n                        }\n                    ],\n                    result: CallResult::Success(array![])\n                };\n\n                assert(trace == expected_trace, '');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"TraceInfoProxy\".to_string(),\n            Path::new(\"tests/data/contracts/trace_info_proxy.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"TraceInfoChecker\".to_string(),\n            Path::new(\"tests/data/contracts/trace_info_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\n#[expect(clippy::too_many_lines)]\nfn trace_call() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use core::clone::Clone;\n            use snforge_std::{declare, ContractClassTrait, DeclareResultTrait, test_address, test_selector, start_cheat_caller_address};\n            use snforge_std::trace::{CallTrace, CallEntryPoint, CallType, EntryPointType, get_call_trace, CallResult};\n\n            use starknet::{ContractAddress, ClassHash};\n\n            #[starknet::interface]\n            trait ITraceInfoProxy<T> {\n                fn with_libcall(self: @T, class_hash: ClassHash) -> felt252;\n                fn regular_call(self: @T, contract_address: ContractAddress) -> felt252;\n                fn with_panic(self: @T, contract_address: ContractAddress);\n                fn call_two(self: @T, checker_address: ContractAddress, dummy_address: ContractAddress);\n            }\n\n            #[starknet::interface]\n            trait ITraceInfoChecker<T> {\n                fn from_proxy(self: @T, data: felt252) -> felt252;\n                fn panic(self: @T);\n            }\n\n            #[starknet::interface]\n            trait ITraceDummy<T> {\n                fn from_proxy(ref self: T);\n            }\n\n            #[test]\n            fn test_call_trace_info() {\n                let proxy = declare(\"TraceInfoProxy\").unwrap().contract_class();\n                let checker = declare(\"TraceInfoChecker\").unwrap().contract_class().clone();\n                let dummy = declare(\"TraceDummy\").unwrap().contract_class();\n\n                let (checker_address, _) = checker.deploy(@array![]).unwrap();\n                let (proxy_address, _) = proxy.deploy(@array![checker_address.into()]).unwrap();\n                let (dummy_address, _) = dummy.deploy(@array![]).unwrap();\n\n                let proxy_dispatcher = ITraceInfoProxyDispatcher { contract_address: proxy_address };\n\n                proxy_dispatcher.regular_call(checker_address);\n                proxy_dispatcher.with_libcall(checker.class_hash);\n                proxy_dispatcher.call_two(checker_address, dummy_address);\n\n                let chcecker_dispatcher = ITraceInfoCheckerDispatcher { contract_address: checker_address };\n                chcecker_dispatcher.from_proxy(4);\n\n                assert_trace(\n                    get_call_trace(), proxy_address, checker_address, dummy_address, checker.class_hash\n                );\n            }\n\n            fn assert_trace(\n                trace: CallTrace,\n                proxy_address: ContractAddress,\n                checker_address: ContractAddress,\n                dummy_address: ContractAddress,\n                checker_class_hash: ClassHash\n            ) {\n                let expected = CallTrace {\n                    entry_point: CallEntryPoint {\n                        entry_point_type: EntryPointType::External,\n                        entry_point_selector: test_selector(),\n                        calldata: array![],\n                        contract_address: test_address(),\n                        caller_address: 0.try_into().unwrap(),\n                        call_type: CallType::Call,\n                    },\n                    nested_calls: array![\n                        CallTrace {\n                            entry_point: CallEntryPoint {\n                                entry_point_type: EntryPointType::Constructor,\n                                entry_point_selector: selector!(\"constructor\"),\n                                calldata: array![checker_address.into()],\n                                contract_address: proxy_address,\n                                caller_address: test_address(),\n                                call_type: CallType::Call,\n                            },\n                            nested_calls: array![\n                                CallTrace {\n                                    entry_point: CallEntryPoint {\n                                        entry_point_type: EntryPointType::External,\n                                        entry_point_selector: selector!(\"from_proxy\"),\n                                        calldata: array![1],\n                                        contract_address: checker_address,\n                                        caller_address: proxy_address,\n                                        call_type: CallType::Call,\n                                    },\n                                    nested_calls: array![],\n                                    result: CallResult::Success(array![101])\n                                },\n                            ],\n                            result: CallResult::Success(array![])\n                        },\n                        CallTrace {\n                            entry_point: CallEntryPoint {\n                                entry_point_type: EntryPointType::External,\n                                entry_point_selector: selector!(\"regular_call\"),\n                                calldata: array![checker_address.into()],\n                                contract_address: proxy_address,\n                                caller_address: test_address(),\n                                call_type: CallType::Call,\n                            },\n                            nested_calls: array![\n                                CallTrace {\n                                    entry_point: CallEntryPoint {\n                                        entry_point_type: EntryPointType::External,\n                                        entry_point_selector: selector!(\"from_proxy\"),\n                                        calldata: array![2],\n                                        contract_address: checker_address,\n                                        caller_address: proxy_address,\n                                        call_type: CallType::Call,\n                                    },\n                                    nested_calls: array![],\n                                    result: CallResult::Success(array![102])\n                                }\n                            ],\n                            result: CallResult::Success(array![102])\n                        },\n                        CallTrace {\n                            entry_point: CallEntryPoint {\n                                entry_point_type: EntryPointType::External,\n                                entry_point_selector: selector!(\"with_libcall\"),\n                                calldata: array![checker_class_hash.into()],\n                                contract_address: proxy_address,\n                                caller_address: test_address(),\n                                call_type: CallType::Call,\n                            },\n                            nested_calls: array![\n                                CallTrace {\n                                    entry_point: CallEntryPoint {\n                                        entry_point_type: EntryPointType::External,\n                                        entry_point_selector: selector!(\"from_proxy\"),\n                                        calldata: array![3],\n                                        contract_address: proxy_address,\n                                        caller_address: test_address(),\n                                        call_type: CallType::Delegate,\n                                    },\n                                    nested_calls: array![],\n                                    result: CallResult::Success(array![103])\n                                }\n                            ],\n                            result: CallResult::Success(array![103])\n                        },\n                        CallTrace {\n                            entry_point: CallEntryPoint {\n                                entry_point_type: EntryPointType::External,\n                                entry_point_selector: selector!(\"call_two\"),\n                                calldata: array![checker_address.into(), dummy_address.into()],\n                                contract_address: proxy_address,\n                                caller_address: test_address(),\n                                call_type: CallType::Call,\n                            },\n                            nested_calls: array![\n                                CallTrace {\n                                    entry_point: CallEntryPoint {\n                                        entry_point_type: EntryPointType::External,\n                                        entry_point_selector: selector!(\"from_proxy\"),\n                                        calldata: array![42],\n                                        contract_address: checker_address,\n                                        caller_address: proxy_address,\n                                        call_type: CallType::Call,\n                                    },\n                                    nested_calls: array![],\n                                    result: CallResult::Success(array![142])\n                                },\n                                CallTrace {\n                                    entry_point: CallEntryPoint {\n                                        entry_point_type: EntryPointType::External,\n                                        entry_point_selector: selector!(\"from_proxy_dummy\"),\n                                        calldata: array![],\n                                        contract_address: dummy_address,\n                                        caller_address: proxy_address,\n                                        call_type: CallType::Call,\n                                    },\n                                    nested_calls: array![],\n                                    result: CallResult::Success(array![])\n                                }\n                            ],\n                            result: CallResult::Success(array![])\n                        },\n                        CallTrace {\n                            entry_point: CallEntryPoint {\n                                entry_point_type: EntryPointType::External,\n                                entry_point_selector: selector!(\"from_proxy\"),\n                                calldata: array![4],\n                                contract_address: checker_address,\n                                caller_address: test_address(),\n                                call_type: CallType::Call,\n                            },\n                            nested_calls: array![],\n                            result: CallResult::Success(array![104])\n                        }\n                    ],\n                    result: CallResult::Success(array![])\n                };\n\n                assert(expected == trace, 'traces are not equal');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"TraceInfoProxy\".to_string(),\n            Path::new(\"tests/data/contracts/trace_info_proxy.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"TraceInfoChecker\".to_string(),\n            Path::new(\"tests/data/contracts/trace_info_checker.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"TraceDummy\".to_string(),\n            Path::new(\"tests/data/contracts/trace_dummy.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\n#[expect(clippy::too_many_lines)]\nfn trace_failed_call() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{declare, ContractClassTrait, DeclareResultTrait, test_address, test_selector};\n            use snforge_std::trace::{CallEntryPoint, CallType, EntryPointType, get_call_trace, CallTrace, CallResult, CallFailure};\n\n            use starknet::{ContractAddress, ClassHash};\n\n            #[starknet::interface]\n            trait ITraceInfoProxy<T> {\n                fn with_libcall(self: @T, class_hash: ClassHash) -> felt252;\n                fn regular_call(self: @T, contract_address: ContractAddress) -> felt252;\n                fn with_panic(self: @T, contract_address: ContractAddress);\n            }\n\n            #[starknet::interface]\n            trait ITraceInfoChecker<T> {\n                fn from_proxy(self: @T, data: felt252) -> felt252;\n                fn panic(self: @T);\n            }\n\n            #[test]\n            #[feature(\"safe_dispatcher\")]\n            fn test_failed_call_trace_info() {\n                let proxy = declare(\"TraceInfoProxy\").unwrap().contract_class();\n                let checker = declare(\"TraceInfoChecker\").unwrap().contract_class();\n\n                let (checker_address, _) = checker.deploy(@array![]).unwrap();\n                let (proxy_address, _) = proxy.deploy(@array![checker_address.into()]).unwrap();\n\n                let proxy_dispatcher = ITraceInfoProxySafeDispatcher { contract_address: proxy_address };\n                match proxy_dispatcher.with_panic(checker_address) {\n                    Result::Ok(_) => panic_with_felt252('shouldve panicked'),\n                    Result::Err(panic_data) => { assert(*panic_data.at(0) == 'panic', *panic_data.at(0)); }\n                }\n\n                let chcecker_dispatcher = ITraceInfoCheckerSafeDispatcher { contract_address: checker_address };\n                match chcecker_dispatcher.panic() {\n                    Result::Ok(_) => panic_with_felt252('shouldve panicked'),\n                    Result::Err(panic_data) => { assert(*panic_data.at(0) == 'panic', *panic_data.at(0)); }\n                }\n\n                assert_trace(get_call_trace(), proxy_address, checker_address);\n            }\n\n            fn assert_trace(\n                trace: CallTrace, proxy_address: ContractAddress, checker_address: ContractAddress\n            ) {\n                let expected = CallTrace {\n                    entry_point: CallEntryPoint {\n                        entry_point_type: EntryPointType::External,\n                        entry_point_selector: test_selector(),\n                        calldata: array![],\n                        contract_address: test_address(),\n                        caller_address: 0.try_into().unwrap(),\n                        call_type: CallType::Call,\n                    },\n                    nested_calls: array![\n                        CallTrace {\n                            entry_point: CallEntryPoint {\n                                entry_point_type: EntryPointType::Constructor,\n                                entry_point_selector: selector!(\"constructor\"),\n                                calldata: array![checker_address.into()],\n                                contract_address: proxy_address,\n                                caller_address: test_address(),\n                                call_type: CallType::Call,\n                            },\n                            nested_calls: array![\n                                CallTrace {\n                                    entry_point: CallEntryPoint {\n                                        entry_point_type: EntryPointType::External,\n                                        entry_point_selector: selector!(\"from_proxy\"),\n                                        calldata: array![1],\n                                        contract_address: checker_address,\n                                        caller_address: proxy_address,\n                                        call_type: CallType::Call,\n                                    },\n                                    nested_calls: array![],\n                                    result: CallResult::Success(array![101])\n                                },\n                            ],\n                            result: CallResult::Success(array![])\n                        },\n                        CallTrace {\n                            entry_point: CallEntryPoint {\n                                entry_point_type: EntryPointType::External,\n                                entry_point_selector: selector!(\"with_panic\"),\n                                calldata: array![checker_address.into()],\n                                contract_address: proxy_address,\n                                caller_address: test_address(),\n                                call_type: CallType::Call,\n                            },\n                            nested_calls: array![\n                                CallTrace {\n                                    entry_point: CallEntryPoint {\n                                        entry_point_type: EntryPointType::External,\n                                        entry_point_selector: selector!(\"panic\"),\n                                        calldata: array![],\n                                        contract_address: checker_address,\n                                        caller_address: proxy_address,\n                                        call_type: CallType::Call,\n                                    },\n                                    nested_calls: array![],\n                                    result: CallResult::Failure(CallFailure::Panic(array![482670963043]))\n                                }\n                            ],\n                            result: CallResult::Failure(CallFailure::Panic(array![482670963043, 23583600924385842957889778338389964899652]))\n                        },\n                        CallTrace {\n                            entry_point: CallEntryPoint {\n                                entry_point_type: EntryPointType::External,\n                                entry_point_selector: selector!(\"panic\"),\n                                calldata: array![],\n                                contract_address: checker_address,\n                                caller_address: test_address(),\n                                call_type: CallType::Call,\n                            },\n                            nested_calls: array![],\n                            result: CallResult::Failure(CallFailure::Panic(array![482670963043]))\n                        }\n                    ],\n                    result: CallResult::Success(array![])\n                };\n\n                assert(expected == trace, 'traces are not equal');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"TraceInfoProxy\".to_string(),\n            Path::new(\"tests/data/contracts/trace_info_proxy.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"TraceInfoChecker\".to_string(),\n            Path::new(\"tests/data/contracts/trace_info_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\n#[expect(clippy::too_many_lines)]\nfn trace_library_call_from_test() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use core::clone::Clone;\n            use snforge_std::{declare, ContractClassTrait, DeclareResultTrait, test_address, test_selector};\n            use snforge_std::trace::{CallEntryPoint, CallType, EntryPointType, get_call_trace, CallTrace, CallResult};\n\n            use starknet::{ContractAddress, ClassHash};\n\n            #[starknet::interface]\n            trait ITraceInfoProxy<T> {\n                fn with_libcall(self: @T, class_hash: ClassHash) -> felt252;\n                fn regular_call(self: @T, contract_address: ContractAddress) -> felt252;\n                fn with_panic(self: @T, contract_address: ContractAddress);\n                fn call_two(self: @T, checker_address: ContractAddress, dummy_address: ContractAddress);\n            }\n\n            #[starknet::interface]\n            trait ITraceInfoChecker<T> {\n                fn from_proxy(self: @T, data: felt252) -> felt252;\n                fn panic(self: @T);\n            }\n\n            #[starknet::interface]\n            trait ITraceDummy<T> {\n                fn from_proxy(ref self: T);\n            }\n\n            #[test]\n            fn test_library_call_trace_info() {\n                let proxy_hash = declare(\"TraceInfoProxy\").unwrap().contract_class().class_hash.clone();\n                let checker = declare(\"TraceInfoChecker\").unwrap().contract_class().clone();\n                let dummy = declare(\"TraceDummy\").unwrap().contract_class();\n\n                let (checker_address, _) = checker.deploy(@array![]).unwrap();\n                let (dummy_address, _) = dummy.deploy(@array![]).unwrap();\n\n                let proxy_lib_dispatcher = ITraceInfoProxyLibraryDispatcher { class_hash: proxy_hash };\n\n                proxy_lib_dispatcher.regular_call(checker_address);\n                proxy_lib_dispatcher.with_libcall(checker.class_hash);\n                proxy_lib_dispatcher.call_two(checker_address, dummy_address);\n\n                let chcecker_lib_dispatcher = ITraceInfoCheckerLibraryDispatcher {\n                    class_hash: checker.class_hash\n                };\n\n                chcecker_lib_dispatcher.from_proxy(4);\n\n                assert_trace(get_call_trace(), checker_address, dummy_address, checker.class_hash);\n            }\n\n            fn assert_trace(\n                trace: CallTrace,\n                checker_address: ContractAddress,\n                dummy_address: ContractAddress,\n                checker_class_hash: ClassHash\n            ) {\n                let expected = CallTrace {\n                    entry_point: CallEntryPoint {\n                        entry_point_type: EntryPointType::External,\n                        entry_point_selector: test_selector(),\n                        calldata: array![],\n                        contract_address: test_address(),\n                        caller_address: 0.try_into().unwrap(),\n                        call_type: CallType::Call,\n                    },\n                    nested_calls: array![\n                        CallTrace {\n                            entry_point: CallEntryPoint {\n                                entry_point_type: EntryPointType::External,\n                                entry_point_selector: selector!(\"regular_call\"),\n                                calldata: array![checker_address.into()],\n                                contract_address: test_address(),\n                                caller_address: 0.try_into().unwrap(),\n                                call_type: CallType::Delegate,\n                            },\n                            nested_calls: array![\n                                CallTrace {\n                                    entry_point: CallEntryPoint {\n                                        entry_point_type: EntryPointType::External,\n                                        entry_point_selector: selector!(\"from_proxy\"),\n                                        calldata: array![2],\n                                        contract_address: checker_address,\n                                        caller_address: test_address(),\n                                        call_type: CallType::Call,\n                                    },\n                                    nested_calls: array![],\n                                    result: CallResult::Success(array![102])\n                                }\n                            ],\n                            result: CallResult::Success(array![102])\n                        },\n                        CallTrace {\n                            entry_point: CallEntryPoint {\n                                entry_point_type: EntryPointType::External,\n                                entry_point_selector: selector!(\"with_libcall\"),\n                                calldata: array![checker_class_hash.into()],\n                                contract_address: test_address(),\n                                caller_address: 0.try_into().unwrap(),\n                                call_type: CallType::Delegate,\n                            },\n                            nested_calls: array![\n                                CallTrace {\n                                    entry_point: CallEntryPoint {\n                                        entry_point_type: EntryPointType::External,\n                                        entry_point_selector: selector!(\"from_proxy\"),\n                                        calldata: array![3],\n                                        contract_address: test_address(),\n                                        caller_address: 0.try_into().unwrap(),\n                                        call_type: CallType::Delegate,\n                                    },\n                                    nested_calls: array![],\n                                    result: CallResult::Success(array![103])\n                                }\n                            ],\n                            result: CallResult::Success(array![103])\n                        },\n                        CallTrace {\n                            entry_point: CallEntryPoint {\n                                entry_point_type: EntryPointType::External,\n                                entry_point_selector: selector!(\"call_two\"),\n                                calldata: array![checker_address.into(), dummy_address.into()],\n                                contract_address: test_address(),\n                                caller_address: 0.try_into().unwrap(),\n                                call_type: CallType::Delegate,\n                            },\n                            nested_calls: array![\n                                CallTrace {\n                                    entry_point: CallEntryPoint {\n                                        entry_point_type: EntryPointType::External,\n                                        entry_point_selector: selector!(\"from_proxy\"),\n                                        calldata: array![42],\n                                        contract_address: checker_address,\n                                        caller_address: test_address(),\n                                        call_type: CallType::Call,\n                                    },\n                                    nested_calls: array![],\n                                    result: CallResult::Success(array![142])\n                                },\n                                CallTrace {\n                                    entry_point: CallEntryPoint {\n                                        entry_point_type: EntryPointType::External,\n                                        entry_point_selector: selector!(\"from_proxy_dummy\"),\n                                        calldata: array![],\n                                        contract_address: dummy_address,\n                                        caller_address: test_address(),\n                                        call_type: CallType::Call,\n                                    },\n                                    nested_calls: array![],\n                                    result: CallResult::Success(array![])\n                                }\n                            ],\n                            result: CallResult::Success(array![])\n                        },\n                        CallTrace {\n                            entry_point: CallEntryPoint {\n                                entry_point_type: EntryPointType::External,\n                                entry_point_selector: selector!(\"from_proxy\"),\n                                calldata: array![4],\n                                contract_address: test_address(),\n                                caller_address: 0.try_into().unwrap(),\n                                call_type: CallType::Delegate,\n                            },\n                            nested_calls: array![],\n                            result: CallResult::Success(array![104])\n                        }\n                    ],\n                    result: CallResult::Success(array![])\n                };\n\n                assert(expected == trace, 'traces are not equal');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"TraceInfoProxy\".to_string(),\n            Path::new(\"tests/data/contracts/trace_info_proxy.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"TraceInfoChecker\".to_string(),\n            Path::new(\"tests/data/contracts/trace_info_checker.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"TraceDummy\".to_string(),\n            Path::new(\"tests/data/contracts/trace_dummy.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\n#[expect(clippy::too_many_lines)]\nfn trace_failed_library_call_from_test() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{declare, ContractClassTrait, DeclareResultTrait, test_address, test_selector};\n            use snforge_std::trace::{CallEntryPoint, CallType, EntryPointType, get_call_trace, CallTrace, CallResult, CallFailure};\n\n            use starknet::{ContractAddress, ClassHash};\n\n            #[starknet::interface]\n            trait ITraceInfoProxy<T> {\n                fn with_libcall(self: @T, class_hash: ClassHash) -> felt252;\n                fn regular_call(self: @T, contract_address: ContractAddress) -> felt252;\n                fn with_panic(self: @T, contract_address: ContractAddress);\n            }\n\n            #[starknet::interface]\n            trait ITraceInfoChecker<T> {\n                fn from_proxy(self: @T, data: felt252) -> felt252;\n                fn panic(self: @T);\n            }\n\n            #[test]\n            #[feature(\"safe_dispatcher\")]\n            fn test_failed_call_trace_info() {\n                let proxy = declare(\"TraceInfoProxy\").unwrap().contract_class();\n                let checker = declare(\"TraceInfoChecker\").unwrap().contract_class();\n\n                let (checker_address, _) = checker.deploy(@array![]).unwrap();\n                let (proxy_address, _) = proxy.deploy(@array![checker_address.into()]).unwrap();\n\n                let proxy_dispatcher = ITraceInfoProxySafeDispatcher { contract_address: proxy_address };\n                match proxy_dispatcher.with_panic(checker_address) {\n                    Result::Ok(_) => panic_with_felt252('shouldve panicked'),\n                    Result::Err(panic_data) => { assert(*panic_data.at(0) == 'panic', *panic_data.at(0)); }\n                }\n\n                let chcecker_dispatcher = ITraceInfoCheckerSafeDispatcher { contract_address: checker_address };\n                match chcecker_dispatcher.panic() {\n                    Result::Ok(_) => panic_with_felt252('shouldve panicked'),\n                    Result::Err(panic_data) => { assert(*panic_data.at(0) == 'panic', *panic_data.at(0)); }\n                }\n\n                assert_trace(get_call_trace(), proxy_address, checker_address);\n            }\n\n            fn assert_trace(\n                trace: CallTrace, proxy_address: ContractAddress, checker_address: ContractAddress\n            ) {\n                let expected = CallTrace {\n                    entry_point: CallEntryPoint {\n                        entry_point_type: EntryPointType::External,\n                        entry_point_selector: test_selector(),\n                        calldata: array![],\n                        contract_address: test_address(),\n                        caller_address: 0.try_into().unwrap(),\n                        call_type: CallType::Call,\n                    },\n                    nested_calls: array![\n                        CallTrace {\n                            entry_point: CallEntryPoint {\n                                entry_point_type: EntryPointType::Constructor,\n                                entry_point_selector: selector!(\"constructor\"),\n                                calldata: array![checker_address.into()],\n                                contract_address: proxy_address,\n                                caller_address: test_address(),\n                                call_type: CallType::Call,\n                            },\n                            nested_calls: array![\n                                CallTrace {\n                                    entry_point: CallEntryPoint {\n                                        entry_point_type: EntryPointType::External,\n                                        entry_point_selector: selector!(\"from_proxy\"),\n                                        calldata: array![1],\n                                        contract_address: checker_address,\n                                        caller_address: proxy_address,\n                                        call_type: CallType::Call,\n                                    },\n                                    nested_calls: array![],\n                                    result: CallResult::Success(array![101])\n                                },\n                            ],\n                            result: CallResult::Success(array![])\n                        },\n                        CallTrace {\n                            entry_point: CallEntryPoint {\n                                entry_point_type: EntryPointType::External,\n                                entry_point_selector: selector!(\"with_panic\"),\n                                calldata: array![checker_address.into()],\n                                contract_address: proxy_address,\n                                caller_address: test_address(),\n                                call_type: CallType::Call,\n                            },\n                            nested_calls: array![\n                                CallTrace {\n                                    entry_point: CallEntryPoint {\n                                        entry_point_type: EntryPointType::External,\n                                        entry_point_selector: selector!(\"panic\"),\n                                        calldata: array![],\n                                        contract_address: checker_address,\n                                        caller_address: proxy_address,\n                                        call_type: CallType::Call,\n                                    },\n                                    nested_calls: array![],\n                                    result: CallResult::Failure(CallFailure::Panic(array![482670963043]))\n                                }\n                            ],\n                            result: CallResult::Failure(CallFailure::Panic(array![482670963043, 23583600924385842957889778338389964899652]))\n                        },\n                        CallTrace {\n                            entry_point: CallEntryPoint {\n                                entry_point_type: EntryPointType::External,\n                                entry_point_selector: selector!(\"panic\"),\n                                calldata: array![],\n                                contract_address: checker_address,\n                                caller_address: test_address(),\n                                call_type: CallType::Call,\n                            },\n                            nested_calls: array![],\n                            result: CallResult::Failure(CallFailure::Panic(array![482670963043]))\n                        }\n                    ],\n                    result: CallResult::Success(array![])\n                };\n\n                assert(expected == trace, 'traces are not equal');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"TraceInfoProxy\".to_string(),\n            Path::new(\"tests/data/contracts/trace_info_proxy.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"TraceInfoChecker\".to_string(),\n            Path::new(\"tests/data/contracts/trace_info_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n\n#[test]\n#[expect(clippy::too_many_lines)]\nfn trace_l1_handler() {\n    let test = test_case!(\n        indoc!(\n            r#\"\n            use snforge_std::{declare, ContractClassTrait, DeclareResultTrait, test_address, test_selector, L1HandlerTrait,};\n            use snforge_std::trace::{CallEntryPoint, CallType, EntryPointType, get_call_trace, CallTrace, CallResult};\n\n            use starknet::ContractAddress;\n\n            #[test]\n            fn test_l1_handler_call_trace_info() {\n                let proxy = declare(\"TraceInfoProxy\").unwrap().contract_class();\n                let checker = declare(\"TraceInfoChecker\").unwrap().contract_class();\n\n                let (checker_address, _) = checker.deploy(@array![]).unwrap();\n                let (proxy_address, _) = proxy.deploy(@array![checker_address.into()]).unwrap();\n\n                let mut l1_handler = L1HandlerTrait::new(checker_address, selector!(\"handle_l1_message\"));\n\n                l1_handler.execute(123, array![proxy_address.into()].span()).unwrap();\n                assert_trace(get_call_trace(), proxy_address, checker_address);\n            }\n\n            fn assert_trace(\n                trace: CallTrace, proxy_address: ContractAddress, checker_address: ContractAddress\n            ) {\n                let expected_trace = CallTrace {\n                    entry_point: CallEntryPoint {\n                        entry_point_type: EntryPointType::External,\n                        entry_point_selector: test_selector(),\n                        calldata: array![],\n                        contract_address: test_address(),\n                        caller_address: 0.try_into().unwrap(),\n                        call_type: CallType::Call,\n                    },\n                    nested_calls: array![\n                        CallTrace {\n                            entry_point: CallEntryPoint {\n                                entry_point_type: EntryPointType::Constructor,\n                                entry_point_selector: selector!(\"constructor\"),\n                                calldata: array![checker_address.into()],\n                                contract_address: proxy_address,\n                                caller_address: test_address(),\n                                call_type: CallType::Call,\n                            },\n                            nested_calls: array![\n                                CallTrace {\n                                    entry_point: CallEntryPoint {\n                                        entry_point_type: EntryPointType::External,\n                                        entry_point_selector: selector!(\"from_proxy\"),\n                                        calldata: array![1],\n                                        contract_address: checker_address,\n                                        caller_address: proxy_address,\n                                        call_type: CallType::Call,\n                                    },\n                                    nested_calls: array![],\n                                    result: CallResult::Success(array![101])\n                                }\n                            ],\n                            result: CallResult::Success(array![])\n                        },\n                        CallTrace {\n                            entry_point: CallEntryPoint {\n                                entry_point_type: EntryPointType::L1Handler,\n                                entry_point_selector: selector!(\"handle_l1_message\"),\n                                calldata: array![123, proxy_address.into()],\n                                contract_address: checker_address,\n                                caller_address: 0.try_into().unwrap(),\n                                call_type: CallType::Call,\n                            },\n                            nested_calls: array![\n                                CallTrace {\n                                    entry_point: CallEntryPoint {\n                                        entry_point_type: EntryPointType::External,\n                                        entry_point_selector: selector!(\"regular_call\"),\n                                        calldata: array![checker_address.into()],\n                                        contract_address: proxy_address,\n                                        caller_address: checker_address,\n                                        call_type: CallType::Call,\n                                    },\n                                    nested_calls: array![\n                                        CallTrace {\n                                            entry_point: CallEntryPoint {\n                                                entry_point_type: EntryPointType::External,\n                                                entry_point_selector: selector!(\"from_proxy\"),\n                                                calldata: array![2],\n                                                contract_address: checker_address,\n                                                caller_address: proxy_address,\n                                                call_type: CallType::Call,\n                                            },\n                                            nested_calls: array![],\n                                            result: CallResult::Success(array![102])\n                                        }\n                                    ],\n                                    result: CallResult::Success(array![102])\n                                }\n                            ],\n                            result: CallResult::Success(array![102])\n                        }\n                    ],\n                    result: CallResult::Success(array![])\n                };\n\n                assert(trace == expected_trace, '');\n            }\n        \"#\n        ),\n        Contract::from_code_path(\n            \"TraceInfoProxy\".to_string(),\n            Path::new(\"tests/data/contracts/trace_info_proxy.cairo\"),\n        )\n        .unwrap(),\n        Contract::from_code_path(\n            \"TraceInfoChecker\".to_string(),\n            Path::new(\"tests/data/contracts/trace_info_checker.cairo\"),\n        )\n        .unwrap()\n    );\n\n    let result = run_test_case(&test, ForgeTrackedResource::CairoSteps);\n\n    assert_passed(&result);\n}\n"
  },
  {
    "path": "crates/forge/tests/main.rs",
    "content": "mod e2e;\nmod integration;\npub mod utils;\n"
  },
  {
    "path": "crates/forge/tests/utils/mod.rs",
    "content": "pub mod runner;\npub mod running_tests;\n\npub use crate::test_case;\n\nuse anyhow::Result;\nuse assert_fs::fixture::PathCopy;\nuse camino::Utf8PathBuf;\nuse project_root::get_project_root;\nuse scarb_api::version::scarb_version;\nuse semver::Version;\nuse std::str::FromStr;\n\npub fn tempdir_with_tool_versions() -> Result<assert_fs::TempDir> {\n    let project_root = get_project_root()?;\n    let temp_dir = assert_fs::TempDir::new()?;\n    temp_dir.copy_from(project_root, &[\".tool-versions\"])?;\n    Ok(temp_dir)\n}\n\npub fn get_assert_macros_version() -> Result<Version> {\n    Ok(scarb_version()?.cairo)\n}\n\n#[must_use]\npub fn get_std_name() -> String {\n    \"snforge_std\".to_string()\n}\n\npub fn get_std_path() -> Result<String> {\n    let name = get_std_name();\n    Ok(Utf8PathBuf::from_str(&format!(\"../../{name}\"))?\n        .canonicalize_utf8()?\n        .to_string())\n}\n\npub fn get_snforge_std_entry() -> Result<String> {\n    let name = get_std_name();\n    let path = get_std_path()?;\n\n    Ok(format!(\"{name} = {{ path = \\\"{path}\\\" }}\"))\n}\n"
  },
  {
    "path": "crates/forge/tests/utils/runner.rs",
    "content": "use crate::utils::{\n    get_assert_macros_version, get_std_name, get_std_path, tempdir_with_tool_versions,\n};\nuse anyhow::{Context, Result, anyhow};\nuse assert_fs::{\n    TempDir,\n    fixture::{FileTouch, FileWriteStr, PathChild},\n};\nuse blockifier::execution::syscalls::vm_syscall_utils::{SyscallSelector, SyscallUsage};\nuse cairo_vm::types::builtin_name::BuiltinName;\nuse camino::Utf8PathBuf;\nuse forge_runner::{\n    test_case_summary::{AnyTestCaseSummary, TestCaseSummary},\n    test_target_summary::TestTargetSummary,\n};\nuse foundry_ui::UI;\nuse indoc::formatdoc;\nuse scarb_api::metadata::metadata_for_dir;\nuse scarb_api::{\n    CompilationOpts, StarknetContractArtifacts, get_contracts_artifacts_and_source_sierra_paths,\n    target_dir_for_workspace,\n};\nuse shared::command::CommandExt;\nuse starknet_api::execution_resources::{GasAmount, GasVector};\nuse std::{\n    collections::HashMap,\n    fs,\n    path::{Path, PathBuf},\n    process::{Command, Stdio},\n    str::FromStr,\n};\n\n/// Represents a dependency of a Cairo project\n#[derive(Debug, Clone)]\npub struct LinkedLibrary {\n    pub name: String,\n    pub path: PathBuf,\n}\n\n#[derive(Debug, Clone)]\npub struct Contract {\n    name: String,\n    code: String,\n}\n\nimpl Contract {\n    #[must_use]\n    pub fn new(name: impl Into<String>, code: impl Into<String>) -> Self {\n        Self {\n            name: name.into(),\n            code: code.into(),\n        }\n    }\n\n    pub fn from_code_path(name: impl Into<String>, path: impl AsRef<Path>) -> Result<Self> {\n        let code = fs::read_to_string(path)?;\n        Ok(Self {\n            name: name.into(),\n            code,\n        })\n    }\n\n    fn generate_contract_artifacts(self, ui: &UI) -> Result<StarknetContractArtifacts> {\n        let dir = tempdir_with_tool_versions()?;\n\n        let contract_path = dir.child(\"src/lib.cairo\");\n        contract_path.touch()?;\n        contract_path.write_str(&self.code)?;\n\n        let scarb_toml_path = dir.child(\"Scarb.toml\");\n        scarb_toml_path\n            .write_str(&formatdoc!(\n                r#\"\n                [package]\n                name = \"contract\"\n                version = \"0.1.0\"\n\n                [[target.starknet-contract]]\n                sierra = true\n\n                [dependencies]\n                starknet = \"2.6.4\"\n                \"#,\n            ))\n            .unwrap();\n\n        Command::new(\"scarb\")\n            .current_dir(&dir)\n            .arg(\"build\")\n            .stdout(Stdio::inherit())\n            .stderr(Stdio::inherit())\n            .output_checked()\n            .context(\"Failed to build contracts with Scarb\")?;\n\n        let scarb_metadata = metadata_for_dir(dir.path())?;\n        let package = scarb_metadata\n            .packages\n            .iter()\n            .find(|package| package.name == \"contract\")\n            .unwrap();\n        let artifacts_dir = target_dir_for_workspace(&scarb_metadata).join(\"dev\");\n\n        let artifacts = get_contracts_artifacts_and_source_sierra_paths(\n            &artifacts_dir,\n            package,\n            ui,\n            CompilationOpts {\n                use_test_target_contracts: false,\n                #[cfg(feature = \"cairo-native\")]\n                run_native: true,\n            },\n        )\n        .unwrap()\n        .remove(&self.name)\n        .ok_or(anyhow!(\"there is no contract with name {}\", self.name))?\n        .0;\n\n        Ok(artifacts)\n    }\n}\n\n#[derive(Debug)]\npub struct TestCase {\n    dir: TempDir,\n    contracts: Vec<Contract>,\n    environment_variables: HashMap<String, String>,\n}\n\nimpl<'a> TestCase {\n    pub const TEST_PATH: &'a str = \"tests/test_case.cairo\";\n    const PACKAGE_NAME: &'a str = \"my_package\";\n\n    pub fn from(test_code: &str, contracts: Vec<Contract>) -> Result<Self> {\n        let dir = tempdir_with_tool_versions()?;\n        let test_file = dir.child(Self::TEST_PATH);\n        test_file.touch()?;\n        test_file.write_str(test_code)?;\n\n        dir.child(\"src/lib.cairo\").touch().unwrap();\n\n        let snforge_std_name = get_std_name();\n        let snforge_std_path = get_std_path().unwrap();\n        let assert_macros_version = get_assert_macros_version()?.to_string();\n\n        let scarb_toml_path = dir.child(\"Scarb.toml\");\n        scarb_toml_path.write_str(&formatdoc!(\n            r#\"\n            [package]\n            name = \"test_package\"\n            version = \"0.1.0\"\n\n            [dependencies]\n            starknet = \"2.4.0\"\n            {snforge_std_name} = {{ path = \"{snforge_std_path}\" }}\n            assert_macros = \"{assert_macros_version}\"\n            \"#\n        ))?;\n\n        Ok(Self {\n            dir,\n            contracts,\n            environment_variables: HashMap::new(),\n        })\n    }\n\n    pub fn set_env(&mut self, key: &str, value: &str) {\n        self.environment_variables.insert(key.into(), value.into());\n    }\n\n    #[must_use]\n    pub fn env(&self) -> &HashMap<String, String> {\n        &self.environment_variables\n    }\n\n    pub fn path(&self) -> Result<Utf8PathBuf> {\n        Utf8PathBuf::from_path_buf(self.dir.path().to_path_buf())\n            .map_err(|_| anyhow!(\"Failed to convert TestCase path to Utf8PathBuf\"))\n    }\n\n    #[must_use]\n    pub fn linked_libraries(&self) -> Vec<LinkedLibrary> {\n        let snforge_std_path = PathBuf::from_str(\"../../snforge_std\")\n            .unwrap()\n            .canonicalize()\n            .unwrap();\n        vec![\n            LinkedLibrary {\n                name: Self::PACKAGE_NAME.to_string(),\n                path: self.dir.path().join(\"src\"),\n            },\n            LinkedLibrary {\n                name: \"snforge_std\".to_string(),\n                path: snforge_std_path.join(\"src\"),\n            },\n        ]\n    }\n\n    pub fn contracts(\n        &self,\n        ui: &UI,\n    ) -> Result<HashMap<String, (StarknetContractArtifacts, Utf8PathBuf)>> {\n        self.contracts\n            .clone()\n            .into_iter()\n            .map(|contract| {\n                let name = contract.name.clone();\n                let artifacts = contract.generate_contract_artifacts(ui)?;\n\n                Ok((name, (artifacts, Utf8PathBuf::default())))\n            })\n            .collect()\n    }\n\n    #[must_use]\n    pub fn find_test_result(results: &[TestTargetSummary]) -> &TestTargetSummary {\n        results\n            .iter()\n            .find(|tc| !tc.test_case_summaries.is_empty())\n            .unwrap()\n    }\n}\n\n#[expect(clippy::crate_in_macro_def)]\n#[macro_export]\nmacro_rules! test_case {\n    ( $test_code:expr ) => ({\n        use crate::utils::runner::TestCase;\n\n        TestCase::from($test_code, vec![]).unwrap()\n    });\n    ( $test_code:expr, $( $contract:expr ),*) => ({\n        use crate::utils::runner::TestCase;\n\n        let contracts = vec![$($contract,)*];\n        TestCase::from($test_code, contracts).unwrap()\n    });\n}\n\npub fn assert_passed(result: &[TestTargetSummary]) {\n    let result = &TestCase::find_test_result(result).test_case_summaries;\n\n    assert!(!result.is_empty(), \"No test results found\");\n    assert!(\n        result.iter().all(AnyTestCaseSummary::is_passed),\n        \"Some tests didn't pass\"\n    );\n}\n\npub fn assert_failed(result: &[TestTargetSummary]) {\n    let result = &TestCase::find_test_result(result).test_case_summaries;\n\n    assert!(!result.is_empty(), \"No test results found\");\n    assert!(\n        result.iter().all(AnyTestCaseSummary::is_failed),\n        \"Some tests didn't fail\"\n    );\n}\n\npub fn assert_case_output_contains(\n    result: &[TestTargetSummary],\n    test_case_name: &str,\n    asserted_msg: &str,\n) {\n    let test_name_suffix = format!(\"::{test_case_name}\");\n\n    let result = TestCase::find_test_result(result);\n\n    assert!(result.test_case_summaries.iter().any(|any_case| {\n        if any_case.is_passed() || any_case.is_failed() {\n            return any_case.msg().unwrap().contains(asserted_msg)\n                && any_case\n                    .name()\n                    .unwrap()\n                    .ends_with(test_name_suffix.as_str());\n        }\n        false\n    }));\n}\n\npub fn assert_gas(result: &[TestTargetSummary], test_case_name: &str, asserted_gas: GasVector) {\n    let test_name_suffix = format!(\"::{test_case_name}\");\n\n    let result = TestCase::find_test_result(result);\n\n    assert!(result.test_case_summaries.iter().any(|any_case| {\n        match any_case {\n            AnyTestCaseSummary::Fuzzing(_) => {\n                panic!(\"Cannot use assert_gas! for fuzzing tests\")\n            }\n            AnyTestCaseSummary::Single(case) => match case {\n                TestCaseSummary::Passed { gas_info: gas, .. } => {\n                    assert_gas_with_margin(gas.gas_used, asserted_gas)\n                        && any_case\n                            .name()\n                            .unwrap()\n                            .ends_with(test_name_suffix.as_str())\n                }\n                _ => false,\n            },\n        }\n    }));\n}\n\n// This logic is used to assert exact gas values in CI for the minimal supported Scarb version\n// and to assert gas values with a margin in scheduled tests, as values can vary for different Scarb versions\n// FOR LOCAL DEVELOPMENT ALWAYS USE EXACT CALCULATIONS\nfn assert_gas_with_margin(gas: GasVector, asserted_gas: GasVector) -> bool {\n    if cfg!(feature = \"non_exact_gas_assertions\") {\n        let diff = gas_vector_abs_diff(&gas, &asserted_gas);\n        diff.l1_gas.0 <= 10 && diff.l1_data_gas.0 <= 10 && diff.l2_gas.0 <= 200_000\n    } else {\n        gas == asserted_gas\n    }\n}\n\nfn gas_vector_abs_diff(a: &GasVector, b: &GasVector) -> GasVector {\n    GasVector {\n        l1_gas: GasAmount(a.l1_gas.0.abs_diff(b.l1_gas.0)),\n        l1_data_gas: GasAmount(a.l1_data_gas.0.abs_diff(b.l1_data_gas.0)),\n        l2_gas: GasAmount(a.l2_gas.0.abs_diff(b.l2_gas.0)),\n    }\n}\n\npub fn assert_syscall(\n    result: &[TestTargetSummary],\n    test_case_name: &str,\n    syscall: SyscallSelector,\n    expected_count: usize,\n) {\n    let test_name_suffix = format!(\"::{test_case_name}\");\n\n    let result = TestCase::find_test_result(result);\n\n    assert!(result.test_case_summaries.iter().any(|any_case| {\n        match any_case {\n            AnyTestCaseSummary::Fuzzing(_) => {\n                panic!(\"Cannot use assert_syscall! for fuzzing tests\")\n            }\n            AnyTestCaseSummary::Single(case) => match case {\n                TestCaseSummary::Passed { used_resources, .. } => {\n                    used_resources\n                        .syscall_usage\n                        .get(&syscall)\n                        .unwrap_or(&SyscallUsage::new(0, 0))\n                        .call_count\n                        == expected_count\n                        && any_case\n                            .name()\n                            .unwrap()\n                            .ends_with(test_name_suffix.as_str())\n                }\n                _ => false,\n            },\n        }\n    }));\n}\n\npub fn assert_builtin(\n    result: &[TestTargetSummary],\n    test_case_name: &str,\n    builtin: BuiltinName,\n    expected_count: usize,\n) {\n    // TODO(#2806)\n    let expected_count = if builtin == BuiltinName::range_check {\n        expected_count - 1\n    } else {\n        expected_count\n    };\n\n    let test_name_suffix = format!(\"::{test_case_name}\");\n    let result = TestCase::find_test_result(result);\n\n    assert!(result.test_case_summaries.iter().any(|any_case| {\n        match any_case {\n            AnyTestCaseSummary::Fuzzing(_) => {\n                panic!(\"Cannot use assert_builtin for fuzzing tests\")\n            }\n            AnyTestCaseSummary::Single(case) => match case {\n                TestCaseSummary::Passed { used_resources, .. } => {\n                    used_resources\n                        .execution_summary\n                        .charged_resources\n                        .extended_vm_resources\n                        .vm_resources\n                        .builtin_instance_counter\n                        .get(&builtin)\n                        .unwrap_or(&0)\n                        == &expected_count\n                        && any_case\n                            .name()\n                            .unwrap()\n                            .ends_with(test_name_suffix.as_str())\n                }\n                _ => false,\n            },\n        }\n    }));\n}\n"
  },
  {
    "path": "crates/forge/tests/utils/running_tests.rs",
    "content": "use crate::utils::runner::TestCase;\nuse camino::Utf8PathBuf;\nuse cheatnet::runtime_extensions::forge_runtime_extension::contracts_data::ContractsData;\nuse forge::shared_cache::FailedTestsCache;\nuse forge::{\n    block_number_map::BlockNumberMap,\n    run_tests::package::{RunForPackageArgs, run_for_package},\n    run_tests::test_target::ExitFirstChannel,\n    test_filter::TestsFilter,\n};\nuse forge_runner::CACHE_DIR;\nuse forge_runner::debugging::TraceArgs;\nuse forge_runner::forge_config::{\n    ExecutionDataToSave, ForgeConfig, ForgeTrackedResource, OutputConfig, TestRunnerConfig,\n};\nuse forge_runner::partition::PartitionConfig;\nuse forge_runner::running::target::prepare_test_target;\nuse forge_runner::scarb::load_test_artifacts;\nuse forge_runner::test_target_summary::TestTargetSummary;\nuse foundry_ui::UI;\nuse scarb_api::ScarbCommand;\nuse scarb_api::metadata::metadata_for_dir;\nuse std::num::NonZeroU32;\nuse std::sync::Arc;\nuse tempfile::tempdir;\nuse tokio::runtime::Runtime;\n\n#[must_use]\npub fn run_test_case(\n    test: &TestCase,\n    tracked_resource: ForgeTrackedResource,\n) -> Vec<TestTargetSummary> {\n    ScarbCommand::new_with_stdio()\n        .current_dir(test.path().unwrap())\n        .arg(\"build\")\n        .arg(\"--test\")\n        .run()\n        .unwrap();\n\n    let metadata = metadata_for_dir(test.path().unwrap()).unwrap();\n\n    let package = metadata\n        .packages\n        .iter()\n        .find(|p| p.name == \"test_package\")\n        .unwrap();\n\n    let rt = Runtime::new().expect(\"Could not instantiate Runtime\");\n    let raw_test_targets =\n        load_test_artifacts(&test.path().unwrap().join(\"target/dev\"), package).unwrap();\n\n    let ui = Arc::new(UI::default());\n    rt.block_on(async {\n        let target_handles = raw_test_targets\n            .into_iter()\n            .map(|t| tokio::task::spawn_blocking(move || prepare_test_target(t, &tracked_resource)))\n            .collect();\n        run_for_package(\n            RunForPackageArgs {\n                target_handles,\n                package_name: \"test_package\".to_string(),\n                package_root: Utf8PathBuf::default(),\n                tests_filter: TestsFilter::from_flags(\n                    None,\n                    false,\n                    Vec::new(),\n                    false,\n                    false,\n                    false,\n                    FailedTestsCache::default(),\n                    PartitionConfig::default(),\n                ),\n                forge_config: Arc::new(ForgeConfig {\n                    test_runner_config: Arc::new(TestRunnerConfig {\n                        exit_first: false,\n                        deterministic_output: false,\n                        fuzzer_runs: NonZeroU32::new(256).unwrap(),\n                        fuzzer_seed: 12345,\n                        max_n_steps: None,\n                        is_vm_trace_needed: false,\n                        cache_dir: Utf8PathBuf::from_path_buf(tempdir().unwrap().keep())\n                            .unwrap()\n                            .join(CACHE_DIR),\n                        contracts_data: ContractsData::try_from(test.contracts(&ui).unwrap())\n                            .unwrap(),\n                        tracked_resource,\n                        environment_variables: test.env().clone(),\n                        launch_debugger: false,\n                    }),\n                    output_config: Arc::new(OutputConfig {\n                        detailed_resources: false,\n                        execution_data_to_save: ExecutionDataToSave::default(),\n                        trace_args: TraceArgs::default(),\n                        gas_report: false,\n                    }),\n                }),\n                fork_targets: vec![],\n            },\n            &BlockNumberMap::default(),\n            ui,\n            &mut ExitFirstChannel::default(),\n        )\n        .await\n    })\n    .expect(\"Runner fail\")\n    .summaries()\n}\n"
  },
  {
    "path": "crates/forge-runner/Cargo.toml",
    "content": "[package]\nname = \"forge_runner\"\nversion.workspace = true\nedition.workspace = true\n\n# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html\n\n[dependencies]\nanyhow.workspace = true\ncairo-lang-casm.workspace = true\ncairo-lang-sierra.workspace = true\ncairo-lang-utils.workspace = true\ncairo-lang-test-plugin.workspace = true\ncairo-lang-starknet-classes.workspace = true\ncairo-annotations.workspace = true\nstarknet-types-core.workspace = true\nstarknet_api.workspace = true\nstarknet-rust.workspace = true\nfutures.workspace = true\ntokio.workspace = true\nnum-traits.workspace = true\nrand.workspace = true\nurl.workspace = true\nblockifier.workspace = true\ncairo-vm.workspace = true\nitertools.workspace = true\nindoc.workspace = true\ncamino.workspace = true\nserde_json.workspace = true\nconsole.workspace = true\nserde.workspace = true\nrayon.workspace = true\ncheatnet = { path = \"../cheatnet\" }\nruntime = { path = \"../runtime\" }\nconversions = { path = \"../conversions\" }\nshared = { path = \"../shared\" }\ndebugging = { path = \"../debugging\" }\nuniversal-sierra-compiler-api = { path = \"../universal-sierra-compiler-api\" }\nwhich.workspace = true\nsanitize-filename.workspace = true\nclap.workspace = true\nfoundry-ui = { path = \"../foundry-ui\" }\nstrum.workspace = true\nstrum_macros.workspace = true\nscarb-oracle-hint-service.workspace = true\ntracing.workspace = true\ncomfy-table.workspace = true\nscarb-api = { path = \"../scarb-api\" }\ncairo-debugger.workspace = true\n\n[dev-dependencies]\ntest-case.workspace = true\n"
  },
  {
    "path": "crates/forge-runner/src/backtrace/data.rs",
    "content": "use crate::backtrace::display::{Backtrace, BacktraceStack, render_fork_backtrace};\nuse anyhow::Context;\nuse anyhow::Result;\nuse cairo_annotations::annotations::TryFromDebugInfo;\nuse cairo_annotations::annotations::coverage::{\n    CoverageAnnotationsV1, VersionedCoverageAnnotations,\n};\nuse cairo_annotations::annotations::profiler::{\n    ProfilerAnnotationsV1, VersionedProfilerAnnotations,\n};\nuse cairo_lang_sierra::program::StatementIdx;\nuse cairo_lang_starknet_classes::casm_contract_class::CasmContractClass;\nuse cairo_lang_starknet_classes::contract_class::ContractClass;\nuse cheatnet::runtime_extensions::forge_runtime_extension::contracts_data::ContractsData;\nuse itertools::Itertools;\nuse rayon::iter::IntoParallelIterator;\nuse rayon::iter::ParallelIterator;\nuse starknet_api::core::ClassHash;\nuse std::collections::{HashMap, HashSet};\n\npub struct ContractBacktraceDataMapping(HashMap<ClassHash, ContractOrigin>);\n\nimpl ContractBacktraceDataMapping {\n    pub fn new(contracts_data: &ContractsData, class_hashes: HashSet<ClassHash>) -> Result<Self> {\n        Ok(Self(\n            class_hashes\n                .into_par_iter()\n                .map(|class_hash| {\n                    ContractOrigin::new(&class_hash, contracts_data)\n                        .map(|contract_data| (class_hash, contract_data))\n                })\n                .collect::<Result<_>>()?,\n        ))\n    }\n\n    pub fn render_backtrace(&self, pcs: &[usize], class_hash: &ClassHash) -> Result<String> {\n        self.0\n            .get(class_hash)\n            .expect(\"class hash should be present in the data mapping\")\n            .render_backtrace(pcs)\n    }\n}\n\nenum ContractOrigin {\n    Fork(ClassHash),\n    Local(ContractBacktraceData),\n}\n\nimpl ContractOrigin {\n    fn new(class_hash: &ClassHash, contracts_data: &ContractsData) -> Result<Self> {\n        if contracts_data.is_fork_class_hash(class_hash) {\n            Ok(ContractOrigin::Fork(*class_hash))\n        } else {\n            Ok(ContractOrigin::Local(ContractBacktraceData::new(\n                class_hash,\n                contracts_data,\n            )?))\n        }\n    }\n    fn render_backtrace(&self, pcs: &[usize]) -> Result<String> {\n        match self {\n            ContractOrigin::Fork(class_hash) => Ok(render_fork_backtrace(class_hash)),\n            ContractOrigin::Local(data) => data.render_backtrace(pcs),\n        }\n    }\n}\n\nstruct ContractBacktraceData {\n    contract_name: String,\n    casm_debug_info_start_offsets: Vec<usize>,\n    coverage_annotations: CoverageAnnotationsV1,\n    profiler_annotations: ProfilerAnnotationsV1,\n}\n\nimpl ContractBacktraceData {\n    fn new(class_hash: &ClassHash, contracts_data: &ContractsData) -> Result<Self> {\n        let contract_name = contracts_data\n            .get_contract_name(class_hash)\n            .context(format!(\n                \"failed to get contract name for class hash: {class_hash}\"\n            ))?\n            .clone();\n\n        let contract_artifacts = contracts_data\n            .get_artifacts(&contract_name)\n            .context(format!(\n                \"failed to get artifacts for contract name: {contract_name}\"\n            ))?;\n\n        let contract_class = serde_json::from_str::<ContractClass>(&contract_artifacts.sierra)?;\n\n        let sierra_debug_info = contract_class\n            .sierra_program_debug_info\n            .as_ref()\n            .context(\"debug info not found\")?;\n\n        let VersionedCoverageAnnotations::V1(coverage_annotations) =\n            VersionedCoverageAnnotations::try_from_debug_info(sierra_debug_info)\n                .expect(\"this should not fail, as we are doing validation in the `can_backtrace_be_generated` function\");\n\n        let VersionedProfilerAnnotations::V1(profiler_annotations) =\n            VersionedProfilerAnnotations::try_from_debug_info(sierra_debug_info).expect(\"this should not fail, as we are doing validation in the `can_backtrace_be_generated` function\");\n\n        let extracted_sierra = contract_class\n            .extract_sierra_program(false)\n            .expect(\"extraction should succeed\");\n        // FIXME(https://github.com/software-mansion/universal-sierra-compiler/issues/98): Use CASM debug info from USC once it provides it.\n        let (_, debug_info) = CasmContractClass::from_contract_class_with_debug_info(\n            contract_class,\n            extracted_sierra,\n            true,\n            usize::MAX,\n        )?;\n\n        let casm_debug_info_start_offsets = debug_info\n            .sierra_statement_info\n            .iter()\n            .map(|statement_debug_info| statement_debug_info.start_offset)\n            .collect();\n\n        Ok(Self {\n            contract_name,\n            casm_debug_info_start_offsets,\n            coverage_annotations,\n            profiler_annotations,\n        })\n    }\n\n    fn backtrace_from(&self, pc: usize) -> Result<Vec<Backtrace<'_>>> {\n        let sierra_statement_idx = StatementIdx(\n            self.casm_debug_info_start_offsets\n                .partition_point(|start_offset| *start_offset < pc - 1)\n                .saturating_sub(1),\n        );\n\n        let code_locations = self\n            .coverage_annotations\n            .statements_code_locations\n            .get(&sierra_statement_idx)\n            .with_context(|| {\n                format!(\"failed to get code locations for statement idx: {sierra_statement_idx}\")\n            })?;\n\n        let function_names = self\n            .profiler_annotations\n            .statements_functions\n            .get(&sierra_statement_idx)\n            .with_context(|| {\n                format!(\"failed to get function names for statement idx: {sierra_statement_idx}\")\n            })?;\n\n        let stack = code_locations\n            .iter()\n            .zip(function_names)\n            .enumerate()\n            .map(|(index, (code_location, function_name))| {\n                let is_not_last = index != function_names.len() - 1;\n                // `function_names is the stack of:\n                // \"functions that were inlined or generated along the way up\n                // to the first non-inlined function from the original code.\n                // The vector represents the stack from the least meaningful elements.\"\n                // ~ from doc of `ProfilerAnnotationsV1`\n                // So we need to check if the function name is not the last one then it is inlined\n                Backtrace {\n                    inlined: is_not_last,\n                    code_location,\n                    function_name,\n                }\n            })\n            .collect();\n\n        Ok(stack)\n    }\n\n    fn render_backtrace(&self, pcs: &[usize]) -> Result<String> {\n        let stack = pcs\n            .iter()\n            .map(|pc| self.backtrace_from(*pc))\n            .flatten_ok()\n            .collect::<Result<Vec<_>>>()?;\n\n        let contract_name = &self.contract_name;\n\n        let backtrace_stack = BacktraceStack {\n            contract_name,\n            stack,\n        };\n\n        Ok(backtrace_stack.to_string())\n    }\n}\n"
  },
  {
    "path": "crates/forge-runner/src/backtrace/display.rs",
    "content": "use cairo_annotations::annotations::coverage::{CodeLocation, ColumnNumber, LineNumber};\nuse cairo_annotations::annotations::profiler::FunctionName;\nuse starknet_api::core::ClassHash;\nuse std::fmt;\nuse std::fmt::Display;\n\npub struct Backtrace<'a> {\n    pub code_location: &'a CodeLocation,\n    pub function_name: &'a FunctionName,\n    pub inlined: bool,\n}\n\npub struct BacktraceStack<'a> {\n    pub contract_name: &'a str,\n    pub stack: Vec<Backtrace<'a>>,\n}\n\nimpl Display for Backtrace<'_> {\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        let function_name = &self.function_name.0;\n        let path = &self.code_location.0;\n        let line = self.code_location.1.start.line + LineNumber(1); // most editors start line numbers from 1\n        let col = self.code_location.1.start.col + ColumnNumber(1); // most editors start column numbers from 1\n\n        if self.inlined {\n            write!(f, \"(inlined) \")?;\n        }\n\n        write!(f, \"{function_name}\\n       at {path}:{line}:{col}\")\n    }\n}\n\nimpl Display for BacktraceStack<'_> {\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        writeln!(f, \"error occurred in contract '{}'\", self.contract_name)?;\n        writeln!(f, \"stack backtrace:\")?;\n        for (i, backtrace) in self.stack.iter().enumerate() {\n            writeln!(f, \"   {i}: {backtrace}\")?;\n        }\n        Ok(())\n    }\n}\n\npub fn render_fork_backtrace(contract_class_hash: &ClassHash) -> String {\n    format!(\n        \"error occurred in forked contract with class hash: {:#x}\\n\",\n        contract_class_hash.0\n    )\n}\n"
  },
  {
    "path": "crates/forge-runner/src/backtrace/mod.rs",
    "content": "use crate::backtrace::data::ContractBacktraceDataMapping;\nuse anyhow::Result;\nuse cheatnet::runtime_extensions::forge_runtime_extension::contracts_data::ContractsData;\nuse cheatnet::state::EncounteredErrors;\nuse std::env;\n\nmod data;\nmod display;\nconst BACKTRACE_ENV: &str = \"SNFORGE_BACKTRACE\";\n\n#[must_use]\npub fn add_backtrace_footer(\n    message: String,\n    contracts_data: &ContractsData,\n    encountered_errors: &EncounteredErrors,\n) -> String {\n    if encountered_errors.is_empty() {\n        return message;\n    }\n\n    let backtrace = if is_backtrace_enabled() {\n        get_backtrace(contracts_data, encountered_errors)\n    } else {\n        format!(\"note: run with `{BACKTRACE_ENV}=1` environment variable to display a backtrace\")\n    };\n\n    format!(\"{message}\\n{backtrace}\")\n}\n\n#[must_use]\npub fn get_backtrace(\n    contracts_data: &ContractsData,\n    encountered_errors: &EncounteredErrors,\n) -> String {\n    let class_hashes = encountered_errors.keys().copied().collect();\n\n    ContractBacktraceDataMapping::new(contracts_data, class_hashes)\n        .and_then(|data_mapping| {\n            encountered_errors\n                .iter()\n                .map(|(class_hash, pcs)| data_mapping.render_backtrace(pcs, class_hash))\n                .collect::<Result<Vec<_>>>()\n                .map(|backtrace| backtrace.join(\"\\n\"))\n        })\n        .unwrap_or_else(|err| format!(\"failed to create backtrace: {err}\"))\n}\n\n#[must_use]\npub fn is_backtrace_enabled() -> bool {\n    env::var(BACKTRACE_ENV).is_ok_and(|value| value == \"1\")\n}\n"
  },
  {
    "path": "crates/forge-runner/src/build_trace_data.rs",
    "content": "use anyhow::{Context, Result};\nuse blockifier::execution::deprecated_syscalls::DeprecatedSyscallSelector;\nuse blockifier::execution::entry_point::{CallEntryPoint, CallType};\nuse blockifier::execution::syscalls::vm_syscall_utils::{\n    SyscallSelector, SyscallUsage, SyscallUsageMap,\n};\n\nuse blockifier::blockifier_versioned_constants::VersionedConstants;\nuse blockifier::execution::call_info::{ExtendedExecutionResources, OrderedEvent};\nuse cairo_annotations::trace_data::{\n    CairoExecutionInfo, CallEntryPoint as ProfilerCallEntryPoint,\n    CallTraceNode as ProfilerCallTraceNode, CallTraceV1 as ProfilerCallTrace,\n    CallType as ProfilerCallType, CasmLevelInfo, ContractAddress,\n    DeprecatedSyscallSelector as ProfilerDeprecatedSyscallSelector,\n    EntryPointSelector as ProfilerEntryPointSelector, EntryPointType as ProfilerEntryPointType,\n    ExecutionResources as ProfilerExecutionResources, SummedUpEvent,\n    SyscallUsage as ProfilerSyscallUsage, TraceEntry as ProfilerTraceEntry,\n    VersionedCallTrace as VersionedProfilerCallTrace, VmExecutionResources,\n};\nuse cairo_vm::vm::trace::trace_entry::RelocatedTraceEntry;\nuse camino::{Utf8Path, Utf8PathBuf};\nuse cheatnet::forking::data::ForkData;\nuse cheatnet::runtime_extensions::common::{get_syscalls_gas_consumed, sum_syscall_usage};\nuse cheatnet::runtime_extensions::forge_runtime_extension::contracts_data::ContractsData;\nuse cheatnet::trace_data::{CallTrace, CallTraceNode};\nuse conversions::IntoConv;\nuse conversions::string::TryFromHexStr;\nuse runtime::starknet::constants::{TEST_CONTRACT_CLASS_HASH, TEST_ENTRY_POINT_SELECTOR};\nuse starknet_api::contract_class::EntryPointType;\nuse starknet_api::core::{ClassHash, EntryPointSelector};\nuse starknet_api::versioned_constants_logic::VersionedConstantsTrait;\nuse starknet_rust::core::utils::get_selector_from_name;\nuse starknet_types_core::felt::Felt;\nuse std::cell::RefCell;\nuse std::fs;\nuse std::path::PathBuf;\nuse std::rc::Rc;\n\npub const TRACE_DIR: &str = \"snfoundry_trace\";\n\npub const TEST_CODE_CONTRACT_NAME: &str = \"SNFORGE_TEST_CODE\";\npub const TEST_CODE_FUNCTION_NAME: &str = \"SNFORGE_TEST_CODE_FUNCTION\";\n\npub fn build_profiler_call_trace(\n    value: &Rc<RefCell<CallTrace>>,\n    contracts_data: &ContractsData,\n    fork_data: &ForkData,\n    versioned_program_path: &Utf8Path,\n) -> ProfilerCallTrace {\n    let value = value.borrow();\n\n    let entry_point = build_profiler_call_entry_point(\n        value.entry_point.clone(),\n        contracts_data,\n        fork_data,\n        &value.events,\n        &value.signature,\n    );\n    let vm_trace = value\n        .vm_trace\n        .as_ref()\n        .map(|trace_data| trace_data.iter().map(build_profiler_trace_entry).collect());\n    let cairo_execution_info = build_cairo_execution_info(\n        &value.entry_point,\n        vm_trace,\n        contracts_data,\n        versioned_program_path,\n    );\n\n    ProfilerCallTrace {\n        entry_point,\n        cumulative_resources: build_profiler_execution_resources(\n            &value.used_execution_resources,\n            &value.used_syscalls_vm_resources,\n            &value.used_syscalls_sierra_gas,\n            value.gas_consumed,\n        ),\n        used_l1_resources: value.used_l1_resources.clone(),\n        nested_calls: value\n            .nested_calls\n            .iter()\n            .map(|c| {\n                build_profiler_call_trace_node(c, contracts_data, fork_data, versioned_program_path)\n            })\n            .collect(),\n        cairo_execution_info,\n    }\n}\n\nfn build_cairo_execution_info(\n    entry_point: &CallEntryPoint,\n    vm_trace: Option<Vec<ProfilerTraceEntry>>,\n    contracts_data: &ContractsData,\n    versioned_program_path: &Utf8Path,\n) -> Option<CairoExecutionInfo> {\n    let contract_name = get_contract_name(entry_point.class_hash, contracts_data);\n    let source_sierra_path = contract_name\n        .and_then(|name| get_source_sierra_path(&name, contracts_data, versioned_program_path));\n\n    Some(CairoExecutionInfo {\n        casm_level_info: CasmLevelInfo {\n            run_with_call_header: false,\n            vm_trace: vm_trace?,\n            program_offset: None,\n        },\n        source_sierra_path: source_sierra_path?,\n        enable_gas: None,\n    })\n}\n\nfn get_source_sierra_path(\n    contract_name: &str,\n    contracts_data: &ContractsData,\n    versioned_program_path: &Utf8Path,\n) -> Option<Utf8PathBuf> {\n    if contract_name == TEST_CODE_CONTRACT_NAME {\n        Some(versioned_program_path.into())\n    } else {\n        contracts_data\n            .get_source_sierra_path(contract_name)\n            .cloned()\n    }\n}\n\nfn build_profiler_call_trace_node(\n    value: &CallTraceNode,\n    contracts_data: &ContractsData,\n    fork_data: &ForkData,\n    versioned_program_path: &Utf8Path,\n) -> ProfilerCallTraceNode {\n    match value {\n        CallTraceNode::EntryPointCall(trace) => ProfilerCallTraceNode::EntryPointCall(Box::new(\n            build_profiler_call_trace(trace, contracts_data, fork_data, versioned_program_path),\n        )),\n        CallTraceNode::DeployWithoutConstructor => ProfilerCallTraceNode::DeployWithoutConstructor,\n    }\n}\n\n#[must_use]\npub fn build_profiler_execution_resources(\n    execution_resources: &ExtendedExecutionResources,\n    syscall_usage_vm_resources: &SyscallUsageMap,\n    syscall_usage_sierra_gas: &SyscallUsageMap,\n    gas_consumed: u64,\n) -> ProfilerExecutionResources {\n    // Subtract syscall related resources to get the values expected by the profiler.\n    // The profiler operates on resources excluding syscall overhead.\n    let versioned_constants = VersionedConstants::latest_constants();\n    let opcodes = execution_resources.opcode_instance_counter.clone();\n    let execution_resources = &execution_resources.vm_resources\n        - &versioned_constants.get_additional_os_syscall_resources(syscall_usage_vm_resources);\n    let gas_consumed =\n        gas_consumed - get_syscalls_gas_consumed(syscall_usage_sierra_gas, versioned_constants);\n\n    let syscall_usage =\n        sum_syscall_usage(syscall_usage_vm_resources.clone(), syscall_usage_sierra_gas);\n    let profiler_syscall_counter = syscall_usage\n        .into_iter()\n        .map(|(key, val)| {\n            (\n                build_profiler_deprecated_syscall_selector(key),\n                build_profiler_syscall_usage(val),\n            )\n        })\n        .collect();\n\n    ProfilerExecutionResources {\n        vm_resources: VmExecutionResources {\n            n_steps: execution_resources.n_steps,\n            n_memory_holes: execution_resources.n_memory_holes,\n            builtin_instance_counter: execution_resources\n                .builtin_instance_counter\n                .into_iter()\n                .map(|(key, value)| (key.to_str_with_suffix().to_owned(), value))\n                .chain(\n                    // Treat opcodes as builtin instances.\n                    opcodes\n                        .into_iter()\n                        .map(|(key, value)| (key.to_str_with_suffix().to_owned(), value)),\n                )\n                .collect(),\n        },\n        gas_consumed: Some(gas_consumed),\n        syscall_counter: Some(profiler_syscall_counter),\n    }\n}\n\n#[must_use]\npub fn build_profiler_call_entry_point(\n    value: CallEntryPoint,\n    contracts_data: &ContractsData,\n    fork_data: &ForkData,\n    events: &[OrderedEvent],\n    signature: &[Felt],\n) -> ProfilerCallEntryPoint {\n    let CallEntryPoint {\n        class_hash,\n        entry_point_type,\n        entry_point_selector,\n        storage_address,\n        call_type,\n        calldata,\n        ..\n    } = value;\n\n    let contract_name = get_contract_name(class_hash, contracts_data);\n    let function_name = get_function_name(&entry_point_selector, contracts_data, fork_data);\n    let calldata_len = calldata.0.len();\n    let signature_len = signature.len();\n\n    ProfilerCallEntryPoint {\n        class_hash: class_hash.map(|ch| cairo_annotations::trace_data::ClassHash(ch.0)),\n        entry_point_type: build_profiler_entry_point_type(entry_point_type),\n        entry_point_selector: ProfilerEntryPointSelector(entry_point_selector.0),\n        contract_address: ContractAddress(*storage_address.0.key()),\n        call_type: build_profiler_call_type(call_type),\n        contract_name,\n        function_name,\n        calldata_len: Some(calldata_len),\n        events_summary: Some(to_summed_up_events(events)),\n        signature_len: Some(signature_len),\n    }\n}\n\nfn get_contract_name(\n    class_hash: Option<ClassHash>,\n    contracts_data: &ContractsData,\n) -> Option<String> {\n    if class_hash == Some(TryFromHexStr::try_from_hex_str(TEST_CONTRACT_CLASS_HASH).unwrap()) {\n        Some(String::from(TEST_CODE_CONTRACT_NAME))\n    } else {\n        class_hash\n            .and_then(|c| contracts_data.get_contract_name(&c))\n            .cloned()\n    }\n}\n\nfn get_function_name(\n    entry_point_selector: &EntryPointSelector,\n    contracts_data: &ContractsData,\n    fork_data: &ForkData,\n) -> Option<String> {\n    if entry_point_selector.0\n        == get_selector_from_name(TEST_ENTRY_POINT_SELECTOR)\n            .unwrap()\n            .into_()\n    {\n        Some(TEST_CODE_FUNCTION_NAME.to_string())\n    } else if let Some(name) = contracts_data\n        .get_function_name(entry_point_selector)\n        .cloned()\n    {\n        Some(name)\n    } else {\n        fork_data.selectors.get(entry_point_selector).cloned()\n    }\n}\n\nfn build_profiler_entry_point_type(value: EntryPointType) -> ProfilerEntryPointType {\n    match value {\n        EntryPointType::Constructor => ProfilerEntryPointType::Constructor,\n        EntryPointType::External => ProfilerEntryPointType::External,\n        EntryPointType::L1Handler => ProfilerEntryPointType::L1Handler,\n    }\n}\n\nfn build_profiler_deprecated_syscall_selector(\n    value: SyscallSelector,\n) -> ProfilerDeprecatedSyscallSelector {\n    // Warning: Do not add a default (`_`) arm here.\n    // This match must remain exhaustive so that if a new syscall is introduced,\n    // we will explicitly add support for it.\n    match value {\n        DeprecatedSyscallSelector::CallContract => ProfilerDeprecatedSyscallSelector::CallContract,\n        DeprecatedSyscallSelector::DelegateCall => ProfilerDeprecatedSyscallSelector::DelegateCall,\n        DeprecatedSyscallSelector::DelegateL1Handler => {\n            ProfilerDeprecatedSyscallSelector::DelegateL1Handler\n        }\n        DeprecatedSyscallSelector::Deploy => ProfilerDeprecatedSyscallSelector::Deploy,\n        DeprecatedSyscallSelector::EmitEvent => ProfilerDeprecatedSyscallSelector::EmitEvent,\n        DeprecatedSyscallSelector::GetBlockHash => ProfilerDeprecatedSyscallSelector::GetBlockHash,\n        DeprecatedSyscallSelector::GetBlockNumber => {\n            ProfilerDeprecatedSyscallSelector::GetBlockNumber\n        }\n        DeprecatedSyscallSelector::GetBlockTimestamp => {\n            ProfilerDeprecatedSyscallSelector::GetBlockTimestamp\n        }\n        DeprecatedSyscallSelector::GetCallerAddress => {\n            ProfilerDeprecatedSyscallSelector::GetCallerAddress\n        }\n        DeprecatedSyscallSelector::GetContractAddress => {\n            ProfilerDeprecatedSyscallSelector::GetContractAddress\n        }\n        DeprecatedSyscallSelector::GetExecutionInfo => {\n            ProfilerDeprecatedSyscallSelector::GetExecutionInfo\n        }\n        DeprecatedSyscallSelector::GetSequencerAddress => {\n            ProfilerDeprecatedSyscallSelector::GetSequencerAddress\n        }\n        DeprecatedSyscallSelector::GetTxInfo => ProfilerDeprecatedSyscallSelector::GetTxInfo,\n        DeprecatedSyscallSelector::GetTxSignature => {\n            ProfilerDeprecatedSyscallSelector::GetTxSignature\n        }\n        DeprecatedSyscallSelector::Keccak => ProfilerDeprecatedSyscallSelector::Keccak,\n        DeprecatedSyscallSelector::LibraryCall => ProfilerDeprecatedSyscallSelector::LibraryCall,\n        DeprecatedSyscallSelector::LibraryCallL1Handler => {\n            ProfilerDeprecatedSyscallSelector::LibraryCallL1Handler\n        }\n        DeprecatedSyscallSelector::ReplaceClass => ProfilerDeprecatedSyscallSelector::ReplaceClass,\n        DeprecatedSyscallSelector::Secp256k1Add => ProfilerDeprecatedSyscallSelector::Secp256k1Add,\n        DeprecatedSyscallSelector::Secp256k1GetPointFromX => {\n            ProfilerDeprecatedSyscallSelector::Secp256k1GetPointFromX\n        }\n        DeprecatedSyscallSelector::Secp256k1GetXy => {\n            ProfilerDeprecatedSyscallSelector::Secp256k1GetXy\n        }\n        DeprecatedSyscallSelector::Secp256k1Mul => ProfilerDeprecatedSyscallSelector::Secp256k1Mul,\n        DeprecatedSyscallSelector::Secp256k1New => ProfilerDeprecatedSyscallSelector::Secp256k1New,\n        DeprecatedSyscallSelector::Secp256r1Add => ProfilerDeprecatedSyscallSelector::Secp256r1Add,\n        DeprecatedSyscallSelector::Secp256r1GetPointFromX => {\n            ProfilerDeprecatedSyscallSelector::Secp256r1GetPointFromX\n        }\n        DeprecatedSyscallSelector::Secp256r1GetXy => {\n            ProfilerDeprecatedSyscallSelector::Secp256r1GetXy\n        }\n        DeprecatedSyscallSelector::Secp256r1Mul => ProfilerDeprecatedSyscallSelector::Secp256r1Mul,\n        DeprecatedSyscallSelector::Secp256r1New => ProfilerDeprecatedSyscallSelector::Secp256r1New,\n        DeprecatedSyscallSelector::SendMessageToL1 => {\n            ProfilerDeprecatedSyscallSelector::SendMessageToL1\n        }\n        DeprecatedSyscallSelector::StorageRead => ProfilerDeprecatedSyscallSelector::StorageRead,\n        DeprecatedSyscallSelector::StorageWrite => ProfilerDeprecatedSyscallSelector::StorageWrite,\n        DeprecatedSyscallSelector::Sha256ProcessBlock => {\n            ProfilerDeprecatedSyscallSelector::Sha256ProcessBlock\n        }\n        DeprecatedSyscallSelector::GetClassHashAt => {\n            ProfilerDeprecatedSyscallSelector::GetClassHashAt\n        }\n        DeprecatedSyscallSelector::KeccakRound => ProfilerDeprecatedSyscallSelector::KeccakRound,\n        DeprecatedSyscallSelector::MetaTxV0 => ProfilerDeprecatedSyscallSelector::MetaTxV0,\n    }\n}\n\nfn build_profiler_syscall_usage(\n    SyscallUsage {\n        call_count,\n        linear_factor,\n    }: SyscallUsage,\n) -> ProfilerSyscallUsage {\n    ProfilerSyscallUsage {\n        call_count,\n        linear_factor,\n    }\n}\n\nfn build_profiler_call_type(value: CallType) -> ProfilerCallType {\n    match value {\n        CallType::Call => ProfilerCallType::Call,\n        CallType::Delegate => ProfilerCallType::Delegate,\n    }\n}\n\nfn build_profiler_trace_entry(value: &RelocatedTraceEntry) -> ProfilerTraceEntry {\n    ProfilerTraceEntry {\n        pc: value.pc,\n        ap: value.ap,\n        fp: value.fp,\n    }\n}\n\npub fn save_trace_data(\n    test_name: &str,\n    trace_data: &VersionedProfilerCallTrace,\n) -> Result<PathBuf> {\n    let serialized_trace =\n        serde_json::to_string(trace_data).expect(\"Failed to serialize call trace\");\n    let dir_to_save_trace = PathBuf::from(TRACE_DIR);\n    fs::create_dir_all(&dir_to_save_trace).context(\"Failed to create a .trace_data directory\")?;\n\n    let filename = format!(\"{test_name}.json\");\n    fs::write(dir_to_save_trace.join(&filename), serialized_trace)\n        .context(\"Failed to write call trace to a file\")?;\n    Ok(dir_to_save_trace.join(&filename))\n}\n\nfn to_summed_up_events(events: &[OrderedEvent]) -> Vec<SummedUpEvent> {\n    events\n        .iter()\n        .map(|ev| SummedUpEvent {\n            keys_len: ev.event.keys.len(),\n            data_len: ev.event.data.0.len(),\n        })\n        .collect()\n}\n"
  },
  {
    "path": "crates/forge-runner/src/coverage_api.rs",
    "content": "use anyhow::{Context, Result, ensure};\nuse indoc::indoc;\nuse shared::command::CommandExt;\nuse std::ffi::OsString;\nuse std::process::Stdio;\nuse std::{env, fs, path::PathBuf, process::Command};\nuse which::which;\n\npub const COVERAGE_DIR: &str = \"coverage\";\npub const OUTPUT_FILE_NAME: &str = \"coverage.lcov\";\n\npub fn run_coverage(saved_trace_data_paths: &[PathBuf], coverage_args: &[OsString]) -> Result<()> {\n    let coverage = env::var(\"CAIRO_COVERAGE\")\n        .map(PathBuf::from)\n        .ok()\n        .unwrap_or_else(|| PathBuf::from(\"cairo-coverage\"));\n\n    ensure!(\n        which(coverage.as_os_str()).is_ok(),\n        indoc! {\n            r\"The 'cairo-coverage' binary was not found in PATH. It may not have been installed.\n            Please refer to the documentation for installation instructions:\n            https://github.com/software-mansion/cairo-coverage/blob/main/README.md\"\n        }\n    );\n\n    let trace_files: Vec<&str> = saved_trace_data_paths\n        .iter()\n        .map(|trace_data_path| {\n            trace_data_path\n                .to_str()\n                .expect(\"Failed to convert trace data path to string\")\n        })\n        .collect();\n\n    let mut command = Command::new(coverage);\n    command.arg(\"run\");\n\n    if coverage_args.iter().all(|arg| arg != \"--output-path\") {\n        let dir_to_save_coverage = PathBuf::from(COVERAGE_DIR);\n        fs::create_dir_all(&dir_to_save_coverage).context(\"Failed to create a coverage dir\")?;\n        let path_to_save_coverage = dir_to_save_coverage.join(OUTPUT_FILE_NAME);\n\n        command.arg(\"--output-path\").arg(&path_to_save_coverage);\n    }\n\n    command\n        .args(trace_files)\n        .args(coverage_args)\n        .stdout(Stdio::inherit())\n        .stderr(Stdio::inherit())\n        .output_checked()\n        .with_context(|| {\n            \"cairo-coverage failed to generate coverage - inspect the errors above for more info\"\n        })?;\n\n    Ok(())\n}\n"
  },
  {
    "path": "crates/forge-runner/src/debugging/args.rs",
    "content": "use crate::debugging::TraceVerbosity;\nuse crate::debugging::component::Component;\nuse clap::Args;\nuse debugging::Components;\n\n#[derive(Args, Debug, Clone, Default, Eq, PartialEq)]\n#[group(required = false, multiple = false)]\npub struct TraceArgs {\n    /// Trace verbosity level\n    #[arg(long)]\n    trace_verbosity: Option<TraceVerbosity>,\n\n    /// Components to include in the trace.\n    #[arg(long, num_args = 1.., value_delimiter = ' ')]\n    trace_components: Option<Vec<Component>>,\n}\n\nimpl TraceArgs {\n    /// Returns the [`Option<Components>`] based on the provided arguments.\n    #[must_use]\n    pub fn to_components(&self) -> Option<Components> {\n        match (&self.trace_components, &self.trace_verbosity) {\n            (None, Some(verbosity)) => Some(build_components(verbosity.to_components_vec())),\n            (Some(components), None) => Some(build_components(components)),\n            (None, None) => None,\n            (Some(_), Some(_)) => {\n                unreachable!(\"this case is impossible, as it is handled by clap\")\n            }\n        }\n    }\n}\n\nfn build_components<'a>(iter: impl IntoIterator<Item = &'a Component>) -> Components {\n    Components::new(iter.into_iter().map(debugging::Component::from).collect())\n}\n"
  },
  {
    "path": "crates/forge-runner/src/debugging/component.rs",
    "content": "use crate::debugging::trace_verbosity::TraceVerbosity;\nuse clap::ValueEnum;\nuse strum_macros::VariantArray;\n\n/// Components that will be included in the trace.\n#[derive(ValueEnum, Clone, VariantArray, Debug, Eq, PartialEq)]\npub enum Component {\n    /// The name of the contract being called.\n    ContractName,\n    /// The type of the entry point being called (e.g., `External`, `L1Handler`, etc.).\n    EntryPointType,\n    /// The calldata of the call, transformed for display.\n    Calldata,\n    /// The address of the contract being called.\n    ContractAddress,\n    /// The address of the caller contract.\n    CallerAddress,\n    /// The type of the call (e.g., `Call`, `Delegate`, etc.).\n    CallType,\n    /// The result of the call, transformed for display.\n    CallResult,\n    /// The L2 gas used by the call.\n    Gas,\n}\nimpl Component {\n    /// Returns minimal [`TraceVerbosity`] for the component.\n    #[must_use]\n    pub fn verbosity(&self) -> TraceVerbosity {\n        match self {\n            Component::ContractName => TraceVerbosity::Minimal,\n            Component::Calldata | Component::CallResult => TraceVerbosity::Standard,\n            Component::ContractAddress\n            | Component::CallerAddress\n            | Component::EntryPointType\n            | Component::CallType\n            | Component::Gas => TraceVerbosity::Detailed,\n        }\n    }\n}\n\nimpl From<&Component> for debugging::Component {\n    fn from(component: &Component) -> Self {\n        match component {\n            Component::ContractName => debugging::Component::ContractName,\n            Component::EntryPointType => debugging::Component::EntryPointType,\n            Component::Calldata => debugging::Component::Calldata,\n            Component::ContractAddress => debugging::Component::ContractAddress,\n            Component::CallerAddress => debugging::Component::CallerAddress,\n            Component::CallType => debugging::Component::CallType,\n            Component::CallResult => debugging::Component::CallResult,\n            Component::Gas => debugging::Component::Gas,\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge-runner/src/debugging/mod.rs",
    "content": "mod args;\nmod component;\nmod trace_verbosity;\n\nuse cheatnet::forking::data::ForkData;\nuse cheatnet::runtime_extensions::forge_runtime_extension::contracts_data::ContractsData;\nuse cheatnet::trace_data::CallTrace;\n\npub use args::TraceArgs;\npub use trace_verbosity::TraceVerbosity;\n\n#[must_use]\npub fn build_debugging_trace(\n    call_trace: &CallTrace,\n    contracts_data: &ContractsData,\n    trace_args: &TraceArgs,\n    test_name: String,\n    fork_data: &ForkData,\n) -> Option<debugging::Trace> {\n    let components = trace_args.to_components()?;\n    let context = debugging::Context::new(contracts_data, fork_data, components);\n    Some(debugging::Trace::new(call_trace, &context, test_name))\n}\n"
  },
  {
    "path": "crates/forge-runner/src/debugging/trace_verbosity.rs",
    "content": "use crate::debugging::component::Component;\nuse clap::ValueEnum;\nuse strum::VariantArray;\n\n/// Trace verbosity level.\n#[derive(ValueEnum, Debug, Clone, Copy, Ord, PartialOrd, Eq, PartialEq)]\npub enum TraceVerbosity {\n    /// Display test name, contract name and selector.\n    Minimal,\n    /// Display test name, contract name, selector, calldata and call result.\n    Standard,\n    /// Display everything.\n    Detailed,\n}\n\nimpl TraceVerbosity {\n    /// Converts the [`TraceVerbosity`] to a vector of [`Component`].\n    #[must_use]\n    pub fn to_components_vec(&self) -> Vec<&Component> {\n        Component::VARIANTS\n            .iter()\n            .filter(|component| component.verbosity() <= *self)\n            .collect()\n    }\n}\n"
  },
  {
    "path": "crates/forge-runner/src/expected_result.rs",
    "content": "// Our custom structs used to prevent name changes in structs on side of cairo compiler from breaking the test collector backwards compatibility\nuse cairo_lang_test_plugin::test_config::{PanicExpectation, TestExpectation};\nuse serde::Deserialize;\nuse starknet_types_core::felt::Felt;\n\n/// Expectation for a panic case.\n#[derive(Debug, Clone, PartialEq, Deserialize)]\npub enum ExpectedPanicValue {\n    /// Accept any panic value.\n    Any,\n    /// Accept only this specific vector of panics.\n    Exact(Vec<Felt>),\n}\n\nimpl From<PanicExpectation> for ExpectedPanicValue {\n    fn from(value: PanicExpectation) -> Self {\n        match value {\n            PanicExpectation::Any => ExpectedPanicValue::Any,\n            PanicExpectation::Exact(vec) => ExpectedPanicValue::Exact(vec),\n        }\n    }\n}\n\n/// Expectation for a result of a test.\n#[derive(Debug, Clone, PartialEq, Deserialize)]\npub enum ExpectedTestResult {\n    /// Running the test should not panic.\n    Success,\n    /// Running the test should result in a panic.\n    Panics(ExpectedPanicValue),\n}\n\nimpl From<TestExpectation> for ExpectedTestResult {\n    fn from(value: TestExpectation) -> Self {\n        match value {\n            TestExpectation::Success => ExpectedTestResult::Success,\n            TestExpectation::Panics(panic_expectation) => {\n                ExpectedTestResult::Panics(panic_expectation.into())\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge-runner/src/filtering.rs",
    "content": "use crate::package_tests::TestCase;\n\n/// Result of filtering a test case.\n#[derive(Debug)]\npub enum FilterResult {\n    /// Test case should be included.\n    Included,\n    /// Test case should be excluded for the given reason.\n    Excluded(ExcludeReason),\n}\n\n/// Reason for excluding a test case.\n#[derive(Debug, Clone, Copy, PartialEq, Eq)]\npub enum ExcludeReason {\n    /// Test case is ignored.\n    Ignored,\n    /// Test case is excluded from the current partition.\n    ExcludedFromPartition,\n}\n\npub trait TestCaseFilter {\n    fn filter<T>(&self, test_case: &TestCase<T>) -> FilterResult\n    where\n        T: TestCaseIsIgnored;\n}\n\npub trait TestCaseIsIgnored {\n    fn is_ignored(&self) -> bool;\n}\n"
  },
  {
    "path": "crates/forge-runner/src/forge_config.rs",
    "content": "use crate::debugging::TraceArgs;\nuse blockifier::execution::contract_class::TrackedResource;\nuse camino::Utf8PathBuf;\nuse cheatnet::runtime_extensions::forge_runtime_extension::contracts_data::ContractsData;\nuse clap::ValueEnum;\nuse serde::Deserialize;\nuse std::collections::HashMap;\nuse std::ffi::OsString;\nuse std::num::NonZeroU32;\nuse std::sync::Arc;\n\n#[derive(Debug, PartialEq)]\npub struct ForgeConfig {\n    pub test_runner_config: Arc<TestRunnerConfig>,\n    pub output_config: Arc<OutputConfig>,\n}\n\n#[expect(clippy::struct_excessive_bools)]\n#[derive(Debug, PartialEq)]\npub struct TestRunnerConfig {\n    pub exit_first: bool,\n    pub deterministic_output: bool,\n    pub fuzzer_runs: NonZeroU32,\n    pub fuzzer_seed: u64,\n    pub max_n_steps: Option<u32>,\n    pub is_vm_trace_needed: bool,\n    pub cache_dir: Utf8PathBuf,\n    pub contracts_data: ContractsData,\n    pub environment_variables: HashMap<String, String>,\n    pub tracked_resource: ForgeTrackedResource,\n    pub launch_debugger: bool,\n}\n\n#[derive(Debug, PartialEq)]\npub struct OutputConfig {\n    pub trace_args: TraceArgs,\n    pub detailed_resources: bool,\n    pub execution_data_to_save: ExecutionDataToSave,\n    pub gas_report: bool,\n}\n\n#[derive(Debug, PartialEq, Clone, Default)]\npub struct ExecutionDataToSave {\n    pub trace: bool,\n    pub profile: bool,\n    pub coverage: bool,\n    pub additional_args: Vec<OsString>,\n}\n\n#[derive(Clone, Copy, Debug, Default, PartialEq, Deserialize, Eq, ValueEnum)]\npub enum ForgeTrackedResource {\n    CairoSteps,\n    #[default]\n    SierraGas,\n}\n\nimpl From<&ForgeTrackedResource> for TrackedResource {\n    fn from(m: &ForgeTrackedResource) -> Self {\n        match m {\n            ForgeTrackedResource::CairoSteps => TrackedResource::CairoSteps,\n            ForgeTrackedResource::SierraGas => TrackedResource::SierraGas,\n        }\n    }\n}\n\nimpl ExecutionDataToSave {\n    #[must_use]\n    pub fn from_flags(\n        save_trace_data: bool,\n        build_profile: bool,\n        coverage: bool,\n        additional_args: &[OsString],\n    ) -> Self {\n        Self {\n            trace: save_trace_data,\n            profile: build_profile,\n            coverage,\n            additional_args: additional_args.to_vec(),\n        }\n    }\n    #[must_use]\n    pub fn is_vm_trace_needed(&self) -> bool {\n        self.trace || self.profile || self.coverage\n    }\n}\n\n/// This struct should be constructed on demand to pass only relevant information from\n/// [`TestRunnerConfig`] to another function.\npub struct RuntimeConfig<'a> {\n    pub max_n_steps: Option<u32>,\n    pub is_vm_trace_needed: bool,\n    pub cache_dir: &'a Utf8PathBuf,\n    pub contracts_data: &'a ContractsData,\n    pub environment_variables: &'a HashMap<String, String>,\n    pub tracked_resource: &'a ForgeTrackedResource,\n    pub launch_debugger: bool,\n}\n\nimpl<'a> RuntimeConfig<'a> {\n    #[must_use]\n    pub fn from(value: &'a TestRunnerConfig) -> RuntimeConfig<'a> {\n        Self {\n            max_n_steps: value.max_n_steps,\n            is_vm_trace_needed: value.is_vm_trace_needed,\n            cache_dir: &value.cache_dir,\n            contracts_data: &value.contracts_data,\n            environment_variables: &value.environment_variables,\n            tracked_resource: &value.tracked_resource,\n            launch_debugger: value.launch_debugger,\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge-runner/src/gas/report.rs",
    "content": "use crate::gas::stats::GasStats;\nuse crate::gas::utils::shorten_felt;\nuse cheatnet::trace_data::{CallTrace, CallTraceNode};\nuse comfy_table::modifiers::UTF8_ROUND_CORNERS;\nuse comfy_table::{Attribute, Cell, Color, Table};\nuse debugging::ContractsDataStore;\nuse starknet_api::core::{ClassHash, EntryPointSelector};\nuse starknet_api::execution_resources::GasVector;\nuse std::collections::BTreeMap;\nuse std::fmt;\nuse std::fmt::Display;\n\ntype ContractName = String;\ntype Selector = String;\n\n#[derive(Debug, Clone, PartialOrd, PartialEq, Ord, Eq)]\npub enum ContractId {\n    LocalContract(ContractName),\n    ForkedContract(ClassHash),\n}\n\n#[derive(Debug, Clone)]\npub struct SingleTestGasInfo {\n    pub gas_used: GasVector,\n    pub report_data: Option<ReportData>,\n}\n\n#[derive(Debug, Clone, Default)]\npub struct ReportData(BTreeMap<ContractId, ContractInfo>);\n\n#[derive(Debug, Clone, Default)]\npub struct ContractInfo {\n    pub(super) gas_used: GasVector,\n    pub(super) functions: BTreeMap<Selector, SelectorReportData>,\n}\n\n#[derive(Debug, Clone, Default)]\npub struct SelectorReportData {\n    pub(super) gas_stats: GasStats,\n    pub(super) n_calls: u64,\n    pub(super) records: Vec<u64>,\n}\n\nimpl SingleTestGasInfo {\n    #[must_use]\n    pub(crate) fn new(gas_used: GasVector) -> Self {\n        Self {\n            gas_used,\n            report_data: None,\n        }\n    }\n\n    pub(crate) fn get_with_report_data(\n        self,\n        trace: &CallTrace,\n        contracts_data: &ContractsDataStore,\n    ) -> Self {\n        let mut report_data = ReportData::default();\n        let mut stack = trace.nested_calls.clone();\n\n        while let Some(call_trace_node) = stack.pop() {\n            if let CallTraceNode::EntryPointCall(call) = call_trace_node {\n                let call = call.borrow();\n\n                // Class hash should be `None` only in case of a mock call.\n                // Otherwise, it is set in `execute_call_entry_point`.\n                if let Some(class_hash) = call.entry_point.class_hash {\n                    let contract_id = get_contract_id(contracts_data, class_hash);\n                    let selector =\n                        get_selector(contracts_data, call.entry_point.entry_point_selector);\n                    let gas = call\n                        .gas_report_data\n                        .as_ref()\n                        .expect(\"Gas report data must be updated after test execution\")\n                        .get_gas();\n\n                    report_data.update_entry(contract_id, selector, gas);\n                    stack.extend(call.nested_calls.clone());\n                }\n            }\n        }\n        report_data.finalize();\n\n        Self {\n            gas_used: self.gas_used,\n            report_data: Some(report_data),\n        }\n    }\n}\n\nimpl ReportData {\n    fn update_entry(&mut self, contract_id: ContractId, selector: Selector, gas_used: GasVector) {\n        let contract_info = self.0.entry(contract_id).or_default();\n\n        let current_gas = contract_info.gas_used;\n        contract_info.gas_used = current_gas.checked_add(gas_used).unwrap_or_else(|| {\n            panic!(\"Gas addition overflow when adding {gas_used:?} to {current_gas:?}.\")\n        });\n\n        let entry = contract_info.functions.entry(selector).or_default();\n        entry.records.push(gas_used.l2_gas.0);\n        entry.n_calls += 1;\n    }\n\n    fn finalize(&mut self) {\n        for contract_info in self.0.values_mut() {\n            for gas_info in contract_info.functions.values_mut() {\n                gas_info.gas_stats = GasStats::new(&gas_info.records);\n            }\n        }\n    }\n}\n\nimpl Display for ReportData {\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        if self.0.is_empty() {\n            writeln!(\n                f,\n                \"\\nNo contract gas usage data to display, no contract calls made.\"\n            )?;\n        }\n\n        for (name, contract_info) in &self.0 {\n            let table = format_table_output(contract_info, name);\n            writeln!(f, \"\\n{table}\")?;\n        }\n        Ok(())\n    }\n}\n\nimpl Display for ContractId {\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        let name = match self {\n            ContractId::LocalContract(name) => format!(\"{name} Contract\"),\n            ContractId::ForkedContract(class_hash) => {\n                format!(\n                    \"forked contract\\n(class hash: {})\",\n                    shorten_felt(class_hash.0)\n                )\n            }\n        };\n        write!(f, \"{name}\")\n    }\n}\n\nfn get_contract_id(contracts_data: &ContractsDataStore, class_hash: ClassHash) -> ContractId {\n    match contracts_data.get_contract_name(&class_hash) {\n        Some(name) => ContractId::LocalContract(name.0.clone()),\n        None => ContractId::ForkedContract(class_hash),\n    }\n}\n\nfn get_selector(contracts_data: &ContractsDataStore, selector: EntryPointSelector) -> Selector {\n    contracts_data\n        .get_selector(&selector)\n        .expect(\"`Selector` should be present\")\n        .0\n        .clone()\n}\n\npub fn format_table_output(contract_info: &ContractInfo, contract_id: &ContractId) -> Table {\n    let mut table = Table::new();\n    table.apply_modifier(UTF8_ROUND_CORNERS);\n\n    table.set_header(vec![Cell::new(contract_id.to_string()).fg(Color::Magenta)]);\n    table.add_row(vec![\n        Cell::new(\"Function Name\").add_attribute(Attribute::Bold),\n        Cell::new(\"Min\").add_attribute(Attribute::Bold),\n        Cell::new(\"Max\").add_attribute(Attribute::Bold),\n        Cell::new(\"Avg\").add_attribute(Attribute::Bold),\n        Cell::new(\"Std Dev\").add_attribute(Attribute::Bold),\n        Cell::new(\"# Calls\").add_attribute(Attribute::Bold),\n    ]);\n\n    contract_info\n        .functions\n        .iter()\n        .for_each(|(selector, report_data)| {\n            table.add_row(vec![\n                Cell::new(selector),\n                Cell::new(report_data.gas_stats.min.to_string()),\n                Cell::new(report_data.gas_stats.max.to_string()),\n                Cell::new(report_data.gas_stats.mean.round().to_string()),\n                Cell::new(report_data.gas_stats.std_deviation.round().to_string()),\n                Cell::new(report_data.n_calls.to_string()),\n            ]);\n        });\n\n    table\n}\n"
  },
  {
    "path": "crates/forge-runner/src/gas/resources.rs",
    "content": "use crate::forge_config::ForgeTrackedResource;\nuse blockifier::abi::constants;\nuse blockifier::execution::call_info::{EventSummary, ExtendedExecutionResources};\nuse blockifier::execution::syscalls::vm_syscall_utils::SyscallUsageMap;\nuse blockifier::fee::resources::{ArchivalDataResources, ComputationResources, MessageResources};\nuse cairo_vm::vm::runners::cairo_runner::ExecutionResources;\nuse cheatnet::runtime_extensions::call_to_blockifier_runtime_extension::rpc::UsedResources;\nuse starknet_api::execution_resources::GasAmount;\n\npub struct GasCalculationResources {\n    pub sierra_gas: GasAmount,\n    pub vm_resources: ExtendedExecutionResources,\n    pub syscalls: SyscallUsageMap,\n    pub events: EventSummary,\n    pub l2_to_l1_payload_lengths: Vec<usize>,\n    pub l1_handler_payload_lengths: Vec<usize>,\n}\n\nimpl GasCalculationResources {\n    pub fn from_used_resources(r: &UsedResources) -> Self {\n        Self {\n            sierra_gas: r.execution_summary.charged_resources.gas_consumed,\n            vm_resources: r\n                .execution_summary\n                .charged_resources\n                .extended_vm_resources\n                .clone(),\n            syscalls: r.syscall_usage.clone(),\n            events: r.execution_summary.event_summary.clone(),\n            l2_to_l1_payload_lengths: r.execution_summary.l2_to_l1_payload_lengths.clone(),\n            l1_handler_payload_lengths: r.l1_handler_payload_lengths.clone(),\n        }\n    }\n\n    pub fn to_computation_resources(&self) -> ComputationResources {\n        ComputationResources {\n            tx_extended_vm_resources: self.vm_resources.clone(),\n            // OS resources (transaction type related costs) and fee transfer resources are not included\n            // as they are not relevant for test execution (see documentation for details):\n            // https://github.com/foundry-rs/starknet-foundry/blob/979caf23c5d1085349e253d75682dd0e2527e321/docs/src/testing/gas-and-resource-estimation.md?plain=1#L75\n            os_vm_resources: ExecutionResources::default(),\n            n_reverted_steps: 0, // TODO(#3681)\n            sierra_gas: self.sierra_gas,\n            reverted_sierra_gas: GasAmount::ZERO, // TODO(#3681)\n        }\n    }\n\n    // Put together from a few blockifier functions\n    // In a transaction (blockifier), there's only one l1_handler possible so we have to calculate those costs manually\n    // (it's not the case in a scope of the test)\n    pub fn to_message_resources(&self) -> MessageResources {\n        let l2_to_l1_segment_length = self\n            .l2_to_l1_payload_lengths\n            .iter()\n            .map(|payload_length| constants::L2_TO_L1_MSG_HEADER_SIZE + payload_length)\n            .sum::<usize>();\n\n        let l1_to_l2_segment_length = self\n            .l1_handler_payload_lengths\n            .iter()\n            .map(|payload_length| constants::L1_TO_L2_MSG_HEADER_SIZE + payload_length)\n            .sum::<usize>();\n\n        let message_segment_length = l2_to_l1_segment_length + l1_to_l2_segment_length;\n\n        MessageResources {\n            l2_to_l1_payload_lengths: self.l2_to_l1_payload_lengths.clone(),\n            message_segment_length,\n            // The logic for calculating gas vector treats `l1_handler_payload_size` being `Some`\n            // as indication that L1 handler was used and adds gas cost for that.\n            //\n            // We need to set it to `None` if length is 0 to avoid including this extra cost.\n            l1_handler_payload_size: if l1_to_l2_segment_length > 0 {\n                Some(l1_to_l2_segment_length)\n            } else {\n                None\n            },\n        }\n    }\n\n    pub fn to_archival_resources(&self) -> ArchivalDataResources {\n        // extended calldata length, signature length, code size and client side proof\n        // are not included in the estimation\n        // ref: https://github.com/foundry-rs/starknet-foundry/blob/5ce15b029135545452588c00aae580c05eb11ca8/docs/src/testing/gas-and-resource-estimation.md?plain=1#L73\n        ArchivalDataResources {\n            event_summary: self.events.clone(),\n            extended_calldata_length: 0,\n            signature_length: 0,\n            code_size: 0,\n            has_client_side_proof: false,\n        }\n    }\n\n    pub fn format_for_display(&self, tracked_resource: ForgeTrackedResource) -> String {\n        // Ensure all resources used for calculation are getting displayed.\n        let Self {\n            sierra_gas,\n            vm_resources,\n            syscalls,\n            events,\n            l2_to_l1_payload_lengths,\n            l1_handler_payload_lengths,\n        } = self;\n        let syscalls = format_syscalls(syscalls);\n        let events = format_events(events);\n        let messages = format_messages(l2_to_l1_payload_lengths, l1_handler_payload_lengths);\n        let vm_resources_output = format_vm_resources(vm_resources);\n\n        match tracked_resource {\n            ForgeTrackedResource::CairoSteps => {\n                format!(\"{vm_resources_output}{syscalls}{events}{messages}\\n\")\n            }\n            ForgeTrackedResource::SierraGas => {\n                let vm_output = if *vm_resources == ExtendedExecutionResources::default() {\n                    String::new()\n                } else {\n                    vm_resources_output.clone()\n                };\n                let sierra_gas = format!(\"\\n        sierra gas: {}\", sierra_gas.0);\n                format!(\"{sierra_gas}{syscalls}{events}{messages}{vm_output}\\n\")\n            }\n        }\n    }\n}\n\nfn format_syscalls(syscalls: &SyscallUsageMap) -> String {\n    let mut syscall_usage: Vec<_> = syscalls\n        .iter()\n        .map(|(selector, usage)| (selector, usage.call_count))\n        .collect();\n    // Sort syscalls by call count\n    syscall_usage.sort_by_key(|b| std::cmp::Reverse(b.1));\n\n    let content = format_items(&syscall_usage);\n    format!(\"\\n        syscalls: ({content})\")\n}\n\nfn format_vm_resources(execution_resources: &ExtendedExecutionResources) -> String {\n    let cairo_primitives = execution_resources.prover_cairo_primitives();\n    let sorted_builtins = sort_by_value(&cairo_primitives);\n    let builtins = format_items(&sorted_builtins);\n\n    format!(\n        \"\n        steps: {}\n        memory holes: {}\n        builtins: ({})\",\n        execution_resources.vm_resources.n_steps,\n        execution_resources.vm_resources.n_memory_holes,\n        builtins\n    )\n}\n\nfn format_events(events: &EventSummary) -> String {\n    format!(\n        \"\\n        events: (count: {}, keys: {}, data size: {})\",\n        events.n_events, events.total_event_keys, events.total_event_data_size\n    )\n}\n\nfn format_messages(l2_to_l1: &[usize], l1_handler: &[usize]) -> String {\n    format!(\n        \"\\n        messages: (l2 to l1: {}, l1 handler: {})\",\n        l2_to_l1.len(),\n        l1_handler.len()\n    )\n}\n\nfn sort_by_value<'a, K, V, M>(map: M) -> Vec<(&'a K, &'a V)>\nwhere\n    M: IntoIterator<Item = (&'a K, &'a V)>,\n    V: Ord,\n{\n    let mut sorted: Vec<_> = map.into_iter().collect();\n    sorted.sort_by(|a, b| b.1.cmp(a.1));\n    sorted\n}\n\nfn format_items<K, V>(items: &[(K, V)]) -> String\nwhere\n    K: std::fmt::Debug,\n    V: std::fmt::Display,\n{\n    items\n        .iter()\n        .map(|(key, value)| format!(\"{key:?}: {value}\"))\n        .collect::<Vec<String>>()\n        .join(\", \")\n}\n"
  },
  {
    "path": "crates/forge-runner/src/gas/stats.rs",
    "content": "use num_traits::Pow;\n\n#[derive(Debug, PartialEq, Clone, Default)]\npub struct GasStats {\n    pub min: u64,\n    pub max: u64,\n    pub mean: f64,\n    pub std_deviation: f64,\n}\n\nimpl GasStats {\n    #[must_use]\n    pub fn new(gas_usages: &[u64]) -> Self {\n        let mean = mean(gas_usages);\n        Self {\n            min: *gas_usages.iter().min().unwrap(),\n            max: *gas_usages.iter().max().unwrap(),\n            mean,\n            std_deviation: std_deviation(mean, gas_usages),\n        }\n    }\n}\n\n#[expect(clippy::cast_precision_loss)]\nfn mean(values: &[u64]) -> f64 {\n    if values.is_empty() {\n        return 0.0;\n    }\n\n    let sum: f64 = values.iter().map(|&x| x as f64).sum();\n    sum / values.len() as f64\n}\n\n#[expect(clippy::cast_precision_loss)]\nfn std_deviation(mean: f64, values: &[u64]) -> f64 {\n    if values.is_empty() {\n        return 0.0;\n    }\n\n    let sum_squared_diff = values\n        .iter()\n        .map(|&x| (x as f64 - mean).pow(2))\n        .sum::<f64>();\n\n    (sum_squared_diff / values.len() as f64).sqrt()\n}\n\n#[cfg(test)]\nmod tests {\n    use super::{mean, std_deviation};\n\n    const FLOAT_ERROR: f64 = 0.01;\n\n    #[test]\n    fn test_mean_basic() {\n        let data = [1, 2, 3, 4, 5];\n        let result = mean(&data);\n        assert!((result - 3.0).abs() < FLOAT_ERROR);\n    }\n\n    #[test]\n    fn test_mean_single_element() {\n        let data = [42];\n        let result = mean(&data);\n        assert!((result - 42.0).abs() < FLOAT_ERROR);\n    }\n\n    #[test]\n    fn test_std_deviation_basic() {\n        let data = [1, 2, 3, 4, 5];\n        let mean_value = mean(&data);\n        let result = std_deviation(mean_value, &data);\n        assert!((result - 1.414).abs() < FLOAT_ERROR);\n    }\n\n    #[test]\n    fn test_std_deviation_single_element() {\n        let data = [10];\n        let mean_value = mean(&data);\n        let result = std_deviation(mean_value, &data);\n        assert!(result.abs() < FLOAT_ERROR);\n    }\n}\n"
  },
  {
    "path": "crates/forge-runner/src/gas/utils.rs",
    "content": "use starknet_types_core::felt::Felt;\n\npub(super) fn shorten_felt(felt: Felt) -> String {\n    let padded = format!(\"{felt:#066x}\");\n    let first = &padded[..6];\n    let last = &padded[padded.len() - 4..];\n    format!(\"{first}…{last}\")\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    #[test]\n    fn test_long() {\n        let felt = Felt::from_hex_unchecked(\n            \"0x01c902da594beda43db10142ecf1fc3a098b56e8d95f3cd28587a0c6ba05a451\",\n        );\n        assert_eq!(\"0x01c9…a451\", &shorten_felt(felt));\n    }\n\n    #[test]\n    fn test_short() {\n        let felt = Felt::from_hex_unchecked(\"0x123\");\n        assert_eq!(\"0x0000…0123\", &shorten_felt(felt));\n    }\n}\n"
  },
  {
    "path": "crates/forge-runner/src/gas.rs",
    "content": "use crate::gas::resources::GasCalculationResources;\nuse crate::test_case_summary::{Single, TestCaseSummary};\nuse blockifier::context::TransactionContext;\nuse blockifier::fee::resources::{StarknetResources, StateResources, TransactionResources};\nuse blockifier::state::cached_state::CachedState;\nuse blockifier::state::errors::StateError;\nuse blockifier::transaction::objects::HasRelatedFeeType;\nuse cheatnet::runtime_extensions::call_to_blockifier_runtime_extension::rpc::UsedResources;\nuse cheatnet::runtime_extensions::forge_config_extension::config::RawAvailableResourceBoundsConfig;\nuse cheatnet::state::ExtendedStateReader;\nuse starknet_api::execution_resources::GasVector;\nuse starknet_api::transaction::fields::GasVectorComputationMode;\n\npub mod report;\npub mod resources;\npub mod stats;\nmod utils;\n\n#[tracing::instrument(skip_all, level = \"debug\")]\npub fn calculate_used_gas(\n    transaction_context: &TransactionContext,\n    state: &mut CachedState<ExtendedStateReader>,\n    used_resources: &UsedResources,\n) -> Result<GasVector, StateError> {\n    let versioned_constants = transaction_context.block_context.versioned_constants();\n    let resources = GasCalculationResources::from_used_resources(used_resources);\n\n    let starknet_resources = StarknetResources {\n        archival_data: resources.to_archival_resources(),\n        messages: resources.to_message_resources(),\n        state: get_state_resources(transaction_context, state)?,\n    };\n\n    let transaction_resources = TransactionResources {\n        starknet_resources,\n        computation: resources.to_computation_resources(),\n    };\n\n    let use_kzg_da = transaction_context.block_context.block_info().use_kzg_da;\n    Ok(transaction_resources.to_gas_vector(\n        versioned_constants,\n        use_kzg_da,\n        &GasVectorComputationMode::All,\n    ))\n}\n\nfn get_state_resources(\n    transaction_context: &TransactionContext,\n    state: &mut CachedState<ExtendedStateReader>,\n) -> Result<StateResources, StateError> {\n    let mut state_changes = state.to_state_diff()?;\n    // compiled_class_hash_updates is used only for keeping track of declares\n    // which we don't want to include in gas cost\n    state_changes.state_maps.compiled_class_hashes.clear();\n    state_changes.state_maps.declared_contracts.clear();\n\n    let state_changes_count = state_changes.count_for_fee_charge(\n        None,\n        transaction_context\n            .block_context\n            .chain_info()\n            .fee_token_address(&transaction_context.tx_info.fee_type()),\n    );\n\n    Ok(StateResources {\n        state_changes_for_fee: state_changes_count,\n    })\n}\n\npub fn check_available_gas(\n    available_gas: Option<RawAvailableResourceBoundsConfig>,\n    summary: TestCaseSummary<Single>,\n) -> TestCaseSummary<Single> {\n    match summary {\n        TestCaseSummary::Passed {\n            name,\n            gas_info,\n            debugging_trace,\n            ..\n        } if available_gas.is_some_and(|available_gas| {\n            let av_gas = available_gas.to_gas_vector();\n            gas_info.gas_used.l1_gas > av_gas.l1_gas\n                || gas_info.gas_used.l1_data_gas > av_gas.l1_data_gas\n                || gas_info.gas_used.l2_gas > av_gas.l2_gas\n        }) =>\n        {\n            TestCaseSummary::Failed {\n                name,\n                msg: Some(format!(\n                    \"\\n\\tTest cost exceeded the available gas. Consumed l1_gas: ~{}, l1_data_gas: ~{}, l2_gas: ~{}\",\n                    gas_info.gas_used.l1_gas,\n                    gas_info.gas_used.l1_data_gas,\n                    gas_info.gas_used.l2_gas\n                )),\n                fuzzer_args: Vec::default(),\n                test_statistics: (),\n                debugging_trace,\n            }\n        }\n        _ => summary,\n    }\n}\n"
  },
  {
    "path": "crates/forge-runner/src/lib.rs",
    "content": "use crate::coverage_api::run_coverage;\nuse crate::forge_config::{ExecutionDataToSave, ForgeConfig};\nuse crate::running::{run_fuzz_test, run_test};\nuse crate::test_case_summary::TestCaseSummary;\nuse anyhow::{Result, bail};\nuse build_trace_data::save_trace_data;\nuse cairo_lang_sierra::program::{ConcreteTypeLongId, Function, TypeDeclaration};\nuse camino::Utf8PathBuf;\nuse cheatnet::runtime_extensions::forge_config_extension::config::RawFuzzerConfig;\nuse foundry_ui::UI;\nuse foundry_ui::components::warning::WarningMessage;\nuse futures::StreamExt;\nuse futures::stream::FuturesUnordered;\nuse package_tests::with_config_resolved::TestCaseWithResolvedConfig;\nuse profiler_api::run_profiler;\nuse rand::SeedableRng;\nuse rand::prelude::StdRng;\nuse shared::spinner::Spinner;\nuse std::collections::HashMap;\nuse std::path::PathBuf;\nuse std::sync::{Arc, Mutex};\nuse test_case_summary::{AnyTestCaseSummary, Fuzzing};\nuse tokio::sync::mpsc::{Sender, channel};\nuse tokio::task::JoinHandle;\nuse universal_sierra_compiler_api::representation::RawCasmProgram;\n\npub mod backtrace;\npub mod build_trace_data;\npub mod coverage_api;\npub mod debugging;\npub mod expected_result;\npub mod filtering;\npub mod forge_config;\nmod gas;\npub mod messages;\npub mod package_tests;\npub mod partition;\npub mod profiler_api;\npub mod running;\npub mod scarb;\npub mod test_case_summary;\npub mod test_target_summary;\npub mod tests_summary;\n\npub const CACHE_DIR: &str = \".snfoundry_cache\";\n\nconst BUILTINS: [&str; 11] = [\n    \"Pedersen\",\n    \"RangeCheck\",\n    \"Bitwise\",\n    \"EcOp\",\n    \"Poseidon\",\n    \"SegmentArena\",\n    \"GasBuiltin\",\n    \"System\",\n    \"RangeCheck96\",\n    \"AddMod\",\n    \"MulMod\",\n];\n\npub fn maybe_save_trace_and_profile(\n    result: &AnyTestCaseSummary,\n    execution_data_to_save: &ExecutionDataToSave,\n) -> Result<Option<PathBuf>> {\n    if let AnyTestCaseSummary::Single(TestCaseSummary::Passed {\n        name, trace_data, ..\n    }) = result\n        && execution_data_to_save.is_vm_trace_needed()\n    {\n        let name = sanitize_filename::sanitize(name.replace(\"::\", \"_\"));\n        let trace_path = save_trace_data(&name, trace_data)?;\n        if execution_data_to_save.profile {\n            // TODO(#3395): Use Ui spinner\n            let _spinner = Spinner::create_with_message(\"Running cairo-profiler\");\n            run_profiler(&name, &trace_path, &execution_data_to_save.additional_args)?;\n        }\n        return Ok(Some(trace_path));\n    }\n    Ok(None)\n}\n\npub fn maybe_generate_coverage(\n    execution_data_to_save: &ExecutionDataToSave,\n    saved_trace_data_paths: &[PathBuf],\n    ui: &UI,\n) -> Result<()> {\n    if execution_data_to_save.coverage {\n        if saved_trace_data_paths.is_empty() {\n            ui.println(&WarningMessage::new(\n                \"No trace data to generate coverage from\",\n            ));\n        } else {\n            // TODO(#3395): Use Ui spinner\n            let _spinner = Spinner::create_with_message(\"Running cairo-coverage\");\n            run_coverage(\n                saved_trace_data_paths,\n                &execution_data_to_save.additional_args,\n            )?;\n        }\n    }\n    Ok(())\n}\n\n#[must_use]\n#[tracing::instrument(skip_all, level = \"debug\")]\npub fn run_for_test_case(\n    case: Arc<TestCaseWithResolvedConfig>,\n    casm_program: Arc<RawCasmProgram>,\n    forge_config: Arc<ForgeConfig>,\n    versioned_program_path: Arc<Utf8PathBuf>,\n    send: Sender<()>,\n) -> JoinHandle<Result<AnyTestCaseSummary>> {\n    if case.config.fuzzer_config.is_none() {\n        tokio::task::spawn(async move {\n            let res = run_test(\n                case,\n                casm_program,\n                forge_config,\n                versioned_program_path,\n                send,\n            )\n            .await?;\n            Ok(AnyTestCaseSummary::Single(res))\n        })\n    } else {\n        tokio::task::spawn(async move {\n            if forge_config.test_runner_config.launch_debugger {\n                bail!(\"--launch-debugger is not supported for fuzzer tests\");\n            }\n            let res = run_with_fuzzing(\n                case,\n                casm_program,\n                forge_config.clone(),\n                versioned_program_path,\n                send,\n            )\n            .await??;\n            Ok(AnyTestCaseSummary::Fuzzing(res))\n        })\n    }\n}\n\n#[tracing::instrument(skip_all, level = \"debug\")]\nfn run_with_fuzzing(\n    case: Arc<TestCaseWithResolvedConfig>,\n    casm_program: Arc<RawCasmProgram>,\n    forge_config: Arc<ForgeConfig>,\n    versioned_program_path: Arc<Utf8PathBuf>,\n    send: Sender<()>,\n) -> JoinHandle<Result<TestCaseSummary<Fuzzing>>> {\n    tokio::task::spawn(async move {\n        let test_runner_config = &forge_config.test_runner_config;\n        if send.is_closed() {\n            return Ok(TestCaseSummary::Interrupted {});\n        }\n\n        let (fuzzing_send, mut fuzzing_rec) = channel(1);\n\n        let (fuzzer_runs, fuzzer_seed) = match case.config.fuzzer_config {\n            Some(RawFuzzerConfig { runs, seed }) => (\n                runs.unwrap_or(test_runner_config.fuzzer_runs),\n                seed.unwrap_or(test_runner_config.fuzzer_seed),\n            ),\n            _ => (\n                test_runner_config.fuzzer_runs,\n                test_runner_config.fuzzer_seed,\n            ),\n        };\n\n        let rng = Arc::new(Mutex::new(StdRng::seed_from_u64(fuzzer_seed)));\n\n        let mut tasks = FuturesUnordered::new();\n\n        let program = case.try_into_program(&casm_program)?;\n\n        for _ in 1..=fuzzer_runs.get() {\n            tasks.push(run_fuzz_test(\n                case.clone(),\n                program.clone(),\n                casm_program.clone(),\n                forge_config.clone(),\n                versioned_program_path.clone(),\n                send.clone(),\n                fuzzing_send.clone(),\n                rng.clone(),\n            ));\n        }\n\n        let mut results = vec![];\n        while let Some(task) = tasks.next().await {\n            let result = task?;\n\n            results.push(result.clone());\n\n            if let TestCaseSummary::Failed { .. } = result {\n                fuzzing_rec.close();\n                break;\n            }\n        }\n\n        let runs = u32::try_from(\n            results\n                .iter()\n                .filter(|item| {\n                    matches!(\n                        item,\n                        TestCaseSummary::Passed { .. } | TestCaseSummary::Failed { .. }\n                    )\n                })\n                .count(),\n        )?;\n\n        let fuzzing_run_summary: TestCaseSummary<Fuzzing> = TestCaseSummary::from(results);\n\n        if let TestCaseSummary::Passed { .. } = fuzzing_run_summary {\n            // Because we execute tests parallel, it's possible to\n            // get Passed after Skipped. To treat fuzzing a test as Passed\n            // we have to ensure that all fuzzing subtests Passed\n            if runs != fuzzer_runs.get() {\n                return Ok(TestCaseSummary::Interrupted {});\n            }\n        }\n\n        Ok(fuzzing_run_summary)\n    })\n}\n\n#[expect(clippy::implicit_hasher)]\n#[must_use]\npub fn function_args(\n    function: &Function,\n    type_declarations: &HashMap<u64, &TypeDeclaration>,\n) -> Vec<ConcreteTypeLongId> {\n    function\n        .signature\n        .param_types\n        .iter()\n        .filter_map(|pt| match type_declarations.get(&pt.id) {\n            Some(ty_declaration)\n                if !BUILTINS.contains(&ty_declaration.long_id.generic_id.0.as_str()) =>\n            {\n                Some(ty_declaration.long_id.clone())\n            }\n            _ => None,\n        })\n        .collect()\n}\n"
  },
  {
    "path": "crates/forge-runner/src/messages.rs",
    "content": "use crate::forge_config::ForgeTrackedResource;\nuse crate::gas::resources::GasCalculationResources;\nuse crate::test_case_summary::{AnyTestCaseSummary, FuzzingStatistics, TestCaseSummary};\nuse cheatnet::runtime_extensions::call_to_blockifier_runtime_extension::rpc::UsedResources;\nuse console::style;\nuse foundry_ui::Message;\nuse serde::Serialize;\nuse serde_json::{Value, json};\n\n#[derive(Serialize)]\nenum TestResultStatus {\n    Passed,\n    Failed,\n    Ignored,\n    Interrupted,\n    ExcludedFromPartition,\n}\n\nimpl From<&AnyTestCaseSummary> for TestResultStatus {\n    fn from(test_result: &AnyTestCaseSummary) -> Self {\n        match test_result {\n            AnyTestCaseSummary::Single(TestCaseSummary::Passed { .. })\n            | AnyTestCaseSummary::Fuzzing(TestCaseSummary::Passed { .. }) => Self::Passed,\n            AnyTestCaseSummary::Single(TestCaseSummary::Failed { .. })\n            | AnyTestCaseSummary::Fuzzing(TestCaseSummary::Failed { .. }) => Self::Failed,\n            AnyTestCaseSummary::Single(TestCaseSummary::Ignored { .. })\n            | AnyTestCaseSummary::Fuzzing(TestCaseSummary::Ignored { .. }) => Self::Ignored,\n            AnyTestCaseSummary::Single(TestCaseSummary::Interrupted { .. })\n            | AnyTestCaseSummary::Fuzzing(TestCaseSummary::Interrupted { .. }) => Self::Interrupted,\n            AnyTestCaseSummary::Single(TestCaseSummary::ExcludedFromPartition { .. })\n            | AnyTestCaseSummary::Fuzzing(TestCaseSummary::ExcludedFromPartition { .. }) => {\n                Self::ExcludedFromPartition\n            }\n        }\n    }\n}\n\n#[derive(Serialize)]\npub struct TestResultMessage {\n    status: TestResultStatus,\n    name: String,\n    msg: Option<String>,\n    debugging_trace: String,\n    fuzzer_report: String,\n    gas_usage: String,\n    used_resources: String,\n    gas_report: String,\n}\n\nimpl TestResultMessage {\n    pub fn new(\n        test_result: &AnyTestCaseSummary,\n        show_detailed_resources: bool,\n        tracked_resource: ForgeTrackedResource,\n    ) -> Self {\n        let name = test_result\n            .name()\n            .expect(\"Test result must have a name\")\n            .to_string();\n\n        let debugging_trace = test_result\n            .debugging_trace()\n            .map(|trace| format!(\"\\n{trace}\"))\n            .unwrap_or_default();\n\n        let fuzzer_report = if let AnyTestCaseSummary::Fuzzing(test_result) = test_result {\n            match test_result {\n                TestCaseSummary::Passed {\n                    test_statistics: FuzzingStatistics { runs },\n                    gas_info,\n                    ..\n                } => format!(\" (runs: {runs}, {gas_info})\"),\n                TestCaseSummary::Failed {\n                    fuzzer_args,\n                    test_statistics: FuzzingStatistics { runs },\n                    ..\n                } => format!(\" (runs: {runs}, arguments: {fuzzer_args:?})\"),\n                _ => String::new(),\n            }\n        } else {\n            String::new()\n        };\n\n        let (gas_usage, gas_report) = match test_result {\n            AnyTestCaseSummary::Single(TestCaseSummary::Passed { gas_info, .. }) => {\n                let gas_report = gas_info\n                    .report_data\n                    .as_ref()\n                    .map(std::string::ToString::to_string)\n                    .unwrap_or_default();\n\n                (\n                    format!(\n                        \" (l1_gas: ~{}, l1_data_gas: ~{}, l2_gas: ~{})\",\n                        gas_info.gas_used.l1_gas,\n                        gas_info.gas_used.l1_data_gas,\n                        gas_info.gas_used.l2_gas\n                    ),\n                    gas_report,\n                )\n            }\n            _ => (String::new(), String::new()),\n        };\n\n        let used_resources = match (show_detailed_resources, &test_result) {\n            (true, AnyTestCaseSummary::Single(TestCaseSummary::Passed { used_resources, .. })) => {\n                format_detailed_resources(used_resources, tracked_resource)\n            }\n            _ => String::new(),\n        };\n\n        let msg = test_result.msg().map(std::string::ToString::to_string);\n        let status = TestResultStatus::from(test_result);\n        Self {\n            status,\n            name,\n            msg,\n            debugging_trace,\n            fuzzer_report,\n            gas_usage,\n            used_resources,\n            gas_report,\n        }\n    }\n\n    fn result_message(&self) -> String {\n        if let Some(msg) = &self.msg {\n            match self.status {\n                TestResultStatus::Passed => return format!(\"\\n\\n{msg}\"),\n                TestResultStatus::Failed => return format!(\"\\n\\nFailure data:{msg}\"),\n                TestResultStatus::Ignored\n                | TestResultStatus::Interrupted\n                | TestResultStatus::ExcludedFromPartition => return String::new(),\n            }\n        }\n        String::new()\n    }\n\n    fn result_header(&self) -> String {\n        match self.status {\n            TestResultStatus::Passed => format!(\"[{}]\", style(\"PASS\").green()),\n            TestResultStatus::Failed => format!(\"[{}]\", style(\"FAIL\").red()),\n            TestResultStatus::Ignored => format!(\"[{}]\", style(\"IGNORE\").yellow()),\n            TestResultStatus::Interrupted => {\n                unreachable!(\"Interrupted tests should not have visible message representation\")\n            }\n            TestResultStatus::ExcludedFromPartition => {\n                unreachable!(\n                    \"Tests excluded from partition should not have visible message representation\"\n                )\n            }\n        }\n    }\n}\n\nimpl Message for TestResultMessage {\n    fn text(&self) -> String {\n        let result_name = &self.name;\n        let result_header = self.result_header();\n\n        let result_msg = self.result_message();\n        let result_debug_trace = &self.debugging_trace;\n\n        let fuzzer_report = &self.fuzzer_report;\n        let gas_usage = &self.gas_usage;\n        let gas_report = &self.gas_report;\n        let used_resources = &self.used_resources;\n\n        format!(\n            \"{result_header} {result_name}{fuzzer_report}{gas_usage}{used_resources}{result_msg}{result_debug_trace}{gas_report}\"\n        )\n    }\n\n    fn json(&self) -> Value {\n        json!(self)\n    }\n}\n\nfn format_detailed_resources(\n    used_resources: &UsedResources,\n    tracked_resource: ForgeTrackedResource,\n) -> String {\n    GasCalculationResources::from_used_resources(used_resources)\n        .format_for_display(tracked_resource)\n}\n"
  },
  {
    "path": "crates/forge-runner/src/package_tests/raw.rs",
    "content": "use super::TestTargetLocation;\nuse cairo_lang_sierra::program::ProgramArtifact;\nuse camino::Utf8PathBuf;\n\n/// these structs are representation of scarb output for `scarb build --test`\n/// produced by scarb\npub struct TestTargetRaw {\n    pub sierra_program: ProgramArtifact,\n    pub sierra_program_path: Utf8PathBuf,\n    pub tests_location: TestTargetLocation,\n}\n"
  },
  {
    "path": "crates/forge-runner/src/package_tests/with_config.rs",
    "content": "use super::{TestCase, TestTarget};\nuse crate::{\n    expected_result::{ExpectedPanicValue, ExpectedTestResult},\n    filtering::TestCaseIsIgnored,\n};\nuse cheatnet::runtime_extensions::forge_config_extension::config::{\n    Expected, RawAvailableResourceBoundsConfig, RawForgeConfig, RawForkConfig, RawFuzzerConfig,\n    RawShouldPanicConfig,\n};\nuse conversions::serde::serialize::SerializeToFeltVec;\n\npub type TestTargetWithConfig = TestTarget<TestCaseConfig>;\n\npub type TestCaseWithConfig = TestCase<TestCaseConfig>;\n\n/// Test case with config that has not yet been resolved\n/// see [`super::with_config_resolved::TestCaseResolvedConfig`] for more info\n#[derive(Debug, Clone)]\npub struct TestCaseConfig {\n    pub available_gas: Option<RawAvailableResourceBoundsConfig>,\n    pub ignored: bool,\n    pub expected_result: ExpectedTestResult,\n    pub fork_config: Option<RawForkConfig>,\n    pub fuzzer_config: Option<RawFuzzerConfig>,\n    pub disable_predeployed_contracts: bool,\n}\n\nimpl TestCaseIsIgnored for TestCaseConfig {\n    fn is_ignored(&self) -> bool {\n        self.ignored\n    }\n}\n\nimpl From<RawForgeConfig> for TestCaseConfig {\n    fn from(value: RawForgeConfig) -> Self {\n        Self {\n            available_gas: value.available_gas,\n            ignored: value.ignore.is_some_and(|v| v.is_ignored),\n            expected_result: value.should_panic.into(),\n            fork_config: value.fork,\n            fuzzer_config: value.fuzzer,\n            disable_predeployed_contracts: value\n                .disable_predeployed_contracts\n                .is_some_and(|v| v.is_disabled),\n        }\n    }\n}\n\nimpl From<Option<RawShouldPanicConfig>> for ExpectedTestResult {\n    fn from(value: Option<RawShouldPanicConfig>) -> Self {\n        match value {\n            None => Self::Success,\n            Some(RawShouldPanicConfig { expected }) => Self::Panics(match expected {\n                Expected::Any => ExpectedPanicValue::Any,\n                Expected::Array(arr) => ExpectedPanicValue::Exact(arr),\n                Expected::ByteArray(arr) => ExpectedPanicValue::Exact(arr.serialize_with_magic()),\n                Expected::ShortString(str) => ExpectedPanicValue::Exact(str.serialize_to_vec()),\n            }),\n        }\n    }\n}\n"
  },
  {
    "path": "crates/forge-runner/src/package_tests/with_config_resolved.rs",
    "content": "use super::{TestCase, TestTarget};\nuse crate::{\n    expected_result::ExpectedTestResult, filtering::TestCaseIsIgnored, package_tests::TestDetails,\n};\nuse anyhow::Result;\nuse cairo_vm::types::program::Program;\nuse cheatnet::runtime_extensions::forge_config_extension::config::{\n    RawAvailableResourceBoundsConfig, RawFuzzerConfig,\n};\nuse starknet_api::block::BlockNumber;\nuse universal_sierra_compiler_api::representation::RawCasmProgram;\nuse url::Url;\n\npub type TestTargetWithResolvedConfig = TestTarget<TestCaseResolvedConfig>;\n\npub type TestCaseWithResolvedConfig = TestCase<TestCaseResolvedConfig>;\n\n#[must_use]\npub fn sanitize_test_case_name(name: &str) -> String {\n    // Test names generated by `#[test]` and `#[fuzzer]` macros contain internal suffixes\n    name.replace(\"__snforge_internal_test_generated\", \"\")\n        .replace(\"__snforge_internal_fuzzer_generated\", \"\")\n}\n\nimpl TestCaseWithResolvedConfig {\n    #[must_use]\n    pub fn new(name: &str, test_details: TestDetails, config: TestCaseResolvedConfig) -> Self {\n        Self {\n            name: sanitize_test_case_name(name),\n            test_details,\n            config,\n        }\n    }\n\n    pub fn try_into_program(&self, casm_program: &RawCasmProgram) -> Result<Program> {\n        self.test_details.try_into_program(casm_program)\n    }\n}\n\n#[derive(Debug, Clone, PartialEq)]\npub struct ResolvedForkConfig {\n    pub url: Url,\n    pub block_number: BlockNumber,\n}\n\n/// Test case with config that has been resolved, that is\n///     `#[fork(\"name\")]` -> url and block id\n///     fetches block number\n#[derive(Debug, Clone, PartialEq)]\npub struct TestCaseResolvedConfig {\n    pub available_gas: Option<RawAvailableResourceBoundsConfig>,\n    pub ignored: bool,\n    pub expected_result: ExpectedTestResult,\n    pub fork_config: Option<ResolvedForkConfig>,\n    pub fuzzer_config: Option<RawFuzzerConfig>,\n    pub disable_predeployed_contracts: bool,\n}\n\nimpl TestCaseIsIgnored for TestCaseResolvedConfig {\n    fn is_ignored(&self) -> bool {\n        self.ignored\n    }\n}\n"
  },
  {
    "path": "crates/forge-runner/src/package_tests.rs",
    "content": "use crate::running::hints_to_params;\nuse anyhow::Result;\nuse cairo_lang_sierra::extensions::NamedType;\nuse cairo_lang_sierra::extensions::bitwise::BitwiseType;\nuse cairo_lang_sierra::extensions::circuit::{AddModType, MulModType};\nuse cairo_lang_sierra::extensions::ec::EcOpType;\nuse cairo_lang_sierra::extensions::pedersen::PedersenType;\nuse cairo_lang_sierra::extensions::poseidon::PoseidonType;\nuse cairo_lang_sierra::extensions::range_check::{RangeCheck96Type, RangeCheckType};\nuse cairo_lang_sierra::extensions::segment_arena::SegmentArenaType;\nuse cairo_lang_sierra::ids::GenericTypeId;\nuse cairo_lang_sierra::program::ProgramArtifact;\nuse cairo_vm::serde::deserialize_program::ReferenceManager;\nuse cairo_vm::types::builtin_name::BuiltinName;\nuse cairo_vm::types::program::Program;\nuse cairo_vm::types::relocatable::MaybeRelocatable;\nuse camino::Utf8PathBuf;\nuse serde::Serialize;\nuse starknet_types_core::felt::Felt;\nuse std::collections::HashMap;\nuse std::sync::Arc;\nuse universal_sierra_compiler_api::representation::RawCasmProgram;\n\npub mod raw;\npub mod with_config;\npub mod with_config_resolved;\n\n// If modifying this, make sure that the order of builtins matches that from\n// `#[implicit_precedence(...)` in generated test code.\nconst BUILTIN_ORDER: [(BuiltinName, GenericTypeId); 9] = [\n    (BuiltinName::pedersen, PedersenType::ID),\n    (BuiltinName::range_check, RangeCheckType::ID),\n    (BuiltinName::bitwise, BitwiseType::ID),\n    (BuiltinName::ec_op, EcOpType::ID),\n    (BuiltinName::poseidon, PoseidonType::ID),\n    (BuiltinName::segment_arena, SegmentArenaType::ID),\n    (BuiltinName::range_check96, RangeCheck96Type::ID),\n    (BuiltinName::add_mod, AddModType::ID),\n    (BuiltinName::mul_mod, MulModType::ID),\n];\n\n#[derive(Debug, PartialEq, Clone, Copy, Hash, Eq, Serialize, PartialOrd, Ord)]\npub enum TestTargetLocation {\n    /// Main crate in a package\n    Lib,\n    /// Crate in the `tests/` directory\n    Tests,\n}\n\n#[derive(Debug, PartialEq, Clone, Default)]\npub struct TestDetails {\n    pub sierra_entry_point_statement_idx: usize,\n    pub parameter_types: Vec<GenericTypeId>,\n}\n\nimpl TestDetails {\n    #[must_use]\n    pub fn builtins(&self) -> Vec<BuiltinName> {\n        let mut builtins = vec![];\n        for (builtin_name, builtin_ty) in BUILTIN_ORDER {\n            if self.parameter_types.iter().any(|ty| ty == &builtin_ty) {\n                builtins.push(builtin_name);\n            }\n        }\n        builtins\n    }\n\n    pub fn try_into_program(&self, casm_program: &RawCasmProgram) -> Result<Program> {\n        let builtins = self.builtins();\n\n        let assembled_program = &casm_program.assembled_cairo_program;\n        let hints_dict = hints_to_params(assembled_program);\n        let data: Vec<MaybeRelocatable> = assembled_program\n            .bytecode\n            .iter()\n            .map(Felt::from)\n            .map(MaybeRelocatable::from)\n            .collect();\n\n        Program::new(\n            builtins.clone(),\n            data,\n            Some(0),\n            hints_dict,\n            ReferenceManager {\n                references: Vec::new(),\n            },\n            HashMap::new(),\n            vec![],\n            None,\n        )\n        .map_err(std::convert::Into::into)\n    }\n}\n\n#[derive(Debug, Clone)]\npub struct TestTarget<C> {\n    pub tests_location: TestTargetLocation,\n    pub sierra_program: ProgramArtifact,\n    pub sierra_program_path: Arc<Utf8PathBuf>,\n    pub casm_program: Arc<RawCasmProgram>,\n    pub test_cases: Vec<TestCase<C>>,\n}\n\n#[derive(Debug, Clone, PartialEq)]\npub struct TestCase<C> {\n    pub test_details: TestDetails,\n    pub name: String,\n    pub config: C,\n}\n"
  },
  {
    "path": "crates/forge-runner/src/partition.rs",
    "content": "use std::collections::HashMap;\nuse std::num::NonZeroUsize;\nuse std::str::FromStr;\nuse std::sync::Arc;\n\nuse crate::package_tests::raw::TestTargetRaw;\nuse crate::package_tests::with_config_resolved::sanitize_test_case_name;\nuse crate::scarb::load_test_artifacts;\nuse anyhow::{Result, anyhow};\nuse camino::Utf8Path;\nuse rayon::iter::{IntoParallelRefIterator, ParallelIterator};\nuse scarb_api::metadata::PackageMetadata;\nuse serde::Serialize;\n\n/// Enum representing configuration for partitioning test cases.\n/// Used only when `--partition` flag is provided.\n/// If `Disabled`, partitioning is disabled.\n/// If `Enabled`, contains the partition information and map of test case names and their partition numbers.\n#[derive(Debug, PartialEq, Clone, Default)]\npub enum PartitionConfig {\n    #[default]\n    Disabled,\n    Enabled {\n        partition: Partition,\n        partition_map: Arc<PartitionMap>,\n    },\n}\n\nimpl PartitionConfig {\n    pub fn new(\n        partition: Partition,\n        packages: &[PackageMetadata],\n        artifacts_dir: &Utf8Path,\n    ) -> Result<Self> {\n        let partition_map = PartitionMap::build(packages, artifacts_dir, partition.total)?;\n\n        Ok(Self::Enabled {\n            partition,\n            partition_map: Arc::new(partition_map),\n        })\n    }\n}\n\n/// Represents a specific partition in a partitioned test run.\n#[derive(Debug, Clone, Copy, Serialize, PartialEq, Eq)]\npub struct Partition {\n    /// The 1-based index of the partition to run.\n    index: NonZeroUsize,\n    /// The total number of partitions in the run.\n    total: NonZeroUsize,\n}\n\nimpl Partition {\n    #[must_use]\n    pub fn index(&self) -> NonZeroUsize {\n        self.index\n    }\n\n    #[must_use]\n    pub fn total(&self) -> NonZeroUsize {\n        self.total\n    }\n}\n\nimpl FromStr for Partition {\n    type Err = String;\n\n    fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {\n        let (index_str, total_str) = s\n            .split_once('/')\n            .ok_or_else(|| \"Partition must be in the format <INDEX>/<TOTAL>\".to_string())?;\n\n        if total_str.contains('/') {\n            return Err(\"Partition must be in the format <INDEX>/<TOTAL>\".to_string());\n        }\n\n        let index = index_str\n            .parse::<NonZeroUsize>()\n            .map_err(|_| \"INDEX must be a positive integer\".to_string())?;\n        let total = total_str\n            .parse::<NonZeroUsize>()\n            .map_err(|_| \"TOTAL must be a positive integer\".to_string())?;\n\n        if index > total {\n            return Err(\"Invalid partition values: ensure 1 <= INDEX <= TOTAL\".to_string());\n        }\n\n        Ok(Partition { index, total })\n    }\n}\n\n/// Map containing test full paths and their assigned partition numbers.\n#[derive(Serialize, Debug, PartialEq)]\npub struct PartitionMap(HashMap<String, NonZeroUsize>);\n\nimpl PartitionMap {\n    /// Builds a partition map from the provided packages and artifacts directory.\n    /// Test full paths are sorted to ensure consistent assignment across runs.\n    /// Each test case is assigned to a partition with round-robin.\n    pub fn build(\n        packages: &[PackageMetadata],\n        artifacts_dir: &Utf8Path,\n        total_partitions: NonZeroUsize,\n    ) -> Result<Self> {\n        let mut test_full_paths: Vec<String> = packages\n            .iter()\n            .map(|package| -> Result<Vec<String>> {\n                let raw_test_targets = load_test_artifacts(artifacts_dir, package)?;\n\n                let full_paths: Vec<String> = raw_test_targets\n                    .iter()\n                    .map(collect_test_full_paths)\n                    .collect::<Result<Vec<Vec<String>>>>()?\n                    .into_iter()\n                    .flatten()\n                    .collect();\n\n                Ok(full_paths)\n            })\n            .collect::<Result<Vec<Vec<String>>>>()?\n            .into_iter()\n            .flatten()\n            .collect();\n\n        test_full_paths.sort();\n\n        let mut partition_map = HashMap::with_capacity(test_full_paths.len());\n\n        for (i, test_full_path) in test_full_paths.iter().enumerate() {\n            let sanitized_full_path = sanitize_test_case_name(test_full_path);\n            let partition_index_1_based = (i % total_partitions) + 1;\n            let partition_index_1_based = NonZeroUsize::try_from(partition_index_1_based)?;\n            if partition_map\n                .insert(sanitized_full_path, partition_index_1_based)\n                .is_some()\n            {\n                unreachable!(\"Test case full path should be unique\");\n            }\n        }\n\n        Ok(Self(partition_map))\n    }\n\n    #[must_use]\n    pub fn get_assigned_index(&self, test_full_path: &str) -> Option<NonZeroUsize> {\n        self.0.get(test_full_path).copied()\n    }\n\n    /// Counts the number of included tests for a given partition based on the partition map.\n    #[must_use]\n    pub fn included_tests_count(&self, run_partition: NonZeroUsize) -> usize {\n        self.0\n            .values()\n            .filter(|assigned_partition| **assigned_partition == run_partition)\n            .count()\n    }\n\n    /// Counts the total number of tests assigned to any partition in the partition map.\n    #[must_use]\n    pub fn total_tests_count(&self) -> usize {\n        self.0.len()\n    }\n}\n\n/// Collects test full paths from a raw test target.\nfn collect_test_full_paths(test_target_raw: &TestTargetRaw) -> Result<Vec<String>> {\n    let executables = test_target_raw\n        .sierra_program\n        .debug_info\n        .as_ref()\n        .and_then(|info| info.executables.get(\"snforge_internal_test_executable\"))\n        .map(Vec::as_slice)\n        .unwrap_or_default();\n    executables\n        .par_iter()\n        .map(|case| {\n            case.debug_name\n                .clone()\n                .map(Into::into)\n                .ok_or_else(|| anyhow!(\"Missing debug name for test executable entry\"))\n        })\n        .collect()\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use test_case::test_case;\n\n    #[test_case(\"1/1\", 1, 1)]\n    #[test_case(\"2/5\", 2, 5)]\n    fn test_happy_case(partition: &str, expected_index: usize, expected_total: usize) {\n        let partition = partition.parse::<Partition>().unwrap();\n        assert_eq!(\n            partition.index,\n            NonZeroUsize::try_from(expected_index).unwrap()\n        );\n        assert_eq!(\n            partition.total,\n            NonZeroUsize::try_from(expected_total).unwrap()\n        );\n    }\n\n    #[test_case(\"1-2\"; \"using hyphen instead of slash\")]\n    #[test_case(\"1/2/3\"; \"too many parts\")]\n    #[test_case(\"12\"; \"no separator\")]\n    fn test_invalid_format(partition: &str) {\n        let err = partition.parse::<Partition>().unwrap_err();\n        assert_eq!(err, \"Partition must be in the format <INDEX>/<TOTAL>\");\n    }\n\n    #[test_case(\"-1/5\", \"INDEX\")]\n    #[test_case(\"2/-5\", \"TOTAL\")]\n    #[test_case(\"a/5\", \"INDEX\")]\n    #[test_case(\"2/b\", \"TOTAL\")]\n    fn test_invalid_integer(partition: &str, invalid_part: &str) {\n        let err = partition.parse::<Partition>().unwrap_err();\n        assert_eq!(err, format!(\"{invalid_part} must be a positive integer\"));\n    }\n\n    #[test_case(\"0/5\")]\n    #[test_case(\"6/5\")]\n    #[test_case(\"2/0\")]\n    fn test_out_of_bounds(partition: &str) {\n        assert!(partition.parse::<Partition>().is_err());\n    }\n}\n"
  },
  {
    "path": "crates/forge-runner/src/printing.rs",
    "content": ""
  },
  {
    "path": "crates/forge-runner/src/profiler_api.rs",
    "content": "use anyhow::{Context, Result};\nuse shared::command::CommandExt;\nuse std::ffi::OsString;\nuse std::process::Stdio;\nuse std::{env, fs, path::PathBuf, process::Command};\n\npub const PROFILE_DIR: &str = \"profile\";\n\npub fn run_profiler(\n    test_name: &str,\n    trace_path: &PathBuf,\n    profiler_args: &[OsString],\n) -> Result<()> {\n    let profiler = env::var(\"CAIRO_PROFILER\")\n        .map(PathBuf::from)\n        .ok()\n        .unwrap_or_else(|| PathBuf::from(\"cairo-profiler\"));\n\n    let mut command = Command::new(profiler);\n\n    if profiler_args.iter().all(|arg| arg != \"--output-path\") {\n        let dir_to_save_profile = PathBuf::from(PROFILE_DIR);\n        fs::create_dir_all(&dir_to_save_profile).context(\"Failed to create a profile dir\")?;\n        let path_to_save_profile = dir_to_save_profile.join(format!(\"{test_name}.pb.gz\"));\n\n        command.arg(\"--output-path\").arg(&path_to_save_profile);\n    }\n\n    command\n        .arg(trace_path)\n        .args(profiler_args)\n        .stdout(Stdio::inherit())\n        .stderr(Stdio::inherit())\n        .output_checked()\n        .with_context(||format!(\"cairo-profiler failed to generate the profile for test {test_name} - inspect the errors above for more info\"))?;\n\n    Ok(())\n}\n"
  },
  {
    "path": "crates/forge-runner/src/running/config_run.rs",
    "content": "use super::hints::hints_by_representation;\nuse crate::running::execution::finalize_execution;\nuse crate::running::setup::{\n    VmExecutionContext, build_test_call_and_entry_point, entry_point_initial_budget,\n    initialize_execution_context,\n};\nuse crate::{forge_config::ForgeTrackedResource, package_tests::TestDetails};\nuse anyhow::Result;\nuse blockifier::execution::contract_class::TrackedResource;\nuse blockifier::execution::entry_point_execution::{prepare_call_arguments, run_entry_point};\nuse blockifier::state::{cached_state::CachedState, state_api::StateReader};\nuse cheatnet::runtime_extensions::forge_config_extension::{\n    ForgeConfigExtension, config::RawForgeConfig,\n};\nuse runtime::{ExtendedRuntime, StarknetRuntime, starknet::context::build_context};\nuse starknet_api::block::{\n    BlockInfo, BlockNumber, BlockTimestamp, GasPrice, GasPriceVector, GasPrices, NonzeroGasPrice,\n    StarknetVersion,\n};\nuse starknet_types_core::felt::Felt;\nuse std::default::Default;\nuse universal_sierra_compiler_api::representation::RawCasmProgram;\n\nstruct PhantomStateReader;\n\nimpl StateReader for PhantomStateReader {\n    fn get_storage_at(\n        &self,\n        _contract_address: starknet_api::core::ContractAddress,\n        _key: starknet_api::state::StorageKey,\n    ) -> blockifier::state::state_api::StateResult<Felt> {\n        unreachable!()\n    }\n    fn get_nonce_at(\n        &self,\n        _contract_address: starknet_api::core::ContractAddress,\n    ) -> blockifier::state::state_api::StateResult<starknet_api::core::Nonce> {\n        unreachable!()\n    }\n    fn get_class_hash_at(\n        &self,\n        _contract_address: starknet_api::core::ContractAddress,\n    ) -> blockifier::state::state_api::StateResult<starknet_api::core::ClassHash> {\n        unreachable!()\n    }\n    fn get_compiled_class(\n        &self,\n        _class_hash: starknet_api::core::ClassHash,\n    ) -> blockifier::state::state_api::StateResult<\n        blockifier::execution::contract_class::RunnableCompiledClass,\n    > {\n        unreachable!()\n    }\n    fn get_compiled_class_hash(\n        &self,\n        _class_hash: starknet_api::core::ClassHash,\n    ) -> blockifier::state::state_api::StateResult<starknet_api::core::CompiledClassHash> {\n        unreachable!()\n    }\n}\n\n#[tracing::instrument(skip_all, level = \"debug\")]\npub fn run_config_pass(\n    test_details: &TestDetails,\n    casm_program: &RawCasmProgram,\n    tracked_resource: &ForgeTrackedResource,\n) -> Result<RawForgeConfig> {\n    let program = test_details.try_into_program(casm_program)?;\n    let (call, entry_point) = build_test_call_and_entry_point(test_details, casm_program, &program);\n\n    let mut cached_state = CachedState::new(PhantomStateReader);\n    let gas_price_vector = GasPriceVector {\n        l1_gas_price: NonzeroGasPrice::new(GasPrice(2))?,\n        l1_data_gas_price: NonzeroGasPrice::new(GasPrice(2))?,\n        l2_gas_price: NonzeroGasPrice::new(GasPrice(2))?,\n    };\n\n    let block_info = BlockInfo {\n        block_number: BlockNumber(0),\n        block_timestamp: BlockTimestamp(0),\n        gas_prices: GasPrices {\n            eth_gas_prices: gas_price_vector.clone(),\n            strk_gas_prices: gas_price_vector,\n        },\n        sequencer_address: 0_u8.into(),\n        use_kzg_da: true,\n        starknet_version: StarknetVersion::LATEST,\n    };\n    let mut context = build_context(&block_info, None, &TrackedResource::from(tracked_resource));\n\n    let hints = hints_by_representation(&casm_program.assembled_cairo_program);\n    let VmExecutionContext {\n        mut runner,\n        syscall_handler,\n        initial_syscall_ptr,\n        program_extra_data_length,\n    } = initialize_execution_context(\n        call.clone(),\n        &hints,\n        &program,\n        &mut cached_state,\n        &mut context,\n    )?;\n\n    let mut config = RawForgeConfig::default();\n\n    let mut forge_config_runtime = ExtendedRuntime {\n        extension: ForgeConfigExtension {\n            config: &mut config,\n        },\n        extended_runtime: StarknetRuntime {\n            hint_handler: syscall_handler,\n            panic_traceback: None,\n        },\n    };\n\n    let tracked_resource = TrackedResource::from(tracked_resource);\n    let entry_point_initial_budget =\n        entry_point_initial_budget(&forge_config_runtime.extended_runtime.hint_handler);\n    let args = prepare_call_arguments(\n        &forge_config_runtime.extended_runtime.hint_handler.base.call,\n        &mut runner,\n        initial_syscall_ptr,\n        &mut forge_config_runtime\n            .extended_runtime\n            .hint_handler\n            .read_only_segments,\n        &entry_point,\n        entry_point_initial_budget,\n    )?;\n    let n_total_args = args.len();\n\n    let bytecode_length = program.data_len();\n    let program_segment_size = bytecode_length + program_extra_data_length;\n\n    run_entry_point(\n        &mut runner,\n        &mut forge_config_runtime,\n        entry_point,\n        args,\n        program_segment_size,\n    )?;\n\n    finalize_execution(\n        &mut runner,\n        &mut forge_config_runtime.extended_runtime.hint_handler,\n        n_total_args,\n        program_extra_data_length,\n        tracked_resource,\n    )?;\n\n    Ok(config)\n}\n"
  },
  {
    "path": "crates/forge-runner/src/running/execution.rs",
    "content": "use blockifier::execution::call_info::{CallExecution, CallInfo, ExtendedExecutionResources};\nuse blockifier::execution::contract_class::TrackedResource;\nuse blockifier::execution::entry_point_execution::{\n    extract_extended_vm_resources, finalize_runner, get_call_result, total_vm_resources,\n};\nuse blockifier::execution::errors::PostExecutionError;\nuse blockifier::execution::syscalls::hint_processor::SyscallHintProcessor;\nuse cairo_vm::vm::runners::cairo_runner::CairoRunner;\n\n// Based on the code from blockifer\n#[tracing::instrument(skip_all, level = \"debug\")]\npub fn finalize_execution(\n    // region: Modified blockifier code\n    runner: &mut CairoRunner,\n    syscall_handler: &mut SyscallHintProcessor<'_>,\n    // endregion\n    n_total_args: usize,\n    program_extra_data_length: usize,\n    tracked_resource: TrackedResource,\n) -> Result<CallInfo, PostExecutionError> {\n    finalize_runner(runner, n_total_args, program_extra_data_length)?;\n    syscall_handler\n        .read_only_segments\n        .mark_as_accessed(runner)?;\n\n    let call_result = get_call_result(runner, syscall_handler, &tracked_resource)?;\n\n    // Take into account the resources of the current call, without inner calls.\n    // Has to happen after marking holes in segments as accessed.\n    let extended_resources_without_inner_calls =\n        extract_extended_vm_resources(runner, syscall_handler)?;\n\n    let tracked_vm_resources_without_inner_calls = match tracked_resource {\n        TrackedResource::CairoSteps => &extended_resources_without_inner_calls,\n        TrackedResource::SierraGas => &ExtendedExecutionResources::default(),\n    };\n\n    syscall_handler.finalize();\n\n    let vm_resources = total_vm_resources(\n        tracked_vm_resources_without_inner_calls,\n        &syscall_handler.base.inner_calls,\n    );\n\n    let syscall_handler_base = &syscall_handler.base;\n    // region: Modified blockifier code - added clones due to different function signature\n    Ok(CallInfo {\n        call: syscall_handler_base.call.clone().into(),\n        execution: CallExecution {\n            retdata: call_result.retdata,\n            events: syscall_handler_base.events.clone(),\n            l2_to_l1_messages: syscall_handler_base.l2_to_l1_messages.clone(),\n            cairo_native: false,\n            failed: call_result.failed,\n            gas_consumed: call_result.gas_consumed,\n        },\n        inner_calls: syscall_handler_base.inner_calls.clone(),\n        tracked_resource,\n        resources: vm_resources,\n        storage_access_tracker: syscall_handler_base.storage_access_tracker.clone(),\n        builtin_counters: extended_resources_without_inner_calls.prover_cairo_primitives(),\n        syscalls_usage: syscall_handler_base.syscalls_usage.clone(),\n    })\n    // endregion\n}\n"
  },
  {
    "path": "crates/forge-runner/src/running/hints.rs",
    "content": "use cairo_lang_casm::hints::Hint;\nuse cairo_vm::serde::deserialize_program::{ApTracking, FlowTrackingData, HintParams};\nuse std::collections::HashMap;\nuse universal_sierra_compiler_api::representation::AssembledCairoProgram;\n\npub fn hints_by_representation(assembled_program: &AssembledCairoProgram) -> HashMap<String, Hint> {\n    assembled_program\n        .hints\n        .iter()\n        .flat_map(|(_, hints)| hints.iter().cloned())\n        .map(|hint| (hint.representing_string(), hint))\n        .collect()\n}\n\n#[must_use]\npub fn hints_to_params(\n    assembled_program: &AssembledCairoProgram,\n) -> HashMap<usize, Vec<HintParams>> {\n    assembled_program\n        .hints\n        .iter()\n        .map(|(offset, hints)| {\n            (\n                *offset,\n                hints\n                    .iter()\n                    .map(|hint| HintParams {\n                        code: hint.representing_string(),\n                        accessible_scopes: vec![],\n                        flow_tracking_data: FlowTrackingData {\n                            ap_tracking: ApTracking::new(),\n                            reference_ids: HashMap::new(),\n                        },\n                    })\n                    .collect::<Vec<HintParams>>(),\n            )\n        })\n        .collect()\n}\n"
  },
  {
    "path": "crates/forge-runner/src/running/setup.rs",
    "content": "use crate::package_tests::TestDetails;\nuse blockifier::execution::contract_class::EntryPointV1;\nuse blockifier::execution::entry_point::{EntryPointExecutionContext, ExecutableCallEntryPoint};\nuse blockifier::execution::entry_point_execution::prepare_program_extra_data;\nuse blockifier::execution::errors::PreExecutionError;\nuse blockifier::execution::execution_utils::ReadOnlySegments;\nuse blockifier::execution::syscalls::hint_processor::SyscallHintProcessor;\nuse blockifier::state::state_api::State;\nuse cairo_lang_casm::hints::Hint;\nuse cairo_vm::types::builtin_name::BuiltinName;\nuse cairo_vm::types::layout_name::LayoutName;\nuse cairo_vm::types::program::Program;\nuse cairo_vm::types::relocatable::Relocatable;\nuse cairo_vm::vm::runners::cairo_runner::CairoRunner;\nuse cheatnet::constants::build_test_entry_point;\nuse starknet_api::deprecated_contract_class::EntryPointOffset;\nuse std::collections::HashMap;\nuse universal_sierra_compiler_api::representation::RawCasmProgram;\n\n// Based on structure from https://github.com/starkware-libs/sequencer/blob/e417a9e7d50cbd78065d357763df2fbc2ad41f7c/crates/blockifier/src/execution/entry_point_execution.rs#L39\n// Logic of `initialize_execution_context` had to be modified so this struct ended up modified as well.\n// Probably won't be possible to upstream it.\npub struct VmExecutionContext<'a> {\n    pub runner: CairoRunner,\n    pub syscall_handler: SyscallHintProcessor<'a>,\n    pub initial_syscall_ptr: Relocatable,\n    // Additional data required for execution is appended after the program bytecode.\n    pub program_extra_data_length: usize,\n}\n\n// Based on code from https://github.com/starkware-libs/sequencer/blob/e417a9e7d50cbd78065d357763df2fbc2ad41f7c/crates/blockifier/src/execution/entry_point_execution.rs#L122\n// Enough of the logic of this had to be changed that probably it won't be possible to upstream it\n#[tracing::instrument(skip_all, level = \"debug\")]\npub fn initialize_execution_context<'a>(\n    call: ExecutableCallEntryPoint,\n    hints: &'a HashMap<String, Hint>,\n    program: &Program,\n    state: &'a mut dyn State,\n    context: &'a mut EntryPointExecutionContext,\n) -> Result<VmExecutionContext<'a>, PreExecutionError> {\n    // Instantiate Cairo runner.\n    let proof_mode = false;\n    let trace_enabled = true;\n    let dynamic_layout_params = None;\n    let disable_trace_padding = false;\n    let mut runner = CairoRunner::new(\n        program,\n        LayoutName::all_cairo,\n        dynamic_layout_params,\n        proof_mode,\n        trace_enabled,\n        disable_trace_padding,\n    )?;\n\n    runner.initialize_function_runner_cairo_1(&builtins_from_program(program))?;\n    let mut read_only_segments = ReadOnlySegments::default();\n    let program_extra_data_length = prepare_program_extra_data(\n        &mut runner,\n        program.data_len(),\n        &mut read_only_segments,\n        &context.versioned_constants().os_constants.gas_costs,\n    )?;\n\n    // Instantiate syscall handler.\n    let initial_syscall_ptr = runner.vm.add_memory_segment();\n    let syscall_handler = SyscallHintProcessor::new(\n        state,\n        context,\n        initial_syscall_ptr,\n        call,\n        hints,\n        read_only_segments,\n    );\n\n    Ok(VmExecutionContext {\n        runner,\n        syscall_handler,\n        initial_syscall_ptr,\n        program_extra_data_length,\n    })\n}\n\n// Builtins field is private in program, so we need this workaround\nfn builtins_from_program(program: &Program) -> Vec<BuiltinName> {\n    program.iter_builtins().copied().collect::<Vec<_>>()\n}\n\npub fn entry_point_initial_budget(syscall_hint_processor: &SyscallHintProcessor) -> u64 {\n    syscall_hint_processor\n        .base\n        .context\n        .gas_costs()\n        .base\n        .entry_point_initial_budget\n}\n\npub fn build_test_call_and_entry_point(\n    test_details: &TestDetails,\n    casm_program: &RawCasmProgram,\n    program: &Program,\n) -> (ExecutableCallEntryPoint, EntryPointV1) {\n    let sierra_instruction_idx = test_details.sierra_entry_point_statement_idx;\n    let casm_entry_point_offset = casm_program.debug_info[sierra_instruction_idx].0;\n\n    let call = build_test_entry_point();\n    let entry_point = EntryPointV1 {\n        selector: call.entry_point_selector,\n        offset: EntryPointOffset(casm_entry_point_offset),\n        builtins: builtins_from_program(program),\n    };\n    (call, entry_point)\n}\n"
  },
  {
    "path": "crates/forge-runner/src/running/syscall_handler.rs",
    "content": "use cairo_lang_sierra::extensions::NoGenericArgsGenericType;\nuse cairo_lang_sierra::{extensions::segment_arena::SegmentArenaType, ids::GenericTypeId};\n\n#[must_use]\npub fn has_segment_arena(test_param_types: &[(GenericTypeId, i16)]) -> bool {\n    test_param_types\n        .iter()\n        .any(|(ty, _)| ty == &SegmentArenaType::ID)\n}\n\n#[must_use]\npub fn syscall_handler_offset(builtins_len: usize, has_segment_arena: bool) -> usize {\n    // * Segment arena is allocated conditionally, so segment index is automatically moved (+2 segments)\n    // * Each used builtin moves the offset by +1\n    // * Line `let mut builtin_offset = 3;` in `create_entry_code_from_params`\n    // * TODO(#2967) Where is remaining +2 in base offset coming from? Maybe System builtin and Gas builtin which seem to be always included\n    let base_offset = 5;\n    if has_segment_arena {\n        base_offset + builtins_len + 2\n    } else {\n        base_offset + builtins_len\n    }\n}\n"
  },
  {
    "path": "crates/forge-runner/src/running/target.rs",
    "content": "use crate::{\n    forge_config::ForgeTrackedResource,\n    package_tests::{\n        TestDetails,\n        raw::TestTargetRaw,\n        with_config::{TestCaseWithConfig, TestTargetWithConfig},\n    },\n    running::config_run::run_config_pass,\n};\nuse anyhow::Result;\nuse cairo_lang_sierra::{\n    ids::ConcreteTypeId,\n    program::{GenFunction, StatementIdx, TypeDeclaration},\n};\nuse rayon::iter::IntoParallelRefIterator;\nuse rayon::iter::ParallelIterator;\nuse std::{collections::HashMap, sync::Arc};\nuse universal_sierra_compiler_api::compile_raw_sierra_at_path;\n\n#[tracing::instrument(skip_all, level = \"debug\")]\npub fn prepare_test_target(\n    test_target_raw: TestTargetRaw,\n    tracked_resource: &ForgeTrackedResource,\n) -> Result<TestTargetWithConfig> {\n    macro_rules! by_id {\n        ($field:ident) => {{\n            let temp: HashMap<_, _> = test_target_raw\n                .sierra_program\n                .program\n                .$field\n                .iter()\n                .map(|f| (f.id.id, f))\n                .collect();\n\n            temp\n        }};\n    }\n    let funcs = by_id!(funcs);\n    let type_declarations = by_id!(type_declarations);\n\n    let casm_program = Arc::new(compile_raw_sierra_at_path(\n        test_target_raw.sierra_program_path.as_std_path(),\n    )?);\n\n    let default_executables = vec![];\n    let executables = test_target_raw\n        .sierra_program\n        .debug_info\n        .as_ref()\n        .and_then(|info| info.executables.get(\"snforge_internal_test_executable\"))\n        .unwrap_or(&default_executables);\n\n    let test_cases = executables\n        .par_iter()\n        .map(|case| -> Result<TestCaseWithConfig> {\n            let func = funcs[&case.id];\n\n            let test_details = build_test_details(func, &type_declarations);\n\n            let raw_config = run_config_pass(&test_details, &casm_program, tracked_resource)?;\n\n            Ok(TestCaseWithConfig {\n                config: raw_config.into(),\n                name: case.debug_name.clone().unwrap().into(),\n                test_details,\n            })\n        })\n        .collect::<Result<_>>()?;\n\n    Ok(TestTargetWithConfig {\n        tests_location: test_target_raw.tests_location,\n        test_cases,\n        sierra_program: test_target_raw.sierra_program,\n        sierra_program_path: test_target_raw.sierra_program_path.into(),\n        casm_program,\n    })\n}\n\n#[tracing::instrument(skip_all, level = \"debug\")]\nfn build_test_details(\n    func: &GenFunction<StatementIdx>,\n    type_declarations: &HashMap<u64, &TypeDeclaration>,\n) -> TestDetails {\n    let map_types = |concrete_types: &[ConcreteTypeId]| {\n        concrete_types\n            .iter()\n            .map(|ty| {\n                let ty = type_declarations[&ty.id];\n                ty.long_id.generic_id.clone()\n            })\n            .collect()\n    };\n\n    TestDetails {\n        sierra_entry_point_statement_idx: func.entry_point.0,\n        parameter_types: map_types(&func.signature.param_types),\n    }\n}\n"
  },
  {
    "path": "crates/forge-runner/src/running.rs",
    "content": "use crate::backtrace::add_backtrace_footer;\nuse crate::forge_config::{ForgeConfig, RuntimeConfig};\nuse crate::gas::calculate_used_gas;\nuse crate::package_tests::with_config_resolved::{ResolvedForkConfig, TestCaseWithResolvedConfig};\nuse crate::test_case_summary::{Single, TestCaseSummary};\nuse anyhow::{Result, bail};\nuse blockifier::execution::call_info::CallInfo;\nuse blockifier::execution::contract_class::TrackedResource;\nuse blockifier::execution::entry_point::EntryPointExecutionContext;\nuse blockifier::execution::entry_point_execution::{\n    extract_extended_vm_resources, prepare_call_arguments, run_entry_point,\n};\nuse blockifier::execution::errors::EntryPointExecutionError;\nuse blockifier::state::cached_state::CachedState;\nuse cairo_vm::Felt252;\nuse cairo_vm::types::program::Program;\nuse cairo_vm::vm::errors::cairo_run_errors::CairoRunError;\nuse cairo_vm::vm::errors::vm_errors::VirtualMachineError;\nuse camino::{Utf8Path, Utf8PathBuf};\nuse cheatnet::constants as cheatnet_constants;\nuse cheatnet::forking::data::ForkData;\nuse cheatnet::forking::state::ForkStateReader;\nuse cheatnet::runtime_extensions::call_to_blockifier_runtime_extension::CallToBlockifierExtension;\nuse cheatnet::runtime_extensions::call_to_blockifier_runtime_extension::rpc::UsedResources;\nuse cheatnet::runtime_extensions::cheatable_starknet_runtime_extension::CheatableStarknetRuntimeExtension;\nuse cheatnet::runtime_extensions::forge_runtime_extension::{\n    ForgeExtension, ForgeRuntime, add_resources_to_top_call, compute_and_store_execution_summary,\n    get_all_used_resources, update_top_call_l1_resources, update_top_call_resources,\n    update_top_call_vm_trace,\n};\nuse cheatnet::state::{BlockInfoReader, CheatnetState, EncounteredErrors, ExtendedStateReader};\nuse cheatnet::trace_data::CallTrace;\nuse execution::finalize_execution;\nuse hints::hints_by_representation;\nuse rand::prelude::StdRng;\nuse runtime::starknet::context::{build_context, set_max_steps};\nuse runtime::{ExtendedRuntime, StarknetRuntime};\nuse scarb_oracle_hint_service::OracleHintService;\nuse starknet_api::execution_resources::GasVector;\nuse std::cell::RefCell;\nuse std::default::Default;\nuse std::marker::PhantomData;\nuse std::rc::Rc;\nuse std::sync::{Arc, Mutex};\nuse tokio::sync::mpsc::Sender;\nuse tokio::task::JoinHandle;\nuse universal_sierra_compiler_api::representation::RawCasmProgram;\n\nuse cairo_debugger::CairoDebugger;\n\npub mod config_run;\nmod execution;\nmod hints;\nmod setup;\nmod syscall_handler;\npub mod target;\n\nuse crate::debugging::build_debugging_trace;\npub use hints::hints_to_params;\nuse setup::VmExecutionContext;\npub use syscall_handler::has_segment_arena;\npub use syscall_handler::syscall_handler_offset;\n\n#[must_use]\n#[tracing::instrument(skip_all, level = \"debug\")]\npub fn run_test(\n    case: Arc<TestCaseWithResolvedConfig>,\n    casm_program: Arc<RawCasmProgram>,\n    forge_config: Arc<ForgeConfig>,\n    versioned_program_path: Arc<Utf8PathBuf>,\n    send: Sender<()>,\n) -> JoinHandle<TestCaseSummary<Single>> {\n    tokio::task::spawn_blocking(move || {\n        // Due to the inability of spawn_blocking to be abruptly cancelled,\n        // a channel is used to receive information indicating\n        // that the execution of the task is no longer necessary.\n        if send.is_closed() {\n            return TestCaseSummary::Interrupted {};\n        }\n\n        let run_result = case.try_into_program(&casm_program).and_then(|program| {\n            run_test_case(\n                &case,\n                &program,\n                &casm_program,\n                &RuntimeConfig::from(&forge_config.test_runner_config),\n                None,\n                &versioned_program_path,\n            )\n        });\n\n        if send.is_closed() {\n            return TestCaseSummary::Interrupted {};\n        }\n\n        extract_test_case_summary(run_result, &case, &forge_config, &versioned_program_path)\n    })\n}\n\n#[tracing::instrument(skip_all, level = \"debug\")]\n#[allow(clippy::too_many_arguments)]\npub(crate) fn run_fuzz_test(\n    case: Arc<TestCaseWithResolvedConfig>,\n    program: Program,\n    casm_program: Arc<RawCasmProgram>,\n    forge_config: Arc<ForgeConfig>,\n    versioned_program_path: Arc<Utf8PathBuf>,\n    send: Sender<()>,\n    fuzzing_send: Sender<()>,\n    rng: Arc<Mutex<StdRng>>,\n) -> JoinHandle<TestCaseSummary<Single>> {\n    tokio::task::spawn_blocking(move || {\n        // Due to the inability of spawn_blocking to be abruptly cancelled,\n        // a channel is used to receive information indicating\n        // that the execution of the task is no longer necessary.\n        if send.is_closed() | fuzzing_send.is_closed() {\n            return TestCaseSummary::Interrupted {};\n        }\n        let run_result = run_test_case(\n            &case,\n            &program,\n            &casm_program,\n            &RuntimeConfig::from(&forge_config.test_runner_config),\n            Some(rng),\n            &versioned_program_path,\n        );\n\n        // TODO: code below is added to fix snforge tests\n        // remove it after improve exit-first tests\n        // issue #1043\n        if send.is_closed() {\n            return TestCaseSummary::Interrupted {};\n        }\n\n        extract_test_case_summary(run_result, &case, &forge_config, &versioned_program_path)\n    })\n}\n\npub enum RunStatus {\n    Success(Vec<Felt252>),\n    Panic(Vec<Felt252>),\n}\n\npub struct RunCompleted {\n    pub(crate) status: RunStatus,\n    pub(crate) call_trace: Rc<RefCell<CallTrace>>,\n    pub(crate) gas_used: GasVector,\n    pub(crate) used_resources: UsedResources,\n    pub(crate) encountered_errors: EncounteredErrors,\n    pub(crate) fuzzer_args: Vec<String>,\n    pub(crate) fork_data: ForkData,\n}\n\npub struct RunError {\n    pub(crate) error: Box<CairoRunError>,\n    pub(crate) call_trace: Rc<RefCell<CallTrace>>,\n    pub(crate) encountered_errors: EncounteredErrors,\n    pub(crate) fuzzer_args: Vec<String>,\n    pub(crate) fork_data: ForkData,\n}\n\npub enum RunResult {\n    Completed(Box<RunCompleted>),\n    Error(RunError),\n}\n\n#[expect(clippy::too_many_lines)]\n#[tracing::instrument(skip_all, level = \"debug\")]\npub fn run_test_case(\n    case: &TestCaseWithResolvedConfig,\n    program: &Program,\n    casm_program: &RawCasmProgram,\n    runtime_config: &RuntimeConfig,\n    fuzzer_rng: Option<Arc<Mutex<StdRng>>>,\n    versioned_program_path: &Utf8Path,\n) -> Result<RunResult> {\n    let (call, entry_point) =\n        setup::build_test_call_and_entry_point(&case.test_details, casm_program, program);\n\n    let debugger = runtime_config\n        .launch_debugger\n        .then(|| CairoDebugger::connect_and_initialize(versioned_program_path.as_std_path()))\n        .transpose()?;\n\n    let mut state_reader = ExtendedStateReader {\n        dict_state_reader: cheatnet_constants::build_testing_state(),\n        fork_state_reader: get_fork_state_reader(\n            runtime_config.cache_dir,\n            case.config.fork_config.as_ref(),\n        )?,\n    };\n\n    if !case.config.disable_predeployed_contracts {\n        state_reader.predeploy_contracts();\n    }\n\n    let block_info = state_reader.get_block_info()?;\n    let chain_id = state_reader.get_chain_id()?;\n    let tracked_resource = TrackedResource::from(runtime_config.tracked_resource);\n    let mut context = build_context(&block_info, chain_id, &tracked_resource);\n\n    if let Some(max_n_steps) = runtime_config.max_n_steps {\n        set_max_steps(&mut context, max_n_steps);\n    }\n    let mut cached_state = CachedState::new(state_reader);\n\n    let hints = hints_by_representation(&casm_program.assembled_cairo_program);\n    let VmExecutionContext {\n        mut runner,\n        syscall_handler,\n        initial_syscall_ptr,\n        program_extra_data_length,\n    } = setup::initialize_execution_context(\n        call.clone(),\n        &hints,\n        program,\n        &mut cached_state,\n        &mut context,\n    )?;\n\n    if let Some(debugger) = debugger {\n        runner.set_vm_hooks(Box::new(debugger));\n    }\n\n    let mut cheatnet_state = CheatnetState {\n        block_info,\n        ..Default::default()\n    };\n    cheatnet_state.trace_data.is_vm_trace_needed = runtime_config.is_vm_trace_needed;\n\n    let cheatable_runtime = ExtendedRuntime {\n        extension: CheatableStarknetRuntimeExtension {\n            cheatnet_state: &mut cheatnet_state,\n        },\n        extended_runtime: StarknetRuntime {\n            hint_handler: syscall_handler,\n            panic_traceback: None,\n        },\n    };\n\n    let call_to_blockifier_runtime = ExtendedRuntime {\n        extension: CallToBlockifierExtension {\n            lifetime: &PhantomData,\n        },\n        extended_runtime: cheatable_runtime,\n    };\n    let forge_extension = ForgeExtension {\n        environment_variables: runtime_config.environment_variables,\n        contracts_data: runtime_config.contracts_data,\n        fuzzer_rng,\n        oracle_hint_service: OracleHintService::new(Some(versioned_program_path.as_std_path())),\n    };\n\n    let mut forge_runtime = ExtendedRuntime {\n        extension: forge_extension,\n        extended_runtime: call_to_blockifier_runtime,\n    };\n\n    let entry_point_initial_budget = setup::entry_point_initial_budget(\n        &forge_runtime\n            .extended_runtime\n            .extended_runtime\n            .extended_runtime\n            .hint_handler,\n    );\n    let args = prepare_call_arguments(\n        &forge_runtime\n            .extended_runtime\n            .extended_runtime\n            .extended_runtime\n            .hint_handler\n            .base\n            .call\n            .clone(),\n        &mut runner,\n        initial_syscall_ptr,\n        &mut forge_runtime\n            .extended_runtime\n            .extended_runtime\n            .extended_runtime\n            .hint_handler\n            .read_only_segments,\n        &entry_point,\n        entry_point_initial_budget,\n    )?;\n\n    let n_total_args = args.len();\n\n    // Execute.\n    let bytecode_length = program.data_len();\n    let program_segment_size = bytecode_length + program_extra_data_length;\n    let result: Result<CallInfo, CairoRunError> = match run_entry_point(\n        &mut runner,\n        &mut forge_runtime,\n        entry_point,\n        args,\n        program_segment_size,\n    ) {\n        Ok(()) => {\n            let call_info = finalize_execution(\n                &mut runner,\n                &mut forge_runtime\n                    .extended_runtime\n                    .extended_runtime\n                    .extended_runtime\n                    .hint_handler,\n                n_total_args,\n                program_extra_data_length,\n                tracked_resource,\n            )?;\n\n            // TODO(#3744): Confirm if this is needed for the profiler\n            let vm_resources_without_inner_calls = extract_extended_vm_resources(\n                &runner,\n                &forge_runtime\n                    .extended_runtime\n                    .extended_runtime\n                    .extended_runtime\n                    .hint_handler,\n            )?;\n\n            add_resources_to_top_call(\n                &mut forge_runtime,\n                &vm_resources_without_inner_calls,\n                &tracked_resource,\n            );\n\n            update_top_call_vm_trace(&mut forge_runtime, &mut runner);\n\n            Ok(call_info)\n        }\n        Err(error) => Err(match error {\n            EntryPointExecutionError::CairoRunError(err_box) => match *err_box {\n                CairoRunError::VmException(err) => CairoRunError::VirtualMachine(err.inner_exc),\n                other => other,\n            },\n            err => bail!(err),\n        }),\n    };\n\n    let encountered_errors = forge_runtime\n        .extended_runtime\n        .extended_runtime\n        .extension\n        .cheatnet_state\n        .encountered_errors\n        .clone();\n\n    let call_trace_ref = get_call_trace_ref(&mut forge_runtime);\n\n    update_top_call_resources(&mut forge_runtime, tracked_resource);\n    update_top_call_l1_resources(&mut forge_runtime);\n    compute_and_store_execution_summary(&call_trace_ref);\n\n    let fuzzer_args = forge_runtime\n        .extended_runtime\n        .extended_runtime\n        .extension\n        .cheatnet_state\n        .fuzzer_args\n        .clone();\n\n    let transaction_context = get_context(&forge_runtime).tx_context.clone();\n\n    let fork_data = cached_state\n        .state\n        .fork_state_reader\n        .as_ref()\n        .map(|fork_state_reader| ForkData::new(&fork_state_reader.compiled_contract_class_map()))\n        .unwrap_or_default();\n\n    Ok(match result {\n        Ok(result) => {\n            let used_resources =\n                get_all_used_resources(&result, &call_trace_ref, &transaction_context);\n            let gas_used =\n                calculate_used_gas(&transaction_context, &mut cached_state, &used_resources)?;\n\n            RunResult::Completed(Box::new(RunCompleted {\n                status: if result.execution.failed {\n                    RunStatus::Panic(result.execution.retdata.0)\n                } else {\n                    RunStatus::Success(result.execution.retdata.0)\n                },\n                call_trace: call_trace_ref,\n                gas_used,\n                used_resources,\n                encountered_errors,\n                fuzzer_args,\n                fork_data,\n            }))\n        }\n        Err(error) => RunResult::Error(RunError {\n            error: Box::new(error),\n            call_trace: call_trace_ref,\n            encountered_errors,\n            fuzzer_args,\n            fork_data,\n        }),\n    })\n}\n\nfn extract_test_case_summary(\n    run_result: Result<RunResult>,\n    case: &TestCaseWithResolvedConfig,\n    forge_config: &ForgeConfig,\n    versioned_program_path: &Utf8Path,\n) -> TestCaseSummary<Single> {\n    let contracts_data = &forge_config.test_runner_config.contracts_data;\n    let trace_args = &forge_config.output_config.trace_args;\n    match run_result {\n        Ok(run_result) => match run_result {\n            RunResult::Completed(run_completed) => TestCaseSummary::from_run_completed(\n                *run_completed,\n                case,\n                contracts_data,\n                versioned_program_path,\n                trace_args,\n                forge_config.output_config.gas_report,\n            ),\n            RunResult::Error(run_error) => {\n                let mut message = format!(\n                    \"\\n    {}\\n\",\n                    run_error\n                        .error\n                        .to_string()\n                        .replace(\" Custom Hint Error: \", \"\\n    \")\n                );\n                if let CairoRunError::VirtualMachine(VirtualMachineError::UnfinishedExecution) =\n                    *run_error.error\n                {\n                    message.push_str(\n                        \"\\n    Suggestion: Consider using the flag `--max-n-steps` to increase allowed limit of steps\",\n                    );\n                }\n                TestCaseSummary::Failed {\n                    name: case.name.clone(),\n                    msg: Some(message).map(|msg| {\n                        add_backtrace_footer(msg, contracts_data, &run_error.encountered_errors)\n                    }),\n                    fuzzer_args: run_error.fuzzer_args,\n                    test_statistics: (),\n                    debugging_trace: build_debugging_trace(\n                        &run_error.call_trace.borrow(),\n                        contracts_data,\n                        trace_args,\n                        case.name.clone(),\n                        &run_error.fork_data,\n                    ),\n                }\n            }\n        },\n        // `ForkStateReader.get_block_info`, `get_fork_state_reader, `calculate_used_gas` may return an error\n        // `available_gas` may be specified with Scarb ~2.4\n        Err(error) => TestCaseSummary::Failed {\n            name: case.name.clone(),\n            msg: Some(error.to_string()),\n            fuzzer_args: Vec::default(),\n            test_statistics: (),\n            debugging_trace: None,\n        },\n    }\n}\n\nfn get_fork_state_reader(\n    cache_dir: &Utf8Path,\n    fork_config: Option<&ResolvedForkConfig>,\n) -> Result<Option<ForkStateReader>> {\n    fork_config\n        .map(|ResolvedForkConfig { url, block_number }| {\n            ForkStateReader::new(url.clone(), *block_number, cache_dir)\n        })\n        .transpose()\n}\n\nfn get_context<'a>(runtime: &'a ForgeRuntime) -> &'a EntryPointExecutionContext {\n    runtime\n        .extended_runtime\n        .extended_runtime\n        .extended_runtime\n        .hint_handler\n        .base\n        .context\n}\n\nfn get_call_trace_ref(runtime: &mut ForgeRuntime) -> Rc<RefCell<CallTrace>> {\n    runtime\n        .extended_runtime\n        .extended_runtime\n        .extension\n        .cheatnet_state\n        .trace_data\n        .current_call_stack\n        .top()\n}\n"
  },
  {
    "path": "crates/forge-runner/src/scarb.rs",
    "content": "use anyhow::Result;\nuse cairo_lang_sierra::program::VersionedProgram;\nuse camino::Utf8Path;\nuse scarb_api::{metadata::PackageMetadata, test_targets_by_name};\nuse std::{fs, io::ErrorKind};\n\nuse crate::package_tests::{TestTargetLocation, raw::TestTargetRaw};\n\n#[tracing::instrument(skip_all, level = \"debug\")]\npub fn load_test_artifacts(\n    target_dir: &Utf8Path,\n    package: &PackageMetadata,\n) -> Result<Vec<TestTargetRaw>> {\n    let mut targets = vec![];\n\n    let dedup_targets = test_targets_by_name(package);\n\n    for (target_name, target) in dedup_targets {\n        let tests_location =\n            if target.params.get(\"test-type\").and_then(|v| v.as_str()) == Some(\"unit\") {\n                TestTargetLocation::Lib\n            } else {\n                TestTargetLocation::Tests\n            };\n\n        let target_file = format!(\"{target_name}.test.sierra.json\");\n        let sierra_program_path = target_dir.join(target_file);\n\n        match fs::read_to_string(&sierra_program_path) {\n            Ok(value) => {\n                let versioned_program = serde_json::from_str::<VersionedProgram>(&value)?;\n\n                let sierra_program = match versioned_program {\n                    VersionedProgram::V1 { program, .. } => program,\n                };\n\n                let test_target = TestTargetRaw {\n                    sierra_program,\n                    sierra_program_path,\n                    tests_location,\n                };\n\n                targets.push(test_target);\n            }\n            Err(err) if err.kind() == ErrorKind::NotFound => {}\n            Err(err) => Err(err)?,\n        }\n    }\n\n    Ok(targets)\n}\n"
  },
  {
    "path": "crates/forge-runner/src/test_case_summary.rs",
    "content": "use crate::backtrace::{add_backtrace_footer, get_backtrace, is_backtrace_enabled};\nuse crate::build_trace_data::build_profiler_call_trace;\nuse crate::debugging::{TraceArgs, build_debugging_trace};\nuse crate::expected_result::{ExpectedPanicValue, ExpectedTestResult};\nuse crate::gas::check_available_gas;\nuse crate::gas::report::SingleTestGasInfo;\nuse crate::gas::stats::GasStats;\nuse crate::package_tests::with_config_resolved::TestCaseWithResolvedConfig;\nuse crate::running::{RunCompleted, RunStatus};\nuse blockifier::execution::syscalls::hint_processor::ENTRYPOINT_FAILED_ERROR_FELT;\nuse cairo_annotations::trace_data::VersionedCallTrace as VersionedProfilerCallTrace;\nuse camino::Utf8Path;\nuse cheatnet::runtime_extensions::call_to_blockifier_runtime_extension::rpc::UsedResources;\nuse cheatnet::runtime_extensions::forge_runtime_extension::contracts_data::ContractsData;\nuse conversions::byte_array::ByteArray;\nuse conversions::felt::ToShortString;\nuse debugging::ContractsDataStore;\nuse shared::utils::build_readable_text;\nuse starknet_api::execution_resources::GasVector;\nuse starknet_types_core::felt::Felt;\nuse std::fmt;\nuse std::option::Option;\n\n#[derive(Debug, PartialEq, Clone, Default)]\npub struct GasFuzzingInfo {\n    pub l1_gas: GasStats,\n    pub l1_data_gas: GasStats,\n    pub l2_gas: GasStats,\n}\n\nimpl fmt::Display for GasFuzzingInfo {\n    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {\n        write!(\n            f,\n            \"(l1_gas: {}, l1_data_gas: {}, l2_gas: {})\",\n            self.l1_gas, self.l1_data_gas, self.l2_gas\n        )\n    }\n}\n\nimpl fmt::Display for GasStats {\n    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {\n        write!(\n            f,\n            \"{{max: ~{}, min: ~{}, mean: ~{:.0}, std deviation: ~{:.0}}}\",\n            self.max, self.min, self.mean, self.std_deviation\n        )\n    }\n}\n\nimpl GasFuzzingInfo {\n    #[must_use]\n    pub fn new(gas_usages: &[GasVector]) -> Self {\n        let l1_gas_values: Vec<u64> = gas_usages.iter().map(|gv| gv.l1_gas.0).collect();\n        let l1_data_gas_values: Vec<u64> = gas_usages.iter().map(|gv| gv.l1_data_gas.0).collect();\n        let l2_gas_values: Vec<u64> = gas_usages.iter().map(|gv| gv.l2_gas.0).collect();\n\n        GasFuzzingInfo {\n            l1_gas: { GasStats::new(l1_gas_values.as_ref()) },\n            l1_data_gas: { GasStats::new(l1_data_gas_values.as_ref()) },\n            l2_gas: { GasStats::new(l2_gas_values.as_ref()) },\n        }\n    }\n}\n\n#[derive(Debug, PartialEq, Clone)]\npub struct FuzzingStatistics {\n    pub runs: usize,\n}\n\npub trait TestType {\n    type GasInfo: fmt::Debug + Clone;\n    type TestStatistics: fmt::Debug + Clone;\n    type TraceData: fmt::Debug + Clone;\n}\n\n#[derive(Debug, PartialEq, Clone)]\npub struct Fuzzing;\nimpl TestType for Fuzzing {\n    type GasInfo = GasFuzzingInfo;\n    type TestStatistics = FuzzingStatistics;\n    type TraceData = ();\n}\n\n#[derive(Debug, PartialEq, Clone)]\npub struct Single;\nimpl TestType for Single {\n    type GasInfo = SingleTestGasInfo;\n    type TestStatistics = ();\n    type TraceData = VersionedProfilerCallTrace;\n}\n\n/// Summary of running a single test case\n#[expect(clippy::large_enum_variant)]\n#[derive(Debug, Clone)]\npub enum TestCaseSummary<T: TestType> {\n    /// Test case passed\n    Passed {\n        /// Name of the test case\n        name: String,\n        /// Message to be printed after the test case run\n        msg: Option<String>,\n        /// Trace of the test case run\n        debugging_trace: Option<debugging::Trace>,\n        /// Information on used gas\n        gas_info: <T as TestType>::GasInfo,\n        /// Resources used during test\n        used_resources: UsedResources,\n        /// Statistics of the test run\n        test_statistics: <T as TestType>::TestStatistics,\n        /// Test trace data\n        trace_data: <T as TestType>::TraceData,\n    },\n    /// Test case failed\n    Failed {\n        /// Name of the test case\n        name: String,\n        /// Message returned by the test case run\n        msg: Option<String>,\n        /// Trace of the test case run\n        debugging_trace: Option<debugging::Trace>,\n        /// Random arguments used in the fuzz test case run\n        fuzzer_args: Vec<String>,\n        /// Statistics of the test run\n        test_statistics: <T as TestType>::TestStatistics,\n    },\n    /// Test case ignored due to `#[ignored]` attribute or `--ignored` flag\n    Ignored {\n        /// Name of the test case\n        name: String,\n    },\n    /// Test case skipped due to exit first or execution interrupted, test result is ignored.\n    Interrupted {},\n    /// Test case excluded from current partition\n    ExcludedFromPartition {},\n}\n\n#[derive(Debug)]\n// We allow large enum variant because `Single` is the bigger variant and it is used most often\n#[expect(clippy::large_enum_variant)]\npub enum AnyTestCaseSummary {\n    Fuzzing(TestCaseSummary<Fuzzing>),\n    Single(TestCaseSummary<Single>),\n}\n\nimpl<T: TestType> TestCaseSummary<T> {\n    #[must_use]\n    pub fn name(&self) -> Option<&str> {\n        match self {\n            TestCaseSummary::Failed { name, .. }\n            | TestCaseSummary::Passed { name, .. }\n            | TestCaseSummary::Ignored { name, .. } => Some(name),\n            TestCaseSummary::Interrupted { .. } | TestCaseSummary::ExcludedFromPartition { .. } => {\n                None\n            }\n        }\n    }\n\n    #[must_use]\n    pub fn msg(&self) -> Option<&str> {\n        match self {\n            TestCaseSummary::Failed { msg: Some(msg), .. }\n            | TestCaseSummary::Passed { msg: Some(msg), .. } => Some(msg),\n            _ => None,\n        }\n    }\n\n    #[must_use]\n    pub fn debugging_trace(&self) -> Option<&debugging::Trace> {\n        match self {\n            TestCaseSummary::Passed {\n                debugging_trace, ..\n            }\n            | TestCaseSummary::Failed {\n                debugging_trace, ..\n            } => debugging_trace.as_ref(),\n            _ => None,\n        }\n    }\n}\n\nimpl TestCaseSummary<Fuzzing> {\n    #[must_use]\n    pub fn from(results: Vec<TestCaseSummary<Single>>) -> Self {\n        let last: TestCaseSummary<Single> = results\n            .iter()\n            .last()\n            .cloned()\n            .expect(\"Fuzz test should always run at least once\");\n        // Only the last result matters as fuzzing is cancelled after first fail\n        match last {\n            TestCaseSummary::Passed {\n                name,\n                msg,\n                gas_info: _,\n                used_resources: _,\n                test_statistics: (),\n                trace_data: _,\n                debugging_trace,\n            } => {\n                let runs = results.len();\n                let gas_usages: Vec<GasVector> = results\n                    .into_iter()\n                    .map(|a| match a {\n                        TestCaseSummary::Passed { gas_info, .. } => gas_info.gas_used,\n                        _ => unreachable!(),\n                    })\n                    .collect();\n\n                TestCaseSummary::Passed {\n                    name,\n                    msg,\n                    gas_info: GasFuzzingInfo::new(gas_usages.as_ref()),\n                    used_resources: UsedResources::default(),\n                    test_statistics: FuzzingStatistics { runs },\n                    trace_data: (),\n                    debugging_trace,\n                }\n            }\n            TestCaseSummary::Failed {\n                name,\n                msg,\n                fuzzer_args,\n                debugging_trace,\n                test_statistics: (),\n            } => TestCaseSummary::Failed {\n                name,\n                msg,\n                fuzzer_args,\n                test_statistics: FuzzingStatistics {\n                    runs: results.len(),\n                },\n                debugging_trace,\n            },\n            TestCaseSummary::Ignored { name } => TestCaseSummary::Ignored { name: name.clone() },\n            TestCaseSummary::Interrupted {} => TestCaseSummary::Interrupted {},\n            TestCaseSummary::ExcludedFromPartition {} => TestCaseSummary::ExcludedFromPartition {},\n        }\n    }\n}\n\nfn build_expected_panic_message(expected_panic_value: &ExpectedPanicValue) -> String {\n    match expected_panic_value {\n        ExpectedPanicValue::Any => \"\\n    Expected to panic, but no panic occurred\\n\".into(),\n        ExpectedPanicValue::Exact(panic_data) => {\n            let panic_string = join_short_strings(panic_data);\n\n            format!(\n                \"\\n    Expected to panic, but no panic occurred\\n    Expected panic data:  {panic_data:?} ({panic_string})\\n\"\n            )\n        }\n    }\n}\n\nfn check_if_matching_and_get_message(\n    actual_panic_value: &[Felt],\n    expected_panic_value: &ExpectedPanicValue,\n) -> (bool, Option<String>) {\n    let expected_data = match expected_panic_value {\n        ExpectedPanicValue::Exact(data) => Some(data),\n        ExpectedPanicValue::Any => None,\n    };\n\n    match expected_data {\n        Some(expected) if is_matching_should_panic_data(actual_panic_value, expected) => {\n            (true, None)\n        }\n        Some(expected) => {\n            let panic_string = convert_felts_to_byte_array_string(actual_panic_value)\n                .unwrap_or_else(|| join_short_strings(actual_panic_value));\n            let expected_string = convert_felts_to_byte_array_string(expected)\n                .unwrap_or_else(|| join_short_strings(expected));\n\n            let message = Some(format!(\n                \"\\n    Incorrect panic data\\n    {}\\n    {}\\n\",\n                format_args!(\"Actual:    {actual_panic_value:?} ({panic_string})\"),\n                format_args!(\"Expected:  {expected:?} ({expected_string})\")\n            ));\n            (false, message)\n        }\n        None => (true, None),\n    }\n}\n\nimpl TestCaseSummary<Single> {\n    #[must_use]\n    pub(crate) fn from_run_completed(\n        RunCompleted {\n            status,\n            call_trace,\n            gas_used,\n            used_resources,\n            encountered_errors,\n            fuzzer_args,\n            fork_data,\n        }: RunCompleted,\n        test_case: &TestCaseWithResolvedConfig,\n        contracts_data: &ContractsData,\n        versioned_program_path: &Utf8Path,\n        trace_args: &TraceArgs,\n        gas_report_enabled: bool,\n    ) -> Self {\n        let name = test_case.name.clone();\n\n        let debugging_trace = build_debugging_trace(\n            &call_trace.borrow(),\n            contracts_data,\n            trace_args,\n            name.clone(),\n            &fork_data,\n        );\n\n        let gas_info = SingleTestGasInfo::new(gas_used);\n        let gas_info = if gas_report_enabled {\n            gas_info.get_with_report_data(\n                &call_trace.borrow(),\n                &ContractsDataStore::new(contracts_data, &fork_data),\n            )\n        } else {\n            gas_info\n        };\n\n        match status {\n            RunStatus::Success(data) => match &test_case.config.expected_result {\n                ExpectedTestResult::Success => {\n                    let summary = TestCaseSummary::Passed {\n                        name,\n                        msg: build_readable_text(&data),\n                        test_statistics: (),\n                        gas_info,\n                        used_resources,\n                        trace_data: VersionedProfilerCallTrace::V1(build_profiler_call_trace(\n                            &call_trace,\n                            contracts_data,\n                            &fork_data,\n                            versioned_program_path,\n                        )),\n                        debugging_trace,\n                    };\n                    check_available_gas(test_case.config.available_gas, summary)\n                }\n                ExpectedTestResult::Panics(expected_panic_value) => TestCaseSummary::Failed {\n                    name,\n                    msg: Some(build_expected_panic_message(expected_panic_value)),\n                    fuzzer_args,\n                    test_statistics: (),\n                    debugging_trace,\n                },\n            },\n            RunStatus::Panic(value) => match &test_case.config.expected_result {\n                ExpectedTestResult::Success => TestCaseSummary::Failed {\n                    name,\n                    msg: build_readable_text(&value)\n                        .map(|msg| add_backtrace_footer(msg, contracts_data, &encountered_errors)),\n                    fuzzer_args,\n                    test_statistics: (),\n                    debugging_trace,\n                },\n                ExpectedTestResult::Panics(expected_panic_value) => {\n                    let (matching, msg) =\n                        check_if_matching_and_get_message(&value, expected_panic_value);\n                    if matching {\n                        TestCaseSummary::Passed {\n                            name,\n                            msg: is_backtrace_enabled()\n                                .then(|| get_backtrace(contracts_data, &encountered_errors)),\n                            test_statistics: (),\n                            gas_info,\n                            used_resources,\n                            trace_data: VersionedProfilerCallTrace::V1(build_profiler_call_trace(\n                                &call_trace,\n                                contracts_data,\n                                &fork_data,\n                                versioned_program_path,\n                            )),\n                            debugging_trace,\n                        }\n                    } else {\n                        TestCaseSummary::Failed {\n                            name,\n                            msg: msg.map(|msg| {\n                                add_backtrace_footer(msg, contracts_data, &encountered_errors)\n                            }),\n                            fuzzer_args,\n                            test_statistics: (),\n                            debugging_trace,\n                        }\n                    }\n                }\n            },\n        }\n    }\n}\n\nfn join_short_strings(data: &[Felt]) -> String {\n    data.iter()\n        .map(|felt| felt.to_short_string().unwrap_or_default())\n        .collect::<Vec<String>>()\n        .join(\", \")\n}\n\nfn is_matching_should_panic_data(data: &[Felt], pattern: &[Felt]) -> bool {\n    let data_str = convert_felts_to_byte_array_string(data);\n    let pattern_str = convert_felts_to_byte_array_string(pattern);\n\n    if let (Some(data), Some(pattern)) = (data_str, pattern_str) {\n        data.contains(&pattern) // If both data and pattern are byte arrays, pattern should be a substring of data\n    } else {\n        // Compare logic depends on the presence of `ENTRYPOINT_FAILED_ERROR` in the expected data.\n        if pattern.contains(&ENTRYPOINT_FAILED_ERROR_FELT) {\n            // If data includes `ENTRYPOINT_FAILED_ERROR` compare as is.\n            data == pattern\n        } else {\n            // Otherwise, remove all generic errors and then compare.\n            let filtered: Vec<Felt> = data\n                .iter()\n                .copied()\n                .filter(|f| f != &ENTRYPOINT_FAILED_ERROR_FELT)\n                .collect();\n            filtered.as_slice() == pattern\n        }\n    }\n}\nfn convert_felts_to_byte_array_string(data: &[Felt]) -> Option<String> {\n    ByteArray::deserialize_with_magic(data)\n        .map(|byte_array| byte_array.to_string())\n        .ok()\n}\n\nimpl AnyTestCaseSummary {\n    #[must_use]\n    pub fn name(&self) -> Option<&str> {\n        match self {\n            AnyTestCaseSummary::Fuzzing(case) => case.name(),\n            AnyTestCaseSummary::Single(case) => case.name(),\n        }\n    }\n\n    #[must_use]\n    pub fn msg(&self) -> Option<&str> {\n        match self {\n            AnyTestCaseSummary::Fuzzing(case) => case.msg(),\n            AnyTestCaseSummary::Single(case) => case.msg(),\n        }\n    }\n\n    #[must_use]\n    pub fn debugging_trace(&self) -> Option<&debugging::Trace> {\n        match self {\n            AnyTestCaseSummary::Fuzzing(case) => case.debugging_trace(),\n            AnyTestCaseSummary::Single(case) => case.debugging_trace(),\n        }\n    }\n\n    #[must_use]\n    pub fn is_passed(&self) -> bool {\n        matches!(\n            self,\n            AnyTestCaseSummary::Single(TestCaseSummary::Passed { .. })\n                | AnyTestCaseSummary::Fuzzing(TestCaseSummary::Passed { .. })\n        )\n    }\n\n    #[must_use]\n    pub fn is_failed(&self) -> bool {\n        matches!(\n            self,\n            AnyTestCaseSummary::Single(TestCaseSummary::Failed { .. })\n                | AnyTestCaseSummary::Fuzzing(TestCaseSummary::Failed { .. })\n        )\n    }\n\n    #[must_use]\n    pub fn is_interrupted(&self) -> bool {\n        matches!(\n            self,\n            AnyTestCaseSummary::Single(TestCaseSummary::Interrupted { .. })\n                | AnyTestCaseSummary::Fuzzing(TestCaseSummary::Interrupted { .. })\n        )\n    }\n\n    #[must_use]\n    pub fn is_ignored(&self) -> bool {\n        matches!(\n            self,\n            AnyTestCaseSummary::Single(TestCaseSummary::Ignored { .. })\n                | AnyTestCaseSummary::Fuzzing(TestCaseSummary::Ignored { .. })\n        )\n    }\n\n    #[must_use]\n    pub fn is_excluded_from_partition(&self) -> bool {\n        matches!(\n            self,\n            AnyTestCaseSummary::Single(TestCaseSummary::ExcludedFromPartition { .. })\n                | AnyTestCaseSummary::Fuzzing(TestCaseSummary::ExcludedFromPartition { .. })\n        )\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use crate::test_case_summary::*;\n    use starknet_api::execution_resources::{GasAmount, GasVector};\n\n    const FLOAT_ERROR: f64 = 0.01;\n\n    #[test]\n    fn test_gas_statistics_new() {\n        let gas_usages = vec![\n            GasVector {\n                l1_gas: GasAmount(10),\n                l1_data_gas: GasAmount(20),\n                l2_gas: GasAmount(30),\n            },\n            GasVector {\n                l1_gas: GasAmount(20),\n                l1_data_gas: GasAmount(40),\n                l2_gas: GasAmount(60),\n            },\n            GasVector {\n                l1_gas: GasAmount(30),\n                l1_data_gas: GasAmount(60),\n                l2_gas: GasAmount(90),\n            },\n        ];\n\n        let stats = GasFuzzingInfo::new(&gas_usages);\n\n        assert_eq!(stats.l1_gas.min, 10);\n        assert_eq!(stats.l1_data_gas.min, 20);\n        assert_eq!(stats.l2_gas.min, 30);\n\n        assert_eq!(stats.l1_gas.max, 30);\n        assert_eq!(stats.l1_data_gas.max, 60);\n        assert_eq!(stats.l2_gas.max, 90);\n\n        assert!((stats.l1_gas.mean - 20.0).abs() < FLOAT_ERROR);\n        assert!((stats.l1_data_gas.mean - 40.0).abs() < FLOAT_ERROR);\n        assert!((stats.l2_gas.mean - 60.0).abs() < FLOAT_ERROR);\n\n        assert!((stats.l1_gas.std_deviation - 8.165).abs() < FLOAT_ERROR);\n        assert!((stats.l1_data_gas.std_deviation - 16.33).abs() < FLOAT_ERROR);\n        assert!((stats.l2_gas.std_deviation - 24.49).abs() < FLOAT_ERROR);\n    }\n\n    #[test]\n    fn test_is_matching_should_panic_data_entrypoint_failed() {\n        let data = vec![\n            Felt::from(11_u8),\n            Felt::from(22_u8),\n            Felt::from(33_u8),\n            ENTRYPOINT_FAILED_ERROR_FELT,\n            ENTRYPOINT_FAILED_ERROR_FELT,\n        ];\n\n        assert!(is_matching_should_panic_data(&data, &data));\n\n        let non_matching_pattern = vec![\n            Felt::from(11_u8),\n            Felt::from(22_u8),\n            Felt::from(33_u8),\n            ENTRYPOINT_FAILED_ERROR_FELT,\n        ];\n        assert!(!is_matching_should_panic_data(&data, &non_matching_pattern));\n\n        let pattern = vec![Felt::from(11_u8), Felt::from(22_u8), Felt::from(33_u8)];\n        assert!(is_matching_should_panic_data(&data, &pattern));\n\n        let non_matching_pattern = vec![Felt::from(11_u8), Felt::from(22_u8)];\n        assert!(!is_matching_should_panic_data(&data, &non_matching_pattern));\n    }\n}\n"
  },
  {
    "path": "crates/forge-runner/src/test_target_summary.rs",
    "content": "use crate::test_case_summary::AnyTestCaseSummary;\n\n/// Summary of the test run in the file\n#[derive(Debug)]\npub struct TestTargetSummary {\n    /// Summaries of each test case in the file\n    pub test_case_summaries: Vec<AnyTestCaseSummary>,\n}\n\nimpl TestTargetSummary {\n    #[must_use]\n    pub fn count_passed(&self) -> usize {\n        self.test_case_summaries\n            .iter()\n            .filter(|tu| tu.is_passed())\n            .count()\n    }\n\n    #[must_use]\n    pub fn count_failed(&self) -> usize {\n        self.test_case_summaries\n            .iter()\n            .filter(|tu| tu.is_failed())\n            .count()\n    }\n\n    #[must_use]\n    pub fn count_interrupted(&self) -> usize {\n        self.test_case_summaries\n            .iter()\n            .filter(|tu| tu.is_interrupted())\n            .count()\n    }\n\n    #[must_use]\n    pub fn count_ignored(&self) -> usize {\n        self.test_case_summaries\n            .iter()\n            .filter(|tu| tu.is_ignored())\n            .count()\n    }\n}\n"
  },
  {
    "path": "crates/forge-runner/src/tests_summary.rs",
    "content": "use crate::test_target_summary::TestTargetSummary;\nuse serde::Serialize;\n\n// TODO(#2574): Bring back \"filtered out\" number in tests summary when running with `--exact` flag\n#[derive(Serialize)]\npub struct TestsSummary {\n    passed: usize,\n    failed: usize,\n    interrupted: usize,\n    ignored: usize,\n    filtered: Option<usize>,\n}\n\nimpl TestsSummary {\n    #[must_use]\n    pub fn new(summaries: &[TestTargetSummary], filtered: Option<usize>) -> Self {\n        let passed = summaries.iter().map(TestTargetSummary::count_passed).sum();\n        let failed = summaries.iter().map(TestTargetSummary::count_failed).sum();\n        let interrupted = summaries\n            .iter()\n            .map(TestTargetSummary::count_interrupted)\n            .sum();\n        let ignored = summaries.iter().map(TestTargetSummary::count_ignored).sum();\n\n        Self {\n            passed,\n            failed,\n            interrupted,\n            ignored,\n            filtered,\n        }\n    }\n\n    #[must_use]\n    pub fn format_summary_message(&self) -> String {\n        let filtered = self\n            .filtered\n            .map_or_else(|| \"other\".to_string(), |v| v.to_string());\n\n        let interrupted = if self.interrupted > 0 {\n            format!(\"\\nInterrupted execution of {} test(s).\", self.interrupted)\n        } else {\n            String::new()\n        };\n\n        format!(\n            \"{} passed, {} failed, {} ignored, {filtered} filtered out{interrupted}\",\n            self.passed, self.failed, self.ignored,\n        )\n    }\n}\n"
  },
  {
    "path": "crates/foundry-ui/Cargo.toml",
    "content": "[package]\nname = \"foundry-ui\"\nversion.workspace = true\nedition.workspace = true\n\n[dependencies]\nserde.workspace = true\nserde_json.workspace = true\nanyhow.workspace = true\nstarknet-types-core.workspace = true\nconsole.workspace = true\n"
  },
  {
    "path": "crates/foundry-ui/src/components/error.rs",
    "content": "use anyhow::Error;\nuse console::style;\nuse serde::Serialize;\nuse serde_json::{Value, json};\n\nuse crate::Message;\n\nuse super::tagged::TaggedMessage;\n\n/// Error message.\n#[derive(Serialize)]\npub struct ErrorMessage<T: Message>(T);\n\nimpl<T: Message> ErrorMessage<T> {\n    #[must_use]\n    pub fn new(message: T) -> Self {\n        Self(message)\n    }\n}\n\nimpl<T: Message> Message for ErrorMessage<T> {\n    fn text(&self) -> String {\n        let tag = style(\"ERROR\").red().to_string();\n        let tagged_message = TaggedMessage::new(&tag, &self.0);\n        tagged_message.text()\n    }\n\n    fn json(&self) -> Value {\n        json!({\n            \"message_type\": \"error\",\n            \"message\": self.0.json(),\n        })\n    }\n}\n\nimpl From<Error> for ErrorMessage<String> {\n    fn from(error: Error) -> Self {\n        Self::new(format!(\"{error:#}\"))\n    }\n}\n"
  },
  {
    "path": "crates/foundry-ui/src/components/labeled.rs",
    "content": "use serde::Serialize;\nuse serde_json::{Value, json};\n\nuse crate::Message;\n\n/// Generic message with `label` prefix.\n///\n/// e.g. \"Tests: 1 passed, 1 failed\"\n#[derive(Serialize)]\npub struct LabeledMessage<'a, T: Message> {\n    label: &'a str,\n    message: &'a T,\n}\n\nimpl<'a, T: Message> LabeledMessage<'a, T> {\n    #[must_use]\n    pub fn new(label: &'a str, message: &'a T) -> Self {\n        Self { label, message }\n    }\n}\n\nimpl<T: Message> Message for LabeledMessage<'_, T> {\n    fn text(&self) -> String {\n        format!(\"{}: {}\", self.label, self.message.text())\n    }\n\n    fn json(&self) -> Value {\n        json!(\n            {\n                \"message_type\": \"labeled\",\n                \"label\": self.label,\n                \"message\": self.message.json(),\n            }\n        )\n    }\n}\n"
  },
  {
    "path": "crates/foundry-ui/src/components/mod.rs",
    "content": "//! This module provides various ready to use message types for use with\n//! a [`UI`].\n\npub mod error;\npub mod labeled;\npub mod tagged;\npub mod warning;\n"
  },
  {
    "path": "crates/foundry-ui/src/components/tagged.rs",
    "content": "use serde::Serialize;\nuse serde_json::{Value, json};\n\nuse crate::Message;\n\n/// Generic message with `tag` prefix.\n///\n/// e.g. \"[WARNING]: An example warning message\"\n#[derive(Serialize)]\npub struct TaggedMessage<'a, T: Message> {\n    tag: &'a str,\n    message: &'a T,\n}\n\nimpl<'a, T: Message> TaggedMessage<'a, T> {\n    #[must_use]\n    pub fn new(tag: &'a str, message: &'a T) -> Self {\n        Self { tag, message }\n    }\n}\n\nimpl<T: Message> Message for TaggedMessage<'_, T> {\n    fn text(&self) -> String {\n        format!(\"[{}] {}\", self.tag, self.message.text())\n    }\n\n    fn json(&self) -> Value {\n        json!(\n            {\n                \"message_type\": \"tagged\",\n                \"tag\": self.tag,\n                \"message\": self.message.json(),\n            }\n        )\n    }\n}\n"
  },
  {
    "path": "crates/foundry-ui/src/components/warning.rs",
    "content": "use console::style;\nuse serde::Serialize;\nuse serde_json::{Value, json};\n\nuse crate::Message;\n\nuse super::tagged::TaggedMessage;\n\n/// Warning message.\n#[derive(Serialize)]\npub struct WarningMessage<T: Message>(T);\n\nimpl<T: Message> WarningMessage<T> {\n    #[must_use]\n    pub fn new(message: T) -> Self {\n        Self(message)\n    }\n}\n\nimpl<T: Message> Message for WarningMessage<T> {\n    fn text(&self) -> String {\n        let tag = style(\"WARNING\").yellow().to_string();\n        let tagged_message = TaggedMessage::new(&tag, &self.0);\n        tagged_message.text()\n    }\n\n    fn json(&self) -> Value {\n        json!({\n            \"message_type\": \"warning\",\n            \"message\": self.0.json(),\n        })\n    }\n}\n"
  },
  {
    "path": "crates/foundry-ui/src/lib.rs",
    "content": "pub use message::*;\n\npub mod components;\npub mod message;\npub mod styling;\n\n#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]\npub enum OutputFormat {\n    #[default]\n    Human,\n    Json,\n}\n\n/// An abstraction around console output which stores preferences for output format (human vs JSON),\n/// colour, etc.\n///\n/// All messaging (basically all writes to `stdout`) must go through this object.\n#[derive(Debug, Default)]\npub struct UI {\n    output_format: OutputFormat,\n    // TODO(#3395): Add state here, that can be used for spinner\n}\n\nimpl UI {\n    /// Create a new [`UI`] instance configured with the given output format.\n    #[must_use]\n    pub fn new(output_format: OutputFormat) -> Self {\n        Self { output_format }\n    }\n\n    /// Create a [`String`] representation of the given message based on the configured output format.\n    fn format_message(&self, message: &impl Message) -> String {\n        match self.output_format {\n            OutputFormat::Human => message.text(),\n            OutputFormat::Json => message.json().to_string(),\n        }\n    }\n\n    /// Print the given message to stdout using the configured output format.\n    pub fn println(&self, message: &impl Message) {\n        println!(\"{}\", self.format_message(message));\n    }\n\n    /// Print the given message to stderr using the configured output format.\n    pub fn eprintln(&self, message: &impl Message) {\n        eprintln!(\"{}\", self.format_message(message));\n    }\n\n    /// Print a blank line to stdout.\n    pub fn print_blank_line(&self) {\n        match self.output_format {\n            OutputFormat::Human => println!(),\n            OutputFormat::Json => {}\n        }\n    }\n\n    #[must_use]\n    pub fn output_format(&self) -> OutputFormat {\n        self.output_format\n    }\n}\n"
  },
  {
    "path": "crates/foundry-ui/src/message.rs",
    "content": "use serde::Serialize;\nuse serde_json::{Value, json};\n\n/// A typed object that can be either printed as a human-readable message or serialized as JSON.\npub trait Message {\n    /// Return textual (human) representation of this message.\n    fn text(&self) -> String;\n\n    /// Return JSON representation of this message.\n    fn json(&self) -> Value;\n}\n\nimpl<T: ToString> Message for T\nwhere\n    T: Serialize,\n{\n    fn text(&self) -> String {\n        self.to_string()\n    }\n\n    fn json(&self) -> Value {\n        json!({ \"message\": self.to_string() })\n    }\n}\n"
  },
  {
    "path": "crates/foundry-ui/src/output.rs",
    "content": ""
  },
  {
    "path": "crates/foundry-ui/src/styling.rs",
    "content": "use console::style;\nuse starknet_types_core::felt::Felt;\nuse std::fmt::Write;\n\n#[derive(Debug, Clone)]\nenum OutputEntry {\n    SuccessMessage(String),\n    ErrorMessage(String),\n    Field { label: String, value: String },\n    BlankLine,\n    Text(String),\n}\n\npub struct OutputBuilder {\n    entries: Vec<OutputEntry>,\n}\n\nimpl Default for OutputBuilder {\n    fn default() -> Self {\n        Self::new()\n    }\n}\n\nimpl OutputBuilder {\n    #[must_use]\n    pub fn new() -> Self {\n        Self {\n            entries: Vec::new(),\n        }\n    }\n\n    fn calculate_field_label_width(&self) -> usize {\n        self.entries\n            .iter()\n            .filter_map(|entry| {\n                if let OutputEntry::Field { label, .. } = entry {\n                    Some(label.len() + 1)\n                } else {\n                    None\n                }\n            })\n            .max()\n            .unwrap_or(0)\n    }\n\n    #[must_use]\n    pub fn success_message(mut self, message: &str) -> Self {\n        self.entries\n            .push(OutputEntry::SuccessMessage(message.to_string()));\n        self\n    }\n\n    #[must_use]\n    pub fn error_message(mut self, message: &str) -> Self {\n        self.entries\n            .push(OutputEntry::ErrorMessage(message.to_string()));\n        self\n    }\n\n    #[must_use]\n    pub fn field(mut self, label_text: &str, value: &str) -> Self {\n        self.entries.push(OutputEntry::Field {\n            label: label_text.to_string(),\n            value: value.to_string(),\n        });\n        self\n    }\n\n    #[must_use]\n    pub fn blank_line(mut self) -> Self {\n        self.entries.push(OutputEntry::BlankLine);\n        self\n    }\n\n    #[must_use]\n    pub fn text_field(mut self, text: &str) -> Self {\n        self.entries.push(OutputEntry::Text(text.to_string()));\n        self\n    }\n\n    #[must_use]\n    pub fn if_some<F, T>(mut self, option: Option<&T>, f: F) -> Self\n    where\n        F: FnOnce(Self, &T) -> Self,\n    {\n        if let Some(value) = option {\n            self = f(self, value);\n        }\n        self\n    }\n\n    #[must_use]\n    pub fn padded_felt_field(self, label: &str, felt: &Felt) -> Self {\n        self.field(label, &felt.to_fixed_hex_string())\n    }\n\n    #[must_use]\n    pub fn felt_field(self, label: &str, felt: &Felt) -> Self {\n        self.field(label, &felt.to_hex_string())\n    }\n\n    #[must_use]\n    pub fn felt_list_field(self, label: &str, felts: &[Felt]) -> Self {\n        let felts = felts.iter().map(Felt::to_hex_string).collect::<Vec<_>>();\n        self.field(label, &format!(\"[{}]\", felts.join(\", \")))\n    }\n\n    #[must_use]\n    pub fn build(self) -> String {\n        let field_width = self.calculate_field_label_width();\n        let mut content = String::new();\n\n        for entry in self.entries {\n            match entry {\n                OutputEntry::SuccessMessage(message) => {\n                    writeln!(content, \"{}: {}\", style(\"Success\").green(), message).unwrap();\n                }\n                OutputEntry::ErrorMessage(message) => {\n                    writeln!(content, \"{}: {}\", style(\"Error\").red(), message).unwrap();\n                }\n                OutputEntry::Field { label, value } => {\n                    writeln!(\n                        content,\n                        \"{:field_width$} {}\",\n                        format!(\"{}:\", label),\n                        style(value).yellow(),\n                    )\n                    .unwrap();\n                }\n                OutputEntry::BlankLine => {\n                    content.push('\\n');\n                }\n                OutputEntry::Text(text) => {\n                    if !content.is_empty() && !content.ends_with('\\n') {\n                        content.push('\\n');\n                    }\n                    content.push_str(&text);\n                    content.push('\\n');\n                }\n            }\n        }\n\n        if content.ends_with('\\n') {\n            content.pop();\n        }\n        content\n    }\n}\n"
  },
  {
    "path": "crates/native-api/Cargo.toml",
    "content": "[package]\nname = \"native-api\"\nversion.workspace = true\nedition.workspace = true\n\n[dependencies]\nthiserror.workspace = true\nstarknet_api.workspace = true\ncairo-lang-starknet-classes.workspace = true\ncairo-native.workspace = true\n"
  },
  {
    "path": "crates/native-api/src/lib.rs",
    "content": "//! This module provides functionality related to `cairo-native`.\n//!\n//! Currently, it includes:\n//!  - Compiling Sierra contract classes into `cairo-native` executors.\n\nuse cairo_lang_starknet_classes::contract_class::ContractClass;\nuse cairo_native::executor::AotContractExecutor;\nuse starknet_api::contract_class::SierraVersion;\n\n/// Compiles a given Sierra [`ContractClass`] into an [`AotContractExecutor`] for `cairo-native` execution.\n#[must_use]\npub fn compile_contract_class(contract_class: &ContractClass) -> AotContractExecutor {\n    let sierra_version = extract_sierra_version(contract_class);\n\n    let extracted = contract_class\n        .extract_sierra_program(false)\n        .expect(\"extraction should succeed\");\n\n    AotContractExecutor::new(\n        &extracted.program,\n        &contract_class.entry_points_by_type,\n        sierra_version.clone().into(),\n        cairo_native::OptLevel::Default,\n        None,\n    )\n    .expect(\"compilation should succeed\")\n}\n\n/// Extracts the Sierra version from the given [`ContractClass`].\nfn extract_sierra_version(contract_class: &ContractClass) -> SierraVersion {\n    let sierra_version_values = contract_class\n        .sierra_program\n        .iter()\n        .take(3)\n        .map(|x| x.value.clone())\n        .collect::<Vec<_>>();\n\n    SierraVersion::extract_from_program(&sierra_version_values)\n        .expect(\"version extraction should succeed\")\n}\n"
  },
  {
    "path": "crates/runtime/Cargo.toml",
    "content": "[package]\nname = \"runtime\"\nversion = \"1.0.0\"\nedition.workspace = true\n\n[features]\ntesting = []\n\n[dependencies]\nindoc.workspace = true\nanyhow.workspace = true\nconversions.workspace = true\ncairo-lang-casm.workspace = true\ncairo-lang-utils.workspace = true\nstarknet-types-core.workspace = true\nstarknet_api.workspace = true\nstarknet-rust.workspace = true\nblockifier.workspace = true\ncairo-vm.workspace = true\nserde_json.workspace = true\nserde.workspace = true\nthiserror.workspace = true\nnum-traits.workspace = true\nshared.workspace = true\n"
  },
  {
    "path": "crates/runtime/src/lib.rs",
    "content": "use crate::vm::{cell_ref_to_relocatable, extract_relocatable, get_val, vm_get_range};\nuse anyhow::Result;\nuse blockifier::execution::syscalls::hint_processor::SyscallHintProcessor;\nuse blockifier::execution::syscalls::vm_syscall_utils::SyscallSelector;\nuse blockifier::state::errors::StateError;\nuse cairo_lang_casm::hints::{ExternalHint, Hint, StarknetHint};\nuse cairo_lang_casm::operand::{CellRef, ResOperand};\nuse cairo_lang_utils::bigint::BigIntAsHex;\nuse cairo_vm::hint_processor::hint_processor_definition::{\n    HintProcessor, HintProcessorLogic, HintReference,\n};\nuse cairo_vm::serde::deserialize_program::ApTracking;\nuse cairo_vm::types::exec_scope::ExecutionScopes;\nuse cairo_vm::types::relocatable::Relocatable;\nuse cairo_vm::vm::errors::hint_errors::HintError;\nuse cairo_vm::vm::errors::hint_errors::HintError::CustomHint;\nuse cairo_vm::vm::errors::vm_errors::VirtualMachineError;\nuse cairo_vm::vm::runners::cairo_runner::{ResourceTracker, RunResources};\nuse cairo_vm::vm::vm_core::VirtualMachine;\nuse conversions::byte_array::ByteArray;\nuse conversions::serde::SerializedValue;\nuse conversions::serde::deserialize::BufferReadError;\nuse conversions::serde::deserialize::BufferReader;\nuse conversions::serde::serialize::{CairoSerialize, SerializeToFeltVec};\nuse indoc::indoc;\nuse shared::vm::VirtualMachineExt;\nuse starknet_api::StarknetApiError;\nuse starknet_types_core::felt::Felt;\nuse std::any::Any;\nuse std::collections::HashMap;\nuse std::io;\nuse std::sync::Arc;\nuse thiserror::Error;\n\npub mod starknet;\nmod vm;\n\n// from core/src/starknet/testing.cairo\nconst CAIRO_TEST_CHEATCODES: [&str; 14] = [\n    \"set_block_number\",\n    \"set_caller_address\",\n    \"set_contract_address\",\n    \"set_sequencer_address\",\n    \"set_block_timestamp\",\n    \"set_version\",\n    \"set_account_contract_address\",\n    \"set_max_fee\",\n    \"set_transaction_hash\",\n    \"set_chain_id\",\n    \"set_nonce\",\n    \"set_signature\",\n    \"pop_log\",\n    \"pop_l2_to_l1_message\",\n];\npub trait SyscallPtrAccess {\n    fn get_mut_syscall_ptr(&mut self) -> &mut Relocatable;\n}\n\npub struct StarknetRuntime<'a> {\n    pub hint_handler: SyscallHintProcessor<'a>,\n    pub panic_traceback: Option<Vec<usize>>,\n}\n\nimpl SyscallPtrAccess for StarknetRuntime<'_> {\n    fn get_mut_syscall_ptr(&mut self) -> &mut Relocatable {\n        &mut self.hint_handler.syscall_ptr\n    }\n}\n\nimpl ResourceTracker for StarknetRuntime<'_> {\n    fn consumed(&self) -> bool {\n        self.hint_handler.base.context.vm_run_resources.consumed()\n    }\n\n    fn consume_step(&mut self) {\n        self.hint_handler\n            .base\n            .context\n            .vm_run_resources\n            .consume_step();\n    }\n\n    fn get_n_steps(&self) -> Option<usize> {\n        self.hint_handler\n            .base\n            .context\n            .vm_run_resources\n            .get_n_steps()\n    }\n\n    fn run_resources(&self) -> &RunResources {\n        self.hint_handler\n            .base\n            .context\n            .vm_run_resources\n            .run_resources()\n    }\n}\n\nimpl SignalPropagator for StarknetRuntime<'_> {\n    fn propagate_system_call_signal(\n        &mut self,\n        _selector: SyscallSelector,\n        _vm: &mut VirtualMachine,\n    ) {\n    }\n\n    fn propagate_cheatcode_signal(&mut self, _selector: &str, _inputs: &[Felt]) {}\n}\n\nfn parse_selector(selector: &BigIntAsHex) -> Result<String, HintError> {\n    let selector = &selector.value.to_bytes_be().1;\n    let selector = std::str::from_utf8(selector)\n        .map_err(|_| CustomHint(Box::from(\"Failed to parse the cheatcode selector\")))?;\n    Ok(String::from(selector))\n}\n\nfn fetch_cheatcode_input(\n    vm: &mut VirtualMachine,\n    input_start: &ResOperand,\n    input_end: &ResOperand,\n) -> Result<Vec<Felt>, HintError> {\n    let input_start = extract_relocatable(vm, input_start)?;\n    let input_end = extract_relocatable(vm, input_end)?;\n    let inputs = vm_get_range(vm, input_start, input_end)\n        .map_err(|_| CustomHint(Box::from(\"Failed to read input data\")))?;\n    Ok(inputs)\n}\n\nimpl HintProcessorLogic for StarknetRuntime<'_> {\n    fn execute_hint(\n        &mut self,\n        vm: &mut VirtualMachine,\n        exec_scopes: &mut ExecutionScopes,\n        hint_data: &Box<dyn Any>,\n    ) -> Result<(), HintError> {\n        let maybe_extended_hint = hint_data.downcast_ref::<Hint>();\n\n        if let Some(extended_hint) = maybe_extended_hint {\n            match extended_hint {\n                Hint::Starknet(StarknetHint::Cheatcode {\n                    selector,\n                    input_start: _,\n                    input_end: _,\n                    output_start: _,\n                    output_end: _,\n                }) => {\n                    let selector = parse_selector(selector)?;\n\n                    let is_cairo_test_fn = CAIRO_TEST_CHEATCODES.contains(&selector.as_str());\n\n                    let error = format!(\n                        \"Function `{selector}` is not supported in this runtime\\n{}\",\n                        if is_cairo_test_fn {\n                            \"Check if functions are imported from `snforge_std`/`sncast_std` NOT from `starknet::testing`\"\n                        } else {\n                            \"Check if used library (`snforge_std` or `sncast_std`) is compatible with used binary, probably one of them is not updated\"\n                        }\n                    );\n\n                    return Err(CustomHint(error.into()));\n                }\n                Hint::External(ExternalHint::AddTrace { flag }) => {\n                    const PANIC_IN_BYTES: Felt = Felt::from_hex_unchecked(\"0x70616e6963\");\n                    let flag = get_val(vm, flag)?;\n                    // Setting the panic backtrace if the given flag is panic.\n                    if flag == PANIC_IN_BYTES {\n                        self.panic_traceback = Some(vm.get_reversed_pc_traceback());\n                    }\n                    return Ok(());\n                }\n                _ => {}\n            }\n        }\n\n        self.hint_handler.execute_hint(vm, exec_scopes, hint_data)\n    }\n\n    fn compile_hint(\n        &self,\n        hint_code: &str,\n        ap_tracking_data: &ApTracking,\n        reference_ids: &HashMap<String, usize>,\n        references: &[HintReference],\n        accessible_scopes: &[String],\n        constants: Arc<HashMap<String, Felt>>,\n    ) -> Result<Box<dyn Any>, VirtualMachineError> {\n        self.hint_handler.compile_hint(\n            hint_code,\n            ap_tracking_data,\n            reference_ids,\n            references,\n            accessible_scopes,\n            constants,\n        )\n    }\n}\n\npub struct ExtendedRuntime<Extension: ExtensionLogic> {\n    pub extension: Extension,\n    pub extended_runtime: <Extension as ExtensionLogic>::Runtime,\n}\n\nimpl<Extension: ExtensionLogic> HintProcessorLogic for ExtendedRuntime<Extension> {\n    fn execute_hint(\n        &mut self,\n        vm: &mut VirtualMachine,\n        exec_scopes: &mut ExecutionScopes,\n        hint_data: &Box<dyn Any>,\n    ) -> Result<(), HintError> {\n        let maybe_extended_hint = hint_data.downcast_ref::<Hint>();\n\n        match maybe_extended_hint {\n            Some(Hint::Starknet(starknet_hint)) => match starknet_hint {\n                StarknetHint::Cheatcode {\n                    selector,\n                    input_start,\n                    input_end,\n                    output_start,\n                    output_end,\n                } => self.execute_cheatcode_hint(\n                    vm,\n                    exec_scopes,\n                    hint_data,\n                    selector,\n                    &VmIoPointers {\n                        input_start,\n                        input_end,\n                        output_start,\n                        output_end,\n                    },\n                ),\n                StarknetHint::SystemCall { .. } => {\n                    self.execute_syscall_hint(vm, exec_scopes, hint_data)\n                }\n            },\n            _ => self\n                .extended_runtime\n                .execute_hint(vm, exec_scopes, hint_data),\n        }\n    }\n\n    fn compile_hint(\n        &self,\n        hint_code: &str,\n        ap_tracking_data: &ApTracking,\n        reference_ids: &HashMap<String, usize>,\n        references: &[HintReference],\n        accessible_scopes: &[String],\n        constants: Arc<HashMap<String, Felt>>,\n    ) -> Result<Box<dyn Any>, VirtualMachineError> {\n        self.extended_runtime.compile_hint(\n            hint_code,\n            ap_tracking_data,\n            reference_ids,\n            references,\n            accessible_scopes,\n            constants,\n        )\n    }\n}\n\nstruct VmIoPointers<'a> {\n    input_start: &'a ResOperand,\n    input_end: &'a ResOperand,\n    output_start: &'a CellRef,\n    output_end: &'a CellRef,\n}\n\nimpl<Extension: ExtensionLogic> ExtendedRuntime<Extension> {\n    fn execute_cheatcode_hint(\n        &mut self,\n        vm: &mut VirtualMachine,\n        exec_scopes: &mut ExecutionScopes,\n        hint_data: &Box<dyn Any>,\n        selector: &BigIntAsHex,\n        vm_io_ptrs: &VmIoPointers,\n    ) -> Result<(), HintError> {\n        let selector = parse_selector(selector)?;\n        let inputs = fetch_cheatcode_input(vm, vm_io_ptrs.input_start, vm_io_ptrs.input_end)?;\n\n        let result = self.extension.handle_cheatcode(\n            &selector,\n            BufferReader::new(&inputs),\n            &mut self.extended_runtime,\n            vm,\n        );\n\n        let res = match result {\n            Ok(CheatcodeHandlingResult::Forwarded) => {\n                let res = self\n                    .extended_runtime\n                    .execute_hint(vm, exec_scopes, hint_data);\n                self.extension.handle_cheatcode_signal(\n                    &selector,\n                    &inputs,\n                    &mut self.extended_runtime,\n                );\n                return res;\n            }\n            // it is serialized again to add `Result` discriminator\n            Ok(CheatcodeHandlingResult::Handled(res)) => Ok(SerializedValue::new(res)),\n            Err(err) => Err(ByteArray::from(err.to_string().as_str())),\n        }\n        .serialize_to_vec();\n\n        let WrittenData {\n            start: result_start,\n            end: result_end,\n        } = write_data(res, vm)?;\n        let output_start = vm_io_ptrs.output_start;\n        let output_end = vm_io_ptrs.output_end;\n\n        vm.insert_value(cell_ref_to_relocatable(*output_start, vm), result_start)?;\n        vm.insert_value(cell_ref_to_relocatable(*output_end, vm), result_end)?;\n\n        self.propagate_cheatcode_signal(&selector, &inputs);\n\n        Ok(())\n    }\n    fn execute_syscall_hint(\n        &mut self,\n        vm: &mut VirtualMachine,\n        exec_scopes: &mut ExecutionScopes,\n        hint_data: &Box<dyn Any>,\n    ) -> Result<(), HintError> {\n        // We peek into memory to check the selector\n        let selector = SyscallSelector::try_from(\n            vm.get_integer(*self.get_mut_syscall_ptr())\n                .unwrap()\n                .into_owned(),\n        )?;\n\n        if let SyscallHandlingResult::Handled =\n            self.extension\n                .override_system_call(selector, vm, &mut self.extended_runtime)?\n        {\n            self.propagate_system_call_signal(selector, vm);\n            Ok(())\n        } else {\n            self.extended_runtime\n                .execute_hint(vm, exec_scopes, hint_data)?;\n            self.extension\n                .handle_system_call_signal(selector, vm, &mut self.extended_runtime);\n            Ok(())\n        }\n    }\n}\n\npub trait SignalPropagator {\n    fn propagate_system_call_signal(&mut self, selector: SyscallSelector, vm: &mut VirtualMachine);\n\n    fn propagate_cheatcode_signal(&mut self, selector: &str, inputs: &[Felt]);\n}\n\nimpl<Extension: ExtensionLogic> SignalPropagator for ExtendedRuntime<Extension> {\n    fn propagate_system_call_signal(&mut self, selector: SyscallSelector, vm: &mut VirtualMachine) {\n        self.extended_runtime\n            .propagate_system_call_signal(selector, vm);\n        self.extension\n            .handle_system_call_signal(selector, vm, &mut self.extended_runtime);\n    }\n\n    fn propagate_cheatcode_signal(&mut self, selector: &str, inputs: &[Felt]) {\n        self.extended_runtime\n            .propagate_cheatcode_signal(selector, inputs);\n        self.extension\n            .handle_cheatcode_signal(selector, inputs, &mut self.extended_runtime);\n    }\n}\n\nimpl<Extension: ExtensionLogic> SyscallPtrAccess for ExtendedRuntime<Extension> {\n    fn get_mut_syscall_ptr(&mut self) -> &mut Relocatable {\n        self.extended_runtime.get_mut_syscall_ptr()\n    }\n}\n\nimpl<Extension: ExtensionLogic> ResourceTracker for ExtendedRuntime<Extension> {\n    fn consumed(&self) -> bool {\n        self.extended_runtime.consumed()\n    }\n\n    fn consume_step(&mut self) {\n        self.extended_runtime.consume_step();\n    }\n\n    fn get_n_steps(&self) -> Option<usize> {\n        self.extended_runtime.get_n_steps()\n    }\n\n    fn run_resources(&self) -> &RunResources {\n        self.extended_runtime.run_resources()\n    }\n}\n\n#[derive(Debug)]\npub enum SyscallHandlingResult {\n    Forwarded,\n    Handled,\n}\n\n#[derive(Debug)]\npub enum CheatcodeHandlingResult {\n    Forwarded,\n    Handled(Vec<Felt>),\n}\n\nimpl CheatcodeHandlingResult {\n    pub fn from_serializable(serializable: impl CairoSerialize) -> Self {\n        Self::Handled(serializable.serialize_to_vec())\n    }\n}\n\npub trait ExtensionLogic {\n    type Runtime: HintProcessor + SyscallPtrAccess + SignalPropagator;\n\n    fn override_system_call(\n        &mut self,\n        _selector: SyscallSelector,\n        _vm: &mut VirtualMachine,\n        _extended_runtime: &mut Self::Runtime,\n    ) -> Result<SyscallHandlingResult, HintError> {\n        Ok(SyscallHandlingResult::Forwarded)\n    }\n\n    fn handle_cheatcode(\n        &mut self,\n        _selector: &str,\n        _input_reader: BufferReader,\n        _extended_runtime: &mut Self::Runtime,\n        _vm: &VirtualMachine,\n    ) -> Result<CheatcodeHandlingResult, EnhancedHintError> {\n        Ok(CheatcodeHandlingResult::Forwarded)\n    }\n\n    /// Different from `override_system_call` because it cannot be overridden,\n    /// always receives a signal and cannot return an error\n    /// Signals are executed in reverse order to normal syscall handlers\n    /// Signals are executed after syscall is handled\n    fn handle_system_call_signal(\n        &mut self,\n        _selector: SyscallSelector,\n        _vm: &mut VirtualMachine,\n        _extended_runtime: &mut Self::Runtime,\n    ) {\n    }\n\n    /// Different from `handle_cheadcode` because it cannot be overridden,\n    /// always receives a signal and cannot return an error\n    /// Signals are executed in reverse order to normal cheatcode handlers\n    /// Signals are executed after cheatcode is handled\n    fn handle_cheatcode_signal(\n        &mut self,\n        _selector: &str,\n        _inputs: &[Felt],\n        _extended_runtime: &mut Self::Runtime,\n    ) {\n    }\n}\n\n// All errors that can be thrown from the hint executor have to be added here,\n// to prevent the whole runner from panicking\n#[derive(Error, Debug)]\npub enum EnhancedHintError {\n    #[error(transparent)]\n    Hint(#[from] HintError),\n    #[error(transparent)]\n    Io(#[from] io::Error),\n    #[error(transparent)]\n    Anyhow(#[from] anyhow::Error),\n    #[error(transparent)]\n    State(#[from] StateError),\n    #[error(transparent)]\n    SerdeJson(#[from] serde_json::Error),\n    #[error(transparent)]\n    StarknetApi(#[from] StarknetApiError),\n    #[error(\"Failed to parse {path} file\")]\n    FileParsing { path: String },\n    #[error(\"{error}\")]\n    OracleError { error: ByteArray },\n}\n\nimpl From<BufferReadError> for EnhancedHintError {\n    fn from(value: BufferReadError) -> Self {\n        EnhancedHintError::Anyhow(\n                anyhow::Error::from(value)\n                    .context(\n                        indoc!(r\"\n                        Reading from buffer failed, this can be caused by calling starknet::testing::cheatcode with invalid arguments.\n                        Probably `snforge_std`/`sncast_std` version is incompatible, check above for incompatibility warning.\n                    \")\n                    )\n            )\n    }\n}\n\nstruct WrittenData {\n    start: Relocatable,\n    end: Relocatable,\n}\n\nfn write_data(data: Vec<Felt>, vm: &mut VirtualMachine) -> Result<WrittenData, HintError> {\n    let mut ptr = vm.add_memory_segment();\n    let start = ptr;\n    for data in data {\n        vm.insert_value(ptr, data)?;\n        ptr += 1;\n    }\n    Ok(WrittenData { start, end: ptr })\n}\n"
  },
  {
    "path": "crates/runtime/src/starknet/constants.rs",
    "content": "pub const TEST_ENTRY_POINT_SELECTOR: &str = \"TEST_CONTRACT_SELECTOR\";\npub const TEST_CONTRACT_CLASS_HASH: &str = \"0x117\";\n// snforge_std/src/cheatcodes.cairo::test_address\npub const TEST_ADDRESS: &str = \"0x01724987234973219347210837402\";\n"
  },
  {
    "path": "crates/runtime/src/starknet/context.rs",
    "content": "use crate::starknet::constants::{TEST_ADDRESS, TEST_CONTRACT_CLASS_HASH};\nuse blockifier::blockifier_versioned_constants::VersionedConstants;\nuse blockifier::bouncer::BouncerConfig;\nuse blockifier::context::{BlockContext, ChainInfo, FeeTokenAddresses, TransactionContext};\nuse blockifier::execution::common_hints::ExecutionMode;\nuse blockifier::execution::contract_class::TrackedResource;\nuse blockifier::execution::entry_point::{\n    EntryPointExecutionContext, EntryPointRevertInfo, SierraGasRevertTracker,\n};\nuse blockifier::transaction::objects::{\n    CommonAccountFields, CurrentTransactionInfo, TransactionInfo,\n};\nuse cairo_vm::vm::runners::cairo_runner::RunResources;\nuse conversions::string::TryFromHexStr;\nuse serde::{Deserialize, Serialize};\nuse starknet_api::block::{BlockInfo, BlockNumber, BlockTimestamp, GasPrice, StarknetVersion};\nuse starknet_api::block::{GasPriceVector, GasPrices, NonzeroGasPrice};\nuse starknet_api::data_availability::DataAvailabilityMode;\nuse starknet_api::execution_resources::GasAmount;\nuse starknet_api::transaction::fields::{AccountDeploymentData, PaymasterData, ProofFacts, Tip};\nuse starknet_api::transaction::fields::{AllResourceBounds, ResourceBounds, ValidResourceBounds};\nuse starknet_api::versioned_constants_logic::VersionedConstantsTrait;\nuse starknet_api::{\n    core::{ChainId, ContractAddress, Nonce},\n    transaction::TransactionVersion,\n};\nuse starknet_types_core::felt::Felt;\nuse std::sync::Arc;\n\npub const DEFAULT_CHAIN_ID: &str = \"SN_SEPOLIA\";\npub const DEFAULT_BLOCK_NUMBER: u64 = 2000;\npub const SEQUENCER_ADDRESS: &str = \"0x1000\";\npub const ERC20_CONTRACT_ADDRESS: &str = \"0x1001\";\npub const STRK_CONTRACT_ADDRESS: &str =\n    \"0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d\";\npub const ETH_CONTRACT_ADDRESS: &str =\n    \"0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7\";\n\nfn default_chain_id() -> ChainId {\n    ChainId::from(String::from(DEFAULT_CHAIN_ID))\n}\n\n#[must_use]\npub fn build_block_context(block_info: &BlockInfo, chain_id: Option<ChainId>) -> BlockContext {\n    BlockContext::new(\n        block_info.clone(),\n        ChainInfo {\n            chain_id: chain_id.unwrap_or_else(default_chain_id),\n            fee_token_addresses: FeeTokenAddresses {\n                strk_fee_token_address: ContractAddress::try_from_hex_str(STRK_CONTRACT_ADDRESS)\n                    .unwrap(),\n                eth_fee_token_address: ContractAddress::try_from_hex_str(ETH_CONTRACT_ADDRESS)\n                    .unwrap(),\n            },\n            is_l3: false,\n        },\n        VersionedConstants::latest_constants().clone(),\n        BouncerConfig::default(),\n    )\n}\n\nfn build_tx_info() -> TransactionInfo {\n    TransactionInfo::Current(CurrentTransactionInfo {\n        common_fields: CommonAccountFields {\n            version: TransactionVersion::THREE,\n            nonce: Nonce(Felt::from(0_u8)),\n            ..Default::default()\n        },\n        resource_bounds: ValidResourceBounds::AllResources(AllResourceBounds {\n            l1_gas: ResourceBounds {\n                max_amount: GasAmount::from(0_u8),\n                max_price_per_unit: GasPrice::from(1_u8),\n            },\n            l2_gas: ResourceBounds {\n                max_amount: GasAmount::from(0_u8),\n                max_price_per_unit: GasPrice::from(0_u8),\n            },\n            l1_data_gas: ResourceBounds {\n                max_amount: GasAmount::from(0_u8),\n                max_price_per_unit: GasPrice::from(1_u8),\n            },\n        }),\n        tip: Tip::default(),\n        nonce_data_availability_mode: DataAvailabilityMode::L1,\n        fee_data_availability_mode: DataAvailabilityMode::L1,\n        paymaster_data: PaymasterData::default(),\n        account_deployment_data: AccountDeploymentData::default(),\n        proof_facts: ProofFacts::default(),\n    })\n}\n\n#[must_use]\npub fn build_transaction_context(\n    block_info: &BlockInfo,\n    chain_id: Option<ChainId>,\n) -> TransactionContext {\n    TransactionContext {\n        block_context: Arc::new(build_block_context(block_info, chain_id)),\n        tx_info: build_tx_info(),\n    }\n}\n\n#[must_use]\npub fn build_context(\n    block_info: &BlockInfo,\n    chain_id: Option<ChainId>,\n    tracked_resource: &TrackedResource,\n) -> EntryPointExecutionContext {\n    let transaction_context = Arc::new(build_transaction_context(block_info, chain_id));\n\n    let mut context = EntryPointExecutionContext::new(\n        transaction_context,\n        ExecutionMode::Execute,\n        false,\n        SierraGasRevertTracker::new(GasAmount::from(i64::MAX as u64)),\n    );\n\n    context.revert_infos.0.push(EntryPointRevertInfo::new(\n        ContractAddress::try_from(Felt::from_hex(TEST_ADDRESS).unwrap()).unwrap(),\n        starknet_api::core::ClassHash(Felt::from_hex(TEST_CONTRACT_CLASS_HASH).unwrap()),\n        context.n_emitted_events,\n        context.n_sent_messages_to_l1,\n    ));\n    context.tracked_resource_stack.push(*tracked_resource);\n\n    context\n}\n\npub fn set_max_steps(entry_point_ctx: &mut EntryPointExecutionContext, max_n_steps: u32) {\n    // override it to omit [`EntryPointExecutionContext::max_steps`] restrictions\n    entry_point_ctx.vm_run_resources = RunResources::new(max_n_steps as usize);\n}\n\n// We need to be copying those 1:1 for serialization (caching purposes)\n#[derive(Clone, Serialize, Deserialize, Debug)]\npub struct SerializableBlockInfo {\n    pub block_number: BlockNumber,\n    pub block_timestamp: BlockTimestamp,\n    pub sequencer_address: ContractAddress,\n    pub gas_prices: SerializableGasPrices,\n    // A field which indicates if EIP-4844 blobs are used for publishing state diffs to l1\n    // This has influence on the cost of publishing the data on l1\n    pub use_kzg_da: bool,\n}\n#[expect(clippy::struct_field_names)]\n#[derive(Clone, Debug, Serialize, Deserialize)]\npub struct SerializableGasPrices {\n    eth_l1_gas_price: NonzeroGasPrice,\n    strk_l1_gas_price: NonzeroGasPrice,\n    eth_l1_data_gas_price: NonzeroGasPrice,\n    strk_l1_data_gas_price: NonzeroGasPrice,\n    eth_l2_gas_price: NonzeroGasPrice,\n    strk_l2_gas_price: NonzeroGasPrice,\n}\nimpl Default for SerializableGasPrices {\n    fn default() -> Self {\n        Self {\n            eth_l1_gas_price: NonzeroGasPrice::new(GasPrice::from(100 * u128::pow(10, 9))).unwrap(),\n            strk_l1_gas_price: NonzeroGasPrice::new(GasPrice::from(100 * u128::pow(10, 9)))\n                .unwrap(),\n            eth_l1_data_gas_price: NonzeroGasPrice::new(GasPrice::from(u128::pow(10, 6))).unwrap(),\n            strk_l1_data_gas_price: NonzeroGasPrice::new(GasPrice::from(u128::pow(10, 9))).unwrap(),\n            eth_l2_gas_price: NonzeroGasPrice::new(GasPrice::from(10000 * u128::pow(10, 9)))\n                .unwrap(),\n            strk_l2_gas_price: NonzeroGasPrice::new(GasPrice::from(10000 * u128::pow(10, 9)))\n                .unwrap(),\n        }\n    }\n}\n\nimpl Default for SerializableBlockInfo {\n    fn default() -> Self {\n        Self {\n            block_number: BlockNumber(DEFAULT_BLOCK_NUMBER),\n            block_timestamp: BlockTimestamp::default(),\n            sequencer_address: TryFromHexStr::try_from_hex_str(SEQUENCER_ADDRESS).unwrap(),\n            gas_prices: SerializableGasPrices::default(),\n            use_kzg_da: true,\n        }\n    }\n}\n\nimpl From<SerializableBlockInfo> for BlockInfo {\n    fn from(forge_block_info: SerializableBlockInfo) -> Self {\n        Self {\n            block_number: forge_block_info.block_number,\n            block_timestamp: forge_block_info.block_timestamp,\n            sequencer_address: forge_block_info.sequencer_address,\n            gas_prices: forge_block_info.gas_prices.into(),\n            use_kzg_da: forge_block_info.use_kzg_da,\n            starknet_version: StarknetVersion::LATEST,\n        }\n    }\n}\n\nimpl From<BlockInfo> for SerializableBlockInfo {\n    fn from(block_info: BlockInfo) -> Self {\n        Self {\n            block_number: block_info.block_number,\n            block_timestamp: block_info.block_timestamp,\n            sequencer_address: block_info.sequencer_address,\n            gas_prices: block_info.gas_prices.into(),\n            use_kzg_da: block_info.use_kzg_da,\n        }\n    }\n}\nimpl From<SerializableGasPrices> for GasPrices {\n    fn from(forge_gas_prices: SerializableGasPrices) -> Self {\n        GasPrices {\n            eth_gas_prices: GasPriceVector {\n                l1_gas_price: forge_gas_prices.eth_l1_gas_price,\n                l1_data_gas_price: forge_gas_prices.eth_l1_data_gas_price,\n                l2_gas_price: forge_gas_prices.eth_l2_gas_price,\n            },\n            strk_gas_prices: GasPriceVector {\n                l1_gas_price: forge_gas_prices.strk_l1_gas_price,\n                l1_data_gas_price: forge_gas_prices.strk_l1_data_gas_price,\n                l2_gas_price: forge_gas_prices.strk_l2_gas_price,\n            },\n        }\n    }\n}\n\nimpl From<GasPrices> for SerializableGasPrices {\n    fn from(gas_prices: GasPrices) -> Self {\n        SerializableGasPrices {\n            eth_l1_gas_price: gas_prices.eth_gas_prices.l1_gas_price,\n            strk_l1_gas_price: gas_prices.strk_gas_prices.l1_gas_price,\n            eth_l1_data_gas_price: gas_prices.eth_gas_prices.l1_data_gas_price,\n            strk_l1_data_gas_price: gas_prices.strk_gas_prices.l1_data_gas_price,\n            eth_l2_gas_price: gas_prices.eth_gas_prices.l2_gas_price,\n            strk_l2_gas_price: gas_prices.strk_gas_prices.l2_gas_price,\n        }\n    }\n}\n"
  },
  {
    "path": "crates/runtime/src/starknet/mod.rs",
    "content": "pub mod constants;\npub mod context;\npub mod state;\n"
  },
  {
    "path": "crates/runtime/src/starknet/state.rs",
    "content": "use blockifier::execution::contract_class::RunnableCompiledClass;\nuse blockifier::state::cached_state::StorageEntry;\nuse blockifier::state::errors::StateError;\nuse blockifier::state::state_api::{StateReader, StateResult};\nuse starknet_api::contract_class::ContractClass;\nuse starknet_api::core::CompiledClassHash;\nuse starknet_api::core::{ClassHash, ContractAddress, Nonce};\nuse starknet_api::state::StorageKey;\nuse starknet_types_core::felt::Felt;\nuse std::collections::HashMap;\n\n/// A simple implementation of `StateReader` using `HashMap`s as storage.\n#[derive(Debug, Default)]\npub struct DictStateReader {\n    pub storage_view: HashMap<StorageEntry, Felt>,\n    pub address_to_class_hash: HashMap<ContractAddress, ClassHash>,\n    pub class_hash_to_class: HashMap<ClassHash, ContractClass>,\n}\n\nimpl StateReader for DictStateReader {\n    fn get_storage_at(\n        &self,\n        contract_address: ContractAddress,\n        key: StorageKey,\n    ) -> StateResult<Felt> {\n        self.storage_view\n            .get(&(contract_address, key))\n            .copied()\n            .ok_or(StateError::StateReadError(format!(\n                \"Unable to get storage at address: {contract_address:?} and key: {key:?} from DictStateReader\"\n        )))\n    }\n\n    fn get_nonce_at(&self, contract_address: ContractAddress) -> StateResult<Nonce> {\n        Err(StateError::StateReadError(format!(\n            \"Unable to get nonce at {contract_address:?} from DictStateReader\"\n        )))\n    }\n\n    fn get_class_hash_at(&self, contract_address: ContractAddress) -> StateResult<ClassHash> {\n        self.address_to_class_hash\n            .get(&contract_address)\n            .copied()\n            .ok_or(StateError::UnavailableContractAddress(contract_address))\n    }\n\n    fn get_compiled_class(&self, class_hash: ClassHash) -> StateResult<RunnableCompiledClass> {\n        let contract_class = self.class_hash_to_class.get(&class_hash).cloned();\n        match contract_class {\n            Some(contract_class) => Ok(contract_class.try_into()?),\n            _ => Err(StateError::UndeclaredClassHash(class_hash)),\n        }\n    }\n\n    fn get_compiled_class_hash(&self, class_hash: ClassHash) -> StateResult<CompiledClassHash> {\n        Err(StateError::StateReadError(format!(\n            \"Unable to get compiled class hash at {class_hash:?} from DictStateReader\"\n        )))\n    }\n}\n"
  },
  {
    "path": "crates/runtime/src/vm.rs",
    "content": "//! Contains code copied from `cairo-lang-runner`\nuse cairo_lang_casm::operand::{\n    BinOpOperand, CellRef, DerefOrImmediate, Operation, Register, ResOperand,\n};\nuse cairo_lang_utils::extract_matches;\nuse cairo_vm::Felt252;\nuse cairo_vm::types::relocatable::Relocatable;\nuse cairo_vm::vm::errors::hint_errors::HintError;\nuse cairo_vm::vm::errors::vm_errors::VirtualMachineError;\nuse cairo_vm::vm::vm_core::VirtualMachine;\n\npub fn cell_ref_to_relocatable(cell_ref: CellRef, vm: &VirtualMachine) -> Relocatable {\n    let base = match cell_ref.register {\n        Register::AP => vm.get_ap(),\n        Register::FP => vm.get_fp(),\n    };\n    (base + i32::from(cell_ref.offset)).unwrap()\n}\n\n/// Extracts a parameter assumed to be a buffer.\nfn extract_buffer(buffer: &ResOperand) -> (CellRef, Felt252) {\n    let (cell, base_offset) = match buffer {\n        ResOperand::Deref(cell) => (cell, 0.into()),\n        ResOperand::BinOp(BinOpOperand {\n            op: Operation::Add,\n            a,\n            b,\n        }) => (\n            a,\n            extract_matches!(b, DerefOrImmediate::Immediate)\n                .clone()\n                .value\n                .into(),\n        ),\n        _ => panic!(\"Illegal argument for a buffer.\"),\n    };\n    (*cell, base_offset)\n}\n\n/// Fetches the value of a cell plus an offset from the vm, useful for pointers.\nfn get_ptr(\n    vm: &VirtualMachine,\n    cell: CellRef,\n    offset: &Felt252,\n) -> Result<Relocatable, VirtualMachineError> {\n    Ok((vm.get_relocatable(cell_ref_to_relocatable(cell, vm))? + offset)?)\n}\n\n/// Extracts a parameter assumed to be a buffer, and converts it into a relocatable.\npub fn extract_relocatable(\n    vm: &VirtualMachine,\n    buffer: &ResOperand,\n) -> Result<Relocatable, VirtualMachineError> {\n    let (base, offset) = extract_buffer(buffer);\n    get_ptr(vm, base, &offset)\n}\n\npub fn vm_get_range(\n    vm: &mut VirtualMachine,\n    mut calldata_start_ptr: Relocatable,\n    calldata_end_ptr: Relocatable,\n) -> Result<Vec<Felt252>, HintError> {\n    let mut values = vec![];\n    while calldata_start_ptr != calldata_end_ptr {\n        let val = *vm.get_integer(calldata_start_ptr)?;\n        values.push(val);\n        calldata_start_ptr.offset += 1;\n    }\n    Ok(values)\n}\n\npub(crate) fn get_cell_val(\n    vm: &VirtualMachine,\n    cell: CellRef,\n) -> Result<Felt252, VirtualMachineError> {\n    Ok(*vm.get_integer(cell_ref_to_relocatable(cell, vm))?.as_ref())\n}\n\nfn get_double_deref_val(\n    vm: &VirtualMachine,\n    cell: CellRef,\n    offset: &Felt252,\n) -> Result<Felt252, VirtualMachineError> {\n    Ok(*vm.get_integer(get_ptr(vm, cell, offset)?)?)\n}\n\n/// Fetches the value of `res_operand` from the vm.\npub fn get_val(\n    vm: &VirtualMachine,\n    res_operand: &ResOperand,\n) -> Result<Felt252, VirtualMachineError> {\n    match res_operand {\n        ResOperand::Deref(cell) => get_cell_val(vm, *cell),\n        ResOperand::DoubleDeref(cell, offset) => get_double_deref_val(vm, *cell, &(*offset).into()),\n        ResOperand::Immediate(x) => Ok(Felt252::from(x.value.clone())),\n        ResOperand::BinOp(op) => {\n            let a = get_cell_val(vm, op.a)?;\n            let b = match &op.b {\n                DerefOrImmediate::Deref(cell) => get_cell_val(vm, *cell)?,\n                DerefOrImmediate::Immediate(x) => Felt252::from(x.value.clone()),\n            };\n            match op.op {\n                Operation::Add => Ok(a + b),\n                Operation::Mul => Ok(a * b),\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "crates/scarb-api/Cargo.toml",
    "content": "[package]\nname = \"scarb-api\"\nversion = \"1.0.0\"\nedition.workspace = true\n\n[features]\ncairo-native = [\"dep:cairo-native\", \"dep:native-api\"]\n\n[dependencies]\nanyhow.workspace = true\nshared.workspace = true\ncamino.workspace = true\nscarb-metadata.workspace = true\nscarb-ui.workspace = true\nserde.workspace = true\nserde_json.workspace = true\nthiserror.workspace = true\nwhich.workspace = true\nsemver.workspace = true\nregex.workspace = true\nrayon.workspace = true\nitertools.workspace = true\nuniversal-sierra-compiler-api = { path = \"../universal-sierra-compiler-api\" }\nfoundry-ui = { path = \"../foundry-ui\" }\ncairo-native = { workspace = true, optional = true }\ncairo-lang-starknet-classes.workspace = true\nnative-api = { path = \"../native-api\", optional = true }\ntracing.workspace = true\ntoml_edit.workspace = true\n\n[dev-dependencies]\nassert_fs.workspace = true\nindoc.workspace = true\nnum-bigint.workspace = true\n"
  },
  {
    "path": "crates/scarb-api/src/artifacts/deserialized.rs",
    "content": "use anyhow::{Context, Result};\nuse camino::{Utf8Path, Utf8PathBuf};\nuse serde::Deserialize;\nuse std::fs;\n\n#[derive(Deserialize, Debug, PartialEq, Clone)]\npub struct StarknetArtifacts {\n    pub version: u32,\n    pub contracts: Vec<StarknetContract>,\n}\n\n#[derive(Deserialize, Debug, PartialEq, Clone)]\npub struct StarknetContract {\n    pub id: String,\n    pub package_name: String,\n    pub contract_name: String,\n    pub module_path: String,\n    pub artifacts: StarknetContractArtifactPaths,\n}\n\n#[derive(Deserialize, Debug, PartialEq, Clone)]\npub struct StarknetContractArtifactPaths {\n    pub sierra: Utf8PathBuf,\n    pub casm: Option<Utf8PathBuf>,\n}\n\n/// Get deserialized contents of `starknet_artifacts.json` file generated by Scarb\n///\n/// # Arguments\n///\n/// * `path` - A path to `starknet_artifacts.json` file.\npub fn artifacts_for_package(path: &Utf8Path) -> Result<StarknetArtifacts> {\n    let starknet_artifacts =\n        fs::read_to_string(path).with_context(|| format!(\"Failed to read {path:?} contents\"))?;\n    let starknet_artifacts: StarknetArtifacts =\n        serde_json::from_str(starknet_artifacts.as_str())\n            .with_context(|| format!(\"Failed to parse starknet artifacts from path = {path:?}.\"))?;\n    Ok(starknet_artifacts)\n}\n"
  },
  {
    "path": "crates/scarb-api/src/artifacts/representation.rs",
    "content": "use crate::artifacts::deserialized::{StarknetArtifacts, artifacts_for_package};\nuse anyhow::anyhow;\nuse camino::{Utf8Path, Utf8PathBuf};\n\npub struct StarknetArtifactsRepresentation {\n    pub(crate) base_path: Utf8PathBuf,\n    pub(crate) artifacts: StarknetArtifacts,\n}\n\nimpl StarknetArtifactsRepresentation {\n    pub fn try_from_path(artifacts_path: &Utf8Path) -> anyhow::Result<Self> {\n        let artifacts = artifacts_for_package(artifacts_path)?;\n        let path = artifacts_path\n            .parent()\n            .ok_or_else(|| anyhow!(\"Failed to get parent for path = {}\", &artifacts_path))?\n            .to_path_buf();\n\n        Ok(Self {\n            base_path: path,\n            artifacts,\n        })\n    }\n\n    pub fn artifacts(self) -> Vec<(String, Utf8PathBuf)> {\n        self.artifacts\n            .contracts\n            .into_iter()\n            .map(|contract| {\n                (\n                    contract.contract_name,\n                    self.base_path.join(contract.artifacts.sierra.as_path()),\n                )\n            })\n            .collect()\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use crate::ScarbCommand;\n    use assert_fs::TempDir;\n    use assert_fs::fixture::{FileTouch, FileWriteStr, PathChild, PathCopy};\n    use camino::Utf8PathBuf;\n\n    use super::*;\n\n    #[test]\n    fn parsing_starknet_artifacts() {\n        let temp = crate::tests::setup_package(\"basic_package\");\n\n        ScarbCommand::new_with_stdio()\n            .current_dir(temp.path())\n            .arg(\"build\")\n            .run()\n            .unwrap();\n\n        let artifacts_path = temp\n            .path()\n            .join(\"target/dev/basic_package.starknet_artifacts.json\");\n        let artifacts_path = Utf8PathBuf::from_path_buf(artifacts_path).unwrap();\n\n        let artifacts = artifacts_for_package(&artifacts_path).unwrap();\n\n        assert!(!artifacts.contracts.is_empty());\n    }\n\n    #[test]\n    fn parsing_starknet_artifacts_on_invalid_file() {\n        let temp = TempDir::new().unwrap();\n        temp.copy_from(\"../../\", &[\".tool-versions\"]).unwrap();\n        let path = temp.child(\"wrong.json\");\n        path.touch().unwrap();\n        path.write_str(\"\\\"aa\\\": {}\").unwrap();\n        let artifacts_path = Utf8PathBuf::from_path_buf(path.to_path_buf()).unwrap();\n\n        let result = artifacts_for_package(&artifacts_path);\n        let err = result.unwrap_err();\n\n        assert!(err.to_string().contains(&format!(\n            \"Failed to parse starknet artifacts from path = {artifacts_path:?}.\"\n        )));\n    }\n}\n"
  },
  {
    "path": "crates/scarb-api/src/artifacts.rs",
    "content": "use anyhow::Result;\n\nuse crate::artifacts::representation::StarknetArtifactsRepresentation;\nuse cairo_lang_starknet_classes::casm_contract_class::CasmContractClass;\n#[cfg(feature = \"cairo-native\")]\nuse cairo_native::executor::AotContractExecutor;\nuse camino::{Utf8Path, Utf8PathBuf};\nuse itertools::Itertools;\nuse rayon::iter::{IntoParallelIterator, ParallelIterator};\nuse std::collections::HashMap;\nuse std::fs;\nuse universal_sierra_compiler_api::compile_contract_sierra_at_path;\n\npub mod deserialized;\nmod representation;\n\n/// Contains compiled Starknet artifacts\n#[derive(Debug, Clone)]\npub struct StarknetContractArtifacts {\n    /// Compiled sierra code\n    pub sierra: String,\n    /// Compiled casm code\n    pub casm: CasmContractClass,\n\n    #[cfg(feature = \"cairo-native\")]\n    /// Optional AOT compiled native executor\n    pub executor: Option<AotContractExecutor>,\n}\n\nimpl PartialEq for StarknetContractArtifacts {\n    fn eq(&self, other: &Self) -> bool {\n        let eq = self.sierra == other.sierra && self.casm == other.casm;\n\n        #[cfg(feature = \"cairo-native\")]\n        let eq = eq && self.executor.is_some() == other.executor.is_some();\n\n        eq\n    }\n}\n\n#[derive(PartialEq, Debug)]\npub(crate) struct StarknetArtifactsFiles {\n    base: Utf8PathBuf,\n    other: Vec<Utf8PathBuf>,\n    #[cfg(feature = \"cairo-native\")]\n    compile_native: bool,\n}\n\nimpl StarknetArtifactsFiles {\n    pub(crate) fn new(base_file: Utf8PathBuf, other_files: Vec<Utf8PathBuf>) -> Self {\n        Self {\n            base: base_file,\n            other: other_files,\n            #[cfg(feature = \"cairo-native\")]\n            compile_native: false,\n        }\n    }\n\n    #[cfg(feature = \"cairo-native\")]\n    pub(crate) fn compile_native(mut self, compile_native: bool) -> Self {\n        self.compile_native = compile_native;\n        self\n    }\n\n    #[tracing::instrument(skip_all, level = \"debug\")]\n    pub(crate) fn load_contracts_artifacts(\n        self,\n    ) -> Result<HashMap<String, (StarknetContractArtifacts, Utf8PathBuf)>> {\n        // TODO(#2626) handle duplicates\n        let mut base_artifacts: HashMap<String, (StarknetContractArtifacts, Utf8PathBuf)> = self\n            .compile_artifacts(\n                StarknetArtifactsRepresentation::try_from_path(self.base.as_path())?.artifacts(),\n            )?;\n\n        let other_artifact_representations: Vec<StarknetArtifactsRepresentation> = self\n            .other\n            .iter()\n            .map(|path| StarknetArtifactsRepresentation::try_from_path(path.as_path()))\n            .collect::<Result<_>>()?;\n\n        let other_artifacts: Vec<(String, Utf8PathBuf)> =\n            unique_artifacts(other_artifact_representations, &base_artifacts);\n\n        let compiled_artifacts = self.compile_artifacts(other_artifacts)?;\n\n        base_artifacts.extend(compiled_artifacts);\n\n        Ok(base_artifacts)\n    }\n\n    #[tracing::instrument(skip_all, level = \"debug\")]\n    fn compile_artifacts(\n        &self,\n        artifacts: Vec<(String, Utf8PathBuf)>,\n    ) -> Result<HashMap<String, (StarknetContractArtifacts, Utf8PathBuf)>> {\n        artifacts\n            .into_par_iter()\n            .map(|(name, path)| {\n                self.compile_artifact_at_path(&path)\n                    .map(|artifact| (name.clone(), (artifact, path)))\n            })\n            .collect::<Result<_>>()\n    }\n\n    #[tracing::instrument(skip_all, level = \"debug\")]\n    #[cfg_attr(not(feature = \"cairo-native\"), expect(clippy::unused_self))]\n    fn compile_artifact_at_path(&self, path: &Utf8Path) -> Result<StarknetContractArtifacts> {\n        let sierra = fs::read_to_string(path)?;\n\n        let casm = compile_contract_sierra_at_path(path.as_std_path())?;\n\n        #[cfg(feature = \"cairo-native\")]\n        let executor = self.compile_to_native(&sierra)?;\n\n        Ok(StarknetContractArtifacts {\n            sierra,\n            casm,\n            #[cfg(feature = \"cairo-native\")]\n            executor,\n        })\n    }\n\n    #[cfg(feature = \"cairo-native\")]\n    #[tracing::instrument(skip_all, level = \"debug\")]\n    fn compile_to_native(&self, sierra: &str) -> Result<Option<AotContractExecutor>> {\n        Ok(if self.compile_native {\n            Some(native_api::compile_contract_class(&serde_json::from_str(\n                sierra,\n            )?))\n        } else {\n            None\n        })\n    }\n}\n\n#[tracing::instrument(skip_all, level = \"debug\")]\nfn unique_artifacts(\n    artifact_representations: Vec<StarknetArtifactsRepresentation>,\n    current_artifacts: &HashMap<String, (StarknetContractArtifacts, Utf8PathBuf)>,\n) -> Vec<(String, Utf8PathBuf)> {\n    artifact_representations\n        .into_iter()\n        .flat_map(StarknetArtifactsRepresentation::artifacts)\n        .unique_by(|(name, _)| name.clone())\n        .filter(|(name, _)| !current_artifacts.contains_key(name))\n        .collect()\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    use crate::ScarbCommand;\n    use crate::tests::setup_package;\n    use assert_fs::TempDir;\n    use assert_fs::fixture::{FileWriteStr, PathChild};\n    use cairo_lang_starknet_classes::casm_contract_class::CasmContractEntryPoints;\n    use camino::Utf8PathBuf;\n    use deserialized::{StarknetArtifacts, StarknetContract, StarknetContractArtifactPaths};\n    use indoc::indoc;\n    use num_bigint::BigUint;\n\n    #[test]\n    fn test_unique_artifacts() {\n        // Mock StarknetArtifactsRepresentation\n        let mock_base_artifacts = HashMap::from([(\n            \"contract1\".to_string(),\n            (\n                StarknetContractArtifacts {\n                    sierra: \"sierra1\".to_string(),\n                    casm: CasmContractClass {\n                        prime: BigUint::default(),\n                        compiler_version: String::default(),\n                        bytecode: vec![],\n                        bytecode_segment_lengths: None,\n                        hints: vec![],\n                        pythonic_hints: None,\n                        entry_points_by_type: CasmContractEntryPoints::default(),\n                    },\n                    #[cfg(feature = \"cairo-native\")]\n                    executor: None,\n                },\n                Utf8PathBuf::from(\"path1\"),\n            ),\n        )]);\n\n        let mock_representation_1 = StarknetArtifactsRepresentation {\n            base_path: Utf8PathBuf::from(\"mock/path1\"),\n            artifacts: StarknetArtifacts {\n                version: 1,\n                contracts: vec![StarknetContract {\n                    id: \"1\".to_string(),\n                    package_name: \"package1\".to_string(),\n                    contract_name: \"contract1\".to_string(),\n                    module_path: \"package1::contract1\".to_string(),\n                    artifacts: StarknetContractArtifactPaths {\n                        sierra: Utf8PathBuf::from(\"mock/path1/contract1.sierra\"),\n                        casm: None,\n                    },\n                }],\n            },\n        };\n\n        let mock_representation_2 = StarknetArtifactsRepresentation {\n            base_path: Utf8PathBuf::from(\"mock/path2\"),\n            artifacts: StarknetArtifacts {\n                version: 1,\n                contracts: vec![StarknetContract {\n                    id: \"2\".to_string(),\n                    package_name: \"package2\".to_string(),\n                    contract_name: \"contract2\".to_string(),\n                    module_path: \"package2::contract2\".to_string(),\n                    artifacts: StarknetContractArtifactPaths {\n                        sierra: Utf8PathBuf::from(\"mock/path2/contract2.sierra\"),\n                        casm: None,\n                    },\n                }],\n            },\n        };\n\n        let representations = vec![mock_representation_1, mock_representation_2];\n\n        let result = unique_artifacts(representations, &mock_base_artifacts);\n\n        assert_eq!(result.len(), 1);\n        assert_eq!(result[0].0, \"contract2\");\n    }\n\n    fn setup() -> (TempDir, StarknetArtifactsFiles) {\n        let temp = setup_package(\"basic_package\");\n        let tests_dir = temp.join(\"tests\");\n        fs::create_dir(&tests_dir).unwrap();\n\n        temp.child(tests_dir.join(\"test.cairo\"))\n            .write_str(indoc!(\n                r\"\n                    #[test]\n                    fn mock_test() {\n                        assert!(true);\n                    }\n                \"\n            ))\n            .unwrap();\n\n        ScarbCommand::new_with_stdio()\n            .current_dir(temp.path())\n            .arg(\"build\")\n            .arg(\"--test\")\n            .run()\n            .unwrap();\n\n        // Define path to the generated artifacts\n        let base_artifacts_path = temp.to_path_buf().join(\"target\").join(\"dev\");\n\n        // Get the base artifact\n        let base_file = Utf8PathBuf::from_path_buf(\n            base_artifacts_path.join(\"basic_package_integrationtest.test.starknet_artifacts.json\"),\n        )\n        .unwrap();\n\n        // Load other artifact files and add them to the temporary directory\n        let other_files = vec![\n            Utf8PathBuf::from_path_buf(\n                base_artifacts_path.join(\"basic_package_unittest.test.starknet_artifacts.json\"),\n            )\n            .unwrap(),\n        ];\n\n        // Create `StarknetArtifactsFiles`\n        let artifacts_files = StarknetArtifactsFiles::new(base_file, other_files);\n\n        (temp, artifacts_files)\n    }\n\n    #[test]\n    fn test_load_contracts_artifacts() {\n        let (_temp, artifacts_files) = setup();\n\n        // Load the contracts\n        let result = artifacts_files.load_contracts_artifacts().unwrap();\n\n        // Assert the Contract Artifacts are loaded.\n        assert!(result.contains_key(\"ERC20\"));\n        assert!(result.contains_key(\"HelloStarknet\"));\n    }\n\n    #[test]\n    #[cfg(feature = \"cairo-native\")]\n    fn test_load_contracts_artifacts_native() {\n        let (_temp, artifacts_files) = setup();\n\n        let artifacts_files = artifacts_files.compile_native(true);\n\n        // Load the contracts\n        let result = artifacts_files.load_contracts_artifacts().unwrap();\n\n        // Assert the Contract Artifacts are loaded.\n        assert!(result.contains_key(\"ERC20\"));\n        assert!(result.contains_key(\"HelloStarknet\"));\n        assert!(result.get(\"ERC20\").unwrap().0.executor.is_some());\n    }\n}\n"
  },
  {
    "path": "crates/scarb-api/src/command.rs",
    "content": "use scarb_ui::args::{FeaturesSpec, PackagesFilter, ProfileSpec, ToEnvVars};\nuse std::collections::HashMap;\nuse std::ffi::{OsStr, OsString};\nuse std::path::PathBuf;\nuse std::process::{Command, Stdio};\nuse std::{env, io};\nuse thiserror::Error;\n\n/// Error thrown while trying to execute `scarb` command.\n#[derive(Error, Debug)]\n#[non_exhaustive]\npub enum ScarbCommandError {\n    /// Failed to read `scarb` output.\n    #[error(\"failed to read `scarb` output\")]\n    Io(#[from] io::Error),\n    /// Error during execution of `scarb` command.\n    #[error(\"`scarb` exited with error\")]\n    ScarbError,\n}\n\n/// A builder for `scarb` command invocation.\n#[derive(Clone, Debug, Default)]\n#[expect(clippy::struct_excessive_bools)]\npub struct ScarbCommand {\n    args: Vec<OsString>,\n    current_dir: Option<PathBuf>,\n    env: HashMap<OsString, Option<OsString>>,\n    inherit_stderr: bool,\n    inherit_stdout: bool,\n    json: bool,\n    offline: bool,\n    manifest_path: Option<PathBuf>,\n}\n\nimpl ScarbCommand {\n    /// Creates a default `scarb` command, which will look for `scarb` in `$PATH` and\n    /// for `Scarb.toml` in the current directory or its ancestors.\n    #[must_use]\n    pub fn new() -> Self {\n        Self::default()\n    }\n\n    /// Creates a default `scarb` command, with inherited standard error and standard output.\n    #[must_use]\n    pub fn new_with_stdio() -> Self {\n        let mut cmd = Self::new();\n        cmd.inherit_stderr();\n        cmd.inherit_stdout();\n        cmd\n    }\n\n    /// Path to `Scarb.toml`.\n    ///\n    /// If not set, this will look for `Scarb.toml` in the current directory or its ancestors.\n    pub fn manifest_path(&mut self, path: impl Into<PathBuf>) -> &mut Self {\n        self.manifest_path = Some(path.into());\n        self\n    }\n\n    /// Pass packages filter to `scarb` call.\n    pub fn packages_filter(&mut self, filter: PackagesFilter) -> &mut Self {\n        self.envs(filter.to_env_vars());\n        self\n    }\n\n    /// Pass features specification filter to `scarb` call.\n    pub fn features(&mut self, features: FeaturesSpec) -> &mut Self {\n        self.envs(features.to_env_vars());\n        self\n    }\n\n    /// Pass profile to `scarb` call.\n    pub fn profile(&mut self, profile: ProfileSpec) -> &mut Self {\n        self.envs(profile.to_env_vars());\n        self\n    }\n\n    /// Current directory of the `scarb` process.\n    pub fn current_dir(&mut self, path: impl Into<PathBuf>) -> &mut Self {\n        self.current_dir = Some(path.into());\n        self\n    }\n\n    /// Adds an argument to pass to `scarb`.\n    pub fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut Self {\n        self.args.push(arg.as_ref().to_os_string());\n        self\n    }\n\n    /// Adds multiple arguments to pass to `scarb`.\n    pub fn args<I, S>(&mut self, args: I) -> &mut Self\n    where\n        I: IntoIterator<Item = S>,\n        S: AsRef<OsStr>,\n    {\n        self.args\n            .extend(args.into_iter().map(|s| s.as_ref().to_os_string()));\n        self\n    }\n\n    /// Inserts or updates an environment variable mapping.\n    pub fn env(&mut self, key: impl AsRef<OsStr>, val: impl AsRef<OsStr>) -> &mut Self {\n        self.env.insert(\n            key.as_ref().to_os_string(),\n            Some(val.as_ref().to_os_string()),\n        );\n        self\n    }\n\n    /// Adds or updates multiple environment variable mappings.\n    pub fn envs<I, K, V>(&mut self, vars: I) -> &mut Self\n    where\n        I: IntoIterator<Item = (K, V)>,\n        K: AsRef<OsStr>,\n        V: AsRef<OsStr>,\n    {\n        for (ref key, ref val) in vars {\n            self.env(key, val);\n        }\n        self\n    }\n\n    /// Removes an environment variable mapping.\n    pub fn env_remove(&mut self, key: impl AsRef<OsStr>) -> &mut Self {\n        let key = key.as_ref();\n        self.env.insert(key.to_os_string(), None);\n        self\n    }\n\n    /// Inherit standard error, i.e. show Scarb errors in this process's standard error.\n    pub fn inherit_stderr(&mut self) -> &mut Self {\n        self.inherit_stderr = true;\n        self\n    }\n\n    /// Inherit standard output, i.e. show Scarb output in this process's standard output.\n    pub fn inherit_stdout(&mut self) -> &mut Self {\n        self.inherit_stdout = true;\n        self\n    }\n\n    /// Set output format to JSON.\n    pub fn json(&mut self) -> &mut Self {\n        self.json = true;\n        self\n    }\n\n    /// Enables offline mode.\n    pub fn offline(&mut self) -> &mut Self {\n        self.offline = true;\n        self\n    }\n\n    /// Build executable `scarb` command.\n    #[must_use]\n    pub fn command(&self) -> Command {\n        let scarb = binary_path();\n\n        let mut cmd = Command::new(scarb);\n\n        if self.json {\n            cmd.arg(\"--json\");\n        }\n\n        if self.offline {\n            cmd.arg(\"--offline\");\n        }\n\n        if let Some(manifest_path) = &self.manifest_path {\n            cmd.arg(\"--manifest-path\").arg(manifest_path);\n        }\n\n        cmd.args(&self.args);\n\n        if let Some(path) = &self.current_dir {\n            cmd.current_dir(path);\n        }\n\n        for (key, val) in &self.env {\n            if let Some(val) = val {\n                cmd.env(key, val);\n            } else {\n                cmd.env_remove(key);\n            }\n        }\n\n        if self.inherit_stderr {\n            cmd.stderr(Stdio::inherit());\n        }\n\n        if self.inherit_stdout {\n            cmd.stdout(Stdio::inherit());\n        }\n\n        cmd\n    }\n\n    /// Runs configured `scarb` command.\n    pub fn run(&self) -> Result<(), ScarbCommandError> {\n        let mut cmd = self.command();\n        if cmd.status()?.success() {\n            Ok(())\n        } else {\n            Err(ScarbCommandError::ScarbError)\n        }\n    }\n}\n\n#[derive(Error, Debug)]\npub enum ScarbUnavailableError {\n    #[error(\n        \"Cannot find `scarb` binary. Make sure you have Scarb installed https://github.com/software-mansion/scarb\"\n    )]\n    NotFound(which::Error),\n}\n\npub fn ensure_scarb_available() -> anyhow::Result<(), ScarbUnavailableError> {\n    which::which(binary_path())\n        .map(|_| ())\n        .map_err(ScarbUnavailableError::NotFound)\n}\n\nfn binary_path() -> PathBuf {\n    env::var(\"SCARB\")\n        .map(PathBuf::from)\n        .ok()\n        .unwrap_or_else(|| PathBuf::from(\"scarb\"))\n}\n"
  },
  {
    "path": "crates/scarb-api/src/lib.rs",
    "content": "use crate::artifacts::StarknetArtifactsFiles;\nuse anyhow::{Context, Result, anyhow};\nuse camino::{Utf8Path, Utf8PathBuf};\npub use command::*;\nuse foundry_ui::UI;\nuse foundry_ui::components::warning::WarningMessage;\nuse scarb_metadata::{Metadata, PackageId, PackageMetadata, TargetMetadata};\nuse scarb_ui::args::PackagesFilter;\nuse semver::{BuildMetadata, Prerelease, Version, VersionReq};\nuse std::collections::HashMap;\nuse std::str::FromStr;\n\npub mod artifacts;\nmod command;\npub mod manifest;\npub mod metadata;\npub mod version;\n\npub use crate::artifacts::StarknetContractArtifacts;\n\nconst INTEGRATION_TEST_TYPE: &str = \"integration\";\n\n/// Constructs `StarknetArtifactsFiles` from contracts built using test target.\n///\n/// If artifacts with `test_type` of `INTEGRATION_TEST_TYPE` are present, we use them base path\n/// and extend with paths to other artifacts.\n/// If `INTEGRATION_TEST_TYPE` is not present, we take first artifacts found.\n#[tracing::instrument(skip_all, level = \"debug\")]\nfn get_starknet_artifacts_paths_from_test_targets(\n    target_dir: &Utf8Path,\n    test_targets: &HashMap<String, &TargetMetadata>,\n) -> Option<StarknetArtifactsFiles> {\n    let artifact =\n        |name: &str, metadata: &TargetMetadata| -> Option<(Utf8PathBuf, Option<String>)> {\n            let path = format!(\"{name}.test.starknet_artifacts.json\");\n            let path = target_dir.join(&path);\n            let path = path.exists().then_some(path);\n\n            let test_type = metadata\n                .params\n                .get(\"test-type\")\n                .and_then(|value| value.as_str())\n                .map(ToString::to_string);\n\n            path.map(|path| (Utf8PathBuf::from_str(path.as_str()).unwrap(), test_type))\n        };\n\n    let artifacts = test_targets\n        .iter()\n        .filter_map(|(target_name, metadata)| artifact(target_name, metadata))\n        .collect::<Vec<_>>();\n\n    let base_artifact_path = artifacts\n        .iter()\n        .find(|(_, test_type)| test_type.as_deref() == Some(INTEGRATION_TEST_TYPE))\n        .cloned()\n        .or_else(|| artifacts.first().cloned());\n\n    if let Some(base_artifact) = base_artifact_path {\n        let other_artifacts_paths = artifacts\n            .into_iter()\n            .filter(|artifact| artifact != &base_artifact)\n            .map(|(path, _)| path)\n            .collect();\n        let (base_artifact_path, _) = base_artifact;\n\n        Some(StarknetArtifactsFiles::new(\n            base_artifact_path,\n            other_artifacts_paths,\n        ))\n    } else {\n        None\n    }\n}\n\n/// Try getting the path to `starknet_artifacts.json` related to `starknet-contract` target. This file that is generated by `scarb build` command.\n/// If the file is not present, `None` is returned.\n#[tracing::instrument(skip_all, level = \"debug\")]\nfn get_starknet_artifacts_path(\n    target_dir: &Utf8Path,\n    target_name: &str,\n    ui: &UI,\n) -> Option<StarknetArtifactsFiles> {\n    let path = format!(\"{target_name}.starknet_artifacts.json\");\n    let path = target_dir.join(&path);\n    let path = if path.exists() {\n        Some(path)\n    } else {\n        ui.println(&WarningMessage::new(&format!(\n            \"File = {path} missing. \\\n            This is most likely caused by `[[target.starknet-contract]]` being undefined in Scarb.toml \\\n            No contracts will be available for deployment\"\n        )));\n        None\n    };\n\n    path.map(|path| StarknetArtifactsFiles::new(path, vec![]))\n}\n\n#[derive(Default)]\npub struct CompilationOpts {\n    pub use_test_target_contracts: bool,\n    #[cfg(feature = \"cairo-native\")]\n    pub run_native: bool,\n}\n\n/// Get the map with `StarknetContractArtifacts` for the given package\n#[tracing::instrument(skip_all, level = \"debug\")]\npub fn get_contracts_artifacts_and_source_sierra_paths(\n    artifacts_dir: &Utf8Path,\n    package: &PackageMetadata,\n    ui: &UI,\n    CompilationOpts {\n        use_test_target_contracts,\n        #[cfg(feature = \"cairo-native\")]\n        run_native,\n    }: CompilationOpts,\n) -> Result<HashMap<String, (StarknetContractArtifacts, Utf8PathBuf)>> {\n    let starknet_artifact_files = if use_test_target_contracts {\n        let test_targets = test_targets_by_name(package);\n        get_starknet_artifacts_paths_from_test_targets(artifacts_dir, &test_targets)\n    } else {\n        let starknet_target_name = package\n            .targets\n            .iter()\n            .find(|target| target.kind == \"starknet-contract\")\n            .map(|target| target.name.clone());\n        starknet_target_name.and_then(|starknet_target_name| {\n            get_starknet_artifacts_path(artifacts_dir, starknet_target_name.as_str(), ui)\n        })\n    };\n\n    if let Some(starknet_artifact_files) = starknet_artifact_files {\n        #[cfg(feature = \"cairo-native\")]\n        let starknet_artifact_files = starknet_artifact_files.compile_native(run_native);\n        starknet_artifact_files.load_contracts_artifacts()\n    } else {\n        Ok(HashMap::default())\n    }\n}\n\n#[must_use]\npub fn target_dir_for_workspace(metadata: &Metadata) -> Utf8PathBuf {\n    metadata\n        .target_dir\n        .clone()\n        .unwrap_or_else(|| metadata.workspace.root.join(\"target\"))\n}\n\n/// Get a name of the given package\npub fn name_for_package(metadata: &Metadata, package: &PackageId) -> Result<String> {\n    let package = metadata\n        .get_package(package)\n        .ok_or_else(|| anyhow!(\"Failed to find metadata for package = {package}\"))?;\n\n    Ok(package.name.clone())\n}\n\npub fn packages_from_filter(\n    metadata: &Metadata,\n    packages_filter: &PackagesFilter,\n) -> Result<Vec<PackageMetadata>> {\n    packages_filter\n        .match_many(metadata)\n        .context(\"Failed to find any packages matching the specified filter\")\n}\n\nfn matches_version_with_special_rules(\n    package_name: &str,\n    package_version: &Version,\n    version_req: &VersionReq,\n) -> bool {\n    if package_name == \"snforge_std\" {\n        let normalized_version = Version {\n            major: package_version.major,\n            minor: package_version.minor,\n            patch: package_version.patch,\n            // Clear pre-release and build metadata to handle exceptions in nightly builds and smoke tests\n            pre: Prerelease::EMPTY,\n            build: BuildMetadata::EMPTY,\n        };\n        version_req.matches(&normalized_version)\n    } else {\n        version_req.matches(package_version)\n    }\n}\n\n/// Checks if the specified package has version compatible with the specified requirement\npub fn package_matches_version_requirement(\n    metadata: &Metadata,\n    name: &str,\n    version_req: &VersionReq,\n) -> Result<bool> {\n    let mut packages = metadata\n        .packages\n        .iter()\n        .filter(|package| package.name == name);\n\n    match (packages.next(), packages.next()) {\n        (Some(package), None) => Ok(matches_version_with_special_rules(\n            name,\n            &package.version,\n            version_req,\n        )),\n        (None, None) => Err(anyhow!(\"Package {name} is not present in dependencies.\")),\n        _ => Err(anyhow!(\"Package {name} is duplicated in dependencies\")),\n    }\n}\n\n/// collecting by name allow us to dedup targets\n/// we do it because they use same sierra and we display them without distinction anyway\n#[must_use]\npub fn test_targets_by_name(package: &PackageMetadata) -> HashMap<String, &TargetMetadata> {\n    fn test_target_name(target: &TargetMetadata) -> String {\n        // this is logic copied from scarb: https://github.com/software-mansion/scarb/blob/90ab01cb6deee48210affc2ec1dc94d540ab4aea/extensions/scarb-cairo-test/src/main.rs#L115\n        target\n            .params\n            .get(\"group-id\") // by unit tests grouping\n            .and_then(|v| v.as_str())\n            .map(ToString::to_string)\n            .unwrap_or(target.name.clone()) // else by integration test name\n    }\n\n    package\n        .targets\n        .iter()\n        .filter(|target| target.kind == \"test\")\n        .map(|target| (test_target_name(target), target))\n        .collect()\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use crate::metadata::metadata_for_dir;\n    use assert_fs::TempDir;\n    use assert_fs::fixture::{FileWriteStr, PathChild, PathCopy};\n    use camino::Utf8PathBuf;\n    use indoc::{formatdoc, indoc};\n    use std::fs;\n    use std::str::FromStr;\n\n    pub(crate) fn setup_package(package_name: &str) -> TempDir {\n        let temp = TempDir::new().unwrap();\n        temp.copy_from(\n            format!(\"tests/data/{package_name}\"),\n            &[\"**/*.cairo\", \"**/*.toml\"],\n        )\n        .unwrap();\n        temp.copy_from(\"../../\", &[\".tool-versions\"]).unwrap();\n\n        let snforge_std_path = Utf8PathBuf::from_str(\"../../snforge_std\")\n            .unwrap()\n            .canonicalize_utf8()\n            .unwrap()\n            .to_string()\n            .replace('\\\\', \"/\");\n\n        let manifest_path = temp.child(\"Scarb.toml\");\n        manifest_path\n            .write_str(&formatdoc!(\n                r#\"\n                [package]\n                name = \"{}\"\n                version = \"0.1.0\"\n\n                [dependencies]\n                starknet = \"2.4.0\"\n                snforge_std = {{ path = \"{}\" }}\n\n                [[target.starknet-contract]]\n\n                [[tool.snforge.fork]]\n                name = \"FIRST_FORK_NAME\"\n                url = \"http://some.rpc.url\"\n                block_id.number = \"1\"\n\n                [[tool.snforge.fork]]\n                name = \"SECOND_FORK_NAME\"\n                url = \"http://some.rpc.url\"\n                block_id.hash = \"1\"\n\n                [[tool.snforge.fork]]\n                name = \"THIRD_FORK_NAME\"\n                url = \"http://some.rpc.url\"\n                block_id.tag = \"latest\"\n                \"#,\n                package_name,\n                snforge_std_path\n            ))\n            .unwrap();\n\n        temp\n    }\n\n    #[test]\n    fn get_starknet_artifacts_path_for_standard_build() {\n        let temp = setup_package(\"basic_package\");\n\n        ScarbCommand::new_with_stdio()\n            .current_dir(temp.path())\n            .arg(\"build\")\n            .run()\n            .unwrap();\n\n        let ui = UI::default();\n        let path = get_starknet_artifacts_path(\n            &Utf8PathBuf::from_path_buf(temp.to_path_buf().join(\"target\").join(\"dev\")).unwrap(),\n            \"basic_package\",\n            &ui,\n        )\n        .unwrap();\n\n        assert_eq!(\n            path,\n            StarknetArtifactsFiles::new(\n                Utf8PathBuf::from_path_buf(\n                    temp.path()\n                        .join(\"target/dev/basic_package.starknet_artifacts.json\")\n                )\n                .unwrap(),\n                vec![]\n            )\n        );\n    }\n\n    #[test]\n    fn get_starknet_artifacts_path_for_test_build() {\n        let temp = setup_package(\"basic_package\");\n\n        ScarbCommand::new_with_stdio()\n            .current_dir(temp.path())\n            .arg(\"build\")\n            .arg(\"--test\")\n            .run()\n            .unwrap();\n\n        let metadata = metadata_for_dir(temp.path()).unwrap();\n\n        let package = metadata\n            .packages\n            .iter()\n            .find(|p| p.name == \"basic_package\")\n            .unwrap();\n\n        let path = get_starknet_artifacts_paths_from_test_targets(\n            &Utf8PathBuf::from_path_buf(temp.join(\"target\").join(\"dev\")).unwrap(),\n            &test_targets_by_name(package),\n        )\n        .unwrap();\n\n        assert_eq!(\n            path,\n            StarknetArtifactsFiles::new(\n                Utf8PathBuf::from_path_buf(\n                    temp.path()\n                        .join(\"target/dev/basic_package_unittest.test.starknet_artifacts.json\")\n                )\n                .unwrap(),\n                vec![],\n            )\n        );\n    }\n\n    #[test]\n    fn get_starknet_artifacts_path_for_test_build_when_integration_tests_exist() {\n        let temp = setup_package(\"basic_package\");\n        let tests_dir = temp.join(\"tests\");\n        fs::create_dir(&tests_dir).unwrap();\n\n        temp.child(tests_dir.join(\"test.cairo\"))\n            .write_str(indoc!(\n                r\"\n                #[test]\n                fn mock_test() {\n                    assert!(true);\n                }\n            \"\n            ))\n            .unwrap();\n\n        ScarbCommand::new_with_stdio()\n            .current_dir(temp.path())\n            .arg(\"build\")\n            .arg(\"--test\")\n            .run()\n            .unwrap();\n\n        let metadata = metadata_for_dir(temp.path()).unwrap();\n\n        let package = metadata\n            .packages\n            .iter()\n            .find(|p| p.name == \"basic_package\")\n            .unwrap();\n\n        let path = get_starknet_artifacts_paths_from_test_targets(\n            &Utf8PathBuf::from_path_buf(temp.to_path_buf().join(\"target\").join(\"dev\")).unwrap(),\n            &test_targets_by_name(package),\n        )\n        .unwrap();\n\n        assert_eq!(\n            path,\n            StarknetArtifactsFiles::new(\n                Utf8PathBuf::from_path_buf(\n                    temp.path().join(\n                        \"target/dev/basic_package_integrationtest.test.starknet_artifacts.json\"\n                    )\n                )\n                .unwrap(),\n                vec![\n                    Utf8PathBuf::from_path_buf(\n                        temp.path()\n                            .join(\"target/dev/basic_package_unittest.test.starknet_artifacts.json\")\n                    )\n                    .unwrap(),\n                ]\n            ),\n        );\n    }\n\n    #[test]\n    fn package_matches_version_requirement_test() {\n        let temp = setup_package(\"basic_package\");\n\n        let manifest_path = temp.child(\"Scarb.toml\");\n        manifest_path\n            .write_str(&formatdoc!(\n                r#\"\n                [package]\n                name = \"version_checker\"\n                version = \"0.1.0\"\n\n                [[target.starknet-contract]]\n                sierra = true\n\n                [dependencies]\n                starknet = \"2.9.4\"\n                \"#,\n            ))\n            .unwrap();\n\n        let scarb_metadata = metadata_for_dir(temp.path()).unwrap();\n\n        assert!(\n            package_matches_version_requirement(\n                &scarb_metadata,\n                \"starknet\",\n                &VersionReq::parse(\"2.12.0\").unwrap(),\n            )\n            .unwrap()\n        );\n\n        assert!(\n            package_matches_version_requirement(\n                &scarb_metadata,\n                \"not_existing\",\n                &VersionReq::parse(\"2.5\").unwrap(),\n            )\n            .is_err()\n        );\n\n        assert!(\n            !package_matches_version_requirement(\n                &scarb_metadata,\n                \"starknet\",\n                &VersionReq::parse(\"2.20\").unwrap(),\n            )\n            .unwrap()\n        );\n    }\n\n    #[test]\n    fn get_starknet_artifacts_path_for_project_with_different_package_and_target_name() {\n        let temp = setup_package(\"basic_package\");\n\n        let snforge_std_path = Utf8PathBuf::from_str(\"../../snforge_std\")\n            .unwrap()\n            .canonicalize_utf8()\n            .unwrap()\n            .to_string()\n            .replace('\\\\', \"/\");\n\n        let scarb_path = temp.child(\"Scarb.toml\");\n        scarb_path\n            .write_str(&formatdoc!(\n                r#\"\n                [package]\n                name = \"basic_package\"\n                version = \"0.1.0\"\n\n                [dependencies]\n                starknet = \"2.4.0\"\n                snforge_std = {{ path = \"{}\" }}\n\n                [[target.starknet-contract]]\n                name = \"essa\"\n                sierra = true\n                \"#,\n                snforge_std_path\n            ))\n            .unwrap();\n\n        ScarbCommand::new_with_stdio()\n            .current_dir(temp.path())\n            .arg(\"build\")\n            .run()\n            .unwrap();\n\n        let ui = UI::default();\n        let path = get_starknet_artifacts_path(\n            &Utf8PathBuf::from_path_buf(temp.to_path_buf().join(\"target\").join(\"dev\")).unwrap(),\n            \"essa\",\n            &ui,\n        )\n        .unwrap();\n\n        assert_eq!(\n            path,\n            StarknetArtifactsFiles::new(\n                Utf8PathBuf::from_path_buf(\n                    temp.path().join(\"target/dev/essa.starknet_artifacts.json\")\n                )\n                .unwrap(),\n                vec![]\n            )\n        );\n    }\n\n    #[test]\n    fn get_starknet_artifacts_path_for_project_without_starknet_target() {\n        let temp = setup_package(\"empty_lib\");\n\n        let manifest_path = temp.child(\"Scarb.toml\");\n        manifest_path\n            .write_str(indoc!(\n                r#\"\n            [package]\n            name = \"empty_lib\"\n            version = \"0.1.0\"\n            \"#,\n            ))\n            .unwrap();\n\n        ScarbCommand::new_with_stdio()\n            .current_dir(temp.path())\n            .arg(\"build\")\n            .run()\n            .unwrap();\n\n        let ui = UI::default();\n        let path = get_starknet_artifacts_path(\n            &Utf8PathBuf::from_path_buf(temp.to_path_buf().join(\"target\").join(\"dev\")).unwrap(),\n            \"empty_lib\",\n            &ui,\n        );\n        assert!(path.is_none());\n    }\n\n    #[test]\n    fn get_starknet_artifacts_path_for_project_without_scarb_build() {\n        let temp = setup_package(\"basic_package\");\n\n        let ui = UI::default();\n        let path = get_starknet_artifacts_path(\n            &Utf8PathBuf::from_path_buf(temp.to_path_buf().join(\"target\").join(\"dev\")).unwrap(),\n            \"basic_package\",\n            &ui,\n        );\n        assert!(path.is_none());\n    }\n\n    #[test]\n    fn get_contracts() {\n        let temp = setup_package(\"basic_package\");\n\n        ScarbCommand::new_with_stdio()\n            .current_dir(temp.path())\n            .arg(\"build\")\n            .run()\n            .unwrap();\n\n        let metadata = metadata_for_dir(temp.path()).unwrap();\n\n        let target_dir = target_dir_for_workspace(&metadata).join(\"dev\");\n        let package = metadata.packages.first().unwrap();\n\n        let ui = UI::default();\n        let contracts = get_contracts_artifacts_and_source_sierra_paths(\n            target_dir.as_path(),\n            package,\n            &ui,\n            CompilationOpts {\n                use_test_target_contracts: false,\n                #[cfg(feature = \"cairo-native\")]\n                run_native: true,\n            },\n        )\n        .unwrap();\n\n        assert!(contracts.contains_key(\"ERC20\"));\n        assert!(contracts.contains_key(\"HelloStarknet\"));\n\n        let sierra_contents_erc20 =\n            fs::read_to_string(temp.join(\"target/dev/basic_package_ERC20.contract_class.json\"))\n                .unwrap();\n\n        let contract = contracts.get(\"ERC20\").unwrap();\n        assert_eq!(&sierra_contents_erc20, &contract.0.sierra);\n\n        let sierra_contents_erc20 = fs::read_to_string(\n            temp.join(\"target/dev/basic_package_HelloStarknet.contract_class.json\"),\n        )\n        .unwrap();\n        let contract = contracts.get(\"HelloStarknet\").unwrap();\n        assert_eq!(&sierra_contents_erc20, &contract.0.sierra);\n    }\n\n    #[test]\n    fn get_name_for_package() {\n        let temp = setup_package(\"basic_package\");\n        let scarb_metadata = metadata_for_dir(temp.path()).unwrap();\n\n        let package_name =\n            name_for_package(&scarb_metadata, &scarb_metadata.workspace.members[0]).unwrap();\n\n        assert_eq!(&package_name, \"basic_package\");\n    }\n}\n"
  },
  {
    "path": "crates/scarb-api/src/manifest.rs",
    "content": "use anyhow::{Context, Result};\nuse camino::{Utf8Path, Utf8PathBuf};\nuse std::fs;\nuse toml_edit::{DocumentMut, Item, value};\n\npub struct ManifestEditor {\n    path: Utf8PathBuf,\n}\n\nimpl ManifestEditor {\n    #[must_use]\n    pub fn new(manifest_path: &Utf8Path) -> Self {\n        Self {\n            path: manifest_path.to_owned(),\n        }\n    }\n\n    pub fn set_inlining_strategy(&self, threshold: u32, profile: &str) -> Result<()> {\n        let content = fs::read_to_string(&self.path)?;\n        let mut doc = content\n            .parse::<DocumentMut>()\n            .context(\"Failed to parse Scarb.toml\")?;\n\n        let profile_table = doc\n            .entry(\"profile\")\n            .or_insert(toml_edit::Item::Table(toml_edit::Table::new()))\n            .as_table_mut()\n            .context(\"Invalid profile section\")?;\n\n        let profile_entry = profile_table\n            .entry(profile)\n            .or_insert(toml_edit::Item::Table(toml_edit::Table::new()))\n            .as_table_mut()\n            .context(\"Invalid profile entry\")?;\n\n        let cairo_table = profile_entry\n            .entry(\"cairo\")\n            .or_insert(toml_edit::Item::Table(toml_edit::Table::new()))\n            .as_table_mut()\n            .context(\"Invalid cairo section\")?;\n\n        cairo_table[\"inlining-strategy\"] = value(i64::from(threshold));\n\n        fs::write(&self.path, doc.to_string())?;\n        Ok(())\n    }\n}\n\npub fn overwrite_starknet_contract_target_flags(doc: &mut DocumentMut) -> bool {\n    let Some(target_item) = doc.as_table_mut().get_mut(\"target\") else {\n        return false;\n    };\n    let Item::Table(target_table) = target_item else {\n        return false;\n    };\n    let Some(starknet_contract_item) = target_table.get_mut(\"starknet-contract\") else {\n        return false;\n    };\n    let Item::ArrayOfTables(starknet_contract_tables) = starknet_contract_item else {\n        return false;\n    };\n\n    let keys = [\"casm\", \"sierra\"];\n    let mut changed = false;\n\n    for target in starknet_contract_tables.iter_mut() {\n        for key in keys {\n            if target.get(key).and_then(Item::as_bool) != Some(true) {\n                target[key] = value(true);\n                changed = true;\n            }\n        }\n    }\n    changed\n}\n"
  },
  {
    "path": "crates/scarb-api/src/metadata.rs",
    "content": "//! Functionality for fetching `scarb` metadata.\n//!\n//! # Note:\n//! To allow more flexibility when changing internals, please make public as few items as possible\n//! and try using more general functions like `metadata` and `metadata_for_dir`\n//! instead of `metadata_with_opts`.\n\nuse crate::{ScarbUnavailableError, ensure_scarb_available};\nuse anyhow::Result;\npub use scarb_metadata::{Metadata, MetadataCommand, MetadataCommandError, PackageMetadata};\nuse std::path::PathBuf;\n\n/// Errors that can occur when fetching `scarb` metadata.\n#[derive(thiserror::Error, Debug)]\npub enum MetadataError {\n    #[error(transparent)]\n    ScarbNotFound(#[from] ScarbUnavailableError),\n    #[error(transparent)]\n    ScarbExecutionFailed(#[from] MetadataCommandError),\n}\n\n/// Options for fetching `scarb` metadata.\n#[derive(Default)]\npub struct MetadataOpts {\n    pub current_dir: Option<PathBuf>,\n    pub no_deps: bool,\n    pub profile: Option<String>,\n}\n\n/// Fetches `scarb` metadata for a specific directory.\npub fn metadata_for_dir(dir: impl Into<PathBuf>) -> Result<Metadata, MetadataError> {\n    metadata_with_opts(MetadataOpts {\n        current_dir: Some(dir.into()),\n        ..MetadataOpts::default()\n    })\n}\n\n/// Fetches `scarb` metadata for the current directory.\npub fn metadata() -> Result<Metadata, MetadataError> {\n    metadata_with_opts(MetadataOpts::default())\n}\n\n/// Fetches `scarb` metadata with specified options.\npub fn metadata_with_opts(\n    MetadataOpts {\n        current_dir,\n        no_deps,\n        profile,\n    }: MetadataOpts,\n) -> Result<Metadata, MetadataError> {\n    ensure_scarb_available()?;\n\n    let mut command = MetadataCommand::new();\n\n    if let Some(dir) = current_dir {\n        command.current_dir(dir);\n    }\n\n    if let Some(profile) = profile {\n        command.profile(profile);\n    }\n\n    if no_deps {\n        command.no_deps();\n    }\n\n    command\n        .inherit_stderr()\n        .inherit_stdout()\n        .exec()\n        .map_err(MetadataError::ScarbExecutionFailed)\n}\n"
  },
  {
    "path": "crates/scarb-api/src/version.rs",
    "content": "//! Functionality for fetching and parsing `scarb` version information.\n\nuse crate::{ScarbCommand, ScarbUnavailableError, ensure_scarb_available};\nuse regex::Regex;\nuse semver::Version;\nuse shared::command::{CommandError, CommandExt};\nuse std::collections::HashMap;\nuse std::path::Path;\nuse std::process::Output;\nuse std::sync::LazyLock;\nuse thiserror::Error;\n\n#[derive(Debug)]\npub struct ScarbVersionOutput {\n    pub scarb: Version,\n    pub cairo: Version,\n    pub sierra: Version,\n}\n\n/// Errors that can occur when fetching `scarb` version information.\n#[derive(Error, Debug)]\npub enum VersionError {\n    #[error(transparent)]\n    ScarbNotFound(#[from] ScarbUnavailableError),\n\n    #[error(\"Failed to execute `scarb --version`: {0}\")]\n    CommandExecutionError(#[from] CommandError),\n\n    #[error(\"Could not parse version for tool `{0}`: {1}\")]\n    VersionParseError(String, #[source] semver::Error),\n\n    #[error(\"Missing version entry for `{0}`\")]\n    MissingToolVersion(String),\n}\n\n/// Fetches `scarb` version information for the current directory.\npub fn scarb_version() -> Result<ScarbVersionOutput, VersionError> {\n    scarb_version_internal(None)\n}\n\n/// Fetches `scarb` version information for a specific directory.\npub fn scarb_version_for_dir(dir: impl AsRef<Path>) -> Result<ScarbVersionOutput, VersionError> {\n    scarb_version_internal(Some(dir.as_ref()))\n}\n\n/// Internal function to fetch `scarb` version information.\nfn scarb_version_internal(dir: Option<&Path>) -> Result<ScarbVersionOutput, VersionError> {\n    let output = run_version_command(dir)?;\n    parse_version_output(&output)\n}\n\n/// Runs the `scarb --version` command in the specified directory.\nfn run_version_command(dir: Option<&Path>) -> Result<Output, VersionError> {\n    ensure_scarb_available()?;\n    let mut scarb_version_command = ScarbCommand::new().arg(\"--version\").command();\n\n    if let Some(path) = dir {\n        scarb_version_command.current_dir(path);\n    }\n\n    Ok(scarb_version_command.output_checked()?)\n}\n\n/// Parses the output of the `scarb --version` command.\nfn parse_version_output(output: &Output) -> Result<ScarbVersionOutput, VersionError> {\n    let output_str = str::from_utf8(&output.stdout).expect(\"valid UTF-8 from scarb\");\n\n    let mut versions = extract_versions(output_str)?;\n\n    let mut get_version = |tool: &str| {\n        versions\n            .remove(tool)\n            .ok_or_else(|| VersionError::MissingToolVersion(tool.into()))\n    };\n\n    Ok(ScarbVersionOutput {\n        scarb: get_version(\"scarb\")?,\n        cairo: get_version(\"cairo\")?,\n        sierra: get_version(\"sierra\")?,\n    })\n}\n\n/// Extracts tool versions from the version output string.\nfn extract_versions(version_output: &str) -> Result<HashMap<String, Version>, VersionError> {\n    // https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\n    static VERSION_REGEX: LazyLock<Regex> = LazyLock::new(|| {\n        Regex::new(r\"(?P<tool>[\\w-]+):?\\s(?P<ver>\\d+\\.\\d+\\.\\d+(?:-[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?(?:\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?)\").expect(\"this should be a valid regex\")\n    });\n\n    VERSION_REGEX\n        .captures_iter(version_output)\n        .map(|cap| {\n            let tool = cap\n                .name(\"tool\")\n                .expect(\"regex ensures tool name exists\")\n                .as_str()\n                .to_string();\n\n            let ver_str = cap\n                .name(\"ver\")\n                .expect(\"regex ensures version string exists\")\n                .as_str();\n\n            Version::parse(ver_str)\n                .map_err(|e| VersionError::VersionParseError(tool.clone(), e))\n                .map(|version| (tool, version))\n        })\n        .collect()\n}\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use std::process::{ExitStatus, Output};\n\n    #[test]\n    fn test_happy_case() {\n        scarb_version().unwrap();\n    }\n\n    #[test]\n    fn test_extract_versions_basic_output() {\n        let version_output = \"scarb 0.2.1\\ncairo 1.1.0\\nsierra 1.0.0\";\n        let map = extract_versions(version_output).unwrap();\n\n        assert_eq!(map[\"scarb\"], Version::parse(\"0.2.1\").unwrap());\n        assert_eq!(map[\"cairo\"], Version::parse(\"1.1.0\").unwrap());\n        assert_eq!(map[\"sierra\"], Version::parse(\"1.0.0\").unwrap());\n    }\n\n    #[test]\n    fn test_extract_versions_with_colons_and_prerelease() {\n        let version_output =\n            \"scarb: 0.2.1-alpha.1\\ncairo: 1.1.0+meta\\nsierra: 1.0.0-beta+exp.build\";\n        let map = extract_versions(version_output).unwrap();\n\n        assert_eq!(map[\"scarb\"], Version::parse(\"0.2.1-alpha.1\").unwrap());\n        assert_eq!(map[\"cairo\"], Version::parse(\"1.1.0+meta\").unwrap());\n        assert_eq!(\n            map[\"sierra\"],\n            Version::parse(\"1.0.0-beta+exp.build\").unwrap()\n        );\n    }\n\n    #[test]\n    fn test_missing_tool_versions() {\n        let version_output = \"scarb 0.2.1\\ncairo 1.1.0\"; // Missing sierra\n\n        let output = Output {\n            status: ExitStatus::default(),\n            stdout: version_output.as_bytes().to_vec(),\n            stderr: vec![],\n        };\n\n        let result = parse_version_output(&output);\n\n        assert!(\n            matches!(result, Err(VersionError::MissingToolVersion(ref tool)) if tool == \"sierra\")\n        );\n    }\n\n    #[test]\n    fn test_extract_versions_extra_tools() {\n        let version_output = \"scarb 0.2.1\\ncairo 1.1.0\\nsierra 1.0.0\\nextra-tool: 2.3.4\";\n        let map = extract_versions(version_output).unwrap();\n\n        assert_eq!(map[\"extra-tool\"], Version::parse(\"2.3.4\").unwrap());\n    }\n}\n"
  },
  {
    "path": "crates/scarb-api/tests/data/basic_package/Scarb.toml",
    "content": "[package]\nname = \"basic_package\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\nsnforge_std = { path = \"../../../../../snforge_std\" }\n\n[[target.starknet-contract]]\n"
  },
  {
    "path": "crates/scarb-api/tests/data/basic_package/src/lib.cairo",
    "content": "#[starknet::contract]\nmod HelloStarknet {\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n}\n\n#[starknet::contract]\nmod ERC20 {\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n}\n"
  },
  {
    "path": "crates/scarb-api/tests/data/empty_lib/Scarb.toml",
    "content": "[package]\nname = \"empty_lib\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n"
  },
  {
    "path": "crates/scarb-api/tests/data/empty_lib/src/lib.cairo",
    "content": "\n"
  },
  {
    "path": "crates/shared/Cargo.toml",
    "content": "[package]\nname = \"shared\"\nversion = \"0.1.0\"\nedition.workspace = true\n\n[dependencies]\nstarknet_api.workspace = true\nanyhow.workspace = true\nstarknet-types-core.workspace = true\nconsole.workspace = true\nsemver.workspace = true\nstarknet-rust.workspace = true\nurl.workspace = true\nregex.workspace = true\nsnapbox.workspace = true\nindicatif.workspace = true\nclap.workspace = true\nclap_complete.workspace = true\ncairo-vm.workspace = true\nnum-traits.workspace = true\nfoundry-ui ={ path = \"../foundry-ui\" }\nthiserror = \"2.0.17\"\n\n[features]\ntesting = []\n"
  },
  {
    "path": "crates/shared/src/auto_completions.rs",
    "content": "use anyhow::Result;\nuse clap::{Args, Command};\nuse clap_complete::{Generator, Shell};\nuse std::io;\n\n#[derive(Args, Debug)]\npub struct Completions {\n    pub shell: Option<Shell>,\n}\n\npub fn generate_completions_to_stdout<G: Generator>(shell: G, cmd: &mut Command) {\n    clap_complete::generate(shell, cmd, cmd.get_name().to_string(), &mut io::stdout());\n}\n\n// TODO(#3960) JSON output support\npub fn generate_completions(shell: Option<Shell>, cmd: &mut Command) -> Result<()> {\n    let Some(shell) = shell.or_else(Shell::from_env) else {\n        anyhow::bail!(\"Unsupported shell\")\n    };\n\n    generate_completions_to_stdout(shell, cmd);\n\n    Ok(())\n}\n"
  },
  {
    "path": "crates/shared/src/command.rs",
    "content": "use std::io;\nuse std::process::{Command, ExitStatus, Output};\nuse thiserror::Error;\n\n/// Error type for command execution failures\n#[derive(Debug, Error)]\npub enum CommandError {\n    #[error(\"Failed to run {command}: {source}\")]\n    IoError {\n        command: String,\n        #[source]\n        source: io::Error,\n    },\n\n    #[error(\"Command {command} failed with status {status}\")]\n    FailedStatus { command: String, status: ExitStatus },\n}\n\n/// Trait extension for Command to check output status\npub trait CommandExt {\n    fn output_checked(&mut self) -> Result<Output, CommandError>;\n}\n\nimpl CommandExt for Command {\n    fn output_checked(&mut self) -> Result<Output, CommandError> {\n        let command = self.get_program().to_string_lossy().to_string();\n\n        match self.output() {\n            Ok(output) => {\n                if output.status.success() {\n                    Ok(output)\n                } else {\n                    Err(CommandError::FailedStatus {\n                        command,\n                        status: output.status,\n                    })\n                }\n            }\n            Err(source) => Err(CommandError::IoError { command, source }),\n        }\n    }\n}\n"
  },
  {
    "path": "crates/shared/src/consts.rs",
    "content": "pub const EXPECTED_RPC_VERSION: &str = \"0.10.0\";\npub const RPC_URL_VERSION: &str = \"v0_10\";\npub const SNFORGE_TEST_FILTER: &str = \"SNFORGE_TEST_FILTER\";\npub const FREE_RPC_PROVIDER_URL: &str = \"https://api.zan.top/public/starknet-sepolia/rpc/v0_10\";\n"
  },
  {
    "path": "crates/shared/src/lib.rs",
    "content": "use crate::consts::EXPECTED_RPC_VERSION;\nuse crate::rpc::{get_rpc_version, is_expected_version};\nuse anyhow::Result;\nuse foundry_ui::UI;\nuse foundry_ui::components::warning::WarningMessage;\nuse starknet_rust::providers::JsonRpcClient;\nuse starknet_rust::providers::jsonrpc::HttpTransport;\nuse std::fmt::Display;\n\npub mod auto_completions;\npub mod command;\npub mod consts;\npub mod rpc;\npub mod spinner;\npub mod test_utils;\npub mod utils;\npub mod vm;\n\npub async fn verify_and_warn_if_incompatible_rpc_version(\n    client: &JsonRpcClient<HttpTransport>,\n    url: impl Display,\n    ui: &UI,\n) -> Result<()> {\n    let node_spec_version = get_rpc_version(client).await?;\n\n    if !is_expected_version(&node_spec_version) {\n        ui.println(&WarningMessage::new(&format!(\n            \"RPC node with the url {url} uses incompatible version {node_spec_version}. Expected version: {EXPECTED_RPC_VERSION}\")));\n    }\n\n    Ok(())\n}\n"
  },
  {
    "path": "crates/shared/src/rpc.rs",
    "content": "use crate::consts::EXPECTED_RPC_VERSION;\nuse anyhow::{Context, Result};\nuse semver::{Version, VersionReq};\nuse starknet_rust::core::types::{BlockId, BlockTag};\nuse starknet_rust::providers::jsonrpc::HttpTransport;\nuse starknet_rust::providers::{JsonRpcClient, Provider};\nuse std::str::FromStr;\nuse url::Url;\n\npub fn create_rpc_client(url: &Url) -> Result<JsonRpcClient<HttpTransport>> {\n    let client = JsonRpcClient::new(HttpTransport::new(url.clone()));\n    Ok(client)\n}\n\n#[must_use]\npub fn is_expected_version(version: &Version) -> bool {\n    VersionReq::from_str(EXPECTED_RPC_VERSION)\n        .expect(\"Failed to parse the expected RPC version\")\n        .matches(version)\n}\n\npub async fn get_rpc_version(client: &JsonRpcClient<HttpTransport>) -> Result<Version> {\n    client\n        .spec_version()\n        .await\n        .context(\"Error while calling RPC method spec_version\")?\n        .parse::<Version>()\n        .context(\"Failed to parse RPC spec version\")\n}\n\npub async fn get_starknet_version(client: &JsonRpcClient<HttpTransport>) -> Result<String> {\n    client\n        .starknet_version(BlockId::Tag(BlockTag::PreConfirmed))\n        .await\n        .context(\"Error while getting Starknet version from the RPC provider\")\n}\n"
  },
  {
    "path": "crates/shared/src/spinner.rs",
    "content": "use indicatif::{ProgressBar, ProgressStyle};\nuse std::borrow::Cow;\nuse std::time::Duration;\n\n/// Styled spinner that uses [`ProgressBar`].\n/// Automatically finishes and clears itself when dropped.\npub struct Spinner(ProgressBar);\nimpl Spinner {\n    /// Create [`Spinner`] with a message.\n    pub fn create_with_message(message: impl Into<Cow<'static, str>>) -> Self {\n        let spinner = ProgressBar::new_spinner();\n        let style = ProgressStyle::with_template(\"\\n{spinner} {msg}\\n\")\n            .expect(\"template is static str and should be valid\");\n        spinner.set_style(style);\n        spinner.enable_steady_tick(Duration::from_millis(100));\n        spinner.set_message(message);\n        Self(spinner)\n    }\n}\n\nimpl Drop for Spinner {\n    fn drop(&mut self) {\n        self.0.finish_and_clear();\n    }\n}\n"
  },
  {
    "path": "crates/shared/src/test_utils/mod.rs",
    "content": "pub mod node_url;\npub mod output_assert;\n"
  },
  {
    "path": "crates/shared/src/test_utils/node_url.rs",
    "content": "use url::Url;\n\n/// #### Note:\n/// - `node_rpc_url()` -> <https://example.com/rpc/v0_7>\n/// - `node_url()` -> <https://example.com/>\n#[must_use]\npub fn node_rpc_url() -> Url {\n    Url::parse(\"http://188.34.188.184:7070/rpc/v0_10\").expect(\"Failed to parse the sepolia RPC URL\")\n}\n\n/// returning URL with no slug (`rpc/v0_7` suffix).\n#[must_use]\npub fn node_url() -> Url {\n    let mut node_url = node_rpc_url();\n    node_url.set_path(\"\");\n    node_url.set_query(None);\n\n    node_url\n}\n"
  },
  {
    "path": "crates/shared/src/test_utils/output_assert.rs",
    "content": "use regex::Regex;\nuse snapbox::cmd::OutputAssert;\nuse std::fmt::Write as _;\n\npub trait AsOutput {\n    fn as_stdout(&self) -> &str;\n    fn as_stderr(&self) -> &str;\n}\n\nimpl AsOutput for OutputAssert {\n    fn as_stdout(&self) -> &str {\n        std::str::from_utf8(&self.get_output().stdout).unwrap()\n    }\n    fn as_stderr(&self) -> &str {\n        std::str::from_utf8(&self.get_output().stderr).unwrap()\n    }\n}\n\nimpl AsOutput for String {\n    fn as_stdout(&self) -> &str {\n        self\n    }\n    fn as_stderr(&self) -> &str {\n        self\n    }\n}\n\nfn find_with_wildcard(line: &str, actual: &[&str]) -> Option<usize> {\n    let escaped = regex::escape(line);\n    let replaced = escaped.replace(\"\\\\[\\\\.\\\\.\\\\]\", \".*\");\n    let wrapped = format!(\"^{replaced}$\");\n    let re = Regex::new(wrapped.as_str()).unwrap();\n\n    actual.iter().position(|other| re.is_match(other))\n}\n\nfn is_present(line: &str, actual: &mut Vec<&str>) -> bool {\n    let position = find_with_wildcard(line, actual);\n    if let Some(position) = position {\n        actual.remove(position);\n        return true;\n    }\n    false\n}\n\nfn assert_output_contains(output: &str, lines: &str, assert_prefix: Option<String>) {\n    let asserted_lines = lines.lines();\n    let mut actual_lines: Vec<&str> = output.lines().collect();\n    let mut contains = true;\n    let mut out = String::new();\n\n    for line in asserted_lines {\n        if is_present(line, &mut actual_lines) {\n            writeln!(out, \"| {line}\").unwrap();\n        } else {\n            contains = false;\n            writeln!(out, \"- {line}\").unwrap();\n        }\n    }\n\n    if !contains {\n        for line in &actual_lines {\n            writeln!(out, \"+ {line}\").unwrap();\n        }\n\n        let full_output = output;\n        if let Some(assert_prefix) = assert_prefix {\n            panic!(\n                \"{assert_prefix} Output does not match.\\n\\n\\\n                 --- FULL OUTPUT ---\\n\\\n                 {full_output}\\n\\n\\\n                 --- DIFF ---\\n\\\n                 {out}\"\n            );\n        } else {\n            panic!(\n                \"Output does not match.\\n\\n\\\n                 --- FULL OUTPUT ---\\n\\\n                 {full_output}\\n\\n\\\n                 --- DIFF ---\\n\\\n                 {out}\"\n            );\n        }\n    }\n}\n\n#[expect(clippy::needless_pass_by_value)]\npub fn case_assert_stdout_contains(case: String, output: impl AsOutput, lines: impl AsRef<str>) {\n    let stdout = output.as_stdout();\n\n    assert_output_contains(stdout, lines.as_ref(), Some(format!(\"Case {case}: \")));\n}\n\n#[expect(clippy::needless_pass_by_value)]\npub fn assert_stdout_contains(output: impl AsOutput, lines: impl AsRef<str>) {\n    let stdout = output.as_stdout();\n\n    assert_output_contains(stdout, lines.as_ref(), None);\n}\n\n#[expect(clippy::needless_pass_by_value)]\npub fn assert_stderr_contains(output: impl AsOutput, lines: impl AsRef<str>) {\n    let stderr = output.as_stderr();\n\n    assert_output_contains(stderr, lines.as_ref(), None);\n}\n\nfn assert_output(output: &str, lines: &str) {\n    let converted_pattern = regex::escape(lines).replace(r\"\\[\\.\\.\\]\", \".*\");\n    let re = Regex::new(&converted_pattern).unwrap();\n    assert!(\n        re.is_match(output),\n        \"Pattern not found in output. Expected pattern:\\n{lines}\\n\\nGot:\\n{output}\",\n    );\n}\n\n#[expect(clippy::needless_pass_by_value)]\npub fn assert_stdout(output: impl AsOutput, lines: impl AsRef<str>) {\n    let stdout = output.as_stdout();\n\n    assert_output(stdout, lines.as_ref());\n}\n"
  },
  {
    "path": "crates/shared/src/utils.rs",
    "content": "use starknet_api::execution_utils::format_panic_data;\nuse starknet_types_core::felt::Felt;\n\n/// Helper function to build readable text from run data.\n#[must_use]\npub fn build_readable_text(data: &[Felt]) -> Option<String> {\n    if data.is_empty() {\n        return None;\n    }\n\n    let string = format_panic_data(data);\n\n    let mut result = indent_string(&format!(\"\\n{string}\"));\n    result.push('\\n');\n    Some(result)\n}\n\nfn indent_string(string: &str) -> String {\n    let without_trailing = string.strip_suffix('\\n').unwrap_or(string);\n    let indented = without_trailing.replace('\\n', \"\\n    \");\n    let should_append_newline = string.ends_with('\\n');\n\n    if should_append_newline {\n        format!(\"{indented}\\n\")\n    } else {\n        indented\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::indent_string;\n\n    #[test]\n    fn test_indent_string() {\n        let s = indent_string(\"\\nabc\\n\");\n        assert_eq!(s, \"\\n    abc\\n\");\n\n        let s = indent_string(\"\\nabc\");\n        assert_eq!(s, \"\\n    abc\");\n\n        let s = indent_string(\"\\nabc\\nd\");\n        assert_eq!(s, \"\\n    abc\\n    d\");\n    }\n}\n"
  },
  {
    "path": "crates/shared/src/vm.rs",
    "content": "use cairo_vm::vm::vm_core::VirtualMachine;\nuse std::iter::once;\n\npub trait VirtualMachineExt {\n    /// Return the relocated pc values corresponding to each call instruction in the traceback.\n    /// Returns the most recent call first.\n    /// # Note\n    /// Only call instructions from segment 0 (the main program segment) are included in the result.\n    /// To get the relocated PC values, we add 1 to each entry in the returned list.\n    ///\n    /// This approach works specifically because all PCs are in segment 0. And relocation table for this\n    /// segment is 1. [Ref](https://github.com/lambdaclass/cairo-vm/blob/82e465bc90f9f32a3b368e8336cc9d0963bbdca3/vm/src/vm/vm_memory/memory_segments.rs#L113)\n    ///\n    /// If the PCs were located in other segments, we would need to use a relocation table\n    /// to compute their relocated values. However, the relocation table is not publicly\n    /// accessible from within the VM, and accessing it would require replicating significant\n    /// amounts of internal implementation code.\n    fn get_reversed_pc_traceback(&self) -> Vec<usize>;\n}\n\nimpl VirtualMachineExt for VirtualMachine {\n    fn get_reversed_pc_traceback(&self) -> Vec<usize> {\n        self.get_traceback_entries()\n            .into_iter()\n            // The cairo-vm implementation doesn't include the start location, so we add it manually.\n            .chain(once((self.get_fp(), self.get_pc())))\n            .rev()\n            .map(|(_, pc)| pc)\n            .filter(|pc| pc.segment_index == 0)\n            .map(|pc| pc.offset + 1)\n            .collect()\n    }\n}\n"
  },
  {
    "path": "crates/sncast/.cargo/config.toml",
    "content": "[alias]\n\"test e2e\" = \"test --test main e2e\"\n\"test integration\" = \"test --test main integration\"\n"
  },
  {
    "path": "crates/sncast/.gitignore",
    "content": ".idea\ntests/utils/cairo\ntests/utils/scarb*\n/tests/data/contracts/**/*.tool-versions\n/tests/utils/compiler/\n.env*\ntests/data/contracts/constructor_with_params[0-9]/\ntests/data/contracts/map[0-9]/\ntests/utils/devnet\ntests/**/*state.json\n\n"
  },
  {
    "path": "crates/sncast/Cargo.toml",
    "content": "[package]\nname = \"sncast\"\ndescription = \"sncast - a Starknet Foundry CLI client\"\nversion.workspace = true\nedition.workspace = true\n\n[dependencies]\nanyhow.workspace = true\ncamino.workspace = true\nbigdecimal.workspace = true\nclap.workspace = true\nclap_complete.workspace = true\nconsole.workspace = true\nserde_json.workspace = true\nserde.workspace = true\nstarknet-rust = { workspace = true, features = [\"ledger\"] }\ntokio.workspace = true\nurl.workspace = true\nrand.workspace = true\nscarb-metadata.workspace = true\nthiserror.workspace = true\nshellexpand.workspace = true\ntoml.workspace = true\nrpassword.workspace = true\npromptly.workspace = true\nscarb-api = { path = \"../scarb-api\" }\nscarb-ui.workspace = true\nreqwest.workspace = true\nindoc.workspace = true\ntempfile.workspace = true\nruntime = { path = \"../runtime\" }\nconversions = { path = \"../conversions\" }\ndata-transformer = { path = \"../data-transformer\" }\nconfiguration = { path = \"../configuration\" }\nshared = { path = \"../shared\" }\nforge_runner = { path = \"../forge-runner\" }\ncairo-lang-runner = \"2.17.0\"\ncairo-lang-runnable-utils = \"2.17.0\"\ncairo-lang-utils.workspace = true\ncairo-lang-sierra.workspace = true\ncairo-lang-casm.workspace = true\nitertools.workspace = true\nstarknet-types-core.workspace = true\ncairo-vm.workspace = true\nblockifier.workspace = true\nsemver.workspace = true\nsha3.workspace = true\nsha2.workspace = true\nbase16ct.workspace = true\nstarknet-rust-crypto.workspace = true\nasync-trait.workspace = true\nserde_path_to_error.workspace = true\nwalkdir.workspace = true\nconst-hex.workspace = true\nregex.workspace = true\ndirs.workspace = true\ndialoguer.workspace = true\ntoml_edit.workspace = true\nnum-traits.workspace = true\nfoundry-ui = { path = \"../foundry-ui\" }\nuniversal-sierra-compiler-api = { path = \"../universal-sierra-compiler-api\" }\ntracing-subscriber.workspace = true\ntracing.workspace = true\ntracing-log.workspace = true\nstrum.workspace = true\nstrum_macros.workspace = true\nprimitive-types.workspace = true\ncoins-ledger.workspace = true\nmimalloc.workspace = true\n\n[dev-dependencies]\nctor.workspace = true\nsnapbox.workspace = true\nindoc.workspace = true\nproject-root.workspace = true\ntempfile.workspace = true\ntest-case.workspace = true\nfs_extra.workspace = true\nwiremock.workspace = true\ndocs = { workspace = true, features = [\"testing\"] }\nshared = { path = \"../shared\", features = [\"testing\"] }\npackages_validation = { path = \"../testing/packages_validation\" }\nspeculos-client.workspace = true\n\n[features]\ndefault = []\nledger-emulator = []\n\n[[bin]]\nname = \"sncast\"\npath = \"src/main.rs\"\n"
  },
  {
    "path": "crates/sncast/README.md",
    "content": "# sncast - Starknet Foundry CLI\n\nStarknet Foundry `sncast` is a command line tool for performing Starknet RPC calls. With it, you can easily interact with Starknet contracts!\n\nNote, that `sncast` only officially supports contracts written in Cairo 2.\n\n## Table of contents\n\n<!-- TOC -->\n  * [Installation](#installation)\n  * [Documentation](#documentation)\n  * [Example usages](#example-usages)\n    * [Declaring contracts](#declare-a-contract)\n    * [Deploying contracts](#deploy-a-contract)\n    * [Invoking contracts](#invoke-a-contract)\n    * [Calling contracts](#call-a-contract)\n  * [Development](#development)\n<!-- TOC -->\n\n## Installation\n\nYou can download latest version of `sncast` [here](https://github.com/foundry-rs/starknet-foundry/releases).\n\n## Documentation\n\nFor more details on Starknet Foundry `sncast`, please visit [our docs](https://foundry-rs.github.io/starknet-foundry/starknet/sncast-overview.html) \n\n## Example usages\n\nAll subcommand usages are shown for two scenarios - when all necessary arguments are supplied using CLI, and when `url`, `accounts-file` and `account` arguments are taken from `snfoundry.toml`. To learn more about configuring profiles with parameters in `snfoundry.toml` file, please refer to the [documentation](https://foundry-rs.github.io/starknet-foundry/projects/configuration.html#defining-profiles-in-snfoundrytoml).\n\n### Declare a contract\n\n<!-- TODO(#2736) -->\n<!-- { \"ignored\": true } -->\n```shell\n$ sncast --account my_account \\\n    declare \\\n    --contract-name HelloSncast\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Declaration completed\n\nClass Hash:       0x[..]\nTransaction Hash: 0x[..]\n```\n</details>\n<br>\n\nWith arguments taken from `snfoundry.toml` file (default profile name):\n\n<!-- TODO(#2736) -->\n<!-- { \"ignored\": true } -->\n```shell\n$ sncast declare \\\n    --contract-name HelloSncast\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Declaration completed\n\nClass Hash:       0x[..]\nTransaction Hash: 0x[..]\n```\n</details>\n<br>\n\n\n### Deploy a contract\n\n<!-- TODO(#2736) -->\n<!-- { \"ignored\": true } -->\n```shell\n$ sncast --account my_account \\\n    deploy --class-hash 0x0227f52a4d2138816edf8231980d5f9e6e0c8a3deab45b601a1fcee3d4427b02 \\\n    --url http://127.0.0.1:5055\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Deployment completed\n\nContract Address: 0x0[..]\nTransaction Hash: 0x0[..]\n```\n</details>\n<br>\n\nWith arguments taken from `snfoundry.toml` file (default profile name):\n\n<!-- TODO(#2736) -->\n<!-- { \"ignored\": true } -->\n```shell\n$ sncast deploy \\\n--class-hash 0x0227f52a4d2138816edf8231980d5f9e6e0c8a3deab45b601a1fcee3d4427b02 \\\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Deployment completed\n\nContract Address: 0x0[..]\nTransaction Hash: 0x0[..]\n```\n</details>\n<br>\n\n\n### Invoke a contract\n\n```shell\n$ sncast \\\n    --account my_account \\\n    invoke \\\n    --contract-address 0x0589a8b8bf819b7820cb699ea1f6c409bc012c9b9160106ddc3dacd6a89653cf \\\n    --function \"sum_numbers\" \\\n    --arguments '1, 2, 3' \\\n    --url http://127.0.0.1:5055/rpc\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Invoke completed\n\nTransaction Hash: [..]\n\nTo see invocation details, visit:\ntransaction: https://sepolia.voyager.online/tx/[..]\n```\n</details>\n<br>\n\n\nWith arguments taken from `snfoundry.toml` file (default profile name):\n\n```shell\n$ sncast invoke \\\n    --contract-address 0x0589a8b8bf819b7820cb699ea1f6c409bc012c9b9160106ddc3dacd6a89653cf \\\n    --function \"sum_numbers\" \\\n    --arguments '1, 2, 3' \\\n    --url http://127.0.0.1:5055/rpc\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Invoke completed\n\nTransaction Hash: [..]\n\nTo see invocation details, visit:\ntransaction: https://sepolia.voyager.online/tx/[..]\n```\n</details>\n<br>\n\n### Call a contract\n\n```shell\n$ sncast \\\n    call \\\n    --contract-address 0x0589a8b8bf819b7820cb699ea1f6c409bc012c9b9160106ddc3dacd6a89653cf \\\n    --function \"sum_numbers\" \\\n    --arguments '1, 2, 3' \\\n    --url http://127.0.0.1:5055/rpc\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Call completed\n\nResponse:     0x6\nResponse Raw: [0x6]\n```\n</details>\n<br>\n\n\nWith arguments taken from `snfoundry.toml` file (default profile name):\n\n```shell\n$ sncast call \\\n    --contract-address 0x0589a8b8bf819b7820cb699ea1f6c409bc012c9b9160106ddc3dacd6a89653cf \\\n    --function \"sum_numbers\" \\\n    --arguments '1, 2, 3' \\\n    --url http://127.0.0.1:5055/rpc\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Call completed\n\nResponse:     0x6\nResponse Raw: [0x6]\n```\n</details>\n<br>\n\n\n## Development\n\nRefer to [documentation](https://foundry-rs.github.io/starknet-foundry/development/environment-setup.html) to make sure you have all the pre-requisites, and to obtain an information on how to help to develop `sncast`.\n\nPlease make sure you're using scarb installed via asdf - otherwise some tests may fail.\nTo verify, run:\n\n```shell\n$ which scarb\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\n$HOME/.asdf/shims/scarb\n```\n</details>\n<br>\n\nIf you previously installed scarb using official installer, you may need to remove this installation or modify your PATH to make sure asdf installed one is always used.\n"
  },
  {
    "path": "crates/sncast/src/helpers/account.rs",
    "content": "use crate::{\n    NestedMap, build_account, check_account_file_exists, helpers::devnet::provider::DevnetProvider,\n};\nuse anyhow::{Result, ensure};\nuse camino::Utf8PathBuf;\nuse starknet_rust::{\n    accounts::SingleOwnerAccount,\n    providers::{JsonRpcClient, Provider, jsonrpc::HttpTransport},\n    signers::LocalWallet,\n};\nuse std::collections::{HashMap, HashSet};\nuse std::fs;\nuse url::Url;\n\nuse crate::{AccountData, read_and_parse_json_file};\nuse anyhow::Context;\nuse serde_json::{Value, json};\n\npub fn generate_account_name(accounts_file: &Utf8PathBuf) -> Result<String> {\n    let mut id = 1;\n\n    if !accounts_file.exists() {\n        return Ok(format!(\"account-{id}\"));\n    }\n\n    let networks: NestedMap<AccountData> = read_and_parse_json_file(accounts_file)?;\n    let mut result = HashSet::new();\n\n    for (_, accounts) in networks {\n        for (name, _) in accounts {\n            if let Some(id) = name\n                .strip_prefix(\"account-\")\n                .and_then(|id| id.parse::<u32>().ok())\n            {\n                result.insert(id);\n            }\n        }\n    }\n\n    while result.contains(&id) {\n        id += 1;\n    }\n\n    Ok(format!(\"account-{id}\"))\n}\n\npub fn load_accounts(accounts_file: &Utf8PathBuf) -> Result<Value> {\n    let contents = fs::read_to_string(accounts_file).context(\"Failed to read accounts file\")?;\n\n    if contents.trim().is_empty() {\n        return Ok(json!({}));\n    }\n\n    let accounts = serde_json::from_str(&contents)\n        .with_context(|| format!(\"Failed to parse accounts file at = {accounts_file}\"))?;\n\n    Ok(accounts)\n}\n\npub fn check_account_exists(\n    account_name: &str,\n    network_name: &str,\n    accounts_file: &Utf8PathBuf,\n) -> Result<bool> {\n    check_account_file_exists(accounts_file)?;\n\n    let accounts: HashMap<String, HashMap<String, AccountData>> =\n        read_and_parse_json_file(accounts_file)?;\n\n    accounts\n        .get(network_name)\n        .map(|network_accounts| network_accounts.contains_key(account_name))\n        .ok_or_else(|| {\n            anyhow::anyhow!(\"Network with name {network_name} does not exist in accounts file\")\n        })\n}\n\n#[must_use]\npub fn is_devnet_account(account: &str) -> bool {\n    account.starts_with(\"devnet-\")\n}\n\npub async fn get_account_from_devnet<'a>(\n    account: &str,\n    provider: &'a JsonRpcClient<HttpTransport>,\n    url: &Url,\n) -> Result<SingleOwnerAccount<&'a JsonRpcClient<HttpTransport>, LocalWallet>> {\n    let account_number: u8 = account\n        .strip_prefix(\"devnet-\")\n        .map(|s| s.parse::<u8>().expect(\"Invalid devnet account number\"))\n        .context(\"Failed to parse devnet account number\")?;\n\n    let devnet_provider = DevnetProvider::new(url.as_ref());\n    devnet_provider.ensure_alive().await?;\n\n    let devnet_config = devnet_provider.get_config().await;\n    let devnet_config = match devnet_config {\n        Ok(config) => config,\n        Err(err) => {\n            return Err(err);\n        }\n    };\n\n    ensure!(\n        account_number <= devnet_config.total_accounts && account_number != 0,\n        \"Devnet account number must be between 1 and {}\",\n        devnet_config.total_accounts\n    );\n\n    let devnet_accounts = devnet_provider.get_predeployed_accounts().await?;\n    let predeployed_account = devnet_accounts\n        .get((account_number - 1) as usize)\n        .expect(\"Failed to get devnet account\")\n        .to_owned();\n\n    let account_data = AccountData::from(predeployed_account);\n    let chain_id = provider.chain_id().await?;\n    build_account(account_data, chain_id, provider).await\n}\n"
  },
  {
    "path": "crates/sncast/src/helpers/artifacts.rs",
    "content": "/// Contains compiled Starknet artifacts\n#[derive(Debug, Clone)]\npub struct CastStarknetContractArtifacts {\n    /// Compiled sierra code\n    pub sierra: String,\n    /// Compiled casm code\n    pub casm: String,\n}\n"
  },
  {
    "path": "crates/sncast/src/helpers/block_explorer.rs",
    "content": "use crate::{Network, response::explorer_link::ExplorerError};\nuse conversions::padded_felt::PaddedFelt;\nuse serde::{Deserialize, Serialize};\n\nconst VOYAGER: &str = \"voyager.online\";\nconst VIEWBLOCK: &str = \"https://viewblock.io/starknet\";\nconst OKLINK: &str = \"https://www.oklink.com/starknet\";\n\n#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]\npub enum Service {\n    #[default]\n    Voyager,\n    StarkScan,\n    ViewBlock,\n    OkLink,\n}\n\nimpl Service {\n    pub fn as_provider(&self, network: Network) -> Result<Box<dyn LinkProvider>, ExplorerError> {\n        match (self, network) {\n            (Service::StarkScan, _) => unreachable!(\"Should be caught by config validation\"),\n            (Service::Voyager, _) => Ok(Box::new(Voyager { network })),\n            (Service::ViewBlock, Network::Mainnet) => Ok(Box::new(ViewBlock)),\n            (Service::OkLink, Network::Mainnet) => Ok(Box::new(OkLink)),\n            (_, Network::Sepolia) => Err(ExplorerError::SepoliaNotSupported),\n            (_, Network::Devnet) => Err(ExplorerError::DevnetNotSupported),\n        }\n    }\n}\n\npub trait LinkProvider {\n    fn transaction(&self, hash: PaddedFelt) -> String;\n    fn class(&self, hash: PaddedFelt) -> String;\n    fn contract(&self, address: PaddedFelt) -> String;\n}\n\nconst fn network_subdomain(network: Network) -> &'static str {\n    match network {\n        Network::Sepolia => \"sepolia.\",\n        Network::Mainnet | Network::Devnet => \"\",\n    }\n}\n\npub struct Voyager {\n    network: Network,\n}\n\nimpl LinkProvider for Voyager {\n    fn transaction(&self, hash: PaddedFelt) -> String {\n        format!(\n            \"https://{}{VOYAGER}/tx/{hash:#x}\",\n            network_subdomain(self.network)\n        )\n    }\n\n    fn class(&self, hash: PaddedFelt) -> String {\n        format!(\n            \"https://{}{VOYAGER}/class/{hash:#x}\",\n            network_subdomain(self.network)\n        )\n    }\n\n    fn contract(&self, address: PaddedFelt) -> String {\n        format!(\n            \"https://{}{VOYAGER}/contract/{address:#x}\",\n            network_subdomain(self.network)\n        )\n    }\n}\n\npub struct ViewBlock;\n\nimpl LinkProvider for ViewBlock {\n    fn transaction(&self, hash: PaddedFelt) -> String {\n        format!(\"{VIEWBLOCK}/tx/{hash:#x}\")\n    }\n\n    fn class(&self, hash: PaddedFelt) -> String {\n        format!(\"{VIEWBLOCK}/class/{hash:#x}\")\n    }\n\n    fn contract(&self, address: PaddedFelt) -> String {\n        format!(\"{VIEWBLOCK}/contract/{address:#x}\")\n    }\n}\n\npub struct OkLink;\n\nimpl LinkProvider for OkLink {\n    fn transaction(&self, hash: PaddedFelt) -> String {\n        format!(\"{OKLINK}/tx/{hash:#x}\")\n    }\n\n    fn class(&self, hash: PaddedFelt) -> String {\n        format!(\"{OKLINK}/class/{hash:#x}\")\n    }\n\n    fn contract(&self, address: PaddedFelt) -> String {\n        format!(\"{OKLINK}/contract/{address:#x}\")\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use crate::response::deploy::DeployResponse;\n    use crate::{\n        Network,\n        helpers::block_explorer::Service,\n        response::{deploy::StandardDeployResponse, explorer_link::OutputLink},\n    };\n    use conversions::padded_felt::PaddedFelt;\n    use regex::Regex;\n    use starknet_rust::macros::felt;\n    use test_case::test_case;\n\n    const MAINNET_RESPONSE: DeployResponse = DeployResponse::Standard(StandardDeployResponse {\n        contract_address: PaddedFelt(felt!(\n            \"0x03241d40a2af53a34274dd411e090ccac1ea80e0380a0303fe76d71b046cfecb\"\n        )),\n        transaction_hash: PaddedFelt(felt!(\n            \"0x7605291e593e0c6ad85681d09e27a601befb85033bdf1805aabf5d84617cf68\"\n        )),\n    });\n\n    const SEPOLIA_RESPONSE: DeployResponse = DeployResponse::Standard(StandardDeployResponse {\n        contract_address: PaddedFelt(felt!(\n            \"0x0716b5f1e3bd760c489272fd6530462a09578109049e26e3f4c70492676eae17\"\n        )),\n        transaction_hash: PaddedFelt(felt!(\n            \"0x1cde70aae10f79d2d1289c923a1eeca7b81a2a6691c32551ec540fa2cb29c33\"\n        )),\n    });\n\n    async fn assert_valid_links(input: &str) {\n        let pattern = Regex::new(r\"transaction: |contract: |class: \").unwrap();\n        let links = pattern.replace_all(input, \"\");\n        let mut links = links.split('\\n');\n\n        let contract = links.next().unwrap();\n        let transaction = links.next().unwrap();\n\n        let (contract_response, transaction_response) =\n            tokio::join!(reqwest::get(contract), reqwest::get(transaction));\n\n        assert!(contract_response.is_ok());\n        assert!(transaction_response.is_ok());\n    }\n\n    #[test_case(Network::Mainnet, &MAINNET_RESPONSE; \"mainnet\")]\n    #[test_case(Network::Sepolia, &SEPOLIA_RESPONSE; \"sepolia\")]\n    #[tokio::test]\n    async fn test_happy_case_voyager(network: Network, response: &DeployResponse) {\n        let provider = Service::Voyager.as_provider(network).unwrap();\n        let result = response.format_links(provider);\n        assert_valid_links(&result).await;\n    }\n\n    #[test_case(Service::ViewBlock; \"viewblock\")]\n    #[test_case(Service::OkLink; \"oklink\")]\n    #[tokio::test]\n    async fn test_happy_case_mainnet(explorer: Service) {\n        let result = MAINNET_RESPONSE.format_links(explorer.as_provider(Network::Mainnet).unwrap());\n        assert_valid_links(&result).await;\n    }\n\n    #[test_case(Service::ViewBlock; \"viewblock\")]\n    #[test_case(Service::OkLink; \"oklink\")]\n    #[tokio::test]\n    async fn test_fail_on_sepolia(explorer: Service) {\n        assert!(explorer.as_provider(Network::Sepolia).is_err());\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/helpers/braavos.rs",
    "content": "use async_trait::async_trait;\nuse starknet_rust::{\n    accounts::{AccountFactory, PreparedAccountDeploymentV3, RawAccountDeploymentV3},\n    core::types::{BlockId, BlockTag},\n    providers::Provider,\n    signers::Signer,\n};\nuse starknet_rust_crypto::poseidon_hash_many;\nuse starknet_types_core::felt::Felt;\n\n// Adapted from strakli as there is currently no implementation of braavos account factory in starknet-rs\npub struct BraavosAccountFactory<S, P> {\n    class_hash: Felt,\n    base_class_hash: Felt,\n    chain_id: Felt,\n    signer_public_key: Felt,\n    signer: S,\n    provider: P,\n    block_id: BlockId,\n}\n\nimpl<S, P> BraavosAccountFactory<S, P>\nwhere\n    S: Signer,\n{\n    pub async fn new(\n        class_hash: Felt,\n        base_class_hash: Felt,\n        chain_id: Felt,\n        signer: S,\n        provider: P,\n    ) -> Result<Self, S::GetPublicKeyError> {\n        let signer_public_key = signer.get_public_key().await?;\n        Ok(Self {\n            class_hash,\n            base_class_hash,\n            chain_id,\n            signer_public_key: signer_public_key.scalar(),\n            signer,\n            provider,\n            block_id: BlockId::Tag(BlockTag::Latest),\n        })\n    }\n\n    pub fn set_block_id(&mut self, block_id: BlockId) -> &Self {\n        self.block_id = block_id;\n        self\n    }\n\n    async fn sign_deployment(&self, tx_hash: Felt) -> Result<Vec<Felt>, S::SignError> {\n        let signature = self.signer.sign_hash(&tx_hash).await?;\n\n        // You can see params here:\n        // https://github.com/myBraavos/braavos-account-cairo/blob/6efdfd597bb051e99c79a512fccd14ee2523c898/src/presets/braavos_account.cairo#L104\n        // Order of the params is important, you can see way and order of deserialization here:\n        // https://github.com/myBraavos/braavos-account-cairo/blob/6efdfd597bb051e99c79a512fccd14ee2523c898/src/presets/braavos_account.cairo#L141\n        // first 3 elements in sig are always [tx hash(r, s), account impl, ...]\n        // last 2 elements are sig on the aux data sent in the sig preceded by chain id:\n        // [..., account_impl, ..., chain_id, aux(r, s)]\n        // ref: https://github.com/myBraavos/braavos-account-cairo/blob/6efdfd597bb051e99c79a512fccd14ee2523c898/src/presets/braavos_base_account.cairo#L74\n        let aux_data: Vec<Felt> = vec![\n            // account_implementation\n            self.class_hash,\n            // signer_type\n            Felt::ZERO,\n            // secp256r1_signer.x.low\n            Felt::ZERO,\n            // secp256r1_signer.x.high\n            Felt::ZERO,\n            // secp256r1_signer.y.low\n            Felt::ZERO,\n            // secp256r1_signer.y.high\n            Felt::ZERO,\n            // multisig_threshold\n            Felt::ZERO,\n            // withdrawal_limit_low\n            Felt::ZERO,\n            // fee_rate\n            Felt::ZERO,\n            // stark_fee_rate\n            Felt::ZERO,\n            // chain_id\n            self.chain_id,\n        ];\n\n        let aux_hash = poseidon_hash_many(&aux_data[..]);\n        let aux_signature = self.signer.sign_hash(&aux_hash).await?;\n\n        Ok([\n            vec![signature.r, signature.s],\n            aux_data,\n            vec![aux_signature.r, aux_signature.s],\n        ]\n        .concat())\n    }\n}\n\n#[async_trait]\nimpl<S, P> AccountFactory for BraavosAccountFactory<S, P>\nwhere\n    S: Signer + Sync + Send,\n    P: Provider + Sync + Send,\n{\n    type Provider = P;\n    type SignError = S::SignError;\n\n    #[expect(clippy::misnamed_getters)]\n    fn class_hash(&self) -> Felt {\n        self.base_class_hash\n    }\n\n    fn calldata(&self) -> Vec<Felt> {\n        vec![self.signer_public_key]\n    }\n\n    fn chain_id(&self) -> Felt {\n        self.chain_id\n    }\n\n    fn provider(&self) -> &Self::Provider {\n        &self.provider\n    }\n\n    fn block_id(&self) -> BlockId {\n        self.block_id\n    }\n\n    async fn sign_deployment_v3(\n        &self,\n        deployment: &RawAccountDeploymentV3,\n        query_only: bool,\n    ) -> Result<Vec<Felt>, Self::SignError> {\n        let tx_hash = PreparedAccountDeploymentV3::from_raw(deployment.clone(), self)\n            .transaction_hash(query_only);\n        self.sign_deployment(tx_hash).await\n    }\n\n    fn is_signer_interactive(&self) -> bool {\n        // Braavos' __validate_deploy__ requires a fully structured signature (minimum number of\n        // elements) even for fee estimation query transactions. If we report the signer as\n        // interactive, starknet-rust will send an empty signature for estimation, which causes the\n        // Braavos contract to panic with \"Index out of bounds\". Returning false forces a real\n        // signature to always be produced, at the cost of an extra Ledger confirmation during\n        // fee estimation.\n        false\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/helpers/command.rs",
    "content": "use crate::response::cast_message::SncastMessage;\nuse crate::response::{errors::ResponseError, explorer_link::ExplorerLinksMessage};\nuse anyhow::Result;\n\nuse crate::response::cast_message::SncastCommandMessage;\nuse crate::response::ui::UI;\nuse foundry_ui::Message;\nuse serde::Serialize;\nuse std::process::ExitCode;\n\npub fn process_command_result<T>(\n    command: &str,\n    result: Result<T>,\n    ui: &UI,\n    block_explorer_link: Option<ExplorerLinksMessage>,\n) -> ExitCode\nwhere\n    T: SncastCommandMessage + Serialize,\n    SncastMessage<T>: Message,\n{\n    let cast_msg = result.map(|command_response| SncastMessage(command_response));\n\n    match cast_msg {\n        Ok(response) => {\n            ui.print_message(command, response);\n            if let Some(link) = block_explorer_link {\n                ui.print_notification(link);\n            }\n            ExitCode::SUCCESS\n        }\n        Err(err) => {\n            let err = ResponseError::new(command.to_string(), format!(\"{err:#}\"));\n            ui.print_error(command, err);\n            ExitCode::FAILURE\n        }\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/helpers/config.rs",
    "content": "use crate::ValidatedWaitParams;\nuse crate::helpers::configuration::{CastConfig, show_explorer_links_default};\nuse crate::helpers::constants::DEFAULT_ACCOUNTS_FILE;\nuse anyhow::Result;\nuse camino::Utf8PathBuf;\nuse indoc::formatdoc;\nuse std::fs;\nuse std::fs::File;\nuse std::io::Write;\n\npub fn get_global_config_path() -> Result<Utf8PathBuf> {\n    let global_config_dir = {\n        if cfg!(target_os = \"windows\") {\n            dirs::config_dir()\n                .ok_or_else(|| anyhow::anyhow!(\"Could not determine config directory\"))?\n                .join(\"starknet-foundry\")\n        } else {\n            dirs::home_dir()\n                .ok_or_else(|| anyhow::anyhow!(\"Could not determine home directory\"))?\n                .join(\".config/starknet-foundry\")\n        }\n    };\n\n    if !global_config_dir.exists() {\n        fs::create_dir_all(&global_config_dir)?;\n    }\n\n    let global_config_path = Utf8PathBuf::from_path_buf(global_config_dir.join(\"snfoundry.toml\"))\n        .expect(\"Failed to convert PathBuf to Utf8PathBuf for global configuration\");\n\n    if !global_config_path.exists() {\n        create_global_config(global_config_path.clone())?;\n    }\n\n    Ok(global_config_path)\n}\n\nfn build_default_manifest() -> String {\n    let default_wait_params = ValidatedWaitParams::default();\n\n    formatdoc! {r#\"\n        # Visit https://foundry-rs.github.io/starknet-foundry/appendix/snfoundry-toml.html\n        # and https://foundry-rs.github.io/starknet-foundry/projects/configuration.html for more information\n\n        # [sncast.default]\n        # url = \"\"\n        # block-explorer = \"{default_block_explorer}\"\n        # wait-params = {{ timeout = {default_wait_timeout}, retry-interval = {default_wait_retry_interval} }}\n        # show-explorer-links = {default_show_explorer_links}\n        # accounts-file = \"{default_accounts_file}\"\n        # account = \"\"\n        # keystore = \"\"\n        \n        # Configure custom network addresses\n        # [sncast.default.networks]\n        # mainnet = \"https://mainnet.your-node.com\"\n        # sepolia = \"https://sepolia.your-node.com\"\n        # devnet = \"http://127.0.0.1:5050/rpc\"\n        \"#,\n        default_accounts_file = DEFAULT_ACCOUNTS_FILE,\n        default_wait_timeout = default_wait_params.timeout,\n        default_wait_retry_interval = default_wait_params.retry_interval,\n        default_block_explorer = \"Voyager\",\n        default_show_explorer_links = show_explorer_links_default(),\n    }\n}\n\nfn create_global_config(global_config_path: Utf8PathBuf) -> Result<()> {\n    let mut file = File::create(global_config_path)?;\n    file.write_all(build_default_manifest().as_bytes())?;\n\n    Ok(())\n}\nmacro_rules! clone_field {\n    ($global_config:expr, $local_config:expr, $default_config:expr, $field:ident) => {\n        if $local_config.$field != $default_config.$field {\n            $local_config.$field.clone()\n        } else {\n            $global_config.$field.clone()\n        }\n    };\n}\n\n#[must_use]\npub fn combine_cast_configs(global_config: &CastConfig, local_config: &CastConfig) -> CastConfig {\n    let default_cast_config = CastConfig::default();\n\n    let mut networks = global_config.networks.clone();\n    networks.override_with(&local_config.networks);\n\n    CastConfig {\n        url: clone_field!(global_config, local_config, default_cast_config, url),\n        network: clone_field!(global_config, local_config, default_cast_config, network),\n        account: clone_field!(global_config, local_config, default_cast_config, account),\n        accounts_file: clone_field!(\n            global_config,\n            local_config,\n            default_cast_config,\n            accounts_file\n        ),\n        keystore: clone_field!(global_config, local_config, default_cast_config, keystore),\n        wait_params: clone_field!(\n            global_config,\n            local_config,\n            default_cast_config,\n            wait_params\n        ),\n        block_explorer: clone_field!(\n            global_config,\n            local_config,\n            default_cast_config,\n            block_explorer\n        ),\n        show_explorer_links: clone_field!(\n            global_config,\n            local_config,\n            default_cast_config,\n            show_explorer_links\n        ),\n        networks,\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/helpers/configuration.rs",
    "content": "use super::block_explorer;\nuse crate::{Network, ValidatedWaitParams};\nuse anyhow::Result;\nuse camino::Utf8PathBuf;\nuse configuration::Config;\nuse serde::{Deserialize, Serialize};\nuse url::Url;\n\n#[must_use]\npub const fn show_explorer_links_default() -> bool {\n    true\n}\n\n#[derive(Deserialize, Serialize, Clone, Debug, PartialEq, Default)]\n#[serde(deny_unknown_fields)]\npub struct NetworksConfig {\n    pub mainnet: Option<Url>,\n    pub sepolia: Option<Url>,\n    pub devnet: Option<Url>,\n}\n\nimpl NetworksConfig {\n    #[must_use]\n    pub fn get_url(&self, network: Network) -> Option<&Url> {\n        match network {\n            Network::Mainnet => self.mainnet.as_ref(),\n            Network::Sepolia => self.sepolia.as_ref(),\n            Network::Devnet => self.devnet.as_ref(),\n        }\n    }\n\n    pub fn override_with(&mut self, other: &NetworksConfig) {\n        if other.mainnet.is_some() {\n            self.mainnet.clone_from(&other.mainnet);\n        }\n        if other.sepolia.is_some() {\n            self.sepolia.clone_from(&other.sepolia);\n        }\n        if other.devnet.is_some() {\n            self.devnet.clone_from(&other.devnet);\n        }\n    }\n}\n\n#[derive(Deserialize, Serialize, Clone, Debug, PartialEq)]\npub struct CastConfig {\n    #[serde(default)]\n    /// RPC url\n    pub url: Option<Url>,\n\n    #[serde(default)]\n    pub network: Option<Network>,\n\n    #[serde(default)]\n    pub account: String,\n\n    #[serde(\n        default,\n        rename(serialize = \"accounts-file\", deserialize = \"accounts-file\")\n    )]\n    pub accounts_file: Utf8PathBuf,\n\n    pub keystore: Option<Utf8PathBuf>,\n\n    #[serde(\n        default,\n        rename(serialize = \"wait-params\", deserialize = \"wait-params\")\n    )]\n    pub wait_params: ValidatedWaitParams,\n\n    #[serde(\n        default,\n        rename(serialize = \"block-explorer\", deserialize = \"block-explorer\")\n    )]\n    /// A block explorer service, used to display links to transaction details\n    pub block_explorer: Option<block_explorer::Service>,\n\n    #[serde(\n        default = \"show_explorer_links_default\",\n        rename(serialize = \"show-explorer-links\", deserialize = \"show-explorer-links\")\n    )]\n    /// Print links pointing to pages with transaction details in the chosen block explorer\n    pub show_explorer_links: bool,\n\n    #[serde(default)]\n    /// Configurable urls of predefined networks - mainnet, sepolia, and devnet are supported\n    pub networks: NetworksConfig,\n}\n\n// TODO(#4027)\nimpl CastConfig {\n    pub fn validate(&self) -> anyhow::Result<()> {\n        if self.block_explorer.unwrap_or_default() == block_explorer::Service::StarkScan {\n            anyhow::bail!(\n                \"starkscan.co was terminated and `'StarkScan'` is no longer available. Please set `block-explorer` to `'Voyager'` or other explorer of your choice.\"\n            )\n        }\n\n        match (&self.url, &self.network) {\n            (Some(_), Some(_)) => {\n                anyhow::bail!(\"Only one of `url` or `network` may be specified\")\n            }\n            _ => Ok(()),\n        }\n    }\n}\n\nimpl Default for CastConfig {\n    fn default() -> Self {\n        Self {\n            url: None,\n            network: None,\n            account: String::default(),\n            accounts_file: Utf8PathBuf::default(),\n            keystore: None,\n            wait_params: ValidatedWaitParams::default(),\n            block_explorer: Some(block_explorer::Service::default()),\n            show_explorer_links: show_explorer_links_default(),\n            networks: NetworksConfig::default(),\n        }\n    }\n}\n\nimpl Config for CastConfig {\n    fn tool_name() -> &'static str {\n        \"sncast\"\n    }\n\n    fn from_raw(config: serde_json::Value) -> Result<Self> {\n        let config = serde_json::from_value::<Self>(config)?;\n        config.validate()?;\n        Ok(config)\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use url::Url;\n\n    #[test]\n    fn test_networks_config_get() {\n        let networks = NetworksConfig {\n            mainnet: Some(Url::parse(\"https://mainnet.example.com\").unwrap()),\n            sepolia: Some(Url::parse(\"https://sepolia.example.com\").unwrap()),\n            devnet: Some(Url::parse(\"https://devnet.example.com\").unwrap()),\n        };\n\n        assert_eq!(\n            networks.get_url(Network::Mainnet),\n            Some(&Url::parse(\"https://mainnet.example.com\").unwrap())\n        );\n        assert_eq!(\n            networks.get_url(Network::Sepolia),\n            Some(&Url::parse(\"https://sepolia.example.com\").unwrap())\n        );\n        assert_eq!(\n            networks.get_url(Network::Devnet),\n            Some(&Url::parse(\"https://devnet.example.com\").unwrap())\n        );\n    }\n\n    #[test]\n    fn test_networks_config_override() {\n        let mut global = NetworksConfig {\n            mainnet: Some(Url::parse(\"https://global-mainnet.example.com\").unwrap()),\n            sepolia: Some(Url::parse(\"https://global-sepolia.example.com\").unwrap()),\n            devnet: None,\n        };\n        let local = NetworksConfig {\n            mainnet: Some(Url::parse(\"https://local-mainnet.example.com\").unwrap()),\n            sepolia: None,\n            devnet: None,\n        };\n\n        global.override_with(&local);\n\n        // Local mainnet should override global\n        assert_eq!(\n            global.mainnet,\n            Some(Url::parse(\"https://local-mainnet.example.com\").unwrap())\n        );\n        // Global sepolia should remain\n        assert_eq!(\n            global.sepolia,\n            Some(Url::parse(\"https://global-sepolia.example.com\").unwrap())\n        );\n    }\n\n    #[test]\n    fn test_networks_config_rejects_unknown_fields_and_typos() {\n        // Unknown fields should cause an error\n        let toml_str = r#\"\n            mainnet = \"https://mainnet.example.com\"\n            custom = \"https://custom.example.com\"\n            wrong_key = \"https://sepolia.example.com\"\n        \"#;\n\n        let result: Result<NetworksConfig, _> = toml::from_str(toml_str);\n        assert!(result.is_err());\n        assert!(result.unwrap_err().to_string().contains(\"unknown field\"));\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/helpers/constants.rs",
    "content": "use starknet_rust::macros::felt;\nuse starknet_types_core::felt::Felt;\n\npub static DEFAULT_MULTICALL_CONTENTS: &str = r#\"[[call]]\ncall_type = \"deploy\"\nclass_hash = \"\"\ninputs = []\nid = \"\"\nunique = false\n\n[[call]]\ncall_type = \"invoke\"\ncontract_address = \"\"\nfunction = \"\"\ninputs = []\n\"#;\n\npub const UDC_ADDRESS: Felt =\n    felt!(\"0x02ceed65a4bd731034c01113685c831b01c15d7d432f71afb1cf1634b53a2125\");\npub const OZ_CLASS_HASH: Felt =\n    felt!(\"0x05b4b537eaa2399e3aa99c4e2e0208ebd6c71bc1467938cd52c798c601e43564\"); // v1.0.0\npub const READY_CLASS_HASH: Felt =\n    felt!(\"0x036078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f\"); // v0.4.0\n\npub const BRAAVOS_CLASS_HASH: Felt =\n    felt!(\"0x03957f9f5a1cbfe918cedc2015c85200ca51a5f7506ecb6de98a5207b759bf8a\"); // v1.2.0\n\npub const BRAAVOS_BASE_ACCOUNT_CLASS_HASH: Felt =\n    felt!(\"0x03d16c7a9a60b0593bd202f660a28c5d76e0403601d9ccc7e4fa253b6a70c201\"); // v1.2.0\n\n// used in wait_for_tx. Txs will be fetched every 5s with timeout of 300s - so 60 attempts\npub const WAIT_TIMEOUT: u16 = 300;\npub const WAIT_RETRY_INTERVAL: u8 = 5;\n\npub const DEFAULT_ACCOUNTS_FILE: &str = \"~/.starknet_accounts/starknet_open_zeppelin_accounts.json\";\n\npub const KEYSTORE_PASSWORD_ENV_VAR: &str = \"KEYSTORE_PASSWORD\";\npub const CREATE_KEYSTORE_PASSWORD_ENV_VAR: &str = \"CREATE_KEYSTORE_PASSWORD\";\n\npub const SCRIPT_LIB_ARTIFACT_NAME: &str = \"__sncast_script_lib\";\n\npub const STATE_FILE_VERSION: u8 = 1;\n\npub const INIT_SCRIPTS_DIR: &str = \"scripts\";\n\npub const DEFAULT_STATE_FILE_SUFFIX: &str = \"state.json\";\n"
  },
  {
    "path": "crates/sncast/src/helpers/devnet/detection/direct.rs",
    "content": "use crate::helpers::devnet::detection::flag_parsing::{\n    extract_port_from_flag, extract_string_from_flag,\n};\nuse crate::helpers::devnet::detection::{\n    DEFAULT_DEVNET_HOST, DEFAULT_DEVNET_PORT, DevnetDetectionError, ProcessInfo,\n};\n\npub fn extract_devnet_info_from_direct_run(\n    cmdline: &str,\n) -> Result<ProcessInfo, DevnetDetectionError> {\n    let mut port = extract_port_from_flag(cmdline, \"--port\");\n    let mut host = extract_string_from_flag(cmdline, \"--host\");\n\n    if port.is_none()\n        && let Ok(port_env) = std::env::var(\"PORT\")\n    {\n        port = Some(\n            port_env\n                .parse()\n                .map_err(|_| DevnetDetectionError::ProcessNotReachable)?,\n        );\n    }\n\n    if host.is_none()\n        && let Ok(host_env) = std::env::var(\"HOST\")\n        && !host_env.is_empty()\n    {\n        host = Some(host_env);\n    }\n\n    let final_port = port.unwrap_or(DEFAULT_DEVNET_PORT);\n    let final_host = host.unwrap_or_else(|| DEFAULT_DEVNET_HOST.to_string());\n\n    Ok(ProcessInfo {\n        host: final_host,\n        port: final_port,\n    })\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    // These tests are marked to run serially to avoid interference from environment variables\n    #[test]\n    fn test_direct_devnet_parsing() {\n        test_extract_devnet_info_from_cmdline();\n        test_extract_devnet_info_with_both_envs();\n        test_invalid_env();\n        test_cmdline_args_override_env();\n        test_wrong_env_var();\n    }\n\n    fn test_extract_devnet_info_from_cmdline() {\n        let cmdline1 = \"starknet-devnet --port 6000 --host 127.0.0.1\";\n        let info1 = extract_devnet_info_from_direct_run(cmdline1).unwrap();\n        assert_eq!(info1.port, 6000);\n        assert_eq!(info1.host, \"127.0.0.1\");\n\n        let cmdline2 = \"/usr/bin/starknet-devnet --port=5000\";\n        let info2 = extract_devnet_info_from_direct_run(cmdline2).unwrap();\n        assert_eq!(info2.port, 5000);\n        assert_eq!(info2.host, \"127.0.0.1\");\n\n        let cmdline3 = \"starknet-devnet --host 127.0.0.1\";\n        let info3 = extract_devnet_info_from_direct_run(cmdline3).unwrap();\n        assert_eq!(info3.port, 5050);\n        assert_eq!(info3.host, \"127.0.0.1\");\n    }\n\n    fn test_extract_devnet_info_with_both_envs() {\n        // SAFETY: Variables are only modified within this test and cleaned up afterwards\n        unsafe {\n            std::env::set_var(\"PORT\", \"9999\");\n            std::env::set_var(\"HOST\", \"9.9.9.9\");\n        }\n\n        let cmdline = \"starknet-devnet\";\n        let info = extract_devnet_info_from_direct_run(cmdline).unwrap();\n        assert_eq!(info.port, 9999);\n        assert_eq!(info.host, \"9.9.9.9\");\n\n        // SAFETY: Clean up environment variables to prevent interference\n        unsafe {\n            std::env::remove_var(\"PORT\");\n            std::env::remove_var(\"HOST\");\n        }\n    }\n\n    fn test_invalid_env() {\n        // SAFETY: Variables are only modified within this test and cleaned up afterwards\n        unsafe {\n            std::env::set_var(\"PORT\", \"asdf\");\n            std::env::set_var(\"HOST\", \"9.9.9.9\");\n        }\n        let cmdline = \"starknet-devnet\";\n        let result = extract_devnet_info_from_direct_run(cmdline);\n        assert!(result.is_err());\n        assert!(matches!(\n            result.unwrap_err(),\n            DevnetDetectionError::ProcessNotReachable\n        ));\n\n        // SAFETY: Clean up environment variables to prevent interference\n        unsafe {\n            std::env::remove_var(\"PORT\");\n            std::env::remove_var(\"HOST\");\n        }\n    }\n\n    fn test_cmdline_args_override_env() {\n        // SAFETY: Variables are only modified within this test and cleaned up afterwards\n        unsafe {\n            std::env::set_var(\"PORT\", \"3000\");\n            std::env::set_var(\"HOST\", \"7.7.7.7\");\n        }\n\n        let cmdline = \"starknet-devnet --port 9999 --host 192.168.1.1\";\n        let info = extract_devnet_info_from_direct_run(cmdline).unwrap();\n        assert_eq!(info.port, 9999);\n        assert_eq!(info.host, \"192.168.1.1\");\n\n        // SAFETY: Clean up environment variables to prevent interference\n        unsafe {\n            std::env::remove_var(\"PORT\");\n            std::env::remove_var(\"HOST\");\n        }\n    }\n\n    fn test_wrong_env_var() {\n        // SAFETY: Variables are only modified within this test and cleaned up afterwards\n        unsafe {\n            std::env::set_var(\"PORT\", \"asdf\");\n        }\n\n        // Empty HOST env var should be ignored and defaults should be used\n        let cmdline = \"starknet-devnet\";\n        let result = extract_devnet_info_from_direct_run(cmdline);\n        assert!(result.is_err());\n        assert!(matches!(\n            result.unwrap_err(),\n            DevnetDetectionError::ProcessNotReachable\n        ));\n\n        // SAFETY: Clean up environment variables to prevent interference\n        unsafe {\n            std::env::remove_var(\"PORT\");\n        }\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/helpers/devnet/detection/docker.rs",
    "content": "use regex::Regex;\n\nuse crate::helpers::devnet::detection::flag_parsing::{\n    extract_port_from_flag, extract_string_from_flag,\n};\nuse crate::helpers::devnet::detection::{DEFAULT_DEVNET_HOST, DevnetDetectionError, ProcessInfo};\n\npub fn extract_docker_mapping(cmdline: &str) -> Option<ProcessInfo> {\n    let port_flags = [\"-p\", \"--publish\"];\n\n    // Port mapping patterns:\n    // - host:host_port:container_port (e.g., \"127.0.0.1:5055:5050\")\n    // - host_port:container_port (e.g., \"5090:5050\")\n    let re = Regex::new(r\"^(?:([^:]+):)?(\\d+):\\d+$\").ok()?;\n\n    for flag in &port_flags {\n        if let Some(port_mapping) = extract_string_from_flag(cmdline, flag)\n            && let Some(caps) = re.captures(&port_mapping)\n            && let Ok(port) = caps.get(2)?.as_str().parse::<u16>()\n        {\n            let host = caps.get(1).map_or_else(\n                || DEFAULT_DEVNET_HOST.to_string(),\n                |m| m.as_str().to_string(),\n            );\n\n            return Some(ProcessInfo { host, port });\n        }\n    }\n\n    None\n}\n\npub fn extract_devnet_info_from_docker_run(\n    cmdline: &str,\n) -> Result<ProcessInfo, DevnetDetectionError> {\n    if let Some(docker_info) = extract_docker_mapping(cmdline) {\n        return Ok(docker_info);\n    }\n\n    if extract_string_from_flag(cmdline, \"--network\").is_some_and(|network| network == \"host\")\n        && let Some(port) = extract_port_from_flag(cmdline, \"--port\")\n    {\n        return Ok(ProcessInfo {\n            host: DEFAULT_DEVNET_HOST.to_string(),\n            port,\n        });\n    }\n\n    // If connection info was not provided (e.g., docker run shardlabs/starknet-devnet-rs),\n    // we cannot connect to the process from outside the container\n    Err(DevnetDetectionError::ProcessNotReachable)\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    #[test]\n    fn test_extract_devnet_info_from_docker_line() {\n        let cmdline1 = \"docker run -p 127.0.0.1:5055:5050 shardlabs/starknet-devnet-rs\";\n        let info1 = extract_devnet_info_from_docker_run(cmdline1).unwrap();\n        assert_eq!(info1.port, 5055);\n        assert_eq!(info1.host, \"127.0.0.1\");\n\n        let cmdline2 = \"docker run --publish     8080:5050 shardlabs/starknet-devnet-rs\";\n        let info2 = extract_devnet_info_from_docker_run(cmdline2).unwrap();\n        assert_eq!(info2.port, 8080);\n        assert_eq!(info2.host, \"127.0.0.1\");\n\n        let cmdline3 = \"podman run --network host shardlabs/starknet-devnet-rs --port 5055\";\n        let info3 = extract_devnet_info_from_docker_run(cmdline3).unwrap();\n        assert_eq!(info3.port, 5055);\n        assert_eq!(info3.host, \"127.0.0.1\");\n    }\n\n    #[test]\n    fn test_extract_docker_mapping_helper() {\n        let line = \"docker run -p 127.0.0.1:5055:5050 shardlabs/starknet-devnet-rs\";\n        let info = extract_docker_mapping(line).expect(\"mapping should parse\");\n        assert_eq!(info.host, \"127.0.0.1\");\n        assert_eq!(info.port, 5055);\n\n        let line2 = \"docker run --publish 8080:5050 shardlabs/starknet-devnet-rs\";\n        let info2 = extract_docker_mapping(line2).expect(\"mapping should parse\");\n        assert_eq!(info2.host, \"127.0.0.1\");\n        assert_eq!(info2.port, 8080);\n    }\n\n    #[test]\n    fn test_docker_without_port_mapping() {\n        let cmdline = \"docker run shardlabs/starknet-devnet-rs\";\n        let result = extract_devnet_info_from_docker_run(cmdline);\n        assert!(result.is_err());\n        assert!(matches!(\n            result.unwrap_err(),\n            DevnetDetectionError::ProcessNotReachable\n        ));\n    }\n\n    #[test]\n    fn test_docker_with_invalid_port_mapping() {\n        let cmdline = \"docker run -p invalid shardlabs/starknet-devnet-rs\";\n        let result = extract_devnet_info_from_docker_run(cmdline);\n        assert!(result.is_err());\n        assert!(matches!(\n            result.unwrap_err(),\n            DevnetDetectionError::ProcessNotReachable\n        ));\n    }\n\n    #[test]\n    fn test_docker_network_host_without_port() {\n        let cmdline = \"docker run --network host shardlabs/starknet-devnet-rs\";\n        let result = extract_devnet_info_from_docker_run(cmdline);\n        assert!(result.is_err());\n        assert!(matches!(\n            result.unwrap_err(),\n            DevnetDetectionError::ProcessNotReachable\n        ));\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/helpers/devnet/detection/flag_parsing.rs",
    "content": "use regex::Regex;\n\npub fn extract_string_from_flag(cmdline: &str, flag: &str) -> Option<String> {\n    let pattern = format!(r\"{}\\s*=?\\s*(\\S+)\", regex::escape(flag));\n    let re = Regex::new(&pattern).ok()?;\n\n    re.captures(cmdline)\n        .and_then(|caps| caps.get(1))\n        .map(|m| m.as_str().to_string())\n}\n\npub fn extract_port_from_flag(cmdline: &str, flag: &str) -> Option<u16> {\n    extract_string_from_flag(cmdline, flag).and_then(|port_str| port_str.parse().ok())\n}\n"
  },
  {
    "path": "crates/sncast/src/helpers/devnet/detection.rs",
    "content": "mod direct;\nmod docker;\nmod flag_parsing;\nuse std::process::Command;\nuse url::Url;\n\nuse crate::helpers::devnet::provider::DevnetProvider;\n\npub(super) const DEFAULT_DEVNET_HOST: &str = \"127.0.0.1\";\npub(super) const DEFAULT_DEVNET_PORT: u16 = 5050;\n\n#[derive(Debug, Clone)]\npub(super) struct ProcessInfo {\n    pub host: String,\n    pub port: u16,\n}\n\n#[derive(Debug, thiserror::Error)]\npub enum DevnetDetectionError {\n    #[error(\n        \"Could not detect running starknet-devnet instance. Please use `--url <URL>` instead or start devnet.\"\n    )]\n    NoInstance,\n    #[error(\n        \"Multiple starknet-devnet instances found. Please use `--url <URL>` to specify which one to use.\"\n    )]\n    MultipleInstances,\n    #[error(\"Failed to execute process detection command.\")]\n    CommandFailed,\n    #[error(\n        \"Found starknet-devnet process, but could not reach it. Please use `--url <URL>` to specify the correct URL.\"\n    )]\n    ProcessNotReachable,\n    #[error(\"Failed to parse devnet URL: {0}\")]\n    InvalidUrl(#[from] url::ParseError),\n}\n\npub async fn detect_devnet_url() -> Result<Url, DevnetDetectionError> {\n    detect_devnet_from_processes().await\n}\n\n#[must_use]\npub async fn is_devnet_running() -> bool {\n    detect_devnet_from_processes().await.is_ok()\n}\n\nasync fn detect_devnet_from_processes() -> Result<Url, DevnetDetectionError> {\n    match find_devnet_process_info() {\n        Ok(info) => {\n            if is_devnet_url_reachable(&info.host, info.port).await {\n                Ok(Url::parse(&format!(\"http://{}:{}\", info.host, info.port))?)\n            } else {\n                Err(DevnetDetectionError::ProcessNotReachable)\n            }\n        }\n        Err(DevnetDetectionError::NoInstance | DevnetDetectionError::CommandFailed) => {\n            // Fallback to default starknet-devnet URL if reachable\n            if is_devnet_url_reachable(DEFAULT_DEVNET_HOST, DEFAULT_DEVNET_PORT).await {\n                Ok(Url::parse(&format!(\n                    \"http://{DEFAULT_DEVNET_HOST}:{DEFAULT_DEVNET_PORT}\"\n                ))?)\n            } else {\n                Err(DevnetDetectionError::NoInstance)\n            }\n        }\n        Err(e) => Err(e),\n    }\n}\n\nfn find_devnet_process_info() -> Result<ProcessInfo, DevnetDetectionError> {\n    let output = Command::new(\"sh\")\n        .args([\"-c\", \"ps aux | grep starknet-devnet | grep -v grep\"])\n        .output()\n        .map_err(|_| DevnetDetectionError::CommandFailed)?;\n    let ps_output = String::from_utf8_lossy(&output.stdout);\n\n    let devnet_processes: Result<Vec<ProcessInfo>, DevnetDetectionError> = ps_output\n        .lines()\n        .map(|line| {\n            if line.contains(\"docker\") || line.contains(\"podman\") {\n                docker::extract_devnet_info_from_docker_run(line)\n            } else {\n                direct::extract_devnet_info_from_direct_run(line)\n            }\n        })\n        .collect();\n\n    let devnet_processes = devnet_processes?;\n\n    match devnet_processes.as_slice() {\n        [single] => Ok(single.clone()),\n        [] => Err(DevnetDetectionError::NoInstance),\n        _ => Err(DevnetDetectionError::MultipleInstances),\n    }\n}\n\nasync fn is_devnet_url_reachable(host: &str, port: u16) -> bool {\n    let url = format!(\"http://{host}:{port}\");\n\n    let provider = DevnetProvider::new(&url);\n    provider.ensure_alive().await.is_ok()\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    #[tokio::test]\n    async fn test_detect_devnet_url() {\n        let result = detect_devnet_url().await;\n        assert!(result.is_err());\n        assert!(matches!(\n            result.unwrap_err(),\n            DevnetDetectionError::NoInstance\n        ));\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/helpers/devnet/mod.rs",
    "content": "pub mod detection;\npub mod provider;\n"
  },
  {
    "path": "crates/sncast/src/helpers/devnet/provider.rs",
    "content": "use crate::{AccountData, SignerType};\nuse ::serde::{Deserialize, Serialize, de::DeserializeOwned};\nuse anyhow::{Context, Error, ensure};\nuse reqwest::Client;\nuse serde_json::json;\nuse starknet_types_core::felt::Felt;\nuse url::Url;\n\n/// A Devnet-RPC client.\n#[derive(Debug, Clone)]\npub struct DevnetProvider {\n    client: Client,\n    url: Url,\n}\n\n/// All Devnet-RPC methods as listed in the official docs.\n#[derive(Debug, Clone, Copy, Serialize, Deserialize)]\npub enum DevnetProviderMethod {\n    #[serde(rename = \"devnet_getConfig\")]\n    GetConfig,\n\n    #[serde(rename = \"devnet_getPredeployedAccounts\")]\n    GetPredeployedAccounts,\n}\n\nimpl DevnetProvider {\n    #[must_use]\n    pub fn new(url: &str) -> Self {\n        let url = Url::parse(url).expect(\"Invalid URL\");\n        Self {\n            client: Client::new(),\n            url,\n        }\n    }\n}\n\nimpl DevnetProvider {\n    async fn send_request<P, R>(&self, method: DevnetProviderMethod, params: P) -> anyhow::Result<R>\n    where\n        P: Serialize + Send + Sync,\n        R: DeserializeOwned,\n    {\n        let res = self\n            .client\n            .post(self.url.clone())\n            .header(\"Content-Type\", \"application/json\")\n            .json(&json!({\n                \"jsonrpc\": \"2.0\",\n                \"method\": method,\n                \"params\": params,\n                \"id\": 1,\n            }))\n            .send()\n            .await\n            .context(\"Failed to send request\")?\n            .json::<serde_json::Value>()\n            .await\n            .context(\"Failed to parse response\")?;\n\n        if let Some(error) = res.get(\"error\") {\n            Err(anyhow::anyhow!(error.to_string()))\n        } else if let Some(result) = res.get(\"result\") {\n            serde_json::from_value(result.clone()).map_err(anyhow::Error::from)\n        } else {\n            panic!(\"Malformed RPC response: {res}\")\n        }\n    }\n\n    /// Fetches the current Devnet configuration.\n    pub async fn get_config(&self) -> Result<Config, Error> {\n        self.send_request(DevnetProviderMethod::GetConfig, json!({}))\n            .await\n    }\n\n    /// Fetches the list of predeployed accounts in Devnet.\n    pub async fn get_predeployed_accounts(&self) -> Result<Vec<PredeployedAccount>, Error> {\n        self.send_request(DevnetProviderMethod::GetPredeployedAccounts, json!({}))\n            .await\n    }\n\n    /// Ensures the Devnet instance is alive.\n    pub async fn ensure_alive(&self) -> Result<(), Error> {\n        let is_alive = self\n            .client\n            .get(format!(\n                \"{}/is_alive\",\n                self.url\n                    .to_string()\n                    .trim_end_matches('/')\n                    .replace(\"/rpc\", \"\")\n            ))\n            .send()\n            .await\n            .is_ok_and(|res| res.status().is_success());\n\n        ensure!(\n            is_alive,\n            \"Node at {} is not responding to the Devnet health check (GET `/is_alive`). It may not be a Devnet instance or it may be down.\",\n            self.url\n        );\n        Ok(())\n    }\n}\n\n#[derive(Debug, Serialize, Deserialize)]\npub struct Config {\n    pub seed: u32,\n    pub account_contract_class_hash: Felt,\n    pub total_accounts: u8,\n}\n\n#[derive(Debug, Serialize, Deserialize)]\npub struct PredeployedAccount {\n    pub address: Felt,\n    pub private_key: Felt,\n    pub public_key: Felt,\n}\n\nimpl From<&PredeployedAccount> for AccountData {\n    fn from(predeployed_account: &PredeployedAccount) -> Self {\n        Self {\n            address: Some(predeployed_account.address),\n            public_key: predeployed_account.public_key,\n            class_hash: None,\n            salt: None,\n            deployed: None,\n            legacy: None,\n            account_type: None,\n            signer_type: SignerType::Local {\n                private_key: predeployed_account.private_key,\n            },\n        }\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/helpers/fee.rs",
    "content": "use anyhow::{Result, ensure};\nuse clap::Args;\nuse conversions::serde::deserialize::CairoDeserialize;\nuse starknet_rust::core::types::FeeEstimate;\nuse starknet_types_core::felt::{Felt, NonZeroFelt};\n\n#[derive(Args, Debug, Clone)]\npub struct FeeArgs {\n    /// Max fee for the transaction. If not provided, will be automatically estimated.\n    #[arg(value_parser = parse_non_zero_felt, short, long, conflicts_with_all = [\"l1_gas\", \"l1_gas_price\", \"l2_gas\", \"l2_gas_price\", \"l1_data_gas\", \"l1_data_gas_price\"])]\n    pub max_fee: Option<NonZeroFelt>,\n\n    /// Max L1 gas amount. If not provided, will be automatically estimated.\n    #[arg(long)]\n    pub l1_gas: Option<u64>,\n\n    /// Max L1 gas price in Fri. If not provided, will be automatically estimated.\n    #[arg(long)]\n    pub l1_gas_price: Option<u128>,\n\n    /// Max L2 gas amount. If not provided, will be automatically estimated.\n    #[arg(long)]\n    pub l2_gas: Option<u64>,\n\n    /// Max L2 gas price in Fri. If not provided, will be automatically estimated.\n    #[arg(long)]\n    pub l2_gas_price: Option<u128>,\n\n    /// Max L1 data gas amount. If not provided, will be automatically estimated.\n    #[arg(long)]\n    pub l1_data_gas: Option<u64>,\n\n    /// Max L1 data gas price in Fri. If not provided, will be automatically estimated.\n    #[arg(long)]\n    pub l1_data_gas_price: Option<u128>,\n\n    /// Tip for the transaction. Defaults to 0 unless `--estimate-tip` is used.\n    #[arg(long, conflicts_with = \"estimate_tip\")]\n    pub tip: Option<u64>,\n\n    /// If passed, an estimated tip will be added to pay for the transaction.\n    #[arg(long)]\n    pub estimate_tip: bool,\n}\n\nimpl From<ScriptFeeSettings> for FeeArgs {\n    fn from(script_fee_settings: ScriptFeeSettings) -> Self {\n        let ScriptFeeSettings {\n            max_fee,\n            l1_gas,\n            l1_gas_price,\n            l2_gas,\n            l2_gas_price,\n            l1_data_gas,\n            l1_data_gas_price,\n        } = script_fee_settings;\n        Self {\n            max_fee,\n            l1_gas,\n            l1_gas_price,\n            l2_gas,\n            l2_gas_price,\n            l1_data_gas,\n            l1_data_gas_price,\n            tip: Some(0),\n            estimate_tip: false,\n        }\n    }\n}\n\nimpl FeeArgs {\n    pub fn try_into_fee_settings(&self, fee_estimate: Option<&FeeEstimate>) -> Result<FeeSettings> {\n        // If some resource bounds values are lacking, starknet-rs will estimate them automatically\n        // but in case someone passes --max-fee flag, we need to make estimation on our own\n        // to check if the fee estimate isn't higher than provided max fee\n        if let Some(max_fee) = self.max_fee {\n            let fee_estimate =\n                fee_estimate.expect(\"Fee estimate must be passed when max_fee is provided\");\n\n            ensure!(\n                Felt::from(max_fee) >= Felt::from(fee_estimate.overall_fee),\n                \"Estimated fee ({}) is higher than provided max fee ({})\",\n                fee_estimate.overall_fee,\n                Felt::from(max_fee)\n            );\n\n            let fee_settings = FeeSettings::try_from(fee_estimate.clone())\n                .expect(\"Failed to convert FeeEstimate to FeeSettings\")\n                .with_resolved_tip(self.tip, self.estimate_tip);\n\n            Ok(fee_settings)\n        } else {\n            let fee_settings = FeeSettings::from(self.clone());\n            Ok(fee_settings)\n        }\n    }\n}\n\n/// Struct used in `sncast script` for deserializing from cairo, `FeeSettings` can't be\n/// used as it missing `max_fee`\n#[derive(Debug, PartialEq, CairoDeserialize)]\npub struct ScriptFeeSettings {\n    max_fee: Option<NonZeroFelt>,\n    l1_gas: Option<u64>,\n    l1_gas_price: Option<u128>,\n    l2_gas: Option<u64>,\n    l2_gas_price: Option<u128>,\n    l1_data_gas: Option<u64>,\n    l1_data_gas_price: Option<u128>,\n}\n\n#[derive(Debug, PartialEq)]\npub struct FeeSettings {\n    pub l1_gas: Option<u64>,\n    pub l1_gas_price: Option<u128>,\n    pub l2_gas: Option<u64>,\n    pub l2_gas_price: Option<u128>,\n    pub l1_data_gas: Option<u64>,\n    pub l1_data_gas_price: Option<u128>,\n    pub tip: Option<u64>,\n}\n\nimpl FeeSettings {\n    #[must_use]\n    pub fn with_resolved_tip(self, tip: Option<u64>, estimate_tip: bool) -> FeeSettings {\n        let tip = if estimate_tip {\n            None // If we leave it as None, the tip will be estimated before sending the transaction\n        } else {\n            Some(tip.unwrap_or(0)) // If a tip is not provided, set it to 0\n        };\n\n        FeeSettings { tip, ..self }\n    }\n}\n\nimpl TryFrom<FeeEstimate> for FeeSettings {\n    type Error = anyhow::Error;\n    fn try_from(fee_estimate: FeeEstimate) -> Result<FeeSettings, anyhow::Error> {\n        Ok(FeeSettings {\n            l1_gas: Some(fee_estimate.l1_gas_consumed),\n            l1_gas_price: Some(fee_estimate.l1_gas_price),\n            l2_gas: Some(fee_estimate.l2_gas_consumed),\n            l2_gas_price: Some(fee_estimate.l2_gas_price),\n            l1_data_gas: Some(fee_estimate.l1_data_gas_consumed),\n            l1_data_gas_price: Some(fee_estimate.l1_data_gas_price),\n            tip: None,\n        })\n    }\n}\n\nimpl From<FeeArgs> for FeeSettings {\n    fn from(fee_args: FeeArgs) -> FeeSettings {\n        FeeSettings {\n            l1_gas: fee_args.l1_gas,\n            l1_gas_price: fee_args.l1_gas_price,\n            l2_gas: fee_args.l2_gas,\n            l2_gas_price: fee_args.l2_gas_price,\n            l1_data_gas: fee_args.l1_data_gas,\n            l1_data_gas_price: fee_args.l1_data_gas_price,\n            tip: None,\n        }\n        .with_resolved_tip(fee_args.tip, fee_args.estimate_tip)\n    }\n}\n\nfn parse_non_zero_felt(s: &str) -> Result<NonZeroFelt, String> {\n    let felt: Felt = s.parse().map_err(|_| \"Failed to parse value\")?;\n    felt.try_into()\n        .map_err(|_| \"Value should be greater than 0\".to_string())\n}\n\n#[cfg(test)]\nmod tests {\n    use super::FeeSettings;\n    use starknet_rust::core::types::FeeEstimate;\n    use std::convert::TryFrom;\n\n    #[tokio::test]\n    async fn test_from_fee_estimate() {\n        let mock_fee_estimate = FeeEstimate {\n            l1_gas_consumed: 1,\n            l1_gas_price: 2,\n            l2_gas_consumed: 3,\n            l2_gas_price: 4,\n            l1_data_gas_consumed: 5,\n            l1_data_gas_price: 6,\n            overall_fee: 44,\n        };\n        let settings = FeeSettings::try_from(mock_fee_estimate).unwrap();\n\n        assert_eq!(\n            settings,\n            FeeSettings {\n                l1_gas: Some(1),\n                l1_gas_price: Some(2),\n                l2_gas: Some(3),\n                l2_gas_price: Some(4),\n                l1_data_gas: Some(5),\n                l1_data_gas_price: Some(6),\n                tip: None,\n            }\n        );\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/helpers/interactive.rs",
    "content": "use crate::helpers::config::get_global_config_path;\nuse anyhow::{Context, Result};\nuse camino::Utf8PathBuf;\nuse configuration::search_config_upwards_relative_to;\nuse dialoguer::Select;\nuse dialoguer::theme::ColorfulTheme;\nuse std::fmt::Display;\nuse std::{env, fs};\nuse toml_edit::{DocumentMut, Item, Table, Value};\n\nenum PromptSelection {\n    GlobalDefault(Utf8PathBuf),\n    LocalDefault(Utf8PathBuf),\n    No,\n}\n\nimpl Display for PromptSelection {\n    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {\n        match self {\n            PromptSelection::LocalDefault(path) => {\n                write!(f, \"Yes, local default ({})\", to_tilde_path(path))\n            }\n            PromptSelection::GlobalDefault(path) => {\n                write!(f, \"Yes, global default ({})\", to_tilde_path(path))\n            }\n            PromptSelection::No => write!(f, \"No\"),\n        }\n    }\n}\n\npub fn prompt_to_add_account_as_default(account: &str) -> Result<()> {\n    let mut options = Vec::new();\n\n    if let Ok(global_path) = get_global_config_path() {\n        options.push(PromptSelection::GlobalDefault(global_path));\n    }\n\n    if let Some(local_path) = env::current_dir()\n        .ok()\n        .and_then(|current_path| Utf8PathBuf::from_path_buf(current_path.clone()).ok())\n        .and_then(|current_path_utf8| search_config_upwards_relative_to(&current_path_utf8).ok())\n    {\n        options.push(PromptSelection::LocalDefault(local_path));\n    }\n\n    options.push(PromptSelection::No);\n\n    let selection = Select::with_theme(&ColorfulTheme::default())\n        .with_prompt(\"Do you want to make this account default?\")\n        .items(&options)\n        .default(0)\n        .interact()\n        .context(\"Failed to display selection dialog\")?;\n\n    match &options[selection] {\n        PromptSelection::GlobalDefault(path) | PromptSelection::LocalDefault(path) => {\n            edit_config(path, \"default\", \"account\", account)?;\n        }\n        PromptSelection::No => {}\n    }\n\n    Ok(())\n}\n\nfn edit_config(config_path: &Utf8PathBuf, profile: &str, key: &str, value: &str) -> Result<()> {\n    let file_content = fs::read_to_string(config_path).context(\"Failed to read config file\")?;\n\n    let mut toml_doc = file_content\n        .parse::<DocumentMut>()\n        .context(\"Failed to parse TOML\")?;\n    update_config(&mut toml_doc, profile, key, value);\n\n    fs::write(config_path, toml_doc.to_string()).context(\"Failed to write to config file\")?;\n\n    Ok(())\n}\n\nfn update_config(toml_doc: &mut DocumentMut, profile: &str, key: &str, value: &str) {\n    let sncast_section = toml_doc\n        .entry(\"sncast\")\n        .or_insert(Item::Table(Table::new()));\n\n    let sncast_table = sncast_section\n        .as_table_mut()\n        .expect(\"Failed to create or access 'sncast' table\");\n    sncast_table.set_implicit(true);\n\n    let profile_table = sncast_table\n        .entry(profile)\n        .or_insert(Item::Table(Table::new()))\n        .as_table_mut()\n        .expect(\"Failed to create or access profile table\");\n\n    profile_table[key] = Value::from(value).into();\n}\n\nfn to_tilde_path(path: &Utf8PathBuf) -> String {\n    if cfg!(not(target_os = \"windows\"))\n        && let Some(home_dir) = dirs::home_dir()\n        && let Ok(canonical_path) = path.canonicalize()\n        && let Ok(stripped_path) = canonical_path.strip_prefix(&home_dir)\n    {\n        return format!(\"~/{}\", stripped_path.to_string_lossy());\n    }\n\n    path.to_string()\n}\n\n#[cfg(test)]\nmod tests {\n\n    use super::update_config;\n    use indoc::formatdoc;\n    use toml_edit::DocumentMut;\n    #[test]\n    fn test_update_value() {\n        let original = formatdoc! {r#\"\n            [snfoundry]\n            key = 2137\n\n            [sncast.default]\n            account = \"mainnet\"\n            url = \"https://localhost:5050\"\n\n            # comment\n\n            [sncast.testnet]\n            account = \"testnet-account\"        # comment\n            url = \"https://swmansion.com/\"\n        \"#};\n\n        let expected = formatdoc! {r#\"\n            [snfoundry]\n            key = 2137\n\n            [sncast.default]\n            account = \"testnet\"\n            url = \"https://localhost:5050\"\n\n            # comment\n\n            [sncast.testnet]\n            account = \"testnet-account\"        # comment\n            url = \"https://swmansion.com/\"\n        \"#};\n\n        let mut toml_doc = original.parse::<DocumentMut>().unwrap();\n\n        update_config(&mut toml_doc, \"default\", \"account\", \"testnet\");\n\n        assert_eq!(toml_doc.to_string(), expected);\n    }\n\n    #[test]\n    fn test_create_key() {\n        let original = formatdoc! {r#\"\n            [snfoundry]\n            key = 2137\n\n            [sncast.default]\n            url = \"https://localhost:5050\"\n\n            [sncast.testnet]\n            account = \"testnet-account\"        # comment\n            url = \"https://swmansion.com/\"\n        \"#};\n\n        let expected = formatdoc! {r#\"\n            [snfoundry]\n            key = 2137\n\n            [sncast.default]\n            url = \"https://localhost:5050\"\n            account = \"testnet\"\n\n            [sncast.testnet]\n            account = \"testnet-account\"        # comment\n            url = \"https://swmansion.com/\"\n        \"#};\n\n        let mut toml_doc = original.parse::<DocumentMut>().unwrap();\n\n        update_config(&mut toml_doc, \"default\", \"account\", \"testnet\");\n\n        assert_eq!(toml_doc.to_string(), expected);\n    }\n\n    #[test]\n    fn test_create_table_key() {\n        let original = formatdoc! {r#\"\n            [snfoundry]\n            key = 2137\n\n            [sncast.testnet]\n            account = \"testnet-account\"        # comment\n            url = \"https://swmansion.com/\"\n        \"#};\n\n        let expected = formatdoc! {r#\"\n            [snfoundry]\n            key = 2137\n\n            [sncast.testnet]\n            account = \"testnet-account\"        # comment\n            url = \"https://swmansion.com/\"\n\n            [sncast.default]\n            account = \"testnet\"\n        \"#};\n\n        let mut toml_doc = original.parse::<DocumentMut>().unwrap();\n\n        update_config(&mut toml_doc, \"default\", \"account\", \"testnet\");\n\n        assert_eq!(toml_doc.to_string(), expected);\n    }\n\n    #[test]\n    fn test_create_table() {\n        let original = formatdoc! {r\"\n            [snfoundry]\n            key = 2137\n        \"};\n\n        let expected = formatdoc! {\n            r#\"\n            [snfoundry]\n            key = 2137\n\n            [sncast.default]\n            account = \"testnet\"\n        \"#};\n\n        let mut toml_doc = original.parse::<DocumentMut>().unwrap();\n\n        update_config(&mut toml_doc, \"default\", \"account\", \"testnet\");\n\n        assert_eq!(toml_doc.to_string(), expected);\n    }\n\n    #[test]\n    fn test_create_table_empty_file() {\n        let original = \"\";\n\n        let expected = formatdoc! {\n            r#\"\n            [sncast.default]\n            account = \"testnet\"\n        \"#};\n\n        let mut toml_doc = original.parse::<DocumentMut>().unwrap();\n\n        update_config(&mut toml_doc, \"default\", \"account\", \"testnet\");\n\n        assert_eq!(toml_doc.to_string(), expected);\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/helpers/ledger/account.rs",
    "content": "use super::{SncastLedgerTransport, create_ledger_app};\nuse crate::response::ui::UI;\nuse anyhow::{Context, Result, bail};\nuse starknet_rust::{\n    accounts::{ExecutionEncoding, SingleOwnerAccount},\n    core::types::{BlockId, BlockTag},\n    providers::jsonrpc::{HttpTransport, JsonRpcClient},\n    signers::{DerivationPath, LedgerSigner},\n};\nuse starknet_types_core::felt::Felt;\n\nconst LEDGER_SIGNER_ERROR: &str = \"Failed to create Ledger signer. Ensure the derivation path is correct and the Ledger app is ready.\";\n\npub async fn create_ledger_signer(\n    ledger_path: &DerivationPath,\n    ui: &UI,\n    print_message: bool,\n) -> Result<LedgerSigner<SncastLedgerTransport>> {\n    let ledger_app = create_ledger_app().await?;\n\n    if print_message {\n        ui.print_notification(\n            \"Ledger device will display a confirmation screen. Please approve it to continue...\\n\",\n        );\n    }\n\n    LedgerSigner::new_with_app(ledger_path.clone(), ledger_app).context(LEDGER_SIGNER_ERROR)\n}\n\npub fn verify_ledger_public_key(ledger_public_key: Felt, stored_public_key: Felt) -> Result<()> {\n    if ledger_public_key != stored_public_key {\n        bail!(\n            \"Public key mismatch!\\n\\\n            Ledger public key: {ledger_public_key:#x}\\n\\\n            Stored public key: {stored_public_key:#x}\\n\\\n            \\n\\\n            This account was created with a different Ledger derivation path or public key.\\n\\\n            Make sure you're using the same derivation path that was used during account creation.\"\n        );\n    }\n    Ok(())\n}\n\npub async fn ledger_account<'a>(\n    ledger_path: &DerivationPath,\n    address: Felt,\n    chain_id: Felt,\n    encoding: ExecutionEncoding,\n    provider: &'a JsonRpcClient<HttpTransport>,\n    ui: &UI,\n) -> Result<SingleOwnerAccount<&'a JsonRpcClient<HttpTransport>, LedgerSigner<SncastLedgerTransport>>>\n{\n    let signer = create_ledger_signer(ledger_path, ui, true).await?;\n\n    let mut account = SingleOwnerAccount::new(provider, signer, address, chain_id, encoding);\n    account.set_block_id(BlockId::Tag(BlockTag::PreConfirmed));\n\n    Ok(account)\n}\n\npub async fn get_ledger_public_key(ledger_path: &DerivationPath, ui: &UI) -> Result<Felt> {\n    let ledger_app = create_ledger_app().await?;\n\n    ui.print_notification(\"Please confirm the public key on your Ledger device...\\n\");\n\n    let public_key = ledger_app\n        .get_public_key(ledger_path.clone(), true)\n        .await\n        .context(\"Failed to get public key from Ledger\")?;\n\n    Ok(public_key.scalar())\n}\n"
  },
  {
    "path": "crates/sncast/src/helpers/ledger/emulator_transport.rs",
    "content": "//! This module is only used behind the `ledger-emulator` feature flag.\n//! It is used to test the ledger commands locally without having to connect to a real Ledger device.\nuse async_trait::async_trait;\nuse coins_ledger::{\n    APDUAnswer, APDUCommand, LedgerError,\n    transports::{LedgerAsync, native::NativeTransportError},\n};\nuse reqwest::Client;\nuse serde::Serialize;\nuse starknet_rust::signers::ledger::{LedgerError as StarknetLedgerError, LedgerStarknetApp};\nuse std::io::Error as IoError;\n\n#[derive(Debug)]\npub struct SpeculosHttpTransport {\n    client: Client,\n    base_url: String,\n}\n\n#[derive(Serialize)]\nstruct ApduRequest {\n    data: String,\n}\n\nfn io_err(e: impl Into<Box<dyn std::error::Error + Send + Sync>>) -> LedgerError {\n    LedgerError::NativeTransportError(NativeTransportError::Io(IoError::other(e)))\n}\n\nimpl SpeculosHttpTransport {\n    pub fn new(url: String) -> Result<Self, LedgerError> {\n        let client = Client::builder().build().map_err(io_err)?;\n        Ok(Self {\n            client,\n            base_url: url,\n        })\n    }\n}\n\n#[async_trait]\nimpl LedgerAsync for SpeculosHttpTransport {\n    async fn init() -> Result<Self, LedgerError> {\n        let url = std::env::var(\"LEDGER_EMULATOR_URL\")\n            .unwrap_or_else(|_| \"http://127.0.0.1:5001\".to_string());\n        Self::new(url)\n    }\n\n    async fn exchange(&self, command: &APDUCommand) -> Result<APDUAnswer, LedgerError> {\n        let request = ApduRequest {\n            data: const_hex::encode(command.serialize()),\n        };\n\n        let resp = self\n            .client\n            .post(format!(\"{}/apdu\", self.base_url))\n            .json(&request)\n            .send()\n            .await\n            .map_err(io_err)?;\n\n        if !resp.status().is_success() {\n            return Err(io_err(format!(\"HTTP Error: {}\", resp.status())));\n        }\n\n        let body: serde_json::Value = resp.json().await.map_err(io_err)?;\n\n        if let Some(err) = body.get(\"error\").and_then(|v| v.as_str()) {\n            return Err(io_err(format!(\"Speculos Error: {err}\")));\n        }\n\n        let data_str =\n            body.get(\"data\")\n                .and_then(|v| v.as_str())\n                .ok_or(LedgerError::NativeTransportError(\n                    NativeTransportError::Comm(\"Missing data field\"),\n                ))?;\n\n        let answer = const_hex::decode(data_str).map_err(io_err)?;\n\n        APDUAnswer::from_answer(answer).map_err(|_| {\n            LedgerError::NativeTransportError(NativeTransportError::Comm(\"Invalid APDU response\"))\n        })\n    }\n\n    fn close(self) {}\n}\n\npub async fn emulator_ledger_app()\n-> Result<LedgerStarknetApp<SpeculosHttpTransport>, StarknetLedgerError> {\n    let transport = SpeculosHttpTransport::init().await?;\n    Ok(LedgerStarknetApp::from_transport(transport))\n}\n"
  },
  {
    "path": "crates/sncast/src/helpers/ledger/hd_path.rs",
    "content": "use std::str::FromStr;\n\nuse crate::response::ui::UI;\nuse anyhow::{Result, anyhow, bail};\nuse clap::{Arg, Command, Error, builder::TypedValueParser, error::ErrorKind};\nuse foundry_ui::components::warning::WarningMessage;\nuse sha2::{Digest, Sha256};\nuse starknet_rust::signers::DerivationPath;\n\nconst EIP2645_LENGTH: usize = 6;\n\n/// BIP-32 encoding of `2645'`\nconst EIP_2645_PURPOSE: u32 = 0x8000_0a55;\n\n/// The BIP-32 hardened derivation bit.\nconst HARDENED_BIT: u32 = 1 << 31;\n\n/// Mask to extract the non-hardened index from a BIP-32 path component.\nconst NON_HARDENED_MASK: u32 = 0x7fff_ffff;\n\n#[derive(Clone)]\npub struct DerivationPathParser;\n\n/// A parsed derivation path together with any warnings produced during parsing.\n#[derive(Debug, Clone)]\npub struct ParsedDerivationPath {\n    pub path: DerivationPath,\n    pub warnings: Vec<String>,\n}\n\nimpl ParsedDerivationPath {\n    pub fn print_warnings(&self, ui: &UI) {\n        for warning in &self.warnings {\n            ui.print_warning(WarningMessage::new(warning));\n        }\n    }\n}\n\n/// An EIP-2645 HD path, required by the Starknet Ledger app. This type allows users to write\n/// hash-based segments in text, instead of manually finding out the lowest 31 bits of the hash.\n///\n/// The Ledger app requires that the path:\n/// - starts with `2645'`; and\n/// - has 6 levels\n///\n/// Supports shorthand `m//` to omit `2645'`:\n///   `m//starknet'/sncast'/0'/0'/0`\n#[derive(Debug, Clone)]\nstruct Eip2645Path {\n    layer: Eip2645Level,\n    application: Eip2645Level,\n    eth_address_1: Eip2645Level,\n    eth_address_2: Eip2645Level,\n    index: Eip2645Level,\n}\n\n#[derive(Debug, Clone)]\nenum Eip2645Level {\n    Hash(HashLevel),\n    Raw(u32),\n}\n\n#[derive(Debug, Clone)]\nstruct HashLevel {\n    text: String,\n    hardened: bool,\n}\n\nimpl TypedValueParser for DerivationPathParser {\n    type Value = ParsedDerivationPath;\n\n    fn parse_ref(\n        &self,\n        cmd: &Command,\n        _arg: Option<&Arg>,\n        value: &std::ffi::OsStr,\n    ) -> Result<Self::Value, Error> {\n        if value.is_empty() {\n            return Err(cmd\n                .clone()\n                .error(ErrorKind::InvalidValue, \"empty Ledger derivation path\"));\n        }\n        match value.to_str() {\n            Some(value) => match Eip2645Path::from_str_with_warnings(value) {\n                Ok((path, warnings)) => Ok(ParsedDerivationPath {\n                    path: path.into(),\n                    warnings,\n                }),\n                Err(err) => Err(cmd.clone().error(\n                    ErrorKind::InvalidValue,\n                    format!(\"invalid Ledger derivation path: {err}\"),\n                )),\n            },\n            None => Err(cmd.clone().error(\n                ErrorKind::InvalidValue,\n                \"invalid Ledger derivation path: not UTF-8\",\n            )),\n        }\n    }\n}\n\nimpl Eip2645Path {\n    fn from_str_with_warnings(s: &str) -> Result<(Self, Vec<String>)> {\n        let path = s.parse::<Self>()?;\n        let mut warnings = Vec::new();\n\n        // These are allowed but we should serve a warning.\n        match &path.eth_address_1 {\n            Eip2645Level::Hash(_) => {\n                warnings.push(\n                    \"using a non-numerical value for \\\"eth_address_1\\\" might make \\\n                    automatic key discovery difficult or impossible\"\n                        .to_string(),\n                );\n            }\n            Eip2645Level::Raw(raw) => {\n                if raw & NON_HARDENED_MASK != 0 {\n                    warnings.push(\n                        \"using any value other than `0'` for \\\"eth_address_1\\\" might \\\n                        make automatic key discovery difficult or impossible\"\n                            .to_string(),\n                    );\n                }\n            }\n        }\n        match &path.eth_address_2 {\n            Eip2645Level::Hash(_) => {\n                warnings.push(\n                    \"using a non-numerical value for \\\"eth_address_2\\\" might make \\\n                    automatic key discovery difficult or impossible\"\n                        .to_string(),\n                );\n            }\n            Eip2645Level::Raw(raw) => {\n                if raw & NON_HARDENED_MASK > 100 {\n                    warnings.push(\n                        \"using a large value for \\\"eth_address_2\\\" might make \\\n                        automatic key discovery difficult\"\n                            .to_string(),\n                    );\n                }\n            }\n        }\n        if path.index.is_hardened() {\n            warnings.push(\n                \"hardening \\\"index\\\" is non-standard and it might make \\\n                automatic key discovery difficult or impossible\"\n                    .to_string(),\n            );\n        }\n        if u32::from(&path.index) & NON_HARDENED_MASK > 100 {\n            warnings.push(\n                \"using a large value for \\\"index\\\" might make \\\n                automatic key discovery difficult\"\n                    .to_string(),\n            );\n        }\n        if !warnings.is_empty() {\n            warnings.push(\n                \"Learn more at \\\n                https://foundry-rs.github.io/starknet-foundry/starknet/eip-2645-hd-paths.html\"\n                    .to_string(),\n            );\n        }\n\n        Ok((path, warnings))\n    }\n}\n\nimpl FromStr for Eip2645Path {\n    type Err = anyhow::Error;\n\n    fn from_str(s: &str) -> Result<Self, Self::Err> {\n        // Handle m// prefix (omitted 2645')\n        let s = if s.starts_with(\"m//\") {\n            s.replacen(\"m//\", \"m/2645'/\", 1)\n        } else {\n            s.to_string()\n        };\n\n        let segments: Vec<&str> = s.split('/').collect();\n        if segments.len() != EIP2645_LENGTH + 1 {\n            bail!(\"EIP-2645 paths must have {EIP2645_LENGTH} levels\");\n        }\n        if segments[0] != \"m\" {\n            bail!(\"HD wallet paths must start with \\\"m/\\\"\");\n        }\n\n        let prefix = segments[1].parse()?;\n        if u32::from(&prefix) != EIP_2645_PURPOSE {\n            bail!(\"EIP-2645 paths must start with \\\"m/2645'/\\\"\");\n        }\n\n        let path = Self {\n            layer: segments[2].parse()?,\n            application: segments[3].parse()?,\n            eth_address_1: segments[4].parse()?,\n            eth_address_2: segments[5].parse()?,\n            index: segments[6].parse()?,\n        };\n\n        // These are not enforced by Ledger (for now) but are nice to have security properties\n        if !path.layer.is_hardened() {\n            bail!(\"the \\\"layer\\\" level of an EIP-2645 path must be hardened\");\n        }\n        if !path.application.is_hardened() {\n            bail!(\"the \\\"application\\\" level of an EIP-2645 path must be hardened\");\n        }\n        if !path.eth_address_1.is_hardened() {\n            bail!(\"the \\\"eth_address_1\\\" level of an EIP-2645 path must be hardened\");\n        }\n        if !path.eth_address_2.is_hardened() {\n            bail!(\"the \\\"eth_address_2\\\" level of an EIP-2645 path must be hardened\");\n        }\n\n        // In the future, certain wallets might utilize sequential `index` values for key discovery,\n        // so it might be a good idea for us to disallow using hash-based values for `index` here.\n        if matches!(path.index, Eip2645Level::Hash(_)) {\n            bail!(\"the \\\"index\\\" level must be a number\");\n        }\n\n        Ok(path)\n    }\n}\n\nimpl Eip2645Level {\n    fn is_hardened(&self) -> bool {\n        match self {\n            Self::Hash(hash) => hash.hardened,\n            Self::Raw(raw) => raw & HARDENED_BIT > 0,\n        }\n    }\n}\n\nimpl FromStr for Eip2645Level {\n    type Err = anyhow::Error;\n\n    fn from_str(s: &str) -> Result<Self, Self::Err> {\n        if s.trim() != s || s.split_whitespace().count() != 1 {\n            bail!(\"path must not contain whitespaces\");\n        }\n\n        let (body, harden_notation) = if s.ends_with('\\'') {\n            (&s[0..(s.len() - 1)], true)\n        } else {\n            (s, false)\n        };\n\n        if body.chars().all(|char| char.is_ascii_digit()) {\n            let raw_node = body\n                .parse::<u32>()\n                .map_err(|err| anyhow!(\"invalid path level \\\"{body}\\\": {err}\"))?;\n\n            if harden_notation {\n                if raw_node & HARDENED_BIT > 0 {\n                    bail!(\"`'` appended to an already-hardened value of {raw_node}\");\n                }\n                Ok(Self::Raw(raw_node | HARDENED_BIT))\n            } else {\n                Ok(Self::Raw(raw_node))\n            }\n        } else {\n            Ok(Self::Hash(HashLevel {\n                text: body.to_owned(),\n                hardened: harden_notation,\n            }))\n        }\n    }\n}\n\nimpl From<Eip2645Path> for DerivationPath {\n    fn from(value: Eip2645Path) -> Self {\n        vec![\n            EIP_2645_PURPOSE,\n            (&value.layer).into(),\n            (&value.application).into(),\n            (&value.eth_address_1).into(),\n            (&value.eth_address_2).into(),\n            (&value.index).into(),\n        ]\n        .into()\n    }\n}\n\nimpl From<&Eip2645Level> for u32 {\n    fn from(value: &Eip2645Level) -> Self {\n        match value {\n            Eip2645Level::Hash(level) => {\n                let mut hasher = Sha256::new();\n                hasher.update(level.text.as_bytes());\n                let hash = hasher.finalize();\n\n                // Safe to unwrap: SHA256 output is fixed size\n                let node = u32::from_be_bytes(hash.as_slice()[28..].try_into().unwrap());\n\n                if level.hardened {\n                    node | HARDENED_BIT\n                } else {\n                    // SHA-256 may produce values >= 2^31; mask off the hardened bit to keep the\n                    // index in the non-hardened range.\n                    node & NON_HARDENED_MASK\n                }\n            }\n            Eip2645Level::Raw(raw) => *raw,\n        }\n    }\n}\n\n/// Constructs the canonical sncast derivation path for a given account ID:\n/// `m//starknet'/sncast'/0'/<account_id>'/0`\npub(super) fn account_id_to_derivation_path(account_id: u32) -> DerivationPath {\n    Eip2645Path::from_str(&format!(\"m//starknet'/sncast'/0'/{account_id}'/0\"))\n        .expect(\"account_id_to_derivation_path: generated path must be valid\")\n        .into()\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    fn hash_segment(s: &str) -> u32 {\n        let level = Eip2645Level::Hash(HashLevel {\n            text: s.to_owned(),\n            hardened: false,\n        });\n        u32::from(&level)\n    }\n\n    #[test]\n    fn test_hash_starknet() {\n        assert_eq!(hash_segment(\"starknet\"), 1_195_502_025);\n    }\n\n    #[test]\n    fn test_hash_bounded() {\n        assert!(hash_segment(\"sncast\") < (1 << 31));\n    }\n\n    #[test]\n    fn test_path_with_omitted_2645() {\n        let path = Eip2645Path::from_str(\"m//starknet'/sncast'/0'/0'/0\").unwrap();\n        let dp: DerivationPath = path.into();\n        let s = dp.derivation_string();\n        assert!(s.contains(\"2645'\"));\n    }\n\n    #[test]\n    fn test_path_with_explicit_2645() {\n        let input = \"m/2645'/starknet'/sncast'/0'/0'/0\";\n        let path = Eip2645Path::from_str(input).unwrap();\n        let dp: DerivationPath = path.into();\n        let s = dp.derivation_string();\n        assert!(s.contains(\"2645'\"));\n        assert!(s.contains(\"1195502025'\"));\n    }\n\n    #[test]\n    fn test_numeric_path() {\n        let input = \"m/2645'/1195502025'/355113700'/0'/0'/0\";\n        let path = Eip2645Path::from_str(input).unwrap();\n        let dp: DerivationPath = path.into();\n        let s = dp.derivation_string();\n        assert!(s.contains(\"1195502025'\"));\n        assert!(s.contains(\"355113700'\"));\n    }\n\n    #[test]\n    fn test_wrong_level_count_errors() {\n        assert!(Eip2645Path::from_str(\"m/2645'/starknet'/sncast'/0'/0'\").is_err());\n    }\n\n    #[test]\n    fn test_unhardened_layer_errors() {\n        assert!(Eip2645Path::from_str(\"m/2645'/1195502025/355113700'/0'/0'/0\").is_err());\n    }\n\n    #[test]\n    fn test_hash_index_errors() {\n        assert!(Eip2645Path::from_str(\"m/2645'/starknet'/sncast'/0'/0'/myindex\").is_err());\n    }\n\n    #[test]\n    fn test_path_warnings() {\n        let warnings_for = |path: &str| {\n            Eip2645Path::from_str_with_warnings(path)\n                .expect(\"path should be valid\")\n                .1\n        };\n\n        // Canonical path — no warnings expected\n        assert!(warnings_for(\"m//starknet'/sncast'/0'/0'/0\").is_empty());\n\n        // eth_address_1: hash segment warns\n        assert!(\n            warnings_for(\"m//starknet'/sncast'/myapp'/0'/0\")\n                .iter()\n                .any(|w| w.contains(\"eth_address_1\"))\n        );\n\n        // eth_address_1: any non-zero raw value warns\n        assert!(\n            warnings_for(\"m//starknet'/sncast'/1'/0'/0\")\n                .iter()\n                .any(|w| w.contains(\"eth_address_1\"))\n        );\n\n        // eth_address_1: 0' is standard — no warning\n        assert!(\n            !warnings_for(\"m//starknet'/sncast'/0'/0'/0\")\n                .iter()\n                .any(|w| w.contains(\"eth_address_1\"))\n        );\n\n        // eth_address_2: hash segment warns\n        assert!(\n            warnings_for(\"m//starknet'/sncast'/0'/wallet'/0\")\n                .iter()\n                .any(|w| w.contains(\"eth_address_2\"))\n        );\n\n        // eth_address_2: value > 100 warns\n        assert!(\n            warnings_for(\"m//starknet'/sncast'/0'/101'/0\")\n                .iter()\n                .any(|w| w.contains(\"eth_address_2\"))\n        );\n\n        // eth_address_2: value <= 100 — no warning\n        assert!(\n            !warnings_for(\"m//starknet'/sncast'/0'/1'/0\")\n                .iter()\n                .any(|w| w.contains(\"eth_address_2\"))\n        );\n\n        // index: value > 100 warns\n        assert!(\n            warnings_for(\"m//starknet'/sncast'/0'/0'/101\")\n                .iter()\n                .any(|w| w.contains(\"index\"))\n        );\n\n        // index: value <= 100 — no warning\n        assert!(\n            !warnings_for(\"m//starknet'/sncast'/0'/0'/5\")\n                .iter()\n                .any(|w| w.contains(\"index\"))\n        );\n    }\n\n    #[test]\n    fn test_account_id_to_derivation_path() {\n        // account_id 5 should equal m//starknet'/sncast'/0'/5'/0\n        let from_id = account_id_to_derivation_path(5);\n        let from_str: DerivationPath = Eip2645Path::from_str(\"m//starknet'/sncast'/0'/5'/0\")\n            .unwrap()\n            .into();\n        assert_eq!(from_id.derivation_string(), from_str.derivation_string());\n    }\n\n    #[test]\n    fn test_account_id_zero() {\n        let from_id = account_id_to_derivation_path(0);\n        let from_str: DerivationPath = Eip2645Path::from_str(\"m//starknet'/sncast'/0'/0'/0\")\n            .unwrap()\n            .into();\n        assert_eq!(from_id.derivation_string(), from_str.derivation_string());\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/helpers/ledger/key_locator.rs",
    "content": "use clap::Args;\nuse starknet_rust::signers::DerivationPath;\n\nuse crate::response::ui::UI;\n\nuse super::hd_path::{DerivationPathParser, ParsedDerivationPath, account_id_to_derivation_path};\n\n#[derive(Args, Debug)]\n#[group(multiple = false, required = true)]\npub struct LedgerKeyLocator {\n    /// Ledger derivation path in EIP-2645 format\n    #[arg(long, value_parser = DerivationPathParser)]\n    pub path: Option<ParsedDerivationPath>,\n\n    /// Account index, expands to \"m//starknet'/sncast'/0'/<account-id>'/0\"\n    #[arg(long)]\n    pub account_id: Option<u32>,\n}\n\n#[derive(Args, Debug)]\n#[group(id = \"ledger_key_locator_account\", multiple = false)]\npub struct LedgerKeyLocatorAccount {\n    /// Ledger derivation path in EIP-2645 format\n    #[arg(long = \"ledger-path\", value_parser = DerivationPathParser)]\n    pub path: Option<ParsedDerivationPath>,\n\n    /// Account index, expands to \"m//starknet'/sncast'/0'/<account-id>'/0\"\n    #[arg(long = \"ledger-account-id\")]\n    pub account_id: Option<u32>,\n}\n\nimpl LedgerKeyLocator {\n    #[must_use]\n    pub fn resolve(&self, ui: &UI) -> DerivationPath {\n        // This expect is unreachable - clap's `required = true` group guarantees\n        // that at least one of `--path` or `--account-id` is provided\n        resolve_key_locator(self.path.as_ref(), self.account_id, ui)\n            .expect(\"clap requires one of --path or --account-id\")\n    }\n}\n\nimpl LedgerKeyLocatorAccount {\n    #[must_use]\n    pub fn resolve(&self, ui: &UI) -> Option<DerivationPath> {\n        resolve_key_locator(self.path.as_ref(), self.account_id, ui)\n    }\n}\n\nfn resolve_key_locator(\n    path: Option<&ParsedDerivationPath>,\n    account_id: Option<u32>,\n    ui: &UI,\n) -> Option<DerivationPath> {\n    if let Some(parsed) = path {\n        parsed.print_warnings(ui);\n        Some(parsed.path.clone())\n    } else {\n        account_id.map(account_id_to_derivation_path)\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/helpers/ledger/mod.rs",
    "content": "mod account;\nmod hd_path;\nmod key_locator;\n\n#[cfg(feature = \"ledger-emulator\")]\nmod emulator_transport;\n\npub use account::{\n    create_ledger_signer, get_ledger_public_key, ledger_account, verify_ledger_public_key,\n};\npub use hd_path::{DerivationPathParser, ParsedDerivationPath};\npub use key_locator::{LedgerKeyLocator, LedgerKeyLocatorAccount};\n\nuse starknet_rust::signers::ledger::LedgerStarknetApp;\n\n#[cfg(feature = \"ledger-emulator\")]\npub type SncastLedgerTransport = emulator_transport::SpeculosHttpTransport;\n\n#[cfg(not(feature = \"ledger-emulator\"))]\npub type SncastLedgerTransport = coins_ledger::transports::Ledger;\n\npub async fn create_ledger_app() -> anyhow::Result<LedgerStarknetApp<SncastLedgerTransport>> {\n    #[cfg(feature = \"ledger-emulator\")]\n    let app = emulator_transport::emulator_ledger_app().await?;\n    #[cfg(not(feature = \"ledger-emulator\"))]\n    let app = LedgerStarknetApp::new().await?;\n    Ok(app)\n}\n"
  },
  {
    "path": "crates/sncast/src/helpers/mod.rs",
    "content": "pub mod account;\npub mod artifacts;\npub mod block_explorer;\npub mod braavos;\npub mod command;\npub mod config;\npub mod configuration;\npub mod constants;\npub mod devnet;\npub mod fee;\npub mod interactive;\npub mod ledger;\npub mod output_format;\npub mod proof;\npub mod rpc;\npub mod scarb_utils;\npub mod signer;\npub mod token;\n"
  },
  {
    "path": "crates/sncast/src/helpers/output_format.rs",
    "content": "use foundry_ui::OutputFormat;\n\n#[must_use]\npub fn output_format_from_json_flag(json: bool) -> OutputFormat {\n    if json {\n        OutputFormat::Json\n    } else {\n        OutputFormat::Human\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/helpers/proof.rs",
    "content": "use anyhow::{Context, Result, bail};\nuse camino::Utf8PathBuf;\nuse clap::Args;\nuse starknet_types_core::felt::Felt;\n\n#[derive(Args, Debug, Clone, Default)]\npub struct ProofArgs {\n    /// Path to a file containing the proof (base64-encoded string) for the transaction.\n    #[arg(long, requires = \"proof_facts_file\")]\n    pub proof_file: Option<Utf8PathBuf>,\n\n    /// Path to a file containing proof facts (comma-separated felts) for the transaction.\n    #[arg(long, requires = \"proof_file\")]\n    pub proof_facts_file: Option<Utf8PathBuf>,\n}\n\nimpl ProofArgs {\n    #[must_use]\n    pub fn none() -> Self {\n        Self {\n            proof_file: None,\n            proof_facts_file: None,\n        }\n    }\n\n    pub fn resolve_proof(&self) -> Result<Option<String>> {\n        match &self.proof_file {\n            Some(path) => {\n                let contents = std::fs::read_to_string(path)\n                    .with_context(|| format!(\"Failed to read proof file at {path}\"))?;\n                let stripped = strip_quotes(contents.trim()).trim();\n                if stripped.is_empty() {\n                    bail!(\"Proof file is empty. Expected base64 string.\");\n                }\n                Ok(Some(stripped.to_string()))\n            }\n            None => Ok(None),\n        }\n    }\n\n    pub fn resolve_proof_facts(&self) -> Result<Option<Vec<Felt>>> {\n        match &self.proof_facts_file {\n            Some(path) => {\n                let contents = std::fs::read_to_string(path)\n                    .with_context(|| format!(\"Failed to read proof facts file at {path}\"))?;\n                let trimmed = contents.trim();\n                if trimmed.is_empty() {\n                    bail!(\"Proof facts file is empty. Expected comma separated felts.\");\n                }\n                let felts: Vec<Felt> = trimmed\n                    .split(',')\n                    .map(str::trim)\n                    .map(|s| {\n                        let stripped = strip_quotes(s);\n                        stripped\n                            .parse::<Felt>()\n                            .with_context(|| format!(\"Failed to parse felt from '{stripped}'\"))\n                    })\n                    .collect::<Result<Vec<_>>>()?;\n                Ok(Some(felts))\n            }\n            None => Ok(None),\n        }\n    }\n}\n\nfn strip_quotes(value: &str) -> &str {\n    for quote in ['\"', '\\''] {\n        if let Some(stripped) = value\n            .strip_prefix(quote)\n            .and_then(|s| s.strip_suffix(quote))\n        {\n            return stripped;\n        }\n    }\n    value\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use std::io::Write;\n    use tempfile::NamedTempFile;\n\n    #[test]\n    fn proof_file() {\n        let mut file = NamedTempFile::new().unwrap();\n        write!(file, \"SGVsbG8gd29ybGQhCg==\").unwrap();\n        let path = Utf8PathBuf::try_from(file.path().to_path_buf()).unwrap();\n\n        let args = ProofArgs {\n            proof_file: Some(path),\n            ..Default::default()\n        };\n        let result = args.resolve_proof().unwrap();\n\n        assert_eq!(result, Some(\"SGVsbG8gd29ybGQhCg==\".to_string()));\n    }\n\n    #[test]\n    fn missing_proof_file() {\n        let missing_path = \"/nonexistent/proof.txt\";\n        let args = ProofArgs {\n            proof_file: Some(Utf8PathBuf::from(missing_path)),\n            ..Default::default()\n        };\n        let err = args.resolve_proof().unwrap_err().to_string();\n\n        assert!(err.contains(&format!(\"Failed to read proof file at {missing_path}\")));\n    }\n\n    #[test]\n    fn empty_proof_file() {\n        let mut file = NamedTempFile::new().unwrap();\n        writeln!(file, \" \").unwrap();\n        let path = Utf8PathBuf::try_from(file.path().to_path_buf()).unwrap();\n\n        let args = ProofArgs {\n            proof_file: Some(path),\n            ..Default::default()\n        };\n        let err = args.resolve_proof().unwrap_err().to_string();\n\n        assert_eq!(err, \"Proof file is empty. Expected base64 string.\");\n    }\n\n    #[test]\n    fn proof_facts_file() {\n        let mut file = NamedTempFile::new().unwrap();\n        write!(file, \"0x1, 0x2, 0x3\").unwrap();\n        let path = Utf8PathBuf::try_from(file.path().to_path_buf()).unwrap();\n\n        let args = ProofArgs {\n            proof_facts_file: Some(path),\n            ..Default::default()\n        };\n        let result = args.resolve_proof_facts().unwrap();\n\n        assert_eq!(\n            result,\n            Some(vec![Felt::from(1), Felt::from(2), Felt::from(3)])\n        );\n    }\n\n    #[test]\n    fn proof_facts_file_quoted() {\n        let mut file = NamedTempFile::new().unwrap();\n        write!(file, \"\\\"0x1\\\", '0x2', 0x3\").unwrap();\n        let path = Utf8PathBuf::try_from(file.path().to_path_buf()).unwrap();\n\n        let args = ProofArgs {\n            proof_facts_file: Some(path),\n            ..Default::default()\n        };\n        let result = args.resolve_proof_facts().unwrap();\n\n        assert_eq!(\n            result,\n            Some(vec![Felt::from(1), Felt::from(2), Felt::from(3)])\n        );\n    }\n\n    #[test]\n    fn proof_facts_malformed() {\n        let mut file = NamedTempFile::new().unwrap();\n        write!(file, \"0x1, invalid, 0x3\").unwrap();\n        let path = Utf8PathBuf::try_from(file.path().to_path_buf()).unwrap();\n\n        let args = ProofArgs {\n            proof_facts_file: Some(path),\n            ..Default::default()\n        };\n        let err = args.resolve_proof_facts().unwrap_err().to_string();\n\n        assert_eq!(err, \"Failed to parse felt from 'invalid'\");\n    }\n\n    #[test]\n    fn missing_proof_facts_file() {\n        let missing_path = \"/nonexistent/path/proof_facts.txt\";\n        let args = ProofArgs {\n            proof_facts_file: Some(Utf8PathBuf::from(missing_path)),\n            ..Default::default()\n        };\n        let err = args.resolve_proof_facts().unwrap_err().to_string();\n\n        assert_eq!(\n            err,\n            \"Failed to read proof facts file at /nonexistent/path/proof_facts.txt\"\n        );\n    }\n\n    #[test]\n    fn empty_proof_facts_file() {\n        let mut file = NamedTempFile::new().unwrap();\n        write!(file, \" \").unwrap();\n        let path = Utf8PathBuf::try_from(file.path().to_path_buf()).unwrap();\n\n        let args = ProofArgs {\n            proof_facts_file: Some(path),\n            ..Default::default()\n        };\n        let err = args.resolve_proof_facts().unwrap_err().to_string();\n\n        assert_eq!(\n            err,\n            \"Proof facts file is empty. Expected comma separated felts.\"\n        );\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/helpers/rpc.rs",
    "content": "use crate::helpers::configuration::CastConfig;\nuse crate::helpers::devnet::detection;\nuse crate::response::ui::UI;\nuse crate::{Network, get_provider};\nuse anyhow::{Result, bail};\nuse clap::Args;\nuse shared::consts::RPC_URL_VERSION;\nuse shared::verify_and_warn_if_incompatible_rpc_version;\nuse starknet_rust::providers::{JsonRpcClient, jsonrpc::HttpTransport};\nuse url::Url;\n\n#[derive(Args, Clone, Debug, Default)]\n#[group(required = false, multiple = false)]\npub struct RpcArgs {\n    /// RPC provider url address; overrides url from snfoundry.toml\n    #[arg(short, long)]\n    pub url: Option<Url>,\n\n    /// Use predefined network with a public provider. Note that this option may result in rate limits or other unexpected behavior.\n    /// For devnet, attempts to auto-detect running starknet-devnet instance.\n    #[arg(long)]\n    pub network: Option<Network>,\n}\n\nimpl RpcArgs {\n    pub async fn get_provider(\n        &self,\n        config: &CastConfig,\n        ui: &UI,\n    ) -> Result<JsonRpcClient<HttpTransport>> {\n        let url = self.get_url(config).await?;\n        let provider = get_provider(&url)?;\n\n        // TODO(#3959) Remove `base_ui`\n        verify_and_warn_if_incompatible_rpc_version(&provider, url, ui.base_ui()).await?;\n\n        Ok(provider)\n    }\n\n    pub async fn get_url(&self, config: &CastConfig) -> Result<Url> {\n        match (&self.network, &self.url, &config.url, &config.network) {\n            (Some(network), None, _, _) => self.resolve_network_url(network, config).await,\n            (None, Some(url), _, _) => Ok(url.clone()),\n            (None, None, Some(config_url), None) => Ok(config_url.clone()),\n            (None, None, None, Some(config_network)) => {\n                self.resolve_network_url(config_network, config).await\n            }\n            _ => bail!(\"Either `--network` or `--url` must be provided.\"),\n        }\n    }\n\n    async fn resolve_network_url(&self, network: &Network, config: &CastConfig) -> Result<Url> {\n        if let Some(custom_url) = config.networks.get_url(*network) {\n            Ok(custom_url.clone())\n        } else {\n            network.url(&FreeProvider::semi_random()).await\n        }\n    }\n}\n\npub enum FreeProvider {\n    Zan,\n}\n\nimpl FreeProvider {\n    #[must_use]\n    pub fn semi_random() -> Self {\n        Self::Zan\n    }\n\n    #[must_use]\n    pub fn mainnet_rpc(&self) -> Url {\n        match self {\n            FreeProvider::Zan => Url::parse(&format!(\n                \"https://api.zan.top/public/starknet-mainnet/rpc/{RPC_URL_VERSION}\"\n            ))\n            .expect(\"Failed to parse URL\"),\n        }\n    }\n\n    #[must_use]\n    pub fn sepolia_rpc(&self) -> Url {\n        match self {\n            FreeProvider::Zan => Url::parse(&format!(\n                \"https://api.zan.top/public/starknet-sepolia/rpc/{RPC_URL_VERSION}\"\n            ))\n            .expect(\"Failed to parse URL\"),\n        }\n    }\n}\n\nimpl Network {\n    pub async fn url(self, provider: &FreeProvider) -> Result<Url> {\n        match self {\n            Network::Mainnet => Ok(Self::free_mainnet_rpc(provider)),\n            Network::Sepolia => Ok(Self::free_sepolia_rpc(provider)),\n            Network::Devnet => Self::devnet_rpc(provider).await,\n        }\n    }\n\n    fn free_mainnet_rpc(provider: &FreeProvider) -> Url {\n        provider.mainnet_rpc()\n    }\n\n    fn free_sepolia_rpc(provider: &FreeProvider) -> Url {\n        provider.sepolia_rpc()\n    }\n\n    async fn devnet_rpc(_provider: &FreeProvider) -> Result<Url> {\n        detection::detect_devnet_url()\n            .await\n            .map_err(|e| anyhow::anyhow!(e))\n    }\n}\n\n#[must_use]\npub fn generate_network_flag(rpc_args: &RpcArgs, config: &CastConfig) -> String {\n    if let Some(network) = &rpc_args.network {\n        format!(\"--network {network}\")\n    } else if let Some(rpc_url) = &rpc_args.url {\n        format!(\"--url {rpc_url}\")\n    } else if config.url.is_some() || config.network.is_some() {\n        // Since url or network is defined in config, no need to pass any flag\n        String::new()\n    } else {\n        unreachable!(\n            \"`--url` or `--network` must be provided or one of url or network field must be set in snfoundry.toml\"\n        );\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use semver::Version;\n    use shared::rpc::is_expected_version;\n    use starknet_rust::providers::Provider;\n\n    #[tokio::test]\n    async fn test_mainnet_url_happy_case() {\n        let provider = get_provider(&Network::free_mainnet_rpc(&FreeProvider::Zan)).unwrap();\n        let spec_version = provider.spec_version().await.unwrap();\n        assert!(is_expected_version(&Version::parse(&spec_version).unwrap()));\n    }\n\n    #[tokio::test]\n    async fn test_sepolia_url_happy_case() {\n        let provider = get_provider(&Network::free_sepolia_rpc(&FreeProvider::Zan)).unwrap();\n        let spec_version = provider.spec_version().await.unwrap();\n        assert!(is_expected_version(&Version::parse(&spec_version).unwrap()));\n    }\n\n    #[tokio::test]\n    async fn test_custom_network_url_from_config() {\n        let mut config = CastConfig::default();\n        config.networks.mainnet =\n            Some(Url::parse(\"https://starknet-mainnet.infura.io/v3/custom-api-key\").unwrap());\n        config.networks.sepolia =\n            Some(Url::parse(\"https://starknet-sepolia.g.alchemy.com/v2/custom-api-key\").unwrap());\n\n        let rpc_args = RpcArgs {\n            url: None,\n            network: Some(Network::Mainnet),\n        };\n\n        let url = rpc_args.get_url(&config).await.unwrap();\n        assert_eq!(\n            url,\n            Url::parse(\"https://starknet-mainnet.infura.io/v3/custom-api-key\").unwrap()\n        );\n    }\n\n    #[tokio::test]\n    async fn test_fallback_to_default_network_url() {\n        let config = CastConfig::default();\n\n        let rpc_args = RpcArgs {\n            url: None,\n            network: Some(Network::Mainnet),\n        };\n\n        let url = rpc_args.get_url(&config).await.unwrap();\n        assert_eq!(url, Network::free_mainnet_rpc(&FreeProvider::Zan).clone());\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/helpers/scarb_utils.rs",
    "content": "use crate::helpers::artifacts::CastStarknetContractArtifacts;\nuse anyhow::{Context, Result, anyhow};\nuse camino::{Utf8Path, Utf8PathBuf};\nuse foundry_ui::{UI, components::warning::WarningMessage};\nuse scarb_api::metadata::{MetadataError, MetadataOpts, metadata_for_dir, metadata_with_opts};\nuse scarb_api::{\n    CompilationOpts, ScarbCommand, ScarbCommandError, ensure_scarb_available,\n    get_contracts_artifacts_and_source_sierra_paths,\n    metadata::{Metadata, PackageMetadata},\n    target_dir_for_workspace,\n};\nuse scarb_ui::args::PackagesFilter;\nuse shared::command::CommandExt;\nuse std::collections::HashMap;\nuse std::str::FromStr;\n\npub fn get_scarb_manifest() -> Result<Utf8PathBuf> {\n    get_scarb_manifest_for(<&Utf8Path>::from(\".\"))\n}\n\npub fn get_scarb_manifest_for(dir: &Utf8Path) -> Result<Utf8PathBuf> {\n    ensure_scarb_available()?;\n\n    let output = ScarbCommand::new()\n        .current_dir(dir)\n        .arg(\"manifest-path\")\n        .command()\n        .output_checked()\n        .context(\"Failed to execute the `scarb manifest-path` command\")?;\n\n    let output_str = String::from_utf8(output.stdout)\n        .context(\"`scarb manifest-path` command failed to provide valid output\")?;\n\n    let path = Utf8PathBuf::from_str(output_str.trim())\n        .context(\"`scarb manifest-path` failed. Invalid location returned\")?;\n\n    Ok(path)\n}\n\npub fn get_scarb_metadata(manifest_path: &Utf8PathBuf) -> Result<Metadata, MetadataError> {\n    metadata_with_opts(MetadataOpts {\n        current_dir: Some(\n            manifest_path\n                .parent()\n                .expect(\"manifest should have parent\")\n                .into(),\n        ),\n        no_deps: true,\n        ..MetadataOpts::default()\n    })\n}\n\npub fn get_scarb_metadata_with_deps(\n    manifest_path: &Utf8PathBuf,\n) -> Result<Metadata, MetadataError> {\n    metadata_for_dir(manifest_path.parent().expect(\"manifest should have parent\"))\n}\n\npub fn get_cairo_version(manifest_path: &Utf8PathBuf) -> Result<String> {\n    let scarb_metadata = get_scarb_metadata(manifest_path)?;\n\n    Ok(scarb_metadata.app_version_info.cairo.version.to_string())\n}\n\npub fn assert_manifest_path_exists() -> Result<Utf8PathBuf> {\n    let manifest_path = get_scarb_manifest().expect(\"Failed to obtain manifest path from scarb\");\n\n    if !manifest_path.exists() {\n        return Err(anyhow!(\n            \"Path to Scarb.toml manifest does not exist = {manifest_path}\"\n        ));\n    }\n\n    Ok(manifest_path)\n}\n\nfn get_package_metadata_by_name<'a>(\n    metadata: &'a Metadata,\n    package_name: &str,\n) -> Result<&'a PackageMetadata> {\n    metadata\n        .packages\n        .iter()\n        .find(|package| package.name == package_name)\n        .ok_or(anyhow!(\n            \"Package {} not found in scarb metadata\",\n            &package_name\n        ))\n}\n\nfn get_default_package_metadata(metadata: &Metadata) -> Result<&PackageMetadata> {\n    match metadata.packages.iter().collect::<Vec<_>>().as_slice() {\n        [package] => Ok(package),\n        [] => Err(anyhow!(\"No package found in scarb metadata\")),\n        _ => Err(anyhow!(\n            \"More than one package found in scarb metadata - specify package using --package flag\"\n        )),\n    }\n}\n\npub fn get_package_metadata(\n    manifest_path: &Utf8PathBuf,\n    package_name: &Option<String>,\n) -> Result<PackageMetadata> {\n    let metadata = get_scarb_metadata(manifest_path)?;\n    match &package_name {\n        Some(package_name) => Ok(get_package_metadata_by_name(&metadata, package_name)?.clone()),\n        None => Ok(get_default_package_metadata(&metadata)?.clone()),\n    }\n}\n\npub struct BuildConfig {\n    pub scarb_toml_path: Utf8PathBuf,\n    pub json: bool,\n    pub profile: String,\n}\n\npub fn build(\n    package: &PackageMetadata,\n    config: &BuildConfig,\n    default_profile: &str,\n) -> Result<(), ScarbCommandError> {\n    let filter = PackagesFilter::generate_for::<Metadata>([package].into_iter());\n\n    let mut cmd = ScarbCommand::new_with_stdio();\n    let metadata =\n        get_scarb_metadata_with_deps(&config.scarb_toml_path).expect(\"Failed to obtain metadata\");\n    let profile = if metadata.profiles.contains(&config.profile) {\n        &config.profile\n    } else {\n        default_profile\n    };\n    cmd.arg(\"--profile\")\n        .arg(profile)\n        .arg(\"build\")\n        .manifest_path(&config.scarb_toml_path)\n        .packages_filter(filter);\n\n    if config.json {\n        cmd.json();\n    }\n    cmd.run()\n}\n\npub fn build_and_load_artifacts(\n    package: &PackageMetadata,\n    config: &BuildConfig,\n    build_for_script: bool,\n    ui: &UI,\n) -> Result<HashMap<String, CastStarknetContractArtifacts>> {\n    // TODO (#2042): Remove this logic, always use release as default\n    let default_profile = if build_for_script { \"dev\" } else { \"release\" };\n    build(package, config, default_profile)\n        .map_err(|e| anyhow!(format!(\"Failed to build using scarb; {e}\")))?;\n\n    let metadata = get_scarb_metadata_with_deps(&config.scarb_toml_path)?;\n    let target_dir = target_dir_for_workspace(&metadata);\n\n    if metadata.profiles.contains(&config.profile) {\n        Ok(get_contracts_artifacts_and_source_sierra_paths(\n            &target_dir.join(&config.profile),\n            package,\n            ui,\n            CompilationOpts::default()\n        ).context(\"Failed to load artifacts. Make sure you have enabled sierra code generation in Scarb.toml\")?\n        .into_iter()\n        .map(|(name, (artifacts, _))| (name, CastStarknetContractArtifacts { sierra: artifacts.sierra, casm: serde_json::to_string(&artifacts.casm).expect(\"valid serialization\")  }))\n        .collect())\n    } else {\n        let profile = &config.profile;\n        ui.println(&WarningMessage::new(&format!(\n            \"Profile {profile} does not exist in scarb, using '{default_profile}' profile.\"\n        )));\n        Ok(get_contracts_artifacts_and_source_sierra_paths(\n            &target_dir.join(default_profile),\n            package,\n            ui,\n            CompilationOpts::default(),\n        ).context(\"Failed to load artifacts. Make sure you have enabled sierra code generation in Scarb.toml\")?\n        .into_iter()\n        .map(|(name, (artifacts, _))| (name, CastStarknetContractArtifacts { sierra: artifacts.sierra, casm: serde_json::to_string(&artifacts.casm).expect(\"valid serialization\") }))\n        .collect())\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use crate::helpers::scarb_utils::{get_package_metadata, get_scarb_metadata};\n\n    #[test]\n    fn test_get_scarb_metadata() {\n        let metadata =\n            get_scarb_metadata(&\"tests/data/contracts/constructor_with_params/Scarb.toml\".into());\n        assert!(metadata.is_ok());\n    }\n\n    #[test]\n    fn test_get_package_metadata_happy_default() {\n        let metadata = get_package_metadata(\n            &\"tests/data/contracts/constructor_with_params/Scarb.toml\".into(),\n            &None,\n        )\n        .unwrap();\n        assert_eq!(metadata.name, \"constructor_with_params\");\n    }\n\n    #[test]\n    fn test_get_package_metadata_happy_by_name() {\n        let metadata = get_package_metadata(\n            &\"tests/data/contracts/multiple_packages/Scarb.toml\".into(),\n            &Some(\"package2\".into()),\n        )\n        .unwrap();\n        assert_eq!(metadata.name, \"package2\");\n    }\n\n    #[test]\n    #[should_panic(\n        expected = \"More than one package found in scarb metadata - specify package using --package flag\"\n    )]\n    fn test_get_package_metadata_more_than_one_default() {\n        get_package_metadata(\n            &\"tests/data/contracts/multiple_packages/Scarb.toml\".into(),\n            &None,\n        )\n        .unwrap();\n    }\n\n    #[test]\n    #[should_panic(expected = \"Package whatever not found in scarb metadata\")]\n    fn test_get_package_metadata_no_such_package() {\n        let metadata = get_package_metadata(\n            &\"tests/data/contracts/multiple_packages/Scarb.toml\".into(),\n            &Some(\"whatever\".into()),\n        )\n        .unwrap();\n        assert_eq!(metadata.name, \"package2\");\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/helpers/signer.rs",
    "content": "use crate::helpers::ledger;\nuse anyhow::{Result, bail};\nuse camino::Utf8PathBuf;\nuse serde::{Deserialize, Serialize};\nuse starknet_rust::{\n    accounts::SingleOwnerAccount,\n    providers::jsonrpc::{HttpTransport, JsonRpcClient},\n    signers::{DerivationPath, LedgerSigner, LocalWallet},\n};\nuse starknet_types_core::felt::Felt;\n\n/// Represents the type of signer stored in the accounts file\n// Uses `untagged` + `flatten` for backward compatibility with the existing accounts file format.\n// Downside: deserialization errors are less descriptive than with tagged variants,\n// and field name collisions across variants would silently misbehave.\n#[derive(Deserialize, Serialize, Clone, Debug)]\n#[serde(untagged)]\npub enum SignerType {\n    Local { private_key: Felt },\n    Ledger { ledger_path: DerivationPath },\n}\n\nimpl SignerType {\n    #[must_use]\n    pub fn private_key(&self) -> Option<Felt> {\n        match self {\n            SignerType::Local { private_key } => Some(*private_key),\n            SignerType::Ledger { .. } => None,\n        }\n    }\n\n    #[must_use]\n    pub fn ledger_path(&self) -> Option<&DerivationPath> {\n        match self {\n            SignerType::Ledger { ledger_path } => Some(ledger_path),\n            SignerType::Local { .. } => None,\n        }\n    }\n}\n\n#[derive(Debug)]\n/// Represents the `SingleOwnerAccount` variant with either `LocalWallet` or `LedgerSigner` as signer\npub enum AccountVariant<'a> {\n    LocalWallet(SingleOwnerAccount<&'a JsonRpcClient<HttpTransport>, LocalWallet>),\n    Ledger(\n        SingleOwnerAccount<\n            &'a JsonRpcClient<HttpTransport>,\n            LedgerSigner<ledger::SncastLedgerTransport>,\n        >,\n    ),\n}\n\nimpl AccountVariant<'_> {\n    #[must_use]\n    pub fn address(&self) -> Felt {\n        use starknet_rust::accounts::Account;\n        match self {\n            AccountVariant::LocalWallet(account) => account.address(),\n            AccountVariant::Ledger(account) => account.address(),\n        }\n    }\n\n    #[must_use]\n    pub fn chain_id(&self) -> Felt {\n        use starknet_rust::accounts::Account;\n        match self {\n            AccountVariant::LocalWallet(account) => account.chain_id(),\n            AccountVariant::Ledger(account) => account.chain_id(),\n        }\n    }\n}\n\n#[macro_export]\nmacro_rules! with_account {\n    ($variant:expr, |$account:ident| $body:expr) => {\n        match $variant {\n            &$crate::AccountVariant::LocalWallet(ref $account) => $body,\n            &$crate::AccountVariant::Ledger(ref $account) => $body,\n        }\n    };\n}\n\n/// Represents the source of the signer for account operations\n#[derive(Debug, Clone, Default)]\npub enum SignerSource {\n    /// Use a keystore file at the given path\n    Keystore(Utf8PathBuf),\n    /// Use a Ledger device with the given derivation path\n    Ledger(DerivationPath),\n    /// Use the accounts file (default)\n    #[default]\n    AccountsFile,\n}\n\nimpl SignerSource {\n    pub fn new(keystore: Option<Utf8PathBuf>, signer_type: Option<&SignerType>) -> Result<Self> {\n        let ledger_path = signer_type.and_then(SignerType::ledger_path);\n        match (keystore, ledger_path) {\n            (Some(path), None) => Ok(SignerSource::Keystore(path)),\n            (None, Some(path)) => Ok(SignerSource::Ledger(path.clone())),\n            (None, None) => Ok(SignerSource::AccountsFile),\n            (Some(_), Some(_)) => {\n                bail!(\"keystore and ledger cannot be used together\")\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/helpers/token.rs",
    "content": "use clap::ValueEnum;\nuse serde::Serialize;\nuse starknet_rust::macros::felt;\nuse starknet_types_core::felt::Felt;\n\nconst STRK_CONTRACT_ADDRESS: Felt =\n    felt!(\"0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d\");\n\nconst ETH_CONTRACT_ADDRESS: Felt =\n    felt!(\"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7\");\n\n#[derive(Default, Clone, Copy, Debug, ValueEnum, strum_macros::Display)]\n#[strum(serialize_all = \"lowercase\")]\npub enum Token {\n    #[default]\n    Strk,\n    Eth,\n}\n\nimpl Token {\n    #[must_use]\n    pub fn contract_address(&self) -> Felt {\n        match self {\n            Token::Strk => STRK_CONTRACT_ADDRESS,\n            Token::Eth => ETH_CONTRACT_ADDRESS,\n        }\n    }\n\n    #[must_use]\n    pub fn as_token_unit(&self) -> TokenUnit {\n        match self {\n            Token::Strk => TokenUnit::Fri,\n            Token::Eth => TokenUnit::Wei,\n        }\n    }\n}\n\n// Smallest non-divisible unit of the token.\n#[derive(Serialize, Clone, Copy, Debug, ValueEnum, strum_macros::Display)]\n#[strum(serialize_all = \"lowercase\")]\n#[serde(rename_all = \"lowercase\")]\npub enum TokenUnit {\n    Fri,\n    Wei,\n}\n"
  },
  {
    "path": "crates/sncast/src/lib.rs",
    "content": "use crate::helpers::account::{check_account_exists, get_account_from_devnet, is_devnet_account};\nuse crate::helpers::configuration::CastConfig;\nuse crate::helpers::constants::{DEFAULT_STATE_FILE_SUFFIX, WAIT_RETRY_INTERVAL, WAIT_TIMEOUT};\nuse crate::helpers::rpc::RpcArgs;\nuse crate::response::errors::SNCastProviderError;\nuse anyhow::{Context, Error, Result, anyhow, bail};\nuse camino::Utf8PathBuf;\nuse clap::ValueEnum;\nuse conversions::serde::serialize::CairoSerialize;\nuse helpers::constants::{KEYSTORE_PASSWORD_ENV_VAR, UDC_ADDRESS};\nuse rand::RngCore;\nuse rand::rngs::OsRng;\nuse response::errors::SNCastStarknetError;\nuse serde::de::DeserializeOwned;\nuse serde::{Deserialize, Serialize};\nuse serde_json::{Deserializer, Value};\nuse shared::rpc::create_rpc_client;\nuse starknet_rust::accounts::{AccountFactory, AccountFactoryError};\nuse starknet_rust::core::types::{\n    BlockId, BlockTag,\n    BlockTag::{Latest, PreConfirmed},\n    ContractClass, ContractErrorData,\n    StarknetError::{ClassHashNotFound, ContractNotFound, TransactionHashNotFound},\n};\nuse starknet_rust::core::types::{ContractExecutionError, ExecutionResult};\nuse starknet_rust::core::utils::UdcUniqueness::{NotUnique, Unique};\nuse starknet_rust::core::utils::{UdcUniqueSettings, UdcUniqueness};\nuse starknet_rust::{\n    accounts::{ExecutionEncoding, SingleOwnerAccount},\n    providers::{\n        Provider, ProviderError,\n        ProviderError::StarknetError,\n        jsonrpc::{HttpTransport, JsonRpcClient},\n    },\n    signers::{DerivationPath, LocalWallet, SigningKey},\n};\nuse starknet_types_core::felt::Felt;\nuse std::collections::HashMap;\nuse std::fmt::Display;\nuse std::str::FromStr;\nuse std::thread::sleep;\nuse std::time::Duration;\nuse std::{env, fs};\nuse thiserror::Error;\nuse url::Url;\n\npub mod helpers;\npub mod response;\npub mod state;\n\nuse crate::helpers::ledger;\nuse crate::response::ui::UI;\nuse conversions::byte_array::ByteArray;\nuse foundry_ui::components::warning::WarningMessage;\npub use helpers::signer::{AccountVariant, SignerSource, SignerType};\n\npub type NestedMap<T> = HashMap<String, HashMap<String, T>>;\n\n#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq, ValueEnum)]\n#[serde(rename_all = \"lowercase\")]\npub enum AccountType {\n    #[serde(rename = \"open_zeppelin\")]\n    OpenZeppelin,\n    Argent,\n    Ready,\n    Braavos,\n}\n\nimpl FromStr for AccountType {\n    type Err = anyhow::Error;\n\n    fn from_str(s: &str) -> Result<Self, Self::Err> {\n        match s {\n            \"open_zeppelin\" | \"open-zeppelin\" | \"oz\" => Ok(AccountType::OpenZeppelin),\n            \"argent\" => Ok(AccountType::Argent),\n            \"ready\" => Ok(AccountType::Ready),\n            \"braavos\" => Ok(AccountType::Braavos),\n            account_type => Err(anyhow!(\"Invalid account type = {account_type}\")),\n        }\n    }\n}\n\nimpl Display for AccountType {\n    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {\n        write!(f, \"{self:?}\")\n    }\n}\n\npub const MAINNET: Felt =\n    Felt::from_hex_unchecked(const_hex::const_encode::<7, true>(b\"SN_MAIN\").as_str());\n\npub const SEPOLIA: Felt =\n    Felt::from_hex_unchecked(const_hex::const_encode::<10, true>(b\"SN_SEPOLIA\").as_str());\n\n#[derive(ValueEnum, Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]\n#[serde(rename_all = \"lowercase\")]\npub enum Network {\n    Mainnet,\n    Sepolia,\n    Devnet,\n}\n\nimpl Display for Network {\n    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {\n        match self {\n            Network::Mainnet => write!(f, \"mainnet\"),\n            Network::Sepolia => write!(f, \"sepolia\"),\n            Network::Devnet => write!(f, \"devnet\"),\n        }\n    }\n}\n\nimpl TryFrom<Felt> for Network {\n    type Error = anyhow::Error;\n\n    fn try_from(value: Felt) -> std::result::Result<Self, Self::Error> {\n        if value == MAINNET {\n            Ok(Network::Mainnet)\n        } else if value == SEPOLIA {\n            Ok(Network::Sepolia)\n        } else {\n            bail!(\"Given network is neither Mainnet nor Sepolia\")\n        }\n    }\n}\n\n#[derive(Deserialize, Serialize, Clone, Debug)]\npub struct AccountData {\n    pub public_key: Felt,\n    pub address: Option<Felt>,\n    pub salt: Option<Felt>,\n    pub deployed: Option<bool>,\n    pub class_hash: Option<Felt>,\n    pub legacy: Option<bool>,\n\n    #[serde(default, rename(serialize = \"type\", deserialize = \"type\"))]\n    pub account_type: Option<AccountType>,\n\n    #[serde(flatten)]\n    pub signer_type: SignerType,\n}\n\n#[derive(Clone, Copy)]\npub struct WaitForTx {\n    pub wait: bool,\n    pub wait_params: ValidatedWaitParams,\n    pub show_ui_outputs: bool,\n}\n\n#[derive(Deserialize, Serialize, Clone, Debug, Copy, PartialEq)]\npub struct ValidatedWaitParams {\n    #[serde(default)]\n    timeout: u16,\n\n    #[serde(\n        default,\n        rename(serialize = \"retry-interval\", deserialize = \"retry-interval\")\n    )]\n    retry_interval: u8,\n}\n\nimpl ValidatedWaitParams {\n    #[must_use]\n    pub fn new(retry_interval: u8, timeout: u16) -> Self {\n        assert!(\n            !(retry_interval == 0 || timeout == 0 || u16::from(retry_interval) > timeout),\n            \"Invalid values for retry_interval and/or timeout!\"\n        );\n\n        Self {\n            timeout,\n            retry_interval,\n        }\n    }\n\n    #[must_use]\n    pub fn get_retries(&self) -> u16 {\n        self.timeout / u16::from(self.retry_interval)\n    }\n\n    #[must_use]\n    pub fn remaining_time(&self, steps_done: u16) -> u16 {\n        steps_done * u16::from(self.retry_interval)\n    }\n\n    #[must_use]\n    pub fn get_retry_interval(&self) -> u8 {\n        self.retry_interval\n    }\n\n    #[must_use]\n    pub fn get_timeout(&self) -> u16 {\n        self.timeout\n    }\n}\n\nimpl Default for ValidatedWaitParams {\n    fn default() -> Self {\n        Self::new(WAIT_RETRY_INTERVAL, WAIT_TIMEOUT)\n    }\n}\n\npub fn get_provider(url: &Url) -> Result<JsonRpcClient<HttpTransport>> {\n    create_rpc_client(url)\n}\n\npub async fn get_chain_id(provider: &JsonRpcClient<HttpTransport>) -> Result<Felt> {\n    provider\n        .chain_id()\n        .await\n        .context(\"Failed to fetch chain_id\")\n}\n\npub fn get_keystore_password(env_var: &str) -> std::io::Result<String> {\n    match env::var(env_var) {\n        Ok(password) => Ok(password),\n        _ => rpassword::prompt_password(\"Enter password: \"),\n    }\n}\n\n#[must_use]\npub fn chain_id_to_network_name(chain_id: Felt) -> String {\n    let decoded = decode_chain_id(chain_id);\n\n    match &decoded[..] {\n        \"SN_MAIN\" => \"alpha-mainnet\".into(),\n        \"SN_SEPOLIA\" => \"alpha-sepolia\".into(),\n        \"SN_INTEGRATION_SEPOLIA\" => \"alpha-integration-sepolia\".into(),\n        _ => decoded,\n    }\n}\n\n#[must_use]\npub fn decode_chain_id(chain_id: Felt) -> String {\n    let non_zero_bytes: Vec<u8> = chain_id\n        .to_bytes_be()\n        .iter()\n        .copied()\n        .filter(|&byte| byte != 0)\n        .collect();\n\n    String::from_utf8(non_zero_bytes).unwrap_or_default()\n}\n\npub async fn get_nonce(\n    provider: &JsonRpcClient<HttpTransport>,\n    block_id: &str,\n    address: Felt,\n) -> Result<Felt> {\n    provider\n        .get_nonce(\n            get_block_id(block_id).context(\"Failed to obtain block id\")?,\n            address,\n        )\n        .await\n        .context(\"Failed to get a nonce\")\n}\n\npub async fn get_account<'a>(\n    config: &'a CastConfig,\n    provider: &'a JsonRpcClient<HttpTransport>,\n    rpc_args: &RpcArgs,\n    ui: &UI,\n) -> Result<AccountVariant<'a>> {\n    let chain_id = get_chain_id(provider).await?;\n\n    let network_name = chain_id_to_network_name(chain_id);\n    let account = &config.account;\n    let is_devnet_account = is_devnet_account(account);\n\n    if is_devnet_account\n        && let Some(network) = rpc_args.network\n        && (network == Network::Mainnet || network == Network::Sepolia)\n    {\n        bail!(format!(\n            \"Devnet accounts cannot be used with `--network {network}`\"\n        ));\n    }\n\n    let accounts_file = &config.accounts_file;\n    let exists_in_accounts_file = check_account_exists(account, &network_name, accounts_file)?;\n\n    match (is_devnet_account, exists_in_accounts_file) {\n        (true, true) => {\n            ui.print_warning(WarningMessage::new(format!(\n                \"Using account {account} from accounts file {accounts_file}. \\\n                To use an inbuilt devnet account, please rename your existing account or use an account with a different number.\"\n            )));\n            ui.print_blank_line();\n            get_account_from_accounts_file(\n                account,\n                accounts_file,\n                provider,\n                config.keystore.as_ref(),\n                ui,\n            )\n            .await\n        }\n        (true, false) => {\n            let url = rpc_args\n                .get_url(config)\n                .await\n                .context(\"Failed to get url\")?;\n            let local_account = get_account_from_devnet(account, provider, &url).await?;\n            Ok(AccountVariant::LocalWallet(local_account))\n        }\n        _ => {\n            get_account_from_accounts_file(\n                account,\n                accounts_file,\n                provider,\n                config.keystore.as_ref(),\n                ui,\n            )\n            .await\n        }\n    }\n}\n\npub async fn get_account_from_accounts_file<'a>(\n    account: &str,\n    accounts_file: &Utf8PathBuf,\n    provider: &'a JsonRpcClient<HttpTransport>,\n    keystore: Option<&Utf8PathBuf>,\n    ui: &UI,\n) -> Result<AccountVariant<'a>> {\n    let chain_id = get_chain_id(provider).await?;\n    let account_data = if let Some(keystore) = keystore {\n        get_account_data_from_keystore(account, keystore)?\n    } else {\n        get_account_data_from_accounts_file(account, chain_id, accounts_file)?\n    };\n\n    if let SignerSource::Ledger(ledger_path) =\n        SignerSource::new(keystore.cloned(), Some(&account_data.signer_type))?\n    {\n        return build_ledger_account(ledger_path, account_data, chain_id, provider, ui).await;\n    }\n\n    let account = build_account(account_data, chain_id, provider).await?;\n    Ok(AccountVariant::LocalWallet(account))\n}\n\npub async fn get_contract_class(\n    class_hash: Felt,\n    provider: &JsonRpcClient<HttpTransport>,\n) -> Result<ContractClass> {\n    let result = provider\n        .get_class(BlockId::Tag(BlockTag::Latest), class_hash)\n        .await;\n\n    if let Err(ProviderError::StarknetError(ClassHashNotFound)) = result {\n        // Imitate error thrown on chain to achieve particular error message (Issue #2554)\n        let artificial_transaction_revert_error = SNCastProviderError::StarknetError(\n            SNCastStarknetError::ContractError(ContractErrorData {\n                revert_error: ContractExecutionError::Message(format!(\n                    \"Class with hash {class_hash:#x} is not declared\"\n                )),\n            }),\n        );\n\n        return Err(handle_rpc_error(artificial_transaction_revert_error));\n    }\n\n    result.map_err(handle_rpc_error)\n}\n\nasync fn build_account(\n    account_data: AccountData,\n    chain_id: Felt,\n    provider: &JsonRpcClient<HttpTransport>,\n) -> Result<SingleOwnerAccount<&JsonRpcClient<HttpTransport>, LocalWallet>> {\n    let private_key = account_data\n        .signer_type\n        .private_key()\n        .context(\"Private key not found\")?;\n\n    let signer = LocalWallet::from(SigningKey::from_secret_scalar(private_key));\n\n    let address = account_data\n        .address\n        .context(\"Failed to get account address\")?;\n\n    verify_account_address(address, chain_id, provider).await?;\n\n    let class_hash = account_data.class_hash;\n\n    let account_encoding =\n        get_account_encoding(account_data.legacy, class_hash, address, provider).await?;\n\n    let mut account =\n        SingleOwnerAccount::new(provider, signer, address, chain_id, account_encoding);\n\n    account.set_block_id(BlockId::Tag(PreConfirmed));\n\n    Ok(account)\n}\n\nasync fn build_ledger_account<'a>(\n    ledger_path: DerivationPath,\n    account_data: AccountData,\n    chain_id: Felt,\n    provider: &'a JsonRpcClient<HttpTransport>,\n    ui: &UI,\n) -> Result<AccountVariant<'a>> {\n    let address = account_data\n        .address\n        .context(\"Failed to get account address\")?;\n\n    verify_account_address(address, chain_id, provider).await?;\n\n    let encoding = get_account_encoding(\n        account_data.legacy,\n        account_data.class_hash,\n        address,\n        provider,\n    )\n    .await?;\n\n    let account =\n        ledger::ledger_account(&ledger_path, address, chain_id, encoding, provider, ui).await?;\n\n    Ok(AccountVariant::Ledger(account))\n}\n\nasync fn verify_account_address(\n    address: Felt,\n    chain_id: Felt,\n    provider: &JsonRpcClient<HttpTransport>,\n) -> Result<()> {\n    match provider\n        .get_nonce(BlockId::Tag(PreConfirmed), address)\n        .await\n    {\n        Ok(_) => Ok(()),\n        Err(error) => {\n            if let StarknetError(ContractNotFound) = error {\n                let decoded_chain_id = decode_chain_id(chain_id);\n                Err(anyhow!(\n                    \"Account with address {address:#x} not found on network {decoded_chain_id}\"\n                ))\n            } else {\n                Err(handle_rpc_error(error))\n            }\n        }\n    }\n}\n\npub async fn check_class_hash_exists(\n    provider: &JsonRpcClient<HttpTransport>,\n    class_hash: Felt,\n) -> Result<()> {\n    match provider\n        .get_class(BlockId::Tag(BlockTag::Latest), class_hash)\n        .await\n    {\n        Ok(_) => Ok(()),\n        Err(err) => match err {\n            StarknetError(ClassHashNotFound) => Err(anyhow!(\n                \"Class with hash {class_hash:#x} is not declared, try using --class-hash with a hash of the declared class\"\n            )),\n            _ => Err(handle_rpc_error(err)),\n        },\n    }\n}\n\npub fn get_account_data_from_keystore(\n    account: &str,\n    keystore_path: &Utf8PathBuf,\n) -> Result<AccountData> {\n    check_keystore_and_account_files_exist(keystore_path, account)?;\n    let path_to_account = Utf8PathBuf::from(account);\n\n    let private_key = SigningKey::from_keystore(\n        keystore_path,\n        get_keystore_password(KEYSTORE_PASSWORD_ENV_VAR)?.as_str(),\n    )?\n    .secret_scalar();\n\n    let account_info: Value = read_and_parse_json_file(&path_to_account)?;\n\n    let parse_to_felt = |pointer: &str| -> Option<Felt> {\n        get_string_value_from_json(&account_info, pointer).and_then(|value| value.parse().ok())\n    };\n\n    let address = parse_to_felt(\"/deployment/address\");\n    let class_hash = parse_to_felt(\"/deployment/class_hash\");\n    let salt = parse_to_felt(\"/deployment/salt\");\n    let deployed = get_string_value_from_json(&account_info, \"/deployment/status\")\n        .map(|status| status == \"deployed\");\n    let legacy = account_info\n        .pointer(\"/variant/legacy\")\n        .and_then(Value::as_bool);\n    let account_type = get_string_value_from_json(&account_info, \"/variant/type\")\n        .and_then(|account_type| account_type.parse().ok());\n\n    let public_key = match account_type.context(\"Failed to get type key\")? {\n        AccountType::Argent | AccountType::Ready => parse_to_felt(\"/variant/owner\"),\n        AccountType::OpenZeppelin => parse_to_felt(\"/variant/public_key\"),\n        AccountType::Braavos => get_braavos_account_public_key(&account_info)?,\n    }\n    .context(\"Failed to get public key from account JSON file\")?;\n\n    Ok(AccountData {\n        public_key,\n        address,\n        salt,\n        deployed,\n        class_hash,\n        legacy,\n        account_type,\n        signer_type: SignerType::Local { private_key },\n    })\n}\nfn get_braavos_account_public_key(account_info: &Value) -> Result<Option<Felt>> {\n    get_string_value_from_json(account_info, \"/variant/multisig/status\")\n        .filter(|status| status == \"off\")\n        .context(\"Braavos accounts cannot be deployed with multisig on\")?;\n\n    account_info\n        .pointer(\"/variant/signers\")\n        .and_then(Value::as_array)\n        .filter(|signers| signers.len() == 1)\n        .context(\"Braavos accounts can only be deployed with one seed signer\")?;\n\n    Ok(\n        get_string_value_from_json(account_info, \"/variant/signers/0/public_key\")\n            .and_then(|value| value.parse().ok()),\n    )\n}\nfn get_string_value_from_json(json: &Value, pointer: &str) -> Option<String> {\n    json.pointer(pointer)\n        .and_then(Value::as_str)\n        .map(str::to_string)\n}\npub fn get_account_data_from_accounts_file(\n    name: &str,\n    chain_id: Felt,\n    path: &Utf8PathBuf,\n) -> Result<AccountData> {\n    if name.is_empty() {\n        bail!(\"Account name not passed nor found in snfoundry.toml\")\n    }\n    check_account_file_exists(path)?;\n\n    let accounts: HashMap<String, HashMap<String, AccountData>> = read_and_parse_json_file(path)?;\n    let network_name = chain_id_to_network_name(chain_id);\n\n    accounts\n        .get(&network_name)\n        .and_then(|accounts_map| accounts_map.get(name))\n        .cloned()\n        .ok_or_else(|| anyhow!(\"Account = {name} not found under network = {network_name}\"))\n}\n\npub fn read_and_parse_json_file<T>(path: &Utf8PathBuf) -> Result<T>\nwhere\n    T: DeserializeOwned + Default,\n{\n    let file_content =\n        fs::read_to_string(path).with_context(|| format!(\"Failed to read a file = {path}\"))?;\n\n    if file_content.trim().is_empty() {\n        return Ok(T::default());\n    }\n\n    let deserializer = &mut Deserializer::from_str(&file_content);\n    serde_path_to_error::deserialize(deserializer).map_err(|err| {\n        let path_to_field = err.path().to_string();\n        anyhow!(\n            \"Failed to parse field `{path_to_field}` in file '{path}': {}\",\n            err.into_inner()\n        )\n    })\n}\n\nasync fn get_account_encoding(\n    legacy: Option<bool>,\n    class_hash: Option<Felt>,\n    address: Felt,\n    provider: &JsonRpcClient<HttpTransport>,\n) -> Result<ExecutionEncoding> {\n    if let Some(legacy) = legacy {\n        Ok(map_encoding(legacy))\n    } else {\n        let legacy = check_if_legacy_contract(class_hash, address, provider).await?;\n        Ok(map_encoding(legacy))\n    }\n}\n\npub async fn check_if_legacy_contract(\n    class_hash: Option<Felt>,\n    address: Felt,\n    provider: &JsonRpcClient<HttpTransport>,\n) -> Result<bool> {\n    let contract_class = match class_hash {\n        Some(class_hash) => {\n            provider\n                .get_class(BlockId::Tag(PreConfirmed), class_hash)\n                .await\n        }\n        None => {\n            provider\n                .get_class_at(BlockId::Tag(PreConfirmed), address)\n                .await\n        }\n    }\n    .map_err(handle_rpc_error)?;\n\n    Ok(is_legacy_contract(&contract_class))\n}\n\npub async fn get_class_hash_by_address(\n    provider: &JsonRpcClient<HttpTransport>,\n    address: Felt,\n) -> Result<Felt> {\n    let result = provider\n        .get_class_hash_at(BlockId::Tag(PreConfirmed), address)\n        .await;\n\n    if let Err(ProviderError::StarknetError(ContractNotFound)) = result {\n        // Imitate error thrown on chain to achieve particular error message (Issue #2554)\n        let artificial_transaction_revert_error = SNCastProviderError::StarknetError(\n            SNCastStarknetError::ContractError(ContractErrorData {\n                revert_error: ContractExecutionError::Message(format!(\n                    \"Requested contract address {address:#x} is not deployed\",\n                )),\n            }),\n        );\n\n        return Err(handle_rpc_error(artificial_transaction_revert_error));\n    }\n\n    result.map_err(handle_rpc_error).with_context(|| {\n        format!(\"Couldn't retrieve class hash of a contract with address {address:#x}\")\n    })\n}\n\n#[must_use]\npub fn is_legacy_contract(contract_class: &ContractClass) -> bool {\n    match contract_class {\n        ContractClass::Legacy(_) => true,\n        ContractClass::Sierra(_) => false,\n    }\n}\n\nfn map_encoding(legacy: bool) -> ExecutionEncoding {\n    if legacy {\n        ExecutionEncoding::Legacy\n    } else {\n        ExecutionEncoding::New\n    }\n}\n\npub fn get_block_id(value: &str) -> Result<BlockId> {\n    match value {\n        \"pre_confirmed\" => Ok(BlockId::Tag(PreConfirmed)),\n        \"latest\" => Ok(BlockId::Tag(Latest)),\n        _ if value.starts_with(\"0x\") => Ok(BlockId::Hash(Felt::from_hex(value)?)),\n        _ => match value.parse::<u64>() {\n            Ok(value) => Ok(BlockId::Number(value)),\n            Err(_) => Err(anyhow::anyhow!(\n                \"Incorrect value passed for block_id = {value}. Possible values are `pre_confirmed`, `latest`, block hash (hex) and block number (u64)\"\n            )),\n        },\n    }\n}\n\n#[derive(Debug, CairoSerialize)]\npub struct ErrorData {\n    pub data: ByteArray,\n}\n\n#[derive(Error, Debug, CairoSerialize)]\npub enum TransactionError {\n    #[error(\"Transaction has been reverted = {}\", .0.data)]\n    Reverted(ErrorData),\n}\n\n#[derive(Error, Debug, CairoSerialize)]\npub enum WaitForTransactionError {\n    #[error(transparent)]\n    TransactionError(TransactionError),\n    #[error(\"sncast timed out while waiting for transaction to succeed\")]\n    TimedOut,\n    #[error(transparent)]\n    ProviderError(#[from] SNCastProviderError),\n}\n\npub async fn wait_for_tx(\n    provider: &JsonRpcClient<HttpTransport>,\n    tx_hash: Felt,\n    wait_params: ValidatedWaitParams,\n    ui: Option<&UI>,\n) -> Result<String, WaitForTransactionError> {\n    ui.inspect(|ui| ui.print_notification(format!(\"Transaction hash: {tx_hash:#x}\")));\n\n    let retries = wait_params.get_retries();\n    for i in (1..retries).rev() {\n        match provider.get_transaction_status(tx_hash).await {\n            Ok(starknet_rust::core::types::TransactionStatus::PreConfirmed(\n                ExecutionResult::Reverted { reason },\n            )) => {\n                return Err(WaitForTransactionError::TransactionError(\n                    TransactionError::Reverted(ErrorData {\n                        data: ByteArray::from(reason.as_str()),\n                    }),\n                ));\n            }\n            Ok(\n                starknet_rust::core::types::TransactionStatus::AcceptedOnL2(execution_status)\n                | starknet_rust::core::types::TransactionStatus::AcceptedOnL1(execution_status),\n            ) => {\n                return match execution_status {\n                    ExecutionResult::Succeeded => Ok(\"Transaction accepted\".to_string()),\n                    ExecutionResult::Reverted { reason } => {\n                        Err(WaitForTransactionError::TransactionError(\n                            TransactionError::Reverted(ErrorData {\n                                data: ByteArray::from(reason.as_str()),\n                            }),\n                        ))\n                    }\n                };\n            }\n            Ok(starknet_rust::core::types::TransactionStatus::PreConfirmed(\n                ExecutionResult::Succeeded,\n            )) => {\n                ui.inspect(|ui| {\n                    let remaining_time = wait_params.remaining_time(i);\n                    ui.print_notification(\"Transaction status: PRE_CONFIRMED\".to_string());\n                    ui.print_notification(format!(\n                        \"Waiting for transaction to be accepted ({i} retries / {remaining_time}s left until timeout)\"\n                    ));\n                });\n            }\n            Ok(\n                starknet_rust::core::types::TransactionStatus::Received\n                | starknet_rust::core::types::TransactionStatus::Candidate,\n            )\n            | Err(StarknetError(TransactionHashNotFound)) => {\n                ui.inspect(|ui| {\n                        let remaining_time = wait_params.remaining_time(i);\n                        ui.print_notification(format!(\n                            \"Waiting for transaction to be accepted ({i} retries / {remaining_time}s left until timeout)\"\n                        ));\n                    });\n            }\n            Err(ProviderError::RateLimited) => {\n                ui.inspect(|ui| {\n                    ui.print_notification(\n                        \"Request rate limited while waiting for transaction to be accepted\"\n                            .to_string(),\n                    );\n                });\n                sleep(Duration::from_secs(wait_params.get_retry_interval().into()));\n            }\n            Err(err) => return Err(WaitForTransactionError::ProviderError(err.into())),\n        }\n\n        sleep(Duration::from_secs(wait_params.get_retry_interval().into()));\n    }\n\n    Err(WaitForTransactionError::TimedOut)\n}\n\n#[must_use]\npub fn handle_rpc_error(error: impl Into<SNCastProviderError>) -> Error {\n    let err: SNCastProviderError = error.into();\n    err.into()\n}\n\n#[must_use]\npub fn handle_account_factory_error<T>(err: AccountFactoryError<T::SignError>) -> anyhow::Error\nwhere\n    T: AccountFactory + Sync,\n{\n    match err {\n        AccountFactoryError::Provider(error) => handle_rpc_error(error),\n        error => anyhow!(error.to_string()),\n    }\n}\n\npub async fn handle_wait_for_tx<T>(\n    provider: &JsonRpcClient<HttpTransport>,\n    transaction_hash: Felt,\n    return_value: T,\n    wait_config: WaitForTx,\n    ui: &UI,\n) -> Result<T, WaitForTransactionError> {\n    if wait_config.wait {\n        return match wait_for_tx(\n            provider,\n            transaction_hash,\n            wait_config.wait_params,\n            wait_config.show_ui_outputs.then_some(ui),\n        )\n        .await\n        {\n            Ok(_) => Ok(return_value),\n            Err(error) => Err(error),\n        };\n    }\n\n    Ok(return_value)\n}\n\npub fn check_account_file_exists(accounts_file_path: &Utf8PathBuf) -> Result<()> {\n    if !accounts_file_path.exists() {\n        bail! {\"Accounts file = {accounts_file_path} does not exist! If you do not have an account create one with `account create` command \\\n        or if you're using a custom accounts file, make sure to supply correct path to it with `--accounts-file` argument.\" }\n    }\n    Ok(())\n}\n\npub fn check_keystore_and_account_files_exist(\n    keystore_path: &Utf8PathBuf,\n    account: &str,\n) -> Result<()> {\n    if !keystore_path.exists() {\n        bail!(\"Failed to find keystore file\");\n    }\n    if account.is_empty() {\n        bail!(\"Argument `--account` must be passed and be a path when using `--keystore`\");\n    }\n    let path_to_account = Utf8PathBuf::from(account);\n    if !path_to_account.exists() {\n        bail!(\n            \"File containing the account does not exist: When using `--keystore` argument, the `--account` argument should be a path to the starkli JSON account file\"\n        );\n    }\n    Ok(())\n}\n\n#[must_use]\npub fn extract_or_generate_salt(salt: Option<Felt>) -> Felt {\n    salt.unwrap_or(Felt::from(OsRng.next_u64()))\n}\n\n#[must_use]\npub fn udc_uniqueness(unique: bool, account_address: Felt) -> UdcUniqueness {\n    if unique {\n        Unique(UdcUniqueSettings {\n            deployer_address: account_address,\n            udc_contract_address: UDC_ADDRESS,\n        })\n    } else {\n        NotUnique\n    }\n}\n\npub fn apply_optional<T, R, F: FnOnce(T, R) -> T>(initial: T, option: Option<R>, function: F) -> T {\n    match option {\n        Some(value) => function(initial, value),\n        None => initial,\n    }\n}\n\n#[macro_export]\nmacro_rules! apply_optional_fields {\n    ($initial:expr, $( $option:expr => $setter:expr ),* ) => {\n        {\n            let mut value = $initial;\n            $(\n                value = ::sncast::apply_optional(value, $option, $setter);\n            )*\n            value\n        }\n    };\n}\n\n#[must_use]\npub fn get_default_state_file_name(script_name: &str, chain_id: &str) -> String {\n    format!(\"{script_name}_{chain_id}_{DEFAULT_STATE_FILE_SUFFIX}\")\n}\n\n#[cfg(test)]\nmod tests {\n    use crate::helpers::constants::KEYSTORE_PASSWORD_ENV_VAR;\n    use crate::{\n        AccountType, chain_id_to_network_name, extract_or_generate_salt,\n        get_account_data_from_accounts_file, get_account_data_from_keystore, get_block_id,\n        udc_uniqueness,\n    };\n    use camino::Utf8PathBuf;\n    use conversions::string::IntoHexStr;\n    use starknet_rust::core::types::{\n        BlockId,\n        BlockTag::{Latest, PreConfirmed},\n        Felt,\n    };\n    use starknet_rust::core::utils::UdcUniqueSettings;\n    use starknet_rust::core::utils::UdcUniqueness::{NotUnique, Unique};\n    use std::env;\n\n    #[test]\n    fn test_get_block_id() {\n        let pending_block = get_block_id(\"pre_confirmed\").unwrap();\n        let latest_block = get_block_id(\"latest\").unwrap();\n\n        assert_eq!(pending_block, BlockId::Tag(PreConfirmed));\n        assert_eq!(latest_block, BlockId::Tag(Latest));\n    }\n\n    #[test]\n    fn test_get_block_id_hex() {\n        let block = get_block_id(\"0x0\").unwrap();\n\n        assert_eq!(\n            block,\n            BlockId::Hash(\n                Felt::from_hex(\n                    \"0x0000000000000000000000000000000000000000000000000000000000000000\"\n                )\n                .unwrap()\n            )\n        );\n    }\n\n    #[test]\n    fn test_get_block_id_num() {\n        let block = get_block_id(\"0\").unwrap();\n\n        assert_eq!(block, BlockId::Number(0));\n    }\n\n    #[test]\n    fn test_get_block_id_invalid() {\n        let block = get_block_id(\"mariusz\").unwrap_err();\n        assert!(block\n            .to_string()\n            .contains(\"Incorrect value passed for block_id = mariusz. Possible values are `pre_confirmed`, `latest`, block hash (hex) and block number (u64)\"));\n    }\n\n    #[test]\n    fn test_generate_salt() {\n        let salt = extract_or_generate_salt(None);\n\n        assert!(salt >= Felt::ZERO);\n    }\n\n    #[test]\n    fn test_extract_salt() {\n        let salt = extract_or_generate_salt(Some(Felt::THREE));\n\n        assert_eq!(salt, Felt::THREE);\n    }\n\n    #[test]\n    fn test_udc_uniqueness_unique() {\n        let uniqueness = udc_uniqueness(true, Felt::ONE);\n\n        assert!(matches!(uniqueness, Unique(UdcUniqueSettings { .. })));\n    }\n\n    #[test]\n    fn test_udc_uniqueness_not_unique() {\n        let uniqueness = udc_uniqueness(false, Felt::ONE);\n\n        assert!(matches!(uniqueness, NotUnique));\n    }\n\n    #[test]\n    fn test_chain_id_to_network_name() {\n        let network_name_katana =\n            chain_id_to_network_name(Felt::from_bytes_be_slice(\"KATANA\".as_bytes()));\n        let network_name_sepolia =\n            chain_id_to_network_name(Felt::from_bytes_be_slice(\"SN_SEPOLIA\".as_bytes()));\n        assert_eq!(network_name_katana, \"KATANA\");\n        assert_eq!(network_name_sepolia, \"alpha-sepolia\");\n    }\n\n    #[test]\n    fn test_get_account_data_from_accounts_file() {\n        let account = get_account_data_from_accounts_file(\n            \"user1\",\n            Felt::from_bytes_be_slice(\"SN_SEPOLIA\".as_bytes()),\n            &Utf8PathBuf::from(\"tests/data/accounts/accounts.json\"),\n        )\n        .unwrap();\n        let private_key = account\n            .signer_type\n            .private_key()\n            .expect(\"Private key should exist\");\n        assert_eq!(\n            private_key.into_hex_string(),\n            \"0xffd33878eed7767e7c546ce3fc026295\"\n        );\n        assert_eq!(\n            account.public_key.into_hex_string(),\n            \"0x17b62d16ee2b9b5ccd3320e2c0b234dfbdd1d01d09d0aa29ce164827cddf46a\"\n        );\n        assert_eq!(\n            account.address.map(IntoHexStr::into_hex_string),\n            Some(\"0xf6ecd22832b7c3713cfa7826ee309ce96a2769833f093795fafa1b8f20c48b\".to_string())\n        );\n        assert_eq!(\n            account.salt.map(IntoHexStr::into_hex_string),\n            Some(\"0x14b6b215424909f34f417ddd7cbaca48de2d505d03c92467367d275e847d252\".to_string())\n        );\n        assert_eq!(account.deployed, Some(true));\n        assert_eq!(account.class_hash, None);\n        assert_eq!(account.legacy, None);\n        assert_eq!(account.account_type, Some(AccountType::OpenZeppelin));\n    }\n\n    #[test]\n    fn test_get_account_data_from_keystore() {\n        set_keystore_password_env();\n        let account = get_account_data_from_keystore(\n            \"tests/data/keystore/my_account.json\",\n            &Utf8PathBuf::from(\"tests/data/keystore/my_key.json\"),\n        )\n        .unwrap();\n        let private_key = account\n            .signer_type\n            .private_key()\n            .expect(\"Private key should exist\");\n        assert_eq!(\n            private_key.into_hex_string(),\n            \"0x55ae34c86281fbd19292c7e3bfdfceb4\"\n        );\n        assert_eq!(\n            account.public_key.into_hex_string(),\n            \"0xe2d3d7080bfc665e0060a06e8e95c3db3ff78a1fec4cc81ddc87e49a12e0a\"\n        );\n        assert_eq!(\n            account.address.map(IntoHexStr::into_hex_string),\n            Some(\"0xcce3217e4aea0ab738b55446b1b378750edfca617db549fda1ede28435206c\".to_string())\n        );\n        assert_eq!(account.salt, None);\n        assert_eq!(account.deployed, Some(true));\n        assert_eq!(account.legacy, Some(true));\n        assert_eq!(account.account_type, Some(AccountType::OpenZeppelin));\n    }\n\n    #[test]\n    fn test_get_braavos_account_from_keystore_with_multisig_on() {\n        set_keystore_password_env();\n        let err = get_account_data_from_keystore(\n            \"tests/data/keystore/my_account_braavos_invalid_multisig.json\",\n            &Utf8PathBuf::from(\"tests/data/keystore/my_key.json\"),\n        )\n        .unwrap_err();\n\n        assert!(\n            err.to_string()\n                .contains(\"Braavos accounts cannot be deployed with multisig on\")\n        );\n    }\n\n    #[test]\n    fn test_get_braavos_account_from_keystore_multiple_signers() {\n        set_keystore_password_env();\n        let err = get_account_data_from_keystore(\n            \"tests/data/keystore/my_account_braavos_multiple_signers.json\",\n            &Utf8PathBuf::from(\"tests/data/keystore/my_key.json\"),\n        )\n        .unwrap_err();\n\n        assert!(\n            err.to_string()\n                .contains(\"Braavos accounts can only be deployed with one seed signer\")\n        );\n    }\n\n    #[test]\n    fn test_get_account_data_wrong_chain_id() {\n        let account = get_account_data_from_accounts_file(\n            \"user1\",\n            Felt::from_hex(\"0x435553544f4d5f434841494e5f4944\")\n                .expect(\"Failed to convert chain id from hex\"),\n            &Utf8PathBuf::from(\"tests/data/accounts/accounts.json\"),\n        );\n        let err = account.unwrap_err();\n        assert!(\n            err.to_string()\n                .contains(\"Account = user1 not found under network = CUSTOM_CHAIN_ID\")\n        );\n    }\n\n    fn set_keystore_password_env() {\n        // SAFETY: Tests run in parallel and share the same environment variables.\n        // However, we only set this variable once to a fixed value and never modify or unset it.\n        // The only potential issue would be if a test explicitly required this variable to be unset,\n        // but to the best of our knowledge, no such test exists.\n        unsafe {\n            env::set_var(KEYSTORE_PASSWORD_ENV_VAR, \"123\");\n        };\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/main.rs",
    "content": "use std::str::FromStr;\n\nuse crate::starknet_commands::declare::declare;\nuse crate::starknet_commands::declare_from::{ContractSource, DeclareFrom};\nuse crate::starknet_commands::deploy::{DeployArguments, DeployCommonArgs};\nuse crate::starknet_commands::get::Get;\nuse crate::starknet_commands::get::balance::Balance;\nuse crate::starknet_commands::invoke::InvokeCommonArgs;\nuse crate::starknet_commands::script::run_script_command;\nuse crate::starknet_commands::utils::{self, Utils};\nuse crate::starknet_commands::{\n    account, account::Account as AccountCommand, call::Call, declare::Declare, deploy::Deploy,\n    get::tx_status::TxStatus, invoke::Invoke, multicall::Multicall, script::Script,\n    show_config::ShowConfig,\n};\nuse crate::starknet_commands::{get, multicall};\nuse anyhow::{Context, Result, bail};\nuse camino::Utf8PathBuf;\nuse clap::{CommandFactory, Parser, Subcommand};\nuse configuration::load_config;\nuse conversions::IntoConv;\nuse data_transformer::transform;\nuse foundry_ui::components::warning::WarningMessage;\nuse mimalloc::MiMalloc;\nuse shared::auto_completions::{Completions, generate_completions};\nuse sncast::helpers::command::process_command_result;\nuse sncast::helpers::config::{combine_cast_configs, get_global_config_path};\nuse sncast::helpers::configuration::CastConfig;\nuse sncast::helpers::constants::DEFAULT_ACCOUNTS_FILE;\nuse sncast::helpers::output_format::output_format_from_json_flag;\nuse sncast::helpers::rpc::generate_network_flag;\nuse sncast::helpers::scarb_utils::{\n    BuildConfig, assert_manifest_path_exists, build_and_load_artifacts, get_package_metadata,\n};\nuse sncast::response::declare::{\n    AlreadyDeclaredResponse, DeclareResponse, DeclareTransactionResponse, DeployCommandMessage,\n};\nuse sncast::response::deploy::{DeployResponse, DeployResponseWithDeclare};\nuse sncast::response::errors::handle_starknet_command_error;\nuse sncast::response::explorer_link::block_explorer_link_if_allowed;\nuse sncast::response::transformed_call::transform_response;\nuse sncast::response::ui::UI;\nuse sncast::{\n    ValidatedWaitParams, WaitForTx, get_account, get_block_id, get_class_hash_by_address,\n    get_contract_class, with_account,\n};\nuse starknet_commands::ledger::{self, Ledger};\nuse starknet_commands::verify::Verify;\nuse starknet_rust::core::types::ContractClass;\nuse starknet_rust::core::types::contract::{AbiEntry, SierraClass};\nuse starknet_rust::core::utils::get_selector_from_name;\nuse starknet_rust::providers::Provider;\nuse starknet_types_core::felt::Felt;\nuse tokio::runtime::Runtime;\n\nmod starknet_commands;\n\n#[global_allocator]\nstatic GLOBAL: MiMalloc = MiMalloc;\n\n#[derive(Parser)]\n#[command(\n    version,\n    help_template = \"\\\n{name} {version}\n{author-with-newline}{about-with-newline}\nUse -h for short descriptions and --help for more details.\n\n{before-help}{usage-heading} {usage}\n\n{all-args}{after-help}\n\",\n    after_help = \"Read the docs: https://foundry-rs.github.io/starknet-foundry/\",\n    after_long_help = \"\\\nRead the docs:\n- Starknet Foundry Book: https://foundry-rs.github.io/starknet-foundry/\n- Cairo Book: https://book.cairo-lang.org/\n- Starknet Book: https://book.starknet.io/\n- Starknet Documentation: https://docs.starknet.io/\n- Scarb Documentation: https://docs.swmansion.com/scarb/docs.html\n\nJoin the community:\n- Follow core developers on X: https://twitter.com/swmansionxyz\n- Get support via Telegram: https://t.me/starknet_foundry_support\n- Or discord: https://discord.gg/starknet-community\n- Or join our general chat (Telegram): https://t.me/starknet_foundry\n\nReport bugs: https://github.com/foundry-rs/starknet-foundry/issues/new/choose\\\n\"\n)]\n#[command(about = \"sncast - All-in-one tool for interacting with Starknet smart contracts\", long_about = None)]\n#[command(name = \"sncast\")]\nstruct Cli {\n    /// Profile name in snfoundry.toml config file\n    #[arg(short, long)]\n    profile: Option<String>,\n\n    /// Account to be used for contract declaration;\n    /// When using keystore (`--keystore`), this should be a path to account file\n    /// When using accounts file, this should be an account name\n    #[arg(short = 'a', long)]\n    account: Option<String>,\n\n    /// Path to the file holding accounts info\n    #[arg(short = 'f', long = \"accounts-file\")]\n    accounts_file_path: Option<Utf8PathBuf>,\n\n    /// Path to keystore file; if specified, --account should be a path to starkli JSON account file\n    #[arg(short, long)]\n    keystore: Option<Utf8PathBuf>,\n\n    /// If passed, output will be displayed in json format\n    #[arg(short, long)]\n    json: bool,\n\n    /// If passed, command will wait until transaction is accepted or rejected\n    #[arg(short = 'w', long)]\n    wait: bool,\n\n    /// Adjusts the time after which --wait assumes transaction was not received or rejected\n    #[arg(long)]\n    wait_timeout: Option<u16>,\n\n    /// Adjusts the time between consecutive attempts to fetch transaction by --wait flag\n    #[arg(long)]\n    wait_retry_interval: Option<u8>,\n\n    #[command(subcommand)]\n    command: Commands,\n}\n\nimpl Cli {\n    fn command_name(&self) -> String {\n        match self.command {\n            Commands::Get(_) => \"get\",\n            Commands::Declare(_) => \"declare\",\n            Commands::DeclareFrom(_) => \"declare-from\",\n            Commands::Deploy(_) => \"deploy\",\n            Commands::Call(_) => \"call\",\n            Commands::Invoke(_) => \"invoke\",\n            Commands::Multicall(_) => \"multicall\",\n            Commands::Account(_) => \"account\",\n            Commands::ShowConfig(_) => \"show-config\",\n            Commands::Script(_) => \"script\",\n            Commands::TxStatus(_) => \"tx-status\",\n            Commands::Verify(_) => \"verify\",\n            Commands::Completions(_) => \"completions\",\n            Commands::Utils(_) => \"utils\",\n            Commands::Balance(_) => \"balance\",\n            Commands::Ledger(_) => \"ledger\",\n        }\n        .to_string()\n    }\n}\n\n#[derive(Subcommand)]\nenum Commands {\n    /// Get various data from the network\n    Get(Get),\n\n    /// Declare a contract\n    Declare(Declare),\n\n    /// Declare a contract by fetching it from a different Starknet instance\n    DeclareFrom(DeclareFrom),\n\n    /// Deploy a contract\n    Deploy(Deploy),\n\n    /// Call a contract\n    Call(Call),\n\n    /// Invoke a contract\n    Invoke(Invoke),\n\n    /// Execute multiple calls\n    Multicall(Multicall),\n\n    /// Create and deploy an account\n    Account(AccountCommand),\n\n    /// Show current configuration being used\n    ShowConfig(ShowConfig),\n\n    /// Run or initialize a deployment script\n    Script(Script),\n\n    /// Get the status of a transaction\n    TxStatus(TxStatus),\n\n    /// Verify a contract\n    Verify(Verify),\n\n    /// Generate completions script\n    Completions(Completions),\n\n    /// Utility commands\n    Utils(Utils),\n\n    /// Fetch balance of the account for specified token\n    Balance(Balance),\n\n    /// Interact with Ledger hardware wallet\n    Ledger(Ledger),\n}\n\n#[derive(Debug, Clone, clap::Args)]\n#[group(multiple = false)]\npub struct Arguments {\n    /// Arguments of the called function serialized as a series of felts\n    #[arg(short, long, value_delimiter = ' ', num_args = 1..)]\n    pub calldata: Option<Vec<String>>,\n\n    // Arguments of the called function as a comma-separated string of Cairo expressions\n    #[arg(long, allow_hyphen_values = true)]\n    pub arguments: Option<String>,\n}\n\nimpl Arguments {\n    fn try_into_calldata(\n        self,\n        contract_class: &ContractClass,\n        selector: &Felt,\n    ) -> Result<Vec<Felt>> {\n        if let Some(calldata) = self.calldata {\n            calldata_to_felts(&calldata)\n        } else {\n            let ContractClass::Sierra(sierra_class) = contract_class else {\n                bail!(\"Transformation of arguments is not available for Cairo Zero contracts\")\n            };\n\n            let abi: Vec<AbiEntry> = serde_json::from_str(sierra_class.abi.as_str())\n                .context(\"Couldn't deserialize ABI received from network\")?;\n\n            transform(&self.arguments.unwrap_or_default(), &abi, selector)\n        }\n    }\n}\n\npub fn calldata_to_felts(calldata: &[String]) -> Result<Vec<Felt>> {\n    calldata\n        .iter()\n        .map(|data| Felt::from_str(data).with_context(|| format!(\"Failed to parse {data} to felt\")))\n        .collect()\n}\n\nimpl From<DeployArguments> for Arguments {\n    fn from(value: DeployArguments) -> Self {\n        let DeployArguments {\n            constructor_calldata,\n            arguments,\n        } = value;\n        Self {\n            calldata: constructor_calldata,\n            arguments,\n        }\n    }\n}\n\nfn init_logging() {\n    use std::io;\n    use std::io::IsTerminal;\n    use tracing_log::LogTracer;\n    use tracing_subscriber::filter::{EnvFilter, LevelFilter};\n    use tracing_subscriber::fmt::Layer;\n    use tracing_subscriber::fmt::time::Uptime;\n    use tracing_subscriber::prelude::*;\n\n    let fmt_layer = Layer::new()\n        .with_writer(io::stderr)\n        .with_ansi(io::stderr().is_terminal())\n        .with_timer(Uptime::default())\n        .with_filter(\n            EnvFilter::builder()\n                .with_default_directive(LevelFilter::WARN.into())\n                .with_default_directive(\"coins_ledger=off\".parse().expect(\"valid directive\"))\n                .with_env_var(\"SNCAST_LOG\")\n                .from_env_lossy(),\n        );\n\n    LogTracer::init().expect(\"could not initialize log tracer\");\n\n    tracing::subscriber::set_global_default(tracing_subscriber::registry().with(fmt_layer))\n        .expect(\"could not set up global logger\");\n}\n\nfn main() -> Result<()> {\n    init_logging();\n\n    let cli = Cli::parse();\n\n    let output_format = output_format_from_json_flag(cli.json);\n\n    let ui = UI::new(output_format);\n\n    let runtime = Runtime::new().expect(\"Failed to instantiate Runtime\");\n\n    if let Commands::Script(script) = &cli.command {\n        run_script_command(&cli, runtime, script, &ui)\n    } else {\n        let config = get_cast_config(&cli, &ui)?;\n        runtime.block_on(run_async_command(cli, config, &ui))\n    }\n}\n\n#[expect(clippy::too_many_lines)]\nasync fn run_async_command(cli: Cli, config: CastConfig, ui: &UI) -> Result<()> {\n    let wait_config = WaitForTx {\n        wait: cli.wait,\n        wait_params: config.wait_params,\n        show_ui_outputs: true,\n    };\n\n    match cli.command {\n        Commands::Declare(declare) => {\n            let provider = declare.common.rpc.get_provider(&config, ui).await?;\n\n            let rpc = declare.common.rpc.clone();\n\n            let account = get_account(&config, &provider, &declare.common.rpc, ui).await?;\n            let manifest_path = assert_manifest_path_exists()?;\n            let package_metadata = get_package_metadata(&manifest_path, &declare.package)?;\n            let artifacts = build_and_load_artifacts(\n                &package_metadata,\n                &BuildConfig {\n                    scarb_toml_path: manifest_path,\n                    json: cli.json,\n                    profile: cli.profile.unwrap_or(\"release\".to_string()),\n                },\n                false,\n                // TODO(#3959) Remove `base_ui`\n                ui.base_ui(),\n            )\n            .expect(\"Failed to build contract\");\n\n            let result = with_account!(&account, |account| {\n                starknet_commands::declare::declare(\n                    declare.contract_name.clone(),\n                    declare.common.fee_args,\n                    declare.common.nonce,\n                    account,\n                    &artifacts,\n                    wait_config,\n                    false,\n                    ui,\n                )\n                .await\n            })\n            .map_err(handle_starknet_command_error)\n            .map(|result| match result {\n                DeclareResponse::Success(declare_transaction_response) => {\n                    declare_transaction_response\n                }\n                DeclareResponse::AlreadyDeclared(_) => {\n                    unreachable!(\"Argument `skip_on_already_declared` is false\")\n                }\n            });\n\n            let block_explorer_link =\n                block_explorer_link_if_allowed(&result, provider.chain_id().await?, &config).await;\n\n            let deploy_command_message = if let Ok(response) = &result {\n                // TODO(#3785)\n                let contract_artifacts = artifacts\n                    .get(&declare.contract_name)\n                    .expect(\"Failed to get contract artifacts\");\n                let contract_definition: SierraClass =\n                    serde_json::from_str(&contract_artifacts.sierra)\n                        .context(\"Failed to parse sierra artifact\")?;\n                let network_flag = generate_network_flag(&rpc, &config);\n                Some(DeployCommandMessage::new(\n                    &contract_definition.abi,\n                    response,\n                    &config.account,\n                    &config.accounts_file,\n                    network_flag,\n                ))\n            } else {\n                None\n            };\n\n            process_command_result(\"declare\", result, ui, block_explorer_link);\n\n            if let Some(deploy_command_message) = deploy_command_message {\n                ui.print_notification(deploy_command_message?);\n            }\n\n            Ok(())\n        }\n\n        Commands::DeclareFrom(declare_from) => {\n            let provider = declare_from.common.rpc.get_provider(&config, ui).await?;\n\n            let contract_source = if let Some(sierra_file) = declare_from.sierra_file {\n                ContractSource::LocalFile {\n                    sierra_path: sierra_file,\n                }\n            } else {\n                let source_provider = declare_from.source_rpc.get_provider(ui).await?;\n                let block_id = get_block_id(&declare_from.block_id)?;\n                let class_hash = declare_from.class_hash.expect(\"missing class_hash\");\n\n                ContractSource::Network {\n                    source_provider,\n                    class_hash,\n                    block_id,\n                }\n            };\n\n            let account = get_account(&config, &provider, &declare_from.common.rpc, ui).await?;\n\n            let result = with_account!(&account, |account| {\n                starknet_commands::declare_from::declare_from(\n                    contract_source,\n                    &declare_from.common,\n                    account,\n                    wait_config,\n                    false,\n                    ui,\n                )\n                .await\n            })\n            .map_err(handle_starknet_command_error)\n            .map(|result| match result {\n                DeclareResponse::Success(declare_transaction_response) => {\n                    declare_transaction_response\n                }\n                DeclareResponse::AlreadyDeclared(_) => {\n                    unreachable!(\"Argument `skip_on_already_declared` is false\")\n                }\n            });\n\n            let block_explorer_link =\n                block_explorer_link_if_allowed(&result, provider.chain_id().await?, &config).await;\n            process_command_result(\"declare-from\", result, ui, block_explorer_link);\n\n            Ok(())\n        }\n\n        Commands::Deploy(deploy) => {\n            let Deploy {\n                common:\n                    DeployCommonArgs {\n                        contract_identifier: identifier,\n                        arguments,\n                        package,\n                        salt,\n                        unique,\n                    },\n                fee_args,\n                rpc,\n                mut nonce,\n                ..\n            } = deploy;\n\n            let provider = rpc.get_provider(&config, ui).await?;\n\n            let account = get_account(&config, &provider, &rpc, ui).await?;\n\n            let (class_hash, declare_response) = if let Some(class_hash) = identifier.class_hash {\n                (class_hash, None)\n            } else if let Some(contract_name) = identifier.contract_name {\n                let manifest_path = assert_manifest_path_exists()?;\n                let package_metadata = get_package_metadata(&manifest_path, &package)?;\n                let artifacts = build_and_load_artifacts(\n                    &package_metadata,\n                    &BuildConfig {\n                        scarb_toml_path: manifest_path,\n                        json: cli.json,\n                        profile: cli.profile.unwrap_or(\"release\".to_string()),\n                    },\n                    false,\n                    // TODO(#3959) Remove `base_ui`\n                    ui.base_ui(),\n                )\n                .expect(\"Failed to build contract\");\n\n                let declare_result = with_account!(&account, |account| {\n                    declare(\n                        contract_name,\n                        fee_args.clone(),\n                        nonce,\n                        account,\n                        &artifacts,\n                        WaitForTx {\n                            wait: true,\n                            wait_params: wait_config.wait_params,\n                            show_ui_outputs: wait_config.wait,\n                        },\n                        true,\n                        ui,\n                    )\n                    .await\n                })\n                .map_err(handle_starknet_command_error);\n\n                // Increment nonce after successful declare if it was explicitly provided\n                nonce = nonce.map(|n| n + Felt::ONE);\n\n                match declare_result {\n                    Ok(DeclareResponse::AlreadyDeclared(AlreadyDeclaredResponse {\n                        class_hash,\n                    })) => (class_hash.into_(), None),\n                    Ok(DeclareResponse::Success(declare_transaction_response)) => (\n                        declare_transaction_response.class_hash.into_(),\n                        Some(declare_transaction_response),\n                    ),\n                    Err(err) => {\n                        // TODO(#3960) This will return json output saying that `deploy` command was run\n                        //  even though the invoked command was declare.\n                        process_command_result::<DeclareTransactionResponse>(\n                            \"deploy\",\n                            Err(err),\n                            ui,\n                            None,\n                        );\n                        return Ok(());\n                    }\n                }\n            } else {\n                unreachable!(\"Either `--class_hash` or `--contract_name` must be provided\");\n            };\n\n            // safe to unwrap because \"constructor\" is a standardized name\n            let selector = get_selector_from_name(\"constructor\").unwrap();\n\n            let contract_class = get_contract_class(class_hash, &provider).await?;\n\n            let arguments: Arguments = arguments.into();\n            let calldata = arguments.try_into_calldata(&contract_class, &selector)?;\n\n            let result = with_account!(&account, |account| {\n                starknet_commands::deploy::deploy(\n                    class_hash,\n                    &calldata,\n                    salt,\n                    unique,\n                    fee_args,\n                    nonce,\n                    account,\n                    wait_config,\n                    ui,\n                )\n                .await\n            })\n            .map_err(handle_starknet_command_error);\n\n            let result = if let Some(declare_response) = declare_response {\n                result.map(|r| {\n                    DeployResponse::WithDeclare(DeployResponseWithDeclare::from_responses(\n                        &r,\n                        &declare_response,\n                    ))\n                })\n            } else {\n                result.map(DeployResponse::Standard)\n            };\n\n            let block_explorer_link =\n                block_explorer_link_if_allowed(&result, provider.chain_id().await?, &config).await;\n            process_command_result(\"deploy\", result, ui, block_explorer_link);\n\n            Ok(())\n        }\n\n        Commands::Call(Call {\n            contract_address,\n            function,\n            arguments,\n            block_id,\n            rpc,\n        }) => {\n            let provider = rpc.get_provider(&config, ui).await?;\n\n            let block_id = get_block_id(&block_id)?;\n            let class_hash = get_class_hash_by_address(&provider, contract_address).await?;\n            let contract_class = get_contract_class(class_hash, &provider).await?;\n\n            let selector = get_selector_from_name(&function)\n                .context(\"Failed to convert entry point selector to FieldElement\")?;\n\n            let calldata = arguments.try_into_calldata(&contract_class, &selector)?;\n\n            let result = starknet_commands::call::call(\n                contract_address,\n                selector,\n                calldata,\n                &provider,\n                block_id.as_ref(),\n            )\n            .await\n            .map_err(handle_starknet_command_error);\n\n            if let Some(transformed_result) =\n                transform_response(&result, &contract_class, &selector)\n            {\n                process_command_result(\"call\", Ok(transformed_result), ui, None);\n            } else {\n                process_command_result(\"call\", result, ui, None);\n            }\n\n            Ok(())\n        }\n\n        Commands::Invoke(invoke) => {\n            let Invoke {\n                common:\n                    InvokeCommonArgs {\n                        contract_address,\n                        function,\n                        arguments,\n                    },\n                fee_args,\n                proof_args,\n                rpc,\n                nonce,\n                ..\n            } = invoke;\n\n            let provider = rpc.get_provider(&config, ui).await?;\n\n            let account = get_account(&config, &provider, &rpc, ui).await?;\n\n            let selector = get_selector_from_name(&function)\n                .context(\"Failed to convert entry point selector to FieldElement\")?;\n\n            let contract_address = contract_address.try_into_felt()?;\n            let class_hash = get_class_hash_by_address(&provider, contract_address).await?;\n            let contract_class = get_contract_class(class_hash, &provider).await?;\n\n            let calldata = arguments.try_into_calldata(&contract_class, &selector)?;\n\n            let result = with_account!(&account, |account| {\n                starknet_commands::invoke::invoke(\n                    contract_address,\n                    calldata,\n                    nonce,\n                    fee_args,\n                    proof_args,\n                    selector,\n                    account,\n                    wait_config,\n                    ui,\n                )\n                .await\n            })\n            .map_err(handle_starknet_command_error);\n\n            let block_explorer_link =\n                block_explorer_link_if_allowed(&result, provider.chain_id().await?, &config).await;\n\n            process_command_result(\"invoke\", result, ui, block_explorer_link);\n\n            Ok(())\n        }\n\n        Commands::Get(get) => get::get(get, config, ui).await,\n\n        Commands::Utils(utils) => {\n            utils::utils(\n                utils,\n                config,\n                ui,\n                cli.json,\n                cli.profile.clone().unwrap_or(\"release\".to_string()),\n            )\n            .await\n        }\n\n        Commands::Multicall(multicall) => {\n            multicall::multicall(multicall, config, ui, wait_config).await\n        }\n\n        Commands::Account(account) => account::account(account, config, ui, wait_config).await,\n\n        Commands::ShowConfig(show) => {\n            let provider = show.rpc.get_provider(&config, ui).await.ok();\n\n            let result = starknet_commands::show_config::show_config(\n                &show,\n                provider.as_ref(),\n                config,\n                cli.profile,\n            )\n            .await;\n\n            process_command_result(\"show-config\", result, ui, None);\n\n            Ok(())\n        }\n\n        // TODO(#4214): Remove moved sncast commands\n        Commands::TxStatus(tx_status) => {\n            print_cmd_move_warning(\"tx-status\", \"get tx-status\", ui);\n            get::tx_status::tx_status(tx_status, config, ui).await\n        }\n\n        Commands::Verify(verify) => {\n            let manifest_path = assert_manifest_path_exists()?;\n            let package_metadata = get_package_metadata(&manifest_path, &verify.package)?;\n            let artifacts = build_and_load_artifacts(\n                &package_metadata,\n                &BuildConfig {\n                    scarb_toml_path: manifest_path.clone(),\n                    json: cli.json,\n                    profile: cli.profile.unwrap_or(\"release\".to_string()),\n                },\n                false,\n                // TODO(#3959) Remove `base_ui`\n                ui.base_ui(),\n            )\n            .expect(\"Failed to build contract\");\n            let result = starknet_commands::verify::verify(\n                verify,\n                &package_metadata.manifest_path,\n                &artifacts,\n                &config,\n                ui,\n            )\n            .await;\n\n            process_command_result(\"verify\", result, ui, None);\n            Ok(())\n        }\n\n        Commands::Completions(completions) => {\n            generate_completions(completions.shell, &mut Cli::command())?;\n            Ok(())\n        }\n\n        // TODO(#4214): Remove moved sncast commands\n        Commands::Balance(balance) => {\n            print_cmd_move_warning(\"balance\", \"get balance\", ui);\n            get::balance::balance(balance, config, ui).await\n        }\n\n        Commands::Ledger(ledger) => {\n            let result = ledger::ledger(&ledger, ui).await?;\n\n            process_command_result(\"ledger\", Ok(result), ui, None);\n\n            Ok(())\n        }\n\n        Commands::Script(_) => unreachable!(),\n    }\n}\n\nfn config_with_cli(config: &mut CastConfig, cli: &Cli) {\n    macro_rules! clone_or_else {\n        ($field:expr, $config_field:expr) => {\n            $field.clone().unwrap_or_else(|| $config_field.clone())\n        };\n    }\n\n    config.account = clone_or_else!(cli.account, config.account);\n    config.keystore = cli.keystore.clone().or(config.keystore.clone());\n\n    if config.accounts_file == Utf8PathBuf::default() {\n        config.accounts_file = Utf8PathBuf::from(DEFAULT_ACCOUNTS_FILE);\n    }\n    let new_accounts_file = clone_or_else!(cli.accounts_file_path, config.accounts_file);\n\n    config.accounts_file = Utf8PathBuf::from(shellexpand::tilde(&new_accounts_file).to_string());\n\n    config.wait_params = ValidatedWaitParams::new(\n        clone_or_else!(\n            cli.wait_retry_interval,\n            config.wait_params.get_retry_interval()\n        ),\n        clone_or_else!(cli.wait_timeout, config.wait_params.get_timeout()),\n    );\n}\n\nfn get_cast_config(cli: &Cli, ui: &UI) -> Result<CastConfig> {\n    let command = cli.command_name();\n    let global_config_path = get_global_config_path().unwrap_or_else(|err| {\n        ui.print_error(&command, format!(\"Error getting global config path: {err}\"));\n        Utf8PathBuf::new()\n    });\n\n    let global_config =\n        load_config::<CastConfig>(Some(&global_config_path.clone()), cli.profile.as_deref())\n            .or_else(|_| load_config::<CastConfig>(Some(&global_config_path), None))\n            .map_err(|err| anyhow::anyhow!(format!(\"Failed to load config: {err}\")))?;\n\n    let local_config = load_config::<CastConfig>(None, cli.profile.as_deref())\n        .map_err(|err| anyhow::anyhow!(format!(\"Failed to load config: {err}\")))?;\n\n    let mut combined_config = combine_cast_configs(&global_config, &local_config);\n\n    config_with_cli(&mut combined_config, cli);\n    Ok(combined_config)\n}\n\nfn print_cmd_move_warning(command_name: &str, new_command_name: &str, ui: &UI) {\n    ui.print_warning(WarningMessage::new(format!(\n        \"`sncast {command_name}` has moved to `sncast {new_command_name}`. `sncast {command_name}` will be removed in the next version.\"\n    )));\n    ui.print_blank_line();\n}\n"
  },
  {
    "path": "crates/sncast/src/response/account/create.rs",
    "content": "use crate::response::cast_message::SncastCommandMessage;\nuse crate::{helpers::block_explorer::LinkProvider, response::explorer_link::OutputLink};\nuse conversions::padded_felt::PaddedFelt;\nuse conversions::string::IntoPaddedHexStr;\nuse foundry_ui::styling;\nuse serde::{Serialize, Serializer};\n\nfn as_str<S>(value: &u128, serializer: S) -> Result<S::Ok, S::Error>\nwhere\n    S: Serializer,\n{\n    serializer.serialize_str(&value.to_string())\n}\n\n#[derive(Serialize, Debug, Clone)]\npub struct AccountCreateResponse {\n    pub address: PaddedFelt,\n    #[serde(serialize_with = \"as_str\")]\n    pub estimated_fee: u128,\n    pub add_profile: Option<String>,\n    pub message: String,\n}\n\nimpl SncastCommandMessage for AccountCreateResponse {\n    fn text(&self) -> String {\n        styling::OutputBuilder::new()\n            .success_message(\"Account created\")\n            .blank_line()\n            .field(\"Address\", &self.address.into_padded_hex_str())\n            .if_some(self.add_profile.as_ref(), |builder, profile| {\n                builder.field(\"Add Profile\", profile)\n            })\n            .blank_line()\n            .text_field(&self.message)\n            .build()\n    }\n}\n\nimpl OutputLink for AccountCreateResponse {\n    const TITLE: &'static str = \"account creation\";\n\n    fn format_links(&self, provider: Box<dyn LinkProvider>) -> String {\n        format!(\"account: {}\", provider.contract(self.address))\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/response/account/delete.rs",
    "content": "use crate::response::cast_message::SncastCommandMessage;\nuse foundry_ui::styling;\nuse serde::Serialize;\n\n#[derive(Serialize, Clone)]\npub struct AccountDeleteResponse {\n    pub result: String,\n}\n\nimpl SncastCommandMessage for AccountDeleteResponse {\n    fn text(&self) -> String {\n        styling::OutputBuilder::new()\n            .success_message(\"Account deleted\")\n            .blank_line()\n            .text_field(&self.result)\n            .build()\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/response/account/deploy.rs",
    "content": "use crate::response::cast_message::SncastCommandMessage;\nuse crate::{\n    helpers::block_explorer::LinkProvider,\n    response::{explorer_link::OutputLink, invoke::InvokeResponse},\n};\nuse conversions::string::IntoHexStr;\nuse conversions::{padded_felt::PaddedFelt, serde::serialize::CairoSerialize};\nuse foundry_ui::styling;\nuse serde::{Deserialize, Serialize};\n\n#[derive(Serialize, Deserialize, CairoSerialize, Clone, Debug, PartialEq)]\npub struct AccountDeployResponse {\n    pub transaction_hash: PaddedFelt,\n}\n\nimpl From<InvokeResponse> for AccountDeployResponse {\n    fn from(value: InvokeResponse) -> Self {\n        Self {\n            transaction_hash: value.transaction_hash,\n        }\n    }\n}\n\nimpl SncastCommandMessage for AccountDeployResponse {\n    fn text(&self) -> String {\n        styling::OutputBuilder::new()\n            .success_message(\"Account deployed\")\n            .blank_line()\n            .field(\"Transaction Hash\", &self.transaction_hash.into_hex_string())\n            .build()\n    }\n}\n\nimpl OutputLink for AccountDeployResponse {\n    const TITLE: &'static str = \"account deployment\";\n\n    fn format_links(&self, provider: Box<dyn LinkProvider>) -> String {\n        format!(\n            \"transaction: {}\",\n            provider.transaction(self.transaction_hash)\n        )\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/response/account/import.rs",
    "content": "use crate::response::cast_message::SncastCommandMessage;\nuse foundry_ui::styling;\nuse serde::Serialize;\n\n#[derive(Serialize, Clone)]\npub struct AccountImportResponse {\n    pub add_profile: Option<String>,\n    pub account_name: String,\n}\n\nimpl SncastCommandMessage for AccountImportResponse {\n    fn text(&self) -> String {\n        styling::OutputBuilder::new()\n            .success_message(\"Account imported successfully\")\n            .blank_line()\n            .field(\"Account Name\", &self.account_name)\n            .if_some(self.add_profile.as_ref(), |builder, profile| {\n                builder.field(\"Add Profile\", profile)\n            })\n            .build()\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/response/account/mod.rs",
    "content": "pub mod create;\npub mod delete;\npub mod deploy;\npub mod import;\n"
  },
  {
    "path": "crates/sncast/src/response/balance.rs",
    "content": "use crate::helpers::token::TokenUnit;\nuse crate::response::cast_message::SncastCommandMessage;\nuse foundry_ui::styling;\nuse primitive_types::U256;\nuse serde::ser::{Serialize, SerializeStruct, Serializer};\n\n#[derive(Debug)]\npub struct BalanceResponse {\n    pub balance: U256,\n    pub token_unit: Option<TokenUnit>,\n}\n\nimpl SncastCommandMessage for BalanceResponse {\n    fn text(&self) -> String {\n        let balance_str = if let Some(token_unit) = self.token_unit {\n            format!(\"{} {token_unit}\", self.balance)\n        } else {\n            self.balance.to_string()\n        };\n\n        styling::OutputBuilder::new()\n            .field(\"Balance\", &balance_str)\n            .build()\n    }\n}\n\n// We need custom serialization because U256's default serialization is hex string\nimpl Serialize for BalanceResponse {\n    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>\n    where\n        S: Serializer,\n    {\n        let mut s = serializer.serialize_struct(\"BalanceResponse\", 2)?;\n        // Default U256 serialization uses hex string, we want decimal string\n        s.serialize_field(\"balance\", &self.balance.to_string())?;\n        s.serialize_field(\"token_unit\", &self.token_unit)?;\n        s.end()\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/response/call.rs",
    "content": "use crate::response::cast_message::SncastCommandMessage;\nuse conversions::serde::serialize::CairoSerialize;\nuse conversions::string::IntoHexStr;\nuse foundry_ui::styling;\nuse serde::Serialize;\nuse starknet_types_core::felt::Felt;\n\n#[derive(Serialize, CairoSerialize, Clone)]\npub struct CallResponse {\n    pub response: Vec<Felt>,\n}\n\nimpl SncastCommandMessage for CallResponse {\n    fn text(&self) -> String {\n        let response_values = self\n            .response\n            .iter()\n            .map(|felt| felt.into_hex_string())\n            .collect::<Vec<_>>()\n            .join(\", \");\n\n        styling::OutputBuilder::new()\n            .success_message(\"Call completed\")\n            .blank_line()\n            .field(\"Response\", &format!(\"[{response_values}]\"))\n            .build()\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/response/cast_message.rs",
    "content": "use foundry_ui::Message;\nuse serde::Serialize;\nuse serde_json::Value;\n\npub struct SncastMessage<T: SncastCommandMessage + Serialize>(pub T);\n\npub trait SncastCommandMessage {\n    fn text(&self) -> String;\n}\n\nimpl<T> Message for SncastMessage<T>\nwhere\n    T: SncastCommandMessage + Serialize,\n{\n    fn text(&self) -> String {\n        self.0.text()\n    }\n\n    fn json(&self) -> Value {\n        serde_json::to_value(&self.0).expect(\"Should be serializable to JSON\")\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/response/class_hash_at.rs",
    "content": "use crate::helpers::block_explorer::LinkProvider;\nuse crate::response::cast_message::SncastCommandMessage;\nuse crate::response::explorer_link::OutputLink;\nuse conversions::padded_felt::PaddedFelt;\nuse conversions::string::IntoPaddedHexStr;\nuse foundry_ui::styling;\nuse serde::Serialize;\n\n#[derive(Serialize, Clone)]\npub struct ClassHashAtResponse {\n    pub class_hash: PaddedFelt,\n}\n\nimpl SncastCommandMessage for ClassHashAtResponse {\n    fn text(&self) -> String {\n        styling::OutputBuilder::new()\n            .success_message(\"Class hash retrieved\")\n            .blank_line()\n            .field(\"Class Hash\", &self.class_hash.into_padded_hex_str())\n            .build()\n    }\n}\n\nimpl OutputLink for ClassHashAtResponse {\n    const TITLE: &'static str = \"class\";\n\n    fn format_links(&self, provider: Box<dyn LinkProvider>) -> String {\n        format!(\"class: {}\", provider.class(self.class_hash))\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/response/completions.rs",
    "content": "use foundry_ui::Message;\nuse serde::Serialize;\nuse serde_json::{Value, json};\n\n#[derive(Serialize)]\npub struct CompletionsMessage {\n    pub completions: String,\n}\n\nimpl Message for CompletionsMessage {\n    fn text(&self) -> String {\n        self.completions.clone()\n    }\n\n    fn json(&self) -> Value {\n        json!(self)\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/response/declare.rs",
    "content": "use super::explorer_link::OutputLink;\nuse crate::helpers::block_explorer::LinkProvider;\nuse crate::response::cast_message::SncastCommandMessage;\nuse anyhow::Error;\nuse camino::Utf8PathBuf;\nuse conversions::string::IntoHexStr;\nuse conversions::{IntoConv, padded_felt::PaddedFelt, serde::serialize::CairoSerialize};\nuse foundry_ui::{Message, styling};\nuse indoc::formatdoc;\nuse serde::{Deserialize, Serialize};\nuse serde_json::Value;\nuse starknet_rust::core::types::contract::{AbiConstructor, AbiEntry};\nuse starknet_types_core::felt::Felt;\nuse std::fmt::Write;\n\n#[derive(Clone, Serialize, Deserialize, CairoSerialize, Debug, PartialEq)]\npub struct DeclareTransactionResponse {\n    pub class_hash: PaddedFelt,\n    pub transaction_hash: PaddedFelt,\n}\n\nimpl SncastCommandMessage for DeclareTransactionResponse {\n    fn text(&self) -> String {\n        styling::OutputBuilder::new()\n            .success_message(\"Declaration completed\")\n            .blank_line()\n            .field(\"Class Hash\", &self.class_hash.into_hex_string())\n            .field(\"Transaction Hash\", &self.transaction_hash.into_hex_string())\n            .build()\n    }\n}\n\n#[derive(Clone, Serialize, Deserialize, CairoSerialize, Debug, PartialEq)]\npub struct AlreadyDeclaredResponse {\n    pub class_hash: PaddedFelt,\n}\n\n#[derive(Clone, Serialize, Deserialize, CairoSerialize, Debug, PartialEq)]\n#[serde(tag = \"status\")]\npub enum DeclareResponse {\n    AlreadyDeclared(AlreadyDeclaredResponse),\n    #[serde(untagged)]\n    Success(DeclareTransactionResponse),\n}\n\nimpl DeclareResponse {\n    #[must_use]\n    pub fn class_hash(&self) -> Felt {\n        match self {\n            DeclareResponse::AlreadyDeclared(response) => response.class_hash.into_(),\n            DeclareResponse::Success(response) => response.class_hash.into_(),\n        }\n    }\n}\n\nimpl OutputLink for DeclareTransactionResponse {\n    const TITLE: &'static str = \"declaration\";\n\n    fn format_links(&self, provider: Box<dyn LinkProvider>) -> String {\n        formatdoc!(\n            \"\n            class: {}\n            transaction: {}\n            \",\n            provider.class(self.class_hash),\n            provider.transaction(self.transaction_hash)\n        )\n    }\n}\n\n#[derive(Clone, Serialize, Deserialize, Debug, PartialEq)]\npub struct DeployCommandMessage {\n    accounts_file: Option<String>,\n    account: String,\n    class_hash: PaddedFelt,\n    arguments_flag: Option<String>,\n    network_flag: String,\n}\n\nimpl DeployCommandMessage {\n    pub fn new(\n        abi: &[AbiEntry],\n        response: &DeclareTransactionResponse,\n        account: &str,\n        accounts_file: &Utf8PathBuf,\n        network_flag: String,\n    ) -> Result<Self, Error> {\n        let arguments_flag: Option<String> = generate_arguments_flag(abi);\n        let accounts_file_str = accounts_file.to_string();\n        let accounts_file = (!accounts_file_str\n            .contains(\"starknet_accounts/starknet_open_zeppelin_accounts.json\"))\n        .then_some(accounts_file_str);\n\n        Ok(Self {\n            account: account.to_string(),\n            accounts_file,\n            class_hash: response.class_hash,\n            arguments_flag,\n            network_flag,\n        })\n    }\n}\n\nimpl Message for DeployCommandMessage {\n    fn text(&self) -> String {\n        let mut command = String::from(\"sncast\");\n\n        let accounts_file_flag = generate_accounts_file_flag(self.accounts_file.as_ref());\n        if let Some(flag) = accounts_file_flag {\n            write!(command, \" {flag}\").unwrap();\n        }\n\n        let account_flag = format!(\"--account {}\", self.account);\n        write!(command, \" {account_flag}\").unwrap();\n\n        write!(command, \" deploy\").unwrap();\n\n        write!(\n            command,\n            \" --class-hash {}\",\n            self.class_hash.into_hex_string()\n        )\n        .unwrap();\n\n        if let Some(arguments) = &self.arguments_flag {\n            write!(command, \" {arguments}\").unwrap();\n        }\n\n        write!(command, \" {}\", self.network_flag).unwrap();\n\n        let header = if self.arguments_flag.is_some() {\n            \"To deploy a contract of this class, replace the placeholders in `--arguments` with your actual values, then run:\"\n        } else {\n            \"To deploy a contract of this class, run:\"\n        };\n\n        formatdoc!(\n            \"\n            {header}\n            {command}\n            \"\n        )\n    }\n\n    fn json(&self) -> Value {\n        // TODO(#3960) JSON output support\n        // This message is only helpful in human mode, we don't need it in JSON mode.\n        Value::Null\n    }\n}\n\nfn generate_constructor_placeholder_arguments(constructor: AbiConstructor) -> String {\n    constructor\n        .inputs\n        .into_iter()\n        .map(|input| {\n            let input_type = input\n                .r#type\n                .split(\"::\")\n                .last()\n                .expect(\"Failed to get last part of input type\");\n            format!(\"<{}: {}>\", input.name, input_type)\n        })\n        .collect::<Vec<String>>()\n        .join(\", \")\n}\n\nfn generate_arguments_flag(abi: &[AbiEntry]) -> Option<String> {\n    let arguments = abi.iter().find_map(|entry| {\n        if let AbiEntry::Constructor(constructor) = entry {\n            let arguments = generate_constructor_placeholder_arguments(constructor.clone());\n            (!arguments.is_empty()).then_some(arguments)\n        } else {\n            None\n        }\n    });\n\n    arguments.map(|arguments| format!(\"--arguments '{arguments}'\"))\n}\n\nfn generate_accounts_file_flag(accounts_file: Option<&String>) -> Option<String> {\n    accounts_file\n        .as_ref()\n        .map(|file| format!(\"--accounts-file {file}\"))\n}\n"
  },
  {
    "path": "crates/sncast/src/response/deploy.rs",
    "content": "use crate::helpers::block_explorer::LinkProvider;\nuse crate::response::cast_message::SncastCommandMessage;\nuse crate::response::declare::DeclareTransactionResponse;\nuse crate::response::explorer_link::OutputLink;\nuse conversions::string::IntoPaddedHexStr;\nuse conversions::{padded_felt::PaddedFelt, serde::serialize::CairoSerialize};\nuse foundry_ui::styling;\nuse indoc::formatdoc;\nuse serde::{Deserialize, Serialize};\n\n#[derive(Clone, Serialize, Deserialize, CairoSerialize, Debug, PartialEq)]\n#[serde(untagged)]\npub enum DeployResponse {\n    Standard(StandardDeployResponse),\n    WithDeclare(DeployResponseWithDeclare),\n}\n\nimpl SncastCommandMessage for DeployResponse {\n    fn text(&self) -> String {\n        match &self {\n            DeployResponse::Standard(response) => response.text(),\n            DeployResponse::WithDeclare(response) => response.text(),\n        }\n    }\n}\n\nimpl OutputLink for DeployResponse {\n    const TITLE: &'static str = \"deployment\";\n\n    fn format_links(&self, provider: Box<dyn LinkProvider>) -> String {\n        match self {\n            DeployResponse::Standard(deploy) => {\n                formatdoc!(\n                    \"\n                    contract: {}\n                    transaction: {}\n                    \",\n                    provider.contract(deploy.contract_address),\n                    provider.transaction(deploy.transaction_hash)\n                )\n            }\n            DeployResponse::WithDeclare(deploy_with_declare) => {\n                formatdoc!(\n                    \"\n                    contract: {}\n                    class: {}\n                    deploy transaction: {}\n                    declare transaction: {}\n                    \",\n                    provider.contract(deploy_with_declare.contract_address),\n                    provider.class(deploy_with_declare.class_hash),\n                    provider.transaction(deploy_with_declare.deploy_transaction_hash),\n                    provider.transaction(deploy_with_declare.declare_transaction_hash),\n                )\n            }\n        }\n    }\n}\n\n#[derive(Clone, Serialize, Deserialize, CairoSerialize, Debug, PartialEq)]\npub struct StandardDeployResponse {\n    pub contract_address: PaddedFelt,\n    pub transaction_hash: PaddedFelt,\n}\n\nimpl StandardDeployResponse {\n    fn text(&self) -> String {\n        styling::OutputBuilder::new()\n            .success_message(\"Deployment completed\")\n            .blank_line()\n            .field(\n                \"Contract Address\",\n                &self.contract_address.into_padded_hex_str(),\n            )\n            .field(\n                \"Transaction Hash\",\n                &self.transaction_hash.into_padded_hex_str(),\n            )\n            .build()\n    }\n}\n\n#[derive(Clone, Serialize, Deserialize, CairoSerialize, Debug, PartialEq)]\npub struct DeployResponseWithDeclare {\n    contract_address: PaddedFelt,\n    class_hash: PaddedFelt,\n    deploy_transaction_hash: PaddedFelt,\n    declare_transaction_hash: PaddedFelt,\n}\n\nimpl DeployResponseWithDeclare {\n    #[must_use]\n    pub fn from_responses(\n        deploy: &StandardDeployResponse,\n        declare: &DeclareTransactionResponse,\n    ) -> Self {\n        Self {\n            contract_address: deploy.contract_address,\n            class_hash: declare.class_hash,\n            deploy_transaction_hash: deploy.transaction_hash,\n            declare_transaction_hash: declare.transaction_hash,\n        }\n    }\n}\n\nimpl DeployResponseWithDeclare {\n    fn text(&self) -> String {\n        styling::OutputBuilder::new()\n            .success_message(\"Deployment completed\")\n            .blank_line()\n            .field(\n                \"Contract Address\",\n                &self.contract_address.into_padded_hex_str(),\n            )\n            .field(\"Class Hash\", &self.class_hash.into_padded_hex_str())\n            .field(\n                \"Declare Transaction Hash\",\n                &self.declare_transaction_hash.into_padded_hex_str(),\n            )\n            .field(\n                \"Deploy Transaction Hash\",\n                &self.deploy_transaction_hash.into_padded_hex_str(),\n            )\n            .build()\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/response/errors.rs",
    "content": "use crate::{ErrorData, WaitForTransactionError, handle_rpc_error};\nuse anyhow::anyhow;\nuse console::style;\nuse conversions::padded_felt::PaddedFelt;\nuse conversions::serde::serialize::CairoSerialize;\n\nuse conversions::byte_array::ByteArray;\n\nuse foundry_ui::Message;\nuse serde_json::{Value, json};\nuse starknet_rust::core::types::{ContractErrorData, StarknetError, TransactionExecutionErrorData};\nuse starknet_rust::providers::ProviderError;\nuse thiserror::Error;\n\n#[derive(Debug)]\npub struct ResponseError {\n    command: String,\n    error: String,\n}\n\nimpl ResponseError {\n    #[must_use]\n    pub fn new(command: String, error: String) -> Self {\n        Self { command, error }\n    }\n}\n\nimpl Message for ResponseError {\n    fn text(&self) -> String {\n        format!(\n            \"Command: {}\n{}: {}\",\n            self.command,\n            style(\"Error\").red(),\n            self.error\n        )\n    }\n\n    fn json(&self) -> Value {\n        json!({\n            \"error\": self.error,\n        })\n    }\n}\n\n#[derive(Error, Debug, CairoSerialize)]\npub enum StarknetCommandError {\n    #[error(transparent)]\n    UnknownError(#[from] anyhow::Error),\n    #[error(\"Failed to find {} artifact in starknet_artifacts.json file. Please make sure you have specified correct package using `--package` flag.\", .0.data)]\n    ContractArtifactsNotFound(ErrorData),\n    #[error(transparent)]\n    WaitForTransactionError(#[from] WaitForTransactionError),\n    #[error(transparent)]\n    ProviderError(#[from] SNCastProviderError),\n}\n\n#[must_use]\npub fn handle_starknet_command_error(error: StarknetCommandError) -> anyhow::Error {\n    match error {\n        StarknetCommandError::ProviderError(err) => handle_rpc_error(err),\n        _ => error.into(),\n    }\n}\n\n#[derive(Debug, Error, CairoSerialize)]\npub enum SNCastProviderError {\n    #[error(transparent)]\n    StarknetError(SNCastStarknetError),\n    #[error(\"Request rate limited\")]\n    RateLimited,\n    #[error(\"Unknown RPC error: {0}\")]\n    UnknownError(#[from] anyhow::Error),\n}\n\nimpl From<ProviderError> for SNCastProviderError {\n    fn from(value: ProviderError) -> Self {\n        match value {\n            ProviderError::StarknetError(err) => SNCastProviderError::StarknetError(err.into()),\n            ProviderError::RateLimited => SNCastProviderError::RateLimited,\n            ProviderError::ArrayLengthMismatch => {\n                SNCastProviderError::UnknownError(anyhow!(\"Array length mismatch\"))\n            }\n            ProviderError::Other(err) => SNCastProviderError::UnknownError(anyhow!(\"{err}\")),\n        }\n    }\n}\n\n#[derive(Debug, Error, CairoSerialize)]\npub enum SNCastStarknetError {\n    #[error(\"Node failed to receive transaction\")]\n    FailedToReceiveTransaction,\n    #[error(\"There is no contract at the specified address\")]\n    ContractNotFound,\n    #[error(\"Requested entrypoint does not exist in the contract\")]\n    EntryPointNotFound,\n    #[error(\"Block was not found\")]\n    BlockNotFound,\n    #[error(\"There is no transaction with such an index\")]\n    InvalidTransactionIndex,\n    #[error(\"Provided class hash does not exist\")]\n    ClassHashNotFound,\n    #[error(\"Transaction with provided hash was not found (does not exist)\")]\n    TransactionHashNotFound,\n    #[error(\"An error occurred in the called contract = {0:?}\")]\n    ContractError(ContractErrorData),\n    #[error(\"Transaction execution error = {0:?}\")]\n    TransactionExecutionError(TransactionExecutionErrorData),\n    #[error(\"Contract with class hash {0:#x} is already declared\")]\n    ClassAlreadyDeclared(PaddedFelt),\n    #[error(\"Invalid transaction nonce\")]\n    InvalidTransactionNonce,\n    #[error(\"The transaction's resources don't cover validation or the minimal transaction fee\")]\n    InsufficientResourcesForValidate,\n    #[error(\"Account balance is too small to cover transaction fee\")]\n    InsufficientAccountBalance,\n    #[error(\"Contract failed the validation = {0}\")]\n    ValidationFailure(ByteArray),\n    #[error(\"Contract failed to compile in starknet\")]\n    CompilationFailed(ByteArray),\n    #[error(\"Contract class size is too large\")]\n    ContractClassSizeIsTooLarge,\n    #[error(\"No account\")]\n    NonAccount,\n    #[error(\"Transaction already exists\")]\n    DuplicateTx,\n    #[error(\"Compiled class hash mismatch\")]\n    CompiledClassHashMismatch,\n    #[error(\"Unsupported transaction version\")]\n    UnsupportedTxVersion,\n    #[error(\"Unsupported contract class version\")]\n    UnsupportedContractClassVersion,\n    #[error(\"Unexpected RPC error occurred: {0}\")]\n    UnexpectedError(anyhow::Error),\n}\n\nimpl From<StarknetError> for SNCastStarknetError {\n    fn from(value: StarknetError) -> Self {\n        match value {\n            StarknetError::FailedToReceiveTransaction => {\n                SNCastStarknetError::FailedToReceiveTransaction\n            }\n            StarknetError::ContractNotFound => SNCastStarknetError::ContractNotFound,\n            StarknetError::BlockNotFound => SNCastStarknetError::BlockNotFound,\n            StarknetError::InvalidTransactionIndex => SNCastStarknetError::InvalidTransactionIndex,\n            StarknetError::ClassHashNotFound => SNCastStarknetError::ClassHashNotFound,\n            StarknetError::TransactionHashNotFound => SNCastStarknetError::TransactionHashNotFound,\n            StarknetError::ContractError(err) => SNCastStarknetError::ContractError(err),\n            StarknetError::TransactionExecutionError(err) => {\n                SNCastStarknetError::TransactionExecutionError(err)\n            }\n            StarknetError::ClassAlreadyDeclared => {\n                unreachable!(\n                    \"ClassAlreadyDeclared error requires class hash parameter which is present in StarknetError::ClassAlreadyDeclared. This conversion should not be used.\"\n                )\n            }\n            StarknetError::InvalidTransactionNonce(_) => {\n                SNCastStarknetError::InvalidTransactionNonce\n            }\n            StarknetError::InsufficientResourcesForValidate => {\n                SNCastStarknetError::InsufficientResourcesForValidate\n            }\n            StarknetError::InsufficientAccountBalance => {\n                SNCastStarknetError::InsufficientAccountBalance\n            }\n            StarknetError::ValidationFailure(err) => {\n                SNCastStarknetError::ValidationFailure(ByteArray::from(err.as_str()))\n            }\n            StarknetError::CompilationFailed(msg) => {\n                SNCastStarknetError::CompilationFailed(ByteArray::from(msg.as_str()))\n            }\n            StarknetError::ContractClassSizeIsTooLarge => {\n                SNCastStarknetError::ContractClassSizeIsTooLarge\n            }\n            StarknetError::NonAccount => SNCastStarknetError::NonAccount,\n            StarknetError::DuplicateTx => SNCastStarknetError::DuplicateTx,\n            StarknetError::CompiledClassHashMismatch => {\n                SNCastStarknetError::CompiledClassHashMismatch\n            }\n            StarknetError::UnsupportedTxVersion => SNCastStarknetError::UnsupportedTxVersion,\n            StarknetError::UnsupportedContractClassVersion => {\n                SNCastStarknetError::UnsupportedContractClassVersion\n            }\n            StarknetError::UnexpectedError(err) => {\n                SNCastStarknetError::UnexpectedError(anyhow!(err))\n            }\n            StarknetError::EntrypointNotFound => SNCastStarknetError::EntryPointNotFound,\n            other => SNCastStarknetError::UnexpectedError(anyhow!(other)),\n        }\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/response/explorer_link.rs",
    "content": "use crate::Network;\nuse crate::helpers::{block_explorer::LinkProvider, configuration::CastConfig, devnet::detection};\nuse foundry_ui::Message;\nuse serde::Serialize;\nuse serde_json::Value;\nuse starknet_types_core::felt::Felt;\n\nconst SNCAST_FORCE_SHOW_EXPLORER_LINKS_ENV: &str = \"SNCAST_FORCE_SHOW_EXPLORER_LINKS\";\n\n// TODO(#3391): This code should be refactored to either use common `Message` trait or be directly\n//  included in `sncast` output messages.\npub trait OutputLink {\n    const TITLE: &'static str;\n\n    fn format_links(&self, provider: Box<dyn LinkProvider>) -> String;\n}\n\n#[derive(Serialize)]\npub struct ExplorerLinksMessage {\n    title: String,\n    links: String,\n}\n\nimpl ExplorerLinksMessage {\n    pub fn new<T>(response: &T, provider: Box<dyn LinkProvider>) -> Self\n    where\n        T: OutputLink,\n    {\n        Self {\n            title: T::TITLE.to_string(),\n            links: response.format_links(provider),\n        }\n    }\n}\n\nimpl Message for ExplorerLinksMessage {\n    fn text(&self) -> String {\n        format!(\"\\nTo see {} details, visit:\\n{}\", self.title, self.links)\n    }\n\n    fn json(&self) -> Value {\n        // TODO(#3960) Fix JSON output support, currently links contain `\\n` characters\n        serde_json::to_value(self).unwrap()\n    }\n}\n\n#[derive(Debug, PartialEq, Eq, thiserror::Error)]\npub enum ExplorerError {\n    #[error(\"The chosen block explorer service is not available for Sepolia Network\")]\n    SepoliaNotSupported,\n    #[error(\"Custom network is not recognized by block explorer service\")]\n    UnrecognizedNetwork,\n    #[error(\"Block explorer service is not available for Devnet Network\")]\n    DevnetNotSupported,\n}\n\npub async fn block_explorer_link_if_allowed<T>(\n    result: &anyhow::Result<T>,\n    chain_id: Felt,\n    config: &CastConfig,\n) -> Option<ExplorerLinksMessage>\nwhere\n    T: OutputLink + Clone,\n{\n    let Ok(response) = result else {\n        return None;\n    };\n\n    let network = chain_id.try_into().ok()?;\n\n    let is_devnet = matches!(network, Network::Devnet) || detection::is_devnet_running().await;\n\n    if (!config.show_explorer_links || is_devnet) && !is_explorer_link_overridden() {\n        return None;\n    }\n\n    config\n        .block_explorer\n        .unwrap_or_default()\n        .as_provider(network)\n        .ok()\n        .map(|provider| ExplorerLinksMessage::new(response, provider))\n}\n\n#[must_use]\npub fn is_explorer_link_overridden() -> bool {\n    std::env::var(SNCAST_FORCE_SHOW_EXPLORER_LINKS_ENV).is_ok_and(|value| value == \"1\")\n}\n"
  },
  {
    "path": "crates/sncast/src/response/invoke.rs",
    "content": "use super::explorer_link::OutputLink;\nuse crate::helpers::block_explorer::LinkProvider;\nuse crate::response::cast_message::SncastCommandMessage;\nuse conversions::string::IntoPaddedHexStr;\nuse conversions::{padded_felt::PaddedFelt, serde::serialize::CairoSerialize};\nuse foundry_ui::styling;\nuse serde::{Deserialize, Serialize};\n\n#[derive(Serialize, Deserialize, CairoSerialize, Clone, Debug, PartialEq)]\npub struct InvokeResponse {\n    pub transaction_hash: PaddedFelt,\n}\n\nimpl SncastCommandMessage for InvokeResponse {\n    fn text(&self) -> String {\n        styling::OutputBuilder::new()\n            .success_message(\"Invoke completed\")\n            .blank_line()\n            .field(\n                \"Transaction Hash\",\n                &self.transaction_hash.into_padded_hex_str(),\n            )\n            .build()\n    }\n}\n\nimpl OutputLink for InvokeResponse {\n    const TITLE: &'static str = \"invocation\";\n\n    fn format_links(&self, provider: Box<dyn LinkProvider>) -> String {\n        format!(\n            \"transaction: {}\",\n            provider.transaction(self.transaction_hash)\n        )\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/response/ledger.rs",
    "content": "use crate::response::cast_message::SncastCommandMessage;\nuse foundry_ui::styling;\nuse serde::Serialize;\n\n#[derive(Debug, Serialize)]\npub struct PublicKeyResponse {\n    pub public_key: String,\n}\n\n#[derive(Debug, Serialize)]\npub struct SignatureResponse {\n    pub r: String,\n    pub s: String,\n}\n\n#[derive(Debug, Serialize)]\npub struct VersionResponse {\n    pub version: String,\n}\n\n#[derive(Debug, Serialize)]\n#[serde(untagged)]\npub enum LedgerResponse {\n    PublicKey(PublicKeyResponse),\n    Signature(SignatureResponse),\n    Version(VersionResponse),\n}\n\nimpl SncastCommandMessage for LedgerResponse {\n    fn text(&self) -> String {\n        match self {\n            LedgerResponse::PublicKey(resp) => styling::OutputBuilder::new()\n                .field(\"Public Key\", &resp.public_key)\n                .build(),\n            LedgerResponse::Signature(resp) => styling::OutputBuilder::new()\n                .text_field(\"Hash signature:\")\n                .field(\"r\", &resp.r)\n                .field(\"s\", &resp.s)\n                .build(),\n            LedgerResponse::Version(resp) => styling::OutputBuilder::new()\n                .field(\"App Version\", &resp.version)\n                .build(),\n        }\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/response/mod.rs",
    "content": "pub mod account;\npub mod balance;\npub mod call;\npub mod cast_message;\npub mod class_hash_at;\npub mod completions;\npub mod declare;\npub mod deploy;\npub mod errors;\npub mod explorer_link;\npub mod invoke;\npub mod ledger;\npub mod multicall;\npub mod nonce;\npub mod script;\npub mod show_config;\npub mod transaction;\npub mod transformed_call;\npub mod tx_status;\npub mod ui;\npub mod utils;\npub mod verify;\n"
  },
  {
    "path": "crates/sncast/src/response/multicall/mod.rs",
    "content": "pub mod new;\npub mod run;\n"
  },
  {
    "path": "crates/sncast/src/response/multicall/new.rs",
    "content": "use crate::response::cast_message::SncastCommandMessage;\nuse camino::Utf8PathBuf;\nuse foundry_ui::styling;\nuse serde::Serialize;\n\n#[derive(Serialize, Clone)]\npub struct MulticallNewResponse {\n    pub path: Utf8PathBuf,\n    pub content: String,\n}\n\nimpl SncastCommandMessage for MulticallNewResponse {\n    fn text(&self) -> String {\n        styling::OutputBuilder::new()\n            .success_message(\"Multicall template created successfully\")\n            .blank_line()\n            .field(\"Path\", self.path.as_ref())\n            .field(\"Content\", self.content.as_ref())\n            .build()\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/response/multicall/run.rs",
    "content": "use crate::response::cast_message::SncastCommandMessage;\nuse crate::{\n    helpers::block_explorer::LinkProvider,\n    response::{explorer_link::OutputLink, invoke::InvokeResponse},\n};\nuse conversions::string::IntoHexStr;\nuse conversions::{padded_felt::PaddedFelt, serde::serialize::CairoSerialize};\nuse foundry_ui::styling;\nuse serde::{Deserialize, Serialize};\n\n#[derive(Serialize, Deserialize, CairoSerialize, Clone, Debug, PartialEq)]\npub struct MulticallRunResponse {\n    pub transaction_hash: PaddedFelt,\n}\n\nimpl SncastCommandMessage for MulticallRunResponse {\n    fn text(&self) -> String {\n        styling::OutputBuilder::new()\n            .success_message(\"Multicall completed\")\n            .blank_line()\n            .field(\"Transaction Hash\", &self.transaction_hash.into_hex_string())\n            .build()\n    }\n}\n\nimpl From<InvokeResponse> for MulticallRunResponse {\n    fn from(value: InvokeResponse) -> Self {\n        Self {\n            transaction_hash: value.transaction_hash,\n        }\n    }\n}\n\nimpl OutputLink for MulticallRunResponse {\n    const TITLE: &'static str = \"invocation\";\n\n    fn format_links(&self, provider: Box<dyn LinkProvider>) -> String {\n        format!(\n            \"transaction: {}\",\n            provider.transaction(self.transaction_hash)\n        )\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/response/nonce.rs",
    "content": "use crate::response::cast_message::SncastCommandMessage;\nuse conversions::serde::serialize::CairoSerialize;\nuse conversions::string::IntoHexStr;\nuse foundry_ui::styling;\nuse serde::Serialize;\nuse starknet_types_core::felt::Felt;\n\n#[derive(Serialize, CairoSerialize, Clone)]\npub struct NonceResponse {\n    pub nonce: Felt,\n}\n\nimpl SncastCommandMessage for NonceResponse {\n    fn text(&self) -> String {\n        styling::OutputBuilder::new()\n            .success_message(\"Nonce retrieved\")\n            .blank_line()\n            .field(\"Nonce\", &self.nonce.into_hex_string())\n            .build()\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/response/script/init.rs",
    "content": "use crate::response::cast_message::SncastCommandMessage;\nuse foundry_ui::styling;\nuse serde::Serialize;\n\n#[derive(Serialize, Clone)]\npub struct ScriptInitResponse {\n    pub message: String,\n}\n\nimpl SncastCommandMessage for ScriptInitResponse {\n    fn text(&self) -> String {\n        styling::OutputBuilder::new()\n            .success_message(\"Script initialization completed\")\n            .blank_line()\n            .text_field(&self.message)\n            .build()\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/response/script/mod.rs",
    "content": "pub mod init;\npub mod run;\n"
  },
  {
    "path": "crates/sncast/src/response/script/run.rs",
    "content": "use crate::response::cast_message::SncastCommandMessage;\nuse foundry_ui::styling;\nuse serde::Serialize;\n\n#[derive(Serialize, Debug, Clone)]\npub struct ScriptRunResponse {\n    pub status: String,\n    pub message: Option<String>,\n}\n\nimpl SncastCommandMessage for ScriptRunResponse {\n    fn text(&self) -> String {\n        let mut builder = styling::OutputBuilder::new()\n            .success_message(\"Script execution completed\")\n            .blank_line()\n            .field(\"Status\", &self.status);\n\n        if let Some(message) = &self.message {\n            builder = builder.blank_line().text_field(message);\n        }\n\n        builder.build()\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/response/show_config.rs",
    "content": "use crate::Network;\nuse crate::helpers::block_explorer;\nuse crate::response::cast_message::SncastCommandMessage;\nuse camino::Utf8PathBuf;\nuse foundry_ui::styling;\nuse serde::Serialize;\nuse url::Url;\n\n#[derive(Serialize, Clone)]\npub struct ShowConfigResponse {\n    pub profile: Option<String>,\n    pub chain_id: Option<String>,\n    pub rpc_url: Option<Url>,\n    pub network: Option<Network>,\n    pub account: Option<String>,\n    pub accounts_file_path: Option<Utf8PathBuf>,\n    pub keystore: Option<Utf8PathBuf>,\n    pub wait_timeout: Option<u64>,\n    pub wait_retry_interval: Option<u64>,\n    pub show_explorer_links: bool,\n    pub block_explorer: Option<block_explorer::Service>,\n}\n\nimpl SncastCommandMessage for ShowConfigResponse {\n    fn text(&self) -> String {\n        let builder = styling::OutputBuilder::new()\n            .if_some(self.profile.as_ref(), |b, profile| {\n                b.field(\"Profile\", profile)\n            })\n            .if_some(self.chain_id.as_ref(), |b, chain_id| {\n                b.field(\"Chain ID\", chain_id)\n            })\n            .if_some(self.rpc_url.as_ref(), |b, rpc_url| {\n                b.field(\"RPC URL\", rpc_url.as_ref())\n            })\n            .if_some(self.network.as_ref(), |b, network| {\n                b.field(\"Network\", network.to_string().as_ref())\n            })\n            .if_some(self.account.as_ref(), |b, account| {\n                b.field(\"Account\", account)\n            })\n            .if_some(self.accounts_file_path.as_ref(), |b, path| {\n                b.field(\"Accounts File Path\", path.as_ref())\n            })\n            .if_some(self.keystore.as_ref(), |b, keystore| {\n                b.field(\"Keystore\", keystore.as_ref())\n            })\n            .if_some(self.wait_timeout.as_ref(), |b, timeout| {\n                b.field(\"Wait Timeout\", format!(\"{}s\", &timeout).as_ref())\n            })\n            .if_some(self.wait_retry_interval.as_ref(), |b, interval| {\n                b.field(\"Wait Retry Interval\", format!(\"{}s\", &interval).as_ref())\n            })\n            .field(\"Show Explorer Links\", &self.show_explorer_links.to_string())\n            .if_some(self.block_explorer.as_ref(), |b, explorer| {\n                b.field(\"Block Explorer\", &format!(\"{explorer:?}\"))\n            });\n\n        builder.build()\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/response/transaction.rs",
    "content": "use crate::helpers::block_explorer::LinkProvider;\nuse crate::response::cast_message::SncastCommandMessage;\nuse crate::response::explorer_link::OutputLink;\nuse conversions::padded_felt::PaddedFelt;\nuse conversions::string::IntoDecStr;\nuse foundry_ui::styling::OutputBuilder;\nuse serde::{Serialize, Serializer};\nuse starknet_rust::core::types::{\n    DataAvailabilityMode, DeclareTransaction, DeployAccountTransaction, InvokeTransaction,\n    ResourceBoundsMapping, Transaction,\n};\nuse starknet_types_core::felt::Felt;\n\n#[derive(Clone)]\npub struct TransactionResponse(pub Transaction);\n\nimpl SncastCommandMessage for TransactionResponse {\n    fn text(&self) -> String {\n        match &self.0 {\n            Transaction::Invoke(tx) => match tx {\n                InvokeTransaction::V0(tx) => build_invoke_v0_response(tx),\n                InvokeTransaction::V1(tx) => build_invoke_v1_response(tx),\n                InvokeTransaction::V3(tx) => build_invoke_v3_response(tx),\n            },\n            Transaction::Declare(tx) => match tx {\n                DeclareTransaction::V0(tx) => build_declare_v0_response(tx),\n                DeclareTransaction::V1(tx) => build_declare_v1_response(tx),\n                DeclareTransaction::V2(tx) => build_declare_v2_response(tx),\n                DeclareTransaction::V3(tx) => build_declare_v3_response(tx),\n            },\n            Transaction::Deploy(tx) => build_deploy_response(tx),\n            Transaction::DeployAccount(tx) => match tx {\n                DeployAccountTransaction::V1(tx) => build_deploy_account_v1_response(tx),\n                DeployAccountTransaction::V3(tx) => build_deploy_account_v3_response(tx),\n            },\n            Transaction::L1Handler(tx) => build_l1_handler_response(tx),\n        }\n    }\n}\n\nimpl OutputLink for TransactionResponse {\n    const TITLE: &'static str = \"transaction\";\n\n    fn format_links(&self, provider: Box<dyn LinkProvider>) -> String {\n        let hash = PaddedFelt(*self.0.transaction_hash());\n        format!(\"transaction: {}\", provider.transaction(hash))\n    }\n}\n\nimpl Serialize for TransactionResponse {\n    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>\n    where\n        S: Serializer,\n    {\n        #[derive(Serialize)]\n        struct Wrapper<'a> {\n            transaction_type: &'static str,\n            transaction: &'a Transaction,\n        }\n\n        Wrapper {\n            transaction_type: json_transaction_type(&self.0),\n            transaction: &self.0,\n        }\n        .serialize(serializer)\n    }\n}\n\nfn json_transaction_type(tx: &Transaction) -> &'static str {\n    match tx {\n        Transaction::Invoke(InvokeTransaction::V0(_)) => \"INVOKE_V0\",\n        Transaction::Invoke(InvokeTransaction::V1(_)) => \"INVOKE_V1\",\n        Transaction::Invoke(InvokeTransaction::V3(_)) => \"INVOKE_V3\",\n        Transaction::Declare(DeclareTransaction::V0(_)) => \"DECLARE_V0\",\n        Transaction::Declare(DeclareTransaction::V1(_)) => \"DECLARE_V1\",\n        Transaction::Declare(DeclareTransaction::V2(_)) => \"DECLARE_V2\",\n        Transaction::Declare(DeclareTransaction::V3(_)) => \"DECLARE_V3\",\n        Transaction::Deploy(_) => \"DEPLOY\",\n        Transaction::DeployAccount(DeployAccountTransaction::V1(_)) => \"DEPLOY_ACCOUNT_V1\",\n        Transaction::DeployAccount(DeployAccountTransaction::V3(_)) => \"DEPLOY_ACCOUNT_V3\",\n        Transaction::L1Handler(_) => \"L1_HANDLER\",\n    }\n}\n\ntrait TransactionOutputBuilder {\n    fn tx_header(self) -> Self;\n    fn tx_type(self, tx_type: &str) -> Self;\n    fn tx_version(self, version: &str) -> Self;\n    fn tx_hash(self, hash: &Felt) -> Self;\n    fn sender_address(self, addr: &Felt) -> Self;\n    fn contract_address(self, addr: &Felt) -> Self;\n    fn entry_point_selector(self, sel: &Felt) -> Self;\n    fn class_hash(self, hash: &Felt) -> Self;\n    fn compiled_class_hash(self, hash: &Felt) -> Self;\n    fn contract_address_salt(self, salt: &Felt) -> Self;\n    fn nonce(self, nonce: &Felt) -> Self;\n    fn calldata(self, calldata: &[Felt]) -> Self;\n    fn signature(self, sig: &[Felt]) -> Self;\n    fn paymaster_data(self, data: &[Felt]) -> Self;\n    fn account_deployment_data(self, data: &[Felt]) -> Self;\n    fn constructor_calldata(self, data: &[Felt]) -> Self;\n    fn resource_bounds(self, rb: &ResourceBoundsMapping) -> Self;\n    fn max_fee(self, fee: &Felt) -> Self;\n    fn tip(self, tip: u64) -> Self;\n    fn nonce_da_mode(self, mode: DataAvailabilityMode) -> Self;\n    fn fee_da_mode(self, mode: DataAvailabilityMode) -> Self;\n    fn proof_facts(self, proof_facts: Option<&[Felt]>) -> Self;\n}\n\nimpl TransactionOutputBuilder for OutputBuilder {\n    fn tx_header(self) -> Self {\n        self.success_message(\"Transaction found\").blank_line()\n    }\n    fn tx_type(self, tx_type: &str) -> Self {\n        self.field(\"Type\", tx_type)\n    }\n    fn tx_version(self, version: &str) -> Self {\n        self.field(\"Version\", version)\n    }\n    fn tx_hash(self, hash: &Felt) -> Self {\n        self.padded_felt_field(\"Transaction Hash\", hash)\n    }\n\n    fn sender_address(self, addr: &Felt) -> Self {\n        self.padded_felt_field(\"Sender Address\", addr)\n    }\n\n    fn contract_address(self, addr: &Felt) -> Self {\n        self.padded_felt_field(\"Contract Address\", addr)\n    }\n\n    fn entry_point_selector(self, sel: &Felt) -> Self {\n        self.padded_felt_field(\"Entry Point Selector\", sel)\n    }\n\n    fn class_hash(self, hash: &Felt) -> Self {\n        self.padded_felt_field(\"Class Hash\", hash)\n    }\n\n    fn compiled_class_hash(self, hash: &Felt) -> Self {\n        self.padded_felt_field(\"Compiled Class Hash\", hash)\n    }\n\n    fn contract_address_salt(self, salt: &Felt) -> Self {\n        self.padded_felt_field(\"Contract Address Salt\", salt)\n    }\n\n    fn nonce(self, nonce: &Felt) -> Self {\n        self.field(\"Nonce\", &nonce.into_dec_string())\n    }\n\n    fn calldata(self, calldata: &[Felt]) -> Self {\n        self.felt_list_field(\"Calldata\", calldata)\n    }\n\n    fn signature(self, sig: &[Felt]) -> Self {\n        self.felt_list_field(\"Signature\", sig)\n    }\n\n    fn paymaster_data(self, data: &[Felt]) -> Self {\n        self.felt_list_field(\"Paymaster Data\", data)\n    }\n\n    fn account_deployment_data(self, data: &[Felt]) -> Self {\n        self.felt_list_field(\"Account Deployment Data\", data)\n    }\n\n    fn constructor_calldata(self, data: &[Felt]) -> Self {\n        self.felt_list_field(\"Constructor Calldata\", data)\n    }\n\n    fn resource_bounds(self, rb: &ResourceBoundsMapping) -> Self {\n        self.field(\n            \"Resource Bounds L1 Gas\",\n            &format!(\n                \"max_amount={}, max_price_per_unit={}\",\n                rb.l1_gas.max_amount, rb.l1_gas.max_price_per_unit\n            ),\n        )\n        .field(\n            \"Resource Bounds L1 Data Gas\",\n            &format!(\n                \"max_amount={}, max_price_per_unit={}\",\n                rb.l1_data_gas.max_amount, rb.l1_data_gas.max_price_per_unit\n            ),\n        )\n        .field(\n            \"Resource Bounds L2 Gas\",\n            &format!(\n                \"max_amount={}, max_price_per_unit={}\",\n                rb.l2_gas.max_amount, rb.l2_gas.max_price_per_unit\n            ),\n        )\n    }\n\n    fn max_fee(self, fee: &Felt) -> Self {\n        self.felt_field(\"Max Fee\", fee)\n    }\n\n    fn tip(self, tip: u64) -> Self {\n        self.field(\"Tip\", &tip.to_string())\n    }\n\n    fn nonce_da_mode(self, mode: DataAvailabilityMode) -> Self {\n        self.field(\"Nonce DA Mode\", fmt_da(mode))\n    }\n\n    fn fee_da_mode(self, mode: DataAvailabilityMode) -> Self {\n        self.field(\"Fee DA Mode\", fmt_da(mode))\n    }\n\n    fn proof_facts(self, proof_facts: Option<&[Felt]>) -> Self {\n        if let Some(proof_facts) = proof_facts {\n            self.felt_list_field(\"Proof Facts\", proof_facts)\n        } else {\n            self\n        }\n    }\n}\n\nfn build_invoke_v0_response(tx: &starknet_rust::core::types::InvokeTransactionV0) -> String {\n    let starknet_rust::core::types::InvokeTransactionV0 {\n        transaction_hash,\n        max_fee,\n        signature,\n        contract_address,\n        entry_point_selector,\n        calldata,\n    } = tx;\n    OutputBuilder::new()\n        .tx_header()\n        .tx_type(\"INVOKE\")\n        .tx_version(\"0\")\n        .tx_hash(transaction_hash)\n        .contract_address(contract_address)\n        .entry_point_selector(entry_point_selector)\n        .calldata(calldata)\n        .max_fee(max_fee)\n        .signature(signature)\n        .build()\n}\n\nfn build_invoke_v1_response(tx: &starknet_rust::core::types::InvokeTransactionV1) -> String {\n    let starknet_rust::core::types::InvokeTransactionV1 {\n        transaction_hash,\n        sender_address,\n        calldata,\n        max_fee,\n        signature,\n        nonce,\n    } = tx;\n    OutputBuilder::new()\n        .tx_header()\n        .tx_type(\"INVOKE\")\n        .tx_version(\"1\")\n        .tx_hash(transaction_hash)\n        .sender_address(sender_address)\n        .nonce(nonce)\n        .calldata(calldata)\n        .max_fee(max_fee)\n        .signature(signature)\n        .build()\n}\n\nfn build_invoke_v3_response(tx: &starknet_rust::core::types::InvokeTransactionV3) -> String {\n    let starknet_rust::core::types::InvokeTransactionV3 {\n        transaction_hash,\n        sender_address,\n        calldata,\n        signature,\n        nonce,\n        resource_bounds,\n        tip,\n        paymaster_data,\n        account_deployment_data,\n        nonce_data_availability_mode,\n        fee_data_availability_mode,\n        proof_facts,\n    } = tx;\n    OutputBuilder::new()\n        .tx_header()\n        .tx_type(\"INVOKE\")\n        .tx_version(\"3\")\n        .tx_hash(transaction_hash)\n        .sender_address(sender_address)\n        .nonce(nonce)\n        .calldata(calldata)\n        .account_deployment_data(account_deployment_data)\n        .resource_bounds(resource_bounds)\n        .tip(*tip)\n        .paymaster_data(paymaster_data)\n        .nonce_da_mode(*nonce_data_availability_mode)\n        .fee_da_mode(*fee_data_availability_mode)\n        .signature(signature)\n        .proof_facts(proof_facts.as_deref())\n        .build()\n}\n\nfn build_declare_v0_response(tx: &starknet_rust::core::types::DeclareTransactionV0) -> String {\n    let starknet_rust::core::types::DeclareTransactionV0 {\n        transaction_hash,\n        sender_address,\n        max_fee,\n        signature,\n        class_hash,\n    } = tx;\n    OutputBuilder::new()\n        .tx_header()\n        .tx_type(\"DECLARE\")\n        .tx_version(\"0\")\n        .tx_hash(transaction_hash)\n        .sender_address(sender_address)\n        .class_hash(class_hash)\n        .max_fee(max_fee)\n        .signature(signature)\n        .build()\n}\n\nfn build_declare_v1_response(tx: &starknet_rust::core::types::DeclareTransactionV1) -> String {\n    let starknet_rust::core::types::DeclareTransactionV1 {\n        transaction_hash,\n        sender_address,\n        max_fee,\n        signature,\n        nonce,\n        class_hash,\n    } = tx;\n    OutputBuilder::new()\n        .tx_header()\n        .tx_type(\"DECLARE\")\n        .tx_version(\"1\")\n        .tx_hash(transaction_hash)\n        .sender_address(sender_address)\n        .nonce(nonce)\n        .class_hash(class_hash)\n        .max_fee(max_fee)\n        .signature(signature)\n        .build()\n}\n\nfn build_declare_v2_response(tx: &starknet_rust::core::types::DeclareTransactionV2) -> String {\n    let starknet_rust::core::types::DeclareTransactionV2 {\n        transaction_hash,\n        sender_address,\n        compiled_class_hash,\n        max_fee,\n        signature,\n        nonce,\n        class_hash,\n    } = tx;\n    OutputBuilder::new()\n        .tx_header()\n        .tx_type(\"DECLARE\")\n        .tx_version(\"2\")\n        .tx_hash(transaction_hash)\n        .sender_address(sender_address)\n        .nonce(nonce)\n        .class_hash(class_hash)\n        .compiled_class_hash(compiled_class_hash)\n        .max_fee(max_fee)\n        .signature(signature)\n        .build()\n}\n\nfn build_declare_v3_response(tx: &starknet_rust::core::types::DeclareTransactionV3) -> String {\n    let starknet_rust::core::types::DeclareTransactionV3 {\n        transaction_hash,\n        sender_address,\n        compiled_class_hash,\n        signature,\n        nonce,\n        class_hash,\n        resource_bounds,\n        tip,\n        paymaster_data,\n        account_deployment_data,\n        nonce_data_availability_mode,\n        fee_data_availability_mode,\n    } = tx;\n    OutputBuilder::new()\n        .tx_header()\n        .tx_type(\"DECLARE\")\n        .tx_version(\"3\")\n        .tx_hash(transaction_hash)\n        .sender_address(sender_address)\n        .nonce(nonce)\n        .class_hash(class_hash)\n        .compiled_class_hash(compiled_class_hash)\n        .account_deployment_data(account_deployment_data)\n        .resource_bounds(resource_bounds)\n        .tip(*tip)\n        .paymaster_data(paymaster_data)\n        .nonce_da_mode(*nonce_data_availability_mode)\n        .fee_da_mode(*fee_data_availability_mode)\n        .signature(signature)\n        .build()\n}\n\nfn build_deploy_response(tx: &starknet_rust::core::types::DeployTransaction) -> String {\n    let starknet_rust::core::types::DeployTransaction {\n        transaction_hash,\n        version,\n        contract_address_salt,\n        constructor_calldata,\n        class_hash,\n    } = tx;\n    OutputBuilder::new()\n        .tx_header()\n        .tx_type(\"DEPLOY\")\n        .tx_version(&version.to_string())\n        .tx_hash(transaction_hash)\n        .class_hash(class_hash)\n        .contract_address_salt(contract_address_salt)\n        .constructor_calldata(constructor_calldata)\n        .build()\n}\n\nfn build_deploy_account_v1_response(\n    tx: &starknet_rust::core::types::DeployAccountTransactionV1,\n) -> String {\n    let starknet_rust::core::types::DeployAccountTransactionV1 {\n        transaction_hash,\n        max_fee,\n        signature,\n        nonce,\n        contract_address_salt,\n        constructor_calldata,\n        class_hash,\n    } = tx;\n    OutputBuilder::new()\n        .tx_header()\n        .tx_type(\"DEPLOY ACCOUNT\")\n        .tx_version(\"1\")\n        .tx_hash(transaction_hash)\n        .nonce(nonce)\n        .class_hash(class_hash)\n        .contract_address_salt(contract_address_salt)\n        .constructor_calldata(constructor_calldata)\n        .max_fee(max_fee)\n        .signature(signature)\n        .build()\n}\n\nfn build_deploy_account_v3_response(\n    tx: &starknet_rust::core::types::DeployAccountTransactionV3,\n) -> String {\n    let starknet_rust::core::types::DeployAccountTransactionV3 {\n        transaction_hash,\n        signature,\n        nonce,\n        contract_address_salt,\n        constructor_calldata,\n        class_hash,\n        resource_bounds,\n        tip,\n        paymaster_data,\n        nonce_data_availability_mode,\n        fee_data_availability_mode,\n    } = tx;\n    OutputBuilder::new()\n        .tx_header()\n        .tx_type(\"DEPLOY ACCOUNT\")\n        .tx_version(\"3\")\n        .tx_hash(transaction_hash)\n        .nonce(nonce)\n        .class_hash(class_hash)\n        .contract_address_salt(contract_address_salt)\n        .constructor_calldata(constructor_calldata)\n        .resource_bounds(resource_bounds)\n        .tip(*tip)\n        .paymaster_data(paymaster_data)\n        .nonce_da_mode(*nonce_data_availability_mode)\n        .fee_da_mode(*fee_data_availability_mode)\n        .signature(signature)\n        .build()\n}\n\nfn build_l1_handler_response(tx: &starknet_rust::core::types::L1HandlerTransaction) -> String {\n    let starknet_rust::core::types::L1HandlerTransaction {\n        transaction_hash,\n        version,\n        nonce,\n        contract_address,\n        entry_point_selector,\n        calldata,\n    } = tx;\n    OutputBuilder::new()\n        .tx_header()\n        .tx_type(\"L1 HANDLER\")\n        .tx_version(&version.to_string())\n        .tx_hash(transaction_hash)\n        .contract_address(contract_address)\n        .nonce(&Felt::from(*nonce))\n        .entry_point_selector(entry_point_selector)\n        .calldata(calldata)\n        .build()\n}\n\nfn fmt_da(mode: DataAvailabilityMode) -> &'static str {\n    match mode {\n        DataAvailabilityMode::L1 => \"L1\",\n        DataAvailabilityMode::L2 => \"L2\",\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/response/transformed_call.rs",
    "content": "use crate::response::call::CallResponse;\nuse crate::response::cast_message::SncastCommandMessage;\nuse anyhow::Result;\nuse conversions::string::IntoHexStr;\nuse data_transformer::reverse_transform_output;\nuse foundry_ui::styling;\nuse serde::Serialize;\nuse starknet_rust::core::types::{ContractClass, contract::AbiEntry};\nuse starknet_types_core::felt::Felt;\n\n#[derive(Serialize, Clone)]\npub struct TransformedCallResponse {\n    pub response: String,\n    pub response_raw: Vec<Felt>,\n}\n\nimpl SncastCommandMessage for TransformedCallResponse {\n    fn text(&self) -> String {\n        let response_raw_values = self\n            .response_raw\n            .iter()\n            .map(|felt| felt.into_hex_string())\n            .collect::<Vec<_>>()\n            .join(\", \");\n\n        styling::OutputBuilder::new()\n            .success_message(\"Call completed\")\n            .blank_line()\n            .field(\"Response\", &self.response)\n            .field(\"Response Raw\", &format!(\"[{response_raw_values}]\"))\n            .build()\n    }\n}\n\n#[must_use]\npub fn transform_response(\n    result: &Result<CallResponse>,\n    contract_class: &ContractClass,\n    selector: &Felt,\n) -> Option<TransformedCallResponse> {\n    let Ok(CallResponse { response, .. }) = result else {\n        return None;\n    };\n\n    if response.is_empty() {\n        return None;\n    }\n\n    let ContractClass::Sierra(sierra_class) = contract_class else {\n        return None;\n    };\n\n    let abi: Vec<AbiEntry> = serde_json::from_str(sierra_class.abi.as_str()).ok()?;\n\n    let transformed_response = reverse_transform_output(response, &abi, selector).ok()?;\n\n    Some(TransformedCallResponse {\n        response_raw: response.clone(),\n        response: transformed_response,\n    })\n}\n"
  },
  {
    "path": "crates/sncast/src/response/tx_status.rs",
    "content": "use crate::response::cast_message::SncastCommandMessage;\nuse conversions::serde::serialize::CairoSerialize;\nuse foundry_ui::styling;\nuse serde::Serialize;\n\n#[derive(Serialize, CairoSerialize, Clone)]\npub enum FinalityStatus {\n    Received,\n    Candidate,\n    PreConfirmed,\n    AcceptedOnL2,\n    AcceptedOnL1,\n}\n\n#[derive(Serialize, CairoSerialize, Clone)]\npub enum ExecutionStatus {\n    Succeeded,\n    Reverted,\n}\n\n#[derive(Serialize, CairoSerialize, Clone)]\npub struct TransactionStatusResponse {\n    pub finality_status: FinalityStatus,\n    pub execution_status: Option<ExecutionStatus>,\n}\n\nimpl SncastCommandMessage for TransactionStatusResponse {\n    fn text(&self) -> String {\n        let finality_status = match &self.finality_status {\n            FinalityStatus::Received => \"Received\",\n            FinalityStatus::Candidate => \"Candidate\",\n            FinalityStatus::PreConfirmed => \"Pre confirmed\",\n            FinalityStatus::AcceptedOnL2 => \"Accepted on L2\",\n            FinalityStatus::AcceptedOnL1 => \"Accepted on L1\",\n        };\n\n        let mut builder = styling::OutputBuilder::new()\n            .success_message(\"Transaction status retrieved\")\n            .blank_line()\n            .field(\"Finality Status\", finality_status);\n\n        if let Some(execution_status) = &self.execution_status {\n            let execution_str = match execution_status {\n                ExecutionStatus::Succeeded => \"Succeeded\",\n                ExecutionStatus::Reverted => \"Reverted\",\n            };\n            builder = builder.field(\"Execution Status\", execution_str);\n        }\n\n        builder.build()\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/response/ui.rs",
    "content": "use foundry_ui::{Message, OutputFormat, UI as BaseUI};\nuse serde::Serialize;\nuse serde_json::Value;\n\n#[derive(Default)]\npub struct UI {\n    ui: BaseUI,\n}\n\nstruct MessageWrapper<T: Message> {\n    command: String,\n    message: T,\n}\nstruct ErrorWrapper<T: Message> {\n    command: String,\n    error: T,\n}\nstruct NotificationWrapper<T: Message> {\n    notification: T,\n}\nstruct WarningWrapper<T: Message> {\n    warning: T,\n}\n\n#[derive(Serialize)]\nstruct OutputWithCommand<'a, T> {\n    r#type: String,\n    command: String,\n    #[serde(flatten)]\n    data: &'a T,\n}\n\n#[derive(Serialize)]\nstruct Output<'a, T> {\n    r#type: String,\n    #[serde(flatten)]\n    data: &'a T,\n}\n\nimpl<T> Message for MessageWrapper<T>\nwhere\n    T: Message,\n{\n    fn text(&self) -> String {\n        self.message.text()\n    }\n\n    fn json(&self) -> Value {\n        let data = self.message.json();\n\n        serde_json::to_value(OutputWithCommand {\n            r#type: \"response\".to_string(),\n            command: self.command.clone(),\n            data: &data,\n        })\n        .expect(\"Failed to serialize message\")\n    }\n}\n\nimpl<T> Message for ErrorWrapper<T>\nwhere\n    T: Message,\n{\n    fn text(&self) -> String {\n        self.error.text()\n    }\n\n    fn json(&self) -> Value {\n        let data = self.error.json();\n\n        serde_json::to_value(OutputWithCommand {\n            r#type: \"error\".to_string(),\n            command: self.command.clone(),\n            data: &data,\n        })\n        .expect(\"Failed to serialize message\")\n    }\n}\n\nimpl<T> Message for WarningWrapper<T>\nwhere\n    T: Message,\n{\n    fn text(&self) -> String {\n        self.warning.text()\n    }\n\n    fn json(&self) -> Value {\n        let data = self.warning.json();\n\n        serde_json::to_value(Output {\n            r#type: \"warning\".to_string(),\n            data: &data,\n        })\n        .expect(\"Failed to serialize message\")\n    }\n}\n\nimpl<T> Message for NotificationWrapper<T>\nwhere\n    T: Message,\n{\n    fn text(&self) -> String {\n        self.notification.text()\n    }\n\n    fn json(&self) -> Value {\n        let data = self.notification.json();\n\n        serde_json::to_value(Output {\n            r#type: \"notification\".to_string(),\n            data: &data,\n        })\n        .expect(\"Failed to serialize message\")\n    }\n}\n\nimpl UI {\n    #[must_use]\n    pub fn new(output_format: OutputFormat) -> Self {\n        let base_ui = BaseUI::new(output_format);\n        Self { ui: base_ui }\n    }\n\n    fn should_skip_empty_json(&self, json: &Value) -> bool {\n        self.ui.output_format() == OutputFormat::Json && *json == Value::Null\n    }\n\n    pub fn print_message<T>(&self, command: &str, message: T)\n    where\n        T: Message,\n    {\n        // TODO(#3960) Add better handling for no JSON output\n        if self.should_skip_empty_json(&message.json()) {\n            return;\n        }\n\n        let internal_message = MessageWrapper {\n            command: command.to_string(),\n            message,\n        };\n        self.ui.println(&internal_message);\n    }\n\n    pub fn print_error<T>(&self, command: &str, message: T)\n    where\n        T: Message,\n    {\n        // TODO(#3960) Add better handling for no JSON output\n        if self.should_skip_empty_json(&message.json()) {\n            return;\n        }\n\n        let internal_message = ErrorWrapper {\n            command: command.to_string(),\n            error: message,\n        };\n        self.ui.eprintln(&internal_message);\n    }\n\n    pub fn print_notification<T>(&self, message: T)\n    where\n        T: Message,\n    {\n        // TODO(#3960) Add better handling for no JSON output\n        if self.should_skip_empty_json(&message.json()) {\n            return;\n        }\n\n        let internal_message = NotificationWrapper {\n            notification: message,\n        };\n        self.ui.println(&internal_message);\n    }\n\n    pub fn print_warning<T>(&self, message: T)\n    where\n        T: Message,\n    {\n        // TODO(#3960) Add better handling for no JSON output\n        if self.should_skip_empty_json(&message.json()) {\n            return;\n        }\n\n        let internal_message = WarningWrapper { warning: message };\n        self.ui.println(&internal_message);\n    }\n\n    pub fn print_blank_line(&self) {\n        self.ui.print_blank_line();\n    }\n\n    #[must_use]\n    pub fn base_ui(&self) -> &BaseUI {\n        &self.ui\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/response/utils/class_hash.rs",
    "content": "use crate::response::cast_message::SncastCommandMessage;\nuse conversions::padded_felt::PaddedFelt;\nuse conversions::{serde::serialize::CairoSerialize, string::IntoPaddedHexStr};\nuse foundry_ui::styling;\nuse serde::{Deserialize, Serialize};\n\n#[derive(Clone, Serialize, Deserialize, CairoSerialize, Debug, PartialEq)]\npub struct ClassHashResponse {\n    pub class_hash: PaddedFelt,\n}\n\nimpl SncastCommandMessage for ClassHashResponse {\n    fn text(&self) -> String {\n        styling::OutputBuilder::new()\n            .field(\"Class Hash\", &self.class_hash.into_padded_hex_str())\n            .build()\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/response/utils/mod.rs",
    "content": "pub mod class_hash;\npub mod selector;\npub mod serialize;\n"
  },
  {
    "path": "crates/sncast/src/response/utils/selector.rs",
    "content": "use crate::response::cast_message::SncastCommandMessage;\nuse conversions::padded_felt::PaddedFelt;\nuse conversions::string::IntoPaddedHexStr;\nuse foundry_ui::styling;\nuse serde::{Deserialize, Serialize};\n\n#[derive(Clone, Serialize, Deserialize, Debug, PartialEq)]\npub struct SelectorResponse {\n    pub selector: PaddedFelt,\n}\n\nimpl SncastCommandMessage for SelectorResponse {\n    fn text(&self) -> String {\n        styling::OutputBuilder::new()\n            .field(\"Selector\", &self.selector.into_padded_hex_str())\n            .build()\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/response/utils/serialize.rs",
    "content": "use crate::response::cast_message::SncastCommandMessage;\nuse conversions::serde::serialize::CairoSerialize;\nuse foundry_ui::styling;\nuse serde::{Deserialize, Serialize};\nuse starknet_types_core::felt::Felt;\n\n#[derive(Serialize, Deserialize, CairoSerialize, Clone, Debug, PartialEq)]\npub struct SerializeResponse {\n    pub calldata: Vec<Felt>,\n}\n\nimpl SncastCommandMessage for SerializeResponse {\n    fn text(&self) -> String {\n        let calldata = format!(\"{:?}\", &self.calldata);\n\n        styling::OutputBuilder::new()\n            .field(\"Calldata\", &calldata)\n            .build()\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/response/verify.rs",
    "content": "use crate::response::cast_message::SncastCommandMessage;\nuse foundry_ui::styling;\nuse serde::Serialize;\n\n#[derive(Serialize, Clone)]\npub struct VerifyResponse {\n    pub message: String,\n}\n\nimpl SncastCommandMessage for VerifyResponse {\n    fn text(&self) -> String {\n        styling::OutputBuilder::new()\n            .success_message(\"Verification completed\")\n            .blank_line()\n            .text_field(&self.message)\n            .build()\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/account/create.rs",
    "content": "use crate::starknet_commands::account::{\n    generate_add_profile_message, prepare_account_json, write_account_to_accounts_file,\n};\nuse anyhow::{Context, Result, anyhow, bail};\nuse bigdecimal::BigDecimal;\nuse camino::Utf8PathBuf;\nuse clap::Args;\nuse console::style;\nuse conversions::IntoConv;\nuse foundry_ui::components::warning::WarningMessage;\nuse serde_json::json;\nuse sncast::helpers::braavos::BraavosAccountFactory;\nuse sncast::helpers::configuration::CastConfig;\nuse sncast::helpers::constants::{\n    BRAAVOS_BASE_ACCOUNT_CLASS_HASH, BRAAVOS_CLASS_HASH, CREATE_KEYSTORE_PASSWORD_ENV_VAR,\n    OZ_CLASS_HASH, READY_CLASS_HASH,\n};\nuse sncast::helpers::ledger;\nuse sncast::helpers::ledger::LedgerKeyLocatorAccount;\nuse sncast::helpers::rpc::{RpcArgs, generate_network_flag};\nuse sncast::response::account::create::AccountCreateResponse;\nuse sncast::response::ui::UI;\nuse sncast::{\n    AccountType, SignerSource, SignerType, check_class_hash_exists, check_if_legacy_contract,\n    extract_or_generate_salt, get_keystore_password, handle_account_factory_error,\n};\nuse starknet_rust::accounts::{\n    AccountDeploymentV3, AccountFactory, ArgentAccountFactory, OpenZeppelinAccountFactory,\n};\nuse starknet_rust::core::types::FeeEstimate;\nuse starknet_rust::providers::JsonRpcClient;\nuse starknet_rust::providers::jsonrpc::HttpTransport;\nuse starknet_rust::signers::{LocalWallet, Signer, SigningKey};\nuse starknet_types_core::felt::Felt;\nuse std::str::FromStr;\n\n#[derive(Args, Debug)]\n#[command(about = \"Create an account with all important secrets\")]\npub struct Create {\n    /// Type of the account\n    #[arg(value_enum, short = 't', long = \"type\", value_parser = AccountType::from_str, default_value_t = AccountType::OpenZeppelin)]\n    pub account_type: AccountType,\n\n    /// Account name under which account information is going to be saved\n    #[arg(short, long)]\n    pub name: Option<String>,\n\n    /// Salt for the address\n    #[arg(short, long)]\n    pub salt: Option<Felt>,\n\n    /// If passed, a profile with provided name and corresponding data will be created in snfoundry.toml\n    #[arg(long)]\n    pub add_profile: Option<String>,\n\n    /// Custom contract class hash of declared contract\n    #[arg(short, long, requires = \"account_type\")]\n    pub class_hash: Option<Felt>,\n\n    #[command(flatten)]\n    pub rpc: RpcArgs,\n\n    #[command(flatten)]\n    pub ledger_key_locator: LedgerKeyLocatorAccount,\n}\n\n#[allow(clippy::too_many_arguments, clippy::too_many_lines)]\npub async fn create(\n    account: &str,\n    accounts_file: &Utf8PathBuf,\n    provider: &JsonRpcClient<HttpTransport>,\n    chain_id: Felt,\n    create: &Create,\n    config: &CastConfig,\n    signer_source: &SignerSource,\n    ui: &UI,\n) -> Result<AccountCreateResponse> {\n    // TODO(#3556): Remove this warning once we drop Argent account type\n    if create.account_type == AccountType::Argent {\n        ui.print_warning(WarningMessage::new(\n            \"Argent has rebranded as Ready. The `argent` option for the `--type` flag in `account create` is deprecated, please use `ready` instead.\",\n        ));\n        ui.print_blank_line();\n    }\n\n    let salt = extract_or_generate_salt(create.salt);\n    let class_hash = create.class_hash.unwrap_or(match create.account_type {\n        AccountType::OpenZeppelin => OZ_CLASS_HASH,\n        AccountType::Argent | AccountType::Ready => READY_CLASS_HASH,\n        AccountType::Braavos => BRAAVOS_CLASS_HASH,\n    });\n    check_class_hash_exists(provider, class_hash).await?;\n\n    let (account_json, estimated_fee) = generate_account(\n        provider,\n        salt,\n        class_hash,\n        create.account_type,\n        signer_source,\n        chain_id,\n        ui,\n    )\n    .await?;\n\n    let address: Felt = account_json[\"address\"]\n        .as_str()\n        .context(\"Invalid address\")?\n        .parse()?;\n\n    let estimated_fee_strk = BigDecimal::new(estimated_fee.into(), 18.into());\n    let mut message = format!(\n        \"Account successfully created but it needs to be deployed. The estimated deployment fee is {} STRK. Prefund the account to cover deployment transaction fee\",\n        style(estimated_fee_strk).magenta()\n    );\n\n    match signer_source {\n        SignerSource::Keystore(keystore) => {\n            let account_path = Utf8PathBuf::from(&account);\n            if account_path == Utf8PathBuf::default() {\n                bail!(\"Argument `--account` must be passed and be a path when using `--keystore`\");\n            }\n\n            let private_key = account_json[\"private_key\"]\n                .as_str()\n                .context(\"Invalid private_key\")?\n                .parse()?;\n            let legacy = account_json[\"legacy\"]\n                .as_bool()\n                .expect(\"Invalid legacy entry\");\n\n            create_to_keystore(\n                private_key,\n                salt,\n                class_hash,\n                create.account_type,\n                keystore,\n                &account_path,\n                legacy,\n            )?;\n\n            let deploy_command =\n                generate_deploy_command_with_keystore(account, keystore, &create.rpc, config);\n            message.push_str(&deploy_command);\n        }\n        SignerSource::Ledger(_) | SignerSource::AccountsFile => {\n            write_account_to_accounts_file(account, accounts_file, chain_id, account_json.clone())?;\n            let deploy_command =\n                generate_deploy_command(accounts_file, &create.rpc, config, account);\n            message.push_str(&deploy_command);\n        }\n    }\n\n    let add_profile_message = generate_add_profile_message(\n        create.add_profile.as_ref(),\n        &create.rpc,\n        account,\n        accounts_file,\n        match signer_source {\n            SignerSource::Keystore(path) => Some(path.clone()),\n            _ => None,\n        },\n        config,\n    )?;\n\n    Ok(AccountCreateResponse {\n        address: address.into_(),\n        estimated_fee,\n        add_profile: add_profile_message,\n        message: if account_json[\"deployed\"] == json!(false) {\n            message\n        } else {\n            \"Account already deployed\".to_string()\n        },\n    })\n}\n\nasync fn generate_account(\n    provider: &JsonRpcClient<HttpTransport>,\n    salt: Felt,\n    class_hash: Felt,\n    account_type: AccountType,\n    signer_source: &SignerSource,\n    chain_id: Felt,\n    ui: &UI,\n) -> Result<(serde_json::Value, u128)> {\n    if let SignerSource::Ledger(ledger_path) = signer_source {\n        let signer = ledger::create_ledger_signer(ledger_path, ui, false).await?;\n        let signer_type = SignerType::Ledger {\n            ledger_path: ledger_path.clone(),\n        };\n\n        finalize_account_generation(\n            provider,\n            signer,\n            signer_type,\n            salt,\n            class_hash,\n            account_type,\n            chain_id,\n        )\n        .await\n    } else {\n        let private_key = SigningKey::from_random();\n        let signer = LocalWallet::from_signing_key(private_key.clone());\n        let signer_type = SignerType::Local {\n            private_key: private_key.secret_scalar(),\n        };\n\n        finalize_account_generation(\n            provider,\n            signer,\n            signer_type,\n            salt,\n            class_hash,\n            account_type,\n            chain_id,\n        )\n        .await\n    }\n}\n\n#[allow(clippy::too_many_arguments)]\nasync fn finalize_account_generation<S>(\n    provider: &JsonRpcClient<HttpTransport>,\n    signer: S,\n    signer_type: SignerType,\n    salt: Felt,\n    class_hash: Felt,\n    account_type: AccountType,\n    chain_id: Felt,\n) -> Result<(serde_json::Value, u128)>\nwhere\n    S: Signer + Send + Sync,\n    <S as Signer>::GetPublicKeyError: 'static,\n{\n    let public_key = signer.get_public_key().await?.scalar();\n\n    let (address, estimated_fee) = match account_type {\n        AccountType::OpenZeppelin => {\n            let factory =\n                OpenZeppelinAccountFactory::new(class_hash, chain_id, signer, provider).await?;\n            get_address_and_deployment_fee(factory, salt).await\n        }\n        AccountType::Argent | AccountType::Ready => {\n            let factory =\n                ArgentAccountFactory::new(class_hash, chain_id, None, signer, provider).await?;\n            get_address_and_deployment_fee(factory, salt).await\n        }\n        AccountType::Braavos => {\n            let factory = BraavosAccountFactory::new(\n                class_hash,\n                BRAAVOS_BASE_ACCOUNT_CLASS_HASH,\n                chain_id,\n                signer,\n                provider,\n            )\n            .await?;\n            get_address_and_deployment_fee(factory, salt).await\n        }\n    }?;\n\n    let legacy = check_if_legacy_contract(Some(class_hash), address, provider).await?;\n\n    let account_json = prepare_account_json(\n        &signer_type,\n        public_key,\n        address,\n        false,\n        legacy,\n        account_type,\n        Some(class_hash),\n        Some(salt),\n    );\n\n    Ok((account_json, estimated_fee.overall_fee))\n}\n\nasync fn get_address_and_deployment_fee<T>(\n    account_factory: T,\n    salt: Felt,\n) -> Result<(Felt, FeeEstimate)>\nwhere\n    T: AccountFactory + Sync,\n{\n    let deployment = account_factory.deploy_v3(salt);\n    Ok((deployment.address(), get_deployment_fee(&deployment).await?))\n}\n\nasync fn get_deployment_fee<T>(\n    account_deployment: &AccountDeploymentV3<'_, T>,\n) -> Result<FeeEstimate>\nwhere\n    T: AccountFactory + Sync,\n{\n    let fee_estimate = account_deployment.estimate_fee().await;\n\n    match fee_estimate {\n        Ok(fee_estimate) => Ok(fee_estimate),\n        Err(err) => Err(anyhow!(\n            \"Failed to estimate account deployment fee. Reason: {}\",\n            handle_account_factory_error::<T>(err)\n        )),\n    }\n}\n\nfn create_to_keystore(\n    private_key: Felt,\n    salt: Felt,\n    class_hash: Felt,\n    account_type: AccountType,\n    keystore_path: &Utf8PathBuf,\n    account_path: &Utf8PathBuf,\n    legacy: bool,\n) -> Result<()> {\n    if keystore_path.exists() {\n        bail!(\"Keystore file {keystore_path} already exists\");\n    }\n    if account_path.exists() {\n        bail!(\"Account file {account_path} already exists\");\n    }\n    let password = get_keystore_password(CREATE_KEYSTORE_PASSWORD_ENV_VAR)?;\n    let private_key = SigningKey::from_secret_scalar(private_key);\n    private_key.save_as_keystore(keystore_path, &password)?;\n    let account_json = match account_type {\n        AccountType::OpenZeppelin => {\n            json!({\n                \"version\": 1,\n                \"variant\": {\n                    \"type\": AccountType::OpenZeppelin,\n                    \"version\": 1,\n                    \"public_key\": format!(\"{:#x}\", private_key.verifying_key().scalar()),\n                    \"legacy\": legacy,\n                },\n                \"deployment\": {\n                    \"status\": \"undeployed\",\n                    \"class_hash\": format!(\"{class_hash:#x}\"),\n                    \"salt\": format!(\"{salt:#x}\"),\n                }\n            })\n        }\n        AccountType::Argent | AccountType::Ready => {\n            json!({\n                \"version\": 1,\n                \"variant\": {\n                    // TODO(#3556): Remove hardcoded \"argent\" and use format! with `AccountType::Ready`\n                    \"type\": \"argent\",\n                    \"version\": 1,\n                    \"owner\": format!(\"{:#x}\", private_key.verifying_key().scalar()),\n                    \"guardian\": \"0x0\",\n                },\n                \"deployment\": {\n                    \"status\": \"undeployed\",\n                    \"class_hash\": format!(\"{class_hash:#x}\"),\n                    \"salt\": format!(\"{salt:#x}\"),\n                }\n            })\n        }\n        AccountType::Braavos => {\n            json!(\n                {\n                  \"version\": 1,\n                  \"variant\": {\n                    \"type\": AccountType::Braavos,\n                    \"version\": 1,\n                    \"multisig\": {\n                      \"status\": \"off\"\n                    },\n                    \"signers\": [\n                      {\n                        \"type\": \"stark\",\n                        \"public_key\": format!(\"{:#x}\", private_key.verifying_key().scalar())\n                      }\n                    ]\n                  },\n                  \"deployment\": {\n                    \"status\": \"undeployed\",\n                    \"class_hash\": format!(\"{class_hash:#x}\"),\n                    \"salt\": format!(\"{salt:#x}\"),\n                    \"context\": {\n                      \"variant\": \"braavos\",\n                      \"base_account_class_hash\": BRAAVOS_BASE_ACCOUNT_CLASS_HASH\n                    }\n                  }\n                }\n            )\n        }\n    };\n\n    write_account_to_file(&account_json, account_path)\n}\n\nfn write_account_to_file(\n    account_json: &serde_json::Value,\n    account_file: &Utf8PathBuf,\n) -> Result<()> {\n    std::fs::create_dir_all(account_file.clone().parent().unwrap())?;\n    std::fs::write(\n        account_file.clone(),\n        serde_json::to_string_pretty(&account_json).unwrap(),\n    )?;\n    Ok(())\n}\n\nfn generate_deploy_command(\n    accounts_file: &Utf8PathBuf,\n    rpc_args: &RpcArgs,\n    config: &CastConfig,\n    account: &str,\n) -> String {\n    let accounts_flag = if accounts_file\n        .to_string()\n        .contains(\"starknet_accounts/starknet_open_zeppelin_accounts.json\")\n    {\n        String::new()\n    } else {\n        format!(\" --accounts-file {accounts_file}\")\n    };\n\n    let network_flag = generate_network_flag(rpc_args, config);\n\n    format!(\n        \"\\n\\nAfter prefunding the account, run:\\n\\\n        sncast{accounts_flag} account deploy {network_flag} --name {account}\"\n    )\n}\n\nfn generate_deploy_command_with_keystore(\n    account: &str,\n    keystore: &Utf8PathBuf,\n    rpc_args: &RpcArgs,\n    config: &CastConfig,\n) -> String {\n    let network_flag = generate_network_flag(rpc_args, config);\n\n    format!(\n        \"\\n\\nAfter prefunding the account, run:\\n\\\n        sncast --account {account} --keystore {keystore} account deploy {network_flag}\"\n    )\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/account/delete.rs",
    "content": "use anyhow::{Result, bail};\nuse camino::Utf8PathBuf;\nuse clap::{ArgGroup, Args};\nuse promptly::prompt;\nuse sncast::helpers::account::load_accounts;\nuse sncast::helpers::configuration::CastConfig;\nuse sncast::helpers::rpc::RpcArgs;\nuse sncast::response::account::delete::AccountDeleteResponse;\nuse sncast::response::ui::UI;\nuse sncast::{chain_id_to_network_name, get_chain_id};\n\n#[derive(Args, Debug)]\n#[command(about = \"Delete account information from the accounts file\")]\n#[command(group(ArgGroup::new(\"networks\")\n    .args(&[\"url\", \"network\", \"network_name\"])\n    .required(true)\n    .multiple(false)))]\npub struct Delete {\n    /// Name of the account to be deleted\n    #[arg(short, long)]\n    pub name: String,\n\n    /// Assume \"yes\" as answer to confirmation prompt and run non-interactively\n    #[arg(long, default_value = \"false\")]\n    pub yes: bool,\n\n    #[command(flatten)]\n    pub rpc: RpcArgs,\n\n    /// Literal name of the network used in accounts file\n    #[arg(long)]\n    pub network_name: Option<String>,\n}\n\npub fn delete(\n    name: &str,\n    path: &Utf8PathBuf,\n    network_name: &str,\n    yes: bool,\n) -> Result<AccountDeleteResponse> {\n    let mut items = load_accounts(path)?;\n\n    if items[&network_name].is_null() {\n        bail!(\"No accounts defined for network = {network_name}\");\n    }\n    if items[&network_name][&name].is_null() {\n        bail!(\"Account with name {name} does not exist\")\n    }\n\n    // Let's ask confirmation\n    if !yes {\n        let prompt_text = format!(\n            \"Do you want to remove the account {name} deployed to network {network_name} from local file {path}? (Y/n)\"\n        );\n        let input: String = prompt(prompt_text)?;\n\n        if !input.starts_with('Y') {\n            bail!(\"Delete aborted\");\n        }\n    }\n\n    // get to the nested object \"nested\"\n    let nested = items\n        .get_mut(network_name)\n        .expect(\"Failed to find network\")\n        .as_object_mut()\n        .expect(\"Failed to convert network\");\n\n    // now remove the child from there\n    nested.remove(name);\n\n    std::fs::write(path.clone(), serde_json::to_string_pretty(&items).unwrap())?;\n    let result = \"Account successfully removed\".to_string();\n    Ok(AccountDeleteResponse { result })\n}\n\npub(crate) async fn get_network_name(\n    delete: &Delete,\n    config: &CastConfig,\n    ui: &UI,\n) -> Result<String> {\n    if let Some(network_name) = &delete.network_name {\n        return Ok(network_name.clone());\n    }\n\n    let provider = delete.rpc.get_provider(config, ui).await?;\n    Ok(chain_id_to_network_name(get_chain_id(&provider).await?))\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/account/deploy.rs",
    "content": "use anyhow::{Context, Result, anyhow, bail};\nuse camino::Utf8PathBuf;\nuse clap::Args;\nuse conversions::IntoConv;\nuse serde_json::Map;\nuse sncast::helpers::account::load_accounts;\nuse sncast::helpers::braavos::BraavosAccountFactory;\nuse sncast::helpers::constants::BRAAVOS_BASE_ACCOUNT_CLASS_HASH;\nuse sncast::helpers::fee::{FeeArgs, FeeSettings};\nuse sncast::helpers::ledger;\nuse sncast::helpers::rpc::RpcArgs;\nuse sncast::response::account::deploy::AccountDeployResponse;\nuse sncast::response::invoke::InvokeResponse;\nuse sncast::response::ui::UI;\nuse sncast::{\n    AccountData, AccountType, SignerType, WaitForTx, apply_optional_fields,\n    chain_id_to_network_name, check_account_file_exists, get_account_data_from_accounts_file,\n    get_account_data_from_keystore, handle_rpc_error, handle_wait_for_tx,\n};\nuse starknet_rust::accounts::{AccountDeploymentV3, AccountFactory, OpenZeppelinAccountFactory};\nuse starknet_rust::accounts::{AccountFactoryError, ArgentAccountFactory};\nuse starknet_rust::core::types::{\n    ContractExecutionError, StarknetError::ClassHashNotFound,\n    StarknetError::TransactionExecutionError, TransactionExecutionErrorData,\n};\nuse starknet_rust::core::utils::get_contract_address;\nuse starknet_rust::providers::jsonrpc::HttpTransport;\nuse starknet_rust::providers::{JsonRpcClient, ProviderError::StarknetError};\nuse starknet_rust::signers::{LocalWallet, Signer, SigningKey};\nuse starknet_types_core::felt::Felt;\n\n#[derive(Args, Debug)]\n#[command(about = \"Deploy an account to the Starknet\")]\npub struct Deploy {\n    /// Name of the account to be deployed\n    #[arg(short, long)]\n    pub name: Option<String>,\n\n    #[command(flatten)]\n    pub fee_args: FeeArgs,\n\n    #[command(flatten)]\n    pub rpc: RpcArgs,\n\n    /// If passed, the command will not trigger an interactive prompt to add an account as a default\n    #[arg(long)]\n    pub silent: bool,\n}\n\n#[expect(clippy::too_many_arguments)]\npub async fn deploy(\n    provider: &JsonRpcClient<HttpTransport>,\n    accounts_file: &Utf8PathBuf,\n    deploy_args: &Deploy,\n    chain_id: Felt,\n    wait_config: WaitForTx,\n    account: &str,\n    keystore_path: Option<Utf8PathBuf>,\n    fee_args: FeeArgs,\n    ui: &UI,\n) -> Result<AccountDeployResponse> {\n    if let Some(keystore_path) = keystore_path {\n        deploy_from_keystore(\n            provider,\n            chain_id,\n            fee_args,\n            wait_config,\n            account,\n            keystore_path,\n            ui,\n        )\n        .await\n        .map(Into::into)\n    } else {\n        let account_name = deploy_args\n            .name\n            .clone()\n            .ok_or_else(|| anyhow!(\"Required argument `--name` not provided\"))?;\n        check_account_file_exists(accounts_file)?;\n        deploy_from_accounts_file(\n            provider,\n            accounts_file,\n            account_name,\n            chain_id,\n            fee_args,\n            wait_config,\n            ui,\n        )\n        .await\n        .map(Into::into)\n    }\n}\n\nasync fn deploy_from_keystore(\n    provider: &JsonRpcClient<HttpTransport>,\n    chain_id: Felt,\n    fee_args: FeeArgs,\n    wait_config: WaitForTx,\n    account: &str,\n    keystore_path: Utf8PathBuf,\n    ui: &UI,\n) -> Result<InvokeResponse> {\n    let account_data = get_account_data_from_keystore(account, &keystore_path)?;\n\n    let is_deployed = account_data\n        .deployed\n        .ok_or_else(|| anyhow!(\"Failed to get status key from account JSON file\"))?;\n    if is_deployed {\n        bail!(\"Account already deployed\");\n    }\n\n    let private_key_felt = account_data\n        .signer_type\n        .private_key()\n        .context(\"Private key not found in keystore account\")?;\n    let private_key = SigningKey::from_secret_scalar(private_key_felt);\n    let public_key = account_data.public_key;\n\n    if public_key != private_key.verifying_key().scalar() {\n        bail!(\"Public key and private key from keystore do not match\");\n    }\n\n    let (account_type, class_hash, salt) = extract_deployment_fields(&account_data)?;\n\n    let address = compute_account_address(salt, public_key, class_hash, account_type, chain_id);\n\n    let signer = LocalWallet::from_signing_key(private_key);\n    let result = create_factory_and_deploy(\n        provider,\n        account_type,\n        class_hash,\n        signer,\n        salt,\n        chain_id,\n        fee_args,\n        wait_config,\n        ui,\n    )\n    .await?;\n\n    update_keystore_account(account, address)?;\n\n    Ok(result)\n}\n\nasync fn deploy_from_accounts_file(\n    provider: &JsonRpcClient<HttpTransport>,\n    accounts_file: &Utf8PathBuf,\n    name: String,\n    chain_id: Felt,\n    fee_args: FeeArgs,\n    wait_config: WaitForTx,\n    ui: &UI,\n) -> Result<InvokeResponse> {\n    let account_data = get_account_data_from_accounts_file(&name, chain_id, accounts_file)?;\n    let (account_type, class_hash, salt) = extract_deployment_fields(&account_data)?;\n\n    let result = match &account_data.signer_type {\n        SignerType::Ledger { ledger_path } => {\n            let signer = ledger::create_ledger_signer(ledger_path, ui, true).await?;\n\n            ledger::verify_ledger_public_key(\n                signer.get_public_key().await?.scalar(),\n                account_data.public_key,\n            )?;\n\n            create_factory_and_deploy(\n                provider,\n                account_type,\n                class_hash,\n                signer,\n                salt,\n                chain_id,\n                fee_args,\n                wait_config,\n                ui,\n            )\n            .await?\n        }\n        SignerType::Local { private_key } => {\n            let signer =\n                LocalWallet::from_signing_key(SigningKey::from_secret_scalar(*private_key));\n\n            create_factory_and_deploy(\n                provider,\n                account_type,\n                class_hash,\n                signer,\n                salt,\n                chain_id,\n                fee_args,\n                wait_config,\n                ui,\n            )\n            .await?\n        }\n    };\n\n    update_account_in_accounts_file(accounts_file, &name, chain_id)?;\n\n    Ok(result)\n}\n\n#[expect(clippy::too_many_arguments)]\nasync fn create_factory_and_deploy<S>(\n    provider: &JsonRpcClient<HttpTransport>,\n    account_type: AccountType,\n    class_hash: Felt,\n    signer: S,\n    salt: Felt,\n    chain_id: Felt,\n    fee_args: FeeArgs,\n    wait_config: WaitForTx,\n    ui: &UI,\n) -> Result<InvokeResponse>\nwhere\n    S: Signer + Send + Sync,\n    S::GetPublicKeyError: 'static,\n    S::SignError: 'static,\n{\n    match account_type {\n        AccountType::Argent | AccountType::Ready => {\n            let factory =\n                ArgentAccountFactory::new(class_hash, chain_id, None, signer, provider).await?;\n            deploy_account(\n                factory,\n                provider,\n                salt,\n                fee_args,\n                wait_config,\n                class_hash,\n                ui,\n            )\n            .await\n        }\n        AccountType::OpenZeppelin => {\n            let factory =\n                OpenZeppelinAccountFactory::new(class_hash, chain_id, signer, provider).await?;\n            deploy_account(\n                factory,\n                provider,\n                salt,\n                fee_args,\n                wait_config,\n                class_hash,\n                ui,\n            )\n            .await\n        }\n        AccountType::Braavos => {\n            let factory = BraavosAccountFactory::new(\n                class_hash,\n                BRAAVOS_BASE_ACCOUNT_CLASS_HASH,\n                chain_id,\n                signer,\n                provider,\n            )\n            .await?;\n            deploy_account(\n                factory,\n                provider,\n                salt,\n                fee_args,\n                wait_config,\n                class_hash,\n                ui,\n            )\n            .await\n        }\n    }\n}\n\nfn extract_deployment_fields(account_data: &AccountData) -> Result<(AccountType, Felt, Felt)> {\n    let account_type = account_data\n        .account_type\n        .context(\"Failed to get account type from file\")?;\n    let class_hash = account_data\n        .class_hash\n        .context(\"Failed to get class hash from file\")?;\n    let salt = account_data.salt.context(\"Failed to get salt from file\")?;\n\n    Ok((account_type, class_hash, salt))\n}\n\nfn execution_error_message(error: &ContractExecutionError) -> &str {\n    match error {\n        ContractExecutionError::Message(msg) => msg,\n        ContractExecutionError::Nested(inner) => execution_error_message(&inner.error),\n    }\n}\n\nasync fn deploy_account<T>(\n    account_factory: T,\n    provider: &JsonRpcClient<HttpTransport>,\n    salt: Felt,\n    fee_args: FeeArgs,\n    wait_config: WaitForTx,\n    class_hash: Felt,\n    ui: &UI,\n) -> Result<InvokeResponse>\nwhere\n    T: AccountFactory + Sync,\n{\n    let deployment = account_factory.deploy_v3(salt);\n\n    let fee_settings = if fee_args.max_fee.is_some() {\n        let fee_estimate = deployment\n            .estimate_fee()\n            .await\n            .expect(\"Failed to estimate fee\");\n        fee_args.try_into_fee_settings(Some(&fee_estimate))\n    } else {\n        fee_args.try_into_fee_settings(None)\n    };\n\n    let FeeSettings {\n        l1_gas,\n        l1_gas_price,\n        l2_gas,\n        l2_gas_price,\n        l1_data_gas,\n        l1_data_gas_price,\n        tip,\n    } = fee_settings.expect(\"Failed to convert to fee settings\");\n\n    let deployment = apply_optional_fields!(\n        deployment,\n        l1_gas => AccountDeploymentV3::l1_gas,\n        l1_gas_price => AccountDeploymentV3::l1_gas_price,\n        l2_gas => AccountDeploymentV3::l2_gas,\n        l2_gas_price => AccountDeploymentV3::l2_gas_price,\n        l1_data_gas => AccountDeploymentV3::l1_data_gas,\n        l1_data_gas_price => AccountDeploymentV3::l1_data_gas_price,\n        tip => AccountDeploymentV3::tip\n    );\n    let result = deployment.send().await;\n\n    match result {\n        Err(AccountFactoryError::Provider(error)) => match error {\n            StarknetError(ClassHashNotFound) => Err(anyhow!(\n                \"Provided class hash {class_hash:#x} does not exist\",\n            )),\n            StarknetError(TransactionExecutionError(TransactionExecutionErrorData {\n                ref execution_error,\n                ..\n            })) => Err(anyhow!(execution_error_message(execution_error).to_owned())),\n            _ => Err(handle_rpc_error(error)),\n        },\n        Err(_) => Err(anyhow!(\"Unknown AccountFactoryError\")),\n        Ok(result) => {\n            let return_value = InvokeResponse {\n                transaction_hash: result.transaction_hash.into_(),\n            };\n            if let Err(message) = handle_wait_for_tx(\n                provider,\n                result.transaction_hash,\n                return_value.clone(),\n                wait_config,\n                ui,\n            )\n            .await\n            {\n                return Err(anyhow!(message));\n            }\n\n            Ok(return_value)\n        }\n    }\n}\n\nfn update_account_in_accounts_file(\n    accounts_file: &Utf8PathBuf,\n    account_name: &str,\n    chain_id: Felt,\n) -> Result<()> {\n    let network_name = chain_id_to_network_name(chain_id);\n\n    let mut items = load_accounts(accounts_file)?;\n    items[&network_name][account_name][\"deployed\"] = serde_json::Value::from(true);\n    std::fs::write(accounts_file, serde_json::to_string_pretty(&items).unwrap())\n        .context(\"Failed to write to accounts file\")?;\n\n    Ok(())\n}\n\nfn update_keystore_account(account: &str, address: Felt) -> Result<()> {\n    let account_path = Utf8PathBuf::from(account.to_string());\n    let contents =\n        std::fs::read_to_string(account_path.clone()).context(\"Failed to read account file\")?;\n    let mut items: Map<String, serde_json::Value> = serde_json::from_str(&contents)\n        .map_err(|_| anyhow!(\"Failed to parse account file at {account_path}\"))?;\n\n    items[\"deployment\"][\"status\"] = serde_json::Value::from(\"deployed\");\n    items\n        .get_mut(\"deployment\")\n        .and_then(|deployment| deployment.as_object_mut())\n        .expect(\"Failed to get deployment as an object\")\n        .retain(|key, _| key != \"salt\" && key != \"context\");\n\n    items[\"deployment\"][\"address\"] = format!(\"{address:#x}\").into();\n\n    std::fs::write(&account_path, serde_json::to_string_pretty(&items).unwrap())\n        .context(\"Failed to write to account file\")?;\n\n    Ok(())\n}\n\npub(crate) fn compute_account_address(\n    salt: Felt,\n    public_key: Felt,\n    class_hash: Felt,\n    account_type: AccountType,\n    chain_id: Felt,\n) -> Felt {\n    match account_type {\n        AccountType::Argent | AccountType::Ready => {\n            get_contract_address(salt, class_hash, &[public_key, Felt::ZERO], Felt::ZERO)\n        }\n        AccountType::OpenZeppelin => {\n            get_contract_address(salt, class_hash, &[public_key], chain_id)\n        }\n        AccountType::Braavos => get_contract_address(\n            salt,\n            BRAAVOS_BASE_ACCOUNT_CLASS_HASH,\n            &[public_key],\n            chain_id,\n        ),\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/account/import.rs",
    "content": "use std::str::FromStr;\n\nuse super::deploy::compute_account_address;\nuse crate::starknet_commands::account::{\n    generate_add_profile_message, prepare_account_json, write_account_to_accounts_file,\n};\nuse anyhow::{Context, Result, bail, ensure};\nuse camino::Utf8PathBuf;\nuse clap::Args;\nuse conversions::string::{TryFromDecStr, TryFromHexStr};\nuse foundry_ui::components::warning::WarningMessage;\nuse sncast::check_if_legacy_contract;\nuse sncast::helpers::account::generate_account_name;\nuse sncast::helpers::configuration::CastConfig;\nuse sncast::helpers::ledger;\nuse sncast::helpers::ledger::LedgerKeyLocatorAccount;\nuse sncast::helpers::rpc::RpcArgs;\nuse sncast::response::account::import::AccountImportResponse;\nuse sncast::response::ui::UI;\nuse sncast::{AccountType, SignerType, check_class_hash_exists, get_chain_id, handle_rpc_error};\nuse starknet_rust::core::types::{BlockId, BlockTag, StarknetError};\nuse starknet_rust::providers::jsonrpc::{HttpTransport, JsonRpcClient};\nuse starknet_rust::providers::{Provider, ProviderError};\nuse starknet_rust::signers::SigningKey;\nuse starknet_types_core::felt::Felt;\n\n#[derive(Args, Debug)]\n#[command(about = \"Add an account to the accounts file\")]\npub struct Import {\n    /// Name of the account to be imported\n    #[arg(short, long)]\n    pub name: Option<String>,\n\n    /// Address of the account\n    #[arg(short, long)]\n    pub address: Felt,\n\n    /// Type of the account\n    #[arg(short = 't', long = \"type\", value_parser = AccountType::from_str)]\n    pub account_type: AccountType,\n\n    /// Class hash of the account\n    #[arg(short, long)]\n    pub class_hash: Option<Felt>,\n\n    /// Account private key\n    #[arg(\n        long,\n        group = \"private_key_input\",\n        conflicts_with = \"ledger_key_locator_account\"\n    )]\n    pub private_key: Option<Felt>,\n\n    /// Path to the file holding account private key\n    #[arg(\n        long = \"private-key-file\",\n        group = \"private_key_input\",\n        conflicts_with = \"ledger_key_locator_account\"\n    )]\n    pub private_key_file_path: Option<Utf8PathBuf>,\n\n    /// Salt for the address\n    #[arg(short, long)]\n    pub salt: Option<Felt>,\n\n    /// If passed, a profile with the provided name and corresponding data will be created in snfoundry.toml\n    #[arg(long)]\n    pub add_profile: Option<String>,\n\n    #[command(flatten)]\n    pub rpc: RpcArgs,\n\n    /// If passed, the command will not trigger an interactive prompt to add an account as a default\n    #[arg(long)]\n    pub silent: bool,\n\n    #[command(flatten)]\n    pub ledger_key_locator: LedgerKeyLocatorAccount,\n}\n\n#[allow(clippy::too_many_lines)]\npub async fn import(\n    account: Option<String>,\n    accounts_file: &Utf8PathBuf,\n    provider: &JsonRpcClient<HttpTransport>,\n    import: &Import,\n    config: &CastConfig,\n    ui: &UI,\n) -> Result<AccountImportResponse> {\n    // TODO(#3556): Remove this warning once we drop Argent account type\n    if import.account_type == AccountType::Argent {\n        ui.print_warning(WarningMessage::new(\n                \"Argent has rebranded as Ready. The `argent` option for the `--type` flag in `account import` is deprecated, please use `ready` instead.\",\n            ));\n        ui.print_blank_line();\n    }\n\n    let (signer_type, public_key) = if let Some(ledger_path) = import.ledger_key_locator.resolve(ui)\n    {\n        let public_key = ledger::get_ledger_public_key(&ledger_path, ui).await?;\n        (SignerType::Ledger { ledger_path }, public_key)\n    } else {\n        let key_felt = match (&import.private_key, &import.private_key_file_path) {\n            (Some(key), _) => *key,\n            (None, Some(path)) => get_private_key_from_file(path)\n                .with_context(|| format!(\"Failed to obtain private key from the file {path}\"))?,\n            (None, None) => get_private_key_from_input()?,\n        };\n\n        let signing_key = SigningKey::from_secret_scalar(key_felt);\n        let public_key = signing_key.verifying_key().scalar();\n        (\n            SignerType::Local {\n                private_key: key_felt,\n            },\n            public_key,\n        )\n    };\n\n    let account_name = account\n        .clone()\n        .unwrap_or_else(|| generate_account_name(accounts_file).unwrap());\n\n    let fetched_class_hash = match provider\n        .get_class_hash_at(BlockId::Tag(BlockTag::PreConfirmed), import.address)\n        .await\n    {\n        Ok(class_hash) => Ok(Some(class_hash)),\n        Err(ProviderError::StarknetError(StarknetError::ContractNotFound)) => Ok(None),\n        Err(err) => Err(handle_rpc_error(err)),\n    }?;\n\n    let deployed: bool = fetched_class_hash.is_some();\n    let class_hash = if let (Some(from_provider), Some(from_user)) =\n        (fetched_class_hash, import.class_hash)\n    {\n        ensure!(\n            from_provider == from_user,\n            \"Incorrect class hash {:#x} for account address {:#x} was provided\",\n            from_user,\n            import.address\n        );\n        from_provider\n    } else if let Some(from_user) = import.class_hash {\n        check_class_hash_exists(provider, from_user).await?;\n        from_user\n    } else if let Some(from_provider) = fetched_class_hash {\n        from_provider\n    } else {\n        bail!(\n            \"Class hash for the account address {:#x} could not be found. Please provide the class hash\",\n            import.address\n        );\n    };\n\n    let chain_id = get_chain_id(provider).await?;\n\n    if let Some(salt) = import.salt {\n        let computed_address =\n            compute_account_address(salt, public_key, class_hash, import.account_type, chain_id);\n        ensure!(\n            computed_address == import.address,\n            \"Computed address {:#x} does not match the provided address {:#x}. Please ensure that the provided salt, class hash, and account type are correct.\",\n            computed_address,\n            import.address\n        );\n    }\n\n    let legacy = check_if_legacy_contract(Some(class_hash), import.address, provider).await?;\n\n    let account_json = prepare_account_json(\n        &signer_type,\n        public_key,\n        import.address,\n        deployed,\n        legacy,\n        import.account_type,\n        Some(class_hash),\n        import.salt,\n    );\n\n    write_account_to_accounts_file(&account_name, accounts_file, chain_id, account_json.clone())?;\n\n    let add_profile_message = generate_add_profile_message(\n        import.add_profile.as_ref(),\n        &import.rpc,\n        &account_name,\n        accounts_file,\n        None,\n        config,\n    )?;\n\n    Ok(AccountImportResponse {\n        add_profile: add_profile_message,\n        account_name,\n    })\n}\n\nfn get_private_key_from_file(file_path: &Utf8PathBuf) -> Result<Felt> {\n    let private_key_string = std::fs::read_to_string(file_path.clone())?;\n    Ok(private_key_string.parse()?)\n}\n\nfn parse_input_to_felt(input: &str) -> Result<Felt> {\n    Felt::try_from_hex_str(input)\n        .or_else(|_| Felt::try_from_dec_str(input))\n        .with_context(|| format!(\"Failed to parse the value {input} as a felt\"))\n}\n\nfn get_private_key_from_input() -> Result<Felt> {\n    let input = rpassword::prompt_password(\"Type in your private key and press enter: \")\n        .expect(\"Failed to read private key from input\");\n    parse_input_to_felt(&input)\n}\n\n#[cfg(test)]\nmod tests {\n    use crate::starknet_commands::account::import::parse_input_to_felt;\n    use conversions::string::TryFromHexStr;\n    use starknet_types_core::felt::Felt;\n\n    #[test]\n    fn test_parse_hex_str() {\n        let hex_str = \"0x0000000000000000000000000000000000000000000000000000000000000001\";\n        let result = parse_input_to_felt(hex_str);\n\n        assert_eq!(result.unwrap(), Felt::try_from_hex_str(\"0x1\").unwrap());\n    }\n\n    #[test]\n    fn test_parse_hex_str_padded() {\n        let hex_str = \"0x1a2b3c\";\n        let result = parse_input_to_felt(hex_str);\n\n        assert_eq!(result.unwrap(), Felt::try_from_hex_str(\"0x1a2b3c\").unwrap());\n    }\n\n    #[test]\n    fn test_parse_hex_str_invalid() {\n        let hex_str = \"0xz\";\n        let result = parse_input_to_felt(hex_str);\n\n        assert!(result.is_err());\n        let error_message = result.unwrap_err().to_string();\n        assert_eq!(\"Failed to parse the value 0xz as a felt\", error_message);\n    }\n\n    #[test]\n    fn test_parse_dec_str() {\n        let dec_str = \"123\";\n        let result = parse_input_to_felt(dec_str);\n\n        assert_eq!(result.unwrap(), Felt::from(123));\n    }\n\n    #[test]\n    fn test_parse_dec_str_negative() {\n        let dec_str = \"-123\";\n        let result = parse_input_to_felt(dec_str);\n\n        assert!(result.is_err());\n        let error_message = result.unwrap_err().to_string();\n        assert_eq!(\"Failed to parse the value -123 as a felt\", error_message);\n    }\n\n    #[test]\n    fn test_parse_invalid_str() {\n        let invalid_str = \"invalid\";\n        let result = parse_input_to_felt(invalid_str);\n\n        assert!(result.is_err());\n        let error_message = result.unwrap_err().to_string();\n        assert_eq!(\"Failed to parse the value invalid as a felt\", error_message);\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/account/list.rs",
    "content": "use anyhow::Error;\nuse camino::Utf8PathBuf;\nuse clap::Args;\nuse conversions::string::IntoHexStr;\nuse foundry_ui::Message;\nuse itertools::Itertools;\nuse serde::Deserialize;\nuse serde::Serialize;\nuse serde_json::Value;\nuse serde_json::json;\nuse sncast::AccountType;\nuse sncast::{\n    AccountData, NestedMap, SignerType, check_account_file_exists, read_and_parse_json_file,\n};\nuse std::collections::HashMap;\nuse std::fmt::Write;\n\n#[derive(Args, Debug)]\n#[command(\n    name = \"list\",\n    about = \"List available accounts\",\n    before_help = \"Warning! This command may expose vulnerable cryptographic information, e.g. accounts' private keys\"\n)]\npub struct List {\n    /// Display private keys\n    #[arg(short = 'p', long = \"display-private-keys\")]\n    pub display_private_keys: bool,\n}\n\n#[derive(Deserialize, Serialize, Clone, Debug)]\npub struct AccountDataRepresentationMessage {\n    pub public_key: String,\n    #[serde(flatten, skip_serializing_if = \"Option::is_none\")]\n    pub signer_type: Option<SignerType>,\n    #[serde(skip_serializing_if = \"Option::is_none\")]\n    pub network: Option<String>,\n    #[serde(skip_serializing_if = \"Option::is_none\")]\n    pub address: Option<String>,\n    #[serde(skip_serializing_if = \"Option::is_none\")]\n    pub salt: Option<String>,\n    #[serde(skip_serializing_if = \"Option::is_none\")]\n    pub deployed: Option<bool>,\n    #[serde(skip_serializing_if = \"Option::is_none\")]\n    pub class_hash: Option<String>,\n    #[serde(skip_serializing_if = \"Option::is_none\")]\n    pub legacy: Option<bool>,\n    #[serde(default, rename(serialize = \"type\", deserialize = \"type\"))]\n    #[serde(skip_serializing_if = \"Option::is_none\")]\n    pub account_type: Option<AccountType>,\n}\n\nimpl AccountDataRepresentationMessage {\n    fn new(account: &AccountData, display_private_key: bool) -> Self {\n        Self {\n            signer_type: match &account.signer_type {\n                SignerType::Local { .. } if !display_private_key => None,\n                other => Some(other.clone()),\n            },\n            public_key: account.public_key.into_hex_string(),\n            network: None,\n            address: account.address.map(IntoHexStr::into_hex_string),\n            salt: account.salt.map(IntoHexStr::into_hex_string),\n            deployed: account.deployed,\n            class_hash: account.class_hash.map(IntoHexStr::into_hex_string),\n            legacy: account.legacy,\n            account_type: account.account_type,\n        }\n    }\n\n    fn set_network(&mut self, network: &str) {\n        self.network = Some(network.to_owned());\n    }\n}\n\nfn read_and_flatten(\n    accounts_file: &Utf8PathBuf,\n    display_private_keys: bool,\n) -> anyhow::Result<HashMap<String, AccountDataRepresentationMessage>> {\n    let networks: NestedMap<AccountData> = read_and_parse_json_file(accounts_file)?;\n    let mut result = HashMap::new();\n\n    for (network, accounts) in networks.iter().sorted_by_key(|(name, _)| *name) {\n        for (name, data) in accounts.iter().sorted_by_key(|(name, _)| *name) {\n            let mut data_repr = AccountDataRepresentationMessage::new(data, display_private_keys);\n\n            data_repr.set_network(network);\n            result.insert(name.to_owned(), data_repr);\n        }\n    }\n\n    Ok(result)\n}\n\nimpl Message for AccountDataRepresentationMessage {\n    fn text(&self) -> String {\n        let mut result = String::new();\n\n        if let Some(ref network) = self.network {\n            let _ = writeln!(result, \"  network: {network}\");\n        }\n\n        let _ = writeln!(result, \"  public key: {}\", self.public_key);\n\n        match &self.signer_type {\n            Some(SignerType::Local { private_key }) => {\n                let _ = writeln!(result, \"  private key: {}\", private_key.into_hex_string());\n            }\n            Some(SignerType::Ledger { ledger_path }) => {\n                let _ = writeln!(result, \"  ledger path: {}\", ledger_path.derivation_string());\n            }\n            None => {}\n        }\n        if let Some(ref address) = self.address {\n            let _ = writeln!(result, \"  address: {address}\");\n        }\n        if let Some(ref salt) = self.salt {\n            let _ = writeln!(result, \"  salt: {salt}\");\n        }\n        if let Some(ref class_hash) = self.class_hash {\n            let _ = writeln!(result, \"  class hash: {class_hash}\");\n        }\n        if let Some(ref deployed) = self.deployed {\n            let _ = writeln!(result, \"  deployed: {deployed}\");\n        }\n        if let Some(ref legacy) = self.legacy {\n            let _ = writeln!(result, \"  legacy: {legacy}\");\n        }\n        if let Some(ref account_type) = self.account_type {\n            // TODO(#3556): Remove this adjustment when the `argent` account type is removed\n            let displayed_type = if account_type == &AccountType::Argent {\n                &AccountType::Ready\n            } else {\n                account_type\n            };\n            let _ = writeln!(result, \"  type: {displayed_type:?}\");\n        }\n\n        result.trim_end().to_string()\n    }\n\n    fn json(&self) -> Value {\n        json!(self)\n    }\n}\n\npub struct AccountsListMessage {\n    accounts_file: Utf8PathBuf,\n    accounts_file_path: String,\n    display_private_keys: bool,\n}\n\nimpl AccountsListMessage {\n    pub fn new(accounts_file: Utf8PathBuf, display_private_keys: bool) -> Result<Self, Error> {\n        check_account_file_exists(&accounts_file)?;\n\n        let accounts_file_path = accounts_file\n            .canonicalize()\n            .expect(\"Failed to resolve the accounts file path\");\n\n        let accounts_file_path = accounts_file_path\n            .to_str()\n            .expect(\"Failed to resolve an absolute path to the accounts file\");\n\n        Ok(Self {\n            accounts_file,\n            accounts_file_path: accounts_file_path.to_string(),\n            display_private_keys,\n        })\n    }\n}\n\nimpl Message for AccountsListMessage {\n    fn text(&self) -> String {\n        let accounts =\n            read_and_flatten(&self.accounts_file, self.display_private_keys).unwrap_or_default();\n\n        if accounts.is_empty() {\n            format!(\"No accounts available at {}\", self.accounts_file_path)\n        } else {\n            let mut result = format!(\"Available accounts (at {}):\", self.accounts_file_path);\n            for (name, data) in accounts.iter().sorted_by_key(|(name, _)| *name) {\n                let _ = writeln!(result, \"\\n- {}:\\n{}\", name, data.text());\n            }\n            if !self.display_private_keys {\n                let _ = writeln!(\n                    result,\n                    \"\\nTo show private keys too, run with --display-private-keys or -p\"\n                );\n            }\n            result\n        }\n    }\n\n    fn json(&self) -> Value {\n        let accounts =\n            read_and_flatten(&self.accounts_file, self.display_private_keys).unwrap_or_default();\n\n        let mut accounts_map: HashMap<String, AccountDataRepresentationMessage> = HashMap::new();\n        for (name, data) in &accounts {\n            accounts_map.insert(name.clone(), data.clone());\n        }\n\n        json!(&accounts_map)\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/account/mod.rs",
    "content": "use crate::starknet_commands::account::create::Create;\nuse crate::starknet_commands::account::delete::Delete;\nuse crate::starknet_commands::account::deploy::Deploy;\nuse crate::starknet_commands::account::import::Import;\nuse crate::starknet_commands::account::list::{AccountsListMessage, List};\nuse crate::{process_command_result, starknet_commands};\nuse anyhow::{Context, Result, bail};\nuse camino::Utf8PathBuf;\nuse clap::{Args, Subcommand};\nuse configuration::resolve_config_file;\nuse configuration::{load_config, search_config_upwards_relative_to};\nuse serde_json::json;\nuse sncast::helpers::account::{generate_account_name, load_accounts};\nuse sncast::helpers::interactive::prompt_to_add_account_as_default;\nuse sncast::helpers::rpc::RpcArgs;\nuse sncast::response::explorer_link::block_explorer_link_if_allowed;\nuse sncast::response::ui::UI;\nuse sncast::{\n    AccountType, chain_id_to_network_name, decode_chain_id, helpers::configuration::CastConfig,\n};\nuse sncast::{SignerSource, SignerType, WaitForTx, get_chain_id};\nuse starknet_rust::providers::Provider;\nuse starknet_types_core::felt::Felt;\nuse std::io::{self, IsTerminal};\nuse std::{fs::OpenOptions, io::Write};\nuse toml::Value;\n\npub mod create;\npub mod delete;\npub mod deploy;\npub mod import;\npub mod list;\n\n#[derive(Args)]\n#[command(about = \"Creates and deploys an account to the Starknet\")]\npub struct Account {\n    #[command(subcommand)]\n    pub command: Commands,\n}\n\n#[derive(Debug, Subcommand)]\npub enum Commands {\n    Import(Import),\n    Create(Create),\n    Deploy(Deploy),\n    Delete(Delete),\n    List(List),\n}\n\n#[allow(clippy::too_many_arguments)]\npub fn prepare_account_json(\n    signer_type: &SignerType,\n    public_key: Felt,\n    address: Felt,\n    deployed: bool,\n    legacy: bool,\n    account_type: AccountType,\n    class_hash: Option<Felt>,\n    salt: Option<Felt>,\n) -> serde_json::Value {\n    // TODO(#3556): Once `Argent` variant is deleted, use `account_type` directly\n    let saved_account_type = match account_type {\n        AccountType::Argent => AccountType::Ready,\n        _ => account_type,\n    };\n\n    let mut account_json = json!({\n        \"public_key\": format!(\"{public_key:#x}\"),\n        \"address\": format!(\"{address:#x}\"),\n        \"type\": format!(\"{saved_account_type}\").to_lowercase().replace(\"openzeppelin\", \"open_zeppelin\"),\n        \"deployed\": deployed,\n        \"legacy\": legacy,\n    });\n\n    match signer_type {\n        SignerType::Local { private_key } => {\n            account_json[\"private_key\"] = serde_json::Value::String(format!(\"{private_key:#x}\"));\n        }\n        SignerType::Ledger { ledger_path } => {\n            account_json[\"ledger_path\"] =\n                serde_json::Value::String(ledger_path.derivation_string());\n        }\n    }\n\n    if let Some(salt) = salt {\n        account_json[\"salt\"] = serde_json::Value::String(format!(\"{salt:#x}\"));\n    }\n    if let Some(class_hash) = class_hash {\n        account_json[\"class_hash\"] = serde_json::Value::String(format!(\"{class_hash:#x}\"));\n    }\n\n    account_json\n}\n\npub fn write_account_to_accounts_file(\n    account: &str,\n    accounts_file: &Utf8PathBuf,\n    chain_id: Felt,\n    account_json: serde_json::Value,\n) -> Result<()> {\n    if !accounts_file.exists() {\n        std::fs::create_dir_all(accounts_file.clone().parent().unwrap())?;\n        std::fs::write(accounts_file.clone(), \"{}\")?;\n    }\n\n    let mut items = load_accounts(accounts_file)?;\n\n    let network_name = chain_id_to_network_name(chain_id);\n\n    if !items[&network_name][account].is_null() {\n        bail!(\n            \"Account with name = {} already exists in network with chain_id = {}\",\n            account,\n            decode_chain_id(chain_id)\n        );\n    }\n    items[&network_name][account] = account_json;\n\n    std::fs::write(\n        accounts_file.clone(),\n        serde_json::to_string_pretty(&items).unwrap(),\n    )?;\n    Ok(())\n}\n\npub fn add_created_profile_to_configuration(\n    profile: Option<&str>,\n    cast_config: &CastConfig,\n    path: &Utf8PathBuf,\n) -> Result<()> {\n    if !load_config::<CastConfig>(Some(path), profile)\n        .unwrap_or_default()\n        .account\n        .is_empty()\n    {\n        bail!(\n            \"Failed to add profile = {} to the snfoundry.toml. Profile already exists\",\n            profile.unwrap_or(\"default\")\n        );\n    }\n\n    let toml_string = {\n        let mut new_profile = toml::value::Table::new();\n\n        if let Some(url) = &cast_config.url {\n            new_profile.insert(\"url\".to_string(), Value::String(url.to_string()));\n        } else if let Some(network) = &cast_config.network {\n            new_profile.insert(\"network\".to_string(), Value::String(network.to_string()));\n        }\n        new_profile.insert(\n            \"account\".to_string(),\n            Value::String(cast_config.account.clone()),\n        );\n        if let Some(keystore) = cast_config.keystore.clone() {\n            new_profile.insert(\"keystore\".to_string(), Value::String(keystore.to_string()));\n        } else {\n            new_profile.insert(\n                \"accounts-file\".to_string(),\n                Value::String(cast_config.accounts_file.to_string()),\n            );\n        }\n        let mut profile_config = toml::value::Table::new();\n        profile_config.insert(\n            profile.map_or_else(|| cast_config.account.clone(), ToString::to_string),\n            Value::Table(new_profile),\n        );\n\n        let mut sncast_config = toml::value::Table::new();\n        sncast_config.insert(String::from(\"sncast\"), Value::Table(profile_config));\n\n        toml::to_string(&Value::Table(sncast_config)).context(\"Failed to convert toml to string\")?\n    };\n\n    let config_path = search_config_upwards_relative_to(path)?;\n\n    let mut snfoundry_toml = OpenOptions::new()\n        .create(true)\n        .append(true)\n        .open(config_path)\n        .context(\"Failed to open snfoundry.toml\")?;\n    snfoundry_toml\n        .write_all(format!(\"\\n{toml_string}\").as_bytes())\n        .context(\"Failed to write to the snfoundry.toml\")?;\n\n    Ok(())\n}\n\nfn generate_add_profile_message(\n    profile_name: Option<&String>,\n    rpc_args: &RpcArgs,\n    account_name: &str,\n    accounts_file: &Utf8PathBuf,\n    keystore: Option<Utf8PathBuf>,\n    config: &CastConfig,\n) -> Result<Option<String>> {\n    if let Some(profile_name) = profile_name {\n        let (url, network) = if rpc_args.url.is_some() || rpc_args.network.is_some() {\n            (rpc_args.url.clone(), rpc_args.network)\n        } else {\n            (config.url.clone(), config.network)\n        };\n        let config = CastConfig {\n            url,\n            network,\n            account: account_name.into(),\n            accounts_file: accounts_file.into(),\n            keystore,\n            ..Default::default()\n        };\n        let config_path = resolve_config_file();\n        add_created_profile_to_configuration(Some(profile_name), &config, &config_path)?;\n        Ok(Some(format!(\n            \"Profile {profile_name} successfully added to {config_path}\",\n        )))\n    } else {\n        Ok(None)\n    }\n}\n\n#[allow(clippy::too_many_lines)]\npub async fn account(\n    account: Account,\n    config: CastConfig,\n    ui: &UI,\n    wait_config: WaitForTx,\n) -> anyhow::Result<()> {\n    match account.command {\n        Commands::Import(import) => {\n            let provider = import.rpc.get_provider(&config, ui).await?;\n            let result = starknet_commands::account::import::import(\n                import.name.clone(),\n                &config.accounts_file,\n                &provider,\n                &import,\n                &config,\n                ui,\n            )\n            .await;\n\n            let run_interactive_prompt =\n                !import.silent && result.is_ok() && io::stdout().is_terminal();\n\n            if run_interactive_prompt\n                && let Some(account_name) = result.as_ref().ok().map(|r| r.account_name.clone())\n                && let Err(err) = prompt_to_add_account_as_default(account_name.as_str())\n            {\n                // TODO(#3436)\n                ui.print_error(\n                    \"account import\",\n                    format!(\"Error: Failed to launch interactive prompt: {err}\"),\n                );\n            }\n\n            process_command_result(\"account import\", result, ui, None);\n            Ok(())\n        }\n        Commands::Create(create) => {\n            let provider = create.rpc.get_provider(&config, ui).await?;\n\n            let chain_id = get_chain_id(&provider).await?;\n\n            let signer_type = create\n                .ledger_key_locator\n                .resolve(ui)\n                .map(|ledger_path| SignerType::Ledger { ledger_path });\n\n            let signer_source = SignerSource::new(config.keystore.clone(), signer_type.as_ref())?;\n\n            let account = if config.keystore.is_none() {\n                create\n                    .name\n                    .clone()\n                    .unwrap_or_else(|| generate_account_name(&config.accounts_file).unwrap())\n            } else {\n                config.account.clone()\n            };\n            let result = starknet_commands::account::create::create(\n                &account,\n                &config.accounts_file,\n                &provider,\n                chain_id,\n                &create,\n                &config,\n                &signer_source,\n                ui,\n            )\n            .await;\n\n            let block_explorer_link =\n                block_explorer_link_if_allowed(&result, provider.chain_id().await?, &config).await;\n\n            process_command_result(\"account create\", result, ui, block_explorer_link);\n            Ok(())\n        }\n\n        Commands::Deploy(deploy) => {\n            let provider = deploy.rpc.get_provider(&config, ui).await?;\n\n            let fee_args = deploy.fee_args.clone();\n\n            let chain_id = get_chain_id(&provider).await?;\n            let result = starknet_commands::account::deploy::deploy(\n                &provider,\n                &config.accounts_file,\n                &deploy,\n                chain_id,\n                wait_config,\n                &config.account,\n                config.keystore.clone(),\n                fee_args,\n                ui,\n            )\n            .await;\n\n            let run_interactive_prompt =\n                !deploy.silent && result.is_ok() && io::stdout().is_terminal();\n\n            if config.keystore.is_none()\n                && run_interactive_prompt\n                && let Err(err) = prompt_to_add_account_as_default(\n                    deploy\n                        .name\n                        .as_ref()\n                        .expect(\"Must be provided when using accounts file\"),\n                )\n            {\n                // TODO(#3436)\n                ui.print_error(\n                    \"account deploy\",\n                    format!(\"Error: Failed to launch interactive prompt: {err}\"),\n                );\n            }\n\n            let block_explorer_link =\n                block_explorer_link_if_allowed(&result, provider.chain_id().await?, &config).await;\n            process_command_result(\"account deploy\", result, ui, block_explorer_link);\n            Ok(())\n        }\n\n        Commands::Delete(delete) => {\n            let network_name =\n                starknet_commands::account::delete::get_network_name(&delete, &config, ui).await?;\n\n            let result = starknet_commands::account::delete::delete(\n                &delete.name,\n                &config.accounts_file,\n                &network_name,\n                delete.yes,\n            );\n\n            process_command_result(\"account delete\", result, ui, None);\n            Ok(())\n        }\n\n        Commands::List(options) => {\n            ui.print_message(\n                \"account delete\",\n                AccountsListMessage::new(config.accounts_file, options.display_private_keys)?,\n            );\n            Ok(())\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use camino::Utf8PathBuf;\n    use configuration::test_utils::copy_config_to_tempdir;\n    use sncast::helpers::{configuration::CastConfig, constants::DEFAULT_ACCOUNTS_FILE};\n    use std::fs;\n    use url::Url;\n\n    use crate::starknet_commands::account::add_created_profile_to_configuration;\n\n    #[test]\n    fn test_add_created_profile_to_configuration_happy_case() {\n        let tempdir = copy_config_to_tempdir(\"tests/data/files/correct_snfoundry.toml\", None);\n        let path = Utf8PathBuf::try_from(tempdir.path().to_path_buf()).unwrap();\n        let config = CastConfig {\n            url: Some(Url::parse(\"http://some-url.com/\").unwrap()),\n            network: None,\n            account: String::from(\"some-name\"),\n            accounts_file: \"accounts\".into(),\n            ..Default::default()\n        };\n        let res = add_created_profile_to_configuration(\n            Some(&String::from(\"some-name\")),\n            &config,\n            &path.clone(),\n        );\n        assert!(res.is_ok());\n\n        let contents =\n            fs::read_to_string(path.join(\"snfoundry.toml\")).expect(\"Failed to read snfoundry.toml\");\n\n        assert!(contents.contains(\"[sncast.some-name]\"));\n        assert!(contents.contains(\"account = \\\"some-name\\\"\"));\n        assert!(contents.contains(\"url = \\\"http://some-url.com/\\\"\"));\n        assert!(contents.contains(\"accounts-file = \\\"accounts\\\"\"));\n    }\n\n    #[test]\n    fn test_add_created_profile_to_configuration_profile_already_exists() {\n        let tempdir = copy_config_to_tempdir(\"tests/data/files/correct_snfoundry.toml\", None);\n        let config = CastConfig {\n            url: Some(Url::parse(\"http://some-url.com/\").unwrap()),\n            network: None,\n            account: String::from(\"user1\"),\n            accounts_file: DEFAULT_ACCOUNTS_FILE.into(),\n            ..Default::default()\n        };\n        let res = add_created_profile_to_configuration(\n            Some(&String::from(\"default\")),\n            &config,\n            &Utf8PathBuf::try_from(tempdir.path().to_path_buf()).unwrap(),\n        );\n        assert!(res.is_err());\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/call.rs",
    "content": "use crate::Arguments;\nuse anyhow::Result;\nuse clap::Args;\nuse sncast::helpers::rpc::RpcArgs;\nuse sncast::response::call::CallResponse;\nuse sncast::response::errors::StarknetCommandError;\nuse starknet_rust::core::types::{BlockId, FunctionCall};\nuse starknet_rust::providers::jsonrpc::HttpTransport;\nuse starknet_rust::providers::{JsonRpcClient, Provider};\nuse starknet_types_core::felt::Felt;\n\n#[derive(Args)]\n#[command(about = \"Call a contract instance on Starknet\", long_about = None)]\npub struct Call {\n    /// Address of the called contract (hex)\n    #[arg(short = 'd', long)]\n    pub contract_address: Felt,\n\n    /// Name of the contract function to be called\n    #[arg(short, long)]\n    pub function: String,\n\n    #[command(flatten)]\n    pub arguments: Arguments,\n\n    /// Block identifier on which call should be performed.\n    /// Possible values: `pre_confirmed`, `latest`, block hash (0x prefixed string)\n    /// and block number (u64)\n    #[arg(short, long, default_value = \"pre_confirmed\")]\n    pub block_id: String,\n\n    #[command(flatten)]\n    pub rpc: RpcArgs,\n}\n\npub async fn call(\n    contract_address: Felt,\n    entry_point_selector: Felt,\n    calldata: Vec<Felt>,\n    provider: &JsonRpcClient<HttpTransport>,\n    block_id: &BlockId,\n) -> Result<CallResponse, StarknetCommandError> {\n    let function_call = FunctionCall {\n        contract_address,\n        entry_point_selector,\n        calldata,\n    };\n    let res = provider.call(function_call, block_id).await;\n\n    match res {\n        Ok(response) => Ok(CallResponse { response }),\n        Err(error) => Err(StarknetCommandError::ProviderError(error.into())),\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/declare.rs",
    "content": "use anyhow::{Context, Result, anyhow};\nuse clap::Args;\nuse conversions::IntoConv;\nuse conversions::byte_array::ByteArray;\nuse shared::rpc::get_starknet_version;\nuse sncast::helpers::artifacts::CastStarknetContractArtifacts;\nuse sncast::helpers::fee::{FeeArgs, FeeSettings};\nuse sncast::helpers::rpc::RpcArgs;\nuse sncast::response::declare::{\n    AlreadyDeclaredResponse, DeclareResponse, DeclareTransactionResponse,\n};\nuse sncast::response::errors::{SNCastProviderError, SNCastStarknetError, StarknetCommandError};\nuse sncast::response::ui::UI;\nuse sncast::{ErrorData, WaitForTx, apply_optional_fields, handle_wait_for_tx};\nuse starknet_rust::accounts::AccountError::Provider;\nuse starknet_rust::accounts::{ConnectedAccount, DeclarationV3};\nuse starknet_rust::core::types::{\n    ContractExecutionError, DeclareTransactionResult, StarknetError, TransactionExecutionErrorData,\n};\nuse starknet_rust::providers::ProviderError;\nuse starknet_rust::{\n    accounts::{Account, SingleOwnerAccount},\n    core::types::contract::{CompiledClass, SierraClass},\n    providers::jsonrpc::{HttpTransport, JsonRpcClient},\n    signers::Signer,\n};\nuse starknet_types_core::felt::Felt;\nuse std::collections::HashMap;\nuse std::sync::Arc;\nuse universal_sierra_compiler_api::compile_contract_sierra;\n\n/// Common args shared by declare command variants.\n#[derive(Args)]\npub struct DeclareCommonArgs {\n    #[command(flatten)]\n    pub fee_args: FeeArgs,\n\n    /// Nonce of the transaction. If not provided, nonce will be set automatically\n    #[arg(short, long)]\n    pub nonce: Option<Felt>,\n\n    #[command(flatten)]\n    pub rpc: RpcArgs,\n}\n\n#[derive(Args)]\n#[command(about = \"Declare a contract to starknet\", long_about = None)]\npub struct Declare {\n    /// Contract name\n    #[arg(short = 'c', long)]\n    pub contract_name: String,\n\n    /// Specifies scarb package to be used\n    #[arg(long)]\n    pub package: Option<String>,\n\n    #[command(flatten)]\n    pub common: DeclareCommonArgs,\n}\n\n// TODO(#3785)\n#[expect(clippy::too_many_arguments)]\npub async fn declare<S>(\n    contract_name: String,\n    fee_args: FeeArgs,\n    nonce: Option<Felt>,\n    account: &SingleOwnerAccount<&JsonRpcClient<HttpTransport>, S>,\n    artifacts: &HashMap<String, CastStarknetContractArtifacts>,\n    wait_config: WaitForTx,\n    skip_on_already_declared: bool,\n    ui: &UI,\n) -> Result<DeclareResponse, StarknetCommandError>\nwhere\n    S: Signer + Sync + Send,\n{\n    let contract_artifacts =\n        artifacts\n            .get(&contract_name)\n            .ok_or(StarknetCommandError::ContractArtifactsNotFound(ErrorData {\n                data: ByteArray::from(contract_name.as_str()),\n            }))?;\n\n    let contract_definition: SierraClass = serde_json::from_str(&contract_artifacts.sierra)\n        .context(\"Failed to parse sierra artifact\")?;\n    let casm_contract_definition: CompiledClass =\n        serde_json::from_str(&contract_artifacts.casm).context(\"Failed to parse casm artifact\")?;\n\n    declare_with_artifacts(\n        contract_definition,\n        casm_contract_definition,\n        &fee_args,\n        nonce,\n        account,\n        wait_config,\n        skip_on_already_declared,\n        ui,\n    )\n    .await\n}\n\n#[expect(clippy::result_large_err)]\npub fn compile_sierra_to_casm(\n    sierra_class: &SierraClass,\n) -> Result<CompiledClass, StarknetCommandError> {\n    let casm_json: String = serde_json::to_string(\n        &compile_contract_sierra(\n            &serde_json::to_value(sierra_class)\n                .with_context(|| \"Failed to convert sierra to JSON value\".to_string())?,\n        )\n        .with_context(|| \"Failed to compile sierra to casm\".to_string())?,\n    )\n    .expect(\"serialization should succeed\");\n\n    let casm: CompiledClass = serde_json::from_str(&casm_json)\n        .with_context(|| \"Failed to deserialize casm JSON into CompiledClass\".to_string())?;\n    Ok(casm)\n}\n\n#[allow(clippy::too_many_arguments)]\npub async fn declare_with_artifacts<S>(\n    sierra_class: SierraClass,\n    compiled_casm: CompiledClass,\n    fee_args: &FeeArgs,\n    nonce: Option<Felt>,\n    account: &SingleOwnerAccount<&JsonRpcClient<HttpTransport>, S>,\n    wait_config: WaitForTx,\n    skip_on_already_declared: bool,\n    ui: &UI,\n) -> Result<DeclareResponse, StarknetCommandError>\nwhere\n    S: Signer + Sync + Send,\n{\n    let starknet_version = get_starknet_version(account.provider()).await?;\n    let hash_function = CompiledClass::hash_function_from_starknet_version(&starknet_version)\n        .ok_or(anyhow!(\"Unsupported Starknet version: {starknet_version}\"))?;\n    let casm_class_hash = compiled_casm\n        .class_hash_with_hash_function(hash_function)\n        .map_err(anyhow::Error::from)?;\n\n    let class_hash = sierra_class.class_hash().map_err(anyhow::Error::from)?;\n\n    let declaration = account.declare_v3(\n        Arc::new(sierra_class.flatten().map_err(anyhow::Error::from)?),\n        casm_class_hash,\n    );\n\n    let fee_settings = if fee_args.max_fee.is_some() {\n        let fee_estimate = declaration\n            .estimate_fee()\n            .await\n            .expect(\"Failed to estimate fee\");\n        fee_args.try_into_fee_settings(Some(&fee_estimate))\n    } else {\n        fee_args.try_into_fee_settings(None)\n    };\n\n    let FeeSettings {\n        l1_gas,\n        l1_gas_price,\n        l2_gas,\n        l2_gas_price,\n        l1_data_gas,\n        l1_data_gas_price,\n        tip,\n    } = fee_settings.expect(\"Failed to convert to fee settings\");\n\n    let declaration = apply_optional_fields!(\n        declaration,\n        l1_gas => DeclarationV3::l1_gas,\n        l1_gas_price => DeclarationV3::l1_gas_price,\n        l2_gas => DeclarationV3::l2_gas,\n        l2_gas_price => DeclarationV3::l2_gas_price,\n        l1_data_gas => DeclarationV3::l1_data_gas,\n        l1_data_gas_price => DeclarationV3::l1_data_gas_price,\n        tip => DeclarationV3::tip,\n        nonce => DeclarationV3::nonce\n    );\n\n    let declared = declaration.send().await;\n\n    match declared {\n        Ok(DeclareTransactionResult {\n            transaction_hash,\n            class_hash,\n        }) => handle_wait_for_tx(\n            account.provider(),\n            transaction_hash,\n            DeclareResponse::Success(DeclareTransactionResponse {\n                class_hash: class_hash.into_(),\n                transaction_hash: transaction_hash.into_(),\n            }),\n            wait_config,\n            ui,\n        )\n        .await\n        .map_err(StarknetCommandError::from),\n        Err(Provider(ProviderError::StarknetError(StarknetError::ClassAlreadyDeclared)))\n            if skip_on_already_declared =>\n        {\n            Ok(DeclareResponse::AlreadyDeclared(AlreadyDeclaredResponse {\n                class_hash: class_hash.into_(),\n            }))\n        }\n        Err(Provider(ProviderError::StarknetError(StarknetError::ClassAlreadyDeclared))) => Err(\n            StarknetCommandError::ProviderError(SNCastProviderError::StarknetError(\n                SNCastStarknetError::ClassAlreadyDeclared(class_hash.into_()),\n            )),\n        ),\n        Err(Provider(ProviderError::StarknetError(StarknetError::TransactionExecutionError(\n            TransactionExecutionErrorData {\n                execution_error: ContractExecutionError::Message(message),\n                ..\n            },\n        )))) if message.contains(\"is already declared\") => {\n            if skip_on_already_declared {\n                Ok(DeclareResponse::AlreadyDeclared(AlreadyDeclaredResponse {\n                    class_hash: class_hash.into_(),\n                }))\n            } else {\n                Err(StarknetCommandError::ProviderError(\n                    SNCastProviderError::StarknetError(SNCastStarknetError::ClassAlreadyDeclared(\n                        class_hash.into_(),\n                    )),\n                ))\n            }\n        }\n        Err(Provider(error)) => Err(StarknetCommandError::ProviderError(error.into())),\n        Err(error) => Err(anyhow!(format!(\"Unexpected error occurred: {error}\")).into()),\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/declare_from.rs",
    "content": "use crate::starknet_commands::declare::{\n    DeclareCommonArgs, compile_sierra_to_casm, declare_with_artifacts,\n};\nuse anyhow::{Context, Result};\nuse clap::{ArgGroup, Args};\nuse shared::verify_and_warn_if_incompatible_rpc_version;\nuse sncast::helpers::rpc::FreeProvider;\nuse sncast::response::declare::DeclareResponse;\nuse sncast::response::errors::{SNCastProviderError, StarknetCommandError};\nuse sncast::response::ui::UI;\nuse sncast::{Network, WaitForTx, get_provider};\nuse starknet_rust::accounts::SingleOwnerAccount;\nuse starknet_rust::core::types::contract::{AbiEntry, SierraClass, SierraClassDebugInfo};\nuse starknet_rust::core::types::{BlockId, ContractClass, FlattenedSierraClass};\nuse starknet_rust::providers::Provider;\nuse starknet_rust::providers::jsonrpc::{HttpTransport, JsonRpcClient};\nuse starknet_rust::signers::Signer;\nuse starknet_types_core::felt::Felt;\nuse std::path::PathBuf;\nuse url::Url;\n\n#[derive(Args)]\n#[command(\n    about = \"Declare a contract from either: a Sierra file, or by fetching it from a different Starknet instance\",\n    long_about = None,\n    group(\n        ArgGroup::new(\"contract_source\")\n            .args([\"sierra_file\", \"class_hash\"])\n            .required(true)\n            .multiple(false)\n    )\n)]\npub struct DeclareFrom {\n    /// Path to the compiled Sierra contract class JSON file\n    #[arg(long, conflicts_with_all = [\"block_id\", \"source_url\", \"source_network\"])]\n    pub sierra_file: Option<PathBuf>,\n\n    /// Class hash of contract declared on a different Starknet instance\n    #[arg(short = 'g', long)]\n    pub class_hash: Option<Felt>,\n\n    #[command(flatten)]\n    pub source_rpc: SourceRpcArgs,\n\n    /// Block identifier from which the contract will be fetched.\n    /// Possible values: `pre_confirmed`, `latest`, block hash (0x prefixed string)\n    /// and block number (u64)\n    #[arg(short, long, default_value = \"latest\")]\n    pub block_id: String,\n\n    #[command(flatten)]\n    pub common: DeclareCommonArgs,\n}\n\n#[derive(Args, Clone, Debug, Default)]\n#[group(required = false, multiple = false)]\npub struct SourceRpcArgs {\n    /// RPC provider url address\n    #[arg(short, long)]\n    pub source_url: Option<Url>,\n\n    /// Use predefined network with a public provider. Note that this option may result in rate limits or other unexpected behavior\n    #[arg(long)]\n    pub source_network: Option<Network>,\n}\n\nimpl SourceRpcArgs {\n    pub async fn get_provider(&self, ui: &UI) -> Result<JsonRpcClient<HttpTransport>> {\n        let url = self\n            .get_url()\n            .await\n            .context(\"Either `--source-network` or `--source-url` must be provided\")?;\n\n        let provider = get_provider(&url)?;\n        // TODO(#3959) Remove `base_ui`\n        verify_and_warn_if_incompatible_rpc_version(&provider, url, ui.base_ui()).await?;\n\n        Ok(provider)\n    }\n\n    #[must_use]\n    async fn get_url(&self) -> Option<Url> {\n        if let Some(network) = self.source_network {\n            let free_provider = FreeProvider::semi_random();\n            Some(network.url(&free_provider).await.ok()?)\n        } else {\n            self.source_url.clone()\n        }\n    }\n}\n\npub enum ContractSource {\n    LocalFile {\n        sierra_path: PathBuf,\n    },\n    Network {\n        source_provider: JsonRpcClient<HttpTransport>,\n        class_hash: Felt,\n        block_id: BlockId,\n    },\n}\n\npub async fn declare_from<S>(\n    contract_source: ContractSource,\n    common_args: &DeclareCommonArgs,\n    account: &SingleOwnerAccount<&JsonRpcClient<HttpTransport>, S>,\n    wait_config: WaitForTx,\n    skip_on_already_declared: bool,\n    ui: &UI,\n) -> Result<DeclareResponse, StarknetCommandError>\nwhere\n    S: Signer + Sync + Send,\n{\n    let sierra = match &contract_source {\n        ContractSource::LocalFile { sierra_path } => {\n            let sierra_json = std::fs::read_to_string(sierra_path).with_context(|| {\n                format!(\"Failed to read sierra file at {}\", sierra_path.display())\n            })?;\n            serde_json::from_str(&sierra_json)\n                .with_context(|| \"Failed to parse sierra file\".to_string())?\n        }\n        ContractSource::Network {\n            source_provider,\n            class_hash,\n            block_id,\n        } => {\n            let class = source_provider\n                .get_class(*block_id, *class_hash)\n                .await\n                .map_err(SNCastProviderError::from)\n                .map_err(StarknetCommandError::from)?;\n\n            let flattened_sierra = match class {\n                ContractClass::Sierra(c) => c,\n                ContractClass::Legacy(_) => {\n                    return Err(StarknetCommandError::UnknownError(anyhow::anyhow!(\n                        \"Declaring from Cairo 0 (legacy) contracts is not supported\"\n                    )));\n                }\n            };\n            let sierra: SierraClass = flattened_sierra_to_sierra(flattened_sierra)\n                .expect(\"Failed to parse flattened sierra class\");\n\n            let sierra_class_hash = sierra.class_hash().map_err(anyhow::Error::from)?;\n\n            if *class_hash != sierra_class_hash {\n                return Err(StarknetCommandError::UnknownError(anyhow::anyhow!(\n                    \"The provided sierra class hash {class_hash:#x} does not match the computed class hash {sierra_class_hash:#x} from the fetched contract.\"\n                )));\n            }\n            sierra\n        }\n    };\n\n    let casm = compile_sierra_to_casm(&sierra)?;\n\n    declare_with_artifacts(\n        sierra,\n        casm,\n        &common_args.fee_args,\n        common_args.nonce,\n        account,\n        wait_config,\n        skip_on_already_declared,\n        ui,\n    )\n    .await\n}\n\nfn flattened_sierra_to_sierra(class: FlattenedSierraClass) -> Result<SierraClass> {\n    Ok(SierraClass {\n        sierra_program: class.sierra_program,\n        sierra_program_debug_info: SierraClassDebugInfo {\n            type_names: vec![],\n            libfunc_names: vec![],\n            user_func_names: vec![],\n        },\n        contract_class_version: class.contract_class_version,\n        entry_points_by_type: class.entry_points_by_type,\n        abi: serde_json::from_str::<Vec<AbiEntry>>(&class.abi)?,\n    })\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/deploy.rs",
    "content": "use anyhow::{Result, anyhow};\nuse clap::Args;\nuse conversions::IntoConv;\nuse sncast::helpers::fee::{FeeArgs, FeeSettings};\nuse sncast::helpers::rpc::RpcArgs;\nuse sncast::response::deploy::StandardDeployResponse;\nuse sncast::response::errors::StarknetCommandError;\nuse sncast::response::ui::UI;\nuse sncast::{WaitForTx, apply_optional_fields, handle_wait_for_tx};\nuse sncast::{extract_or_generate_salt, udc_uniqueness};\nuse starknet_rust::accounts::AccountError::Provider;\nuse starknet_rust::accounts::{Account, ConnectedAccount, SingleOwnerAccount};\nuse starknet_rust::contract::{ContractFactory, DeploymentV3, UdcSelector};\nuse starknet_rust::core::utils::get_udc_deployed_address;\nuse starknet_rust::providers::JsonRpcClient;\nuse starknet_rust::providers::jsonrpc::HttpTransport;\nuse starknet_rust::signers::Signer;\nuse starknet_types_core::felt::Felt;\n\n#[derive(Args, Debug, Clone)]\n#[group(required = true, multiple = false)]\npub struct ContractIdentifier {\n    /// Class hash of contract to deploy\n    #[arg(short = 'g', long, conflicts_with = \"package\")]\n    pub class_hash: Option<Felt>,\n\n    /// Contract name\n    #[arg(long)]\n    pub contract_name: Option<String>,\n}\n\n#[derive(Args)]\npub struct DeployCommonArgs {\n    #[command(flatten)]\n    pub contract_identifier: ContractIdentifier,\n\n    #[command(flatten)]\n    pub arguments: DeployArguments,\n\n    /// Salt for the address\n    #[arg(short, long)]\n    pub salt: Option<Felt>,\n\n    /// If true, salt will be modified with an account address\n    #[arg(long)]\n    pub unique: bool,\n\n    /// Specifies scarb package to be used. Only possible to use with `--contract-name`.\n    #[arg(long, conflicts_with = \"class_hash\")]\n    pub package: Option<String>,\n}\n\n#[derive(Args)]\n#[command(about = \"Deploy a contract on Starknet\")]\npub struct Deploy {\n    #[command(flatten)]\n    pub common: DeployCommonArgs,\n\n    #[command(flatten)]\n    pub fee_args: FeeArgs,\n\n    /// Nonce of the transaction. If not provided, nonce will be set automatically\n    #[arg(short, long)]\n    pub nonce: Option<Felt>,\n\n    #[command(flatten)]\n    pub rpc: RpcArgs,\n}\n\n#[derive(Debug, Clone, clap::Args)]\n#[group(multiple = false)]\npub struct DeployArguments {\n    /// Arguments of the called function serialized as a series of felts\n    #[arg(short, long, value_delimiter = ' ', num_args = 1..)]\n    pub constructor_calldata: Option<Vec<String>>,\n\n    // Arguments of the called function as a comma-separated string of Cairo expressions\n    #[arg(long)]\n    pub arguments: Option<String>,\n}\n\n#[expect(clippy::ptr_arg, clippy::too_many_arguments)]\npub async fn deploy<S>(\n    class_hash: Felt,\n    calldata: &Vec<Felt>,\n    salt: Option<Felt>,\n    unique: bool,\n    fee_args: FeeArgs,\n    nonce: Option<Felt>,\n    account: &SingleOwnerAccount<&JsonRpcClient<HttpTransport>, S>,\n    wait_config: WaitForTx,\n    ui: &UI,\n) -> Result<StandardDeployResponse, StarknetCommandError>\nwhere\n    S: Signer + Sync + Send,\n{\n    let salt = extract_or_generate_salt(salt);\n\n    // TODO(#3628): Use `ContractFactory::new` once new UDC address is the default one in starknet-rs\n    let factory = ContractFactory::new_with_udc(class_hash, account, UdcSelector::New);\n\n    let deployment = factory.deploy_v3(calldata.clone(), salt, unique);\n\n    let fee_settings = if fee_args.max_fee.is_some() {\n        let fee_estimate = deployment\n            .estimate_fee()\n            .await\n            .expect(\"Failed to estimate fee\");\n        fee_args.try_into_fee_settings(Some(&fee_estimate))\n    } else {\n        fee_args.try_into_fee_settings(None)\n    };\n\n    let FeeSettings {\n        l1_gas,\n        l1_gas_price,\n        l2_gas,\n        l2_gas_price,\n        l1_data_gas,\n        l1_data_gas_price,\n        tip,\n    } = fee_settings.expect(\"Failed to convert to fee settings\");\n\n    let deployment = apply_optional_fields!(\n        deployment,\n        l1_gas => DeploymentV3::l1_gas,\n        l1_gas_price => DeploymentV3::l1_gas_price,\n        l2_gas => DeploymentV3::l2_gas,\n        l2_gas_price => DeploymentV3::l2_gas_price,\n        l1_data_gas => DeploymentV3::l1_data_gas,\n        l1_data_gas_price => DeploymentV3::l1_data_gas_price,\n        tip => DeploymentV3::tip,\n        nonce => DeploymentV3::nonce\n    );\n    let result = deployment.send().await;\n\n    match result {\n        Ok(result) => handle_wait_for_tx(\n            account.provider(),\n            result.transaction_hash,\n            StandardDeployResponse {\n                contract_address: get_udc_deployed_address(\n                    salt,\n                    class_hash,\n                    &udc_uniqueness(unique, account.address()),\n                    calldata,\n                )\n                .into_(),\n                transaction_hash: result.transaction_hash.into_(),\n            },\n            wait_config,\n            ui,\n        )\n        .await\n        .map_err(StarknetCommandError::from),\n        Err(Provider(error)) => Err(StarknetCommandError::ProviderError(error.into())),\n        Err(error) => Err(anyhow!(format!(\"Unexpected error occurred: {error}\")).into()),\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/get/balance.rs",
    "content": "use anyhow::{Error, Result};\nuse clap::Args;\nuse primitive_types::U256;\nuse sncast::helpers::command::process_command_result;\nuse sncast::helpers::configuration::CastConfig;\nuse sncast::helpers::rpc::RpcArgs;\nuse sncast::helpers::token::Token;\nuse sncast::response::balance::BalanceResponse;\nuse sncast::response::errors::SNCastProviderError;\nuse sncast::response::errors::StarknetCommandError;\nuse sncast::response::ui::UI;\nuse sncast::{get_account, get_block_id};\nuse starknet_rust::{\n    core::{types::FunctionCall, utils::get_selector_from_name},\n    providers::{JsonRpcClient, Provider, jsonrpc::HttpTransport},\n};\nuse starknet_types_core::felt::Felt;\n\n#[derive(Args, Debug, Clone)]\n#[group(multiple = false)]\npub struct TokenIdentifier {\n    /// Symbol of the token to check the balance for.\n    /// Supported tokens are: strk, eth.\n    /// Defaults to strk.\n    #[arg(value_enum, short = 't', long)]\n    pub token: Option<Token>,\n\n    /// Token contract address to check the balance for. Token needs to be compatible with ERC-20 standard.\n    #[arg(short = 'd', long)]\n    pub token_address: Option<Felt>,\n}\n\nimpl TokenIdentifier {\n    pub fn contract_address(&self) -> Felt {\n        if let Some(addr) = self.token_address {\n            addr\n        } else if let Some(tok) = self.token {\n            tok.contract_address()\n        } else {\n            // Both token and token address are optional, hence we cannot have\n            // default value for token at clap level.\n            Token::default().contract_address()\n        }\n    }\n\n    pub fn token_suffix(&self) -> Option<Token> {\n        match (self.token, self.token_address) {\n            (Some(token), None) => Some(token),\n            (None, Some(_)) => None,\n            (None, None) => Some(Token::default()),\n            (Some(_), Some(_)) => unreachable!(\n                \"Clap should ensure that only one of `--token` or `--token-address` is provided\"\n            ),\n        }\n    }\n}\n\n#[derive(Args, Debug)]\n#[command(about = \"Fetch balance of the account for specified token\")]\npub struct Balance {\n    #[command(flatten)]\n    pub token_identifier: TokenIdentifier,\n\n    /// Block identifier on which balance should be fetched.\n    /// Possible values: `pre_confirmed`, `latest`, block hash (0x prefixed string)\n    /// and block number (u64)\n    #[arg(short, long, default_value = \"pre_confirmed\")]\n    pub block_id: String,\n\n    #[command(flatten)]\n    pub rpc: RpcArgs,\n}\n\npub async fn balance(balance: Balance, config: CastConfig, ui: &UI) -> anyhow::Result<()> {\n    let provider = balance.rpc.get_provider(&config, ui).await?;\n    let account = get_account(&config, &provider, &balance.rpc, ui).await?;\n\n    let result = get_balance(account.address(), &provider, &balance).await?;\n\n    process_command_result(\"get balance\", Ok(result), ui, None);\n\n    Ok(())\n}\n\npub async fn get_balance(\n    account_address: Felt,\n    provider: &JsonRpcClient<HttpTransport>,\n    balance: &Balance,\n) -> Result<BalanceResponse> {\n    let call = FunctionCall {\n        contract_address: balance.token_identifier.contract_address(),\n        entry_point_selector: get_selector_from_name(\"balance_of\").expect(\"Failed to get selector\"),\n        calldata: vec![account_address],\n    };\n    let block_id = get_block_id(&balance.block_id)?;\n\n    let res = provider\n        .call(call, block_id)\n        .await\n        .map_err(|err| StarknetCommandError::ProviderError(SNCastProviderError::from(err)))?;\n\n    let token_unit = balance\n        .token_identifier\n        .token_suffix()\n        .map(|token| token.as_token_unit());\n\n    let balance = erc20_balance_to_u256(&res)?;\n\n    Ok(BalanceResponse {\n        balance,\n        token_unit,\n    })\n}\n\nfn erc20_balance_to_u256(balance: &[Felt]) -> Result<U256, Error> {\n    if balance.len() != 2 {\n        return Err(anyhow::anyhow!(\n            \"Balance response should contain exactly two values\"\n        ));\n    }\n\n    let low: u128 = balance[0].try_into()?;\n    let high: u128 = balance[1].try_into()?;\n\n    let mut bytes = [0u8; 32];\n    bytes[0..16].copy_from_slice(&low.to_le_bytes());\n    bytes[16..32].copy_from_slice(&high.to_le_bytes());\n\n    Ok(U256::from_little_endian(&bytes))\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use primitive_types::U256;\n    use starknet_rust::macros::felt;\n    use starknet_types_core::felt::Felt;\n\n    #[test]\n    fn test_happy_case() {\n        let balance = vec![\n            Felt::from_hex(\"0x1\").unwrap(),\n            Felt::from_hex(\"0x0\").unwrap(),\n        ];\n        let result = erc20_balance_to_u256(&balance).unwrap();\n        assert_eq!(result, U256::from(1u64));\n\n        let balance = vec![\n            Felt::from_hex(\"0xFFFFFFFFFFFFFFFF\").unwrap(),\n            Felt::from_hex(\"0x2\").unwrap(),\n        ];\n        let result = erc20_balance_to_u256(&balance).unwrap();\n        let expected = U256::from_dec_str(\"680564733841876926945195958937245974527\").unwrap();\n        assert_eq!(result, expected);\n    }\n\n    #[test]\n    fn test_invalid_length() {\n        let balance = vec![felt!(\"0x1\"), felt!(\"0x0\"), felt!(\"0x0\")];\n        let err = erc20_balance_to_u256(&balance).unwrap_err();\n        assert!(\n            err.to_string()\n                .contains(\"Balance response should contain exactly two values\"),\n            \"Unexpected error: {err}\"\n        );\n\n        let balance = vec![Felt::from_hex(\"0x1\").unwrap()];\n        let err = erc20_balance_to_u256(&balance).unwrap_err();\n        assert!(\n            err.to_string()\n                .contains(\"Balance response should contain exactly two values\"),\n            \"Unexpected error: {err}\"\n        );\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/get/class_hash_at.rs",
    "content": "use anyhow::Result;\nuse clap::Args;\nuse conversions::IntoConv;\nuse sncast::get_block_id;\nuse sncast::helpers::command::process_command_result;\nuse sncast::helpers::configuration::CastConfig;\nuse sncast::helpers::rpc::RpcArgs;\nuse sncast::response::class_hash_at::ClassHashAtResponse;\nuse sncast::response::errors::{SNCastProviderError, StarknetCommandError};\nuse sncast::response::explorer_link::block_explorer_link_if_allowed;\nuse sncast::response::ui::UI;\nuse starknet_rust::providers::jsonrpc::HttpTransport;\nuse starknet_rust::providers::{JsonRpcClient, Provider};\nuse starknet_types_core::felt::Felt;\n\n#[derive(Debug, Args)]\n#[command(about = \"Get the class hash of a contract deployed at a given address\")]\npub struct ClassHashAt {\n    /// Address of the contract\n    pub contract_address: Felt,\n\n    /// Block identifier on which class hash should be fetched.\n    /// Possible values: `pre_confirmed`, `latest`, block hash (0x prefixed string)\n    /// and block number (u64)\n    #[arg(short, long, default_value = \"pre_confirmed\")]\n    pub block_id: String,\n\n    #[command(flatten)]\n    pub rpc: RpcArgs,\n}\n\npub async fn class_hash_at(args: ClassHashAt, config: CastConfig, ui: &UI) -> anyhow::Result<()> {\n    let provider = args.rpc.get_provider(&config, ui).await?;\n\n    let result = get_class_hash_at(&provider, args.contract_address, &args.block_id).await;\n\n    let chain_id = provider.chain_id().await?;\n    let block_explorer_link = block_explorer_link_if_allowed(&result, chain_id, &config).await;\n\n    process_command_result(\"get class-hash-at\", result, ui, block_explorer_link);\n    Ok(())\n}\n\nasync fn get_class_hash_at(\n    provider: &JsonRpcClient<HttpTransport>,\n    contract_address: Felt,\n    block_id: &str,\n) -> Result<ClassHashAtResponse> {\n    let block_id = get_block_id(block_id)?;\n\n    let class_hash = provider\n        .get_class_hash_at(block_id, contract_address)\n        .await\n        .map_err(|err| StarknetCommandError::ProviderError(SNCastProviderError::from(err)))?;\n\n    Ok(ClassHashAtResponse {\n        class_hash: class_hash.into_(),\n    })\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/get/mod.rs",
    "content": "use clap::{Args, Subcommand};\nuse sncast::helpers::configuration::CastConfig;\nuse sncast::response::ui::UI;\n\npub mod balance;\npub mod class_hash_at;\npub mod nonce;\npub mod transaction;\npub mod tx_status;\n\n#[derive(Args)]\n#[command(about = \"Commands for querying Starknet state\")]\npub struct Get {\n    #[command(subcommand)]\n    pub command: GetCommands,\n}\n\n#[derive(Debug, Subcommand)]\npub enum GetCommands {\n    /// Get the status of a transaction\n    TxStatus(tx_status::TxStatus),\n\n    /// Get the transaction by hash\n    Tx(transaction::Transaction),\n\n    /// Fetch balance of the account for specified token\n    Balance(balance::Balance),\n\n    /// Get nonce of a contract\n    Nonce(nonce::Nonce),\n\n    /// Get class hash of a contract at a given address\n    ClassHashAt(class_hash_at::ClassHashAt),\n}\n\npub async fn get(get: Get, config: CastConfig, ui: &UI) -> anyhow::Result<()> {\n    match get.command {\n        GetCommands::TxStatus(status) => tx_status::tx_status(status, config, ui).await?,\n\n        GetCommands::Tx(tx) => transaction::transaction(tx, config, ui).await?,\n\n        GetCommands::Balance(balance) => balance::balance(balance, config, ui).await?,\n\n        GetCommands::Nonce(nonce) => nonce::nonce(nonce, config, ui).await?,\n\n        GetCommands::ClassHashAt(args) => class_hash_at::class_hash_at(args, config, ui).await?,\n    }\n\n    Ok(())\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/get/nonce.rs",
    "content": "use anyhow::Result;\nuse clap::Args;\nuse sncast::get_block_id;\nuse sncast::helpers::command::process_command_result;\nuse sncast::helpers::configuration::CastConfig;\nuse sncast::helpers::rpc::RpcArgs;\nuse sncast::response::errors::{SNCastProviderError, StarknetCommandError};\nuse sncast::response::nonce::NonceResponse;\nuse sncast::response::ui::UI;\nuse starknet_rust::providers::jsonrpc::HttpTransport;\nuse starknet_rust::providers::{JsonRpcClient, Provider};\nuse starknet_types_core::felt::Felt;\n\n#[derive(Debug, Args)]\n#[command(about = \"Get the nonce of a contract\")]\npub struct Nonce {\n    /// Address of the contract\n    pub contract_address: Felt,\n\n    /// Block identifier on which nonce should be fetched.\n    /// Possible values: `pre_confirmed`, `latest`, block hash (0x prefixed string)\n    /// and block number (u64)\n    #[arg(short, long, default_value = \"pre_confirmed\")]\n    pub block_id: String,\n\n    #[command(flatten)]\n    pub rpc: RpcArgs,\n}\n\npub async fn nonce(nonce: Nonce, config: CastConfig, ui: &UI) -> Result<()> {\n    let provider = nonce.rpc.get_provider(&config, ui).await?;\n\n    let result = get_nonce(&provider, nonce.contract_address, &nonce.block_id).await;\n\n    process_command_result(\"get nonce\", result, ui, None);\n    Ok(())\n}\n\npub async fn get_nonce(\n    provider: &JsonRpcClient<HttpTransport>,\n    contract_address: Felt,\n    block_id: &str,\n) -> Result<NonceResponse> {\n    let block_id = get_block_id(block_id)?;\n    let nonce = provider\n        .get_nonce(block_id, contract_address)\n        .await\n        .map_err(|err| StarknetCommandError::ProviderError(SNCastProviderError::from(err)))?;\n    Ok(NonceResponse { nonce })\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/get/transaction.rs",
    "content": "use anyhow::Context;\nuse clap::Args;\nuse sncast::helpers::command::process_command_result;\nuse sncast::helpers::configuration::CastConfig;\nuse sncast::helpers::rpc::RpcArgs;\nuse sncast::response::errors::StarknetCommandError;\nuse sncast::response::explorer_link::block_explorer_link_if_allowed;\nuse sncast::response::transaction::TransactionResponse;\nuse sncast::response::ui::UI;\nuse starknet_rust::core::types::TransactionResponseFlag;\nuse starknet_rust::providers::jsonrpc::HttpTransport;\nuse starknet_rust::providers::{JsonRpcClient, Provider};\nuse starknet_types_core::felt::Felt;\n\n#[derive(Debug, Args)]\n#[command(about = \"Get the details of a transaction\")]\npub struct Transaction {\n    #[allow(clippy::struct_field_names)]\n    /// Hash of the transaction\n    pub transaction_hash: Felt,\n\n    /// Include proof facts in transaction response\n    #[arg(long)]\n    pub with_proof_facts: bool,\n\n    #[command(flatten)]\n    pub rpc: RpcArgs,\n}\n\npub async fn transaction(tx: Transaction, config: CastConfig, ui: &UI) -> anyhow::Result<()> {\n    let provider = tx.rpc.get_provider(&config, ui).await?;\n\n    let result = get_transaction(&provider, tx.transaction_hash, tx.with_proof_facts)\n        .await\n        .context(\"Failed to get transaction\");\n\n    let chain_id = provider.chain_id().await?;\n    let block_explorer_link = block_explorer_link_if_allowed(&result, chain_id, &config).await;\n\n    process_command_result(\"get tx\", result, ui, block_explorer_link);\n    Ok(())\n}\n\nasync fn get_transaction(\n    provider: &JsonRpcClient<HttpTransport>,\n    transaction_hash: Felt,\n    with_proof_facts: bool,\n) -> Result<TransactionResponse, StarknetCommandError> {\n    let response_flags = if with_proof_facts {\n        Some(&[TransactionResponseFlag::IncludeProofFacts][..])\n    } else {\n        None\n    };\n    provider\n        .get_transaction_by_hash(transaction_hash, response_flags)\n        .await\n        .map(TransactionResponse)\n        .map_err(|err| StarknetCommandError::ProviderError(err.into()))\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/get/tx_status.rs",
    "content": "use anyhow::Context;\nuse clap::Args;\nuse sncast::helpers::command::process_command_result;\nuse sncast::helpers::configuration::CastConfig;\nuse sncast::helpers::rpc::RpcArgs;\nuse sncast::response::errors::StarknetCommandError;\nuse sncast::response::tx_status::{ExecutionStatus, FinalityStatus, TransactionStatusResponse};\nuse sncast::response::ui::UI;\nuse starknet_rust::core::types::{TransactionExecutionStatus, TransactionStatus};\nuse starknet_rust::providers::jsonrpc::HttpTransport;\nuse starknet_rust::providers::{JsonRpcClient, Provider};\nuse starknet_types_core::felt::Felt;\n\n#[derive(Debug, Args)]\n#[command(about = \"Get the status of a transaction\")]\npub struct TxStatus {\n    /// Hash of the transaction\n    pub transaction_hash: Felt,\n\n    #[command(flatten)]\n    pub rpc: RpcArgs,\n}\n\npub async fn tx_status(tx_status: TxStatus, config: CastConfig, ui: &UI) -> anyhow::Result<()> {\n    let provider = tx_status.rpc.get_provider(&config, ui).await?;\n\n    let result = get_tx_status(&provider, tx_status.transaction_hash)\n        .await\n        .context(\"Failed to get transaction status\");\n\n    process_command_result(\"get tx-status\", result, ui, None);\n    Ok(())\n}\n\npub async fn get_tx_status(\n    provider: &JsonRpcClient<HttpTransport>,\n    transaction_hash: Felt,\n) -> Result<TransactionStatusResponse, StarknetCommandError> {\n    provider\n        .get_transaction_status(transaction_hash)\n        .await\n        .map(|status| build_transaction_status_response(&status))\n        .map_err(|error| StarknetCommandError::ProviderError(error.into()))\n}\n\nfn build_transaction_status_response(status: &TransactionStatus) -> TransactionStatusResponse {\n    match status {\n        TransactionStatus::Received => TransactionStatusResponse {\n            finality_status: FinalityStatus::Received,\n            execution_status: None,\n        },\n        TransactionStatus::Candidate => TransactionStatusResponse {\n            finality_status: FinalityStatus::Candidate,\n            execution_status: None,\n        },\n        TransactionStatus::PreConfirmed(tx_exec_result) => TransactionStatusResponse {\n            finality_status: FinalityStatus::PreConfirmed,\n            execution_status: Some(build_execution_status(tx_exec_result.status())),\n        },\n        TransactionStatus::AcceptedOnL2(tx_exec_result) => TransactionStatusResponse {\n            finality_status: FinalityStatus::AcceptedOnL2,\n            execution_status: Some(build_execution_status(tx_exec_result.status())),\n        },\n        TransactionStatus::AcceptedOnL1(tx_exec_result) => TransactionStatusResponse {\n            finality_status: FinalityStatus::AcceptedOnL1,\n            execution_status: Some(build_execution_status(tx_exec_result.status())),\n        },\n    }\n}\n\nfn build_execution_status(status: TransactionExecutionStatus) -> ExecutionStatus {\n    match status {\n        TransactionExecutionStatus::Succeeded => ExecutionStatus::Succeeded,\n        TransactionExecutionStatus::Reverted => ExecutionStatus::Reverted,\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/invoke.rs",
    "content": "use crate::Arguments;\nuse crate::starknet_commands::utils::felt_or_id::FeltOrId;\nuse anyhow::{Context, Result, anyhow};\nuse clap::Args;\nuse conversions::IntoConv;\nuse sncast::helpers::fee::{FeeArgs, FeeSettings};\nuse sncast::helpers::proof::ProofArgs;\nuse sncast::helpers::rpc::RpcArgs;\nuse sncast::response::errors::StarknetCommandError;\nuse sncast::response::invoke::InvokeResponse;\nuse sncast::response::ui::UI;\nuse sncast::{WaitForTx, apply_optional_fields, handle_wait_for_tx};\nuse starknet_rust::accounts::AccountError::Provider;\nuse starknet_rust::accounts::{Account, ConnectedAccount, ExecutionV3, SingleOwnerAccount};\nuse starknet_rust::core::types::{Call, InvokeTransactionResult};\nuse starknet_rust::providers::JsonRpcClient;\nuse starknet_rust::providers::jsonrpc::HttpTransport;\nuse starknet_rust::signers::Signer;\nuse starknet_types_core::felt::Felt;\n\n#[derive(Args, Clone, Debug)]\npub struct InvokeCommonArgs {\n    /// Address of contract to invoke\n    #[arg(short = 'd', long)]\n    pub contract_address: FeltOrId,\n\n    /// Name of the function to invoke\n    #[arg(short, long)]\n    pub function: String,\n\n    #[command(flatten)]\n    pub arguments: Arguments,\n}\n\n#[derive(Args, Clone, Debug)]\n#[command(about = \"Invoke a contract on Starknet\")]\npub struct Invoke {\n    #[command(flatten)]\n    pub common: InvokeCommonArgs,\n\n    #[command(flatten)]\n    pub fee_args: FeeArgs,\n\n    #[command(flatten)]\n    pub proof_args: ProofArgs,\n\n    /// Nonce of the transaction. If not provided, nonce will be set automatically\n    #[arg(short, long)]\n    pub nonce: Option<Felt>,\n\n    #[command(flatten)]\n    pub rpc: RpcArgs,\n}\n\n#[expect(clippy::too_many_arguments)]\npub async fn invoke<S>(\n    contract_address: Felt,\n    calldata: Vec<Felt>,\n    nonce: Option<Felt>,\n    fee_args: FeeArgs,\n    proof_args: ProofArgs,\n    function_selector: Felt,\n    account: &SingleOwnerAccount<&JsonRpcClient<HttpTransport>, S>,\n    wait_config: WaitForTx,\n    ui: &UI,\n) -> Result<InvokeResponse, StarknetCommandError>\nwhere\n    S: Signer + Sync + Send,\n{\n    let call = Call {\n        to: contract_address,\n        selector: function_selector,\n        calldata,\n    };\n\n    execute_calls(\n        account,\n        vec![call],\n        fee_args,\n        proof_args,\n        nonce,\n        wait_config,\n        ui,\n    )\n    .await\n}\n\npub async fn execute_calls<S>(\n    account: &SingleOwnerAccount<&JsonRpcClient<HttpTransport>, S>,\n    calls: Vec<Call>,\n    fee_args: FeeArgs,\n    proof_args: ProofArgs,\n    nonce: Option<Felt>,\n    wait_config: WaitForTx,\n    ui: &UI,\n) -> Result<InvokeResponse, StarknetCommandError>\nwhere\n    S: Signer + Sync + Send,\n{\n    let execution_calls = account.execute_v3(calls);\n\n    let fee_settings = if fee_args.max_fee.is_some() {\n        let fee_estimate = execution_calls\n            .estimate_fee()\n            .await\n            .expect(\"Failed to estimate fee\");\n        fee_args.try_into_fee_settings(Some(&fee_estimate))\n    } else {\n        fee_args.try_into_fee_settings(None)\n    };\n\n    let FeeSettings {\n        l1_gas,\n        l1_gas_price,\n        l2_gas,\n        l2_gas_price,\n        l1_data_gas,\n        l1_data_gas_price,\n        tip,\n    } = fee_settings.expect(\"Failed to convert to fee settings\");\n\n    let proof = proof_args\n        .resolve_proof()\n        .context(\"Failed to resolve proof\")?;\n    let proof_facts = proof_args\n        .resolve_proof_facts()\n        .context(\"Failed to resolve proof facts\")?;\n\n    let execution = apply_optional_fields!(\n        execution_calls,\n        l1_gas => ExecutionV3::l1_gas,\n        l1_gas_price => ExecutionV3::l1_gas_price,\n        l2_gas => ExecutionV3::l2_gas,\n        l2_gas_price => ExecutionV3::l2_gas_price,\n        l1_data_gas => ExecutionV3::l1_data_gas,\n        l1_data_gas_price => ExecutionV3::l1_data_gas_price,\n        tip => ExecutionV3::tip,\n        nonce => ExecutionV3::nonce,\n        proof => ExecutionV3::proof,\n        proof_facts => ExecutionV3::proof_facts\n    );\n    let result = execution.send().await;\n\n    match result {\n        Ok(InvokeTransactionResult { transaction_hash }) => handle_wait_for_tx(\n            account.provider(),\n            transaction_hash,\n            InvokeResponse {\n                transaction_hash: transaction_hash.into_(),\n            },\n            wait_config,\n            ui,\n        )\n        .await\n        .map_err(StarknetCommandError::from),\n        Err(Provider(error)) => Err(StarknetCommandError::ProviderError(error.into())),\n        Err(error) => Err(anyhow!(format!(\"Unexpected error occurred: {error}\")).into()),\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/ledger/app_version.rs",
    "content": "use anyhow::{Context, Result};\nuse clap::Args;\nuse coins_ledger::transports::LedgerAsync;\nuse starknet_rust::signers::ledger::LedgerStarknetApp;\n\nuse sncast::response::ledger::{LedgerResponse, VersionResponse};\n\n#[derive(Args, Debug)]\npub struct AppVersion;\n\npub async fn app_version<T: LedgerAsync + 'static>(\n    _args: &AppVersion,\n    ledger: LedgerStarknetApp<T>,\n) -> Result<LedgerResponse> {\n    let version = ledger\n        .get_version()\n        .await\n        .context(\"Failed to get app version from Ledger\")?;\n\n    Ok(LedgerResponse::Version(VersionResponse {\n        version: version.to_string(),\n    }))\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/ledger/get_public_key.rs",
    "content": "use anyhow::{Context, Result};\nuse clap::Args;\nuse coins_ledger::transports::LedgerAsync;\nuse conversions::string::IntoHexStr;\nuse sncast::helpers::ledger::LedgerKeyLocator;\nuse sncast::response::ui::UI;\nuse starknet_rust::signers::ledger::LedgerStarknetApp;\n\nuse sncast::response::ledger::{LedgerResponse, PublicKeyResponse};\n\n#[derive(Args, Debug)]\npub struct GetPublicKey {\n    #[command(flatten)]\n    pub key_locator: LedgerKeyLocator,\n\n    /// Do not display the public key on Ledger's screen for confirmation\n    #[arg(long)]\n    pub no_display: bool,\n}\n\npub async fn get_public_key<T: LedgerAsync + 'static>(\n    args: &GetPublicKey,\n    ledger: LedgerStarknetApp<T>,\n    ui: &UI,\n) -> Result<LedgerResponse> {\n    let path = args.key_locator.resolve(ui);\n\n    if !args.no_display {\n        ui.print_notification(\"Please confirm the public key on your Ledger device...\\n\");\n    }\n\n    let public_key = ledger\n        .get_public_key(path, !args.no_display)\n        .await\n        .context(\"Failed to get public key from Ledger\")?;\n\n    Ok(LedgerResponse::PublicKey(PublicKeyResponse {\n        public_key: public_key.scalar().into_hex_string(),\n    }))\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/ledger/mod.rs",
    "content": "use anyhow::Result;\nuse clap::{Args, Subcommand};\nuse sncast::helpers::ledger::create_ledger_app;\nuse sncast::response::ui::UI;\n\nuse sncast::response::ledger::LedgerResponse;\n\nuse app_version::{AppVersion, app_version};\nuse get_public_key::{GetPublicKey, get_public_key};\nuse sign_hash::{SignHash, sign_hash};\n\npub mod app_version;\npub mod get_public_key;\npub mod sign_hash;\n\n#[derive(Args, Debug)]\n#[command(about = \"Interact with Ledger hardware wallet\")]\npub struct Ledger {\n    #[command(subcommand)]\n    subcommand: LedgerSubcommand,\n}\n\n#[derive(Subcommand, Debug)]\nenum LedgerSubcommand {\n    /// Get public key from Ledger device\n    GetPublicKey(GetPublicKey),\n    /// Sign a hash using Ledger device\n    SignHash(SignHash),\n    /// Get Starknet app version from Ledger device\n    AppVersion(AppVersion),\n}\n\npub async fn ledger(ledger_args: &Ledger, ui: &UI) -> Result<LedgerResponse> {\n    let ledger = create_ledger_app().await?;\n\n    match &ledger_args.subcommand {\n        LedgerSubcommand::GetPublicKey(args) => get_public_key(args, ledger, ui).await,\n        LedgerSubcommand::SignHash(args) => sign_hash(args, ledger, ui).await,\n        LedgerSubcommand::AppVersion(args) => app_version(args, ledger).await,\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/ledger/sign_hash.rs",
    "content": "use anyhow::{Context, Result};\nuse clap::Args;\nuse coins_ledger::transports::LedgerAsync;\nuse conversions::string::IntoHexStr;\nuse foundry_ui::components::warning::WarningMessage;\nuse sncast::helpers::ledger::LedgerKeyLocator;\nuse sncast::response::ui::UI;\nuse starknet_rust::signers::ledger::LedgerStarknetApp;\nuse starknet_types_core::felt::Felt;\n\nuse sncast::response::ledger::{LedgerResponse, SignatureResponse};\n\n#[derive(Args, Debug)]\npub struct SignHash {\n    #[command(flatten)]\n    pub key_locator: LedgerKeyLocator,\n\n    /// The raw hash to be signed\n    pub hash: Felt,\n}\n\npub async fn sign_hash<T: LedgerAsync + 'static>(\n    args: &SignHash,\n    ledger: LedgerStarknetApp<T>,\n    ui: &UI,\n) -> Result<LedgerResponse> {\n    let path = args.key_locator.resolve(ui);\n\n    ui.print_warning(WarningMessage::new(\n        \"Blind signing a raw hash could be dangerous. Make sure you ONLY sign hashes \\\n        from trusted sources. For better security, sign full transactions instead \\\n        of raw hashes whenever possible.\",\n    ));\n    ui.print_blank_line();\n\n    ui.print_notification(\"Please confirm the signing operation on your Ledger\\n\");\n\n    let signature = ledger\n        .sign_hash(path, &args.hash)\n        .await\n        .context(\"Failed to sign hash with Ledger\")?;\n\n    Ok(LedgerResponse::Signature(SignatureResponse {\n        r: signature.r.into_hex_string(),\n        s: signature.s.into_hex_string(),\n    }))\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/mod.rs",
    "content": "pub mod account;\npub mod call;\npub mod declare;\npub mod declare_from;\npub mod deploy;\npub mod get;\npub mod invoke;\npub mod ledger;\npub mod multicall;\npub mod script;\npub mod show_config;\npub mod utils;\npub mod verify;\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/multicall/contract_registry.rs",
    "content": "use anyhow::{Context, Result, bail};\nuse sncast::{get_class_hash_by_address, get_contract_class};\nuse starknet_rust::{\n    core::types::ContractClass,\n    providers::{JsonRpcClient, jsonrpc::HttpTransport},\n};\nuse starknet_types_core::felt::Felt;\nuse std::collections::{HashMap, hash_map::Entry};\n\n/// Registry for managing contract information during multicall execution.\n/// It stores the following mappings:\n/// - user-defined ids to contract addresses\n/// - contract addresses to class hashes\n/// - class hashes to contract classes\n///   to allow referencing and re-using deployed contracts across multiple calls in a multicall sequence.\npub struct ContractRegistry {\n    id_to_address: HashMap<String, Felt>,\n    address_to_class_hash: HashMap<Felt, Felt>,\n    class_hash_to_contract_class: HashMap<Felt, ContractClass>,\n    provider: JsonRpcClient<HttpTransport>,\n}\n\nimpl ContractRegistry {\n    pub fn new(provider: &JsonRpcClient<HttpTransport>) -> Self {\n        ContractRegistry {\n            id_to_address: HashMap::new(),\n            address_to_class_hash: HashMap::new(),\n            class_hash_to_contract_class: HashMap::new(),\n            provider: provider.clone(),\n        }\n    }\n\n    /// Retrieves the contract address associated with the given id, if it exists.\n    pub fn get_address_by_id(&self, id: &str) -> Option<Felt> {\n        self.id_to_address.get(id).copied()\n    }\n\n    /// Inserts a mapping from the given id to the specified contract address.\n    /// Returns an error if the id already exists.\n    pub fn insert_new_id_to_address(&mut self, id: String, address: Felt) -> Result<()> {\n        if self.id_to_address.contains_key(&id) {\n            anyhow::bail!(\"Duplicate id found: {id}\");\n        }\n        self.id_to_address.insert(id, address);\n        Ok(())\n    }\n\n    /// Retrieves the class hash associated with the given contract address.\n    /// Checks the local cache first, and fetches from the provider if not cached.\n    pub async fn get_class_hash_by_address(&mut self, address: &Felt) -> Result<Felt> {\n        if let Some(hash) = self.get_class_hash_by_address_local(address) {\n            return Ok(hash);\n        }\n        let class_hash = get_class_hash_by_address(&self.provider, *address)\n            .await\n            .context(\"Failed to fetch class hash from provider\")?;\n        self.address_to_class_hash.insert(*address, class_hash);\n        Ok(class_hash)\n    }\n\n    /// Retrieves the class hash associated with the given contract address from the local cache, if it exists.\n    pub fn get_class_hash_by_address_local(&self, address: &Felt) -> Option<Felt> {\n        self.address_to_class_hash.get(address).copied()\n    }\n\n    /// Inserts a mapping from the given contract address to the specified class hash.\n    /// Returns an error if the address already exists.\n    pub fn insert_new_address(&mut self, address: Felt, class_hash: Felt) -> Result<()> {\n        if let Entry::Vacant(e) = self.address_to_class_hash.entry(address) {\n            e.insert(class_hash);\n            Ok(())\n        } else {\n            bail!(\"Duplicate address found: {address}\")\n        }\n    }\n\n    /// Retrieves the contract class associated with the given class hash, if it exists.\n    /// If not found in the cache, it queries the provider and updates the cache.\n    pub async fn get_contract_class_by_class_hash(\n        &mut self,\n        class_hash: &Felt,\n    ) -> Result<&ContractClass> {\n        if self.class_hash_to_contract_class.contains_key(class_hash) {\n            return Ok(self\n                .class_hash_to_contract_class\n                .get(class_hash)\n                .expect(\"Contract class should exist\"));\n        }\n\n        let contract_class = get_contract_class(*class_hash, &self.provider)\n            .await\n            .context(\"Failed to fetch contract class from provider\")?;\n\n        Ok(self\n            .class_hash_to_contract_class\n            .entry(*class_hash)\n            .or_insert(contract_class))\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::ContractRegistry;\n    use starknet_rust::providers::{JsonRpcClient, jsonrpc::HttpTransport};\n    use starknet_types_core::felt::Felt;\n    use url::Url;\n\n    #[test]\n    fn test_insert_and_get() {\n        let mock_provider = JsonRpcClient::new(HttpTransport::new(\n            Url::parse(\"http://localhost:8545\").unwrap(),\n        ));\n        let mut registry = ContractRegistry::new(&mock_provider);\n        let id = \"contract1\".to_string();\n        let address = Felt::from(12345);\n\n        assert!(\n            registry\n                .insert_new_id_to_address(id.clone(), address)\n                .is_ok()\n        );\n        assert_eq!(registry.get_address_by_id(&id), Some(address));\n    }\n\n    #[test]\n    fn test_duplicate_id() {\n        let mock_provider = JsonRpcClient::new(HttpTransport::new(\n            Url::parse(\"http://localhost:8545\").unwrap(),\n        ));\n        let mut registry = ContractRegistry::new(&mock_provider);\n        let id = \"contract1\".to_string();\n        let address1 = Felt::from(12345);\n        let address2 = Felt::from(67890);\n\n        assert!(\n            registry\n                .insert_new_id_to_address(id.clone(), address1)\n                .is_ok()\n        );\n\n        // Attempt to insert a duplicate id\n        assert!(\n            registry\n                .insert_new_id_to_address(id.clone(), address2)\n                .is_err()\n        );\n\n        // Ensure the original address is still retrievable\n        assert_eq!(registry.get_address_by_id(&id), Some(address1));\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/multicall/deploy.rs",
    "content": "use anyhow::{Context, Result};\nuse clap::Args;\nuse sncast::helpers::constants::UDC_ADDRESS;\nuse sncast::{extract_or_generate_salt, udc_uniqueness};\nuse starknet_rust::accounts::{Account, SingleOwnerAccount};\nuse starknet_rust::core::types::Call;\nuse starknet_rust::core::utils::{get_selector_from_name, get_udc_deployed_address};\nuse starknet_rust::providers::JsonRpcClient;\nuse starknet_rust::providers::jsonrpc::HttpTransport;\nuse starknet_rust::signers::Signer;\nuse starknet_types_core::felt::Felt;\n\nuse crate::starknet_commands::deploy::{ContractIdentifier, DeployArguments, DeployCommonArgs};\nuse crate::starknet_commands::multicall::contract_registry::ContractRegistry;\nuse crate::starknet_commands::multicall::replaced_arguments;\nuse crate::starknet_commands::multicall::run::{DeployItem, parse_inputs};\nuse crate::{Arguments, calldata_to_felts};\n\n#[derive(Args)]\npub struct MulticallDeploy {\n    /// Optional identifier to reference this contract in later steps\n    #[arg(long)]\n    pub id: Option<String>,\n\n    #[command(flatten)]\n    pub common: DeployCommonArgs,\n}\n\nimpl MulticallDeploy {\n    pub fn new_from_item(item: &DeployItem, contracts: &ContractRegistry) -> Result<Self> {\n        let constructor_calldata = parse_inputs(&item.inputs, contracts)?;\n        let deploy = MulticallDeploy {\n            common: DeployCommonArgs {\n                contract_identifier: ContractIdentifier {\n                    class_hash: Some(item.class_hash),\n                    contract_name: None,\n                },\n                arguments: DeployArguments {\n                    constructor_calldata: Some(\n                        constructor_calldata\n                            .iter()\n                            .map(ToString::to_string)\n                            .collect(),\n                    ),\n                    arguments: None,\n                },\n                salt: item.salt,\n                unique: item.unique,\n                package: None,\n            },\n            id: item.id.clone(),\n        };\n\n        Ok(deploy)\n    }\n\n    pub async fn build_call<S>(\n        &self,\n        account: &SingleOwnerAccount<&JsonRpcClient<HttpTransport>, S>,\n        contract_registry: &mut ContractRegistry,\n    ) -> Result<Call>\n    where\n        S: Signer + Sync + Send,\n    {\n        let salt = extract_or_generate_salt(self.common.salt);\n        let constructor_arguments = replaced_arguments(\n            &Arguments::from(self.common.arguments.clone()),\n            contract_registry,\n        )?;\n\n        let constructor_selector = get_selector_from_name(\"constructor\")?;\n        let class_hash = self\n            .common\n            .contract_identifier\n            .class_hash\n            .context(\"Using deploy with multicall requires providing class hash\")?;\n        let constructor_calldata = if let Some(raw_calldata) = &constructor_arguments.calldata {\n            calldata_to_felts(raw_calldata)?\n        } else {\n            let contract_class = contract_registry\n                .get_contract_class_by_class_hash(&class_hash)\n                .await?;\n            constructor_arguments.try_into_calldata(contract_class, &constructor_selector)?\n        };\n\n        let mut calldata = vec![\n            class_hash,\n            salt,\n            Felt::from(u8::from(self.common.unique)),\n            constructor_calldata.len().into(),\n        ];\n        calldata.extend_from_slice(&constructor_calldata);\n\n        let contract_address = get_udc_deployed_address(\n            salt,\n            class_hash,\n            &udc_uniqueness(self.common.unique, account.address()),\n            &constructor_calldata,\n        );\n\n        if contract_registry\n            .get_class_hash_by_address_local(&contract_address)\n            .is_none()\n        {\n            contract_registry.insert_new_address(contract_address, class_hash)?;\n        }\n\n        // Store the contract address in the context with the provided id for later use in invoke calls\n        if let Some(id) = &self.id {\n            contract_registry.insert_new_id_to_address(id.clone(), contract_address)?;\n        }\n\n        Ok(Call {\n            to: UDC_ADDRESS,\n            selector: get_selector_from_name(\"deployContract\")?,\n            calldata,\n        })\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/multicall/execute.rs",
    "content": "use anyhow::{Context, Result, bail};\nuse clap::{Args, Command, FromArgMatches};\nuse sncast::{\n    WaitForTx,\n    helpers::{fee::FeeArgs, rpc::RpcArgs},\n    response::{\n        errors::handle_starknet_command_error, multicall::run::MulticallRunResponse, ui::UI,\n    },\n};\nuse starknet_rust::{\n    accounts::SingleOwnerAccount,\n    providers::{JsonRpcClient, jsonrpc::HttpTransport},\n    signers::Signer,\n};\nuse starknet_types_core::felt::Felt;\n\nuse crate::starknet_commands::{\n    invoke::execute_calls,\n    multicall::{\n        contract_registry::ContractRegistry, deploy::MulticallDeploy, invoke::MulticallInvoke,\n    },\n};\nuse sncast::helpers::proof::ProofArgs;\n\nconst ALLOWED_MULTICALL_COMMANDS: [&str; 2] = [\"deploy\", \"invoke\"];\n\n#[derive(Args, Debug, Clone)]\n#[command(about = \"Execute a multicall with CLI arguments\")]\npub struct Execute {\n    #[command(flatten)]\n    pub fee_args: FeeArgs,\n\n    #[command(flatten)]\n    pub rpc: RpcArgs,\n\n    /// Nonce of the transaction. If not provided, nonce will be set automatically\n    #[arg(short, long)]\n    pub nonce: Option<Felt>,\n\n    /// The multicall arguments. Subsequent calls should be separated by a '/' token.\n    ///\n    /// Supported commands: `invoke`, `deploy`.\n    /// Their syntax is the same as `sncast invoke` and `sncast deploy`.\n    /// Use `sncast  invoke --help` and `sncast deploy --help` for reference.\n    ///\n    /// Additionally, `deploy` supports `--id <ID>` argument to name the deployed contract in this multicall.\n    /// In subsequent calls, `@<ID>` can be referenced in `--contract-address` and `--calldata` flags to reference the deployed contract address.\n    ///\n    /// For more, read the documentation: `<https://foundry-rs.github.io/starknet-foundry/starknet/multicall.html#multicall-with-cli-arguments>`\n    #[arg(allow_hyphen_values = true, num_args = 1..)]\n    pub tokens: Vec<String>,\n}\n\npub async fn execute<S>(\n    execute: Execute,\n    account: &SingleOwnerAccount<&JsonRpcClient<HttpTransport>, S>,\n    provider: &JsonRpcClient<HttpTransport>,\n    wait_config: WaitForTx,\n    ui: &UI,\n) -> Result<MulticallRunResponse>\nwhere\n    S: Signer + Sync + Send,\n{\n    let command_groups = extract_commands_groups(&execute.tokens, \"/\", &ALLOWED_MULTICALL_COMMANDS);\n\n    let mut contract_registry = ContractRegistry::new(provider);\n    let mut calls = vec![];\n\n    for group in command_groups {\n        let cmd_name = &group[0];\n        let cmd_args = &group[1..];\n\n        match cmd_name.as_str() {\n            \"deploy\" => {\n                let call = parse_args::<MulticallDeploy>(cmd_name, cmd_args)?\n                    .build_call(account, &mut contract_registry)\n                    .await?;\n                calls.push(call);\n            }\n            \"invoke\" => {\n                let call = parse_args::<MulticallInvoke>(cmd_name, cmd_args)?\n                    .build_call(&mut contract_registry)\n                    .await?;\n                calls.push(call);\n            }\n            _ => bail!(\n                \"Unknown multicall command: '{}'. Allowed commands: {}\",\n                cmd_name,\n                ALLOWED_MULTICALL_COMMANDS.join(\", \")\n            ),\n        }\n    }\n\n    if calls.is_empty() {\n        bail!(\"No valid multicall commands found to execute. Please check the provided commands.\");\n    }\n\n    execute_calls(\n        account,\n        calls,\n        execute.fee_args,\n        ProofArgs::none(),\n        execute.nonce,\n        wait_config,\n        ui,\n    )\n    .await\n    .map(Into::into)\n    .map_err(handle_starknet_command_error)\n}\n\n/// Groups tokens into separate command groups based on the provided separator and allowed commands.\nfn extract_commands_groups(\n    tokens: &[String],\n    separator: &str,\n    commands: &[&str],\n) -> Vec<Vec<String>> {\n    let mut all_groups = Vec::new();\n    let mut current_group = Vec::new();\n\n    let mut i = 0;\n    while i < tokens.len() {\n        let token = &tokens[i];\n\n        if token == separator {\n            // Look ahead to find the next non-separator token\n            let mut j = i + 1;\n            while j < tokens.len() && tokens[j] == separator {\n                j += 1;\n            }\n\n            let is_at_end = j == tokens.len();\n            let next_is_command = !is_at_end && commands.contains(&tokens[j].as_str());\n\n            // If the sequence of separators leads to a command or the end of the input,\n            // it acts as a valid boundary.\n            if is_at_end || next_is_command {\n                if !current_group.is_empty() {\n                    all_groups.push(current_group);\n                    current_group = Vec::new();\n                }\n                // Fast-forward the index to skip all consecutive separators\n                i = j;\n                continue;\n            }\n        }\n\n        current_group.push(token.clone());\n        i += 1;\n    }\n\n    if !current_group.is_empty() {\n        all_groups.push(current_group);\n    }\n\n    all_groups\n}\n\nfn parse_args<T>(command_name: &str, tokens: &[String]) -> anyhow::Result<T>\nwhere\n    T: Args + FromArgMatches,\n{\n    let cmd = T::augment_args(Command::new(command_name.to_string()));\n\n    let argv = std::iter::once(command_name)\n        .chain(tokens.iter().map(String::as_str))\n        .collect::<Vec<_>>();\n\n    let matches = cmd\n        .try_get_matches_from(argv)\n        .with_context(|| format!(\"Failed to parse args for `{command_name}`\"))?;\n\n    T::from_arg_matches(&matches).map_err(Into::into)\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    fn create_tokens(commands: Vec<&str>) -> Vec<String> {\n        commands.into_iter().map(String::from).collect()\n    }\n\n    #[test]\n    fn test_extract_commands_groups() {\n        let tokens = create_tokens(vec![\n            \"deploy\",\n            \"--class-hash\",\n            \"0x123\",\n            \"/\",\n            \"invoke\",\n            \"--contract-address\",\n            \"0xabc\",\n            \"--function\",\n            \"my_function\",\n            \"/\",\n            \"deploy\",\n            \"--class-hash\",\n            \"0x456\",\n        ]);\n\n        let groups = extract_commands_groups(&tokens, \"/\", &ALLOWED_MULTICALL_COMMANDS);\n        assert_eq!(\n            groups,\n            vec![\n                create_tokens(vec![\"deploy\", \"--class-hash\", \"0x123\"]),\n                create_tokens(vec![\n                    \"invoke\",\n                    \"--contract-address\",\n                    \"0xabc\",\n                    \"--function\",\n                    \"my_function\"\n                ]),\n                create_tokens(vec![\"deploy\", \"--class-hash\", \"0x456\"])\n            ]\n        );\n    }\n\n    #[test]\n    fn test_extract_commands_groups_leading_slash() {\n        let tokens = vec![\"/\", \"deploy\", \"--class-hash\", \"0x123\"]\n            .into_iter()\n            .map(String::from)\n            .collect::<Vec<_>>();\n\n        let groups = extract_commands_groups(&tokens, \"/\", &ALLOWED_MULTICALL_COMMANDS);\n        assert_eq!(\n            groups,\n            vec![create_tokens(vec![\"deploy\", \"--class-hash\", \"0x123\"])]\n        );\n    }\n\n    #[test]\n    fn test_extract_commands_groups_trailing_slash() {\n        let tokens = create_tokens(vec![\"deploy\", \"--class-hash\", \"0x123\", \"/\"]);\n\n        let groups = extract_commands_groups(&tokens, \"/\", &ALLOWED_MULTICALL_COMMANDS);\n        assert_eq!(\n            groups,\n            vec![create_tokens(vec![\"deploy\", \"--class-hash\", \"0x123\"])]\n        );\n    }\n\n    #[test]\n    fn test_extract_commands_groups_consecutive_slashes() {\n        let tokens = create_tokens(vec![\n            \"deploy\",\n            \"--class-hash\",\n            \"0x123\",\n            \"/\",\n            \"/\",\n            \"invoke\",\n            \"--contract-address\",\n            \"0xabc\",\n        ]);\n\n        let groups = extract_commands_groups(&tokens, \"/\", &ALLOWED_MULTICALL_COMMANDS);\n        assert_eq!(\n            groups,\n            vec![\n                create_tokens(vec![\"deploy\", \"--class-hash\", \"0x123\"]),\n                create_tokens(vec![\"invoke\", \"--contract-address\", \"0xabc\"])\n            ]\n        );\n    }\n\n    #[test]\n    fn test_extract_commands_groups_only_slashes() {\n        let tokens = create_tokens(vec![\"/\", \"/\", \"/\"]);\n\n        let groups = extract_commands_groups(&tokens, \"/\", &ALLOWED_MULTICALL_COMMANDS);\n        let expected: Vec<Vec<String>> = vec![];\n        assert_eq!(groups, expected);\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/multicall/invoke.rs",
    "content": "use anyhow::{Context, Result};\nuse clap::Args;\nuse starknet_rust::core::{types::Call, utils::get_selector_from_name};\n\nuse crate::{\n    Arguments, calldata_to_felts,\n    starknet_commands::{\n        invoke::InvokeCommonArgs,\n        multicall::{\n            contract_registry::ContractRegistry,\n            replaced_arguments,\n            run::{InvokeItem, parse_inputs},\n        },\n    },\n};\n\n#[derive(Args)]\npub struct MulticallInvoke {\n    #[command(flatten)]\n    pub common: InvokeCommonArgs,\n}\n\nimpl MulticallInvoke {\n    pub fn new_from_item(item: &InvokeItem, contracts: &ContractRegistry) -> Result<Self> {\n        let calldata = parse_inputs(&item.inputs, contracts)?;\n        let invoke = MulticallInvoke {\n            common: InvokeCommonArgs {\n                contract_address: item.contract_address.clone(),\n                function: item.function.clone(),\n                arguments: Arguments {\n                    calldata: Some(calldata.iter().map(ToString::to_string).collect()),\n                    arguments: None,\n                },\n            },\n        };\n        Ok(invoke)\n    }\n\n    pub async fn build_call(&self, contract_registry: &mut ContractRegistry) -> Result<Call> {\n        let selector = get_selector_from_name(&self.common.function)?;\n        let arguments = replaced_arguments(&self.common.arguments, contract_registry)?;\n        let contract_address = if let Some(id) = self.common.contract_address.as_id() {\n            contract_registry\n                .get_address_by_id(id)\n                .with_context(|| format!(\"Failed to find contract address for id: {id}\"))\n        } else {\n            self.common.contract_address.try_into_felt()\n        }?;\n\n        let calldata = if let Some(raw_calldata) = &arguments.calldata {\n            calldata_to_felts(raw_calldata)?\n        } else {\n            let class_hash = contract_registry\n                .get_class_hash_by_address(&contract_address)\n                .await?;\n            let contract_class = contract_registry\n                .get_contract_class_by_class_hash(&class_hash)\n                .await?;\n            arguments.try_into_calldata(contract_class, &selector)?\n        };\n\n        Ok(Call {\n            to: contract_address,\n            selector,\n            calldata,\n        })\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/multicall/mod.rs",
    "content": "use anyhow::{Context, Result};\nuse clap::{Args, Subcommand};\nuse serde::Serialize;\nuse serde_json::{Value, json};\n\npub mod contract_registry;\npub mod deploy;\npub mod execute;\npub mod invoke;\npub mod new;\npub mod run;\n\nuse crate::starknet_commands::multicall::contract_registry::ContractRegistry;\nuse crate::starknet_commands::multicall::execute::Execute;\nuse crate::starknet_commands::utils::felt_or_id::FeltOrId;\nuse crate::{Arguments, process_command_result, starknet_commands};\nuse foundry_ui::Message;\nuse new::New;\nuse run::Run;\nuse sncast::response::ui::UI;\nuse sncast::with_account;\nuse sncast::{\n    WaitForTx, get_account,\n    helpers::{configuration::CastConfig, constants::DEFAULT_MULTICALL_CONTENTS},\n    response::explorer_link::block_explorer_link_if_allowed,\n};\nuse starknet_rust::providers::Provider;\n\n#[derive(Args)]\n#[command(about = \"Execute multiple calls at once\", long_about = None)]\npub struct Multicall {\n    #[command(subcommand)]\n    pub command: Commands,\n}\n\n#[derive(Debug, Subcommand)]\npub enum Commands {\n    Run(Box<Run>),\n    New(New),\n    Execute(Box<Execute>),\n}\n\npub async fn multicall(\n    multicall: Multicall,\n    config: CastConfig,\n    ui: &UI,\n    wait_config: WaitForTx,\n) -> Result<()> {\n    #[derive(Serialize)]\n    struct MulticallMessage {\n        file_contents: String,\n    }\n\n    impl Message for MulticallMessage {\n        fn text(&self) -> String {\n            self.file_contents.clone()\n        }\n\n        fn json(&self) -> Value {\n            json!(self)\n        }\n    }\n\n    match &multicall.command {\n        starknet_commands::multicall::Commands::New(new) => {\n            if let Some(output_path) = &new.output_path {\n                let result = starknet_commands::multicall::new::write_empty_template(\n                    output_path,\n                    new.overwrite,\n                );\n\n                process_command_result(\"multicall new\", result, ui, None);\n            } else {\n                ui.print_message(\n                    \"multicall_new\",\n                    MulticallMessage {\n                        file_contents: DEFAULT_MULTICALL_CONTENTS.to_string(),\n                    },\n                );\n            }\n            Ok(())\n        }\n        starknet_commands::multicall::Commands::Run(run) => {\n            let provider = run.rpc.get_provider(&config, ui).await?;\n\n            let account = get_account(&config, &provider, &run.rpc, ui).await?;\n            let result = with_account!(&account, |account| {\n                starknet_commands::multicall::run::run(\n                    run.clone(),\n                    account,\n                    &provider,\n                    wait_config,\n                    ui,\n                )\n                .await\n            });\n\n            let block_explorer_link =\n                block_explorer_link_if_allowed(&result, provider.chain_id().await?, &config).await;\n            process_command_result(\"multicall run\", result, ui, block_explorer_link);\n            Ok(())\n        }\n        starknet_commands::multicall::Commands::Execute(execute) => {\n            let provider = execute.rpc.get_provider(&config, ui).await?;\n            let account = get_account(&config, &provider, &execute.rpc, ui).await?;\n\n            let result = with_account!(&account, |account| {\n                starknet_commands::multicall::execute::execute(\n                    *execute.clone(),\n                    account,\n                    &provider,\n                    wait_config,\n                    ui,\n                )\n                .await\n            });\n            let block_explorer_link =\n                block_explorer_link_if_allowed(&result, provider.chain_id().await?, &config).await;\n            process_command_result(\"multicall execute\", result, ui, block_explorer_link);\n            Ok(())\n        }\n    }\n}\n\n/// Replaces arguments that reference user-defined ids with their corresponding values from the contract registry.\npub fn replaced_arguments(\n    arguments: &Arguments,\n    contracts: &ContractRegistry,\n) -> Result<Arguments> {\n    Ok(match (&arguments.calldata, &arguments.arguments) {\n        (Some(calldata), None) => {\n            let replaced_calldata = calldata\n                .iter()\n                .map(|raw_input| {\n                    let input = FeltOrId::new(raw_input.clone());\n                    if let Some(id) = input.as_id() {\n                        contracts\n                            .get_address_by_id(id)\n                            .with_context(|| {\n                                format!(\"Failed to find contract address for id: {id}\")\n                            })\n                            .map(|f| f.to_string())\n                    } else {\n                        Ok(raw_input.clone())\n                    }\n                })\n                .collect::<Result<Vec<String>>>()?;\n\n            Arguments {\n                calldata: Some(replaced_calldata),\n                arguments: None,\n            }\n        }\n        (None, _) => arguments.clone(),\n        (Some(_), Some(_)) => {\n            unreachable!(\"Only one of `calldata` or `arguments` can be provided, but both are set.\")\n        }\n    })\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/multicall/new.rs",
    "content": "use anyhow::{Result, bail};\nuse camino::Utf8PathBuf;\nuse clap::Args;\nuse sncast::{\n    helpers::constants::DEFAULT_MULTICALL_CONTENTS, response::multicall::new::MulticallNewResponse,\n};\n\n#[derive(Args, Debug)]\n#[command(about = \"Generate a template for the multicall .toml file\", long_about = None)]\npub struct New {\n    /// Output path to the file where the template is going to be saved\n    #[arg(required = true, num_args = 1)]\n    pub output_path: Option<Utf8PathBuf>,\n\n    /// If the file specified in output-path exists, this flag decides if it is going to be overwritten\n    #[arg(short = 'o', long = \"overwrite\")]\n    pub overwrite: bool,\n}\n\npub fn write_empty_template(\n    output_path: &Utf8PathBuf,\n    overwrite: bool,\n) -> Result<MulticallNewResponse> {\n    if output_path.exists() {\n        if !output_path.is_file() {\n            bail!(\"Output file cannot be a directory\");\n        }\n\n        if !overwrite {\n            bail!(\n                \"Output file already exists, if you want to overwrite it, use the `--overwrite` flag\"\n            );\n        }\n    }\n\n    std::fs::write(output_path.clone(), DEFAULT_MULTICALL_CONTENTS)?;\n\n    Ok(MulticallNewResponse {\n        path: output_path.clone(),\n        content: DEFAULT_MULTICALL_CONTENTS.to_string(),\n    })\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/multicall/run.rs",
    "content": "use std::str::FromStr;\n\nuse crate::starknet_commands::invoke::execute_calls;\nuse crate::starknet_commands::multicall::contract_registry::ContractRegistry;\nuse crate::starknet_commands::multicall::deploy::MulticallDeploy;\nuse crate::starknet_commands::multicall::invoke::MulticallInvoke;\nuse crate::starknet_commands::utils::felt_or_id::FeltOrId;\nuse anyhow::{Context, Result};\nuse camino::Utf8PathBuf;\nuse clap::Args;\nuse serde::Deserialize;\nuse serde_json::Number;\nuse sncast::WaitForTx;\nuse sncast::helpers::fee::FeeArgs;\nuse sncast::helpers::proof::ProofArgs;\nuse sncast::helpers::rpc::RpcArgs;\nuse sncast::response::errors::handle_starknet_command_error;\nuse sncast::response::multicall::run::MulticallRunResponse;\nuse sncast::response::ui::UI;\nuse starknet_rust::accounts::SingleOwnerAccount;\nuse starknet_rust::core::types::Call;\nuse starknet_rust::providers::JsonRpcClient;\nuse starknet_rust::providers::jsonrpc::HttpTransport;\nuse starknet_rust::signers::Signer;\nuse starknet_types_core::felt::Felt;\n\n#[derive(Args, Debug, Clone)]\n#[command(about = \"Execute a multicall from a .toml file\", long_about = None)]\npub struct Run {\n    /// Path to the toml file with declared operations\n    #[arg(short = 'p', long = \"path\")]\n    pub path: Utf8PathBuf,\n\n    #[command(flatten)]\n    pub fee_args: FeeArgs,\n\n    #[command(flatten)]\n    pub rpc: RpcArgs,\n\n    /// Nonce of the transaction. If not provided, nonce will be set automatically\n    #[arg(short, long)]\n    pub nonce: Option<Felt>,\n}\n\n#[derive(Deserialize, Debug)]\n#[serde(untagged)]\npub enum Input {\n    String(String),\n    Number(Number),\n}\n\n#[derive(Deserialize, Debug)]\n#[serde(tag = \"call_type\", rename_all = \"lowercase\")]\nenum CallItem {\n    Deploy(DeployItem),\n    Invoke(InvokeItem),\n}\n\n#[derive(Deserialize, Debug)]\nstruct MulticallFile {\n    #[serde(rename = \"call\")]\n    calls: Vec<CallItem>,\n}\n\n#[derive(Deserialize, Debug)]\npub struct DeployItem {\n    pub class_hash: Felt,\n    pub inputs: Vec<Input>,\n    pub unique: bool,\n    pub salt: Option<Felt>,\n    pub id: Option<String>,\n}\n\n#[derive(Deserialize, Debug)]\npub struct InvokeItem {\n    pub contract_address: FeltOrId,\n    pub function: String,\n    pub inputs: Vec<Input>,\n}\n\npub async fn run<S>(\n    run: Box<Run>,\n    account: &SingleOwnerAccount<&JsonRpcClient<HttpTransport>, S>,\n    provider: &JsonRpcClient<HttpTransport>,\n    wait_config: WaitForTx,\n    ui: &UI,\n) -> Result<MulticallRunResponse>\nwhere\n    S: Signer + Sync + Send,\n{\n    let fee_args = run.fee_args.clone();\n    let nonce = run.nonce;\n\n    let contents = std::fs::read_to_string(&run.path)?;\n    let multicall: MulticallFile =\n        toml::from_str(&contents).with_context(|| format!(\"Failed to parse {}\", run.path))?;\n\n    let mut contracts = ContractRegistry::new(provider);\n    let mut parsed_calls: Vec<Call> = vec![];\n\n    for call in multicall.calls {\n        match call {\n            CallItem::Deploy(item) => {\n                let call = MulticallDeploy::new_from_item(&item, &contracts)?\n                    .build_call(account, &mut contracts)\n                    .await?;\n                parsed_calls.push(call);\n            }\n            CallItem::Invoke(item) => {\n                let call = MulticallInvoke::new_from_item(&item, &contracts)?\n                    .build_call(&mut contracts)\n                    .await?;\n                parsed_calls.push(call);\n            }\n        }\n    }\n\n    execute_calls(\n        account,\n        parsed_calls,\n        fee_args,\n        ProofArgs::none(),\n        nonce,\n        wait_config,\n        ui,\n    )\n    .await\n    .map(Into::into)\n    .map_err(handle_starknet_command_error)\n}\n\npub fn parse_inputs(inputs: &[Input], contract_registry: &ContractRegistry) -> Result<Vec<Felt>> {\n    let mut parsed_inputs = Vec::new();\n    for input in inputs {\n        let felt_value = match input {\n            Input::String(s) => contract_registry\n                .get_address_by_id(s)\n                .map_or_else(|| s.parse(), Ok)?,\n            Input::Number(n) => Felt::from_str(&n.to_string())\n                .with_context(|| format!(\"Failed to parse {n} to felt\"))?,\n        };\n        parsed_inputs.push(felt_value);\n    }\n\n    Ok(parsed_inputs)\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/script/init.rs",
    "content": "use anyhow::{Context, Result, ensure};\nuse camino::Utf8PathBuf;\nuse sncast::response::ui::UI;\nuse std::fs;\n\nuse clap::Args;\nuse foundry_ui::components::warning::WarningMessage;\nuse indoc::{formatdoc, indoc};\nuse scarb_api::ScarbCommand;\nuse scarb_api::version::scarb_version;\nuse semver::Version;\nuse sncast::helpers::constants::INIT_SCRIPTS_DIR;\nuse sncast::helpers::scarb_utils::get_cairo_version;\nuse sncast::response::script::init::ScriptInitResponse;\nuse toml_edit::DocumentMut;\n\n#[derive(Args, Debug)]\npub struct Init {\n    /// Name of a script to create\n    pub script_name: String,\n}\n\npub fn init(init_args: &Init, ui: &UI) -> Result<ScriptInitResponse> {\n    let script_root_dir_path = get_script_root_dir_path(&init_args.script_name)?;\n\n    init_scarb_project(&init_args.script_name, &script_root_dir_path)?;\n\n    let modify_files_result = add_dependencies(&script_root_dir_path)\n        .and_then(|()| modify_files_in_src_dir(&init_args.script_name, &script_root_dir_path));\n\n    ui.print_warning(WarningMessage::new(\n        &\"The newly created script isn't auto-added to the workspace. For more details, please see https://foundry-rs.github.io/starknet-foundry/starknet/script.html#initialize-a-script\",\n    ));\n\n    match modify_files_result {\n        Result::Ok(()) => Ok(ScriptInitResponse {\n            message: format!(\n                \"Initialized `{}` at {}\",\n                init_args.script_name, script_root_dir_path\n            ),\n        }),\n        Err(err) => {\n            clean_created_dir_and_files(&script_root_dir_path, ui);\n            Err(err)\n        }\n    }\n}\n\nfn get_script_root_dir_path(script_name: &str) -> Result<Utf8PathBuf> {\n    let current_dir = Utf8PathBuf::from_path_buf(std::env::current_dir()?)\n        .expect(\"Failed to create Utf8PathBuf for the current directory\");\n\n    let scripts_dir = current_dir.join(INIT_SCRIPTS_DIR);\n\n    ensure!(\n        !scripts_dir.exists(),\n        \"Scripts directory already exists at `{scripts_dir}`\"\n    );\n\n    Ok(scripts_dir.join(script_name))\n}\n\nfn init_scarb_project(script_name: &str, script_root_dir: &Utf8PathBuf) -> Result<()> {\n    const SCARB_WITHOUT_CAIRO_TEST_TEMPLATE: Version = Version::new(2, 13, 0);\n\n    let version = scarb_version()?;\n\n    // TODO(#3910)\n    let test_runner = if version.scarb < SCARB_WITHOUT_CAIRO_TEST_TEMPLATE {\n        \"cairo-test\"\n    } else {\n        \"none\"\n    };\n\n    ScarbCommand::new()\n        .args([\n            \"new\",\n            \"--name\",\n            script_name,\n            \"--no-vcs\",\n            \"--quiet\",\n            script_root_dir.as_str(),\n        ])\n        .env(\"SCARB_INIT_TEST_RUNNER\", test_runner)\n        .run()\n        .context(\"Failed to init Scarb project\")?;\n\n    // TODO(#3910)\n    if version.scarb < SCARB_WITHOUT_CAIRO_TEST_TEMPLATE {\n        remove_cairo_test_dependency(script_root_dir)?;\n    }\n\n    Ok(())\n}\n\nfn add_dependencies(script_root_dir: &Utf8PathBuf) -> Result<()> {\n    add_sncast_std_dependency(script_root_dir)\n        .context(\"Failed to add sncast_std dependency to Scarb.toml\")?;\n    add_starknet_dependency(script_root_dir)\n        .context(\"Failed to add starknet dependency to Scarb.toml\")?;\n\n    Ok(())\n}\n\nfn add_sncast_std_dependency(script_root_dir: &Utf8PathBuf) -> Result<()> {\n    let cast_version = env!(\"CARGO_PKG_VERSION\").to_string();\n    let dep_id = format!(\"sncast_std@{cast_version}\");\n    ScarbCommand::new()\n        .current_dir(script_root_dir)\n        .args([\"--offline\", \"add\", &dep_id])\n        .run()?;\n\n    Ok(())\n}\n\nfn add_starknet_dependency(script_root_dir: &Utf8PathBuf) -> Result<()> {\n    let scarb_manifest_path = script_root_dir.join(\"Scarb.toml\");\n    let cairo_version =\n        get_cairo_version(&scarb_manifest_path).context(\"Failed to get cairo version\")?;\n    let starknet_dependency = format!(\"starknet@>={cairo_version}\");\n\n    ScarbCommand::new()\n        .current_dir(script_root_dir)\n        .args([\"--offline\", \"add\", &starknet_dependency])\n        .run()?;\n\n    Ok(())\n}\n\nfn modify_files_in_src_dir(script_name: &str, script_root_dir: &Utf8PathBuf) -> Result<()> {\n    create_script_main_file(script_name, script_root_dir)\n        .context(format!(\"Failed to create {script_name}.cairo file\"))?;\n    overwrite_lib_file(script_name, script_root_dir).context(\"Failed to overwrite lib.cairo file\")\n}\n\nfn create_script_main_file(script_name: &str, script_root_dir: &Utf8PathBuf) -> Result<()> {\n    let script_main_file_name = format!(\"{script_name}.cairo\");\n    let script_main_file_path = script_root_dir.join(\"src\").join(script_main_file_name);\n\n    fs::write(\n        script_main_file_path,\n        indoc! {r#\"\n            use sncast_std::call;\n\n            // The example below uses a contract deployed to the Sepolia testnet\n            const CONTRACT_ADDRESS: felt252 =\n                0x07e867f1fa6da2108dd2b3d534f1fbec411c5ec9504eb3baa1e49c7a0bef5ab5;\n\n            fn main() {\n                let call_result = call(\n                    CONTRACT_ADDRESS.try_into().unwrap(), selector!(\"get_greeting\"), array![],\n                )\n                    .expect('call failed');\n\n                assert(*call_result.data[1] == 'Hello, Starknet!', *call_result.data[1]);\n\n                println!(\"{:?}\", call_result);\n            }\n        \"#},\n    )?;\n\n    Ok(())\n}\n\nfn overwrite_lib_file(script_name: &str, script_root_dir: &Utf8PathBuf) -> Result<()> {\n    let lib_file_path = script_root_dir.join(\"src/lib.cairo\");\n\n    fs::write(\n        lib_file_path,\n        formatdoc! {r\"\n            mod {script_name};\n        \"},\n    )?;\n\n    Ok(())\n}\n\nfn clean_created_dir_and_files(script_root_dir: &Utf8PathBuf, ui: &UI) {\n    if fs::remove_dir_all(script_root_dir).is_err() {\n        ui.print_error(\n            \"script\",\n            format!(\"Failed to clean created files by init command at {script_root_dir}\"),\n        );\n    }\n}\n\nfn remove_cairo_test_dependency(script_root_dir: &Utf8PathBuf) -> Result<()> {\n    let manifest_path = script_root_dir.join(\"Scarb.toml\");\n    let mut document: DocumentMut = fs::read_to_string(&manifest_path)?.parse()?;\n    document.remove(\"dev-dependencies\");\n    fs::write(manifest_path, document.to_string())?;\n    Ok(())\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/script/mod.rs",
    "content": "use crate::starknet_commands::script::run::Run;\nuse crate::{Cli, starknet_commands::script::init::Init};\nuse crate::{get_cast_config, process_command_result, starknet_commands};\nuse anyhow::Context;\nuse clap::{Args, Subcommand};\nuse sncast::helpers::scarb_utils::{\n    BuildConfig, assert_manifest_path_exists, build, build_and_load_artifacts,\n    get_package_metadata, get_scarb_metadata_with_deps,\n};\nuse sncast::response::ui::UI;\nuse sncast::{chain_id_to_network_name, get_chain_id, get_default_state_file_name};\nuse tokio::runtime::Runtime;\n\npub mod init;\npub mod run;\n\n#[derive(Args)]\npub struct Script {\n    #[command(subcommand)]\n    pub command: Commands,\n}\n\n#[derive(Debug, Subcommand)]\npub enum Commands {\n    Init(Init),\n    Run(Run),\n}\n\npub fn run_script_command(\n    cli: &Cli,\n    runtime: Runtime,\n    script: &Script,\n    ui: &UI,\n) -> anyhow::Result<()> {\n    match &script.command {\n        starknet_commands::script::Commands::Init(init) => {\n            let result = starknet_commands::script::init::init(init, ui);\n            process_command_result(\"script init\", result, ui, None);\n        }\n        starknet_commands::script::Commands::Run(run) => {\n            let manifest_path = assert_manifest_path_exists()?;\n            let package_metadata = get_package_metadata(&manifest_path, &run.package)?;\n\n            let config = get_cast_config(cli, ui)?;\n\n            let provider = runtime.block_on(run.rpc.get_provider(&config, ui))?;\n\n            let mut artifacts = build_and_load_artifacts(\n                &package_metadata,\n                &BuildConfig {\n                    scarb_toml_path: manifest_path.clone(),\n                    json: cli.json,\n                    profile: cli.profile.clone().unwrap_or(\"dev\".to_string()),\n                },\n                true,\n                // TODO(#3959) Remove `base_ui`\n                ui.base_ui(),\n            )\n            .expect(\"Failed to build artifacts\");\n            // TODO(#2042): remove duplicated compilation\n            build(\n                &package_metadata,\n                &BuildConfig {\n                    scarb_toml_path: manifest_path.clone(),\n                    json: cli.json,\n                    profile: \"dev\".to_string(),\n                },\n                \"dev\",\n            )\n            .expect(\"Failed to build script\");\n            let metadata_with_deps = get_scarb_metadata_with_deps(&manifest_path)?;\n\n            let chain_id = runtime.block_on(get_chain_id(&provider))?;\n            let state_file_path = if run.no_state_file {\n                None\n            } else {\n                Some(package_metadata.root.join(get_default_state_file_name(\n                    &run.script_name,\n                    &chain_id_to_network_name(chain_id),\n                )))\n            };\n            let url = runtime\n                .block_on(run.rpc.get_url(&config))\n                .context(\"Failed to get url\")?;\n            let result = starknet_commands::script::run::run(\n                &run.script_name,\n                &metadata_with_deps,\n                &package_metadata,\n                &mut artifacts,\n                &provider,\n                &url,\n                runtime,\n                &config,\n                state_file_path,\n                ui,\n            );\n\n            process_command_result(\"script run\", result, ui, None);\n        }\n    }\n\n    Ok(())\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/script/run/script_runtime.rs",
    "content": "use blockifier::execution::syscalls::vm_syscall_utils::SyscallSelector;\nuse cairo_lang_casm::hints::{ExternalHint, Hint};\nuse cairo_lang_runner::Arg;\nuse cairo_lang_runner::casm_run::{cell_ref_to_relocatable, extract_relocatable, get_val};\nuse cairo_vm::hint_processor::hint_processor_definition::{HintProcessorLogic, HintReference};\nuse cairo_vm::serde::deserialize_program::ApTracking;\nuse cairo_vm::types::exec_scope::ExecutionScopes;\nuse cairo_vm::types::relocatable::Relocatable;\nuse cairo_vm::vm::errors::hint_errors::HintError;\nuse cairo_vm::vm::errors::vm_errors::VirtualMachineError;\nuse cairo_vm::vm::runners::cairo_runner::{ResourceTracker, RunResources};\nuse cairo_vm::vm::vm_core::VirtualMachine;\nuse num_traits::ToPrimitive;\nuse runtime::{SignalPropagator, StarknetRuntime, SyscallPtrAccess};\nuse starknet_types_core::felt::Felt;\nuse std::any::Any;\nuse std::collections::HashMap;\nuse std::sync::Arc;\n\npub struct CastScriptRuntime<'a> {\n    pub starknet_runtime: StarknetRuntime<'a>,\n    pub user_args: Vec<Vec<Arg>>,\n}\n\nimpl SyscallPtrAccess for CastScriptRuntime<'_> {\n    fn get_mut_syscall_ptr(&mut self) -> &mut Relocatable {\n        self.starknet_runtime.get_mut_syscall_ptr()\n    }\n}\n\nimpl ResourceTracker for CastScriptRuntime<'_> {\n    fn consumed(&self) -> bool {\n        self.starknet_runtime.consumed()\n    }\n\n    fn consume_step(&mut self) {\n        self.starknet_runtime.consume_step();\n    }\n\n    fn get_n_steps(&self) -> Option<usize> {\n        self.starknet_runtime.get_n_steps()\n    }\n\n    fn run_resources(&self) -> &RunResources {\n        self.starknet_runtime.run_resources()\n    }\n}\n\nimpl SignalPropagator for CastScriptRuntime<'_> {\n    fn propagate_system_call_signal(&mut self, selector: SyscallSelector, vm: &mut VirtualMachine) {\n        self.starknet_runtime\n            .propagate_system_call_signal(selector, vm);\n    }\n\n    fn propagate_cheatcode_signal(&mut self, selector: &str, inputs: &[Felt]) {\n        self.starknet_runtime\n            .propagate_cheatcode_signal(selector, inputs);\n    }\n}\n\nimpl HintProcessorLogic for CastScriptRuntime<'_> {\n    fn execute_hint(\n        &mut self,\n        vm: &mut VirtualMachine,\n        exec_scopes: &mut ExecutionScopes,\n        hint_data: &Box<dyn Any>,\n    ) -> Result<(), HintError> {\n        let maybe_extended_hint = hint_data.downcast_ref::<Hint>();\n\n        match maybe_extended_hint {\n            // Copied from https://github.com/starkware-libs/cairo/blob/ada0450439a36d756223fba88dfd1f266f428f0c/crates/cairo-lang-runner/src/casm_run/mod.rs#L1321\n            Some(Hint::External(ExternalHint::AddRelocationRule { src, dst })) => {\n                vm.add_relocation_rule(\n                    extract_relocatable(vm, src)?,\n                    extract_relocatable(vm, dst)?,\n                )?;\n                Ok(())\n            }\n            // Copied from https://github.com/starkware-libs/cairo/blob/ada0450439a36d756223fba88dfd1f266f428f0c/crates/cairo-lang-runner/src/casm_run/mod.rs#L1330\n            Some(Hint::External(ExternalHint::WriteRunParam { index, dst })) => {\n                let index = get_val(vm, index)?.to_usize().expect(\"Got a bad index.\");\n                let mut stack = vec![(cell_ref_to_relocatable(dst, vm), &self.user_args[index])];\n                while let Some((mut buffer, values)) = stack.pop() {\n                    for value in values {\n                        match value {\n                            Arg::Value(v) => {\n                                vm.insert_value(buffer, v)?;\n                                buffer += 1;\n                            }\n                            Arg::Array(arr) => {\n                                let arr_buffer = vm.add_memory_segment();\n                                stack.push((arr_buffer, arr));\n                                vm.insert_value(buffer, arr_buffer)?;\n                                buffer += 1;\n                                vm.insert_value(buffer, (arr_buffer + args_size(arr))?)?;\n                                buffer += 1;\n                            }\n                        }\n                    }\n                }\n                Ok(())\n            }\n            _ => self\n                .starknet_runtime\n                .execute_hint(vm, exec_scopes, hint_data),\n        }\n    }\n\n    fn compile_hint(\n        &self,\n        hint_code: &str,\n        ap_tracking_data: &ApTracking,\n        reference_ids: &HashMap<String, usize>,\n        references: &[HintReference],\n        accessible_scopes: &[String],\n        constants: Arc<HashMap<String, Felt>>,\n    ) -> Result<Box<dyn Any>, VirtualMachineError> {\n        self.starknet_runtime.compile_hint(\n            hint_code,\n            ap_tracking_data,\n            reference_ids,\n            references,\n            accessible_scopes,\n            constants,\n        )\n    }\n}\n\nfn args_size(args: &[Arg]) -> usize {\n    args.iter().map(Arg::size).sum()\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/script/run.rs",
    "content": "use crate::starknet_commands::{call, declare, deploy, get::tx_status, invoke};\nuse crate::{WaitForTx, get_account};\nuse anyhow::{Context, Result, anyhow, bail};\nuse blockifier::execution::contract_class::TrackedResource;\nuse blockifier::execution::entry_point::ExecutableCallEntryPoint;\nuse blockifier::execution::execution_utils::ReadOnlySegments;\nuse blockifier::execution::syscalls::hint_processor::SyscallHintProcessor;\nuse blockifier::execution::syscalls::vm_syscall_utils::SyscallSelector;\nuse blockifier::state::cached_state::CachedState;\nuse cairo_lang_casm::hints::Hint;\nuse cairo_lang_runnable_utils::builder::{EntryCodeConfig, RunnableBuilder, create_code_footer};\nuse cairo_lang_runner::casm_run::hint_to_hint_params;\nuse cairo_lang_runner::short_string::as_cairo_short_string;\nuse cairo_lang_runner::{Arg, RunResultValue, SierraCasmRunner};\nuse cairo_lang_sierra::program::VersionedProgram;\nuse cairo_lang_utils::ordered_hash_map::OrderedHashMap;\nuse cairo_vm::serde::deserialize_program::HintParams;\nuse cairo_vm::types::relocatable::Relocatable;\nuse cairo_vm::vm::errors::hint_errors::HintError;\nuse cairo_vm::vm::vm_core::VirtualMachine;\nuse camino::Utf8PathBuf;\nuse clap::Args;\nuse conversions::byte_array::ByteArray;\nuse conversions::serde::deserialize::BufferReader;\nuse forge_runner::running::{has_segment_arena, syscall_handler_offset};\nuse foundry_ui::components::warning::WarningMessage;\nuse runtime::starknet::context::{SerializableBlockInfo, build_context};\nuse runtime::starknet::state::DictStateReader;\nuse runtime::{\n    CheatcodeHandlingResult, EnhancedHintError, ExtendedRuntime, ExtensionLogic, StarknetRuntime,\n    SyscallHandlingResult,\n};\nuse scarb_api::package_matches_version_requirement;\nuse scarb_metadata::{Metadata, PackageMetadata};\nuse script_runtime::CastScriptRuntime;\nuse semver::{Comparator, Op, Version, VersionReq};\nuse shared::utils::build_readable_text;\nuse sncast::AccountVariant;\nuse sncast::get_nonce;\nuse sncast::helpers::artifacts::CastStarknetContractArtifacts;\nuse sncast::helpers::configuration::CastConfig;\nuse sncast::helpers::constants::SCRIPT_LIB_ARTIFACT_NAME;\nuse sncast::helpers::fee::{FeeArgs, ScriptFeeSettings};\nuse sncast::helpers::proof::ProofArgs;\nuse sncast::helpers::rpc::RpcArgs;\nuse sncast::response::script::run::ScriptRunResponse;\nuse sncast::response::ui::UI;\nuse sncast::state::hashing::{\n    generate_declare_tx_id, generate_deploy_tx_id, generate_invoke_tx_id,\n};\nuse sncast::state::state_file::StateManager;\nuse starknet_rust::accounts::{Account, SingleOwnerAccount};\nuse starknet_rust::core::types::{BlockId, BlockTag::PreConfirmed};\nuse starknet_rust::providers::JsonRpcClient;\nuse starknet_rust::providers::jsonrpc::HttpTransport;\nuse starknet_rust::signers::LocalWallet;\nuse starknet_types_core::felt::Felt;\nuse std::collections::HashMap;\nuse std::fs;\nuse tokio::runtime::Runtime;\nuse url::Url;\n\nmod script_runtime;\n\n#[derive(Args, Debug)]\n#[command(about = \"Execute a deployment script\")]\npub struct Run {\n    /// Module name that contains the `main` function, which will be executed\n    pub script_name: String,\n\n    /// Specifies scarb package to be used\n    #[arg(long)]\n    pub package: Option<String>,\n\n    /// Do not use the state file\n    #[arg(long)]\n    pub no_state_file: bool,\n\n    #[command(flatten)]\n    pub rpc: RpcArgs,\n}\n\npub struct CastScriptExtension<'a> {\n    pub provider: &'a JsonRpcClient<HttpTransport>,\n    pub account: Option<&'a SingleOwnerAccount<&'a JsonRpcClient<HttpTransport>, LocalWallet>>,\n    pub tokio_runtime: Runtime,\n    pub config: &'a CastConfig,\n    pub artifacts: &'a HashMap<String, CastStarknetContractArtifacts>,\n    pub state: StateManager,\n    pub ui: &'a UI,\n}\n\nimpl CastScriptExtension<'_> {\n    pub fn account(\n        &self,\n    ) -> Result<&SingleOwnerAccount<&JsonRpcClient<HttpTransport>, LocalWallet>> {\n        self.account.ok_or_else(|| anyhow!(\"Account not defined. Please ensure the correct account is passed to `script run` command\"))\n    }\n}\n\nimpl<'a> ExtensionLogic for CastScriptExtension<'a> {\n    type Runtime = CastScriptRuntime<'a>;\n\n    #[expect(clippy::too_many_lines)]\n    fn handle_cheatcode(\n        &mut self,\n        selector: &str,\n        mut input_reader: BufferReader,\n        _extended_runtime: &mut Self::Runtime,\n        _vm: &VirtualMachine,\n    ) -> Result<CheatcodeHandlingResult, EnhancedHintError> {\n        match selector {\n            \"call\" => {\n                let contract_address = input_reader.read()?;\n                let function_selector = input_reader.read()?;\n                let calldata_felts = input_reader.read()?;\n\n                let call_result = self.tokio_runtime.block_on(call::call(\n                    contract_address,\n                    function_selector,\n                    calldata_felts,\n                    self.provider,\n                    &BlockId::Tag(PreConfirmed),\n                ));\n                Ok(CheatcodeHandlingResult::from_serializable(call_result))\n            }\n            \"declare\" => {\n                let contract: String = input_reader.read::<ByteArray>()?.to_string();\n                let fee_args: FeeArgs = input_reader.read::<ScriptFeeSettings>()?.into();\n                let nonce = input_reader.read()?;\n\n                let declare_tx_id = generate_declare_tx_id(contract.as_str());\n\n                if let Some(success_output) =\n                    self.state.get_output_if_success(declare_tx_id.as_str())\n                {\n                    return Ok(CheatcodeHandlingResult::from_serializable(success_output));\n                }\n\n                let declare_result = self.tokio_runtime.block_on(declare::declare(\n                    contract.clone(),\n                    fee_args,\n                    nonce,\n                    self.account()?,\n                    self.artifacts,\n                    WaitForTx {\n                        wait: true,\n                        wait_params: self.config.wait_params,\n                        show_ui_outputs: true,\n                    },\n                    true,\n                    self.ui,\n                ));\n\n                self.state.maybe_insert_tx_entry(\n                    declare_tx_id.as_str(),\n                    selector,\n                    &declare_result,\n                )?;\n                Ok(CheatcodeHandlingResult::from_serializable(declare_result))\n            }\n            \"deploy\" => {\n                let class_hash = input_reader.read()?;\n                let constructor_calldata = input_reader.read::<Vec<Felt>>()?;\n                let salt = input_reader.read()?;\n                let unique = input_reader.read()?;\n                let fee_args: FeeArgs = input_reader.read::<ScriptFeeSettings>()?.into();\n                let nonce = input_reader.read()?;\n\n                let deploy_tx_id =\n                    generate_deploy_tx_id(class_hash, &constructor_calldata, salt, unique);\n\n                if let Some(success_output) =\n                    self.state.get_output_if_success(deploy_tx_id.as_str())\n                {\n                    return Ok(CheatcodeHandlingResult::from_serializable(success_output));\n                }\n\n                let deploy_result = self.tokio_runtime.block_on(deploy::deploy(\n                    class_hash,\n                    &constructor_calldata,\n                    salt,\n                    unique,\n                    fee_args,\n                    nonce,\n                    self.account()?,\n                    WaitForTx {\n                        wait: true,\n                        wait_params: self.config.wait_params,\n                        show_ui_outputs: true,\n                    },\n                    self.ui,\n                ));\n\n                self.state.maybe_insert_tx_entry(\n                    deploy_tx_id.as_str(),\n                    selector,\n                    &deploy_result,\n                )?;\n\n                Ok(CheatcodeHandlingResult::from_serializable(deploy_result))\n            }\n            \"invoke\" => {\n                let contract_address = input_reader.read()?;\n                let function_selector = input_reader.read()?;\n                let calldata: Vec<_> = input_reader.read()?;\n                let fee_args = input_reader.read::<ScriptFeeSettings>()?.into();\n                let nonce = input_reader.read()?;\n\n                let invoke_tx_id =\n                    generate_invoke_tx_id(contract_address, function_selector, &calldata);\n\n                if let Some(success_output) =\n                    self.state.get_output_if_success(invoke_tx_id.as_str())\n                {\n                    return Ok(CheatcodeHandlingResult::from_serializable(success_output));\n                }\n\n                let invoke_result = self.tokio_runtime.block_on(invoke::invoke(\n                    contract_address,\n                    calldata,\n                    nonce,\n                    fee_args,\n                    ProofArgs::none(),\n                    function_selector,\n                    self.account()?,\n                    WaitForTx {\n                        wait: true,\n                        wait_params: self.config.wait_params,\n                        show_ui_outputs: true,\n                    },\n                    self.ui,\n                ));\n\n                self.state.maybe_insert_tx_entry(\n                    invoke_tx_id.as_str(),\n                    selector,\n                    &invoke_result,\n                )?;\n\n                Ok(CheatcodeHandlingResult::from_serializable(invoke_result))\n            }\n            \"get_nonce\" => {\n                let block_id = as_cairo_short_string(&input_reader.read()?)\n                    .expect(\"Failed to convert entry point name to short string\");\n\n                let nonce = self.tokio_runtime.block_on(get_nonce(\n                    self.provider,\n                    &block_id,\n                    self.account()?.address(),\n                ))?;\n\n                Ok(CheatcodeHandlingResult::from_serializable(nonce))\n            }\n            \"tx_status\" => {\n                let transaction_hash = input_reader.read()?;\n\n                let tx_status_result = self\n                    .tokio_runtime\n                    .block_on(tx_status::get_tx_status(self.provider, transaction_hash));\n\n                Ok(CheatcodeHandlingResult::from_serializable(tx_status_result))\n            }\n            _ => Ok(CheatcodeHandlingResult::Forwarded),\n        }\n    }\n\n    fn override_system_call(\n        &mut self,\n        _selector: SyscallSelector,\n        _vm: &mut VirtualMachine,\n        _extended_runtime: &mut Self::Runtime,\n    ) -> Result<SyscallHandlingResult, HintError> {\n        Err(HintError::CustomHint(Box::from(\n            \"Starknet syscalls are not supported\",\n        )))\n    }\n}\n\n#[expect(clippy::too_many_arguments, clippy::too_many_lines)]\npub fn run(\n    module_name: &str,\n    metadata: &Metadata,\n    package_metadata: &PackageMetadata,\n    artifacts: &mut HashMap<String, CastStarknetContractArtifacts>,\n    provider: &JsonRpcClient<HttpTransport>,\n    url: &Url,\n    tokio_runtime: Runtime,\n    config: &CastConfig,\n    state_file_path: Option<Utf8PathBuf>,\n    ui: &UI,\n) -> Result<ScriptRunResponse> {\n    warn_if_sncast_std_not_compatible(metadata, ui)?;\n\n    let artifacts = inject_lib_artifact(metadata, package_metadata, artifacts)?;\n\n    let artifact = artifacts\n        .get(SCRIPT_LIB_ARTIFACT_NAME)\n        .ok_or(anyhow!(\"Failed to find script artifact\"))?;\n\n    let sierra_program = serde_json::from_str::<VersionedProgram>(&artifact.sierra)\n        .with_context(|| \"Failed to deserialize Sierra program\")?\n        .into_v1()\n        .with_context(|| \"Failed to load Sierra program\")?\n        .program;\n\n    let runner = SierraCasmRunner::new(\n        sierra_program.clone(),\n        None,\n        OrderedHashMap::default(),\n        None,\n    )\n    .with_context(|| \"Failed to set up runner\")?;\n\n    // `builder` field in `SierraCasmRunner` is private, hence the need to create a new `RunnableBuilder`\n    // https://github.com/starkware-libs/cairo/blob/66f5c7223f7a6c27c5f800816dba05df9b60674e/crates/cairo-lang-runner/src/lib.rs#L184\n    let builder =\n        RunnableBuilder::new(sierra_program, None).with_context(|| \"Failed to create builder\")?;\n\n    let name_suffix = module_name.to_string() + \"::main\";\n    let func = runner.find_function(name_suffix.as_str())\n        .context(\"Failed to find main function in script - please make sure `sierra-replace-ids` is not set to `false` for `dev` profile in script's Scarb.toml\")?;\n\n    let entry_code_config = EntryCodeConfig::testing();\n    let casm_program_wrapper_info = builder.create_wrapper_info(func, entry_code_config)?;\n    let entry_code = casm_program_wrapper_info.header;\n    let builtins = casm_program_wrapper_info.builtins;\n    let footer = create_code_footer();\n\n    // import from cairo-lang-runner\n    let assembled_program = builder\n        .casm_program()\n        .clone()\n        .assemble_ex(&entry_code, &footer);\n    let (hints_dict, string_to_hint) = hints_to_params(assembled_program.hints);\n\n    // hint processor\n    let mut context = build_context(\n        &SerializableBlockInfo::default().into(),\n        None,\n        &TrackedResource::CairoSteps,\n    );\n\n    let mut blockifier_state = CachedState::new(DictStateReader::default());\n\n    // TODO(#2954)\n    let param_types = builder.generic_id_and_size_from_concrete(&func.signature.param_types);\n\n    let segment_index = syscall_handler_offset(builtins.len(), has_segment_arena(&param_types));\n    let syscall_handler = SyscallHintProcessor::new(\n        &mut blockifier_state,\n        &mut context,\n        // This segment is created by SierraCasmRunner\n        Relocatable {\n            segment_index: segment_index\n                .try_into()\n                .expect(\"Failed to convert index to isize\"),\n            offset: 0,\n        },\n        ExecutableCallEntryPoint::default(),\n        &string_to_hint,\n        ReadOnlySegments::default(),\n    );\n\n    let account = if config.account.is_empty() {\n        None\n    } else {\n        let rpc_args = RpcArgs {\n            url: Some(url.clone()),\n            network: None,\n        };\n        let account = tokio_runtime.block_on(get_account(config, provider, &rpc_args, ui))?;\n        match account {\n            AccountVariant::LocalWallet(acc) => Some(acc),\n            AccountVariant::Ledger(_) => bail!(\"Ledger is not supported for scripts\"),\n        }\n    };\n    let state = StateManager::from(state_file_path)?;\n\n    let cast_extension = CastScriptExtension {\n        provider,\n        tokio_runtime,\n        config,\n        artifacts: &artifacts,\n        account: account.as_ref(),\n        state,\n        ui,\n    };\n\n    let mut cast_runtime = ExtendedRuntime {\n        extension: cast_extension,\n        extended_runtime: CastScriptRuntime {\n            starknet_runtime: StarknetRuntime {\n                hint_handler: syscall_handler,\n                panic_traceback: None,\n            },\n            user_args: vec![vec![Arg::Value(Felt::from(i64::MAX))]],\n        },\n    };\n\n    match runner.run_function(\n        func,\n        &mut cast_runtime,\n        hints_dict,\n        assembled_program.bytecode.iter(),\n        builtins,\n    ) {\n        Ok(result) => match result.value {\n            RunResultValue::Success(data) => Ok(ScriptRunResponse {\n                status: \"success\".to_string(),\n                message: build_readable_text(&data),\n            }),\n            RunResultValue::Panic(panic_data) => Ok(ScriptRunResponse {\n                status: \"script panicked\".to_string(),\n                message: build_readable_text(&panic_data),\n            }),\n        },\n        Err(err) => Err(err.into()),\n    }\n}\n\nfn sncast_std_version_requirement() -> VersionReq {\n    let version = Version::parse(env!(\"CARGO_PKG_VERSION\")).unwrap();\n    let comparator = Comparator {\n        op: Op::Exact,\n        major: version.major,\n        minor: Some(version.minor),\n        patch: Some(version.patch),\n        pre: version.pre,\n    };\n    VersionReq {\n        comparators: vec![comparator],\n    }\n}\n\nfn warn_if_sncast_std_not_compatible(scarb_metadata: &Metadata, ui: &UI) -> Result<()> {\n    let sncast_std_version_requirement = sncast_std_version_requirement();\n    if !package_matches_version_requirement(\n        scarb_metadata,\n        \"sncast_std\",\n        &sncast_std_version_requirement,\n    )? {\n        ui.print_warning(WarningMessage::new(&format!(\n            \"Package sncast_std version does not meet the recommended version requirement {sncast_std_version_requirement}, it might result in unexpected behaviour\"\n        )));\n    }\n    Ok(())\n}\n\nfn inject_lib_artifact(\n    metadata: &Metadata,\n    package_metadata: &PackageMetadata,\n    artifacts: &mut HashMap<String, CastStarknetContractArtifacts>,\n) -> Result<HashMap<String, CastStarknetContractArtifacts>> {\n    let sierra_filename = format!(\"{}.sierra.json\", package_metadata.name);\n\n    let target_dir = &metadata\n        .target_dir\n        .clone()\n        .unwrap_or_else(|| metadata.workspace.root.join(\"target\"));\n    // TODO(#2042)\n    let sierra_path = &target_dir.join(\"dev\").join(sierra_filename);\n\n    let lib_artifacts = CastStarknetContractArtifacts {\n        sierra: fs::read_to_string(sierra_path)?,\n        casm: String::new(),\n    };\n\n    artifacts.insert(SCRIPT_LIB_ARTIFACT_NAME.to_string(), lib_artifacts);\n    Ok(artifacts.clone())\n}\n\nfn hints_to_params(\n    hints: Vec<(usize, Vec<Hint>)>,\n) -> (HashMap<usize, Vec<HintParams>>, HashMap<String, Hint>) {\n    let mut hints_dict: HashMap<usize, Vec<HintParams>> = HashMap::new();\n    let mut string_to_hint: HashMap<String, Hint> = HashMap::new();\n\n    for (offset, offset_hints) in hints {\n        for hint in offset_hints.clone() {\n            string_to_hint.insert(hint.representing_string(), hint.clone());\n        }\n        hints_dict.insert(\n            offset,\n            offset_hints\n                .clone()\n                .iter()\n                .map(hint_to_hint_params)\n                .collect(),\n        );\n    }\n\n    (hints_dict, string_to_hint)\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/show_config.rs",
    "content": "use anyhow::Result;\nuse camino::Utf8PathBuf;\nuse clap::Args;\nuse sncast::helpers::configuration::CastConfig;\nuse sncast::helpers::rpc::RpcArgs;\nuse sncast::response::show_config::ShowConfigResponse;\nuse sncast::{chain_id_to_network_name, get_chain_id};\nuse starknet_rust::providers::JsonRpcClient;\nuse starknet_rust::providers::jsonrpc::HttpTransport;\n\n#[derive(Args)]\n#[command(about = \"Show current configuration being used\", long_about = None)]\npub struct ShowConfig {\n    #[command(flatten)]\n    pub rpc: RpcArgs,\n}\n\npub async fn show_config(\n    show: &ShowConfig,\n    provider: Option<&JsonRpcClient<HttpTransport>>,\n    cast_config: CastConfig,\n    profile: Option<String>,\n) -> Result<ShowConfigResponse> {\n    let chain_id = if let Some(provider) = provider {\n        let chain_id_field = get_chain_id(provider).await?;\n        Some(chain_id_to_network_name(chain_id_field))\n    } else {\n        None\n    };\n\n    let rpc_url = show.rpc.url.clone().or(cast_config.url);\n    let network = show.rpc.network.or(cast_config.network);\n\n    let account = Some(cast_config.account).filter(|p| !p.is_empty());\n    let mut accounts_file_path =\n        Some(cast_config.accounts_file).filter(|p| p != &Utf8PathBuf::default());\n    let keystore = cast_config.keystore;\n    if keystore.is_some() {\n        accounts_file_path = None;\n    }\n    let wait_timeout = Some(cast_config.wait_params.get_timeout());\n    let wait_retry_interval = Some(cast_config.wait_params.get_retry_interval());\n    let block_explorer = cast_config.block_explorer;\n\n    Ok(ShowConfigResponse {\n        profile,\n        chain_id,\n        rpc_url,\n        network,\n        account,\n        accounts_file_path,\n        keystore,\n        wait_timeout: wait_timeout.map(u64::from),\n        wait_retry_interval: wait_retry_interval.map(u64::from),\n        show_explorer_links: cast_config.show_explorer_links,\n        block_explorer,\n    })\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/utils/class_hash.rs",
    "content": "use anyhow::Context;\nuse clap::Args;\nuse conversions::{IntoConv, byte_array::ByteArray};\nuse sncast::helpers::artifacts::CastStarknetContractArtifacts;\nuse sncast::{\n    ErrorData,\n    response::{errors::StarknetCommandError, utils::class_hash::ClassHashResponse},\n};\nuse starknet_rust::core::types::contract::SierraClass;\nuse std::collections::HashMap;\n\n#[derive(Args, Debug)]\n#[command(about = \"Generate the class hash of a contract\", long_about = None)]\npub struct ClassHash {\n    /// Contract name\n    #[arg(short = 'c', long = \"contract-name\")]\n    pub contract: String,\n\n    /// Specifies scarb package to be used\n    #[arg(long)]\n    pub package: Option<String>,\n}\n\n#[expect(clippy::result_large_err)]\npub fn get_class_hash(\n    class_hash: &ClassHash,\n    artifacts: &HashMap<String, CastStarknetContractArtifacts>,\n) -> Result<ClassHashResponse, StarknetCommandError> {\n    let contract_artifacts = artifacts.get(&class_hash.contract).ok_or(\n        StarknetCommandError::ContractArtifactsNotFound(ErrorData {\n            data: ByteArray::from(class_hash.contract.as_str()),\n        }),\n    )?;\n\n    let contract_definition: SierraClass = serde_json::from_str(&contract_artifacts.sierra)\n        .context(\"Failed to parse sierra artifact\")?;\n\n    let class_hash = contract_definition\n        .class_hash()\n        .map_err(anyhow::Error::from)?;\n\n    Ok(ClassHashResponse {\n        class_hash: class_hash.into_(),\n    })\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/utils/felt_or_id.rs",
    "content": "use anyhow::{Context, Result};\nuse serde::Deserialize;\nuse starknet_types_core::felt::Felt;\nuse std::str::FromStr;\n\nconst ID_PREFIX: char = '@';\n\n#[derive(Deserialize, Debug, Clone)]\npub struct FeltOrId(String);\n\nimpl FeltOrId {\n    pub fn new(s: String) -> Self {\n        FeltOrId(s)\n    }\n\n    pub fn try_into_felt(&self) -> Result<Felt> {\n        Felt::from_str(&self.0)\n            .context(\"Failed to parse contract address: expected a hex or decimal string\")\n    }\n\n    pub fn as_id(&self) -> Option<&str> {\n        self.0.strip_prefix(ID_PREFIX)\n    }\n}\n\nimpl std::str::FromStr for FeltOrId {\n    type Err = anyhow::Error;\n\n    fn from_str(s: &str) -> Result<Self, Self::Err> {\n        Ok(FeltOrId(s.to_owned()))\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/utils/mod.rs",
    "content": "use clap::{Args, Subcommand};\nuse sncast::response::ui::UI;\nuse sncast::{\n    helpers::{\n        configuration::CastConfig,\n        scarb_utils::{\n            BuildConfig, assert_manifest_path_exists, build_and_load_artifacts,\n            get_package_metadata,\n        },\n    },\n    response::errors::handle_starknet_command_error,\n};\n\nuse crate::{\n    process_command_result,\n    starknet_commands::{\n        self,\n        utils::{class_hash::ClassHash, selector::Selector, serialize::Serialize},\n    },\n};\n\npub mod class_hash;\npub mod felt_or_id;\npub mod selector;\npub mod serialize;\n\n#[derive(Args)]\n#[command(about = \"Utility commands for Starknet\")]\npub struct Utils {\n    #[command(subcommand)]\n    pub command: Commands,\n}\n\n#[derive(Debug, Subcommand)]\npub enum Commands {\n    Serialize(Serialize),\n\n    /// Get contract class hash\n    ClassHash(ClassHash),\n\n    /// Calculate selector from name\n    Selector(Selector),\n}\n\npub async fn utils(\n    utils: Utils,\n    config: CastConfig,\n    ui: &UI,\n    json: bool,\n    profile: String,\n) -> anyhow::Result<()> {\n    match utils.command {\n        Commands::Serialize(serialize) => {\n            let result = starknet_commands::utils::serialize::serialize(serialize, config, ui)\n                .await\n                .map_err(handle_starknet_command_error)?;\n\n            process_command_result(\"serialize\", Ok(result), ui, None);\n        }\n\n        Commands::ClassHash(class_hash) => {\n            let manifest_path = assert_manifest_path_exists()?;\n            let package_metadata = get_package_metadata(&manifest_path, &class_hash.package)?;\n\n            let artifacts = build_and_load_artifacts(\n                &package_metadata,\n                &BuildConfig {\n                    scarb_toml_path: manifest_path,\n                    json,\n                    profile,\n                },\n                false,\n                // TODO(#3959) Remove `base_ui`\n                ui.base_ui(),\n            )\n            .expect(\"Failed to build contract\");\n\n            let result = class_hash::get_class_hash(&class_hash, &artifacts)\n                .map_err(handle_starknet_command_error)?;\n\n            process_command_result(\"class-hash\", Ok(result), ui, None);\n        }\n\n        Commands::Selector(sel) => {\n            let result = selector::get_selector(&sel).map_err(handle_starknet_command_error)?;\n            process_command_result(\"selector\", Ok(result), ui, None);\n        }\n    }\n\n    Ok(())\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/utils/selector.rs",
    "content": "use anyhow::anyhow;\nuse clap::Args;\nuse conversions::IntoConv;\nuse sncast::response::{errors::StarknetCommandError, utils::selector::SelectorResponse};\nuse starknet_rust::core::utils::get_selector_from_name;\n\n#[derive(Args, Debug)]\n#[command(about = \"Calculate entrypoint selector from function name\", long_about = None)]\npub struct Selector {\n    /// Function name\n    pub name: String,\n}\n\n#[expect(clippy::result_large_err)]\npub fn get_selector(selector: &Selector) -> Result<SelectorResponse, StarknetCommandError> {\n    let trimmed = selector.name.trim();\n\n    if trimmed.contains('(') || trimmed.contains(')') {\n        return Err(StarknetCommandError::UnknownError(anyhow!(\n            \"Parentheses and the content within should not be supplied\"\n        )));\n    }\n\n    let felt = get_selector_from_name(trimmed)\n        .map_err(|e| StarknetCommandError::UnknownError(anyhow::Error::from(e)))?;\n\n    Ok(SelectorResponse {\n        selector: felt.into_(),\n    })\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/utils/serialize.rs",
    "content": "use anyhow::{Context, Result, bail};\nuse camino::Utf8PathBuf;\nuse clap::Args;\nuse data_transformer::transform;\nuse sncast::response::ui::UI;\nuse sncast::{\n    get_class_hash_by_address, get_contract_class,\n    helpers::{configuration::CastConfig, rpc::RpcArgs},\n    response::{errors::StarknetCommandError, utils::serialize::SerializeResponse},\n};\nuse starknet_rust::core::{\n    types::{ContractClass, contract::AbiEntry},\n    utils::get_selector_from_name,\n};\nuse starknet_types_core::felt::Felt;\n\n#[derive(Args, Clone, Debug)]\n#[group(required = true, multiple = false)]\npub struct LocationArgs {\n    /// Class hash of contract which contains the function\n    #[arg(short = 'c', long)]\n    pub class_hash: Option<Felt>,\n\n    /// Address of contract which contains the function\n    #[arg(short = 'd', long)]\n    pub contract_address: Option<Felt>,\n\n    /// Path to the file containing ABI of the contract class\n    #[arg(long)]\n    pub abi_file: Option<Utf8PathBuf>,\n}\n\n#[derive(Debug)]\npub enum Location {\n    AbiFile(Utf8PathBuf),\n    ClassHash(Felt),\n    ContractAddress(Felt),\n}\n\nimpl TryFrom<LocationArgs> for Location {\n    type Error = anyhow::Error;\n\n    fn try_from(args: LocationArgs) -> Result<Self> {\n        match (args.class_hash, args.contract_address, args.abi_file) {\n            (Some(class_hash), None, None) => Ok(Location::ClassHash(class_hash)),\n            (None, Some(address), None) => Ok(Location::ContractAddress(address)),\n            (None, None, Some(path)) => Ok(Location::AbiFile(path)),\n            _ => bail!(\n                \"Exactly one of --class-hash, --contract-address, or --abi-file must be provided\"\n            ),\n        }\n    }\n}\n\n#[derive(Args, Clone, Debug)]\n#[command(about = \"Serialize Cairo expressions into calldata\")]\npub struct Serialize {\n    /// Comma-separated string of Cairo expressions\n    #[arg(long, allow_hyphen_values = true)]\n    pub arguments: String,\n\n    /// Name of the function whose calldata should be serialized\n    #[arg(short, long)]\n    pub function: String,\n\n    #[command(flatten)]\n    pub location_args: LocationArgs,\n\n    #[command(flatten)]\n    pub rpc_args: Option<RpcArgs>,\n}\n\npub async fn serialize(\n    Serialize {\n        function,\n        arguments,\n        rpc_args,\n        location_args,\n    }: Serialize,\n    config: CastConfig,\n    ui: &UI,\n) -> Result<SerializeResponse, StarknetCommandError> {\n    let selector = get_selector_from_name(&function)\n        .context(\"Failed to convert entry point selector to FieldElement\")?;\n    let location = Location::try_from(location_args)?;\n\n    let abi = resolve_abi(location, rpc_args, &config, ui).await?;\n\n    let calldata = transform(&arguments, &abi, &selector)?;\n\n    Ok(SerializeResponse { calldata })\n}\n\npub async fn resolve_abi(\n    location: Location,\n    rpc_args: Option<RpcArgs>,\n    config: &CastConfig,\n    ui: &UI,\n) -> Result<Vec<AbiEntry>> {\n    match location {\n        Location::AbiFile(path) => {\n            let abi_str = tokio::fs::read_to_string(path)\n                .await\n                .context(\"Failed to read ABI file\")?;\n            serde_json::from_str(&abi_str).context(\"Failed to deserialize ABI from file\")\n        }\n        Location::ClassHash(class_hash) => {\n            let provider = rpc_args\n                .context(\n                    \"Either `--network` or `--url` must be provided when using `--class-hash`\",\n                )?\n                .get_provider(config, ui)\n                .await?;\n            let contract_class = get_contract_class(class_hash, &provider).await?;\n            parse_abi_from_contract_class(contract_class)\n        }\n        Location::ContractAddress(address) => {\n            let provider = rpc_args.context(\"Either `--network` or `--url` must be provided when using `--contract-address`\")?.get_provider(config, ui).await?;\n            let class_hash = get_class_hash_by_address(&provider, address).await?;\n            let contract_class = get_contract_class(class_hash, &provider).await?;\n            parse_abi_from_contract_class(contract_class)\n        }\n    }\n}\n\nfn parse_abi_from_contract_class(contract_class: ContractClass) -> Result<Vec<AbiEntry>> {\n    let ContractClass::Sierra(sierra) = contract_class else {\n        bail!(\"ABI transformation not supported for Cairo 0 (legacy) contracts\");\n    };\n    serde_json::from_str(&sierra.abi).context(\"Couldn't deserialize ABI from network\")\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/verify/explorer.rs",
    "content": "use anyhow::Result;\nuse camino::Utf8PathBuf;\nuse serde::Serialize;\nuse sncast::response::ui::UI;\nuse sncast::{Network, response::verify::VerifyResponse};\nuse starknet_rust::providers::{JsonRpcClient, jsonrpc::HttpTransport};\n\n#[derive(Serialize, Debug)]\n#[serde(untagged)]\npub enum ContractIdentifier {\n    ClassHash { class_hash: String },\n    Address { contract_address: String },\n}\n\n#[derive(Serialize, Debug)]\npub struct VerificationPayload {\n    pub contract_name: String,\n    #[serde(flatten)]\n    pub identifier: ContractIdentifier,\n    pub source_code: serde_json::Value,\n}\n\n#[async_trait::async_trait]\npub trait VerificationInterface<'a>: Sized {\n    fn new(\n        network: Network,\n        workspace_dir: Utf8PathBuf,\n        provider: &'a JsonRpcClient<HttpTransport>,\n        ui: &'a UI,\n    ) -> Result<Self>;\n    async fn verify(\n        &self,\n        identifier: ContractIdentifier,\n        contract_name: String,\n        package: Option<String>,\n        test_files: bool,\n        ui: &UI,\n    ) -> Result<VerifyResponse>;\n    fn gen_explorer_url(&self) -> Result<String>;\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/verify/mod.rs",
    "content": "use anyhow::{Result, anyhow, bail};\nuse camino::Utf8PathBuf;\nuse clap::{ArgGroup, Args, ValueEnum};\nuse promptly::prompt;\nuse sncast::helpers::configuration::CastConfig;\nuse sncast::helpers::rpc::FreeProvider;\nuse sncast::response::ui::UI;\nuse sncast::{Network, response::verify::VerifyResponse};\nuse sncast::{get_chain_id, get_provider};\nuse starknet_rust::providers::jsonrpc::{HttpTransport, JsonRpcClient};\nuse starknet_types_core::felt::Felt;\nuse std::{collections::HashMap, fmt};\nuse url::Url;\n\npub mod explorer;\npub mod voyager;\npub mod walnut;\n\nuse explorer::ContractIdentifier;\nuse explorer::VerificationInterface;\nuse foundry_ui::components::warning::WarningMessage;\nuse sncast::helpers::artifacts::CastStarknetContractArtifacts;\nuse voyager::Voyager;\nuse walnut::WalnutVerificationInterface;\n\n#[derive(Args)]\n#[command(about = \"Verify a contract through a block explorer\")]\n#[command(group(\n    ArgGroup::new(\"contract_identifier\")\n        .required(true)\n        .args(&[\"class_hash\", \"contract_address\"])\n))]\npub struct Verify {\n    /// Class hash of a contract to be verified\n    #[arg(short = 'g', long)]\n    pub class_hash: Option<Felt>,\n\n    /// Address of a contract to be verified\n    #[arg(short = 'd', long)]\n    pub contract_address: Option<Felt>,\n\n    /// Name of the contract that is being verified\n    #[arg(short, long)]\n    pub contract_name: String,\n\n    /// Block explorer to use for the verification\n    #[arg(short, long, value_enum)]\n    pub verifier: Verifier,\n\n    /// The network on which block explorer will do the verification\n    #[arg(short, long, value_enum)]\n    pub network: Option<Network>,\n\n    /// Assume \"yes\" as answer to confirmation prompt and run non-interactively\n    #[arg(long, default_value = \"false\")]\n    pub confirm_verification: bool,\n\n    /// Specifies scarb package to be used\n    #[arg(long)]\n    pub package: Option<String>,\n\n    /// RPC provider url address; overrides url from snfoundry.toml. Will use public provider if not set.\n    #[arg(long)]\n    pub url: Option<Url>,\n\n    /// Include test files under src/ for verification (only applies to voyager)\n    #[arg(long, default_value = \"false\")]\n    pub test_files: bool,\n}\n\n#[derive(ValueEnum, Clone, Debug)]\npub enum Verifier {\n    Walnut,\n    Voyager,\n}\n\nimpl fmt::Display for Verifier {\n    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {\n        match *self {\n            Verifier::Walnut => write!(f, \"walnut\"),\n            Verifier::Voyager => write!(f, \"voyager\"),\n        }\n    }\n}\n\nasync fn resolve_verification_network(\n    cli_network: Option<Network>,\n    config_network: Option<Network>,\n    provider: &JsonRpcClient<HttpTransport>,\n) -> Result<Network> {\n    if let Some(network) = cli_network.or(config_network) {\n        return Ok(network);\n    }\n\n    let chain_id = get_chain_id(provider).await?;\n\n    Network::try_from(chain_id).map_err(|_| {\n            anyhow!(\n                \"Failed to infer verification network from the RPC chain ID {chain_id:#x}; pass `--network mainnet` or `--network sepolia` explicitly\"\n            )\n        })\n}\n\nfn display_files_and_confirm(\n    verifier: &Verifier,\n    files_to_display: Vec<String>,\n    confirm_verification: bool,\n    ui: &UI,\n    artifacts: &HashMap<String, CastStarknetContractArtifacts>,\n    contract_name: &str,\n) -> Result<()> {\n    // Display files that will be uploaded\n    // TODO(#3960) JSON output support\n    ui.print_notification(\"The following files will be uploaded to verifier:\".to_string());\n    for file_path in files_to_display {\n        ui.print_notification(file_path);\n    }\n\n    // Ask for confirmation after showing files\n    if !confirm_verification {\n        let prompt_text = format!(\n            \"\\n\\tYou are about to submit the above files to the third-party verifier at {verifier}.\\n\\n\\tImportant: Make sure your project's Scarb.toml does not include sensitive information like private keys.\\n\\n\\tAre you sure you want to proceed? (Y/n)\"\n        );\n        let input: String = prompt(prompt_text)?;\n\n        if !input.to_lowercase().starts_with('y') {\n            bail!(\"Verification aborted\");\n        }\n    }\n\n    // Check contract exists after confirmation\n    if !artifacts.contains_key(contract_name) {\n        return Err(anyhow!(\"Contract named '{contract_name}' was not found\"));\n    }\n\n    Ok(())\n}\n\npub async fn verify(\n    args: Verify,\n    manifest_path: &Utf8PathBuf,\n    artifacts: &HashMap<String, CastStarknetContractArtifacts>,\n    config: &CastConfig,\n    ui: &UI,\n) -> Result<VerifyResponse> {\n    let Verify {\n        contract_address,\n        class_hash,\n        contract_name,\n        verifier,\n        network,\n        confirm_verification,\n        package,\n        url,\n        test_files,\n    } = args;\n\n    let rpc_url = match url {\n        Some(url) => url,\n        None => {\n            if let Some(config_url) = &config.url {\n                config_url.clone()\n            } else if let Some(network) = &config.network {\n                network.url(&FreeProvider::semi_random()).await?\n            } else {\n                let network =\n                    network.ok_or_else(|| anyhow!(\"Either --network or --url must be provided\"))?;\n                network.url(&FreeProvider::semi_random()).await?\n            }\n        }\n    };\n    let provider = get_provider(&rpc_url)?;\n\n    // Build JSON Payload for the verification request\n    // get the parent dir of the manifest path\n    let workspace_dir = manifest_path\n        .parent()\n        .ok_or(anyhow!(\"Failed to obtain workspace dir\"))?;\n\n    let contract_identifier = match (class_hash, contract_address) {\n        (Some(class_hash), None) => ContractIdentifier::ClassHash {\n            class_hash: class_hash.to_fixed_hex_string(),\n        },\n        (None, Some(contract_address)) => ContractIdentifier::Address {\n            contract_address: contract_address.to_fixed_hex_string(),\n        },\n\n        _ => {\n            unreachable!(\"Exactly one of class_hash or contract_address must be provided.\");\n        }\n    };\n\n    let network = resolve_verification_network(network, config.network, &provider).await?;\n\n    // Handle test_files warning for Walnut\n    if matches!(verifier, Verifier::Walnut) && test_files {\n        ui.print_warning(WarningMessage::new(\n            \"The `--test-files` option is ignored for Walnut verifier\",\n        ));\n    }\n\n    // Create verifier instance, gather files, and perform verification\n    match verifier {\n        Verifier::Walnut => {\n            let walnut = WalnutVerificationInterface::new(\n                network,\n                workspace_dir.to_path_buf(),\n                &provider,\n                ui,\n            )?;\n\n            // Gather and format files for display\n            let files = walnut.gather_files()?;\n            let files_to_display: Vec<String> =\n                files.iter().map(|(path, _)| format!(\"  {path}\")).collect();\n\n            // Display files and confirm\n            display_files_and_confirm(\n                &verifier,\n                files_to_display,\n                confirm_verification,\n                ui,\n                artifacts,\n                &contract_name,\n            )?;\n\n            // Perform verification\n            walnut\n                .verify(contract_identifier, contract_name, package, false, ui)\n                .await\n        }\n        Verifier::Voyager => {\n            let voyager = Voyager::new(network, workspace_dir.to_path_buf(), &provider, ui)?;\n\n            // Gather and format files for display\n            let (_, files) = voyager.gather_files(test_files)?;\n            let files_to_display: Vec<String> =\n                files.keys().map(|name| format!(\"  {name}\")).collect();\n\n            // Display files and confirm\n            display_files_and_confirm(\n                &verifier,\n                files_to_display,\n                confirm_verification,\n                ui,\n                artifacts,\n                &contract_name,\n            )?;\n\n            // Perform verification\n            voyager\n                .verify(contract_identifier, contract_name, package, test_files, ui)\n                .await\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::resolve_verification_network;\n    use serde_json::json;\n    use sncast::Network;\n    use sncast::get_provider;\n    use starknet_types_core::felt::Felt;\n    use url::Url;\n    use wiremock::matchers::{body_partial_json, method};\n    use wiremock::{Mock, MockServer, ResponseTemplate};\n\n    fn unused_provider() -> starknet_rust::providers::jsonrpc::JsonRpcClient<\n        starknet_rust::providers::jsonrpc::HttpTransport,\n    > {\n        get_provider(&Url::parse(\"http://127.0.0.1:1\").unwrap()).unwrap()\n    }\n\n    async fn mock_provider_for_chain_id(\n        chain_id: Felt,\n    ) -> (\n        starknet_rust::providers::jsonrpc::JsonRpcClient<\n            starknet_rust::providers::jsonrpc::HttpTransport,\n        >,\n        MockServer,\n    ) {\n        let mock_rpc = MockServer::start().await;\n        Mock::given(method(\"POST\"))\n            .and(body_partial_json(json!({\"method\": \"starknet_chainId\"})))\n            .respond_with(ResponseTemplate::new(200).set_body_json(json!({\n                \"id\": 1,\n                \"jsonrpc\": \"2.0\",\n                \"result\": format!(\"{chain_id:#x}\")\n            })))\n            .expect(1)\n            .mount(&mock_rpc)\n            .await;\n\n        (\n            get_provider(&Url::parse(&mock_rpc.uri()).unwrap()).unwrap(),\n            mock_rpc,\n        )\n    }\n\n    #[tokio::test]\n    async fn uses_cli_network_when_provided() {\n        let provider = unused_provider();\n        let network =\n            resolve_verification_network(Some(Network::Mainnet), Some(Network::Sepolia), &provider)\n                .await\n                .unwrap();\n\n        assert_eq!(network, Network::Mainnet);\n    }\n\n    #[tokio::test]\n    async fn uses_config_network_when_cli_network_is_missing() {\n        let provider = unused_provider();\n        let network = resolve_verification_network(None, Some(Network::Mainnet), &provider)\n            .await\n            .unwrap();\n\n        assert_eq!(network, Network::Mainnet);\n    }\n\n    #[tokio::test]\n    async fn infers_mainnet_from_chain_id_when_no_network_is_configured() {\n        let (provider, _mock_rpc) = mock_provider_for_chain_id(sncast::MAINNET).await;\n        let network = resolve_verification_network(None, None, &provider)\n            .await\n            .unwrap();\n\n        assert_eq!(network, Network::Mainnet);\n    }\n\n    #[tokio::test]\n    async fn infers_sepolia_from_chain_id_when_no_network_is_configured() {\n        let (provider, _mock_rpc) = mock_provider_for_chain_id(sncast::SEPOLIA).await;\n        let network = resolve_verification_network(None, None, &provider)\n            .await\n            .unwrap();\n\n        assert_eq!(network, Network::Sepolia);\n    }\n\n    #[tokio::test]\n    async fn errors_when_network_cannot_be_resolved() {\n        let (provider, _mock_rpc) =\n            mock_provider_for_chain_id(Felt::from_hex_unchecked(\"0x1234\")).await;\n        let error = resolve_verification_network(None, None, &provider)\n            .await\n            .unwrap_err();\n\n        assert!(\n            error\n                .to_string()\n                .contains(\"Failed to infer verification network from the RPC chain ID 0x1234\")\n        );\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/verify/voyager.rs",
    "content": "use super::explorer::{ContractIdentifier, VerificationInterface};\nuse anyhow::{Context, Result, anyhow};\nuse camino::{Utf8Path, Utf8PathBuf};\nuse foundry_ui::components::warning::WarningMessage;\nuse itertools::Itertools;\nuse reqwest::{self, StatusCode};\nuse scarb_api::metadata::metadata_for_dir;\nuse scarb_metadata::{Metadata, PackageMetadata};\nuse serde::Serialize;\nuse sncast::Network;\nuse sncast::response::explorer_link::ExplorerError;\nuse sncast::response::ui::UI;\nuse sncast::{helpers::scarb_utils, response::verify::VerifyResponse};\nuse starknet_rust::{\n    core::types::{BlockId, BlockTag},\n    providers::{\n        Provider,\n        jsonrpc::{HttpTransport, JsonRpcClient},\n    },\n};\nuse starknet_types_core::felt::Felt;\nuse std::{collections::HashMap, env, ffi::OsStr, fs, path::PathBuf};\nuse url::Url;\nuse walkdir::WalkDir;\n\nconst CAIRO_EXT: &str = \"cairo\";\nconst VERIFY_ENDPOINT: &str = \"/class-verify\";\nconst STATUS_ENDPOINT: &str = \"/class-verify/job\";\n\npub struct Voyager<'a> {\n    network: Network,\n    metadata: Metadata,\n    provider: &'a JsonRpcClient<HttpTransport>,\n}\n\n#[derive(Debug, Clone, Serialize)]\npub struct Body {\n    pub compiler_version: semver::Version,\n    pub scarb_version: semver::Version,\n    pub project_dir_path: Utf8PathBuf,\n    #[serde(rename = \"name\")]\n    pub contract_name: String,\n    pub package_name: String,\n    pub build_tool: String,\n    pub license: Option<String>,\n    pub files: HashMap<String, String>,\n}\n\n#[derive(Debug, serde::Deserialize)]\npub struct ApiError {\n    error: String,\n}\n\n#[derive(Debug, serde::Deserialize)]\npub struct VerificationJobDispatch {\n    job_id: String,\n}\n\n#[derive(Debug, thiserror::Error)]\npub enum VoyagerApiError {\n    #[error(\"Failed to parse {name} path: {path}\")]\n    DependencyPathError { name: String, path: String },\n\n    #[error(\"Scarb metadata failed for {name}: {path}\")]\n    MetadataError { name: String, path: String },\n}\n\nfn gather_packages(metadata: &Metadata, packages: &mut Vec<PackageMetadata>) -> Result<()> {\n    let mut workspace_packages: Vec<PackageMetadata> = metadata\n        .packages\n        .clone()\n        .into_iter()\n        .filter(|package_meta| metadata.workspace.members.contains(&package_meta.id))\n        .filter(|package_meta| !packages.contains(package_meta))\n        .collect();\n\n    let workspace_packages_names = workspace_packages\n        .iter()\n        .map(|package| package.name.clone())\n        .collect_vec();\n\n    // find all dependencies listed by path\n    let mut dependencies: HashMap<String, PathBuf> = HashMap::new();\n    for package in &workspace_packages {\n        for dependency in &package.dependencies {\n            let name = &dependency.name;\n            let url = Url::parse(&dependency.source.repr).map_err(|_| {\n                VoyagerApiError::DependencyPathError {\n                    name: name.clone(),\n                    path: dependency.source.repr.clone(),\n                }\n            })?;\n\n            if url.scheme().starts_with(\"path\") {\n                let path =\n                    url.to_file_path()\n                        .map_err(|()| VoyagerApiError::DependencyPathError {\n                            name: name.clone(),\n                            path: dependency.source.repr.clone(),\n                        })?;\n                dependencies.insert(name.clone(), path);\n            }\n        }\n    }\n\n    packages.append(&mut workspace_packages);\n\n    // filter out dependencies already covered by workspace\n    let out_of_workspace_dependencies: HashMap<&String, &PathBuf> = dependencies\n        .iter()\n        .filter(|&(k, _)| !workspace_packages_names.contains(k))\n        .collect();\n\n    for (name, manifest) in out_of_workspace_dependencies {\n        let new_meta = metadata_for_dir(manifest.parent().expect(\"manifest should have a parent\"))\n            .map_err(|_| VoyagerApiError::MetadataError {\n                name: name.clone(),\n                path: manifest.to_string_lossy().to_string(),\n            })?;\n        gather_packages(&new_meta, packages)?;\n    }\n\n    Ok(())\n}\n\nfn package_source_files(\n    package_metadata: &PackageMetadata,\n    include_test_files: bool,\n) -> Result<Vec<Utf8PathBuf>> {\n    let mut sources: Vec<Utf8PathBuf> = WalkDir::new(package_metadata.root.clone())\n        .into_iter()\n        .filter_map(std::result::Result::ok)\n        .filter(|f| f.file_type().is_file())\n        .filter(|f| {\n            if let Some(ext) = f.path().extension() {\n                if ext != OsStr::new(CAIRO_EXT) {\n                    return false;\n                }\n                let parts: Vec<_> = f\n                    .path()\n                    .components()\n                    .map(|c| c.as_os_str().to_string_lossy().to_lowercase())\n                    .collect();\n\n                if parts.contains(&\"src\".to_string()) {\n                    // If include_test_files is true, include all files under src/\n                    if include_test_files {\n                        return true;\n                    }\n                    // Otherwise, skip files with \"test\" in their path under src/\n                    let path_str = f.path().to_string_lossy().to_lowercase();\n                    if path_str.contains(\"/test\") || path_str.contains(\"\\\\test\") {\n                        return false;\n                    }\n                    // Also skip files ending with \"_test.cairo\" or \"_tests.cairo\"\n                    if path_str.ends_with(\"_test.cairo\") || path_str.ends_with(\"_tests.cairo\") {\n                        return false;\n                    }\n                    return true;\n                }\n\n                if parts.contains(&\"test\".to_string()) || parts.contains(&\"tests\".to_string()) {\n                    return false;\n                }\n                // We'll include files with #[test] attributes since they might be source files\n                // that happen to include unit tests\n                return true;\n            }\n            false\n        })\n        .map(walkdir::DirEntry::into_path)\n        .map(Utf8PathBuf::try_from)\n        .try_collect()?;\n\n    sources.push(package_metadata.manifest_path.clone());\n    let package_root = &package_metadata.root;\n\n    if let Some(lic) = package_metadata\n        .manifest_metadata\n        .license_file\n        .as_ref()\n        .map(Utf8Path::new)\n        .map(Utf8Path::to_path_buf)\n    {\n        sources.push(package_root.join(lic));\n    }\n\n    if let Some(readme) = package_metadata\n        .manifest_metadata\n        .readme\n        .as_deref()\n        .map(Utf8Path::new)\n        .map(Utf8Path::to_path_buf)\n    {\n        sources.push(package_root.join(readme));\n    }\n\n    Ok(sources)\n}\n\nfn longest_common_prefix<P: AsRef<Utf8Path> + Clone>(\n    paths: &[Utf8PathBuf],\n    first_guess: P,\n) -> Utf8PathBuf {\n    let ancestors = Utf8Path::ancestors(first_guess.as_ref());\n    let mut longest_prefix = first_guess.as_ref();\n    for prefix in ancestors {\n        if paths.iter().all(|src| src.starts_with(prefix)) {\n            longest_prefix = prefix;\n            break;\n        }\n    }\n    longest_prefix.to_path_buf()\n}\n\nimpl Voyager<'_> {\n    pub fn gather_files(\n        &self,\n        include_test_files: bool,\n    ) -> Result<(Utf8PathBuf, HashMap<String, Utf8PathBuf>)> {\n        let mut packages = vec![];\n        gather_packages(&self.metadata, &mut packages)?;\n\n        let mut sources: Vec<Utf8PathBuf> = vec![];\n        for package in &packages {\n            let mut package_sources = package_source_files(package, include_test_files)?;\n            sources.append(&mut package_sources);\n        }\n\n        let prefix = longest_common_prefix(&sources, &self.metadata.workspace.root);\n        let manifest_path = &self.metadata.workspace.manifest_path;\n        let manifest = manifest_path\n            .strip_prefix(&prefix)\n            .map_err(|_| anyhow!(\"Couldn't strip {prefix} from {manifest_path}\"))?;\n\n        let mut files: HashMap<String, Utf8PathBuf> = sources\n            .iter()\n            .map(|p| -> Result<(String, Utf8PathBuf)> {\n                let name = p\n                    .strip_prefix(&prefix)\n                    .map_err(|_| anyhow!(\"Couldn't strip {prefix} from {p}\"))?;\n                Ok((name.to_string(), p.clone()))\n            })\n            .try_collect()?;\n        files.insert(\n            manifest.to_string(),\n            self.metadata.workspace.manifest_path.clone(),\n        );\n\n        Ok((prefix, files))\n    }\n}\n\n#[async_trait::async_trait]\nimpl<'a> VerificationInterface<'a> for Voyager<'a> {\n    fn new(\n        network: Network,\n        workspace_dir: Utf8PathBuf,\n        provider: &'a JsonRpcClient<HttpTransport>,\n        _ui: &'a UI,\n    ) -> Result<Self> {\n        let manifest_path = scarb_utils::get_scarb_manifest_for(workspace_dir.as_ref())?;\n        let metadata = scarb_utils::get_scarb_metadata_with_deps(&manifest_path)?;\n        Ok(Voyager {\n            network,\n            metadata,\n            provider,\n        })\n    }\n\n    async fn verify(\n        &self,\n        contract_identifier: ContractIdentifier,\n        contract_name: String,\n        package: Option<String>,\n        test_files: bool,\n        ui: &UI,\n    ) -> Result<VerifyResponse> {\n        let hash = match contract_identifier {\n            ContractIdentifier::ClassHash { class_hash } => Felt::from_hex(class_hash.as_ref())?,\n            ContractIdentifier::Address { contract_address } => {\n                self.provider\n                    .get_class_hash_at(\n                        BlockId::Tag(BlockTag::Latest),\n                        Felt::from_hex(contract_address.as_ref())?,\n                    )\n                    .await?\n            }\n        };\n\n        let cairo_version = self.metadata.app_version_info.cairo.version.clone();\n        let scarb_version = self.metadata.app_version_info.version.clone();\n\n        let mut workspace_packages: Vec<PackageMetadata> = self\n            .metadata\n            .packages\n            .iter()\n            .filter(|&package_meta| self.metadata.workspace.members.contains(&package_meta.id))\n            .cloned()\n            .collect();\n\n        let selected = (if workspace_packages.len() > 1 {\n            match package {\n                Some(ref package_name) => workspace_packages\n                    .into_iter()\n                    .find(|p| p.name == *package_name)\n                    .ok_or(anyhow!(\n                        \"Package {package_name} not found in scarb metadata\"\n                    )),\n                None => Err(anyhow!(\n                    \"More than one package found in scarb metadata - specify package using --package flag\"\n                )),\n            }\n        } else {\n            workspace_packages\n                .pop()\n                .ok_or(anyhow!(\"No packages found in scarb metadata\"))\n        })?;\n\n        let (prefix, files) = self.gather_files(test_files)?;\n        let project_dir_path = self\n            .metadata\n            .workspace\n            .root\n            .strip_prefix(prefix)\n            // backend expects this: \".\" for cwd\n            .map(|path| {\n                if path.as_str().is_empty() {\n                    Utf8Path::new(\".\")\n                } else {\n                    path\n                }\n            })?;\n\n        if selected.manifest_metadata.license.is_none() {\n            ui.print_warning(WarningMessage::new(\"License not specified in Scarb.toml\"));\n        }\n\n        let client = reqwest::Client::new();\n        let body = Body {\n            compiler_version: cairo_version,\n            scarb_version,\n            project_dir_path: project_dir_path.to_path_buf(),\n            contract_name: contract_name.clone(),\n            license: selected.manifest_metadata.license.clone(),\n            package_name: selected.name,\n            build_tool: \"scarb\".to_string(),\n            files: files\n                .iter()\n                .map(|(name, path)| -> Result<(String, String)> {\n                    let contents = fs::read_to_string(path.as_path())?;\n                    Ok((name.clone(), contents))\n                })\n                .try_collect()?,\n        };\n\n        let url = format!(\n            \"{}{}/{:#066x}\",\n            self.gen_explorer_url()?,\n            VERIFY_ENDPOINT,\n            hash\n        );\n\n        let response = client\n            .post(url)\n            .json(&body)\n            .send()\n            .await\n            .context(\"Failed to submit contract for verification\")?;\n\n        match response.status() {\n            StatusCode::OK => {\n                let message = format!(\n                    \"{} submitted for verification, you can query the status at: {}{}/{}\",\n                    contract_name.clone(),\n                    self.gen_explorer_url()?,\n                    STATUS_ENDPOINT,\n                    response.json::<VerificationJobDispatch>().await?.job_id,\n                );\n                Ok(VerifyResponse { message })\n            }\n            StatusCode::BAD_REQUEST => Err(anyhow!(response.json::<ApiError>().await?.error)),\n            _ => Err(anyhow!(response.text().await?)),\n        }\n    }\n\n    fn gen_explorer_url(&self) -> Result<String> {\n        match env::var(\"VERIFIER_API_URL\") {\n            Ok(addr) => Ok(addr),\n            Err(_) => match self.network {\n                Network::Mainnet => Ok(\"https://api.voyager.online/beta\".to_string()),\n                Network::Sepolia => Ok(\"https://sepolia-api.voyager.online/beta\".to_string()),\n                Network::Devnet => Err(ExplorerError::DevnetNotSupported.into()),\n            },\n        }\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/starknet_commands/verify/walnut.rs",
    "content": "use anyhow::{Context, Result};\nuse camino::Utf8PathBuf;\nuse reqwest::StatusCode;\nuse sncast::response::ui::UI;\nuse sncast::response::verify::VerifyResponse;\nuse sncast::{Network, response::explorer_link::ExplorerError};\nuse starknet_rust::providers::{JsonRpcClient, jsonrpc::HttpTransport};\nuse std::env;\nuse std::ffi::OsStr;\nuse walkdir::WalkDir;\n\nuse super::explorer::{ContractIdentifier, VerificationInterface, VerificationPayload};\n\npub struct WalnutVerificationInterface {\n    network: Network,\n    workspace_dir: Utf8PathBuf,\n}\n\nimpl WalnutVerificationInterface {\n    pub fn gather_files(&self) -> Result<Vec<(String, std::path::PathBuf)>> {\n        let mut files = Vec::new();\n\n        for entry in WalkDir::new(self.workspace_dir.clone()).follow_links(true) {\n            let entry = entry?;\n            let path = entry.path();\n            if path.is_file()\n                && let Some(extension) = path.extension()\n                && (extension == OsStr::new(\"cairo\") || extension == OsStr::new(\"toml\"))\n            {\n                let relative_path = path.strip_prefix(self.workspace_dir.clone())?;\n                files.push((\n                    relative_path.to_string_lossy().into_owned(),\n                    path.to_path_buf(),\n                ));\n            }\n        }\n\n        Ok(files)\n    }\n}\n\n#[async_trait::async_trait]\nimpl VerificationInterface<'_> for WalnutVerificationInterface {\n    fn new(\n        network: Network,\n        workspace_dir: Utf8PathBuf,\n        _provider: &JsonRpcClient<HttpTransport>,\n        _ui: &UI,\n    ) -> Result<Self> {\n        Ok(WalnutVerificationInterface {\n            network,\n            workspace_dir,\n        })\n    }\n\n    async fn verify(\n        &self,\n        identifier: ContractIdentifier,\n        contract_name: String,\n        _package: Option<String>,\n        _test_files: bool,\n        _ui: &UI,\n    ) -> Result<VerifyResponse> {\n        // Read all files name along with their contents in a JSON format\n        // in the workspace dir recursively\n        // key is the file name and value is the file content\n        let mut file_data = serde_json::Map::new();\n\n        // Use the gather_files method to get the list of files\n        let files = self.gather_files()?;\n        for (relative_path, full_path) in files {\n            let file_content = std::fs::read_to_string(full_path)?;\n            file_data.insert(relative_path, serde_json::Value::String(file_content));\n        }\n\n        // Serialize the JSON object to a JSON string\n        let source_code = serde_json::Value::Object(file_data);\n\n        // Create the JSON payload with \"contract name,\" \"address,\" and \"source_code\" fields\n        let payload = VerificationPayload {\n            contract_name,\n            identifier,\n            source_code,\n        };\n\n        // Serialize the payload to a JSON string for the POST request\n        let json_payload = serde_json::to_string(&payload)?;\n\n        // Send the POST request to the explorer\n        let client = reqwest::Client::new();\n        let api_res = client\n            .post(self.gen_explorer_url()?)\n            .header(\"Content-Type\", \"application/json\")\n            .body(json_payload)\n            .send()\n            .await\n            .context(\"Failed to send request to verifier API\")?;\n\n        if api_res.status() == StatusCode::OK {\n            let message = api_res\n                .text()\n                .await\n                .context(\"Failed to read verifier API response\")?;\n            Ok(VerifyResponse { message })\n        } else {\n            let message = api_res.text().await.context(\"Failed to verify contract\")?;\n            Err(anyhow::anyhow!(\"{message}\"))\n        }\n    }\n\n    fn gen_explorer_url(&self) -> Result<String> {\n        let api_base_url =\n            env::var(\"VERIFIER_API_URL\").unwrap_or_else(|_| \"https://api.walnut.dev\".to_string());\n        let path = match self.network {\n            Network::Mainnet => \"/v1/sn_main/verify\",\n            Network::Sepolia => \"/v1/sn_sepolia/verify\",\n            Network::Devnet => return Err(ExplorerError::DevnetNotSupported.into()),\n        };\n        Ok(format!(\"{api_base_url}{path}\"))\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/state/hashing.rs",
    "content": "use sha3::Digest;\nuse sha3::Sha3_256;\nuse starknet_types_core::felt::Felt;\nuse std::vec;\n\ntrait SerialiseAsBytes {\n    fn serialise_as_bytes(&self) -> Vec<u8>;\n}\n\nimpl<T: SerialiseAsBytes> SerialiseAsBytes for Option<T> {\n    fn serialise_as_bytes(&self) -> Vec<u8> {\n        match self {\n            None => {\n                vec![0]\n            }\n            Some(val) => {\n                let mut res = vec![1u8];\n                res.extend(val.serialise_as_bytes());\n                res\n            }\n        }\n    }\n}\n\nimpl<T: SerialiseAsBytes> SerialiseAsBytes for &[T] {\n    fn serialise_as_bytes(&self) -> Vec<u8> {\n        self.iter()\n            .flat_map(SerialiseAsBytes::serialise_as_bytes)\n            .collect()\n    }\n}\n\nimpl SerialiseAsBytes for str {\n    fn serialise_as_bytes(&self) -> Vec<u8> {\n        self.as_bytes().to_vec()\n    }\n}\n\nimpl SerialiseAsBytes for Felt {\n    fn serialise_as_bytes(&self) -> Vec<u8> {\n        self.to_bytes_be().to_vec()\n    }\n}\n\nimpl SerialiseAsBytes for bool {\n    fn serialise_as_bytes(&self) -> Vec<u8> {\n        vec![u8::from(*self)]\n    }\n}\n\n// if we change API this might have collisions with old API hashes\npub(super) fn generate_id(selector: &str, inputs_bytes: Vec<u8>) -> String {\n    let hash = Sha3_256::new()\n        .chain_update(selector)\n        .chain_update(inputs_bytes)\n        .finalize();\n    base16ct::lower::encode_string(&hash)\n}\n\n#[must_use]\npub fn generate_declare_tx_id(contract_name: &str) -> String {\n    generate_id(\"declare\", contract_name.serialise_as_bytes())\n}\n\n#[must_use]\npub fn generate_deploy_tx_id(\n    class_hash: Felt,\n    constructor_calldata: &[Felt],\n    salt: Option<Felt>,\n    unique: bool,\n) -> String {\n    let bytes = [\n        class_hash.serialise_as_bytes(),\n        constructor_calldata.serialise_as_bytes(),\n        salt.serialise_as_bytes(),\n        unique.serialise_as_bytes(),\n    ]\n    .concat();\n    generate_id(\"deploy\", bytes)\n}\n\n#[must_use]\npub fn generate_invoke_tx_id(\n    contract_address: Felt,\n    function_selector: Felt,\n    calldata: &[Felt],\n) -> String {\n    let bytes = [\n        contract_address.serialise_as_bytes(),\n        function_selector.serialise_as_bytes(),\n        calldata.serialise_as_bytes(),\n    ]\n    .concat();\n    generate_id(\"invoke\", bytes)\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use crate::state::hashing::{\n        generate_declare_tx_id, generate_deploy_tx_id, generate_id, generate_invoke_tx_id,\n    };\n    use conversions::IntoConv;\n\n    #[test]\n    fn basic_case() {\n        let hash = generate_id(\"aaa\", vec![b'a']);\n        assert_eq!(\n            hash,\n            \"28913c89fa628136fffce7ded99d65a4e3f5c211f82639fed4adca30d53b8dff\"\n        );\n    }\n\n    #[test]\n    fn declare() {\n        let contract_name = \"testcontract\";\n        let hash = generate_declare_tx_id(contract_name);\n        assert_eq!(\n            hash,\n            \"058d80fb318b7a9aefce7c3725d062f1e449197909a654920b773d3f2c8bb7ce\"\n        );\n    }\n\n    #[test]\n    fn deploy() {\n        let class_hash: Felt = Felt::from_dec_str(\n            \"3372465304726137760522924034754430320558984443503992760655017624209518336998\",\n        )\n        .unwrap()\n        .into_();\n        let constructor_calldata = vec![Felt::from(12u32), Felt::from(4u32)];\n        let salt = Some(Felt::from(89u32));\n        let unique = true;\n\n        let hash = generate_deploy_tx_id(class_hash, &constructor_calldata, salt, unique);\n        assert_eq!(\n            hash,\n            \"c4146aa83f3d3c4e700db0bb8a2781d5b33914d899559d98918d73eb97985480\"\n        );\n    }\n\n    #[test]\n    fn invoke() {\n        let contract_address = Felt::from_dec_str(\n            \"379396891768624119314138643760266110764950106055405813326441497989022918556\",\n        )\n        .unwrap()\n        .into_();\n        let function_selector = Felt::from(890u32);\n        let calldata = vec![Felt::from(1809u32), Felt::from(14u32)];\n        let hash = generate_invoke_tx_id(contract_address, function_selector, &calldata);\n        assert_eq!(\n            hash,\n            \"9b7d3fa2d93d1360a343bfd1d3d76aedef74aace5a5ad47ddbda136d9ce9b244\"\n        );\n    }\n}\n"
  },
  {
    "path": "crates/sncast/src/state/mod.rs",
    "content": "pub mod hashing;\npub mod state_file;\n"
  },
  {
    "path": "crates/sncast/src/state/state_file.rs",
    "content": "use crate::WaitForTransactionError;\nuse crate::helpers::constants::STATE_FILE_VERSION;\nuse crate::response::declare::DeclareResponse;\nuse crate::response::deploy::StandardDeployResponse;\nuse crate::response::errors::StarknetCommandError;\nuse crate::response::invoke::InvokeResponse;\nuse crate::state::hashing::generate_id;\nuse anyhow::{Context, Result, anyhow};\nuse camino::Utf8PathBuf;\nuse conversions::serde::serialize::{BufferWriter, CairoSerialize};\nuse serde::{Deserialize, Serialize};\nuse serde_json::Value;\nuse std::collections::HashMap;\nuse std::fs;\nuse std::time::{SystemTime, UNIX_EPOCH};\n\nstruct InnerStateManager {\n    state_file: Utf8PathBuf,\n    executed_transactions_prev_run: ScriptTransactionEntries,\n    executed_transactions_current_run: ScriptTransactionEntries,\n}\n\n#[derive(Default)]\npub struct StateManager {\n    inner: Option<InnerStateManager>,\n}\n\nimpl StateManager {\n    pub fn from(state_file_path: Option<Utf8PathBuf>) -> Result<Self> {\n        let res = if let Some(state_file_path) = state_file_path {\n            let executed_transactions = load_or_create_state_file(&state_file_path)?\n                .transactions\n                .unwrap_or_default();\n\n            Self {\n                inner: Some(InnerStateManager {\n                    state_file: state_file_path,\n                    executed_transactions_prev_run: executed_transactions,\n                    executed_transactions_current_run: ScriptTransactionEntries::default(),\n                }),\n            }\n        } else {\n            Self::default()\n        };\n\n        Ok(res)\n    }\n\n    #[must_use]\n    pub fn get_output_if_success(&self, tx_id: &str) -> Option<ScriptTransactionOutput> {\n        if let Some(state) = &self.inner {\n            return state\n                .executed_transactions_prev_run\n                .get_success_output(tx_id);\n        }\n        None\n    }\n\n    pub fn maybe_insert_tx_entry(\n        &mut self,\n        tx_id: &str,\n        selector: &str,\n        result: &Result<impl Into<ScriptTransactionOutput> + Clone, StarknetCommandError>,\n    ) -> Result<()> {\n        if let Some(state) = &mut self.inner {\n            state.executed_transactions_current_run.insert(\n                tx_id,\n                ScriptTransactionEntry::from(selector.to_string(), result),\n            );\n\n            write_txs_to_state_file(\n                &state.state_file,\n                state.executed_transactions_current_run.clone(),\n            )?;\n        }\n\n        Ok(())\n    }\n}\n\n#[derive(Deserialize, Serialize, Debug)]\npub struct ScriptTransactionsSchema {\n    pub version: u8,\n    pub transactions: Option<ScriptTransactionEntries>,\n}\n\nimpl ScriptTransactionsSchema {\n    pub fn append_transaction_entries(&mut self, tx_entries: ScriptTransactionEntries) {\n        match self.transactions {\n            Some(ref mut existing_entries) => {\n                existing_entries\n                    .transactions\n                    .extend(tx_entries.transactions);\n            }\n            None => {\n                self.transactions = Some(tx_entries);\n            }\n        }\n    }\n}\n\n#[derive(Clone, Deserialize, Serialize, Debug, PartialEq, Default)]\npub struct ScriptTransactionEntries {\n    pub transactions: HashMap<String, ScriptTransactionEntry>,\n}\n\nimpl ScriptTransactionEntries {\n    #[must_use]\n    pub fn get(&self, tx_id: &str) -> Option<&ScriptTransactionEntry> {\n        self.transactions.get(tx_id)\n    }\n\n    pub fn insert(&mut self, tx_id: &str, entry: ScriptTransactionEntry) {\n        self.transactions.insert(tx_id.to_string(), entry);\n    }\n\n    #[must_use]\n    pub fn get_success_output(&self, tx_id: &str) -> Option<ScriptTransactionOutput> {\n        if let Some(entry) = self.get(tx_id)\n            && entry.status == ScriptTransactionStatus::Success\n        {\n            return Some(entry.output.clone());\n        }\n        None\n    }\n}\n\n#[derive(Clone, Deserialize, Serialize, Debug, PartialEq)]\npub struct ScriptTransactionEntry {\n    pub name: String,\n    pub output: ScriptTransactionOutput,\n    pub status: ScriptTransactionStatus,\n    pub timestamp: u64,\n    pub misc: Option<HashMap<String, Value>>,\n}\n\nimpl ScriptTransactionEntry {\n    pub fn from(\n        name: String,\n        result: &Result<impl Into<ScriptTransactionOutput> + Clone, StarknetCommandError>,\n    ) -> ScriptTransactionEntry {\n        let (response, status) = match result {\n            Ok(response) => {\n                let response: ScriptTransactionOutput = (*response).clone().into();\n                (response, ScriptTransactionStatus::Success)\n            }\n            Err(error) => {\n                let transaction_status = match error {\n                    StarknetCommandError::WaitForTransactionError(\n                        WaitForTransactionError::TransactionError(_),\n                    ) => ScriptTransactionStatus::Fail,\n                    _ => ScriptTransactionStatus::Error,\n                };\n                let response = ErrorResponse {\n                    message: error.to_string(),\n                };\n                let response = ScriptTransactionOutput::ErrorResponse(response);\n                (response, transaction_status)\n            }\n        };\n\n        let timestamp = SystemTime::now()\n            .duration_since(UNIX_EPOCH)\n            .expect(\"System time is smaller than Unix epoch\")\n            .as_secs();\n\n        Self {\n            name,\n            output: response,\n            status,\n            timestamp,\n            misc: None,\n        }\n    }\n}\n\n#[derive(Clone, Deserialize, Serialize, Debug, PartialEq)]\n#[serde(tag = \"type\")]\npub enum ScriptTransactionOutput {\n    InvokeResponse(InvokeResponse),\n    DeclareResponse(DeclareResponse),\n    DeployResponse(StandardDeployResponse),\n    ErrorResponse(ErrorResponse),\n}\n\nimpl From<InvokeResponse> for ScriptTransactionOutput {\n    fn from(value: InvokeResponse) -> Self {\n        Self::InvokeResponse(value)\n    }\n}\n\nimpl From<DeclareResponse> for ScriptTransactionOutput {\n    fn from(value: DeclareResponse) -> Self {\n        Self::DeclareResponse(value)\n    }\n}\n\nimpl From<StandardDeployResponse> for ScriptTransactionOutput {\n    fn from(value: StandardDeployResponse) -> Self {\n        Self::DeployResponse(value)\n    }\n}\n\nimpl CairoSerialize for ScriptTransactionOutput {\n    fn serialize(&self, output: &mut BufferWriter) {\n        match self {\n            ScriptTransactionOutput::InvokeResponse(val) => {\n                Ok::<_, StarknetCommandError>(val).serialize(output);\n            }\n            ScriptTransactionOutput::DeclareResponse(val) => {\n                Ok::<_, StarknetCommandError>(val).serialize(output);\n            }\n            ScriptTransactionOutput::DeployResponse(val) => {\n                Ok::<_, StarknetCommandError>(val).serialize(output);\n            }\n            ScriptTransactionOutput::ErrorResponse(_) => {\n                panic!(\"Cannot return ErrorResponse as script function response\")\n            }\n        }\n    }\n}\n\n#[derive(Clone, Deserialize, Serialize, Debug, PartialEq)]\npub struct ErrorResponse {\n    pub message: String,\n}\n\n#[derive(Clone, Copy, Deserialize, Serialize, Debug, PartialEq)]\npub enum ScriptTransactionStatus {\n    // script executed successfully, transaction accepted/succeeded\n    Success,\n    // script executed successfully, transaction rejected/reverted\n    Fail,\n    // script error\n    Error,\n}\n\npub fn load_state_file(path: &Utf8PathBuf) -> Result<ScriptTransactionsSchema> {\n    let content = fs::read_to_string(path).context(\"Failed to load state file\")?;\n    match serde_json::from_str::<ScriptTransactionsSchema>(&content) {\n        Ok(state_file) => {\n            verify_version(state_file.version)?;\n            Ok(state_file)\n        }\n        Err(_) => Err(anyhow!(\"Failed to parse state file - it may be corrupt\")),\n    }\n}\n\npub fn load_or_create_state_file(path: &Utf8PathBuf) -> Result<ScriptTransactionsSchema> {\n    if path.exists() {\n        load_state_file(path)\n    } else {\n        let default_state = ScriptTransactionsSchema {\n            version: STATE_FILE_VERSION,\n            transactions: None,\n        };\n        fs::write(\n            path,\n            serde_json::to_string_pretty(&default_state)\n                .context(\"Failed to convert ScriptTransactionsSchema to json\")?,\n        )\n        .context(\"Failed to write initial state to state file\")?;\n        Ok(default_state)\n    }\n}\n\n// TODO(#1233): remove must_use attribute when it's no longer needed\n#[must_use]\npub fn generate_transaction_entry_with_id(\n    tx_entry: ScriptTransactionEntry,\n    input_bytes: Vec<u8>,\n) -> ScriptTransactionEntries {\n    let id = generate_id(tx_entry.name.as_str(), input_bytes);\n    let transaction = HashMap::from([(id, tx_entry)]);\n    ScriptTransactionEntries {\n        transactions: transaction,\n    }\n}\n\npub fn read_txs_from_state_file(\n    state_file_path: &Utf8PathBuf,\n) -> Result<Option<ScriptTransactionEntries>> {\n    let state_file = load_state_file(state_file_path)?;\n    Ok(state_file.transactions)\n}\n\npub fn write_txs_to_state_file(\n    state_file_path: &Utf8PathBuf,\n    tx_entries: ScriptTransactionEntries,\n) -> Result<()> {\n    let mut state_file = load_or_create_state_file(state_file_path)\n        .with_context(|| anyhow!(format!(\"Failed to write to state file {state_file_path}\")))?;\n    state_file.append_transaction_entries(tx_entries);\n    fs::write(\n        state_file_path,\n        serde_json::to_string_pretty(&state_file)\n            .expect(\"Failed to convert ScriptTransactionsSchema to json\"),\n    )\n    .with_context(|| anyhow!(\"Failed to write new transactions to state file {state_file_path}\"))?;\n    Ok(())\n}\n\nfn verify_version(version: u8) -> Result<()> {\n    match version {\n        STATE_FILE_VERSION => Ok(()),\n        _ => Err(anyhow!(format!(\"Unsupported state file version {version}\"))),\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use crate::response::declare::DeclareTransactionResponse;\n    use crate::state::state_file::ScriptTransactionOutput::ErrorResponse;\n    use camino::Utf8PathBuf;\n    use conversions::IntoConv;\n    use conversions::string::TryFromHexStr;\n    use starknet_types_core::felt::Felt;\n    use tempfile::TempDir;\n\n    #[test]\n    fn test_load_or_create_state_file_new_happy() {\n        let tempdir = TempDir::new().unwrap();\n        let state_file = Utf8PathBuf::from_path_buf(\n            tempdir\n                .path()\n                .join(\"test_load_or_create_state_file_new_happy.json\"),\n        )\n        .unwrap();\n\n        let result = load_or_create_state_file(&state_file).unwrap();\n\n        assert_eq!(result.version, 1);\n        assert_eq!(result.transactions, None);\n    }\n\n    #[test]\n    fn test_load_or_create_state_file_exists_no_txs() {\n        let state_file = Utf8PathBuf::from(\"tests/data/files/state_no_txs.json\");\n        let result = load_or_create_state_file(&state_file).unwrap();\n\n        assert_eq!(result.version, 1);\n        assert_eq!(result.transactions, None);\n    }\n\n    #[test]\n    fn test_load_or_create_state_file_exists_with_tx() {\n        let state_file = Utf8PathBuf::from(\"tests/data/files/state_with_tx.json\");\n        let result = load_or_create_state_file(&state_file).unwrap();\n\n        assert_eq!(\n            result.transactions.unwrap().get(\"123abc789\").unwrap().name,\n            \"declare\"\n        );\n    }\n\n    #[test]\n    fn test_load_or_create_state_file_exists_with_tx_pre_0_34_0() {\n        let state_file = Utf8PathBuf::from(\"tests/data/files/pre_0.34.0_state_with_tx.json\");\n        let result = load_or_create_state_file(&state_file).unwrap();\n\n        assert_eq!(\n            result.transactions.unwrap().get(\"123abc789\").unwrap().name,\n            \"declare\"\n        );\n    }\n\n    #[test]\n    fn test_load_or_create_state_file_exists_with_txs() {\n        let state_file = Utf8PathBuf::from(\"tests/data/files/state_with_txs.json\");\n        let result = load_or_create_state_file(&state_file).unwrap();\n\n        let transaction_entry = result\n            .transactions\n            .as_ref()\n            .and_then(|tx| tx.get(\"789def420\"))\n            .unwrap();\n\n        match &transaction_entry.output {\n            ErrorResponse(error) => assert_eq!(\n                error.message,\n                \"Max fee is smaller than the minimal transaction cost\"\n            ),\n            _ => unreachable!(),\n        }\n    }\n\n    #[test]\n    fn test_load_or_create_state_file_exists_corrupt() {\n        let state_file = Utf8PathBuf::from(\"tests/data/files/state_corrupt_missing_field.json\");\n        let result = load_or_create_state_file(&state_file).unwrap_err();\n        assert_eq!(\n            result.to_string(),\n            \"Failed to parse state file - it may be corrupt\"\n        );\n    }\n\n    #[test]\n    #[should_panic(expected = \"Failed to load state file\")]\n    fn test_load_state_file_invalid_path() {\n        let state_file = Utf8PathBuf::from(\"bla/bla/crypto.json\");\n        load_state_file(&state_file).unwrap();\n    }\n\n    #[test]\n    fn test_version_mismatch() {\n        let state_file = Utf8PathBuf::from(\"tests/data/files/state_wrong_version.json\");\n        let result = load_or_create_state_file(&state_file).unwrap_err();\n        assert_eq!(result.to_string(), \"Unsupported state file version 0\");\n    }\n\n    #[test]\n    fn test_write_to_file() {\n        let tempdir = TempDir::new().unwrap();\n        let state_file_path =\n            Utf8PathBuf::from_path_buf(tempdir.path().join(\"write_state_nofile.json\")).unwrap();\n\n        let inputs = vec![123u8, 46u8];\n        let transaction = ScriptTransactionEntry {\n            name: \"declare\".to_string(),\n            output: ScriptTransactionOutput::DeclareResponse(DeclareResponse::Success(\n                DeclareTransactionResponse {\n                    class_hash: Felt::try_from_hex_str(\"0x123\").unwrap().into_(),\n                    transaction_hash: Felt::try_from_hex_str(\"0x321\").unwrap().into_(),\n                },\n            )),\n            status: ScriptTransactionStatus::Success,\n            timestamp: 0,\n            misc: None,\n        };\n\n        let tx_entry = generate_transaction_entry_with_id(transaction.clone(), inputs);\n        write_txs_to_state_file(&state_file_path, tx_entry).unwrap();\n        let content = fs::read_to_string(state_file_path).unwrap();\n        let parsed_content = serde_json::from_str::<ScriptTransactionsSchema>(&content).unwrap();\n\n        assert_eq!(parsed_content.version, 1);\n        assert_eq!(\n            parsed_content\n                .transactions\n                .unwrap()\n                .transactions\n                .iter()\n                .next()\n                .unwrap()\n                .1,\n            &transaction\n        );\n    }\n\n    #[test]\n    fn test_write_to_file_append() {\n        let tempdir = TempDir::new().unwrap();\n        let state_file_path =\n            Utf8PathBuf::from_path_buf(tempdir.path().join(\"write_state_append.json\")).unwrap();\n\n        let inputs = vec![123u8, 45u8];\n        let transaction1 = ScriptTransactionEntry {\n            name: \"declare\".to_string(),\n            output: ScriptTransactionOutput::DeclareResponse(DeclareResponse::Success(\n                DeclareTransactionResponse {\n                    class_hash: Felt::try_from_hex_str(\"0x1\").unwrap().into_(),\n                    transaction_hash: Felt::try_from_hex_str(\"0x2\").unwrap().into_(),\n                },\n            )),\n            status: ScriptTransactionStatus::Success,\n            timestamp: 0,\n            misc: None,\n        };\n\n        let tx1_entry = generate_transaction_entry_with_id(transaction1.clone(), inputs);\n        write_txs_to_state_file(&state_file_path, tx1_entry).unwrap();\n\n        let inputs = vec![101u8, 22u8];\n        let transaction2 = ScriptTransactionEntry {\n            name: \"invoke\".to_string(),\n            output: ScriptTransactionOutput::InvokeResponse(InvokeResponse {\n                transaction_hash: Felt::try_from_hex_str(\"0x3\").unwrap().into_(),\n            }),\n            status: ScriptTransactionStatus::Success,\n            timestamp: 1,\n            misc: None,\n        };\n\n        let tx2_entry = generate_transaction_entry_with_id(transaction2.clone(), inputs);\n        write_txs_to_state_file(&state_file_path, tx2_entry).unwrap();\n\n        let content = fs::read_to_string(state_file_path).unwrap();\n        let parsed_content = serde_json::from_str::<ScriptTransactionsSchema>(&content).unwrap();\n\n        assert_eq!(\n            parsed_content\n                .transactions\n                .clone()\n                .unwrap()\n                .transactions\n                .len(),\n            2\n        );\n        assert_eq!(\n            parsed_content\n                .transactions\n                .clone()\n                .unwrap()\n                .get(\"73a528dc325194630de256f187a49c8c3984cdeda6eacc0bad31053cb23715e2\")\n                .unwrap(),\n            &transaction1\n        );\n        assert_eq!(\n            parsed_content\n                .transactions\n                .clone()\n                .unwrap()\n                .get(\"d9b7c5fd12456cbad0a707f3a7800b17f0ad329c9795b4d392a053ef29caa947\")\n                .unwrap(),\n            &transaction2\n        );\n    }\n\n    #[test]\n    fn test_write_to_file_multiple_at_once() {\n        let tempdir = TempDir::new().unwrap();\n        let state_file_path =\n            Utf8PathBuf::from_path_buf(tempdir.path().join(\"write_state_multiple.json\")).unwrap();\n        let mut state = ScriptTransactionsSchema {\n            version: STATE_FILE_VERSION,\n            transactions: None,\n        };\n\n        let inputs = vec![123u8, 45u8];\n        let transaction1 = ScriptTransactionEntry {\n            name: \"declare\".to_string(),\n            output: ScriptTransactionOutput::DeclareResponse(DeclareResponse::Success(\n                DeclareTransactionResponse {\n                    class_hash: Felt::try_from_hex_str(\"0x1\").unwrap().into_(),\n                    transaction_hash: Felt::try_from_hex_str(\"0x2\").unwrap().into_(),\n                },\n            )),\n            status: ScriptTransactionStatus::Success,\n            timestamp: 2,\n            misc: None,\n        };\n        let tx1_entry = generate_transaction_entry_with_id(transaction1.clone(), inputs);\n        state.append_transaction_entries(tx1_entry);\n\n        let inputs = vec![13u8, 15u8];\n        let transaction2 = ScriptTransactionEntry {\n            name: \"invoke\".to_string(),\n            output: ScriptTransactionOutput::InvokeResponse(InvokeResponse {\n                transaction_hash: Felt::try_from_hex_str(\"0x3\").unwrap().into_(),\n            }),\n            status: ScriptTransactionStatus::Success,\n            timestamp: 3,\n            misc: None,\n        };\n        let tx2_entry = generate_transaction_entry_with_id(transaction2.clone(), inputs);\n        state.append_transaction_entries(tx2_entry);\n\n        write_txs_to_state_file(&state_file_path, state.transactions.unwrap()).unwrap();\n\n        let content = fs::read_to_string(state_file_path).unwrap();\n        let parsed_content = serde_json::from_str::<ScriptTransactionsSchema>(&content).unwrap();\n\n        assert_eq!(\n            parsed_content\n                .transactions\n                .clone()\n                .unwrap()\n                .transactions\n                .len(),\n            2\n        );\n        assert_eq!(\n            parsed_content\n                .transactions\n                .clone()\n                .unwrap()\n                .get(\"73a528dc325194630de256f187a49c8c3984cdeda6eacc0bad31053cb23715e2\")\n                .unwrap(),\n            &transaction1\n        );\n        assert_eq!(\n            parsed_content\n                .transactions\n                .clone()\n                .unwrap()\n                .get(\"7b99f490728861b6701d95268e612dd4d0b5bb1f3a9e2dbbe9cc27f3eccda234\")\n                .unwrap(),\n            &transaction2\n        );\n    }\n\n    #[test]\n    fn test_read_and_write_state_file_exists_with_txs() {\n        let from_state_file = Utf8PathBuf::from(\"tests/data/files/state_with_txs.json\");\n        let tempdir = TempDir::new().unwrap();\n        let temp_state_file =\n            Utf8PathBuf::from_path_buf(tempdir.path().join(\"state_with_txs.json\")).unwrap();\n        fs::copy(from_state_file, &temp_state_file).unwrap();\n\n        let tx_id = \"789def420\".to_string();\n\n        let result = read_txs_from_state_file(&temp_state_file).expect(\"Failed to read state file\");\n        let mut entries = result.unwrap();\n        let transaction_entry = entries.transactions.get(&tx_id).unwrap();\n        assert_eq!(entries.transactions.len(), 3);\n        assert_eq!(transaction_entry.status, ScriptTransactionStatus::Fail);\n\n        let new_transaction = ScriptTransactionEntry {\n            name: \"deploy\".to_string(),\n            output: ScriptTransactionOutput::DeployResponse(StandardDeployResponse {\n                transaction_hash: Felt::try_from_hex_str(\"0x3\").unwrap().into_(),\n                contract_address: Felt::try_from_hex_str(\"0x333\").unwrap().into_(),\n            }),\n            status: ScriptTransactionStatus::Success,\n            timestamp: 1,\n            misc: None,\n        };\n        entries\n            .transactions\n            .insert(tx_id.clone(), new_transaction)\n            .unwrap();\n        write_txs_to_state_file(&temp_state_file, entries).unwrap();\n\n        let result = read_txs_from_state_file(&temp_state_file).expect(\"Failed to read state file\");\n        let entries = result.unwrap();\n        let transaction_entry = entries.transactions.get(&tx_id).unwrap();\n        assert_eq!(entries.transactions.len(), 3);\n        assert_eq!(transaction_entry.status, ScriptTransactionStatus::Success);\n    }\n}\n"
  },
  {
    "path": "crates/sncast/tests/code_quality.rs",
    "content": "use camino::Utf8PathBuf;\nuse packages_validation::check_and_lint;\n\n#[test]\nfn validate_sncast_std() {\n    let package_path = Utf8PathBuf::from(\"../../sncast_std\")\n        .canonicalize()\n        .unwrap()\n        .try_into()\n        .unwrap();\n    check_and_lint(&package_path);\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/accounts/accounts.json",
    "content": "{\n    \"alpha-sepolia\": {\n        \"user0\": {\n            \"private_key\": \"0x56c12e097e49ea382ca8eadec0839401\",\n            \"public_key\": \"0x48234b9bc6c1e749f4b908d310d8c53dae6564110b05ccf79016dca8ce7dfac\",\n            \"address\": \"0x6f4621e7ad43707b3f69f9df49425c3d94fdc5ab2e444bfa0e7e4edeff7992d\"\n        },\n        \"user1\": {\n            \"private_key\": \"0xffd33878eed7767e7c546ce3fc026295\",\n            \"public_key\": \"0x17b62d16ee2b9b5ccd3320e2c0b234dfbdd1d01d09d0aa29ce164827cddf46a\",\n            \"salt\": \"0x14b6b215424909f34f417ddd7cbaca48de2d505d03c92467367d275e847d252\",\n            \"address\": \"0xf6ecd22832b7c3713cfa7826ee309ce96a2769833f093795fafa1b8f20c48b\",\n            \"deployed\": true,\n            \"type\": \"open_zeppelin\"\n        },\n        \"user2\": {\n            \"private_key\": \"0xd55976edf8fadf692436af68f7476817\",\n            \"public_key\": \"0x4db538fb2e14aaa37a635d17464e15b5b20e1ab92485c841f0c90ff2061119d\",\n            \"address\": \"0x3e40c4c2770812f69166a12b0462e887ecf58a2eba5b7be1fba78450fd07dbd\"\n        },\n        \"user3\": {\n            \"private_key\": \"0x7e7f595383c98deeb705a6a06e1bc8ff\",\n            \"public_key\": \"0x126ae3ef8f5c843112eed75876ce5bc650f01d33d1917c24f0cd0cee57869ef\",\n            \"address\": \"0x4f740e090e9930518a3a7efc76c6a61b9dffa09dfb20aae645645af739cfac8\"\n        },\n        \"user4\": {\n            \"private_key\": \"0x7d4ad2e3c3e6f34ccaae5cf34bfcecb5\",\n            \"public_key\": \"0x2598e6ec76379ce596506499ddf1c339e46dbc5d80569ceccee3880421ad237\",\n            \"address\": \"0x3ffc270312cbefaf2fb4a88e97cc186797bada41a291331186ec5ca316e32fa\"\n        },\n        \"user5\": {\n            \"private_key\": \"0xa93f89e75aaf77eaa26fa0292becb8f0\",\n            \"public_key\": \"0x3de0121583da0bbc0836e8be45fb93391057fcd0082cb6aae6b941c4a680969\",\n            \"address\": \"0x51b3c1e02298485322763acbe269b53f46217adc1dc66f07e3e6f6d0fe885b7\"\n        },\n        \"user6\": {\n            \"private_key\": \"0x9255d1e74778df39cb6514fd143a431\",\n            \"public_key\": \"0x6ec12575eb96e09affeeb84551c7e0e21f5c33ba2b379794285f224aabe2140\",\n            \"address\": \"0x6ccfd328e3512986cde1de944f3f6598e5381aae635839cbf7d4db01b8bee0a\"\n        },\n        \"user7\": {\n            \"private_key\": \"0xb302d1b22f135036dfbd79198777c7e9\",\n            \"public_key\": \"0x43916246826b183daf4f9235572ae46b2eabd1a5f3bea14f52d123a88e1dcf2\",\n            \"address\": \"0x65b2c72a2fe093c135ab191c2e7ce181205bb10d59a366942a1cbf284b98662\"\n        },\n        \"user8\": {\n            \"private_key\": \"0xe087cfde9474b2e716b1aeda95a02081\",\n            \"public_key\": \"0x4fdaeb60e75399877bd5d14d3dac2e805f3c2a6732851a19db63fee0cfae00d\",\n            \"address\": \"0x68d6e92b8e2310c550178b2fe484d5cb89dd6aa93ae804afd4d124e9d6c3cd3\"\n        },\n        \"oz_cairo_1\": {\n            \"private_key\": \"0x88ecc06581d81c76cef06d6f4f0c1b28\",\n            \"public_key\": \"0x8cdbe26bc82084b04eccb3c6f8a76f12ad6c4015b3dc8ab90dc840d42cac29\",\n            \"address\": \"0x691a61b12a7105b1372cc377f135213c11e8400a546f6b0e7ea0296046690ce\",\n            \"legacy\": false\n        },\n        \"user9\": {\n            \"address\": \"0x56d5ce4cfa419b1ed7b4a36a02673781ee7f8ce14f14dd138f3680d2373ce79\",\n            \"private_key\": \"0x783384d0b78b078ee3aecbeefa3b53d\",\n            \"public_key\": \"0x404bcccb310f044137fa1790d1b059dbe65a2f2183a47faa63c0d36b2672fe\"\n        },\n        \"user10\": {\n            \"address\": \"0x374271e0344358bc75965ba584e1f48586d88e1be735447b7b5816644526ad6\",\n            \"private_key\": \"0x5c9e5e944bbb2b812b4ed945cb65fde5\",\n            \"public_key\": \"0x1c7178f1c48d08463baaaddc077a53c15b88cde319401771db2cc60c554923e\"\n        },\n        \"user11\": {\n            \"address\": \"0x4ce45bd95d2ec35e3dd4490e28f896367958b966673789fef253626133ed37d\",\n            \"private_key\": \"0x5e643953ed2cfb2da8ec571ddd4f0c6e\",\n            \"public_key\": \"0xdfc904e94dc2ca03ce25be703959c2a209f9519ef97a6c6697caf283dd569e\"\n        },\n        \"user12\": {\n            \"address\": \"0x5a21a825f1c5ef6d39b6db8f5c04709dbc003ca77eac4bf76aa4e2ffb3acddb\",\n            \"private_key\": \"0x11c734e0f6bc6d7af2eecc3ab4cafecd\",\n            \"public_key\": \"0x548aa366cfff6986cf35e10a063d848112961cbb21cd0bb90feded2029fb228\"\n        },\n        \"user13\": {\n            \"address\": \"0x52e667bcfe4edf245f885841da86f4cc636450473bca1ed10b9c89e92d06989\",\n            \"private_key\": \"0x1c2d90055709d02a7ed3e2c7a8747cd3\",\n            \"public_key\": \"0x361827f172e65d9f49df3fad6c85e1a54668cb61ef2d1ad53fde4ccc660e577\"\n        },\n        \"user14\": {\n            \"address\": \"0x67e26e7507906e8b16d237adf405d8c9251d183b884990be4106b2cf2468d4b\",\n            \"private_key\": \"0xc0a3ca11e949e7a68018291cbc68c217\",\n            \"public_key\": \"0x7cac3417039e39f8b43f597cf2bfbe09b09d7d384ad3e776b40327d671f2cd6\"\n        },\n        \"user15\": {\n            \"address\": \"0x6b3f4e866f26b547f0b3c44ecda337ccb5fa3bb1039cc133e1fcc263ae71e46\",\n            \"private_key\": \"0xa2cc1d4a77df993ffdbbc334f2a9bd75\",\n            \"public_key\": \"0x6f966dd05f85a9ad3fcfd4ad2de8fd767b0512bf2905c1154fb033a5c43e334\"\n        },\n        \"user16\": {\n            \"address\": \"0x225321e7a7a8c5cd2efd8a8d7730b405adbc8f20b9cd80dd522f1d5e3ababfb\",\n            \"private_key\": \"0x6f05692b1faf2c28bc4203fcafac001a\",\n            \"public_key\": \"0x2bde1887739707bea5204c04d54cb5435c746b1dca7fd5b368ce6466919c0e5\"\n        },\n        \"user17\": {\n            \"address\": \"0x1774b8406f03426b2754aed8bf4934ea750182b6195d9033dfc90a67902cdbf\",\n            \"private_key\": \"0x80e37e863d20b77f53bd347c3d888f2\",\n            \"public_key\": \"0x72ebaa063bc33531088ce4bd3e88b7599548a1d86f249056573861b9736158f\"\n        },\n        \"user18\": {\n            \"address\": \"0x2c7645c4ec2c162e91d43938d145097f33eb00aa3c7aa44264a84315c62c1a7\",\n            \"private_key\": \"0x98459e6c48a54ea0839a578c6814fc86\",\n            \"public_key\": \"0x4825d8b86a41f7c66c40229445afb139cec19397dd2b81037aa60bf2140c4b9\"\n        },\n        \"oz_cairo_0\": {\n            \"private_key\": \"0x45136b667118bab7f2a9d656d08981ecd7065feb420c3f81c3ed8f461072b0a\",\n            \"public_key\": \"0x6b35e242f65996a44b6cf808b954785926eb89e8f4b6441b65780c4eacb9668\",\n            \"address\": \"0x5c8fb90cc7249383cbc83c682565720a6d3df92840c02424a6c230e26464c4c\",\n            \"class_hah\": \"0x4d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f\",\n            \"salt\": \"0xe35eea9d1b0fa729\",\n            \"legacy\": true\n        },\n        \"ready\": {\n            \"address\": \"0x0321dd5ed1ff8ca08792d5c7c66d9daad1f0249c4defbe045b28ab0fec1beaed\",\n            \"class_hash\": \"0x36078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f\",\n            \"legacy\": false,\n            \"private_key\": \"0x00bb17245c662eb6ada1ae85c0a6afc77b0df2aa92ee9046e577f4427cdf6d3a\",\n            \"public_key\": \"0x04d2c00e488819b43a09d720694fe97aa44054803f411bdc93d6b22d548f69a2\",\n            \"salt\": \"0x50d1de0aa965925d611a0d52142f22f6fd0a664838b213da4621f8d70230b40\",\n            \"type\": \"ready\"\n        },\n        \"braavos\": {\n            \"address\": \"0x2235bf96ef3f88915e3537f9a692977f5caf10b728dd95b0a3ccca2282fbb9b\",\n            \"class_hash\": \"0x3957f9f5a1cbfe918cedc2015c85200ca51a5f7506ecb6de98a5207b759bf8a\",\n            \"deployed\": false,\n            \"legacy\": false,\n            \"private_key\": \"0x18201c12f4742c34655c5e41dba442afbe95fdeb018f8581d1b39b06824affe\",\n            \"public_key\": \"0x222c9fa27a71f007fc04da4dad684fa6a2b7328c002788089920b53c16ea374\",\n            \"salt\": \"0x76210f283afb4f88\",\n            \"type\": \"braavos\"\n        },\n        \"oz\": {\n            \"address\": \"0x1173129651d1853fe9a15f8e8ef29e4806c5a9469b0a6b9622ee90f392bc26d\",\n            \"class_hash\": \"0x5b4b537eaa2399e3aa99c4e2e0208ebd6c71bc1467938cd52c798c601e43564\",\n            \"deployed\": false,\n            \"legacy\": false,\n            \"private_key\": \"0x4a31141908e08ec6d82d324303d97405ad2196def8a13ea320e2117166809d2\",\n            \"public_key\": \"0x36a64f9d432cce317c3e50bc467d48f2797463babe8f29c83c2e6125ddd1947\",\n            \"salt\": \"0x25e7144fce03d200\",\n            \"type\": \"open_zeppelin\"\n        },\n        \"devnet-1\": {\n            \"private_key\": \"0x0000000000000000000000000000000056c12e097e49ea382ca8eadec0839401\",\n            \"public_key\": \"0x048234b9bc6c1e749f4b908d310d8c53dae6564110b05ccf79016dca8ce7dfac\",\n            \"address\": \"0x06f4621e7ad43707b3f69f9df49425c3d94fdc5ab2e444bfa0e7e4edeff7992d\"\n        },\n        \"balance-test\": {\n            \"private_key\": \"0x1\",\n            \"public_key\": \"0x1\",\n            \"address\": \"0x0585Dd8cAb667CA8415FaC8bEad99c78947079AA72d9120140549a6f2EDc4128\"\n        }\n    }\n}\n\n"
  },
  {
    "path": "crates/sncast/tests/data/accounts/faulty_accounts.json",
    "content": "{\n    \"alpha-sepolia\": {\n        \"with_wrong_private_key\": {\n            \"private_key\": \"0x1\",\n            \"public_key\": \"0x14b491156e96ecf11dace8999b1e5e30888548a581c067b1956b7468bb279b9\",\n            \"salt\": \"0x14b6b215424909f34f417ddd7cbaca48de2d505d03c92467367d275e847d252\",\n            \"address\": \"0x76e7ce6466e353a00b614ee763f1bc93dba01a57925784a7682efa6b1879c3d\",\n            \"deployed\": true\n        },\n        \"with_wrong_class_hash\": {\n            \"private_key\": \"0x88ecc06581d81c76cef06d6f4f0c1b28\",\n            \"public_key\": \"0x8cdbe26bc82084b04eccb3c6f8a76f12ad6c4015b3dc8ab90dc840d42cac29\",\n            \"address\": \"0x691a61b12a7105b1372cc377f135213c11e8400a546f6b0e7ea0296046690ce\",\n            \"class_hash\": \"0x1\"\n        },\n        \"with_wrong_address\": {\n            \"private_key\": \"0xe3e70682c2094cac629f6fbed82c07cd\",\n            \"public_key\": \"0x7e52885445756b313ea16849145363ccb73fb4ab0440dbac333cf9d13de82b9\",\n            \"address\": \"0x2\"\n        },\n        \"with_nonexistent_address\": {\n            \"private_key\": \"0xe3e70682c2094cac629f6fbed82c07cd\",\n            \"public_key\": \"0x7e52885445756b313ea16849145363ccb73fb4ab0440dbac333cf9d13de82b9\",\n            \"address\": \"0x1010101010011aaabbcc\"\n        }\n    }\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/accounts/faulty_accounts_invalid_felt.json",
    "content": "{\n    \"alpha-sepolia\": {\n        \"with_invalid_private_key\": {\n            \"private_key\": \"private_key\",\n            \"public_key\": \"0x14b491156e96ecf11dace8999b1e5e30888548a581c067b1956b7468bb279b9\",\n            \"salt\": \"0x14b6b215424909f34f417ddd7cbaca48de2d505d03c92467367d275e847d252\",\n            \"address\": \"0x76e7ce6466e353a00b614ee763f1bc93dba01a57925784a7682efa6b1879c3d\",\n            \"deployed\": true\n        }\n    }\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/accounts/invalid_format.json",
    "content": "{\n    \"alpha-sepolia\": {\n        \"__default__\": {\n            \"private_key\": \"0x421b62d2cba1fd39798d719a6cee5f599afc79b0bacbea50f76215057c068dd\",\n            \"public_key\": \"0x12d3ad59161fd2a72d5bc8501bb2f2ca1acd34706d2dfa31a90aadb4b41e050\",\n            \"address\": \"0x20f8c63faff27a0c5fe8a25dc1635c40c971bf67b8c35c6089a998649dfdfcb\"\n        }\n        \"user1\": {\n            \"private_key\": \"0x74d866eabee023f563684e955401326eeec6a4d3ce609d23bfe8b6b391de269\",\n            \"public_key\": \"0x14b491156e96ecf11dace8999b1e5e30888548a581c067b1956b7468bb279b9\",\n            \"salt\": \"0x14b6b215424909f34f417ddd7cbaca48de2d505d03c92467367d275e847d252\",\n            \"address\": \"0x76e7ce6466e353a00b614ee763f1bc93dba01a57925784a7682efa6b1879c3d\",\n            \"deployed\": true\n        }\n    }\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/contracts/build_fails/Scarb.toml",
    "content": "[package]\nname = \"build_fails\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \">=2.0.2\"\n\n[[target.starknet-contract]]\n\n[lib]\nsierra = false\n"
  },
  {
    "path": "crates/sncast/tests/data/contracts/build_fails/src/lib.cairo",
    "content": "#[starknet::contract]\nmod BuildFails {\n    #[storage]\n    struct Storage {\n        storage: felt2,\n    }\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/contracts/constructor_with_params/Scarb.toml",
    "content": "[package]\nname = \"constructor_with_params\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \">=2.0.2\"\n\n[[target.starknet-contract]]\n\n[lib]\nsierra = false\n"
  },
  {
    "path": "crates/sncast/tests/data/contracts/constructor_with_params/src/lib.cairo",
    "content": "#[starknet::contract]\nmod ConstructorWithParams {\n    #[storage]\n    struct Storage {\n        value1: felt252,\n        value2: u256,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState, first: felt252, second: u256) {\n        self.value1.write(first);\n        self.value2.write(second);\n    }\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/contracts/contract_with_constructor_params/Scarb.toml",
    "content": "[package]\nname = \"contract_with_constructor_params\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \">=2.10.1\"\n\n[[target.starknet-contract]]\n\n[lib]\nsierra = false\n"
  },
  {
    "path": "crates/sncast/tests/data/contracts/contract_with_constructor_params/src/lib.cairo",
    "content": "#[starknet::contract]\nmod ContractWithConstructorParams {\n    #[storage]\n    struct Storage {}\n\n    #[constructor]\n    fn constructor(ref self: ContractState, foo: felt252, bar: felt252) {\n        let _x = foo + bar;\n    }\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/contracts/map/Scarb.toml",
    "content": "[package]\nname = \"map\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \">=2.0.2\"\n\n[[target.starknet-contract]]\n\n[lib]\nsierra = false\n"
  },
  {
    "path": "crates/sncast/tests/data/contracts/map/src/lib.cairo",
    "content": "#[starknet::interface]\ntrait IMap<TMapState> {\n    fn put(ref self: TMapState, key: felt252, value: felt252);\n    fn get(self: @TMapState, key: felt252) -> felt252;\n}\n\n\n#[starknet::contract]\nmod Map {\n    use starknet::storage::{Map, StorageMapReadAccess, StoragePathEntry, StoragePointerWriteAccess};\n    #[storage]\n    struct Storage {\n        storage: Map<felt252, felt252>,\n    }\n\n    #[abi(embed_v0)]\n    impl MapImpl of super::IMap<ContractState> {\n        fn put(ref self: ContractState, key: felt252, value: felt252) {\n            self.storage.entry(key).write(value);\n        }\n\n        fn get(self: @ContractState, key: felt252) -> felt252 {\n            self.storage.read(key)\n        }\n    }\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/contracts/map/src/test_helpers.cairo",
    "content": "fn create_test_pair(key: felt252, value: felt252) -> (felt252, felt252) {\n    (key, value)\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/contracts/map/src/tests.cairo",
    "content": "/// Simple test file for testing --test-files flag functionality\n/// This file contains basic test helper functions\n\n/// Test function that validates a felt252 value\n#[test]\nfn test_validate_felt(value: felt252) -> bool {\n    value != 0\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/contracts/multiple_packages/Scarb.toml",
    "content": "[workspace]\nmembers = [\n    \"crates/*\",\n]\n\n[workspace.dependencies]\nstarknet = \"2.4.0\"\n\n[workspace.package]\nversion = \"0.1.0\"\n\n[package]\nname = \"main_workspace\"\nversion.workspace = true\nedition = \"2024_07\"\n\n[dependencies]\nstarknet.workspace = true\npackage1 = { path = \"crates/package1\" }\npackage2 = { path = \"crates/package2\" }\n\n[[target.starknet-contract]]\n"
  },
  {
    "path": "crates/sncast/tests/data/contracts/multiple_packages/crates/package1/Scarb.toml",
    "content": "[package]\nname = \"package1\"\nversion.workspace = true\nedition = \"2024_07\"\n\n[dependencies]\nstarknet.workspace = true\n\n[[target.starknet-contract]]\n\n[lib]\n"
  },
  {
    "path": "crates/sncast/tests/data/contracts/multiple_packages/crates/package1/src/lib.cairo",
    "content": "#[starknet::contract]\npub mod supercomplexcode1 {\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    fn whatever(ref self: ContractState) -> felt252 {\n        1\n    }\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/contracts/multiple_packages/crates/package2/Scarb.toml",
    "content": "[package]\nname = \"package2\"\nversion.workspace = true\nedition = \"2024_07\"\n\n[dependencies]\nstarknet.workspace = true\n\n[[target.starknet-contract]]\n\n[lib]\n"
  },
  {
    "path": "crates/sncast/tests/data/contracts/multiple_packages/crates/package2/src/lib.cairo",
    "content": "#[starknet::contract]\npub mod supercomplexcode2 {\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    fn whatever(ref self: ContractState) -> felt252 {\n        2\n    }\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/contracts/multiple_packages/src/lib.cairo",
    "content": "#[starknet::contract]\nmod supercomplexcode {\n    use package1::supercomplexcode1;\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    fn whatever(ref self: ContractState) -> felt252 {\n        3\n    }\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/contracts/no_casm/Scarb.toml",
    "content": "[package]\nname = \"build_fails_no_casm\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \">=2.0.2\"\n\n[[target.starknet-contract]]\nsierra = true\ncasm = false\n\n[lib]\nsierra = true\n"
  },
  {
    "path": "crates/sncast/tests/data/contracts/no_casm/src/lib.cairo",
    "content": "#[starknet::interface]\ntrait Iminimal_contract<TContractState> {\n    fn empty(ref self: TContractState);\n}\n\n#[starknet::contract]\nmod minimal_contract {\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl minimal_contractImpl of super::Iminimal_contract<ContractState> {\n        fn empty(ref self: ContractState) {}\n    }\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/contracts/no_sierra/Scarb.toml",
    "content": "[package]\nname = \"build_fails_no_sierra\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \">=2.0.2\"\n\n[[target.starknet-contract]]\nsierra = false\n\n[lib]\nsierra = false\n"
  },
  {
    "path": "crates/sncast/tests/data/contracts/no_sierra/src/lib.cairo",
    "content": "#[starknet::interface]\ntrait Iminimal_contract<TContractState> {\n    fn empty(ref self: TContractState);\n}\n\n#[starknet::contract]\nmod minimal_contract {\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl minimal_contractImpl of super::Iminimal_contract<ContractState> {\n        fn empty(ref self: ContractState) {}\n    }\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/contracts/virtual_workspace/Scarb.toml",
    "content": "[workspace]\nmembers = [\n    \"crates/*\",\n]\n\n[workspace.package]\nversion = \"0.1.0\"\n\n[workspace.dependencies]\nstarknet = \"2.4.0\"\n"
  },
  {
    "path": "crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/Scarb.toml",
    "content": "[package]\nname = \"cast_addition\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet.workspace = true\n\n[[target.starknet-contract]]\n\n[lib]\n"
  },
  {
    "path": "crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_addition/src/lib.cairo",
    "content": "pub fn add(a: felt252, b: felt252) -> felt252 {\n    a + b\n}\n\n#[starknet::contract]\nmod AdditionContract {\n    use cast_addition::add;\n\n    #[storage]\n    struct Storage {}\n\n    #[external(v0)]\n    fn answer(ref self: ContractState) -> felt252 {\n        add(10, 20)\n    }\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_fibonacci/Scarb.toml",
    "content": "[package]\nname = \"cast_fibonacci\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\ncast_addition = { path = \"../cast_addition\" }\nstarknet.workspace = true\n\n[[target.starknet-contract]]\nbuild-external-contracts = [\"cast_addition::AdditionContract\"]\n\n[lib]\n"
  },
  {
    "path": "crates/sncast/tests/data/contracts/virtual_workspace/crates/cast_fibonacci/src/lib.cairo",
    "content": "use cast_addition::add;\n\nfn fib(a: felt252, b: felt252, n: felt252) -> felt252 {\n    match n {\n        0 => a,\n        _ => fib(b, add(a, b), n - 1),\n    }\n}\n\n#[starknet::contract]\nmod FibonacciContract {\n    use cast_addition::add;\n    use cast_fibonacci::fib;\n\n    #[storage]\n    struct Storage {}\n\n    #[external(v0)]\n    fn answer(ref self: ContractState) -> felt252 {\n        add(fib(0, 1, 16), fib(0, 1, 8))\n    }\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/files/correct_snfoundry.toml",
    "content": "[sncast.default]\nurl = \"http://127.0.0.1:5055/rpc\"\naccounts-file = \"../account-file\"\naccount = \"user1\"\n\n[sncast.profile1]\nurl = \"http://127.0.0.1:5050/rpc\"\naccount = \"user3\"\n\n[sncast.profile2]\nurl = \"http://127.0.0.1:5055/rpc\"\naccounts-file = \"../account-file\"\naccount = \"user100\"\nblock-explorer = \"ViewBlock\"\n\n[sncast.profile3]\nurl = \"http://127.0.0.1:5055/rpc\"\naccount = \"/path/to/account.json\"\nkeystore = \"../keystore\"\n\n[sncast.profile4]\nurl = \"http://127.0.0.1:5055/rpc\"\naccounts-file = \"../account-file\"\naccount = \"user3\"\n\n[sncast.profile5]\nurl = \"http://127.0.0.1:5055/rpc\"\naccount = \"user8\"\n\n[sncast.profile6]\naccounts-file = \"/path/to/account.json\"\naccount = \"user1\"\nwait-params = { timeout = 500, retry-interval = 10 }\nshow-explorer-links = false\n\n[sncast.profile7]\nnetwork = \"sepolia\"\naccount = \"user1\"\naccounts-file = \"/path/to/account.json\"\n\n[sncast.no_url]\naccounts-file = \"../account-file\"\naccount = \"user1\"\n"
  },
  {
    "path": "crates/sncast/tests/data/files/data_transformer_contract_abi.json",
    "content": "[{\"name\":\"DataTransformerImpl\",\"type\":\"impl\",\"interface_name\":\"data_transformer_contract::IDataTransformer\"},{\"name\":\"core::integer::u256\",\"type\":\"struct\",\"members\":[{\"name\":\"low\",\"type\":\"core::integer::u128\"},{\"name\":\"high\",\"type\":\"core::integer::u128\"}]},{\"name\":\"data_transformer_contract::SimpleStruct\",\"type\":\"struct\",\"members\":[{\"name\":\"a\",\"type\":\"core::felt252\"}]},{\"name\":\"data_transformer_contract::NestedStructWithField\",\"type\":\"struct\",\"members\":[{\"name\":\"a\",\"type\":\"data_transformer_contract::SimpleStruct\"},{\"name\":\"b\",\"type\":\"core::felt252\"}]},{\"name\":\"data_transformer_contract::Enum\",\"type\":\"enum\",\"variants\":[{\"name\":\"One\",\"type\":\"()\"},{\"name\":\"Two\",\"type\":\"core::integer::u128\"},{\"name\":\"Three\",\"type\":\"data_transformer_contract::NestedStructWithField\"}]},{\"name\":\"core::byte_array::ByteArray\",\"type\":\"struct\",\"members\":[{\"name\":\"data\",\"type\":\"core::array::Array::<core::bytes_31::bytes31>\"},{\"name\":\"pending_word\",\"type\":\"core::felt252\"},{\"name\":\"pending_word_len\",\"type\":\"core::integer::u32\"}]},{\"name\":\"core::bool\",\"type\":\"enum\",\"variants\":[{\"name\":\"False\",\"type\":\"()\"},{\"name\":\"True\",\"type\":\"()\"}]},{\"name\":\"data_transformer_contract::ComplexStruct\",\"type\":\"struct\",\"members\":[{\"name\":\"a\",\"type\":\"data_transformer_contract::NestedStructWithField\"},{\"name\":\"b\",\"type\":\"core::felt252\"},{\"name\":\"c\",\"type\":\"core::integer::u8\"},{\"name\":\"d\",\"type\":\"core::integer::i32\"},{\"name\":\"e\",\"type\":\"data_transformer_contract::Enum\"},{\"name\":\"f\",\"type\":\"core::byte_array::ByteArray\"},{\"name\":\"g\",\"type\":\"core::array::Array::<core::felt252>\"},{\"name\":\"h\",\"type\":\"core::integer::u256\"},{\"name\":\"i\",\"type\":\"(core::integer::i128, core::integer::u128)\"}]},{\"name\":\"data_transformer_contract::BitArray\",\"type\":\"struct\",\"members\":[{\"name\":\"bit\",\"type\":\"core::felt252\"}]},{\"name\":\"alexandria_data_structures::bit_array::BitArray\",\"type\":\"struct\",\"members\":[{\"name\":\"data\",\"type\":\"core::array::Array::<core::bytes_31::bytes31>\"},{\"name\":\"current\",\"type\":\"core::felt252\"},{\"name\":\"read_pos\",\"type\":\"core::integer::u32\"},{\"name\":\"write_pos\",\"type\":\"core::integer::u32\"}]},{\"name\":\"core::array::Span::<core::felt252>\",\"type\":\"struct\",\"members\":[{\"name\":\"snapshot\",\"type\":\"@core::array::Array::<core::felt252>\"}]},{\"name\":\"data_transformer_contract::IDataTransformer\",\"type\":\"interface\",\"items\":[{\"name\":\"simple_fn\",\"type\":\"function\",\"inputs\":[{\"name\":\"a\",\"type\":\"core::felt252\"}],\"outputs\":[],\"state_mutability\":\"external\"},{\"name\":\"u256_fn\",\"type\":\"function\",\"inputs\":[{\"name\":\"a\",\"type\":\"core::integer::u256\"}],\"outputs\":[],\"state_mutability\":\"external\"},{\"name\":\"signed_fn\",\"type\":\"function\",\"inputs\":[{\"name\":\"a\",\"type\":\"core::integer::i32\"}],\"outputs\":[],\"state_mutability\":\"external\"},{\"name\":\"unsigned_fn\",\"type\":\"function\",\"inputs\":[{\"name\":\"a\",\"type\":\"core::integer::u32\"}],\"outputs\":[],\"state_mutability\":\"external\"},{\"name\":\"tuple_fn\",\"type\":\"function\",\"inputs\":[{\"name\":\"a\",\"type\":\"(core::felt252, core::integer::u8, data_transformer_contract::Enum)\"}],\"outputs\":[],\"state_mutability\":\"external\"},{\"name\":\"complex_fn\",\"type\":\"function\",\"inputs\":[{\"name\":\"arr\",\"type\":\"core::array::Array::<core::array::Array::<core::felt252>>\"},{\"name\":\"one\",\"type\":\"core::integer::u8\"},{\"name\":\"two\",\"type\":\"core::integer::i16\"},{\"name\":\"three\",\"type\":\"core::byte_array::ByteArray\"},{\"name\":\"four\",\"type\":\"(core::felt252, core::integer::u32)\"},{\"name\":\"five\",\"type\":\"core::bool\"},{\"name\":\"six\",\"type\":\"core::integer::u256\"}],\"outputs\":[],\"state_mutability\":\"external\"},{\"name\":\"simple_struct_fn\",\"type\":\"function\",\"inputs\":[{\"name\":\"a\",\"type\":\"data_transformer_contract::SimpleStruct\"}],\"outputs\":[],\"state_mutability\":\"external\"},{\"name\":\"nested_struct_fn\",\"type\":\"function\",\"inputs\":[{\"name\":\"a\",\"type\":\"data_transformer_contract::NestedStructWithField\"}],\"outputs\":[],\"state_mutability\":\"external\"},{\"name\":\"enum_fn\",\"type\":\"function\",\"inputs\":[{\"name\":\"a\",\"type\":\"data_transformer_contract::Enum\"}],\"outputs\":[],\"state_mutability\":\"external\"},{\"name\":\"complex_struct_fn\",\"type\":\"function\",\"inputs\":[{\"name\":\"a\",\"type\":\"data_transformer_contract::ComplexStruct\"}],\"outputs\":[],\"state_mutability\":\"external\"},{\"name\":\"external_struct_fn\",\"type\":\"function\",\"inputs\":[{\"name\":\"a\",\"type\":\"data_transformer_contract::BitArray\"},{\"name\":\"b\",\"type\":\"alexandria_data_structures::bit_array::BitArray\"}],\"outputs\":[],\"state_mutability\":\"external\"},{\"name\":\"span_fn\",\"type\":\"function\",\"inputs\":[{\"name\":\"a\",\"type\":\"core::array::Span::<core::felt252>\"}],\"outputs\":[],\"state_mutability\":\"external\"},{\"name\":\"multiple_signed_fn\",\"type\":\"function\",\"inputs\":[{\"name\":\"a\",\"type\":\"core::integer::i32\"},{\"name\":\"b\",\"type\":\"core::integer::i8\"}],\"outputs\":[],\"state_mutability\":\"external\"}]},{\"name\":\"constructor\",\"type\":\"constructor\",\"inputs\":[{\"name\":\"init_owner\",\"type\":\"core::starknet::contract_address::ContractAddress\"}]},{\"kind\":\"enum\",\"name\":\"data_transformer_contract::DataTransformer::Event\",\"type\":\"event\",\"variants\":[]}]\n\n"
  },
  {
    "path": "crates/sncast/tests/data/files/data_transformer_contract_abi_missing_function.json",
    "content": "[\n    {\n        \"name\": \"DataTransformerImpl\",\n        \"type\": \"impl\",\n        \"interface_name\": \"data_transformer_contract::IDataTransformer\"\n    },\n    {\n        \"name\": \"data_transformer_contract::IDataTransformer\",\n        \"type\": \"interface\",\n        \"items\": []\n    }\n]\n\n"
  },
  {
    "path": "crates/sncast/tests/data/files/data_transformer_contract_abi_missing_type.json",
    "content": "[\n    {\n        \"name\": \"DataTransformerImpl\",\n        \"type\": \"impl\",\n        \"interface_name\": \"data_transformer_contract::IDataTransformer\"\n    },\n    {\n        \"name\": \"data_transformer_contract::IDataTransformer\",\n        \"type\": \"interface\",\n        \"items\": [\n            {\n                \"name\": \"nested_struct_fn\",\n                \"type\": \"function\",\n                \"inputs\": [\n                    {\n                        \"name\": \"a\",\n                        \"type\": \"data_transformer_contract::NestedStructWithField\"\n                    }\n                ],\n                \"outputs\": [],\n                \"state_mutability\": \"external\"\n            }\n        ]\n    }\n]\n\n"
  },
  {
    "path": "crates/sncast/tests/data/files/invalid_snfoundry.toml",
    "content": "[sncast.url_and_network]\naccount = \"user1\"\nurl = \"http://some.url\"\nnetwork = \"sepolia\"\naccounts-file = \"/path/to/account.json\"\n\n[sncast.profile_with_stark_scan]\naccount = \"user1\"\nurl = \"http://some.url\"\nnetwork = \"sepolia\"\naccounts-file = \"/path/to/account.json\"\nblock-explorer = \"StarkScan\"\n"
  },
  {
    "path": "crates/sncast/tests/data/files/pre_0.34.0_state_with_tx.json",
    "content": "{\n  \"version\": 1,\n  \"transactions\": [{\n    \"123abc789\": {\n      \"name\": \"declare\",\n      \"output\": {\n        \"type\": \"DeclareResponse\",\n        \"class_hash\": \"0x123\",\n        \"transaction_hash\": \"0x321\"\n      },\n      \"status\": \"Success\",\n      \"timestamp\": 1706093159,\n      \"misc\": null\n    }\n  }]\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/files/state_corrupt_missing_field.json",
    "content": "{\n  \"version\": 1,\n  \"transactions\": {\n    \"123abc789\": {\n      \"name\": \"declare\",\n      \"output\": {\n        \"class_hash\": \"0x123\",\n        \"transaction_hash\": \"0x321\"\n      },\n      \"status\": \"success\",\n      \"misc\": null\n    }\n  }\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/files/state_no_txs.json",
    "content": "{\n  \"version\": 1,\n  \"transactions\": null\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/files/state_with_tx.json",
    "content": "{\n  \"version\": 1,\n  \"transactions\": [{\n    \"123abc789\": {\n      \"name\": \"declare\",\n      \"output\": {\n        \"type\": \"DeclareResponse\",\n        \"status\": \"Success\",\n        \"class_hash\": \"0x0000000000000000000000000000000000000000000000000000000000000123\",\n        \"transaction_hash\": \"0x0000000000000000000000000000000000000000000000000000000000000321\"\n      },\n      \"status\": \"Success\",\n      \"timestamp\": 1706093159,\n      \"misc\": null\n    }\n  }]\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/files/state_with_txs.json",
    "content": "{\n  \"version\": 1,\n  \"transactions\": [{\n    \"123abc456\": {\n      \"name\": \"declare\",\n      \"output\": {\n        \"type\": \"DeclareResponse\",\n        \"status\": \"Success\",\n        \"class_hash\": \"0x0000000000000000000000000000000000000000000000000000000000000123\",\n        \"transaction_hash\": \"0x0000000000000000000000000000000000000000000000000000000000000321\"\n      },\n      \"status\": \"Success\",\n      \"timestamp\": 1706093159,\n      \"misc\": null\n    },\n    \"111aaa111\": {\n      \"name\": \"declare\",\n      \"output\": {\n        \"type\": \"DeclareResponse\",\n        \"status\": \"AlreadyDeclared\",\n        \"class_hash\": \"0x0000000000000000000000000000000000000000000000000000000000000123\"\n      },\n      \"status\": \"Success\",\n      \"timestamp\": 1706093159,\n      \"misc\": null\n    },\n    \"789def420\": {\n      \"name\": \"deploy\",\n      \"output\": {\n        \"type\": \"ErrorResponse\",\n        \"message\": \"Max fee is smaller than the minimal transaction cost\"\n      },\n      \"status\": \"Fail\",\n      \"timestamp\": 1706093160,\n      \"misc\": null\n    }\n  }]\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/files/state_wrong_version.json",
    "content": "{\n  \"version\": 0,\n  \"transactions\": null\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/keystore/my_account.json",
    "content": "{\n    \"version\": 1,\n    \"variant\": {\n        \"type\": \"open_zeppelin\",\n        \"version\": 1,\n        \"public_key\": \"0xe2d3d7080bfc665e0060a06e8e95c3db3ff78a1fec4cc81ddc87e49a12e0a\",\n        \"legacy\": true\n    },\n    \"deployment\": {\n        \"status\": \"deployed\",\n        \"class_hash\": \"0x4d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f\",\n        \"address\": \"0xcce3217e4aea0ab738b55446b1b378750edfca617db549fda1ede28435206c\"\n    }\n}"
  },
  {
    "path": "crates/sncast/tests/data/keystore/my_account_braavos_invalid_multisig.json",
    "content": "{\n  \"version\": 1,\n  \"variant\": {\n    \"type\": \"braavos\",\n    \"version\": 1,\n    \"multisig\": {\n      \"status\": \"on\"\n    },\n    \"signers\": [\n      {\n        \"type\": \"stark\",\n        \"public_key\": \"0xe2d3d7080bfc665e0060a06e8e95c3db3ff78a1fec4cc81ddc87e49a12e0a\"\n      }\n    ]\n  },\n  \"deployment\": {\n    \"status\": \"undeployed\",\n    \"class_hash\": \"0x816dd0297efc55dc1e7559020a3a825e81ef734b558f03c83325d4da7e6253\",\n    \"salt\": \"0x1fe42e5aa816ee55d72471ad50e74a0d2974c9497b86adef561d27c12b4e045\",\n    \"context\": {\n      \"variant\": \"braavos\",\n      \"base_account_class_hash\": \"0x13bfe114fb1cf405bfc3a7f8dbe2d91db146c17521d40dcf57e16d6b59fa8e6\"\n    }\n  }\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/keystore/my_account_braavos_multiple_signers.json",
    "content": "{\n  \"version\": 1,\n  \"variant\": {\n    \"type\": \"braavos\",\n    \"version\": 1,\n    \"multisig\": {\n      \"status\": \"off\"\n    },\n    \"signers\": [\n      {\n        \"type\": \"stark\",\n        \"public_key\": \"0xe2d3d7080bfc665e0060a06e8e95c3db3ff78a1fec4cc81ddc87e49a12e0a\"\n      },\n      {\n        \"type\": \"stark\",\n        \"public_key\": \"0xe2d3d7080bfc665e0060a06e8e95c3db3ff78a1fec4cc81ddc87e49a12e0a\"\n      }\n    ]\n  },\n  \"deployment\": {\n    \"status\": \"undeployed\",\n    \"class_hash\": \"0x816dd0297efc55dc1e7559020a3a825e81ef734b558f03c83325d4da7e6253\",\n    \"salt\": \"0x1fe42e5aa816ee55d72471ad50e74a0d2974c9497b86adef561d27c12b4e045\",\n    \"context\": {\n      \"variant\": \"braavos\",\n      \"base_account_class_hash\": \"0x13bfe114fb1cf405bfc3a7f8dbe2d91db146c17521d40dcf57e16d6b59fa8e6\"\n    }\n  }\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/keystore/my_account_braavos_undeployed_happy_case.json",
    "content": "{\n  \"version\": 1,\n  \"variant\": {\n    \"type\": \"braavos\",\n    \"version\": 1,\n    \"multisig\": {\n      \"status\": \"off\"\n    },\n    \"signers\": [\n      {\n        \"type\": \"stark\",\n        \"public_key\": \"0xe2d3d7080bfc665e0060a06e8e95c3db3ff78a1fec4cc81ddc87e49a12e0a\"\n      }\n    ]\n  },\n  \"deployment\": {\n    \"status\": \"undeployed\",\n    \"class_hash\": \"0x816dd0297efc55dc1e7559020a3a825e81ef734b558f03c83325d4da7e6253\",\n    \"salt\": \"0x1fe42e5aa816ee55d72471ad50e74a0d2974c9497b86adef561d27c12b4e045\",\n    \"context\": {\n      \"variant\": \"braavos\",\n      \"base_account_class_hash\": \"0x13bfe114fb1cf405bfc3a7f8dbe2d91db146c17521d40dcf57e16d6b59fa8e6\"\n    }\n  }\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/keystore/my_account_invalid.json",
    "content": "{\n    \"version\": 1,\n    \"variant\": {\n        \"type\": \"open_zeppelin\",\n        \"version\": 1,\n        \"public_key\": \"0xe2d3d7080bfc665e0060a06e8e95c3db3ff78a1fec4cc81ddc87e49a12e0a\"\n    },\n    \"deployment\": {\n        \"class_hash\": \"0x4d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f\",\n        \"salt\": \"0x14df438ac6825165c7a0af29decd5892528b763a333f93a5f6b12980dbddd9f\"\n    }\n}"
  },
  {
    "path": "crates/sncast/tests/data/keystore/my_account_oz_undeployed_happy_case.json",
    "content": "{\n    \"version\": 1,\n    \"variant\": {\n        \"type\": \"open_zeppelin\",\n        \"version\": 1,\n        \"public_key\": \"0xe2d3d7080bfc665e0060a06e8e95c3db3ff78a1fec4cc81ddc87e49a12e0a\"\n    },\n    \"deployment\": {\n        \"status\": \"undeployed\",\n        \"class_hash\": \"0x4d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f\",\n        \"salt\": \"0x14df438ac6825165c7a0af29decd5892528b763a333f93a5f6b12980dbddd9b\"\n    }\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/keystore/my_account_ready_undeployed_happy_case.json",
    "content": "{\n  \"version\": 1,\n  \"variant\": {\n    \"type\": \"ready\",\n    \"version\": 1,\n    \"owner\": \"0xe2d3d7080bfc665e0060a06e8e95c3db3ff78a1fec4cc81ddc87e49a12e0a\",\n    \"guardian\": \"0x0\"\n  },\n  \"deployment\": {\n    \"status\": \"undeployed\",\n    \"class_hash\": \"0x36078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f\",\n    \"salt\": \"0x1924d8e7415bd440195fefa23a1ce71b106252109bdbc59e51afb9229f136f5\"\n  }\n}\n\n"
  },
  {
    "path": "crates/sncast/tests/data/keystore/my_account_undeployed.json",
    "content": "{\n    \"version\": 1,\n    \"variant\": {\n        \"type\": \"open_zeppelin\",\n        \"version\": 1,\n        \"public_key\": \"0xe2d3d7080bfc665e0060a06e8e95c3db3ff78a1fec4cc81ddc87e49a12e0a\"\n    },\n    \"deployment\": {\n        \"status\": \"undeployed\",\n        \"class_hash\": \"0x4d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f\",\n        \"salt\": \"0x14df438ac6825165c7a0af29decd5892528b763a333f93a5f6b12980dbddd9f\"\n    }\n}"
  },
  {
    "path": "crates/sncast/tests/data/keystore/my_account_undeployed_happy_case_other_args.json",
    "content": "{\n    \"version\": 1,\n    \"variant\": {\n        \"type\": \"open_zeppelin\",\n        \"version\": 1,\n        \"public_key\": \"0xe2d3d7080bfc665e0060a06e8e95c3db3ff78a1fec4cc81ddc87e49a12e0a\"\n    },\n    \"deployment\": {\n        \"status\": \"undeployed\",\n        \"class_hash\": \"0x4d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f\",\n        \"salt\": \"0x14df438ac6825165c7a0af29decd5892528b763a333f93a5f6b12980dbddd9a\"\n    }\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/keystore/my_key.json",
    "content": "{\n    \"crypto\": {\n        \"cipher\": \"aes-128-ctr\",\n        \"cipherparams\": {\n            \"iv\": \"6778ab3640234a4446fbd8e5ef0ed4fd\"\n        },\n        \"ciphertext\": \"6a2b513c8113368f8edb260f1cb6a18963be1a557c43e4a5cb8addca61a9f960\",\n        \"kdf\": \"scrypt\",\n        \"kdfparams\": {\n            \"dklen\": 32,\n            \"n\": 8192,\n            \"p\": 1,\n            \"r\": 8,\n            \"salt\": \"3cabf6912a1af118d279259d0a73a08d2ee2955dc8b13daa144ff367a58581a6\"\n        },\n        \"mac\": \"86de09eddb631f7984b6e327ef486e5bd9e9a5c9e8738feb89350fcecfcfc7cd\"\n    },\n    \"id\": \"093ecb4e-794e-416c-81ac-03a18b098f63\",\n    \"version\": 3\n}"
  },
  {
    "path": "crates/sncast/tests/data/keystore/my_key_invalid.json",
    "content": "{\n    \"crypto\": {\n        \"cipher\": \"aes-128-ctr\",\n        \"cipherparams\": {\n            \"iv\": \"0b32081dd36ebf77706376034b7d43da\"\n        },\n        \"ciphertext\": \"e98a9457cb1db843a5e70efda609d558b108e82e9af17c378a0c4c72564ac9dd\",\n        \"kdf\": \"scrypt\",\n        \"kdfparams\": {\n            \"dklen\": 32,\n            \"n\": 8192,\n            \"p\": 1,\n            \"r\": 8,\n            \"salt\": \"219eb431e32d0514432d666dbc1e6d4861798477480d6ba26f215967726a11f4\"\n        },\n        \"mac\": \"832bc7db3656fde7f5ed69d3d8a68a27f12ef1e85ee2b76896d6f241c6d72ff0\"\n    },\n    \"id\": \"de5a454e-a55a-48e9-a1b7-3da6ddc0c20f\",\n    \"version\": 3\n}"
  },
  {
    "path": "crates/sncast/tests/data/keystore/predeployed_account.json",
    "content": "{\n  \"deployment\": {\n    \"address\": \"0x4ee94bdf625820bc562c49c4d1ca4b2ef82bcfc5ed0cf67464770bea333b19a\",\n    \"class_hash\": \"0x4d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f\",\n    \"status\": \"deployed\"\n  },\n  \"variant\": {\n    \"public_key\": \"0xd39cc3278f855cb025b28409d16137792175638a8acec3b5b3d2487d2472a6\",\n    \"type\": \"open_zeppelin\",\n    \"version\": 1\n  },\n  \"version\": 1\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/keystore/predeployed_key.json",
    "content": "{\n  \"crypto\": {\n    \"cipher\": \"aes-128-ctr\",\n    \"cipherparams\": { \"iv\": \"969dc1d196eccd96518b4945820a7ac0\" },\n    \"ciphertext\": \"fd20c0dfa110976bffa70b54321487c4546d0c26816c8383ffcfa1ba099f73b1\",\n    \"kdf\": \"scrypt\",\n    \"kdfparams\": {\n      \"dklen\": 32,\n      \"n\": 8192,\n      \"p\": 1,\n      \"r\": 8,\n      \"salt\": \"177919634a458573cf15ee537f658cca630d32aaae1a3b7cecf86a427ef01ea9\"\n    },\n    \"mac\": \"adada9c6d157999ba340dc99c6b6596698904026e3f619d025962d1cbcd2a50e\"\n  },\n  \"id\": \"caf9c371-4e46-45c7-b682-a44667a83725\",\n  \"version\": 3\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/multicall_configs/deploy_invalid.toml",
    "content": "[[call]]\ncall_type = \"deploy\"\nclass_hash = \"0x1\"\ninputs = []\nid = \"Map\"\nunique = false\n"
  },
  {
    "path": "crates/sncast/tests/data/multicall_configs/deploy_invoke.toml",
    "content": "[[call]]\ncall_type = \"deploy\"\nclass_hash = \"0x02a09379665a749e609b4a8459c86fe954566a6beeaddd0950e43f6c700ed321\"\ninputs = []\nid = \"map_contract\"\nunique = false\n\n[[call]]\ncall_type = \"invoke\"\ncontract_address = \"0xcd8f9ab31324bb93251837e4efb4223ee195454f6304fcfcb277e277653008\"\nfunction = \"put\"\ninputs = [\"0x123\", \"234\"]\n\n[[call]]\ncall_type = \"invoke\"\ncontract_address = \"@map_contract\"\nfunction = \"put\"\ninputs = [\"0x123\", \"234\"]\n"
  },
  {
    "path": "crates/sncast/tests/data/multicall_configs/deploy_invoke_calldata_ids.toml",
    "content": "[[call]]\ncall_type = \"deploy\"\nclass_hash = \"0x02a09379665a749e609b4a8459c86fe954566a6beeaddd0950e43f6c700ed321\"\ninputs = []\nid = \"map_contract\"\nunique = false\n\n[[call]]\ncall_type = \"invoke\"\ncontract_address = \"0xcd8f9ab31324bb93251837e4efb4223ee195454f6304fcfcb277e277653008\"\nfunction = \"put\"\ninputs = [\"0x123\", \"map_contract\"]\n\n[[call]]\ncall_type = \"deploy\"\nclass_hash = \"0x059426c817fb8103edebdbf1712fa084c6744b2829db9c62d1ea4dce14ee6ded\"\ninputs = [\"map_contract\", \"0x1\", \"0x1\"]\nid = \"constructor-params\"\nunique = false\n"
  },
  {
    "path": "crates/sncast/tests/data/multicall_configs/deploy_invoke_numeric_inputs.toml",
    "content": "[[call]]\ncall_type = \"deploy\"\nclass_hash = \"0x02a09379665a749e609b4a8459c86fe954566a6beeaddd0950e43f6c700ed321\"\ninputs = []\nid = \"map_contract\"\nunique = false\n\n[[call]]\ncall_type = \"invoke\"\ncontract_address = \"0xcd8f9ab31324bb93251837e4efb4223ee195454f6304fcfcb277e277653008\"\nfunction = \"put\"\ninputs = [0x123, 234]\n\n[[call]]\ncall_type = \"invoke\"\ncontract_address = \"@map_contract\"\nfunction = \"put\"\ninputs = [0x123, 9223372036854775807]\n"
  },
  {
    "path": "crates/sncast/tests/data/multicall_configs/deploy_invoke_numeric_overflow.toml",
    "content": "[[call]]\ncall_type = \"deploy\"\nclass_hash = \"0x02a09379665a749e609b4a8459c86fe954566a6beeaddd0950e43f6c700ed321\"\ninputs = []\nid = \"map_contract\"\nunique = false\n\n[[call]]\ncall_type = \"invoke\"\ncontract_address = \"0xcd8f9ab31324bb93251837e4efb4223ee195454f6304fcfcb277e277653008\"\nfunction = \"put\"\ninputs = [0x123, 9223372036854775808]\n"
  },
  {
    "path": "crates/sncast/tests/data/multicall_configs/deploy_succ_invoke_fail.toml",
    "content": "[[call]]\ncall_type = \"deploy\"\nclass_hash = \"0x7644be7f58307726aa836e945edede13e9e08c38eaf2186d4d48eca7dd435ac\"\ninputs = []\nid = \"Map\"\nunique = false\n\n[[call]]\ncall_type = \"invoke\"\ncontract_address = \"0x1\"\nfunction = \"put\"\ninputs = [\"0x123\", \"234\"]\n"
  },
  {
    "path": "crates/sncast/tests/data/multicall_configs/invoke_invalid.toml",
    "content": "[[call]]\ncall_type = \"invoke\"\ncontract_address = \"0x1\"\nfunction = \"put\"\ninputs = [\"123\", \"234\"]\n"
  },
  {
    "path": "crates/sncast/tests/data/multicall_configs/invoke_ledger.toml",
    "content": "[[call]]\ncall_type = \"invoke\"\ncontract_address = \"0xcd8f9ab31324bb93251837e4efb4223ee195454f6304fcfcb277e277653008\"\nfunction = \"put\"\ninputs = [\"0x1\", \"0x2\"]\n\n[[call]]\ncall_type = \"invoke\"\ncontract_address = \"0xcd8f9ab31324bb93251837e4efb4223ee195454f6304fcfcb277e277653008\"\nfunction = \"put\"\ninputs = [\"0x3\", \"0x4\"]\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/call/Scarb.toml",
    "content": "[package]\nname = \"call_test_scripts\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \">=2.3.0\"\nsncast_std = { path = \"../../../../../../sncast_std\" }\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/call/src/invalid_address.cairo",
    "content": "use sncast_std::{ProviderError, ScriptCommandError, StarknetError, call};\n\nfn main() {\n    let eth = 0x049;\n    let call_err: ScriptCommandError = call(\n        eth.try_into().expect('bad address'), selector!(\"decimals\"), array![],\n    )\n        .unwrap_err();\n\n    println!(\"{:?}\", call_err);\n\n    assert(\n        ScriptCommandError::ProviderError(\n            ProviderError::StarknetError(StarknetError::ContractNotFound),\n        ) == call_err,\n        'ohno',\n    )\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/call/src/invalid_calldata.cairo",
    "content": "use sncast_std::{ScriptCommandError, call};\n\nfn main() {\n    let eth = 0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7;\n    let call_err: ScriptCommandError = call(\n        eth.try_into().expect('bad address'),\n        selector!(\"allowance\"),\n        array![0x12, 0x12, 0x12, 0x12, 0x12],\n    )\n        .unwrap_err();\n\n    println!(\"{:?}\", call_err);\n\n    let call_err: ScriptCommandError = call(\n        eth.try_into().expect('bad address'), selector!(\"allowance\"), array![0x12],\n    )\n        .unwrap_err();\n\n    println!(\"{:?}\", call_err);\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/call/src/invalid_entry_point.cairo",
    "content": "use sncast_std::{ScriptCommandError, call};\n\nfn main() {\n    let eth = 0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7;\n    let call_err: ScriptCommandError = call(\n        eth.try_into().expect('bad address'), selector!(\"gimme_money\"), array![],\n    )\n        .unwrap_err();\n\n    println!(\"{:?}\", call_err);\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/call/src/lib.cairo",
    "content": "mod invalid_address;\nmod invalid_calldata;\nmod invalid_entry_point;\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/declare/Scarb.toml",
    "content": "[package]\nname = \"declare_test_scripts\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \">=2.3.0\"\nsncast_std = { path = \"../../../../../../sncast_std\" }\nmap1 = { path = \"../map_script/contracts\" }\n\n[lib]\nsierra = true\n\n[[target.starknet-contract]]\nbuild-external-contracts = [\"map1::Mapa\"]\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/declare/src/fee_settings.cairo",
    "content": "use sncast_std::{FeeSettingsTrait, declare, get_nonce};\n\nfn main() {\n    let fee_settings = FeeSettingsTrait::resource_bounds(\n        100000, 10000000000000, 1000000000, 100000000000000000000, 100000, 10000000000000,\n    );\n    let declare_nonce = get_nonce('latest');\n    declare(\"Mapa\", fee_settings, Option::Some(declare_nonce)).expect('declare failed');\n    println!(\"success\");\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/declare/src/insufficient_account_balance.cairo",
    "content": "use sncast_std::{\n    FeeSettingsTrait, ProviderError, ScriptCommandError, StarknetError, declare, get_nonce,\n};\n\nfn main() {\n    let fee_settings = FeeSettingsTrait::resource_bounds(\n        9999999999999999999,\n        99999999999999999999999999999999999999,\n        9999999999999999999,\n        99999999999999999999999999999999999999,\n        9999999999999999999,\n        99999999999999999999999999999999999999,\n    );\n    let declare_nonce = get_nonce('latest');\n    let declare_result = declare(\"Mapa\", fee_settings, Option::Some(declare_nonce)).unwrap_err();\n    println!(\"{:?}\", declare_result);\n\n    assert(\n        ScriptCommandError::ProviderError(\n            ProviderError::StarknetError(StarknetError::InsufficientAccountBalance),\n        ) == declare_result,\n        'ohno',\n    )\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/declare/src/lib.cairo",
    "content": "mod fee_settings;\nmod insufficient_account_balance;\nmod no_contract;\nmod same_contract_twice;\nmod time_out;\nmod with_invalid_max_fee;\nmod with_invalid_nonce;\n\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/declare/src/no_contract.cairo",
    "content": "use sncast_std::{FeeSettingsTrait, declare};\n\nfn main() {\n    let fee_settings = FeeSettingsTrait::estimate();\n    let declare_result = declare(\"Mapaaaa\", fee_settings, Option::None).unwrap_err();\n    println!(\"{:?}\", declare_result);\n}\n\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/declare/src/same_contract_twice.cairo",
    "content": "use sncast_std::{DeclareResult, DeclareResultTrait, FeeSettingsTrait, declare, get_nonce};\n\nfn main() {\n    let fee_settings = FeeSettingsTrait::resource_bounds(\n        100000, 10000000000000, 1000000000, 100000000000000000000, 100000, 10000000000000,\n    );\n    let declare_nonce = get_nonce('latest');\n    let first_declare_result = declare(\"Mapa\", fee_settings, Option::Some(declare_nonce))\n        .expect('declare failed');\n    println!(\"success\");\n\n    // Check if contract was declared successfully\n    let class_hash = match first_declare_result {\n        DeclareResult::Success(declare_transaction_result) => declare_transaction_result.class_hash,\n        DeclareResult::AlreadyDeclared(_) => panic!(\"Should not be already declared\"),\n    };\n\n    // Check declare result trait is implemented correctly for Success\n    assert(*first_declare_result.class_hash() == class_hash, 'Class hashes must be equal');\n\n    let declare_nonce = get_nonce('latest');\n    let second_declare_result = declare(\"Mapa\", fee_settings, Option::Some(declare_nonce))\n        .expect('second declare failed');\n\n    // Check if already declared contract was handled correctly\n    match second_declare_result {\n        DeclareResult::Success(_) => panic!(\"Should be already declared\"),\n        DeclareResult::AlreadyDeclared(already_declared_result) => assert!(\n            already_declared_result.class_hash == class_hash,\n        ),\n    }\n\n    // Check declare result trait is implemented correctly for AlreadyDeclared\n    assert(*second_declare_result.class_hash() == class_hash, 'Class hashes must be equal');\n\n    println!(\"{:?}\", first_declare_result);\n    println!(\"{:?}\", second_declare_result);\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/declare/src/time_out.cairo",
    "content": "use sncast_std::{FeeSettingsTrait, declare, get_nonce};\n\nfn main() {\n    let fee_settings = FeeSettingsTrait::resource_bounds(\n        100000, 10000000000000, 1000000000, 100000000000000000000, 100000, 10000000000000,\n    );\n    let declare_nonce = get_nonce('latest');\n    let declare_result = declare(\"Mapa\", fee_settings, Option::Some(declare_nonce)).unwrap_err();\n\n    println!(\"{:?}\", declare_result);\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/declare/src/with_invalid_max_fee.cairo",
    "content": "use sncast_std::{\n    FeeSettingsTrait, ProviderError, ScriptCommandError, StarknetError, declare, get_nonce,\n};\n\nfn main() {\n    let fee_settings = FeeSettingsTrait::resource_bounds(1, 1, 1, 1, 1, 1);\n    let declare_nonce = get_nonce('latest');\n    let declare_result = declare(\"Mapa\", fee_settings, Option::Some(declare_nonce)).unwrap_err();\n    println!(\"{:?}\", declare_result);\n\n    assert(\n        ScriptCommandError::ProviderError(\n            ProviderError::StarknetError(StarknetError::InsufficientResourcesForValidate),\n        ) == declare_result,\n        'ohno',\n    )\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/declare/src/with_invalid_nonce.cairo",
    "content": "use sncast_std::{\n    FeeSettingsTrait, ProviderError, ScriptCommandError, StarknetError, declare, get_nonce,\n};\n\nfn main() {\n    let fee_settings = FeeSettingsTrait::resource_bounds(\n        100000, 10000000000000, 1000000000, 100000000000000000000, 100000, 10000000000000,\n    );\n    let declare_nonce = get_nonce('pre_confirmed') + 100;\n    let declare_result = declare(\"Mapa\", fee_settings, Option::Some(declare_nonce)).unwrap_err();\n    println!(\"{:?}\", declare_result);\n\n    assert(\n        ScriptCommandError::ProviderError(\n            ProviderError::StarknetError(StarknetError::InvalidTransactionNonce),\n        ) == declare_result,\n        'ohno',\n    )\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/deploy/Scarb.toml",
    "content": "[package]\nname = \"deploy_test_scripts\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \">=2.4.0\"\nsncast_std = { path = \"../../../../../../sncast_std\" }\n\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/deploy/src/fee_settings.cairo",
    "content": "use sncast_std::{FeeSettingsTrait, deploy};\nuse starknet::ClassHash;\n\nfn main() {\n    let fee_settings = FeeSettingsTrait::resource_bounds(\n        100000, 10000000000000, 1000000000, 100000000000000000000, 100000, 10000000000000,\n    );\n    let salt = 0x3;\n    let class_hash: ClassHash = 0x059426c817fb8103edebdbf1712fa084c6744b2829db9c62d1ea4dce14ee6ded\n        .try_into()\n        .expect('Invalid class hash value');\n\n    let deploy_result = deploy(\n        class_hash, array![0x2, 0x2, 0x0], Option::Some(salt), true, fee_settings, Option::None,\n    )\n        .expect('deploy failed');\n\n    assert(deploy_result.transaction_hash != 0, deploy_result.transaction_hash);\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/deploy/src/invalid_calldata.cairo",
    "content": "use sncast_std::{FeeSettingsTrait, deploy, get_nonce};\nuse starknet::ClassHash;\n\nfn main() {\n    let fee_settings = FeeSettingsTrait::resource_bounds(\n        100000, 10000000000000, 1000000000, 100000000000000000000, 100000, 10000000000000,\n    );\n    let salt = 0x3;\n\n    let class_hash: ClassHash = 0x059426c817fb8103edebdbf1712fa084c6744b2829db9c62d1ea4dce14ee6ded\n        .try_into()\n        .expect('Invalid class hash value');\n\n    let deploy_nonce = get_nonce('pre_confirmed');\n    let deploy_result = deploy(\n        class_hash, array![0x2], Option::Some(salt), true, fee_settings, Option::Some(deploy_nonce),\n    )\n        .unwrap_err();\n\n    println!(\"{:?}\", deploy_result);\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/deploy/src/invalid_class_hash.cairo",
    "content": "use sncast_std::{FeeSettingsTrait, deploy, get_nonce};\nuse starknet::ClassHash;\n\nfn main() {\n    let fee_settings = FeeSettingsTrait::resource_bounds(\n        100000, 10000000000000, 1000000000, 100000000000000000000, 100000, 10000000000000,\n    );\n    let salt = 0x3;\n\n    let class_hash: ClassHash = 0xdddd.try_into().expect('Invalid class hash value');\n\n    let deploy_nonce = get_nonce('pre_confirmed');\n    let deploy_result = deploy(\n        class_hash,\n        array![0x2, 0x2, 0x0],\n        Option::Some(salt),\n        true,\n        fee_settings,\n        Option::Some(deploy_nonce),\n    )\n        .unwrap_err();\n\n    println!(\"{:?}\", deploy_result);\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/deploy/src/invalid_nonce.cairo",
    "content": "use sncast_std::{\n    FeeSettingsTrait, ProviderError, ScriptCommandError, StarknetError, deploy, get_nonce,\n};\nuse starknet::ClassHash;\n\nfn main() {\n    let fee_settings = FeeSettingsTrait::resource_bounds(\n        100000, 10000000000000, 1000000000, 100000000000000000000, 100000, 10000000000000,\n    );\n    let salt = 0x3;\n\n    let class_hash: ClassHash = 0x059426c817fb8103edebdbf1712fa084c6744b2829db9c62d1ea4dce14ee6ded\n        .try_into()\n        .expect('Invalid class hash value');\n\n    let deploy_nonce = get_nonce('pre_confirmed') + 100;\n    let deploy_result = deploy(\n        class_hash,\n        array![0x2, 0x2, 0x0],\n        Option::Some(salt),\n        true,\n        fee_settings,\n        Option::Some(deploy_nonce),\n    )\n        .unwrap_err();\n\n    println!(\"{:?}\", deploy_result);\n\n    assert(\n        ScriptCommandError::ProviderError(\n            ProviderError::StarknetError(StarknetError::InvalidTransactionNonce),\n        ) == deploy_result,\n        'ohno',\n    )\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/deploy/src/lib.cairo",
    "content": "mod fee_settings;\nmod invalid_calldata;\nmod invalid_class_hash;\nmod invalid_nonce;\nmod same_class_hash_and_salt;\nmod with_calldata;\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/deploy/src/same_class_hash_and_salt.cairo",
    "content": "use sncast_std::{FeeSettingsTrait, deploy, get_nonce};\nuse starknet::ClassHash;\n\nfn main() {\n    let fee_settings = FeeSettingsTrait::resource_bounds(\n        100000, 10000000000000, 1000000000, 100000000000000000000, 100000, 10000000000000,\n    );\n    let salt = 0x34542;\n\n    let class_hash: ClassHash = 0x059426c817fb8103edebdbf1712fa084c6744b2829db9c62d1ea4dce14ee6ded\n        .try_into()\n        .expect('Invalid class hash value');\n\n    let deploy_nonce = get_nonce('pre_confirmed');\n    deploy(\n        class_hash,\n        array![0x2, 0x2, 0x0],\n        Option::Some(salt),\n        true,\n        fee_settings,\n        Option::Some(deploy_nonce),\n    )\n        .expect('1st deploy failed');\n\n    let class_hash: ClassHash = 0x059426c817fb8103edebdbf1712fa084c6744b2829db9c62d1ea4dce14ee6ded\n        .try_into()\n        .expect('Invalid class hash value');\n\n    let deploy_nonce = get_nonce('pre_confirmed');\n    let deploy_result = deploy(\n        class_hash,\n        array![0x2, 0x2, 0x0],\n        Option::Some(salt),\n        true,\n        fee_settings,\n        Option::Some(deploy_nonce),\n    )\n        .unwrap_err();\n\n    println!(\"{:?}\", deploy_result);\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/deploy/src/with_calldata.cairo",
    "content": "use sncast_std::{FeeSettingsTrait, deploy};\nuse starknet::ClassHash;\n\nfn main() {\n    let fee_settings = FeeSettingsTrait::resource_bounds(\n        100000, 10000000000000, 1000000000, 100000000000000000000, 100000, 10000000000000,\n    );\n    let salt = 0x3;\n    let class_hash: ClassHash = 0x059426c817fb8103edebdbf1712fa084c6744b2829db9c62d1ea4dce14ee6ded\n        .try_into()\n        .expect('Invalid class hash value');\n\n    let deploy_result = deploy(\n        class_hash, array![0x2, 0x2, 0x0], Option::Some(salt), true, fee_settings, Option::None,\n    )\n        .expect('deploy failed');\n\n    assert(deploy_result.transaction_hash != 0, deploy_result.transaction_hash);\n}\n\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/invoke/Scarb.toml",
    "content": "[package]\nname = \"invoke_script\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \">=2.3.0\"\nsncast_std = { path = \"../../../../../../sncast_std\" }\n\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/invoke/src/contract_does_not_exist.cairo",
    "content": "use sncast_std::{\n    FeeSettingsTrait, InvokeResult, ProviderError, ScriptCommandError, StarknetError, invoke,\n};\n\nfn main() {\n    let map_contract_address = 0x123.try_into().expect('Invalid contract address value');\n    let fee_settings = FeeSettingsTrait::resource_bounds(\n        100000, 10000000000000, 1000000000, 100000000000000000000, 100000, 10000000000000,\n    );\n    let invoke_result = invoke(\n        map_contract_address, selector!(\"put\"), array![0x10, 0x1], fee_settings, Option::None,\n    )\n        .unwrap_err();\n    println!(\"{:?}\", invoke_result);\n}\n\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/invoke/src/lib.cairo",
    "content": "mod contract_does_not_exist;\nmod max_fee_too_low;\nmod wrong_calldata;\nmod wrong_function_name;\n\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/invoke/src/max_fee_too_low.cairo",
    "content": "use sncast_std::{\n    FeeSettingsTrait, InvokeResult, ProviderError, ScriptCommandError, StarknetError, invoke,\n};\n\nfn main() {\n    let map_contract_address = 0x07537a17e169c96cf2b0392508b3a66cbc50c9a811a8a7896529004c5e93fdf6\n        .try_into()\n        .expect('Invalid contract address value');\n    let fee_settings = FeeSettingsTrait::resource_bounds(1, 1, 1, 1, 1, 1);\n\n    let invoke_result = invoke(\n        map_contract_address, selector!(\"put\"), array![0x10, 0x1], fee_settings, Option::None,\n    )\n        .unwrap_err();\n    println!(\"{:?}\", invoke_result);\n}\n\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/invoke/src/wrong_calldata.cairo",
    "content": "use sncast_std::{\n    FeeSettingsTrait, InvokeResult, ProviderError, ScriptCommandError, StarknetError, invoke,\n};\n\nfn main() {\n    let map_contract_address = 0xcd8f9ab31324bb93251837e4efb4223ee195454f6304fcfcb277e277653008\n        .try_into()\n        .expect('Invalid contract address value');\n    let fee_settings = FeeSettingsTrait::estimate();\n\n    let invoke_result = invoke(\n        map_contract_address, selector!(\"put\"), array![0x10], fee_settings, Option::None,\n    )\n        .unwrap_err();\n    println!(\"{:?}\", invoke_result);\n}\n\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/invoke/src/wrong_function_name.cairo",
    "content": "use sncast_std::{\n    FeeSettingsTrait, InvokeResult, ProviderError, ScriptCommandError, StarknetError, invoke,\n};\n\nfn main() {\n    let map_contract_address = 0xcd8f9ab31324bb93251837e4efb4223ee195454f6304fcfcb277e277653008\n        .try_into()\n        .expect('Invalid contract address value');\n    let fee_settings = FeeSettingsTrait::estimate();\n\n    let invoke_result = invoke(\n        map_contract_address, selector!(\"mariusz\"), array![0x10, 0x1], fee_settings, Option::None,\n    )\n        .unwrap_err();\n    println!(\"{:?}\", invoke_result);\n}\n\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/map_script/contracts/Scarb.toml",
    "content": "[package]\nname = \"map1\"\nversion = \"0.2.0\"\nedition = \"2023_11\"\n\n[dependencies]\nstarknet = \">=2.4.0\"\n\n[[target.starknet-contract]]\n\n[lib]\nsierra = false\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/map_script/contracts/src/lib.cairo",
    "content": "#[starknet::interface]\ntrait IMap<TMapState> {\n    fn put(ref self: TMapState, key: felt252, value: felt252);\n    fn get(self: @TMapState, key: felt252) -> felt252;\n    fn dummy(self: @TMapState) -> felt252;\n}\n\n\n#[starknet::contract]\nmod Mapa {\n    use starknet::storage::{Map, StorageMapReadAccess, StoragePathEntry, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        storage: Map<felt252, felt252>,\n    }\n\n    #[abi(embed_v0)]\n    impl MapaImpl of super::IMap<ContractState> {\n        fn put(ref self: ContractState, key: felt252, value: felt252) {\n            self.storage.entry(key).write(value);\n        }\n\n        fn get(self: @ContractState, key: felt252) -> felt252 {\n            self.storage.read(key)\n        }\n\n        fn dummy(self: @ContractState) -> felt252 {\n            1\n        }\n    }\n}\n\n#[starknet::contract]\nmod Mapa2 {\n    use starknet::storage::{Map, StorageMapReadAccess, StoragePathEntry, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        storage: Map<felt252, felt252>,\n    }\n\n    #[abi(embed_v0)]\n    impl Mapa2Impl of super::IMap<ContractState> {\n        fn put(ref self: ContractState, key: felt252, value: felt252) {\n            self.storage.entry(key).write(value);\n        }\n\n        fn get(self: @ContractState, key: felt252) -> felt252 {\n            self.storage.read(key)\n        }\n\n        fn dummy(self: @ContractState) -> felt252 {\n            1\n        }\n    }\n}\n\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/map_script/scripts/Scarb.toml",
    "content": "[package]\nname = \"map_script\"\nversion = \"0.1.0\"\nedition = \"2023_11\"\n\n[dependencies]\nstarknet = \">=2.3.0\"\nsncast_std = { path = \"../../../../../../../sncast_std\" }\nmap1 = { path = \"../contracts\" }\n\n[lib]\nsierra = true\n\n[[target.starknet-contract]]\nbuild-external-contracts = [\"map1::Mapa\", \"map1::Mapa2\"]\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/map_script/scripts/src/display_debug_traits_for_subcommand_responses.cairo",
    "content": "use sncast_std::{DeclareResultTrait, FeeSettingsTrait, call, declare, deploy, get_nonce, invoke};\n\nfn main() {\n    println!(\"test\");\n    let salt = 0x3;\n\n    let declare_nonce = get_nonce('latest');\n    println!(\"declare_nonce: {}\", declare_nonce);\n    println!(\"debug declare_nonce: {:?}\", declare_nonce);\n\n    let fee_settings = FeeSettingsTrait::resource_bounds(\n        100000, 10000000000000, 1000000000, 100000000000000000000, 100000, 10000000000000,\n    );\n\n    let declare_result = declare(\"Mapa\", fee_settings, Option::Some(declare_nonce))\n        .expect('declare failed');\n    println!(\"declare_result: {}\", declare_result);\n    println!(\"debug declare_result: {:?}\", declare_result);\n\n    let class_hash = declare_result.class_hash();\n    let deploy_nonce = get_nonce('pre_confirmed');\n    let deploy_result = deploy(\n        *class_hash,\n        ArrayTrait::new(),\n        Option::Some(salt),\n        true,\n        fee_settings,\n        Option::Some(deploy_nonce),\n    )\n        .expect('deploy failed');\n    println!(\"deploy_result: {}\", deploy_result);\n    println!(\"debug deploy_result: {:?}\", deploy_result);\n\n    assert(deploy_result.transaction_hash != 0, deploy_result.transaction_hash);\n\n    let invoke_nonce = get_nonce('pre_confirmed');\n    let invoke_result = invoke(\n        deploy_result.contract_address,\n        selector!(\"put\"),\n        array![0x1, 0x2],\n        fee_settings,\n        Option::Some(invoke_nonce),\n    )\n        .expect('invoke failed');\n    println!(\"invoke_result: {}\", invoke_result);\n    println!(\"debug invoke_result: {:?}\", invoke_result);\n\n    assert(invoke_result.transaction_hash != 0, invoke_result.transaction_hash);\n\n    let call_result = call(deploy_result.contract_address, selector!(\"get\"), array![0x1])\n        .expect('call failed');\n    println!(\"call_result: {}\", call_result);\n    println!(\"debug call_result: {:?}\", call_result);\n\n    assert(call_result.data == array![0x2], *call_result.data.at(0));\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/map_script/scripts/src/lib.cairo",
    "content": "mod display_debug_traits_for_subcommand_responses;\nmod map_script;\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/map_script/scripts/src/map_script.cairo",
    "content": "use sncast_std::{DeclareResultTrait, FeeSettingsTrait, call, declare, deploy, get_nonce, invoke};\n\nfn second_contract() {\n    let fee_settings = FeeSettingsTrait::resource_bounds(\n        100000, 10000000000000, 1000000000, 100000000000000000000, 100000, 10000000000000,\n    );\n\n    let declare_result = declare(\"Mapa2\", fee_settings, Option::None)\n        .expect('mapa2 declare failed');\n\n    let deploy_result = deploy(\n        *declare_result.class_hash(),\n        ArrayTrait::new(),\n        Option::None,\n        false,\n        fee_settings,\n        Option::None,\n    )\n        .expect('mapa deploy failed');\n    assert(deploy_result.transaction_hash != 0, deploy_result.transaction_hash);\n\n    let invoke_result = invoke(\n        deploy_result.contract_address,\n        selector!(\"put\"),\n        array![0x1, 0x3],\n        fee_settings,\n        Option::None,\n    )\n        .expect('mapa2 invoke failed');\n    assert(invoke_result.transaction_hash != 0, invoke_result.transaction_hash);\n\n    let call_result = call(deploy_result.contract_address, selector!(\"get\"), array![0x1])\n        .expect('mapa2 call failed');\n    assert(call_result.data == array![0x3], *call_result.data.at(0));\n}\n\nfn main() {\n    let fee_settings = FeeSettingsTrait::resource_bounds(\n        100000, 10000000000000, 1000000000, 100000000000000000000, 100000, 10000000000000,\n    );\n    let salt = 0x3;\n\n    let declare_nonce = get_nonce('latest');\n    let declare_result = declare(\"Mapa\", fee_settings, Option::Some(declare_nonce))\n        .expect('mapa declare failed');\n\n    let class_hash = declare_result.class_hash();\n    let deploy_nonce = get_nonce('pre_confirmed');\n    let deploy_result = deploy(\n        *class_hash,\n        ArrayTrait::new(),\n        Option::Some(salt),\n        true,\n        fee_settings,\n        Option::Some(deploy_nonce),\n    )\n        .expect('mapa deploy failed');\n    assert(deploy_result.transaction_hash != 0, deploy_result.transaction_hash);\n\n    let invoke_nonce = get_nonce('pre_confirmed');\n    let invoke_result = invoke(\n        deploy_result.contract_address,\n        selector!(\"put\"),\n        array![0x1, 0x2],\n        fee_settings,\n        Option::Some(invoke_nonce),\n    )\n        .expect('mapa invoke failed');\n    assert(invoke_result.transaction_hash != 0, invoke_result.transaction_hash);\n\n    let call_result = call(deploy_result.contract_address, selector!(\"get\"), array![0x1])\n        .expect('mapa call failed');\n    assert(call_result.data == array![0x2], *call_result.data.at(0));\n\n    second_contract();\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/misc/Scarb.toml",
    "content": "[package]\nname = \"misc_script\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \">=2.3.0\"\nsncast_std = { path = \"../../../../../../sncast_std\" }\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/misc/src/call_fail.cairo",
    "content": "use sncast_std::call;\n\nfn main() {\n    let strk = 0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d;\n    let call_result = call(strk.try_into().unwrap(), selector!(\"gimme_money\"), array![]);\n    call_result.expect('call failed');\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/misc/src/call_happy.cairo",
    "content": "use sncast_std::call;\n\nfn main() {\n    let eth = 0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7;\n    let addr = 0x0089496091c660345BaA480dF76c1A900e57cf34759A899eFd1EADb362b20DB5;\n    let call_result = call(eth.try_into().unwrap(), selector!(\"allowance\"), array![addr, addr])\n        .unwrap();\n    let call_result = *call_result.data[0];\n    assert(call_result == 0, call_result);\n\n    let call_result = call(eth.try_into().unwrap(), selector!(\"decimals\"), array![]).unwrap();\n    let call_result = *call_result.data[0];\n    assert(call_result == 18, call_result);\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/misc/src/lib.cairo",
    "content": "mod call_fail;\nmod call_happy;\nmod using_starknet_syscall;\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/misc/src/using_starknet_syscall.cairo",
    "content": "use core::box::BoxTrait;\nuse starknet::get_execution_info;\n\nfn main() {\n    let exec_info = get_execution_info().unbox();\n    assert(1 == 2, 'unreachable');\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/missing_field/Scarb.toml",
    "content": "[package]\nname = \"missing_field_script\"\nversion = \"0.1.0\"\nedition = \"2023_11\"\n\n[dependencies]\nstarknet = \">=2.3.0\"\nsncast_std = { path = \"../../../../../../sncast_std\" }\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/missing_field/src/lib.cairo",
    "content": "mod missing_field;\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/missing_field/src/missing_field.cairo",
    "content": "use sncast_std::declare;\n\nfn main() {\n    let declare_result = declare(\"Mapa\", max_fee: Option::None);\n}\n\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/old_sncast_std/scripts/Scarb.toml",
    "content": "[package]\nname = \"old_sncast_std\"\nversion = \"0.1.0\"\nedition = \"2023_11\"\n\n[dependencies]\nstarknet = \">=2.3.0\"\nsncast_std = { git = \"https://github.com/foundry-rs/starknet-foundry.git\", tag = \"v0.13.1\" }\n\n[lib]\nsierra = true\n\n[[target.starknet-contract]]\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/old_sncast_std/scripts/src/lib.cairo",
    "content": "mod map_script;\n\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/old_sncast_std/scripts/src/map_script.cairo",
    "content": "fn main() {}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/packages/Scarb.toml",
    "content": "[workspace]\nmembers = [\n    \"crates/scripts/*\",\n]\n\n[workspace.package]\nversion = \"0.1.0\"\n\n[workspace.dependencies]\nstarknet = \"2.4.0\"\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/packages/crates/scripts/script1/Scarb.toml",
    "content": "[package]\nname = \"script1\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \">=2.3.0\"\nsncast_std = { path = \"../../../../../../../../../sncast_std\" }\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/packages/crates/scripts/script1/src/lib.cairo",
    "content": "use sncast_std::get_nonce;\n\nfn main() {\n    get_nonce('latest');\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/packages/crates/scripts/script2/Scarb.toml",
    "content": "[package]\nname = \"script2\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \">=2.3.0\"\nsncast_std = { path = \"../../../../../../../../../sncast_std\" }\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/packages/crates/scripts/script2/src/lib.cairo",
    "content": "use sncast_std::declare;\n\nfn main() {\n    declare(\"whatever\", Option::None, Option::None);\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/state_file/Scarb.toml",
    "content": "[package]\nname = \"state_file_test_script\"\nversion = \"0.1.0\"\nedition = \"2023_11\"\n\n[dependencies]\nstarknet = \">=2.3.0\"\nsncast_std = { path = \"../../../../../../sncast_std\" }\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/state_file/rerun_failed_tx_alpha-sepolia_state.json",
    "content": "{\n  \"version\": 1,\n  \"transactions\": {\n    \"transactions\": {\n      \"31829eae07da513c7e6f457b9ac48af0004512db23efeae38734af97834bb273\": {\n        \"name\": \"invoke\",\n        \"output\": {\n          \"type\": \"ErrorResponse\",\n          \"message\": \"An error occurred in the called contract = ContractErrorData { revert_error: \\\"Error in the called contract (0x00f6ecd22832b7c3713cfa7826ee309ce96a2769833f093795fafa1b8f20c48b):\\\\nError at pc=0:4835:\\\\nGot an exception while executing a hint: Requested contract address ContractAddress(PatriciaKey(StarkFelt(\\\\\\\"0x00cd8f9ab31324bb93251837e4efb4223ee195454f6304fcfcb277e277653008\\\\\\\"))) is not deployed.\\\\nCairo traceback (most recent call last):\\\\nUnknown location (pc=0:67)\\\\nUnknown location (pc=0:1835)\\\\nUnknown location (pc=0:2554)\\\\nUnknown location (pc=0:3436)\\\\nUnknown location (pc=0:4040)\\\\n\\\" }\"\n        },\n        \"status\": \"Error\",\n        \"timestamp\": 1712758668,\n        \"misc\": null\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/state_file/src/all_tx_fail.cairo",
    "content": "use sncast_std::{FeeSettingsTrait, declare, deploy, get_nonce, invoke};\nuse starknet::{ClassHash, ContractAddress};\n\nfn main() {\n    let fee_settings = FeeSettingsTrait::resource_bounds(\n        100000, 10000000000000, 1000000000, 100000000000000000000, 100000, 10000000000000,\n    );\n    let salt = 0x3;\n\n    let nonexistent_class_hash: ClassHash = 0x10101.try_into().expect('Invalid class hash value');\n\n    let map_contract_address: ContractAddress = 0x2020202\n        .try_into()\n        .expect('Invalid contract address value');\n\n    let declare_nonce = get_nonce('latest');\n    declare(\"Not_this_time\", fee_settings, Option::Some(declare_nonce))\n        .expect_err('error expected declare');\n\n    let deploy_nonce = get_nonce('pre_confirmed');\n    deploy(\n        nonexistent_class_hash,\n        ArrayTrait::new(),\n        Option::Some(salt),\n        true,\n        fee_settings,\n        Option::Some(deploy_nonce),\n    )\n        .expect_err('error expected deploy');\n\n    let invoke_nonce = get_nonce('pre_confirmed');\n    invoke(\n        map_contract_address,\n        selector!(\"put\"),\n        array![0x1, 0x2],\n        fee_settings,\n        Option::Some(invoke_nonce),\n    )\n        .expect_err('error expected invoke');\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/state_file/src/lib.cairo",
    "content": "mod all_tx_fail;\nmod rerun_failed_tx;\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/state_file/src/rerun_failed_tx.cairo",
    "content": "use sncast_std::{FeeSettingsTrait, invoke};\n\nfn main() {\n    let fee_settings = FeeSettingsTrait::resource_bounds(\n        100000, 10000000000000, 1000000000, 100000000000000000000, 100000, 10000000000000,\n    );\n    let map_contract_address = 0xcd8f9ab31324bb93251837e4efb4223ee195454f6304fcfcb277e277653008\n        .try_into()\n        .expect('Invalid contract address value');\n\n    invoke(map_contract_address, selector!(\"put\"), array![0x10, 0x1], fee_settings, Option::None)\n        .unwrap();\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/state_script/contracts/Scarb.toml",
    "content": "[package]\nname = \"state\"\nversion = \"0.2.0\"\nedition = \"2023_11\"\n\n[dependencies]\nstarknet = \">=2.4.0\"\n\n[[target.starknet-contract]]\n\n[lib]\nsierra = false\n\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/state_script/contracts/src/lib.cairo",
    "content": "#[starknet::interface]\ntrait IState<TState> {\n    fn put(ref self: TState, key: felt252, value: felt252);\n    fn get(self: @TState, key: felt252) -> felt252;\n    fn dummy(self: @TState) -> felt252;\n}\n\n\n#[starknet::contract]\nmod State {\n    use starknet::storage::{Map, StorageMapReadAccess, StoragePathEntry, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        storage: Map<felt252, felt252>,\n    }\n\n    #[abi(embed_v0)]\n    impl State of super::IState<ContractState> {\n        fn put(ref self: ContractState, key: felt252, value: felt252) {\n            self.storage.entry(key).write(value);\n        }\n\n        fn get(self: @ContractState, key: felt252) -> felt252 {\n            self.storage.read(key)\n        }\n\n        fn dummy(self: @ContractState) -> felt252 {\n            1\n        }\n    }\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/state_script/scripts/Scarb.toml",
    "content": "[package]\nname = \"state_script\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \">=2.4.0\"\nsncast_std = { path = \"../../../../../../../sncast_std\" }\nstate = { path = \"../contracts\" }\n\n[lib]\nsierra = true\n\n[[target.starknet-contract]]\nbuild-external-contracts = [\n    \"state::State\"\n]\n\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/state_script/scripts/src/lib.cairo",
    "content": "mod state_script;\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/state_script/scripts/src/state_script.cairo",
    "content": "use sncast_std::{DeclareResultTrait, FeeSettingsTrait, call, declare, deploy, get_nonce, invoke};\n\nfn main() {\n    let fee_settings = FeeSettingsTrait::resource_bounds(\n        100000, 10000000000000, 1000000000, 100000000000000000000, 100000, 10000000000000,\n    );\n    let salt = 0x5;\n\n    let declare_nonce = get_nonce('latest');\n    let declare_result = declare(\"State\", fee_settings, Option::Some(declare_nonce))\n        .expect('state declare failed');\n\n    let class_hash = declare_result.class_hash();\n    let deploy_nonce = get_nonce('pre_confirmed');\n    let deploy_result = deploy(\n        *class_hash,\n        ArrayTrait::new(),\n        Option::Some(salt),\n        true,\n        fee_settings,\n        Option::Some(deploy_nonce),\n    )\n        .expect('state deploy failed');\n    assert(deploy_result.transaction_hash != 0, deploy_result.transaction_hash);\n\n    let invoke_nonce = get_nonce('pre_confirmed');\n    let invoke_result = invoke(\n        deploy_result.contract_address,\n        selector!(\"put\"),\n        array![0x1, 0x2],\n        fee_settings,\n        Option::Some(invoke_nonce),\n    )\n        .expect('state invoke failed');\n    assert(invoke_result.transaction_hash != 0, invoke_result.transaction_hash);\n\n    let call_result = call(deploy_result.contract_address, selector!(\"get\"), array![0x1])\n        .expect('state call failed');\n    assert(call_result.data == array![0x2], *call_result.data.at(0));\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/tx_status/Scarb.toml",
    "content": "[package]\nname = \"tx_status_test_scripts\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \">=2.4.0\"\nsncast_std = { path = \"../../../../../../sncast_std\" }\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/tx_status/src/incorrect_transaction_hash.cairo",
    "content": "use sncast_std::{ProviderError, ScriptCommandError, StarknetError, tx_status};\n\nfn main() {\n    let incorrect_tx_hash = 0x1;\n    let status = tx_status(incorrect_tx_hash).unwrap_err();\n    println!(\"{:?}\", status);\n\n    assert!(\n        ScriptCommandError::ProviderError(\n            ProviderError::StarknetError(StarknetError::TransactionHashNotFound(())),\n        ) == status,\n    )\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/tx_status/src/lib.cairo",
    "content": "mod incorrect_transaction_hash;\nmod status_reverted;\nmod status_succeeded;\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/tx_status/src/status_reverted.cairo",
    "content": "use sncast_std::{ExecutionStatus, FinalityStatus, TxStatusResult, tx_status};\n\nfn main() {\n    let reverted_tx_hash = 0x00ae35dacba17cde62b8ceb12e3b18f4ab6e103fa2d5e3d9821cb9dc59d59a3c;\n    let status = tx_status(reverted_tx_hash).unwrap();\n\n    println!(\"{}\", status);\n    println!(\"{:?}\", status);\n\n    assert!(\n        TxStatusResult {\n            finality_status: FinalityStatus::AcceptedOnL1,\n            execution_status: Option::Some(ExecutionStatus::Reverted),\n        } == status,\n    )\n}\n"
  },
  {
    "path": "crates/sncast/tests/data/scripts/tx_status/src/status_succeeded.cairo",
    "content": "use sncast_std::{ExecutionStatus, FinalityStatus, TxStatusResult, tx_status};\n\nfn main() {\n    let succeeded_tx_hash = 0x07d2067cd7675f88493a9d773b456c8d941457ecc2f6201d2fe6b0607daadfd1;\n    let status = tx_status(succeeded_tx_hash).unwrap();\n\n    println!(\"{}\", status);\n    println!(\"{:?}\", status);\n\n    assert!(\n        TxStatusResult {\n            finality_status: FinalityStatus::AcceptedOnL1,\n            execution_status: Option::Some(ExecutionStatus::Succeeded),\n        } == status,\n    )\n}\n"
  },
  {
    "path": "crates/sncast/tests/docs_snippets/ledger.rs",
    "content": "use crate::e2e::ledger::{automation, setup_speculos};\nuse crate::helpers::constants::URL;\nuse crate::helpers::runner::runner;\nuse docs::snippet::SnippetType;\nuse docs::utils::{\n    get_nth_ancestor, print_ignored_snippet_message, print_snippets_validation_summary,\n};\nuse docs::validation::{extract_snippets_from_directory, extract_snippets_from_file};\nuse shared::test_utils::output_assert::assert_stdout_contains;\nuse std::sync::Arc;\nuse tempfile::TempDir;\n\nconst DOCS_SNIPPETS_PORT_BASE: u16 = 4006;\n\nasync fn setup_speculos_automation(client: &Arc<speculos_client::SpeculosClient>, args: &[&str]) {\n    if args.contains(&\"get-public-key\") && !args.contains(&\"--no-display\") {\n        client\n            .automation(&[automation::APPROVE_PUBLIC_KEY])\n            .await\n            .unwrap();\n    } else if args.contains(&\"sign-hash\") {\n        client\n            .automation(&[\n                automation::ENABLE_BLIND_SIGN,\n                automation::APPROVE_BLIND_SIGN_HASH,\n            ])\n            .await\n            .unwrap();\n    }\n}\n\n#[tokio::test]\n#[ignore = \"requires Speculos installation\"]\nasync fn test_ledger_docs_snippets() {\n    let root_dir_path = get_nth_ancestor(2);\n    let ledger_appendix_dir = root_dir_path.join(\"docs/src/appendix/sncast/ledger\");\n    let ledger_guide_path = root_dir_path.join(\"docs/src/starknet/ledger.md\");\n\n    let snippet_type = SnippetType::sncast();\n\n    let appendix_snippets = extract_snippets_from_directory(&ledger_appendix_dir, &snippet_type)\n        .expect(\"Failed to extract ledger appendix snippets\");\n    let guide_snippets = extract_snippets_from_file(&ledger_guide_path, &snippet_type)\n        .expect(\"Failed to extract ledger guide snippets\");\n\n    let snippets: Vec<_> = appendix_snippets\n        .into_iter()\n        .chain(guide_snippets)\n        .collect();\n\n    let tempdir = TempDir::new().expect(\"Unable to create a temporary directory\");\n    std::fs::write(tempdir.path().join(\"accounts.json\"), \"{}\").unwrap();\n\n    let target_accounts_json_path = tempdir.path().join(\"accounts.json\");\n\n    // sign-hash snippets need a fresh Speculos instance each time: ENABLE_BLIND_SIGN fires\n    // All other snippets share one instance to keep the total startup count low.\n    let (shared_client, shared_url) = setup_speculos(DOCS_SNIPPETS_PORT_BASE);\n    let mut sign_hash_port_offset = 1;\n\n    for snippet in &snippets {\n        if snippet.config.ignored {\n            print_ignored_snippet_message(snippet);\n            continue;\n        }\n\n        if !snippet.config.requires_ledger {\n            continue;\n        }\n\n        let args = snippet.to_command_args();\n        let mut args: Vec<&str> = args.iter().map(String::as_str).collect();\n\n        // remove \"sncast\" from the args\n        args.remove(0);\n\n        args.insert(0, \"--accounts-file\");\n        args.insert(1, target_accounts_json_path.to_str().unwrap());\n\n        if snippet.config.replace_network {\n            let network_pos = args.iter().position(|arg| *arg == \"--network\");\n            if let Some(network_pos) = network_pos {\n                args[network_pos] = \"--url\";\n                args[network_pos + 1] = URL;\n            }\n        }\n\n        let (snippet_client, snippet_url) = if args.contains(&\"sign-hash\") {\n            let port = DOCS_SNIPPETS_PORT_BASE + sign_hash_port_offset;\n            sign_hash_port_offset += 1;\n            setup_speculos(port)\n        } else {\n            (shared_client.clone(), shared_url.clone())\n        };\n\n        setup_speculos_automation(&snippet_client, &args).await;\n\n        let snapbox = runner(&args)\n            .env(\"LEDGER_EMULATOR_URL\", &snippet_url)\n            .current_dir(tempdir.path());\n        let output = snapbox.assert().success();\n        snippet_client.automation(&[]).await.unwrap();\n\n        if let Some(expected_stdout) = &snippet.output\n            && !snippet.config.ignored_output\n        {\n            assert_stdout_contains(output, expected_stdout);\n        }\n    }\n\n    let ledger_snippets: Vec<_> = snippets\n        .into_iter()\n        .filter(|s| s.config.requires_ledger)\n        .collect();\n\n    print_snippets_validation_summary(&ledger_snippets, snippet_type.as_str());\n}\n"
  },
  {
    "path": "crates/sncast/tests/docs_snippets/mod.rs",
    "content": "pub mod ledger;\npub mod validation;\n"
  },
  {
    "path": "crates/sncast/tests/docs_snippets/validation.rs",
    "content": "use std::fs;\n\nuse crate::helpers::constants::URL;\nuse crate::helpers::runner::runner;\nuse camino::Utf8PathBuf;\nuse docs::snippet::{Snippet, SnippetType};\nuse docs::utils::{\n    get_nth_ancestor, print_ignored_snippet_message, print_snippets_validation_summary,\n    update_scarb_toml_dependencies,\n};\nuse docs::validation::{extract_snippets_from_directory, extract_snippets_from_file};\nuse shared::test_utils::output_assert::assert_stdout_contains;\nuse tempfile::TempDir;\n\n#[test]\nfn test_docs_snippets() {\n    let root_dir_path = get_nth_ancestor(2);\n    let docs_dir_path = root_dir_path.join(\"docs/src\");\n    let sncast_readme_path = root_dir_path.join(\"crates/sncast/README.md\");\n\n    let snippet_type = SnippetType::sncast();\n\n    let docs_snippets = extract_snippets_from_directory(&docs_dir_path, &snippet_type)\n        .expect(\"Failed to extract command snippets\");\n\n    let readme_snippets = extract_snippets_from_file(&sncast_readme_path, &snippet_type)\n        .expect(\"Failed to extract command snippets\");\n\n    let snippets = docs_snippets\n        .into_iter()\n        .chain(readme_snippets)\n        .collect::<Vec<Snippet>>();\n\n    let hello_sncast_dir =\n        Utf8PathBuf::from_path_buf(root_dir_path.join(\"docs/listings/hello_sncast\"))\n            .expect(\"Invalid UTF-8 path\");\n\n    let dirs_to_copy = [\n        \"crates/sncast/tests/data/files\",\n        \"docs/listings/hello_sncast\",\n    ];\n\n    let tempdir = TempDir::new().expect(\"Unable to create a temporary directory\");\n\n    let target_path = tempdir.path();\n\n    for dir in &dirs_to_copy {\n        let source_path = root_dir_path.join(dir);\n\n        fs_extra::dir::copy(\n            source_path.as_path(),\n            target_path,\n            &fs_extra::dir::CopyOptions::new()\n                .overwrite(true)\n                .content_only(true),\n        )\n        .expect(\"Failed to copy the directory\");\n    }\n\n    let source_accounts_json_path = hello_sncast_dir.join(\"accounts.json\");\n    let target_accounts_json_path = tempdir.path().join(\"accounts.json\");\n\n    fs::copy(&source_accounts_json_path, &target_accounts_json_path)\n        .expect(\"Failed to copy accounts.json\");\n    update_scarb_toml_dependencies(&tempdir).unwrap();\n\n    for snippet in &snippets {\n        if snippet.config.ignored || snippet.config.requires_ledger {\n            print_ignored_snippet_message(snippet);\n            continue;\n        }\n\n        let args = snippet.to_command_args();\n        let mut args: Vec<&str> = args.iter().map(String::as_str).collect();\n\n        // remove \"sncast\" from the args\n        args.remove(0);\n\n        args.insert(0, \"--accounts-file\");\n        args.insert(1, target_accounts_json_path.to_str().unwrap());\n\n        if snippet.config.replace_network {\n            let network_pos = args.iter().position(|arg| *arg == \"--network\");\n            if let Some(network_pos) = network_pos {\n                args[network_pos] = \"--url\";\n                args[network_pos + 1] = URL;\n            }\n        }\n\n        let snapbox = runner(&args)\n            .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n            .current_dir(tempdir.path());\n        let output = snapbox.assert().success();\n\n        if let Some(expected_stdout) = &snippet.output\n            && !snippet.config.ignored_output\n        {\n            assert_stdout_contains(output, expected_stdout);\n        }\n    }\n\n    print_snippets_validation_summary(&snippets, snippet_type.as_str());\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/account/create.rs",
    "content": "use crate::helpers::constants::{ACCOUNT_FILE_PATH, DEVNET_OZ_CLASS_HASH_CAIRO_0, URL};\nuse crate::helpers::fixtures::copy_file;\nuse crate::helpers::runner::runner;\nuse configuration::test_utils::copy_config_to_tempdir;\nuse indoc::{formatdoc, indoc};\n\nuse crate::helpers::env::set_create_keystore_password_env;\nuse camino::Utf8PathBuf;\nuse conversions::string::IntoHexStr;\nuse serde_json::{json, to_string_pretty};\nuse shared::test_utils::output_assert::{\n    AsOutput, assert_stderr_contains, assert_stdout, assert_stdout_contains,\n};\nuse snapbox::assert_data_eq;\nuse sncast::AccountType;\nuse sncast::helpers::constants::{\n    BRAAVOS_BASE_ACCOUNT_CLASS_HASH, BRAAVOS_CLASS_HASH, OZ_CLASS_HASH, READY_CLASS_HASH,\n};\nuse std::fs;\nuse tempfile::tempdir;\nuse test_case::test_case;\n\n#[test_case(\"oz\"; \"oz_account_type\")]\n#[test_case(\"ready\"; \"ready_account_type\")]\n#[test_case(\"braavos\"; \"braavos_account_type\")]\n#[tokio::test]\npub async fn test_happy_case(account_type: &str) {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"create\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account\",\n        \"--salt\",\n        \"0x1\",\n        \"--type\",\n        account_type,\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(temp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        Success: Account created\n\n        Address: 0x0[..]\n        \n        Account successfully created but it needs to be deployed. The estimated deployment fee is [..] STRK. Prefund the account to cover deployment transaction fee\n\n        After prefunding the account, run:\n        sncast --accounts-file accounts.json account deploy --url http://127.0.0.1:5055/rpc --name my_account\n\n        To see account creation details, visit:\n        account: [..]\n        \"},\n    );\n\n    let contents = fs::read_to_string(temp_dir.path().join(accounts_file))\n        .expect(\"Unable to read created file\");\n\n    let expected = json!(\n        {\n            \"alpha-sepolia\": {\n                \"my_account\": {\n                    \"address\": \"0x[..]\",\n                    \"class_hash\": \"0x[..]\",\n                    \"deployed\": false,\n                    \"legacy\": false,\n                    \"private_key\": \"0x[..]\",\n                    \"public_key\": \"0x[..]\",\n                    \"salt\": \"0x1\",\n                    \"type\": get_formatted_account_type(account_type)\n                }\n            }\n        }\n    );\n\n    assert_data_eq!(contents, to_string_pretty(&expected).unwrap());\n}\n\n// TODO(#3556): Remove this test once we drop Argent account type\n#[tokio::test]\npub async fn test_happy_case_argent_with_deprecation_warning() {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"create\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account\",\n        \"--salt\",\n        \"0x1\",\n        \"--type\",\n        \"argent\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(temp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout(\n        output,\n        indoc! {r\"\n        [WARNING] Argent has rebranded as Ready. The `argent` option for the `--type` flag in `account create` is deprecated, please use `ready` instead.\n        \n        Success: Account created\n\n        Address: 0x0[..]\n        \n        Account successfully created but it needs to be deployed. The estimated deployment fee is [..] STRK. Prefund the account to cover deployment transaction fee\n\n        After prefunding the account, run:\n        sncast --accounts-file accounts.json account deploy --url http://127.0.0.1:5055/rpc --name my_account\n\n        To see account creation details, visit:\n        account: [..]\n        \"},\n    );\n\n    let contents = fs::read_to_string(temp_dir.path().join(accounts_file))\n        .expect(\"Unable to read created file\");\n\n    let expected = json!(\n        {\n            \"alpha-sepolia\": {\n                \"my_account\": {\n                    \"address\": \"0x[..]\",\n                    \"class_hash\": \"0x[..]\",\n                    \"deployed\": false,\n                    \"legacy\": false,\n                    \"private_key\": \"0x[..]\",\n                    \"public_key\": \"0x[..]\",\n                    \"salt\": \"0x1\",\n                    \"type\": \"ready\"\n                }\n            }\n        }\n    );\n\n    assert_data_eq!(contents, to_string_pretty(&expected).unwrap());\n}\n\n#[tokio::test]\npub async fn test_invalid_class_hash() {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"create\",\n        \"--url\",\n        URL,\n        \"--type\",\n        \"oz\",\n        \"--class-hash\",\n        \"0x10101\",\n        \"--name\",\n        \"my_account_create_happy\",\n        \"--salt\",\n        \"0x1\",\n    ];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: account create\n        Error: Class with hash 0x10101 is not declared, try using --class-hash with a hash of the declared class\n        \"},\n    );\n}\n\n#[tokio::test]\npub async fn test_happy_case_generate_salt() {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"create\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account\",\n        \"--class-hash\",\n        DEVNET_OZ_CLASS_HASH_CAIRO_0,\n        \"--type\",\n        \"oz\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(temp_dir.path());\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        Success: Account created\n\n        Address: 0x0[..]\n        \n        Account successfully created but it needs to be deployed. The estimated deployment fee is [..] STRK. Prefund the account to cover deployment transaction fee\n\n        After prefunding the account, run:\n        sncast --accounts-file accounts.json account deploy --url http://127.0.0.1:5055/rpc --name my_account\n\n        To see account creation details, visit:\n        account: [..]\n        \"});\n\n    let contents = fs::read_to_string(temp_dir.path().join(accounts_file))\n        .expect(\"Unable to read created file\");\n    assert!(contents.contains(\"my_account\"));\n    assert!(contents.contains(\"alpha-sepolia\"));\n    assert!(contents.contains(\"private_key\"));\n    assert!(contents.contains(\"public_key\"));\n    assert!(contents.contains(\"address\"));\n    assert!(contents.contains(\"salt\"));\n    assert!(contents.contains(\"class_hash\"));\n    assert!(contents.contains(\"legacy\"));\n    assert!(contents.contains(\"type\"));\n}\n\n#[test_case(\"--url\", URL; \"with_url\")]\n#[test_case(\"--network\", \"devnet\"; \"with_network\")]\n#[tokio::test]\npub async fn test_happy_case_add_profile(rpc_flag: &str, rpc_value: &str) {\n    let tempdir = copy_config_to_tempdir(\"tests/data/files/correct_snfoundry.toml\", None);\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"create\",\n        rpc_flag,\n        rpc_value,\n        \"--name\",\n        \"my_account\",\n        \"--add-profile\",\n        \"my_account\",\n    ];\n\n    let output = runner(&args).current_dir(tempdir.path()).assert();\n    let config_path = Utf8PathBuf::from_path_buf(tempdir.path().join(\"snfoundry.toml\"))\n        .unwrap()\n        .canonicalize_utf8()\n        .unwrap();\n\n    assert_stdout_contains(\n        output,\n        format!(\"Add Profile: Profile my_account successfully added to {config_path}\"),\n    );\n\n    let contents = fs::read_to_string(tempdir.path().join(\"snfoundry.toml\"))\n        .expect(\"Unable to read snfoundry.toml\");\n    let expected_lines = [\n        \"[sncast.my_account]\",\n        \"account = \\\"my_account\\\"\",\n        \"accounts-file = \\\"accounts.json\\\"\",\n        &format!(\"{} = \\\"{}\\\"\", rpc_flag.trim_start_matches(\"--\"), rpc_value),\n    ];\n    let expected_block = expected_lines.join(\"\\n\");\n\n    assert!(contents.contains(&expected_block));\n}\n\n#[tokio::test]\npub async fn test_happy_case_accounts_file_already_exists() {\n    let accounts_file = \"accounts.json\";\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n\n    copy_file(\n        \"tests/data/accounts/accounts.json\",\n        temp_dir.path().join(accounts_file),\n    );\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"create\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account\",\n        \"--salt\",\n        \"0x1\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(temp_dir.path());\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        Success: Account created\n\n        Address: 0x0[..]\n        \n        Account successfully created but it needs to be deployed. The estimated deployment fee is [..] STRK. Prefund the account to cover deployment transaction fee\n\n        After prefunding the account, run:\n        sncast --accounts-file accounts.json account deploy --url http://127.0.0.1:5055/rpc --name my_account\n\n        To see account creation details, visit:\n        account: [..]\n        \"});\n\n    let contents = fs::read_to_string(temp_dir.path().join(accounts_file))\n        .expect(\"Unable to read created file\");\n    assert!(contents.contains(\"my_account\"));\n    assert!(contents.contains(\"deployed\"));\n    assert!(contents.contains(\"legacy\"));\n}\n\n#[tokio::test]\npub async fn test_profile_already_exists() {\n    let tempdir = copy_config_to_tempdir(\"tests/data/files/correct_snfoundry.toml\", None);\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"create\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"myprofile\",\n        \"--add-profile\",\n        \"default\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: account create\n        Error: Failed to add profile = default to the snfoundry.toml. Profile already exists\n        \"},\n    );\n}\n\n#[tokio::test]\npub async fn test_account_already_exists() {\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"account\",\n        \"create\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"user1\",\n        \"--salt\",\n        \"0x1\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: account create\n        Error: Account with name = user1 already exists in network with chain_id = SN_SEPOLIA\n        \"},\n    );\n}\n\n#[test_case(\"oz\"; \"oz_account_type\")]\n#[test_case(\"ready\"; \"ready_account_type\")]\n#[test_case(\"braavos\"; \"braavos_account_type\")]\n#[tokio::test]\npub async fn test_happy_case_keystore(account_type: &str) {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n    let keystore_file = \"my_key.json\";\n    let account_file = \"my_account.json\";\n    set_create_keystore_password_env();\n\n    let args = vec![\n        \"--keystore\",\n        keystore_file,\n        \"--account\",\n        account_file,\n        \"account\",\n        \"create\",\n        \"--url\",\n        URL,\n        \"--type\",\n        account_type,\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(temp_dir.path());\n\n    snapbox.assert().stdout_eq(formatdoc! {r\"\n        Success: Account created\n\n        Address: 0x0[..]\n        \n        Account successfully created but it needs to be deployed. The estimated deployment fee is [..] STRK. Prefund the account to cover deployment transaction fee\n\n        After prefunding the account, run:\n        sncast --account {} --keystore {} account deploy --url {}\n\n        To see account creation details, visit:\n        account: [..]\n    \", account_file, keystore_file, URL});\n\n    assert!(temp_dir.path().join(keystore_file).exists());\n\n    let contents = fs::read_to_string(temp_dir.path().join(account_file))\n        .expect(\"Unable to read created file\");\n\n    assert_data_eq!(\n        contents,\n        get_keystore_account_pattern(account_type.parse().unwrap(), None),\n    );\n}\n\n// TODO(#3556): Remove this test once we drop Argent account type\n#[tokio::test]\npub async fn test_happy_case_keystore_argent_with_deprecation_warning() {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n    let keystore_file = \"my_key.json\";\n    let account_file = \"my_account.json\";\n    set_create_keystore_password_env();\n\n    let args = vec![\n        \"--keystore\",\n        keystore_file,\n        \"--account\",\n        account_file,\n        \"account\",\n        \"create\",\n        \"--url\",\n        URL,\n        \"--type\",\n        \"argent\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(temp_dir.path());\n\n    snapbox.assert().stdout_eq(formatdoc! {r\"\n        [WARNING] Argent has rebranded as Ready. The `argent` option for the `--type` flag in `account create` is deprecated, please use `ready` instead.\n        \n        Success: Account created\n\n        Address: 0x0[..]\n        \n        Account successfully created but it needs to be deployed. The estimated deployment fee is [..] STRK. Prefund the account to cover deployment transaction fee\n\n        After prefunding the account, run:\n        sncast --account {} --keystore {} account deploy --url {}\n\n        To see account creation details, visit:\n        account: [..]\n    \", account_file, keystore_file, URL});\n\n    assert!(temp_dir.path().join(keystore_file).exists());\n\n    let contents = fs::read_to_string(temp_dir.path().join(account_file))\n        .expect(\"Unable to read created file\");\n\n    assert_data_eq!(\n        contents,\n        get_keystore_account_pattern(\"argent\".parse().unwrap(), None),\n    );\n}\n\n#[tokio::test]\npub async fn test_happy_case_keystore_add_profile() {\n    let tempdir = copy_config_to_tempdir(\"tests/data/files/correct_snfoundry.toml\", None);\n    let keystore_file = \"my_key.json\";\n    let account_file = \"my_account.json\";\n    let accounts_json_file = \"accounts.json\";\n    set_create_keystore_password_env();\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_file,\n        \"--keystore\",\n        keystore_file,\n        \"--account\",\n        account_file,\n        \"account\",\n        \"create\",\n        \"--url\",\n        URL,\n        \"--add-profile\",\n        \"with_keystore\",\n    ];\n\n    let output = runner(&args).current_dir(tempdir.path()).assert();\n\n    let config_path = Utf8PathBuf::from_path_buf(tempdir.path().join(\"snfoundry.toml\"))\n        .unwrap()\n        .canonicalize_utf8()\n        .unwrap();\n\n    assert_stdout_contains(\n        output,\n        format!(\"Add Profile: Profile with_keystore successfully added to {config_path}\"),\n    );\n\n    let contents =\n        fs::read_to_string(tempdir.path().join(account_file)).expect(\"Unable to read created file\");\n    assert!(contents.contains(\"\\\"deployment\\\": {\"));\n    assert!(contents.contains(\"\\\"variant\\\": {\"));\n    assert!(contents.contains(\"\\\"version\\\": 1\"));\n    assert!(contents.contains(\"\\\"legacy\\\": false\"));\n\n    let contents = fs::read_to_string(tempdir.path().join(\"snfoundry.toml\"))\n        .expect(\"Unable to read snfoundry.toml\");\n    assert!(contents.contains(r\"[sncast.with_keystore]\"));\n    assert!(contents.contains(r#\"account = \"my_account.json\"\"#));\n    assert!(!contents.contains(r#\"accounts-file = \"accounts.json\"\"#));\n    assert!(contents.contains(r#\"keystore = \"my_key.json\"\"#));\n    assert!(contents.contains(r#\"url = \"http://127.0.0.1:5055/rpc\"\"#));\n}\n\n#[tokio::test]\npub async fn test_keystore_without_account() {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n    let keystore_file = \"my_key.json\";\n\n    set_create_keystore_password_env();\n\n    let args = vec![\n        \"--keystore\",\n        keystore_file,\n        \"account\",\n        \"create\",\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: account create\n        Error: Argument `--account` must be passed and be a path when using `--keystore`\n        \"},\n    );\n}\n\n#[tokio::test]\npub async fn test_keystore_file_already_exists() {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n\n    let keystore_file = \"my_key.json\";\n    let account_file = \"my_account_new.json\";\n\n    copy_file(\n        \"tests/data/keystore/my_key.json\",\n        temp_dir.path().join(keystore_file),\n    );\n    set_create_keystore_password_env();\n\n    let args = vec![\n        \"--keystore\",\n        keystore_file,\n        \"--account\",\n        account_file,\n        \"account\",\n        \"create\",\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: account create\n        Error: Keystore file my_key.json already exists\n        \"},\n    );\n}\n\n#[tokio::test]\npub async fn test_keystore_account_file_already_exists() {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n\n    let keystore_file = \"my_key_new.json\";\n    let account_file = \"my_account.json\";\n\n    copy_file(\n        \"tests/data/keystore/my_account.json\",\n        temp_dir.path().join(account_file),\n    );\n\n    set_create_keystore_password_env();\n\n    let args = vec![\n        \"--keystore\",\n        keystore_file,\n        \"--account\",\n        account_file,\n        \"account\",\n        \"create\",\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: account create\n        Error: Account file my_account.json already exists\n        \"},\n    );\n}\n\n#[tokio::test]\npub async fn test_happy_case_keystore_int_format() {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n    let keystore_file = \"my_key_int.json\";\n    let account_file = \"my_account_int.json\";\n\n    set_create_keystore_password_env();\n\n    let args = vec![\n        \"--keystore\",\n        keystore_file,\n        \"--account\",\n        account_file,\n        \"account\",\n        \"create\",\n        \"--url\",\n        URL,\n        \"--class-hash\",\n        DEVNET_OZ_CLASS_HASH_CAIRO_0,\n        \"--type\",\n        \"oz\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(temp_dir.path());\n\n    snapbox.assert().stdout_eq(formatdoc! {r\"\n        Success: Account created\n\n        Address: [..]\n        \n        Account successfully created but it needs to be deployed. The estimated deployment fee is [..] STRK. Prefund the account to cover deployment transaction fee\n\n        After prefunding the account, run:\n        sncast --account {} --keystore {} account deploy --url {}\n\n        To see account creation details, visit:\n        account: [..]\n    \", account_file, keystore_file, URL});\n\n    let contents = fs::read_to_string(temp_dir.path().join(account_file))\n        .expect(\"Unable to read created file\");\n    assert!(contents.contains(\"\\\"deployment\\\": {\"));\n    assert!(contents.contains(\"\\\"variant\\\": {\"));\n    assert!(contents.contains(\"\\\"version\\\": 1\"));\n    assert!(contents.contains(\"\\\"legacy\\\": true\"));\n}\n\n#[tokio::test]\npub async fn test_happy_case_default_name_generation() {\n    let tempdir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_file = \"accounts.json\";\n\n    let create_args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"create\",\n        \"--url\",\n        URL,\n        \"--salt\",\n        \"0x1\",\n    ];\n\n    let delete_args = vec![\n        \"--accounts-file\",\n        &accounts_file,\n        \"account\",\n        \"delete\",\n        \"--name\",\n        \"account-2\",\n        \"--network\",\n        \"sepolia\",\n    ];\n\n    let assert_account_created = |id: usize| {\n        runner(&create_args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(tempdir.path())\n        .assert()\n        .stdout_eq(formatdoc! {r\"\n            Success: Account created\n\n            Address: 0x0[..]\n            \n            Account successfully created but it needs to be deployed. The estimated deployment fee is [..] STRK. Prefund the account to cover deployment transaction fee\n\n            After prefunding the account, run:\n            sncast --accounts-file accounts.json account deploy --url http://127.0.0.1:5055/rpc --name account-{id}\n\n            To see account creation details, visit:\n            account: [..]\n        \", id = id});\n    };\n\n    for i in 0..3 {\n        assert_account_created(i + 1);\n    }\n\n    let contents = fs::read_to_string(tempdir.path().join(accounts_file))\n        .expect(\"Unable to read created file\");\n\n    assert!(\n        [\"account-1\", \"account-2\", \"account-3\"]\n            .iter()\n            .all(|a| contents.contains(a))\n    );\n\n    runner(&delete_args)\n        .current_dir(tempdir.path())\n        .stdin(\"Y\")\n        .assert()\n        .success()\n        .stdout_eq(indoc! {r\"\n        Success: Account deleted\n\n        Account successfully removed\n    \"});\n\n    let contents_after_delete = fs::read_to_string(tempdir.path().join(accounts_file))\n        .expect(\"Unable to read created file\");\n\n    assert!(!contents_after_delete.contains(\"account-2\"));\n\n    assert_account_created(2);\n\n    let contents = fs::read_to_string(tempdir.path().join(accounts_file))\n        .expect(\"Unable to read created file\");\n\n    assert!(contents.contains(\"account-2\"));\n\n    let expected = json!(\n        {\n            \"alpha-sepolia\": {\n                \"account-1\": {\n                    \"address\": \"0x[..]\",\n                    \"class_hash\": \"0x[..]\",\n                    \"deployed\": false,\n                    \"legacy\": false,\n                    \"private_key\": \"0x[..]\",\n                    \"public_key\": \"0x[..]\",\n                    \"salt\": \"0x1\",\n                    \"type\": \"open_zeppelin\"\n                },\n                \"account-2\": {\n                    \"address\": \"0x[..]\",\n                    \"class_hash\": \"0x[..]\",\n                    \"deployed\": false,\n                    \"legacy\": false,\n                    \"private_key\": \"0x[..]\",\n                    \"public_key\": \"0x[..]\",\n                    \"salt\": \"0x1\",\n                    \"type\": \"open_zeppelin\"\n                },\n                \"account-3\": {\n                    \"address\": \"0x[..]\",\n                    \"class_hash\": \"0x[..]\",\n                    \"deployed\": false,\n                    \"legacy\": false,\n                    \"private_key\": \"0x[..]\",\n                    \"public_key\": \"0x[..]\",\n                    \"salt\": \"0x1\",\n                    \"type\": \"open_zeppelin\"\n                },\n            }\n        }\n    );\n\n    assert_data_eq!(contents, to_string_pretty(&expected).unwrap());\n}\n\nfn get_formatted_account_type(account_type: &str) -> &str {\n    match account_type {\n        \"oz\" => \"open_zeppelin\",\n        _ => account_type,\n    }\n}\n\nfn get_keystore_account_pattern(account_type: AccountType, class_hash: Option<&str>) -> String {\n    let account_json = match account_type {\n        AccountType::OpenZeppelin => {\n            json!(\n                {\n                    \"version\": 1,\n                    \"variant\": {\n                        \"type\": \"open_zeppelin\",\n                        \"version\": 1,\n                        \"public_key\": \"0x[..]\",\n                        \"legacy\": false,\n                    },\n                    \"deployment\": {\n                        \"status\": \"undeployed\",\n                        \"class_hash\": class_hash.unwrap_or(&OZ_CLASS_HASH.into_hex_string()),\n                        \"salt\": \"0x[..]\",\n                    }\n                }\n            )\n        }\n        AccountType::Argent | AccountType::Ready => {\n            json!(\n                {\n                    \"version\": 1,\n                    \"variant\": {\n                        // TODO(#3556): Remove hardcoded \"argent\" and use format! with `AccountType::Ready`\n                        \"type\": \"argent\",\n                        \"version\": 1,\n                        \"owner\": \"0x[..]\",\n                        \"guardian\": \"0x0\"\n                    },\n                    \"deployment\": {\n                        \"status\": \"undeployed\",\n                        \"class_hash\": class_hash.unwrap_or(&READY_CLASS_HASH.into_hex_string()),\n                        \"salt\": \"0x[..]\",\n                    }\n                }\n            )\n        }\n        AccountType::Braavos => {\n            json!(\n                {\n                  \"version\": 1,\n                  \"variant\": {\n                    \"type\": \"braavos\",\n                    \"version\": 1,\n                    \"multisig\": {\n                      \"status\": \"off\"\n                    },\n                    \"signers\": [\n                      {\n                        \"type\": \"stark\",\n                        \"public_key\": \"0x[..]\"\n                      }\n                    ]\n                  },\n                  \"deployment\": {\n                    \"status\": \"undeployed\",\n                    \"class_hash\": class_hash.unwrap_or(&BRAAVOS_CLASS_HASH.into_hex_string()),\n                    \"salt\": \"0x[..]\",\n                    \"context\": {\n                      \"variant\": \"braavos\",\n                      \"base_account_class_hash\": BRAAVOS_BASE_ACCOUNT_CLASS_HASH\n                    }\n                  }\n                }\n            )\n        }\n    };\n\n    to_string_pretty(&account_json).unwrap()\n}\n\n#[tokio::test]\npub async fn test_happy_case_deployment_fee_message() {\n    let tempdir = tempdir().expect(\"Failed to create a temporary directory\");\n\n    let args = vec![\"account\", \"create\", \"--url\", URL];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        \"Account successfully created but it needs to be deployed. The estimated deployment fee is [..] STRK. Prefund the account to cover deployment transaction fee\",\n    );\n}\n\n#[tokio::test]\npub async fn test_happy_case_default_name_generation_when_accounts_file_empty() {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_file = \"test_accounts.json\";\n    let accounts_path = temp_dir.path().join(accounts_file);\n    std::fs::File::create(&accounts_path).expect(\"Failed to create empty accounts file\");\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"create\",\n        \"--url\",\n        URL,\n        \"--class-hash\",\n        DEVNET_OZ_CLASS_HASH_CAIRO_0,\n        \"--type\",\n        \"oz\",\n    ];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n\n    snapbox.assert().success();\n}\n\n#[tokio::test]\npub async fn test_happy_case_accounts_file_empty() {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_file = \"test_accounts.json\";\n    let accounts_path = temp_dir.path().join(accounts_file);\n    std::fs::File::create(&accounts_path).expect(\"Failed to create empty accounts file\");\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"create\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account\",\n        \"--class-hash\",\n        DEVNET_OZ_CLASS_HASH_CAIRO_0,\n        \"--type\",\n        \"oz\",\n    ];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n\n    snapbox.assert().success();\n}\n\n#[tokio::test]\npub async fn test_json_output_format() {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"--json\",\n        \"account\",\n        \"create\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account\",\n        \"--salt\",\n        \"0x1\",\n        \"--type\",\n        \"oz\",\n        \"--add-profile\",\n        \"my_account\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(temp_dir.path());\n    snapbox.assert().stdout_eq(indoc! {r#\"\n        {\"add_profile\":\"Profile my_account successfully added to [..]/snfoundry.toml\",\"address\":\"0x[..]\",\"command\":\"account create\",\"estimated_fee\":\"[..]\",\"message\":\"Account successfully created but it needs to be deployed. The estimated deployment fee is [..] STRK. Prefund the account to cover deployment transaction fee/n/nAfter prefunding the account, run:/nsncast --accounts-file accounts.json account deploy --url [..] --name my_account\",\"type\":\"response\"}\n        {\"links\":\"account: https://sepolia.voyager.online/contract/0x[..]\",\"title\":\"account creation\",\"type\":\"notification\"}\n    \"#});\n}\n\n#[tokio::test]\npub async fn test_no_explorer_links_on_localhost() {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"create\",\n        \"--url\",\n        \"http://127.0.0.1:5055/rpc\",\n        \"--name\",\n        \"my_account\",\n        \"--salt\",\n        \"0x1\",\n        \"--type\",\n        \"oz\",\n    ];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert!(\n        !output\n            .as_stdout()\n            .contains(\"To see account creation details, visit:\")\n    );\n}\n\n#[tokio::test]\npub async fn test_use_url_from_config() {\n    let accounts_file = \"accounts.json\";\n    let temp_dir = copy_config_to_tempdir(\"tests/data/files/correct_snfoundry.toml\", None);\n    copy_file(\n        \"tests/data/accounts/accounts.json\",\n        temp_dir.path().join(accounts_file),\n    );\n\n    let args = vec![\"--accounts-file\", accounts_file, \"account\", \"create\"];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(temp_dir.path());\n\n    snapbox.assert().success();\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/account/delete.rs",
    "content": "use crate::helpers::constants::ACCOUNT_FILE_PATH;\nuse crate::helpers::runner::runner;\nuse crate::{e2e::account::helpers::create_tempdir_with_accounts_file, helpers::constants::URL};\nuse indoc::indoc;\nuse shared::test_utils::output_assert::{AsOutput, assert_stderr_contains};\n\n#[test]\npub fn test_no_accounts_in_network() {\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"account\",\n        \"delete\",\n        \"--name\",\n        \"user99\",\n        \"--network-name\",\n        \"my-custom-network\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: account delete\n        Error: No accounts defined for network = my-custom-network\n        \"},\n    );\n}\n\n#[test]\npub fn test_account_does_not_exist() {\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"account\",\n        \"delete\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"user99\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: account delete\n        Error: Account with name user99 does not exist\n        \"},\n    );\n}\n\n#[test]\npub fn test_delete_abort() {\n    // Creating dummy accounts test file\n    let accounts_file_name = \"temp_accounts.json\";\n    let temp_dir = create_tempdir_with_accounts_file(accounts_file_name, true);\n\n    // Now delete dummy account\n    let args = vec![\n        \"--accounts-file\",\n        &accounts_file_name,\n        \"account\",\n        \"delete\",\n        \"--name\",\n        \"user3\",\n        \"--network-name\",\n        \"custom-network\",\n    ];\n\n    // Run test with a negative user input\n    let snapbox = runner(&args).current_dir(temp_dir.path()).stdin(\"n\");\n\n    let output = snapbox.assert().success();\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: account delete\n        Error: Delete aborted\n        \"},\n    );\n}\n\n#[test]\npub fn test_happy_case() {\n    // Creating dummy accounts test file\n    let accounts_file_name = \"temp_accounts.json\";\n    let temp_dir = create_tempdir_with_accounts_file(accounts_file_name, true);\n\n    // Now delete dummy account\n    let args = vec![\n        \"--accounts-file\",\n        &accounts_file_name,\n        \"account\",\n        \"delete\",\n        \"--name\",\n        \"user3\",\n        \"--network-name\",\n        \"custom-network\",\n    ];\n\n    // Run test with an affirmative user input\n    let snapbox = runner(&args).current_dir(temp_dir.path()).stdin(\"Y\");\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        Success: Account deleted\n\n        Account successfully removed\n    \"});\n}\n\n#[test]\npub fn test_happy_case_url() {\n    let accounts_file_name = \"temp_accounts.json\";\n    let temp_dir = create_tempdir_with_accounts_file(accounts_file_name, true);\n\n    let args = vec![\n        \"--accounts-file\",\n        &accounts_file_name,\n        \"account\",\n        \"delete\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"user0\",\n    ];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path()).stdin(\"Y\");\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        Success: Account deleted\n\n        Account successfully removed\n    \"});\n}\n\n#[test]\npub fn test_happy_case_with_yes_flag() {\n    // Creating dummy accounts test file\n    let accounts_file_name = \"temp_accounts.json\";\n    let temp_dir = create_tempdir_with_accounts_file(accounts_file_name, true);\n\n    // Now delete dummy account\n    let args = vec![\n        \"--accounts-file\",\n        &accounts_file_name,\n        \"account\",\n        \"delete\",\n        \"--name\",\n        \"user3\",\n        \"--network-name\",\n        \"custom-network\",\n        \"--yes\",\n    ];\n\n    // Run test with no additional user input\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert!(output.as_stderr().is_empty());\n    output.stdout_eq(indoc! {r\"\n        Success: Account deleted\n\n        Account successfully removed\n    \"});\n}\n\n#[test]\npub fn test_accept_only_one_network_type_argument() {\n    let accounts_file_name = \"temp_accounts.json\";\n    let temp_dir = create_tempdir_with_accounts_file(accounts_file_name, true);\n\n    let args = vec![\n        \"--accounts-file\",\n        &accounts_file_name,\n        \"account\",\n        \"delete\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"user3\",\n        \"--network-name\",\n        \"custom-network\",\n    ];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path()).stdin(\"Y\");\n\n    let output = snapbox.assert().failure();\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n            error: the argument '--url <URL>' cannot be used with '--network-name <NETWORK_NAME>'\n        \"},\n    );\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/account/deploy.rs",
    "content": "use crate::helpers::constants::{DEVNET_OZ_CLASS_HASH_CAIRO_0, URL};\nuse crate::helpers::env::set_keystore_password_env;\nuse crate::helpers::fixtures::copy_file;\nuse crate::helpers::fixtures::{\n    get_address_from_keystore, get_transaction_hash, get_transaction_receipt, mint_token,\n};\nuse crate::helpers::runner::runner;\nuse camino::Utf8PathBuf;\nuse configuration::test_utils::copy_config_to_tempdir;\nuse conversions::string::IntoHexStr;\nuse indoc::indoc;\nuse shared::test_utils::output_assert::{AsOutput, assert_stderr_contains};\nuse sncast::AccountType;\nuse sncast::helpers::account::load_accounts;\nuse sncast::helpers::constants::{\n    BRAAVOS_CLASS_HASH, KEYSTORE_PASSWORD_ENV_VAR, OZ_CLASS_HASH, READY_CLASS_HASH,\n};\nuse starknet_rust::core::types::TransactionReceipt::DeployAccount;\nuse std::fs;\nuse tempfile::{TempDir, tempdir};\nuse test_case::test_case;\n\n#[test_case(DEVNET_OZ_CLASS_HASH_CAIRO_0, \"oz\"; \"cairo_0_class_hash\")]\n#[test_case(&OZ_CLASS_HASH.into_hex_string(), \"oz\"; \"cairo_1_class_hash\")]\n#[test_case(&READY_CLASS_HASH.into_hex_string(), \"ready\"; \"ready_class_hash\")]\n#[test_case(&BRAAVOS_CLASS_HASH.into_hex_string(), \"braavos\"; \"braavos_class_hash\")]\n#[tokio::test]\npub async fn test_happy_case(class_hash: &str, account_type: &str) {\n    let tempdir = create_account(false, class_hash, account_type).await;\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"--json\",\n        \"account\",\n        \"deploy\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(tempdir.path());\n    let bdg = snapbox.assert();\n\n    let hash = get_transaction_hash(&bdg.get_output().stdout);\n    let receipt = get_transaction_receipt(hash).await;\n\n    assert!(matches!(receipt, DeployAccount(_)));\n\n    let stdout_str = bdg.as_stdout();\n    assert!(stdout_str.contains(\"account deploy\"));\n    assert!(stdout_str.contains(\"transaction_hash\"));\n\n    let path = Utf8PathBuf::from_path_buf(tempdir.path().join(accounts_file))\n        .expect(\"Path is not valid UTF-8\");\n    let items = load_accounts(&path).expect(\"Failed to load accounts\");\n    assert_eq!(items[\"alpha-sepolia\"][\"my_account\"][\"deployed\"], true);\n}\n\n#[tokio::test]\npub async fn test_happy_case_max_fee() {\n    let tempdir = create_account(false, &OZ_CLASS_HASH.into_hex_string(), \"oz\").await;\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"--json\",\n        \"account\",\n        \"deploy\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(tempdir.path());\n    let bdg = snapbox.assert();\n\n    let hash = get_transaction_hash(&bdg.get_output().stdout);\n    let receipt = get_transaction_receipt(hash).await;\n\n    assert!(matches!(receipt, DeployAccount(_)));\n\n    let stdout_str = bdg.as_stdout();\n    assert!(stdout_str.contains(\"account deploy\"));\n    assert!(stdout_str.contains(\"transaction_hash\"));\n\n    let path = Utf8PathBuf::from_path_buf(tempdir.path().join(accounts_file))\n        .expect(\"Path is not valid UTF-8\");\n    let items = load_accounts(&path).expect(\"Failed to load accounts\");\n    assert_eq!(items[\"alpha-sepolia\"][\"my_account\"][\"deployed\"], true);\n}\n\n#[tokio::test]\npub async fn test_happy_case_add_profile() {\n    let tempdir = create_account(true, &OZ_CLASS_HASH.into_hex_string(), \"oz\").await;\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--profile\",\n        \"deploy_profile\",\n        \"--accounts-file\",\n        accounts_file,\n        \"--json\",\n        \"account\",\n        \"deploy\",\n        \"--name\",\n        \"my_account\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(tempdir.path());\n    let output = snapbox.assert();\n\n    let hash = get_transaction_hash(&output.get_output().stdout);\n    let receipt = get_transaction_receipt(hash).await;\n\n    assert!(matches!(receipt, DeployAccount(_)));\n\n    let stdout_str = output.as_stdout();\n    assert!(stdout_str.contains(\"account deploy\"));\n    assert!(stdout_str.contains(\"transaction_hash\"));\n}\n\n#[test_case(\"{\\\"alpha-sepolia\\\": {}}\", \"Error: Account = my_account not found under network = alpha-sepolia\" ; \"when account name not present\")]\n#[test_case(\"{\\\"alpha-sepolia\\\": {\\\"my_account\\\" : {}}}\", \"Error: Failed to parse field `alpha-sepolia.my_account` in file 'accounts.json': missing field `public_key`[..]\" ; \"when public key not present\")]\nfn test_account_deploy_error(accounts_content: &str, error: &str) {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n\n    let accounts_file = \"accounts.json\";\n    fs::write(temp_dir.path().join(accounts_file), accounts_content).unwrap();\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"deploy\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account\",\n    ];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert();\n\n    assert_stderr_contains(output, error);\n}\n\n#[tokio::test]\npub async fn test_valid_class_hash() {\n    let tempdir = create_account(true, &OZ_CLASS_HASH.into_hex_string(), \"oz\").await;\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--profile\",\n        \"deploy_profile\",\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"deploy\",\n        \"--name\",\n        \"my_account\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(tempdir.path());\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        Success: Account deployed\n\n        Transaction Hash: 0x[..]\n\n        To see account deployment details, visit:\n        transaction: https://sepolia.voyager.online/tx/0x[..]\n    \"});\n}\n\n#[tokio::test]\npub async fn test_valid_no_max_fee() {\n    let tempdir = create_account(true, &OZ_CLASS_HASH.into_hex_string(), \"oz\").await;\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--profile\",\n        \"deploy_profile\",\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"deploy\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(tempdir.path());\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        Success: Account deployed\n\n        Transaction Hash: 0x[..]\n\n        To see account deployment details, visit:\n        transaction: https://sepolia.voyager.online/tx/0x[..]\n    \"});\n}\n\npub async fn create_account(add_profile: bool, class_hash: &str, account_type: &str) -> TempDir {\n    let tempdir = copy_config_to_tempdir(\"tests/data/files/correct_snfoundry.toml\", None);\n    let accounts_file = \"accounts.json\";\n\n    let mut args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"create\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account\",\n        \"--class-hash\",\n        class_hash,\n        \"--type\",\n        account_type,\n    ];\n    if add_profile {\n        args.push(\"--add-profile\");\n        args.push(\"deploy_profile\");\n    }\n\n    runner(&args).current_dir(tempdir.path()).assert().success();\n\n    let path = Utf8PathBuf::from_path_buf(tempdir.path().join(accounts_file))\n        .expect(\"Path is not valid UTF-8\");\n    let items = load_accounts(&path).expect(\"Failed to load accounts\");\n\n    mint_token(\n        items[\"alpha-sepolia\"][\"my_account\"][\"address\"]\n            .as_str()\n            .unwrap(),\n        9_999_999_999_999_999_999_999_999_999_999,\n    )\n    .await;\n    tempdir\n}\n\n#[test_case(\"oz\"; \"open_zeppelin_account\")]\n#[test_case(\"ready\"; \"ready_account\")]\n#[test_case(\"braavos\"; \"braavos_account\")]\n#[tokio::test]\npub async fn test_happy_case_keystore(account_type: &str) {\n    let tempdir = tempdir().expect(\"Unable to create a temporary directory\");\n\n    let keystore_file = \"my_key.json\";\n    let account_file = format!(\"my_account_{account_type}_undeployed_happy_case.json\");\n\n    copy_file(\n        \"tests/data/keystore/my_key.json\",\n        tempdir.path().join(keystore_file),\n    );\n    copy_file(\n        format!(\"tests/data/keystore/{account_file}\"),\n        tempdir.path().join(&account_file),\n    );\n    set_keystore_password_env();\n\n    let address = get_address_from_keystore(\n        tempdir.path().join(keystore_file).to_str().unwrap(),\n        tempdir.path().join(&account_file).to_str().unwrap(),\n        KEYSTORE_PASSWORD_ENV_VAR,\n        &account_type.parse().unwrap(),\n    );\n\n    mint_token(\n        &address.into_hex_string(),\n        9_999_999_999_999_999_999_999_999_999_999,\n    )\n    .await;\n\n    let args = vec![\n        \"--keystore\",\n        keystore_file,\n        \"--account\",\n        &account_file,\n        \"account\",\n        \"deploy\",\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(tempdir.path());\n\n    snapbox.assert().stdout_eq(indoc! {r\"\n        Success: Account deployed\n\n        Transaction Hash: 0x[..]\n\n        To see account deployment details, visit:\n        transaction: https://sepolia.voyager.online/tx/0x[..]\n    \"});\n\n    let path = Utf8PathBuf::from_path_buf(tempdir.path().join(account_file))\n        .expect(\"Path is not valid UTF-8\");\n    let items = load_accounts(&path).expect(\"Failed to load accounts\");\n    assert_eq!(items[\"deployment\"][\"status\"], \"deployed\");\n    assert!(!items[\"deployment\"][\"address\"].is_null());\n    assert!(items[\"deployment\"][\"salt\"].is_null());\n    assert!(items[\"deployment\"][\"context\"].is_null());\n}\n\n#[tokio::test]\npub async fn test_keystore_already_deployed() {\n    let tempdir = tempdir().expect(\"Unable to create a temporary directory\");\n\n    let keystore_file = \"my_key.json\";\n    let account_file = \"account.json\";\n\n    copy_file(\n        \"tests/data/keystore/my_key.json\",\n        tempdir.path().join(keystore_file),\n    );\n    copy_file(\n        \"tests/data/keystore/my_account.json\",\n        tempdir.path().join(account_file),\n    );\n    set_keystore_password_env();\n\n    let args = vec![\n        \"--keystore\",\n        keystore_file,\n        \"--account\",\n        account_file,\n        \"account\",\n        \"deploy\",\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: account deploy\n        Error: Account already deployed\n        \"},\n    );\n}\n\n#[tokio::test]\npub async fn test_keystore_key_mismatch() {\n    let tempdir = tempdir().expect(\"Unable to create a temporary directory\");\n\n    let keystore_file = \"my_key_invalid.json\";\n    let account_file = \"my_account_undeployed.json\";\n\n    copy_file(\n        \"tests/data/keystore/my_key_invalid.json\",\n        tempdir.path().join(keystore_file),\n    );\n    copy_file(\n        \"tests/data/keystore/my_account_undeployed.json\",\n        tempdir.path().join(account_file),\n    );\n\n    set_keystore_password_env();\n\n    let args = vec![\n        \"--keystore\",\n        keystore_file,\n        \"--account\",\n        account_file,\n        \"account\",\n        \"deploy\",\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: account deploy\n        Error: Public key and private key from keystore do not match\n        \"},\n    );\n}\n\n#[tokio::test]\npub async fn test_deploy_keystore_inexistent_keystore_file() {\n    let tempdir = tempdir().expect(\"Unable to create a temporary directory\");\n\n    let keystore_file = \"my_key_inexistent.json\";\n    let account_file = \"my_account_undeployed.json\";\n\n    copy_file(\n        \"tests/data/keystore/my_account_undeployed.json\",\n        tempdir.path().join(account_file),\n    );\n    set_keystore_password_env();\n\n    let args = vec![\n        \"--keystore\",\n        keystore_file,\n        \"--account\",\n        account_file,\n        \"account\",\n        \"deploy\",\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: account deploy\n        Error: Failed to find keystore file\n        \"},\n    );\n}\n\n#[tokio::test]\npub async fn test_deploy_keystore_inexistent_account_file() {\n    let tempdir = tempdir().expect(\"Unable to create a temporary directory\");\n\n    let keystore_file = \"my_key.json\";\n    let account_file = \"my_account_inexistent.json\";\n\n    copy_file(\n        \"tests/data/keystore/my_key.json\",\n        tempdir.path().join(keystore_file),\n    );\n    set_keystore_password_env();\n\n    let args = vec![\n        \"--keystore\",\n        keystore_file,\n        \"--account\",\n        account_file,\n        \"account\",\n        \"deploy\",\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: account deploy\n        Error: File containing the account does not exist: When using `--keystore` argument, the `--account` argument should be a path to the starkli JSON account file\n        \"},\n    );\n}\n\n#[tokio::test]\npub async fn test_deploy_keystore_no_status() {\n    let tempdir = tempdir().expect(\"Unable to create a temporary directory\");\n\n    let keystore_file = \"my_key.json\";\n    let account_file = \"my_account_invalid.json\";\n\n    copy_file(\n        \"tests/data/keystore/my_key.json\",\n        tempdir.path().join(keystore_file),\n    );\n    copy_file(\n        \"tests/data/keystore/my_account_invalid.json\",\n        tempdir.path().join(account_file),\n    );\n    set_keystore_password_env();\n\n    let args = vec![\n        \"--keystore\",\n        keystore_file,\n        \"--account\",\n        account_file,\n        \"account\",\n        \"deploy\",\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: account deploy\n        Error: Failed to get status key from account JSON file\n        \"},\n    );\n}\n\n#[tokio::test]\npub async fn test_deploy_keystore_other_args() {\n    let tempdir = tempdir().expect(\"Unable to create a temporary directory\");\n\n    let keystore_file = \"my_key.json\";\n    let account_file = \"my_account_undeployed_happy_case_other_args.json\";\n\n    copy_file(\n        \"tests/data/keystore/my_key.json\",\n        tempdir.path().join(keystore_file),\n    );\n    copy_file(\n        \"tests/data/keystore/my_account_undeployed_happy_case_other_args.json\",\n        tempdir.path().join(account_file),\n    );\n    set_keystore_password_env();\n\n    let address = get_address_from_keystore(\n        tempdir.path().join(keystore_file),\n        tempdir.path().join(account_file),\n        KEYSTORE_PASSWORD_ENV_VAR,\n        &AccountType::OpenZeppelin,\n    );\n\n    mint_token(\n        &address.into_hex_string(),\n        9_999_999_999_999_999_999_999_999_999_999,\n    )\n    .await;\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--keystore\",\n        keystore_file,\n        \"--account\",\n        account_file,\n        \"account\",\n        \"deploy\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"some-name\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(tempdir.path());\n    snapbox.assert().stdout_eq(indoc! {r\"\n        Success: Account deployed\n\n        Transaction Hash: 0x[..]\n\n        To see account deployment details, visit:\n        transaction: https://sepolia.voyager.online/tx/0x[..]\n    \"});\n}\n\n#[tokio::test]\npub async fn test_json_output_format() {\n    let tempdir = create_account(false, &OZ_CLASS_HASH.into_hex_string(), \"oz\").await;\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"--json\",\n        \"account\",\n        \"deploy\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(tempdir.path());\n    snapbox.assert().stdout_eq(indoc! {r#\"\n        {\"command\":\"account deploy\",\"transaction_hash\":\"0x0[..]\",\"type\":\"response\"}\n        {\"links\":\"transaction: https://sepolia.voyager.online/tx/0x0[..]\",\"title\":\"account deployment\",\"type\":\"notification\"}\n    \"#});\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/account/helpers.rs",
    "content": "use indoc::indoc;\nuse std::{fs::File, io::Write};\nuse tempfile::{TempDir, tempdir};\n\n#[must_use]\npub fn create_tempdir_with_accounts_file(file_name: &str, with_sample_data: bool) -> TempDir {\n    let dir = tempdir().expect(\"Unable to create a temporary directory\");\n    let location = dir.path().join(file_name);\n\n    let mut file = File::create(location).expect(\"Unable to create a temporary accounts file\");\n\n    let data = if with_sample_data {\n        indoc! {r#\"\n        {\n            \"alpha-sepolia\": {\n                \"user0\": {\n                    \"private_key\": \"0x1e9038bdc68ce1d27d54205256988e85\",\n                    \"public_key\": \"0x2f91ed13f8f0f7d39b942c80bfcd3d0967809d99e0cc083606cbe59033d2b39\",\n                    \"address\": \"0x4f5f24ceaae64434fa2bc2befd08976b51cf8f6a5d8257f7ec3616f61de263a\",\n                    \"type\": \"open_zeppelin\"\n                },\n                \"user1\": {\n                    \"address\": \"0x9613a934141dd6625748a7e066a380b3f9787f079f35ecc2f3ba934d507d4e\",\n                    \"class_hash\": \"0x36078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f\",\n                    \"private_key\": \"0x1c3495fce931c0b3ed244f55c54226441a8254deafbc7fab2e46926b4d2fdae\",\n                    \"public_key\": \"0x63b3a3ac141e4c007b167b27450f110c729cc0d0238541ca705b0de5144edbd\",\n                    \"salt\": \"0xe2b200bbdf76c31b\",\n                    \"type\": \"ready\"\n                },\n                \"user2\": {\n                    \"address\": \"0x9613a934141dd6625748a7e066a380b3f9787f079f35ecc2f3ba934d507d4e\",\n                    \"class_hash\": \"0x36078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f\",\n                    \"private_key\": \"0x1c3495fce931c0b3ed244f55c54226441a8254deafbc7fab2e46926b4d2fdae\",\n                    \"public_key\": \"0x63b3a3ac141e4c007b167b27450f110c729cc0d0238541ca705b0de5144edbd\",\n                    \"salt\": \"0xe2b200bbdf76c31b\",\n                    \"type\": \"argent\"\n                }\n            },\n            \"custom-network\": {\n                \"user3\": {\n                    \"private_key\": \"0xe3e70682c2094cac629f6fbed82c07cd\",\n                    \"public_key\": \"0x7e52885445756b313ea16849145363ccb73fb4ab0440dbac333cf9d13de82b9\",\n                    \"address\": \"0x7e00d496e324876bbc8531f2d9a82bf154d1a04a50218ee74cdd372f75a551a\"\n                },\n                \"user4\": {\n                    \"private_key\": \"0x73fbb3c1eff11167598455d0408f3932e42c678bd8f7fbc6028c716867cc01f\",\n                    \"public_key\": \"0x43a74f86b7e204f1ba081636c9d4015e1f54f5bb03a4ae8741602a15ffbb182\",\n                    \"salt\": \"0x54aa715a5cff30ccf7845ad4659eb1dac5b730c2541263c358c7e3a4c4a8064\",\n                    \"address\": \"0x7ccdf182d27c7aaa2e733b94db4a3f7b28ff56336b34abf43c15e3a9edfbe91\",\n                    \"deployed\": true\n                }\n            }\n        }\n        \"#}\n    } else {\n        r\"{}\"\n    };\n\n    file.write_all(data.as_bytes())\n        .expect(\"Unable to write test data to a temporary file\");\n\n    file.flush().expect(\"Unable to flush a temporary file\");\n\n    dir\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/account/import.rs",
    "content": "use crate::helpers::constants::{\n    DEVNET_OZ_CLASS_HASH_CAIRO_0, DEVNET_OZ_CLASS_HASH_CAIRO_1, DEVNET_PREDEPLOYED_ACCOUNT_ADDRESS,\n    URL,\n};\nuse crate::helpers::runner::runner;\nuse camino::Utf8PathBuf;\nuse configuration::CONFIG_FILENAME;\nuse configuration::test_utils::copy_config_to_tempdir;\nuse conversions::string::IntoHexStr;\nuse indoc::{formatdoc, indoc};\nuse serde_json::json;\nuse shared::test_utils::output_assert::{assert_stderr_contains, assert_stdout_contains};\nuse std::fs::{self, File};\nuse tempfile::tempdir;\nuse test_case::test_case;\n\n#[test_case(\"oz\", \"open_zeppelin\"; \"oz_account_type\")]\n#[test_case(\"ready\", \"ready\"; \"ready_account_type\")]\n#[test_case(\"braavos\", \"braavos\"; \"braavos_account_type\")]\n#[tokio::test]\npub async fn test_happy_case(input_account_type: &str, saved_type: &str) {\n    let tempdir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"import\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account_import\",\n        \"--address\",\n        \"0x123\",\n        \"--private-key\",\n        \"0x456\",\n        \"--class-hash\",\n        DEVNET_OZ_CLASS_HASH_CAIRO_0,\n        \"--type\",\n        input_account_type,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().stdout_eq(indoc! {r\"\n        Success: Account imported successfully\n\n        Account Name: my_account_import\n    \"});\n\n    let contents = fs::read_to_string(tempdir.path().join(accounts_file))\n        .expect(\"Unable to read created file\");\n    let contents_json: serde_json::Value = serde_json::from_str(&contents).unwrap();\n    assert_eq!(\n        contents_json,\n        json!(\n            {\n                \"alpha-sepolia\": {\n                  \"my_account_import\": {\n                    \"address\": \"0x123\",\n                    \"class_hash\": DEVNET_OZ_CLASS_HASH_CAIRO_0,\n                    \"deployed\": false,\n                    \"legacy\": true,\n                    \"private_key\": \"0x456\",\n                    \"public_key\": \"0x5f679dacd8278105bd3b84a15548fe84079068276b0e84d6cc093eb5430f063\",\n                    \"type\": saved_type\n                  }\n                }\n            }\n        )\n    );\n}\n\n// TODO(#3556): Remove this test once we drop Argent account type\n#[tokio::test]\npub async fn test_happy_case_argent_with_deprecation_warning() {\n    let tempdir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"import\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account_import\",\n        \"--address\",\n        \"0x123\",\n        \"--private-key\",\n        \"0x456\",\n        \"--class-hash\",\n        DEVNET_OZ_CLASS_HASH_CAIRO_0,\n        \"--type\",\n        \"argent\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().stdout_eq(indoc! {r\"\n        [WARNING] Argent has rebranded as Ready. The `argent` option for the `--type` flag in `account import` is deprecated, please use `ready` instead.\n        \n        Success: Account imported successfully\n\n        Account Name: my_account_import\n    \"});\n\n    let contents = fs::read_to_string(tempdir.path().join(accounts_file))\n        .expect(\"Unable to read created file\");\n    let contents_json: serde_json::Value = serde_json::from_str(&contents).unwrap();\n    assert_eq!(\n        contents_json,\n        json!(\n            {\n                \"alpha-sepolia\": {\n                  \"my_account_import\": {\n                    \"address\": \"0x123\",\n                    \"class_hash\": DEVNET_OZ_CLASS_HASH_CAIRO_0,\n                    \"deployed\": false,\n                    \"legacy\": true,\n                    \"private_key\": \"0x456\",\n                    \"public_key\": \"0x5f679dacd8278105bd3b84a15548fe84079068276b0e84d6cc093eb5430f063\",\n                    \"type\": \"ready\"\n                  }\n                }\n            }\n        )\n    );\n}\n\n#[tokio::test]\npub async fn test_existent_account_address() {\n    let tempdir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"import\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account_import\",\n        \"--address\",\n        DEVNET_PREDEPLOYED_ACCOUNT_ADDRESS,\n        \"--private-key\",\n        \"0x456\",\n        \"--type\",\n        \"oz\",\n    ];\n\n    let _ = runner(&args).current_dir(tempdir.path()).assert();\n\n    let contents = fs::read_to_string(tempdir.path().join(accounts_file))\n        .expect(\"Unable to read created file\");\n    let contents_json: serde_json::Value = serde_json::from_str(&contents).unwrap();\n    assert_eq!(\n        contents_json,\n        json!(\n            {\n                \"alpha-sepolia\": {\n                  \"my_account_import\": {\n                    \"address\": DEVNET_PREDEPLOYED_ACCOUNT_ADDRESS,\n                    \"class_hash\": &DEVNET_OZ_CLASS_HASH_CAIRO_1.into_hex_string(),\n                    \"deployed\": true,\n                    \"legacy\": false,\n                    \"private_key\": \"0x456\",\n                    \"public_key\": \"0x5f679dacd8278105bd3b84a15548fe84079068276b0e84d6cc093eb5430f063\",\n                    \"type\": \"open_zeppelin\"\n                  }\n                }\n            }\n        )\n    );\n}\n\n#[tokio::test]\npub async fn test_existent_account_address_and_incorrect_class_hash() {\n    let tempdir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"import\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account_import\",\n        \"--address\",\n        DEVNET_PREDEPLOYED_ACCOUNT_ADDRESS,\n        \"--private-key\",\n        \"0x456\",\n        \"--class-hash\",\n        DEVNET_OZ_CLASS_HASH_CAIRO_0,\n        \"--type\",\n        \"oz\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().stderr_eq(formatdoc! {r\"\n        Command: account import\n        Error: Incorrect class hash {} for account address {} was provided\n    \", DEVNET_OZ_CLASS_HASH_CAIRO_0, DEVNET_PREDEPLOYED_ACCOUNT_ADDRESS});\n}\n\n#[tokio::test]\npub async fn test_nonexistent_account_address_and_nonexistent_class_hash() {\n    let tempdir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"import\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account_import\",\n        \"--address\",\n        \"0x202\",\n        \"--private-key\",\n        \"0x456\",\n        \"--class-hash\",\n        \"0x101\",\n        \"--type\",\n        \"oz\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().stderr_eq(indoc! {r\"\n        Command: account import\n        Error: Class with hash 0x101 is not declared, try using --class-hash with a hash of the declared class\n    \"});\n}\n\n#[tokio::test]\npub async fn test_nonexistent_account_address() {\n    let tempdir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"import\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account_import\",\n        \"--address\",\n        \"0x123\",\n        \"--private-key\",\n        \"0x456\",\n        \"--type\",\n        \"oz\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().stderr_eq(indoc! {r\"\n        Command: account import\n        Error: Class hash for the account address 0x123 could not be found. Please provide the class hash\n    \"});\n}\n\n#[test_case(\"--url\", URL; \"with_url\")]\n#[test_case(\"--network\", \"devnet\"; \"with_network\")]\n#[tokio::test]\npub async fn test_happy_case_add_profile(rpc_flag: &str, rpc_value: &str) {\n    let tempdir = tempdir().expect(\"Failed to create a temporary directory\");\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"import\",\n        rpc_flag,\n        rpc_value,\n        \"--name\",\n        \"my_account_import\",\n        \"--address\",\n        \"0x1\",\n        \"--private-key\",\n        \"0x2\",\n        \"--class-hash\",\n        DEVNET_OZ_CLASS_HASH_CAIRO_0,\n        \"--type\",\n        \"oz\",\n        \"--add-profile\",\n        \"my_account_import\",\n    ];\n\n    let output = runner(&args).current_dir(tempdir.path()).assert();\n\n    let config_path = Utf8PathBuf::from_path_buf(tempdir.path().join(\"snfoundry.toml\"))\n        .unwrap()\n        .canonicalize_utf8()\n        .unwrap();\n\n    assert_stdout_contains(\n        output,\n        format!(\"Add Profile:  Profile my_account_import successfully added to {config_path}\"),\n    );\n    let current_dir_utf8 = Utf8PathBuf::try_from(tempdir.path().to_path_buf()).unwrap();\n\n    let contents = fs::read_to_string(current_dir_utf8.join(accounts_file))\n        .expect(\"Unable to read created file\");\n    let contents_json: serde_json::Value = serde_json::from_str(&contents).unwrap();\n    assert_eq!(\n        contents_json,\n        json!(\n            {\n                \"alpha-sepolia\": {\n                  \"my_account_import\": {\n                    \"address\": \"0x1\",\n                    \"class_hash\": DEVNET_OZ_CLASS_HASH_CAIRO_0,\n                    \"deployed\": false,\n                    \"private_key\": \"0x2\",\n                    \"public_key\": \"0x759ca09377679ecd535a81e83039658bf40959283187c654c5416f439403cf5\",\n                    \"legacy\": true,\n                    \"type\": \"open_zeppelin\"\n                  }\n                }\n            }\n        )\n    );\n\n    let contents = fs::read_to_string(current_dir_utf8.join(\"snfoundry.toml\"))\n        .expect(\"Unable to read snfoundry.toml\");\n    let expected_lines = [\n        \"[sncast.my_account_import]\",\n        \"account = \\\"my_account_import\\\"\",\n        \"accounts-file = \\\"accounts.json\\\"\",\n        &format!(\"{} = \\\"{}\\\"\", rpc_flag.trim_start_matches(\"--\"), rpc_value),\n    ];\n    let expected_block = expected_lines.join(\"\\n\");\n\n    assert!(contents.contains(&expected_block));\n}\n\n#[tokio::test]\npub async fn test_detect_deployed() {\n    let tempdir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"import\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account_import\",\n        \"--address\",\n        DEVNET_PREDEPLOYED_ACCOUNT_ADDRESS,\n        \"--private-key\",\n        \"0x5\",\n        \"--type\",\n        \"oz\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().stdout_eq(indoc! {r\"\n        Success: Account imported successfully\n\n        Account Name: my_account_import\n    \"});\n\n    let contents = fs::read_to_string(tempdir.path().join(accounts_file))\n        .expect(\"Unable to read created file\");\n    let contents_json: serde_json::Value = serde_json::from_str(&contents).unwrap();\n    assert_eq!(\n        contents_json,\n        json!(\n            {\n                \"alpha-sepolia\": {\n                  \"my_account_import\": {\n                    \"address\": DEVNET_PREDEPLOYED_ACCOUNT_ADDRESS,\n                    \"class_hash\": &DEVNET_OZ_CLASS_HASH_CAIRO_1.into_hex_string(),\n                    \"deployed\": true,\n                    \"private_key\": \"0x5\",\n                    \"public_key\": \"0x788435d61046d3eec54d77d25bd194525f4fa26ebe6575536bc6f656656b74c\",\n                    \"legacy\": false,\n                    \"type\": \"open_zeppelin\"\n                  }\n                }\n            }\n        )\n    );\n}\n\n#[tokio::test]\npub async fn test_missing_arguments() {\n    let args = vec![\n        \"account\",\n        \"import\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account_import\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        error: the following required arguments were not provided:\n          --address <ADDRESS>\n          --type <ACCOUNT_TYPE>\n        \"},\n    );\n}\n\n#[tokio::test]\npub async fn test_private_key_from_file() {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_file = \"accounts.json\";\n    let private_key_file = \"my_private_key\";\n\n    fs::write(temp_dir.path().join(private_key_file), \"0x456\").unwrap();\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"import\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account_import\",\n        \"--address\",\n        \"0x123\",\n        \"--private-key-file\",\n        private_key_file,\n        \"--class-hash\",\n        DEVNET_OZ_CLASS_HASH_CAIRO_0,\n        \"--type\",\n        \"oz\",\n    ];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n\n    snapbox.assert().stdout_eq(indoc! {r\"\n        Success: Account imported successfully\n\n        Account Name: my_account_import\n    \"});\n\n    let contents = fs::read_to_string(temp_dir.path().join(accounts_file))\n        .expect(\"Unable to read created file\");\n    let contents_json: serde_json::Value = serde_json::from_str(&contents).unwrap();\n    assert_eq!(\n        contents_json,\n        json!(\n            {\n                \"alpha-sepolia\": {\n                  \"my_account_import\": {\n                    \"address\": \"0x123\",\n                    \"deployed\": false,\n                    \"legacy\": true,\n                    \"private_key\": \"0x456\",\n                    \"public_key\": \"0x5f679dacd8278105bd3b84a15548fe84079068276b0e84d6cc093eb5430f063\",\n                    \"class_hash\": DEVNET_OZ_CLASS_HASH_CAIRO_0,\n                    \"type\": \"open_zeppelin\"\n                  }\n                }\n            }\n        )\n    );\n}\n\n#[tokio::test]\npub async fn test_accept_only_one_private_key() {\n    let args = vec![\n        \"account\",\n        \"import\",\n        \"--name\",\n        \"my_account_import\",\n        \"--address\",\n        \"0x123\",\n        \"--private-key\",\n        \"0x456\",\n        \"--private-key-file\",\n        \"my_private_key\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        \"error: the argument '--private-key <PRIVATE_KEY>' cannot be used with '--private-key-file <PRIVATE_KEY_FILE_PATH>'\",\n    );\n}\n\n#[tokio::test]\npub async fn test_invalid_private_key_file_path() {\n    let args = vec![\n        \"account\",\n        \"import\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account_import\",\n        \"--address\",\n        \"0x123\",\n        \"--private-key-file\",\n        \"my_private_key\",\n        \"--type\",\n        \"oz\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().success();\n\n    let expected_file_error = \"No such file or directory [..]\";\n\n    assert_stderr_contains(\n        output,\n        formatdoc! {r\"\n        Command: account import\n        Error: Failed to obtain private key from the file my_private_key: {}\n        \", expected_file_error},\n    );\n}\n\n#[tokio::test]\npub async fn test_invalid_private_key_in_file() {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n    let private_key_file = \"my_private_key\";\n\n    fs::write(\n        temp_dir.path().join(private_key_file),\n        \"invalid private key\",\n    )\n    .unwrap();\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"account\",\n        \"import\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account_import\",\n        \"--address\",\n        \"0x123\",\n        \"--private-key-file\",\n        private_key_file,\n        \"--type\",\n        \"oz\",\n    ];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: account import\n        Error: Failed to obtain private key from the file my_private_key: failed to create Felt from string: invalid dec string\n        \"},\n    );\n}\n\n#[tokio::test]\npub async fn test_private_key_as_int_in_file() {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_file = \"accounts.json\";\n    let private_key_file = \"my_private_key\";\n\n    fs::write(temp_dir.path().join(private_key_file), \"1110\").unwrap();\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"import\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account_import\",\n        \"--address\",\n        DEVNET_PREDEPLOYED_ACCOUNT_ADDRESS,\n        \"--private-key-file\",\n        private_key_file,\n        \"--type\",\n        \"oz\",\n    ];\n\n    runner(&args)\n        .current_dir(temp_dir.path())\n        .assert()\n        .success();\n\n    let contents = fs::read_to_string(temp_dir.path().join(accounts_file))\n        .expect(\"Unable to read created file\");\n    let contents_json: serde_json::Value = serde_json::from_str(&contents).unwrap();\n    assert_eq!(\n        contents_json,\n        json!(\n            {\n                \"alpha-sepolia\": {\n                  \"my_account_import\": {\n                    \"address\": DEVNET_PREDEPLOYED_ACCOUNT_ADDRESS,\n                    \"deployed\": true,\n                    \"legacy\": false,\n                    \"private_key\": \"0x456\",\n                    \"public_key\": \"0x5f679dacd8278105bd3b84a15548fe84079068276b0e84d6cc093eb5430f063\",\n                    \"class_hash\": &DEVNET_OZ_CLASS_HASH_CAIRO_1.into_hex_string(),\n                    \"type\": \"open_zeppelin\"\n                  }\n                }\n            }\n        )\n    );\n}\n\n#[tokio::test]\npub async fn test_empty_config_add_profile() {\n    let tempdir = tempdir().expect(\"Unable to create a temporary directory\");\n    File::create(tempdir.path().join(CONFIG_FILENAME)).unwrap();\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"import\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account_import\",\n        \"--address\",\n        DEVNET_PREDEPLOYED_ACCOUNT_ADDRESS,\n        \"--private-key\",\n        \"0x456\",\n        \"--type\",\n        \"oz\",\n        \"--add-profile\",\n        \"random\",\n    ];\n\n    let output = runner(&args).current_dir(tempdir.path()).assert();\n\n    let config_path = Utf8PathBuf::from_path_buf(tempdir.path().join(\"snfoundry.toml\"))\n        .unwrap()\n        .canonicalize_utf8()\n        .unwrap();\n\n    assert_stdout_contains(\n        output,\n        format!(\"Add Profile:  Profile random successfully added to {config_path}\"),\n    );\n    let current_dir_utf8 = Utf8PathBuf::try_from(tempdir.path().to_path_buf()).unwrap();\n\n    let contents = fs::read_to_string(current_dir_utf8.join(\"snfoundry.toml\"))\n        .expect(\"Unable to read snfoundry.toml\");\n    assert!(contents.contains(\"[sncast.random]\"));\n    assert!(contents.contains(\"account = \\\"my_account_import\\\"\"));\n    assert!(contents.contains(&format!(\"url = \\\"{URL}\\\"\")));\n}\n\n#[tokio::test]\npub async fn test_happy_case_valid_address_computation() {\n    let tempdir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"import\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account_import\",\n        \"--address\",\n        \"0x721c21e0cc9d37aec8e176797effd1be222aff6db25f068040adefabb7cfb6d\",\n        \"--private-key\",\n        \"0x2\",\n        \"--salt\",\n        \"0x3\",\n        \"--class-hash\",\n        DEVNET_OZ_CLASS_HASH_CAIRO_0,\n        \"--type\",\n        \"oz\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().stdout_eq(indoc! {r\"\n        Success: Account imported successfully\n\n        Account Name: my_account_import\n    \"});\n\n    let contents = fs::read_to_string(tempdir.path().join(accounts_file))\n        .expect(\"Unable to read created file\");\n    let contents_json: serde_json::Value = serde_json::from_str(&contents).unwrap();\n    assert_eq!(\n        contents_json,\n        json!(\n            {\n                \"alpha-sepolia\": {\n                  \"my_account_import\": {\n                    \"address\": \"0x721c21e0cc9d37aec8e176797effd1be222aff6db25f068040adefabb7cfb6d\",\n                    \"class_hash\": DEVNET_OZ_CLASS_HASH_CAIRO_0,\n                    \"deployed\": false,\n                    \"salt\": \"0x3\",\n                    \"legacy\": true,\n                    \"private_key\": \"0x2\",\n                    \"public_key\": \"0x759ca09377679ecd535a81e83039658bf40959283187c654c5416f439403cf5\",\n                    \"type\": \"open_zeppelin\"\n                  }\n                }\n            }\n        )\n    );\n}\n\n#[tokio::test]\npub async fn test_invalid_address_computation() {\n    let tempdir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"import\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account_import\",\n        \"--address\",\n        \"0x123\",\n        \"--private-key\",\n        \"0x456\",\n        \"--salt\",\n        \"0x789\",\n        \"--class-hash\",\n        DEVNET_OZ_CLASS_HASH_CAIRO_0,\n        \"--type\",\n        \"oz\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let computed_address = \"0xaf550326d32c8106ef08d25cbc0dba06e5cd10a2201c2e9bc5ad4cbbce45e6\";\n    snapbox.assert().stderr_eq(formatdoc! {r\"\n        Command: account import\n        Error: Computed address {computed_address} does not match the provided address 0x123. Please ensure that the provided salt, class hash, and account type are correct.\n    \"});\n}\n\n#[tokio::test]\npub async fn test_happy_case_default_name_generation() {\n    let tempdir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_file = \"accounts.json\";\n\n    let import_args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"import\",\n        \"--url\",\n        URL,\n        \"--address\",\n        \"0x123\",\n        \"--private-key\",\n        \"0x456\",\n        \"--class-hash\",\n        DEVNET_OZ_CLASS_HASH_CAIRO_0,\n        \"--type\",\n        \"oz\",\n    ];\n\n    let delete_args = vec![\n        \"--accounts-file\",\n        &accounts_file,\n        \"account\",\n        \"delete\",\n        \"--name\",\n        \"account-2\",\n        \"--network-name\",\n        \"alpha-sepolia\",\n    ];\n\n    let account_info = json!({\n      \"address\": \"0x123\",\n      \"class_hash\": DEVNET_OZ_CLASS_HASH_CAIRO_0,\n      \"deployed\": false,\n      \"legacy\": true,\n      \"private_key\": \"0x456\",\n      \"public_key\": \"0x5f679dacd8278105bd3b84a15548fe84079068276b0e84d6cc093eb5430f063\",\n      \"type\": \"open_zeppelin\"\n    });\n\n    let mut all_accounts_content = serde_json::Value::Object(serde_json::Map::new());\n    all_accounts_content[\"alpha-sepolia\"][\"account-1\"] = account_info.clone();\n    all_accounts_content[\"alpha-sepolia\"][\"account-2\"] = account_info.clone();\n    all_accounts_content[\"alpha-sepolia\"][\"account-3\"] = account_info.clone();\n\n    let mut accounts_content_after_delete = serde_json::Value::Object(serde_json::Map::new());\n    accounts_content_after_delete[\"alpha-sepolia\"][\"account-1\"] = account_info.clone();\n    accounts_content_after_delete[\"alpha-sepolia\"][\"account-3\"] = account_info.clone();\n\n    for i in 0..3 {\n        let snapbox = runner(&import_args).current_dir(tempdir.path());\n        snapbox.assert().stdout_eq(formatdoc! {r\"\n        Success: Account imported successfully\n\n        Account Name: account-{id}\n    \", id = i + 1});\n    }\n\n    let contents = fs::read_to_string(tempdir.path().join(accounts_file))\n        .expect(\"Unable to read created file\");\n    let contents_json: serde_json::Value = serde_json::from_str(&contents).unwrap();\n\n    assert_eq!(contents_json, all_accounts_content);\n\n    let snapbox = runner(&delete_args).current_dir(tempdir.path()).stdin(\"Y\");\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        Success: Account deleted\n\n        Account successfully removed\n    \"});\n\n    let contents = fs::read_to_string(tempdir.path().join(accounts_file))\n        .expect(\"Unable to read created file\");\n    let contents_json: serde_json::Value = serde_json::from_str(&contents).unwrap();\n\n    assert_eq!(contents_json, accounts_content_after_delete);\n\n    let snapbox = runner(&import_args).current_dir(tempdir.path());\n    snapbox.assert().stdout_eq(indoc! {r\"\n        Success: Account imported successfully\n\n        Account Name: account-2\n    \"});\n\n    let contents = fs::read_to_string(tempdir.path().join(accounts_file))\n        .expect(\"Unable to read created file\");\n    let contents_json: serde_json::Value = serde_json::from_str(&contents).unwrap();\n\n    assert_eq!(contents_json, all_accounts_content);\n}\n\n#[tokio::test]\npub async fn test_use_url_from_config() {\n    let temp_dir = copy_config_to_tempdir(\"tests/data/files/correct_snfoundry.toml\", None);\n    let accounts_file = \"accounts.json\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"import\",\n        \"--address\",\n        \"0x123\",\n        \"--private-key\",\n        \"0x456\",\n        \"--type\",\n        \"oz\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(temp_dir.path());\n\n    snapbox.assert().success();\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/account/list.rs",
    "content": "use anyhow::Context;\nuse indoc::formatdoc;\nuse serde_json::{Value, json};\nuse shared::test_utils::output_assert::{AsOutput, assert_stderr_contains, assert_stdout_contains};\nuse tempfile::tempdir;\n\nuse crate::{e2e::account::helpers::create_tempdir_with_accounts_file, helpers::runner::runner};\n\n#[test]\nfn test_happy_case() {\n    let accounts_file_name = \"temp_accounts.json\";\n    let temp_dir = create_tempdir_with_accounts_file(accounts_file_name, true);\n\n    let accounts_file_path = temp_dir\n        .path()\n        .canonicalize()\n        .expect(\"Unable to resolve a temporary directory path\")\n        .join(accounts_file_name);\n\n    let args = vec![\"--accounts-file\", &accounts_file_name, \"account\", \"list\"];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert!(output.as_stderr().is_empty());\n\n    let expected = formatdoc!(\n        \"\n        Available accounts (at {}):\n        - user0:\n          network: alpha-sepolia\n          public key: 0x2f91ed13f8f0f7d39b942c80bfcd3d0967809d99e0cc083606cbe59033d2b39\n          address: 0x4f5f24ceaae64434fa2bc2befd08976b51cf8f6a5d8257f7ec3616f61de263a\n          type: OpenZeppelin\n\n        - user1:\n          network: alpha-sepolia\n          public key: 0x63b3a3ac141e4c007b167b27450f110c729cc0d0238541ca705b0de5144edbd\n          address: 0x9613a934141dd6625748a7e066a380b3f9787f079f35ecc2f3ba934d507d4e\n          salt: 0xe2b200bbdf76c31b\n          type: Ready\n          class hash: 0x36078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f\n\n        - user2:\n          network: alpha-sepolia\n          public key: 0x63b3a3ac141e4c007b167b27450f110c729cc0d0238541ca705b0de5144edbd\n          address: 0x9613a934141dd6625748a7e066a380b3f9787f079f35ecc2f3ba934d507d4e\n          salt: 0xe2b200bbdf76c31b\n          type: Ready\n          class hash: 0x36078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f\n\n        - user3:\n          network: custom-network\n          public key: 0x7e52885445756b313ea16849145363ccb73fb4ab0440dbac333cf9d13de82b9\n          address: 0x7e00d496e324876bbc8531f2d9a82bf154d1a04a50218ee74cdd372f75a551a\n\n        - user4:\n          network: custom-network\n          public key: 0x43a74f86b7e204f1ba081636c9d4015e1f54f5bb03a4ae8741602a15ffbb182\n          address: 0x7ccdf182d27c7aaa2e733b94db4a3f7b28ff56336b34abf43c15e3a9edfbe91\n          salt: 0x54aa715a5cff30ccf7845ad4659eb1dac5b730c2541263c358c7e3a4c4a8064\n          deployed: true\n\n        To show private keys too, run with --display-private-keys or -p\n        \",\n        accounts_file_path.to_str().unwrap()\n    );\n\n    assert_stdout_contains(output, expected);\n}\n\n#[test]\nfn test_happy_case_with_private_keys() {\n    let accounts_file_name = \"temp_accounts.json\";\n    let temp_dir = create_tempdir_with_accounts_file(accounts_file_name, true);\n\n    let accounts_file_path = temp_dir\n        .path()\n        .canonicalize()\n        .expect(\"Unable to resolve a temporary directory path\")\n        .join(accounts_file_name);\n\n    let args = vec![\n        \"--accounts-file\",\n        &accounts_file_name,\n        \"account\",\n        \"list\",\n        \"--display-private-keys\",\n    ];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert!(output.as_stderr().is_empty());\n\n    let expected = formatdoc!(\n        \"\n        Available accounts (at {}):\n        - user0:\n          network: alpha-sepolia\n          private key: 0x1e9038bdc68ce1d27d54205256988e85\n          public key: 0x2f91ed13f8f0f7d39b942c80bfcd3d0967809d99e0cc083606cbe59033d2b39\n          address: 0x4f5f24ceaae64434fa2bc2befd08976b51cf8f6a5d8257f7ec3616f61de263a\n          type: OpenZeppelin\n\n        - user1:\n          network: alpha-sepolia\n          private key: 0x1c3495fce931c0b3ed244f55c54226441a8254deafbc7fab2e46926b4d2fdae\n          public key: 0x63b3a3ac141e4c007b167b27450f110c729cc0d0238541ca705b0de5144edbd\n          address: 0x9613a934141dd6625748a7e066a380b3f9787f079f35ecc2f3ba934d507d4e\n          salt: 0xe2b200bbdf76c31b\n          type: Ready\n\n        - user2:\n          network: alpha-sepolia\n          private key: 0x1c3495fce931c0b3ed244f55c54226441a8254deafbc7fab2e46926b4d2fdae\n          public key: 0x63b3a3ac141e4c007b167b27450f110c729cc0d0238541ca705b0de5144edbd\n          address: 0x9613a934141dd6625748a7e066a380b3f9787f079f35ecc2f3ba934d507d4e\n          salt: 0xe2b200bbdf76c31b\n          type: Ready\n\n        - user3:\n          network: custom-network\n          private key: 0xe3e70682c2094cac629f6fbed82c07cd\n          public key: 0x7e52885445756b313ea16849145363ccb73fb4ab0440dbac333cf9d13de82b9\n          address: 0x7e00d496e324876bbc8531f2d9a82bf154d1a04a50218ee74cdd372f75a551a\n\n        - user4:\n          network: custom-network\n          private key: 0x73fbb3c1eff11167598455d0408f3932e42c678bd8f7fbc6028c716867cc01f\n          public key: 0x43a74f86b7e204f1ba081636c9d4015e1f54f5bb03a4ae8741602a15ffbb182\n          address: 0x7ccdf182d27c7aaa2e733b94db4a3f7b28ff56336b34abf43c15e3a9edfbe91\n          salt: 0x54aa715a5cff30ccf7845ad4659eb1dac5b730c2541263c358c7e3a4c4a8064\n          deployed: true\n        \",\n        accounts_file_path.to_str().unwrap()\n    );\n\n    assert_stdout_contains(output, expected);\n}\n\n#[test]\nfn test_happy_case_json() {\n    let accounts_file_name = \"temp_accounts.json\";\n    let temp_dir = create_tempdir_with_accounts_file(accounts_file_name, true);\n\n    let args = vec![\n        \"--json\",\n        \"--accounts-file\",\n        &accounts_file_name,\n        \"account\",\n        \"list\",\n    ];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert!(output.as_stderr().is_empty());\n\n    let output_plain = output.as_stdout().to_string();\n    let output_parsed: Value = serde_json::from_str(&output_plain)\n        .context(\"Failed to parse command's output to JSON\")\n        .unwrap();\n\n    let expected = json!(\n        {\n            \"command\": \"account delete\",\n            \"type\": \"response\",\n            \"user3\": {\n              \"address\": \"0x7e00d496e324876bbc8531f2d9a82bf154d1a04a50218ee74cdd372f75a551a\",\n              \"public_key\": \"0x7e52885445756b313ea16849145363ccb73fb4ab0440dbac333cf9d13de82b9\",\n              \"network\": \"custom-network\"\n            },\n            \"user4\": {\n              \"public_key\": \"0x43a74f86b7e204f1ba081636c9d4015e1f54f5bb03a4ae8741602a15ffbb182\",\n              \"address\": \"0x7ccdf182d27c7aaa2e733b94db4a3f7b28ff56336b34abf43c15e3a9edfbe91\",\n              \"salt\": \"0x54aa715a5cff30ccf7845ad4659eb1dac5b730c2541263c358c7e3a4c4a8064\",\n              \"deployed\": true,\n              \"network\": \"custom-network\"\n            },\n            \"user0\": {\n              \"public_key\": \"0x2f91ed13f8f0f7d39b942c80bfcd3d0967809d99e0cc083606cbe59033d2b39\",\n              \"address\": \"0x4f5f24ceaae64434fa2bc2befd08976b51cf8f6a5d8257f7ec3616f61de263a\",\n              \"type\": \"open_zeppelin\",\n              \"network\": \"alpha-sepolia\"\n            },\n            \"user1\": {\n              \"address\": \"0x9613a934141dd6625748a7e066a380b3f9787f079f35ecc2f3ba934d507d4e\",\n              \"class_hash\": \"0x36078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f\",\n              \"public_key\": \"0x63b3a3ac141e4c007b167b27450f110c729cc0d0238541ca705b0de5144edbd\",\n              \"salt\": \"0xe2b200bbdf76c31b\",\n              \"type\": \"ready\",\n              \"network\": \"alpha-sepolia\"\n            },\n            \"user2\": {\n              \"address\": \"0x9613a934141dd6625748a7e066a380b3f9787f079f35ecc2f3ba934d507d4e\",\n              \"class_hash\": \"0x36078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f\",\n              \"public_key\": \"0x63b3a3ac141e4c007b167b27450f110c729cc0d0238541ca705b0de5144edbd\",\n              \"salt\": \"0xe2b200bbdf76c31b\",\n              \"type\": \"argent\",\n              \"network\": \"alpha-sepolia\"\n            },\n        }\n    );\n\n    assert_eq!(output_parsed, expected);\n}\n\n#[test]\nfn test_happy_case_with_private_keys_json() {\n    let accounts_file_name = \"temp_accounts.json\";\n    let temp_dir = create_tempdir_with_accounts_file(accounts_file_name, true);\n\n    let args = vec![\n        \"--json\",\n        \"--accounts-file\",\n        &accounts_file_name,\n        \"account\",\n        \"list\",\n        \"--display-private-keys\",\n    ];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert!(output.as_stderr().is_empty());\n\n    let output_plain = output.as_stdout().to_string();\n    let output_parsed: Value = serde_json::from_str(&output_plain)\n        .context(\"Failed to parse command's output to JSON\")\n        .unwrap();\n\n    let expected = json!(\n        {\n          \"command\": \"account delete\",\n          \"type\": \"response\",\n          \"user3\": {\n              \"address\": \"0x7e00d496e324876bbc8531f2d9a82bf154d1a04a50218ee74cdd372f75a551a\",\n              \"private_key\": \"0xe3e70682c2094cac629f6fbed82c07cd\",\n              \"public_key\": \"0x7e52885445756b313ea16849145363ccb73fb4ab0440dbac333cf9d13de82b9\",\n              \"network\": \"custom-network\"\n          },\n          \"user4\": {\n            \"public_key\": \"0x43a74f86b7e204f1ba081636c9d4015e1f54f5bb03a4ae8741602a15ffbb182\",\n            \"address\": \"0x7ccdf182d27c7aaa2e733b94db4a3f7b28ff56336b34abf43c15e3a9edfbe91\",\n            \"salt\": \"0x54aa715a5cff30ccf7845ad4659eb1dac5b730c2541263c358c7e3a4c4a8064\",\n            \"private_key\": \"0x73fbb3c1eff11167598455d0408f3932e42c678bd8f7fbc6028c716867cc01f\",\n            \"deployed\": true,\n            \"network\": \"custom-network\"\n          },\n          \"user0\": {\n            \"public_key\": \"0x2f91ed13f8f0f7d39b942c80bfcd3d0967809d99e0cc083606cbe59033d2b39\",\n            \"address\": \"0x4f5f24ceaae64434fa2bc2befd08976b51cf8f6a5d8257f7ec3616f61de263a\",\n            \"type\": \"open_zeppelin\",\n            \"network\": \"alpha-sepolia\",\n            \"private_key\": \"0x1e9038bdc68ce1d27d54205256988e85\",\n          },\n          \"user1\": {\n            \"address\": \"0x9613a934141dd6625748a7e066a380b3f9787f079f35ecc2f3ba934d507d4e\",\n            \"class_hash\": \"0x36078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f\",\n            \"private_key\": \"0x1c3495fce931c0b3ed244f55c54226441a8254deafbc7fab2e46926b4d2fdae\",\n            \"public_key\": \"0x63b3a3ac141e4c007b167b27450f110c729cc0d0238541ca705b0de5144edbd\",\n            \"salt\": \"0xe2b200bbdf76c31b\",\n            \"type\": \"ready\",\n            \"network\": \"alpha-sepolia\",\n          },\n          \"user2\": {\n            \"address\": \"0x9613a934141dd6625748a7e066a380b3f9787f079f35ecc2f3ba934d507d4e\",\n            \"class_hash\": \"0x36078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f\",\n            \"private_key\": \"0x1c3495fce931c0b3ed244f55c54226441a8254deafbc7fab2e46926b4d2fdae\",\n            \"public_key\": \"0x63b3a3ac141e4c007b167b27450f110c729cc0d0238541ca705b0de5144edbd\",\n            \"salt\": \"0xe2b200bbdf76c31b\",\n            \"type\": \"argent\",\n            \"network\": \"alpha-sepolia\",\n          },\n        }\n    );\n\n    assert_eq!(output_parsed, expected);\n}\n\n#[test]\nfn test_accounts_file_does_not_exist() {\n    let accounts_file_name = \"some_inexistent_file.json\";\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n\n    let args = vec![\"--accounts-file\", &accounts_file_name, \"account\", \"list\"];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().failure();\n\n    assert!(output.as_stdout().is_empty());\n\n    let expected = \"Error: Accounts file = some_inexistent_file.json does not exist! \\\n        If you do not have an account create one with `account create` command \\\n        or if you're using a custom accounts file, make sure \\\n        to supply correct path to it with `--accounts-file` argument.\";\n\n    assert_stderr_contains(output, expected);\n}\n\n#[test]\nfn test_no_accounts_available() {\n    let accounts_file_name = \"temp_accounts.json\";\n    let temp_dir = create_tempdir_with_accounts_file(accounts_file_name, false);\n\n    let accounts_file_path = temp_dir\n        .path()\n        .canonicalize()\n        .expect(\"Unable to resolve a temporary directory path\")\n        .join(accounts_file_name);\n\n    let args = vec![\"--accounts-file\", &accounts_file_name, \"account\", \"list\"];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert!(output.as_stderr().is_empty());\n    assert_stdout_contains(\n        output,\n        format!(\n            \"No accounts available at {}\",\n            accounts_file_path.to_str().unwrap()\n        ),\n    );\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/account/mod.rs",
    "content": "mod create;\nmod delete;\nmod deploy;\nmod helpers;\nmod import;\nmod list;\n\npub use deploy::create_account;\n"
  },
  {
    "path": "crates/sncast/tests/e2e/balance.rs",
    "content": "use crate::helpers::constants::URL;\nuse crate::helpers::fixtures::get_accounts_path;\nuse crate::helpers::runner::runner;\nuse indoc::{formatdoc, indoc};\nuse shared::test_utils::output_assert::AsOutput;\nuse sncast::helpers::token::Token;\nuse tempfile::tempdir;\nuse test_case::test_case;\n\n#[tokio::test]\npub async fn happy_case() {\n    let tempdir = tempdir().unwrap();\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"balance-test\",\n        \"get\",\n        \"balance\",\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().stdout_eq(indoc! {r\"\n        Balance: 109394843313476728397 fri\n    \"});\n}\n\n#[tokio::test]\npub async fn happy_case_old_command() {\n    let tempdir = tempdir().unwrap();\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"balance-test\",\n        \"balance\",\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().stdout_eq(indoc! {r\"\n        [WARNING] `sncast balance` has moved to `sncast get balance`. `sncast balance` will be removed in the next version.\n\n        Balance: 109394843313476728397 fri\n    \"});\n}\n\n#[tokio::test]\npub async fn happy_case_json() {\n    let tempdir = tempdir().unwrap();\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let args = vec![\n        \"--json\",\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user1\",\n        \"get\",\n        \"balance\",\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().stdout_eq(indoc! {r#\"\n        {\"balance\":\"[..]\",\"command\":\"get balance\",\"token_unit\":\"fri\",\"type\":\"response\"}\n    \"#});\n}\n\n#[test_case(&Token::Strk)]\n#[test_case(&Token::Eth)]\n#[tokio::test]\npub async fn happy_case_with_token(token: &Token) {\n    let tempdir = tempdir().unwrap();\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let token_unit = token.as_token_unit();\n    let token = token.to_string();\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user1\",\n        \"get\",\n        \"balance\",\n        \"--token\",\n        &token,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().stdout_eq(formatdoc! {r\"\n        Balance: [..] {token_unit}\n    \"});\n}\n\n#[tokio::test]\npub async fn happy_case_with_block_id() {\n    let tempdir = tempdir().unwrap();\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user1\",\n        \"get\",\n        \"balance\",\n        \"--block-id\",\n        \"latest\",\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().stdout_eq(indoc! {r\"\n        Balance: [..] fri\n    \"});\n}\n\n#[tokio::test]\npub async fn invalid_token() {\n    let tempdir = tempdir().unwrap();\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user1\",\n        \"get\",\n        \"balance\",\n        \"--token\",\n        \"xyz\",\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().stderr_eq(indoc! {r\"\n        error: invalid value 'xyz' for '--token <TOKEN>'\n          [possible values: strk, eth]\n\n        For more information, try '--help'.\n    \"});\n}\n\n#[tokio::test]\npub async fn happy_case_with_token_address() {\n    let tempdir = tempdir().unwrap();\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let strk_address = \"0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user1\",\n        \"get\",\n        \"balance\",\n        \"--token-address\",\n        strk_address,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().stdout_eq(indoc! {r\"\n        Balance: [..]\n    \"});\n}\n\n#[tokio::test]\npub async fn happy_case_json_with_token_address() {\n    let tempdir = tempdir().unwrap();\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let args = vec![\n        \"--json\",\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user1\",\n        \"get\",\n        \"balance\",\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n    let balance_str = std::str::from_utf8(&output.get_output().stdout).unwrap();\n\n    assert!(!balance_str.contains(\"0x\"));\n\n    output.stdout_eq(indoc! {r#\"\n        {\"balance\":\"[..]\"}\n    \"#});\n}\n\n#[tokio::test]\npub async fn nonexistent_token_address() {\n    let tempdir = tempdir().unwrap();\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user1\",\n        \"get\",\n        \"balance\",\n        \"--token-address\",\n        \"0x123\",\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    let snapbox = snapbox.assert().failure();\n    let err = snapbox.as_stderr();\n    assert!(err.contains(\"Error: There is no contract at the specified address\"));\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/call.rs",
    "content": "use crate::helpers::constants::{\n    ACCOUNT_FILE_PATH, DATA_TRANSFORMER_CONTRACT_ADDRESS_SEPOLIA, MAP_CONTRACT_ADDRESS_SEPOLIA, URL,\n};\nuse crate::helpers::fixtures::invoke_contract;\nuse crate::helpers::runner::runner;\nuse crate::helpers::shell::os_specific_shell;\nuse camino::Utf8PathBuf;\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stderr_contains;\nuse snapbox::cargo_bin;\nuse sncast::helpers::fee::FeeSettings;\n\n#[test]\nfn test_happy_case() {\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"call\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"get\",\n        \"--calldata\",\n        \"0x0\",\n        \"--block-id\",\n        \"latest\",\n    ];\n\n    let snapbox = runner(&args);\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        Success: Call completed\n\n        Response:     0x0\n        Response Raw: [0x0]\n    \"});\n}\n\n#[test]\nfn test_happy_case_cairo_expression_calldata() {\n    let args = vec![\n        \"call\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"put\",\n        \"--arguments\",\n        \"0x0_felt252, 0x2137\",\n        \"--block-id\",\n        \"latest\",\n    ];\n\n    let snapbox = runner(&args);\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        Success: Call completed\n        \n        Response: []\n    \"});\n}\n\n#[tokio::test]\nasync fn test_call_after_storage_changed() {\n    let fee_settings = FeeSettings {\n        l1_gas: Some(100_000),\n        l1_gas_price: Some(10_000_000_000_000),\n        l2_gas: Some(1_000_000_000),\n        l2_gas_price: Some(100_000_000_000_000_000),\n        l1_data_gas: Some(100_000),\n        l1_data_gas_price: Some(10_000_000_000_000),\n        tip: Some(100_000),\n    };\n    invoke_contract(\n        \"user2\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"put\",\n        fee_settings,\n        &[\"0x2\", \"0x3\"],\n    )\n    .await;\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"call\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"get\",\n        \"--calldata\",\n        \"0x2\",\n    ];\n\n    let snapbox = runner(&args);\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        Success: Call completed\n\n        Response:     0x3\n        Response Raw: [0x3]\n    \"});\n}\n\n#[tokio::test]\nasync fn test_contract_does_not_exist() {\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"call\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        \"0x1\",\n        \"--function\",\n        \"get\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        \"Error: An error occurred in the called contract[..]Requested contract address[..]is not deployed[..]\",\n    );\n}\n\n#[test]\nfn test_wrong_function_name() {\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"call\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"nonexistent_get\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        r#\"Error: Function with selector \"0x2924aec1f107eca35a5dc447cee68cc6985fe404841c9aad477adfcbe596d0a\" not found in ABI of the contract\"#,\n    );\n}\n\n#[test]\nfn test_wrong_calldata() {\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"call\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--calldata\",\n        \"0x1\",\n        \"0x2\",\n        \"--function\",\n        \"get\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().success();\n\n    // TODO(#3107)\n    // 0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473 is \"Input too long for arguments\"\n    assert_stderr_contains(\n        output,\n        indoc! {r#\"\n        Command: call\n        Error: An error occurred in the called contract = [..] error: Message(\"[\\\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\\\"]\") }) }\n        \"#},\n    );\n}\n\n#[tokio::test]\nasync fn test_invalid_selector() {\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"call\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"ą\",\n        \"--calldata\",\n        \"0x1 0x2\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Error: Failed to convert entry point selector to FieldElement\n\n        Caused by:\n            the provided name contains non-ASCII characters\n  \"},\n    );\n}\n\n#[test]\nfn test_wrong_block_id() {\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"call\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"get\",\n        \"--calldata\",\n        \"0x0\",\n        \"--block-id\",\n        \"0x10101\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: call\n        Error: Block was not found\n        \"},\n    );\n}\n\n#[test]\nfn test_happy_case_shell() {\n    let binary_path = cargo_bin!(\"sncast\");\n    let command = os_specific_shell(&Utf8PathBuf::from(\"tests/shell/call\"));\n\n    let snapbox = command\n        .arg(binary_path)\n        .arg(URL)\n        .arg(DATA_TRANSFORMER_CONTRACT_ADDRESS_SEPOLIA);\n    snapbox.assert().success();\n}\n\n#[test]\nfn test_leading_negative_values() {\n    let binary_path = cargo_bin!(\"sncast\");\n    let command = os_specific_shell(&Utf8PathBuf::from(\"tests/shell/call_unsigned\"));\n\n    let snapbox = command\n        .arg(binary_path)\n        .arg(URL)\n        .arg(DATA_TRANSFORMER_CONTRACT_ADDRESS_SEPOLIA);\n    snapbox.assert().success();\n}\n\n#[test]\nfn test_json_output_format() {\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"--json\",\n        \"call\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"get\",\n        \"--calldata\",\n        \"0x0\",\n        \"--block-id\",\n        \"latest\",\n    ];\n\n    let snapbox = runner(&args);\n\n    snapbox.assert().success().stdout_eq(indoc! {r#\"\n        {\"command\":\"call\",\"response\":\"0x0\",\"response_raw\":[\"0x0\"],\"type\":\"response\"}\n    \"#});\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/class_hash.rs",
    "content": "use crate::helpers::{\n    constants::CONTRACTS_DIR, fixtures::duplicate_contract_directory_with_salt, runner::runner,\n};\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stdout_contains;\n\n#[test]\nfn test_happy_case_get_class_hash() {\n    let contract_path = duplicate_contract_directory_with_salt(\n        CONTRACTS_DIR.to_string() + \"/map\",\n        \"put\",\n        \"human_readable\",\n    );\n\n    let args = vec![\"utils\", \"class-hash\", \"--contract-name\", \"Map\"];\n\n    let snapbox = runner(&args).current_dir(contract_path.path());\n\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(output, indoc! {r\"Class Hash: 0x0[..]\"});\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/class_hash_at.rs",
    "content": "use crate::helpers::constants::{\n    DEVNET_PREDEPLOYED_ACCOUNT_ADDRESS, MAP_CONTRACT_ADDRESS_SEPOLIA, URL,\n};\nuse crate::helpers::runner::runner;\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stderr_contains;\n\n#[tokio::test]\nasync fn test_happy_case() {\n    let args = vec![\n        \"get\",\n        \"class-hash-at\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--url\",\n        URL,\n    ];\n    let snapbox = runner(&args).env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\");\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        Success: Class hash retrieved\n\n        Class Hash: 0x02a09379665a749e609b4a8459c86fe954566a6beeaddd0950e43f6c700ed321\n\n        To see class details, visit:\n        class: https://sepolia.voyager.online/class/0x02a09379665a749e609b4a8459c86fe954566a6beeaddd0950e43f6c700ed321\n    \"});\n}\n\n#[tokio::test]\nasync fn test_with_block_id() {\n    let args = vec![\n        \"get\",\n        \"class-hash-at\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--block-id\",\n        \"latest\",\n        \"--url\",\n        URL,\n    ];\n    let snapbox = runner(&args);\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        Success: Class hash retrieved\n\n        Class Hash: 0x02a09379665a749e609b4a8459c86fe954566a6beeaddd0950e43f6c700ed321\n    \"});\n}\n\n#[tokio::test]\nasync fn test_json_output() {\n    let args = vec![\n        \"--json\",\n        \"get\",\n        \"class-hash-at\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--url\",\n        URL,\n    ];\n    let snapbox = runner(&args);\n    let output = snapbox.assert().success();\n    let stdout = output.get_output().stdout.clone();\n\n    let json: serde_json::Value = serde_json::from_slice(&stdout).unwrap();\n    assert_eq!(json[\"command\"], \"get class-hash-at\");\n    assert_eq!(json[\"type\"], \"response\");\n    assert_eq!(\n        json[\"class_hash\"],\n        \"0x02a09379665a749e609b4a8459c86fe954566a6beeaddd0950e43f6c700ed321\"\n    );\n}\n\n#[tokio::test]\nasync fn test_nonexistent_contract_address() {\n    let args = vec![\"get\", \"class-hash-at\", \"0x0\", \"--url\", URL];\n    let snapbox = runner(&args);\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: get class-hash-at\n        Error: There is no contract at the specified address\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_invalid_block_id() {\n    let args = vec![\n        \"get\",\n        \"class-hash-at\",\n        DEVNET_PREDEPLOYED_ACCOUNT_ADDRESS,\n        \"--block-id\",\n        \"invalid_block\",\n        \"--url\",\n        URL,\n    ];\n    let snapbox = runner(&args);\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: get class-hash-at\n        Error: Incorrect value passed for block_id = invalid_block. Possible values are `pre_confirmed`, `latest`, block hash (hex) and block number (u64)\n        \"},\n    );\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/completions.rs",
    "content": "use crate::helpers::runner::runner;\nuse clap::ValueEnum;\nuse clap_complete::Shell;\nuse indoc::formatdoc;\nuse shared::test_utils::output_assert::assert_stderr_contains;\n\n#[test]\nfn test_happy_case() {\n    for variant in Shell::value_variants() {\n        let shell = variant.to_string();\n        let args = vec![\"completions\", shell.as_str()];\n\n        let snapbox = runner(&args);\n\n        snapbox.assert().success();\n    }\n}\n\n#[test]\nfn test_generate_completions_unsupported_shell() {\n    // SAFETY: Tests run in parallel and share the same environment variables.\n    // However, this modification is applies only to this one test.\n    unsafe {\n        std::env::set_var(\"SHELL\", \"/bin/unsupported\");\n    }\n    let args = vec![\"completions\"];\n\n    let snapbox = runner(&args);\n\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        formatdoc!(\n            r\"\n            Error: Unsupported shell\n            \"\n        ),\n    );\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/declare.rs",
    "content": "use crate::helpers::constants::{CONTRACTS_DIR, DEVNET_OZ_CLASS_HASH_CAIRO_0, URL};\nuse crate::helpers::fixtures::{\n    copy_directory_to_tempdir, create_and_deploy_account, create_and_deploy_oz_account,\n    duplicate_contract_directory_with_salt, get_accounts_path, get_transaction_by_hash,\n    get_transaction_hash, get_transaction_receipt, join_tempdirs,\n};\nuse crate::helpers::runner::runner;\nuse configuration::CONFIG_FILENAME;\nuse indoc::indoc;\nuse shared::test_utils::output_assert::{AsOutput, assert_stderr_contains, assert_stdout_contains};\nuse sncast::AccountType;\nuse sncast::helpers::constants::{BRAAVOS_CLASS_HASH, OZ_CLASS_HASH, READY_CLASS_HASH};\nuse sncast::helpers::fee::FeeArgs;\nuse starknet_rust::core::types::TransactionReceipt::Declare;\nuse starknet_rust::core::types::{DeclareTransaction, Transaction, TransactionExecutionStatus};\nuse starknet_types_core::felt::{Felt, NonZeroFelt};\nuse std::fs;\nuse test_case::test_case;\n\n#[tokio::test]\nasync fn test_happy_case_human_readable() {\n    let contract_path = duplicate_contract_directory_with_salt(\n        CONTRACTS_DIR.to_string() + \"/map\",\n        \"put\",\n        \"human_readable\",\n    );\n    let tempdir = create_and_deploy_oz_account().await;\n    join_tempdirs(&contract_path, &tempdir);\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"Map\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        Success: Declaration completed\n\n        Class Hash:       0x[..]\n        Transaction Hash: 0x[..]\n        \n        To see declaration details, visit:\n        class: https://[..]\n        transaction: https://[..]\n\n        To deploy a contract of this class, run:\n        sncast --accounts-file accounts.json --account my_account deploy --class-hash 0x[..] --url http://127.0.0.1:5055/rpc\n    \" },\n    );\n}\n\n#[tokio::test]\nasync fn test_happy_case_json_output() {\n    let contract_path = duplicate_contract_directory_with_salt(\n        CONTRACTS_DIR.to_string() + \"/map\",\n        \"put\",\n        \"test_happy_case_json_output\",\n    );\n    let tempdir = create_and_deploy_oz_account().await;\n    join_tempdirs(&contract_path, &tempdir);\n\n    let args = vec![\n        \"--json\",\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"Map\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(tempdir.path());\n\n    snapbox.assert().success().stdout_eq(indoc! {\n        r#\"\n{\"status\":\"compiling\",\"message\":\"[..]\"}\n{\"type\":\"warn\",\"message\":\"[..]\"}\n{\"type\":\"warn\",\"message\":\"[..]\"}\n{\"status\":\"compiling\",\"message\":\"[..]\"}\n{\"status\":\"finished\",\"message\":\"[..]\"}\n{\"class_hash\":\"0x0[..]\",\"command\":\"declare\",\"transaction_hash\":\"0x0[..]\",\"type\":\"response\"}\n{\"links\":\"class: https://sepolia.voyager.online/class/0x0[..]/ntransaction: https://sepolia.voyager.online/tx/0x0[..]/n\",\"title\":\"declaration\",\"type\":\"notification\"}\n\"#,\n    });\n}\n\n#[test_case(DEVNET_OZ_CLASS_HASH_CAIRO_0.parse().unwrap(), AccountType::OpenZeppelin; \"cairo_0_class_hash\"\n)]\n#[test_case(OZ_CLASS_HASH, AccountType::OpenZeppelin; \"cairo_1_class_hash\")]\n#[test_case(READY_CLASS_HASH, AccountType::Ready; \"READY_CLASS_HASH\")]\n#[test_case(BRAAVOS_CLASS_HASH, AccountType::Braavos; \"braavos_class_hash\")]\n#[tokio::test]\nasync fn test_happy_case(class_hash: Felt, account_type: AccountType) {\n    let contract_path = duplicate_contract_directory_with_salt(\n        CONTRACTS_DIR.to_string() + \"/map\",\n        \"put\",\n        &class_hash.to_string(),\n    );\n    let tempdir = create_and_deploy_account(class_hash, account_type).await;\n    join_tempdirs(&contract_path, &tempdir);\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"--json\",\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"Map\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success().get_output().stdout.clone();\n\n    let hash = get_transaction_hash(&output);\n    let receipt = get_transaction_receipt(hash).await;\n\n    assert!(matches!(receipt, Declare(_)));\n}\n\n#[tokio::test]\nasync fn test_contract_with_constructor_params() {\n    let contract_path = duplicate_contract_directory_with_salt(\n        CONTRACTS_DIR.to_string() + \"/contract_with_constructor_params\",\n        \"put\",\n        \"human_readable\",\n    );\n    let tempdir = create_and_deploy_oz_account().await;\n    join_tempdirs(&contract_path, &tempdir);\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"ContractWithConstructorParams\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        Success: Declaration completed\n\n        Class Hash:       0x[..]\n        Transaction Hash: 0x[..]\n        \n        To see declaration details, visit:\n        class: https://[..]\n        transaction: https://[..]\n\n        To deploy a contract of this class, replace the placeholders in `--arguments` with your actual values, then run:\n        sncast --accounts-file accounts.json --account my_account deploy --class-hash 0x[..] --arguments '<foo: felt252>, <bar: felt252>' --url http://127.0.0.1:5055/rpc\n    \" },\n    );\n}\n\n#[test_case(FeeArgs{\n    max_fee: Some(NonZeroFelt::try_from(Felt::from(1_000_000_000_000_000_000_000_000_u128)).unwrap()),\n    l1_data_gas: None,\n    l1_data_gas_price:  None,\n    l1_gas:  None,\n    l1_gas_price:  None,\n    l2_gas:  None,\n    l2_gas_price:  None,\n    tip: Some(100_000),\n    estimate_tip: false,\n}; \"max_fee\")]\n#[test_case(FeeArgs{\n    max_fee: None,\n    l1_data_gas: Some(100_000),\n    l1_data_gas_price: Some(10_000_000_000_000),\n    l1_gas: Some(100_000),\n    l1_gas_price: Some(10_000_000_000_000),\n    l2_gas: Some(1_000_000_000),\n    l2_gas_price: Some(100_000_000_000_000_000_000),\n    tip: None,\n    estimate_tip: false,\n}; \"resource_bounds\")]\n#[tokio::test]\nasync fn test_happy_case_different_fees(fee_args: FeeArgs) {\n    let contract_path = duplicate_contract_directory_with_salt(\n        CONTRACTS_DIR.to_string() + \"/map\",\n        \"put\",\n        &format!(\n            \"{}{}{}{}{}{}{}\",\n            fee_args.max_fee.map_or(Felt::from(0), Felt::from),\n            fee_args.l1_data_gas.unwrap_or(1),\n            fee_args.l1_data_gas_price.unwrap_or(2),\n            fee_args.l1_gas.unwrap_or(3),\n            fee_args.l1_gas_price.unwrap_or(4),\n            fee_args.l2_gas.unwrap_or(5),\n            fee_args.l2_gas_price.unwrap_or(6)\n        ),\n    );\n    let tempdir = create_and_deploy_oz_account().await;\n    join_tempdirs(&contract_path, &tempdir);\n    let mut args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"--json\",\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"Map\",\n    ];\n\n    let options = [\n        (\n            \"--max-fee\",\n            fee_args.max_fee.map(Felt::from).map(|x| x.to_string()),\n        ),\n        (\"--l1-data-gas\", fee_args.l1_data_gas.map(|x| x.to_string())),\n        (\n            \"--l1-data-gas-price\",\n            fee_args.l1_data_gas_price.map(|x| x.to_string()),\n        ),\n        (\"--l1-gas\", fee_args.l1_gas.map(|x| x.to_string())),\n        (\n            \"--l1-gas-price\",\n            fee_args.l1_gas_price.map(|x| x.to_string()),\n        ),\n        (\"--l2-gas\", fee_args.l2_gas.map(|x| x.to_string())),\n        (\n            \"--l2-gas-price\",\n            fee_args.l2_gas_price.map(|x| x.to_string()),\n        ),\n        (\"--tip\", fee_args.tip.map(|x| x.to_string())),\n    ];\n\n    for &(key, ref value) in &options {\n        if let Some(val) = value.as_ref() {\n            args.push(key);\n            args.push(val);\n        }\n    }\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success().get_output().stdout.clone();\n\n    let hash = get_transaction_hash(&output);\n    let Declare(receipt) = get_transaction_receipt(hash).await else {\n        panic!(\"Should be Declare receipt\");\n    };\n    assert_eq!(\n        receipt.execution_result.status(),\n        TransactionExecutionStatus::Succeeded\n    );\n\n    let Transaction::Declare(DeclareTransaction::V3(tx)) = get_transaction_by_hash(hash).await\n    else {\n        panic!(\"Expected Declare V3 transaction\")\n    };\n    assert_eq!(tx.tip, fee_args.tip.unwrap_or(0));\n}\n\n#[tokio::test]\nasync fn test_happy_case_specify_package() {\n    let tempdir = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/multiple_packages\");\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user8\",\n        \"--json\",\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"supercomplexcode\",\n        \"--package\",\n        \"main_workspace\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    let output = snapbox.assert().success().get_output().stdout.clone();\n\n    let hash = get_transaction_hash(&output);\n    let receipt = get_transaction_receipt(hash).await;\n\n    assert!(matches!(receipt, Declare(_)));\n}\n\n#[tokio::test]\nasync fn test_contract_already_declared() {\n    let tempdir = duplicate_contract_directory_with_salt(\n        CONTRACTS_DIR.to_string() + \"/map\",\n        \"put\",\n        \"8512851\",\n    );\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user1\",\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"Map\",\n    ];\n\n    runner(&args).current_dir(tempdir.path()).assert().success();\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: declare\n        Error: Contract with class hash 0x0[..] is already declared\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_contract_already_declared_estimate_fee() {\n    let contract_path = duplicate_contract_directory_with_salt(\n        CONTRACTS_DIR.to_string() + \"/map\",\n        \"put\",\n        \"74362345\",\n    );\n    let tempdir = create_and_deploy_oz_account().await;\n    join_tempdirs(&contract_path, &tempdir);\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"Map\",\n    ];\n    // Commented out because we explicitly do not want to set any resource bounds.\n    // Transaction has to go through estimate fee endpoint first because it throws different errors\n    // than the normal declare endpoint and we want to test them.\n\n    runner(&args).current_dir(tempdir.path()).assert().success();\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: declare\n        Error: Contract with class hash 0x0[..] is already declared\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_invalid_nonce() {\n    let contract_path =\n        duplicate_contract_directory_with_salt(CONTRACTS_DIR.to_string() + \"/map\", \"put\", \"1123\");\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user8\",\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"Map\",\n        \"--nonce\",\n        \"12345\",\n    ];\n\n    let snapbox = runner(&args).current_dir(contract_path.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r#\"\n        Command: declare\n        Error: Transaction execution error = TransactionExecutionErrorData { transaction_index: 0, execution_error: Message(\"Account transaction nonce is invalid.\") }\n        \"#},\n    );\n}\n\n#[tokio::test]\nasync fn test_wrong_contract_name_passed() {\n    let tempdir = duplicate_contract_directory_with_salt(\n        CONTRACTS_DIR.to_string() + \"/map\",\n        \"put\",\n        \"521754725\",\n    );\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user1\",\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"nonexistent\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: declare\n        Error: Failed to find nonexistent artifact in starknet_artifacts.json file[..]\n        \"},\n    );\n}\n\n#[test]\nfn test_scarb_build_fails_when_wrong_cairo_path() {\n    let tempdir = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/build_fails\");\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user1\",\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"BuildFails\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().failure();\n    assert_stderr_contains(\n        output,\n        \"Failed to build contract: Failed to build using scarb; `scarb` exited with error\",\n    );\n}\n\n#[should_panic(expected = \"Path to Scarb.toml manifest does not exist\")]\n#[test]\nfn test_scarb_build_fails_scarb_toml_does_not_exist() {\n    let tempdir = copy_directory_to_tempdir(CONTRACTS_DIR);\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user1\",\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"BuildFails\",\n    ];\n\n    runner(&args).current_dir(tempdir.path()).assert().success();\n}\n\n#[test]\nfn test_scarb_build_fails_manifest_does_not_exist() {\n    let tempdir = copy_directory_to_tempdir(CONTRACTS_DIR);\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user1\",\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"BuildFails\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Error: Path to Scarb.toml manifest does not exist =[..]\n        \"},\n    );\n}\n\n#[test]\nfn test_too_low_gas() {\n    let contract_path = duplicate_contract_directory_with_salt(\n        CONTRACTS_DIR.to_string() + \"/map\",\n        \"put\",\n        \"2451825\",\n    );\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user6\",\n        \"--wait\",\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"Map\",\n        \"--l1-gas\",\n        \"1\",\n        \"--l2-gas\",\n        \"1\",\n        \"--l1-data-gas\",\n        \"1\",\n    ];\n\n    let snapbox = runner(&args).current_dir(contract_path.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: declare\n        Error: The transaction's resources don't cover validation or the minimal transaction fee\n        \"},\n    );\n}\n\n#[should_panic(expected = \"Make sure you have enabled sierra code generation in Scarb.toml\")]\n#[test]\nfn test_scarb_no_sierra_artifact() {\n    let tempdir = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/no_sierra\");\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user1\",\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"minimal_contract\",\n    ];\n\n    runner(&args).current_dir(tempdir.path()).assert().success();\n}\n\n#[test]\nfn test_scarb_no_casm_artifact() {\n    let tempdir = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/no_casm\");\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user1\",\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"minimal_contract\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        Success: Declaration completed\n\n        Class Hash: [..]\n        Transaction Hash: [..]\n\n        To deploy a contract of this class, run:\n        sncast --accounts-file [..]accounts.json --account user1 deploy --class-hash 0x[..] --url http://127.0.0.1:5055/rpc\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_many_packages_default() {\n    let tempdir = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/multiple_packages\");\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user8\",\n        \"--json\",\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"supercomplexcode2\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        \"Error: More than one package found in scarb metadata - specify package using --package flag\",\n    );\n}\n\n#[tokio::test]\nasync fn test_workspaces_package_specified_virtual_fibonacci() {\n    let tempdir = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/virtual_workspace\");\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user8\",\n        \"--json\",\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--package\",\n        \"cast_fibonacci\",\n        \"--contract-name\",\n        \"FibonacciContract\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(tempdir.path());\n\n    let output = snapbox.assert().success().get_output().clone();\n    let output = output.stdout.clone();\n    let hash = get_transaction_hash(&output);\n    let receipt = get_transaction_receipt(hash).await;\n    assert!(matches!(receipt, Declare(_)));\n}\n\n#[tokio::test]\nasync fn test_workspaces_package_no_contract() {\n    let tempdir = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/virtual_workspace\");\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user8\",\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--package\",\n        \"cast_addition\",\n        \"--contract-name\",\n        \"whatever\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: declare\n        Error: Failed to find whatever artifact in starknet_artifacts.json file[..]\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_no_scarb_profile() {\n    let contract_path =\n        duplicate_contract_directory_with_salt(CONTRACTS_DIR.to_string() + \"/map\", \"put\", \"694215\");\n    fs::copy(\n        \"tests/data/files/correct_snfoundry.toml\",\n        contract_path.path().join(CONFIG_FILENAME),\n    )\n    .expect(\"Failed to copy config file to temp dir\");\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--profile\",\n        \"profile5\",\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"Map\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(contract_path.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {\"\n            [..]\n            [WARNING] Profile profile5 does not exist in scarb, using 'release' profile.\n            Success: Declaration completed\n\n            Class Hash:       [..]\n            Transaction Hash: [..]\n\n            To see declaration details, visit:\n            class: [..]\n            transaction: [..]\n\n            To deploy a contract of this class, run:\n            sncast --accounts-file [..]accounts.json --account user8 deploy --class-hash 0x[..] --url http://127.0.0.1:5055/rpc\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_no_explorer_links_on_localhost() {\n    let contract_path = duplicate_contract_directory_with_salt(\n        CONTRACTS_DIR.to_string() + \"/map\",\n        \"put\",\n        \"localhost_test\",\n    );\n    let tempdir = create_and_deploy_oz_account().await;\n    join_tempdirs(&contract_path, &tempdir);\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"declare\",\n        \"--url\",\n        \"http://localhost:5055/rpc\",\n        \"--contract-name\",\n        \"Map\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert!(\n        !output\n            .as_stdout()\n            .contains(\"To see declaration details, visit:\")\n    );\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/declare_from.rs",
    "content": "use crate::helpers::constants::{\n    CONTRACTS_DIR, MAP_CONTRACT_CLASS_HASH_SEPOLIA, SEPOLIA_RPC_URL, URL,\n};\nuse crate::helpers::fixtures::{\n    create_and_deploy_oz_account, duplicate_contract_directory_with_salt, get_accounts_path,\n    join_tempdirs,\n};\nuse crate::helpers::runner::runner;\nuse indoc::indoc;\nuse scarb_api::ScarbCommand;\nuse shared::test_utils::output_assert::{assert_stderr_contains, assert_stdout_contains};\nuse std::fs;\nuse std::process::Stdio;\nuse tempfile::tempdir;\n\n#[tokio::test]\nasync fn test_happy_case() {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let example_contract_class_hash_sepolia =\n        \"0x66802613e2cd02ea21430a56181d9ee83c54d4ccdc45efa497d41fe1dc55a0e\";\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user1\",\n        \"declare-from\",\n        \"--class-hash\",\n        example_contract_class_hash_sepolia,\n        \"--source-url\",\n        SEPOLIA_RPC_URL,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(temp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        Success: Declaration completed\n\n        Class Hash:       0x66802613e2cd02ea21430a56181d9ee83c54d4ccdc45efa497d41fe1dc55a0e\n        Transaction Hash: 0x[..]\n        \n        To see declaration details, visit:\n        class: https://[..]\n        transaction: https://[..]\n    \" },\n    );\n}\n\n#[tokio::test]\nasync fn test_happy_case_with_block_id() {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let example_b_contract_class_hash_sepolia =\n        \"0x3de1a95e27b385c882c79355ca415915989e71f67c0f6f8ce146d4bcee7163c\";\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user2\",\n        \"declare-from\",\n        \"--class-hash\",\n        example_b_contract_class_hash_sepolia,\n        \"--source-url\",\n        SEPOLIA_RPC_URL,\n        \"--url\",\n        URL,\n        \"--block-id\",\n        \"latest\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(temp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        Success: Declaration completed\n\n        Class Hash:       0x3de1a95e27b385c882c79355ca415915989e71f67c0f6f8ce146d4bcee7163c\n        Transaction Hash: 0x[..]\n        \n        To see declaration details, visit:\n        class: https://[..]\n        transaction: https://[..]\n    \" },\n    );\n}\n\n#[tokio::test]\nasync fn test_contract_already_declared() {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user3\",\n        \"declare-from\",\n        \"--class-hash\",\n        MAP_CONTRACT_CLASS_HASH_SEPOLIA,\n        \"--source-url\",\n        SEPOLIA_RPC_URL,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: declare-from\n        Error: Contract with class hash 0x0[..] is already declared\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_class_hash_does_not_exist_on_source_network() {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user1\",\n        \"declare-from\",\n        \"--class-hash\",\n        \"0x1\",\n        \"--source-url\",\n        SEPOLIA_RPC_URL,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: declare-from\n        Error: Provided class hash does not exist\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_source_rpc_args_not_passed() {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user1\",\n        \"declare-from\",\n        \"--class-hash\",\n        \"0x1\",\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Error: Either `--source-network` or `--source-url` must be provided\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_invalid_block_id() {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user1\",\n        \"declare-from\",\n        \"--class-hash\",\n        \"0x1\",\n        \"--url\",\n        URL,\n        \"--block-id\",\n        \"0x10101\",\n    ];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Error: Either `--source-network` or `--source-url` must be provided\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_declare_from_sierra_happy_case() {\n    let contract_path = duplicate_contract_directory_with_salt(\n        CONTRACTS_DIR.to_string() + \"/map\",\n        \"put\",\n        \"declare_from_file_happy\",\n    );\n\n    let tempdir = create_and_deploy_oz_account().await;\n    join_tempdirs(&contract_path, &tempdir);\n\n    let build_output = ScarbCommand::new()\n        .arg(\"build\")\n        .current_dir(tempdir.path())\n        .command()\n        .stderr(Stdio::inherit())\n        .stdout(Stdio::inherit())\n        .output()\n        .expect(\"Failed to run `scarb build`\");\n\n    assert!(build_output.status.success(), \"`scarb build` failed\");\n    let sierra_path = tempdir\n        .path()\n        .join(\"target/dev/map_Map.contract_class.json\");\n    assert!(\n        sierra_path.exists(),\n        \"sierra artifact not found at {sierra_path:?}\"\n    );\n    let sierra_path = sierra_path.to_str().unwrap();\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"declare-from\",\n        \"--sierra-file\",\n        sierra_path,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        Success: Declaration completed\n\n        Class Hash:       0x[..]\n        Transaction Hash: 0x[..]\n\n        To see declaration details, visit:\n        class: https://[..]\n        transaction: https://[..]\n    \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_declare_from_sierra_does_not_exist() {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user1\",\n        \"declare-from\",\n        \"--sierra-file\",\n        \"/nonexistent/path/contract.contract_class.json\",\n        \"--url\",\n        URL,\n    ];\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: declare-from\n        Error: Failed to read sierra file at [..]contract_class.json: No such file or directory [..]\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_declare_from_sierra_invalid_json() {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n    let invalid_sierra_path = temp_dir.path().join(\"invalid_contract_class.json\");\n    fs::write(&invalid_sierra_path, r#\"{\"not\": \"a valid sierra\"}\"#).unwrap();\n    let invalid_sierra_path = invalid_sierra_path.to_str().unwrap().to_string();\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user1\",\n        \"declare-from\",\n        \"--sierra-file\",\n        invalid_sierra_path.as_str(),\n        \"--url\",\n        URL,\n    ];\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: declare-from\n        Error: Failed to parse sierra file: missing field `sierra_program` at line 1 column 25\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_declare_from_sierra_already_declared() {\n    let contract_path = duplicate_contract_directory_with_salt(\n        CONTRACTS_DIR.to_string() + \"/map\",\n        \"put\",\n        \"declare_from_file_already_declared\",\n    );\n    let tempdir = create_and_deploy_oz_account().await;\n    join_tempdirs(&contract_path, &tempdir);\n\n    let build_output = ScarbCommand::new()\n        .arg(\"build\")\n        .current_dir(tempdir.path())\n        .command()\n        .output()\n        .expect(\"Failed to run `scarb build`\");\n    assert!(build_output.status.success(), \"`scarb build` failed\");\n\n    let sierra_path = tempdir\n        .path()\n        .join(\"target/dev/map_Map.contract_class.json\");\n    let sierra_path = sierra_path.to_str().unwrap();\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"declare-from\",\n        \"--sierra-file\",\n        sierra_path,\n        \"--url\",\n        URL,\n    ];\n\n    runner(&args).current_dir(tempdir.path()).assert().success();\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"declare-from\",\n        \"--sierra-file\",\n        sierra_path,\n        \"--url\",\n        URL,\n    ];\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: declare-from\n        Error: Contract with class hash 0x0[..] is already declared\n        \"},\n    );\n}\n\n#[test]\nfn test_declare_from_requires_sierra_file_or_class_hash() {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n    let args = vec![\"declare-from\", \"--url\", URL];\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        error: the following required arguments were not provided:\n          <--sierra-file <SIERRA_FILE>|--class-hash <CLASS_HASH>>\n\n        Usage: sncast declare-from --url <URL> <--sierra-file <SIERRA_FILE>|--class-hash <CLASS_HASH>>\n\n        For more information, try '--help'.\n        \"},\n    );\n}\n\n#[test]\nfn test_declare_from_conflicting_contract_source() {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n    let args = vec![\n        \"declare-from\",\n        \"--class-hash\",\n        \"0x1\",\n        \"--sierra-file\",\n        \"path/to/sierra.json\",\n        \"--url\",\n        URL,\n    ];\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        error: the argument '--class-hash <CLASS_HASH>' cannot be used with '--sierra-file <SIERRA_FILE>'\n        \n        Usage: sncast declare-from --url <URL> <--sierra-file <SIERRA_FILE>|--class-hash <CLASS_HASH>>\n\n        For more information, try '--help'.\n        \"},\n    );\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/deploy.rs",
    "content": "use crate::helpers::constants::{\n    ACCOUNT, ACCOUNT_FILE_PATH, CONSTRUCTOR_WITH_PARAMS_CONTRACT_CLASS_HASH_SEPOLIA, CONTRACTS_DIR,\n    DEVNET_OZ_CLASS_HASH_CAIRO_0, MAP_CONTRACT_CLASS_HASH_SEPOLIA, URL,\n};\nuse crate::helpers::fixtures::{\n    create_and_deploy_account, create_and_deploy_oz_account, create_test_provider,\n    duplicate_contract_directory_with_salt, get_transaction_by_hash, get_transaction_hash,\n    get_transaction_receipt, join_tempdirs,\n};\nuse crate::helpers::runner::runner;\nuse crate::helpers::shell::os_specific_shell;\nuse camino::Utf8PathBuf;\nuse indoc::indoc;\nuse shared::test_utils::output_assert::{AsOutput, assert_stderr_contains, assert_stdout_contains};\nuse snapbox::cargo_bin;\nuse sncast::AccountType;\nuse sncast::helpers::constants::OZ_CLASS_HASH;\nuse sncast::helpers::fee::FeeArgs;\nuse starknet_rust::core::types::TransactionReceipt::Invoke;\nuse starknet_rust::core::types::{\n    BlockId, BlockTag, InvokeTransaction, Transaction, TransactionExecutionStatus,\n};\nuse starknet_rust::providers::Provider;\nuse starknet_types_core::felt::{Felt, NonZeroFelt};\nuse test_case::test_case;\nuse toml::Value;\n\n#[tokio::test]\nasync fn test_happy_case_human_readable() {\n    let tempdir = create_and_deploy_account(OZ_CLASS_HASH, AccountType::OpenZeppelin).await;\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"deploy\",\n        \"--url\",\n        URL,\n        \"--class-hash\",\n        MAP_CONTRACT_CLASS_HASH_SEPOLIA,\n        \"--salt\",\n        \"0x2\",\n        \"--unique\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {\n            \"\n            Success: Deployment completed\n\n            Contract Address: 0x0[..]\n            Transaction Hash: 0x0[..]\n\n            To see deployment details, visit:\n            contract: [..]\n            transaction: [..]\n            \"\n        },\n    );\n}\n\n#[test_case(DEVNET_OZ_CLASS_HASH_CAIRO_0.parse().unwrap(), AccountType::OpenZeppelin; \"cairo_0_class_hash\")]\n#[test_case(OZ_CLASS_HASH, AccountType::OpenZeppelin; \"cairo_1_class_hash\")]\n#[test_case(sncast::helpers::constants::READY_CLASS_HASH, AccountType::Ready; \"READY_CLASS_HASH\")]\n#[test_case(sncast::helpers::constants::BRAAVOS_CLASS_HASH, AccountType::Braavos; \"braavos_class_hash\")]\n#[tokio::test]\nasync fn test_happy_case(class_hash: Felt, account_type: AccountType) {\n    let tempdir = create_and_deploy_account(class_hash, account_type).await;\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"--json\",\n        \"deploy\",\n        \"--url\",\n        URL,\n        \"--class-hash\",\n        MAP_CONTRACT_CLASS_HASH_SEPOLIA,\n        \"--salt\",\n        \"0x2\",\n        \"--unique\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    let hash = get_transaction_hash(&snapbox.assert().success().get_output().stdout.clone());\n    let receipt = get_transaction_receipt(hash).await;\n\n    assert!(matches!(receipt, Invoke(_)));\n}\n\n#[test_case(FeeArgs{\n    max_fee: Some(NonZeroFelt::try_from(Felt::from(1_000_000_000_000_000_000_000_000_u128)).unwrap()),\n    l1_data_gas: None,\n    l1_data_gas_price:  None,\n    l1_gas:  None,\n    l1_gas_price:  None,\n    l2_gas:  None,\n    l2_gas_price:  None,\n    tip: None,\n    estimate_tip: false,\n}; \"max_fee\")]\n#[test_case(FeeArgs{\n    max_fee: None,\n    l1_data_gas: Some(100_000),\n    l1_data_gas_price: Some(10_000_000_000_000),\n    l1_gas: Some(100_000),\n    l1_gas_price: Some(10_000_000_000_000),\n    l2_gas: Some(1_000_000_000),\n    l2_gas_price: Some(100_000_000_000_000_000_000),\n    tip: Some(100_000),\n    estimate_tip: false,\n}; \"resource_bounds\")]\n#[tokio::test]\nasync fn test_happy_case_different_fees(fee_args: FeeArgs) {\n    let tempdir = create_and_deploy_oz_account().await;\n\n    let mut args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"--json\",\n        \"deploy\",\n        \"--url\",\n        URL,\n        \"--class-hash\",\n        MAP_CONTRACT_CLASS_HASH_SEPOLIA,\n        \"--salt\",\n        \"0x2\",\n        \"--unique\",\n    ];\n    let options = [\n        (\n            \"--max-fee\",\n            fee_args.max_fee.map(Felt::from).map(|x| x.to_string()),\n        ),\n        (\"--l1-data-gas\", fee_args.l1_data_gas.map(|x| x.to_string())),\n        (\n            \"--l1-data-gas-price\",\n            fee_args.l1_data_gas_price.map(|x| x.to_string()),\n        ),\n        (\"--l1-gas\", fee_args.l1_gas.map(|x| x.to_string())),\n        (\n            \"--l1-gas-price\",\n            fee_args.l1_gas_price.map(|x| x.to_string()),\n        ),\n        (\"--l2-gas\", fee_args.l2_gas.map(|x| x.to_string())),\n        (\n            \"--l2-gas-price\",\n            fee_args.l2_gas_price.map(|x| x.to_string()),\n        ),\n        (\"--tip\", fee_args.tip.map(|x| x.to_string())),\n    ];\n\n    for &(key, ref value) in &options {\n        if let Some(val) = value.as_ref() {\n            args.push(key);\n            args.push(val);\n        }\n    }\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success().get_output().stdout.clone();\n\n    let hash = get_transaction_hash(&output);\n    let Invoke(receipt) = get_transaction_receipt(hash).await else {\n        panic!(\"Should be Invoke receipt\");\n    };\n    assert_eq!(\n        receipt.execution_result.status(),\n        TransactionExecutionStatus::Succeeded\n    );\n\n    let Transaction::Invoke(InvokeTransaction::V3(tx)) = get_transaction_by_hash(hash).await else {\n        panic!(\"Expected Invoke V3 transaction\")\n    };\n    assert_eq!(tx.tip, fee_args.tip.unwrap_or(0));\n}\n\n#[tokio::test]\nasync fn test_happy_case_with_constructor() {\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"--account\",\n        \"user4\",\n        \"--json\",\n        \"deploy\",\n        \"--url\",\n        URL,\n        \"--constructor-calldata\",\n        \"0x1\",\n        \"0x1\",\n        \"0x0\",\n        \"--class-hash\",\n        CONSTRUCTOR_WITH_PARAMS_CONTRACT_CLASS_HASH_SEPOLIA,\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().success().get_output().stdout.clone();\n\n    let hash = get_transaction_hash(&output);\n    let receipt = get_transaction_receipt(hash).await;\n\n    assert!(matches!(receipt, Invoke(_)));\n}\n\n#[tokio::test]\nasync fn test_happy_case_with_constructor_cairo_expression_calldata() {\n    let tempdir = create_and_deploy_oz_account().await;\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"--json\",\n        \"deploy\",\n        \"--url\",\n        URL,\n        \"--arguments\",\n        \"0x420, 0x2137_u256\",\n        \"--class-hash\",\n        CONSTRUCTOR_WITH_PARAMS_CONTRACT_CLASS_HASH_SEPOLIA,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success().get_output().stdout.clone();\n\n    let hash = get_transaction_hash(&output);\n    let receipt = get_transaction_receipt(hash).await;\n\n    assert!(matches!(receipt, Invoke(_)));\n}\n\n#[test]\nfn test_wrong_calldata() {\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"--account\",\n        \"user9\",\n        \"deploy\",\n        \"--url\",\n        URL,\n        \"--class-hash\",\n        CONSTRUCTOR_WITH_PARAMS_CONTRACT_CLASS_HASH_SEPOLIA,\n        \"--constructor-calldata\",\n        \"0x1 0x2 0x3 0x4\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: deploy\n        Error: Transaction execution error [..]Input too long for arguments[..]\n        \"},\n    );\n}\n\n#[test]\nfn test_class_hash_with_package() {\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"--account\",\n        \"user9\",\n        \"deploy\",\n        \"--url\",\n        URL,\n        \"--class-hash\",\n        CONSTRUCTOR_WITH_PARAMS_CONTRACT_CLASS_HASH_SEPOLIA,\n        \"--package\",\n        \"my_package\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        error: the argument '--class-hash <CLASS_HASH>' cannot be used with '--package <PACKAGE>'\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_contract_not_declared() {\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"--account\",\n        ACCOUNT,\n        \"deploy\",\n        \"--url\",\n        URL,\n        \"--class-hash\",\n        \"0x1\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        \"Error: An error occurred in the called contract[..]Class with hash[..]is not declared[..]\",\n    );\n}\n\n#[test]\nfn test_contract_already_deployed() {\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"--account\",\n        \"user1\",\n        \"deploy\",\n        \"--url\",\n        URL,\n        \"--class-hash\",\n        MAP_CONTRACT_CLASS_HASH_SEPOLIA,\n        \"--salt\",\n        \"0x1\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: deploy\n        Error: Transaction execution error [..] contract already deployed at address [..]\n        \"},\n    );\n}\n\n#[test]\nfn test_too_low_gas() {\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"--account\",\n        \"user7\",\n        \"--wait\",\n        \"deploy\",\n        \"--url\",\n        URL,\n        \"--class-hash\",\n        MAP_CONTRACT_CLASS_HASH_SEPOLIA,\n        \"--salt\",\n        \"0x2\",\n        \"--unique\",\n        \"--l1-gas\",\n        \"1\",\n        \"--l2-gas\",\n        \"1\",\n        \"--l1-data-gas\",\n        \"1\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().success();\n    // TODO Check extra blank line\n    println!(\"====\\n{}\\n====\", output.as_stderr());\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: deploy\n        Error: The transaction's resources don't cover validation or the minimal transaction fee\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_happy_case_shell() {\n    let tempdir = create_and_deploy_oz_account().await;\n    let binary_path = cargo_bin!(\"sncast\");\n    let command = os_specific_shell(&Utf8PathBuf::from(\"tests/shell/deploy\"));\n\n    let snapbox = command\n        .current_dir(tempdir.path())\n        .arg(binary_path)\n        .arg(URL)\n        .arg(CONSTRUCTOR_WITH_PARAMS_CONTRACT_CLASS_HASH_SEPOLIA);\n    snapbox.assert().success();\n}\n\n#[tokio::test]\nasync fn test_json_output_format() {\n    let tempdir = create_and_deploy_account(OZ_CLASS_HASH, AccountType::OpenZeppelin).await;\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"--json\",\n        \"deploy\",\n        \"--url\",\n        URL,\n        \"--class-hash\",\n        MAP_CONTRACT_CLASS_HASH_SEPOLIA,\n        \"--salt\",\n        \"0x2\",\n        \"--unique\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r#\"\n            {\"command\":\"deploy\",\"contract_address\":\"0x[..]\",\"transaction_hash\":\"0x[..]\",\"type\":\"response\"}\n            {\"links\":\"contract: https://sepolia.voyager.online/contract/0x[..]\\ntransaction: https://sepolia.voyager.online/tx/0x[..]\\n\",\"title\":\"deployment\",\"type\":\"notification\"}\n            \"#},\n    );\n}\n\n#[tokio::test]\nasync fn test_happy_case_with_declare() {\n    let contract_path = duplicate_contract_directory_with_salt(\n        CONTRACTS_DIR.to_string() + \"/map\",\n        \"put\",\n        \"with_declare\",\n    );\n    let tempdir = create_and_deploy_oz_account().await;\n    join_tempdirs(&contract_path, &tempdir);\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"deploy\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"Map\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {\n            \"\n            Success: Deployment completed\n\n            Contract Address:         0x0[..]\n            Class Hash:               0x0[..]\n            Declare Transaction Hash: 0x0[..]\n            Deploy Transaction Hash:  0x0[..]\n\n            To see deployment details, visit:\n            contract: [..]\n            class: [..]\n            deploy transaction: [..]\n            declare transaction: [..]\n            \"\n        },\n    );\n}\n\n#[tokio::test]\nasync fn test_happy_case_with_already_declared() {\n    let contract_path = duplicate_contract_directory_with_salt(\n        CONTRACTS_DIR.to_string() + \"/map\",\n        \"put\",\n        \"with_redeclare\",\n    );\n    let tempdir = create_and_deploy_oz_account().await;\n    join_tempdirs(&contract_path, &tempdir);\n\n    {\n        // Declare the contract first\n        let args = vec![\n            \"--accounts-file\",\n            \"accounts.json\",\n            \"--account\",\n            \"my_account\",\n            \"declare\",\n            \"--url\",\n            URL,\n            \"--contract-name\",\n            \"Map\",\n        ];\n\n        runner(&args).current_dir(tempdir.path()).assert().success();\n    }\n\n    // Deploy the contract with declaring\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"deploy\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"Map\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {\n            \"\n            Success: Deployment completed\n\n            Contract Address: 0x0[..]\n            Transaction Hash: 0x0[..]\n\n            To see deployment details, visit:\n            contract: [..]\n            transaction: [..]\n            \"\n        },\n    );\n}\n\n#[tokio::test]\nasync fn test_happy_case_with_declare_nonce() {\n    let contract_path = duplicate_contract_directory_with_salt(\n        CONTRACTS_DIR.to_string() + \"/map\",\n        \"put\",\n        \"with_declare_nonce\",\n    );\n    let tempdir = create_and_deploy_oz_account().await;\n    join_tempdirs(&contract_path, &tempdir);\n\n    let nonce = {\n        // Get nonce\n        let provider = create_test_provider();\n        let args = vec![\n            \"--accounts-file\",\n            \"accounts.json\",\n            \"--json\",\n            \"account\",\n            \"list\",\n        ];\n\n        let snapbox = runner(&args).current_dir(tempdir.path());\n        let output = snapbox.assert().success();\n\n        let value: Value = serde_json::from_str(output.as_stdout()).unwrap();\n        let account_address = value[\"my_account\"][\"address\"].as_str().unwrap();\n\n        provider\n            .get_nonce(\n                BlockId::Tag(BlockTag::Latest),\n                Felt::from_hex(account_address).unwrap(),\n            )\n            .await\n            .unwrap()\n            .to_string()\n    };\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"deploy\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"Map\",\n        \"--nonce\",\n        nonce.as_str(),\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {\n            \"\n            Success: Deployment completed\n\n            Contract Address:         0x0[..]\n            Class Hash:               0x0[..]\n            Declare Transaction Hash: 0x0[..]\n            Deploy Transaction Hash:  0x0[..]\n\n            To see deployment details, visit:\n            contract: [..]\n            class: [..]\n            deploy transaction: [..]\n            declare transaction: [..]\n            \"\n        },\n    );\n}\n\n#[tokio::test]\nasync fn test_deploy_with_declare_invalid_nonce() {\n    let contract_path = duplicate_contract_directory_with_salt(\n        CONTRACTS_DIR.to_string() + \"/map\",\n        \"put\",\n        \"with_redeclare\",\n    );\n    let tempdir = create_and_deploy_oz_account().await;\n    join_tempdirs(&contract_path, &tempdir);\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"deploy\",\n        \"--url\",\n        URL,\n        \"--constructor-calldata\",\n        \"0x1\",\n        \"0x1\",\n        \"0x0\",\n        \"--contract-name\",\n        \"Map\",\n        \"--nonce\",\n        \"0x123456\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r#\"\n        Command: deploy\n        Error: Transaction execution error = TransactionExecutionErrorData { transaction_index: 0, execution_error: Message(\"Account transaction nonce is invalid.\") }\n        \"#},\n    );\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/devnet_accounts.rs",
    "content": "use crate::helpers::constants::{MAP_CONTRACT_ADDRESS_SEPOLIA, SEPOLIA_RPC_URL, URL};\nuse crate::helpers::fixtures::copy_file;\nuse crate::helpers::runner::runner;\nuse indoc::indoc;\nuse shared::test_utils::output_assert::{assert_stderr_contains, assert_stdout_contains};\nuse tempfile::tempdir;\nuse test_case::test_case;\n\n#[test_case(1)]\n#[test_case(20)]\n#[tokio::test]\npub async fn happy_case(account_number: u8) {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n\n    let account = format!(\"devnet-{account_number}\");\n    let args = vec![\n        \"--account\",\n        &account,\n        \"invoke\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"put\",\n        \"--calldata\",\n        \"0x1 0x2\",\n    ];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {\n            \"\n            Success: Invoke completed\n\n            Transaction Hash: 0x0[..]\n            \"\n        },\n    );\n}\n\n#[test_case(0)]\n#[test_case(21)]\n#[tokio::test]\npub async fn account_number_out_of_range(account_number: u8) {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n\n    let account = format!(\"devnet-{account_number}\");\n    let args = vec![\n        \"--account\",\n        &account,\n        \"invoke\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"put\",\n        \"--calldata\",\n        \"0x1 0x2\",\n    ];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        indoc! {\n            \"\n            Error: Devnet account number must be between 1 and 20\n            \"\n        },\n    );\n}\n\n#[tokio::test]\npub async fn account_name_already_exists() {\n    let accounts_file = \"accounts.json\";\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n\n    copy_file(\n        \"tests/data/accounts/accounts.json\",\n        temp_dir.path().join(accounts_file),\n    );\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"--account\",\n        \"devnet-1\",\n        \"invoke\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"put\",\n        \"--calldata\",\n        \"0x1 0x2\",\n    ];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {\n            \"\n            [WARNING] Using account devnet-1 from accounts file accounts.json. To use an inbuilt devnet account, please rename your existing account or use an account with a different number.\n            \n            Success: Invoke completed\n\n            Transaction Hash: 0x0[..]\n            \"\n        },\n    );\n}\n\n#[tokio::test]\npub async fn use_devnet_account_with_network_not_being_devnet() {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n\n    let args = vec![\n        \"--account\",\n        \"devnet-1\",\n        \"invoke\",\n        \"--url\",\n        SEPOLIA_RPC_URL,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"put\",\n        \"--calldata\",\n        \"0x1 0x2\",\n    ];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        format! {\"Error: Node at {SEPOLIA_RPC_URL} is not responding to the Devnet health check (GET `/is_alive`). It may not be a Devnet instance or it may be down.\"\n        },\n    );\n}\n\n#[test_case(\"mainnet\")]\n#[test_case(\"sepolia\")]\n#[tokio::test]\npub async fn use_devnet_account_with_network_flags(network: &str) {\n    let temp_dir = tempdir().expect(\"Unable to create a temporary directory\");\n\n    let args = vec![\n        \"--account\",\n        \"devnet-1\",\n        \"invoke\",\n        \"--network\",\n        network,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"put\",\n        \"--calldata\",\n        \"0x1 0x2\",\n    ];\n\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        format! {\"Error: Devnet accounts cannot be used with `--network {network}`\"\n        },\n    );\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/fee.rs",
    "content": "use crate::helpers::constants::{ACCOUNT_FILE_PATH, MAP_CONTRACT_ADDRESS_SEPOLIA, URL};\nuse crate::helpers::runner::runner;\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stderr_contains;\n\n#[test]\nfn test_max_fee_used_with_other_args() {\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"--account\",\n        \"user11\",\n        \"--wait\",\n        \"invoke\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"put\",\n        \"--calldata\",\n        \"0x1\",\n        \"0x2\",\n        \"--max-fee\",\n        \"1\",\n        \"--l1-gas\",\n        \"1\",\n        \"--l1-gas-price\",\n        \"1\",\n        \"--l2-gas\",\n        \"1\",\n        \"--l2-gas-price\",\n        \"1\",\n        \"--l1-data-gas\",\n        \"1\",\n        \"--l1-data-gas-price\",\n        \"1\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        error: the argument '--max-fee <MAX_FEE>' cannot be used with:\n          --l1-gas <L1_GAS>\n          --l1-gas-price <L1_GAS_PRICE>\n          --l2-gas <L2_GAS>\n          --l2-gas-price <L2_GAS_PRICE>\n          --l1-data-gas <L1_DATA_GAS>\n          --l1-data-gas-price <L1_DATA_GAS_PRICE>\n        \"},\n    );\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/invoke.rs",
    "content": "use crate::helpers::constants::{\n    ACCOUNT, ACCOUNT_FILE_PATH, DATA_TRANSFORMER_CONTRACT_ADDRESS_SEPOLIA,\n    DEVNET_OZ_CLASS_HASH_CAIRO_0, MAP_CONTRACT_ADDRESS_SEPOLIA, URL,\n};\nuse crate::helpers::fixtures::{\n    create_and_deploy_account, create_and_deploy_oz_account, get_transaction_by_hash,\n    get_transaction_hash, get_transaction_receipt,\n};\nuse crate::helpers::runner::runner;\nuse crate::helpers::shell::os_specific_shell;\nuse camino::Utf8PathBuf;\nuse indoc::indoc;\nuse shared::test_utils::output_assert::{assert_stderr_contains, assert_stdout_contains};\nuse snapbox::cargo_bin;\nuse sncast::AccountType;\nuse sncast::helpers::constants::{BRAAVOS_CLASS_HASH, OZ_CLASS_HASH, READY_CLASS_HASH};\nuse sncast::helpers::fee::FeeArgs;\nuse starknet_rust::core::types::TransactionReceipt::Invoke;\nuse starknet_rust::core::types::{InvokeTransaction, Transaction, TransactionExecutionStatus};\nuse starknet_types_core::felt::{Felt, NonZeroFelt};\nuse test_case::test_case;\n\n#[tokio::test]\nasync fn test_happy_case_human_readable() {\n    let tempdir = create_and_deploy_account(OZ_CLASS_HASH, AccountType::OpenZeppelin).await;\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"invoke\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"put\",\n        \"--calldata\",\n        \"0x1 0x2\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {\n            \"\n            Success: Invoke completed\n\n            Transaction Hash: 0x0[..]\n\n            To see invocation details, visit:\n            transaction: [..]\n            \"\n        },\n    );\n}\n\n#[test_case(DEVNET_OZ_CLASS_HASH_CAIRO_0.parse().unwrap(), AccountType::OpenZeppelin; \"cairo_0_class_hash\")]\n#[test_case(OZ_CLASS_HASH, AccountType::OpenZeppelin; \"cairo_1_class_hash\")]\n#[test_case(READY_CLASS_HASH, AccountType::Ready; \"READY_CLASS_HASH\")]\n#[test_case(BRAAVOS_CLASS_HASH, AccountType::Braavos; \"braavos_class_hash\")]\n#[tokio::test]\nasync fn test_happy_case(class_hash: Felt, account_type: AccountType) {\n    let tempdir = create_and_deploy_account(class_hash, account_type).await;\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"--json\",\n        \"invoke\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"put\",\n        \"--calldata\",\n        \"0x1 0x2\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n    let stdout = output.get_output().stdout.clone();\n\n    let hash = get_transaction_hash(&stdout);\n    let receipt = get_transaction_receipt(hash).await;\n\n    assert!(matches!(receipt, Invoke(_)));\n}\n\n#[test_case(FeeArgs{\n    max_fee: Some(NonZeroFelt::try_from(Felt::from(1_000_000_000_000_000_000_000_000_u128)).unwrap()),\n    l1_data_gas: None,\n    l1_data_gas_price:  None,\n    l1_gas:  None,\n    l1_gas_price:  None,\n    l2_gas:  None,\n    l2_gas_price:  None,\n    tip: None,\n    estimate_tip: false,\n}; \"max_fee\")]\n#[test_case(FeeArgs{\n    max_fee: None,\n    l1_data_gas: Some(100_000),\n    l1_data_gas_price: Some(10_000_000_000_000),\n    l1_gas: Some(100_000),\n    l1_gas_price: Some(10_000_000_000_000),\n    l2_gas: Some(1_000_000_000),\n    l2_gas_price: Some(100_000_000_000_000_000_000),\n    tip: Some(100_000_000),\n    estimate_tip: false,\n}; \"resource_bounds\")]\n#[tokio::test]\nasync fn test_happy_case_different_fees(fee_args: FeeArgs) {\n    let tempdir = create_and_deploy_oz_account().await;\n    let mut args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"--json\",\n        \"invoke\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"put\",\n        \"--calldata\",\n        \"0x1 0x2\",\n    ];\n    let options = [\n        (\n            \"--max-fee\",\n            fee_args.max_fee.map(Felt::from).map(|x| x.to_string()),\n        ),\n        (\"--l1-data-gas\", fee_args.l1_data_gas.map(|x| x.to_string())),\n        (\n            \"--l1-data-gas-price\",\n            fee_args.l1_data_gas_price.map(|x| x.to_string()),\n        ),\n        (\"--l1-gas\", fee_args.l1_gas.map(|x| x.to_string())),\n        (\n            \"--l1-gas-price\",\n            fee_args.l1_gas_price.map(|x| x.to_string()),\n        ),\n        (\"--l2-gas\", fee_args.l2_gas.map(|x| x.to_string())),\n        (\n            \"--l2-gas-price\",\n            fee_args.l2_gas_price.map(|x| x.to_string()),\n        ),\n        (\"--tip\", fee_args.tip.map(|x| x.to_string())),\n    ];\n\n    for &(key, ref value) in &options {\n        if let Some(val) = value.as_ref() {\n            args.push(key);\n            args.push(val);\n        }\n    }\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success().get_output().stdout.clone();\n\n    let hash = get_transaction_hash(&output);\n    let Invoke(receipt) = get_transaction_receipt(hash).await else {\n        panic!(\"Should be Invoke receipt\");\n    };\n    assert_eq!(\n        receipt.execution_result.status(),\n        TransactionExecutionStatus::Succeeded\n    );\n\n    let Transaction::Invoke(InvokeTransaction::V3(tx)) = get_transaction_by_hash(hash).await else {\n        panic!(\"Expected Invoke V3 transaction\")\n    };\n    assert_eq!(tx.tip, fee_args.tip.unwrap_or(0));\n}\n\n#[tokio::test]\nasync fn test_contract_does_not_exist() {\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"--account\",\n        ACCOUNT,\n        \"invoke\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        \"0x1\",\n        \"--function\",\n        \"put\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        \"Error: An error occurred in the called contract[..]Requested contract address[..]is not deployed[..]\",\n    );\n}\n\n#[test]\nfn test_wrong_function_name() {\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"--account\",\n        \"user2\",\n        \"invoke\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"nonexistent_put\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        r#\"Error: Function with selector \"0x2e0f845a8d0319c5c37d558023299beec2a0155d415f41cca140a09e6877c67\" not found in ABI of the contract\"#,\n    );\n}\n\n#[test]\nfn test_wrong_calldata() {\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"--account\",\n        \"user5\",\n        \"invoke\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"put\",\n        \"--calldata\",\n        \"0x1\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: invoke\n        Error: Transaction execution error [..]Failed to deserialize param #2[..]\n        \"},\n    );\n}\n\n#[test]\nfn test_too_low_gas() {\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"--account\",\n        \"user11\",\n        \"--wait\",\n        \"invoke\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"put\",\n        \"--calldata\",\n        \"0x1\",\n        \"0x2\",\n        \"--l1-gas\",\n        \"1\",\n        \"--l1-gas-price\",\n        \"1\",\n        \"--l2-gas\",\n        \"1\",\n        \"--l2-gas-price\",\n        \"1\",\n        \"--l1-data-gas\",\n        \"1\",\n        \"--l1-data-gas-price\",\n        \"1\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: invoke\n        Error: The transaction's resources don't cover validation or the minimal transaction fee\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_happy_case_cairo_expression_calldata() {\n    let tempdir = create_and_deploy_oz_account().await;\n\n    let calldata = r\"NestedStructWithField { a: SimpleStruct { a: 0x24 }, b: 96 }\";\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"--json\",\n        \"invoke\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        DATA_TRANSFORMER_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"nested_struct_fn\",\n        \"--arguments\",\n        calldata,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success().get_output().stdout.clone();\n\n    let hash = get_transaction_hash(&output);\n    let receipt = get_transaction_receipt(hash).await;\n\n    assert!(matches!(receipt, Invoke(_)));\n}\n\n#[tokio::test]\nasync fn test_happy_case_shell() {\n    let tempdir = create_and_deploy_oz_account().await;\n    let binary_path = cargo_bin!(\"sncast\");\n    let command = os_specific_shell(&Utf8PathBuf::from(\"tests/shell/invoke\"));\n\n    let snapbox = command\n        .current_dir(tempdir.path())\n        .arg(binary_path)\n        .arg(URL)\n        .arg(DATA_TRANSFORMER_CONTRACT_ADDRESS_SEPOLIA);\n    snapbox.assert().success();\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/ledger/account.rs",
    "content": "use std::fs;\n\nuse crate::e2e::ledger::{\n    BRAAVOS_LEDGER_PATH, LEDGER_ACCOUNT_NAME, LEDGER_PUBLIC_KEY, OZ_LEDGER_PATH, READY_LEDGER_PATH,\n    TEST_LEDGER_PATH, TEST_LEDGER_PATH_STORED, automation, setup_speculos,\n};\nuse crate::helpers::constants::URL;\nuse crate::helpers::fixtures::mint_token;\nuse crate::helpers::runner::runner;\nuse camino::Utf8PathBuf;\nuse configuration::test_utils::copy_config_to_tempdir;\nuse conversions::string::IntoHexStr;\nuse indoc::indoc;\nuse serde_json::{json, to_string_pretty};\nuse shared::test_utils::output_assert::{assert_stderr_contains, assert_stdout_contains};\nuse snapbox::assert_data_eq;\nuse sncast::helpers::account::load_accounts;\nuse sncast::helpers::constants::{BRAAVOS_CLASS_HASH, OZ_CLASS_HASH, READY_CLASS_HASH};\nuse speculos_client::AutomationRule;\nuse tempfile::tempdir;\nuse test_case::test_case;\n\n#[test_case(\"oz\", \"open_zeppelin\", OZ_CLASS_HASH.into_hex_string(), 6001, &[automation::APPROVE_PUBLIC_KEY]; \"oz_account_type\")]\n#[test_case(\"ready\", \"ready\", READY_CLASS_HASH.into_hex_string(), 6002, &[automation::APPROVE_PUBLIC_KEY]; \"ready_account_type\")]\n// Braavos calls sign_hash twice during fee estimation (tx_hash + aux_hash) because\n// is_signer_interactive() always returns false — see BraavosAccountFactory::is_signer_interactive.\n// That means we need ENABLE_BLIND_SIGN + two APPROVE_BLIND_SIGN_HASH after the public key approval.\n#[test_case(\n    \"braavos\", \"braavos\", BRAAVOS_CLASS_HASH.into_hex_string(), 6003,\n    &[\n        automation::APPROVE_PUBLIC_KEY,\n        automation::ENABLE_BLIND_SIGN,\n        automation::APPROVE_BLIND_SIGN_HASH, // tx_hash\n        automation::APPROVE_BLIND_SIGN_HASH, // aux_hash\n    ];\n    \"braavos_account_type\"\n)]\n#[tokio::test]\n#[ignore = \"requires Speculos installation\"]\nasync fn test_create_ledger_account(\n    account_type: &str,\n    saved_type: &str,\n    class_hash: String,\n    port: u16,\n    automations: &[speculos_client::AutomationRule<'static>],\n) {\n    let (client, url) = setup_speculos(port);\n    let tempdir = tempdir().unwrap();\n\n    client.automation(automations).await.unwrap();\n\n    let output = runner(&[\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"account\",\n        \"create\",\n        \"--ledger-path\",\n        TEST_LEDGER_PATH,\n        \"--url\",\n        URL,\n        \"--name\",\n        LEDGER_ACCOUNT_NAME,\n        \"--type\",\n        account_type,\n    ])\n    .env(\"LEDGER_EMULATOR_URL\", &url)\n    .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n    .current_dir(tempdir.path())\n    .assert()\n    .success();\n\n    assert_stdout_contains(\n        output,\n        indoc::formatdoc! {\"\n            Success: Account created\n\n            Address: 0x0[..]\n\n            Account successfully created but it needs to be deployed. The estimated deployment fee is [..] STRK. Prefund the account to cover deployment transaction fee\n\n            After prefunding the account, run:\n            sncast --accounts-file accounts.json account deploy --url {URL} --name {LEDGER_ACCOUNT_NAME}\n\n            To see account creation details, visit:\n            account: [..]\n        \",\n            URL = URL,\n            LEDGER_ACCOUNT_NAME = LEDGER_ACCOUNT_NAME,\n        },\n    );\n\n    let contents = fs::read_to_string(tempdir.path().join(\"accounts.json\"))\n        .expect(\"Unable to read created file\");\n\n    let expected = json!(\n        {\n            \"alpha-sepolia\": {\n                LEDGER_ACCOUNT_NAME: {\n                    \"address\": \"0x[..]\",\n                    \"class_hash\": class_hash,\n                    \"deployed\": false,\n                    \"legacy\": false,\n                    \"public_key\": \"0x[..]\",\n                    \"salt\": \"0x[..]\",\n                    \"type\": saved_type,\n                    \"ledger_path\": TEST_LEDGER_PATH_STORED,\n                }\n            }\n        }\n    );\n\n    assert_data_eq!(contents, to_string_pretty(&expected).unwrap());\n}\n\n#[tokio::test]\n#[ignore = \"requires Speculos installation\"]\nasync fn test_create_ledger_account_add_profile() {\n    let (client, url) = setup_speculos(6004);\n    let tempdir = copy_config_to_tempdir(\"tests/data/files/correct_snfoundry.toml\", None);\n\n    client\n        .automation(&[automation::APPROVE_PUBLIC_KEY])\n        .await\n        .unwrap();\n\n    let output = runner(&[\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"account\",\n        \"create\",\n        \"--ledger-path\",\n        TEST_LEDGER_PATH,\n        \"--url\",\n        URL,\n        \"--name\",\n        LEDGER_ACCOUNT_NAME,\n        \"--add-profile\",\n        LEDGER_ACCOUNT_NAME,\n    ])\n    .env(\"LEDGER_EMULATOR_URL\", &url)\n    .current_dir(tempdir.path())\n    .assert()\n    .success();\n\n    let config_path = Utf8PathBuf::from_path_buf(tempdir.path().join(\"snfoundry.toml\"))\n        .unwrap()\n        .canonicalize_utf8()\n        .unwrap();\n\n    assert_stdout_contains(\n        output,\n        format!(\"Add Profile: Profile {LEDGER_ACCOUNT_NAME} successfully added to {config_path}\"),\n    );\n\n    let contents = std::fs::read_to_string(tempdir.path().join(\"snfoundry.toml\")).unwrap();\n    assert!(contents.contains(&format!(\"[sncast.{LEDGER_ACCOUNT_NAME}]\")));\n    assert!(contents.contains(&format!(\"account = \\\"{LEDGER_ACCOUNT_NAME}\\\"\")));\n}\n\n#[test_case(\n    \"oz\", OZ_LEDGER_PATH, 6005,\n    // create: public key only (OZ skips signing during fee estimation)\n    // deploy: enable blind sign + 1 sign_hash\n    &[\n        automation::APPROVE_PUBLIC_KEY,\n        automation::ENABLE_BLIND_SIGN,\n        automation::APPROVE_BLIND_SIGN_HASH,\n    ];\n    \"oz_account_type\"\n)]\n#[test_case(\n    \"ready\", READY_LEDGER_PATH, 6006,\n    // create: public key only (Ready skips signing during fee estimation)\n    // deploy: enable blind sign + 1 sign_hash\n    &[\n        automation::APPROVE_PUBLIC_KEY,\n        automation::ENABLE_BLIND_SIGN,\n        automation::APPROVE_BLIND_SIGN_HASH,\n    ];\n    \"ready_account_type\"\n)]\n#[test_case(\n    \"braavos\", BRAAVOS_LEDGER_PATH, 6007,\n    // create: public key + enable blind sign + 2x sign_hash (tx_hash + aux_hash)\n    // deploy: 2x sign_hash again (tx_hash + aux_hash), blind sign already enabled\n    &[\n        automation::APPROVE_PUBLIC_KEY,\n        automation::ENABLE_BLIND_SIGN,\n        automation::APPROVE_BLIND_SIGN_HASH, // create: tx_hash\n        automation::APPROVE_BLIND_SIGN_HASH, // create: aux_hash\n        automation::APPROVE_BLIND_SIGN_HASH, // deploy: tx_hash\n        automation::APPROVE_BLIND_SIGN_HASH, // deploy: aux_hash\n    ];\n    \"braavos_account_type\"\n)]\n#[tokio::test]\n#[ignore = \"requires Speculos installation\"]\nasync fn test_deploy_ledger_account(\n    account_type_str: &str,\n    ledger_path: &str,\n    port: u16,\n    automations: &[AutomationRule<'static>],\n) {\n    let (client, url) = setup_speculos(port);\n\n    client.automation(automations).await.unwrap();\n\n    let tempdir = tempdir().unwrap();\n    let accounts_file = tempdir.path().join(\"accounts.json\");\n    let accounts_file_str = accounts_file.to_str().unwrap();\n\n    // First create the accounts\n    runner(&[\n        \"--accounts-file\",\n        accounts_file_str,\n        \"account\",\n        \"create\",\n        \"--ledger-path\",\n        ledger_path,\n        \"--url\",\n        URL,\n        \"--name\",\n        LEDGER_ACCOUNT_NAME,\n        \"--type\",\n        account_type_str,\n    ])\n    .env(\"LEDGER_EMULATOR_URL\", &url)\n    .assert()\n    .success();\n\n    let accounts_content = std::fs::read_to_string(&accounts_file).unwrap();\n    let contents_json: serde_json::Value = serde_json::from_str(&accounts_content).unwrap();\n    let address = contents_json[\"alpha-sepolia\"][LEDGER_ACCOUNT_NAME][\"address\"]\n        .as_str()\n        .unwrap()\n        .to_string();\n\n    mint_token(&address, u128::MAX).await;\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file_str,\n        \"account\",\n        \"deploy\",\n        \"--name\",\n        LEDGER_ACCOUNT_NAME,\n        \"--url\",\n        URL,\n    ];\n\n    let output = runner(&args)\n        .env(\"LEDGER_EMULATOR_URL\", &url)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .assert()\n        .success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {\"\n            Ledger device will display a confirmation screen. Please approve it to continue...\n\n            Success: Account deployed\n            Transaction Hash: 0x[..]\n        \"},\n    );\n\n    let path = Utf8PathBuf::from_path_buf(accounts_file.clone()).expect(\"Path is not valid UTF-8\");\n    let items = load_accounts(&path).expect(\"Failed to load accounts\");\n    assert_eq!(\n        items[\"alpha-sepolia\"][LEDGER_ACCOUNT_NAME][\"deployed\"],\n        true\n    );\n}\n\n#[tokio::test]\n#[ignore = \"requires Speculos installation\"]\nasync fn test_invalid_derivation_path() {\n    let (_client, url) = setup_speculos(6008);\n\n    let output = runner(&[\n        \"ledger\",\n        \"get-public-key\",\n        \"--path\",\n        \"invalid/path\",\n        \"--no-display\",\n    ])\n    .env(\"LEDGER_EMULATOR_URL\", &url)\n    .assert()\n    .failure();\n\n    assert_stderr_contains(\n        output,\n        \"error: invalid Ledger derivation path: EIP-2645 paths must have 6 levels\",\n    );\n}\n\n#[test_case(\"oz\", \"open_zeppelin\", OZ_CLASS_HASH.into_hex_string(), 6009; \"oz_account_type\")]\n#[test_case(\"ready\", \"ready\", READY_CLASS_HASH.into_hex_string(), 6010; \"ready_account_type\")]\n#[test_case(\"braavos\", \"braavos\", BRAAVOS_CLASS_HASH.into_hex_string(), 6011; \"braavos_account_type\")]\n#[tokio::test]\n#[ignore = \"requires Speculos installation\"]\nasync fn test_import_ledger_account(\n    account_type: &str,\n    saved_type: &str,\n    class_hash: String,\n    port: u16,\n) {\n    let (client, url) = setup_speculos(port);\n    let tempdir = tempdir().unwrap();\n\n    client\n        .automation(&[automation::APPROVE_PUBLIC_KEY])\n        .await\n        .unwrap();\n\n    let output = runner(&[\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"account\",\n        \"import\",\n        \"--ledger-path\",\n        TEST_LEDGER_PATH,\n        \"--url\",\n        URL,\n        \"--name\",\n        LEDGER_ACCOUNT_NAME,\n        \"--address\",\n        \"0x1\",\n        \"--class-hash\",\n        &class_hash,\n        \"--type\",\n        account_type,\n    ])\n    .env(\"LEDGER_EMULATOR_URL\", &url)\n    .current_dir(tempdir.path())\n    .assert()\n    .success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n            Success: Account imported successfully\n\n            Account Name: my_ledger\n        \"},\n    );\n\n    let accounts_content = std::fs::read_to_string(tempdir.path().join(\"accounts.json\")).unwrap();\n    let contents_json: serde_json::Value = serde_json::from_str(&accounts_content).unwrap();\n    assert_eq!(\n        contents_json,\n        json!({\n            \"alpha-sepolia\": {\n                LEDGER_ACCOUNT_NAME: {\n                    \"address\": \"0x1\",\n                    \"class_hash\": class_hash,\n                    \"deployed\": false,\n                    \"legacy\": false,\n                    \"public_key\": LEDGER_PUBLIC_KEY,\n                    \"type\": saved_type,\n                    \"ledger_path\": TEST_LEDGER_PATH_STORED,\n                }\n            }\n        })\n    );\n}\n\n#[tokio::test]\n#[ignore = \"requires Speculos installation\"]\nasync fn test_import_ledger_account_add_profile() {\n    let (client, url) = setup_speculos(6012);\n    let tempdir = copy_config_to_tempdir(\"tests/data/files/correct_snfoundry.toml\", None);\n\n    client\n        .automation(&[automation::APPROVE_PUBLIC_KEY])\n        .await\n        .unwrap();\n\n    let oz_class_hash = OZ_CLASS_HASH.into_hex_string();\n\n    let output = runner(&[\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"account\",\n        \"import\",\n        \"--ledger-path\",\n        TEST_LEDGER_PATH,\n        \"--url\",\n        URL,\n        \"--name\",\n        LEDGER_ACCOUNT_NAME,\n        \"--address\",\n        \"0x1\",\n        \"--class-hash\",\n        &oz_class_hash,\n        \"--type\",\n        \"oz\",\n        \"--add-profile\",\n        LEDGER_ACCOUNT_NAME,\n    ])\n    .env(\"LEDGER_EMULATOR_URL\", &url)\n    .current_dir(tempdir.path())\n    .assert()\n    .success();\n\n    let config_path = Utf8PathBuf::from_path_buf(tempdir.path().join(\"snfoundry.toml\"))\n        .unwrap()\n        .canonicalize_utf8()\n        .unwrap();\n\n    assert_stdout_contains(\n        output,\n        format!(\"Add Profile:  Profile {LEDGER_ACCOUNT_NAME} successfully added to {config_path}\"),\n    );\n\n    let contents = std::fs::read_to_string(tempdir.path().join(\"snfoundry.toml\")).unwrap();\n    assert!(contents.contains(&format!(\"[sncast.{LEDGER_ACCOUNT_NAME}]\")));\n    assert!(contents.contains(&format!(\"account = \\\"{LEDGER_ACCOUNT_NAME}\\\"\")));\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/ledger/basic.rs",
    "content": "use crate::e2e::ledger::{TEST_LEDGER_PATH, automation, setup_speculos};\nuse crate::helpers::runner::runner;\nuse shared::test_utils::output_assert::{assert_stderr_contains, assert_stdout_contains};\n\n#[tokio::test]\n#[ignore = \"requires Speculos installation\"]\nasync fn test_get_app_version() {\n    let (_client, url) = setup_speculos(4001);\n\n    let output = runner(&[\"ledger\", \"app-version\"])\n        .env(\"LEDGER_EMULATOR_URL\", &url)\n        .assert()\n        .success();\n\n    assert_stdout_contains(output, \"App Version: 2.3.4\");\n}\n\n#[tokio::test]\n#[ignore = \"requires Speculos installation\"]\nasync fn test_get_public_key_headless() {\n    let (_client, url) = setup_speculos(4002);\n\n    let output = runner(&[\n        \"ledger\",\n        \"get-public-key\",\n        \"--account-id\",\n        \"0\",\n        \"--no-display\",\n    ])\n    .env(\"LEDGER_EMULATOR_URL\", &url)\n    .assert()\n    .success();\n\n    assert_stdout_contains(\n        output,\n        \"Public Key: 0x51f3e99d539868d8f45ca705ad6f75e68229a6037a919b15216b4e92a4d6d8\",\n    );\n}\n\n#[tokio::test]\n#[ignore = \"requires Speculos installation\"]\nasync fn test_get_public_key_with_confirmation() {\n    let (client, url) = setup_speculos(4003);\n\n    client\n        .automation(&[automation::APPROVE_PUBLIC_KEY])\n        .await\n        .unwrap();\n\n    let output = runner(&[\"ledger\", \"get-public-key\", \"--path\", TEST_LEDGER_PATH])\n        .env(\"LEDGER_EMULATOR_URL\", &url)\n        .assert()\n        .success();\n\n    assert_stdout_contains(\n        output,\n        \"Public Key: 0x51f3e99d539868d8f45ca705ad6f75e68229a6037a919b15216b4e92a4d6d8\",\n    );\n}\n\n#[tokio::test]\n#[ignore = \"requires Speculos installation\"]\nasync fn test_sign_hash() {\n    let (client, url) = setup_speculos(4004);\n\n    client\n        .automation(&[\n            automation::ENABLE_BLIND_SIGN,\n            automation::APPROVE_BLIND_SIGN_HASH,\n        ])\n        .await\n        .unwrap();\n\n    let output = runner(&[\n        \"ledger\",\n        \"sign-hash\",\n        \"--path\",\n        TEST_LEDGER_PATH,\n        \"0x01234567890abcdef1234567890abcdef1234567890abcdef1234567890abcd\",\n    ])\n    .env(\"LEDGER_EMULATOR_URL\", &url)\n    .assert()\n    .success();\n\n    assert_stdout_contains(output, \"Hash signature:\\nr: 0x[..]\\ns: 0x[..]\");\n}\n\n#[tokio::test]\n#[ignore = \"requires Speculos installation\"]\nasync fn test_sign_hash_invalid_format() {\n    let (_client, url) = setup_speculos(4005);\n\n    let output = runner(&[\n        \"ledger\",\n        \"sign-hash\",\n        \"--path\",\n        TEST_LEDGER_PATH,\n        \"not-a-hex-hash\",\n    ])\n    .env(\"LEDGER_EMULATOR_URL\", &url)\n    .assert()\n    .failure();\n\n    assert_stderr_contains(\n        output,\n        \"error: invalid value 'not-a-hex-hash' for '<HASH>'[..]\",\n    );\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/ledger/mod.rs",
    "content": "#![cfg(not(target_arch = \"wasm32\"))]\n\nuse std::env;\nuse std::{borrow::Cow, sync::Arc};\n\nuse crate::helpers::constants::URL;\nuse crate::helpers::fixtures::mint_token;\nuse clap::Command;\nuse clap::builder::TypedValueParser;\nuse serde_json::json;\nuse sncast::AccountType;\nuse sncast::helpers::braavos::BraavosAccountFactory;\nuse sncast::helpers::constants::{\n    BRAAVOS_BASE_ACCOUNT_CLASS_HASH, BRAAVOS_CLASS_HASH, OZ_CLASS_HASH, READY_CLASS_HASH,\n};\nuse sncast::helpers::ledger::{DerivationPathParser, create_ledger_app};\nuse sncast::response::ui::UI;\nuse speculos_client::{\n    AutomationAction, AutomationCondition, AutomationRule, Button, DeviceModel, SpeculosClient,\n};\nuse starknet_rust::accounts::{AccountFactory, ArgentAccountFactory, OpenZeppelinAccountFactory};\nuse starknet_rust::core::types::{BlockId, BlockTag};\nuse starknet_rust::providers::Provider;\nuse starknet_rust::providers::jsonrpc::{HttpTransport, JsonRpcClient};\nuse starknet_rust::signers::LedgerSigner;\nuse starknet_types_core::felt::Felt;\nuse tempfile::TempDir;\nuse url::Url;\n\nmod account;\nmod basic;\nmod network;\n\npub(crate) const OZ_LEDGER_PATH: &str = \"m//starknet'/sncast'/0'/0'/0\";\npub(crate) const READY_LEDGER_PATH: &str = \"m//starknet'/sncast'/0'/1'/0\";\npub(crate) const BRAAVOS_LEDGER_PATH: &str = \"m//starknet'/sncast'/0'/2'/0\";\npub(crate) const TEST_LEDGER_PATH: &str = OZ_LEDGER_PATH;\n\npub(crate) const TEST_LEDGER_PATH_STORED: &str = \"m/2645'/1195502025'/355113700'/0'/0'/0\";\n\n// TODO(#4221): Update to latest version and build in workflow\nconst APP_PATH: &str = \"tests/data/ledger-app/nanox#strk#0.25.13.elf\";\n\npub(crate) const LEDGER_PUBLIC_KEY: &str =\n    \"0x51f3e99d539868d8f45ca705ad6f75e68229a6037a919b15216b4e92a4d6d8\";\n\npub(crate) const LEDGER_ACCOUNT_NAME: &str = \"my_ledger\";\n\npub(crate) fn setup_speculos(port: u16) -> (Arc<SpeculosClient>, String) {\n    let client = Arc::new(SpeculosClient::new(DeviceModel::Nanox, port, APP_PATH).unwrap());\n    let url = format!(\"http://127.0.0.1:{port}\");\n    (client, url)\n}\n\nfn create_jsonrpc_client() -> JsonRpcClient<HttpTransport> {\n    JsonRpcClient::new(HttpTransport::new(Url::parse(URL).unwrap()))\n}\n\npub(crate) fn create_temp_accounts_json(address: Felt) -> TempDir {\n    let tempdir = TempDir::new().unwrap();\n    let accounts_json = json!({\n        \"alpha-sepolia\": {\n            LEDGER_ACCOUNT_NAME: {\n                \"public_key\": LEDGER_PUBLIC_KEY,\n                \"address\": format!(\"{address:#066x}\"),\n                \"deployed\": true,\n                \"type\": \"open_zeppelin\",\n                \"ledger_path\": TEST_LEDGER_PATH_STORED,\n            }\n        }\n    });\n    let accounts_path = tempdir.path().join(\"accounts.json\");\n    std::fs::write(&accounts_path, accounts_json.to_string()).unwrap();\n    tempdir\n}\n\npub(crate) async fn deploy_ledger_account(speculos_url: &str, path: &str, salt: Felt) -> Felt {\n    deploy_ledger_account_of_type(speculos_url, path, salt, AccountType::OpenZeppelin).await\n}\n\nasync fn deploy_if_needed<F>(\n    factory: F,\n    salt: Felt,\n    provider: &JsonRpcClient<HttpTransport>,\n) -> Felt\nwhere\n    F: AccountFactory + Sync,\n    F::SignError: Send,\n{\n    let deployment = factory.deploy_v3(salt);\n    let address = deployment.address();\n    let is_deployed = provider\n        .get_class_hash_at(BlockId::Tag(BlockTag::Latest), address)\n        .await\n        .is_ok();\n    mint_token(&format!(\"{address:#066x}\"), u128::MAX).await;\n    if !is_deployed {\n        deployment.send().await.expect(\"Failed to deploy account\");\n    }\n    address\n}\n\npub(crate) async fn deploy_ledger_account_of_type(\n    speculos_url: &str,\n    path: &str,\n    salt: Felt,\n    account_type: AccountType,\n) -> Felt {\n    let provider = create_jsonrpc_client();\n    let ui = UI::default();\n    let parsed = DerivationPathParser\n        .parse_ref(&Command::new(\"test\"), None, std::ffi::OsStr::new(path))\n        .unwrap();\n    parsed.print_warnings(&ui);\n    let parsed_path = parsed.path;\n\n    // SAFETY: All tests share the same devnet instance, so even if a race condition causes\n    // `set_var` to race with another test using a different ledger emulator URL, the account\n    // deployment will still reach the correct devnet and remain accessible to the original test.\n    // The ledger emulator URL has no effect on account deployment when using the emulator.\n    unsafe {\n        env::set_var(\"LEDGER_EMULATOR_URL\", speculos_url);\n    };\n\n    let app = create_ledger_app().await.unwrap();\n    let ledger_signer = LedgerSigner::new_with_app(parsed_path, app).unwrap();\n    let chain_id = starknet_rust::core::chain_id::SEPOLIA;\n\n    match account_type {\n        AccountType::OpenZeppelin => {\n            let factory = OpenZeppelinAccountFactory::new(\n                OZ_CLASS_HASH,\n                chain_id,\n                ledger_signer,\n                provider.clone(),\n            )\n            .await\n            .unwrap();\n            deploy_if_needed(factory, salt, &provider).await\n        }\n        AccountType::Ready | AccountType::Argent => {\n            let factory = ArgentAccountFactory::new(\n                READY_CLASS_HASH,\n                chain_id,\n                None,\n                ledger_signer,\n                provider.clone(),\n            )\n            .await\n            .unwrap();\n            deploy_if_needed(factory, salt, &provider).await\n        }\n        AccountType::Braavos => {\n            let factory = BraavosAccountFactory::new(\n                BRAAVOS_CLASS_HASH,\n                BRAAVOS_BASE_ACCOUNT_CLASS_HASH,\n                chain_id,\n                ledger_signer,\n                provider.clone(),\n            )\n            .await\n            .unwrap();\n            deploy_if_needed(factory, salt, &provider).await\n        }\n    }\n}\n\npub(crate) mod automation {\n    use super::*;\n\n    pub(crate) const APPROVE_PUBLIC_KEY: AutomationRule<'static> = AutomationRule {\n        text: Some(Cow::Borrowed(\"Confirm Public Key\")),\n        regexp: None,\n        x: None,\n        y: None,\n        conditions: &[],\n        actions: &[\n            // Press right\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: true,\n            },\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: false,\n            },\n            // Press right\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: true,\n            },\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: false,\n            },\n            // Press right\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: true,\n            },\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: false,\n            },\n            // Press both\n            AutomationAction::Button {\n                button: Button::Left,\n                pressed: true,\n            },\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: true,\n            },\n            AutomationAction::Button {\n                button: Button::Left,\n                pressed: false,\n            },\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: false,\n            },\n        ],\n    };\n\n    pub(crate) const ENABLE_BLIND_SIGN: AutomationRule<'static> = AutomationRule {\n        text: None,\n        regexp: Some(Cow::Borrowed(\"^(S)?tarknet$\")),\n        x: None,\n        y: None,\n        conditions: &[AutomationCondition {\n            varname: Cow::Borrowed(\"blind_enabled\"),\n            value: false,\n        }],\n        actions: &[\n            // Right\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: true,\n            },\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: false,\n            },\n            // Right\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: true,\n            },\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: false,\n            },\n            // Both\n            AutomationAction::Button {\n                button: Button::Left,\n                pressed: true,\n            },\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: true,\n            },\n            AutomationAction::Button {\n                button: Button::Left,\n                pressed: false,\n            },\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: false,\n            },\n            // Both\n            AutomationAction::Button {\n                button: Button::Left,\n                pressed: true,\n            },\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: true,\n            },\n            AutomationAction::Button {\n                button: Button::Left,\n                pressed: false,\n            },\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: false,\n            },\n            // Left\n            AutomationAction::Button {\n                button: Button::Left,\n                pressed: true,\n            },\n            AutomationAction::Button {\n                button: Button::Left,\n                pressed: false,\n            },\n            // Mark as done\n            AutomationAction::Setbool {\n                varname: Cow::Borrowed(\"blind_enabled\"),\n                value: true,\n            },\n        ],\n    };\n\n    /// Must be used with [`ENABLE_BLIND_SIGN`].\n    pub(crate) const APPROVE_BLIND_SIGN_HASH: AutomationRule<'static> = AutomationRule {\n        text: None,\n        regexp: Some(Cow::Borrowed(\"^Cancel$\")),\n        x: None,\n        y: None,\n        conditions: &[AutomationCondition {\n            varname: Cow::Borrowed(\"blind_enabled\"),\n            value: true,\n        }],\n        actions: &[\n            // Right\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: true,\n            },\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: false,\n            },\n            // Both\n            AutomationAction::Button {\n                button: Button::Left,\n                pressed: true,\n            },\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: true,\n            },\n            AutomationAction::Button {\n                button: Button::Left,\n                pressed: false,\n            },\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: false,\n            },\n            // Right\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: true,\n            },\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: false,\n            },\n            // Right\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: true,\n            },\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: false,\n            },\n            // Right\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: true,\n            },\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: false,\n            },\n            // Both\n            AutomationAction::Button {\n                button: Button::Left,\n                pressed: true,\n            },\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: true,\n            },\n            AutomationAction::Button {\n                button: Button::Left,\n                pressed: false,\n            },\n            AutomationAction::Button {\n                button: Button::Right,\n                pressed: false,\n            },\n        ],\n    };\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/ledger/network.rs",
    "content": "use crate::e2e::ledger::{\n    BRAAVOS_LEDGER_PATH, LEDGER_ACCOUNT_NAME, OZ_LEDGER_PATH, TEST_LEDGER_PATH, automation,\n    create_temp_accounts_json, deploy_ledger_account, deploy_ledger_account_of_type,\n    setup_speculos,\n};\nuse crate::helpers::constants::{\n    CONSTRUCTOR_WITH_PARAMS_CONTRACT_CLASS_HASH_SEPOLIA, CONTRACTS_DIR,\n    MAP_CONTRACT_ADDRESS_SEPOLIA, MAP_CONTRACT_CLASS_HASH_SEPOLIA, MULTICALL_CONFIGS_DIR, URL,\n};\nuse crate::helpers::fixtures::{\n    duplicate_contract_directory_with_salt, get_transaction_hash, get_transaction_receipt,\n    join_tempdirs,\n};\nuse crate::helpers::runner::runner;\nuse sncast::AccountType;\nuse starknet_rust::core::types::TransactionReceipt::{Declare, Invoke};\nuse starknet_types_core::felt::Felt;\nuse std::path::Path;\nuse tempfile::tempdir;\nuse test_case::test_case;\n\n#[tokio::test]\n#[ignore = \"requires Speculos installation\"]\nasync fn test_ledger_invoke_happy_case() {\n    let (client, url) = setup_speculos(5001);\n\n    client\n        .automation(&[\n            automation::ENABLE_BLIND_SIGN,\n            automation::APPROVE_BLIND_SIGN_HASH,\n        ])\n        .await\n        .unwrap();\n\n    let account_address = deploy_ledger_account(&url, TEST_LEDGER_PATH, Felt::from(5001_u32)).await;\n    let tempdir = create_temp_accounts_json(account_address);\n    let accounts_file = tempdir.path().join(\"accounts.json\");\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file.to_str().unwrap(),\n        \"--account\",\n        LEDGER_ACCOUNT_NAME,\n        \"--json\",\n        \"invoke\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"put\",\n        \"--calldata\",\n        \"0x1 0x2\",\n    ];\n\n    let output = runner(&args)\n        .env(\"LEDGER_EMULATOR_URL\", &url)\n        .assert()\n        .success()\n        .get_output()\n        .stdout\n        .clone();\n\n    let tx_hash = get_transaction_hash(&output);\n    let receipt = get_transaction_receipt(tx_hash).await;\n    assert!(matches!(receipt, Invoke(_)));\n}\n\n#[tokio::test]\n#[ignore = \"requires Speculos installation\"]\nasync fn test_ledger_invoke_with_wait() {\n    let (client, url) = setup_speculos(5002);\n\n    client\n        .automation(&[\n            automation::ENABLE_BLIND_SIGN,\n            automation::APPROVE_BLIND_SIGN_HASH,\n        ])\n        .await\n        .unwrap();\n\n    let account_address = deploy_ledger_account(&url, TEST_LEDGER_PATH, Felt::from(5002_u32)).await;\n    let tempdir = create_temp_accounts_json(account_address);\n    let accounts_file = tempdir.path().join(\"accounts.json\");\n\n    // Without `--ledger-path`, it should be taken from the accounts file\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file.to_str().unwrap(),\n        \"--account\",\n        LEDGER_ACCOUNT_NAME,\n        \"--json\",\n        \"--wait\",\n        \"invoke\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"put\",\n        \"--calldata\",\n        \"0x3 0x4\",\n    ];\n\n    let output = runner(&args)\n        .env(\"LEDGER_EMULATOR_URL\", &url)\n        .assert()\n        .success()\n        .get_output()\n        .stdout\n        .clone();\n\n    let tx_hash = get_transaction_hash(&output);\n    let receipt = get_transaction_receipt(tx_hash).await;\n    assert!(matches!(receipt, Invoke(_)));\n}\n\n#[tokio::test]\n#[ignore = \"requires Speculos installation\"]\nasync fn test_ledger_deploy_happy_case() {\n    let (client, url) = setup_speculos(5004);\n\n    client\n        .automation(&[\n            automation::ENABLE_BLIND_SIGN,\n            automation::APPROVE_BLIND_SIGN_HASH,\n        ])\n        .await\n        .unwrap();\n\n    let account_address = deploy_ledger_account(&url, TEST_LEDGER_PATH, Felt::from(5004_u32)).await;\n    let tempdir = create_temp_accounts_json(account_address);\n    let accounts_file = tempdir.path().join(\"accounts.json\");\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file.to_str().unwrap(),\n        \"--account\",\n        LEDGER_ACCOUNT_NAME,\n        \"--json\",\n        \"deploy\",\n        \"--url\",\n        URL,\n        \"--class-hash\",\n        MAP_CONTRACT_CLASS_HASH_SEPOLIA,\n        \"--salt\",\n        \"0x123\",\n        \"--unique\",\n    ];\n\n    let output = runner(&args)\n        .env(\"LEDGER_EMULATOR_URL\", &url)\n        .assert()\n        .success()\n        .get_output()\n        .stdout\n        .clone();\n\n    let tx_hash = get_transaction_hash(&output);\n    let receipt = get_transaction_receipt(tx_hash).await;\n    assert!(matches!(receipt, Invoke(_)));\n}\n\n#[tokio::test]\n#[ignore = \"requires Speculos installation\"]\nasync fn test_ledger_deploy_with_constructor() {\n    let (client, url) = setup_speculos(5005);\n\n    client\n        .automation(&[\n            automation::ENABLE_BLIND_SIGN,\n            automation::APPROVE_BLIND_SIGN_HASH,\n        ])\n        .await\n        .unwrap();\n\n    let account_address = deploy_ledger_account(&url, TEST_LEDGER_PATH, Felt::from(6001_u32)).await;\n    let tempdir = create_temp_accounts_json(account_address);\n    let accounts_file = tempdir.path().join(\"accounts.json\");\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file.to_str().unwrap(),\n        \"--account\",\n        LEDGER_ACCOUNT_NAME,\n        \"--json\",\n        \"deploy\",\n        \"--url\",\n        URL,\n        \"--class-hash\",\n        CONSTRUCTOR_WITH_PARAMS_CONTRACT_CLASS_HASH_SEPOLIA,\n        \"--salt\",\n        \"0x456\",\n        \"--unique\",\n        \"--constructor-calldata\",\n        \"0x1 0x1 0x0\",\n    ];\n\n    let output = runner(&args)\n        .env(\"LEDGER_EMULATOR_URL\", &url)\n        .assert()\n        .success()\n        .get_output()\n        .stdout\n        .clone();\n\n    let tx_hash = get_transaction_hash(&output);\n    let receipt = get_transaction_receipt(tx_hash).await;\n    assert!(matches!(receipt, Invoke(_)));\n}\n\n#[tokio::test]\n#[ignore = \"requires Speculos installation\"]\nasync fn test_ledger_declare() {\n    let (client, url) = setup_speculos(5006);\n\n    client\n        .automation(&[\n            automation::ENABLE_BLIND_SIGN,\n            automation::APPROVE_BLIND_SIGN_HASH,\n        ])\n        .await\n        .unwrap();\n\n    let account_address = deploy_ledger_account(&url, TEST_LEDGER_PATH, Felt::from(5006_u32)).await;\n\n    let contract_dir = duplicate_contract_directory_with_salt(\n        CONTRACTS_DIR.to_string() + \"/map\",\n        \"put\",\n        \"ledger_declare\",\n    );\n    let accounts_tempdir = create_temp_accounts_json(account_address);\n    join_tempdirs(&accounts_tempdir, &contract_dir);\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        LEDGER_ACCOUNT_NAME,\n        \"--json\",\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"Map\",\n    ];\n\n    let output = runner(&args)\n        .env(\"LEDGER_EMULATOR_URL\", &url)\n        .current_dir(contract_dir.path())\n        .assert()\n        .success()\n        .get_output()\n        .stdout\n        .clone();\n\n    let tx_hash = get_transaction_hash(&output);\n    let receipt = get_transaction_receipt(tx_hash).await;\n    assert!(matches!(receipt, Declare(_)));\n}\n\n#[test_case(AccountType::OpenZeppelin, \"oz\", Some(OZ_LEDGER_PATH), None, 5008; \"oz_account_type\")]\n#[test_case(AccountType::Ready, \"ready\", None, Some(1), 5009; \"ready_account_type\")]\n#[test_case(AccountType::Braavos, \"braavos\", Some(BRAAVOS_LEDGER_PATH), None, 5010; \"braavos_account_type\")]\n#[tokio::test]\n#[ignore = \"requires Speculos installation\"]\nasync fn test_ledger_import_and_invoke(\n    account_type: AccountType,\n    account_type_str: &str,\n    ledger_path: Option<&str>,\n    ledger_account_id: Option<u32>,\n    port: u16,\n) {\n    let (client, url) = setup_speculos(port);\n\n    client\n        .automation(&[\n            automation::ENABLE_BLIND_SIGN,\n            automation::APPROVE_BLIND_SIGN_HASH,\n            automation::APPROVE_PUBLIC_KEY,\n        ])\n        .await\n        .unwrap();\n\n    let account_id_path_buf;\n    let deploy_path = match (ledger_path, ledger_account_id) {\n        (Some(path), None) => path,\n        (None, Some(id)) => {\n            account_id_path_buf = format!(\"m//starknet'/sncast'/0'/{id}'/0\");\n            &account_id_path_buf\n        }\n        _ => unreachable!(),\n    };\n    let account_address =\n        deploy_ledger_account_of_type(&url, deploy_path, Felt::from(u32::from(port)), account_type)\n            .await;\n    let tempdir = tempdir().unwrap();\n    let accounts_file = tempdir.path().join(\"accounts.json\");\n    let accounts_file_str = accounts_file.to_str().unwrap();\n    let account_address_str = format!(\"{account_address:#x}\");\n    let ledger_account_id_str;\n    let mut import_args = vec![\n        \"--accounts-file\",\n        accounts_file_str,\n        \"account\",\n        \"import\",\n        \"--url\",\n        URL,\n        \"--name\",\n        LEDGER_ACCOUNT_NAME,\n        \"--address\",\n        &account_address_str,\n        \"--type\",\n        account_type_str,\n    ];\n    if let Some(path) = ledger_path {\n        import_args.push(\"--ledger-path\");\n        import_args.push(path);\n    } else if let Some(id) = ledger_account_id {\n        ledger_account_id_str = id.to_string();\n        import_args.push(\"--ledger-account-id\");\n        import_args.push(&ledger_account_id_str);\n    }\n    runner(&import_args)\n        .env(\"LEDGER_EMULATOR_URL\", &url)\n        .assert()\n        .success();\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file_str,\n        \"--account\",\n        LEDGER_ACCOUNT_NAME,\n        \"--json\",\n        \"invoke\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"put\",\n        \"--calldata\",\n        \"0x1 0x2\",\n    ];\n\n    let output = runner(&args)\n        .env(\"LEDGER_EMULATOR_URL\", &url)\n        .assert()\n        .success()\n        .get_output()\n        .stdout\n        .clone();\n\n    let tx_hash = get_transaction_hash(&output);\n    let receipt = get_transaction_receipt(tx_hash).await;\n    assert!(matches!(receipt, Invoke(_)));\n}\n\n#[tokio::test]\n#[ignore = \"requires Speculos installation\"]\nasync fn test_ledger_multicall() {\n    let (client, url) = setup_speculos(5007);\n\n    client\n        .automation(&[\n            automation::ENABLE_BLIND_SIGN,\n            automation::APPROVE_BLIND_SIGN_HASH,\n        ])\n        .await\n        .unwrap();\n\n    let account_address = deploy_ledger_account(&url, TEST_LEDGER_PATH, Felt::from(5007_u32)).await;\n    let tempdir = create_temp_accounts_json(account_address);\n    let accounts_file = tempdir.path().join(\"accounts.json\");\n\n    let multicall_path = project_root::get_project_root().expect(\"failed to get project root path\");\n    let multicall_path = Path::new(&multicall_path)\n        .join(MULTICALL_CONFIGS_DIR)\n        .join(\"invoke_ledger.toml\");\n    let multicall_path = multicall_path\n        .to_str()\n        .expect(\"failed converting path to str\");\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file.to_str().unwrap(),\n        \"--account\",\n        LEDGER_ACCOUNT_NAME,\n        \"--json\",\n        \"multicall\",\n        \"run\",\n        \"--url\",\n        URL,\n        \"--path\",\n        multicall_path,\n    ];\n\n    let output = runner(&args)\n        .env(\"LEDGER_EMULATOR_URL\", &url)\n        .assert()\n        .success()\n        .get_output()\n        .stdout\n        .clone();\n\n    let tx_hash = get_transaction_hash(&output);\n    let receipt = get_transaction_receipt(tx_hash).await;\n    assert!(matches!(receipt, Invoke(_)));\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/main_tests.rs",
    "content": "use crate::helpers::constants::{\n    ACCOUNT, ACCOUNT_FILE_PATH, CONTRACTS_DIR, MAP_CONTRACT_ADDRESS_SEPOLIA, URL,\n};\nuse crate::helpers::env::set_keystore_password_env;\nuse crate::helpers::fixtures::{\n    duplicate_contract_directory_with_salt, get_accounts_path, get_keystores_path,\n};\nuse crate::helpers::runner::runner;\nuse configuration::test_utils::copy_config_to_tempdir;\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stderr_contains;\n\n#[tokio::test]\nasync fn test_happy_case_from_sncast_config() {\n    let tempdir = copy_config_to_tempdir(\"tests/data/files/correct_snfoundry.toml\", None);\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"call\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        \"0x0\",\n        \"--function\",\n        \"doesnotmatter\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        \"Error: An error occurred in the called contract[..]Requested contract address [..] is not deployed[..]\",\n    );\n}\n\n#[tokio::test]\nasync fn test_happy_case_predefined_network() {\n    let tempdir = copy_config_to_tempdir(\"tests/data/files/correct_snfoundry.toml\", None);\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"--profile\",\n        \"no_url\",\n        \"call\",\n        \"--network\",\n        \"sepolia\",\n        \"--contract-address\",\n        \"0x0\",\n        \"--function\",\n        \"doesnotmatter\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        \"Error: An error occurred in the called contract[..]Requested contract address [..] is not deployed[..]\",\n    );\n}\n\n#[tokio::test]\nasync fn test_url_with_network_args() {\n    let tempdir = copy_config_to_tempdir(\"tests/data/files/correct_snfoundry.toml\", None);\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"--profile\",\n        \"no_url\",\n        \"call\",\n        \"--network\",\n        \"sepolia\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        \"0x0\",\n        \"--function\",\n        \"doesnotmatter\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        \"error: the argument '--network <NETWORK>' cannot be used with '--url <URL>'\",\n    );\n}\n\n#[tokio::test]\nasync fn test_happy_case_from_cli_no_scarb() {\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"--account\",\n        ACCOUNT,\n        \"call\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        \"0x0\",\n        \"--function\",\n        \"doesnotmatter\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        \"Error: An error occurred in the called contract[..]Requested contract address [..] is not deployed[..]\",\n    );\n}\n\n#[tokio::test]\nasync fn test_happy_case_from_cli_with_sncast_config() {\n    let tempdir = copy_config_to_tempdir(\"tests/data/files/correct_snfoundry.toml\", None);\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"--profile\",\n        \"default\",\n        \"--account\",\n        ACCOUNT,\n        \"call\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"get\",\n        \"--calldata\",\n        \"0x0\",\n        \"--block-id\",\n        \"latest\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        Success: Call completed\n        \n        Response:     0x0\n        Response Raw: [0x0]\n    \"});\n}\n\n#[tokio::test]\nasync fn test_happy_case_mixed() {\n    let tempdir = copy_config_to_tempdir(\"tests/data/files/correct_snfoundry.toml\", None);\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"--account\",\n        ACCOUNT,\n        \"call\",\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"get\",\n        \"--calldata\",\n        \"0x0\",\n        \"--block-id\",\n        \"latest\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        Success: Call completed\n        \n        Response:     0x0\n        Response Raw: [0x0]\n    \"});\n}\n\n#[tokio::test]\nasync fn test_nonexistent_account_address() {\n    let contract_path =\n        duplicate_contract_directory_with_salt(CONTRACTS_DIR.to_string() + \"/map\", \"dummy\", \"101\");\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/faulty_accounts.json\");\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"with_nonexistent_address\",\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"Map\",\n    ];\n\n    let snapbox = runner(&args).current_dir(contract_path.path());\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        \"Error: Account with address 0x1010101010011aaabbcc not found on network SN_SEPOLIA\",\n    );\n}\n\n#[tokio::test]\nasync fn test_missing_account_flag() {\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"whatever\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        \"Error: Account name not passed nor found in snfoundry.toml\",\n    );\n}\n\n#[tokio::test]\nasync fn test_inexistent_keystore() {\n    let args = vec![\n        \"--keystore\",\n        \"inexistent_key.json\",\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"my_contract\",\n    ];\n\n    let snapbox = runner(&args);\n\n    let output = snapbox.assert().failure();\n    assert_stderr_contains(output, \"Error: Failed to find keystore file\");\n}\n\n#[tokio::test]\nasync fn test_keystore_account_required() {\n    let args = vec![\n        \"--keystore\",\n        \"tests/data/keystore/my_key.json\",\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"my_contract\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        \"Error: Argument `--account` must be passed and be a path when using `--keystore`\",\n    );\n}\n\n#[tokio::test]\nasync fn test_keystore_inexistent_account() {\n    let args = vec![\n        \"--keystore\",\n        \"tests/data/keystore/my_key.json\",\n        \"--account\",\n        \"inexistent_account\",\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"my_contract\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        \"Error: File containing the account does not exist[..]\",\n    );\n}\n\n#[tokio::test]\nasync fn test_keystore_undeployed_account() {\n    let contract_path =\n        duplicate_contract_directory_with_salt(CONTRACTS_DIR.to_string() + \"/map\", \"put\", \"8\");\n    let my_key_path = get_keystores_path(\"tests/data/keystore/my_key.json\");\n    let my_account_undeployed_path =\n        get_keystores_path(\"tests/data/keystore/my_account_undeployed.json\");\n\n    let args = vec![\n        \"--keystore\",\n        my_key_path.as_str(),\n        \"--account\",\n        my_account_undeployed_path.as_str(),\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"Map\",\n    ];\n\n    set_keystore_password_env();\n    let snapbox = runner(&args).current_dir(contract_path.path());\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(output, \"Error: Failed to get account address\");\n}\n\n#[tokio::test]\nasync fn test_keystore_declare() {\n    let contract_path =\n        duplicate_contract_directory_with_salt(CONTRACTS_DIR.to_string() + \"/map\", \"put\", \"999\");\n    let my_key_path = get_keystores_path(\"tests/data/keystore/predeployed_key.json\");\n    let my_account_path = get_keystores_path(\"tests/data/keystore/predeployed_account.json\");\n    let args = vec![\n        \"--keystore\",\n        my_key_path.as_str(),\n        \"--account\",\n        my_account_path.as_str(),\n        \"declare\",\n        \"--url\",\n        URL,\n        \"--contract-name\",\n        \"Map\",\n    ];\n\n    set_keystore_password_env();\n    let snapbox = runner(&args).current_dir(contract_path.path());\n\n    assert!(snapbox.assert().success().get_output().stderr.is_empty());\n}\n\n#[tokio::test]\nasync fn test_keystore_and_ledger_conflict() {\n    let args = vec![\n        \"--keystore\",\n        \"some_keystore\",\n        \"account\",\n        \"create\",\n        \"--url\",\n        URL,\n        \"--ledger-path\",\n        \"m//starknet'/sncast'/0'/0'/0\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(output, \"Error: keystore and ledger cannot be used together\");\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/mod.rs",
    "content": "mod account;\npub mod balance;\nmod call;\nmod class_hash;\nmod class_hash_at;\nmod completions;\nmod declare;\nmod declare_from;\nmod deploy;\nmod devnet_accounts;\nmod fee;\nmod invoke;\npub(crate) mod ledger;\nmod main_tests;\nmod multicall;\nmod nonce;\nmod proof;\nmod script;\nmod selector;\nmod serialize;\nmod show_config;\nmod transaction;\nmod tx_status;\nmod verify;\n"
  },
  {
    "path": "crates/sncast/tests/e2e/multicall/execute.rs",
    "content": "use crate::helpers::constants::{\n    MAP_CONTRACT_ADDRESS_SEPOLIA, MAP_CONTRACT_CLASS_HASH_SEPOLIA, URL,\n};\nuse crate::helpers::fixtures::create_and_deploy_account;\nuse crate::helpers::runner::runner;\nuse indoc::indoc;\nuse shared::test_utils::output_assert::{assert_stderr_contains, assert_stdout_contains};\nuse sncast::AccountType;\nuse sncast::helpers::constants::OZ_CLASS_HASH;\n\n#[tokio::test]\nasync fn test_one_invoke() {\n    let tempdir = create_and_deploy_account(OZ_CLASS_HASH, AccountType::OpenZeppelin).await;\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"multicall\",\n        \"execute\",\n        \"--url\",\n        URL,\n        \"invoke\",\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--calldata\",\n        \"0x1 0x2\",\n        \"--function\",\n        \"put\",\n    ];\n\n    let snapbox = runner(&args)\n        .current_dir(tempdir.path())\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\");\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {\n            \"\n            Success: Multicall completed\n\n            Transaction Hash: 0x[..]\n\n            To see invocation details, visit:\n            transaction: [..]\n            \"\n        },\n    );\n}\n\n#[tokio::test]\nasync fn test_two_invokes() {\n    let tempdir = create_and_deploy_account(OZ_CLASS_HASH, AccountType::OpenZeppelin).await;\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"multicall\",\n        \"execute\",\n        \"--url\",\n        URL,\n        \"invoke\",\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--calldata\",\n        \"0x1 0x2\",\n        \"--function\",\n        \"put\",\n        \"/\",\n        \"invoke\",\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"put\",\n        \"--calldata\",\n        \"0x3 0x4\",\n    ];\n\n    let snapbox = runner(&args)\n        .current_dir(tempdir.path())\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\");\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {\n            \"\n            Success: Multicall completed\n\n            Transaction Hash: 0x[..]\n\n            To see invocation details, visit:\n            transaction: [..]\n            \"\n        },\n    );\n}\n\n#[tokio::test]\nasync fn test_deploy_and_invoke() {\n    let tempdir = create_and_deploy_account(OZ_CLASS_HASH, AccountType::OpenZeppelin).await;\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"multicall\",\n        \"execute\",\n        \"--url\",\n        URL,\n        \"deploy\",\n        \"--class-hash\",\n        MAP_CONTRACT_CLASS_HASH_SEPOLIA,\n        \"/\",\n        \"invoke\",\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"get\",\n        \"--calldata\",\n        \"0x1\",\n    ];\n\n    let snapbox = runner(&args)\n        .current_dir(tempdir.path())\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\");\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {\n            \"\n            Success: Multicall completed\n\n            Transaction Hash: 0x[..]\n\n            To see invocation details, visit:\n            transaction: [..]\n            \"\n        },\n    );\n}\n\n#[tokio::test]\nasync fn test_use_id() {\n    let tempdir = create_and_deploy_account(OZ_CLASS_HASH, AccountType::OpenZeppelin).await;\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"multicall\",\n        \"execute\",\n        \"--url\",\n        URL,\n        \"deploy\",\n        \"--class-hash\",\n        MAP_CONTRACT_CLASS_HASH_SEPOLIA,\n        \"--id\",\n        \"dpl\",\n        \"/\",\n        \"invoke\",\n        \"--contract-address\",\n        \"@dpl\",\n        \"--function\",\n        \"get\",\n        \"--calldata\",\n        \"@dpl\",\n    ];\n\n    let snapbox = runner(&args)\n        .current_dir(tempdir.path())\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\");\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {\n            \"\n            Success: Multicall completed\n\n            Transaction Hash: 0x[..]\n\n            To see invocation details, visit:\n            transaction: [..]\n            \"\n        },\n    );\n}\n\n#[tokio::test]\nasync fn test_non_existent_id() {\n    let tempdir = create_and_deploy_account(OZ_CLASS_HASH, AccountType::OpenZeppelin).await;\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"multicall\",\n        \"execute\",\n        \"--url\",\n        URL,\n        \"deploy\",\n        \"--class-hash\",\n        MAP_CONTRACT_CLASS_HASH_SEPOLIA,\n        \"--id\",\n        \"dpl\",\n        \"/\",\n        \"invoke\",\n        \"--contract-address\",\n        \"@non_existent_id\",\n        \"--function\",\n        \"get\",\n        \"--calldata\",\n        \"0x1\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {\n            \"\n            Error: Failed to find contract address for id: non_existent_id\n            \"\n        },\n    );\n}\n\n#[tokio::test]\nasync fn test_duplicated_id() {\n    let tempdir = create_and_deploy_account(OZ_CLASS_HASH, AccountType::OpenZeppelin).await;\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"multicall\",\n        \"execute\",\n        \"--url\",\n        URL,\n        \"deploy\",\n        \"--class-hash\",\n        MAP_CONTRACT_CLASS_HASH_SEPOLIA,\n        \"--id\",\n        \"dpl\",\n        \"/\",\n        \"deploy\",\n        \"--class-hash\",\n        MAP_CONTRACT_CLASS_HASH_SEPOLIA,\n        \"--id\",\n        \"dpl\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {\n            \"\n            Error: Duplicate id found: dpl\n            \"\n        },\n    );\n}\n\n#[tokio::test]\nasync fn test_unrecognized_command() {\n    let tempdir = create_and_deploy_account(OZ_CLASS_HASH, AccountType::OpenZeppelin).await;\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"multicall\",\n        \"execute\",\n        \"--url\",\n        URL,\n        \"declare\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {\n            \"\n            Command: multicall execute\n            Error: Unknown multicall command: 'declare'. Allowed commands: deploy, invoke\n            \"\n        },\n    );\n}\n\n#[tokio::test]\nasync fn test_empty_calls() {\n    let tempdir = create_and_deploy_account(OZ_CLASS_HASH, AccountType::OpenZeppelin).await;\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"multicall\",\n        \"execute\",\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {\n            \"\n            Command: multicall execute\n            Error: No valid multicall commands found to execute. Please check the provided commands.\n            \"\n        },\n    );\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/multicall/mod.rs",
    "content": "mod execute;\nmod new;\nmod run;\n"
  },
  {
    "path": "crates/sncast/tests/e2e/multicall/new.rs",
    "content": "use crate::helpers::constants::ACCOUNT_FILE_PATH;\nuse crate::helpers::runner::runner;\nuse indoc::{formatdoc, indoc};\nuse shared::test_utils::output_assert::{AsOutput, assert_stderr_contains, assert_stdout_contains};\nuse sncast::helpers::constants::DEFAULT_MULTICALL_CONTENTS;\nuse tempfile::tempdir;\n\n#[tokio::test]\nasync fn test_happy_case_file() {\n    let tmp_dir = tempdir().expect(\"Failed to create temporary directory\");\n    let multicall_toml_file = \"multicall.toml\";\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"multicall\",\n        \"new\",\n        multicall_toml_file,\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(tmp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        Success: Multicall template created successfully\n\n        Path:    multicall.toml\n        Content: [..]\n        \"},\n    );\n\n    let contents = std::fs::read_to_string(tmp_dir.path().join(multicall_toml_file))\n        .expect(\"Should have been able to read the file\");\n\n    assert!(contents.contains(DEFAULT_MULTICALL_CONTENTS));\n}\n\n#[tokio::test]\nasync fn test_no_output_path_specified() {\n    let args = vec![\"--accounts-file\", ACCOUNT_FILE_PATH, \"multicall\", \"new\"];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().failure();\n\n    let expected = indoc! {r\"\n    error: the following required arguments were not provided:\n      <OUTPUT_PATH>\n\n    Usage: sncast[..] multicall new <OUTPUT_PATH>\n\n    For more information, try '--help'.\n    \"};\n\n    assert!(output.as_stdout().is_empty());\n    assert_stderr_contains(output, expected);\n}\n\n#[tokio::test]\nasync fn test_directory_non_existent() {\n    let tmp_dir = tempdir().expect(\"failed to create temporary directory\");\n    let multicall_toml_path = \"non_existent_directory/multicall.toml\";\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"multicall\",\n        \"new\",\n        multicall_toml_path,\n    ];\n\n    let snapbox = runner(&args).current_dir(tmp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert!(output.as_stdout().is_empty());\n\n    let expected_file_error = \"No such file or directory [..]\";\n\n    assert_stderr_contains(\n        output,\n        formatdoc! {r\"\n        Command: multicall new\n        Error: {}\n        \", expected_file_error},\n    );\n}\n\n#[tokio::test]\nasync fn test_file_invalid_path() {\n    let tmp_dir = tempdir().expect(\"failed to create temporary directory\");\n    let tmp_path = tmp_dir\n        .path()\n        .to_str()\n        .expect(\"failed to convert path to string\");\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"multicall\",\n        \"new\",\n        tmp_path,\n    ];\n\n    let snapbox = runner(&args).current_dir(tmp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert!(output.as_stdout().is_empty());\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: multicall new\n        Error: Output file cannot be a directory[..]\n        \"},\n    );\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/multicall/run.rs",
    "content": "use crate::helpers::constants::{ACCOUNT_FILE_PATH, MULTICALL_CONFIGS_DIR, URL};\nuse crate::helpers::fixtures::create_and_deploy_oz_account;\nuse crate::helpers::runner::runner;\nuse indoc::{formatdoc, indoc};\nuse shared::test_utils::output_assert::{AsOutput, assert_stderr_contains};\nuse std::path::Path;\nuse test_case::test_case;\n\n#[test_case(\"oz_cairo_0\"; \"cairo_0_account\")]\n#[test_case(\"oz_cairo_1\"; \"cairo_1_account\")]\n#[test_case(\"oz\"; \"oz_account\")]\n#[test_case(\"ready\"; \"ready_account\")]\n#[test_case(\"braavos\"; \"braavos_account\")]\n#[tokio::test]\nasync fn test_happy_case(account: &str) {\n    let path = project_root::get_project_root().expect(\"failed to get project root path\");\n    let path = Path::new(&path)\n        .join(MULTICALL_CONFIGS_DIR)\n        .join(\"deploy_invoke.toml\");\n    let path = path.to_str().expect(\"failed converting path to str\");\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"--account\",\n        account,\n        \"multicall\",\n        \"run\",\n        \"--url\",\n        URL,\n        \"--path\",\n        path,\n    ];\n\n    let snapbox = runner(&args).env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\");\n    let output = snapbox.assert();\n\n    let stderr_str = output.as_stderr();\n    assert!(\n        stderr_str.is_empty(),\n        \"Multicall error, stderr: \\n{stderr_str}\",\n    );\n\n    output.stdout_eq(indoc! {r\"\n        Success: Multicall completed\n\n        Transaction Hash: 0x[..]\n\n        To see invocation details, visit:\n        transaction: [..]\n    \"});\n}\n\n#[tokio::test]\nasync fn test_calldata_ids() {\n    let tempdir = create_and_deploy_oz_account().await;\n\n    let path = project_root::get_project_root().expect(\"failed to get project root path\");\n    let path = Path::new(&path)\n        .join(MULTICALL_CONFIGS_DIR)\n        .join(\"deploy_invoke_calldata_ids.toml\");\n    let path = path.to_str().expect(\"failed converting path to str\");\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"multicall\",\n        \"run\",\n        \"--url\",\n        URL,\n        \"--path\",\n        path,\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(tempdir.path());\n    let output = snapbox.assert();\n\n    let stderr_str = output.as_stderr();\n    assert!(\n        stderr_str.is_empty(),\n        \"Multicall error, stderr: \\n{stderr_str}\",\n    );\n\n    output.stdout_eq(indoc! {r\"\n        Success: Multicall completed\n\n        Transaction Hash: 0x[..]\n\n        To see invocation details, visit:\n        transaction: [..]\n    \"});\n}\n\n#[tokio::test]\nasync fn test_invalid_path() {\n    let tempdir = create_and_deploy_oz_account().await;\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"multicall\",\n        \"run\",\n        \"--url\",\n        URL,\n        \"--path\",\n        \"non-existent\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert!(output.as_stdout().is_empty());\n\n    let expected_file_error = \"No such file or directory [..]\";\n\n    assert_stderr_contains(\n        output,\n        formatdoc! {r\"\n        Command: multicall run\n        Error: {}\n        \", expected_file_error},\n    );\n}\n\n#[tokio::test]\nasync fn test_deploy_fail() {\n    let tempdir = create_and_deploy_oz_account().await;\n\n    let path = project_root::get_project_root().expect(\"failed to get project root path\");\n    let path = Path::new(&path)\n        .join(MULTICALL_CONFIGS_DIR)\n        .join(\"deploy_invalid.toml\");\n    let path = path.to_str().expect(\"failed converting path to str\");\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"multicall\",\n        \"run\",\n        \"--url\",\n        URL,\n        \"--path\",\n        path,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: multicall run\n        Error: Transaction execution error [..]\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_invoke_fail() {\n    let tempdir = create_and_deploy_oz_account().await;\n\n    let path = project_root::get_project_root().expect(\"failed to get project root path\");\n    let path = Path::new(&path)\n        .join(MULTICALL_CONFIGS_DIR)\n        .join(\"invoke_invalid.toml\");\n    let path = path.to_str().expect(\"failed converting path to str\");\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"multicall\",\n        \"run\",\n        \"--url\",\n        URL,\n        \"--path\",\n        path,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: multicall run\n        Error: Transaction execution error [..]\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_deploy_success_invoke_fails() {\n    let tempdir = create_and_deploy_oz_account().await;\n\n    let path = project_root::get_project_root().expect(\"failed to get project root path\");\n    let path = Path::new(&path)\n        .join(MULTICALL_CONFIGS_DIR)\n        .join(\"deploy_succ_invoke_fail.toml\");\n    let path = path.to_str().expect(\"failed converting path to str\");\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"multicall\",\n        \"run\",\n        \"--url\",\n        URL,\n        \"--path\",\n        path,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    let output = snapbox.assert().success();\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: multicall run\n        Error: Transaction execution error [..]\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_numeric_inputs() {\n    let tempdir = create_and_deploy_oz_account().await;\n\n    let path = project_root::get_project_root().expect(\"failed to get project root path\");\n    let path = Path::new(&path)\n        .join(MULTICALL_CONFIGS_DIR)\n        .join(\"deploy_invoke_numeric_inputs.toml\");\n    let path = path.to_str().expect(\"failed converting path to str\");\n\n    let args = vec![\n        \"--accounts-file\",\n        \"accounts.json\",\n        \"--account\",\n        \"my_account\",\n        \"multicall\",\n        \"run\",\n        \"--url\",\n        URL,\n        \"--path\",\n        path,\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\")\n        .current_dir(tempdir.path());\n    let output = snapbox.assert();\n\n    let stderr_str = output.as_stderr();\n    assert!(\n        stderr_str.is_empty(),\n        \"Multicall error, stderr: \\n{stderr_str}\",\n    );\n\n    output.stdout_eq(indoc! {r\"\n        Success: Multicall completed\n\n        Transaction Hash: 0x[..]\n\n        To see invocation details, visit:\n        transaction: [..]\n    \"});\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/nonce.rs",
    "content": "use crate::helpers::constants::{DEVNET_PREDEPLOYED_ACCOUNT_ADDRESS, URL};\nuse crate::helpers::runner::runner;\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stderr_contains;\n\n#[tokio::test]\nasync fn test_happy_case() {\n    let args = vec![\n        \"get\",\n        \"nonce\",\n        DEVNET_PREDEPLOYED_ACCOUNT_ADDRESS,\n        \"--url\",\n        URL,\n    ];\n    let snapbox = runner(&args);\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        Success: Nonce retrieved\n\n        Nonce: 0x[..]\n    \"});\n}\n\n#[tokio::test]\nasync fn test_happy_case_with_block_id() {\n    let args = vec![\n        \"get\",\n        \"nonce\",\n        DEVNET_PREDEPLOYED_ACCOUNT_ADDRESS,\n        \"--block-id\",\n        \"latest\",\n        \"--url\",\n        URL,\n    ];\n    let snapbox = runner(&args);\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        Success: Nonce retrieved\n\n        Nonce: 0x[..]\n    \"});\n}\n\n#[tokio::test]\nasync fn test_happy_case_json() {\n    let args = vec![\n        \"--json\",\n        \"get\",\n        \"nonce\",\n        DEVNET_PREDEPLOYED_ACCOUNT_ADDRESS,\n        \"--url\",\n        URL,\n    ];\n    let snapbox = runner(&args);\n\n    snapbox.assert().success().stdout_eq(indoc! {r#\"\n        {\"command\":\"get nonce\",\"nonce\":\"0x[..]\",\"type\":\"response\"}\n    \"#});\n}\n\n#[tokio::test]\nasync fn test_nonexistent_contract_address() {\n    let args = vec![\"get\", \"nonce\", \"0x0\", \"--url\", URL];\n    let snapbox = runner(&args);\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: get nonce\n        Error: There is no contract at the specified address\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_invalid_block_id() {\n    let args = vec![\n        \"get\",\n        \"nonce\",\n        DEVNET_PREDEPLOYED_ACCOUNT_ADDRESS,\n        \"--block-id\",\n        \"invalid_block\",\n        \"--url\",\n        URL,\n    ];\n    let snapbox = runner(&args);\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: get nonce\n        Error: Incorrect value passed for block_id = invalid_block. Possible values are `pre_confirmed`, `latest`, block hash (hex) and block number (u64)\n        \"},\n    );\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/proof.rs",
    "content": "use crate::helpers::constants::{ACCOUNT_FILE_PATH, MAP_CONTRACT_ADDRESS_SEPOLIA, URL};\nuse crate::helpers::runner::runner;\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stderr_contains;\n\n// TODO (#4258): Add proper tests for sending invoke with proof.\n\n#[test]\nfn test_proof_file_requires_proof_facts_file() {\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"--account\",\n        \"user11\",\n        \"invoke\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"put\",\n        \"--calldata\",\n        \"0x1\",\n        \"0x2\",\n        \"--proof-file\",\n        \"proof.txt\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        error: the following required arguments were not provided:\n          --proof-facts-file <PROOF_FACTS_FILE>\n        \"},\n    );\n}\n\n#[test]\nfn test_proof_facts_file_requires_proof_file() {\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"--account\",\n        \"user11\",\n        \"invoke\",\n        \"--url\",\n        URL,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"put\",\n        \"--calldata\",\n        \"0x1\",\n        \"0x2\",\n        \"--proof-facts-file\",\n        \"proof-facts.txt\",\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        error: the following required arguments were not provided:\n          --proof-file <PROOF_FILE>\n        \"},\n    );\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/script/call.rs",
    "content": "use crate::helpers::constants::{SCRIPTS_DIR, URL};\nuse crate::helpers::fixtures::copy_script_directory_to_tempdir;\nuse crate::helpers::runner::runner;\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stdout_contains;\n\n#[tokio::test]\nasync fn test_happy_case() {\n    let tempdir =\n        copy_script_directory_to_tempdir(SCRIPTS_DIR.to_owned() + \"/misc\", Vec::<String>::new());\n\n    let script_name = \"call_happy\";\n    let args = vec![\"script\", \"run\", &script_name, \"--url\", URL];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        ...\n        Success: Script execution completed\n\n        Status: success\n    \"});\n}\n\n#[tokio::test]\nasync fn test_failing() {\n    let tempdir =\n        copy_script_directory_to_tempdir(SCRIPTS_DIR.to_owned() + \"/misc\", Vec::<String>::new());\n\n    let script_name = \"call_fail\";\n    let args = vec![\"script\", \"run\", &script_name, \"--url\", URL];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        Success: Script execution completed\n\n        Status: script panicked\n\n\n            0x63616c6c206661696c6564 ('call failed')\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_call_invalid_entry_point() {\n    let tempdir =\n        copy_script_directory_to_tempdir(SCRIPTS_DIR.to_owned() + \"/call\", Vec::<String>::new());\n\n    let script_name = \"invalid_entry_point\";\n    let args = vec![\"script\", \"run\", &script_name, \"--url\", URL];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        ScriptCommandError::ProviderError(ProviderError::StarknetError(StarknetError::EntryPointNotFound(())))\n        Success: Script execution completed\n        \n        Status: success\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_call_invalid_address() {\n    let tempdir =\n        copy_script_directory_to_tempdir(SCRIPTS_DIR.to_owned() + \"/call\", Vec::<String>::new());\n\n    let script_name = \"invalid_address\";\n    let args = vec![\"script\", \"run\", &script_name, \"--url\", URL];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        ScriptCommandError::ProviderError(ProviderError::StarknetError(StarknetError::ContractNotFound(())))\n        Success: Script execution completed\n\n        Status: success\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_call_invalid_calldata() {\n    let tempdir =\n        copy_script_directory_to_tempdir(SCRIPTS_DIR.to_owned() + \"/call\", Vec::<String>::new());\n\n    let script_name = \"invalid_calldata\";\n    let args = vec![\"script\", \"run\", &script_name, \"--url\", URL];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r#\"\n        ScriptCommandError::ProviderError(ProviderError::StarknetError(StarknetError::ContractError(ContractErrorData { revert_error: ContractExecutionError::Nested(&ContractExecutionErrorInner { [..] error: ContractExecutionError::Message(\"[\"0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473\"]\") }) })))\n        ScriptCommandError::ProviderError(ProviderError::StarknetError(StarknetError::ContractError(ContractErrorData { revert_error: ContractExecutionError::Nested(&ContractExecutionErrorInner { [..] error: ContractExecutionError::Message(\"[\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\"]\") }) })))\n        Success: Script execution completed\n        \n        Status: success\n        \"#},\n    );\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/script/declare.rs",
    "content": "use crate::helpers::constants::{ACCOUNT_FILE_PATH, SCRIPTS_DIR, URL};\nuse crate::helpers::fixtures::duplicate_contract_directory_with_salt;\nuse crate::helpers::fixtures::{copy_script_directory_to_tempdir, get_accounts_path};\nuse crate::helpers::runner::runner;\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stdout_contains;\nuse test_case::test_case;\n\n#[test_case(\"oz_cairo_0\"; \"cairo_0_account\")]\n#[test_case(\"oz_cairo_1\"; \"cairo_1_account\")]\n#[test_case(\"oz\"; \"oz_account\")]\n#[test_case(\"ready\"; \"ready_account\")]\n#[test_case(\"braavos\"; \"braavos_account\")]\n#[tokio::test]\nasync fn test_wrong_contract_name(account: &str) {\n    let contract_dir = duplicate_contract_directory_with_salt(\n        SCRIPTS_DIR.to_owned() + \"/map_script/contracts/\",\n        \"dummy\",\n        \"609\",\n    );\n    let tempdir = copy_script_directory_to_tempdir(\n        SCRIPTS_DIR.to_owned() + \"/declare/\",\n        vec![contract_dir.as_ref()],\n    );\n    let accounts_json_path = get_accounts_path(ACCOUNT_FILE_PATH);\n\n    let script_name = \"no_contract\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        account,\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r#\"\n        ScriptCommandError::ContractArtifactsNotFound(ErrorData { msg: \"Mapaaaa\" })\n        Success: Script execution completed\n        \n        Status: success\n        \"#},\n    );\n}\n\n#[tokio::test]\n#[ignore = \"TODO(#2912)\"]\nasync fn test_same_contract_twice() {\n    let contract_dir = duplicate_contract_directory_with_salt(\n        SCRIPTS_DIR.to_owned() + \"/map_script/contracts/\",\n        \"dummy\",\n        \"69\",\n    );\n    let script_dir = copy_script_directory_to_tempdir(\n        SCRIPTS_DIR.to_owned() + \"/declare/\",\n        vec![contract_dir.as_ref()],\n    );\n\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let script_name = \"same_contract_twice\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user4\",\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(script_dir.path());\n    snapbox.assert().success().stdout_eq(indoc! {\"\n        ...\n        success\n        DeclareResult::Success(DeclareTransactionResult { class_hash: [..], transaction_hash: [..] })\n        DeclareResult::AlreadyDeclared(AlreadyDeclaredResult { class_hash: [..] })\n        Success: Script execution completed\n        \n        Status: success\n    \"});\n}\n\n#[tokio::test]\nasync fn test_with_invalid_max_fee() {\n    let contract_dir = duplicate_contract_directory_with_salt(\n        SCRIPTS_DIR.to_owned() + \"/map_script/contracts/\",\n        \"dummy\",\n        \"19\",\n    );\n    let script_dir = copy_script_directory_to_tempdir(\n        SCRIPTS_DIR.to_owned() + \"/declare/\",\n        vec![contract_dir.as_ref()],\n    );\n    let accounts_json_path = get_accounts_path(ACCOUNT_FILE_PATH);\n\n    let script_name = \"with_invalid_max_fee\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user2\",\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(script_dir.path());\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        ...\n        ScriptCommandError::ProviderError(ProviderError::StarknetError(StarknetError::InsufficientResourcesForValidate(())))\n        Success: Script execution completed\n        \n        Status: success\n    \"});\n}\n\n#[tokio::test]\nasync fn test_with_invalid_nonce() {\n    let contract_dir = duplicate_contract_directory_with_salt(\n        SCRIPTS_DIR.to_owned() + \"/map_script/contracts/\",\n        \"dummy\",\n        \"21\",\n    );\n    let script_dir = copy_script_directory_to_tempdir(\n        SCRIPTS_DIR.to_owned() + \"/declare/\",\n        vec![contract_dir.as_ref()],\n    );\n    let accounts_json_path = get_accounts_path(ACCOUNT_FILE_PATH);\n\n    let script_name = \"with_invalid_nonce\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user4\",\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(script_dir.path());\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        ...\n        ScriptCommandError::ProviderError(ProviderError::StarknetError(StarknetError::InvalidTransactionNonce(())))\n        Success: Script execution completed\n        \n        Status: success\n    \"});\n}\n\n#[tokio::test]\n#[ignore = \"TODO(#3091) Devnet response does not match te spec\"]\nasync fn test_insufficient_account_balance() {\n    let contract_dir = duplicate_contract_directory_with_salt(\n        SCRIPTS_DIR.to_owned() + \"/map_script/contracts/\",\n        \"dummy\",\n        \"21\",\n    );\n    let script_dir = copy_script_directory_to_tempdir(\n        SCRIPTS_DIR.to_owned() + \"/declare/\",\n        vec![contract_dir.as_ref()],\n    );\n    let accounts_json_path = get_accounts_path(ACCOUNT_FILE_PATH);\n\n    let script_name = \"insufficient_account_balance\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user6\",\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(script_dir.path());\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        ...\n        ScriptCommandError::ProviderError(ProviderError::StarknetError(StarknetError::InsufficientAccountBalance(())))\n        Success: Script execution completed\n        \n        Status: success\n    \"});\n}\n\n#[tokio::test]\nasync fn test_sncast_timed_out() {\n    let contract_dir = duplicate_contract_directory_with_salt(\n        SCRIPTS_DIR.to_owned() + \"/map_script/contracts/\",\n        \"dummy\",\n        \"78\",\n    );\n    let script_dir = copy_script_directory_to_tempdir(\n        SCRIPTS_DIR.to_owned() + \"/declare/\",\n        vec![contract_dir.as_ref()],\n    );\n\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let script_name = \"time_out\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user8\",\n        \"--wait-timeout\",\n        \"1\",\n        \"--wait-retry-interval\",\n        \"1\",\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(script_dir.path());\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        ...\n        ScriptCommandError::WaitForTransactionError(WaitForTransactionError::TimedOut(()))\n        Success: Script execution completed\n        \n        Status: success\n    \"});\n}\n\n#[tokio::test]\nasync fn test_fee_settings() {\n    let contract_dir = duplicate_contract_directory_with_salt(\n        SCRIPTS_DIR.to_owned() + \"/map_script/contracts/\",\n        \"dummy\",\n        \"100\",\n    );\n    let script_dir = copy_script_directory_to_tempdir(\n        SCRIPTS_DIR.to_owned() + \"/declare/\",\n        vec![contract_dir.as_ref()],\n    );\n\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let script_name = \"fee_settings\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user4\",\n        \"script\",\n        \"run\",\n        \"--url\",\n        URL,\n        &script_name,\n    ];\n\n    let snapbox = runner(&args).current_dir(script_dir.path());\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        ...\n        success\n        Success: Script execution completed\n        \n        Status: success\n    \"});\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/script/deploy.rs",
    "content": "use crate::helpers::constants::{ACCOUNT_FILE_PATH, SCRIPTS_DIR, URL};\nuse crate::helpers::fixtures::{copy_script_directory_to_tempdir, get_accounts_path};\nuse crate::helpers::runner::runner;\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stdout_contains;\nuse test_case::test_case;\n\n#[test_case(\"oz_cairo_0\"; \"cairo_0_account\")]\n#[test_case(\"oz_cairo_1\"; \"cairo_1_account\")]\n#[test_case(\"oz\"; \"oz_account\")]\n#[test_case(\"ready\"; \"ready_account\")]\n#[test_case(\"braavos\"; \"braavos_account\")]\n#[tokio::test]\nasync fn test_with_calldata(account: &str) {\n    let tempdir =\n        copy_script_directory_to_tempdir(SCRIPTS_DIR.to_owned() + \"/deploy\", Vec::<String>::new());\n    let accounts_json_path = get_accounts_path(ACCOUNT_FILE_PATH);\n\n    let script_name = \"with_calldata\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        account,\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        Success: Script execution completed\n        \n        Status: success\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_with_fee_settings() {\n    let tempdir =\n        copy_script_directory_to_tempdir(SCRIPTS_DIR.to_owned() + \"/deploy\", Vec::<String>::new());\n    let accounts_json_path = get_accounts_path(ACCOUNT_FILE_PATH);\n\n    let script_name = \"fee_settings\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user7\",\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        Success: Script execution completed\n        \n        Status: success\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_same_salt_and_class_hash_deployed_twice() {\n    let tempdir =\n        copy_script_directory_to_tempdir(SCRIPTS_DIR.to_owned() + \"/deploy\", Vec::<String>::new());\n    let accounts_json_path = get_accounts_path(ACCOUNT_FILE_PATH);\n\n    let script_name = \"same_class_hash_and_salt\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user3\",\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r#\"\n        [..]\n        ScriptCommandError::WaitForTransactionError(WaitForTransactionError::TransactionError(TransactionError::Reverted(ErrorData { msg: \"Transaction execution has failed:\n        [..]\n        [..]: Error in the contract class constructor ([..]):\n        Deployment failed: contract already deployed at address [..]\n        \" })))\n        Success: Script execution completed\n        \n        Status: success\n        \"#},\n    );\n}\n\n#[tokio::test]\nasync fn test_invalid_class_hash() {\n    let tempdir =\n        copy_script_directory_to_tempdir(SCRIPTS_DIR.to_owned() + \"/deploy\", Vec::<String>::new());\n    let accounts_json_path = get_accounts_path(ACCOUNT_FILE_PATH);\n\n    let script_name = \"invalid_class_hash\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user2\",\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r#\"\n        [..]\n        ScriptCommandError::WaitForTransactionError(WaitForTransactionError::TransactionError(TransactionError::Reverted(ErrorData { msg: \"Transaction execution has failed:\n        [..]\n        [..]: Error in the contract class constructor ([..]):\n        Class with hash [..] is not declared.\n        \" })))\n        Success: Script execution completed\n        \n        Status: success\n        \"#},\n    );\n}\n\n#[tokio::test]\nasync fn test_invalid_call_data() {\n    let tempdir =\n        copy_script_directory_to_tempdir(SCRIPTS_DIR.to_owned() + \"/deploy\", Vec::<String>::new());\n    let accounts_json_path = get_accounts_path(ACCOUNT_FILE_PATH);\n\n    let script_name = \"invalid_calldata\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user5\",\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r#\"\n        [..]\n        ScriptCommandError::WaitForTransactionError(WaitForTransactionError::TransactionError(TransactionError::Reverted(ErrorData { msg: \"Transaction execution has failed:\n        [..]\n        [..]: Error in the contract class constructor ([..]):\n        Execution failed. Failure reason:\n        Error in contract [..]:\n        0x4661696c656420746f20646573657269616c697a6520706172616d202332 ('Failed to deserialize param #2').\n        \" })))\n        Success: Script execution completed\n        \n        Status: success\n        \"#},\n    );\n}\n\n#[tokio::test]\nasync fn test_invalid_nonce() {\n    let tempdir =\n        copy_script_directory_to_tempdir(SCRIPTS_DIR.to_owned() + \"/deploy\", Vec::<String>::new());\n    let accounts_json_path = get_accounts_path(ACCOUNT_FILE_PATH);\n\n    let script_name = \"invalid_nonce\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user5\",\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {\"\n        ScriptCommandError::ProviderError(ProviderError::StarknetError(StarknetError::InvalidTransactionNonce(())))\n        Success: Script execution completed\n        \n        Status: success\n        \"},\n    );\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/script/general.rs",
    "content": "use crate::helpers::constants::{ACCOUNT_FILE_PATH, SCRIPTS_DIR, URL};\nuse crate::helpers::fixtures::{\n    assert_tx_entry_failed, assert_tx_entry_success, copy_directory_to_tempdir,\n    copy_script_directory_to_tempdir, copy_workspace_directory_to_tempdir,\n    duplicate_contract_directory_with_salt, get_accounts_path,\n};\nuse crate::helpers::runner::runner;\nuse camino::Utf8PathBuf;\nuse indoc::{formatdoc, indoc};\nuse shared::test_utils::output_assert::assert_stderr_contains;\nuse sncast::get_default_state_file_name;\nuse sncast::state::state_file::{ScriptTransactionStatus, read_txs_from_state_file};\nuse tempfile::tempdir;\nuse test_case::test_case;\n\n#[test_case(\"oz_cairo_0\"; \"cairo_0_account\")]\n#[test_case(\"oz_cairo_1\"; \"cairo_1_account\")]\n#[test_case(\"oz\"; \"oz_account\")]\n#[test_case(\"ready\"; \"ready_account\")]\n#[test_case(\"braavos\"; \"braavos_account\")]\n#[tokio::test]\nasync fn test_happy_case(account: &str) {\n    let contract_dir = duplicate_contract_directory_with_salt(\n        SCRIPTS_DIR.to_owned() + \"/map_script/contracts/\",\n        \"dummy\",\n        account,\n    );\n    let script_dir = copy_script_directory_to_tempdir(\n        SCRIPTS_DIR.to_owned() + \"/map_script/scripts/\",\n        vec![contract_dir.as_ref()],\n    );\n\n    let accounts_json_path = get_accounts_path(ACCOUNT_FILE_PATH);\n\n    let script_name = \"map_script\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        account,\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(script_dir.path());\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        ...\n        Success: Script execution completed\n\n        Status: success\n    \"});\n}\n\n#[tokio::test]\nasync fn test_run_script_from_different_directory_no_path_to_scarb_toml() {\n    let tempdir = tempdir().expect(\"Unable to create temporary directory\");\n    let accounts_json_path = get_accounts_path(ACCOUNT_FILE_PATH);\n\n    let script_name = \"call_happy\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user1\",\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        \"Error: Path to Scarb.toml manifest does not exist =[..]\",\n    );\n}\n\n#[tokio::test]\n#[ignore = \"TODO: Fix this tests in https://github.com/foundry-rs/starknet-foundry/issues/2351\"]\nasync fn test_fail_when_using_starknet_syscall() {\n    let script_dir =\n        copy_script_directory_to_tempdir(SCRIPTS_DIR.to_owned() + \"/misc\", Vec::<String>::new());\n    let accounts_json_path = get_accounts_path(ACCOUNT_FILE_PATH);\n\n    let script_name = \"using_starknet_syscall\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user1\",\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(script_dir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: script run\n        Error: Got an exception while executing a hint: Hint Error: Starknet syscalls are not supported\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_incompatible_sncast_std_version() {\n    let script_dir = copy_directory_to_tempdir(SCRIPTS_DIR.to_owned() + \"/old_sncast_std/scripts\");\n    let accounts_json_path = get_accounts_path(ACCOUNT_FILE_PATH);\n\n    let script_name = \"map_script\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user4\",\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(script_dir.path());\n    let version = env!(\"CARGO_PKG_VERSION\");\n\n    snapbox.assert().success().stdout_eq(formatdoc! {r\"\n        ...\n        [WARNING] Package sncast_std version does not meet the recommended version requirement ={version}, it might result in unexpected behaviour\n        ...\n    \"});\n}\n\n#[tokio::test]\nasync fn test_multiple_packages_not_picked() {\n    let workspace_dir = copy_workspace_directory_to_tempdir(\n        SCRIPTS_DIR.to_owned() + \"/packages\",\n        vec![\"crates/scripts/script1\", \"crates/scripts/script2\"],\n        Vec::<String>::new().as_ref(),\n    );\n    let accounts_json_path = get_accounts_path(ACCOUNT_FILE_PATH);\n\n    let script_name = \"script1\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user4\",\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(workspace_dir.path());\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        \"Error: More than one package found in scarb metadata - specify package using --package flag\",\n    );\n}\n\n#[tokio::test]\nasync fn test_multiple_packages_happy_case() {\n    let workspace_dir = copy_workspace_directory_to_tempdir(\n        SCRIPTS_DIR.to_owned() + \"/packages\",\n        vec![\"crates/scripts/script1\", \"crates/scripts/script2\"],\n        Vec::<String>::new().as_ref(),\n    );\n    let accounts_json_path = get_accounts_path(ACCOUNT_FILE_PATH);\n\n    let script_name = \"script1\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user4\",\n        \"script\",\n        \"run\",\n        \"--package\",\n        &script_name,\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(workspace_dir.path());\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        ...\n        Success: Script execution completed\n\n        Status: success\n    \"});\n}\n\n#[tokio::test]\nasync fn test_run_script_display_debug_traits() {\n    let contract_dir = duplicate_contract_directory_with_salt(\n        SCRIPTS_DIR.to_owned() + \"/map_script/contracts/\",\n        \"dummy\",\n        \"45\",\n    );\n    let script_dir = copy_script_directory_to_tempdir(\n        SCRIPTS_DIR.to_owned() + \"/map_script/scripts/\",\n        vec![contract_dir.as_ref()],\n    );\n\n    let accounts_json_path = get_accounts_path(\"tests/data/accounts/accounts.json\");\n\n    let script_name = \"display_debug_traits_for_subcommand_responses\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user6\",\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(script_dir.path());\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        ...\n        test\n        declare_nonce: [..]\n        debug declare_nonce: [..]\n        Transaction hash: 0x[..]\n        declare_result: class_hash: [..], transaction_hash: [..]\n        debug declare_result: DeclareResult::Success(DeclareTransactionResult { class_hash: [..], transaction_hash: [..] })\n        Transaction hash: 0x[..]\n        deploy_result: contract_address: [..], transaction_hash: [..]\n        debug deploy_result: DeployResult { contract_address: [..], transaction_hash: [..] }\n        Transaction hash: 0x[..]\n        invoke_result: [..]\n        debug invoke_result: InvokeResult { transaction_hash: [..] }\n        call_result: [2]\n        debug call_result: CallResult { data: [2] }\n        Success: Script execution completed\n\n        Status: success\n    \"});\n}\n\n#[tokio::test]\nasync fn test_nonexistent_account_address() {\n    let script_name = \"map_script\";\n    let args = vec![\n        \"--accounts-file\",\n        \"../../../accounts/faulty_accounts.json\",\n        \"--account\",\n        \"with_nonexistent_address\",\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(SCRIPTS_DIR.to_owned() + \"/map_script/scripts\");\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: script run\n        Error: Account with address 0x1010101010011aaabbcc not found on network SN_SEPOLIA\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_no_account_passed() {\n    let script_name = \"map_script\";\n    let args = vec![\"script\", \"run\", &script_name, \"--url\", URL];\n\n    let snapbox = runner(&args).current_dir(SCRIPTS_DIR.to_owned() + \"/map_script/scripts\");\n    snapbox.assert().success().stdout_eq(indoc! {r#\"\n        ...\n        Success: Script execution completed\n        \n        Status: script panicked\n\n\n            \"Account not defined. Please ensure the correct account is passed to `script run` command\"\n        ...\n    \"#});\n}\n\n#[tokio::test]\nasync fn test_missing_field() {\n    let tempdir = copy_script_directory_to_tempdir(\n        SCRIPTS_DIR.to_owned() + \"/missing_field\",\n        Vec::<String>::new(),\n    );\n    let accounts_json_path = get_accounts_path(ACCOUNT_FILE_PATH);\n\n    let script_name = \"missing_field\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user4\",\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    // TODO(#4170): Replace [..] with actual error message when scarb 2.16.0 will be minimal test version.\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    snapbox.assert().failure().stdout_eq(indoc! {r\"\n        ...\n        error[..]: Wrong number of arguments. Expected 3, found: 2\n        ...\n    \"});\n}\n\n#[tokio::test]\nasync fn test_run_script_twice_with_state_file_enabled() {\n    let contract_dir = duplicate_contract_directory_with_salt(\n        SCRIPTS_DIR.to_owned() + \"/state_script/contracts/\",\n        \"dummy\",\n        \"34547\",\n    );\n    let script_dir = copy_script_directory_to_tempdir(\n        SCRIPTS_DIR.to_owned() + \"/state_script/scripts/\",\n        vec![contract_dir.as_ref()],\n    );\n\n    let accounts_json_path = get_accounts_path(ACCOUNT_FILE_PATH);\n\n    let script_name = \"state_script\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user7\",\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(script_dir.path());\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        ...\n        Success: Script execution completed\n\n        Status: success\n    \"});\n\n    let state_file_path = Utf8PathBuf::from_path_buf(\n        script_dir\n            .path()\n            .join(get_default_state_file_name(script_name, \"alpha-sepolia\")),\n    )\n    .unwrap();\n    let tx_entries_after_first_run = read_txs_from_state_file(&state_file_path).unwrap().unwrap();\n\n    assert!(\n        tx_entries_after_first_run\n            .transactions\n            .iter()\n            .all(|(_, value)| value.status == ScriptTransactionStatus::Success)\n    );\n\n    assert_eq!(tx_entries_after_first_run.transactions.len(), 3);\n\n    let snapbox = runner(&args).current_dir(script_dir.path());\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        ...\n        Success: Script execution completed\n\n        Status: success\n    \"});\n\n    let tx_entries_after_second_run = read_txs_from_state_file(&state_file_path).unwrap().unwrap();\n\n    assert_eq!(tx_entries_after_first_run, tx_entries_after_second_run);\n}\n\n#[tokio::test]\nasync fn test_state_file_contains_all_failed_txs() {\n    let script_dir = copy_script_directory_to_tempdir(\n        SCRIPTS_DIR.to_owned() + \"/state_file/\",\n        Vec::<String>::new(),\n    );\n\n    let accounts_json_path = get_accounts_path(ACCOUNT_FILE_PATH);\n\n    let script_name = \"all_tx_fail\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user10\",\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(script_dir.path());\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        ...\n        Success: Script execution completed\n\n        Status: success\n    \"});\n\n    let state_file_path = Utf8PathBuf::from_path_buf(\n        script_dir\n            .path()\n            .join(get_default_state_file_name(script_name, \"alpha-sepolia\")),\n    )\n    .unwrap();\n    let tx_entries_after_first_run = read_txs_from_state_file(&state_file_path).unwrap().unwrap();\n\n    assert_eq!(tx_entries_after_first_run.transactions.len(), 3);\n\n    let declare_tx_entry = tx_entries_after_first_run\n        .get(\"2341f038132e07bd9fa3cabf5fa0c3fde26b0fc03e7b09198dbd230e1b1e071c\")\n        .unwrap();\n    assert_tx_entry_failed(\n        declare_tx_entry,\n        \"declare\",\n        ScriptTransactionStatus::Error,\n        vec![\n            \"Failed to find Not_this_time artifact in starknet_artifacts.json file. Please make sure you have specified correct package using `--package` flag.\",\n        ],\n    );\n\n    let deploy_tx_entry = tx_entries_after_first_run\n        .get(\"2402e1bcaf641961a4e97b76cad1e91f9522e4a34e57b5f740f3ea529b853c8f\")\n        .unwrap();\n    assert_tx_entry_failed(\n        deploy_tx_entry,\n        \"deploy\",\n        ScriptTransactionStatus::Fail,\n        vec![\"Class with hash 0x\", \"is not declared\"],\n    );\n\n    let invoke_tx_entry = tx_entries_after_first_run\n        .get(\"9e0f8008202594e57674569610b5cd22079802b0929f570dfe118b107cb24221\")\n        .unwrap();\n    assert_tx_entry_failed(\n        invoke_tx_entry,\n        \"invoke\",\n        ScriptTransactionStatus::Fail,\n        vec![\"Requested contract address\", \"is not deployed\"],\n    );\n}\n\n#[tokio::test]\nasync fn test_state_file_rerun_failed_tx() {\n    let script_dir = copy_script_directory_to_tempdir(\n        SCRIPTS_DIR.to_owned() + \"/state_file/\",\n        Vec::<String>::new(),\n    );\n    let script_name = \"rerun_failed_tx\";\n    let map_invoke_tx_id = \"31829eae07da513c7e6f457b9ac48af0004512db23efeae38734af97834bb273\";\n    let accounts_json_path = get_accounts_path(ACCOUNT_FILE_PATH);\n    let state_file_path = Utf8PathBuf::from_path_buf(\n        script_dir\n            .path()\n            .join(get_default_state_file_name(script_name, \"alpha-sepolia\")),\n    )\n    .unwrap();\n\n    let tx_entries_before = read_txs_from_state_file(&state_file_path).unwrap().unwrap();\n    assert_eq!(tx_entries_before.transactions.len(), 1);\n    let invoke_tx_entry_before = tx_entries_before.get(map_invoke_tx_id).unwrap();\n    assert_tx_entry_failed(\n        invoke_tx_entry_before,\n        \"invoke\",\n        ScriptTransactionStatus::Error,\n        vec![\"Requested contract address\", \"is not deployed\"],\n    );\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user4\",\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(script_dir.path());\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        ...\n        Success: Script execution completed\n        \n        Status: success\n    \"});\n\n    let tx_entries_after_first_run = read_txs_from_state_file(&state_file_path).unwrap().unwrap();\n    assert_eq!(tx_entries_after_first_run.transactions.len(), 1);\n\n    let invoke_tx_entry = tx_entries_after_first_run.get(map_invoke_tx_id).unwrap();\n    assert_tx_entry_success(invoke_tx_entry, \"invoke\");\n}\n\n#[tokio::test]\nasync fn test_using_release_profile() {\n    let contract_dir = duplicate_contract_directory_with_salt(\n        SCRIPTS_DIR.to_owned() + \"/map_script/contracts/\",\n        \"dummy\",\n        \"69420\",\n    );\n    let script_dir = copy_script_directory_to_tempdir(\n        SCRIPTS_DIR.to_owned() + \"/map_script/scripts/\",\n        vec![contract_dir.as_ref()],\n    );\n\n    let accounts_json_path = get_accounts_path(ACCOUNT_FILE_PATH);\n\n    let script_name = \"map_script\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user5\",\n        \"--profile\",\n        \"release\",\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(script_dir.path());\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        ...\n        Success: Script execution completed\n        \n        Status: success\n    \"});\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/script/init.rs",
    "content": "use crate::helpers::runner::runner;\nuse camino::Utf8PathBuf;\nuse indoc::{formatdoc, indoc};\nuse scarb_api::ScarbCommand;\nuse scarb_api::version::scarb_version;\nuse semver::Version;\nuse shared::test_utils::output_assert::{assert_stderr_contains, assert_stdout_contains};\nuse sncast::helpers::constants::INIT_SCRIPTS_DIR;\nuse sncast::helpers::scarb_utils::get_cairo_version;\nuse tempfile::TempDir;\n\nconst SCARB_2_14_0: Version = Version::new(2, 14, 0);\n\n#[test]\nfn test_script_init_happy_case() {\n    let script_name = \"my_script\";\n    let temp_dir = TempDir::new().expect(\"Unable to create a temporary directory\");\n\n    let snapbox = runner(&[\"script\", \"init\", script_name]).current_dir(temp_dir.path());\n\n    snapbox.assert().stdout_eq(formatdoc! {r\"\n        [WARNING] [..]\n        Success: Script initialization completed\n        \n        Initialized `{script_name}` at [..]/scripts/{script_name}\n    \"});\n\n    let script_dir_path = temp_dir.path().join(INIT_SCRIPTS_DIR).join(script_name);\n    let scarb_toml_path = script_dir_path.join(\"Scarb.toml\");\n\n    let scarb_toml_content = std::fs::read_to_string(&scarb_toml_path).unwrap();\n    let lib_cairo_content = std::fs::read_to_string(script_dir_path.join(\"src/lib.cairo\")).unwrap();\n    let main_file_content =\n        std::fs::read_to_string(script_dir_path.join(format!(\"src/{script_name}.cairo\"))).unwrap();\n\n    let cast_version = env!(\"CARGO_PKG_VERSION\");\n\n    let scarb_toml_path = Utf8PathBuf::from_path_buf(scarb_toml_path).unwrap();\n    let cairo_version = get_cairo_version(&scarb_toml_path).unwrap();\n\n    let scarb_version = scarb_version().unwrap().scarb;\n\n    let expected_scarb_toml = if scarb_version >= SCARB_2_14_0 {\n        formatdoc!(\n            r#\"\n            [package]\n            name = \"{script_name}\"\n            version = \"0.1.0\"\n            edition = [..]\n\n            # See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html\n\n            [executable]\n\n            [cairo]\n            enable-gas = false\n\n            [dependencies]\n            cairo_execute = \"{cairo_version}\"\n            sncast_std = \"{cast_version}\"\n            starknet = \">={cairo_version}\"\n        \"#\n        )\n    } else {\n        formatdoc!(\n            r#\"\n            [package]\n            name = \"{script_name}\"\n            version = \"0.1.0\"\n            edition = [..]\n\n            # See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html\n\n            [dependencies]\n            sncast_std = \"{cast_version}\"\n            starknet = \">={cairo_version}\"\n        \"#\n        )\n    };\n\n    snapbox::assert_data_eq!(scarb_toml_content, expected_scarb_toml);\n\n    assert_eq!(\n        lib_cairo_content,\n        formatdoc! {r\"\n            mod {script_name};\n        \"}\n    );\n    assert_eq!(\n        main_file_content,\n        indoc! {r#\"\n            use sncast_std::call;\n\n            // The example below uses a contract deployed to the Sepolia testnet\n            const CONTRACT_ADDRESS: felt252 =\n                0x07e867f1fa6da2108dd2b3d534f1fbec411c5ec9504eb3baa1e49c7a0bef5ab5;\n\n            fn main() {\n                let call_result = call(\n                    CONTRACT_ADDRESS.try_into().unwrap(), selector!(\"get_greeting\"), array![],\n                )\n                    .expect('call failed');\n\n                assert(*call_result.data[1] == 'Hello, Starknet!', *call_result.data[1]);\n\n                println!(\"{:?}\", call_result);\n            }\n        \"#}\n    );\n}\n\n#[test]\nfn test_init_fails_when_scripts_dir_exists_in_cwd() {\n    let script_name = \"my_script\";\n    let temp_dir = TempDir::new().expect(\"Unable to create a temporary directory\");\n\n    std::fs::create_dir_all(temp_dir.path().join(INIT_SCRIPTS_DIR))\n        .expect(\"Failed to create scripts directory in the current temp directory\");\n\n    let snapbox = runner(&[\"script\", \"init\", script_name]).current_dir(temp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: script init\n        Error: Scripts directory already exists at [..]\n        \"},\n    );\n}\n\n#[test]\nfn test_init_twice_fails() {\n    let script_name = \"my_script\";\n    let temp_dir = TempDir::new().expect(\"Unable to create a temporary directory\");\n\n    let args = vec![\"script\", \"init\", script_name];\n    runner(&args)\n        .current_dir(temp_dir.path())\n        .assert()\n        .success();\n\n    assert!(temp_dir.path().join(INIT_SCRIPTS_DIR).exists());\n\n    let snapbox = runner(&args).current_dir(temp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: script init\n        Error: Scripts directory already exists at [..]\n        \"},\n    );\n}\n\n#[ignore = \"Fails if plugin is unreleased, fixed and restore after release\"]\n#[test]\nfn test_initialized_script_compiles() {\n    let script_name = \"my_script\";\n    let temp_dir = TempDir::new().expect(\"Unable to create a temporary directory\");\n\n    let snapbox = runner(&[\"script\", \"init\", script_name]).current_dir(temp_dir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        formatdoc! {r\"\n        [WARNING] The newly created script isn't auto-added to the workspace. [..]\n        Success: Script initialization completed\n        \n        Initialized `{script_name}` at [..]{script_name}\n    \"},\n    );\n\n    let script_dir_path = temp_dir.path().join(INIT_SCRIPTS_DIR).join(script_name);\n\n    // Using a tag during the release process will cause the test to fail as the new tag won't exist in the repository yet\n    // This command will overwrite sncast_std dependency to use the master branch instead of a tag\n    ScarbCommand::new_with_stdio()\n        .current_dir(&script_dir_path)\n        .args([\n            \"--offline\",\n            \"add\",\n            \"sncast_std\",\n            \"--git\",\n            \"https://github.com/foundry-rs/starknet-foundry.git\",\n            \"--branch\",\n            \"master\",\n        ])\n        .run()\n        .expect(\"Failed to overwrite sncast_std dependency in Scarb.toml\");\n\n    ScarbCommand::new_with_stdio()\n        .current_dir(&script_dir_path)\n        .arg(\"build\")\n        .run()\n        .expect(\"Failed to compile the initialized script\");\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/script/invoke.rs",
    "content": "use crate::helpers::constants::{ACCOUNT_FILE_PATH, SCRIPTS_DIR, URL};\nuse crate::helpers::fixtures::{copy_script_directory_to_tempdir, get_accounts_path};\nuse crate::helpers::runner::runner;\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stdout_contains;\nuse test_case::test_case;\n\n#[test_case(\"oz_cairo_0\"; \"cairo_0_account\")]\n#[test_case(\"oz_cairo_1\"; \"cairo_1_account\")]\n#[test_case(\"oz\"; \"oz_account\")]\n#[test_case(\"ready\"; \"ready_account\")]\n#[test_case(\"braavos\"; \"braavos_account\")]\n#[tokio::test]\nasync fn test_insufficient_resource_for_validate(account: &str) {\n    let script_dir =\n        copy_script_directory_to_tempdir(SCRIPTS_DIR.to_owned() + \"/invoke\", Vec::<String>::new());\n    let accounts_json_path = get_accounts_path(ACCOUNT_FILE_PATH);\n\n    let script_name = \"max_fee_too_low\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        account,\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(script_dir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        ScriptCommandError::ProviderError(ProviderError::StarknetError(StarknetError::InsufficientResourcesForValidate(())))\n        Success: Script execution completed\n        \n        Status: success\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_contract_does_not_exist() {\n    let script_dir =\n        copy_script_directory_to_tempdir(SCRIPTS_DIR.to_owned() + \"/invoke\", Vec::<String>::new());\n    let accounts_json_path = get_accounts_path(ACCOUNT_FILE_PATH);\n\n    let script_name = \"contract_does_not_exist\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user4\",\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(script_dir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r#\"\n        [..]\n        ScriptCommandError::WaitForTransactionError(WaitForTransactionError::TransactionError(TransactionError::Reverted(ErrorData { msg: \"Transaction execution has failed:\n        [..]\n        [..]: Error in the called contract ([..]):\n        Requested contract address [..] is not deployed.\n        \" })))\n        Success: Script execution completed\n        \n        Status: success\n        \"#},\n    );\n}\n\n#[test]\nfn test_wrong_function_name() {\n    let script_dir =\n        copy_script_directory_to_tempdir(SCRIPTS_DIR.to_owned() + \"/invoke\", Vec::<String>::new());\n    let accounts_json_path = get_accounts_path(ACCOUNT_FILE_PATH);\n\n    let script_name = \"wrong_function_name\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user4\",\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(script_dir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r#\"\n        [..]\n        ScriptCommandError::ProviderError(ProviderError::StarknetError(StarknetError::TransactionExecutionError(TransactionExecutionErrorData { transaction_index: 0, execution_error: ContractExecutionError::Nested(&ContractExecutionErrorInner { contract_address: [..], class_hash: [..], selector: [..], error: ContractExecutionError::Nested(&ContractExecutionErrorInner { contract_address: [..], class_hash: [..], selector: [..], error: ContractExecutionError::Nested(&ContractExecutionErrorInner { contract_address: [..], class_hash: [..], selector: [..], error: ContractExecutionError::Message(\"Transaction execution has failed:\n        0: Error in the called contract (contract address: 0x03ffc270312cbefaf2fb4a88e97cc186797bada41a291331186ec5ca316e32fa, class hash: 0x05b4b537eaa2399e3aa99c4e2e0208ebd6c71bc1467938cd52c798c601e43564, selector: [..]):\n        Execution failed. Failure reason:\n        Error in contract (contract address: [..], class hash: [..], selector: [..]):\n        Error in contract (contract address: [..], class hash: [..], selector: [..]):\n        [..] ('ENTRYPOINT_NOT_FOUND').\n         [\"0x454e545259504f494e545f4e4f545f464f554e44\"]\") }) }) }) })))\n        Success: Script execution completed\n        \n        Status: success\n        \"#},\n    );\n}\n\n#[test]\nfn test_wrong_calldata() {\n    let script_dir =\n        copy_script_directory_to_tempdir(SCRIPTS_DIR.to_owned() + \"/invoke\", Vec::<String>::new());\n    let accounts_json_path = get_accounts_path(ACCOUNT_FILE_PATH);\n\n    let script_name = \"wrong_calldata\";\n    let args = vec![\n        \"--accounts-file\",\n        accounts_json_path.as_str(),\n        \"--account\",\n        \"user4\",\n        \"script\",\n        \"run\",\n        &script_name,\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(script_dir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r#\"\n        ScriptCommandError::ProviderError(ProviderError::StarknetError(StarknetError::TransactionExecutionError(TransactionExecutionErrorData { transaction_index: 0, execution_error: ContractExecutionError::Nested(&ContractExecutionErrorInner { contract_address: [..], class_hash: [..], selector: [..], error: ContractExecutionError::Nested(&ContractExecutionErrorInner { contract_address: [..], class_hash: [..], selector: [..], error: ContractExecutionError::Nested(&ContractExecutionErrorInner { contract_address: [..], class_hash: [..], selector: [..], error: ContractExecutionError::Message(\"Transaction execution has failed:\n        0: Error in the called contract (contract address: [..], class hash: [..], selector: [..]):\n        Execution failed. Failure reason:\n        Error in contract (contract address: [..], class hash: [..], selector: [..]):\n        Error in contract (contract address: [..], class hash: [..], selector: [..]):\n        [..] ('Failed to deserialize param #2').\n         [\"0x4661696c656420746f20646573657269616c697a6520706172616d202332\"]\") }) }) }) })))\n        Success: Script execution completed\n        \n        Status: success\n        \"#},\n    );\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/script/mod.rs",
    "content": "mod call;\nmod declare;\nmod deploy;\nmod general;\nmod init;\nmod invoke;\nmod tx_status;\n"
  },
  {
    "path": "crates/sncast/tests/e2e/script/tx_status.rs",
    "content": "use crate::helpers::constants::{SCRIPTS_DIR, URL};\nuse crate::helpers::fixtures::copy_script_directory_to_tempdir;\nuse crate::helpers::runner::runner;\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stdout_contains;\n\n#[tokio::test]\nasync fn test_tx_status_status_reverted() {\n    let tempdir = copy_script_directory_to_tempdir(\n        SCRIPTS_DIR.to_owned() + \"/tx_status\",\n        Vec::<String>::new(),\n    );\n\n    let script_name = \"status_reverted\";\n    let args = vec![\"script\", \"run\", &script_name, \"--url\", URL];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        finality_status: AcceptedOnL1, execution_status: Reverted\n        TxStatusResult { finality_status: FinalityStatus::AcceptedOnL1(()), execution_status: Option::Some(ExecutionStatus::Reverted(())) }\n        Success: Script execution completed\n        \n        Status: success\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_tx_status_status_succeeded() {\n    let tempdir = copy_script_directory_to_tempdir(\n        SCRIPTS_DIR.to_owned() + \"/tx_status\",\n        Vec::<String>::new(),\n    );\n\n    let script_name = \"status_succeeded\";\n    let args = vec![\"script\", \"run\", &script_name, \"--url\", URL];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        finality_status: AcceptedOnL1, execution_status: Succeeded\n        TxStatusResult { finality_status: FinalityStatus::AcceptedOnL1(()), execution_status: Option::Some(ExecutionStatus::Succeeded(())) }\n        Success: Script execution completed\n        \n        Status: success\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_tx_status_incorrect_transaction_hash() {\n    let tempdir = copy_script_directory_to_tempdir(\n        SCRIPTS_DIR.to_owned() + \"/tx_status\",\n        Vec::<String>::new(),\n    );\n\n    let script_name = \"incorrect_transaction_hash\";\n    let args = vec![\"script\", \"run\", &script_name, \"--url\", URL];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n        ScriptCommandError::ProviderError(ProviderError::StarknetError(StarknetError::TransactionHashNotFound(())))\n        Success: Script execution completed\n        \n        Status: success\n        \"},\n    );\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/selector.rs",
    "content": "use crate::helpers::runner::runner;\nuse indoc::indoc;\nuse shared::test_utils::output_assert::{assert_stderr_contains, assert_stdout_contains};\n\n#[test]\nfn test_selector_happy_case() {\n    let args = vec![\"utils\", \"selector\", \"transfer\"];\n    let snapbox = runner(&args);\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        indoc! {r\"\n            Selector: 0x0083afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e\n        \"},\n    );\n}\n\n#[test]\nfn test_selector_json_output() {\n    let args = vec![\"--json\", \"utils\", \"selector\", \"transfer\"];\n    let snapbox = runner(&args);\n    let output = snapbox.assert().success();\n    let stdout = output.get_output().stdout.clone();\n\n    let json: serde_json::Value = serde_json::from_slice(&stdout).unwrap();\n    assert_eq!(json[\"command\"], \"selector\");\n    assert_eq!(json[\"type\"], \"response\");\n    assert_eq!(\n        json[\"selector\"],\n        \"0x0083afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e\"\n    );\n}\n\n#[test]\nfn test_selector_with_parentheses() {\n    let args = vec![\"utils\", \"selector\", \"transfer(u256)\"];\n    let snapbox = runner(&args);\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n            Error: Parentheses and the content within should not be supplied\n        \"},\n    );\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/serialize.rs",
    "content": "use crate::helpers::constants::{\n    DATA_TRANSFORMER_CONTRACT_ABI_PATH, DATA_TRANSFORMER_CONTRACT_ADDRESS_SEPOLIA,\n    DATA_TRANSFORMER_CONTRACT_CLASS_HASH_SEPOLIA, MAP_CONTRACT_ADDRESS_SEPOLIA, URL,\n};\nuse crate::helpers::runner::runner;\nuse crate::helpers::shell::os_specific_shell;\nuse camino::Utf8PathBuf;\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stderr_contains;\nuse snapbox::cargo_bin;\nuse tempfile::tempdir;\n\n#[tokio::test]\nasync fn test_happy_case() {\n    let tempdir = tempdir().unwrap();\n\n    let calldata = r\"NestedStructWithField { a: SimpleStruct { a: 0x24 }, b: 96 }\";\n\n    let args = vec![\n        \"utils\",\n        \"serialize\",\n        \"--arguments\",\n        calldata,\n        \"--contract-address\",\n        DATA_TRANSFORMER_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"nested_struct_fn\",\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n    Calldata: [0x24, 0x60]\n    \"});\n}\n\n#[tokio::test]\nasync fn test_happy_case_class_hash() {\n    let tempdir = tempdir().unwrap();\n\n    let calldata = r\"NestedStructWithField { a: SimpleStruct { a: 0x24 }, b: 96 }\";\n\n    let args = vec![\n        \"utils\",\n        \"serialize\",\n        \"--arguments\",\n        calldata,\n        \"--class-hash\",\n        DATA_TRANSFORMER_CONTRACT_CLASS_HASH_SEPOLIA,\n        \"--function\",\n        \"nested_struct_fn\",\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n    Calldata: [0x24, 0x60]\n    \"});\n}\n\n#[tokio::test]\nasync fn test_happy_case_abi_file() {\n    let tempdir = tempdir().unwrap();\n    let abi_file_path = Utf8PathBuf::from(DATA_TRANSFORMER_CONTRACT_ABI_PATH);\n    let temp_abi_file_path = tempdir.path().join(abi_file_path.file_name().unwrap());\n    std::fs::copy(abi_file_path, &temp_abi_file_path)\n        .expect(\"Failed to copy ABI file to temp directory\");\n\n    let calldata = r\"NestedStructWithField { a: SimpleStruct { a: 0x24 }, b: 96 }\";\n\n    let args = vec![\n        \"utils\",\n        \"serialize\",\n        \"--arguments\",\n        calldata,\n        \"--abi-file\",\n        temp_abi_file_path.to_str().unwrap(),\n        \"--function\",\n        \"nested_struct_fn\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n    Calldata: [0x24, 0x60]\n    \"});\n}\n\n#[tokio::test]\nasync fn test_abi_file_missing_function() {\n    let tempdir = tempdir().unwrap();\n    let abi_file_path =\n        Utf8PathBuf::from(\"tests/data/files/data_transformer_contract_abi_missing_function.json\");\n    let temp_abi_file_path = tempdir.path().join(abi_file_path.file_name().unwrap());\n    std::fs::copy(abi_file_path, &temp_abi_file_path)\n        .expect(\"Failed to copy ABI file to temp directory\");\n\n    let calldata = r\"NestedStructWithField { a: SimpleStruct { a: 0x24 }, b: 96 }\";\n\n    let args = vec![\n        \"utils\",\n        \"serialize\",\n        \"--arguments\",\n        calldata,\n        \"--abi-file\",\n        temp_abi_file_path.to_str().unwrap(),\n        \"--function\",\n        \"nested_struct_fn\",\n    ];\n\n    let output = runner(&args).current_dir(tempdir.path()).assert().failure();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r#\"\n    Error: Function with selector \"0x2cf7c96d7437a80a891adac280b9089dbe00c5413e7d253bbc87845271ae772\" not found in ABI of the contract\n    \"#},\n    );\n}\n\n#[tokio::test]\nasync fn test_abi_file_missing_type() {\n    let tempdir = tempdir().unwrap();\n    let abi_file_path =\n        Utf8PathBuf::from(\"tests/data/files/data_transformer_contract_abi_missing_type.json\");\n    let temp_abi_file_path = tempdir.path().join(abi_file_path.file_name().unwrap());\n    std::fs::copy(abi_file_path, &temp_abi_file_path)\n        .expect(\"Failed to copy ABI file to temp directory\");\n\n    let calldata = r\"NestedStructWithField { a: SimpleStruct { a: 0x24 }, b: 96 }\";\n\n    let args = vec![\n        \"utils\",\n        \"serialize\",\n        \"--arguments\",\n        calldata,\n        \"--abi-file\",\n        temp_abi_file_path.to_str().unwrap(),\n        \"--function\",\n        \"nested_struct_fn\",\n    ];\n\n    let output = runner(&args).current_dir(tempdir.path()).assert().failure();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r#\"\n    Error: Error while processing Cairo-like calldata\n        Struct \"NestedStructWithField\" not found in ABI\n    \"#},\n    );\n}\n\n#[tokio::test]\nasync fn test_happy_case_json() {\n    let tempdir = tempdir().unwrap();\n\n    let calldata = r\"NestedStructWithField { a: SimpleStruct { a: 0x24 }, b: 96 }\";\n\n    let args = vec![\n        \"--json\",\n        \"utils\",\n        \"serialize\",\n        \"--arguments\",\n        calldata,\n        \"--contract-address\",\n        DATA_TRANSFORMER_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"nested_struct_fn\",\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().success().stdout_eq(indoc! {r#\"\n        {\"calldata\":[\"0x24\",\"0x60\"],\"command\":\"serialize\",\"type\":\"response\"}\n    \"#});\n}\n\n#[tokio::test]\nasync fn test_contract_does_not_exist() {\n    let args = vec![\n        \"utils\",\n        \"serialize\",\n        \"--arguments\",\n        \"some_calldata\",\n        \"--contract-address\",\n        \"0x1\",\n        \"--function\",\n        \"nested_struct_fn\",\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        \"Error: An error occurred in the called contract[..]Requested contract address[..]is not deployed[..]\",\n    );\n}\n\n#[tokio::test]\nasync fn test_wrong_function_name() {\n    let calldata = r\"NestedStructWithField { a: SimpleStruct { a: 0x24 }, b: 96 }\";\n\n    let args = vec![\n        \"utils\",\n        \"serialize\",\n        \"--arguments\",\n        calldata,\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"nonexistent_function\",\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args);\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        r#\"Error: Function with selector \"0x38a013a14030cb08ae86482a9e0f3bad42daeb0222bdfe0634d77388deab9b9\" not found in ABI of the contract\"#,\n    );\n}\n\n#[tokio::test]\nasync fn test_rpc_args_not_passed_when_using_class_hash() {\n    let tempdir = tempdir().unwrap();\n\n    let calldata = r\"NestedStructWithField { a: SimpleStruct { a: 0x24 }, b: 96 }\";\n\n    let args = vec![\n        \"utils\",\n        \"serialize\",\n        \"--arguments\",\n        calldata,\n        \"--class-hash\",\n        DATA_TRANSFORMER_CONTRACT_CLASS_HASH_SEPOLIA,\n        \"--function\",\n        \"nested_struct_fn\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().failure().stderr_eq(indoc! {r\"\n    Error: Either `--network` or `--url` must be provided when using `--class-hash`\n    \"});\n}\n\n#[tokio::test]\nasync fn test_rpc_args_not_passed_when_using_contract_address() {\n    let tempdir = tempdir().unwrap();\n\n    let calldata = r\"NestedStructWithField { a: SimpleStruct { a: 0x24 }, b: 96 }\";\n\n    let args = vec![\n        \"utils\",\n        \"serialize\",\n        \"--arguments\",\n        calldata,\n        \"--contract-address\",\n        DATA_TRANSFORMER_CONTRACT_ADDRESS_SEPOLIA,\n        \"--function\",\n        \"nested_struct_fn\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().failure().stderr_eq(indoc! {r\"\n    Error: Either `--network` or `--url` must be provided when using `--contract-address`\n    \"});\n}\n\n#[tokio::test]\nasync fn test_happy_case_shell() {\n    let binary_path = cargo_bin!(\"sncast\");\n    let command = os_specific_shell(&Utf8PathBuf::from(\"tests/shell/serialize\"));\n\n    let snapbox = command\n        .arg(binary_path)\n        .arg(URL)\n        .arg(DATA_TRANSFORMER_CONTRACT_ADDRESS_SEPOLIA);\n    snapbox.assert().success();\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/show_config.rs",
    "content": "use crate::helpers::{constants::URL, runner::runner};\nuse configuration::test_utils::copy_config_to_tempdir;\nuse indoc::formatdoc;\nuse shared::test_utils::output_assert::assert_stderr_contains;\n\n#[tokio::test]\nasync fn test_show_config_from_snfoundry_toml() {\n    let tempdir = copy_config_to_tempdir(\"tests/data/files/correct_snfoundry.toml\", None);\n    let args = vec![\"show-config\"];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().success().stdout_eq(formatdoc! {r\"\n        Chain ID:            alpha-sepolia\n        RPC URL:             {}\n        Account:             user1\n        Accounts File Path:  ../account-file\n        Wait Timeout:        300s\n        Wait Retry Interval: 5s\n        Show Explorer Links: true\n    \", URL});\n}\n\n#[tokio::test]\nasync fn test_show_config_from_cli() {\n    let args = vec![\n        \"--account\",\n        \"/path/to/account.json\",\n        \"--keystore\",\n        \"../keystore\",\n        \"--wait-timeout\",\n        \"2\",\n        \"--wait-retry-interval\",\n        \"1\",\n        \"show-config\",\n        \"--url\",\n        URL,\n    ];\n\n    let snapbox = runner(&args);\n\n    snapbox.assert().success().stdout_eq(formatdoc! {r\"\n        Chain ID:            alpha-sepolia\n        RPC URL:             {}\n        Account:             /path/to/account.json\n        Keystore:            ../keystore\n        Wait Timeout:        2s\n        Wait Retry Interval: 1s\n        Show Explorer Links: true\n    \", URL});\n}\n\n#[tokio::test]\nasync fn test_show_config_from_cli_and_snfoundry_toml() {\n    let tempdir = copy_config_to_tempdir(\"tests/data/files/correct_snfoundry.toml\", None);\n    let args = vec![\"--account\", \"user2\", \"--profile\", \"profile2\", \"show-config\"];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().success().stdout_eq(formatdoc! {r\"\n        Profile:             profile2\n        Chain ID:            alpha-sepolia\n        RPC URL:             {}\n        Account:             user2\n        Accounts File Path:  ../account-file\n        Wait Timeout:        300s\n        Wait Retry Interval: 5s\n        Show Explorer Links: true\n        Block Explorer:      ViewBlock\n    \", URL});\n}\n\n#[tokio::test]\nasync fn test_show_config_when_no_keystore() {\n    let tempdir = copy_config_to_tempdir(\"tests/data/files/correct_snfoundry.toml\", None);\n    let args = vec![\"--profile\", \"profile4\", \"show-config\"];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().success().stdout_eq(formatdoc! {r\"\n        Profile:             profile4\n        Chain ID:            alpha-sepolia\n        RPC URL:             {}\n        Account:             user3\n        Accounts File Path:  ../account-file\n        Wait Timeout:        300s\n        Wait Retry Interval: 5s\n        Show Explorer Links: true\n    \", URL});\n}\n\n#[tokio::test]\nasync fn test_show_config_when_keystore() {\n    let tempdir = copy_config_to_tempdir(\"tests/data/files/correct_snfoundry.toml\", None);\n    let args = vec![\"--profile\", \"profile3\", \"show-config\"];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().success().stdout_eq(formatdoc! {r\"\n        Profile:             profile3\n        Chain ID:            alpha-sepolia\n        RPC URL:             {}\n        Account:             /path/to/account.json\n        Keystore:            ../keystore\n        Wait Timeout:        300s\n        Wait Retry Interval: 5s\n        Show Explorer Links: true\n    \", URL});\n}\n\n#[tokio::test]\nasync fn test_show_config_no_url() {\n    let tempdir = copy_config_to_tempdir(\"tests/data/files/correct_snfoundry.toml\", None);\n    let args = vec![\"--profile\", \"profile6\", \"show-config\"];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().success().stdout_eq(formatdoc! {r\"\n        Profile:             profile6\n        Account:             user1\n        Accounts File Path:  /path/to/account.json\n        Wait Timeout:        500s\n        Wait Retry Interval: 10s\n        Show Explorer Links: false\n    \"});\n}\n\n#[tokio::test]\nasync fn test_show_config_with_network() {\n    let tempdir = copy_config_to_tempdir(\"tests/data/files/correct_snfoundry.toml\", None);\n    let args = vec![\"--profile\", \"profile7\", \"show-config\"];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n\n    snapbox.assert().success().stdout_eq(formatdoc! {r\"\n        Profile:             profile7\n        Chain ID:            alpha-sepolia\n        Network:             sepolia\n        Account:             user1\n        Accounts File Path:  /path/to/account.json\n        Wait Timeout:        300s\n        Wait Retry Interval: 5s\n        Show Explorer Links: true\n    \"});\n}\n\n#[tokio::test]\nasync fn test_only_one_from_url_and_network_allowed() {\n    let tempdir = copy_config_to_tempdir(\"tests/data/files/invalid_snfoundry.toml\", None);\n    let args = vec![\"--profile\", \"url_and_network\", \"show-config\"];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        \"Error: Failed to load config: Only one of `url` or `network` may be specified\",\n    );\n}\n\n#[tokio::test]\nasync fn test_stark_scan_as_block_explorer() {\n    let tempdir = copy_config_to_tempdir(\"tests/data/files/invalid_snfoundry.toml\", None);\n    let args = vec![\"--profile\", \"profile_with_stark_scan\", \"show-config\"];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().failure();\n\n    assert_stderr_contains(\n        output,\n        \"Error: Failed to load config: starkscan.co was terminated and `'StarkScan'` is no longer available. Please set `block-explorer` to `'Voyager'` or other explorer of your choice.\",\n    );\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/transaction.rs",
    "content": "use crate::e2e::account::create_account;\nuse crate::helpers::constants::{MAP_CONTRACT_DECLARE_TX_HASH_SEPOLIA, URL};\nuse crate::helpers::fixtures::get_transaction_hash;\nuse crate::helpers::runner::runner;\nuse conversions::string::IntoHexStr;\nuse indoc::indoc;\nuse shared::test_utils::output_assert::{assert_stderr_contains, assert_stdout_contains};\nuse sncast::helpers::constants::OZ_CLASS_HASH;\n\nconst INVOKE_TX_HASH: &str = \"0x07d2067cd7675f88493a9d773b456c8d941457ecc2f6201d2fe6b0607daadfd1\";\n\n#[tokio::test]\nasync fn test_get_invoke_transaction() {\n    let args = vec![\"get\", \"tx\", INVOKE_TX_HASH, \"--url\", URL];\n    let snapbox = runner(&args).env(\"SNCAST_FORCE_SHOW_EXPLORER_LINKS\", \"1\");\n    let output = snapbox.assert().success();\n\n    output.stdout_eq(indoc! {r\"\n        Success: Transaction found\n\n        Type:                        INVOKE\n        Version:                     3\n        Transaction Hash:            0x07d2067cd7675f88493a9d773b456c8d941457ecc2f6201d2fe6b0607daadfd1\n        Sender Address:              0x01d091b30a2d20ca2509579f8beae26934bfdc3725c0b497f50b353b7a3c636f\n        Nonce:                       98206\n        Calldata:                    [0x1, 0x424ce41bea300e095e763d9fb4316af76c9da9c0fa926009f25b42b6f4ad04a, 0xc844fd57777b0cd7e75c8ea68deec0adf964a6308da7a58de32364b7131cc8, 0x13, 0x441b0ab7fcd3923bd830e146e99ed90c4aebd19951eb6ed7b3713241aa8af, 0x29e701, 0xf29c0193adc354752489f1a7af2f507d72a5e5b76cce705094d05d72e21ab5, 0x6655cb7c, 0x304020100000000000000000000000000000000000000000000000000000000, 0x4, 0x27693e402, 0x276a2b3d2, 0x276a3f070, 0x276aeecf0, 0xb9eab07caffbd5538, 0x1, 0x2, 0x6771e459d1e5563ec13af0ca40f04406ff4b70e6cc9a534dce12957f46c0f24, 0x36383aebe2151145a66dd7a87d9c885a862339e35d2ee0bd9df4075d17a8979, 0x2cb74dff29a13dd5d855159349ec92f943bacf0547ff3734e7d84a15d08cbc5, 0xb1a29e2cfed2f0a9d5f137845280bb6ce746f2f4b6a2dd05ec794171f4012, 0x1f85c957582717816bd2c910ac678caf007f6f84d71bc5a95f38de0b6435163, 0x4225d1c8ee8e451a25e30c10689ef898e11ccf5c0f68d0fc7876c47b318e946]\n        Account Deployment Data:     []\n        Resource Bounds L1 Gas:      max_amount=39865, max_price_per_unit=226571933234745\n        Resource Bounds L1 Data Gas: max_amount=0, max_price_per_unit=0\n        Resource Bounds L2 Gas:      max_amount=0, max_price_per_unit=0\n        Tip:                         0\n        Paymaster Data:              []\n        Nonce DA Mode:               L1\n        Fee DA Mode:                 L1\n        Signature:                   [0x1e45e75e772a8f21592cac2cb7d662ee53af236155621ae580bd02bbfa13bbc, 0x3528f5508bd323fa3301ca59823c0b35f17bc29a9a70d919be2ecd6f941d3db]\n        \n        To see transaction details, visit:\n        transaction: https://sepolia.voyager.online/tx/0x07d2067cd7675f88493a9d773b456c8d941457ecc2f6201d2fe6b0607daadfd1\n    \"});\n}\n\n#[tokio::test]\nasync fn test_json_output() {\n    let args = vec![\"--json\", \"get\", \"tx\", INVOKE_TX_HASH, \"--url\", URL];\n    let snapbox = runner(&args);\n    let output = snapbox.assert().success();\n    let stdout = output.get_output().stdout.clone();\n\n    let json: serde_json::Value = serde_json::from_slice(&stdout).unwrap();\n    assert_eq!(json[\"command\"], \"get tx\");\n    assert_eq!(json[\"type\"], \"response\");\n    assert_eq!(json[\"transaction_type\"], \"INVOKE_V3\");\n\n    let tx = &json[\"transaction\"];\n    assert!(tx[\"transaction_hash\"].as_str().unwrap().starts_with(\"0x\"));\n    assert!(tx[\"sender_address\"].as_str().unwrap().starts_with(\"0x\"));\n    assert!(tx[\"nonce\"].as_str().unwrap().starts_with(\"0x\"));\n    assert!(tx[\"calldata\"].is_array());\n    assert!(tx[\"signature\"].is_array());\n    assert!(tx[\"tip\"].as_str().unwrap().starts_with(\"0x\"));\n    assert!(tx[\"paymaster_data\"].is_array());\n    assert_eq!(tx[\"nonce_data_availability_mode\"], \"L1\");\n    assert_eq!(tx[\"fee_data_availability_mode\"], \"L1\");\n    assert!(tx[\"account_deployment_data\"].is_array());\n}\n\n#[tokio::test]\nasync fn test_deploy_account_transaction() {\n    let tempdir = create_account(false, &OZ_CLASS_HASH.into_hex_string(), \"oz\").await;\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"--json\",\n        \"account\",\n        \"deploy\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path());\n    let output = snapbox.assert().success();\n    let hash = get_transaction_hash(&output.get_output().stdout);\n    let hash_hex = format!(\"{hash:#x}\");\n\n    let get_tx_args = vec![\"get\", \"tx\", hash_hex.as_str(), \"--url\", URL];\n    let get_tx_output = runner(&get_tx_args)\n        .current_dir(tempdir.path())\n        .assert()\n        .success();\n\n    assert_stdout_contains(\n        get_tx_output,\n        indoc! {r\"\n            Success: Transaction found\n\n            Type:                        DEPLOY ACCOUNT\n            Version:                     3\n            Transaction Hash:            0x[..]\n            Nonce:                       0\n            Class Hash:                  0x05b4b537eaa2399e3aa99c4e2e0208ebd6c71bc1467938cd52c798c601e43564\n            Contract Address Salt:       0x[..]\n            Constructor Calldata:        [0x[..]]\n            Resource Bounds L1 Gas:      max_amount=0, max_price_per_unit=1500000000\n            Resource Bounds L1 Data Gas: max_amount=672, max_price_per_unit=1500000000\n            Resource Bounds L2 Gas:      max_amount=3302760, max_price_per_unit=1500000000\n            Tip:                         0\n            Paymaster Data:              []\n            Nonce DA Mode:               L1\n            Fee DA Mode:                 L1\n            Signature:                   [0x[..], 0x[..]]\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_declare_transaction() {\n    let args = vec![\n        \"get\",\n        \"tx\",\n        MAP_CONTRACT_DECLARE_TX_HASH_SEPOLIA,\n        \"--url\",\n        URL,\n    ];\n    let snapbox = runner(&args);\n    let output = snapbox.assert().success();\n\n    output.stdout_eq(indoc! {r\"\n        Success: Transaction found\n\n        Type:                DECLARE\n        Version:             2\n        Transaction Hash:    0x04f644d3ea723b9c28781f2bea76e9c2cd8cc667b2861faf66b4e45402ea221c\n        Sender Address:      0x0709cebece48663c3f0ece4b4553c9b1aaf325a3de5eb93792d5edfc3fdc42a8\n        Nonce:               6\n        Class Hash:          0x02a09379665a749e609b4a8459c86fe954566a6beeaddd0950e43f6c700ed321\n        Compiled Class Hash: 0x023ea170b0fc421a0ba919e32310cab42c16b3c9ded46add315a94ae63f5dde4\n        Max Fee:             0x1559951f089bf\n        Signature:           [0xb587f3ac9d32ea2ef741409681d8f255e300cbeb633e28a8557bcd1464f623, 0x600ddf65382e33485a9ed0cdb632233cf83a5e971c75e9dc9c31d585cec3655]\n    \"});\n}\n\n#[tokio::test]\nasync fn test_nonexistent_transaction() {\n    let args = vec![\"get\", \"tx\", \"0x1\", \"--url\", URL];\n    let snapbox = runner(&args);\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: get tx\n        Error: Failed to get transaction: Transaction with provided hash was not found (does not exist)\n        \"},\n    );\n}\n\n// TODO (#4258): Add test for invoke tx with `proof_facts`\n"
  },
  {
    "path": "crates/sncast/tests/e2e/tx_status.rs",
    "content": "use crate::helpers::constants::URL;\nuse crate::helpers::runner::runner;\nuse indoc::indoc;\nuse shared::test_utils::output_assert::assert_stderr_contains;\n\nconst SUCCEEDED_TX_HASH: &str =\n    \"0x07d2067cd7675f88493a9d773b456c8d941457ecc2f6201d2fe6b0607daadfd1\";\nconst REVERTED_TX_HASH: &str = \"0x00ae35dacba17cde62b8ceb12e3b18f4ab6e103fa2d5e3d9821cb9dc59d59a3c\";\n\n#[tokio::test]\nasync fn test_incorrect_transaction_hash() {\n    let args = vec![\"get\", \"tx-status\", \"0x1\", \"--url\", URL];\n    let snapbox = runner(&args);\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        indoc! {r\"\n        Command: get tx-status\n        Error: Failed to get transaction status: Transaction with provided hash was not found (does not exist)\n        \"},\n    );\n}\n\n#[tokio::test]\nasync fn test_succeeded_old_command() {\n    let args = vec![\"tx-status\", SUCCEEDED_TX_HASH, \"--url\", URL];\n    let snapbox = runner(&args);\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        [WARNING] `sncast tx-status` has moved to `sncast get tx-status`. `sncast tx-status` will be removed in the next version.\n\n        Success: Transaction status retrieved\n        \n        Finality Status:  Accepted on L1\n        Execution Status: Succeeded\n    \"});\n}\n\n#[tokio::test]\nasync fn test_succeeded() {\n    let args = vec![\"get\", \"tx-status\", SUCCEEDED_TX_HASH, \"--url\", URL];\n    let snapbox = runner(&args);\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        Success: Transaction status retrieved\n\n        Finality Status:  Accepted on L1\n        Execution Status: Succeeded\n    \"});\n}\n\n#[tokio::test]\nasync fn test_reverted() {\n    let args = vec![\"get\", \"tx-status\", REVERTED_TX_HASH, \"--url\", URL];\n    let snapbox = runner(&args);\n\n    snapbox.assert().success().stdout_eq(indoc! {r\"\n        Success: Transaction status retrieved\n        \n        Finality Status:  Accepted on L1\n        Execution Status: Reverted\n    \"});\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/verify/mod.rs",
    "content": "mod voyager;\nmod walnut;\n"
  },
  {
    "path": "crates/sncast/tests/e2e/verify/voyager.rs",
    "content": "use crate::helpers::constants::{\n    ACCOUNT_FILE_PATH, CONTRACTS_DIR, MAP_CONTRACT_ADDRESS_SEPOLIA, MAP_CONTRACT_CLASS_HASH_SEPOLIA,\n};\nuse crate::helpers::fixtures::copy_directory_to_tempdir;\nuse crate::helpers::runner::runner;\nuse indoc::formatdoc;\nuse serde_json::json;\nuse shared::test_utils::output_assert::assert_stderr_contains;\nuse sncast::SEPOLIA;\nuse starknet_types_core::felt::Felt;\nuse std::fs;\nuse wiremock::matchers::{body_partial_json, method, path};\nuse wiremock::{Mock, MockServer, Request, ResponseTemplate};\n\nasync fn mock_chain_id(mock_rpc: &MockServer, chain_id: Felt) {\n    Mock::given(method(\"POST\"))\n        .and(body_partial_json(json!({\"method\": \"starknet_chainId\"})))\n        .respond_with(ResponseTemplate::new(200).set_body_json(json!({\n            \"id\": 1,\n            \"jsonrpc\": \"2.0\",\n            \"result\": format!(\"{chain_id:#x}\")\n        })))\n        .expect(1)\n        .mount(mock_rpc)\n        .await;\n}\n\nasync fn mock_sepolia_chain_id(mock_rpc: &MockServer) {\n    mock_chain_id(mock_rpc, SEPOLIA).await;\n}\n\n#[tokio::test]\nasync fn test_happy_case_contract_address() {\n    let contract_path = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/map\");\n\n    let mock_server = MockServer::start().await;\n    let rpc_response = json!({\n        \"id\": 1,\n        \"jsonrpc\": \"2.0\",\n        \"result\": MAP_CONTRACT_CLASS_HASH_SEPOLIA\n    });\n\n    let mock_rpc = MockServer::start().await;\n    let mock_rpc_uri = mock_rpc.uri().clone();\n\n    // Only mock the getClassHashAt call that voyager actually makes\n    Mock::given(method(\"POST\"))\n        .and(body_partial_json(\n            json!({\"method\": \"starknet_getClassHashAt\"}),\n        ))\n        .respond_with(ResponseTemplate::new(200).set_body_json(rpc_response))\n        .expect(1)\n        .mount(&mock_rpc)\n        .await;\n\n    let job_id = \"2b206064-ffee-4955-8a86-1ff3b854416a\";\n    let class_hash = Felt::from_hex(MAP_CONTRACT_CLASS_HASH_SEPOLIA).expect(\"Invalid class hash\");\n\n    Mock::given(method(\"POST\"))\n        .and(path(format!(\"class-verify/{class_hash:#066x}\")))\n        .respond_with(ResponseTemplate::new(200).set_body_json(json!({ \"job_id\": job_id })))\n        .expect(1)\n        .mount(&mock_server)\n        .await;\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"verify\",\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--contract-name\",\n        \"Map\",\n        \"--verifier\",\n        \"voyager\",\n        \"--network\",\n        \"sepolia\",\n        \"--url\",\n        &mock_rpc_uri,\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"VERIFIER_API_URL\", mock_server.uri())\n        .current_dir(contract_path.path())\n        .stdin(\"Y\");\n\n    snapbox.assert().success();\n}\n\n#[tokio::test]\nasync fn test_happy_case_class_hash() {\n    let contract_path = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/map\");\n\n    let mock_server = MockServer::start().await;\n    let mock_rpc = MockServer::start().await;\n    let mock_rpc_uri = mock_rpc.uri().clone();\n\n    // For class hash tests, no RPC calls are made since we already have the class hash\n    // No need to mock any RPC calls\n\n    let job_id = \"2b206064-ffee-4955-8a86-1ff3b854416a\";\n    let class_hash = Felt::from_hex(MAP_CONTRACT_CLASS_HASH_SEPOLIA).expect(\"Invalid class hash\");\n\n    Mock::given(method(\"POST\"))\n        .and(path(format!(\"class-verify/{class_hash:#066x}\")))\n        .respond_with(ResponseTemplate::new(200).set_body_json(json!({ \"job_id\": job_id })))\n        .expect(1)\n        .mount(&mock_server)\n        .await;\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"verify\",\n        \"--class-hash\",\n        MAP_CONTRACT_CLASS_HASH_SEPOLIA,\n        \"--contract-name\",\n        \"Map\",\n        \"--verifier\",\n        \"voyager\",\n        \"--network\",\n        \"sepolia\",\n        \"--url\",\n        &mock_rpc_uri,\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"VERIFIER_API_URL\", mock_server.uri())\n        .current_dir(contract_path.path())\n        .stdin(\"Y\");\n\n    snapbox.assert().success();\n}\n\n#[tokio::test]\nasync fn test_happy_case_with_confirm_verification_flag() {\n    let contract_path = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/map\");\n\n    let mock_server = MockServer::start().await;\n    let rpc_response = json!({\n        \"id\": 1,\n        \"jsonrpc\": \"2.0\",\n        \"result\": MAP_CONTRACT_CLASS_HASH_SEPOLIA\n    });\n\n    let mock_rpc = MockServer::start().await;\n    let mock_rpc_uri = mock_rpc.uri().clone();\n\n    // Only mock the getClassHashAt call that voyager actually makes\n    Mock::given(method(\"POST\"))\n        .and(body_partial_json(\n            json!({\"method\": \"starknet_getClassHashAt\"}),\n        ))\n        .respond_with(ResponseTemplate::new(200).set_body_json(rpc_response))\n        .expect(1)\n        .mount(&mock_rpc)\n        .await;\n    mock_sepolia_chain_id(&mock_rpc).await;\n\n    let job_id = \"2b206064-ffee-4955-8a86-1ff3b854416a\";\n    let class_hash = Felt::from_hex(MAP_CONTRACT_CLASS_HASH_SEPOLIA).expect(\"Invalid class hash\");\n\n    Mock::given(method(\"POST\"))\n        .and(path(format!(\"class-verify/{class_hash:#066x}\")))\n        .respond_with(ResponseTemplate::new(200).set_body_json(json!({ \"job_id\": job_id })))\n        .expect(1)\n        .mount(&mock_server)\n        .await;\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"verify\",\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--contract-name\",\n        \"Map\",\n        \"--verifier\",\n        \"voyager\",\n        \"--confirm-verification\",\n        \"--url\",\n        &mock_rpc_uri,\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"VERIFIER_API_URL\", mock_server.uri())\n        .current_dir(contract_path.path());\n\n    snapbox.assert().success();\n}\n\n#[tokio::test]\nasync fn test_happy_case_uses_network_from_config() {\n    let contract_path = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/map\");\n    fs::write(\n        contract_path.path().join(\"snfoundry.toml\"),\n        \"[sncast.default]\\nnetwork = \\\"sepolia\\\"\\n\",\n    )\n    .unwrap();\n\n    let mock_server = MockServer::start().await;\n    let rpc_response = json!({\n        \"id\": 1,\n        \"jsonrpc\": \"2.0\",\n        \"result\": MAP_CONTRACT_CLASS_HASH_SEPOLIA\n    });\n\n    let mock_rpc = MockServer::start().await;\n    let mock_rpc_uri = mock_rpc.uri().clone();\n\n    Mock::given(method(\"POST\"))\n        .and(body_partial_json(\n            json!({\"method\": \"starknet_getClassHashAt\"}),\n        ))\n        .respond_with(ResponseTemplate::new(200).set_body_json(rpc_response))\n        .expect(1)\n        .mount(&mock_rpc)\n        .await;\n\n    Mock::given(method(\"POST\"))\n        .and(body_partial_json(json!({\"method\": \"starknet_chainId\"})))\n        .respond_with(ResponseTemplate::new(200))\n        .expect(0)\n        .mount(&mock_rpc)\n        .await;\n\n    let job_id = \"config-network-job-id\";\n    let class_hash = Felt::from_hex(MAP_CONTRACT_CLASS_HASH_SEPOLIA).expect(\"Invalid class hash\");\n\n    Mock::given(method(\"POST\"))\n        .and(path(format!(\"class-verify/{class_hash:#066x}\")))\n        .respond_with(ResponseTemplate::new(200).set_body_json(json!({ \"job_id\": job_id })))\n        .expect(1)\n        .mount(&mock_server)\n        .await;\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"verify\",\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--contract-name\",\n        \"Map\",\n        \"--verifier\",\n        \"voyager\",\n        \"--confirm-verification\",\n        \"--url\",\n        &mock_rpc_uri,\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"VERIFIER_API_URL\", mock_server.uri())\n        .current_dir(contract_path.path());\n\n    snapbox.assert().success();\n}\n\n#[tokio::test]\nasync fn test_failed_verification_contract_address() {\n    let contract_path = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/map\");\n\n    let mock_server = MockServer::start().await;\n    let rpc_response = json!({\n        \"id\": 1,\n        \"jsonrpc\": \"2.0\",\n        \"result\": MAP_CONTRACT_CLASS_HASH_SEPOLIA\n    });\n\n    let mock_rpc = MockServer::start().await;\n    let mock_rpc_uri = mock_rpc.uri().clone();\n\n    // Only mock the getClassHashAt call that voyager actually makes\n    Mock::given(method(\"POST\"))\n        .and(body_partial_json(\n            json!({\"method\": \"starknet_getClassHashAt\"}),\n        ))\n        .respond_with(ResponseTemplate::new(200).set_body_json(rpc_response))\n        .expect(1)\n        .mount(&mock_rpc)\n        .await;\n\n    let error = \"some error message\";\n    let class_hash = Felt::from_hex(MAP_CONTRACT_CLASS_HASH_SEPOLIA).expect(\"Invalid class hash\");\n\n    Mock::given(method(\"POST\"))\n        .and(path(format!(\"class-verify/{class_hash:#066x}\")))\n        .respond_with(ResponseTemplate::new(400).set_body_json(json!({ \"error\": error })))\n        .expect(1)\n        .mount(&mock_server)\n        .await;\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"verify\",\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--contract-name\",\n        \"Map\",\n        \"--verifier\",\n        \"voyager\",\n        \"--network\",\n        \"sepolia\",\n        \"--url\",\n        &mock_rpc_uri,\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"VERIFIER_API_URL\", mock_server.uri())\n        .current_dir(contract_path.path())\n        .stdin(\"Y\");\n\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        formatdoc! {\"\n        Command: verify\n        Error: {}\n        \",\n        error,\n        },\n    );\n}\n\n#[tokio::test]\nasync fn test_failed_verification_class_hash() {\n    let contract_path = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/map\");\n\n    let mock_server = MockServer::start().await;\n    let mock_rpc = MockServer::start().await;\n    let mock_rpc_uri = mock_rpc.uri().clone();\n\n    // For class hash tests, no RPC calls are made since we already have the class hash\n    // No need to mock any RPC calls\n\n    let error = \"some error message\";\n    let class_hash = Felt::from_hex(MAP_CONTRACT_CLASS_HASH_SEPOLIA).expect(\"Invalid class hash\");\n\n    Mock::given(method(\"POST\"))\n        .and(path(format!(\"class-verify/{class_hash:#066x}\")))\n        .respond_with(ResponseTemplate::new(400).set_body_json(json!({ \"error\": error })))\n        .expect(1)\n        .mount(&mock_server)\n        .await;\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"verify\",\n        \"--class-hash\",\n        MAP_CONTRACT_CLASS_HASH_SEPOLIA,\n        \"--contract-name\",\n        \"Map\",\n        \"--verifier\",\n        \"voyager\",\n        \"--network\",\n        \"sepolia\",\n        \"--url\",\n        &mock_rpc_uri,\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"VERIFIER_API_URL\", mock_server.uri())\n        .current_dir(contract_path.path())\n        .stdin(\"Y\");\n\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        formatdoc! {\"\n        Command: verify\n        Error: {}\n        \",\n        error,\n        },\n    );\n}\n\n#[tokio::test]\nasync fn test_failed_class_hash_lookup() {\n    let contract_path = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/map\");\n\n    let mock_server = MockServer::start().await;\n    let contract_not_found = json!({\n        \"error\": {\n            \"code\": 20,\n            \"message\": \"Contract not found\"\n        },\n        \"id\": 1,\n        \"jsonrpc\": \"2.0\"\n    });\n\n    let mock_rpc = MockServer::start().await;\n    let mock_rpc_uri = mock_rpc.uri().clone();\n\n    // Mock the getClassHashAt call to return contract not found\n    Mock::given(method(\"POST\"))\n        .and(body_partial_json(\n            json!({\"method\": \"starknet_getClassHashAt\"}),\n        ))\n        .respond_with(ResponseTemplate::new(400).set_body_json(contract_not_found))\n        .expect(1)\n        .mount(&mock_rpc)\n        .await;\n\n    // Voyager API should not be called since RPC call fails\n    let class_hash = Felt::from_hex(MAP_CONTRACT_CLASS_HASH_SEPOLIA).expect(\"Invalid class hash\");\n\n    Mock::given(method(\"POST\"))\n        .and(path(format!(\"class-verify/{class_hash:#066x}\")))\n        .respond_with(ResponseTemplate::new(400))\n        .expect(0)\n        .mount(&mock_server)\n        .await;\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"verify\",\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--contract-name\",\n        \"Map\",\n        \"--verifier\",\n        \"voyager\",\n        \"--network\",\n        \"sepolia\",\n        \"--url\",\n        &mock_rpc_uri,\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"VERIFIER_API_URL\", mock_server.uri())\n        .current_dir(contract_path.path())\n        .stdin(\"Y\");\n\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        formatdoc! {\"\n        Command: verify\n        Error: ContractNotFound\n        \",\n        },\n    );\n}\n\n#[tokio::test]\nasync fn test_virtual_workspaces() {\n    let contract_path = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/virtual_workspace\");\n\n    let mock_server = MockServer::start().await;\n    let rpc_response = json!({\n        \"id\": 1,\n        \"jsonrpc\": \"2.0\",\n        \"result\": MAP_CONTRACT_CLASS_HASH_SEPOLIA\n    });\n\n    let mock_rpc = MockServer::start().await;\n    let mock_rpc_uri = mock_rpc.uri().clone();\n\n    // Only mock the getClassHashAt call that voyager actually makes\n    Mock::given(method(\"POST\"))\n        .and(body_partial_json(\n            json!({\"method\": \"starknet_getClassHashAt\"}),\n        ))\n        .respond_with(ResponseTemplate::new(200).set_body_json(rpc_response))\n        .expect(1)\n        .mount(&mock_rpc)\n        .await;\n\n    let job_id = \"2b206064-ffee-4955-8a86-1ff3b854416a\";\n    let class_hash = Felt::from_hex(MAP_CONTRACT_CLASS_HASH_SEPOLIA).expect(\"Invalid class hash\");\n\n    Mock::given(method(\"POST\"))\n        .and(path(format!(\"class-verify/{class_hash:#066x}\")))\n        .respond_with(ResponseTemplate::new(200).set_body_json(json!({ \"job_id\": job_id })))\n        .expect(1)\n        .mount(&mock_server)\n        .await;\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"verify\",\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--contract-name\",\n        \"FibonacciContract\",\n        \"--package\",\n        \"cast_fibonacci\",\n        \"--verifier\",\n        \"voyager\",\n        \"--network\",\n        \"sepolia\",\n        \"--url\",\n        &mock_rpc_uri,\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"VERIFIER_API_URL\", mock_server.uri())\n        .current_dir(contract_path.path())\n        .stdin(\"Y\");\n\n    snapbox.assert().success();\n}\n\n#[tokio::test]\nasync fn test_contract_name_not_found() {\n    let contract_path = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/virtual_workspace\");\n\n    let mock_server = MockServer::start().await;\n    let mock_rpc = MockServer::start().await;\n    let mock_rpc_uri = mock_rpc.uri().clone();\n\n    // For this test, the error happens before any RPC calls are made (contract name not found)\n    // So no RPC mocks needed\n\n    let job_id = \"2b206064-ffee-4955-8a86-1ff3b854416a\";\n    let class_hash = Felt::from_hex(MAP_CONTRACT_CLASS_HASH_SEPOLIA).expect(\"Invalid class hash\");\n\n    let expected_body = json!({\n        \"project_dir_path\": \".\",\n        \"name\": \"FibonacciContract\",\n        \"package_name\": \"cast_fibonacci\",\n        \"license\": null\n    });\n    Mock::given(method(\"POST\"))\n        .and(path(format!(\"class-verify/{class_hash:#066x}\")))\n        .and(body_partial_json(&expected_body))\n        .respond_with(ResponseTemplate::new(200).set_body_json(json!({ \"job_id\": job_id })))\n        .expect(0)\n        .mount(&mock_server)\n        .await;\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"verify\",\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--contract-name\",\n        \"non_existent\",\n        \"--package\",\n        \"cast_fibonacci\",\n        \"--verifier\",\n        \"voyager\",\n        \"--network\",\n        \"sepolia\",\n        \"--url\",\n        &mock_rpc_uri,\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"VERIFIER_API_URL\", mock_server.uri())\n        .current_dir(contract_path.path())\n        .stdin(\"Y\");\n\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        formatdoc! {\"\n        Command: verify\n        Error: Contract named 'non_existent' was not found\n        \",\n        },\n    );\n}\n\n#[tokio::test]\nasync fn test_error_when_neither_network_nor_url_provided() {\n    let contract_path = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/map\");\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"verify\",\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--contract-name\",\n        \"Map\",\n        \"--verifier\",\n        \"voyager\",\n        \"--confirm-verification\",\n    ];\n\n    let snapbox = runner(&args).current_dir(contract_path.path());\n\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        formatdoc! {\"\n        Command: verify\n        Error: Either --network or --url must be provided\n        \",\n        },\n    );\n}\n\n#[tokio::test]\nasync fn test_error_when_chain_id_is_unrecognized_and_network_is_missing() {\n    let contract_path = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/map\");\n\n    let mock_server = MockServer::start().await;\n    let mock_rpc = MockServer::start().await;\n    let mock_rpc_uri = mock_rpc.uri().clone();\n\n    mock_chain_id(&mock_rpc, Felt::from_hex_unchecked(\"0x1234\")).await;\n\n    let class_hash = Felt::from_hex(MAP_CONTRACT_CLASS_HASH_SEPOLIA).expect(\"Invalid class hash\");\n\n    Mock::given(method(\"POST\"))\n        .and(path(format!(\"class-verify/{class_hash:#066x}\")))\n        .respond_with(ResponseTemplate::new(200))\n        .expect(0)\n        .mount(&mock_server)\n        .await;\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"verify\",\n        \"--class-hash\",\n        MAP_CONTRACT_CLASS_HASH_SEPOLIA,\n        \"--contract-name\",\n        \"Map\",\n        \"--verifier\",\n        \"voyager\",\n        \"--confirm-verification\",\n        \"--url\",\n        &mock_rpc_uri,\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"VERIFIER_API_URL\", mock_server.uri())\n        .current_dir(contract_path.path());\n\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        formatdoc! {\"\n        Command: verify\n        Error: Failed to infer verification network from the RPC chain ID 0x1234; pass `--network mainnet` or `--network sepolia` explicitly\n        \",\n        },\n    );\n}\n\n#[tokio::test]\nasync fn test_test_files_flag_includes_test_files() {\n    let contract_path = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/map\");\n\n    let mock_server = MockServer::start().await;\n    let rpc_response = json!({\n        \"id\": 1,\n        \"jsonrpc\": \"2.0\",\n        \"result\": MAP_CONTRACT_CLASS_HASH_SEPOLIA\n    });\n\n    let mock_rpc = MockServer::start().await;\n    let mock_rpc_uri = mock_rpc.uri().clone();\n\n    // Mock the getClassHashAt call\n    Mock::given(method(\"POST\"))\n        .and(body_partial_json(\n            json!({\"method\": \"starknet_getClassHashAt\"}),\n        ))\n        .respond_with(ResponseTemplate::new(200).set_body_json(rpc_response))\n        .expect(1)\n        .mount(&mock_rpc)\n        .await;\n\n    let job_id = \"test-job-id-with-test-files\";\n    let class_hash = Felt::from_hex(MAP_CONTRACT_CLASS_HASH_SEPOLIA).expect(\"Invalid class hash\");\n\n    // Mock the verification request and verify that test files are included\n    Mock::given(method(\"POST\"))\n        .and(path(format!(\"class-verify/{class_hash:#066x}\")))\n        .and(body_partial_json(json!({\n            \"name\": \"Map\",\n            \"package_name\": \"map\"\n        })))\n        .and(|req: &Request| {\n            if let Ok(body_str) = std::str::from_utf8(&req.body)\n                && let Ok(body_json) = serde_json::from_str::<serde_json::Value>(body_str)\n                && let Some(files) = body_json.get(\"files\")\n                && let Some(files_obj) = files.as_object()\n            {\n                // Verify that test files ARE present\n                return files_obj.contains_key(\"src/test_helpers.cairo\")\n                    && files_obj.contains_key(\"src/tests.cairo\");\n            }\n            false\n        })\n        .respond_with(ResponseTemplate::new(200).set_body_json(json!({ \"job_id\": job_id })))\n        .expect(1)\n        .mount(&mock_server)\n        .await;\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"verify\",\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--contract-name\",\n        \"Map\",\n        \"--verifier\",\n        \"voyager\",\n        \"--network\",\n        \"sepolia\",\n        \"--url\",\n        &mock_rpc_uri,\n        \"--test-files\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"VERIFIER_API_URL\", mock_server.uri())\n        .current_dir(contract_path.path())\n        .stdin(\"Y\");\n\n    snapbox.assert().success();\n}\n\n#[tokio::test]\nasync fn test_without_test_files_flag_excludes_test_files() {\n    let contract_path = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/map\");\n\n    let mock_server = MockServer::start().await;\n    let rpc_response = json!({\n        \"id\": 1,\n        \"jsonrpc\": \"2.0\",\n        \"result\": MAP_CONTRACT_CLASS_HASH_SEPOLIA\n    });\n\n    let mock_rpc = MockServer::start().await;\n    let mock_rpc_uri = mock_rpc.uri().clone();\n\n    // Mock the getClassHashAt call\n    Mock::given(method(\"POST\"))\n        .and(body_partial_json(\n            json!({\"method\": \"starknet_getClassHashAt\"}),\n        ))\n        .respond_with(ResponseTemplate::new(200).set_body_json(rpc_response))\n        .expect(1)\n        .mount(&mock_rpc)\n        .await;\n\n    let job_id = \"test-job-id-without-test-files\";\n    let class_hash = Felt::from_hex(MAP_CONTRACT_CLASS_HASH_SEPOLIA).expect(\"Invalid class hash\");\n\n    // Mock the verification request - without --test-files flag, test files should be excluded\n    Mock::given(method(\"POST\"))\n        .and(path(format!(\"class-verify/{class_hash:#066x}\")))\n        .and(body_partial_json(json!({\n            \"name\": \"Map\",\n            \"package_name\": \"map\"\n        })))\n        .and(|req: &Request| {\n            if let Ok(body_str) = std::str::from_utf8(&req.body)\n                && let Ok(body_json) = serde_json::from_str::<serde_json::Value>(body_str)\n                && let Some(files) = body_json.get(\"files\")\n                && let Some(files_obj) = files.as_object()\n            {\n                // Verify that test files are NOT present\n                return !files_obj.contains_key(\"src/test_helpers.cairo\")\n                    && !files_obj.contains_key(\"src/tests.cairo\");\n            }\n            false\n        })\n        .respond_with(ResponseTemplate::new(200).set_body_json(json!({ \"job_id\": job_id })))\n        .expect(1)\n        .mount(&mock_server)\n        .await;\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"verify\",\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--contract-name\",\n        \"Map\",\n        \"--verifier\",\n        \"voyager\",\n        \"--network\",\n        \"sepolia\",\n        \"--url\",\n        &mock_rpc_uri,\n        // Note: --test-files flag is NOT included\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"VERIFIER_API_URL\", mock_server.uri())\n        .current_dir(contract_path.path())\n        .stdin(\"Y\");\n\n    snapbox.assert().success();\n}\n"
  },
  {
    "path": "crates/sncast/tests/e2e/verify/walnut.rs",
    "content": "use crate::helpers::constants::{\n    ACCOUNT_FILE_PATH, CONTRACTS_DIR, MAP_CONTRACT_ADDRESS_SEPOLIA, MAP_CONTRACT_CLASS_HASH_SEPOLIA,\n};\nuse crate::helpers::fixtures::copy_directory_to_tempdir;\nuse crate::helpers::runner::runner;\nuse indoc::formatdoc;\nuse shared::test_utils::output_assert::{assert_stderr_contains, assert_stdout_contains};\nuse wiremock::matchers::{method, path};\nuse wiremock::{Mock, MockServer, ResponseTemplate};\n\n#[tokio::test]\nasync fn test_happy_case_contract_address() {\n    let contract_path = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/map\");\n\n    let mock_server = MockServer::start().await;\n\n    let verifier_response = \"Contract successfully verified\";\n\n    Mock::given(method(\"POST\"))\n        .and(path(\"/v1/sn_sepolia/verify\"))\n        .respond_with(\n            ResponseTemplate::new(200)\n                .append_header(\"content-type\", \"text/plain\")\n                .set_body_string(verifier_response),\n        )\n        .mount(&mock_server)\n        .await;\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"verify\",\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--contract-name\",\n        \"Map\",\n        \"--verifier\",\n        \"walnut\",\n        \"--network\",\n        \"sepolia\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"VERIFIER_API_URL\", mock_server.uri())\n        .current_dir(contract_path.path())\n        .stdin(\"Y\");\n\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        formatdoc!(\n            r\"\n        Success: Verification completed\n\n        {}\n        \",\n            verifier_response\n        ),\n    );\n}\n\n#[tokio::test]\nasync fn test_happy_case_class_hash() {\n    let contract_path = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/map\");\n\n    let mock_server = MockServer::start().await;\n\n    let verifier_response = \"Contract successfully verified\";\n\n    Mock::given(method(\"POST\"))\n        .and(path(\"/v1/sn_sepolia/verify\"))\n        .respond_with(\n            ResponseTemplate::new(200)\n                .append_header(\"content-type\", \"text/plain\")\n                .set_body_string(verifier_response),\n        )\n        .mount(&mock_server)\n        .await;\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"verify\",\n        \"--class-hash\",\n        MAP_CONTRACT_CLASS_HASH_SEPOLIA,\n        \"--contract-name\",\n        \"Map\",\n        \"--verifier\",\n        \"walnut\",\n        \"--network\",\n        \"sepolia\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"VERIFIER_API_URL\", mock_server.uri())\n        .current_dir(contract_path.path())\n        .stdin(\"Y\");\n\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        formatdoc!(\n            r\"\n        Success: Verification completed\n\n        {}\n        \",\n            verifier_response\n        ),\n    );\n}\n\n#[tokio::test]\nasync fn test_failed_verification_contract_address() {\n    let contract_path = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/map\");\n\n    let mock_server = MockServer::start().await;\n\n    let verifier_response = \"An error occurred during verification: contract class isn't declared\";\n\n    Mock::given(method(\"POST\"))\n        .and(path(\"/v1/sn_sepolia/verify\"))\n        .respond_with(\n            ResponseTemplate::new(400)\n                .append_header(\"content-type\", \"text/plain\")\n                .set_body_string(verifier_response),\n        )\n        .mount(&mock_server)\n        .await;\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"verify\",\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--contract-name\",\n        \"Map\",\n        \"--verifier\",\n        \"walnut\",\n        \"--network\",\n        \"sepolia\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"VERIFIER_API_URL\", mock_server.uri())\n        .current_dir(contract_path.path())\n        .stdin(\"Y\");\n\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        formatdoc!(\n            r\"\n        Command: verify\n        Error: {}\n        \",\n            verifier_response\n        ),\n    );\n}\n\n#[tokio::test]\nasync fn test_failed_verification_class_hash() {\n    let contract_path = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/map\");\n\n    let mock_server = MockServer::start().await;\n\n    let verifier_response = \"An error occurred during verification: contract class isn't declared\";\n\n    Mock::given(method(\"POST\"))\n        .and(path(\"/v1/sn_sepolia/verify\"))\n        .respond_with(\n            ResponseTemplate::new(400)\n                .append_header(\"content-type\", \"text/plain\")\n                .set_body_string(verifier_response),\n        )\n        .mount(&mock_server)\n        .await;\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"verify\",\n        \"--class-hash\",\n        MAP_CONTRACT_CLASS_HASH_SEPOLIA,\n        \"--contract-name\",\n        \"Map\",\n        \"--verifier\",\n        \"walnut\",\n        \"--network\",\n        \"sepolia\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"VERIFIER_API_URL\", mock_server.uri())\n        .current_dir(contract_path.path())\n        .stdin(\"Y\");\n\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        formatdoc!(\n            r\"\n        Command: verify\n        Error: {}\n        \",\n            verifier_response\n        ),\n    );\n}\n\n#[tokio::test]\nasync fn test_verification_abort() {\n    let contract_path = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/map\");\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"verify\",\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--contract-name\",\n        \"nonexistent\",\n        \"--verifier\",\n        \"walnut\",\n        \"--network\",\n        \"sepolia\",\n    ];\n\n    let snapbox = runner(&args).current_dir(contract_path.path()).stdin(\"n\");\n\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        formatdoc!(\n            r\"\n        Command: verify\n        Error: Verification aborted\n        \"\n        ),\n    );\n}\n\n#[tokio::test]\nasync fn test_happy_case_lowercase_y() {\n    let contract_path = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/map\");\n\n    let mock_server = MockServer::start().await;\n\n    let verifier_response = \"Contract successfully verified\";\n\n    Mock::given(method(\"POST\"))\n        .and(path(\"/v1/sn_sepolia/verify\"))\n        .respond_with(\n            ResponseTemplate::new(200)\n                .append_header(\"content-type\", \"text/plain\")\n                .set_body_string(verifier_response),\n        )\n        .mount(&mock_server)\n        .await;\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"verify\",\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--contract-name\",\n        \"Map\",\n        \"--verifier\",\n        \"walnut\",\n        \"--network\",\n        \"sepolia\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"VERIFIER_API_URL\", mock_server.uri())\n        .current_dir(contract_path.path())\n        .stdin(\"y\");\n\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        formatdoc!(\n            r\"\n        Success: Verification completed\n\n        {}\n        \",\n            verifier_response\n        ),\n    );\n}\n\n#[tokio::test]\nasync fn test_wrong_contract_name_passed() {\n    let contract_path = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/map\");\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"verify\",\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--contract-name\",\n        \"nonexistent\",\n        \"--verifier\",\n        \"walnut\",\n        \"--network\",\n        \"sepolia\",\n    ];\n\n    let snapbox = runner(&args).current_dir(contract_path.path()).stdin(\"Y\");\n\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        formatdoc!(\n            r\"\n        Command: verify\n        Error: Contract named 'nonexistent' was not found\n        \"\n        ),\n    );\n}\n\n#[tokio::test]\nasync fn test_happy_case_with_confirm_verification_flag() {\n    let contract_path = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/map\");\n\n    let mock_server = MockServer::start().await;\n\n    let verifier_response = \"Contract successfully verified\";\n\n    Mock::given(method(\"POST\"))\n        .and(path(\"/v1/sn_sepolia/verify\"))\n        .respond_with(\n            ResponseTemplate::new(200)\n                .append_header(\"content-type\", \"text/plain\")\n                .set_body_string(verifier_response),\n        )\n        .mount(&mock_server)\n        .await;\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"verify\",\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--contract-name\",\n        \"Map\",\n        \"--verifier\",\n        \"walnut\",\n        \"--network\",\n        \"sepolia\",\n        \"--confirm-verification\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"VERIFIER_API_URL\", mock_server.uri())\n        .current_dir(contract_path.path());\n\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        formatdoc!(\n            r\"\n        Success: Verification completed\n\n        {}\n        \",\n            verifier_response\n        ),\n    );\n}\n\n#[tokio::test]\nasync fn test_happy_case_specify_package() {\n    let tempdir = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/multiple_packages\");\n\n    let mock_server = MockServer::start().await;\n\n    let verifier_response = \"Contract successfully verified\";\n\n    Mock::given(method(\"POST\"))\n        .and(path(\"/v1/sn_sepolia/verify\"))\n        .respond_with(\n            ResponseTemplate::new(200)\n                .append_header(\"content-type\", \"text/plain\")\n                .set_body_string(verifier_response),\n        )\n        .mount(&mock_server)\n        .await;\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"verify\",\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--contract-name\",\n        \"supercomplexcode\",\n        \"--verifier\",\n        \"walnut\",\n        \"--network\",\n        \"sepolia\",\n        \"--package\",\n        \"main_workspace\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"VERIFIER_API_URL\", mock_server.uri())\n        .current_dir(tempdir.path())\n        .stdin(\"Y\");\n\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        formatdoc!(\n            r\"\n        Success: Verification completed\n\n        {}\n        \",\n            verifier_response\n        ),\n    );\n}\n\n#[tokio::test]\nasync fn test_worskpaces_package_specified_virtual_fibonacci() {\n    let tempdir = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/virtual_workspace\");\n\n    let mock_server = MockServer::start().await;\n\n    let verifier_response = \"Contract successfully verified\";\n\n    Mock::given(method(\"POST\"))\n        .and(path(\"/v1/sn_sepolia/verify\"))\n        .respond_with(\n            ResponseTemplate::new(200)\n                .append_header(\"content-type\", \"text/plain\")\n                .set_body_string(verifier_response),\n        )\n        .mount(&mock_server)\n        .await;\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"verify\",\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--contract-name\",\n        \"FibonacciContract\",\n        \"--verifier\",\n        \"walnut\",\n        \"--network\",\n        \"sepolia\",\n        \"--package\",\n        \"cast_fibonacci\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"VERIFIER_API_URL\", mock_server.uri())\n        .current_dir(tempdir.path())\n        .stdin(\"Y\");\n\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        formatdoc!(\n            r\"\n        Success: Verification completed\n\n        {}\n        \",\n            verifier_response\n        ),\n    );\n}\n\n#[tokio::test]\nasync fn test_worskpaces_package_no_contract() {\n    let tempdir = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/virtual_workspace\");\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"verify\",\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--contract-name\",\n        \"nonexistent\",\n        \"--verifier\",\n        \"walnut\",\n        \"--network\",\n        \"sepolia\",\n        \"--package\",\n        \"cast_addition\",\n    ];\n\n    let snapbox = runner(&args).current_dir(tempdir.path()).stdin(\"Y\");\n\n    let output = snapbox.assert().success();\n\n    assert_stderr_contains(\n        output,\n        formatdoc!(\n            r\"\n        Command: verify\n        Error: Contract named 'nonexistent' was not found\n        \"\n        ),\n    );\n}\n\n#[tokio::test]\nasync fn test_test_files_flag_ignored_with_warning() {\n    let contract_path = copy_directory_to_tempdir(CONTRACTS_DIR.to_string() + \"/map\");\n\n    let mock_server = MockServer::start().await;\n\n    let verifier_response = \"Contract successfully verified\";\n\n    Mock::given(method(\"POST\"))\n        .and(path(\"/v1/sn_sepolia/verify\"))\n        .respond_with(\n            ResponseTemplate::new(200)\n                .append_header(\"content-type\", \"text/plain\")\n                .set_body_string(verifier_response),\n        )\n        .mount(&mock_server)\n        .await;\n\n    let args = vec![\n        \"--accounts-file\",\n        ACCOUNT_FILE_PATH,\n        \"verify\",\n        \"--contract-address\",\n        MAP_CONTRACT_ADDRESS_SEPOLIA,\n        \"--contract-name\",\n        \"Map\",\n        \"--verifier\",\n        \"walnut\",\n        \"--network\",\n        \"sepolia\",\n        \"--test-files\",\n        \"--confirm-verification\",\n    ];\n\n    let snapbox = runner(&args)\n        .env(\"VERIFIER_API_URL\", mock_server.uri())\n        .current_dir(contract_path.path());\n\n    let output = snapbox.assert().success();\n\n    assert_stdout_contains(\n        output,\n        formatdoc!(\n            r\"\n        [WARNING] The `--test-files` option is ignored for Walnut verifier\n        Success: Verification completed\n\n        {}\n        \",\n            verifier_response\n        ),\n    );\n}\n"
  },
  {
    "path": "crates/sncast/tests/helpers/constants.rs",
    "content": "use starknet_rust::macros::felt;\nuse starknet_types_core::felt::Felt;\n\npub const ACCOUNT: &str = \"user1\";\npub const ACCOUNT_FILE_PATH: &str = \"tests/data/accounts/accounts.json\";\n\npub const SEPOLIA_RPC_URL: &str = \"http://188.34.188.184:7070/rpc/v0_10\";\n\npub const URL: &str = \"http://127.0.0.1:5055/rpc\";\npub const NETWORK: &str = \"testnet\";\npub const DEVNET_SEED: u32 = 1_053_545_548;\npub const DEVNET_ACCOUNTS_NUMBER: u8 = 20;\n\n// Block number used by devnet to fork the Sepolia testnet network in the tests\npub const DEVNET_FORK_BLOCK_NUMBER: u32 = 721_720;\n\npub const CONTRACTS_DIR: &str = \"tests/data/contracts\";\npub const SCRIPTS_DIR: &str = \"tests/data/scripts\";\npub const MULTICALL_CONFIGS_DIR: &str = \"crates/sncast/tests/data/multicall_configs\";\n\npub const DEVNET_OZ_CLASS_HASH_CAIRO_0: &str =\n    \"0x4d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f\";\npub const DEVNET_PREDEPLOYED_ACCOUNT_ADDRESS: &str =\n    \"0x691a61b12a7105b1372cc377f135213c11e8400a546f6b0e7ea0296046690ce\";\n\npub const DEVNET_OZ_CLASS_HASH_CAIRO_1: Felt =\n    felt!(\"0x05b4b537eaa2399e3aa99c4e2e0208ebd6c71bc1467938cd52c798c601e43564\");\n\npub const MAP_CONTRACT_ADDRESS_SEPOLIA: &str =\n    \"0xcd8f9ab31324bb93251837e4efb4223ee195454f6304fcfcb277e277653008\";\n\npub const MAP_CONTRACT_CLASS_HASH_SEPOLIA: &str =\n    \"0x2a09379665a749e609b4a8459c86fe954566a6beeaddd0950e43f6c700ed321\";\n\npub const MAP_CONTRACT_DECLARE_TX_HASH_SEPOLIA: &str =\n    \"0x4f644d3ea723b9c28781f2bea76e9c2cd8cc667b2861faf66b4e45402ea221c\";\n\npub const CONSTRUCTOR_WITH_PARAMS_CONTRACT_CLASS_HASH_SEPOLIA: &str =\n    \"0x59426c817fb8103edebdbf1712fa084c6744b2829db9c62d1ea4dce14ee6ded\";\n\npub const DATA_TRANSFORMER_CONTRACT_ADDRESS_SEPOLIA: &str =\n    \"0x00351c816183324878714973f3da1a43c1a40d661b8dac5cb69294cc333342ed\";\npub const DATA_TRANSFORMER_CONTRACT_CLASS_HASH_SEPOLIA: &str =\n    \"0x0786d1f010d66f838837290e472415186ba6a789fb446e7f92e444bed7b5d9c0\";\npub const DATA_TRANSFORMER_CONTRACT_ABI_PATH: &str =\n    \"tests/data/files/data_transformer_contract_abi.json\";\n"
  },
  {
    "path": "crates/sncast/tests/helpers/devnet.rs",
    "content": "use crate::helpers::constants::{\n    DEVNET_ACCOUNTS_NUMBER, DEVNET_FORK_BLOCK_NUMBER, DEVNET_SEED, SEPOLIA_RPC_URL, URL,\n};\nuse crate::helpers::fixtures::{\n    deploy_braavos_account, deploy_cairo_0_account, deploy_keystore_account,\n    deploy_latest_oz_account, deploy_ready_account,\n};\nuse ctor::{ctor, dtor};\nuse std::net::TcpStream;\nuse std::process::{Command, Stdio};\nuse std::string::ToString;\nuse std::time::{Duration, Instant};\nuse tokio::runtime::Runtime;\nuse url::Url;\n\n#[expect(clippy::zombie_processes)]\n#[cfg(test)]\n#[ctor]\nfn start_devnet() {\n    fn verify_devnet_availability(address: &str) -> bool {\n        TcpStream::connect(address).is_ok()\n    }\n\n    let port = Url::parse(URL).unwrap().port().unwrap_or(80).to_string();\n    let host = Url::parse(URL)\n        .unwrap()\n        .host()\n        .expect(\"Can't parse devnet URL!\")\n        .to_string();\n\n    loop {\n        if verify_devnet_availability(&format!(\"{host}:{port}\")) {\n            stop_devnet();\n        } else {\n            break;\n        }\n    }\n\n    Command::new(\"starknet-devnet\")\n        .args([\n            \"--port\",\n            &port,\n            \"--seed\",\n            &DEVNET_SEED.to_string(),\n            \"--state-archive-capacity\",\n            \"full\",\n            \"--fork-network\",\n            SEPOLIA_RPC_URL,\n            \"--fork-block\",\n            &DEVNET_FORK_BLOCK_NUMBER.to_string(),\n            \"--initial-balance\",\n            \"9999999999999999999999999999999\",\n            \"--accounts\",\n            &DEVNET_ACCOUNTS_NUMBER.to_string(),\n        ])\n        .stdout(Stdio::null())\n        .spawn()\n        .expect(\"Failed to start devnet!\");\n\n    let now = Instant::now();\n    let timeout = Duration::from_secs(30);\n\n    loop {\n        if verify_devnet_availability(&format!(\"{host}:{port}\")) {\n            break;\n        } else if now.elapsed() >= timeout {\n            eprintln!(\"Timed out while waiting for devnet!\");\n            std::process::exit(1);\n        }\n    }\n\n    let rt = Runtime::new().expect(\"Could not instantiate Runtime\");\n\n    rt.block_on(deploy_keystore_account());\n    rt.block_on(deploy_cairo_0_account());\n    rt.block_on(deploy_latest_oz_account());\n    rt.block_on(deploy_ready_account());\n    rt.block_on(deploy_braavos_account());\n}\n\n#[cfg(test)]\n#[dtor]\nfn stop_devnet() {\n    let port = Url::parse(URL).unwrap().port().unwrap_or(80).to_string();\n    let pattern = format!(\"starknet-devnet.*{port}.*{DEVNET_SEED}\");\n\n    Command::new(\"pkill\")\n        .args([\"-f\", &pattern])\n        .output()\n        .expect(\"Failed to kill devnet processes\");\n}\n"
  },
  {
    "path": "crates/sncast/tests/helpers/devnet_detection.rs",
    "content": "use sncast::helpers::devnet::detection::{DevnetDetectionError, detect_devnet_url};\nuse std::net::TcpStream;\nuse std::process::{Child, Command, Stdio};\nuse std::time::{Duration, Instant};\nuse url::Url;\n\nuse crate::helpers::constants::URL;\n\n// These tests are marked to run serially to avoid interference from second devnet instance\n\n#[tokio::test]\nasync fn test_devnet_detection() {\n    test_detect_devnet_url().await;\n    test_multiple_devnet_instances_error().await;\n}\n\nasync fn test_detect_devnet_url() {\n    let result = detect_devnet_url()\n        .await\n        .expect(\"Failed to detect devnet URL\");\n\n    assert_eq!(result, Url::parse(&URL.replace(\"/rpc\", \"\")).unwrap());\n}\n\nasync fn test_multiple_devnet_instances_error() {\n    let mut devnet1 = start_devnet_instance(5051, 1234);\n\n    wait_for_devnet(\"127.0.0.1:5051\", Duration::from_secs(10));\n\n    let result = detect_devnet_url().await;\n\n    let _ = devnet1.kill();\n    let _ = devnet1.wait();\n\n    assert!(matches!(\n        result,\n        Err(DevnetDetectionError::MultipleInstances)\n    ));\n}\n\nfn start_devnet_instance(port: u16, seed: u32) -> Child {\n    Command::new(\"starknet-devnet\")\n        .args([\n            \"--port\",\n            &port.to_string(),\n            \"--seed\",\n            &seed.to_string(),\n            \"--accounts\",\n            \"1\",\n        ])\n        .stdout(Stdio::null())\n        .stderr(Stdio::null())\n        .spawn()\n        .expect(\"Failed to start devnet instance\")\n}\n\nfn wait_for_devnet(address: &str, timeout: Duration) {\n    let now = Instant::now();\n    loop {\n        if TcpStream::connect(address).is_ok() {\n            break;\n        } else if now.elapsed() >= timeout {\n            panic!(\"Timed out waiting for devnet at {address}\");\n        }\n        std::thread::sleep(Duration::from_millis(100));\n    }\n}\n"
  },
  {
    "path": "crates/sncast/tests/helpers/devnet_provider.rs",
    "content": "use crate::helpers::constants::{DEVNET_ACCOUNTS_NUMBER, DEVNET_SEED, SEPOLIA_RPC_URL, URL};\nuse num_traits::ToPrimitive;\nuse sncast::helpers::{constants::OZ_CLASS_HASH, devnet::provider::DevnetProvider};\n\n#[tokio::test]\nasync fn test_get_config() {\n    let devnet_provider = DevnetProvider::new(URL);\n    let config = devnet_provider\n        .get_config()\n        .await\n        .expect(\"Failed to get config\");\n\n    assert!(config.account_contract_class_hash == OZ_CLASS_HASH);\n    assert!(config.seed == DEVNET_SEED);\n    assert!(config.total_accounts == DEVNET_ACCOUNTS_NUMBER);\n}\n\n#[tokio::test]\nasync fn test_get_predeployed_accounts() {\n    let devnet_provider = DevnetProvider::new(URL);\n    let predeployed_accounts = devnet_provider\n        .get_predeployed_accounts()\n        .await\n        .expect(\"Failed to get predeployed accounts\");\n\n    assert!(predeployed_accounts.len().to_u8().unwrap() == DEVNET_ACCOUNTS_NUMBER);\n}\n\n#[tokio::test]\nasync fn test_is_alive_happy_case() {\n    let devnet_provider = DevnetProvider::new(URL);\n    devnet_provider\n        .ensure_alive()\n        .await\n        .expect(\"Failed to ensure the devnet is alive\");\n}\n\n#[tokio::test]\nasync fn test_is_alive_fails_on_sepolia_node() {\n    let devnet_provider = DevnetProvider::new(SEPOLIA_RPC_URL);\n    let res = devnet_provider.ensure_alive().await;\n    assert!(res.is_err(), \"Expected an error\");\n\n    let err = res.unwrap_err().to_string();\n    assert!(\n        err == format!(\n            \"Node at {SEPOLIA_RPC_URL} is not responding to the Devnet health check (GET `/is_alive`). It may not be a Devnet instance or it may be down.\"\n        ),\n        \"Unexpected error message: {err}\"\n    );\n}\n"
  },
  {
    "path": "crates/sncast/tests/helpers/env.rs",
    "content": "use sncast::helpers::constants::{CREATE_KEYSTORE_PASSWORD_ENV_VAR, KEYSTORE_PASSWORD_ENV_VAR};\nuse std::env;\n\npub fn set_keystore_password_env() {\n    // SAFETY: Tests run in parallel and share the same environment variables.\n    // However, we only set this variable once to a fixed value and never modify or unset it.\n    // The only potential issue would be if a test explicitly required this variable to be unset,\n    // but to the best of our knowledge, no such test exists.\n    unsafe {\n        env::set_var(KEYSTORE_PASSWORD_ENV_VAR, \"123\");\n    };\n}\n\npub fn set_create_keystore_password_env() {\n    // SAFETY: Tests run in parallel and share the same environment variables.\n    // However, we only set this variable once to a fixed value and never modify or unset it.\n    // The only potential issue would be if a test explicitly required this variable to be unset,\n    // but to the best of our knowledge, no such test exists.\n    unsafe {\n        env::set_var(CREATE_KEYSTORE_PASSWORD_ENV_VAR, \"123\");\n    };\n}\n"
  },
  {
    "path": "crates/sncast/tests/helpers/fixtures.rs",
    "content": "use crate::helpers::constants::{ACCOUNT_FILE_PATH, DEVNET_OZ_CLASS_HASH_CAIRO_0, URL};\nuse crate::helpers::runner::runner;\nuse anyhow::Context;\nuse camino::{Utf8Path, Utf8PathBuf};\nuse conversions::string::IntoHexStr;\nuse core::str;\nuse fs_extra::dir::{CopyOptions, copy};\nuse serde::Deserialize;\nuse serde::de::DeserializeOwned;\nuse serde_json::{Map, Value, json};\nuse sncast::helpers::account::load_accounts;\nuse sncast::helpers::braavos::BraavosAccountFactory;\nuse sncast::helpers::configuration::CastConfig;\nuse sncast::helpers::constants::{\n    BRAAVOS_BASE_ACCOUNT_CLASS_HASH, BRAAVOS_CLASS_HASH, OZ_CLASS_HASH, READY_CLASS_HASH,\n};\nuse sncast::helpers::fee::FeeSettings;\nuse sncast::helpers::rpc::RpcArgs;\nuse sncast::helpers::scarb_utils::get_package_metadata;\nuse sncast::response::ui::UI;\nuse sncast::state::state_file::{\n    ScriptTransactionEntry, ScriptTransactionOutput, ScriptTransactionStatus,\n};\nuse sncast::{AccountType, apply_optional_fields, get_chain_id, get_keystore_password};\nuse sncast::{get_account, get_provider};\nuse starknet_rust::accounts::{\n    Account, AccountFactory, ArgentAccountFactory, ExecutionV3, OpenZeppelinAccountFactory,\n};\nuse starknet_rust::core::types::{Call, InvokeTransactionResult, Transaction, TransactionReceipt};\nuse starknet_rust::core::utils::get_contract_address;\nuse starknet_rust::core::utils::get_selector_from_name;\nuse starknet_rust::providers::JsonRpcClient;\nuse starknet_rust::providers::jsonrpc::HttpTransport;\nuse starknet_rust::signers::{LocalWallet, SigningKey};\nuse starknet_types_core::felt::Felt;\nuse std::collections::HashMap;\nuse std::env;\nuse std::fs;\nuse std::fs::File;\nuse std::io::{BufRead, Write};\nuse tempfile::{TempDir, tempdir};\nuse toml::Table;\nuse url::Url;\n\nconst SCRIPT_ORIGIN_TIMESTAMP: u64 = 1_709_853_748;\n\npub async fn deploy_keystore_account() {\n    let keystore_path = \"tests/data/keystore/predeployed_key.json\";\n    let account_path = \"tests/data/keystore/predeployed_account.json\";\n    let private_key =\n        SigningKey::from_keystore(keystore_path, \"123\").expect(\"Failed to get private_key\");\n\n    let contents = fs::read_to_string(account_path).expect(\"Failed to read keystore account file\");\n    let items: Value = serde_json::from_str(&contents)\n        .unwrap_or_else(|_| panic!(\"Failed to parse keystore account file at = {account_path}\"));\n\n    let deployment_info = items\n        .get(\"deployment\")\n        .expect(\"Failed to get deployment key\");\n    let address = get_from_json_as_str(deployment_info, \"address\");\n\n    deploy_oz_account(\n        address,\n        DEVNET_OZ_CLASS_HASH_CAIRO_0,\n        \"0xa5d90c65b1b1339\",\n        private_key,\n    )\n    .await;\n}\n\npub async fn deploy_cairo_0_account() {\n    let (address, salt, private_key) = get_account_deployment_data(\"oz_cairo_0\");\n    deploy_oz_account(\n        address.as_str(),\n        DEVNET_OZ_CLASS_HASH_CAIRO_0,\n        salt.as_str(),\n        private_key,\n    )\n    .await;\n}\npub async fn deploy_latest_oz_account() {\n    let (address, salt, private_key) = get_account_deployment_data(\"oz\");\n    deploy_oz_account(\n        address.as_str(),\n        OZ_CLASS_HASH.into_hex_string().as_str(),\n        salt.as_str(),\n        private_key,\n    )\n    .await;\n}\npub async fn deploy_ready_account() {\n    let provider = get_provider(&Url::parse(URL).unwrap()).expect(\"Failed to get the provider\");\n    let chain_id = get_chain_id(&provider)\n        .await\n        .expect(\"Failed to get chain id\");\n\n    let (address, salt, private_key) = get_account_deployment_data(\"ready\");\n\n    let factory = ArgentAccountFactory::new(\n        READY_CLASS_HASH,\n        chain_id,\n        None,\n        LocalWallet::from_signing_key(private_key),\n        provider,\n    )\n    .await\n    .expect(\"Failed to create Account Factory\");\n\n    deploy_account_to_devnet(factory, address.as_str(), salt.as_str()).await;\n}\n\npub async fn deploy_braavos_account() {\n    let provider = get_provider(&Url::parse(URL).unwrap()).expect(\"Failed to get the provider\");\n    let chain_id = get_chain_id(&provider)\n        .await\n        .expect(\"Failed to get chain id\");\n\n    let (address, salt, private_key) = get_account_deployment_data(\"braavos\");\n\n    let factory = BraavosAccountFactory::new(\n        BRAAVOS_CLASS_HASH,\n        BRAAVOS_BASE_ACCOUNT_CLASS_HASH,\n        chain_id,\n        LocalWallet::from_signing_key(private_key),\n        provider,\n    )\n    .await\n    .expect(\"Failed to create Account Factory\");\n\n    deploy_account_to_devnet(factory, address.as_str(), salt.as_str()).await;\n}\n\nasync fn deploy_oz_account(address: &str, class_hash: &str, salt: &str, private_key: SigningKey) {\n    let provider = get_provider(&Url::parse(URL).unwrap()).expect(\"Failed to get the provider\");\n    let chain_id = get_chain_id(&provider)\n        .await\n        .expect(\"Failed to get chain id\");\n\n    let factory = OpenZeppelinAccountFactory::new(\n        class_hash.parse().expect(\"Failed to parse class hash\"),\n        chain_id,\n        LocalWallet::from_signing_key(private_key),\n        provider,\n    )\n    .await\n    .expect(\"Failed to create Account Factory\");\n\n    deploy_account_to_devnet(factory, address, salt).await;\n}\n\nasync fn deploy_account_to_devnet<T: AccountFactory + Sync>(factory: T, address: &str, salt: &str) {\n    mint_token(address, u128::MAX).await;\n    factory\n        .deploy_v3(salt.parse().expect(\"Failed to parse salt\"))\n        .l1_gas(100_000)\n        .l1_gas_price(10_000_000_000_000)\n        .l2_gas(1_000_000_000)\n        .l2_gas_price(10_000_000_000_000)\n        .l1_data_gas(100_000)\n        .l1_data_gas_price(10_000_000_000_000)\n        .send()\n        .await\n        .expect(\"Failed to deploy account\");\n}\n\nfn get_account_deployment_data(account: &str) -> (String, String, SigningKey) {\n    let items =\n        load_accounts(&Utf8PathBuf::from(ACCOUNT_FILE_PATH)).expect(\"Failed to load accounts\");\n\n    let account_data = items\n        .get(\"alpha-sepolia\")\n        .and_then(|accounts| accounts.get(account))\n        .unwrap_or_else(|| panic!(\"Failed to get {account} account\"));\n\n    let address = get_from_json_as_str(account_data, \"address\");\n    let salt = get_from_json_as_str(account_data, \"salt\");\n    let private_key = get_from_json_as_str(account_data, \"private_key\");\n\n    let private_key = SigningKey::from_secret_scalar(\n        private_key\n            .parse()\n            .expect(\"Failed to convert private key to Felt\"),\n    );\n\n    (address.to_string(), salt.to_string(), private_key)\n}\n\nfn get_from_json_as_str<'a>(entry: &'a Value, key: &str) -> &'a str {\n    entry\n        .get(key)\n        .and_then(Value::as_str)\n        .unwrap_or_else(|| panic!(\"Failed to get {key} key\"))\n}\n\npub async fn invoke_contract(\n    account: &str,\n    contract_address: &str,\n    entry_point_name: &str,\n    fee_settings: FeeSettings,\n    constructor_calldata: &[&str],\n) -> InvokeTransactionResult {\n    let provider = get_provider(&Url::parse(URL).unwrap()).expect(\"Could not get the provider\");\n    let config = CastConfig {\n        account: account.to_string(),\n        accounts_file: Utf8PathBuf::from(ACCOUNT_FILE_PATH),\n        ..Default::default()\n    };\n    let rpc_args = RpcArgs {\n        url: Some(Url::parse(URL).expect(\"Failed to parse URL\")),\n        network: None,\n    };\n    let account = get_account(&config, &provider, &rpc_args, &UI::default())\n        .await\n        .expect(\"Could not get the account\");\n\n    let mut calldata: Vec<Felt> = vec![];\n\n    for value in constructor_calldata {\n        let value: Felt = value.parse().expect(\"Could not parse the calldata\");\n        calldata.push(value);\n    }\n\n    let call = Call {\n        to: contract_address\n            .parse()\n            .expect(\"Could not parse the contract address\"),\n        selector: get_selector_from_name(entry_point_name)\n            .unwrap_or_else(|_| panic!(\"Could not get selector from {entry_point_name}\")),\n        calldata,\n    };\n\n    let account = match account {\n        sncast::AccountVariant::LocalWallet(acc) => acc,\n        sncast::AccountVariant::Ledger(_) => panic!(\"Ledger account not supported in test\"),\n    };\n\n    let execution = account.execute_v3(vec![call]);\n    let execution = apply_optional_fields!(\n        execution,\n        fee_settings.l1_gas => ExecutionV3::l1_gas,\n        fee_settings.l1_gas_price => ExecutionV3::l1_gas_price,\n        fee_settings.l2_gas => ExecutionV3::l2_gas,\n        fee_settings.l2_gas_price => ExecutionV3::l2_gas_price,\n        fee_settings.l1_data_gas => ExecutionV3::l1_data_gas,\n        fee_settings.l1_data_gas_price => ExecutionV3::l1_data_gas_price\n    );\n\n    execution\n        .send()\n        .await\n        .expect(\"Transaction execution failed\")\n}\n\npub async fn mint_token(recipient: &str, amount: u128) {\n    let client = reqwest::Client::new();\n    let json = json!({\n        \"jsonrpc\": \"2.0\",\n        \"method\": \"devnet_mint\",\n        \"params\": {\n            \"address\": recipient,\n            \"amount\": amount,\n            \"unit\": \"FRI\",\n        },\n        \"id\": 0,\n    });\n    let resp = client\n        .post(\"http://127.0.0.1:5055/rpc\")\n        .header(\"Content-Type\", \"application/json\")\n        .body(json.to_string())\n        .send()\n        .await\n        .expect(\"Error occurred while minting tokens\");\n\n    let resp_body: serde_json::Value = resp.json().await.expect(\"No JSON in response\");\n    assert!(resp_body[\"result\"].is_object());\n}\n\n#[must_use]\npub fn default_cli_args() -> Vec<&'static str> {\n    vec![\"--url\", URL, \"--accounts-file\", ACCOUNT_FILE_PATH]\n}\n\nfn parse_output<T: DeserializeOwned>(output: &[u8]) -> T {\n    for line in BufRead::split(output, b'\\n') {\n        let line = line.expect(\"Failed to read line from stdout\");\n        if let Ok(t) = serde_json::de::from_slice::<T>(&line) {\n            return t;\n        }\n    }\n\n    panic!(\"Failed to deserialize stdout JSON to struct\");\n}\n\n#[derive(Deserialize)]\n#[expect(dead_code)]\nstruct TransactionHashOutput {\n    pub transaction_hash: String,\n    contract_address: Option<String>,\n    class_hash: Option<String>,\n    command: Option<String>,\n}\n\n#[must_use]\npub fn get_transaction_hash(output: &[u8]) -> Felt {\n    let output = parse_output::<TransactionHashOutput>(output);\n    output\n        .transaction_hash\n        .parse()\n        .expect(\"Could not parse a number\")\n}\n\npub async fn get_transaction_receipt(tx_hash: Felt) -> TransactionReceipt {\n    let client = reqwest::Client::new();\n    let json = json!(\n        {\n            \"jsonrpc\": \"2.0\",\n            \"method\": \"starknet_getTransactionReceipt\",\n            \"params\": {\n                \"transaction_hash\": format!(\"{tx_hash:#x}\"),\n            },\n            \"id\": 0,\n        }\n    );\n    let resp: Value = serde_json::from_str(\n        &client\n            .post(URL)\n            .header(\"Content-Type\", \"application/json\")\n            .body(json.to_string())\n            .send()\n            .await\n            .expect(\"Error occurred while getting transaction receipt\")\n            .text()\n            .await\n            .expect(\"Could not get response from getTransactionReceipt\"),\n    )\n    .expect(\"Could not serialize getTransactionReceipt response\");\n\n    let result = resp\n        .get(\"result\")\n        .expect(\"There is no `result` field in getTransactionReceipt response\");\n    serde_json::from_str(&result.to_string())\n        .expect(\"Could not serialize result to `TransactionReceipt`\")\n}\n\npub async fn get_transaction_by_hash(tx_hash: Felt) -> Transaction {\n    let client = reqwest::Client::new();\n    let json = json!(\n        {\n            \"jsonrpc\": \"2.0\",\n            \"method\": \"starknet_getTransactionByHash\",\n            \"params\": {\n                \"transaction_hash\": format!(\"{tx_hash:#x}\"),\n            },\n            \"id\": 0,\n        }\n    );\n    let resp: Value = serde_json::from_str(\n        &client\n            .post(URL)\n            .header(\"Content-Type\", \"application/json\")\n            .body(json.to_string())\n            .send()\n            .await\n            .expect(\"Error occurred while getting transaction\")\n            .text()\n            .await\n            .expect(\"Could not get response from getTransactionByHash\"),\n    )\n    .expect(\"Could not serialize getTransactionByHash response\");\n\n    let result = resp\n        .get(\"result\")\n        .expect(\"There is no `result` field in getTransactionByHash response\");\n    serde_json::from_str(&result.to_string()).expect(\"Could not serialize result to `Transaction`\")\n}\n\n#[must_use]\npub fn create_test_provider() -> JsonRpcClient<HttpTransport> {\n    let parsed_url = Url::parse(URL).unwrap();\n    JsonRpcClient::new(HttpTransport::new(parsed_url))\n}\n\npub fn copy_file(src_path: impl AsRef<std::path::Path>, dest_path: impl AsRef<std::path::Path>) {\n    fs_extra::file::copy(\n        src_path.as_ref(),\n        dest_path.as_ref(),\n        &fs_extra::file::CopyOptions::new().overwrite(true),\n    )\n    .expect(\"Failed to copy the file\");\n}\n\n#[must_use]\npub fn duplicate_contract_directory_with_salt(\n    src_dir: impl AsRef<Utf8Path>,\n    code_to_be_salted: &str,\n    salt: &str,\n) -> TempDir {\n    let src_dir = Utf8PathBuf::from(src_dir.as_ref());\n\n    let temp_dir = copy_directory_to_tempdir(&src_dir);\n\n    let dest_dir = Utf8PathBuf::from_path_buf(temp_dir.path().to_path_buf())\n        .expect(\"Failed to create Utf8PathBuf from PathBuf\");\n\n    let file_to_be_salted = \"src/lib.cairo\";\n    let contract_code =\n        fs::read_to_string(src_dir.join(file_to_be_salted)).expect(\"Unable to get contract code\");\n    let updated_code =\n        contract_code.replace(code_to_be_salted, &(code_to_be_salted.to_string() + salt));\n    fs::write(dest_dir.join(file_to_be_salted), updated_code)\n        .expect(\"Unable to change contract code\");\n\n    temp_dir\n}\n\n#[must_use]\npub fn copy_directory_to_tempdir(src_dir: impl AsRef<Utf8Path>) -> TempDir {\n    let temp_dir = TempDir::new().expect(\"Unable to create a temporary directory\");\n\n    fs_extra::dir::copy(\n        src_dir.as_ref(),\n        temp_dir.as_ref(),\n        &fs_extra::dir::CopyOptions::new()\n            .overwrite(true)\n            .content_only(true),\n    )\n    .expect(\"Failed to copy the directory\");\n\n    temp_dir\n}\n\nfn copy_script_directory(\n    src_dir: impl AsRef<Utf8Path>,\n    dest_dir: impl AsRef<Utf8Path>,\n    deps: Vec<impl AsRef<std::path::Path>>,\n) {\n    let src_dir = Utf8PathBuf::from(src_dir.as_ref());\n    let dest_dir = Utf8PathBuf::from(dest_dir.as_ref());\n    let mut deps = get_deps_map_from_paths(deps);\n\n    let manifest_path = dest_dir.join(\"Scarb.toml\");\n    let contents = fs::read_to_string(&manifest_path).unwrap();\n    let mut parsed_toml: Table = toml::from_str(&contents)\n        .with_context(|| format!(\"Failed to parse {manifest_path}\"))\n        .unwrap();\n\n    let deps_toml = parsed_toml\n        .get_mut(\"dependencies\")\n        .unwrap()\n        .as_table_mut()\n        .unwrap();\n\n    let sncast_std = deps_toml\n        .get_mut(\"sncast_std\")\n        .expect(\"sncast_std not found\");\n\n    let sncast_std_path = sncast_std.get_mut(\"path\").expect(\"No path to sncast_std\");\n    let sncast_std_path =\n        Utf8PathBuf::from(sncast_std_path.as_str().expect(\"Failed to extract string\"));\n\n    let sncast_std_path = src_dir.join(sncast_std_path);\n    let sncast_std_path_absolute = sncast_std_path\n        .canonicalize_utf8()\n        .expect(\"Failed to canonicalize sncast_std path\");\n    deps.insert(String::from(\"sncast_std\"), sncast_std_path_absolute);\n\n    for (key, value) in deps {\n        let pkg = deps_toml.get_mut(&key).unwrap().as_table_mut().unwrap();\n        pkg.insert(\"path\".to_string(), toml::Value::String(value.to_string()));\n    }\n\n    let modified_toml = toml::to_string(&parsed_toml).expect(\"Failed to serialize TOML\");\n\n    let mut file = File::create(manifest_path).expect(\"Failed to create file\");\n    file.write_all(modified_toml.as_bytes())\n        .expect(\"Failed to write to file\");\n}\n\npub fn copy_script_directory_to_tempdir(\n    src_dir: impl AsRef<Utf8Path>,\n    deps: Vec<impl AsRef<std::path::Path>>,\n) -> TempDir {\n    let temp_dir = copy_directory_to_tempdir(&src_dir);\n\n    let dest_dir = Utf8PathBuf::from_path_buf(temp_dir.path().to_path_buf())\n        .expect(\"Failed to create Utf8PathBuf from PathBuf\");\n\n    copy_script_directory(&src_dir, dest_dir, deps);\n\n    temp_dir\n}\n\npub fn copy_workspace_directory_to_tempdir(\n    src_dir: impl AsRef<Utf8Path>,\n    relative_member_paths: Vec<impl AsRef<std::path::Path>>,\n    deps: &[impl AsRef<std::path::Path> + Clone],\n) -> TempDir {\n    let src_dir = Utf8PathBuf::from(src_dir.as_ref());\n\n    let temp_dir = copy_directory_to_tempdir(&src_dir);\n\n    let dest_dir = Utf8PathBuf::from_path_buf(temp_dir.path().to_path_buf())\n        .expect(\"Failed to create Utf8PathBuf from PathBuf\");\n\n    for member in relative_member_paths {\n        let member = member.as_ref().to_str().unwrap();\n        let src_member_path = src_dir.join(member);\n        let dest_member_path = dest_dir.join(member);\n        fs::create_dir_all(&dest_member_path).expect(\"Failed to create directories in temp dir\");\n        copy_script_directory(&src_member_path, dest_member_path, deps.to_vec());\n    }\n\n    temp_dir\n}\n\n#[must_use]\npub fn get_deps_map_from_paths(\n    paths: Vec<impl AsRef<std::path::Path>>,\n) -> HashMap<String, Utf8PathBuf> {\n    let mut deps = HashMap::<String, Utf8PathBuf>::new();\n\n    for path in paths {\n        let path = Utf8PathBuf::from_path_buf(path.as_ref().to_path_buf())\n            .expect(\"Failed to create Utf8PathBuf from PathBuf\");\n        let manifest_path = path.join(\"Scarb.toml\");\n        let package =\n            get_package_metadata(&manifest_path, &None).expect(\"Failed to get package metadata\");\n        deps.insert(package.name.clone(), path);\n    }\n\n    deps\n}\n\npub fn get_address_from_keystore(\n    keystore_path: impl AsRef<std::path::Path>,\n    account_path: impl AsRef<std::path::Path>,\n    password: &str,\n    account_type: &AccountType,\n) -> Felt {\n    let contents = std::fs::read_to_string(account_path).unwrap();\n    let items: Map<String, serde_json::Value> = serde_json::from_str(&contents).unwrap();\n    let deployment = items.get(\"deployment\").unwrap();\n\n    let private_key = SigningKey::from_keystore(\n        keystore_path,\n        get_keystore_password(password).unwrap().as_str(),\n    )\n    .unwrap();\n    let salt = Felt::from_hex(\n        deployment\n            .get(\"salt\")\n            .and_then(serde_json::Value::as_str)\n            .unwrap(),\n    )\n    .unwrap();\n    let class_hash = match account_type {\n        AccountType::Braavos => BRAAVOS_BASE_ACCOUNT_CLASS_HASH,\n        AccountType::OpenZeppelin | AccountType::Argent | AccountType::Ready => Felt::from_hex(\n            deployment\n                .get(\"class_hash\")\n                .and_then(serde_json::Value::as_str)\n                .unwrap(),\n        )\n        .unwrap(),\n    };\n\n    let calldata = match account_type {\n        AccountType::OpenZeppelin | AccountType::Braavos => {\n            vec![private_key.verifying_key().scalar()]\n        }\n        // This is a serialization of `Signer` enum for the variant `StarknetSigner` from the Ready account code\n        // One stands for `None` for the guardian argument\n        AccountType::Argent | AccountType::Ready => {\n            vec![Felt::ZERO, private_key.verifying_key().scalar(), Felt::ONE]\n        }\n    };\n\n    get_contract_address(salt, class_hash, &calldata, Felt::ZERO)\n}\n#[must_use]\npub fn get_accounts_path(relative_path_from_cargo_toml: &str) -> String {\n    use std::path::PathBuf;\n    let manifest_dir = env::var(\"CARGO_MANIFEST_DIR\").expect(\"CARGO_MANIFEST_DIR not set\");\n    let binding = PathBuf::from(manifest_dir).join(relative_path_from_cargo_toml);\n    binding\n        .to_str()\n        .expect(\"Failed to convert path to string\")\n        .to_string()\n}\n#[must_use]\npub fn get_keystores_path(relative_path_from_cargo_toml: &str) -> String {\n    use std::path::PathBuf;\n    let manifest_dir = env::var(\"CARGO_MANIFEST_DIR\").expect(\"CARGO_MANIFEST_DIR not set\");\n    let binding = PathBuf::from(manifest_dir).join(relative_path_from_cargo_toml);\n    binding\n        .to_str()\n        .expect(\"Failed to convert path to string\")\n        .to_string()\n}\n\npub fn assert_tx_entry_failed(\n    tx_entry: &ScriptTransactionEntry,\n    name: &str,\n    status: ScriptTransactionStatus,\n    msg_contains: Vec<&str>,\n) {\n    assert_eq!(tx_entry.name, name);\n    assert_eq!(tx_entry.status, status);\n\n    let ScriptTransactionOutput::ErrorResponse(response) = &tx_entry.output else {\n        panic!(\"Wrong response\")\n    };\n    for msg in msg_contains {\n        assert!(response.message.contains(msg));\n    }\n\n    assert!(tx_entry.timestamp > SCRIPT_ORIGIN_TIMESTAMP);\n}\n\npub fn assert_tx_entry_success(tx_entry: &ScriptTransactionEntry, name: &str) {\n    assert_eq!(tx_entry.name, name);\n    assert_eq!(tx_entry.status, ScriptTransactionStatus::Success);\n\n    let expected_selector = match tx_entry.output {\n        ScriptTransactionOutput::DeployResponse(_) => \"deploy\",\n        ScriptTransactionOutput::DeclareResponse(_) => \"declare\",\n        ScriptTransactionOutput::InvokeResponse(_) => \"invoke\",\n        ScriptTransactionOutput::ErrorResponse(_) => panic!(\"Error response received\"),\n    };\n    assert_eq!(expected_selector, name);\n\n    assert!(tx_entry.timestamp > SCRIPT_ORIGIN_TIMESTAMP);\n}\n\npub async fn create_and_deploy_oz_account() -> TempDir {\n    create_and_deploy_account(OZ_CLASS_HASH, AccountType::OpenZeppelin).await\n}\npub async fn create_and_deploy_account(class_hash: Felt, account_type: AccountType) -> TempDir {\n    let class_hash = &class_hash.into_hex_string();\n    let account_type = match account_type {\n        AccountType::OpenZeppelin => \"oz\",\n        AccountType::Argent => \"argent\",\n        AccountType::Ready => \"ready\",\n        AccountType::Braavos => \"braavos\",\n    };\n    let tempdir = tempdir().unwrap();\n    let accounts_file = \"accounts.json\";\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"account\",\n        \"create\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account\",\n        \"--class-hash\",\n        class_hash,\n        \"--type\",\n        account_type,\n    ];\n\n    runner(&args).current_dir(tempdir.path()).assert().success();\n\n    let contents = fs::read_to_string(tempdir.path().join(accounts_file)).unwrap();\n    let items: Value = serde_json::from_str(&contents).unwrap();\n\n    mint_token(\n        items[\"alpha-sepolia\"][\"my_account\"][\"address\"]\n            .as_str()\n            .unwrap(),\n        u128::MAX,\n    )\n    .await;\n\n    let args = vec![\n        \"--accounts-file\",\n        accounts_file,\n        \"--json\",\n        \"account\",\n        \"deploy\",\n        \"--url\",\n        URL,\n        \"--name\",\n        \"my_account\",\n    ];\n\n    runner(&args).current_dir(tempdir.path()).assert().success();\n\n    tempdir\n}\n\npub fn join_tempdirs(from: &TempDir, to: &TempDir) {\n    copy(\n        from.path(),\n        to.path(),\n        &CopyOptions::new().overwrite(true).content_only(true),\n    )\n    .expect(\"Failed to copy the directory\");\n}\n"
  },
  {
    "path": "crates/sncast/tests/helpers/mod.rs",
    "content": "pub mod constants;\npub mod devnet;\npub mod devnet_detection;\npub mod devnet_provider;\npub mod env;\npub mod fixtures;\npub mod runner;\npub mod shell;\n"
  },
  {
    "path": "crates/sncast/tests/helpers/runner.rs",
    "content": "use snapbox::cargo_bin;\nuse snapbox::cmd::Command;\n\n#[must_use]\npub fn runner(args: &[&str]) -> Command {\n    Command::new(cargo_bin!(\"sncast\")).args(args)\n}\n"
  },
  {
    "path": "crates/sncast/tests/helpers/shell.rs",
    "content": "use camino::Utf8PathBuf;\nuse snapbox::cmd::Command;\n\n#[must_use]\npub fn os_specific_shell(script_path: &Utf8PathBuf) -> Command {\n    let test_path = script_path.with_extension(\"sh\");\n    let absolute_test_path = test_path.canonicalize_utf8().unwrap();\n\n    Command::new(absolute_test_path)\n}\n"
  },
  {
    "path": "crates/sncast/tests/integration/fee.rs",
    "content": "use sncast::helpers::fee::{FeeArgs, FeeSettings};\nuse starknet_rust::core::types::FeeEstimate;\nuse starknet_types_core::felt::{Felt, NonZeroFelt};\n\n#[tokio::test]\nasync fn test_happy_case() {\n    let args = FeeArgs {\n        max_fee: None,\n        l1_gas: Some(100),\n        l1_gas_price: Some(200),\n        l2_gas: Some(100),\n        l2_gas_price: Some(200),\n        l1_data_gas: Some(100),\n        l1_data_gas_price: Some(200),\n        tip: None,\n        estimate_tip: false,\n    };\n\n    let settings = args.try_into_fee_settings(None).unwrap();\n\n    assert_eq!(\n        settings,\n        FeeSettings {\n            l1_gas: Some(100),\n            l1_gas_price: Some(200),\n            l2_gas: Some(100),\n            l2_gas_price: Some(200),\n            l1_data_gas: Some(100),\n            l1_data_gas_price: Some(200),\n            tip: Some(0),\n        }\n    );\n}\n\n#[tokio::test]\nasync fn test_max_fee_none() {\n    let args = FeeArgs {\n        max_fee: None,\n        l1_gas: Some(100),\n        l1_gas_price: Some(100),\n        l2_gas: Some(100),\n        l2_gas_price: Some(100),\n        l1_data_gas: Some(100),\n        l1_data_gas_price: Some(100),\n        tip: Some(100),\n        estimate_tip: false,\n    };\n\n    let settings = args.try_into_fee_settings(None).unwrap();\n\n    assert_eq!(\n        settings,\n        FeeSettings {\n            l1_gas: Some(100),\n            l1_gas_price: Some(100),\n            l2_gas: Some(100),\n            l2_gas_price: Some(100),\n            l1_data_gas: Some(100),\n            l1_data_gas_price: Some(100),\n            tip: Some(100),\n        }\n    );\n}\n\n#[tokio::test]\nasync fn test_max_fee_set() {\n    let mock_fee_estimate = FeeEstimate {\n        l1_gas_consumed: 1,\n        l1_gas_price: 2,\n        l2_gas_consumed: 3,\n        l2_gas_price: 4,\n        l1_data_gas_consumed: 5,\n        l1_data_gas_price: 6,\n        overall_fee: 44,\n    };\n\n    let args = FeeArgs {\n        max_fee: Some(NonZeroFelt::try_from(Felt::from(100)).unwrap()),\n        l1_gas: None,\n        l1_gas_price: None,\n        l2_gas: None,\n        l2_gas_price: None,\n        l1_data_gas: None,\n        l1_data_gas_price: None,\n        tip: None,\n        estimate_tip: false,\n    };\n\n    let settings = args\n        .try_into_fee_settings(Some(&mock_fee_estimate))\n        .unwrap();\n\n    assert_eq!(\n        settings,\n        FeeSettings {\n            l1_gas: Some(1),\n            l1_gas_price: Some(2),\n            l2_gas: Some(3),\n            l2_gas_price: Some(4),\n            l1_data_gas: Some(5),\n            l1_data_gas_price: Some(6),\n            tip: Some(0),\n        }\n    );\n}\n\n#[tokio::test]\nasync fn test_max_fee_set_and_fee_estimate_higher() {\n    let mock_fee_estimate = FeeEstimate {\n        l1_gas_consumed: 10,\n        l1_data_gas_price: 20,\n        l2_gas_consumed: 30,\n        l2_gas_price: 40,\n        l1_data_gas_consumed: 50,\n        l1_gas_price: 60,\n        overall_fee: 4400,\n    };\n\n    let args = FeeArgs {\n        max_fee: Some(NonZeroFelt::try_from(Felt::from(100)).unwrap()),\n        l1_gas: None,\n        l1_gas_price: None,\n        l2_gas: None,\n        l2_gas_price: None,\n        l1_data_gas: None,\n        l1_data_gas_price: None,\n        tip: None,\n        estimate_tip: false,\n    };\n\n    let err = args\n        .try_into_fee_settings(Some(&mock_fee_estimate))\n        .unwrap_err();\n\n    assert_eq!(\n        err.to_string(),\n        format!(\n            \"Estimated fee ({}) is higher than provided max fee ({})\",\n            mock_fee_estimate.overall_fee,\n            Felt::from(args.max_fee.unwrap())\n        )\n    );\n}\n\n#[tokio::test]\n#[should_panic(expected = \"Fee estimate must be passed when max_fee is provided\")]\nasync fn test_max_fee_set_and_fee_estimate_none() {\n    let args = FeeArgs {\n        max_fee: Some(NonZeroFelt::try_from(Felt::from(100)).unwrap()),\n        l1_gas: None,\n        l1_gas_price: None,\n        l2_gas: None,\n        l2_gas_price: None,\n        l1_data_gas: None,\n        l1_data_gas_price: None,\n        tip: None,\n        estimate_tip: false,\n    };\n\n    args.try_into_fee_settings(None).unwrap();\n}\n\n#[tokio::test]\nasync fn test_all_args_none() {\n    let args = FeeArgs {\n        max_fee: None,\n        l1_gas: None,\n        l1_gas_price: None,\n        l2_gas: None,\n        l2_gas_price: None,\n        l1_data_gas: None,\n        l1_data_gas_price: None,\n        tip: None,\n        estimate_tip: false,\n    };\n\n    let settings = args.try_into_fee_settings(None).unwrap();\n\n    assert_eq!(\n        settings,\n        FeeSettings {\n            l1_gas: None,\n            l1_gas_price: None,\n            l2_gas: None,\n            l2_gas_price: None,\n            l1_data_gas: None,\n            l1_data_gas_price: None,\n            tip: Some(0),\n        }\n    );\n}\n\n#[tokio::test]\nasync fn test_estimate_tip() {\n    let args = FeeArgs {\n        max_fee: None,\n        l1_gas: None,\n        l1_gas_price: None,\n        l2_gas: None,\n        l2_gas_price: None,\n        l1_data_gas: None,\n        l1_data_gas_price: None,\n        tip: None,\n        estimate_tip: true,\n    };\n\n    let settings = args.try_into_fee_settings(None).unwrap();\n\n    assert_eq!(\n        settings,\n        FeeSettings {\n            l1_gas: None,\n            l1_gas_price: None,\n            l2_gas: None,\n            l2_gas_price: None,\n            l1_data_gas: None,\n            l1_data_gas_price: None,\n            tip: None,\n        }\n    );\n}\n"
  },
  {
    "path": "crates/sncast/tests/integration/lib_tests.rs",
    "content": "use crate::helpers::constants::{\n    DEVNET_OZ_CLASS_HASH_CAIRO_0, DEVNET_PREDEPLOYED_ACCOUNT_ADDRESS, URL,\n};\nuse crate::helpers::fixtures::create_test_provider;\n\nuse camino::Utf8PathBuf;\nuse shared::rpc::{get_rpc_version, is_expected_version};\nuse sncast::helpers::configuration::CastConfig;\nuse sncast::helpers::rpc::RpcArgs;\nuse sncast::response::ui::UI;\nuse sncast::{check_if_legacy_contract, get_account, get_provider};\nuse starknet_rust::macros::felt;\nuse url::Url;\n\n#[tokio::test]\nasync fn test_get_provider() {\n    let provider = get_provider(&Url::parse(URL).unwrap());\n    assert!(provider.is_ok());\n}\n\n#[tokio::test]\nasync fn test_get_account() {\n    let provider = create_test_provider();\n    let config = CastConfig {\n        account: \"user1\".to_string(),\n        accounts_file: Utf8PathBuf::from(\"tests/data/accounts/accounts.json\"),\n        ..Default::default()\n    };\n    let rpc_args = RpcArgs {\n        url: Some(Url::parse(URL).expect(\"Failed to parse URL\")),\n        network: None,\n    };\n    let account = get_account(&config, &provider, &rpc_args, &UI::default())\n        .await\n        .unwrap();\n\n    assert_eq!(account.chain_id(), felt!(\"0x534e5f5345504f4c4941\"));\n    assert_eq!(\n        account.address(),\n        felt!(\"0xf6ecd22832b7c3713cfa7826ee309ce96a2769833f093795fafa1b8f20c48b\")\n    );\n}\n\n#[tokio::test]\nasync fn test_get_account_no_file() {\n    let provider = create_test_provider();\n    let config = CastConfig {\n        account: \"user1\".to_string(),\n        accounts_file: Utf8PathBuf::from(\"tests/data/accounts/nonexistentfile.json\"),\n        ..Default::default()\n    };\n    let rpc_args = RpcArgs {\n        url: Some(Url::parse(URL).expect(\"Failed to parse URL\")),\n        network: None,\n    };\n    let account = get_account(&config, &provider, &rpc_args, &UI::default()).await;\n    let err = account.unwrap_err();\n    assert!(\n        err.to_string()\n            .contains(\"Accounts file = tests/data/accounts/nonexistentfile.json does not exist!\")\n    );\n}\n\n#[tokio::test]\nasync fn test_get_account_invalid_file() {\n    let provider = create_test_provider();\n    let config = CastConfig {\n        account: \"user1\".to_string(),\n        accounts_file: Utf8PathBuf::from(\"tests/data/accounts/invalid_format.json\"),\n        ..Default::default()\n    };\n    let rpc_args = RpcArgs {\n        url: Some(Url::parse(URL).expect(\"Failed to parse URL\")),\n        network: None,\n    };\n    let account = get_account(&config, &provider, &rpc_args, &UI::default()).await;\n    let err = account.unwrap_err();\n    assert!(err\n        .to_string()\n        .contains(\"Failed to parse field `alpha-sepolia.?` in file 'tests/data/accounts/invalid_format.json': expected `,` or `}` at line 8 column 9\")\n    );\n}\n\n#[tokio::test]\nasync fn test_get_account_no_account() {\n    let provider = create_test_provider();\n    let config = CastConfig {\n        account: String::new(),\n        accounts_file: Utf8PathBuf::from(\"tests/data/accounts/accounts.json\"),\n        ..Default::default()\n    };\n    let rpc_args = RpcArgs {\n        url: Some(Url::parse(URL).expect(\"Failed to parse URL\")),\n        network: None,\n    };\n    let account = get_account(&config, &provider, &rpc_args, &UI::default()).await;\n    let err = account.unwrap_err();\n    assert!(\n        err.to_string()\n            .contains(\"Account name not passed nor found in snfoundry.toml\")\n    );\n}\n\n#[tokio::test]\nasync fn test_get_account_no_user_for_network() {\n    let provider = create_test_provider();\n    let config = CastConfig {\n        account: \"user100\".to_string(),\n        accounts_file: Utf8PathBuf::from(\"tests/data/accounts/accounts.json\"),\n        ..Default::default()\n    };\n    let rpc_args = RpcArgs {\n        url: Some(Url::parse(URL).expect(\"Failed to parse URL\")),\n        network: None,\n    };\n    let account = get_account(&config, &provider, &rpc_args, &UI::default()).await;\n    let err = account.unwrap_err();\n    assert!(\n        err.to_string()\n            .contains(\"Account = user100 not found under network = alpha-sepolia\")\n    );\n}\n\n#[tokio::test]\nasync fn test_get_account_failed_to_convert_field_elements() {\n    let provider = create_test_provider();\n    let config = CastConfig {\n        account: \"with_invalid_private_key\".to_string(),\n        accounts_file: Utf8PathBuf::from(\"tests/data/accounts/faulty_accounts_invalid_felt.json\"),\n        ..Default::default()\n    };\n    let rpc_args = RpcArgs {\n        url: Some(Url::parse(URL).expect(\"Failed to parse URL\")),\n        network: None,\n    };\n    let account1 = get_account(&config, &provider, &rpc_args, &UI::default()).await;\n    let err = account1.unwrap_err();\n\n    assert!(err.to_string().contains(\n        \"Failed to parse field `alpha-sepolia.with_invalid_private_key` in file 'tests/data/accounts/faulty_accounts_invalid_felt.json': data did not match any variant of untagged enum SignerType at line 9 column 9\"\n    ));\n}\n\n// TODO (#1690): Move this test to the shared crate and execute it for a real node\n#[tokio::test]\nasync fn test_supported_rpc_version_matches_devnet_version() {\n    let provider = create_test_provider();\n    let devnet_spec_version = get_rpc_version(&provider).await.unwrap();\n    assert!(is_expected_version(&devnet_spec_version));\n}\n\n#[tokio::test]\nasync fn test_check_if_legacy_contract_by_class_hash() {\n    let provider = create_test_provider();\n    let class_hash = DEVNET_OZ_CLASS_HASH_CAIRO_0\n        .parse()\n        .expect(\"Failed to parse DEVNET_OZ_CLASS_HASH_CAIRO_0\");\n    let mock_address = \"0x1\".parse().unwrap();\n    let is_legacy = check_if_legacy_contract(Some(class_hash), mock_address, &provider)\n        .await\n        .unwrap();\n    assert!(is_legacy);\n}\n\n#[tokio::test]\nasync fn test_check_if_legacy_contract_by_address() {\n    let provider = create_test_provider();\n    let address = DEVNET_PREDEPLOYED_ACCOUNT_ADDRESS\n        .parse()\n        .expect(\"Failed to parse DEVNET_PREDEPLOYED_ACCOUNT_ADDRESS\");\n    let is_legacy = check_if_legacy_contract(None, address, &provider)\n        .await\n        .unwrap();\n    assert!(!is_legacy);\n}\n"
  },
  {
    "path": "crates/sncast/tests/integration/mod.rs",
    "content": "mod fee;\nmod lib_tests;\nmod wait_for_tx;\n"
  },
  {
    "path": "crates/sncast/tests/integration/wait_for_tx.rs",
    "content": "use crate::helpers::{\n    constants::{ACCOUNT, ACCOUNT_FILE_PATH, URL},\n    fixtures::{create_test_provider, invoke_contract},\n};\nuse camino::Utf8PathBuf;\nuse sncast::helpers::{\n    configuration::CastConfig, constants::UDC_ADDRESS, fee::FeeSettings, rpc::RpcArgs,\n};\nuse sncast::response::ui::UI;\nuse url::Url;\n\nuse crate::helpers::constants::{\n    CONSTRUCTOR_WITH_PARAMS_CONTRACT_CLASS_HASH_SEPOLIA, MAP_CONTRACT_CLASS_HASH_SEPOLIA,\n    MAP_CONTRACT_DECLARE_TX_HASH_SEPOLIA,\n};\nuse conversions::string::IntoHexStr;\nuse sncast::{ValidatedWaitParams, get_account};\nuse sncast::{WaitForTx, handle_wait_for_tx, wait_for_tx};\nuse starknet_rust::contract::{ContractFactory, UdcSelector};\nuse starknet_types_core::felt::Felt;\n\n#[tokio::test]\nasync fn test_happy_path() {\n    let provider = create_test_provider();\n    let ui = UI::default();\n    let res = wait_for_tx(\n        &provider,\n        MAP_CONTRACT_DECLARE_TX_HASH_SEPOLIA.parse().unwrap(),\n        ValidatedWaitParams::default(),\n        Some(&ui),\n    )\n    .await;\n\n    assert!(res.is_ok());\n    assert!(matches!(res.unwrap().as_str(), \"Transaction accepted\"));\n}\n\n#[tokio::test]\nasync fn test_rejected_transaction() {\n    let provider = create_test_provider();\n    let config = CastConfig {\n        account: ACCOUNT.to_string(),\n        accounts_file: Utf8PathBuf::from(ACCOUNT_FILE_PATH),\n        ..Default::default()\n    };\n    let rpc_args = RpcArgs {\n        url: Some(Url::parse(URL).unwrap()),\n        network: None,\n    };\n    let account = get_account(&config, &provider, &rpc_args, &UI::default())\n        .await\n        .expect(\"Could not get the account\");\n\n    let account = match account {\n        sncast::AccountVariant::LocalWallet(acc) => acc,\n        sncast::AccountVariant::Ledger(_) => panic!(\"Ledger account not supported in tests\"),\n    };\n\n    let factory = ContractFactory::new_with_udc(\n        MAP_CONTRACT_CLASS_HASH_SEPOLIA.parse().unwrap(),\n        account,\n        UdcSelector::New,\n    );\n    let deployment = factory\n        .deploy_v3(Vec::new(), Felt::ONE, false)\n        .l1_gas(1)\n        .l2_gas(1)\n        .l1_data_gas(1)\n        .send()\n        .await\n        .map_err(|e| anyhow::anyhow!(e));\n\n    let resp = deployment.unwrap_err();\n\n    assert!(\n        resp.to_string()\n            .contains(\"InsufficientResourcesForValidate\")\n    );\n}\n\n#[tokio::test]\n#[should_panic(\n    expected = \"Transaction execution failed: Provider(StarknetError(InsufficientResourcesForValidate))\"\n)]\nasync fn test_wait_for_reverted_transaction() {\n    let provider = create_test_provider();\n    let salt = \"0x029c81e6487b5f9278faa6f454cda3c8eca259f99877faab823b3704327cd695\";\n\n    let fee_settings = FeeSettings {\n        l1_gas: Some(1),\n        l1_gas_price: Some(1),\n        l2_gas: Some(1),\n        l2_gas_price: Some(1),\n        l1_data_gas: Some(1),\n        l1_data_gas_price: Some(1),\n        tip: None,\n    };\n    let transaction_hash = invoke_contract(\n        ACCOUNT,\n        UDC_ADDRESS.into_hex_string().as_str(),\n        \"deployContract\",\n        fee_settings,\n        &[\n            CONSTRUCTOR_WITH_PARAMS_CONTRACT_CLASS_HASH_SEPOLIA,\n            salt,\n            \"0x1\",\n            \"0x3\",\n            \"0x43\",\n            \"0x41\",\n            \"0x1\",\n        ],\n    )\n    .await\n    .transaction_hash;\n\n    let ui = UI::default();\n    wait_for_tx(\n        &provider,\n        transaction_hash,\n        ValidatedWaitParams::new(1, 3),\n        Some(&ui),\n    )\n    .await\n    .map_err(anyhow::Error::from)\n    .unwrap();\n}\n\n#[tokio::test]\n#[should_panic(expected = \"sncast timed out while waiting for transaction to succeed\")]\nasync fn test_wait_for_nonexistent_tx() {\n    let provider = create_test_provider();\n    let ui = UI::default();\n    wait_for_tx(\n        &provider,\n        \"0x123456789\".parse().expect(\"Could not parse a number\"),\n        ValidatedWaitParams::new(1, 3),\n        Some(&ui),\n    )\n    .await\n    .map_err(anyhow::Error::from)\n    .unwrap();\n}\n\n#[tokio::test]\nasync fn test_happy_path_handle_wait_for_tx() {\n    let provider = create_test_provider();\n    let ui = UI::default();\n    let res = handle_wait_for_tx(\n        &provider,\n        MAP_CONTRACT_DECLARE_TX_HASH_SEPOLIA.parse().unwrap(),\n        1,\n        WaitForTx {\n            wait: true,\n            wait_params: ValidatedWaitParams::new(5, 63),\n            show_ui_outputs: true,\n        },\n        &ui,\n    )\n    .await;\n\n    assert!(matches!(res, Ok(1)));\n}\n\n#[tokio::test]\n#[should_panic(expected = \"Invalid values for retry_interval and/or timeout!\")]\nasync fn test_wait_for_wrong_retry_values() {\n    let provider = create_test_provider();\n    let ui = UI::default();\n    wait_for_tx(\n        &provider,\n        MAP_CONTRACT_DECLARE_TX_HASH_SEPOLIA.parse().unwrap(),\n        ValidatedWaitParams::new(2, 1),\n        Some(&ui),\n    )\n    .await\n    .unwrap();\n}\n\n#[tokio::test]\n#[should_panic(expected = \"Invalid values for retry_interval and/or timeout!\")]\nasync fn test_wait_for_wrong_retry_values_timeout_zero() {\n    let provider = create_test_provider();\n    let ui = UI::default();\n    wait_for_tx(\n        &provider,\n        MAP_CONTRACT_DECLARE_TX_HASH_SEPOLIA.parse().unwrap(),\n        ValidatedWaitParams::new(2, 0),\n        Some(&ui),\n    )\n    .await\n    .unwrap();\n}\n\n#[tokio::test]\n#[should_panic(expected = \"Invalid values for retry_interval and/or timeout!\")]\nasync fn test_wait_for_wrong_retry_values_interval_zero() {\n    let provider = create_test_provider();\n    let ui = UI::default();\n    wait_for_tx(\n        &provider,\n        MAP_CONTRACT_DECLARE_TX_HASH_SEPOLIA.parse().unwrap(),\n        ValidatedWaitParams::new(0, 1),\n        Some(&ui),\n    )\n    .await\n    .unwrap();\n}\n"
  },
  {
    "path": "crates/sncast/tests/main.rs",
    "content": "mod docs_snippets;\nmod e2e;\npub mod helpers;\nmod integration;\n"
  },
  {
    "path": "crates/sncast/tests/shell/call.sh",
    "content": "#!/bin/bash\n\nCAST_BINARY=\"$1\"\nURL=\"$2\"\nDATA_TRANSFORMER_CONTRACT_ADDRESS_SEPOLIA=\"$3\"\n\n$CAST_BINARY \\\n  --json \\\n  call \\\n  --url \\\n  \"$URL\" \\\n  --contract-address \\\n  \"$DATA_TRANSFORMER_CONTRACT_ADDRESS_SEPOLIA\" \\\n  --function \\\n  complex_fn \\\n  --arguments 'array![array![1, 2], array![3, 4, 5], array![6]],'\\\n'12,'\\\n'-128_i8,'\\\n'\"Some string (a ByteArray)\",'\\\n\"('a shortstring', 32_u32),\"\\\n'true,'\\\n'0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'\n"
  },
  {
    "path": "crates/sncast/tests/shell/call_unsigned.sh",
    "content": "#!/bin/bash\n\nCAST_BINARY=\"$1\"\nURL=\"$2\"\nDATA_TRANSFORMER_CONTRACT_ADDRESS_SEPOLIA=\"$3\"\n\n$CAST_BINARY \\\n  --json \\\n  call \\\n  --url \\\n  \"$URL\" \\\n  --contract-address \\\n  \"$DATA_TRANSFORMER_CONTRACT_ADDRESS_SEPOLIA\" \\\n  --function \\\n  multiple_signed_fn \\\n  --arguments '-3_i32, -4'\n"
  },
  {
    "path": "crates/sncast/tests/shell/deploy.sh",
    "content": "#!/bin/bash\n\nCAST_BINARY=\"$1\"\nURL=\"$2\"\nCONSTRUCTOR_WITH_PARAMS_CONTRACT_CLASS_HASH_SEPOLIA=\"$3\"\n\n$CAST_BINARY \\\n  --accounts-file \\\n  accounts.json \\\n  --account \\\n  my_account \\\n  --json \\\n  deploy \\\n  --url \\\n  \"$URL\" \\\n  --class-hash \\\n  \"$CONSTRUCTOR_WITH_PARAMS_CONTRACT_CLASS_HASH_SEPOLIA\" \\\n  --arguments \\\n  '0x420, 0x2137_u256' \\\n  --l1-gas \\\n  100000 \\\n  --l1-gas-price \\\n  10000000000000 \\\n  --l2-gas \\\n  1000000000 \\\n  --l2-gas-price \\\n  100000000000000000000 \\\n  --l1-data-gas \\\n  100000 \\\n  --l1-data-gas-price \\\n  10000000000000\n"
  },
  {
    "path": "crates/sncast/tests/shell/invoke.sh",
    "content": "#!/bin/bash\n\nCAST_BINARY=\"$1\"\nURL=\"$2\"\nDATA_TRANSFORMER_CONTRACT_ADDRESS_SEPOLIA=\"$3\"\n\n$CAST_BINARY \\\n  --accounts-file \\\n  accounts.json \\\n  --account \\\n  my_account \\\n  --json \\\n  invoke \\\n  --url \\\n  \"$URL\" \\\n  --contract-address \\\n  \"$DATA_TRANSFORMER_CONTRACT_ADDRESS_SEPOLIA\" \\\n  --function \\\n  complex_fn \\\n  --arguments 'array![array![1, 2], array![3, 4, 5], array![6]],'\\\n'12,'\\\n'-128_i8,'\\\n'\"Some string (a ByteArray)\",'\\\n\"('a shortstring', 32_u32),\"\\\n'true,'\\\n'0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff' \\\n  --max-fee \\\n  99999999999999999 \\\n"
  },
  {
    "path": "crates/sncast/tests/shell/serialize.sh",
    "content": "#!/bin/bash\n\nCAST_BINARY=\"$1\"\nURL=\"$2\"\nDATA_TRANSFORMER_CONTRACT_ADDRESS_SEPOLIA=\"$3\"\n\n$CAST_BINARY \\\n  utils \\\n  serialize \\\n  --url \\\n  \"$URL\" \\\n  --contract-address \\\n  \"$DATA_TRANSFORMER_CONTRACT_ADDRESS_SEPOLIA\" \\\n  --function \\\n  complex_fn \\\n  --arguments 'array![array![1, 2], array![3, 4, 5], array![6]],'\\\n'12,'\\\n'-128_i8,'\\\n'\"Some string (a ByteArray)\",'\\\n\"('a shortstring', 32_u32),\"\\\n'true,'\\\n'0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff' \\\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/Cargo.toml",
    "content": "[package]\nname = \"snforge_scarb_plugin\"\nversion = \"0.59.0\"\nedition = \"2024\"\npublish = false\nrust-version = \"1.87.0\"\n\n[lib]\ncrate-type = [\"rlib\", \"cdylib\"]\n\n[profile.ci]\ninherits = \"release\"\ndebug-assertions = true\n\n[dependencies]\ncairo-lang-macro = \"0.2.1\"\ncairo-lang-parser = \"=2.12.3\"\ncairo-lang-utils = \"=2.12.3\"\ncairo-lang-syntax = \"=2.12.3\"\ncairo-lang-primitive-token = \"1\"\nurl = \"=2.5.4\"\nindoc = \"=2.0.5\"\nsmol_str = \"=0.3.2\"\nnum-bigint = \"=0.4.6\"\nregex = \"1.11.1\"\nxxhash-rust = { version = \"0.8\", features = [\"xxh3\"] }\n\n[dev-dependencies]\ncairo-lang-formatter = \"=2.12.3\"\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/Scarb.toml",
    "content": "[package]\nname = \"snforge_scarb_plugin\"\nversion = \"0.59.0\"\nedition = \"2024_07\"\ninclude = [\"target/scarb/cairo-plugin/\"]\n\n[cairo-plugin]\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/clippy.toml",
    "content": "disallowed-methods = [\n    { path = \"std::env::args\", reason = \"all external inputs should be handled inside ExternalInputs struct\" },\n    { path = \"std::env::args_os\", reason = \"all external inputs should be handled inside ExternalInputs struct\" },\n    { path = \"std::env::current_dir\", reason = \"all external inputs should be handled inside ExternalInputs struct\" },\n    { path = \"std::env::current_exe\", reason = \"all external inputs should be handled inside ExternalInputs struct\" },\n    { path = \"std::env::home_dir\", reason = \"all external inputs should be handled inside ExternalInputs struct\" },\n    { path = \"std::env::var\", reason = \"all external inputs should be handled inside ExternalInputs struct\" },\n    { path = \"std::env::var_os\", reason = \"all external inputs should be handled inside ExternalInputs struct\" },\n    { path = \"std::env::vars\", reason = \"all external inputs should be handled inside ExternalInputs struct\" },\n    { path = \"std::env::vars_os\", reason = \"all external inputs should be handled inside ExternalInputs struct\" },\n    { path = \"std::fs::exists\", reason = \"all external inputs should be handled inside ExternalInputs struct\" },\n    { path = \"std::fs::hard_link\", reason = \"all external inputs should be handled inside ExternalInputs struct\" },\n    { path = \"std::fs::metadata\", reason = \"all external inputs should be handled inside ExternalInputs struct\" },\n    { path = \"std::fs::read\", reason = \"all external inputs should be handled inside ExternalInputs struct\" },\n    { path = \"std::fs::read_dir\", reason = \"all external inputs should be handled inside ExternalInputs struct\" },\n    { path = \"std::fs::read_link\", reason = \"all external inputs should be handled inside ExternalInputs struct\" },\n    { path = \"std::fs::read_to_string\", reason = \"all external inputs should be handled inside ExternalInputs struct\" },\n    { path = \"std::fs::symlink_metadata\", reason = \"all external inputs should be handled inside ExternalInputs struct\" },\n]\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/src/args/named.rs",
    "content": "use crate::attributes::{AttributeInfo, ErrorExt};\nuse cairo_lang_macro::Diagnostic;\nuse cairo_lang_syntax::node::ast::Expr;\nuse indoc::formatdoc;\nuse smol_str::SmolStr;\nuse std::{\n    collections::HashMap,\n    ops::{Deref, DerefMut},\n};\n\n#[derive(Debug, Default, Clone)]\npub struct NamedArgs(HashMap<SmolStr, Vec<Expr>>);\n\nimpl Deref for NamedArgs {\n    type Target = HashMap<SmolStr, Vec<Expr>>;\n\n    fn deref(&self) -> &Self::Target {\n        &self.0\n    }\n}\n\nimpl DerefMut for NamedArgs {\n    fn deref_mut(&mut self) -> &mut Self::Target {\n        &mut self.0\n    }\n}\n\nimpl NamedArgs {\n    pub fn allow_only<T: AttributeInfo>(&self, expected: &[&str]) -> Result<(), Diagnostic> {\n        let mut unexpected = self\n            .0\n            .keys()\n            .filter(|k| !expected.contains(&k.as_str()))\n            .collect::<Vec<_>>();\n\n        if unexpected.is_empty() {\n            return Ok(());\n        }\n\n        // Sort for deterministic output\n        unexpected.sort_by_key(|k| k.as_str());\n\n        Err(T::error(formatdoc!(\n            \"unexpected argument(s): {}\",\n            unexpected\n                .iter()\n                .map(|k| format!(\"<{}>\", k.as_str()))\n                .collect::<Vec<_>>()\n                .join(\", \")\n        )))\n    }\n\n    pub fn as_once(&self, arg: &str) -> Result<&Expr, Diagnostic> {\n        let exprs = self\n            .0\n            .get(arg)\n            .ok_or_else(|| Diagnostic::error(format!(\"<{arg}> argument is missing\")))?;\n\n        Self::once(exprs, arg)\n    }\n\n    pub fn as_once_optional(&self, arg: &str) -> Result<Option<&Expr>, Diagnostic> {\n        let exprs = self.0.get(arg);\n\n        match exprs {\n            None => Ok(None),\n            Some(exprs) => Self::once(exprs, arg).map(Some),\n        }\n    }\n\n    fn once<'a>(exprs: &'a [Expr], arg: &str) -> Result<&'a Expr, Diagnostic> {\n        if exprs.len() == 1 {\n            Ok(exprs.last().unwrap())\n        } else {\n            Err(Diagnostic::error(format!(\n                \"<{arg}> argument was specified {} times, expected to be used only once\",\n                exprs.len()\n            )))\n        }\n    }\n\n    pub fn one_of_once<T: AsRef<str> + Copy>(&self, args: &[T]) -> Result<(T, &Expr), Diagnostic> {\n        let (field, values) = self.one_of(args)?;\n\n        let value = Self::once(values, field.as_ref())?;\n\n        Ok((field, value))\n    }\n\n    pub fn one_of<T: AsRef<str> + Copy>(&self, args: &[T]) -> Result<(T, &Vec<Expr>), Diagnostic> {\n        let occurred_args: Vec<_> = args\n            .iter()\n            .filter(|arg| self.0.contains_key(arg.as_ref()))\n            .collect();\n\n        match occurred_args.as_slice() {\n            [field] => Ok((**field, self.0.get(field.as_ref()).unwrap())),\n            _ => Err(format!(\n                \"exactly one of {} should be specified, got {}\",\n                args.iter()\n                    .map(|field| format!(\"<{}>\", field.as_ref()))\n                    .collect::<Vec<_>>()\n                    .join(\" | \"),\n                occurred_args.len()\n            )),\n        }\n        .map_err(Diagnostic::error)\n    }\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/src/args/unnamed.rs",
    "content": "use crate::attributes::{AttributeInfo, ErrorExt};\nuse cairo_lang_macro::Diagnostic;\nuse cairo_lang_syntax::node::ast::Expr;\nuse std::{collections::HashMap, ops::Deref};\n\npub struct UnnamedArgs<'a>(Vec<(usize, &'a Expr)>);\n\nimpl<'a> Deref for UnnamedArgs<'a> {\n    type Target = Vec<(usize, &'a Expr)>;\n\n    fn deref(&self) -> &Self::Target {\n        &self.0\n    }\n}\n\nimpl UnnamedArgs<'_> {\n    pub fn new(unnamed: &HashMap<usize, Expr>) -> UnnamedArgs<'_> {\n        let mut args: Vec<_> = unnamed.iter().collect();\n\n        args.sort_by_key(|(a, _)| *a);\n\n        let args = args.into_iter().map(|(&pos, expr)| (pos, expr)).collect();\n\n        UnnamedArgs(args)\n    }\n}\n\nimpl<'a> UnnamedArgs<'a> {\n    pub fn of_length<const N: usize, T: AttributeInfo>(\n        &self,\n    ) -> Result<&[(usize, &'a Expr); N], Diagnostic> {\n        self.as_slice()\n            .try_into()\n            .map_err(|_| T::error(format!(\"expected arguments: {}, got: {}\", N, self.len())))\n    }\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/src/args.rs",
    "content": "use self::{named::NamedArgs, unnamed::UnnamedArgs};\nuse crate::attributes::{AttributeInfo, ErrorExt};\nuse cairo_lang_macro::Diagnostic;\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse cairo_lang_syntax::node::{\n    Terminal,\n    ast::{ArgClause, Expr, OptionArgListParenthesized},\n};\nuse smol_str::SmolStr;\nuse std::collections::HashMap;\n\npub mod named;\npub mod unnamed;\n\n#[derive(Debug, Default)]\npub struct Arguments {\n    named: NamedArgs,\n    unnamed: HashMap<usize, Expr>,\n    shorthand: HashMap<usize, SmolStr>,\n}\n\nimpl Arguments {\n    pub fn new<T: AttributeInfo>(\n        db: &SimpleParserDatabase,\n        args: OptionArgListParenthesized,\n        warns: &mut Vec<Diagnostic>,\n    ) -> Self {\n        let args = match args {\n            OptionArgListParenthesized::Empty(_) => vec![],\n            OptionArgListParenthesized::ArgListParenthesized(args) => {\n                let args = args.arguments(db).elements(db);\n\n                if args.len() == 0 {\n                    warns.push(T::warn(\n                        \"used with empty argument list. Either remove () or specify some arguments\",\n                    ));\n                }\n\n                args.collect::<Vec<_>>()\n            }\n        };\n\n        let mut this = Self::default();\n\n        for (i, arg) in args.into_iter().enumerate() {\n            match arg.arg_clause(db) {\n                ArgClause::Unnamed(value) => {\n                    this.unnamed.insert(i, value.value(db));\n                }\n                ArgClause::FieldInitShorthand(value) => {\n                    this.shorthand.insert(i, value.name(db).name(db).text(db));\n                }\n                ArgClause::Named(value) => {\n                    this.named\n                        .entry(value.name(db).text(db))\n                        .or_default()\n                        .push(value.value(db));\n                }\n            }\n        }\n\n        this\n    }\n\n    pub fn is_empty(&self) -> bool {\n        self.named.is_empty() && self.unnamed.is_empty() && self.shorthand.is_empty()\n    }\n\n    #[inline]\n    pub fn named_only<T: AttributeInfo>(&self) -> Result<&NamedArgs, Diagnostic> {\n        if self.shorthand.is_empty() && self.unnamed.is_empty() {\n            Ok(&self.named)\n        } else {\n            Err(T::error(\"can be used with named arguments only\"))\n        }\n    }\n\n    #[inline]\n    pub fn unnamed_only<T: AttributeInfo>(&self) -> Result<UnnamedArgs<'_>, Diagnostic> {\n        if self.shorthand.is_empty() && self.named.is_empty() {\n            Ok(UnnamedArgs::new(&self.unnamed))\n        } else {\n            Err(T::error(\"can be used with unnamed arguments only\"))\n        }\n    }\n\n    #[inline]\n    pub fn unnamed(&self) -> UnnamedArgs<'_> {\n        UnnamedArgs::new(&self.unnamed)\n    }\n\n    #[inline]\n    pub fn named(&self) -> NamedArgs {\n        self.named.clone()\n    }\n\n    #[inline]\n    pub fn assert_is_empty<T: AttributeInfo>(&self) -> Result<(), Diagnostic> {\n        if self.is_empty() {\n            Ok(())\n        } else {\n            Err(T::error(\"does not accept any arguments\"))?\n        }\n    }\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/src/asserts.rs",
    "content": "use crate::attributes::{AttributeInfo, ErrorExt};\nuse cairo_lang_macro::Diagnostic;\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse cairo_lang_syntax::node::{ast::FunctionWithBody, helpers::QueryAttrs};\n\npub fn assert_is_used_once<T: AttributeInfo>(\n    db: &SimpleParserDatabase,\n    func: &FunctionWithBody,\n) -> Result<(), Diagnostic> {\n    if func.attributes(db).has_attr(db, T::ATTR_NAME) {\n        Err(T::error(\"can only be used once per item\"))\n    } else {\n        Ok(())\n    }\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/src/attributes/available_gas.rs",
    "content": "use crate::{\n    args::Arguments,\n    attributes::{AttributeCollector, AttributeInfo, AttributeTypeData},\n    cairo_expression::CairoExpression,\n    config_statement::extend_with_config_cheatcodes,\n    types::{Number, ParseFromExpr},\n};\nuse cairo_lang_macro::{Diagnostic, Diagnostics, ProcMacroResult, TokenStream, quote};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\n\npub struct AvailableGasCollector;\n\nimpl AttributeInfo for AvailableGasCollector {\n    const ATTR_NAME: &'static str = \"available_gas\";\n}\n\nimpl AttributeTypeData for AvailableGasCollector {\n    const CHEATCODE_NAME: &'static str = \"set_config_available_gas\";\n}\n\nimpl AttributeCollector for AvailableGasCollector {\n    fn args_into_config_expression(\n        db: &SimpleParserDatabase,\n        args: Arguments,\n        _warns: &mut Vec<Diagnostic>,\n    ) -> Result<TokenStream, Diagnostics> {\n        Ok(from_resource_bounds(db, &args)?)\n    }\n}\n\nfn from_resource_bounds(\n    db: &SimpleParserDatabase,\n    args: &Arguments,\n) -> Result<TokenStream, Diagnostic> {\n    let named_args = args.named_only::<AvailableGasCollector>()?;\n\n    named_args.allow_only::<AvailableGasCollector>(&[\"l1_gas\", \"l1_data_gas\", \"l2_gas\"])?;\n\n    let max = u64::MAX;\n    let l1_gas = named_args\n        .as_once_optional(\"l1_gas\")?\n        .map(|arg| Number::parse_from_expr::<AvailableGasCollector>(db, arg, \"l1_gas\"))\n        .transpose()?\n        .unwrap_or(Number(max.into()));\n\n    let l1_data_gas = named_args\n        .as_once_optional(\"l1_data_gas\")?\n        .map(|arg| Number::parse_from_expr::<AvailableGasCollector>(db, arg, \"l1_data_gas\"))\n        .transpose()?\n        .unwrap_or(Number(max.into()));\n\n    let l2_gas = named_args\n        .as_once_optional(\"l2_gas\")?\n        .map(|arg| Number::parse_from_expr::<AvailableGasCollector>(db, arg, \"l2_gas\"))\n        .transpose()?\n        .unwrap_or(Number(max.into()));\n\n    l1_gas.validate_in_gas_range::<AvailableGasCollector>(\"l1_gas\")?;\n    l1_data_gas.validate_in_gas_range::<AvailableGasCollector>(\"l1_data_gas\")?;\n    l2_gas.validate_in_gas_range::<AvailableGasCollector>(\"l2_gas\")?;\n\n    let l1_gas_expr = l1_gas.as_cairo_expression();\n    let l1_data_gas_expr = l1_data_gas.as_cairo_expression();\n    let l2_gas_expr = l2_gas.as_cairo_expression();\n\n    Ok(quote!(\n        snforge_std::_internals::config_types::AvailableResourceBoundsConfig {\n            l1_gas: #l1_gas_expr,\n            l1_data_gas: #l1_data_gas_expr,\n            l2_gas: #l2_gas_expr,\n        }\n    ))\n}\n\n#[must_use]\npub fn available_gas(args: TokenStream, item: TokenStream) -> ProcMacroResult {\n    extend_with_config_cheatcodes::<AvailableGasCollector>(args, item)\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/src/attributes/disable_predeployed_contracts.rs",
    "content": "use super::{AttributeInfo, AttributeTypeData};\nuse crate::{\n    args::Arguments, attributes::AttributeCollector,\n    config_statement::extend_with_config_cheatcodes,\n};\nuse cairo_lang_macro::{Diagnostic, Diagnostics, ProcMacroResult, TokenStream, quote};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\n\npub struct PredeployedContractsCollector;\n\nimpl AttributeInfo for PredeployedContractsCollector {\n    const ATTR_NAME: &'static str = \"disable_predeployed_contracts\";\n}\n\nimpl AttributeTypeData for PredeployedContractsCollector {\n    const CHEATCODE_NAME: &'static str = \"set_config_disable_contracts\";\n}\n\nimpl AttributeCollector for PredeployedContractsCollector {\n    fn args_into_config_expression(\n        _db: &SimpleParserDatabase,\n        args: Arguments,\n        _warns: &mut Vec<Diagnostic>,\n    ) -> Result<TokenStream, Diagnostics> {\n        args.assert_is_empty::<Self>()?;\n\n        Ok(quote! {\n            snforge_std::_internals::config_types::PredeployedContractsConfig { is_disabled: true }\n        })\n    }\n}\n\n#[must_use]\npub fn disable_predeployed_contracts(args: TokenStream, item: TokenStream) -> ProcMacroResult {\n    extend_with_config_cheatcodes::<PredeployedContractsCollector>(args, item)\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/src/attributes/fork/block_id.rs",
    "content": "use super::ForkCollector;\nuse crate::{\n    attributes::ErrorExt,\n    cairo_expression::CairoExpression,\n    types::{Number, ParseFromExpr},\n};\nuse cairo_lang_macro::{Diagnostic, TokenStream, quote};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse cairo_lang_syntax::node::{ast::Expr, helpers::GetIdentifier};\n\n#[derive(Debug, Clone, Copy)]\npub enum BlockIdVariants {\n    Hash,\n    Number,\n    Tag,\n}\n\nimpl AsRef<str> for BlockIdVariants {\n    fn as_ref(&self) -> &str {\n        match self {\n            Self::Hash => \"block_hash\",\n            Self::Number => \"block_number\",\n            Self::Tag => \"block_tag\",\n        }\n    }\n}\n\n#[derive(Debug, Clone)]\npub enum BlockId {\n    Hash(Number),\n    Number(Number),\n    Tag,\n}\n\nimpl CairoExpression for BlockId {\n    fn as_cairo_expression(&self) -> TokenStream {\n        match self {\n            Self::Hash(hash) => {\n                let block_hash = hash.as_cairo_expression();\n                quote!(snforge_std::_internals::config_types::BlockId::BlockHash(#block_hash))\n            }\n            Self::Number(number) => {\n                let block_number = number.as_cairo_expression();\n                quote!(snforge_std::_internals::config_types::BlockId::BlockNumber(#block_number))\n            }\n            Self::Tag => quote!(snforge_std::_internals::config_types::BlockId::BlockTag),\n        }\n    }\n}\n\nimpl ParseFromExpr<(BlockIdVariants, &Expr)> for BlockId {\n    fn parse_from_expr<T: crate::attributes::AttributeInfo>(\n        db: &SimpleParserDatabase,\n        (variant, block_args): &(BlockIdVariants, &Expr),\n        arg_name: &str,\n    ) -> Result<Self, Diagnostic> {\n        match variant {\n            BlockIdVariants::Tag => {\n                if let Expr::Path(path) = block_args {\n                    let segments = path.segments(db).elements(db);\n\n                    if segments.len() == 1 {\n                        let segment = segments.last().unwrap();\n\n                        // currently no other tags\n                        if segment.identifier(db).as_str() == \"latest\" {\n                            return Ok(Self::Tag);\n                        }\n                    }\n                }\n                Err(ForkCollector::error(format!(\n                    \"<{arg_name}> value incorrect, expected: latest\",\n                )))\n            }\n            BlockIdVariants::Hash => {\n                let hash = Number::parse_from_expr::<ForkCollector>(\n                    db,\n                    block_args,\n                    BlockIdVariants::Hash.as_ref(),\n                )?;\n\n                Ok(Self::Hash(hash))\n            }\n            BlockIdVariants::Number => {\n                let number = Number::parse_from_expr::<ForkCollector>(\n                    db,\n                    block_args,\n                    BlockIdVariants::Number.as_ref(),\n                )?;\n\n                Ok(Self::Number(number))\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/src/attributes/fork.rs",
    "content": "use self::block_id::{BlockId, BlockIdVariants};\nuse crate::{\n    args::Arguments,\n    attributes::{AttributeCollector, AttributeInfo, AttributeTypeData},\n    branch,\n    cairo_expression::CairoExpression,\n    config_statement::extend_with_config_cheatcodes,\n    types::ParseFromExpr,\n};\nuse cairo_lang_macro::{Diagnostic, Diagnostics, ProcMacroResult, Severity, TokenStream, quote};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse url::Url;\n\nmod block_id;\n\npub struct ForkCollector;\n\nimpl AttributeInfo for ForkCollector {\n    const ATTR_NAME: &'static str = \"fork\";\n}\n\nimpl AttributeTypeData for ForkCollector {\n    const CHEATCODE_NAME: &'static str = \"set_config_fork\";\n}\n\nimpl AttributeCollector for ForkCollector {\n    fn args_into_config_expression(\n        db: &SimpleParserDatabase,\n        args: Arguments,\n        _warns: &mut Vec<Diagnostic>,\n    ) -> Result<TokenStream, Diagnostics> {\n        let expr = branch!(\n            inline_args(db, &args),\n            overridden_args(db, &args),\n            from_file_args(db, &args)\n        )?;\n\n        Ok(expr)\n    }\n}\n\nfn inline_args(db: &SimpleParserDatabase, args: &Arguments) -> Result<TokenStream, Diagnostic> {\n    let named_args = args.named_only::<ForkCollector>()?;\n\n    named_args.allow_only::<ForkCollector>(&[\"url\", \"block_hash\", \"block_number\", \"block_tag\"])?;\n\n    let block_id = named_args.one_of_once(&[\n        BlockIdVariants::Hash,\n        BlockIdVariants::Number,\n        BlockIdVariants::Tag,\n    ])?;\n    let url = named_args.as_once(\"url\")?;\n\n    let block_id = BlockId::parse_from_expr::<ForkCollector>(db, &block_id, block_id.0.as_ref())?;\n    let url = Url::parse_from_expr::<ForkCollector>(db, url, \"url\")?;\n\n    let block_id = block_id.as_cairo_expression();\n    let url = url.as_cairo_expression();\n\n    Ok(quote!(\n        snforge_std::_internals::config_types::ForkConfig::Inline(\n            snforge_std::_internals::config_types::InlineForkConfig {\n                url: #url,\n                block: #block_id\n            }\n        )\n    ))\n}\n\nfn from_file_args(db: &SimpleParserDatabase, args: &Arguments) -> Result<TokenStream, Diagnostic> {\n    let &[arg] = args\n        .unnamed_only::<ForkCollector>()?\n        .of_length::<1, ForkCollector>()?;\n\n    let name = String::parse_from_expr::<ForkCollector>(db, arg.1, arg.0.to_string().as_str())?;\n\n    let name = name.as_cairo_expression();\n\n    Ok(quote!(snforge_std::_internals::config_types::ForkConfig::Named(#name)))\n}\n\nfn overridden_args(db: &SimpleParserDatabase, args: &Arguments) -> Result<TokenStream, Diagnostic> {\n    let &[arg] = args.unnamed().of_length::<1, ForkCollector>()?;\n\n    let named_args = args.named();\n    named_args.allow_only::<ForkCollector>(&[\"block_hash\", \"block_number\", \"block_tag\"])?;\n\n    let block_id = named_args.one_of_once(&[\n        BlockIdVariants::Hash,\n        BlockIdVariants::Number,\n        BlockIdVariants::Tag,\n    ])?;\n\n    let block_id = BlockId::parse_from_expr::<ForkCollector>(db, &block_id, block_id.0.as_ref())?;\n    let name = String::parse_from_expr::<ForkCollector>(db, arg.1, arg.0.to_string().as_str())?;\n\n    let block_id = block_id.as_cairo_expression();\n    let name = name.as_cairo_expression();\n\n    Ok(quote!(\n        snforge_std::_internals::config_types::ForkConfig::Overridden(\n            snforge_std::_internals::config_types::OverriddenForkConfig {\n                block: #block_id,\n                name: #name\n            }\n        )\n    ))\n}\n\n#[must_use]\npub fn fork(args: TokenStream, item: TokenStream) -> ProcMacroResult {\n    extend_with_config_cheatcodes::<ForkCollector>(args, item)\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/src/attributes/fuzzer/wrapper.rs",
    "content": "use crate::args::Arguments;\nuse crate::attributes::AttributeInfo;\nuse crate::attributes::internal_config_statement::InternalConfigStatementCollector;\nuse crate::attributes::test::TestCollector;\nuse crate::common::{into_proc_macro_result, with_parsed_values};\nuse crate::format_ident;\nuse crate::utils::{SyntaxNodeUtils, create_single_token, get_statements};\nuse cairo_lang_macro::{Diagnostic, Diagnostics, ProcMacroResult, TokenStream, quote};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse cairo_lang_syntax::node::ast::OptionTypeClause::{Empty, TypeClause};\nuse cairo_lang_syntax::node::ast::{FunctionWithBody, Param};\nuse cairo_lang_syntax::node::helpers::QueryAttrs;\nuse cairo_lang_syntax::node::with_db::SyntaxNodeWithDb;\nuse cairo_lang_syntax::node::{Terminal, TypedSyntaxNode};\n\npub struct FuzzerWrapperCollector;\n\nimpl AttributeInfo for FuzzerWrapperCollector {\n    const ATTR_NAME: &'static str = \"__fuzzer_wrapper\";\n}\n\n#[must_use]\npub fn fuzzer_wrapper(args: TokenStream, item: TokenStream) -> ProcMacroResult {\n    into_proc_macro_result(args, item, |args, item, warns| {\n        with_parsed_values::<FuzzerWrapperCollector>(args, item, warns, fuzzer_wrapper_internal)\n    })\n}\n\n#[expect(clippy::needless_pass_by_value)]\nfn fuzzer_wrapper_internal(\n    db: &SimpleParserDatabase,\n    func: &FunctionWithBody,\n    _args_db: &SimpleParserDatabase,\n    args: Arguments,\n    _warns: &mut Vec<Diagnostic>,\n) -> Result<TokenStream, Diagnostics> {\n    args.assert_is_empty::<FuzzerWrapperCollector>()?;\n\n    let attr_list = func.attributes(db);\n    let test_or_executable_attrs =\n        if let Some(test_attr) = attr_list.find_attr(db, TestCollector::ATTR_NAME) {\n            vec![test_attr]\n        } else {\n            attr_list\n                .query_attr(db, InternalConfigStatementCollector::ATTR_NAME)\n                .collect::<Vec<_>>()\n        };\n\n    let actual_body_fn_attrs = attr_list\n        .elements(db)\n        .filter(|attr| !test_or_executable_attrs.contains(attr))\n        .map(|stmt| stmt.to_token_stream(db))\n        .fold(TokenStream::empty(), |mut acc, token| {\n            acc.extend(token);\n            acc\n        });\n\n    let test_or_executable_attrs = test_or_executable_attrs\n        .iter()\n        .map(|stmt| stmt.to_token_stream(db))\n        .fold(TokenStream::empty(), |mut acc, token| {\n            acc.extend(token);\n            acc\n        });\n\n    let vis = func.visibility(db).as_syntax_node();\n    let vis = SyntaxNodeWithDb::new(&vis, db);\n\n    let name = format_ident!(\n        \"{}__snforge_internal_fuzzer_generated\",\n        func.declaration(db).name(db).text(db)\n    );\n\n    let signature = func.declaration(db).signature(db).as_syntax_node();\n    let signature = SyntaxNodeWithDb::new(&signature, db);\n\n    let fuzzer_assignments = extract_and_transform_params(db, func, |param| {\n        let name = param.name(db).as_syntax_node();\n        let name = SyntaxNodeWithDb::new(&name, db);\n\n        let name_type = match param.type_clause(db) {\n            TypeClause(type_clause) => type_clause.ty(db).as_syntax_node(),\n            Empty(option_type_clause) => option_type_clause.as_syntax_node(),\n        };\n        let name_type = SyntaxNodeWithDb::new(&name_type, db);\n\n        quote! {\n            let #name = snforge_std::fuzzable::Fuzzable::<#name_type>::generate();\n            snforge_std::_internals::save_fuzzer_arg(@#name);\n        }\n    });\n\n    let blank_values_for_config_run = extract_and_transform_params(db, func, |_param| {\n        quote! {\n            snforge_std::fuzzable::Fuzzable::blank(),\n        }\n    });\n\n    let arguments_list = extract_and_transform_params(db, func, |param| {\n        let name = param.name(db).as_syntax_node();\n        let name = SyntaxNodeWithDb::new(&name, db);\n\n        quote! {\n            #name,\n        }\n    });\n\n    let func_name = func.declaration(db).name(db).as_syntax_node();\n    let func_name = SyntaxNodeWithDb::new(&func_name, db);\n\n    let (statements, if_content) = get_statements(db, func);\n\n    let internal_config_attr = create_single_token(InternalConfigStatementCollector::ATTR_NAME);\n\n    Ok(quote!(\n            #test_or_executable_attrs\n            #vis fn #name() {\n                if snforge_std::_internals::is_config_run() {\n                    #if_content\n\n                    #func_name(#blank_values_for_config_run);\n\n                    return;\n                }\n                #fuzzer_assignments\n                #func_name(#arguments_list);\n            }\n\n            #actual_body_fn_attrs\n            #[#internal_config_attr]\n            fn #func_name #signature {\n                #statements\n            }\n    ))\n}\n\nfn extract_and_transform_params<F>(\n    db: &SimpleParserDatabase,\n    func: &FunctionWithBody,\n    transformer: F,\n) -> TokenStream\nwhere\n    F: Fn(&Param) -> TokenStream,\n{\n    func.declaration(db)\n        .signature(db)\n        .parameters(db)\n        .elements(db)\n        .map(|e| transformer(&e))\n        .fold(TokenStream::empty(), |mut acc, token| {\n            acc.extend(token);\n            acc\n        })\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/src/attributes/fuzzer.rs",
    "content": "use super::{AttributeCollector, AttributeInfo, AttributeTypeData, ErrorExt};\nuse crate::args::Arguments;\nuse crate::asserts::assert_is_used_once;\nuse crate::attributes::fuzzer::wrapper::FuzzerWrapperCollector;\nuse crate::cairo_expression::CairoExpression;\nuse crate::common::into_proc_macro_result;\nuse crate::config_statement::extend_with_config_cheatcodes;\nuse crate::parse::parse;\nuse crate::types::{Number, ParseFromExpr};\nuse crate::utils::create_single_token;\nuse cairo_lang_macro::{Diagnostic, Diagnostics, ProcMacroResult, TokenStream, quote};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse cairo_lang_syntax::node::TypedSyntaxNode;\nuse cairo_lang_syntax::node::with_db::SyntaxNodeWithDb;\nuse cairo_lang_utils::Upcast;\nuse num_bigint::BigInt;\n\npub mod wrapper;\n\npub struct FuzzerConfigCollector;\n\nimpl AttributeInfo for FuzzerConfigCollector {\n    const ATTR_NAME: &'static str = \"__fuzzer_config\";\n}\n\npub struct FuzzerCollector;\n\nimpl AttributeInfo for FuzzerCollector {\n    const ATTR_NAME: &'static str = \"fuzzer\";\n}\n\nimpl AttributeTypeData for FuzzerCollector {\n    const CHEATCODE_NAME: &'static str = \"set_config_fuzzer\";\n}\n\nimpl AttributeCollector for FuzzerCollector {\n    fn args_into_config_expression(\n        db: &SimpleParserDatabase,\n        args: Arguments,\n        _warns: &mut Vec<Diagnostic>,\n    ) -> Result<TokenStream, Diagnostics> {\n        let named_args = args.named_only::<Self>()?;\n\n        named_args.allow_only::<Self>(&[\"seed\", \"runs\"])?;\n\n        let seed = named_args\n            .as_once_optional(\"seed\")?\n            .map(|arg| Number::parse_from_expr::<Self>(db, arg, \"seed\"))\n            .transpose()?;\n\n        let runs = named_args\n            .as_once_optional(\"runs\")?\n            .map(|arg| Number::parse_from_expr::<Self>(db, arg, \"runs\"))\n            .transpose()?;\n\n        if let Some(Number(ref runs)) = runs {\n            if runs <= &BigInt::from(0) {\n                Err(Self::error(\"runs must be greater than 0\"))?;\n            }\n        }\n\n        let seed = seed.as_cairo_expression();\n        let runs = runs.as_cairo_expression();\n\n        Ok(quote!(\n            snforge_std::_internals::config_types::FuzzerConfig { seed: #seed, runs: #runs }\n        ))\n    }\n}\n\n#[must_use]\npub fn fuzzer(args: TokenStream, item: TokenStream) -> ProcMacroResult {\n    into_proc_macro_result(args, item, fuzzer_internal)\n}\n\n#[must_use]\npub fn fuzzer_config(args: TokenStream, item: TokenStream) -> ProcMacroResult {\n    extend_with_config_cheatcodes::<FuzzerCollector>(args, item)\n}\n\nfn fuzzer_internal(\n    args: &TokenStream,\n    item: &TokenStream,\n    _warns: &mut Vec<Diagnostic>,\n) -> Result<TokenStream, Diagnostics> {\n    let (db, func) = parse::<FuzzerCollector>(item)?;\n    let db = db.upcast();\n\n    assert_is_used_once::<FuzzerCollector>(db, &func)?;\n\n    let attrs = func.attributes(db).as_syntax_node();\n    let attrs = SyntaxNodeWithDb::new(&attrs, db);\n\n    let body = func.body(db).as_syntax_node();\n    let body = SyntaxNodeWithDb::new(&body, db);\n\n    let declaration = func.declaration(db).as_syntax_node();\n    let declaration = SyntaxNodeWithDb::new(&declaration, db);\n\n    let fuzzer_config = create_single_token(FuzzerConfigCollector::ATTR_NAME);\n    let fuzzer_wrapper = create_single_token(FuzzerWrapperCollector::ATTR_NAME);\n\n    let args = args.clone();\n\n    Ok(quote!(\n        #[#fuzzer_config #args]\n        #[#fuzzer_wrapper]\n        #attrs\n        #declaration\n            #body\n    ))\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/src/attributes/ignore.rs",
    "content": "use super::{AttributeInfo, AttributeTypeData};\nuse crate::{\n    args::Arguments, attributes::AttributeCollector,\n    config_statement::extend_with_config_cheatcodes,\n};\nuse cairo_lang_macro::{Diagnostic, Diagnostics, ProcMacroResult, TokenStream, quote};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\n\npub struct IgnoreCollector;\n\nimpl AttributeInfo for IgnoreCollector {\n    const ATTR_NAME: &'static str = \"ignore\";\n}\n\nimpl AttributeTypeData for IgnoreCollector {\n    const CHEATCODE_NAME: &'static str = \"set_config_ignore\";\n}\n\nimpl AttributeCollector for IgnoreCollector {\n    fn args_into_config_expression(\n        _db: &SimpleParserDatabase,\n        args: Arguments,\n        _warns: &mut Vec<Diagnostic>,\n    ) -> Result<TokenStream, Diagnostics> {\n        args.assert_is_empty::<Self>()?;\n\n        Ok(quote!(\n            snforge_std::_internals::config_types::IgnoreConfig { is_ignored: true }\n        ))\n    }\n}\n\n#[must_use]\npub fn ignore(args: TokenStream, item: TokenStream) -> ProcMacroResult {\n    extend_with_config_cheatcodes::<IgnoreCollector>(args, item)\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/src/attributes/internal_config_statement.rs",
    "content": "use super::AttributeInfo;\nuse crate::{\n    args::Arguments,\n    asserts::assert_is_used_once,\n    common::{into_proc_macro_result, with_parsed_values},\n    config_statement::append_config_statements,\n};\nuse cairo_lang_macro::{Diagnostic, Diagnostics, ProcMacroResult, TokenStream};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse cairo_lang_syntax::node::ast::FunctionWithBody;\n\npub struct InternalConfigStatementCollector;\n\nimpl AttributeInfo for InternalConfigStatementCollector {\n    const ATTR_NAME: &'static str = \"__internal_config_statement\";\n}\n\n#[must_use]\npub fn internal_config_statement(args: TokenStream, item: TokenStream) -> ProcMacroResult {\n    into_proc_macro_result(args, item, |args, item, warns| {\n        with_parsed_values::<InternalConfigStatementCollector>(\n            args,\n            item,\n            warns,\n            internal_config_statement_internal,\n        )\n    })\n}\n\n// we need to insert empty config statement in case there was no config used\n// so function will be stopped in configuration mode run\n#[expect(clippy::needless_pass_by_value)]\nfn internal_config_statement_internal(\n    db: &SimpleParserDatabase,\n    func: &FunctionWithBody,\n    _args_db: &SimpleParserDatabase,\n    args: Arguments,\n    _warns: &mut Vec<Diagnostic>,\n) -> Result<TokenStream, Diagnostics> {\n    assert_is_used_once::<InternalConfigStatementCollector>(db, func)?;\n    args.assert_is_empty::<InternalConfigStatementCollector>()?;\n\n    Ok(append_config_statements(db, func, TokenStream::empty()))\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/src/attributes/should_panic/expected.rs",
    "content": "use super::ShouldPanicCollector;\nuse crate::{\n    attributes::{AttributeInfo, ErrorExt},\n    cairo_expression::CairoExpression,\n    types::{Felt, ParseFromExpr},\n};\nuse cairo_lang_macro::{Diagnostic, TokenStream, quote};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse cairo_lang_syntax::node::{Terminal, ast::Expr};\n\n#[derive(Debug, Clone, Default)]\npub enum Expected {\n    Felt(Felt),\n    ByteArray(String),\n    Array(Vec<Felt>),\n    #[default]\n    Any,\n}\n\nimpl CairoExpression for Expected {\n    fn as_cairo_expression(&self) -> TokenStream {\n        match self {\n            Self::Felt(felt) => {\n                let string = felt.as_cairo_expression();\n\n                quote!(snforge_std::_internals::config_types::Expected::ShortString(#string))\n            }\n            Self::ByteArray(string) => {\n                let string = string.as_cairo_expression();\n\n                quote!(snforge_std::_internals::config_types::Expected::ByteArray(#string))\n            }\n            Self::Array(strings) => {\n                let arr = strings.as_cairo_expression();\n\n                quote!(snforge_std::_internals::config_types::Expected::Array(#arr))\n            }\n            Self::Any => quote!(snforge_std::_internals::config_types::Expected::Any),\n        }\n    }\n}\n\nimpl ParseFromExpr<Expr> for Expected {\n    fn parse_from_expr<T: AttributeInfo>(\n        db: &SimpleParserDatabase,\n        expr: &Expr,\n        arg_name: &str,\n    ) -> Result<Self, Diagnostic> {\n        let error_msg = format!(\n            \"<{arg_name}> argument must be string, short string, number or list of short strings or numbers in regular brackets ()\"\n        );\n\n        match expr {\n            Expr::ShortString(_) | Expr::Literal(_) => {\n                Ok(Self::Felt(\n                    Felt::parse_from_expr::<ShouldPanicCollector>(db, expr, arg_name)\n                        // this unwrap is safe because we checked if expression is valid short string or number\n                        .unwrap(),\n                ))\n            }\n            Expr::String(string) => {\n                let string = string.text(db).trim_matches('\"').to_string();\n\n                Ok(Self::ByteArray(string))\n            }\n            Expr::Tuple(expressions) => {\n                let elements = expressions\n                    .expressions(db)\n                    .elements(db)\n                    .map(|expr| Felt::parse_from_expr::<ShouldPanicCollector>(db, &expr, arg_name))\n                    .collect::<Result<Vec<Felt>, Diagnostic>>()\n                    .map_err(|_| ShouldPanicCollector::error(error_msg))?;\n\n                Ok(Self::Array(elements))\n            }\n            _ => Err(ShouldPanicCollector::error(error_msg)),\n        }\n    }\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/src/attributes/should_panic.rs",
    "content": "use self::expected::Expected;\nuse crate::{\n    args::Arguments,\n    attributes::{AttributeCollector, AttributeInfo, AttributeTypeData},\n    cairo_expression::CairoExpression,\n    config_statement::extend_with_config_cheatcodes,\n    types::ParseFromExpr,\n};\nuse cairo_lang_macro::{Diagnostic, Diagnostics, ProcMacroResult, TokenStream, quote};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\n\nmod expected;\n\npub struct ShouldPanicCollector;\n\nimpl AttributeInfo for ShouldPanicCollector {\n    const ATTR_NAME: &'static str = \"should_panic\";\n}\n\nimpl AttributeTypeData for ShouldPanicCollector {\n    const CHEATCODE_NAME: &'static str = \"set_config_should_panic\";\n}\n\nimpl AttributeCollector for ShouldPanicCollector {\n    fn args_into_config_expression(\n        db: &SimpleParserDatabase,\n        args: Arguments,\n        _warns: &mut Vec<Diagnostic>,\n    ) -> Result<TokenStream, Diagnostics> {\n        let named_args = args.named_only::<Self>()?;\n\n        named_args.allow_only::<Self>(&[\"expected\"])?;\n\n        let expected = named_args.as_once_optional(\"expected\")?;\n\n        let expected = expected\n            .map(|expr| Expected::parse_from_expr::<Self>(db, expr, \"expected\"))\n            .transpose()?\n            .unwrap_or_default();\n\n        let expected = expected.as_cairo_expression();\n\n        Ok(quote!(\n            snforge_std::_internals::config_types::ShouldPanicConfig { expected: #expected }\n        ))\n    }\n}\n\n#[must_use]\npub fn should_panic(args: TokenStream, item: TokenStream) -> ProcMacroResult {\n    extend_with_config_cheatcodes::<ShouldPanicCollector>(args, item)\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/src/attributes/test.rs",
    "content": "use super::{AttributeInfo, ErrorExt, internal_config_statement::InternalConfigStatementCollector};\nuse crate::asserts::assert_is_used_once;\nuse crate::common::{has_fuzzer_attribute, has_test_case_attribute};\nuse crate::external_inputs::ExternalInput;\nuse crate::utils::{create_single_token, get_statements};\nuse crate::{\n    args::Arguments,\n    common::{into_proc_macro_result, with_parsed_values},\n    format_ident,\n};\nuse cairo_lang_macro::{Diagnostic, Diagnostics, ProcMacroResult, TokenStream, quote};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse cairo_lang_syntax::node::with_db::SyntaxNodeWithDb;\nuse cairo_lang_syntax::node::{Terminal, TypedSyntaxNode, ast::FunctionWithBody};\n\npub struct TestCollector;\n\nimpl AttributeInfo for TestCollector {\n    const ATTR_NAME: &'static str = \"test\";\n}\n\n#[must_use]\npub fn test(args: TokenStream, item: TokenStream) -> ProcMacroResult {\n    into_proc_macro_result(args, item, |args, item, warns| {\n        with_parsed_values::<TestCollector>(args, item, warns, test_internal)\n    })\n}\n\n#[expect(clippy::needless_pass_by_value)]\nfn test_internal(\n    db: &SimpleParserDatabase,\n    func: &FunctionWithBody,\n    _args_db: &SimpleParserDatabase,\n    args: Arguments,\n    _warns: &mut Vec<Diagnostic>,\n) -> Result<TokenStream, Diagnostics> {\n    assert_is_used_once::<TestCollector>(db, func)?;\n    args.assert_is_empty::<TestCollector>()?;\n    ensure_parameters_only_with_fuzzer_or_test_case_attribute(db, func)?;\n\n    let has_test_case = has_test_case_attribute(db, func);\n    let has_fuzzer = has_fuzzer_attribute(db, func);\n\n    // If the function has `#[test_case]` attribute and does not have `#[fuzzer]`, we can\n    // safely skip code generation from `#[test]`. It will be handled later by `#[test_case]`.\n    if has_test_case && !has_fuzzer {\n        let func_item = func.as_syntax_node();\n        let func_item = SyntaxNodeWithDb::new(&func_item, db);\n\n        return Ok(quote!(\n            #func_item\n        ));\n    }\n\n    let internal_config = create_single_token(InternalConfigStatementCollector::ATTR_NAME);\n\n    let func_item = func.as_syntax_node();\n    let func_item = SyntaxNodeWithDb::new(&func_item, db);\n\n    let name = func.declaration(db).name(db).text(db).to_string();\n\n    let test_filter = ExternalInput::get().forge_test_filter;\n\n    let should_run_test = match test_filter {\n        Some(ref filter) => name.contains(filter),\n        None => true,\n    };\n\n    let has_fuzzer = has_fuzzer_attribute(db, func);\n\n    // If there is `#[fuzzer]` attribute, called function is suffixed with `__snforge_internal_fuzzer_generated`\n    // `#[__fuzzer_wrapper]` is responsible for adding this suffix.\n    let called_func_ident = if has_fuzzer {\n        format_ident!(\"{name}__snforge_internal_fuzzer_generated\")\n    } else {\n        format_ident!(\"{name}\")\n    };\n    let called_func = TokenStream::new(vec![called_func_ident]);\n\n    let signature = func.declaration(db).signature(db).as_syntax_node();\n    let signature = SyntaxNodeWithDb::new(&signature, db);\n    let signature = quote! { #signature };\n\n    let attributes = func.attributes(db).as_syntax_node();\n    let attributes = SyntaxNodeWithDb::new(&attributes, db);\n\n    let test_func = TokenStream::new(vec![format_ident!(\n        \"{}__snforge_internal_test_generated\",\n        name\n    )]);\n    let func_name_node = func.declaration(db).name(db).as_syntax_node();\n    let func_name_ident = SyntaxNodeWithDb::new(&func_name_node, db);\n\n    if should_run_test {\n        let call_args = TokenStream::empty();\n\n        let test_func_with_attrs = test_func_with_attrs(&test_func, &called_func, &call_args);\n\n        let (statements, if_content) = get_statements(db, func);\n\n        Ok(quote!(\n            #test_func_with_attrs\n\n            #attributes\n            fn #func_name_ident #signature\n            {\n               if snforge_std::_internals::is_config_run() {\n                   #if_content\n\n                   return;\n               }\n\n               #statements\n           }\n        ))\n    } else {\n        Ok(quote!(\n            #[#internal_config]\n            #func_item\n        ))\n    }\n}\n\nfn ensure_parameters_only_with_fuzzer_or_test_case_attribute(\n    db: &SimpleParserDatabase,\n    func: &FunctionWithBody,\n) -> Result<(), Diagnostic> {\n    if has_parameters(db, func)\n        && !has_fuzzer_attribute(db, func)\n        && !has_test_case_attribute(db, func)\n    {\n        Err(TestCollector::error(\n            \"function with parameters must have #[fuzzer] or #[test_case] attribute\",\n        ))?;\n    }\n\n    Ok(())\n}\n\nfn has_parameters(db: &SimpleParserDatabase, func: &FunctionWithBody) -> bool {\n    func.declaration(db)\n        .signature(db)\n        .parameters(db)\n        .elements(db)\n        .len()\n        != 0\n}\n\n#[must_use]\npub fn test_func_with_attrs(\n    test_fn_name: &TokenStream,\n    fn_name: &TokenStream,\n    call_args: &TokenStream,\n) -> TokenStream {\n    let test_fn_name = test_fn_name.clone();\n    let fn_name = fn_name.clone();\n    let call_args = call_args.clone();\n    let out_of_gas = create_single_token(\"'Out of gas'\");\n    quote!(\n        #[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)]\n        #[snforge_internal_test_executable]\n        fn #test_fn_name(mut _data: Span<felt252>) -> Span::<felt252> {\n            core::internal::require_implicit::<System>();\n            core::internal::revoke_ap_tracking();\n            core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), #out_of_gas);\n\n            core::option::OptionTraitImpl::expect(\n                core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), #out_of_gas\n            );\n            #fn_name (#call_args);\n\n            let mut arr = ArrayTrait::new();\n            core::array::ArrayTrait::span(@arr)\n        }\n    )\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/src/attributes/test_case/name.rs",
    "content": "use crate::args::unnamed::UnnamedArgs;\nuse crate::attributes::ErrorExt;\nuse crate::attributes::test_case::TestCaseCollector;\nuse cairo_lang_macro::Diagnostics;\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse cairo_lang_syntax::node::TypedSyntaxNode;\nuse cairo_lang_syntax::node::ast::Expr;\nuse regex::Regex;\nuse std::sync::LazyLock;\n\nstatic RE_SANITIZE: LazyLock<Regex> =\n    LazyLock::new(|| Regex::new(r\"[^a-zA-Z0-9]+\").expect(\"Failed to create regex\"));\n\nfn sanitize_expr(expr: &Expr, db: &SimpleParserDatabase) -> String {\n    let expr_text = &expr.as_syntax_node().get_text(db);\n    let expr_sanitized = RE_SANITIZE\n        .replace_all(expr_text, \"_\")\n        .to_lowercase()\n        .trim_matches('_')\n        .to_string();\n\n    if expr_sanitized.is_empty() {\n        \"_empty\".into()\n    } else {\n        expr_sanitized\n    }\n}\n\nfn generate_case_suffix(unnamed_args: &UnnamedArgs, db: &SimpleParserDatabase) -> String {\n    if unnamed_args.is_empty() {\n        unreachable!(\"Arguments cannot be empty for case name generation\");\n    }\n\n    let exprs = unnamed_args\n        .iter()\n        .map(|(_, expr)| sanitize_expr(expr, db))\n        .collect::<Vec<_>>();\n\n    exprs.join(\"_\")\n}\n\npub fn test_case_name(\n    func_name: &str,\n    name_arg: Option<&Expr>,\n    unnamed_args: &UnnamedArgs,\n    db: &SimpleParserDatabase,\n) -> Result<String, Diagnostics> {\n    let suffix = if let Some(expr) = name_arg {\n        match expr {\n            Expr::ShortString(_) | Expr::String(_) => {}\n            _ => {\n                return Err(Diagnostics::from(TestCaseCollector::error(\n                    \"Only string literals are allowed for 'name' argument.\",\n                )));\n            }\n        }\n        sanitize_expr(expr, db)\n    } else {\n        generate_case_suffix(unnamed_args, db)\n    };\n\n    Ok(format!(\"{func_name}_{suffix}\"))\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/src/attributes/test_case.rs",
    "content": "use crate::args::Arguments;\nuse crate::args::unnamed::UnnamedArgs;\nuse crate::attributes::internal_config_statement::InternalConfigStatementCollector;\nuse crate::attributes::test::{TestCollector, test_func_with_attrs};\nuse crate::attributes::test_case::name::test_case_name;\nuse crate::attributes::{AttributeInfo, ErrorExt};\nuse crate::common::{\n    has_fuzzer_attribute, has_test_attribute, into_proc_macro_result, with_parsed_values,\n};\nuse crate::utils::SyntaxNodeUtils;\nuse crate::{create_single_token, format_ident};\nuse cairo_lang_macro::{Diagnostic, Diagnostics, ProcMacroResult, TokenStream, quote};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse cairo_lang_syntax::node::ast::FunctionWithBody;\nuse cairo_lang_syntax::node::with_db::SyntaxNodeWithDb;\nuse cairo_lang_syntax::node::{Terminal, TypedSyntaxNode};\n\nmod name;\n\npub struct TestCaseCollector;\n\nimpl AttributeInfo for TestCaseCollector {\n    const ATTR_NAME: &'static str = \"test_case\";\n}\n\n#[must_use]\npub fn test_case(args: TokenStream, item: TokenStream) -> ProcMacroResult {\n    into_proc_macro_result(args, item, |args, item, warns| {\n        with_parsed_values::<TestCaseCollector>(args, item, warns, test_case_internal)\n    })\n}\n\n#[expect(clippy::needless_pass_by_value)]\nfn test_case_internal(\n    db: &SimpleParserDatabase,\n    func: &FunctionWithBody,\n    args_db: &SimpleParserDatabase,\n    args: Arguments,\n    _warns: &mut Vec<Diagnostic>,\n) -> Result<TokenStream, Diagnostics> {\n    let named_args = args.named();\n    named_args.allow_only::<TestCaseCollector>(&[\"name\"])?;\n\n    let unnamed_args = args.unnamed();\n    ensure_params_valid(func, &args.unnamed(), db)?;\n\n    let func_name = func.declaration(db).name(db);\n\n    let name_arg = named_args.as_once_optional(\"name\")?;\n    let case_fn_name = test_case_name(&func_name.text(db), name_arg, &unnamed_args, args_db)?;\n    let filtered_fn_attrs = collect_preserved_attributes_for_test_case(func, db);\n\n    let signature = func.declaration(db).signature(db).as_syntax_node();\n    let signature = SyntaxNodeWithDb::new(&signature, db);\n\n    let func_body = func.body(db).as_syntax_node();\n    let func_body = SyntaxNodeWithDb::new(&func_body, db);\n\n    let case_fn_name = format_ident!(\"{}\", case_fn_name);\n    let case_fn_name = TokenStream::new(vec![case_fn_name]);\n\n    let func_name = func_name.to_token_stream(db);\n\n    let call_args = args_to_token_stream(&unnamed_args, args_db);\n\n    let test_func_with_attrs = test_func_with_attrs(&case_fn_name, &func_name, &call_args);\n\n    // If the function has both `#[fuzzer]` and `#[test]` attributes, we do not need to add\n    // `#[__internal_config_statement]` attribute, since it will be handled by `#[test]`.\n    let skip_internal_config = has_fuzzer_attribute(db, func) && has_test_attribute(db, func);\n    let internal_config_attr = if skip_internal_config {\n        TokenStream::empty()\n    } else {\n        let internal_config = create_single_token(InternalConfigStatementCollector::ATTR_NAME);\n        quote!(#[#internal_config])\n    };\n\n    let func_ident = quote!(\n        #filtered_fn_attrs\n\n        #internal_config_attr\n        fn #func_name #signature\n        #func_body\n    );\n\n    Ok(quote!(\n        #test_func_with_attrs\n\n        #func_ident\n    ))\n}\n\nfn args_to_token_stream(args: &UnnamedArgs, db: &SimpleParserDatabase) -> TokenStream {\n    args.iter()\n        .map(|(_, expr)| {\n            let expr = expr.as_syntax_node();\n            let expr = SyntaxNodeWithDb::new(&expr, db);\n            quote! { #expr, }\n        })\n        .fold(TokenStream::empty(), |mut acc, token| {\n            acc.extend(token);\n            acc\n        })\n}\n\nfn ensure_params_valid(\n    func: &FunctionWithBody,\n    unnamed_args: &UnnamedArgs,\n    db: &SimpleParserDatabase,\n) -> Result<(), Diagnostics> {\n    let param_count = func\n        .declaration(db)\n        .signature(db)\n        .parameters(db)\n        .elements(db)\n        .len();\n\n    if param_count == 0 {\n        return Err(Diagnostics::from(TestCaseCollector::error(\n            \"The function must have at least one parameter to use #[test_case] attribute\",\n        )));\n    }\n\n    if param_count != unnamed_args.len() {\n        return Err(Diagnostics::from(TestCaseCollector::error(format!(\n            \"Expected {} arguments, but got {}\",\n            param_count,\n            unnamed_args.len()\n        ))));\n    }\n\n    Ok(())\n}\n\nfn collect_preserved_attributes_for_test_case(\n    func: &FunctionWithBody,\n    func_db: &SimpleParserDatabase,\n) -> TokenStream {\n    let attr_list = func.attributes(func_db);\n    let has_fuzzer = has_fuzzer_attribute(func_db, func);\n\n    // We do not want to copy the `#[test]` attribute unless the function has `#[fuzzer]`.\n    // We also do not want to copy `#[__internal_config_statement]` because it will be added later.\n    attr_list\n        .elements(func_db)\n        .filter(|attr| {\n            let test_attr_text = format!(\"#[{}]\", TestCollector::ATTR_NAME);\n            let internal_config_attr_text =\n                format!(\"#[{}]\", InternalConfigStatementCollector::ATTR_NAME);\n            let attr_text = attr.as_syntax_node().get_text(func_db);\n            let attr_text = attr_text.trim();\n            let is_test_attr = attr_text == test_attr_text;\n            let is_internal_config_attr = attr_text == internal_config_attr_text;\n\n            (!is_test_attr || has_fuzzer) && !is_internal_config_attr\n        })\n        .map(|attr| attr.to_token_stream(func_db))\n        .fold(TokenStream::empty(), |mut acc, token| {\n            acc.extend(token);\n            acc\n        })\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/src/attributes.rs",
    "content": "use crate::args::Arguments;\nuse cairo_lang_macro::{Diagnostic, Diagnostics, TokenStream};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\n\npub mod available_gas;\npub mod disable_predeployed_contracts;\npub mod fork;\npub mod fuzzer;\npub mod ignore;\npub mod internal_config_statement;\npub mod should_panic;\npub mod test;\npub mod test_case;\n\npub trait AttributeInfo {\n    const ATTR_NAME: &'static str;\n}\n\npub trait AttributeTypeData {\n    const CHEATCODE_NAME: &'static str;\n}\n\npub trait AttributeCollector: AttributeInfo + AttributeTypeData {\n    fn args_into_config_expression(\n        db: &SimpleParserDatabase,\n        args: Arguments,\n        warns: &mut Vec<Diagnostic>,\n    ) -> Result<TokenStream, Diagnostics>;\n}\n\npub trait ErrorExt {\n    fn error(message: impl ToString) -> Diagnostic;\n    fn warn(message: impl ToString) -> Diagnostic;\n}\n\nimpl<T> ErrorExt for T\nwhere\n    T: AttributeInfo,\n{\n    fn error(message: impl ToString) -> Diagnostic {\n        let message = message.to_string();\n        let attr_name = Self::ATTR_NAME;\n\n        Diagnostic::error(format!(\"#[{attr_name}] {message}\"))\n    }\n\n    fn warn(message: impl ToString) -> Diagnostic {\n        let message = message.to_string();\n        let attr_name = Self::ATTR_NAME;\n\n        Diagnostic::warn(format!(\"#[{attr_name}] {message}\"))\n    }\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/src/cairo_expression.rs",
    "content": "use cairo_lang_macro::{TokenStream, quote};\n\npub trait CairoExpression {\n    fn as_cairo_expression(&self) -> TokenStream;\n}\n\nimpl<T> CairoExpression for Option<T>\nwhere\n    T: CairoExpression,\n{\n    fn as_cairo_expression(&self) -> TokenStream {\n        if let Some(v) = self {\n            let v = v.as_cairo_expression();\n            quote!(Option::Some( #v ))\n        } else {\n            quote!(Option::None)\n        }\n    }\n}\n\nimpl<T> CairoExpression for Vec<T>\nwhere\n    T: CairoExpression,\n{\n    fn as_cairo_expression(&self) -> TokenStream {\n        let items = self.iter().fold(TokenStream::empty(), |mut acc, val| {\n            let val = val.as_cairo_expression();\n            acc.extend(quote! { #val, });\n            acc\n        });\n        quote! {\n            array![#items]\n        }\n    }\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/src/common.rs",
    "content": "use crate::{\n    args::Arguments,\n    attributes::{\n        AttributeInfo,\n        fuzzer::{FuzzerCollector, FuzzerConfigCollector, wrapper::FuzzerWrapperCollector},\n        test::TestCollector,\n        test_case::TestCaseCollector,\n    },\n    parse::{parse, parse_args},\n};\nuse cairo_lang_macro::{Diagnostic, Diagnostics, ProcMacroResult, TokenStream};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse cairo_lang_syntax::node::{TypedSyntaxNode, ast::FunctionWithBody};\nuse cairo_lang_utils::Upcast;\n\n#[expect(clippy::needless_pass_by_value)]\npub fn into_proc_macro_result(\n    args: TokenStream,\n    item: TokenStream,\n    handler: impl Fn(\n        &TokenStream,\n        &TokenStream,\n        &mut Vec<Diagnostic>,\n    ) -> Result<TokenStream, Diagnostics>,\n) -> ProcMacroResult {\n    let mut warns = vec![]; // `Vec<Diagnostic>` instead of `Diagnostics` because `Diagnostics` does not allow to push ready `Diagnostic`\n\n    match handler(&args, &item, &mut warns) {\n        Ok(item) => ProcMacroResult::new(item).with_diagnostics(warns.into()),\n        Err(mut diagnostics) => {\n            diagnostics.extend(warns);\n            ProcMacroResult::new(item).with_diagnostics(diagnostics)\n        }\n    }\n}\n\npub fn with_parsed_values<Collector>(\n    args: &TokenStream,\n    item: &TokenStream,\n    warns: &mut Vec<Diagnostic>,\n    handler: impl Fn(\n        //func item\n        &SimpleParserDatabase,\n        &FunctionWithBody,\n        //args\n        &SimpleParserDatabase,\n        Arguments,\n        //warns\n        &mut Vec<Diagnostic>,\n    ) -> Result<TokenStream, Diagnostics>,\n) -> Result<TokenStream, Diagnostics>\nwhere\n    Collector: AttributeInfo,\n{\n    let (db, func) = parse::<Collector>(item)?;\n\n    let db = db.upcast();\n\n    let (args_db, args) = parse_args(args);\n    let args_db = args_db.upcast();\n\n    let args = Arguments::new::<Collector>(args_db, args, warns);\n\n    handler(db, &func, args_db, args, warns)\n}\n\nfn has_any_attribute(\n    db: &SimpleParserDatabase,\n    func: &FunctionWithBody,\n    attr_names: &[&str],\n) -> bool {\n    func.attributes(db).elements(db).any(|attr| {\n        attr_names.contains(\n            &attr\n                .attr(db)\n                .as_syntax_node()\n                .get_text_without_trivia(db)\n                .as_str(),\n        )\n    })\n}\n\npub fn has_fuzzer_attribute(db: &SimpleParserDatabase, func: &FunctionWithBody) -> bool {\n    const FUZZER_ATTRIBUTES: [&str; 3] = [\n        FuzzerCollector::ATTR_NAME,\n        FuzzerWrapperCollector::ATTR_NAME,\n        FuzzerConfigCollector::ATTR_NAME,\n    ];\n    has_any_attribute(db, func, &FUZZER_ATTRIBUTES)\n}\n\npub fn has_test_case_attribute(db: &SimpleParserDatabase, func: &FunctionWithBody) -> bool {\n    const TEST_CASE_ATTRIBUTES: [&str; 1] = [TestCaseCollector::ATTR_NAME];\n    has_any_attribute(db, func, &TEST_CASE_ATTRIBUTES)\n}\n\npub fn has_test_attribute(db: &SimpleParserDatabase, func: &FunctionWithBody) -> bool {\n    const TEST_ATTRIBUTES: [&str; 1] = [TestCollector::ATTR_NAME];\n    has_any_attribute(db, func, &TEST_ATTRIBUTES)\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/src/config_statement.rs",
    "content": "use crate::asserts::assert_is_used_once;\nuse crate::utils::{create_single_token, get_statements};\nuse crate::{\n    args::Arguments,\n    attributes::AttributeCollector,\n    common::{into_proc_macro_result, with_parsed_values},\n};\nuse cairo_lang_macro::{Diagnostic, Diagnostics, ProcMacroResult, TokenStream, quote};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse cairo_lang_syntax::node::TypedSyntaxNode;\nuse cairo_lang_syntax::node::ast::FunctionWithBody;\nuse cairo_lang_syntax::node::with_db::SyntaxNodeWithDb;\n\npub fn extend_with_config_cheatcodes<Collector>(\n    args: TokenStream,\n    item: TokenStream,\n) -> ProcMacroResult\nwhere\n    Collector: AttributeCollector,\n{\n    into_proc_macro_result(args, item, |args, item, warns| {\n        with_parsed_values::<Collector>(args, item, warns, with_config_cheatcodes::<Collector>)\n    })\n}\n\nfn with_config_cheatcodes<Collector>(\n    db: &SimpleParserDatabase,\n    func: &FunctionWithBody,\n    args_db: &SimpleParserDatabase,\n    args: Arguments,\n    warns: &mut Vec<Diagnostic>,\n) -> Result<TokenStream, Diagnostics>\nwhere\n    Collector: AttributeCollector,\n{\n    assert_is_used_once::<Collector>(db, func)?;\n\n    let value = Collector::args_into_config_expression(args_db, args, warns)?;\n\n    let cheatcode_name = Collector::CHEATCODE_NAME;\n    let cheatcode = create_single_token(format!(\"'{cheatcode_name}'\"));\n    let cheatcode = quote! {\n        starknet::testing::cheatcode::<#cheatcode>(data.span());\n    };\n\n    let config_cheatcode = quote!(\n            let mut data = array![];\n\n            #value\n            .serialize(ref data);\n\n            #cheatcode\n    );\n\n    Ok(append_config_statements(db, func, config_cheatcode))\n}\n\n#[expect(clippy::needless_pass_by_value)]\npub fn append_config_statements(\n    db: &SimpleParserDatabase,\n    func: &FunctionWithBody,\n    config_statements: TokenStream,\n) -> TokenStream {\n    let vis = func.visibility(db).as_syntax_node();\n    let vis = SyntaxNodeWithDb::new(&vis, db);\n\n    let attrs = func.attributes(db).as_syntax_node();\n    let attrs = SyntaxNodeWithDb::new(&attrs, db);\n\n    let declaration = func.declaration(db).as_syntax_node();\n    let declaration = SyntaxNodeWithDb::new(&declaration, db);\n\n    let (statements, if_content) = get_statements(db, func);\n\n    quote!(\n        #attrs\n        #vis #declaration {\n            if snforge_std::_internals::is_config_run() {\n                #if_content\n\n                #config_statements\n\n                return;\n            }\n\n            #statements\n        }\n    )\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/src/external_inputs.rs",
    "content": "use cairo_lang_macro::fingerprint;\nuse std::env;\nuse std::hash::{Hash, Hasher};\nuse xxhash_rust::xxh3::Xxh3;\n\n/// All external inputs that influence the compilation should be added here.\n#[derive(Hash)]\npub struct ExternalInput {\n    pub forge_test_filter: Option<String>,\n}\n\n#[allow(clippy::disallowed_methods)]\nimpl ExternalInput {\n    pub fn get() -> Self {\n        Self {\n            forge_test_filter: env::var(\"SNFORGE_TEST_FILTER\").ok(),\n        }\n    }\n}\n\n/// This function implements a callback that Scarb will use to determine\n/// whether Cairo code depending on this macro should be recompiled.\n/// The callback is concerned with informing Scarb about changes to inputs that don't come from Scarb directly,\n/// like the `SNFORGE_TEST_FILTER` environmental variable.\n///\n/// Warning: Removing this callback can break incremental compilation with this macro!\n#[fingerprint]\nfn test_filter_fingerprint() -> u64 {\n    // The hashes need to be consistent across different runs.\n    // Thus, we cannot use the default hasher, which is rng-seeded.\n    let mut hasher = Xxh3::default();\n    ExternalInput::get().hash(&mut hasher);\n    hasher.finish()\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/src/lib.rs",
    "content": "// Disallows using methods that are not safed to be used.\n// See clippy.toml for the list of disallowed methods and reasoning behind them.\n#![deny(clippy::disallowed_methods)]\n\nuse attributes::fuzzer;\nuse attributes::{\n    available_gas::available_gas, disable_predeployed_contracts::disable_predeployed_contracts,\n    fork::fork, fuzzer::fuzzer, ignore::ignore,\n    internal_config_statement::internal_config_statement, should_panic::should_panic, test::test,\n    test_case::test_case,\n};\nuse cairo_lang_macro::{ProcMacroResult, TokenStream, attribute_macro, executable_attribute};\n\nmod args;\nmod asserts;\npub mod attributes;\nmod cairo_expression;\nmod common;\nmod config_statement;\nmod external_inputs;\nmod parse;\nmod types;\nmod utils;\n\npub use utils::create_single_token;\n\nexecutable_attribute!(\"snforge_internal_test_executable\");\n\n#[attribute_macro]\nfn __internal_config_statement(args: TokenStream, item: TokenStream) -> ProcMacroResult {\n    internal_config_statement(args, item)\n}\n\n#[attribute_macro]\nfn __fuzzer_config(args: TokenStream, item: TokenStream) -> ProcMacroResult {\n    fuzzer::fuzzer_config(args, item)\n}\n\n#[attribute_macro]\nfn __fuzzer_wrapper(args: TokenStream, item: TokenStream) -> ProcMacroResult {\n    fuzzer::wrapper::fuzzer_wrapper(args, item)\n}\n\n#[attribute_macro]\nfn test_case(args: TokenStream, item: TokenStream) -> ProcMacroResult {\n    test_case(args, item)\n}\n\n#[attribute_macro]\nfn test(args: TokenStream, item: TokenStream) -> ProcMacroResult {\n    test(args, item)\n}\n\n#[attribute_macro]\nfn ignore(args: TokenStream, item: TokenStream) -> ProcMacroResult {\n    ignore(args, item)\n}\n\n#[attribute_macro]\nfn fuzzer(args: TokenStream, item: TokenStream) -> ProcMacroResult {\n    fuzzer(args, item)\n}\n\n#[attribute_macro]\nfn fork(args: TokenStream, item: TokenStream) -> ProcMacroResult {\n    fork(args, item)\n}\n\n#[attribute_macro]\nfn available_gas(args: TokenStream, item: TokenStream) -> ProcMacroResult {\n    available_gas(args, item)\n}\n\n#[attribute_macro]\nfn should_panic(args: TokenStream, item: TokenStream) -> ProcMacroResult {\n    should_panic(args, item)\n}\n\n#[attribute_macro]\nfn disable_predeployed_contracts(args: TokenStream, item: TokenStream) -> ProcMacroResult {\n    disable_predeployed_contracts(args, item)\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/src/parse.rs",
    "content": "use crate::attributes::{AttributeInfo, ErrorExt};\nuse crate::utils::create_single_token;\nuse cairo_lang_macro::{Diagnostic, TokenStream, TokenTree, quote};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse cairo_lang_syntax::node::ast::SyntaxFile;\nuse cairo_lang_syntax::node::{\n    TypedSyntaxNode,\n    ast::{FunctionWithBody, ModuleItem, OptionArgListParenthesized},\n    helpers::QueryAttrs,\n};\nuse cairo_lang_utils::Upcast;\n\npub fn parse<T: AttributeInfo>(\n    code: &TokenStream,\n) -> Result<(SimpleParserDatabase, FunctionWithBody), Diagnostic> {\n    let simple_db = SimpleParserDatabase::default();\n    let (parsed_node, diagnostics) = simple_db.parse_token_stream(code);\n\n    if !diagnostics.is_empty() {\n        return Err(Diagnostic::error(\"Failed because of invalid syntax\"));\n    }\n\n    let db = simple_db.upcast();\n    let function = SyntaxFile::from_syntax_node(db, parsed_node)\n        .items(db)\n        .elements(db)\n        .find_map(|element| {\n            if let ModuleItem::FreeFunction(func) = element {\n                Some(func)\n            } else {\n                None\n            }\n        });\n\n    match function {\n        Some(func) => Ok((simple_db, func)),\n        None => Err(T::error(\"can be used only on a function\")),\n    }\n}\n\nstruct InternalCollector;\n\nimpl AttributeInfo for InternalCollector {\n    const ATTR_NAME: &'static str = \"__SNFORGE_INTERNAL_ATTR__\";\n}\n\npub fn parse_args(args: &TokenStream) -> (SimpleParserDatabase, OptionArgListParenthesized) {\n    let attr_name = create_single_token(InternalCollector::ATTR_NAME);\n    let args = args.clone();\n    let mut token_stream = quote! {\n        #[#attr_name #args]\n        fn __SNFORGE_INTERNAL_FN__(){{}}\n    };\n    if !token_stream.is_empty() {\n        match &mut token_stream.tokens[0] {\n            TokenTree::Ident(ident) => {\n                ident.span.start = 0;\n            }\n        }\n    }\n    let (simple_db, func) = parse::<InternalCollector>(&token_stream)\n        .expect(\"Parsing the arguments shouldn't fail at this stage\"); // Arguments were parsed previously, so they should pass parsing here\n\n    let db = simple_db.upcast();\n\n    let args = func\n        .attributes(db)\n        .find_attr(db, InternalCollector::ATTR_NAME)\n        .unwrap()\n        .arguments(db);\n\n    (simple_db, args)\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/src/types.rs",
    "content": "use crate::utils::create_single_token;\nuse crate::{\n    attributes::{AttributeInfo, ErrorExt},\n    cairo_expression::CairoExpression,\n};\nuse cairo_lang_macro::{Diagnostic, TokenStream};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse cairo_lang_syntax::node::{Terminal, ast::Expr};\nuse num_bigint::BigInt;\nuse url::Url;\n\npub trait ParseFromExpr<E>: Sized {\n    fn parse_from_expr<T: AttributeInfo>(\n        db: &SimpleParserDatabase,\n        expr: &E,\n        arg_name: &str,\n    ) -> Result<Self, Diagnostic>;\n}\n\n#[derive(Debug, Clone)]\npub enum Felt {\n    Number(Number),\n    ShortString(ShortString),\n}\n\nimpl CairoExpression for Felt {\n    fn as_cairo_expression(&self) -> TokenStream {\n        match self {\n            Self::Number(number) => number.as_cairo_expression(),\n            Self::ShortString(string) => string.as_cairo_expression(),\n        }\n    }\n}\n\nimpl ParseFromExpr<Expr> for Felt {\n    fn parse_from_expr<T: AttributeInfo>(\n        db: &SimpleParserDatabase,\n        expr: &Expr,\n        arg_name: &str,\n    ) -> Result<Self, Diagnostic> {\n        match expr {\n            Expr::ShortString(string) => {\n                let string = string.text(db).trim_matches('\\'').to_string();\n                Ok(Self::ShortString(ShortString(string)))\n            }\n            Expr::Literal(string) => {\n                let num = string.numeric_value(db).unwrap();\n\n                Ok(Self::Number(Number(num)))\n            }\n            _ => Err(T::error(format!(\"<{arg_name}> argument must be felt\")))?,\n        }\n    }\n}\n\n#[derive(Debug, Clone, PartialEq, PartialOrd)]\npub struct Number(pub(crate) BigInt);\n\nimpl Number {\n    pub fn validate_in_gas_range<T: AttributeInfo>(\n        &self,\n        arg_name: &str,\n    ) -> Result<(), Diagnostic> {\n        let max = u64::MAX;\n        if *self > Number(max.into()) {\n            return Err(T::error(format!(\n                \"{arg_name} it too large (max permissible value is {max})\"\n            )));\n        }\n        Ok(())\n    }\n}\n\n#[derive(Debug, Clone)]\npub struct ShortString(pub(crate) String);\n\nimpl CairoExpression for Number {\n    fn as_cairo_expression(&self) -> TokenStream {\n        TokenStream::new(vec![create_single_token(format!(\n            \"0x{}\",\n            self.0.to_str_radix(16)\n        ))])\n    }\n}\n\nimpl CairoExpression for ShortString {\n    fn as_cairo_expression(&self) -> TokenStream {\n        TokenStream::new(vec![create_single_token(format!(\"'{}'\", self.0))])\n    }\n}\n\nimpl ParseFromExpr<Expr> for Number {\n    fn parse_from_expr<T: AttributeInfo>(\n        db: &SimpleParserDatabase,\n        expr: &Expr,\n        arg_name: &str,\n    ) -> Result<Self, Diagnostic> {\n        match expr {\n            Expr::Literal(literal) => {\n                let num = literal\n                    .numeric_value(db)\n                    .ok_or_else(|| T::error(format!(\"<{arg_name}> got invalid number literal\")))?;\n\n                Ok(Self(num))\n            }\n            _ => Err(T::error(format!(\"<{arg_name}> should be number literal\"))),\n        }\n    }\n}\n\nimpl ParseFromExpr<Expr> for Url {\n    fn parse_from_expr<T: AttributeInfo>(\n        db: &SimpleParserDatabase,\n        expr: &Expr,\n        arg_name: &str,\n    ) -> Result<Self, Diagnostic> {\n        let url = String::parse_from_expr::<T>(db, expr, arg_name)?;\n\n        Url::parse(&url).map_err(|_| T::error(format!(\"<{arg_name}> is not a valid url\")))\n    }\n}\n\nimpl ParseFromExpr<Expr> for String {\n    fn parse_from_expr<T: AttributeInfo>(\n        db: &SimpleParserDatabase,\n        expr: &Expr,\n        arg_name: &str,\n    ) -> Result<Self, Diagnostic> {\n        match expr {\n            Expr::String(string) => Ok(string.text(db).trim_matches('\"').to_string()),\n            _ => Err(T::error(format!(\n                \"<{arg_name}> invalid type, should be: double quoted string\"\n            ))),\n        }\n    }\n}\n\nimpl ParseFromExpr<Expr> for ShortString {\n    fn parse_from_expr<T: AttributeInfo>(\n        db: &SimpleParserDatabase,\n        expr: &Expr,\n        arg_name: &str,\n    ) -> Result<Self, Diagnostic> {\n        match expr {\n            Expr::ShortString(string) => {\n                let string = string.text(db).trim_matches('\\'').to_string();\n                Ok(ShortString(string))\n            }\n            _ => Err(T::error(format!(\n                \"<{arg_name}> invalid type, should be: double quoted string\"\n            ))),\n        }\n    }\n}\n\nimpl CairoExpression for String {\n    fn as_cairo_expression(&self) -> TokenStream {\n        TokenStream::new(vec![create_single_token(format!(r#\"\"{self}\"\"#))])\n    }\n}\n\nimpl CairoExpression for Url {\n    fn as_cairo_expression(&self) -> TokenStream {\n        TokenStream::new(vec![create_single_token(format!(r#\"\"{self}\"\"#))])\n    }\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/src/utils.rs",
    "content": "use cairo_lang_macro::{Diagnostic, Severity, TextSpan, Token, TokenStream, TokenTree, quote};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse cairo_lang_syntax::node::TypedSyntaxNode;\nuse cairo_lang_syntax::node::ast::{Condition, Expr, FunctionWithBody, Statement};\nuse cairo_lang_syntax::node::helpers::GetIdentifier;\nuse cairo_lang_syntax::node::with_db::SyntaxNodeWithDb;\nuse indoc::formatdoc;\n\npub fn higher_severity(a: Severity, b: Severity) -> Severity {\n    match (a, b) {\n        (Severity::Warning, Severity::Warning) => Severity::Warning,\n        _ => Severity::Error,\n    }\n}\npub fn format_error_message(variants: &[Diagnostic]) -> String {\n    let formatted_variants: Vec<String> = variants\n        .iter()\n        .map(|variant| format!(\"- variant: {}\", variant.message()))\n        .collect();\n\n    formatdoc! {\"\n        All options failed\n        {}\n        Resolve at least one of them\n    \", formatted_variants.join(\"\\n\")}\n}\n\n/// The `branch` macro is used to evaluate multiple expressions and return the first successful result.\n/// If all expressions fail, it collects the error messages and returns a combined error.\n///\n/// This macro is used instead of a function because it can perform lazy evaluation and has better readability.\n#[macro_export]\nmacro_rules! branch {\n    ($($result:expr_2021),+) => {{\n        let mut messages = Vec::new();\n        let mut result = None;\n\n        $(\n            if result.is_none() {\n                match $result {\n                    Ok(val) => {\n                        result = Some(val);\n                    },\n                    Err(err) => {\n                        messages.push(err);\n                    },\n                }\n            }\n        )+\n\n        if let Some(result) = result {\n            Ok(result)\n        } else {\n            let severity = messages.clone().into_iter().fold(Severity::Warning, |acc, diagnostic| $crate::utils::higher_severity(acc, diagnostic.severity()));\n            let message = $crate::utils::format_error_message(&messages);\n            Err(Diagnostic::new(severity, message))\n        }\n    }};\n}\n\npub fn create_single_token(content: impl AsRef<str>) -> TokenTree {\n    TokenTree::Ident(Token::new(content, TextSpan::call_site()))\n}\n\npub trait SyntaxNodeUtils {\n    fn to_token_stream(&self, db: &SimpleParserDatabase) -> TokenStream;\n}\n\nimpl<T: TypedSyntaxNode> SyntaxNodeUtils for T {\n    fn to_token_stream(&self, db: &SimpleParserDatabase) -> TokenStream {\n        let syntax = self.as_syntax_node();\n        let syntax = SyntaxNodeWithDb::new(&syntax, db);\n        quote!(#syntax)\n    }\n}\n\n// Gets test statements and content of `if` statement that checks if function is run in config mode\npub fn get_statements(\n    db: &SimpleParserDatabase,\n    func: &FunctionWithBody,\n) -> (TokenStream, TokenStream) {\n    let statements = func\n        .body(db)\n        .statements(db)\n        .elements(db)\n        .collect::<Vec<_>>();\n\n    let if_content = statements.first().and_then(|stmt| {\n        // first statement is `if`\n        let Statement::Expr(expr) = stmt else {\n            return None;\n        };\n        let Expr::If(if_expr) = expr.expr(db) else {\n            return None;\n        };\n        // its condition is function call\n        let Some(Condition::Expr(expr)) = if_expr.conditions(db).elements(db).next() else {\n            return None;\n        };\n        let Expr::FunctionCall(expr) = expr.expr(db) else {\n            return None;\n        };\n\n        // this function is named \"snforge_std::_internals::is_config_run\"\n        let segments: Vec<_> = expr.path(db).segments(db).elements(db).collect();\n\n        let [snforge_std, cheatcode, is_config_run] = segments.as_slice() else {\n            return None;\n        };\n\n        if snforge_std.identifier(db) != \"snforge_std\"\n            || cheatcode.identifier(db) != \"_internals\"\n            || is_config_run.identifier(db) != \"is_config_run\"\n        {\n            return None;\n        }\n\n        let statements: Vec<_> = if_expr.if_block(db).statements(db).elements(db).collect();\n\n        // omit last one (`return;`) as it have to be inserted after all new statements\n        Some(\n            statements[..statements.len() - 1]\n                .iter()\n                .map(|stmt| stmt.to_token_stream(db))\n                .fold(TokenStream::empty(), |mut acc, token| {\n                    acc.extend(token);\n                    acc\n                }),\n        )\n    });\n\n    // there was already config check, omit it and collect remaining statements\n    let statements = if if_content.is_some() {\n        &statements[1..]\n    } else {\n        &statements[..]\n    }\n    .iter()\n    .map(|stmt| stmt.to_token_stream(db))\n    .fold(TokenStream::empty(), |mut acc, token| {\n        acc.extend(token);\n        acc\n    });\n\n    (statements, if_content.unwrap_or_else(TokenStream::empty))\n}\n\n#[macro_export]\nmacro_rules! format_ident {\n    ($name:literal $(,$formats:expr_2021),*) => {\n        {\n            use cairo_lang_macro::{TextSpan, Token, TokenTree};\n\n            let content = format!($name,$($formats),*);\n            TokenTree::Ident(Token::new(content, TextSpan::call_site()))\n        }\n    };\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/tests/integration/main.rs",
    "content": "mod multiple_attributes;\nmod single_attributes;\nmod utils;\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/tests/integration/multiple_attributes.rs",
    "content": "use crate::utils::{assert_diagnostics, assert_output, empty_function};\nuse cairo_lang_macro::{TokenStream, TokenTree, quote};\nuse cairo_lang_parser::utils::SimpleParserDatabase;\nuse cairo_lang_syntax::node::ast::{ModuleItem, SyntaxFile};\nuse cairo_lang_syntax::node::with_db::SyntaxNodeWithDb;\nuse cairo_lang_syntax::node::{Terminal, TypedSyntaxNode};\nuse snforge_scarb_plugin::attributes::fuzzer::wrapper::fuzzer_wrapper;\nuse snforge_scarb_plugin::attributes::fuzzer::{fuzzer, fuzzer_config};\nuse snforge_scarb_plugin::attributes::{available_gas::available_gas, fork::fork, test::test};\nuse snforge_scarb_plugin::create_single_token;\n\nfn get_function(token_stream: &TokenStream, function_name: &str, skip_args: bool) -> TokenStream {\n    let db = SimpleParserDatabase::default();\n    let (parsed_node, _diagnostics) = db.parse_token_stream(token_stream);\n    let syntax_file = SyntaxFile::from_syntax_node(&db, parsed_node);\n    let function = syntax_file\n        .items(&db)\n        .elements(&db)\n        .find_map(|e| {\n            if let ModuleItem::FreeFunction(free_function) = e {\n                if free_function.declaration(&db).name(&db).text(&db) == function_name {\n                    Some(free_function.clone())\n                } else {\n                    None\n                }\n            } else {\n                None\n            }\n        })\n        .unwrap();\n\n    let vis = function.visibility(&db).as_syntax_node();\n    let vis = SyntaxNodeWithDb::new(&vis, &db);\n\n    let signature = function.declaration(&db).as_syntax_node();\n    let signature = SyntaxNodeWithDb::new(&signature, &db);\n\n    let body = function.body(&db).as_syntax_node();\n    let body = SyntaxNodeWithDb::new(&body, &db);\n\n    let attrs = function.attributes(&db).as_syntax_node();\n    let attrs = SyntaxNodeWithDb::new(&attrs, &db);\n\n    let mut token_stream = if skip_args {\n        quote! {\n            #vis #signature\n            #body\n        }\n    } else {\n        quote! {\n            #attrs\n            #vis #signature\n            #body\n        }\n    };\n\n    match &mut token_stream.tokens[0] {\n        TokenTree::Ident(ident) => {\n            ident.span.start = 0;\n        }\n    }\n\n    token_stream\n}\n\n#[test]\nfn works_with_few_attributes() {\n    let args = TokenStream::empty();\n\n    let result = test(args, empty_function());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            #[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)]\n            #[snforge_internal_test_executable]\n            fn empty_fn__snforge_internal_test_generated(mut _data: Span<felt252>) -> Span::<felt252> {\n                core::internal::require_implicit::<System>();\n                core::internal::revoke_ap_tracking();\n                core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas');\n\n                core::option::OptionTraitImpl::expect(\n                    core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas',\n                );\n                empty_fn();\n\n                let mut arr = ArrayTrait::new();\n                core::array::ArrayTrait::span(@arr)\n            }\n\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n                    return;\n                }\n            }\n        \",\n    );\n\n    let item = get_function(&result.token_stream, \"empty_fn\", false);\n    let args = quote!((l1_gas: 1, l1_data_gas: 2, l2_gas: 3));\n\n    let result = available_gas(args, item);\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::AvailableResourceBoundsConfig {\n                        l1_gas: 0x1,\n                        l1_data_gas: 0x2,\n                        l2_gas: 0x3\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_available_gas'>(data.span());\n\n                    return;\n                }\n            }\n        \",\n    );\n\n    let item = result.token_stream;\n    let args = quote!((\"test\"));\n\n    let result = fork(args, item);\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        r#\"\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::AvailableResourceBoundsConfig {\n                        l1_gas: 0x1,\n                        l1_data_gas: 0x2,\n                        l2_gas: 0x3\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_available_gas'>(data.span());\n\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::ForkConfig::Named(\"test\")\n                        .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_fork'>(data.span());\n\n                    return;\n                }\n            }\n        \"#,\n    );\n}\n\n#[test]\nfn works_with_fuzzer() {\n    let args = TokenStream::empty();\n\n    let result = test(args, empty_function());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            #[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)]\n            #[snforge_internal_test_executable]\n            fn empty_fn__snforge_internal_test_generated(mut _data: Span<felt252>) -> Span::<felt252> {\n                core::internal::require_implicit::<System>();\n                core::internal::revoke_ap_tracking();\n                core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas');\n\n                core::option::OptionTraitImpl::expect(\n                    core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas',\n                );\n                empty_fn();\n\n                let mut arr = ArrayTrait::new();\n                core::array::ArrayTrait::span(@arr)\n            }\n\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n                    return;\n                }\n            }\n        \",\n    );\n\n    let item = get_function(&result.token_stream, \"empty_fn\", false);\n    let args = quote!((runs: 123, seed: 321));\n\n    let result = fuzzer(args, item);\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        r\"\n            #[__fuzzer_config(runs: 123, seed: 321)]\n            #[__fuzzer_wrapper]\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n                    return;\n                }\n            }\n        \",\n    );\n}\n\n#[test]\nfn works_with_fuzzer_before_test() {\n    let item = quote!(\n        fn empty_fn(f: felt252) {}\n    );\n    let fuzzer_args = quote!((runs: 123, seed: 321));\n    let fuzzer_res = fuzzer(fuzzer_args, item);\n    assert_diagnostics(&fuzzer_res, &[]);\n\n    assert_output(\n        &fuzzer_res,\n        r\"\n            #[__fuzzer_config(runs: 123, seed: 321)]\n            #[__fuzzer_wrapper]\n            fn empty_fn(f: felt252) {}\n        \",\n    );\n\n    let test_args = TokenStream::empty();\n    let item = get_function(&fuzzer_res.token_stream, \"empty_fn\", false);\n    let result = test(test_args, item);\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        r\"\n            #[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)]\n            #[snforge_internal_test_executable]\n            fn empty_fn__snforge_internal_test_generated(mut _data: Span<felt252>) -> Span::<felt252> {\n                core::internal::require_implicit::<System>();\n                core::internal::revoke_ap_tracking();\n                core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas');\n\n                core::option::OptionTraitImpl::expect(\n                    core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas',\n                );\n                empty_fn__snforge_internal_fuzzer_generated();\n\n                let mut arr = ArrayTrait::new();\n                core::array::ArrayTrait::span(@arr)\n            }\n\n            #[__fuzzer_config(runs: 123, seed: 321)]\n            #[__fuzzer_wrapper]\n            fn empty_fn(f: felt252) {\n                if snforge_std::_internals::is_config_run() {\n                    return;\n                }\n            }\n        \",\n    );\n\n    // We need to remove `#[__fuzzer_wrapper]` to be able to call `fuzzer_wrapper()` again\n    let item = get_function(&result.token_stream, \"empty_fn\", true);\n    let item = quote!(\n        #[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)]\n        #[snforge_internal_test_executable]\n        #item\n\n        #[__fuzzer_config(runs: 123, seed: 321)]\n        #[__internal_config_statement]\n        fn empty_fn() {}\n    );\n    let result = fuzzer_wrapper(TokenStream::empty(), item);\n\n    assert_diagnostics(&result, &[]);\n    assert_output(\n        &result,\n        r\"\n            fn empty_fn__snforge_internal_fuzzer_generated() {\n                if snforge_std::_internals::is_config_run() {\n                empty_fn(snforge_std::fuzzable::Fuzzable::blank());\n                return;\n                }\n                \n                let f = snforge_std::fuzzable::Fuzzable::<felt252>::generate();\n                snforge_std::_internals::save_fuzzer_arg(@f);\n                empty_fn(f);\n            }\n\n            #[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)]\n            #[snforge_internal_test_executable]\n            #[__internal_config_statement]\n            fn empty_fn(f: felt252) {}\n        \",\n    );\n}\n\n#[test]\n#[expect(clippy::too_many_lines)]\nfn works_with_fuzzer_config_wrapper() {\n    let item = quote!(\n        fn empty_fn(f: felt252) {}\n    );\n    let args = quote!((l2_gas: 999));\n\n    let result = available_gas(args, item);\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            fn empty_fn(f: felt252) {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::AvailableResourceBoundsConfig {\n                        l1_gas: 0xffffffffffffffff,\n                        l1_data_gas: 0xffffffffffffffff,\n                        l2_gas: 0x3e7\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_available_gas'>(data.span());\n\n                    return;\n                }\n            }\n        \",\n    );\n\n    // Append `#[fuzzer]` so we can use `test()`\n    let mut item = TokenStream::new(vec![create_single_token(\"#[fuzzer]\")]);\n    item.extend(result.token_stream);\n\n    let result = test(TokenStream::empty(), item);\n    assert_diagnostics(&result, &[]);\n    assert_output(\n        &result,\n        r\"\n            #[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)]\n            #[snforge_internal_test_executable]\n            fn empty_fn__snforge_internal_test_generated(mut _data: Span<felt252>) -> Span::<felt252> {\n                core::internal::require_implicit::<System>();\n                core::internal::revoke_ap_tracking();\n                core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas');\n\n                core::option::OptionTraitImpl::expect(\n                    core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas',\n                );\n                empty_fn__snforge_internal_fuzzer_generated();\n\n                let mut arr = ArrayTrait::new();\n                core::array::ArrayTrait::span(@arr)\n            }\n\n            #[fuzzer]\n            fn empty_fn(f: felt252) {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::AvailableResourceBoundsConfig {\n                        l1_gas: 0xffffffffffffffff,\n                        l1_data_gas: 0xffffffffffffffff,\n                        l2_gas: 0x3e7\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_available_gas'>(data.span());\n\n                    return;\n                }\n            }\n    \",\n    );\n\n    // Skip all the lines including `#[fuzzer]` that was appended previously\n    let item = get_function(&result.token_stream, \"empty_fn\", true);\n    let internal_config_statement =\n        TokenStream::new(vec![create_single_token(\"__internal_config_statement\")]);\n    let item = quote! {\n        #[#internal_config_statement]\n        #item\n    };\n    let args = quote!((runs: 123, seed: 321));\n\n    let result = fuzzer_config(args, item);\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        r\"\n            #[__internal_config_statement]\n            fn empty_fn(f: felt252) {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::AvailableResourceBoundsConfig {\n                        l1_gas: 0xffffffffffffffff,\n                        l1_data_gas: 0xffffffffffffffff,\n                        l2_gas: 0x3e7\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_available_gas'>(data.span());\n\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::FuzzerConfig {\n                        seed: Option::Some(0x141),\n                        runs: Option::Some(0x7b)\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_fuzzer'>(data.span());\n\n                    return;\n                }\n            }\n        \",\n    );\n\n    let item = result.token_stream;\n    let args = TokenStream::empty();\n\n    let result = fuzzer_wrapper(args, item);\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        r\"\n            #[__internal_config_statement]\n            fn empty_fn__snforge_internal_fuzzer_generated() {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::AvailableResourceBoundsConfig {\n                        l1_gas: 0xffffffffffffffff,\n                        l1_data_gas: 0xffffffffffffffff,\n                        l2_gas: 0x3e7\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_available_gas'>(data.span());\n\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::FuzzerConfig {\n                        seed: Option::Some(0x141),\n                        runs: Option::Some(0x7b)\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_fuzzer'>(data.span());\n\n                    empty_fn(snforge_std::fuzzable::Fuzzable::blank());\n\n                    return;\n                }\n                let f = snforge_std::fuzzable::Fuzzable::<felt252>::generate();\n                snforge_std::_internals::save_fuzzer_arg(@f);\n                empty_fn(f);\n            }\n            #[__internal_config_statement]\n            fn empty_fn(f: felt252) {\n            }\n        \",\n    );\n}\n\nuse snforge_scarb_plugin::attributes::test_case::test_case;\n\n#[test]\n#[expect(clippy::too_many_lines)]\nfn works_with_test_fuzzer_and_test_case() {\n    // Ad 1. We must add `#[test_case]` first so `#[test]` will not throw\n    // diagnostic error \"function with parameters must have #[fuzzer] or #[test_case] attribute\".\n    // It will be later removed (Ad 2.).\n    let item = quote!(\n        #[test_case(name: \"one_and_two\", 1, 2, 3)]\n        fn test_add(x: i128, y: i128, expected: i128) {}\n    );\n\n    let result = test(TokenStream::empty(), item.clone());\n    assert_diagnostics(&result, &[]);\n    assert_output(\n        &result,\n        r#\"\n            #[test_case(name: \"one_and_two\", 1, 2, 3)]\n            fn test_add(x: i128, y: i128, expected: i128) {}\n        \"#,\n    );\n\n    let item = get_function(&result.token_stream, \"test_add\", false);\n    let result = fuzzer(TokenStream::empty(), item);\n    assert_diagnostics(&result, &[]);\n    assert_output(\n        &result,\n        r#\"\n            #[__fuzzer_config]\n            #[__fuzzer_wrapper]\n            #[test_case(name: \"one_and_two\", 1, 2, 3)]\n            fn test_add(x: i128, y: i128, expected: i128) {}\n        \"#,\n    );\n\n    // Ad 2. Now, we need to remove `#[test_case]` before calling `test_case()`.\n    let item = get_function(&result.token_stream, \"test_add\", true);\n    let item = quote! {\n        #[__fuzzer_config]\n        #[__fuzzer_wrapper]\n        #item\n    };\n\n    let args = quote!((name: \"one_and_two\", 1, 2, 3));\n    let result = test_case(args, item);\n    assert_diagnostics(&result, &[]);\n    assert_output(\n        &result,\n        \"\n            #[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)]\n            #[snforge_internal_test_executable]\n            fn test_add_one_and_two(mut _data: Span<felt252>) -> Span::<felt252> {\n                core::internal::require_implicit::<System>();\n                core::internal::revoke_ap_tracking();\n                core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas');\n                core::option::OptionTraitImpl::expect(\n                    core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas',\n                );\n                test_add(1, 2, 3);\n                let mut arr = ArrayTrait::new();\n                core::array::ArrayTrait::span(@arr)\n            }\n\n            #[__fuzzer_config]\n            #[__fuzzer_wrapper]\n            #[__internal_config_statement]\n            fn test_add(x: i128, y: i128, expected: i128) {}\n        \",\n    );\n\n    let item = get_function(&result.token_stream, \"test_add\", true);\n    let item = quote!(\n        #[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)]\n        #[snforge_internal_test_executable]\n        fn test_add_one_and_two(mut _data: Span<felt252>) -> Span::<felt252> {\n            core::internal::require_implicit::<System>();\n            core::internal::revoke_ap_tracking();\n            core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), \"Out of gas\");\n            core::option::OptionTraitImpl::expect(\n                core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), \"Out of gas\",\n            );\n            test_add(1, 2, 3);\n            let mut arr = ArrayTrait::new();\n            core::array::ArrayTrait::span(@arr)\n        }\n\n        #[__fuzzer_wrapper]\n        #item\n    );\n    let result = fuzzer_config(TokenStream::empty(), item);\n\n    assert_diagnostics(&result, &[]);\n    assert_output(\n        &result,\n        \"\n        #[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)]\n        #[snforge_internal_test_executable]\n        fn test_add_one_and_two(mut _data: Span<felt252>) -> Span<felt252> {\n            if snforge_std::_internals::is_config_run() {\n                let mut data = array![];\n                snforge_std::_internals::config_types::FuzzerConfig {\n                    seed: Option::None, runs: Option::None,\n                }\n                .serialize(ref data);\n                starknet::testing::cheatcode::<'set_config_fuzzer'>(data.span());\n                return;\n            }\n            \n            core::internal::require_implicit::<System>();\n            core::internal::revoke_ap_tracking();\n            core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), \\\"Out of gas\\\");\n            core::option::OptionTraitImpl::expect(\n                core::gas::withdraw_gas_all(core::gas::get_builtin_costs()),\\\"Out of gas\\\",\n            );\n\n            test_add(1, 2, 3);\n            let mut arr = ArrayTrait::new();\n            core::array::ArrayTrait::span(@arr)\n        }\n    \");\n\n    let item = get_function(&result.token_stream, \"test_add_one_and_two\", false);\n    let result = fuzzer_wrapper(TokenStream::empty(), item);\n\n    assert_diagnostics(&result, &[]);\n    assert_output(\n        &result,\n        \"\n    fn test_add_one_and_two__snforge_internal_fuzzer_generated() {\n        if snforge_std::_internals::is_config_run() {\n            let mut data = array![];\n            snforge_std::_internals::config_types::FuzzerConfig {\n                seed: Option::None,\n                runs: Option::None,\n            }\n                .serialize(ref data);\n            starknet::testing::cheatcode::<'set_config_fuzzer'>(data.span());\n            test_add_one_and_two(snforge_std::fuzzable::Fuzzable::blank());\n            return;\n        }\n\n        let _data = snforge_std::fuzzable::Fuzzable::<Span<felt252>>::generate();\n        snforge_std::_internals::save_fuzzer_arg(@_data);\n        test_add_one_and_two(_data);\n    }\n\n    #[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)]\n    #[snforge_internal_test_executable]\n    #[__internal_config_statement]\n    fn test_add_one_and_two(mut _data: Span<felt252>) -> Span::<felt252> {\n        core::internal::require_implicit::<System>();\n        core::internal::revoke_ap_tracking();\n        core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), \\\"Out of gas\\\");\n        core::option::OptionTraitImpl::expect(\n            core::gas::withdraw_gas_all(core::gas::get_builtin_costs()),\n            \\\"Out of gas\\\",\n        );\n\n        test_add(1, 2, 3);\n        let mut arr = ArrayTrait::new();\n        core::array::ArrayTrait::span(@arr)\n    }\n    \",\n    );\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/tests/integration/single_attributes/available_gas.rs",
    "content": "use crate::utils::{assert_diagnostics, assert_output, empty_function};\nuse cairo_lang_macro::{Diagnostic, quote};\nuse indoc::formatdoc;\nuse snforge_scarb_plugin::attributes::available_gas::available_gas;\n\n#[test]\nfn works_with_empty() {\n    let args = quote!(());\n\n    let result = available_gas(args, empty_function());\n\n    assert_output(\n        &result,\n        \"\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n                    \n                    snforge_std::_internals::config_types::AvailableResourceBoundsConfig {\n                        l1_gas: 0xffffffffffffffff,\n                        l1_data_gas: 0xffffffffffffffff,\n                        l2_gas: 0xffffffffffffffff\n                    }\n                    .serialize(ref data);\n                    starknet::testing::cheatcode::<'set_config_available_gas'>(data.span());\n                    return;\n                }\n            }\n        \",\n    );\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::warn(\n            \"#[available_gas] used with empty argument list. Either remove () or specify some arguments\",\n        )],\n    );\n}\n\n#[test]\nfn fails_with_non_number_literal() {\n    let args = quote!((l2_gas: \"123\"));\n\n    let result = available_gas(args, empty_function());\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(formatdoc!(\n            \"#[available_gas] <l2_gas> should be number literal\"\n        ))],\n    );\n}\n\n#[test]\nfn work_with_number_some_set() {\n    let args = quote!((l1_gas: 123));\n\n    let result = available_gas(args, empty_function());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::AvailableResourceBoundsConfig {\n                        l1_gas: 0x7b,\n                        l1_data_gas: 0xffffffffffffffff,\n                        l2_gas: 0xffffffffffffffff\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_available_gas'>(data.span());\n\n                    return;\n                }\n            }\n        \",\n    );\n}\n\n#[test]\nfn work_with_number_all_set() {\n    let args = quote!((l1_gas: 1, l1_data_gas: 2, l2_gas: 3));\n\n    let result = available_gas(args, empty_function());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::AvailableResourceBoundsConfig {\n                        l1_gas: 0x1,\n                        l1_data_gas: 0x2,\n                        l2_gas: 0x3\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_available_gas'>(data.span());\n\n                    return;\n                }\n            }\",\n    );\n}\n\n#[test]\nfn is_used_once() {\n    let args = quote!((l2_gas: 1, l2_gas: 3));\n\n    let result = available_gas(args, empty_function());\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(formatdoc!(\n            \"<l2_gas> argument was specified 2 times, expected to be used only once\"\n        ))],\n    );\n}\n\n#[test]\nfn does_not_work_with_unnamed_arg() {\n    let args = quote!((3));\n\n    let result = available_gas(args, empty_function());\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(formatdoc!(\n            \"#[available_gas] can be used with named arguments only\"\n        ))],\n    );\n}\n\n#[test]\nfn fails_with_unexpected_args() {\n    let args = quote!((sth: 1000));\n    let result = available_gas(args, empty_function());\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(formatdoc!(\n            \"#[available_gas] unexpected argument(s): <sth>\"\n        ))],\n    );\n}\n\n#[test]\nfn handles_number_overflow_l1() {\n    let args = quote!((l1_gas: 18446744073709551616));\n\n    let result = available_gas(args, empty_function());\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(formatdoc!(\n            \"#[available_gas] l1_gas it too large (max permissible value is 18446744073709551615)\"\n        ))],\n    );\n}\n\n#[test]\nfn handles_number_overflow_l1_data() {\n    let args = quote!((l1_data_gas: 18446744073709551616));\n\n    let result = available_gas(args, empty_function());\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(formatdoc!(\n            \"#[available_gas] l1_data_gas it too large (max permissible value is 18446744073709551615)\"\n        ))],\n    );\n}\n\n#[test]\nfn handles_number_overflow_l2() {\n    let args = quote!((l2_gas: 18446744073709551616));\n\n    let result = available_gas(args, empty_function());\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(formatdoc!(\n            \"#[available_gas] l2_gas it too large (max permissible value is 18446744073709551615)\"\n        ))],\n    );\n}\n\n#[test]\nfn max_permissible_value() {\n    let args = quote!((l2_gas: 18446744073709551615));\n\n    let result = available_gas(args, empty_function());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::AvailableResourceBoundsConfig {\n                        l1_gas: 0xffffffffffffffff,\n                        l1_data_gas: 0xffffffffffffffff,\n                        l2_gas: 0xffffffffffffffff\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_available_gas'>(data.span());\n\n                    return;\n                }\n            }\n        \",\n    );\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/tests/integration/single_attributes/disable_predeployed_contracts.rs",
    "content": "use crate::utils::{assert_diagnostics, assert_output, empty_function};\nuse cairo_lang_macro::{Diagnostic, TokenStream, quote};\nuse snforge_scarb_plugin::attributes::disable_predeployed_contracts::disable_predeployed_contracts;\n\n#[test]\nfn fails_with_args() {\n    let args = quote!((123));\n\n    let result = disable_predeployed_contracts(args, empty_function());\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(\n            \"#[disable_predeployed_contracts] does not accept any arguments\",\n        )],\n    );\n}\n\n#[test]\nfn works_without_args() {\n    let args = TokenStream::empty();\n\n    let result = disable_predeployed_contracts(args, empty_function());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::PredeployedContractsConfig {\n                        is_disabled: true\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_disable_contracts'>(data.span());\n\n                    return;\n                }\n            }\n        \",\n    );\n}\n\n#[test]\nfn is_used_once() {\n    let item = quote! {\n        #[disable_predeployed_contracts]\n        fn empty_fn() {}\n    };\n    let args = TokenStream::empty();\n\n    let result = disable_predeployed_contracts(args, item);\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(\n            \"#[disable_predeployed_contracts] can only be used once per item\",\n        )],\n    );\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/tests/integration/single_attributes/fork.rs",
    "content": "use crate::utils::{assert_diagnostics, assert_output, empty_function};\nuse cairo_lang_macro::{Diagnostic, quote};\nuse indoc::formatdoc;\nuse snforge_scarb_plugin::attributes::fork::fork;\n\n#[test]\nfn fails_without_block() {\n    let args = quote!((url: \"invalid url\"));\n\n    let result = fork(args, empty_function());\n\n    assert_diagnostics(\n        &result,\n        &[\n           Diagnostic::error(formatdoc!(\n                \"\n                    All options failed\n                    - variant: exactly one of <block_hash> | <block_number> | <block_tag> should be specified, got 0\n                    - variant: #[fork] expected arguments: 1, got: 0\n                    - variant: #[fork] can be used with unnamed arguments only\n                    Resolve at least one of them\n                \"\n            ))\n        ],\n    );\n}\n\n#[test]\nfn fails_without_url() {\n    let args = quote!((block_number: 23));\n\n    let result = fork(args, empty_function());\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(formatdoc!(\n            \"\n                All options failed\n                - variant: <url> argument is missing\n                - variant: #[fork] expected arguments: 1, got: 0\n                - variant: #[fork] can be used with unnamed arguments only\n                Resolve at least one of them\n            \"\n        ))],\n    );\n}\n\n#[test]\nfn fails_without_args() {\n    let args = quote!(());\n\n    let result = fork(args, empty_function());\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::warn(\"#[fork] used with empty argument list. Either remove () or specify some arguments\"),\n            Diagnostic::error(formatdoc!(\n            \"\n                All options failed\n                - variant: exactly one of <block_hash> | <block_number> | <block_tag> should be specified, got 0\n                - variant: #[fork] expected arguments: 1, got: 0\n                - variant: #[fork] expected arguments: 1, got: 0\n                Resolve at least one of them\n            \"\n        ))],\n    );\n}\n\n#[test]\nfn fails_with_invalid_url() {\n    let args = quote!((url: \"invalid url\", block_number: 23));\n\n    let result = fork(args, empty_function());\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(formatdoc!(\n            \"\n                All options failed\n                - variant: #[fork] <url> is not a valid url\n                - variant: #[fork] expected arguments: 1, got: 0\n                - variant: #[fork] can be used with unnamed arguments only\n                Resolve at least one of them\n            \"\n        ))],\n    );\n}\n\n#[test]\nfn accepts_string() {\n    let args = quote!((\"test\"));\n\n    let result = fork(args, empty_function());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        r#\"\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::ForkConfig::Named(\"test\")\n                        .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_fork'>(data.span());\n\n                    return;\n                }\n            }\n        \"#,\n    );\n}\n\n#[test]\nfn fails_with_unexpected_args() {\n    let args = quote!((url: \"http://example.com\", block_number: 23, tomato: 123, hello: \"world\"));\n\n    let result = fork(args, empty_function());\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(formatdoc!(\n            \"\n                All options failed\n                - variant: #[fork] unexpected argument(s): <hello>, <tomato>\n                - variant: #[fork] expected arguments: 1, got: 0\n                - variant: #[fork] can be used with unnamed arguments only\n                Resolve at least one of them\n            \"\n        ))],\n    );\n}\n\n#[test]\nfn accepts_inline_config() {\n    let args = quote!((url: \"http://example.com\", block_number: 23));\n\n    let result = fork(args, empty_function());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        r#\"\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::ForkConfig::Inline(\n                        snforge_std::_internals::config_types::InlineForkConfig {\n                            url: \"http://example.com/\",\n                            block: snforge_std::_internals::config_types::BlockId::BlockNumber(0x17)\n                        }\n                    )\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_fork'>(data.span());\n\n                    return;\n                }\n            }\n        \"#,\n    );\n}\n\n#[test]\nfn overriding_config_name_first() {\n    let args = quote!((\"MAINNET\", block_number: 23));\n\n    let result = fork(args, empty_function());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        r#\"\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::ForkConfig::Overridden(\n                        snforge_std::_internals::config_types::OverriddenForkConfig {\n                            block: snforge_std::_internals::config_types::BlockId::BlockNumber(0x17),\n                            name: \"MAINNET\"\n                        }\n                     )\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_fork'>(data.span());\n\n                    return;\n                }\n            }\n        \"#,\n    );\n}\n\n#[test]\nfn overriding_config_name_second() {\n    let args = quote!((block_number: 23, \"MAINNET\"));\n\n    let result = fork(args, empty_function());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        r#\"\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::ForkConfig::Overridden(\n                        snforge_std::_internals::config_types::OverriddenForkConfig {\n                            block: snforge_std::_internals::config_types::BlockId::BlockNumber(0x17),\n                            name: \"MAINNET\"\n                        }\n                    )\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_fork'>(data.span());\n\n                    return;\n                }\n            }\n        \"#,\n    );\n}\n\n#[test]\nfn is_used_once() {\n    let item = quote!(\n        #[fork]\n        fn empty_fn() {}\n    );\n    let args = quote!((\"name\"));\n\n    let result = fork(args, item);\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(\"#[fork] can only be used once per item\")],\n    );\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/tests/integration/single_attributes/fuzzer.rs",
    "content": "use crate::utils::{assert_diagnostics, assert_output, empty_function};\nuse cairo_lang_macro::{Diagnostic, TextSpan, Token, TokenStream, TokenTree, quote};\nuse snforge_scarb_plugin::attributes::fuzzer::wrapper::fuzzer_wrapper;\nuse snforge_scarb_plugin::attributes::fuzzer::{fuzzer, fuzzer_config};\n\n#[test]\nfn work_without_args() {\n    let args = TokenStream::empty();\n\n    let result = fuzzer(args, empty_function());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            #[__fuzzer_config]\n            #[__fuzzer_wrapper]\n            fn empty_fn() {}\n        \",\n    );\n}\n\n#[test]\nfn work_with_args() {\n    let args = quote!((runs: 655, seed: 32872357));\n\n    let result = fuzzer(args, empty_function());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            #[__fuzzer_config(runs: 655, seed: 32872357)]\n            #[__fuzzer_wrapper]\n            fn empty_fn() {}\n        \",\n    );\n}\n\n#[test]\nfn config_works_with_runs_only() {\n    let args = quote!((runs: 655));\n\n    let result = fuzzer_config(args, empty_function());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::FuzzerConfig {\n                        seed: Option::None,\n                        runs: Option::Some(0x28f)\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_fuzzer'>(data.span());\n\n                    return;\n                }\n            }\n        \",\n    );\n}\n\n#[test]\nfn config_works_with_seed_only() {\n    let args = quote!((seed: 655));\n\n    let result = fuzzer_config(args, empty_function());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::FuzzerConfig {\n                        seed: Option::Some(0x28f),\n                        runs: Option::None\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_fuzzer'>(data.span());\n\n                    return;\n                }\n            }\n        \",\n    );\n}\n\n#[test]\nfn config_works_with_both_args() {\n    let args = quote!((runs: 655, seed: 32872357));\n\n    let result = fuzzer_config(args, empty_function());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::FuzzerConfig {\n                        seed: Option::Some(0x1f597a5),\n                        runs: Option::Some(0x28f)\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_fuzzer'>(data.span());\n\n                    return;\n                }\n            }\n        \",\n    );\n}\n\n#[test]\nfn config_wrapper_work_without_args() {\n    let args = TokenStream::empty();\n\n    let result = fuzzer_config(args, empty_function());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::FuzzerConfig {\n                        seed: Option::None,\n                        runs: Option::None\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_fuzzer'>(data.span());\n\n                    return;\n                }\n            }\n        \",\n    );\n\n    let item = result.token_stream;\n    let args = TokenStream::empty();\n\n    let result = fuzzer_wrapper(args, item);\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            fn empty_fn__snforge_internal_fuzzer_generated() {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::FuzzerConfig {\n                        seed: Option::None,\n                        runs: Option::None\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_fuzzer'>(data.span());\n\n                    empty_fn();\n\n                    return;\n                }\n                empty_fn();\n            }\n\n            #[__internal_config_statement]\n            fn empty_fn() {\n            }\n        \",\n    );\n}\n\n#[test]\nfn config_wrapper_work_with_both_args() {\n    let args = quote!((runs: 655, seed: 32872357));\n\n    let result = fuzzer_config(args, empty_function());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::FuzzerConfig {\n                        seed: Option::Some(0x1f597a5),\n                        runs: Option::Some(0x28f)\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_fuzzer'>(data.span());\n\n                    return;\n                }\n            }\n        \",\n    );\n\n    let item = result.token_stream;\n    let args = TokenStream::empty();\n\n    let result = fuzzer_wrapper(args, item);\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            fn empty_fn__snforge_internal_fuzzer_generated() {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::FuzzerConfig {\n                        seed: Option::Some(0x1f597a5),\n                        runs: Option::Some(0x28f)\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_fuzzer'>(data.span());\n\n                    empty_fn();\n\n                    return;\n                }\n                empty_fn();\n            }\n\n            #[__internal_config_statement]\n            fn empty_fn() {\n            }\n        \",\n    );\n}\n\n#[test]\nfn config_wrapper_work_with_fn_with_single_param() {\n    let item = quote!(\n        fn empty_fn(f: felt252) {}\n    );\n    let args = TokenStream::empty();\n\n    let result = fuzzer_config(args, item);\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            fn empty_fn(f: felt252) {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::FuzzerConfig {\n                        seed: Option::None,\n                        runs: Option::None\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_fuzzer'>(data.span());\n\n                    return;\n                }\n            }\n        \",\n    );\n\n    let item = result.token_stream;\n    let args = TokenStream::empty();\n\n    let result = fuzzer_wrapper(args, item);\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            fn empty_fn__snforge_internal_fuzzer_generated() {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::FuzzerConfig {\n                        seed: Option::None,\n                        runs: Option::None\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_fuzzer'>(data.span());\n\n                    empty_fn(snforge_std::fuzzable::Fuzzable::blank());\n\n                    return;\n                }\n                let f = snforge_std::fuzzable::Fuzzable::<felt252>::generate();\n                snforge_std::_internals::save_fuzzer_arg(@f);\n                empty_fn(f);\n            }\n            #[__internal_config_statement]\n            fn empty_fn(f: felt252) {\n            }\n        \",\n    );\n}\n\n#[test]\nfn config_wrapper_work_with_fn_with_params() {\n    let item = quote!(\n        fn empty_fn(f: felt252, u: u32) {}\n    );\n    let args = TokenStream::empty();\n\n    let result = fuzzer_config(args, item);\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            fn empty_fn(f: felt252, u: u32) {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::FuzzerConfig {\n                        seed: Option::None,\n                        runs: Option::None\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_fuzzer'>(data.span());\n\n                    return;\n                }\n            }\n        \",\n    );\n\n    let item = result.token_stream;\n    let args = TokenStream::empty();\n\n    let result = fuzzer_wrapper(args, item);\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            fn empty_fn__snforge_internal_fuzzer_generated() {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::FuzzerConfig {\n                        seed: Option::None,\n                        runs: Option::None\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_fuzzer'>(data.span());\n\n                    empty_fn(snforge_std::fuzzable::Fuzzable::blank(), snforge_std::fuzzable::Fuzzable::blank());\n\n                    return;\n                }\n                let f = snforge_std::fuzzable::Fuzzable::<felt252>::generate();\n                snforge_std::_internals::save_fuzzer_arg(@f);\n                let u = snforge_std::fuzzable::Fuzzable::<u32>::generate();\n                snforge_std::_internals::save_fuzzer_arg(@u);\n                empty_fn(f, u);\n            }\n            #[__internal_config_statement]\n            fn empty_fn(f: felt252, u: u32) {\n            }\n        \",\n    );\n}\n\n#[test]\nfn wrapper_handle_attributes() {\n    let item = quote!(\n        #[available_gas(l2_gas: 40000)]\n        #[test]\n        fn empty_fn() {}\n    );\n    let args = TokenStream::empty();\n\n    let result = fuzzer_wrapper(args, item);\n\n    assert_output(\n        &result,\n        \"\n            #[test]\n            fn empty_fn__snforge_internal_fuzzer_generated() {\n                if snforge_std::_internals::is_config_run() {\n                    empty_fn();\n\n                    return;\n                }\n                empty_fn();\n            }\n\n            #[available_gas(l2_gas: 40000)]\n            #[__internal_config_statement]\n            fn empty_fn() {\n            }\n        \",\n    );\n}\n\n#[test]\nfn fail_with_invalid_args() {\n    let args = TokenStream::new(vec![TokenTree::Ident(Token::new(\n        \"(seed: '655')\",\n        TextSpan::call_site(),\n    ))]);\n\n    let result = fuzzer_config(args, empty_function());\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(\n            \"#[fuzzer] <seed> should be number literal\",\n        )],\n    );\n}\n\n#[test]\nfn fail_with_unnamed_arg() {\n    let args = quote!((123));\n\n    let result = fuzzer_config(args, empty_function());\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(\n            \"#[fuzzer] can be used with named arguments only\",\n        )],\n    );\n}\n\n#[test]\nfn is_used_once() {\n    let item = quote!(\n        #[fuzzer]\n        fn empty_fn() {}\n    );\n    let args = TokenStream::empty();\n\n    let result = fuzzer(args, item);\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(\n            \"#[fuzzer] can only be used once per item\",\n        )],\n    );\n}\n\n#[test]\nfn fails_with_unexpected_args() {\n    let args = quote!((runs: 100, tomato: 123));\n\n    let result = fuzzer_config(args, empty_function());\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(\n            \"#[fuzzer] unexpected argument(s): <tomato>\",\n        )],\n    );\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/tests/integration/single_attributes/ignore.rs",
    "content": "use crate::utils::{assert_diagnostics, assert_output, empty_function};\nuse cairo_lang_macro::{Diagnostic, TokenStream, quote};\nuse snforge_scarb_plugin::attributes::ignore::ignore;\n\n#[test]\nfn fails_with_args() {\n    let args = quote!((123));\n\n    let result = ignore(args, empty_function());\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(\"#[ignore] does not accept any arguments\")],\n    );\n}\n\n#[test]\nfn works_without_args() {\n    let args = TokenStream::empty();\n\n    let result = ignore(args, empty_function());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::IgnoreConfig {\n                        is_ignored: true\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_ignore'>(data.span());\n\n                    return;\n                }\n            }\n        \",\n    );\n}\n\n#[test]\nfn is_used_once() {\n    let item = quote!(\n        #[ignore]\n        fn empty_fn() {}\n    );\n    let args = TokenStream::empty();\n\n    let result = ignore(args, item);\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(\n            \"#[ignore] can only be used once per item\",\n        )],\n    );\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/tests/integration/single_attributes/internal_config_statement.rs",
    "content": "use crate::utils::{assert_diagnostics, assert_output, empty_function};\nuse cairo_lang_macro::{Diagnostic, TokenStream, quote};\nuse snforge_scarb_plugin::attributes::internal_config_statement::internal_config_statement;\n\n#[test]\nfn fails_with_non_empty_args() {\n    let args = quote!((123));\n\n    let result = internal_config_statement(args, empty_function());\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(\n            \"#[__internal_config_statement] does not accept any arguments\",\n        )],\n    );\n}\n#[test]\nfn appends_config_statement() {\n    let args = TokenStream::empty();\n\n    let result = internal_config_statement(args, empty_function());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n                    return;\n                }\n            }\n        \",\n    );\n}\n\n#[test]\nfn is_used_once() {\n    let item = quote!(\n        #[__internal_config_statement]\n        fn empty_fn() {}\n    );\n    let args = TokenStream::empty();\n\n    let result = internal_config_statement(args, item);\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(\n            \"#[__internal_config_statement] can only be used once per item\",\n        )],\n    );\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/tests/integration/single_attributes/should_panic.rs",
    "content": "use crate::utils::{assert_diagnostics, assert_output, empty_function};\nuse cairo_lang_macro::{Diagnostic, TextSpan, Token, TokenStream, TokenTree, quote};\nuse snforge_scarb_plugin::attributes::should_panic::should_panic;\n\n#[test]\nfn work_with_empty() {\n    let args = TokenStream::empty();\n\n    let result = should_panic(args, empty_function());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        r\"\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::ShouldPanicConfig {\n                        expected: snforge_std::_internals::config_types::Expected::Any\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_should_panic'>(data.span());\n                    return;\n                }\n            }\n        \",\n    );\n}\n\n#[test]\nfn work_with_expected_string() {\n    let args = quote!((expected: \"panic data\"));\n\n    let result = should_panic(args, empty_function());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        r#\"\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::ShouldPanicConfig {\n                        expected: snforge_std::_internals::config_types::Expected::ByteArray(\"panic data\")\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_should_panic'>(data.span());\n                    return;\n                }\n            }\n        \"#,\n    );\n}\n\n#[test]\nfn work_with_expected_string_escaped() {\n    let args = quote!((expected: \"can\\\"t \\0 null byte\"));\n\n    let result = should_panic(args, empty_function());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        r#\"\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::ShouldPanicConfig {\n                        expected: snforge_std::_internals::config_types::Expected::ByteArray(\"can\\\"t \\0 null byte\")\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_should_panic'>(data.span());\n                    return;\n                }\n            }\n        \"#,\n    );\n}\n\n#[test]\nfn work_with_expected_short_string() {\n    let args = TokenStream::new(vec![TokenTree::Ident(Token::new(\n        \"(expected: 'panic data')\",\n        TextSpan::call_site(),\n    ))]);\n\n    let result = should_panic(args, empty_function());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        r\"\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::ShouldPanicConfig {\n                        expected: snforge_std::_internals::config_types::Expected::ShortString('panic data')\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_should_panic'>(data.span());\n                    return;\n                }\n            }\n        \",\n    );\n}\n\n#[test]\nfn work_with_expected_short_string_escaped() {\n    let args = TokenStream::new(vec![TokenTree::Ident(Token::new(\n        r\"(expected: 'can\\'t')\",\n        TextSpan::call_site(),\n    ))]);\n\n    let result = should_panic(args, empty_function());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        r\"\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::ShouldPanicConfig {\n                        expected: snforge_std::_internals::config_types::Expected::ShortString('can\\'t')\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_should_panic'>(data.span());\n                    return;\n                }\n            }\n        \",\n    );\n}\n\n#[test]\nfn work_with_expected_tuple() {\n    let args = TokenStream::new(vec![TokenTree::Ident(Token::new(\n        r\"(expected: ('panic data', ' or not'))\",\n        TextSpan::call_site(),\n    ))]);\n\n    let result = should_panic(args, empty_function());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n                    let mut data = array![];\n\n                    snforge_std::_internals::config_types::ShouldPanicConfig {\n                        expected: snforge_std::_internals::config_types::Expected::Array(array!['panic data',' or not',])\n                    }\n                    .serialize(ref data);\n\n                    starknet::testing::cheatcode::<'set_config_should_panic'>(data.span());\n                    return;\n                }\n            }\n        \",\n    );\n}\n\n#[test]\nfn is_used_once() {\n    let item = quote!(\n        #[should_panic]\n        fn empty_fn() {}\n    );\n    let args = TokenStream::empty();\n\n    let result = should_panic(args, item);\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(\n            \"#[should_panic] can only be used once per item\",\n        )],\n    );\n}\n\n#[test]\nfn fails_with_unexpected_args() {\n    let args = quote!((expected: \"panic\", tomato: 123));\n\n    let result = should_panic(args, empty_function());\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(\n            \"#[should_panic] unexpected argument(s): <tomato>\",\n        )],\n    );\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/tests/integration/single_attributes/test.rs",
    "content": "use crate::utils::{assert_diagnostics, assert_output, empty_function};\nuse cairo_lang_macro::{Diagnostic, TokenStream, quote};\nuse snforge_scarb_plugin::attributes::test::test;\n\n#[test]\nfn appends_internal_config_and_executable() {\n    let args = TokenStream::empty();\n\n    let result = test(args, empty_function());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            #[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)]\n            #[snforge_internal_test_executable]\n            fn empty_fn__snforge_internal_test_generated(mut _data: Span<felt252>) -> Span::<felt252> {\n                core::internal::require_implicit::<System>();\n                core::internal::revoke_ap_tracking();\n                core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas');\n\n                core::option::OptionTraitImpl::expect(\n                    core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas',\n                );\n                empty_fn();\n\n                let mut arr = ArrayTrait::new();\n                core::array::ArrayTrait::span(@arr)\n            }\n\n            fn empty_fn() {\n                if snforge_std::_internals::is_config_run() {\n                    return;\n                }\n            }\n        \",\n    );\n}\n\n#[test]\nfn fails_with_non_empty_args() {\n    let args = quote!((123));\n\n    let result = test(args, empty_function());\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(\"#[test] does not accept any arguments\")],\n    );\n}\n\n#[test]\nfn is_used_once() {\n    let item = quote!(\n        #[test]\n        fn empty_fn() {}\n    );\n    let args = TokenStream::empty();\n\n    let result = test(args, item);\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(\"#[test] can only be used once per item\")],\n    );\n}\n\n#[test]\nfn fails_with_params() {\n    let item = quote!(\n        fn empty_fn(f: felt252) {}\n    );\n    let args = TokenStream::empty();\n\n    let result = test(args, item);\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(\n            \"#[test] function with parameters must have #[fuzzer] or #[test_case] attribute\",\n        )],\n    );\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/tests/integration/single_attributes/test_case.rs",
    "content": "use crate::utils::{assert_diagnostics, assert_output, empty_function};\nuse cairo_lang_macro::{Diagnostic, TokenStream, quote};\nuse snforge_scarb_plugin::attributes::test_case::test_case;\n\npub fn function_with_params() -> TokenStream {\n    quote!(\n        fn test_add(x: i128, y: i128, expected: i128) {}\n    )\n}\n\n#[test]\nfn works_with_args() {\n    let args = quote!((1, 2, 3));\n\n    let result = test_case(args, function_with_params());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            #[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)]\n            #[snforge_internal_test_executable]\n            fn test_add_1_2_3(mut _data: Span<felt252>) -> Span<felt252> {\n                core::internal::require_implicit::<System>();\n                core::internal::revoke_ap_tracking();\n                core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas');\n                core::option::OptionTraitImpl::expect(\n                    core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas',\n                );\n                test_add(1, 2, 3);\n                let mut arr = ArrayTrait::new();\n                core::array::ArrayTrait::span(@arr)\n            }\n            #[__internal_config_statement]\n            fn test_add(x: i128, y: i128, expected: i128) {}\n        \",\n    );\n}\n\n#[test]\nfn works_with_name_and_args() {\n    let args = quote!((name: \"one_and_two\", 1, 2, 3));\n\n    let result = test_case(args, function_with_params());\n\n    assert_diagnostics(&result, &[]);\n\n    assert_output(\n        &result,\n        \"\n            #[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)]\n            #[snforge_internal_test_executable]\n            fn test_add_one_and_two(mut _data: Span<felt252>) -> Span<felt252> {\n                core::internal::require_implicit::<System>();\n                core::internal::revoke_ap_tracking();\n                core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas');\n                core::option::OptionTraitImpl::expect(\n                    core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas',\n                );\n                test_add(1, 2, 3);\n                let mut arr = ArrayTrait::new();\n                core::array::ArrayTrait::span(@arr)\n            }\n            #[__internal_config_statement]\n            fn test_add(x: i128, y: i128, expected: i128) {}\n        \",\n    );\n}\n\n#[test]\nfn invalid_args_number() {\n    let args = quote!((1, 2));\n\n    let result = test_case(args, function_with_params());\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(\n            \"#[test_case] Expected 3 arguments, but got 2\",\n        )],\n    );\n}\n\n#[test]\nfn name_passed_multiple_times() {\n    let args = quote!((name: \"a\", name: \"b\", 1, 2, 3));\n\n    let result = test_case(args, function_with_params());\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(\n            \"<name> argument was specified 2 times, expected to be used only once\",\n        )],\n    );\n}\n\n#[test]\nfn function_without_params() {\n    let args = quote!((1, 2, 3));\n\n    let result = test_case(args, empty_function());\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(\n            \"#[test_case] The function must have at least one parameter to use #[test_case] attribute\",\n        )],\n    );\n}\n\n#[test]\nfn fails_with_unexpected_named_args() {\n    let args = quote!((name: \"test\", tomato: 123, 1, 2, 3));\n\n    let result = test_case(args, function_with_params());\n\n    assert_diagnostics(\n        &result,\n        &[Diagnostic::error(\n            \"#[test_case] unexpected argument(s): <tomato>\",\n        )],\n    );\n}\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/tests/integration/single_attributes.rs",
    "content": "mod available_gas;\nmod disable_predeployed_contracts;\nmod fork;\nmod fuzzer;\nmod ignore;\nmod internal_config_statement;\nmod should_panic;\nmod test;\nmod test_case;\n"
  },
  {
    "path": "crates/snforge-scarb-plugin/tests/integration/utils.rs",
    "content": "use cairo_lang_formatter::{CairoFormatter, FormatterConfig};\nuse cairo_lang_macro::{Diagnostic, ProcMacroResult, TokenStream, quote};\nuse std::collections::HashSet;\n\npub fn empty_function() -> TokenStream {\n    quote!(\n        fn empty_fn() {}\n    )\n}\n\npub fn assert_diagnostics(result: &ProcMacroResult, expected: &[Diagnostic]) {\n    let diagnostics: HashSet<_> = result.diagnostics.iter().collect();\n    let expected: HashSet<_> = expected.iter().collect();\n\n    let remaining_diagnostics: Vec<_> = diagnostics\n        .difference(&expected)\n        .map(|diff| {\n            format!(\n                \"Diagnostic where emitted and unexpected:\\n {:?} => \\\"{}\\\"\\n\",\n                diff.severity(),\n                diff.message(),\n            )\n        })\n        .collect();\n\n    let not_emitted_diagnostics: Vec<_> = expected\n        .difference(&diagnostics)\n        .map(|diff| {\n            format!(\n                \"Diagnostic where expected but not emitted:\\n {:?} => \\\"{}\\\"\\n\",\n                diff.severity(),\n                diff.message(),\n            )\n        })\n        .collect();\n\n    assert!(\n        remaining_diagnostics.is_empty() && not_emitted_diagnostics.is_empty(),\n        \"\\n---------------------\\n\\n{}\\n---------------------\",\n        remaining_diagnostics.join(\"\\n\") + \"\\n\" + &not_emitted_diagnostics.join(\"\\n\")\n    );\n}\n\n// Before asserting output token, format both strings with `CairoFormatter` and normalize by removing newlines\npub fn assert_output(result: &ProcMacroResult, expected: &str) {\n    let fmt = CairoFormatter::new(FormatterConfig::default());\n    let format_and_normalize_code = |code: String| -> String {\n        fmt.format_to_string(&code)\n            .unwrap_or_else(|_| panic!(\"Failed to format provided code: {code}\"))\n            .into_output_text()\n            .replace('\\n', \"\")\n            .trim()\n            .to_string()\n    };\n\n    assert_eq!(\n        format_and_normalize_code(result.token_stream.to_string()),\n        format_and_normalize_code(expected.to_string()),\n        \"Invalid code generated\"\n    );\n}\n"
  },
  {
    "path": "crates/testing/packages_validation/Cargo.toml",
    "content": "[package]\nname = \"packages_validation\"\nversion = \"1.0.0\"\nedition.workspace = true\n\n[lib]\n\n[dependencies]\ncamino.workspace = true\nscarb-api = { path = \"../../scarb-api\" }\nproject-root.workspace = true\n\n[dev-dependencies]\ntest-case.workspace = true\n"
  },
  {
    "path": "crates/testing/packages_validation/src/lib.rs",
    "content": "use camino::Utf8PathBuf;\nuse scarb_api::ScarbCommand;\nuse std::process::Stdio;\n\npub fn check_and_lint(package_path: &Utf8PathBuf) {\n    let check_output = ScarbCommand::new()\n        .current_dir(package_path)\n        .arg(\"check\")\n        .command()\n        .stdout(Stdio::inherit())\n        .stderr(Stdio::inherit())\n        .output()\n        .expect(\"Failed to run `scarb check`\");\n    assert!(\n        check_output.status.success(),\n        \"`scarb check` failed in {package_path}\",\n    );\n\n    let lint_output = ScarbCommand::new()\n        .current_dir(package_path)\n        .arg(\"lint\")\n        .command()\n        .stdout(Stdio::inherit())\n        .stderr(Stdio::inherit())\n        .output()\n        .expect(\"Failed to run `scarb lint`\");\n    assert!(\n        lint_output.status.success(),\n        \"`scarb lint` failed in {package_path}\"\n    );\n}\n"
  },
  {
    "path": "crates/universal-sierra-compiler-api/Cargo.toml",
    "content": "[package]\nname = \"universal-sierra-compiler-api\"\nversion = \"1.0.0\"\nedition.workspace = true\n\n[dependencies]\nshared.workspace = true\nserde.workspace = true\nserde_json.workspace = true\nwhich.workspace = true\ntempfile.workspace = true\nnum-bigint.workspace = true\ncairo-lang-casm.workspace = true\ncairo-lang-starknet-classes.workspace = true\ntracing.workspace = true\nstrum_macros.workspace = true\nthiserror.workspace = true\n"
  },
  {
    "path": "crates/universal-sierra-compiler-api/src/command.rs",
    "content": "use shared::command::{CommandError, CommandExt};\nuse std::process::Output;\nuse std::{\n    env,\n    ffi::OsStr,\n    process::{Command, Stdio},\n};\nuse thiserror::Error;\n\n/// Errors that can occur while working with `universal-sierra-compiler` command.\n#[derive(Debug, Error)]\npub enum USCError {\n    #[error(\n        \"`universal-sierra-compiler` binary not available. \\\n          Make sure it is installed https://github.com/software-mansion/universal-sierra-compiler \\\n          and available in PATH or set via UNIVERSAL_SIERRA_COMPILER.\"\n    )]\n    NotFound(#[source] which::Error),\n\n    #[error(\n        \"Error while compiling Sierra. \\\n         Make sure you have the latest universal-sierra-compiler binary installed. \\\n         Contact Starknet Foundry team through Github or Telegram if it doesn't help.\"\n    )]\n    RunFailed(#[source] CommandError),\n}\n\n/// An internal builder for `universal-sierra-compiler` command invocation.\n#[derive(Debug)]\npub struct USCInternalCommand {\n    inner: Command,\n}\n\nimpl USCInternalCommand {\n    /// Creates a new `universal-sierra-compiler` command builder.\n    pub fn new() -> Result<Self, USCError> {\n        ensure_available()?;\n        let mut cmd = Command::new(binary_path());\n        cmd.stderr(Stdio::inherit());\n        Ok(Self { inner: cmd })\n    }\n\n    /// Adds an argument to pass to `universal-sierra-compiler`.\n    pub fn arg(mut self, arg: impl AsRef<OsStr>) -> Self {\n        self.inner.arg(arg);\n        self\n    }\n\n    /// Returns the constructed [`Command`].\n    #[must_use]\n    pub fn command(self) -> Command {\n        self.inner\n    }\n\n    /// Runs the `universal-sierra-compiler` command and returns the [`Output`].\n    pub fn run(self) -> Result<Output, USCError> {\n        self.command().output_checked().map_err(USCError::RunFailed)\n    }\n}\n\n/// Ensures that `universal-sierra-compiler` binary is available in the system.\npub fn ensure_available() -> Result<(), USCError> {\n    which::which(binary_path())\n        .map(|_| ())\n        .map_err(USCError::NotFound)\n}\n\n/// Returns the binary path either from env or fallback to default name.\nfn binary_path() -> String {\n    env::var(\"UNIVERSAL_SIERRA_COMPILER\")\n        .unwrap_or_else(|_| \"universal-sierra-compiler\".to_string())\n}\n"
  },
  {
    "path": "crates/universal-sierra-compiler-api/src/compile.rs",
    "content": "use crate::command::{USCError, USCInternalCommand};\nuse serde_json::Value;\nuse std::io;\nuse std::io::Write;\nuse std::path::Path;\nuse strum_macros::Display;\nuse tempfile::Builder;\nuse thiserror::Error;\n\n/// Errors that can occur during Sierra compilation.\n#[derive(Debug, Error)]\npub enum CompilationError {\n    #[error(\"Failed to write Sierra JSON to temp file: {0}\")]\n    TempFileWrite(#[from] io::Error),\n\n    #[error(\"Could not serialize Sierra JSON: {0}\")]\n    Serialization(serde_json::Error),\n\n    #[error(transparent)]\n    USCSetup(#[from] USCError),\n\n    #[error(\"Failed to deserialize compilation output: {0}\")]\n    Deserialization(serde_json::Error),\n}\n\n#[derive(Debug, Display, Copy, Clone)]\n#[strum(serialize_all = \"lowercase\")]\npub enum SierraType {\n    Contract,\n    Raw,\n}\n\n/// Compiles the given Sierra JSON into the specified type using the `universal-sierra-compiler`.\npub fn compile_sierra(\n    sierra_json: &Value,\n    sierra_type: SierraType,\n) -> Result<String, CompilationError> {\n    let mut temp_sierra_file = Builder::new().tempfile()?;\n\n    let json_bytes = serde_json::to_vec(sierra_json).map_err(CompilationError::Serialization)?;\n    temp_sierra_file.write_all(&json_bytes)?;\n\n    compile_sierra_at_path(temp_sierra_file.path(), sierra_type)\n}\n\n/// Compiles the Sierra file at the given path into the specified type using the `universal-sierra-compiler`.\n#[tracing::instrument(skip_all, level = \"debug\")]\npub fn compile_sierra_at_path(\n    sierra_file_path: &Path,\n    sierra_type: SierraType,\n) -> Result<String, CompilationError> {\n    let usc_output = USCInternalCommand::new()?\n        .arg(format!(\"compile-{sierra_type}\"))\n        .arg(\"--sierra-path\")\n        .arg(sierra_file_path)\n        .run()?;\n\n    Ok(String::from_utf8(usc_output.stdout).expect(\"valid UTF-8 from universal-sierra-compiler\"))\n}\n"
  },
  {
    "path": "crates/universal-sierra-compiler-api/src/lib.rs",
    "content": "//! API for compiling Sierra programs using the `universal-sierra-compiler` (USC).\n//!\n//! This crate provides functions to compile Sierra JSON representations of contracts and raw programs into their respective Casm formats.\n//!\n//! # Note:\n//! To allow more flexibility when changing internals, please make public as few items as possible.\n\nuse crate::command::{USCError, USCInternalCommand};\nuse crate::compile::{CompilationError, SierraType, compile_sierra, compile_sierra_at_path};\nuse crate::representation::RawCasmProgram;\nuse cairo_lang_starknet_classes::casm_contract_class::CasmContractClass;\nuse serde_json::Value;\nuse std::path::Path;\nuse std::process::Command;\n\nmod command;\nmod compile;\npub mod representation;\n\n/// Compiles Sierra JSON of a contract into [`CasmContractClass`].\npub fn compile_contract_sierra(sierra_json: &Value) -> Result<CasmContractClass, CompilationError> {\n    let json = compile_sierra(sierra_json, SierraType::Contract)?;\n    serde_json::from_str(&json).map_err(CompilationError::Deserialization)\n}\n\n/// Compiles Sierra JSON file at the given path of a contract into [`CasmContractClass`].\npub fn compile_contract_sierra_at_path(\n    sierra_file_path: &Path,\n) -> Result<CasmContractClass, CompilationError> {\n    let json = compile_sierra_at_path(sierra_file_path, SierraType::Contract)?;\n    serde_json::from_str(&json).map_err(CompilationError::Deserialization)\n}\n\n/// Compiles Sierra JSON of a raw program into [`RawCasmProgram`].\npub fn compile_raw_sierra(sierra_json: &Value) -> Result<RawCasmProgram, CompilationError> {\n    let json = compile_sierra(sierra_json, SierraType::Raw)?;\n    serde_json::from_str(&json).map_err(CompilationError::Deserialization)\n}\n\n/// Compiles Sierra JSON file at the given path of a raw program into [`RawCasmProgram`].\npub fn compile_raw_sierra_at_path(\n    sierra_file_path: &Path,\n) -> Result<RawCasmProgram, CompilationError> {\n    let json = compile_sierra_at_path(sierra_file_path, SierraType::Raw)?;\n    serde_json::from_str(&json).map_err(CompilationError::Deserialization)\n}\n\n/// Creates a `universal-sierra-compiler --version` command.\n///\n/// Only exists because of how requirements checker was implemented.\npub fn version_command() -> Result<Command, USCError> {\n    Ok(USCInternalCommand::new()?.arg(\"--version\").command())\n}\n"
  },
  {
    "path": "crates/universal-sierra-compiler-api/src/representation.rs",
    "content": "use cairo_lang_casm::hints::Hint;\nuse num_bigint::BigInt;\nuse serde::{Deserialize, Serialize};\n\npub type CasmCodeOffset = usize;\npub type CasmInstructionIdx = usize;\n\n#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]\npub struct RawCasmProgram {\n    pub assembled_cairo_program: AssembledCairoProgram,\n    /// `debug_info[i]` contains the following information about the first CASM instruction that\n    /// was generated by the Sierra statement with\n    /// `StatementIdx(i)` (i-th index in Sierra statements vector):\n    /// - code offset in the CASM bytecode\n    /// - index in CASM instructions vector\n    ///\n    /// Those 2 values are usually not equal since the instruction sizes in CASM may vary\n    pub debug_info: Vec<(CasmCodeOffset, CasmInstructionIdx)>,\n}\n\n#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]\npub struct AssembledCairoProgram {\n    pub bytecode: Vec<BigInt>,\n    pub hints: Vec<(usize, Vec<Hint>)>,\n}\n"
  },
  {
    "path": "design_documents/accessing_emitted_events.md",
    "content": "# Accessing emitted events\n\n<!-- TOC -->\n* [Accessing emitted events](#accessing-emitted-events)\n  * [Context](#context)\n  * [Goal](#goal)\n  * [Considered Solutions](#considered-solutions)\n  * [`expect_events` cheatcode](#expectevents-cheatcode)\n    * [Usage example](#usage-example)\n  * [`spy_events` cheatcode](#spyevents-cheatcode)\n    * [Propositions to consider](#propositions-to-consider)\n    * [Usage example](#usage-example-1)\n<!-- TOC -->\n\n## Context\n\nSome contract functions can emit events. It is important to test if they were emitted properly.\n\n## Goal\n\nPropose a solution that will allow checking if events were emitted.\n\n## Considered Solutions\n\n1. `expect_events` cheatcode \n2. `spy_events` cheatcode\n\n## `expect_events` cheatcode\n\nIntroduce a cheatcode with the signature:\n\n```cario\nfn expect_events(events: Array<snforge_std::Event>)\n```\n\nwhere `snforge_std::Event` is defined as below\n\n```cario\nstruct Event {\n    name: felt252,\n    keys: Array<felt252>,\n    data: Array<felt252>\n}\n```\n\n- `name` is a name of an event passed as a shortstring,\n- `keys` are values under `#[key]`-marked fields of an event,\n- `data` are all other values in emitted event.\n\n`expect_event` cheatcode will define events which should be emitted in the next call. Other calls will not be affected.\nIf provided events will not be emitted it will panic with a detailed message.\n\n`events` are the subset of all events emitted by the function, but you can also require function\nto return exactly those (and not more) events with the `expect_exact_events` cheatcode. \n\n```cario\nfn expect_exact_events(events: Array<snforge_std::Event>)\n```\n\nIt will panic if:\n- not all defined events were emitted\n- some other events where emitted\n\n### Usage example\n\n```cario\n#[starknet::interface]\ntrait IHelloEvent<TContractState> {\n    fn emit_store_name(self: @TContractState, name: felt252);\n}\n\nmod HelloEvent {\n    // ...\n    \n    #[event]\n    #[derive(Drop, starknet::Event)]\n    enum Event {\n        StoredName: StoredName, \n    }\n\n    #[derive(Drop, starknet::Event)]\n    struct StoredName {\n        #[key]\n        user: ContractAddress,\n        name: felt252\n    }\n    \n    #[abi(embed_v0)]\n    impl IHelloEventImpl of super::IHelloEvent<ContractState> {\n        fn emit_store_name(self: @ContractState, name: felt252) {\n            // ...\n            self.emit(Event::StoredName(StoredName { user: get_caller_address(), name: name }));\n        }\n    }\n}\n\nuse snforge_std::expect_events;\nuse snforge_std::Event;\n\n#[test]\nfn check_emitted_event() {\n    // ...\n\texpect_events(array![Event { name: 'StoredName', keys: array![123], data: array![456] }]);\n    let res = contract.emit_store_name(...);  // if the event is not emitted it will panic\n\n    let res = contract.emit_store_name(...);  // expect_events does not work here\n    \n    expect_exact_events(array![Event { name: 'StoredName', keys: array![123], data: array![456] }]);\n    let res = contract.emit_store_name(...);  // function has to emit exactly those events defined in the array otherwise it will panic\n    // ...\n}\n```\n\n## `spy_events` cheatcode\n\nAnother idea is to give users the highest possible customization. There would be a handler for extracting events emitted\nafter the line it was created. Users would have to assert events manually (which could be more complex than the previous\nsolution but would add more flexibility).\n\nIntroduce `spy_events` cheatcode with the signature:\n\n```cario\nfn spy_events() -> snforge_std::EventSpy\n```\n\nwhere `snforge_std::EventSpy` would allow for accessing events emitted after its creation.\n`EventSpy` would be defined as follows.\n\n```cario\nstruct EventSpy {\n    events: Array<snforge_std::Event>,\n}\n\nstruct Event {\n    from: ContractAddress,\n    name: felt252,\n    keys: Array<felt252>,\n    data: Array<felt252>\n}\n\ntrait EventFetcher {\n    fn fetch_events(ref self: EventSpy);\n}\n```\n\nUsers will be responsible for calling `fetch_events` to load emitted events to the `events` property.\n\nThere will also be `assert_emitted` method available on the `EventSpy` struct.\n\n```cairo\ntrait EventAssertions {\n    fn assert_emitted(ref self: EventSpy, events: Array<snforge_std::Event>);\n}\n```\n\nIt is designed to enable more simplified flow:\n- `fetch_events` will be called internally, so there will always be the newest events,\n- checked events will be removed from the `events` property.\n\n### Propositions to consider\n\n- `TargetedSpy` - regular spy with the target parameter for creation, which would be an enumeration of:\n  ```cairo\n  enum SpyOn {\n      All,\n      One(ContractAddress),\n      Multiple(Array<ContractAddress>>)\n  }\n  ```\n- Two different classes for Events - one for incoming events and the second one for events created by users. \n  It would clarify the confusion when `name` field is hashed when it comes from `EventSpy`.\n\n\n### Usage example\n\n```cario\n// Contract is the same as in the previous example\n\nuse snforge_std::spy_events;\nuse snforge_std::EventSpy;\nuse snforge_std::EventFetcher;\nuse snforge_std::EventAssertions;\nuse snforge_std::event_name_hash;\n\n#[test]\nfn check_emitted_event_simple() {\n    // ...\n\tlet mut spy = spy_events();  // all events emitted after this line will be saved under the `spy` variable\n    let res = contract.emit_store_name(...);\n    \n    // after this line there will be no events under the `spy.events`\n    spy.assert_emitted(array![Event {from: ..., name: 'StoredName', ...}]);\n\n    let res = contract.emit_store_name(...);\n    let res = contract.emit_store_name(...);\n    \n    spy.assert_emitted(\n        array![\n            Event {from: ..., name: 'StoredName', ...},\n            Event {from: ..., name: 'StoredName', ...}\n        ]\n    );\n    \n    assert(spy.events.len() == 0, 'All events should be consumed');\n    // ...\n}\n\n#[test]\nfn check_emitted_event_complex() {\n    // ...\n\tlet mut spy = spy_events();  // all events emitted after this line will be saved under the `spy` variable\n    let res = contract.emit_store_name(...);\n    \n    spy.fetch_events();\n    \n    // users can assert events on their own\n    assert(spy.events.len() == 1, 'There should be one event');\n    assert(spy.events.at(0).name == event_name_hash('StoredName'), 'Wrong event name');\n    \n    let data = array![...];\n    assert(spy.events.at(0).data == data, 'Wrong data');\n\n    let res = contract.emit_store_name(...);\n    let res = contract.emit_store_name(...);\n    \n    // events will not be present before fetching\n    assert!(spy.events.len() == 1, 'There should be one event');\n    \n    spy.fetch_events();\n    assert(spy.events.len() == 3, 'There should be three events');\n    // ...\n```\n\n\n"
  },
  {
    "path": "design_documents/cairo_deployment_scripts.md",
    "content": "# Cairo deployment scripts\n\n## Table of contents\n\n* [Context](#context)\n* [Goal](#goal)\n* [Considered Solutions](#considered-solution)\n  * [sncast commands](#sncast-commands)\n  * [sncast config](#sncast-config)\n  * [interacting with contract](#interacting-with-contract)\n  * [running the script](#running-the-script)\n  * [error handling](#error-handling)\n  * [idempotency](#idempotency)\n  * [example script](#example-script)\n  * [example state file](#example-state-file)\n  * [miscellaneous](#miscellaneous)\n* [Proposed steps and tasks](#proposed-stepstasks)\n\n## Context\n\nThere should be a possibility to write a script in cairo, that would enable users to make transactions and send them \nto starknet chain. It should allow to declare and deploy contracts as well as apply state transitions on already deployed\ncontracts.\n\n## Goal\n\nPropose a solution with an example syntax, that would allow to write deployment scripts in cairo.\n\n## Considered solution\n\nThis section is split into smaller subsections describing things we will need to tackle while implementing the solution.\n\n### sncast commands\nSpecific sncast commands (declare, deploy, account) could be imported as regular functions to the scripts, and called as such.\nOur functions return specific types (structs defined in `cast/src/helpers/response_structs.rs`), that make retrieving\nessential information easier, so we should be good on that front.\n\nThe commands would have to be implemented in the same manner as forge's cheatcodes.\n\n### sncast config\nWe should allow for all flags passed to sncast to be propagated to the script. CastConfig should also be importable\nand usable from script if someone wishes so, but we should not require it. That means, we might have to review our subcommands\nand if some of them requires it directly (`account create` is one), we should try to get rid of this dependency. \n\n### interacting with contract\nWe will use contracts dispatchers to be able to call/invoke its functions directly \n(e.g. if contract named `mycontract` has a function `myfunction`, we should be able to just do `mycontractDispatcher.myfunction();`).\nWe should also support our subcommands (`invoke`, `call`) to call/invoke so dispatchers are able to use them, and for calling/invoking \ncontracts without dispatchers.\n\n### running the script\nThe script would essentially run an entrypoint function - `main`. Inside our script subcommand, we will have to compile \nthe cairo script file using a custom builder/extension, and then run it using some form of a custom runner - all similarly\nto how it is done in snforge.\nThe main function would be required in the deployment script, and we should return an error if it is not found.\n\nThe deployment script could then be run like so:\n```bash\n$ sncast script /path/to/myscript.s.cairo\n```\n\nIn later versions, if needed, we might want to also allow to mark an entrypoint function with:\n```cairo\n#[script]\nfn some_script {\n  ...\n}\n```\n\nLog info should be outputted to stdout and optionally written to some log file. \nWe could have a flag to suppress outputting to stdout or to output with different formats (int, hex).\n\nBy default, the scripts could run in some kind of \"dry run mode\", meaning all the transactions would be simulated with \nspecific rpc calls (like `starknet_simulateTransactions`). An interesting idea would be to research an approach similar \nto cheatnet - fork a runner and test the scripts against it (to be assessed if it is feasible). We could also provide \na way to show a trace of said transactions if required. In later iterations, we could also provide a helper function\nthat sets up the devnet to be used for dry running for users.\n\nThe behaviour would be changed with `--broadcast` flag, that would actually execute needed transactions. We should also\ninclude a warning message about potential incurring cost.\n\n### error handling\nIf the transaction fails, we should put all the relevant info about it to the state file, output log information and stop\nscript execution.\nIf the script fails (for any reason that is not connected to transactions - eg rpc node down), we should output relevant\nlog information.\n\nIn case of failed transaction, we should allow to:\n- let the users handle the errors in cairo with Result\n- let the script fail - in the \"output\" field in state file we should then include an error message. After fixing the issue\nwe should allow users to just re-run the script - all the previous (succeeded) transactions should not be replayed, the\nerroneous transaction should be retried and its output should be put into [state file](#example-state-file).\n\n### idempotency\nAt the later stages we will want to have the script to be able to track the on chain state using a state file, which would \nin turn allow the script to be called multiple times without any modifications, to ensure desired state. To achieve that\nwe must ensure idempotency of calls to the network.\n\nThe proposed solution would be to use an external json file, that holds hashes of transactions that were already performed.\nWhile executing a command we could first check this file to see if given transaction exists/succeeded, and based on this\neither perform and an action (make a transaction) or skip it and proceed to the next thing in script.\n\nEach transaction request would have its id in the state file, in a form of `Hash(function_name, arguments, address)`.\nIf the id changes the transaction from state file should be re-executed.\n\nAt each invocation the script generates the list of transactions to make, and compares it with state file - if any transaction id\nhas changed or is missing, this transaction (and each next one from the list) should be (re)executed. \n\nTo achieve this there are a few possible solutions:\n- adjust our existing cast subcommand functions to handle checking the file\n  - pros: \n    - just import a subcommand function and use it without a fuss\n    - easy to implement for cast subcommands functions\n  - cons:\n    - we will have to modify currently existing functions to enable state checking\n    - this solution does not work for dispatcher functions\n\n- just try to execute functions, parse the output and compare it with the state file\n  - pros:\n    - no modifications needed for subcommands functions\n    - just import a function and use it\n  - cons:\n    - kind of brute force solution - we should not have to talk to chain since we have all the necessary info in local file\n    - executing dispatcher functions can cause us all kinds of trouble (eg - someone could invoke 'send_eth' function multiple times, where in fact they only wanted to do it once)\n    - not every cast subcommand is idempotent\n\n- implement a higher order function (or function wrapper) to conditionally execute functions based on the information in state file\n  - pros:\n    - no modifications needed to cast subcommands functions\n    - works with dispatcher functions just fine\n    - added flexibility - user can decide which function should be replayed each time, and which shouldn't\n  - cons:\n    - boilerplate code - wrapping each function call will be ugly\n    - no option to just annotate main function (procedural macros could achieve this, but they do some compile-time modifications)\n    - potentially more complex\n\nAn example pseudo-implementation of this could look like this:\n```rust\nfn skip_if_done<F>(func: F)\nwhere\n    F: Fn() + 'static,\n{\n    // Decorator logic here\n    // Check the state file and decide whether to execute the function or not\n\n    if should_execute {\n        func();\n        // write func outputs to state file\n    } else {\n        // Do nothing or return an appropriate value\n    }\n}\n\nfn main() {\n    skip_if_done(|| {\n        dispatcher.send_eth(...);\n    });\n}\n```\n\n- Use a procedural macro to automatically apply decorator-like behaviour to functions, which will decide on whether\ngiven function should be executetd or not (based on state file)\n  - pros:\n    - elegant solution\n    - could be applied selectively (per function) or globally (to main)\n  - cons:\n    - more complex solution\n    - probably not very suitable for runtime based behaviours (like reading json file) - requires more research\n\nAn example pseudo-implementation of this could look like this:\n```rust\n// skip_if_done.rs\nuse proc_macro_hack::proc_macro_hack;\n\n#[proc_macro_hack]\npub use skip_if_done_impl::skip_if_done;\n\n\n// skip_if_done_impl.rs\nuse quote::quote;\nuse std::env;\n\nfn should_execute() -> bool {\n    // Your logic to check whether the function should be executed goes here\n    true\n}\n\n#[macro_export]\nmacro_rules! skip_if_done {\n    ($($tokens:tt)*) => {\n        {\n            if should_execute() {\n                $($tokens)*\n            }\n        }\n    };\n}\n\n// main.rs\n#[path = \"skip_if_done.rs\"]\nmod skip_if_done;\n\nfn main() {\n    skip_if_done! {\n        dispatcher.send_eth(...);\n    }\n}\n```\n\nGiven all this, the most obvious solutions seem to be:\n  - for cast subcommands functions:\n    - adjust them to handle checking the file\n  - for dispatcher functions:\n    - implement a higher order function\n\nPicking those would ensure us that:\n  - syntax is relatively boiler-code free (only dispatcher functions are annotated)\n  - idempotency is achieved\n  - it is quite easy to write a script\n\n\n\n### example script\nAn example deployment script could look like this:\n\n```cairo\n// we might need to rename account functions to avoid confusion\nuse sncast::starknet_commands::account::create::create as create_account\nuse sncast::starknet_commands::account::deploy::deploy as deploy_account\nuse sncast::{get_provider, get_account};\nuse sncast::starknet_commands::{declare, deploy, invoke, call};\n(...)\n\nfn make_account(provider: &JsonRpcClient<HttpTransport>) -> Result<SingleOwnerAccount<&'a JsonRpcClient<HttpTransport>, LocalWallet>> {\n  let mut prefunder = get_account(\"user\", &provider)?; // the user that will prefund new account \n  let user = create_account(\"user1\", &provider);\n  let prefund_account = invoke(\"0x123\", \"deposit\", [1234, user.address], &prefunder);\n  deploy_account(\"user1\", &provider);\n  get_account(\"user1\", &provider)?\n}\n\nfn main() {\n  ler provider = get_provider(\"http://127.0.0.1:5050/rpc\")?;\n  let user = make_account(provider);\n\n  let declared_contract = declare(\"mycontract\", &user, \"/path/to/Scarb.toml\");\n  let contract = deploy(&declared_contract.class_hash, [], &user);\n\n  let dispatcher = DispatcherMyContract { contract.contract_address };\n\n  skip_if_done(|| {\n        dispatcher.increase_balance(5);\n    });\n  let get_balance = skip_if_done(|| {\n        dispatcher.get_balance();\n    });\n\n  let called_balance = call(&contract.contract_address, \"get_balance\", [], \"latest\"); \n}\n```\n\n### example state file\nThe state file by default should be written to the current working directory, with a name `<script file name>.state.json`.\nIts schema could look like this:\n\n```json\n{\n  \"version\": 1,\n  \"transactions\" : {\n    \"<create_account_id>\": {\n      \"name\": \"create_account\",\n      \"arguments\": {\n        \"name\": \"whatever\",\n        (...)\n      },\n      \"output\": {\n        \"address\": \"0x123\",\n        \"max_fee\": \"0x321\"\n      },\n      \"status\": \"accepted\",\n      \"timestamp\": (...)\n    },\n    \"<prefund_account_id>\": {\n      \"name\": \"prefound_account\",\n      \"arguments\": {\n        (...)\n      },\n      \"output\": {\n        \"error\": \"...\"\n      },\n      \"status\": \"rejected\",\n      \"timestamp\": (...)\n  }\n}\n```\n\nHaving this, we could allow users to `--retries` or `--verify` transactions if something unexpected happens,\nsome transactions were rejected because of faulty script, too low user eth balance etc.\n\nIf we were to implement dry run mode that runs by default, the state should only be written to a file when we pass `--broadcast`\nflag; otherwise the output should be directed to stdout.\n\nThe file should be used to see, if given action/transaction was already taken - it should take under account the function\nname as well as its parameters, to distinguish functions from one another (eg. user creates two accounts, we should check\nstate file records, one by one, and check if a function `account new` was already invoked with specified parameter `username` \n(and others, if supplied)).\n\n### Miscellaneous\n\nThere would be a new subcommand `script` that would be invoked with required parameter - a path to script file, with\n`*.s.cairo` extension. Proposed interface:\n\n- `--gas-multiplier` - relative percentage by which to multiply add gas estimates (perhaps passed directly to sncast)\n- `--broadcast` - broadcasts the transactions\n- `--no-state-file` - do not write to state file\n- `--state-file` - specify path to custom state file\n- `--log-file` - output logs to a file\n- `--quiet` - do not output logs to stdout\n- `--slow` - makes sure a transaction is sent, only after its previous one has been confirmed and succeeded (possible reuse of `--wait` flag)\n- `--verify` - find a matching broadcast in state file, and try to verify transactions against the chain (basically getting\nthe transaction receipt and checking its status etc)\n- `--delay` - optional timeout to apply in between attempts in seconds (perhaps passed directly to sncast)\n- `--retries` - number of attempts for retrying (perhaps passed directly to sncast)\n- `--replay` - do a clean run of script, every transaction would be re-done\n\nIf it makes sense, some of the flags could be included in Scarb.toml config file.\n\n## Proposed steps/tasks\n\nMVP:\n  - allow for writing scripts using dispatchers and imported cast subcommand functions:\n    - no idempotency required at this stage\n    - all cast subcommand functions return every information necessary (tx hashes, addresses etc) as importable structs\n    - no cast subcommand requires CastConfig directly (eg as parameter)\n    - it is possible to create and deploy an account, create and deploy a contract\n    - it is possible to call/invoke contracts using dispatchers\n    - `script` subcommand is added to cast, that builds and runs the script\n    - logs are outputted to stdout\n    - basic tests for `script` subcommand\n    - docs\n\nnext iteration:\n  - invoke, call and multicall (after it is possible to use it without a file [issue 502](https://github.com/foundry-rs/starknet-foundry/issues/502)) subcommands support\n  - dry run\n  - writing to state file\n  - idempotency\n\nnext iteration:\n  - add support for flags from [Miscellaneous](#miscellaneous)\n  - script tests\n  - helper for user to set up devnet for dry_running / tests\n"
  },
  {
    "path": "design_documents/contract_verification.md",
    "content": "# Cairo Contract Verification via Block Explorers\n\n## Context\n\nCairo smart contracts deployed to Starknet are only visible as a Cairo Bytecode and their's ABIs, which is difficult to decipher and understand. To increase readability of a smart contract, it's source code can also be made public, however in order to ensure trustlessness, the source code vs resulting Cairo Bytecode verification can be performed. Such verification and its results can be performed and made public by popular Blockchain Explorers.\n\n## Goal\n\nThis proposal includes an extension to `sncast` utility enabling a contract owner to perform contract verification against a selected Blockchain Explorer API. We propose to create a first, reference implementation for the Voyager APIs.\n\n## Proposed Solution\n\nWe propose to design a dedicated `verify` command for the `sncast` tool, and add a mechanism whereby this command can be implemented for various Blockchain Explorers. We define a \"generic\" contract verification interface and propose to implement the interface by \"adapters\" specific to respective explorers. \n\n### `sncast` utility command - `verify`\n\nCommand name: `verify`\n\nThe `verify` command will perform following actions:\n- select the verification logic to use (based on `--verifier` parameter)\n- pick the selected scarb workspace source code from local filesystem (based on `Scarb.toml` file)\n- for the selected verifier it will upload the Scarb workspace contracts source code to the verifier's API\n- call the verifier's API to trigger verification of the uploaded source code\n- wait for results of the verification API call\n- respond to the user with the results \n\n#### Parameters\n\n#### `--class-name`\n\nRequired.\nName of the contract to be submitted for verification.\n\n#### `--contract-address`\n\nRequired.\nAddress of the contract to be submitted for verification.\n\n#### `--class-hash`\n\nRequired.\nAddress of the contract to be submitted for verification.\n\n#### `--verifier <VERIFIER NAME>`\n\nRequired.\nSpecifies the Blockchain Explorer to verify with.  \n\nOptions as of writing of this document: \n - voyager\n - walnut\n\n#### `--network <NETWORK_NAME>`\n\nRequired.\nSpecifies the network on which Blockchain Explorers will do the verification\n\nOptions are:\n - mainnet - for verification at mainnet\n - goerli -  for verification on testnet\n\n### Contract Verification interface\n\nTo implement contract verification for a specific explorer, it is required to implement a generic interface (request/response), as described below. The data structures proposed can be eventually extended to cater for detailed requirements of subsequent explorer adapters.\n\n#### Request\n\n- `ContractAddress` - `ContractAddress`\n- `ClassHash` - `String`\n- `ClassName` - `String`\n- `SourceCode` - collection of file records (`.cairo` files  + `Scarb.toml`):\n  - `FilePath` - `String`\n  - `FileContent` - `String`\n\nNote: `ContractAddress` and `ClassHash` are mutually exclusive. One of them must be provided.\n\n#### Response\n\n- `VerificationStatus` - `Enum` (`OK`, `Error`)\n- `Errors` - (Optional) collection of error records:\n  - `ErrorMessage` - `String`\n  - `ErrorDetail` - `String`\n\n### Voyager API adapter plugin\n\nA sample request in the Voyager API adapter implementation will look as follows: \n```rust\n\nconst url = `${voyager.testnet.url}/contract/`\n\nconst payload = serde_json::json!({\n        \"contract_address\": \"0x0\", // this is optional if class_hash is provided\n        \"class_hash\": \"0x0\", // this is optional if contract_address is provided\n        \"class_name\": \"balance\",\n        \"source_code\": {\n            \"Scarb.toml\" : {\n                \"\"\"\n                [package]\n                ...\n                [dependencies]\n                starknet = \"2.3.0-rc0\"\n                \"\"\"\n            },\n            \"src/lib.cairo\" : {\n                \"\"\"\n                mod balance;\n                mod forty_two;\n                \"\"\"\n            },\n            \"src/balance.cairo\" : {\n                \"\"\"\n                #[starknet::interface]\n                ...\n                #[starknet::contract]\n                mod Balance {\n                    ...\n                }\n                \"\"\"\n            },\n            \"src/forty_two.cairo\" : {\n                \"\"\"\n                #[starknet::contract]\n                mod FortyTwo {\n                    ...\n                }\n                \"\"\"\n            }\n        }\n    });\n\nconst resp = client\n    .post(url)\n    .json(&payload)\n    .send()\n    .await?;\n\nprintln!(resp.verification_status)\n```\n"
  },
  {
    "path": "design_documents/loading_data_from_files.md",
    "content": "# Loading data from files\n\n## Context\n\nReading data from files and loading it into Cairo memory can be useful when testing\nagainst different specified cases. This way users won't need to edit their Cairo code,\njust edit the contents of their files.\n\nAdditionally, some major projects migrating to Starknet Foundry could benefit from\nsuch a feature, as it was communicated by them.\n\n## Goal\n\nPropose a solution that will allow reading data from files to Cairo memory.\n\nFor example, the following test should pass when reading from a file with content like this:\n```\n2 90\n```\n\n```\nlet array = array![2, 90];\nlet file_data = read_array_from_file('file.txt').unwrap();\nassert(*array[0] == *file_data[0] && *array[1] == *file_data[1], 'arrays are not equal');\n```\n\n## Proposed Solution\n\nCreate traits that are responsible for reading data from a file and loading it into Cairo memory\nas an array of felts, returning a Result if something goes wrong (file does not exist, short string is too long, etc.).\nThen the user can deserialize it themselves to the desired structure \nas described in [Cairo Book](https://book.cairo-lang.org/appendix-03-derivable-traits.html#serializing-with-serde).\n\n### Supported type of files\n\nFor now, two types of files would be supported (in the future we can support also CSV, TOML, etc.):\n- plain text files with space-separated felts like this\n```\n1 40 'hello' 100\n```\n- JSON files — order of elements in the output array would be as if traversing JSON tree with DFS\n```json\n{\n  \"a\": 1,\n  \"b\": {\n    \"c\": {\n        \"array\": [40, {\"e\": \"hello\"}]\n      }\n    },\n  \"d\": 100\n}\n```\nNote that short strings have to be in double quotes here due to JSON grammar definition.\n\n### User interface\n```\n// struct to store path of the file\nstruct File {\n    path: felt252 // relative path to the file\n}\n\ntrait FileTrait {\n    fn new(path: felt252) -> File;\n}\n\nimpl FileTraitImpl of FileTrait {\n    fn new(path: felt252) -> File {\n        File { path }\n    }\n}\n\nfn read_txt(file: @File) -> Array<felt252>;\nfn read_json(file: @File) -> Array<felt252>;\n```\n\nExample usage:\n```\n#[derive(Serde, Drop, PartialEq)]\nstruct A {\n    item_one: felt252,\n    item_two: felt252,\n}\n\nlet file = FileTrait::new('data/file.txt');\nlet data = read_txt(file);\n\nlet mut span = data.span();\nlet deserialized_struct: A = Serde::<A>::deserialize(ref span).unwrap();\n```\n"
  },
  {
    "path": "design_documents/parametrizing_tests_with_fixed_values.md",
    "content": "# Parametrizing Tests With Fixed Values\n\n## Context\n\nVarious test runners for other programming languages provide ways of parametrizing test cases with fixed values.\nThis way, multiple test cases can be executed for the same test source code.\n\n## Goal\n\nPropose a way of adding support for parametrized tests to Starknet Foundry's `snforge`.\n\n## Proposed Solution\n\nIntroduce new attribute `test_case`.\n\nThe attribute should accept arguments:\n\n- Optional, named argument `name`.\n- Unnamed, non-optional arguments, each corresponding to a test argument.\n\nGenerate code for each of the test cases so no handling of values injection, etc. is necessary.\nThe compiler would then validate if the values for the generated code are actually valid.\nThanks to that, we could have failures for invalid arguments early in the execution.\n\n### Parametrization With Arguments\n\nIn the `test_case` attribute, user provides a list of unnamed arguments, each corresponding to test function argument.\nArguments are handled in order: The first argument of the attribute corresponds to the first argument of a test\nfunction.\n\n```cairo\n#[test_case(1, 3)]\n#[test_case(3, 5)]\nfn my_test(a: felt252, b: u32) {\n    // ...\n}\n```\n\nFor test cases like this, we would generate two actual test cases:\n\n```cairo\n#[test]\nfn my_test_case_1() {\n  let a: felt252 = 1;\n  let b: u32 = 3;\n  // ...\n}\n\n#[test]\nfn my_test_case_2() {\n    let a: felt252 = 3;\n    let b: u32 = 5;\n  // ...\n}\n```\n\n### Generated Cases Names\n\nGenerated test cases should be named in such a way that we can automatically detect which tests are generated cases of\nthe same base test.\n\nTest in `snforge` can be filtered by name.\nIt is important that generated test names do not break the test filtering logic.\n\nFor consistent UX, we should not allow filtering specific test cases.\nIt should only be possible to filter the whole parametrized test.\n\nThis can be resolved by either using names for generated tests that still work with filters as the base test would do,\nor changing the filtering logic, so it can recognize generated test cases and treat them accordingly.\n\n### Named Test Cases\n\nIf `name` attribute is provided, instead of generating case name, it should be used instead.\nFor `name` values to be suitable for generating case names, they are limited to lowercase letters, digits and\nunderscore `_` character.\nProvided names must be unique and must not be the same as automatically generated names of any of the test cases.\n\nFor example:\n\n```cairo\n#[test_case(1, 3, name: \"my_name\")]\n#[test_case(3, 5, name: \"a_test\")]\nfn my_test(a: felt252, b: u32) {\n    // ...\n}\n```\n\n### Parametrizing With Complex Types\n\nComplex types would result in the same code generation as simple types:\n\n```cairo\n#[test_case(MyStruct { a: 1, b: array![2, 3] })]\nfn my_test(a: MyStruct) {\n    // ...\n}\n```\n\n```cairo\n#[test]\nfn my_test_1() {\n    let a = MyStruct { a: 1, b: array![2, 3] };\n    // ...\n}\n```\n\n### Problems With Code Generation\n\nThe code generation solution has some problems that will need to be addressed before it is implemented.\nSee [section below](#possible-problems-with-code-generation) for details.\n\n## User Experience\n\nUnlike fuzz-tests, we should run and indicate the result of all parametrized cases.\nIf some test cases fail, others should still be executed and their results should be displayed to the user.\n\nIf a test case has a custom name, it should be displayed to the user.\n\nAn example output could look similarly to this:\n\n```shell\n$ snforge test\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\n[PASS] tests::parametrized(a = 1, b = 2)              # unnamed test case\n[PASS] tests::parametrized[a_test](a = 3, b = 5)      # named test case\n[FAIL] tests::parametrized[my_case](a = 4, b = 5)     # named test case\n\nFailure data:\n    0x50414e4943 ('PANIC')\n    \n[PASS] tests::parametrized(a = 5, b = 7)\n# ...\n```\n</details>\n<br>\n\n## Deterministic Test Output Order\n\nParallel test execution implementation in forge makes deterministic test execution order non-trivial.\nFor good user experience, we should aim to implement parametrized tests in such a way that cases results are displayed\nin deterministic order and grouped together.\n\nTest execution itself can be performed in any order as long as we display the results in a grouped manner.\nWe can follow the fuzzed tests implementation for this.\n\n### Behavior of `--exit-first` Flag\n\nIn case `--exit-first` flag is used we should try to have consistent behavior of parametrized tests.\n\nIf some other test fails and there are cases of parametrized tests that did not finish execution,\nwe should not display any results of parametrized test.\n\nIn case a parametrized test case fails, we should display it.\nOther cases may not be displayed in this case.\n\n### Behavior of `#[ignore]` Attribute\n\nAdding `#[ignore]` attribute to parametrized test should ignore all of it's test cases - test should not run at all.\n\n### Behavior of `--rerun-failed` Flag\n\nIn case `--rerun-failed` flag is used, only failed cases of a parametrized test should be rerun.\n\nRerun cases should still be displayed together: The behavior should be exactly the same as if just running test cases.\n\n### Behavior of `#[fuzzer]` Attribute\n\nIt must not be possible to add `#[fuzzer]` attribute to parametrized test.\nIt must not be possible to use fuzzing in parametrized test.\n\n## Required Changes to Test Collector\n\nTo support parametric test, we need to introduce some changes to the test collector in Scarb as outlined below.\n\n### Define the Necessary Attributes\n\nThis change is mostly straightforward: It can be done in the same manner as all other attributes.\n\n### Code Generation\n\nFor this approach, my recommendation is to use plugins for code generation.\nWe could create a separate plugin for just generating test cases from our attribute and make sure it is executed before\nthe test collection.\n\nCairo repository contains multiple examples of plugins that generate Cairo code which we could follow:\n\n- https://github.com/starkware-libs/cairo/blob/main/crates/cairo-lang-plugins/src/plugins/generate_trait.rs\n- https://github.com/starkware-libs/cairo/blob/main/crates/cairo-lang-plugins/src/plugins/panicable.rs\n- https://github.com/starkware-libs/cairo/blob/main/crates/cairo-lang-semantic/src/inline_macros/array.rs\n\nDetails of this are for the implementer to investigate.\nMy recommendation is to follow the implementations of other Cairo plugins and generate Cairo code for test cases.\n\n### Possible Problems With Code Generation\n\nFor each test case, we will have to generate multiple versions of the test.\nThis is problematic because `snforge` would treat these generated tests as completely separate entities.\n\nTest collector should be modified, so that cases of the same test as a single bundle.\nThis way we can handle execution of them more easily.\n\n## Implementation Plan\n\n1. Prototype creating a plugin for test code generation.\n   Initially, it can support just simple arguments and unnamed test cases.\n2. If/Once code generation approach is proven viable, add support for complex types arguments and introduce necessary\n   test collection logic according to the document.\n3. Named test cases can be added after MVP is created.\n"
  },
  {
    "path": "design_documents/prepare_cheatcode.md",
    "content": "# `prepare` Cheatcode\n\n<!-- TOC -->\n* [`prepare` Cheatcode](#prepare-cheatcode)\n  * [Context](#context)\n  * [Goal](#goal)\n  * [Considered Solutions](#considered-solutions)\n    * [Require Calling the `prepare` Cheatcode Before Every Deployment](#require-calling-the-prepare-cheatcode-before-every-deployment)\n    * [Introducing the `precalculate_address` Cheatcode](#introducing-the-precalculateaddress-cheatcode)\n      * [Salt \"Counter\"](#salt-counter)\n      * [`precalculate_address` Cheatcode](#precalculateaddress-cheatcode)\n      * [Known Problems With This Solution](#known-problems-with-this-solution)\n      * [Example Usage](#example-usage)\n  * [Proposed Solution](#proposed-solution)\n    * [`declare` Cheatcode](#declare-cheatcode)\n    * [Salt \"Counter\"](#salt-counter-1)\n    * [Known Problems With This Solution](#known-problems-with-this-solution-1)\n    * [Example Usage](#example-usage-1)\n<!-- TOC -->\n\n## Context\n\nSome testing cases require knowing the address of the contract that will be deployed in advance.\nThese include:\n\n- Using cheatcodes in contract's constructor: This requires running the cheatcode before `deploy` is called.\n- Tests that depend on knowing the address of the contract that will be deployed.\n\nSince `deploy` already performs a deployment of the contract identified just by `class_hash` it is impossible to know\nthe address in advance with the current cheatcodes.\n\n## Goal\n\nPropose a solution that will allow knowing the address of a contract before the deployment.\n\n## Considered Solutions\n\n### Require Calling the `prepare` Cheatcode Before Every Deployment\n\nThis is similar to how the contract deployment worked in Protostar:\n\n1. Call `declare` with the contract name. This returns `class_hash`.\n2. Call `prepare` with the `class_hash` and `calldata`. This returns `PreparedContract` struct.\n3. Call `deploy` with the `PreparedContract` struct. This returns the address.\n\nWith this approach, `PreparedContract` also included a `contract_address` field that could be used for applying the\ncheatcodes before the contract was deployed.\n\nThe problem with this approach is that it is very verbose and requires multiple steps:\nJust deploying the contracts is more frequent use case than applying cheatcodes before the deployment.\nUsers would have to perform an often unnecessary extra step with every deployment.\n\n### Introducing the `precalculate_address` Cheatcode\n\nIntroducing the `precalculate_address` cheatcode that would return the contract address of the contract that would be\ndeployed with `deploy` cheatcode.\n\n#### Salt \"Counter\"\n\nIntroduce an internal \"counter\" and use its value to salt the otherwise deterministic contract address.\nEvery time the `deploy` is called, increment this counter, so subsequent calls of `deploy` with the same `class_hash`\nwill yield different addresses.\n\n#### `precalculate_address` Cheatcode\n\nIntroduce a cheatcode with the signature:\n\n```cairo\nfn precalculate_address(prepared_contract: PreparedContract) -> ContractAddress;\n```\n\nThat will use the same method of calculating the contract address as `deploy` uses, utilizing the internal counter.\nThis way the user will have an ability to know the address of the contract that will be deployed, and the current\ndeployment flow will remain unchanged.\n\n#### Known Problems With This Solution\n\nFor the address returned by `precalculate_address` to match the address from `deploy`, the user will have to\ncall `precalculate_address` immediately before the deployment or at least before any other calls to `deploy` as the\ninternal counter will then be incremented.\n\nThis could be remedied by having separate counters for all `class_hashe`es, but it will still remain a limiting factor.\n\n#### Example Usage\n\n```cairo\nmod HelloStarknet {\n    // ...\n    \n    #[constructor]\n    fn constructor(ref self: ContractState) {\n        let timestamp = starknet::get_block_timestamp();\n        self.create_time.write(timestamp);\n    }\n}\n\n#[test]\nfn call_and_invoke() {\n    // Declare the contract\n    let class_hash = declare(\"HelloStarknet\");\n    \n    // Prepare contract for deployment\n    let prepared = PreparedContract { class_hash: class_hash, constructor_calldata: @ArrayTrait::new() };\n    \n    // Precalculate the address\n    let contract_address = precalulucate_address(prepared);\n    \n    // Warp the address\n    start_warp(contract_address, 1234);\n    \n    // Deploy with warped constructor\n    let contract_address = deploy(prepared).unwrap();\n    let dispatcher = IHelloStarknetDispatcher { contract_address };\n}\n```\n\nIn case the user does not need to apply cheatcodes to the constructor, the deployment flow remains as before, without\nany steps introduced.\n\n```cairo\n#[test]\nfn call_and_invoke() {\n    // Declare the contract\n    let class_hash = declare(\"HelloStarknet\");\n    \n    // Prepare contract for deployment\n    let prepared = PreparedContract { class_hash: class_hash, constructor_calldata: @ArrayTrait::new() };\n        \n    // Deploy\n    let contract_address = deploy(prepared).unwrap();\n    let dispatcher = IHelloStarknetDispatcher { contract_address };\n}\n```\n\n## Proposed Solution\n\nChange the current deployment flow, so it can better facilitate precalculating of contract addresses.\n\n### `declare` Cheatcode\n\nChange the `declare` cheatcode signature to this:\n\n```cairo\nstruct ContractClass {\n    class_hash: ClassHash\n    // ...\n}\n\ntrait ContractClassTrait {\n    fn precalculate_address(self: @ContractClass, constructor_calldata: @Array::<felt252>) -> ContractAddress;\n    fn deploy(self: @ContractClass, constructor_calldata: @Array::<felt252>) -> Result::<ContractAddress, RevertedTransaction>;\n}\n\nimpl ContractClassTrait of ContractClassTrait {\n    // ...\n}\n\nfn declare(contract: felt252) -> ContractClass;\n```\n\nAnd remove the `deploy` cheatcode entirely.\n\nBoth `precalculate_address` and `deploy` should use the same way of calculating the contract address.\n\n### Salt \"Counter\"\n\nIntroduce the same salt counter as [discussed here](#salt-counter).\nThis will allow deterministic address calculation and deploying of multiple instances of the same contract.\n\n### Known Problems With This Solution\n\nSame problems as [indicated here](#known-problems-with-this-solution) apply to Proposed Solution 2 as well.\n\n### Example Usage\n\n```cairo\nmod HelloStarknet {\n    // ...\n    \n    #[constructor]\n    fn constructor(ref self: ContractState) {\n        let timestamp = starknet::get_block_timestamp();\n        self.create_time.write(timestamp);\n    }\n}\n\n#[test]\nfn call_and_invoke() {\n    // Declare the contract\n    let contract = declare(\"HelloStarknet\");\n        \n    // Precalculate the address\n    let contract_address = contract.precalulucate_address(@ArrayTrait::new());\n    \n    // Warp the address\n    start_warp(contract_address, 1234);\n    \n    // Deploy with warped constructor\n    let contract_address = contract.deploy(@ArrayTrait::new()).unwrap();\n    let dispatcher = IHelloStarknetDispatcher { contract_address };\n}\n```\n"
  },
  {
    "path": "design_documents/sncast_interface_overhaul.md",
    "content": "# sncast interface overhaul\n\n## Context\nIn light of needed changes on how the scripts and contract declaration work (ie adding support for scarb workspaces and various directory layouts),\nwe need to re-think how we call the respective subcommands, and try to improve it. This design doc covers only a portion\n(although significant one) of sncast interface - it was decided recently we should make the interfaces as 'clap-native'\nas possible, but this design doc won't cover those changes in detail, as they are pretty straight forward and already have\nan opened issue.\n\n## The 'now'\nCurrently, when declaring a contract we require user to pass the contract name using `--contract-name` flag. This flag only\ntakes the contract's name, so for example it is not possible to specify the package this contract was defined in (only\nachievable when passing `--path-to-scarb-toml`). \n\nWhen running a script we require a positional argument, that is the script package name. Similarly to declare, we could\npass `--path-to-scarb-toml` if we wanted to pick the manifest we wanted to use.\n\nThese approaches are a bit different to each other, and have a common flaw in the shape of having to specify a manifest \nfile one wants to work with, when the package needs to be specified. This may seem quite quirky, as we probably could \nassume that we're always in some workspace/package.\n\n## Proposed changes\nWe could streamline the way we interact with scarb-related subcommands (declare, script at the moment of writing this)\nto look like this:\n\n```bash\n$ # this is the same module\n$ sncast script path::to::script_module\n$ sncast script to::script_module\n$ sncast script script_module\n\n$ # this is the same contract\n$ sncast declare path::to::contract\n$ sncast declare to::contract\n$ sncast declare contract\n\n$ # contract is ambiguous - there are multiple contracts named 'contract' in multiple packages\n$ sncast declare --package packagea contract\n```\n\nIn case there is only one script module/contract with specified name in workspace, only this name can be used to target it.\nOtherwise, if it is ambiguous in the context of workspace, we should show all matches with full paths (along with package names),\nto let user decide which one to use.\n\nThis change would mean that from now on we will have unified interface for declare/script, always assume we're in some workspace/package, \nthe `--path-to-scarb-toml` flag can be removed.\n\n## Implementation\nAs much things as possible should be imported from scarb-api crate. The mechanism for path matching should take under\naccount whole words between `::`, so (having examples above in mind) `contract` should be matched, but `tract` shouldn't.  \n"
  },
  {
    "path": "design_documents/stark_curve_signatures.md",
    "content": "# `StarkCurve` signatures\n\n## Context\n\nSome users would like to have a way of generating and signing with the `stark curve`. It would be useful for testing\ncustom account implementations. \n\n## Existing solutions\n\nCurrently, it is possible only with the snForge I/O utilities which does not seem flexible. Also, to import such a signature\nusers have to generate it outside the Cairo and save it somewhere. Cheatcodes should simplify that process.\n\n## Proposed solution\n\nMy proposal would be to introduce a `StarkCurveKeyPair` struct which would implement `sign` and `verify` methods.\n\n```cairo\nstruct StarkCurveKeyPair {\n    private_key: felt252,\n    public_key: felt252 \n}\n\ntrait StarkCurveKeyPairTrait {\n    fn generate() -> StarkCurveKeyPair;\n    fn sign(ref self: StarkCurveKeyPair, message_hash: felt252) -> (felt252, felt252);\n    fn verify(ref self: StarkCurveKeyPair, message_hash: felt252, signature: (felt252, felt252)) -> bool;\n}\n```\n\n## Example usage\n\n```cairo\nuse snforge_std::{StarkCurveKeyPair, StarkCurveKeyPairTrait};\n\n#[test]\nfn test_stark_curve() {\n    let mut key_pair = StarkCurveKeyPairTrait::generate();\n    let message_hash = 12345;\n    \n    let signature = key_pair.sign(message_hash);\n    \n    assert(key_pair.verify(message_hash, signature), 'Signature is incorrect');\n}\n```\n"
  },
  {
    "path": "design_documents/state_forking/multi-forking.md",
    "content": "# Multi-forking\n\nFoundry provides a way of interacting with multiple networks inside a single test. We would like to mimic this approach.\n\n## Features\n\n- creating a fork\n- selecting a fork\n- sharing a contract between all forks\n\nAbove features will require us to change currently implemented `CheatnetState`.\n\n## New CheatnetState interface\n\n![New CheatnetState interface](./new_CheatnetState_interface.png)\n\nThe most important part (from multi-forking perspective) is one under the `blockifier_state` branch.\nWe have to keep:\n- `shared_state` - which is a common `DictStateReader`. It represents contracts/classes/data shared between all networks (forks).\n- `forks_states` - (tmp name) vector keeping track of all forks. Each fork is represented as a `ExtendedStateReader`\nwhich consists of `DictStateReader` and `ForkStateReader`. \n- `current_fork_id` - variable defining which fork is currently in use.\n\n`blockifier_state` is currently represented as a `CachedState<ExtendedStateReader>` because some blockifier methods \n(like AccountTransaction.execute) requires `CachedState`.\n`CachedState` is native blockifier struct, so we can't change its implementation to meet our requirements.\n\nIt appears that since our tests are contracts we can abandon `CachedState` and `AccountTransaction.execute`.\nWe would have to verify this idea, but if it is double we could create some class that implements `State` trait from blockifier\nand keep it as a `blockifier_state`.\n\n## Interacting with multiple forks (Cheatnet side)\n\nLet's split common fork interaction into parts:\n\n- user creates and selects fork\n  - fork is created, saved to `forks_states` and `current_fork_id` is set to 0\n- deploys contract `A` and marks it as `shared`\n  - contract is deployed\n  - all its data is saved under the `shared_state` (address, class_hash and storage)\n- deploys contract `B`\n  - contract is deployed and saved under the local fork state (`forks_states[current_fork_id]`)\n- creates and selects another fork\n  - all contracts under the `shared_state` are available for this network\n  - `A` is available\n  - `B` is not\n\nThe most tricky part would be playing on top of the merged `shared_state` with one of the `forks_states`. We can do it\nby simply implementing `StateReader` for the `StateCache`. It would search for a contract in the following order:\n\n- check if contract is available in the `shared_state` - if so return it\n- check if contract is available in the local `DictStateReader` of the `ExtendedStateReader` - if so return it\n- check if contract is available in the forked network (perform call to node) - if so return it\n- throw an error\n\n## Required actions\n\n- verify if it is possible to get rid of methods using `CachedState`\n- create `StarknetState` (name can be changed) struct which will implement `State` trait\n- change `CheatnetState` fields to implement proposed solution\n- add control cheatcodes\n"
  },
  {
    "path": "design_documents/state_forking/state_forking.md",
    "content": "## Motivation\n\nMany projects may rely on state which already exists on the chain. \nThis might be difficult to replicate on a local testing environment \n(this might include deploying multiple contracts, performing many transactions etc.).\nIn order to make this easier, some frameworks from ethereum (like foundry) introduce \"state forking\" (see [foundry docs](https://book.getfoundry.sh/forge/fork-testing)).\n\n## State forking in foundry\n\nOriginal implementation allows for 2 ways of forking the state.\n\nBoth of the approaches require the user to specify the source (RPC endpoint) and optionally - a block number we want to fork state from.\n\n### 1. Forking the state once for all tests\nThis is a simpler way of forking, which requires only to pass some arguments to the forge CLI, \nand state is forked for the whole suite.\n\n### 2. Switching forks dynamically in tests, using cheatcodes\nEffectively, the state in tests will be switched after creating and selecting the fork. \nThis allows a per-case configuration which is more flexible and allows for writing more specific tests.\nThis also enables testing more advanced scenarios like testing RPC adapters, cross-chain swaps etc. \n\n## Considered solutions\n\nFor the state to be considered as \"forked\", we have to swap the storage object \nto a one which reads/writes on data from the fork. This can be done in two ways:\n\n- Pulling the state from the fork eagerly (use a fork DB dump as storage, clone and use it for reading & writing)\n- Pulling the state from the fork lazily (read from fork on read request, cache locally, write state diffs to local cache)\n\nThe latter is preferred as the first is too heavy, inconsistent between node implementations, and generally \nunfeasible for fast testing.\n\n## Architecture\n\nAll things considered it's worth to implement the data fetching mechanism properly from the get-go, \nsince it's going to be usable in both forking approaches.\n\n### State-forking architecture\n\n![State forking architecture diagram](./state_forking_arch_diag.jpg)\n\n### Reading data from the fork\n\n![Read state flow diagram](./read_state_flow_diag.jpg)\n\n\n## Next steps\n\nIn order to make things simple and easy to review, we should approach implementing this iteratively, \nwhile considering future expansion. \n\n### MVP\n1. Implement fetching data (contracts, state, classes) utilizing a single worker utilizing `ForkDatabase` architecture\n2. Implement executing transaction on top of the forked state (should be able to modify the local state only)\n3. Implement user interface, enabling the forking in the tests\n\n### Further down the line\n4. Implement storing worker cache on disk, loading and clearing it\n5. Implement multifork, fetching utilizing multiple workers + controlling cheatcodes\n"
  },
  {
    "path": "design_documents/store_load_cheatcodes.md",
    "content": "# `store/load` Cheatcodes\n\n## Context\nPeople might want to manipulate the storage of contracts from the test context.\nFor example: we might want to modify the `authority` of the contract, without actually having an exposed endpoint in the contract, \nsince it might impose some security issues. Having the function, to modify the stored `authority` will allow to change it,\nwithout re-deploying the contract.\n\nAlso - some specific storage variables may not be exposed directly to the user via the contracts' interface, since it \nwould bloat the interface and would not be needed for anything but tests (which is generally an antipattern in programming).\n\n## Existing solutions\n\nThe [store](https://book.getfoundry.sh/cheatcodes/store) and [load](https://book.getfoundry.sh/cheatcodes/load) cheatcodes known from foundry,\nprovide the functionality to store and load memory in the VM for the given contract. \nHaving the correct format of data (conversion), is up to the user, since the interface accepts bytes, and returns bytes as well.\n\n\n## Proposed solution\n\nMy proposal would be to use the generated `contract_state_for_testing` and leverage it's typed structure, to \nenable the users to get the address of the variable, via the `<var_name>.address(<params>)` function, and \nimplement a `store/load` functions, which use the: \n- Contract address\n- Calculated variable address\n- Value (in case of `store`)\n\n## Caveats & pitfalls of the approach\n\n1. Constructing `contract_state_for_testing` to only calculate the address of the variable\n2. Implementing & importing `storage_access` for the objects we want to write (needs to be implemented anyway, just a bit inconvenient)\n\n## Example usage\n### Contract\n```cairo\n#[starknet::contract]\nmod HelloStarknet {\n    #[derive(starknet::Store)]\n    struct CustomStruct {\n        a: felt252,\n        b: felt252,\n    }\n\n    #[storage]\n    struct Storage {\n        balance: felt252, \n        map: LegacyMap<felt252, felt252>,\n        custom_struct: CustomStruct,\n    }\n}\n```\n### Test\n\n```cairo\nuse array::ArrayTrait;\nuse result::ResultTrait;\nuse option::OptionTrait;\nuse traits::TryInto;\nuse starknet::ContractAddress;\nuse starknet::Felt252TryIntoContractAddress;\n\nuse snforge_std::{ declare, ContractClassTrait, store, load };\n\nuse pkg::HelloStarknet;\nuse pkg::HelloStarknet::{balanceContractMemberStateTrait, CustomStruct};\n\nfn deploy_hello_contract() -> ContractAddress {\n    let contract_class = declare(\"HelloStarknet\");\n    contract_class.deploy(@array![]).unwrap()\n}\n\n#[test]\nfn test_felt252() {\n    let contract_address = deploy_hello_contract();\n    let state = HelloStarknet::contract_state_for_testing();\n    let variable_address = state.balance.address();\n    \n    let new_balance = 420;\n    store::<felt252>(contract_address, variable_address, new_balance);\n    let stored_value = load::<felt252>(contract_address, variable_address);\n    \n    assert(stored_value == 420, 'Wrong balance stored');    \n}\n\n#[test]\nfn test_legacy_map() {\n    let contract_address = deploy_hello_contract();\n    let state = HelloStarknet::contract_state_for_testing();\n    \n    \n    let key = 420;\n    let value = 69;\n    let variable_address = state.map.address(key);\n    \n    store::<felt252>(contract_address, variable_address, value);\n    let stored_value = load::<felt252>(contract_address, variable_address);\n    \n    assert(stored_value == 69, 'Wrong k:v stored');   \n}\n\n#[test]\nfn test_custom_struct() {\n    let contract_address = deploy_hello_contract();\n    let state = HelloStarknet::contract_state_for_testing();\n    \n    \n    let a = 420;\n    let b = 69;\n    let value = CustomStruct {a, b};\n    let variable_address = state.custom_struct.address();\n    \n    store::<CustomStruct>(contract_address, variable_address, value);\n    let stored_value = load::<CustomStruct>(contract_address, variable_address);\n    \n    assert(stored_value.a == 420, 'Wrong custom_struct.a stored');\n    assert(stored_value.b == 69, 'Wrong custom_struct.a stored');   \n}\n```\n"
  },
  {
    "path": "design_documents/template.md",
    "content": "# <TITLE>\n\n## Rationale of the solution \nProvide use cases of the feature and general motivation why it is worth implementing/was implemented. You can also include some \nexisting solutions.\n\n## User perspective description of the solution\nProvide only if documentation doesn't already exist and if the feature is user-facing. \nProvide an overview of the feature API from the user perspective. Consider it a draft documentation which you can later reuse as documentation.\n\n## Technical overview of the solution\nProvide a rough description of the feature implementation. Keep it high level. Try to include your mental model if possible.\nTry to include motivation behind non-obvious technical decisions. This is important so we don't have to rethink details and motivations it every time.\nIf something is an open question include it as well.\n\n\n## Implementation plan\nOptional - provide only if feature is not implemented and you have some steps in mind which you will take. Keep it high level!\n\n"
  },
  {
    "path": "design_documents/test_design.md",
    "content": "# Test design\n\n## Context\n\nCurrent test design in Starknet Forge has some issues:\n1. Gas estimation is problematic since we have to distinguish between pure Cairo gas\n(e.g., creating an array in test) and Starknet gas\n2. Starknet functions like `get_caller_address` and system calls like `library_call` are unavailable in tests directly \n3. Testing internal contract functions requires exposing them as `external`\n4. Operating on the contract execution layer while tests being pure Cairo code can create confusion\n\n## Goal\n\nPropose a solution of test design that solves most of the aforementioned issues.\n\n## Proposed Solution\n\nTests should be contracts (just like in the early days of Protostar).\nBasically, the code in test should behave as if it was a function called in an invoke transaction.\n\nSolutions to aforementioned problems:\n1. Since everything happens in the Starknet context now, we can just calculate the cost of the whole test. \n2. Starknet functions and system calls can be made available in tests directly since tests, being contracts, have their own states.\n3. See next [section](#testing-internal-functions).\n4. The confusion concerning what actually happens when using dispatchers is cleared: we just call another contract as if we were in an invoke transaction.\n\n## Testing internal functions\n\nWhen implementing contracts, a function called `contract_state_for_testing` is created just before compilation to Sierra/CASM, just like with dispatchers.\nIt can be used to obtain the state (storage) of the current (to be tested) contract. Since each test is a contract, now internal functions can be tested\nusing the storage of the test.\n\nFor example for a contract:\n\n```cairo\n#[starknet::contract]\nmod Contract {\n    #[storage]\n    struct Storage {\n        balance: felt252, \n        debt: felt252,\n    }\n    \n    //...\n    \n    #[generate_trait]\n    impl InternalImpl of InternalTrait {\n        fn internal_function(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n    }\n}\n```\n\nwe can set initial storage values (keep in mind it modifies the storage of the test) and call internal functions like this:\n\n```cairo\nuse pkg::HelloStarknet::balanceContractMemberStateTrait;\nuse pkg::HelloStarknet::debtContractMemberStateTrait;\n\n#[test]\nfn test_internal() {\n    let mut state = HelloStarknet::contract_state_for_testing();\n\n    state.balance.write(10);\n    state.debt.write(5);\n    \n    HelloStarknet::InternalImpl::internal_function(@state);\n}\n```\n\n## Concerns\n\nWe need to clearly communicate the changes to the users and explain to them that Starknet Forge is operating on\nexecution layer (in fact, account layer) rather than on transaction layer. We need to put an emphasis on the fact\nthat tests should be treated as if they were happening in an `invoke` transaction.\n"
  },
  {
    "path": "design_documents/transactional_testing/transactional_testing.md",
    "content": "# Transactional testing proposal\n\n## Context\n\nSome flows are not currently intuitively testable via standard testing methods, \nlike accounts logic (__validate__, __execute__ etc.), transaction rejections,\nfees, contract upgrade flows, and other e2e testing procedures.\n\n## Goal\n\nIn order to facilitate that, we should consider adding a way to test\nthe contracts in conditions as close to real networks conditions as possible.\n\nAlso, the goal is to make the deployments testable and validation \nof the deployments possible to the user. \n\nThe tests should be also runnable in a variety of environments, depending on the\nuse case (namely katana, devnet, or testnet). This would increase user's confidence\nin the release process.\n\n## Proposed solution\n\nWe could consider extending `cast script`, since the functionalities would overlap.\nThis could be considered as a variant of `cast script`, in a way. \n\nThe extending/differentiating factors would be:\n\n- Extra environment-specific functions (for [katana](https://book.dojoengine.org/toolchain/katana/reference.html#custom-methods)/[devnet](https://0xspaceshard.github.io/starknet-devnet/docs/dump-load-restart) - see docs)\n- Additional RPC functions support (receipts, etc.)\n- Test-like behavior (fail/pass)\n- Idempotent functions, for functionalities that can fail when double-running them (i.e. declare)\n\n\n## Solution architecture\n\n### High-level architecture\nThis is pretty straightforward. We ought to use the existing architecture for hint interception,\nprovide extra functionality via libraries (one for katana, second one for devnet, possibly more), and collect the cases from\nfolders using existing collecting logic. \n\nNote: Currently, the backend architecture between `cast script` and `forge test` is not common,\nand the following effort to implement this architecture should be preceded by making that solution.\n\n![txn_based_testing_arch.png](./txn_based_testing_arch.png)\n\n### E2E tests and scarb\n\nThe relation between scarb and the following tests is very much like in `cast script`:\n1. Scarb compiles the contracts\n2. The test scripts are compiled with foundry (until a plugin solution is available)\n3. The test uses artifacts from Ad. 1, runs program from Ad 2. on own VM with hint processing logic \n\n### File organization within scarb workspace\n\nEach package can have its own contract, so each package could have its own e2e directory, \nand the whole workspace could have it as well (to test it in integration).\nFor example:\n```\nproject/\n├── Scarb.toml\n├── e2e/\n│   ├── test_integration.cairo\n│   └── test_integration2.cairo\n├── pkg1/\n│   ├── src\n│   ├── test\n│   └── e2e/\n│       └── test_contract_1.cairo\n├── pkg2\n└── ...\n```\n## Solution analysis\n\n### Pros\n\n- Support of external tech (devnet, katana) via specialized libraries\n- Flow close to real starknet transactions, fees, testing how the protocol changes affect contracts\n- Ability to test accounts (__validate__, __execute__)\n- Ability to test real deployment/interaction scripts in environment close to real one\n\n### Cons\n- Keeping up the specialized libraries updated as tech adds new features/changes\n- Overall higher maintenance cost\n- Test execution speed significantly lower (depending on the used endpoints' throughput)\n- Dry-run mode from sncast scripts might be sufficient for some use cases (testing deployments)\n- Might be confusing to users if not communicated correctly\n\n\n## Usage examples\n1. Test transaction signing\n```rust\nfrom xxx_std import {deploy_account, deploy_contracts, end_txn, call, stark_curve, Transaction, TransactionStatus, Calldata, Call};  \nfrom xxx_devnet_extras import {set_time, dump};\n\nconst PREFUNDED_ADDRESS = 0x31231; // Set by the user, or generated inside the test\n\n#[devnet_test(url=localhost:3000)]\nfn test_signature_validation() {\n    let account_contract = deploy_account(\"OZAccount\", PREFUNDED_ADDRESS, );\n    let mock_contract = deploy_contract(\"MockContract\"); // The one that account is calling\n\n    let txn = Transaction(\n        version=2,      // Different versions could be supported\n        address=account_contract.address,\n        function=\"__execute__\", \n        calldata=Calldata::from_calls(array![Call(...), Call(...)])),\n        max_fee=100000,\n    );\n    \n    let signed_txn = stark_curve::sign(txn); // This would also be pluggable, for users to be able to sign with different curves\n    \n    set_time(123); // Set time for txn\n    let result = send_txn(signed_txn); // Synchronous\n    match result {\n        TransactionStatus::Rejected(data) => { /* assert failure data or gas */ },\n        TransactionStatus::Accepted(data) => { /* assert result data  or gas */ }\n    };\n    \n    let account_balance = call(\n        address=mock_contract.address, \n        function=\"get_balance\",\n        calldata=Calldata::from_calls(array![Call(...), Call(...)])\n    );\n    \n    assert(account_balance > ..., \"not correct balance\");\n    dump(); // Dump can be used for pre-populating your test environment\n}\n```\n\n## Alternative approaches\n\n### 1. Extending the deployment scripts\n\nWe could extend the concept of deployment scripts, adding more contextual info for deployment scripts and providing \nthe additional functions could work, but we would lack test-like behavior (pass/fail), and it could also be confusing\nfrom the point of user to use the deployment scripts in that way.\n\n\n### 2. Providing utilities to emulate transactional testing\n\nIt's similar to alternative 1, but rather than integrating those concepts into deployment scripts,\nwe could implement them into snforge itself.\nThis approach would include trying to include this kind of flow into the current tests.\nWe could provide utilities to test validation + execution in accounts, and/or add more cheatcodes which you'd use in the \nsaid scenarios only (submit_txn, call, etc.). This would make for more confusing flow, if not used correctly\n(lack of intuitive separation of concerns for std funcs).\n\n\n### 3. Providing extra library to a language instead for running those kinds of tests\nLet's say we do it in python:\nWe could develop a library which does all that, with python + starknet.py\nPros: \n- Running arbitrary code is easy\n- RPC methods already supported in starknet.py (less work to be done)\nCons:\n- Inconsistent codebase (have to include python tooling setup for tests)\n- No existing runner re-using (would have to integrate with pytest or something like that)\n\n## Scope for MVP\n\n- Basic test runner with collecting + workspaces support\n- Tests can interact with devnet via extra functions (i.e. `devnet_extras` library)\n- Tests are runnable on testnet/integration as well\n- We are able to run tests with fees and whole transaction flow (handling __validation__ failures, testing __execute__)\n\n## Next steps\n\n- Katana support\n- Predeployed accounts\n- \"Verify\" mode (run test on devnet, and then ignore special calls and run it on testnet)\n- Forking devnet/katana\n- Transaction-based profiling\n"
  },
  {
    "path": "docs/.gitignore",
    "content": "book\n"
  },
  {
    "path": "docs/README.md",
    "content": "# Starknet Foundry Book\n\n## Installation\n\nInstall mdBook\n\n<!-- TODO(#3970): Use latest version after resolving issue -->\n```shell\n$ cargo install mdbook@0.4.52\n```\n\nInstall necessary mdBook extensions\n\n```shell\n$ cargo install mdbook-linkcheck\n```\n\n<!-- TODO(#3970): Use latest version after resolving issue -->\n```shell\n$ cargo install mdbook-variables@0.3.0\n```\n\n## Building\n\n```shell\n$ mdbook build\n```\n\n## Open preview and reload on every change\n\n```shell\n$ mdbook serve\n```"
  },
  {
    "path": "docs/book.toml",
    "content": "[book]\nauthors = [\"Starknet Foundry\"]\nlanguage = \"en\"\nmultilingual = false\nsrc = \"src\"\ntitle = \"The Starknet Foundry Book\"\ndescription = \"Starknet Foundry is a toolchain for developing Starknet smart contracts. It helps with writing, deploying, and testing your smart contracts written in Cairo. It is inspired by Foundry.\"\n\n[output.linkcheck]\nwarning-policy = \"error\"\nfollow-web-links = true\ntraverse-parent-directories = false\nexclude = [\n    \"foundry-rs.github.io/starknet-foundry/snforge_std\",\n    \"foundry-rs.github.io/starknet-foundry/sncast_std\",\n    \"starknet-faucet.vercel.app\",\n    \"marketplace.visualstudio.com\"\n]\n\n[output.html]\ngit-repository-url = \"https://github.com/foundry-rs/starknet-foundry/\"\nedit-url-template = \"https://github.com/foundry-rs/starknet-foundry/edit/master/docs/{path}\"\nadditional-js = [\"count.js\", \"codeSnippets.js\"]\n\n[output.html.playground]\nrunnable = false\n\n[output.html.fold]\nenable = true\nlevel = 0\n\n[preprocessor.variables.variables]\nsnforge_std_version = \"0.59.0\"\nmatrix.partition = \"{{ matrix.partition }}\"\n"
  },
  {
    "path": "docs/codeSnippets.js",
    "content": "/**\n * Removes the initial prompt characters \"$ \" from the beginning of each line in a multiline string, if present.\n *\n * @param {string} text - The input string, potentially containing multiple lines with prompts at the beginning.\n * @returns {string} - The modified string with initial prompts removed from each line, or the original lines if no prompt is present.\n */\nfunction removePrompt(text) {\n    return text.split('\\n').map(line => {\n        if (line.startsWith(\"$ \")) {\n            return line.slice(2);\n        }\n        return line;\n    }).join('\\n');\n}\n\n\n// Overwrite the default `playground_text` function which is used to extract the code from a playground.\nfunction playground_text(playground, hidden = true) {\n    let code_block = playground.querySelector(\"code\");\n    \n    if (window.ace && code_block.classList.contains(\"editable\")) {\n        let editor = window.ace.edit(code_block);\n        return removePrompt(editor.getValue());\n    } else if (hidden) {\n        return removePrompt(code_block.textContent);\n    } else {\n        return removePrompt(code_block.innerText);\n    }\n}\n"
  },
  {
    "path": "docs/count.js",
    "content": "// GoatCounter: https://www.goatcounter.com\n// This file is released under the ISC license: https://opensource.org/licenses/ISC\n;(function() {\n    'use strict';\n\n    if (window.goatcounter && window.goatcounter.vars)  // Compatibility with very old version; do not use.\n        window.goatcounter = window.goatcounter.vars\n    else\n        window.goatcounter = window.goatcounter || {}\n\n    // Load settings from data-goatcounter-settings.\n    var s = document.querySelector('script[data-goatcounter]')\n    if (s && s.dataset.goatcounterSettings) {\n        try         { var set = JSON.parse(s.dataset.goatcounterSettings) }\n        catch (err) { console.error('invalid JSON in data-goatcounter-settings: ' + err) }\n        for (var k in set)\n            if (['no_onload', 'no_events', 'allow_local', 'allow_frame', 'path', 'title', 'referrer', 'event'].indexOf(k) > -1)\n                window.goatcounter[k] = set[k]\n    }\n\n    var enc = encodeURIComponent\n\n    // Get all data we're going to send off to the counter endpoint.\n    var get_data = function(vars) {\n        var data = {\n            p: (vars.path     === undefined ? goatcounter.path     : vars.path),\n            r: (vars.referrer === undefined ? goatcounter.referrer : vars.referrer),\n            t: (vars.title    === undefined ? goatcounter.title    : vars.title),\n            e: !!(vars.event || goatcounter.event),\n            s: [window.screen.width, window.screen.height, (window.devicePixelRatio || 1)],\n            b: is_bot(),\n            q: location.search,\n        }\n\n        var rcb, pcb, tcb  // Save callbacks to apply later.\n        if (typeof(data.r) === 'function') rcb = data.r\n        if (typeof(data.t) === 'function') tcb = data.t\n        if (typeof(data.p) === 'function') pcb = data.p\n\n        if (is_empty(data.r)) data.r = document.referrer\n        if (is_empty(data.t)) data.t = document.title\n        if (is_empty(data.p)) data.p = get_path()\n\n        if (rcb) data.r = rcb(data.r)\n        if (tcb) data.t = tcb(data.t)\n        if (pcb) data.p = pcb(data.p)\n        return data\n    }\n\n    // Check if a value is \"empty\" for the purpose of get_data().\n    var is_empty = function(v) { return v === null || v === undefined || typeof(v) === 'function' }\n\n    // See if this looks like a bot; there is some additional filtering on the\n    // backend, but these properties can't be fetched from there.\n    var is_bot = function() {\n        // Headless browsers are probably a bot.\n        var w = window, d = document\n        if (w.callPhantom || w._phantom || w.phantom)\n            return 150\n        if (w.__nightmare)\n            return 151\n        if (d.__selenium_unwrapped || d.__webdriver_evaluate || d.__driver_evaluate)\n            return 152\n        if (navigator.webdriver)\n            return 153\n        return 0\n    }\n\n    // Object to urlencoded string, starting with a ?.\n    var urlencode = function(obj) {\n        var p = []\n        for (var k in obj)\n            if (obj[k] !== '' && obj[k] !== null && obj[k] !== undefined && obj[k] !== false)\n                p.push(enc(k) + '=' + enc(obj[k]))\n        return '?' + p.join('&')\n    }\n\n    // Show a warning in the console.\n    var warn = function(msg) {\n        if (console && 'warn' in console)\n            console.warn('goatcounter: ' + msg)\n    }\n\n    // Get the endpoint to send requests to.\n    var get_endpoint = function() {\n        var s = document.querySelector('script[data-goatcounter]')\n        if (s && s.dataset.goatcounter)\n            return s.dataset.goatcounter\n        return (goatcounter.endpoint || window.counter)  // counter is for compat; don't use.\n    }\n\n    // Get current path.\n    var get_path = function() {\n        var loc = location,\n            c = document.querySelector('link[rel=\"canonical\"][href]')\n        if (c) {  // May be relative or point to different domain.\n            var a = document.createElement('a')\n            a.href = c.href\n            if (a.hostname.replace(/^www\\./, '') === location.hostname.replace(/^www\\./, ''))\n                loc = a\n        }\n        return (loc.pathname + loc.search) || '/'\n    }\n\n    // Run function after DOM is loaded.\n    var on_load = function(f) {\n        if (document.body === null)\n            document.addEventListener('DOMContentLoaded', function() { f() }, false)\n        else\n            f()\n    }\n\n    // Filter some requests that we (probably) don't want to count.\n    goatcounter.filter = function() {\n        if ('visibilityState' in document && document.visibilityState === 'prerender')\n            return 'visibilityState'\n        if (!goatcounter.allow_frame && location !== parent.location)\n            return 'frame'\n        if (!goatcounter.allow_local && location.hostname.match(/(localhost$|^127\\.|^10\\.|^172\\.(1[6-9]|2[0-9]|3[0-1])\\.|^192\\.168\\.|^0\\.0\\.0\\.0$)/))\n            return 'localhost'\n        if (!goatcounter.allow_local && location.protocol === 'file:')\n            return 'localfile'\n        if (localStorage && localStorage.getItem('skipgc') === 't')\n            return 'disabled with #toggle-goatcounter'\n        return false\n    }\n\n    // Get URL to send to GoatCounter.\n    window.goatcounter.url = function(vars) {\n        var data = get_data(vars || {})\n        if (data.p === null)  // null from user callback.\n            return\n        data.rnd = Math.random().toString(36).substr(2, 5)  // Browsers don't always listen to Cache-Control.\n\n        var endpoint = get_endpoint()\n        if (!endpoint)\n            return warn('no endpoint found')\n\n        return endpoint + urlencode(data)\n    }\n\n    // Count a hit.\n    window.goatcounter.count = function(vars) {\n        var f = goatcounter.filter()\n        if (f)\n            return warn('not counting because of: ' + f)\n        var url = goatcounter.url(vars)\n        if (!url)\n            return warn('not counting because path callback returned null')\n\n        if (!navigator.sendBeacon(url)) {\n            // This mostly fails due to being blocked by CSP; try again with an\n            // image-based fallback.\n            var img = document.createElement('img')\n            img.src = url\n            img.style.position = 'absolute'  // Affect layout less.\n            img.style.bottom = '0px'\n            img.style.width = '1px'\n            img.style.height = '1px'\n            img.loading = 'eager'\n            img.setAttribute('alt', '')\n            img.setAttribute('aria-hidden', 'true')\n\n            var rm = function() { if (img && img.parentNode) img.parentNode.removeChild(img) }\n            img.addEventListener('load', rm, false)\n            document.body.appendChild(img)\n        }\n    }\n\n    // Get a query parameter.\n    window.goatcounter.get_query = function(name) {\n        var s = location.search.substr(1).split('&')\n        for (var i = 0; i < s.length; i++)\n            if (s[i].toLowerCase().indexOf(name.toLowerCase() + '=') === 0)\n                return s[i].substr(name.length + 1)\n    }\n\n    // Track click events.\n    window.goatcounter.bind_events = function() {\n        if (!document.querySelectorAll)  // Just in case someone uses an ancient browser.\n            return\n\n        var send = function(elem) {\n            return function() {\n                goatcounter.count({\n                    event:    true,\n                    path:     (elem.dataset.goatcounterClick || elem.name || elem.id || ''),\n                    title:    (elem.dataset.goatcounterTitle || elem.title || (elem.innerHTML || '').substr(0, 200) || ''),\n                    referrer: (elem.dataset.goatcounterReferrer || elem.dataset.goatcounterReferral || ''),\n                })\n            }\n        }\n\n        Array.prototype.slice.call(document.querySelectorAll(\"*[data-goatcounter-click]\")).forEach(function(elem) {\n            if (elem.dataset.goatcounterBound)\n                return\n            var f = send(elem)\n            elem.addEventListener('click', f, false)\n            elem.addEventListener('auxclick', f, false)  // Middle click.\n            elem.dataset.goatcounterBound = 'true'\n        })\n    }\n\n    // Add a \"visitor counter\" frame or image.\n    window.goatcounter.visit_count = function(opt) {\n        on_load(function() {\n            opt        = opt        || {}\n            opt.type   = opt.type   || 'html'\n            opt.append = opt.append || 'body'\n            opt.path   = opt.path   || get_path()\n            opt.attr   = opt.attr   || {width: '200', height: (opt.no_branding ? '60' : '80')}\n\n            opt.attr['src'] = get_endpoint() + 'er/' + enc(opt.path) + '.' + enc(opt.type) + '?'\n            if (opt.no_branding) opt.attr['src'] += '&no_branding=1'\n            if (opt.style)       opt.attr['src'] += '&style=' + enc(opt.style)\n            if (opt.start)       opt.attr['src'] += '&start=' + enc(opt.start)\n            if (opt.end)         opt.attr['src'] += '&end='   + enc(opt.end)\n\n            var tag = {png: 'img', svg: 'img', html: 'iframe'}[opt.type]\n            if (!tag)\n                return warn('visit_count: unknown type: ' + opt.type)\n\n            if (opt.type === 'html') {\n                opt.attr['frameborder'] = '0'\n                opt.attr['scrolling']   = 'no'\n            }\n\n            var d = document.createElement(tag)\n            for (var k in opt.attr)\n                d.setAttribute(k, opt.attr[k])\n\n            var p = document.querySelector(opt.append)\n            if (!p)\n                return warn('visit_count: append not found: ' + opt.append)\n            p.appendChild(d)\n        })\n    }\n\n    // Make it easy to skip your own views.\n    if (location.hash === '#toggle-goatcounter') {\n        if (localStorage.getItem('skipgc') === 't') {\n            localStorage.removeItem('skipgc', 't')\n            alert('GoatCounter tracking is now ENABLED in this browser.')\n        }\n        else {\n            localStorage.setItem('skipgc', 't')\n            alert('GoatCounter tracking is now DISABLED in this browser until ' + location + ' is loaded again.')\n        }\n    }\n\n    if (!goatcounter.no_onload)\n        on_load(function() {\n            // 1. Page is visible, count request.\n            // 2. Page is not yet visible; wait until it switches to 'visible' and count.\n            // See #487\n            if (!('visibilityState' in document) || document.visibilityState === 'visible')\n                goatcounter.count()\n            else {\n                var f = function(e) {\n                    if (document.visibilityState !== 'visible')\n                        return\n                    document.removeEventListener('visibilitychange', f)\n                    goatcounter.count()\n                }\n                document.addEventListener('visibilitychange', f)\n            }\n\n            if (!goatcounter.no_events)\n                goatcounter.bind_events()\n        })\n})();\n"
  },
  {
    "path": "docs/example_workflows/basic_workflow.yml",
    "content": "name: My workflow\non:\n  push:\n  pull_request:\njobs:\n  check:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n\n      - name: Setup Starknet Foundry\n        uses: foundry-rs/setup-snfoundry@v3\n\n      - name: Setup Scarb\n        uses: software-mansion/setup-scarb@v1\n        with:\n          scarb-lock: ./hello_starknet/Scarb.lock\n\n      - name: Run tests\n        run: cd hello_starknet && snforge test\n"
  },
  {
    "path": "docs/example_workflows/partitioned_workflow.yml",
    "content": "name: My workflow\n\non:\n  push:\n  pull_request:\n\njobs:\n  check:\n    runs-on: ubuntu-latest\n    strategy:\n      fail-fast: false\n      matrix:\n        partition: [ 1, 2, 3, 4 ]\n    steps:\n      - uses: actions/checkout@v4\n\n      - name: Setup Starknet Foundry\n        uses: foundry-rs/setup-snfoundry@v3\n\n      - name: Setup Scarb\n        uses: software-mansion/setup-scarb@v1\n        with:\n          scarb-lock: ./hello_starknet/Scarb.lock\n\n      - name: Run tests\n        run: |\n          cd hello_starknet\n          snforge test --partition '${{ matrix.partition }}/4'\n"
  },
  {
    "path": "docs/listings/basic_example/Scarb.toml",
    "content": "[package]\nname = \"basic_example\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html\n\n[dependencies]\nstarknet = \"2.8.5\"\nsnforge_std = { path = \"../../../snforge_std\" }\nsncast_std = { path = \"../../../sncast_std\" }\n\n[[target.lib]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/basic_example/src/basic_example.cairo",
    "content": "use sncast_std::call;\n\n// A real contract deployed on Sepolia network\nconst CONTRACT_ADDRESS: felt252 =\n    0x07e867f1fa6da2108dd2b3d534f1fbec411c5ec9504eb3baa1e49c7a0bef5ab5;\n\nfn main() {\n    let call_result = call(\n        CONTRACT_ADDRESS.try_into().unwrap(), selector!(\"get_greeting\"), array![],\n    )\n        .expect('call failed');\n\n    assert(*call_result.data[1] == 'Hello, Starknet!', *call_result.data[1]);\n\n    println!(\"{:?}\", call_result);\n}\n"
  },
  {
    "path": "docs/listings/basic_example/src/lib.cairo",
    "content": "mod basic_example;\n"
  },
  {
    "path": "docs/listings/call/Scarb.toml",
    "content": "[package]\nname = \"call\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\nsncast_std = { path = \"../../../sncast_std\" }\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.lib]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/call/src/lib.cairo",
    "content": "use sncast_std::call;\nuse starknet::ContractAddress;\n\nfn main() {\n    let contract_address: ContractAddress =\n        0x1e52f6ebc3e594d2a6dc2a0d7d193cb50144cfdfb7fdd9519135c29b67e427\n        .try_into()\n        .expect('Invalid contract address value');\n\n    let result = call(contract_address, selector!(\"get\"), array![0x1]).expect('call failed');\n\n    println!(\"call result: {}\", result);\n    println!(\"debug call result: {:?}\", result);\n}\n"
  },
  {
    "path": "docs/listings/cheatcodes_reference/Scarb.toml",
    "content": "[package]\nname = \"cheatcodes_reference\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.12.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.starknet-contract]]\n"
  },
  {
    "path": "docs/listings/cheatcodes_reference/src/l1_handler_example.cairo",
    "content": "#[starknet::contract]\nmod L1HandlerExample {\n    #[storage]\n    struct Storage {}\n\n    #[l1_handler]\n    fn handle_l1_message(ref self: ContractState, from_address: felt252, numbers: Array<felt252>) {\n        assert!(from_address == 0x123456789012345678901234567890123456789, \"Unexpected address\");\n        assert!(numbers.len() == 3, \"Expected exactly 3 numbers\");\n    }\n}\n"
  },
  {
    "path": "docs/listings/cheatcodes_reference/src/lib.cairo",
    "content": "pub mod l1_handler_example;\npub mod mock_call_example;\n"
  },
  {
    "path": "docs/listings/cheatcodes_reference/src/mock_call_example.cairo",
    "content": "#[derive(Copy, Debug, Drop, Serde, starknet::Store)]\npub struct Product {\n    pub name: felt252,\n    pub price: u64,\n    pub quantity: u64,\n}\n\n#[starknet::interface]\npub trait IShoppingCart<TContractState> {\n    fn get_products(self: @TContractState) -> Array<Product>;\n}\n\n#[starknet::contract]\npub mod ShoppingCart {\n    use starknet::storage::{MutableVecTrait, StoragePointerReadAccess, Vec, VecTrait};\n    use super::Product;\n\n    #[storage]\n    struct Storage {\n        products: Vec<Product>,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState, initial_products: Array<Product>) {\n        for product in initial_products {\n            self.products.push(product);\n        }\n    }\n\n    #[abi(embed_v0)]\n    impl ShoppingCartImpl of super::IShoppingCart<ContractState> {\n        fn get_products(self: @ContractState) -> Array<Product> {\n            let mut products = array![];\n            for i in 0..self.products.len() {\n                products.append(self.products.at(i).read());\n            }\n            products\n        }\n    }\n}\n"
  },
  {
    "path": "docs/listings/cheatcodes_reference/tests/test_l1_handler.cairo",
    "content": "use snforge_std::cheatcodes::contract_class::DeclareResultTrait;\nuse snforge_std::{ContractClassTrait, L1HandlerTrait, declare};\n\n#[test]\nfn test_l1_handler() {\n    // 1. Declare and deploy the Starknet contract\n    let example_contract = declare(\"L1HandlerExample\").unwrap().contract_class();\n    let (contract_address, _) = example_contract.deploy(@array![]).unwrap();\n\n    // 2. Define the L1 handler to be called\n    let l1_handler = L1HandlerTrait::new(contract_address, selector!(\"handle_l1_message\"));\n\n    // 3. Define Ethereum address of the message sender\n    let eth_address = 0x123456789012345678901234567890123456789;\n\n    // 4. The payload to be sent to the L1 handler\n    let payload = array![1, 2, 3];\n    let mut serialized_payload = array![];\n    payload.serialize(ref serialized_payload);\n\n    // 5. Execute the L1 handler with the Ethereum address and payload\n    // This will trigger the `handle_l1_message` function of the contract\n    l1_handler.execute(eth_address, serialized_payload.span()).unwrap();\n}\n"
  },
  {
    "path": "docs/listings/cheatcodes_reference/tests/test_mock_call.cairo",
    "content": "use cheatcodes_reference::mock_call_example::{\n    IShoppingCartDispatcher, IShoppingCartDispatcherTrait, Product,\n};\nuse snforge_std::{ContractClassTrait, DeclareResultTrait, declare, start_mock_call, stop_mock_call};\n\n#[test]\nfn test_mock_call() {\n    // 1. Create calldata for the contract deployment\n    let mut calldata = ArrayTrait::new();\n\n    // 2. Serialize initial products (in this case an empty array)\n    let initial_products: Array<Product> = array![];\n    initial_products.serialize(ref calldata);\n\n    // 3. Declare and deploy the ShoppingCart contract\n    let contract = declare(\"ShoppingCart\").unwrap().contract_class();\n    let (contract_address, _) = contract.deploy(@calldata).unwrap();\n\n    // 4. Create an instance of the dispatcher\n    let dispatcher = IShoppingCartDispatcher { contract_address };\n\n    // 5. Mock the returned value of the `get_products` function\n    let mock_products = array![\n        Product { name: 'Banana', price: 2, quantity: 5 },\n        Product { name: 'Apple', price: 3, quantity: 10 },\n    ];\n\n    // 6. Start the mock call with the mocked products\n    start_mock_call(contract_address, selector!(\"get_products\"), mock_products);\n\n    // 7. Call the `get_products` function through the dispatcher\n    let retrieved_products: Array<Product> = dispatcher.get_products();\n\n    // 8. Verify the retrieved products\n    let product_0 = retrieved_products.at(0);\n    assert(*product_0.name == 'Banana', 'product_0.name');\n    assert(*product_0.price == 2, 'product_0.price');\n    assert(*product_0.quantity == 5, 'product_0.quantity');\n\n    let product_1 = retrieved_products.at(1);\n    assert(*product_1.name == 'Apple', 'product_1.name');\n    assert(*product_1.price == 3, 'product_1.price');\n    assert(*product_1.quantity == 10, 'product_1.quantity');\n\n    // 9. Stop the mock call\n    stop_mock_call(contract_address, selector!(\"get_products\"));\n}\n"
  },
  {
    "path": "docs/listings/declare/Scarb.toml",
    "content": "[package]\nname = \"declare\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\nsncast_std = { path = \"../../../sncast_std\" }\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[[target.lib]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/declare/src/lib.cairo",
    "content": "use sncast_std::{FeeSettingsTrait, declare};\n\nfn main() {\n    let fee_settings = FeeSettingsTrait::max_fee(9999999);\n\n    let result = declare(\"HelloStarknet\", fee_settings, Option::None).expect('declare failed');\n\n    println!(\"declare result: {}\", result);\n    println!(\"debug declare result: {:?}\", result);\n}\n"
  },
  {
    "path": "docs/listings/deploy/Scarb.toml",
    "content": "[package]\nname = \"deploy\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\nsncast_std = { path = \"../../../sncast_std\" }\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.lib]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/deploy/src/lib.cairo",
    "content": "use sncast_std::{FeeSettingsTrait, deploy};\nuse starknet::ClassHash;\n\nfn main() {\n    let fee_settings = FeeSettingsTrait::max_fee(9999999);\n    let salt = 0x1;\n    let nonce = 0x1;\n\n    let class_hash: ClassHash = 0x03a8b191831033ba48ee176d5dde7088e71c853002b02a1cfa5a760aa98be046\n        .try_into()\n        .expect('Invalid class hash value');\n\n    let result = deploy(\n        class_hash, ArrayTrait::new(), Option::Some(salt), true, fee_settings, Option::Some(nonce),\n    )\n        .expect('deploy failed');\n\n    println!(\"deploy result: {}\", result);\n    println!(\"debug deploy result: {:?}\", result);\n}\n"
  },
  {
    "path": "docs/listings/deployment_with_constructor_args/Scarb.toml",
    "content": "[package]\nname = \"deployment_with_constructor_args\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.12.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\nassert_macros = \"2.12.0\"\n\n[[target.starknet-contract]]\n"
  },
  {
    "path": "docs/listings/deployment_with_constructor_args/src/lib.cairo",
    "content": "#[derive(Copy, Debug, Drop, Serde, starknet::Store)]\npub struct Product {\n    pub name: felt252,\n    pub price: u64,\n    pub quantity: u64,\n}\n\n#[starknet::interface]\npub trait IShoppingCart<TContractState> {\n    fn get_products(self: @TContractState) -> Array<Product>;\n}\n\n#[starknet::contract]\npub mod ShoppingCart {\n    use starknet::storage::{MutableVecTrait, StoragePointerReadAccess, Vec, VecTrait};\n    use super::Product;\n\n    #[storage]\n    struct Storage {\n        products: Vec<Product>,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState, initial_products: Array<Product>) {\n        for product in initial_products {\n            self.products.push(product);\n        }\n    }\n\n\n    #[abi(embed_v0)]\n    impl ShoppingCartImpl of super::IShoppingCart<ContractState> {\n        fn get_products(self: @ContractState) -> Array<Product> {\n            let mut products = array![];\n            for i in 0..self.products.len() {\n                products.append(self.products.at(i).read());\n            }\n            products\n        }\n    }\n}\n"
  },
  {
    "path": "docs/listings/deployment_with_constructor_args/tests/test_with_deploy_for_test.cairo",
    "content": "use deployment_with_constructor_args::Product;\nuse deployment_with_constructor_args::ShoppingCart::deploy_for_test;\nuse snforge_std::{DeclareResult, DeclareResultTrait, declare};\nuse starknet::deployment::DeploymentParams;\nuse starknet::storage::StorableStoragePointerReadAccess;\n\n#[test]\nfn test_initial_cart_non_empty_with_deploy_for_test() {\n    // 1. Declare contract\n    let declare_result: DeclareResult = declare(\"ShoppingCart\").unwrap();\n    let class_hash = declare_result.contract_class().class_hash;\n\n    // 2. Create deployment parameters\n    let deployment_params = DeploymentParams { salt: 0, deploy_from_zero: true };\n\n    // 3. Create initial products\n    let initial_products = array![\n        Product { name: 'Bread', price: 5, quantity: 2 },\n        Product { name: 'Milk', price: 2, quantity: 4 },\n        Product { name: 'Eggs', price: 3, quantity: 12 },\n    ];\n\n    // 4. Use `deploy_for_test` to deploy the contract\n    // It automatically handles serialization of constructor parameters\n    let (_contract_address, _) = deploy_for_test(*class_hash, deployment_params, initial_products)\n        .expect('Deployment failed');\n}\n"
  },
  {
    "path": "docs/listings/deployment_with_constructor_args/tests/test_with_serialization.cairo",
    "content": "use deployment_with_constructor_args::Product;\nuse snforge_std::{ContractClassTrait, DeclareResult, DeclareResultTrait, declare};\nuse starknet::storage::StorableStoragePointerReadAccess;\n\n\n#[test]\nfn test_initial_cart_non_empty_with_serialization() {\n    // 1. Declare contract\n    let declare_result: DeclareResult = declare(\"ShoppingCart\").unwrap();\n    let contract = declare_result.contract_class();\n\n    // 2. Create deployment parameters\n    let initial_products = array![\n        Product { name: 'Bread', price: 5, quantity: 2 },\n        Product { name: 'Milk', price: 2, quantity: 4 },\n        Product { name: 'Eggs', price: 3, quantity: 12 },\n    ];\n\n    // 3. Create calldata\n    let mut calldata = ArrayTrait::new();\n\n    // 4. Serialize initial products\n    initial_products.serialize(ref calldata);\n\n    // 5. Deploy the contract\n    let (_contract_address, _) = contract.deploy(@calldata).unwrap();\n}\n"
  },
  {
    "path": "docs/listings/detailed_resources_example/Scarb.toml",
    "content": "[package]\nname = \"detailed_resources_example\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html\n\n[dependencies]\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/detailed_resources_example/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait IHelloStarknet<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n}\n\n#[starknet::contract]\nmod HelloStarknet {\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl HelloStarknetImpl of super::IHelloStarknet<ContractState> {\n        fn increase_balance(ref self: ContractState, amount: felt252) {\n            assert(amount != 0, 'Amount cannot be 0');\n            self.balance.write(self.balance.read() + amount);\n        }\n\n        fn get_balance(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n    }\n}\n"
  },
  {
    "path": "docs/listings/detailed_resources_example/tests/test_contract.cairo",
    "content": "#[test]\nfn test_abc() {\n    assert(1 == 1, 1);\n}\n\n#[test]\nfn test_failing() {\n    assert(1 == 2, 'failing check');\n}\n\n#[test]\nfn test_xyz() {\n    assert(1 == 1, 1);\n}\n\n"
  },
  {
    "path": "docs/listings/direct_storage_access/Scarb.toml",
    "content": "[package]\nname = \"direct_storage_access\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\nassert_macros = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/direct_storage_access/src/complex_structures.cairo",
    "content": "use core::hash::LegacyHash;\n\n// Required for lookup of complex_mapping values\n// This is consistent with `map_entry_address`, which uses pedersen hashing of keys\nimpl StructuredKeyHash of LegacyHash<MapKey> {\n    fn hash(state: felt252, value: MapKey) -> felt252 {\n        let state = LegacyHash::<felt252>::hash(state, value.a);\n        LegacyHash::<felt252>::hash(state, value.b)\n    }\n}\n\n#[derive(Copy, Drop, Serde)]\npub struct MapKey {\n    pub a: felt252,\n    pub b: felt252,\n}\n\n// Serialization of keys and values with `Serde` to make usage of `map_entry_address` easier\nimpl MapKeyIntoSpan of Into<MapKey, Span<felt252>> {\n    fn into(self: MapKey) -> Span<felt252> {\n        let mut serialized_struct: Array<felt252> = array![];\n        self.serialize(ref serialized_struct);\n        serialized_struct.span()\n    }\n}\n\n#[derive(Copy, Drop, Serde, starknet::Store)]\npub struct MapValue {\n    pub a: felt252,\n    pub b: felt252,\n}\n\nimpl MapValueIntoSpan of Into<MapValue, Span<felt252>> {\n    fn into(self: MapValue) -> Span<felt252> {\n        let mut serialized_struct: Array<felt252> = array![];\n        self.serialize(ref serialized_struct);\n        serialized_struct.span()\n    }\n}\n\n#[starknet::interface]\npub trait IComplexStorageContract<TContractState> {}\n\n#[starknet::contract]\nmod ComplexStorageContract {\n    use starknet::storage::Map;\n    use super::{MapKey, MapValue};\n\n    #[storage]\n    struct Storage {\n        complex_mapping: Map<MapKey, MapValue>,\n    }\n}\n"
  },
  {
    "path": "docs/listings/direct_storage_access/src/felts_only.cairo",
    "content": "#[starknet::interface]\npub trait ISimpleStorageContract<TState> {\n    fn get_value(self: @TState, key: felt252) -> felt252;\n}\n\n#[starknet::contract]\npub mod SimpleStorageContract {\n    use starknet::storage::{\n        Map, StorageMapReadAccess, StorageMapWriteAccess, StoragePointerWriteAccess,\n    };\n\n    #[storage]\n    struct Storage {\n        plain_felt: felt252,\n        mapping: Map<felt252, felt252>,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState) {\n        self.plain_felt.write(0x2137_felt252);\n        self.mapping.write('some_key', 'some_value');\n    }\n\n    #[external(v0)]\n    pub fn get_value(self: @ContractState, key: felt252) -> felt252 {\n        self.mapping.read(key)\n    }\n}\n"
  },
  {
    "path": "docs/listings/direct_storage_access/src/lib.cairo",
    "content": "pub mod complex_structures;\npub mod felts_only;\npub mod using_enums;\n"
  },
  {
    "path": "docs/listings/direct_storage_access/src/using_enums.cairo",
    "content": "#[starknet::interface]\npub trait IEnumsStorageContract<TContractState> {\n    fn read_value(self: @TContractState, key: u256) -> Option<u256>;\n}\n\n#[starknet::contract]\npub mod EnumsStorageContract {\n    use starknet::storage::{Map, StoragePathEntry, StoragePointerReadAccess};\n\n    #[storage]\n    struct Storage {\n        example_storage: Map<u256, Option<u256>>,\n    }\n\n    #[abi(embed_v0)]\n    impl EnumsStorageContractImpl of super::IEnumsStorageContract<ContractState> {\n        fn read_value(self: @ContractState, key: u256) -> Option<u256> {\n            self.example_storage.entry(key).read()\n        }\n    }\n}\n"
  },
  {
    "path": "docs/listings/direct_storage_access/tests/complex_structures.cairo",
    "content": "use direct_storage_access::complex_structures::{MapKey, MapValue};\nuse snforge_std::{ContractClassTrait, DeclareResultTrait, declare, load, map_entry_address, store};\n\n#[test]\nfn store_in_complex_mapping() {\n    let (contract_address, _) = declare(\"ComplexStorageContract\")\n        .unwrap()\n        .contract_class()\n        .deploy(@array![])\n        .unwrap();\n\n    let k = MapKey { a: 111, b: 222 };\n    let v = MapValue { a: 123, b: 456 };\n\n    store(\n        contract_address,\n        map_entry_address( // uses Pedersen hashing under the hood for address calculation\n            selector!(\"mapping\"), // storage variable name\n            k.into() // map key\n        ),\n        v.into(),\n    );\n\n    // complex_mapping = {\n    //     hash(k): 123,\n    //     hash(k) + 1: 456\n    //     ...\n    // }\n\n    let loaded = load(contract_address, map_entry_address(selector!(\"mapping\"), k.into()), 2);\n\n    assert_eq!(loaded, array![123, 456]);\n}\n"
  },
  {
    "path": "docs/listings/direct_storage_access/tests/felts_only/field.cairo",
    "content": "use snforge_std::{ContractClassTrait, DeclareResultTrait, declare, load, map_entry_address, store};\n\n#[test]\nfn test_store_and_load_plain_felt() {\n    let (contract_address, _) = declare(\"SimpleStorageContract\")\n        .unwrap()\n        .contract_class()\n        .deploy(@array![])\n        .unwrap();\n\n    // load existing value from storage\n    let loaded = load(\n        contract_address, // an existing contract which owns the storage\n        selector!(\"plain_felt\"), // field marking the start of the memory chunk being read from\n        1 // length of the memory chunk (seen as an array of felts) to read\n    );\n\n    assert_eq!(loaded, array![0x2137_felt252]);\n\n    // overwrite it with a new value\n    store(\n        contract_address, // storage owner\n        selector!(\"plain_felt\"), // field marking the start of the memory chunk being written to\n        array![420].span() // array of felts to write\n    );\n\n    // load again and check if it changed\n    let loaded = load(contract_address, selector!(\"plain_felt\"), 1);\n    assert_eq!(loaded, array![420]);\n}\n"
  },
  {
    "path": "docs/listings/direct_storage_access/tests/felts_only/map_entry.cairo",
    "content": "use snforge_std::{ContractClassTrait, DeclareResultTrait, declare, load, map_entry_address, store};\n\n#[test]\nfn test_store_and_load_map_entries() {\n    let (contract_address, _) = declare(\"SimpleStorageContract\")\n        .unwrap()\n        .contract_class()\n        .deploy(@array![])\n        .unwrap();\n\n    // load an existing map entry\n    let loaded = load(\n        contract_address,\n        map_entry_address(\n            selector!(\"mapping\"), // start of the read memory chunk\n            array!['some_key'].span() // map key\n        ),\n        1 // length of the read memory chunk\n    );\n\n    assert_eq!(loaded, array!['some_value']);\n\n    // write other value in place of the previous one\n    store(\n        contract_address,\n        map_entry_address(\n            selector!(\"mapping\"), // storage variable name\n            array!['some_key'].span() // map key\n        ),\n        array!['some_other_value'].span(),\n    );\n\n    let loaded = load(\n        contract_address,\n        map_entry_address(\n            selector!(\"mapping\"), // start of the read memory chunk\n            array!['some_key'].span() // map key\n        ),\n        1 // length of the read memory chunk\n    );\n\n    assert_eq!(loaded, array!['some_other_value']);\n\n    // load value written under non-existing key\n    let loaded = load(\n        contract_address,\n        map_entry_address(selector!(\"mapping\"), array!['non_existing_field'].span()),\n        1,\n    );\n\n    assert_eq!(loaded, array![0]);\n}\n"
  },
  {
    "path": "docs/listings/direct_storage_access/tests/felts_only.cairo",
    "content": "pub mod field;\npub mod map_entry;\n"
  },
  {
    "path": "docs/listings/direct_storage_access/tests/lib.cairo",
    "content": "pub mod complex_structures;\npub mod felts_only;\npub mod storage_address;\npub mod using_enums;\npub mod using_storage_address_from_base;\n"
  },
  {
    "path": "docs/listings/direct_storage_access/tests/storage_address.cairo",
    "content": "\n"
  },
  {
    "path": "docs/listings/direct_storage_access/tests/using_enums.cairo",
    "content": "use direct_storage_access::using_enums::{\n    IEnumsStorageContractSafeDispatcher, IEnumsStorageContractSafeDispatcherTrait,\n};\nuse snforge_std::{ContractClassTrait, DeclareResultTrait, declare, load, map_entry_address, store};\nuse starknet::ContractAddress;\n\nfn deploy_contract(name: ByteArray) -> ContractAddress {\n    let contract = declare(name).unwrap().contract_class();\n    let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n    contract_address\n}\n\n\n#[test]\nfn test_store_and_read() {\n    let contract_address = deploy_contract(\"EnumsStorageContract\");\n    let safe_dispatcher = IEnumsStorageContractSafeDispatcher { contract_address };\n\n    let mut keys = ArrayTrait::new();\n    let key: u256 = 1;\n    key.serialize(ref keys);\n\n    let value: Option<u256> = Option::Some((100));\n    let felt_value: felt252 = value.unwrap().try_into().unwrap();\n\n    // Serialize Option enum according to its 1-based storage layout\n    let serialized_value = array![1, felt_value];\n\n    let storage_address = map_entry_address(selector!(\"example_storage\"), keys.span());\n\n    store(\n        target: contract_address,\n        storage_address: storage_address,\n        serialized_value: serialized_value.span(),\n    );\n\n    let read_value = safe_dispatcher.read_value(key).expect('Failed to read value');\n\n    assert_eq!(read_value, value);\n}\n\n"
  },
  {
    "path": "docs/listings/direct_storage_access/tests/using_storage_address_from_base.cairo",
    "content": "use direct_storage_access::felts_only::{\n    ISimpleStorageContractDispatcher, ISimpleStorageContractDispatcherTrait, SimpleStorageContract,\n};\nuse snforge_std::{ContractClassTrait, DeclareResultTrait, declare, load, store};\nuse starknet::storage::{StorageAsPointer, StoragePathEntry};\nuse starknet::storage_access::storage_address_from_base;\n\n#[test]\nfn update_mapping() {\n    let key = 0;\n    let data = 100;\n    let (contract_address, _) = declare(\"SimpleStorageContract\")\n        .unwrap()\n        .contract_class()\n        .deploy(@array![])\n        .unwrap();\n    let dispatcher = ISimpleStorageContractDispatcher { contract_address };\n    let mut state = SimpleStorageContract::contract_state_for_testing();\n\n    let storage_address = storage_address_from_base(\n        state.mapping.entry(key).as_ptr().__storage_pointer_address__.into(),\n    );\n    let storage_value: Span<felt252> = array![data.into()].span();\n    store(contract_address, storage_address.into(), storage_value);\n\n    let read_data = dispatcher.get_value(key.into());\n    assert_eq!(read_data, data, \"Storage update failed\")\n}\n"
  },
  {
    "path": "docs/listings/error_handling/Scarb.toml",
    "content": "[package]\nname = \"error_handling\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html\n\n[dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\nsncast_std = { path = \"../../../sncast_std\" }\nstarknet = \"2.8.5\"\nassert_macros = \"2.8.5\"\n\n[[target.lib]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/error_handling/src/error_handling.cairo",
    "content": "use sncast_std::call;\n\n// Some nonexistent contract\nconst CONTRACT_ADDRESS: felt252 = 0x2137;\n\nfn main() {\n    // This call fails\n    let call_result = call(\n        CONTRACT_ADDRESS.try_into().unwrap(), selector!(\"get_greeting\"), array![],\n    );\n\n    // Make some assertion\n    assert!(call_result.is_err());\n\n    // Print the result error\n    println!(\"Received error: {:?}\", call_result.unwrap_err());\n}\n"
  },
  {
    "path": "docs/listings/error_handling/src/lib.cairo",
    "content": "mod error_handling;\n"
  },
  {
    "path": "docs/listings/failing_example/Scarb.toml",
    "content": "[package]\nname = \"failing_example\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html\n\n[dependencies]\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/failing_example/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait IHelloStarknet<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n}\n\n#[starknet::contract]\nmod HelloStarknet {\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl HelloStarknetImpl of super::IHelloStarknet<ContractState> {\n        fn increase_balance(ref self: ContractState, amount: felt252) {\n            assert(amount != 0, 'Amount cannot be 0');\n            self.balance.write(self.balance.read() + amount);\n        }\n\n        fn get_balance(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n    }\n}\n"
  },
  {
    "path": "docs/listings/failing_example/tests/lib.cairo",
    "content": "#[test]\nfn test_abc() {\n    assert(1 == 1, 1);\n}\n\n#[test]\nfn test_failing() {\n    assert(1 == 2, 'failing check');\n}\n\n#[test]\nfn test_xyz() {\n    assert(1 == 1, 1);\n}\n\n"
  },
  {
    "path": "docs/listings/first_test/Scarb.toml",
    "content": "[package]\nname = \"first_test\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/first_test/src/lib.cairo",
    "content": "fn sum(a: felt252, b: felt252) -> felt252 {\n    return a + b;\n}\n\n#[cfg(test)]\nmod tests {\n    use super::sum;\n\n    #[test]\n    fn test_sum() {\n        assert(sum(2, 3) == 5, 'sum incorrect');\n    }\n}\n"
  },
  {
    "path": "docs/listings/fork_testing/Scarb.toml",
    "content": "[package]\nname = \"fork_testing\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\nassert_macros = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n\n[[tool.snforge.fork]]\nname = \"SEPOLIA_LATEST\"\nurl = \"https://api.zan.top/public/starknet-sepolia/rpc/v0_10\"\nblock_id.tag = \"latest\"\n"
  },
  {
    "path": "docs/listings/fork_testing/src/lib.cairo",
    "content": "#[derive(Clone, Debug, PartialEq, Drop, Serde, starknet::Store)]\npub struct Pokemon {\n    pub name: ByteArray,\n    pub element: Element,\n    pub likes: felt252,\n    pub owner: starknet::ContractAddress,\n}\n\n#[derive(Copy, Debug, PartialEq, Drop, Serde, starknet::Store)]\npub enum Element {\n    #[default]\n    Fire,\n    Water,\n    Grass,\n}\n\n#[starknet::interface]\npub trait IPokemonGallery<TContractState> {\n    fn like(ref self: TContractState, name: ByteArray);\n    fn all(self: @TContractState) -> Array<Pokemon>;\n    fn pokemon(self: @TContractState, name: ByteArray) -> Option<Pokemon>;\n    fn liked(self: @TContractState) -> Array<Pokemon>;\n}\n"
  },
  {
    "path": "docs/listings/fork_testing/tests/explicit/block_hash.cairo",
    "content": "use fork_testing::{IPokemonGalleryDispatcher, IPokemonGalleryDispatcherTrait};\n\nconst CONTRACT_ADDRESS: felt252 =\n    0x0522dc7cbe288037382a02569af5a4169531053d284193623948eac8dd051716;\n\n#[test]\n#[fork(\n    url: \"https://api.zan.top/public/starknet-sepolia/rpc/v0_10\",\n    block_hash: 0x0690f8d584b52c2798d76b3346217a516778abee9b1bd8e400beb4f05dd9a4e7,\n)]\nfn test_using_forked_state() {\n    let dispatcher = IPokemonGalleryDispatcher {\n        contract_address: CONTRACT_ADDRESS.try_into().unwrap(),\n    };\n\n    dispatcher.like(\"Charizard\");\n    let pokemon = dispatcher.pokemon(\"Charizard\");\n\n    assert!(pokemon.is_some());\n    assert_eq!(pokemon.unwrap().likes, 1);\n}\n"
  },
  {
    "path": "docs/listings/fork_testing/tests/explicit/block_number.cairo",
    "content": "// import dispatcher generated by the interface we wrote\nuse fork_testing::{IPokemonGalleryDispatcher, IPokemonGalleryDispatcherTrait};\n\n// take an address of a real network contract\nconst CONTRACT_ADDRESS: felt252 =\n    0x0522dc7cbe288037382a02569af5a4169531053d284193623948eac8dd051716;\n\n#[test]\n#[fork(url: \"https://api.zan.top/public/starknet-sepolia/rpc/v0_10\", block_number: 77864)]\nfn test_using_forked_state() {\n    // instantiate the dispatcher\n    let dispatcher = IPokemonGalleryDispatcher {\n        contract_address: CONTRACT_ADDRESS.try_into().unwrap(),\n    };\n\n    // call the mutating method\n    dispatcher.like(\"Charizard\");\n\n    // check if the contract's state has changed\n    let pokemon = dispatcher.pokemon(\"Charizard\");\n\n    assert!(pokemon.is_some());\n    assert_eq!(pokemon.unwrap().likes, 1);\n}\n"
  },
  {
    "path": "docs/listings/fork_testing/tests/explicit/block_tag.cairo",
    "content": "use fork_testing::{IPokemonGalleryDispatcher, IPokemonGalleryDispatcherTrait};\n\nconst CONTRACT_ADDRESS: felt252 =\n    0x0522dc7cbe288037382a02569af5a4169531053d284193623948eac8dd051716;\n\n#[test]\n#[fork(url: \"https://api.zan.top/public/starknet-sepolia/rpc/v0_10\", block_tag: latest)]\nfn test_using_forked_state() {\n    let dispatcher = IPokemonGalleryDispatcher {\n        contract_address: CONTRACT_ADDRESS.try_into().unwrap(),\n    };\n\n    dispatcher.like(\"Charizard\");\n    let pokemon = dispatcher.pokemon(\"Charizard\");\n\n    assert!(pokemon.is_some());\n    assert_eq!(pokemon.unwrap().likes, 1);\n}\n"
  },
  {
    "path": "docs/listings/fork_testing/tests/explicit.cairo",
    "content": "pub mod block_hash;\npub mod block_number;\npub mod block_tag;\n"
  },
  {
    "path": "docs/listings/fork_testing/tests/lib.cairo",
    "content": "pub mod explicit;\npub mod name;\npub mod overridden_name;\n"
  },
  {
    "path": "docs/listings/fork_testing/tests/name.cairo",
    "content": "use fork_testing::{IPokemonGalleryDispatcher, IPokemonGalleryDispatcherTrait};\n\nconst CONTRACT_ADDRESS: felt252 =\n    0x0522dc7cbe288037382a02569af5a4169531053d284193623948eac8dd051716;\n\n#[test]\n#[fork(\"SEPOLIA_LATEST\")]\nfn test_using_forked_state() {\n    let dispatcher = IPokemonGalleryDispatcher {\n        contract_address: CONTRACT_ADDRESS.try_into().unwrap(),\n    };\n\n    dispatcher.like(\"Charizard\");\n    let pokemon = dispatcher.pokemon(\"Charizard\");\n\n    assert!(pokemon.is_some());\n    assert_eq!(pokemon.unwrap().likes, 1);\n}\n"
  },
  {
    "path": "docs/listings/fork_testing/tests/overridden_name.cairo",
    "content": "use fork_testing::{IPokemonGalleryDispatcher, IPokemonGalleryDispatcherTrait};\n\nconst CONTRACT_ADDRESS: felt252 =\n    0x0522dc7cbe288037382a02569af5a4169531053d284193623948eac8dd051716;\n\n#[test]\n#[fork(\"SEPOLIA_LATEST\", block_number: 200000)]\nfn test_using_forked_state() {\n    let dispatcher = IPokemonGalleryDispatcher {\n        contract_address: CONTRACT_ADDRESS.try_into().unwrap(),\n    };\n\n    dispatcher.like(\"Charizard\");\n    let pokemon = dispatcher.pokemon(\"Charizard\");\n\n    assert!(pokemon.is_some());\n    assert_eq!(pokemon.unwrap().likes, 1);\n}\n"
  },
  {
    "path": "docs/listings/full_example/Scarb.toml",
    "content": "[package]\nname = \"full_example\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html\n\n[dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\nsncast_std = { path = \"../../../sncast_std\" }\nmap3 = { path = \"../map3\" }\nstarknet = \"2.11.4\"\n\n[[target.starknet-contract]]\nbuild-external-contracts = [\"map3::MapContract\"]\n\n[[target.lib]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/full_example/src/full_example.cairo",
    "content": "use sncast_std::{DeclareResultTrait, FeeSettingsTrait, call, declare, deploy, get_nonce, invoke};\n\nfn main() {\n    let fee_settings = FeeSettingsTrait::max_fee(999999999999999);\n    let salt = 0x3;\n\n    let declare_nonce = get_nonce('latest');\n\n    let declare_result = declare(\"MapContract\", fee_settings, Option::Some(declare_nonce))\n        .expect('map declare failed');\n\n    let class_hash = declare_result.class_hash();\n    let deploy_nonce = get_nonce('pending');\n\n    let deploy_result = deploy(\n        *class_hash,\n        ArrayTrait::new(),\n        Option::Some(salt),\n        true,\n        fee_settings,\n        Option::Some(deploy_nonce),\n    )\n        .expect('map deploy failed');\n\n    assert(deploy_result.transaction_hash != 0, deploy_result.transaction_hash);\n\n    let invoke_nonce = get_nonce('pending');\n\n    let invoke_result = invoke(\n        deploy_result.contract_address,\n        selector!(\"put\"),\n        array![0x1, 0x2],\n        fee_settings,\n        Option::Some(invoke_nonce),\n    )\n        .expect('map invoke failed');\n\n    assert(invoke_result.transaction_hash != 0, invoke_result.transaction_hash);\n\n    let call_result = call(deploy_result.contract_address, selector!(\"get\"), array![0x1])\n        .expect('map call failed');\n\n    assert(call_result.data == array![0x2], *call_result.data.at(0));\n}\n"
  },
  {
    "path": "docs/listings/full_example/src/lib.cairo",
    "content": "mod full_example;\n"
  },
  {
    "path": "docs/listings/fuzz_testing/Scarb.toml",
    "content": "[package]\nname = \"fuzz_testing\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\nassert_macros = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.lib]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/fuzz_testing/src/basic_example.cairo",
    "content": "fn sum(a: felt252, b: felt252) -> felt252 {\n    return a + b;\n}\n\n#[cfg(test)]\nmod tests {\n    use super::sum;\n\n    #[test]\n    #[fuzzer]\n    fn test_sum(x: felt252, y: felt252) {\n        assert_eq!(sum(x, y), x + y);\n    }\n}\n"
  },
  {
    "path": "docs/listings/fuzz_testing/src/lib.cairo",
    "content": "pub mod basic_example;\npub mod with_parameters;\n"
  },
  {
    "path": "docs/listings/fuzz_testing/src/with_parameters.cairo",
    "content": "fn sum(a: felt252, b: felt252) -> felt252 {\n    return a + b;\n}\n\n#[cfg(test)]\nmod tests {\n    use super::sum;\n\n    #[test]\n    #[fuzzer(runs: 22, seed: 38)]\n    fn test_sum(x: felt252, y: felt252) {\n        assert_eq!(sum(x, y), x + y);\n    }\n}\n"
  },
  {
    "path": "docs/listings/get_nonce/Scarb.toml",
    "content": "[package]\nname = \"get_nonce\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\nsnforge_std = { path = \"../../../snforge_std\" }\nsncast_std = { path = \"../../../sncast_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/get_nonce/src/lib.cairo",
    "content": "use sncast_std::get_nonce;\n\nfn main() {\n    let nonce = get_nonce('latest');\n    println!(\"nonce: {}\", nonce);\n    println!(\"debug nonce: {:?}\", nonce);\n}\n"
  },
  {
    "path": "docs/listings/hello_sncast/Scarb.toml",
    "content": "[package]\nname = \"hello_sncast\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html\n\n[dependencies]\nstarknet = \"2.8.5\"\nsncast_std = { path = \"../../../sncast_std\" }\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/hello_sncast/accounts.json",
    "content": "{\n  \"alpha-sepolia\": {\n    \"my_account\": {\n      \"address\": \"0x6f4621e7ad43707b3f69f9df49425c3d94fdc5ab2e444bfa0e7e4edeff7992d\",\n      \"deployed\": true,\n      \"private_key\": \"0x0000000000000000000000000000000056c12e097e49ea382ca8eadec0839401\",\n      \"public_key\": \"0x048234b9bc6c1e749f4b908d310d8c53dae6564110b05ccf79016dca8ce7dfac\",\n      \"type\": \"open_zeppelin\"\n    }\n  }\n}\n"
  },
  {
    "path": "docs/listings/hello_sncast/snfoundry.toml",
    "content": "[sncast.default]\naccount = \"my_account\"\naccounts-file = \"accounts.json\"\nurl = \"http://127.0.0.1:5055/rpc\"\n\n[sncast.myprofile]\naccount = \"my_account\"\naccounts-file = \"accounts.json\"\nurl = \"http://127.0.0.1:5055/rpc\"\n"
  },
  {
    "path": "docs/listings/hello_sncast/src/constructor_contract.cairo",
    "content": "#[starknet::contract]\npub mod ConstructorContract {\n    #[storage]\n    struct Storage {}\n\n    #[constructor]\n    fn constructor(ref self: ContractState, x: felt252, y: felt252, z: felt252) {}\n}\n"
  },
  {
    "path": "docs/listings/hello_sncast/src/data_transformer_contract.cairo",
    "content": "#[derive(Serde, Drop)]\npub struct SimpleStruct {\n    a: felt252,\n}\n\n#[derive(Serde, Drop)]\npub struct NestedStructWithField {\n    a: SimpleStruct,\n    b: felt252,\n}\n\n#[derive(Serde, Drop)]\npub enum Enum {\n    One: (),\n    Two: u128,\n    Three: NestedStructWithField,\n}\n\n#[starknet::interface]\npub trait IDataTransformerContract<TContractState> {\n    fn tuple_fn(self: @TContractState, a: (felt252, u8, Enum));\n    fn nested_struct_fn(self: @TContractState, a: NestedStructWithField);\n    fn complex_fn(\n        self: @TContractState,\n        arr: Array<Array<felt252>>,\n        one: u8,\n        two: i8,\n        three: ByteArray,\n        four: (felt252, u32),\n        five: bool,\n        six: u256,\n    );\n}\n\n\n#[starknet::contract]\npub mod DataTransformerContract {\n    use super::{Enum, NestedStructWithField};\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl DataTransformerContractImpl of super::IDataTransformerContract<ContractState> {\n        fn tuple_fn(self: @ContractState, a: (felt252, u8, Enum)) {}\n\n        fn nested_struct_fn(self: @ContractState, a: NestedStructWithField) {}\n\n        fn complex_fn(\n            self: @ContractState,\n            arr: Array<Array<felt252>>,\n            one: u8,\n            two: i8,\n            three: ByteArray,\n            four: (felt252, u32),\n            five: bool,\n            six: u256,\n        ) {}\n    }\n}\n"
  },
  {
    "path": "docs/listings/hello_sncast/src/hello_sncast.cairo",
    "content": "#[starknet::interface]\npub trait IHelloSncast<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n    fn sum_numbers(ref self: TContractState, a: felt252, b: felt252, c: felt252) -> felt252;\n}\n\n#[starknet::contract]\nmod HelloSncast {\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl HelloSncastImpl of super::IHelloSncast<ContractState> {\n        fn increase_balance(ref self: ContractState, amount: felt252) {\n            assert(amount != 0, 'Amount cannot be 0');\n            self.balance.write(self.balance.read() + amount);\n        }\n\n        fn get_balance(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n\n        fn sum_numbers(ref self: ContractState, a: felt252, b: felt252, c: felt252) -> felt252 {\n            a + b + c\n        }\n    }\n}\n"
  },
  {
    "path": "docs/listings/hello_sncast/src/lib.cairo",
    "content": "pub mod constructor_contract;\npub mod data_transformer_contract;\npub mod hello_sncast;\n"
  },
  {
    "path": "docs/listings/hello_snforge/Scarb.toml",
    "content": "[package]\nname = \"hello_snforge\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html\n\n[dependencies]\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/hello_snforge/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait IHelloStarknet<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n}\n\n#[starknet::contract]\nmod HelloStarknet {\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl HelloStarknetImpl of super::IHelloStarknet<ContractState> {\n        fn increase_balance(ref self: ContractState, amount: felt252) {\n            assert(amount != 0, 'Amount cannot be 0');\n            self.balance.write(self.balance.read() + amount);\n        }\n\n        fn get_balance(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n    }\n}\n"
  },
  {
    "path": "docs/listings/hello_snforge/tests/test_contract.cairo",
    "content": "#[test]\nfn test_executing() {\n    assert(1 == 1, 1);\n}\n\n#[test]\nfn test_calling() {\n    assert(2 == 2, 2);\n}\n\n#[test]\nfn test_calling_another() {\n    assert(3 == 3, 3);\n}\n"
  },
  {
    "path": "docs/listings/hello_starknet/Scarb.toml",
    "content": "[package]\nname = \"hello_starknet\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html\n\n[dependencies]\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/hello_starknet/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait IHelloStarknet<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n}\n\n#[starknet::contract]\nmod HelloStarknet {\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl HelloStarknetImpl of super::IHelloStarknet<ContractState> {\n        fn increase_balance(ref self: ContractState, amount: felt252) {\n            assert(amount != 0, 'Amount cannot be 0');\n            self.balance.write(self.balance.read() + amount);\n        }\n\n        fn get_balance(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n    }\n}\n"
  },
  {
    "path": "docs/listings/hello_starknet/tests/test_contract.cairo",
    "content": "use hello_starknet::{\n    IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait, IHelloStarknetSafeDispatcher,\n    IHelloStarknetSafeDispatcherTrait,\n};\nuse snforge_std::{ContractClassTrait, DeclareResultTrait, declare};\nuse starknet::ContractAddress;\n\nfn deploy_contract(name: ByteArray) -> ContractAddress {\n    let contract = declare(name).unwrap().contract_class();\n    let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n    contract_address\n}\n\n#[test]\nfn test_increase_balance() {\n    let contract_address = deploy_contract(\"HelloStarknet\");\n\n    let dispatcher = IHelloStarknetDispatcher { contract_address };\n\n    let balance_before = dispatcher.get_balance();\n    assert(balance_before == 0, 'Invalid balance');\n\n    dispatcher.increase_balance(42);\n\n    let balance_after = dispatcher.get_balance();\n    assert(balance_after == 42, 'Invalid balance');\n}\n\n#[test]\n#[feature(\"safe_dispatcher\")]\nfn test_cannot_increase_balance_with_zero_value() {\n    let contract_address = deploy_contract(\"HelloStarknet\");\n\n    let safe_dispatcher = IHelloStarknetSafeDispatcher { contract_address };\n\n    let balance_before = safe_dispatcher.get_balance().unwrap();\n    assert(balance_before == 0, 'Invalid balance');\n\n    match safe_dispatcher.increase_balance(0) {\n        Result::Ok(_) => core::panic_with_felt252('Should have panicked'),\n        Result::Err(panic_data) => {\n            assert(*panic_data.at(0) == 'Amount cannot be 0', *panic_data.at(0));\n        },\n    };\n}\n"
  },
  {
    "path": "docs/listings/hello_workspaces_docs/Scarb.toml",
    "content": "[workspace]\nmembers = [\n    \"crates/*\",\n]\n\n[workspace.scripts]\ntest = \"snforge\"\n\n[workspace.tool.snforge]\n\n[workspace.package]\nversion = \"0.1.0\"\n\n[package]\nname = \"hello_workspaces_docs\"\nversion.workspace = true\nedition = \"2024_07\"\n\n[scripts]\ntest.workspace = true\n\n[tool]\nsnforge.workspace = true\n\n[dependencies]\nfibonacci_docs = { path = \"crates/fibonacci_docs\" }\naddition_docs = { path = \"crates/addition_docs\" }\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std.workspace = true\n\n[workspace.dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n"
  },
  {
    "path": "docs/listings/hello_workspaces_docs/crates/addition_docs/Scarb.toml",
    "content": "[package]\nname = \"addition_docs\"\nversion.workspace = true\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std.workspace = true\n\n[[target.starknet-contract]]\nsierra = true\n\n[lib]\n"
  },
  {
    "path": "docs/listings/hello_workspaces_docs/crates/addition_docs/src/lib.cairo",
    "content": "pub fn add(a: felt252, b: felt252) -> felt252 {\n    a + b\n}\n\n#[starknet::interface]\ntrait IAdditionContract<TContractState> {\n    fn answer(ref self: TContractState) -> felt252;\n}\n\n#[starknet::contract]\nmod AdditionContract {\n    use addition_docs::add;\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl AdditionContractImpl of super::IAdditionContract<ContractState> {\n        fn answer(ref self: ContractState) -> felt252 {\n            add(10, 20)\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::add;\n\n    #[test]\n    fn it_works() {\n        assert(add(2, 3) == 5, 'it works!');\n    }\n}\n"
  },
  {
    "path": "docs/listings/hello_workspaces_docs/crates/addition_docs/tests/nested/test_nested.cairo",
    "content": "use super::foo;\n\n#[test]\nfn test_two() {\n    assert(foo() == 2, 'foo() == 2');\n}\n\n#[test]\nfn test_two_and_two() {\n    assert(2 == 2, '2 == 2');\n    assert(2 == 2, '2 == 2');\n}\n"
  },
  {
    "path": "docs/listings/hello_workspaces_docs/crates/addition_docs/tests/nested.cairo",
    "content": "use snforge_std::declare;\n\nmod test_nested;\n\nfn foo() -> u8 {\n    2\n}\n\n#[test]\nfn simple_case() {\n    assert(1 == 1, 'simple check');\n}\n\n#[test]\nfn contract_test() {\n    declare(\"AdditionContract\").unwrap();\n}\n"
  },
  {
    "path": "docs/listings/hello_workspaces_docs/crates/fibonacci_docs/Scarb.toml",
    "content": "[package]\nname = \"fibonacci_docs\"\nversion.workspace = true\nedition = \"2024_07\"\n\n[scripts]\ntest.workspace = true\n\n[tool]\nsnforge.workspace = true\n\n[dependencies]\naddition_docs = { path = \"../addition_docs\" }\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std.workspace = true\n\n[[target.starknet-contract]]\nsierra = true\nbuild-external-contracts = [\"addition_docs::AdditionContract\"]\n\n[lib]\n"
  },
  {
    "path": "docs/listings/hello_workspaces_docs/crates/fibonacci_docs/src/lib.cairo",
    "content": "use addition_docs::add;\n\npub fn fib(a: felt252, b: felt252, n: felt252) -> felt252 {\n    match n {\n        0 => a,\n        _ => fib(b, add(a, b), n - 1),\n    }\n}\n\n#[starknet::contract]\nmod FibonacciContract {\n    use addition_docs::add;\n    use fibonacci_docs::fib;\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    fn answer(ref self: ContractState) -> felt252 {\n        add(fib(0, 1, 16), fib(0, 1, 8))\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use snforge_std::declare;\n    use super::fib;\n\n    #[test]\n    fn it_works() {\n        assert(fib(0, 1, 16) == 987, 'it works!');\n    }\n\n    #[test]\n    fn contract_test() {\n        declare(\"FibonacciContract\").unwrap();\n        declare(\"AdditionContract\").unwrap();\n    }\n}\n"
  },
  {
    "path": "docs/listings/hello_workspaces_docs/crates/fibonacci_docs/tests/abc/efg.cairo",
    "content": "#[test]\nfn efg_test() {\n    assert(super::foo() == 1, '');\n}\n\n#[test]\nfn failing_test() {\n    assert(1 == 2, '');\n}\n"
  },
  {
    "path": "docs/listings/hello_workspaces_docs/crates/fibonacci_docs/tests/abc.cairo",
    "content": "mod efg;\n\n#[test]\nfn abc_test() {\n    assert(foo() == 1, '');\n}\n\npub fn foo() -> u8 {\n    1\n}\n"
  },
  {
    "path": "docs/listings/hello_workspaces_docs/crates/fibonacci_docs/tests/lib.cairo",
    "content": "mod abc;\n\n#[test]\nfn lib_test() {\n    assert(abc::foo() == 1, '');\n}\n"
  },
  {
    "path": "docs/listings/hello_workspaces_docs/crates/fibonacci_docs/tests/not_collected.cairo",
    "content": "// should not be collected\n\n#[test]\nfn not_collected() {\n    assert(1 == 1, '');\n}\n"
  },
  {
    "path": "docs/listings/hello_workspaces_docs/src/lib.cairo",
    "content": "#[starknet::interface]\ntrait IFibContract<TContractState> {\n    fn answer(ref self: TContractState) -> felt252;\n}\n\n#[starknet::contract]\nmod FibContract {\n    use addition_docs::add;\n    use fibonacci_docs::fib;\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl FibContractImpl of super::IFibContract<ContractState> {\n        fn answer(ref self: ContractState) -> felt252 {\n            add(fib(0, 1, 16), fib(0, 1, 8))\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    #[test]\n    fn test_simple() {\n        assert(1 == 1, 1);\n    }\n}\n"
  },
  {
    "path": "docs/listings/hello_workspaces_docs/tests/test_failing.cairo",
    "content": "#[test]\nfn test_failing() {\n    assert(1 == 2, 'failing check');\n}\n\n#[test]\nfn test_another_failing() {\n    assert(2 == 3, 'failing check');\n}\n"
  },
  {
    "path": "docs/listings/ignoring_example/Scarb.toml",
    "content": "[package]\nname = \"ignoring_example\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/ignoring_example/src/lib.cairo",
    "content": "#[cfg(test)]\nmod tests {\n    #[test]\n    #[ignore]\n    fn ignored_test() { // test code\n    }\n}\n\n"
  },
  {
    "path": "docs/listings/invoke/Scarb.toml",
    "content": "[package]\nname = \"invoke\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\nsnforge_std = { path = \"../../../snforge_std\" }\nsncast_std = { path = \"../../../sncast_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/invoke/src/lib.cairo",
    "content": "use sncast_std::{FeeSettingsTrait, invoke};\nuse starknet::ContractAddress;\n\nfn main() {\n    let contract_address: ContractAddress =\n        0x1e52f6ebc3e594d2a6dc2a0d7d193cb50144cfdfb7fdd9519135c29b67e427\n        .try_into()\n        .expect('Invalid contract address value');\n    let fee_settings = FeeSettingsTrait::estimate();\n\n    let result = invoke(\n        contract_address, selector!(\"put\"), array![0x1, 0x2], fee_settings, Option::None,\n    )\n        .expect('invoke failed');\n\n    println!(\"invoke result: {}\", result);\n    println!(\"debug invoke result: {:?}\", result);\n}\n"
  },
  {
    "path": "docs/listings/map3/Scarb.toml",
    "content": "[package]\nname = \"map3\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[[target.starknet-contract]]\nsierra = true\n\n[[target.lib]]\nsierra = false\n\n[dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\nstarknet = \"2.8.5\"\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/map3/snfoundry.toml",
    "content": "[sncast.default]\nurl = \"http://127.0.0.1:5050/rpc\"\n# [sncast.default]\n# url = \"https://api.zan.top/public/starknet-sepolia/rpc/v0_10\"\n"
  },
  {
    "path": "docs/listings/map3/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait IMapContract<State> {\n    fn put(ref self: State, key: felt252, value: felt252);\n    fn get(self: @State, key: felt252) -> felt252;\n}\n\n#[starknet::contract]\npub mod MapContract {\n    use starknet::storage::{Map, StorageMapReadAccess, StorageMapWriteAccess};\n\n    #[storage]\n    struct Storage {\n        storage: Map<felt252, felt252>,\n    }\n\n    #[abi(embed_v0)]\n    impl MapContractImpl of super::IMapContract<ContractState> {\n        fn put(ref self: ContractState, key: felt252, value: felt252) {\n            self.storage.write(key, value);\n        }\n\n        fn get(self: @ContractState, key: felt252) -> felt252 {\n            self.storage.read(key)\n        }\n    }\n}\n"
  },
  {
    "path": "docs/listings/panicking_test/Scarb.toml",
    "content": "[package]\nname = \"panicking_test\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/panicking_test/src/lib.cairo",
    "content": "fn panicking_function() {\n    let mut data = array![];\n    data.append('panic message');\n    panic(data)\n}\n\n#[cfg(test)]\nmod tests {\n    use super::panicking_function;\n\n    #[test]\n    fn failing() {\n        panicking_function();\n        assert(2 == 2, '2 == 2');\n    }\n}\n"
  },
  {
    "path": "docs/listings/parametrized_testing_advanced/Scarb.toml",
    "content": "[package]\nname = \"parametrized_testing_advanced\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.12.0\"\nassert_macros = \"2.12.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/parametrized_testing_advanced/src/lib.cairo",
    "content": "#[starknet::contract]\npub mod HelloStarknet {\n    #[storage]\n    struct Storage {}\n}\n"
  },
  {
    "path": "docs/listings/parametrized_testing_advanced/tests/example.cairo",
    "content": "#[derive(Copy, Drop)]\nstruct User {\n    pub name: felt252,\n    pub age: u8,\n}\n\n#[generate_trait]\nimpl UserImpl of UserTrait {\n    fn is_adult(self: @User) -> bool {\n        return *self.age >= 18_u8;\n    }\n}\n\n#[test]\n#[test_case(User { name: 'Alice', age: 20 }, true)]\n#[test_case(User { name: 'Bob', age: 14 }, false)]\n#[test_case(User { name: 'Josh', age: 18 }, true)]\nfn test_is_adult(user: User, expected: bool) {\n    assert_eq!(user.is_adult(), expected);\n}\n"
  },
  {
    "path": "docs/listings/parametrized_testing_basic/Scarb.toml",
    "content": "[package]\nname = \"parametrized_testing_basic\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.12.0\"\nassert_macros = \"2.12.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/parametrized_testing_basic/src/lib.cairo",
    "content": "#[starknet::contract]\npub mod HelloStarknet {\n    #[storage]\n    struct Storage {}\n}\n"
  },
  {
    "path": "docs/listings/parametrized_testing_basic/tests/example.cairo",
    "content": "fn sum(x: felt252, y: felt252) -> felt252 {\n    return x + y;\n}\n\n#[test]\n#[test_case(1, 2, 3)]\n#[test_case(3, 4, 7)]\nfn test_sum(x: felt252, y: felt252, expected: felt252) {\n    assert_eq!(sum(x, y), expected);\n}\n"
  },
  {
    "path": "docs/listings/parametrized_testing_fuzzer/Scarb.toml",
    "content": "[package]\nname = \"parametrized_testing_fuzzer\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.12.0\"\nassert_macros = \"2.12.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/parametrized_testing_fuzzer/src/lib.cairo",
    "content": "#[starknet::contract]\npub mod HelloStarknet {\n    #[storage]\n    struct Storage {}\n}\n"
  },
  {
    "path": "docs/listings/parametrized_testing_fuzzer/tests/example.cairo",
    "content": "fn sum(x: felt252, y: felt252) -> felt252 {\n    return x + y;\n}\n\n#[test]\n#[test_case(1, 2)]\n#[test_case(3, 4)]\n#[fuzzer(runs: 10)]\nfn test_sum(x: felt252, y: felt252) {\n    assert_eq!(sum(x, y), x + y);\n}\n"
  },
  {
    "path": "docs/listings/should_panic_example/Scarb.toml",
    "content": "[package]\nname = \"should_panic_example\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/should_panic_example/src/lib.cairo",
    "content": "#[cfg(test)]\nmod tests {\n    //ANCHOR:byte_array\n    #[test]\n    #[should_panic(expected: \"This will panic\")]\n    fn should_panic_exact() {\n        panic!(\"This will panic\");\n    }\n\n    // here the expected message is a substring of the actual message\n    #[test]\n    #[should_panic(expected: \"will panic\")]\n    fn should_panic_expected_is_substring() {\n        panic!(\"This will panic\");\n    }\n    //ANCHOR_END:byte_array\n\n    //ANCHOR:felt\n    #[test]\n    #[should_panic(expected: 'panic message')]\n    fn should_panic_felt_matching() {\n        assert(1 != 1, 'panic message');\n    }\n    //ANCHOR_END:felt\n\n    //ANCHOR:tuple\n    use core::panic_with_felt252;\n\n    #[test]\n    #[should_panic(expected: ('panic message',))]\n    fn should_panic_check_data() {\n        panic_with_felt252('panic message');\n    }\n\n    // works for multiple messages\n    #[test]\n    #[should_panic(expected: ('panic message', 'second message'))]\n    fn should_panic_multiple_messages() {\n        let mut arr = ArrayTrait::new();\n        arr.append('panic message');\n        arr.append('second message');\n        panic(arr);\n    }\n    //ANCHOR_END:tuple\n}\n"
  },
  {
    "path": "docs/listings/snforge_library_reference/Scarb.toml",
    "content": "[package]\nname = \"snforge_library_reference\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.12.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.starknet-contract]]\n"
  },
  {
    "path": "docs/listings/snforge_library_reference/data/hello_starknet.txt",
    "content": "'Hello Starknet!'\n'Let's code in Cairo!'\n\"Example byte array\"\n"
  },
  {
    "path": "docs/listings/snforge_library_reference/data/user.json",
    "content": "{\n    \"age\": 30,\n    \"job\": \"Software Engineer\",\n    \"location\": {\n        \"city\": \"New York\",\n        \"country\": \"USA\"\n    },\n    \"name\": \"John\",\n    \"surname\": \"Doe\"\n}\n\n"
  },
  {
    "path": "docs/listings/snforge_library_reference/src/lib.cairo",
    "content": "\n"
  },
  {
    "path": "docs/listings/snforge_library_reference/tests/test_fs_file_trait.cairo",
    "content": "use snforge_std::fs::FileTrait;\n\n#[test]\nfn file_trait_example() {\n    // Create an instance of `File` to be used later\n    let _file = FileTrait::new(\"data/hello_starknet.txt\");\n}\n"
  },
  {
    "path": "docs/listings/snforge_library_reference/tests/test_fs_parse_json.cairo",
    "content": "use core::array::ArrayTrait;\nuse core::option::OptionTrait;\nuse core::serde::Serde;\nuse snforge_std::fs::{FileParser, FileTrait};\n\n#[derive(Debug, Serde, Drop, PartialEq)]\nstruct Location {\n    city: ByteArray,\n    country: ByteArray,\n}\n\n#[derive(Debug, Serde, Drop, PartialEq)]\nstruct User {\n    age: u32,\n    job: ByteArray,\n    location: Location,\n    name: ByteArray,\n    surname: ByteArray,\n}\n\n\n#[test]\nfn parse_json_example() {\n    // Create an instance of `File` to be used later\n    let file = FileTrait::new(\"data/user.json\");\n\n    // Parse the JSON content from the file\n    let content = FileParser::<User>::parse_json(@file).expect('Failed to parse JSON');\n\n    // Serialize the content to an array for comparison\n    let mut output_array = ArrayTrait::new();\n    content.serialize(ref output_array);\n\n    println!(\"{:?}\", content);\n\n    assert!(content.name == \"John\");\n    assert!(content.location.country == \"USA\");\n    assert!(content.age == 30);\n}\n"
  },
  {
    "path": "docs/listings/snforge_library_reference/tests/test_fs_read_json.cairo",
    "content": "use snforge_std::fs::{FileTrait, read_json};\n\n#[test]\nfn read_json_example() {\n    // Create an instance of `File` to be used later\n    let file = FileTrait::new(\"data/user.json\");\n\n    // Read the JSON content from the file\n    let content = read_json(@file);\n\n    let expected_serialized_json = array![\n        30, 0, 28391512738467412385612170632190008583538, 17, 0, 5649052288429290091, 8, 0, 5591873,\n        3, 0, 1248815214, 4, 0, 4484965, 3,\n    ];\n    let mut i = 0;\n\n    // Iterate through the content and compare with expected values\n    while i != content.len() {\n        println!(\"0x{:x}\", *content[i]);\n        assert!(*content[i] == *expected_serialized_json[i]);\n        i += 1;\n    };\n}\n"
  },
  {
    "path": "docs/listings/snforge_library_reference/tests/test_fs_read_txt.cairo",
    "content": "use snforge_std::fs::{FileTrait, read_txt};\n\n#[test]\nfn read_txt_example() {\n    // Create an instance of `File` to be used later\n    let file = FileTrait::new(\"data/hello_starknet.txt\");\n\n    // Read the content of the file\n    let content = read_txt(@file);\n\n    let expected = array![\n        'Hello Starknet!',\n        'Let\\'s code in Cairo!', // Below is serialized byte array \"Example byte array\"\n        0,\n        6051711116678136165665715375637410673222009, 18,\n    ];\n    let mut i = 0;\n\n    // Iterate through the content and compare with expected values\n    while i != content.len() {\n        println!(\"0x{:x}\", *content[i]);\n        assert(*content[i] == *expected[i], 'unexpected content');\n        i += 1;\n    };\n}\n"
  },
  {
    "path": "docs/listings/testing_contract_internals/Scarb.toml",
    "content": "[package]\nname = \"testing_contract_internals\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/testing_contract_internals/src/contract.cairo",
    "content": "#[starknet::interface]\npub trait IContract<TContractState> {\n    fn get_balance_at(self: @TContractState, address: starknet::ContractAddress) -> u64;\n}\n\n#[starknet::contract]\npub mod Contract {\n    use starknet::ContractAddress;\n    use starknet::storage::{\n        Map, StorageMapReadAccess, StorageMapWriteAccess, StoragePointerReadAccess,\n    };\n\n    #[storage]\n    pub struct Storage {\n        pub balances: Map<ContractAddress, u64>,\n    }\n\n    #[abi(embed_v0)]\n    impl ContractImpl of super::IContract<ContractState> {\n        fn get_balance_at(self: @ContractState, address: ContractAddress) -> u64 {\n            self.balances.read(address)\n        }\n    }\n\n    #[generate_trait]\n    pub impl InternalImpl of InternalTrait {\n        fn _internal_set_balance(ref self: ContractState, address: ContractAddress, balance: u64) {\n            self.balances.write(address, balance);\n        }\n    }\n}\n"
  },
  {
    "path": "docs/listings/testing_contract_internals/src/lib.cairo",
    "content": "pub mod contract;\npub mod spying_for_events;\npub mod using_interact_with_state;\npub mod using_library_calls;\n"
  },
  {
    "path": "docs/listings/testing_contract_internals/src/spying_for_events.cairo",
    "content": "#[starknet::interface]\npub trait IEmitter<TContractState> {\n    fn emit_event(ref self: TContractState);\n}\n\n#[starknet::contract]\npub mod Emitter {\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    pub enum Event {\n        ThingEmitted: ThingEmitted,\n    }\n\n    #[derive(Drop, starknet::Event)]\n    pub struct ThingEmitted {\n        pub thing: felt252,\n    }\n\n    #[storage]\n    struct Storage {}\n\n    #[external(v0)]\n    pub fn emit_event(ref self: ContractState) {\n        self.emit(Event::ThingEmitted(ThingEmitted { thing: 420 }));\n    }\n}\n"
  },
  {
    "path": "docs/listings/testing_contract_internals/src/using_interact_with_state.cairo",
    "content": "#[starknet::interface]\ntrait IContract<TContractState> {\n    fn get_balance(self: @TContractState, address: starknet::ContractAddress) -> u64;\n}\n\n#[starknet::contract]\npub mod Contract {\n    use starknet::ContractAddress;\n    use starknet::storage::{Map, StorageMapReadAccess, StorageMapWriteAccess};\n\n    #[storage]\n    pub struct Storage {\n        pub balances: Map<ContractAddress, u64>,\n    }\n\n    #[abi(embed_v0)]\n    impl ContractImpl of super::IContract<ContractState> {\n        fn get_balance(self: @ContractState, address: ContractAddress) -> u64 {\n            self.balances.read(address)\n        }\n    }\n\n    #[generate_trait]\n    pub impl InternalImpl of InternalTrait {\n        fn _set_balance(ref self: ContractState, address: ContractAddress, balance: u64) {\n            self.balances.write(address, balance);\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    // 0. Import necessary structs and traits\n    use snforge_std::{ContractClassTrait, DeclareResultTrait, declare, interact_with_state};\n    use starknet::ContractAddress;\n    use starknet::storage::{StorageMapReadAccess, StorageMapWriteAccess};\n    use super::Contract::InternalTrait;\n    use super::{Contract, IContractDispatcher, IContractDispatcherTrait};\n\n    fn deploy_contract() -> starknet::ContractAddress {\n        let contract = declare(\"Contract\").unwrap().contract_class();\n        let (contract_address, _) = contract.deploy(@array![]).unwrap();\n        contract_address\n    }\n\n    #[test]\n    fn test_storage() {\n        // 1. Deploy your contract\n        let contract_address = deploy_contract();\n        let dispatcher = IContractDispatcher { contract_address };\n\n        let contract_to_modify: ContractAddress = 0x123.try_into().unwrap();\n\n        assert(dispatcher.get_balance(contract_to_modify) == 0, 'Wrong balance');\n\n        // 2. Use `interact_with_state` to access and modify the contract's storage\n        interact_with_state(\n            contract_address,\n            || {\n                // 3. Get access to the contract's state\n                let mut state = Contract::contract_state_for_testing();\n\n                // 4. Read from storage\n                let current_balance = state.balances.read(contract_to_modify);\n\n                // 5. Write to storage\n                state.balances.write(contract_to_modify, current_balance + 100);\n            },\n        );\n\n        assert(dispatcher.get_balance(contract_to_modify) == 100, 'Wrong balance');\n    }\n\n    #[test]\n    fn test_internal_function() {\n        // 1. Deploy your contract\n        let contract_address = deploy_contract();\n        let dispatcher = IContractDispatcher { contract_address };\n\n        let contract_to_modify: ContractAddress = 0x456.try_into().unwrap();\n\n        assert(dispatcher.get_balance(contract_to_modify) == 0, 'Wrong balance');\n\n        // 2. Use `interact_with_state` to call contract's internal function\n        interact_with_state(\n            contract_address,\n            || {\n                // 3. Get access to the contract's state\n                let mut state = Contract::contract_state_for_testing();\n\n                // 4. Call internal function\n                state._set_balance(contract_to_modify, 200);\n            },\n        );\n\n        assert(dispatcher.get_balance(contract_to_modify) == 200, 'Wrong balance');\n    }\n}\n"
  },
  {
    "path": "docs/listings/testing_contract_internals/src/using_library_calls.cairo",
    "content": "#[starknet::interface]\npub trait ILibraryContract<TContractState> {\n    fn get_value(self: @TContractState) -> felt252;\n    fn set_value(ref self: TContractState, number: felt252);\n}\n\n#[starknet::contract]\npub mod LibraryContract {\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n    #[storage]\n    struct Storage {\n        value: felt252,\n    }\n\n    #[external(v0)]\n    pub fn get_value(self: @ContractState) -> felt252 {\n        self.value.read()\n    }\n\n    #[external(v0)]\n    pub fn set_value(ref self: ContractState, number: felt252) {\n        self.value.write(number);\n    }\n}\n"
  },
  {
    "path": "docs/listings/testing_contract_internals/tests/interact_with_state.cairo",
    "content": "// 0. Import necessary structs and traits\nuse snforge_std::{ContractClassTrait, DeclareResultTrait, declare, interact_with_state};\nuse starknet::ContractAddress;\nuse starknet::storage::{StorageMapReadAccess, StorageMapWriteAccess};\nuse testing_contract_internals::contract::Contract::InternalTrait;\nuse testing_contract_internals::contract::{Contract, IContractDispatcher, IContractDispatcherTrait};\n\nfn deploy_contract() -> starknet::ContractAddress {\n    let contract = declare(\"Contract\").unwrap().contract_class();\n    let (contract_address, _) = contract.deploy(@array![]).unwrap();\n    contract_address\n}\n\n#[test]\nfn test_storage() {\n    // 1. Deploy your contract\n    let contract_address = deploy_contract();\n    let dispatcher = IContractDispatcher { contract_address };\n\n    let contract_to_modify: ContractAddress = 0x123.try_into().unwrap();\n\n    assert(dispatcher.get_balance_at(contract_to_modify) == 0, 'Wrong balance');\n\n    // 2. Use `interact_with_state` to access and modify the contract's storage\n    interact_with_state(\n        contract_address,\n        || {\n            // 3. Get access to the contract's state\n            let mut state = Contract::contract_state_for_testing();\n\n            // 4. Read from storage\n            let current_balance = state.balances.read(contract_to_modify);\n\n            // 5. Write to storage\n            state.balances.write(contract_to_modify, current_balance + 100);\n        },\n    );\n\n    assert(dispatcher.get_balance_at(contract_to_modify) == 100, 'Wrong balance');\n}\n\n#[test]\nfn test_internal_function() {\n    // 1. Deploy your contract\n    let contract_address = deploy_contract();\n    let dispatcher = IContractDispatcher { contract_address };\n\n    let contract_to_modify: ContractAddress = 0x456.try_into().unwrap();\n\n    assert(dispatcher.get_balance_at(contract_to_modify) == 0, 'Wrong balance');\n\n    // 2. Use `interact_with_state` to call contract's internal function\n    interact_with_state(\n        contract_address,\n        || {\n            // 3. Get access to the contract's state\n            let mut state = Contract::contract_state_for_testing();\n\n            // 4. Call internal function\n            state._internal_set_balance(contract_to_modify, 200);\n        },\n    );\n\n    assert(dispatcher.get_balance_at(contract_to_modify) == 200, 'Wrong balance');\n}\n"
  },
  {
    "path": "docs/listings/testing_contract_internals/tests/lib.cairo",
    "content": "pub mod interact_with_state;\npub mod mocking_the_context_info;\npub mod spying_for_events;\npub mod using_library_calls;\n"
  },
  {
    "path": "docs/listings/testing_contract_internals/tests/mocking_the_context_info.cairo",
    "content": "use core::box::BoxTrait;\nuse core::result::ResultTrait;\nuse snforge_std::{start_cheat_block_number, stop_cheat_block_number, test_address};\nuse starknet::ContractAddress;\n\n#[test]\nfn test_cheat_block_number_test_state() {\n    let test_address: ContractAddress = test_address();\n    let old_block_number = starknet::get_block_info().unbox().block_number;\n\n    start_cheat_block_number(test_address, 234);\n    let new_block_number = starknet::get_block_info().unbox().block_number;\n    assert(new_block_number == 234, 'Wrong block number');\n\n    stop_cheat_block_number(test_address);\n    let new_block_number = starknet::get_block_info().unbox().block_number;\n    assert(new_block_number == old_block_number, 'Block num did not change back');\n}\n"
  },
  {
    "path": "docs/listings/testing_contract_internals/tests/spying_for_events/syscall_tests.cairo",
    "content": "use core::array::ArrayTrait;\nuse core::result::ResultTrait;\nuse snforge_std::{\n    ContractClassTrait, Event, EventSpy, EventSpyAssertionsTrait, EventSpyTrait, declare,\n    spy_events, test_address,\n};\nuse starknet::syscalls::emit_event_syscall;\nuse starknet::{ContractAddress, SyscallResultTrait};\n\n#[test]\nfn test_expect_event() {\n    let contract_address = test_address();\n    let mut spy = spy_events();\n\n    emit_event_syscall(array![1234].span(), array![2345].span()).unwrap_syscall();\n\n    spy\n        .assert_emitted(\n            @array![(contract_address, Event { keys: array![1234], data: array![2345] })],\n        );\n\n    assert(spy.get_events().events.len() == 1, 'There should no more events');\n}\n"
  },
  {
    "path": "docs/listings/testing_contract_internals/tests/spying_for_events/tests.cairo",
    "content": "use core::array::ArrayTrait;\nuse snforge_std::{\n    ContractClassTrait, Event, EventSpy, EventSpyAssertionsTrait, EventSpyTrait, declare,\n    spy_events, test_address,\n};\nuse testing_contract_internals::spying_for_events::Emitter;\n\n#[test]\nfn test_expect_event() {\n    let contract_address = test_address();\n    let mut spy = spy_events();\n\n    let mut testing_state = Emitter::contract_state_for_testing();\n    Emitter::emit_event(ref testing_state);\n\n    spy\n        .assert_emitted(\n            @array![\n                (\n                    contract_address,\n                    Emitter::Event::ThingEmitted(Emitter::ThingEmitted { thing: 420 }),\n                ),\n            ],\n        )\n}\n"
  },
  {
    "path": "docs/listings/testing_contract_internals/tests/spying_for_events.cairo",
    "content": "pub mod syscall_tests;\npub mod tests;\n"
  },
  {
    "path": "docs/listings/testing_contract_internals/tests/using_library_calls.cairo",
    "content": "use snforge_std::{DeclareResultTrait, declare};\nuse starknet::syscalls::library_call_syscall;\nuse starknet::{ClassHash, ContractAddress};\nuse testing_contract_internals::using_library_calls::{\n    ILibraryContractSafeDispatcherTrait, ILibraryContractSafeLibraryDispatcher,\n};\n\n#[test]\nfn test_library_calls() {\n    let class_hash = declare(\"LibraryContract\").unwrap().contract_class().class_hash.clone();\n    let lib_dispatcher = ILibraryContractSafeLibraryDispatcher { class_hash };\n\n    let value = lib_dispatcher.get_value().unwrap();\n    assert(value == 0, 'Incorrect state');\n\n    lib_dispatcher.set_value(10).unwrap();\n\n    let value = lib_dispatcher.get_value().unwrap();\n    assert(value == 10, 'Incorrect state');\n}\n"
  },
  {
    "path": "docs/listings/testing_events/Scarb.toml",
    "content": "[package]\nname = \"testing_events\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/testing_events/src/contract.cairo",
    "content": "#[starknet::interface]\npub trait ISpyEventsChecker<TContractState> {\n    fn emit_one_event(ref self: TContractState, some_data: felt252);\n}\n\n#[starknet::contract]\npub mod SpyEventsChecker {\n    #[storage]\n    struct Storage {}\n\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    pub enum Event {\n        FirstEvent: FirstEvent,\n    }\n\n    #[derive(Drop, starknet::Event)]\n    pub struct FirstEvent {\n        pub some_data: felt252,\n    }\n\n    #[external(v0)]\n    pub fn emit_one_event(ref self: ContractState, some_data: felt252) {\n        self.emit(FirstEvent { some_data });\n    }\n}\n"
  },
  {
    "path": "docs/listings/testing_events/src/lib.cairo",
    "content": "pub mod contract;\npub mod syscall; // syscall_dummy intentionally excluded\n"
  },
  {
    "path": "docs/listings/testing_events/src/syscall.cairo",
    "content": "#[starknet::interface]\npub trait ISpySyscallEventsChecker<TContractState> {\n    fn emit_one_event(ref self: TContractState, some_data: felt252);\n    fn emit_event_with_syscall(ref self: TContractState, some_key: felt252, some_data: felt252);\n}\n\n#[starknet::contract]\npub mod SpySyscallEventsChecker {\n    #[storage]\n    struct Storage {}\n\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    pub enum Event {\n        FirstEvent: FirstEvent,\n    }\n\n    #[derive(Drop, starknet::Event)]\n    pub struct FirstEvent {\n        pub some_data: felt252,\n    }\n\n    #[external(v0)]\n    pub fn emit_one_event(ref self: ContractState, some_data: felt252) {\n        self.emit(FirstEvent { some_data });\n    }\n    use core::starknet::SyscallResultTrait;\n    use core::starknet::syscalls::emit_event_syscall;\n\n    #[external(v0)]\n    pub fn emit_event_with_syscall(ref self: ContractState, some_key: felt252, some_data: felt252) {\n        emit_event_syscall(array![some_key].span(), array![some_data].span()).unwrap_syscall();\n    }\n}\n"
  },
  {
    "path": "docs/listings/testing_events/src/syscall_dummy.cairo",
    "content": "#[starknet::interface]\npub trait ISpySyscallEventsChecker<TContractState> {\n    fn emit_one_event(ref self: TContractState, some_data: felt252);\n    fn emit_event_with_syscall(ref self: TContractState, some_key: felt252, some_data: felt252);\n}\n\n#[starknet::contract]\npub mod SpySyscallEventsChecker {\n    // ...\n    // Rest of the implementation identical to `SpyEventsChecker`\n\n    use core::starknet::SyscallResultTrait;\n    use core::starknet::syscalls::emit_event_syscall;\n\n    #[external(v0)]\n    pub fn emit_event_with_syscall(ref self: ContractState, some_key: felt252, some_data: felt252) {\n        emit_event_syscall(array![some_key].span(), array![some_data].span()).unwrap_syscall();\n    }\n}\n"
  },
  {
    "path": "docs/listings/testing_events/tests/assert_base.cairo",
    "content": "use snforge_std::{\n    declare, ContractClassTrait, DeclareResultTrait, spy_events,\n    EventSpyAssertionsTrait, // Add for assertions on the EventSpy\n    Event // Import the base Event\n};\nuse testing_events::contract::{\n    ISpyEventsCheckerDispatcher, ISpyEventsCheckerDispatcherTrait, SpyEventsChecker,\n};\n\n#[test]\nfn test_simple_assertions() {\n    let contract = declare(\"SpyEventsChecker\").unwrap().contract_class();\n    let (contract_address, _) = contract.deploy(@array![]).unwrap();\n    let dispatcher = ISpyEventsCheckerDispatcher { contract_address };\n\n    let mut spy = spy_events();\n\n    dispatcher.emit_one_event(123);\n\n    let mut keys = array![];\n    keys.append(selector!(\"FirstEvent\")); // Append the name of the event to keys\n    let mut data = array![];\n    data.append(123); // Append the expected data\n\n    let expected = Event { keys, data }; // Instantiate the Event\n\n    spy.assert_emitted(@array![ // Assert\n    (contract_address, expected)]);\n}\n"
  },
  {
    "path": "docs/listings/testing_events/tests/assert_emitted.cairo",
    "content": "use snforge_std::{\n    declare, ContractClassTrait, DeclareResultTrait, spy_events,\n    EventSpyAssertionsTrait // Add for assertions on the EventSpy\n};\nuse testing_events::contract::{\n    ISpyEventsCheckerDispatcher, ISpyEventsCheckerDispatcherTrait, SpyEventsChecker,\n};\n\n#[test]\nfn test_simple_assertions() {\n    let contract = declare(\"SpyEventsChecker\").unwrap().contract_class();\n    let (contract_address, _) = contract.deploy(@array![]).unwrap();\n    let dispatcher = ISpyEventsCheckerDispatcher { contract_address };\n\n    let mut spy = spy_events(); // Ad. 1\n\n    dispatcher.emit_one_event(123);\n\n    spy\n        .assert_emitted(\n            @array![ // Ad. 2\n                (\n                    contract_address,\n                    SpyEventsChecker::Event::FirstEvent(\n                        SpyEventsChecker::FirstEvent { some_data: 123 },\n                    ),\n                ),\n            ],\n        );\n}\n"
  },
  {
    "path": "docs/listings/testing_events/tests/assert_manually.cairo",
    "content": "use snforge_std::{\n    declare, ContractClassTrait, DeclareResultTrait, spy_events, EventSpyAssertionsTrait,\n    EventSpyTrait, // Add for fetching events directly\n    Event, // A structure describing a raw `Event`\n    IsEmitted // Trait for checking if a given event was ever emitted\n};\nuse starknet::ContractAddress;\nuse testing_events::contract::{\n    ISpyEventsCheckerDispatcher, ISpyEventsCheckerDispatcherTrait, SpyEventsChecker,\n};\n\n#[test]\nfn test_complex_assertions() {\n    let contract = declare(\"SpyEventsChecker\").unwrap().contract_class();\n    let (contract_address, _) = contract.deploy(@array![]).unwrap();\n    let dispatcher = ISpyEventsCheckerDispatcher { contract_address };\n\n    let mut spy = spy_events(); // Ad 1.\n\n    dispatcher.emit_one_event(123);\n\n    let events = spy.get_events(); // Ad 2.\n\n    assert(events.events.len() == 1, 'There should be one event');\n\n    let expected_event = SpyEventsChecker::Event::FirstEvent(\n        SpyEventsChecker::FirstEvent { some_data: 123 },\n    );\n\n    assert!(events.is_emitted(contract_address, @expected_event)); // Ad 3.\n\n    let expected_events: Array<(ContractAddress, Event)> = array![\n        (contract_address, expected_event.into()),\n    ];\n\n    assert!(events.events == expected_events); // Ad 4.\n\n    let (from, event) = events.events.at(0); // Ad 5.\n    assert(from == @contract_address, 'Emitted from wrong address');\n    assert(event.keys.len() == 1, 'There should be one key');\n    assert(event.keys.at(0) == @selector!(\"FirstEvent\"), 'Wrong event name'); // Ad 6.\n    assert(event.data.len() == 1, 'There should be one data');\n}\n"
  },
  {
    "path": "docs/listings/testing_events/tests/filter.cairo",
    "content": "use snforge_std::{\n    declare, ContractClassTrait, DeclareResultTrait, spy_events, EventSpyAssertionsTrait,\n    EventSpyTrait, Event,\n    EventsFilterTrait // Add for filtering the Events object (result of `get_events`)\n};\nuse testing_events::contract::{\n    ISpyEventsCheckerDispatcher, ISpyEventsCheckerDispatcherTrait, SpyEventsChecker,\n};\n\n#[test]\nfn test_assertions_with_filtering() {\n    let contract = declare(\"SpyEventsChecker\").unwrap().contract_class();\n    let (first_address, _) = contract.deploy(@array![]).unwrap();\n    let (second_address, _) = contract.deploy(@array![]).unwrap();\n\n    let first_dispatcher = ISpyEventsCheckerDispatcher { contract_address: first_address };\n    let second_dispatcher = ISpyEventsCheckerDispatcher { contract_address: second_address };\n\n    let mut spy = spy_events();\n\n    first_dispatcher.emit_one_event(123);\n    second_dispatcher.emit_one_event(234);\n    second_dispatcher.emit_one_event(345);\n\n    let events_from_first_address = spy.get_events().emitted_by(first_address);\n    let events_from_second_address = spy.get_events().emitted_by(second_address);\n\n    let (from_first, event_from_first) = events_from_first_address.events.at(0);\n    assert(from_first == @first_address, 'Emitted from wrong address');\n    assert(event_from_first.data.at(0) == @123.into(), 'Data should be 123');\n\n    let (from_second_one, event_from_second_one) = events_from_second_address.events.at(0);\n    assert(from_second_one == @second_address, 'Emitted from wrong address');\n    assert(event_from_second_one.data.at(0) == @234.into(), 'Data should be 234');\n\n    let (from_second_two, event_from_second_two) = events_from_second_address.events.at(1);\n    assert(from_second_two == @second_address, 'Emitted from wrong address');\n    assert(event_from_second_two.data.at(0) == @345.into(), 'Data should be 345');\n}\n"
  },
  {
    "path": "docs/listings/testing_events/tests/syscall.cairo",
    "content": "use snforge_std::{\n    ContractClassTrait, DeclareResultTrait, Event, EventSpyAssertionsTrait, EventSpyTrait,\n    EventsFilterTrait, declare, spy_events,\n};\nuse testing_events::syscall::{\n    ISpySyscallEventsCheckerDispatcher, ISpySyscallEventsCheckerDispatcherTrait,\n};\n\n#[test]\nfn test_nonstandard_events() {\n    let contract = declare(\"SpySyscallEventsChecker\").unwrap().contract_class();\n    let (contract_address, _) = contract.deploy(@array![]).unwrap();\n    let dispatcher = ISpySyscallEventsCheckerDispatcher { contract_address };\n\n    let mut spy = spy_events();\n    dispatcher.emit_event_with_syscall(123, 456);\n\n    spy.assert_emitted(@array![(contract_address, Event { keys: array![123], data: array![456] })]);\n}\n"
  },
  {
    "path": "docs/listings/testing_messages_to_l1/Scarb.toml",
    "content": "[package]\nname = \"testing_messages_to_l1\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/testing_messages_to_l1/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait IMessageSender<TContractState> {\n    fn greet_ethereum(ref self: TContractState, receiver: felt252);\n}\n\n#[starknet::contract]\npub mod MessageSender {\n    #[storage]\n    struct Storage {}\n    use starknet::syscalls::send_message_to_l1_syscall;\n\n    #[external(v0)]\n    pub fn greet_ethereum(ref self: ContractState, receiver: felt252) {\n        let payload = array!['hello'];\n        send_message_to_l1_syscall(receiver, payload.span()).unwrap();\n    }\n}\n"
  },
  {
    "path": "docs/listings/testing_messages_to_l1/tests/detailed.cairo",
    "content": "use snforge_std::{\n    ContractClassTrait, DeclareResultTrait, MessageToL1, MessageToL1FilterTrait,\n    MessageToL1SpyAssertionsTrait, MessageToL1SpyTrait, declare, spy_messages_to_l1,\n};\nuse starknet::EthAddress;\nuse testing_messages_to_l1::{IMessageSenderDispatcher, IMessageSenderDispatcherTrait};\n\n#[test]\nfn test_spying_l1_messages_details() {\n    let mut spy = spy_messages_to_l1();\n\n    let contract = declare(\"MessageSender\").unwrap().contract_class();\n    let (contract_address, _) = contract.deploy(@array![]).unwrap();\n\n    let dispatcher = IMessageSenderDispatcher { contract_address };\n\n    let receiver_address: felt252 = 0x2137;\n    let receiver_l1_address: EthAddress = receiver_address.try_into().unwrap();\n\n    dispatcher.greet_ethereum(receiver_address);\n\n    let messages = spy.get_messages();\n\n    // Use filtering optionally on MessagesToL1 instance\n    let messages_from_specific_address = messages.sent_by(contract_address);\n    let messages_to_specific_address = messages_from_specific_address.sent_to(receiver_l1_address);\n\n    // Get the messages from the MessagesToL1 structure\n    let (from, message) = messages_to_specific_address.messages.at(0);\n\n    // Assert the sender\n    assert!(*from == contract_address, \"Sent from wrong address\");\n\n    // Assert the MessageToL1 fields\n    assert!(*message.to_address == receiver_l1_address, \"Wrong L1 address of the receiver\");\n    assert!(message.payload.len() == 1, \"There should be 3 items in the data\");\n    assert!(*message.payload.at(0) == 'hello', \"Expected \\\"hello\\\" in payload\");\n}\n"
  },
  {
    "path": "docs/listings/testing_messages_to_l1/tests/lib.cairo",
    "content": "pub mod detailed;\npub mod simple;\n"
  },
  {
    "path": "docs/listings/testing_messages_to_l1/tests/simple.cairo",
    "content": "use snforge_std::{\n    ContractClassTrait, DeclareResultTrait, MessageToL1, MessageToL1SpyAssertionsTrait, declare,\n    spy_messages_to_l1,\n};\nuse starknet::EthAddress;\nuse testing_messages_to_l1::{IMessageSenderDispatcher, IMessageSenderDispatcherTrait};\n\n#[test]\nfn test_spying_l1_messages() {\n    let mut spy = spy_messages_to_l1();\n\n    let contract = declare(\"MessageSender\").unwrap().contract_class();\n    let (contract_address, _) = contract.deploy(@array![]).unwrap();\n\n    let dispatcher = IMessageSenderDispatcher { contract_address };\n\n    let receiver_address: felt252 = 0x2137;\n    dispatcher.greet_ethereum(receiver_address);\n\n    let expected_payload = array!['hello'];\n    let receiver_l1_address: EthAddress = receiver_address.try_into().unwrap();\n\n    spy\n        .assert_sent(\n            @array![\n                (\n                    contract_address, // Message sender\n                    MessageToL1 { // Message content (receiver and payload)\n                        to_address: receiver_l1_address, payload: expected_payload,\n                    },\n                ),\n            ],\n        );\n}\n"
  },
  {
    "path": "docs/listings/testing_reference/Scarb.toml",
    "content": "[package]\nname = \"testing_reference\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.12.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.starknet-contract]]\n"
  },
  {
    "path": "docs/listings/testing_reference/src/lib.cairo",
    "content": "\n"
  },
  {
    "path": "docs/listings/testing_reference/tests/tests.cairo",
    "content": "use snforge_std::testing::get_current_vm_step;\n\n#[feature(\"safe_dispatcher\")]\nfn setup() {\n    let mut _counter = 0_u32;\n\n    while _counter < 1_000 {\n        _counter += 1;\n    }\n}\n\n#[test]\nfn test_setup_steps() {\n    let steps_start = get_current_vm_step();\n    setup();\n    let steps_end = get_current_vm_step();\n\n    // Assert that setup used no more than 20_000 steps\n    assert!(steps_end - steps_start <= 20_000);\n}\n"
  },
  {
    "path": "docs/listings/testing_smart_contracts_handling_errors/Scarb.toml",
    "content": "[package]\nname = \"testing_smart_contracts_handling_errors\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/testing_smart_contracts_handling_errors/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait IPanicContract<TContractState> {\n    fn do_a_panic(self: @TContractState);\n    fn do_a_string_panic(self: @TContractState);\n}\n\n#[starknet::contract]\npub mod PanicContract {\n    use core::array::ArrayTrait;\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    pub impl PanicContractImpl of super::IPanicContract<ContractState> {\n        // Panics\n        fn do_a_panic(self: @ContractState) {\n            panic(array!['PANIC', 'DAYTAH']);\n        }\n\n        fn do_a_string_panic(self: @ContractState) {\n            // A macro which allows panicking with a ByteArray (string) instance\n            panic!(\"This is panicking with a string, which can be longer than 31 characters\");\n        }\n    }\n}\n"
  },
  {
    "path": "docs/listings/testing_smart_contracts_handling_errors/tests/handle_panic.cairo",
    "content": "// Necessary utility function import\nuse snforge_std::byte_array::try_deserialize_bytearray_error;\nuse snforge_std::{ContractClassTrait, DeclareResultTrait, declare};\nuse testing_smart_contracts_handling_errors::{\n    IPanicContractSafeDispatcher, IPanicContractSafeDispatcherTrait,\n};\n\n#[test]\n#[feature(\"safe_dispatcher\")]\nfn handling_string_errors() {\n    let contract = declare(\"PanicContract\").unwrap().contract_class();\n    let (contract_address, _) = contract.deploy(@array![]).unwrap();\n    let safe_dispatcher = IPanicContractSafeDispatcher { contract_address };\n\n    match safe_dispatcher.do_a_string_panic() {\n        Result::Ok(_) => panic!(\"Entrypoint did not panic\"),\n        Result::Err(panic_data) => {\n            let str_err = try_deserialize_bytearray_error(panic_data.span()).expect('wrong format');\n\n            assert(\n                str_err == \"This is panicking with a string, which can be longer than 31 characters\",\n                'wrong string received',\n            );\n        },\n    };\n}\n"
  },
  {
    "path": "docs/listings/testing_smart_contracts_handling_errors/tests/panic.cairo",
    "content": "//ANCHOR:first_half\nuse snforge_std::{ContractClassTrait, DeclareResultTrait, declare};\nuse testing_smart_contracts_handling_errors::{\n    IPanicContractDispatcher, IPanicContractDispatcherTrait,\n};\n\n#[test]\n//ANCHOR_END:first_half\n//ANCHOR:second_half\nfn failing() {\n    let contract = declare(\"PanicContract\").unwrap().contract_class();\n    let (contract_address, _) = contract.deploy(@array![]).unwrap();\n    let dispatcher = IPanicContractDispatcher { contract_address };\n\n    dispatcher.do_a_panic();\n}\n//ANCHOR_END:second_half\n\nmod dummy {} // trick `scarb fmt --check`\n"
  },
  {
    "path": "docs/listings/testing_smart_contracts_safe_dispatcher/Scarb.toml",
    "content": "[package]\nname = \"testing_smart_contracts_safe_dispatcher\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/testing_smart_contracts_safe_dispatcher/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait IPanicContract<TContractState> {\n    fn do_a_panic(self: @TContractState);\n    fn do_a_string_panic(self: @TContractState);\n}\n\n#[starknet::contract]\npub mod PanicContract {\n    use core::array::ArrayTrait;\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    pub impl PanicContractImpl of super::IPanicContract<ContractState> {\n        // Panics\n        fn do_a_panic(self: @ContractState) {\n            panic(array!['PANIC', 'DAYTAH']);\n        }\n\n        fn do_a_string_panic(self: @ContractState) {\n            // A macro which allows panicking with a ByteArray (string) instance\n            panic!(\"This is panicking with a string, which can be longer than 31 characters\");\n        }\n    }\n}\n"
  },
  {
    "path": "docs/listings/testing_smart_contracts_safe_dispatcher/tests/safe_dispatcher.cairo",
    "content": "use snforge_std::{ContractClassTrait, DeclareResultTrait, declare};\nuse testing_smart_contracts_safe_dispatcher::{\n    IPanicContractSafeDispatcher, IPanicContractSafeDispatcherTrait,\n};\n\n#[test]\n#[feature(\"safe_dispatcher\")]\nfn handling_errors() {\n    let contract = declare(\"PanicContract\").unwrap().contract_class();\n    let (contract_address, _) = contract.deploy(@array![]).unwrap();\n    let safe_dispatcher = IPanicContractSafeDispatcher { contract_address };\n\n    match safe_dispatcher.do_a_panic() {\n        Result::Ok(_) => panic!(\"Entrypoint did not panic\"),\n        Result::Err(panic_data) => {\n            assert(*panic_data.at(0) == 'PANIC', *panic_data.at(0));\n            assert(*panic_data.at(1) == 'DAYTAH', *panic_data.at(1));\n        },\n    };\n}\n"
  },
  {
    "path": "docs/listings/testing_smart_contracts_writing_tests/Scarb.toml",
    "content": "[package]\nname = \"testing_smart_contracts_writing_tests\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/testing_smart_contracts_writing_tests/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait ISimpleContract<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n}\n\n#[starknet::contract]\npub mod SimpleContract {\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[abi(embed_v0)]\n    pub impl SimpleContractImpl of super::ISimpleContract<ContractState> {\n        // Increases the balance by the given amount\n        fn increase_balance(ref self: ContractState, amount: felt252) {\n            self.balance.write(self.balance.read() + amount);\n        }\n\n        // Gets the balance.\n        fn get_balance(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n    }\n}\n"
  },
  {
    "path": "docs/listings/testing_smart_contracts_writing_tests/tests/simple_contract.cairo",
    "content": "use snforge_std::{ContractClassTrait, DeclareResultTrait, declare};\nuse testing_smart_contracts_writing_tests::{\n    ISimpleContractDispatcher, ISimpleContractDispatcherTrait,\n};\n\n#[test]\nfn call_and_invoke() {\n    // First declare and deploy a contract\n    let contract = declare(\"SimpleContract\").unwrap().contract_class();\n    // Alternatively we could use `deploy_syscall` here\n    let (contract_address, _) = contract.deploy(@array![]).unwrap();\n\n    // Create a Dispatcher object that will allow interacting with the deployed contract\n    let dispatcher = ISimpleContractDispatcher { contract_address };\n\n    // Call a view function of the contract\n    let balance = dispatcher.get_balance();\n    assert(balance == 0, 'balance == 0');\n\n    // Call a function of the contract\n    // Here we mutate the state of the storage\n    dispatcher.increase_balance(100);\n\n    // Check that transaction took effect\n    let balance = dispatcher.get_balance();\n    assert(balance == 100, 'balance == 100');\n}\n"
  },
  {
    "path": "docs/listings/tests_partitioning/Scarb.toml",
    "content": "[package]\nname = \"tests_partitioning\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.12.0\"\nassert_macros = \"2.12.0\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/tests_partitioning/src/lib.cairo",
    "content": "#[starknet::contract]\npub mod HelloStarknet {\n    #[storage]\n    struct Storage {}\n}\n"
  },
  {
    "path": "docs/listings/tests_partitioning/tests/example.cairo",
    "content": "#[test]\nfn test_a() {\n    assert_eq!(1 + 1, 2);\n}\n\n#[test]\nfn test_b() {\n    assert_eq!(1 + 1, 2);\n}\n\n#[test]\nfn test_c() {\n    assert_eq!(1 + 1, 2);\n}\n\n#[test]\nfn test_d() {\n    assert_eq!(1 + 1, 2);\n}\n\n#[test]\nfn test_e() {\n    assert_eq!(1 + 1, 2);\n}\n\n#[test]\nfn test_f() {\n    assert_eq!(1 + 1, 2);\n}\n\n#[test]\nfn test_g() {\n    assert_eq!(1 + 1, 2);\n}\n"
  },
  {
    "path": "docs/listings/tx_status/Scarb.toml",
    "content": "[package]\nname = \"tx_status\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\nsnforge_std = { path = \"../../../snforge_std\" }\nsncast_std = { path = \"../../../sncast_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/tx_status/src/lib.cairo",
    "content": "use sncast_std::tx_status;\n\nfn main() {\n    let transaction_hash = 0x00ae35dacba17cde62b8ceb12e3b18f4ab6e103fa2d5e3d9821cb9dc59d59a3c;\n    let status = tx_status(transaction_hash).expect('Failed to get status');\n\n    println!(\"transaction status: {:?}\", status);\n}\n"
  },
  {
    "path": "docs/listings/using_cheatcodes/Scarb.toml",
    "content": "[package]\nname = \"using_cheatcodes\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\nassert_macros = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/using_cheatcodes/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait ICheatcodeChecker<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n    fn get_block_number_at_construction(self: @TContractState) -> u64;\n    fn get_block_timestamp_at_construction(self: @TContractState) -> u64;\n}\n\n#[starknet::contract]\npub mod CheatcodeChecker {\n    use core::box::BoxTrait;\n    use starknet::get_caller_address;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        balance: felt252,\n        blk_nb: u64,\n        blk_timestamp: u64,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState) {\n        // store the current block number\n        self.blk_nb.write(starknet::get_block_info().unbox().block_number);\n        // store the current block timestamp\n        self.blk_timestamp.write(starknet::get_block_info().unbox().block_timestamp);\n    }\n\n    #[abi(embed_v0)]\n    impl ICheatcodeCheckerImpl of super::ICheatcodeChecker<ContractState> {\n        // Increases the balance by the given amount\n        fn increase_balance(ref self: ContractState, amount: felt252) {\n            assert_is_allowed_user();\n            self.balance.write(self.balance.read() + amount);\n        }\n        // Gets the balance.\n        fn get_balance(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n        // Gets the block number\n        fn get_block_number_at_construction(self: @ContractState) -> u64 {\n            self.blk_nb.read()\n        }\n        // Gets the block timestamp\n        fn get_block_timestamp_at_construction(self: @ContractState) -> u64 {\n            self.blk_timestamp.read()\n        }\n    }\n\n    fn assert_is_allowed_user() {\n        // checks if caller is '123'\n        let address = get_caller_address();\n        assert(address.into() == 123, 'user is not allowed');\n    }\n}\n"
  },
  {
    "path": "docs/listings/using_cheatcodes/tests/lib.cairo",
    "content": "use snforge_std::{ContractClassTrait, DeclareResultTrait, declare};\nuse using_cheatcodes::{ICheatcodeCheckerDispatcher, ICheatcodeCheckerDispatcherTrait};\n\n#[test]\nfn call_and_invoke() {\n    let contract = declare(\"CheatcodeChecker\").unwrap().contract_class();\n    let (contract_address, _) = contract.deploy(@array![]).unwrap();\n    let dispatcher = ICheatcodeCheckerDispatcher { contract_address };\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 0, 'balance == 0');\n\n    dispatcher.increase_balance(100);\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 100, 'balance == 100');\n}\n"
  },
  {
    "path": "docs/listings/using_cheatcodes_cancelling_cheat/Scarb.toml",
    "content": "[package]\nname = \"using_cheatcodes_cancelling_cheat\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\nassert_macros = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/using_cheatcodes_cancelling_cheat/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait ICheatcodeChecker<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n    fn get_block_number_at_construction(self: @TContractState) -> u64;\n    fn get_block_timestamp_at_construction(self: @TContractState) -> u64;\n}\n\n#[starknet::contract]\npub mod CheatcodeChecker {\n    use core::box::BoxTrait;\n    use starknet::get_caller_address;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        balance: felt252,\n        blk_nb: u64,\n        blk_timestamp: u64,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState) {\n        // store the current block number\n        self.blk_nb.write(starknet::get_block_info().unbox().block_number);\n        // store the current block timestamp\n        self.blk_timestamp.write(starknet::get_block_info().unbox().block_timestamp);\n    }\n\n    #[abi(embed_v0)]\n    impl ICheatcodeCheckerImpl of super::ICheatcodeChecker<ContractState> {\n        // Increases the balance by the given amount\n        fn increase_balance(ref self: ContractState, amount: felt252) {\n            assert_is_allowed_user();\n            self.balance.write(self.balance.read() + amount);\n        }\n        // Gets the balance.\n        fn get_balance(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n        // Gets the block number\n        fn get_block_number_at_construction(self: @ContractState) -> u64 {\n            self.blk_nb.read()\n        }\n        // Gets the block timestamp\n        fn get_block_timestamp_at_construction(self: @ContractState) -> u64 {\n            self.blk_timestamp.read()\n        }\n    }\n\n    fn assert_is_allowed_user() {\n        // checks if caller is '123'\n        let address = get_caller_address();\n        assert(address.into() == 123, 'user is not allowed');\n    }\n}\n"
  },
  {
    "path": "docs/listings/using_cheatcodes_cancelling_cheat/tests/lib.cairo",
    "content": "use snforge_std::{\n    ContractClassTrait, DeclareResultTrait, declare, start_cheat_caller_address,\n    stop_cheat_caller_address,\n};\nuse using_cheatcodes_cancelling_cheat::{\n    ICheatcodeCheckerSafeDispatcher, ICheatcodeCheckerSafeDispatcherTrait,\n};\n\n#[test]\n#[feature(\"safe_dispatcher\")]\nfn call_and_invoke() {\n    let contract = declare(\"CheatcodeChecker\").unwrap().contract_class();\n    let (contract_address, _) = contract.deploy(@array![]).unwrap();\n    let dispatcher = ICheatcodeCheckerSafeDispatcher { contract_address };\n\n    let balance = dispatcher.get_balance().unwrap();\n    assert(balance == 0, 'balance == 0');\n\n    // Change the caller address to 123 when calling the contract at the `contract_address` address\n    start_cheat_caller_address(contract_address, 123.try_into().unwrap());\n\n    // Call to method with caller restriction succeeds\n    dispatcher.increase_balance(100).expect('First call failed!');\n\n    let balance = dispatcher.get_balance();\n    assert_eq!(balance, Result::Ok(100));\n\n    // Cancel the cheat\n    stop_cheat_caller_address(contract_address);\n\n    // The call fails now\n    dispatcher.increase_balance(100).expect('Second call failed!');\n\n    let balance = dispatcher.get_balance();\n    assert_eq!(balance, Result::Ok(100));\n}\n"
  },
  {
    "path": "docs/listings/using_cheatcodes_cheat_address/Scarb.toml",
    "content": "[package]\nname = \"using_cheatcodes_cheat_address\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\nassert_macros = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/using_cheatcodes_cheat_address/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait ICheatcodeChecker<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n    fn get_block_number_at_construction(self: @TContractState) -> u64;\n    fn get_block_timestamp_at_construction(self: @TContractState) -> u64;\n}\n\n#[starknet::contract]\npub mod CheatcodeChecker {\n    use core::box::BoxTrait;\n    use starknet::get_caller_address;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        balance: felt252,\n        blk_nb: u64,\n        blk_timestamp: u64,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState) {\n        // store the current block number\n        self.blk_nb.write(starknet::get_block_info().unbox().block_number);\n        // store the current block timestamp\n        self.blk_timestamp.write(starknet::get_block_info().unbox().block_timestamp);\n    }\n\n    #[abi(embed_v0)]\n    impl ICheatcodeCheckerImpl of super::ICheatcodeChecker<ContractState> {\n        // Increases the balance by the given amount\n        fn increase_balance(ref self: ContractState, amount: felt252) {\n            assert_is_allowed_user();\n            self.balance.write(self.balance.read() + amount);\n        }\n        // Gets the balance.\n        fn get_balance(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n        // Gets the block number\n        fn get_block_number_at_construction(self: @ContractState) -> u64 {\n            self.blk_nb.read()\n        }\n        // Gets the block timestamp\n        fn get_block_timestamp_at_construction(self: @ContractState) -> u64 {\n            self.blk_timestamp.read()\n        }\n    }\n\n    fn assert_is_allowed_user() {\n        // checks if caller is '123'\n        let address = get_caller_address();\n        assert(address.into() == 123, 'user is not allowed');\n    }\n}\n"
  },
  {
    "path": "docs/listings/using_cheatcodes_cheat_address/tests/lib.cairo",
    "content": "use snforge_std::{ContractClassTrait, DeclareResultTrait, declare, start_cheat_caller_address};\nuse using_cheatcodes_cheat_address::{ICheatcodeCheckerDispatcher, ICheatcodeCheckerDispatcherTrait};\n\n#[test]\nfn call_and_invoke() {\n    let contract = declare(\"CheatcodeChecker\").unwrap().contract_class();\n    let (contract_address, _) = contract.deploy(@array![]).unwrap();\n    let dispatcher = ICheatcodeCheckerDispatcher { contract_address };\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 0, 'balance == 0');\n\n    // Change the caller address to 123 when calling the contract at the `contract_address` address\n    start_cheat_caller_address(contract_address, 123.try_into().unwrap());\n\n    dispatcher.increase_balance(100);\n\n    let balance = dispatcher.get_balance();\n    assert(balance == 100, 'balance == 100');\n}\n"
  },
  {
    "path": "docs/listings/using_cheatcodes_others/Scarb.toml",
    "content": "[package]\nname = \"using_cheatcodes_others\"\nversion = \"0.1.0\"\nedition = \"2024_07\"\n\n[dependencies]\nstarknet = \"2.8.5\"\nassert_macros = \"2.8.5\"\n\n[dev-dependencies]\nsnforge_std = { path = \"../../../snforge_std\" }\n\n[[target.starknet-contract]]\nsierra = true\n\n[scripts]\ntest = \"snforge test\"\n"
  },
  {
    "path": "docs/listings/using_cheatcodes_others/src/lib.cairo",
    "content": "#[starknet::interface]\npub trait ICheatcodeChecker<TContractState> {\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    fn get_balance(self: @TContractState) -> felt252;\n    fn get_block_number_at_construction(self: @TContractState) -> u64;\n    fn get_block_timestamp_at_construction(self: @TContractState) -> u64;\n}\n\n#[starknet::contract]\npub mod CheatcodeChecker {\n    use core::box::BoxTrait;\n    use starknet::get_caller_address;\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        balance: felt252,\n        blk_nb: u64,\n        blk_timestamp: u64,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState) {\n        // store the current block number\n        self.blk_nb.write(starknet::get_block_info().unbox().block_number);\n        // store the current block timestamp\n        self.blk_timestamp.write(starknet::get_block_info().unbox().block_timestamp);\n    }\n\n    #[abi(embed_v0)]\n    impl ICheatcodeCheckerImpl of super::ICheatcodeChecker<ContractState> {\n        // Increases the balance by the given amount\n        fn increase_balance(ref self: ContractState, amount: felt252) {\n            assert_is_allowed_user();\n            self.balance.write(self.balance.read() + amount);\n        }\n        // Gets the balance.\n        fn get_balance(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n        // Gets the block number\n        fn get_block_number_at_construction(self: @ContractState) -> u64 {\n            self.blk_nb.read()\n        }\n        // Gets the block timestamp\n        fn get_block_timestamp_at_construction(self: @ContractState) -> u64 {\n            self.blk_timestamp.read()\n        }\n    }\n\n    fn assert_is_allowed_user() {\n        // checks if caller is '123'\n        let address = get_caller_address();\n        assert(address.into() == 123, 'user is not allowed');\n    }\n}\n"
  },
  {
    "path": "docs/listings/using_cheatcodes_others/tests/caller_address/proper_use_global.cairo",
    "content": "use snforge_std::{\n    ContractClassTrait, DeclareResultTrait, declare, start_cheat_caller_address_global,\n    stop_cheat_caller_address_global,\n};\nuse using_cheatcodes_others::{ICheatcodeCheckerDispatcher, ICheatcodeCheckerDispatcherTrait};\n\n#[test]\nfn call_and_invoke_global() {\n    let contract = declare(\"CheatcodeChecker\").unwrap().contract_class();\n    let (contract_address_a, _) = contract.deploy(@array![]).unwrap();\n    let (contract_address_b, _) = contract.deploy(@array![]).unwrap();\n    let dispatcher_a = ICheatcodeCheckerDispatcher { contract_address: contract_address_a };\n    let dispatcher_b = ICheatcodeCheckerDispatcher { contract_address: contract_address_b };\n\n    let balance_a = dispatcher_a.get_balance();\n    let balance_b = dispatcher_b.get_balance();\n    assert_eq!(balance_a, 0);\n    assert_eq!(balance_b, 0);\n\n    // Change the caller address to 123, both targets a and b will be affected\n    // global cheatcodes work indefinitely until stopped\n    start_cheat_caller_address_global(123.try_into().unwrap());\n\n    dispatcher_a.increase_balance(100);\n    dispatcher_b.increase_balance(100);\n\n    let balance_a = dispatcher_a.get_balance();\n    let balance_b = dispatcher_b.get_balance();\n    assert_eq!(balance_a, 100);\n    assert_eq!(balance_b, 100);\n\n    // Cancel the cheat\n    stop_cheat_caller_address_global();\n}\n"
  },
  {
    "path": "docs/listings/using_cheatcodes_others/tests/caller_address/span.cairo",
    "content": "use snforge_std::{CheatSpan, ContractClassTrait, DeclareResultTrait, cheat_caller_address, declare};\nuse starknet::ContractAddress;\nuse using_cheatcodes_others::{\n    ICheatcodeCheckerSafeDispatcher, ICheatcodeCheckerSafeDispatcherTrait,\n};\n\n#[test]\n#[feature(\"safe_dispatcher\")]\nfn call_and_invoke() {\n    let contract = declare(\"CheatcodeChecker\").unwrap().contract_class();\n    let (contract_address, _) = contract.deploy(@array![]).unwrap();\n    let safe_dispatcher = ICheatcodeCheckerSafeDispatcher { contract_address };\n\n    let balance = safe_dispatcher.get_balance().unwrap();\n    assert_eq!(balance, 0);\n\n    // Function `increase_balance` from HelloStarknet contract\n    // requires the caller_address to be 123\n    let spoofed_caller: ContractAddress = 123.try_into().unwrap();\n\n    // Change the caller address for the contract_address for a span of 2 target calls (here, calls\n    // to contract_address)\n    cheat_caller_address(contract_address, spoofed_caller, CheatSpan::TargetCalls(2));\n\n    // Call #1 should succeed\n    let call_1_result = safe_dispatcher.increase_balance(100);\n    assert!(call_1_result.is_ok());\n\n    // Call #2 should succeed\n    let call_2_result = safe_dispatcher.increase_balance(100);\n    assert!(call_2_result.is_ok());\n\n    // Call #3 should fail, as the cheat_caller_address cheatcode has been canceled\n    let call_3_result = safe_dispatcher.increase_balance(100);\n    assert_eq!(call_3_result, Result::Err(array!['user is not allowed']));\n\n    let balance = safe_dispatcher.get_balance().unwrap();\n    assert_eq!(balance, 200);\n}\n"
  },
  {
    "path": "docs/listings/using_cheatcodes_others/tests/caller_address.cairo",
    "content": "pub mod proper_use_global;\npub mod span;\n"
  },
  {
    "path": "docs/listings/using_cheatcodes_others/tests/cheat_constructor.cairo",
    "content": "use snforge_std::{\n    ContractClassTrait, DeclareResultTrait, declare, start_cheat_block_number,\n    start_cheat_block_timestamp,\n};\nuse using_cheatcodes_others::{ICheatcodeCheckerDispatcher, ICheatcodeCheckerDispatcherTrait};\n\n#[test]\nfn call_and_invoke() {\n    let contract = declare(\"CheatcodeChecker\").unwrap().contract_class();\n\n    // Precalculate the address to obtain the contract address before the constructor call (deploy)\n    let contract_address = contract.precalculate_address(@array![]);\n\n    // Change the block number and timestamp before the call to contract.deploy\n    start_cheat_block_number(contract_address, 0x420_u64);\n    start_cheat_block_timestamp(contract_address, 0x2137_u64);\n\n    // Deploy as normally\n    contract.deploy(@array![]).unwrap();\n\n    // Construct a dispatcher with the precalculated address\n    let dispatcher = ICheatcodeCheckerDispatcher { contract_address };\n\n    let block_number = dispatcher.get_block_number_at_construction();\n    let block_timestamp = dispatcher.get_block_timestamp_at_construction();\n\n    assert_eq!(block_number, 0x420_u64);\n    assert_eq!(block_timestamp, 0x2137_u64);\n}\n"
  },
  {
    "path": "docs/listings/using_cheatcodes_others/tests/lib.cairo",
    "content": "pub mod caller_address;\npub mod cheat_constructor;\npub mod set_balance_custom_token;\npub mod set_balance_strk;\n"
  },
  {
    "path": "docs/listings/using_cheatcodes_others/tests/set_balance_custom_token.cairo",
    "content": "use snforge_std::{\n    ContractClassTrait, CustomToken, DeclareResultTrait, Token, TokenImpl, TokenTrait, declare,\n    set_balance,\n};\nuse starknet::syscalls::call_contract_syscall;\nuse starknet::{ContractAddress, SyscallResultTrait};\n\nfn deploy_contract(name: ByteArray, constructor_calldata: Array<felt252>) -> ContractAddress {\n    let contract = declare(name).unwrap().contract_class();\n    let (contract_address, _) = contract.deploy(@constructor_calldata).unwrap();\n    contract_address\n}\n\n\n#[test]\nfn set_balance_custom_token() {\n    // Deploy your own token with ERC20 contract\n    let constructor_calldata = array![\n        'CustomToken ', // Token name\n        'CTKN', // Token symbol\n        18, // Decimals\n        999_000_000, // Initial supply (u256 high)\n        0, // Initial supply (u256 low)\n        1234 // Recipient address\n    ];\n    let token_contract_address = deploy_contract(\"ERC20\", constructor_calldata);\n\n    // Example user address, whose balance we want to set\n    let user_address: ContractAddress = 0x123.try_into().unwrap();\n\n    // Define custom token\n    let token = Token::Custom(\n        CustomToken {\n            contract_address: token_contract_address,\n            // In this example, we assume that the balances variable is named `balances`\n            balances_variable_selector: selector!(\"balances\"),\n        },\n    );\n\n    set_balance(user_address, 1_000_000, token);\n\n    // Read the balance\n    let balance = call_contract_syscall(\n        token.contract_address().into(),\n        selector!(\"balance_of\"),\n        array![user_address.into()].span(),\n    )\n        .unwrap_syscall();\n\n    assert(balance == array![1_000_000, 0].span(), 'Invalid balance');\n}\n"
  },
  {
    "path": "docs/listings/using_cheatcodes_others/tests/set_balance_strk.cairo",
    "content": "use snforge_std::{Token, TokenImpl, TokenTrait, set_balance};\nuse starknet::syscalls::call_contract_syscall;\nuse starknet::{ContractAddress, SyscallResultTrait};\n\n#[test]\nfn set_balance_strk() {\n    // Example user address, whose balance we want to set\n    let user_address: ContractAddress = 0x123.try_into().unwrap();\n\n    set_balance(user_address, 1_000_000, Token::STRK);\n\n    // Read the balance\n    let balance = call_contract_syscall(\n        Token::STRK.contract_address().into(),\n        selector!(\"balance_of\"),\n        array![user_address.into()].span(),\n    )\n        .unwrap_syscall();\n\n    assert(balance == array![1_000_000, 0].span(), 'Invalid balance');\n}\n\n"
  },
  {
    "path": "docs/src/README.md",
    "content": "<img src=\"images/logo.png\" alt=\"logo\" style=\"margin-left: 20px\" width=\"120\" align=\"right\" />\n\n# The Starknet Foundry\n\nStarknet Foundry is a toolchain for developing Starknet smart contracts.\nIt helps with writing, deploying, and testing your smart contracts.\nIt is inspired by [Foundry](https://www.getfoundry.sh/).\n"
  },
  {
    "path": "docs/src/SUMMARY.md",
    "content": "# Summary\n\n[Introduction](./README.md)\n\n# Getting Started\n\n* [Installation](getting-started/installation.md)\n* [First Steps with Starknet Foundry](getting-started/first-steps.md)\n* [Scarb](getting-started/scarb.md)\n* [Project Configuration](projects/configuration.md)\n* [Blake Hash Support](getting-started/blake-hash-support.md)\n\n---\n\n# `snforge` Overview\n\n* [Running Tests](testing/running-tests.md)\n* [Writing Tests](testing/testing.md)\n* [Test Attributes](testing/test-attributes.md)\n* [Testing Smart Contracts](testing/contracts.md)\n* [Testing Contracts' Internals](testing/testing-contract-internals.md)\n* [Using Cheatcodes](testing/using-cheatcodes.md)\n* [Testing Events](testing/testing-events.md)\n* [Testing Messages to L1](testing/testing-messages-to-l1.md)\n* [Testing Workspaces](testing/testing-workspaces.md)\n* [Test Collection](testing/test-collection.md)\n* [Contract Collection](testing/contracts-collection.md)\n    * [Optimized Mechanism](testing/contract-collection/new-mechanism.md)\n    * [Old Mechanism](testing/contract-collection/old-mechanism.md)\n* [Gas and VM Resources Estimation](testing/gas-and-resource-estimation.md)\n* [Coverage](testing/coverage.md)\n\n# `snforge` Advanced Features\n\n* [Fork Testing](snforge-advanced-features/fork-testing.md)\n* [Fuzz Testing](snforge-advanced-features/fuzz-testing.md)\n* [Direct Storage Access](snforge-advanced-features/storage-cheatcodes.md)\n* [Profiling](snforge-advanced-features/profiling.md)\n* [Debugging](snforge-advanced-features/debugging.md)\n* [Oracles](snforge-advanced-features/oracles.md)\n* [Parametrized Tests](snforge-advanced-features/parametrized-testing.md)\n* [Tests Partitioning](snforge-advanced-features/tests-partitioning.md)\n\n---\n\n# `sncast` Overview\n\n* [Outline](starknet/sncast-overview.md)\n* [`sncast` 101](starknet/101.md)\n* [Creating And Deploying Accounts](starknet/account.md)\n* [Account Balance](starknet/account-balance.md)\n* [Importing Accounts](starknet/account-import.md)\n* [Declaring New Contracts](starknet/declare.md)\n* [Deploying New Contracts](starknet/deploy.md)\n* [Invoking Contracts](starknet/invoke.md)\n* [Calling Contracts](starknet/call.md)\n* [Performing Multicall](starknet/multicall.md)\n* [Cairo Deployment Scripts](starknet/script.md)\n* [Inspecting Transactions](starknet/tx-status.md)\n* [Verifying Contracts](starknet/verify.md)\n* [Calldata Transformation](starknet/calldata-transformation.md)\n* [Block Explorers](starknet/block_explorer.md)\n* [Integration With Devnet](starknet/integration_with_devnet.md)\n* [Developer Functionalities](starknet/developer.md)\n* [Ledger Hardware Wallet](starknet/ledger.md)\n    * [EIP-2645 HD Paths](starknet/eip-2645-hd-paths.md)\n\n---\n\n# Foundry Development\n\n* [Environment Setup](development/environment-setup.md)\n* [Shell snippets](development/shell-snippets.md)\n* [Snapshot tests](development/snapshot-tests.md)\n\n---\n\n# Appendix\n\n* [`snforge` Commands](appendix/snforge.md)\n    * [test](appendix/snforge/test.md)\n    * [new](appendix/snforge/new.md)\n    * [clean](appendix/snforge/clean.md)\n    * [clean-cache](appendix/snforge/clean-cache.md)\n    * [check-requirements](appendix/snforge/check-requirements.md)\n    * [completions](appendix/snforge/completions.md)\n    * [optimize-inlining](appendix/snforge/optimize-inlining.md)\n* [Cheatcodes Reference](appendix/cheatcodes.md)\n    * [Cheating Globally](appendix/cheatcodes/global.md)\n    * [CheatSpan](appendix/cheatcodes/cheat_span.md)\n    * [caller_address](appendix/cheatcodes/caller_address.md)\n    * [block_number](appendix/cheatcodes/block_number.md)\n    * [block_timestamp](appendix/cheatcodes/block_timestamp.md)\n    * [block_hash](appendix/cheatcodes/block_hash.md)\n    * [sequencer_address](appendix/cheatcodes/sequencer_address.md)\n    * [version](appendix/cheatcodes/transaction_version.md)\n    * [account_contract_address](appendix/cheatcodes/account_contract_address.md)\n    * [max_fee](appendix/cheatcodes/max_fee.md)\n    * [signature](appendix/cheatcodes/signature.md)\n    * [transaction_hash](appendix/cheatcodes/transaction_hash.md)\n    * [chain_id](appendix/cheatcodes/chain_id.md)\n    * [nonce](appendix/cheatcodes/nonce.md)\n    * [resource_bounds](appendix/cheatcodes/resource_bounds.md)\n    * [tip](appendix/cheatcodes/tip.md)\n    * [paymaster_data](appendix/cheatcodes/paymaster_data.md)\n    * [nonce_data_availability_mode](appendix/cheatcodes/nonce_data_availability_mode.md)\n    * [fee_data_availability_mode](appendix/cheatcodes/fee_data_availability_mode.md)\n    * [account_deployment_data](appendix/cheatcodes/account_deployment_data.md)\n    * [proof_facts](appendix/cheatcodes/proof_facts.md)\n    * [mock_call](appendix/cheatcodes/mock_call.md)\n    * [get_class_hash](appendix/cheatcodes/get_class_hash.md)\n    * [replace_bytecode](appendix/cheatcodes/replace_bytecode.md)\n    * [l1_handler](appendix/cheatcodes/l1_handler.md)\n    * [spy_events](appendix/cheatcodes/spy_events.md)\n    * [spy_messages_to_l1](appendix/cheatcodes/spy_messages_to_l1.md)\n    * [store](appendix/cheatcodes/store.md)\n    * [load](appendix/cheatcodes/load.md)\n    * [generate_random_felt](appendix/cheatcodes/generate_random_felt.md)\n    * [generate_arg](appendix/cheatcodes/generate_arg.md)\n    * [set_balance](appendix/cheatcodes/set_balance.md)\n    * [Token](appendix/cheatcodes/token.md)\n    * [interact_with_state](appendix/cheatcodes/interact_with_state.md)\n* [`snforge` Library Reference](appendix/snforge-library.md)\n    * [byte_array](appendix/snforge-library/byte_array.md)\n    * [declare](appendix/snforge-library/declare.md)\n    * [contract_class](appendix/snforge-library/contract_class.md)\n    * [get_call_trace](appendix/snforge-library/get_call_trace.md)\n    * [fs](appendix/snforge-library/fs.md)\n        * [file format rules](appendix/snforge-library/fs/file_format_rules.md)\n        * [`File`](appendix/snforge-library/fs/file.md)\n        * [`FileParser`](appendix/snforge-library/fs/file_parser.md)\n        * [`read_txt`](appendix/snforge-library/fs/read_txt.md)\n        * [`read_json`](appendix/snforge-library/fs/read_json.md)\n    * [env](appendix/snforge-library/env.md)\n    * [signature](appendix/snforge-library/signature.md)\n    * [fuzzable](appendix/snforge-library/fuzzable.md)\n    * [testing](appendix/snforge-library/testing.md)\n        * [get_current_vm_step](appendix/snforge-library/testing/get_current_vm_step.md)\n* [`sncast` Commands](appendix/sncast.md)\n    * [common flags](appendix/sncast/common.md)\n    * [account](appendix/sncast/account/account.md)\n        * [import](appendix/sncast/account/import.md)\n        * [create](appendix/sncast/account/create.md)\n        * [deploy](appendix/sncast/account/deploy.md)\n        * [delete](appendix/sncast/account/delete.md)\n        * [list](appendix/sncast/account/list.md)\n    * [declare](appendix/sncast/declare.md)\n    * [declare-from](appendix/sncast/declare_from.md)\n    * [deploy](appendix/sncast/deploy.md)\n    * [invoke](appendix/sncast/invoke.md)\n    * [call](appendix/sncast/call.md)\n    * [multicall](appendix/sncast/multicall/multicall.md)\n        * [new](appendix/sncast/multicall/new.md)\n        * [run](appendix/sncast/multicall/run.md)\n        * [execute](appendix/sncast/multicall/execute.md)\n          * [deploy](appendix/sncast/multicall/execute/deploy.md)\n          * [invoke](appendix/sncast/multicall/execute/invoke.md)\n    * [show-config](appendix/sncast/show_config.md)\n    * [script](appendix/sncast/script/script.md)\n        * [init](appendix/sncast/script/init.md)\n        * [run](appendix/sncast/script/run.md)\n    * [verify](appendix/sncast/verify.md)\n    * [ledger](appendix/sncast/ledger/ledger.md)\n        * [app-version](appendix/sncast/ledger/app-version.md)\n        * [get-public-key](appendix/sncast/ledger/get-public-key.md)\n        * [sign-hash](appendix/sncast/ledger/sign-hash.md)\n    * [completions](appendix/sncast/completions.md)\n    * [get](appendix/sncast/get/get.md)\n        * [balance](appendix/sncast/get/balance.md)\n        * [class-hash-at](appendix/sncast/get/class_hash_at.md)\n        * [nonce](appendix/sncast/get/nonce.md)\n        * [tx](appendix/sncast/get/tx.md)\n        * [tx-status](appendix/sncast/get/tx-status.md)\n    * [utils](appendix/sncast/utils/utils.md)\n        * [serialize](appendix/sncast/utils/serialize.md)\n        * [class-hash](appendix/sncast/utils/class_hash.md)\n        * [selector](appendix/sncast/utils/selector.md)\n* [`sncast` Library Reference](appendix/sncast-library.md)\n    * [declare](appendix/sncast-library/declare.md)\n    * [deploy](appendix/sncast-library/deploy.md)\n    * [invoke](appendix/sncast-library/invoke.md)\n    * [call](appendix/sncast-library/call.md)\n    * [get_nonce](appendix/sncast-library/get_nonce.md)\n    * [tx_status](appendix/sncast-library/tx_status.md)\n    * [errors](appendix/sncast-library/errors.md)\n    * [`FeeSettingsTrait`](appendix/sncast-library/fee_settings_trait.md)\n* [`snfoundry.toml` Reference](appendix/snfoundry-toml.md)\n* [`Scarb.toml` Reference](appendix/scarb-toml.md)\n* [Inlining Optimizer](appendix/inlining-optimizer.md)\n* [Starknet Foundry Github Action](appendix/starknet-foundry-github-action.md)\n* [`snforge` 0.56.0 Migration Guide](appendix/0-56-0-migration-guide.md)\n"
  },
  {
    "path": "docs/src/appendix/0-56-0-migration-guide.md",
    "content": "# `snforge` 0.56.0 Migration Guide\n\nStarting from version 0.56.0, `snforge` requires Scarb version 2.12.0 or newer.\nThis is due to the migration to the Scarb V2 version of procedural macros, which are used to handle arguments like `#[test]`\nin `snforge`.\nThanks to this migration, tools like the Cairo plugin for VSCode shows better, more descriptive errors.\n\n## Scarb Versions >= 2.12.0\n\nFor Scarb versions >= 2.12.0, we recommend upgrading your `snforge_std` dependency to the one matching your `snforge`\ninstallation (0.56.0 at the time of writing this doc).\n\nIn your `Scarb.toml` file, update the dependency:\n\n```toml\n[dev-dependencies]\nsnforge_std = \"{{snforge_std_version}}\"\n```\n\nNo further action is required.\n\n## Scarb Versions < 2.12.0\n\n> ⚠️ **Warning**\n>\n> **Support for Scarb versions < 2.12.0 has been removed in `snforge` 0.56.0.**\n>\n> If you are using Scarb < 2.12.0, you must upgrade to Scarb 2.12.0 or newer.\n> The deprecated `snforge_std_deprecated` package and `snforge_scarb_plugin_deprecated` plugin are no longer supported, and no new versions of these will be published.\n\nTo upgrade:\n\nFirst, update your Scarb installation to version 2.12.0 or newer.\n\nNext, in your `Scarb.toml`, remove the `snforge_std_deprecated` dependency and add `snforge_std`:\n\n```diff\n[dev-dependencies]\n- snforge_std_deprecated = \"0.55.0\"\n+ snforge_std = \"{{snforge_std_version}}\"\n```\n\nThen, replace all kinds of imports in your code from `snforge_std_deprecated` to `snforge_std`:\n\n```diff\n// Replace use statements\n- use snforge_std_deprecated::{ContractClassTrait, start_cheat_caller_address};\n+ use snforge_std::{ContractClassTrait, start_cheat_caller_address};\n\n// Replace full path usages\n- let result = snforge_std_deprecated::declare(\"MyContract\").unwrap();\n+ let result = snforge_std::declare(\"MyContract\").unwrap();\n```\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/account_contract_address.md",
    "content": "# `account_contract_address`\n\nCheatcodes modifying `account_contract_address`:\n\n## `cheat_account_contract_address`\n> `fn cheat_account_contract_address(target: ContractAddress, account_contract_address: ContractAddress, span: CheatSpan)`\n\nChanges the address of an account which the transaction originates from, for the given target and span.\n\n## `start_cheat_account_contract_address_global`\n> `fn start_cheat_account_contract_address_global(account_contract_address: ContractAddress)`\n\nChanges the address of an account which the transaction originates from, for all targets.\n\n## `start_cheat_account_contract_address`\n> `fn start_cheat_account_contract_address(target: ContractAddress, account_contract_address: ContractAddress)`\n\nChanges the address of an account which the transaction originates from, for the given target.\n\n## `stop_cheat_account_contract_address`\n> `fn stop_cheat_account_contract_address(target: ContractAddress)`\n\nCancels the `cheat_account_contract_address` / `start_cheat_account_contract_address` for the given target.\n\n## `stop_cheat_account_contract_address_global`\n> `fn stop_cheat_account_contract_address_global()`\n\nCancels the `start_cheat_account_contract_address_global`.\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/account_deployment_data.md",
    "content": "# `account_deployment_data`\n\nCheatcodes modifying `account_deployment_data`:\n\n## `cheat_account_deployment_data`\n> `fn cheat_account_deployment_data(target: ContractAddress, account_deployment_data: Span<felt252>, span: CheatSpan)`\n\nChanges the transaction account deployment data for the given target and span.\n\n## `start_cheat_account_deployment_data_global`\n> `fn start_cheat_account_deployment_data_global(account_deployment_data: Span<felt252>)`\n\nChanges the transaction account deployment data for all targets.\n\n## `start_cheat_account_deployment_data`\n> `fn start_cheat_account_deployment_data(target: ContractAddress, account_deployment_data: Span<felt252>)`\n\nChanges the transaction account deployment data for the given target.\n\n## `stop_cheat_account_deployment_data`\n> `fn stop_cheat_account_deployment_data(target: ContractAddress)`\n\nCancels the `cheat_account_deployment_data` / `start_cheat_account_deployment_data` for the given target.\n\n## `stop_cheat_account_deployment_data_global`\n> `fn stop_cheat_account_deployment_data_global()`\n\nCancels the `start_cheat_account_deployment_data_global`.\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/block_hash.md",
    "content": "# `block_hash`\n\nCheatcodes modifying `get_block_hash_syscall` output:\n\n## `cheat_block_hash`\n\n> `fn cheat_block_hash(contract_address: ContractAddress, block_number: u64, block_hash: felt252, span: CheatSpan)`\n\nChanges the block hash for the given block number and contract address.\n\n## `start_cheat_block_hash_global`\n\n> `fn start_cheat_block_hash_global(block_number: u64, block_hash: felt252)`\n\nGlobally modifies the block hash for a specified block number until explicitly stopped.\n\n## `stop_cheat_block_hash_global`\n\n> `fn stop_cheat_block_hash_global(block_number: u64)`\n\nStops a global block hash modification.\n\n## `start_cheat_block_hash`\n\n> `fn start_cheat_block_hash(contract_address: ContractAddress, block_number: u64, block_hash: felt252)`\n\nModifies the block hash for a given block number and contract until the cheat is explicitly stopped.\n\n## `stop_cheat_block_hash`\n\n> `fn stop_cheat_block_hash(contract_address: ContractAddress, block_number: u64)`\n\nStops an active block hash modification for a specific contract.\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/block_number.md",
    "content": "# `block_number`\n\nCheatcodes modifying `block_number`:\n\n## `cheat_block_number`\n> `fn cheat_block_number(target: ContractAddress, block_number: u64, span: CheatSpan)`\n\nChanges the block number for the given target and span.\n\n## `start_cheat_block_number_global`\n> `fn start_cheat_block_number_global(block_number: u64)`\n\nChanges the block number for all targets.\n\n## `start_cheat_block_number`\n> `fn start_cheat_block_number(target: ContractAddress, block_number: u64)`\n\nChanges the block number for the given target.\n\n## `stop_cheat_block_number`\n> `fn stop_cheat_block_number(target: ContractAddress)`\n\nCancels the `cheat_block_number` / `start_cheat_block_number` for the given target.\n\n## `stop_cheat_block_number_global`\n> `fn stop_cheat_block_number_global()`\n\nCancels the `start_cheat_block_number_global`.\n\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/block_timestamp.md",
    "content": "# `block_timestamp`\n\nCheatcodes modifying `block_timestamp`:\n\n## `cheat_block_timestamp`\n> `fn cheat_block_timestamp(target: ContractAddress, block_timestamp: u64, span: CheatSpan)`\n\nChanges the block timestamp for the given target and span.\n\n## `start_cheat_block_timestamp_global`\n> `fn start_cheat_block_timestamp_global(block_timestamp: u64)`\n\nChanges the block timestamp for all targets.\n\n## `start_cheat_block_timestamp`\n> `fn start_cheat_block_timestamp(target: ContractAddress, block_timestamp: u64)`\n\nChanges the block timestamp for the given target.\n\n## `stop_cheat_block_timestamp`\n> `fn stop_cheat_block_timestamp(target: ContractAddress)`\n\nCancels the `cheat_block_timestamp` / `start_cheat_block_timestamp` for the given target.\n\n## `stop_cheat_block_timestamp_global`\n> `fn stop_cheat_block_timestamp_global()`\n\nCancels the `start_cheat_block_timestamp_global`.\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/caller_address.md",
    "content": "# `caller_address`\n\nCheatcodes modifying `caller_address`:\n\n## `cheat_caller_address`\n> `fn cheat_caller_address(target: ContractAddress, caller_address: ContractAddress, span: CheatSpan)`\n\nChanges the caller address for the given target and span.\n\n## `start_cheat_caller_address_global`\n> `fn start_cheat_caller_address_global(caller_address: ContractAddress)`\n\nChanges the caller address for all targets.\n\n## `start_cheat_caller_address`\n> `fn start_cheat_caller_address(target: ContractAddress, caller_address: ContractAddress)`\n\nChanges the caller address for the given target.\n\n## `stop_cheat_caller_address`\n> `fn stop_cheat_caller_address(target: ContractAddress)`\n\nCancels the `cheat_caller_address` / `start_cheat_caller_address` for the given target.\n\n## `stop_cheat_caller_address_global`\n> `fn stop_cheat_caller_address_global()`\n\nCancels the `start_cheat_caller_address_global`.\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/chain_id.md",
    "content": "# `chain_id`\n\nCheatcodes modifying `chain_id`:\n\n## `cheat_chain_id`\n> `fn cheat_chain_id(target: ContractAddress, chain_id: felt252, span: CheatSpan)`\n\nChanges the transaction chain_id for the given target and span.\n\n## `start_cheat_chain_id_global`\n> `fn start_cheat_chain_id_global(chain_id: felt252)`\n\nChanges the transaction chain_id for all targets.\n\n## `start_cheat_chain_id`\n> `fn start_cheat_chain_id(target: ContractAddress, chain_id: felt252)`\n\nChanges the transaction chain_id for the given target.\n\n## `stop_cheat_chain_id`\n> `fn stop_cheat_chain_id(target: ContractAddress)`\n\nCancels the `cheat_chain_id` / `start_cheat_chain_id` for the given target.\n\n## `stop_cheat_chain_id_global`\n> `fn stop_cheat_chain_id_global()`\n\nCancels the `start_cheat_chain_id_global`.\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/cheat_span.md",
    "content": "# `CheatSpan`\n\n```rust\nenum CheatSpan {\n    Indefinite: (),\n    TargetCalls: NonZero<usize>\n}\n```\n\n`CheatSpan` is an enum used to specify for how long the target should be cheated for.\n\n- `Indefinite` applies the cheatcode indefinitely, until the cheat is canceled manually (e.g. using `stop_cheat_block_timestamp`).\n- `TargetCalls` applies the cheatcode for a specified number of calls to the target, after which the cheat is canceled (or until the cheat is canceled manually).\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/fee_data_availability_mode.md",
    "content": "# `fee_data_availability_mode`\n\nCheatcodes modifying `fee_data_availability_mode`:\n\n## `cheat_fee_data_availability_mode`\n> `fn cheat_fee_data_availability_mode(target: ContractAddress, fee_data_availability_mode: u32, span: CheatSpan)`\n\nChanges the transaction fee data availability mode for the given target and span.\n\n## `start_cheat_fee_data_availability_mode_global`\n> `fn start_cheat_fee_data_availability_mode_global(fee_data_availability_mode: u32)`\n\nChanges the transaction fee data availability mode for all targets.\n\n## `start_cheat_fee_data_availability_mode`\n> `fn start_cheat_fee_data_availability_mode(target: ContractAddress, fee_data_availability_mode: u32)`\n\nChanges the transaction fee data availability mode for the given target.\n\n## `stop_cheat_fee_data_availability_mode`\n> `fn stop_cheat_fee_data_availability_mode(target: ContractAddress)`\n\nCancels the `cheat_fee_data_availability_mode` / `start_cheat_fee_data_availability_mode` for the given target.\n\n## `stop_cheat_fee_data_availability_mode_global`\n> `fn stop_cheat_fee_data_availability_mode_global()`\n\nCancels the `start_cheat_fee_data_availability_mode_global`.\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/generate_arg.md",
    "content": "# `generate_arg`\n\n> `fn generate_arg<T, +Serde<T>, +Drop<T>, +Into<T, felt252>>(min_value: T, max_value: T) -> T`\n\nReturns a random number from a range `[min_value, max_value]`.\nIt is used in the context of fuzz testing to implement [`Fuzzable`](../snforge-library/fuzzable.md) trait.\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/generate_random_felt.md",
    "content": "# `generate_random_felt`\n\n> `fn generate_random_felt() -> felt252`\n\nGenerates a (pseudo) random `felt252` value.\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/get_class_hash.md",
    "content": "# `get_class_hash`\n\n> `fn get_class_hash(contract_address: ContractAddress) -> ClassHash`\n\nReturns a class hash of a contract at the specified address.\n\n> 💡 **Tip**\n>\n> This cheatcode can be used to test if your contract upgrade procedure is correct\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/global.md",
    "content": "# Cheating Globally\n\nCheatcodes which have `_global` suffix allow to change specific properties in blockchain state for all targets and for indefinite time span. Therefore, you don't pass the target address, nor the span.\n\nSee the [Cheating Addresses Globally](../../testing/using-cheatcodes.md#cheating-addresses-globally) example.\n\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/interact_with_state.md",
    "content": "# `interact_with_state`\n\n> ⚠️ **Warning**\n>\n> The feature might not work correctly if you're using Cairo version earlier than `2.11`, because closures weren’t fully supported before it.\n\n> `pub fn interact_with_state<F, +Drop<F>, impl func: core::ops::FnOnce<F, ()>, +Drop<func::Output>>(contract_address: ContractAddress, f: F,) -> func::Output`\n\nAllows to use `contract_state_for_testing` for a deployed contract, enabling interaction with its state in tests.\n\nTo use this cheatcode, it is necessary to take care of the following:\n\n- The contract implementation must be visible in the test context\n- Storage struct along with the variables that you want to access must be public\n- If testing internal contract functions, the respective trait or specific function must be imported\n- Storage related traits must be imported, such as `StoragePointerReadAccess` and `StoragePointerWriteAccess`\n\n> 📝 **Note**\n> To use `interact_with_state` with a forked contract, it is required to have the contract's implementation.\n\n### Usage\n\nTo use this cheatcode, follow these steps:\n\n1. Provide the contract address as the first argument\n2. Define a closure that modifies the contract's state and pass it as the second argument\n3. Inside the closure, define a mutable variable for the contract's state using `contract_state_for_testing`\n4. Use this state variable to interact with the contract state\n\nHere’s a minimal example that modifies a single storage variable in a contract:\n\n```rust\ninteract_with_state(contract_address, || {\n    let mut state = MyContract::contract_state_for_testing();\n    state.balance.write(1000);\n});\n\n```\n\nFor more extensive example usage, please refer to the [testing contract internals](../../testing/testing-contract-internals.md#modifying-the-state-of-an-existing-contract) documentation.\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/l1_handler.md",
    "content": "# `l1_handler`\n\n> `fn new(target: ContractAddress, selector: felt252) -> L1Handler`\n\nReturns an `L1Handler` structure which can be used to mock sending messages from L1 for the contract to handle in function marked with `#[l1_handler]`.\n\n```rust\n#[derive(Drop, Clone)]\npub struct L1Handler {\n    target: ContractAddress,\n    selector: felt252,\n}\n```\n\n> `fn execute(self: L1Handler, from_address: felt252, payload: Span<felt252>) -> SyscallResult<()>`\n\nMocks an L1 -> L2 message from Ethereum handled by the given L1 handler function.\n\n## Example\n\nLet's consider a very simple contract, which receives an L1 message with an array of numbers them:\n\n```rust\n{{#include ../../../listings/cheatcodes_reference/src/l1_handler_example.cairo}}\n```\n\nTest code:\n\n```rust\n{{#include ../../../listings/cheatcodes_reference/tests/test_l1_handler.cairo}}\n```\n\nLet's run the test:\n\n<!-- { \"package_name\": \"cheatcodes_reference\", \"scarb_version\": \">=2.11.4\" } -->\n```shell\n$ snforge test test_l1_handler\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 1 test(s) from cheatcodes_reference package\nRunning 1 test(s) from tests/\n[PASS] cheatcodes_reference_integrationtest::test_l1_handler::test_l1_handler ([..])\nRunning 0 test(s) from src/\nTests: 1 passed, 0 failed, 0 ignored, [..] filtered out\n```\n</details>\n<br>\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/load.md",
    "content": "# `load`\n\n> `fn load(target: ContractAddress, storage_address: felt252, size: felt252) -> Array<felt252> `\n\nLoads `size` felts from `target` contract's storage into an `Array`, starting at `storage_address`.\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/max_fee.md",
    "content": "# `max_fee`\n\nCheatcodes modifying `max_fee`:\n\n## `cheat_max_fee`\n> `fn cheat_max_fee(target: ContractAddress, max_fee: u128, span: CheatSpan)`\n\nChanges the transaction max fee for the given target and span.\n\n## `start_cheat_max_fee_global`\n> `fn start_cheat_max_fee_global(max_fee: u128)`\n\nChanges the transaction max fee for all targets.\n\n## `start_cheat_max_fee`\n> `fn start_cheat_max_fee(target: ContractAddress, max_fee: u128)`\n\nChanges the transaction max fee for the given target.\n\n## `stop_cheat_max_fee`\n> `fn stop_cheat_max_fee(target: ContractAddress)`\n\nCancels the `cheat_max_fee` / `start_cheat_max_fee` for the given target.\n\n## `stop_cheat_max_fee_global`\n> `fn stop_cheat_max_fee_global()`\n\nCancels the `start_cheat_max_fee_global`.\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/mock_call.md",
    "content": "# `mock_call`\n\nCheatcodes mocking contract entry point calls:\n\n## `mock_call`\n> `fn mock_call<T, impl TSerde: serde::Serde<T>, impl TDestruct: Destruct<T>>(\n>   contract_address: ContractAddress, function_selector: felt252, ret_data: T, n_times: u32\n> )`\n\nMocks contract call to a `function_selector` of a contract at the given address, for `n_times` first calls that are made to the contract. \nA call to function `function_selector` will return data provided in `ret_data` argument. \nAn address with no contract can be mocked as well. \nAn entrypoint that is not present on the deployed contract is also possible to mock.\nNote that the function is not meant for mocking internal calls - it works only for contract entry points.\n\n## `start_mock_call`\n> `fn start_mock_call<T, impl TSerde: serde::Serde<T>, impl TDestruct: Destruct<T>>(\n>   contract_address: ContractAddress, function_selector: felt252, ret_data: T\n> )`\n\nMocks contract call to a `function_selector` of a contract at the given address, indefinitely.\nSee `mock_call` for comprehensive definition of how it can be used.\n\n\n## `stop_mock_call`\n\n> `fn stop_mock_call(contract_address: ContractAddress, function_selector: felt252)`\n\nCancels the `mock_call` / `start_mock_call` for the function `function_selector` of a contract at the given address.\n\n## Example\n\nLet's consider a contract which simulates a shopping cart. It has a function `get_products` that returns a list of products in the cart.\n\n```rust\n{{#include ../../../listings/cheatcodes_reference/src/mock_call_example.cairo}}\n```\n\nTest code:\n\n```rust\n{{#include ../../../listings/cheatcodes_reference/tests/test_mock_call.cairo}}\n```\n\nLet's run the test:\n\n<!-- { \"package_name\": \"cheatcodes_reference\", \"scarb_version\": \">=2.11.4\" } -->\n```shell\n$ snforge test test_mock_call\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 1 test(s) from cheatcodes_reference package\nRunning 0 test(s) from src/\nRunning 1 test(s) from tests/\n[PASS] cheatcodes_reference_integrationtest::test_mock_call::test_mock_call ([..])\nTests: 1 passed, 0 failed, 0 ignored, [..] filtered out\n```\n</details>\n<br>"
  },
  {
    "path": "docs/src/appendix/cheatcodes/nonce.md",
    "content": "# `nonce`\n\nCheatcodes modifying `nonce`:\n\n## `cheat_nonce`\n> `fn cheat_nonce(target: ContractAddress, nonce: felt252, span: CheatSpan)`\n\nChanges the transaction nonce for the given target and span.\n\n## `start_cheat_nonce_global`\n> `fn start_cheat_nonce_global(nonce: felt252)`\n\nChanges the transaction nonce for all targets.\n\n## `start_cheat_nonce`\n> `fn start_cheat_nonce(target: ContractAddress, nonce: felt252)`\n\nChanges the transaction nonce for the given target.\n\n## `stop_cheat_nonce`\n> `fn stop_cheat_nonce(target: ContractAddress)`\n\nCancels the `cheat_nonce` / `start_cheat_nonce` for the given target.\n\n## `stop_cheat_nonce_global`\n> `fn stop_cheat_nonce_global()`\n\nCancels the `start_cheat_nonce_global`.\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/nonce_data_availability_mode.md",
    "content": "# `nonce_data_availability_mode`\n\nCheatcodes modifying `nonce_data_availability_mode`:\n\n## `cheat_nonce_data_availability_mode`\n> `fn cheat_nonce_data_availability_mode(target: ContractAddress, nonce_data_availability_mode: u32, span: CheatSpan)`\n\nChanges the transaction nonce data availability mode for the given target and span.\n\n## `start_cheat_nonce_data_availability_mode_global`\n> `fn start_cheat_nonce_data_availability_mode_global(nonce_data_availability_mode: u32)`\n\nChanges the transaction nonce data availability mode for all targets.\n\n## `start_cheat_nonce_data_availability_mode`\n> `fn start_cheat_nonce_data_availability_mode(target: ContractAddress, nonce_data_availability_mode: u32)`\n\nChanges the transaction nonce data availability mode for the given target.\n\n## `stop_cheat_nonce_data_availability_mode`\n> `fn stop_cheat_nonce_data_availability_mode(target: ContractAddress)`\n\nCancels the `cheat_nonce_data_availability_mode` / `start_cheat_nonce_data_availability_mode` for the given target.\n\n## `stop_cheat_nonce_data_availability_mode_global`\n> `fn stop_cheat_nonce_data_availability_mode_global()`\n\nCancels the `start_cheat_nonce_data_availability_mode_global`.\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/paymaster_data.md",
    "content": "# `paymaster_data`\n\nCheatcodes modifying `paymaster_data`:\n\n## `cheat_paymaster_data`\n> `fn cheat_paymaster_data(target: ContractAddress, paymaster_data: Span<felt252>, span: CheatSpan)`\n\nChanges the transaction paymaster data for the given target and span.\n\n## `start_cheat_paymaster_data_global`\n> `fn start_cheat_paymaster_data_global(paymaster_data: Span<felt252>)`\n\nChanges the transaction paymaster data for all targets.\n\n## `start_cheat_paymaster_data`\n> `fn start_cheat_paymaster_data(target: ContractAddress, paymaster_data: Span<felt252>)`\n\nChanges the transaction paymaster data for the given target.\n\n## `stop_cheat_paymaster_data`\n> `fn stop_cheat_paymaster_data(target: ContractAddress)`\n\nCancels the `cheat_paymaster_data` / `start_cheat_paymaster_data` for the given target.\n\n## `stop_cheat_paymaster_data_global`\n> `fn stop_cheat_paymaster_data_global()`\n\nCancels the `start_cheat_paymaster_data_global`.\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/proof_facts.md",
    "content": "# `proof_facts`\n\nCheatcodes modifying `proof_facts`:\n\n## `cheat_proof_facts`\n> `fn cheat_proof_facts(contract_address: ContractAddress, proof_facts: Span<felt252>, span: CheatSpan)`\n\nChanges the transaction proof facts for the given target and span.\n\n## `start_cheat_proof_facts_global`\n> `fn start_cheat_proof_facts_global(proof_facts: Span<felt252>)`\n\nChanges the transaction proof facts for all targets.\n\n## `start_cheat_proof_facts`\n> `fn start_cheat_proof_facts(contract_address: ContractAddress, proof_facts: Span<felt252>)`\n\nChanges the transaction proof facts for the given target.\n\n## `stop_cheat_proof_facts`\n> `fn stop_cheat_proof_facts(contract_address: ContractAddress)`\n\nCancels the `cheat_proof_facts` / `start_cheat_proof_facts` for the given target.\n\n## `stop_cheat_proof_facts_global`\n> `fn stop_cheat_proof_facts_global()`\n\nCancels the `start_cheat_proof_facts_global`.\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/replace_bytecode.md",
    "content": "# `replace_bytecode`\n\n> `fn replace_bytecode(contract: ContractAddress, new_class: ClassHash) -> Result<(), ReplaceBytecodeError>`\n\nReplaces class for given contract address.\nThe `new_class` hash has to be declared in order for the replacement class to execute the code when interacting with the contract.\nReturns `Result::Ok` if the replacement succeeded, and a `ReplaceBytecodeError` with appropriate error type otherwise\n\n## ReplaceBytecodeError\nAn enum with appropriate type of replacement failure\n\n```rust\npub enum ReplaceBytecodeError {\n    /// Means that the contract does not exist, and thus bytecode cannot be replaced\n    ContractNotDeployed,\n    /// Means that the given class for replacement is not declared\n    UndeclaredClassHash,\n}\n```"
  },
  {
    "path": "docs/src/appendix/cheatcodes/resource_bounds.md",
    "content": "# `resource_bounds`\n\nCheatcodes modifying `resource_bounds`:\n\n## `cheat_resource_bounds`\n> `fn cheat_resource_bounds(target: ContractAddress, resource_bounds: Span<ResourcesBounds>, span: CheatSpan)`\n\nChanges the transaction resource bounds for the given target and span.\n\n## `start_cheat_resource_bounds_global`\n> `fn start_cheat_resource_bounds_global(resource_bounds: Span<ResourcesBounds>)`\n\nChanges the transaction resource bounds for all targets.\n\n## `start_cheat_resource_bounds`\n> `fn start_cheat_resource_bounds(target: ContractAddress, resource_bounds: Span<ResourcesBounds>)`\n\nChanges the transaction resource bounds for the given target.\n\n## `stop_cheat_resource_bounds`\n> `fn stop_cheat_resource_bounds(target: ContractAddress)`\n\nCancels the `cheat_resource_bounds` / `start_cheat_resource_bounds` for the given target.\n\n## `stop_cheat_resource_bounds_global`\n> `fn stop_cheat_resource_bounds_global()`\n\nCancels the `start_cheat_resource_bounds_global`.\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/sequencer_address.md",
    "content": "# `sequencer_address`\n\nCheatcodes modifying `sequencer_address`:\n\n## `cheat_sequencer_address`\n> `fn cheat_sequencer_address(target: ContractAddress, sequencer_address: ContractAddress, span: CheatSpan)`\n\nChanges the sequencer address for the given target and span.\n\n## `start_cheat_sequencer_address_global`\n> `fn start_cheat_sequencer_address_global(sequencer_address: ContractAddress)`\n\nChanges the sequencer address for all targets.\n\n## `start_cheat_sequencer_address`\n> `fn start_cheat_sequencer_address(target: ContractAddress, sequencer_address: ContractAddress)`\n\nChanges the sequencer address for the given target.\n\n## `stop_cheat_sequencer_address`\n> `fn stop_cheat_sequencer_address(target: ContractAddress)`\n\nCancels the `cheat_sequencer_address` / `start_cheat_sequencer_address` for the given target.\n\n## `stop_cheat_sequencer_address_global`\n> `fn stop_cheat_sequencer_address_global()`\n\nCancels the `start_cheat_sequencer_address_global`.\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/set_balance.md",
    "content": "# `set_balance`\n\n> `fn set_balance(target: ContractAddress, new_balance: u256, token: Token)`\n\nSets balance of `token` for `target` contract to `new_balance`.\n\nSee [`Token`](../cheatcodes/token.md) docs on how to define and use tokens.\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/signature.md",
    "content": "# `signature`\n\nCheatcodes modifying `signature`:\n\n## `cheat_signature`\n> `fn cheat_signature(target: ContractAddress, signature: Span<felt252>, span: CheatSpan)`\n\nChanges the transaction signature for the given target and span.\n\n## `start_cheat_signature_global`\n> `fn start_cheat_signature_global(signature: Span<felt252>)`\n\nChanges the transaction signature for all targets.\n\n## `start_cheat_signature`\n> `fn start_cheat_signature(target: ContractAddress, signature: Span<felt252>)`\n\nChanges the transaction signature for the given target.\n\n## `stop_cheat_signature`\n> `fn stop_cheat_signature(target: ContractAddress)`\n\nCancels the `cheat_signature` / `start_cheat_signature` for the given target.\n\n## `stop_cheat_signature_global`\n> `fn stop_cheat_signature_global()`\n\nCancels the `start_cheat_signature_global`.\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/spy_events.md",
    "content": "# `spy_events`\n\n> `fn spy_events() -> EventSpy`\n\nCreates `EventSpy` instance which spies on events emitted after its creation.\n\n```rust\npub struct EventSpy {\n    ...\n}\n```\nAn event spy structure.\n\n```rust\npub struct Events {\n    pub events: Array<(ContractAddress, Event)>,\n}\n```\nA wrapper structure on an array of events to handle event filtering.\n\n```rust\npub struct Event {\n    pub keys: Array<felt252>,\n    pub data: Array<felt252>,\n}\n```\nRaw event format (as seen via the RPC-API), can be used for asserting the emitted events.\n\n## Implemented traits\n\n### EventSpyTrait\n\n```rust\npub trait EventSpyTrait {\n    fn get_events(ref self: EventSpy) -> Events;\n}\n```\nGets all events since the creation of the given `EventSpy`. \n\n### EventSpyAssertionsTrait\n\n```rust\npub trait EventSpyAssertionsTrait<T, +starknet::Event<T>, +Drop<T>> {\n    fn assert_emitted(ref self: EventSpy, events: @Array<(ContractAddress, T)>);\n    fn assert_not_emitted(ref self: EventSpy, events: @Array<(ContractAddress, T)>);\n}\n```\nAllows to assert the expected events emission (or lack thereof), in the scope of the `EventSpy` structure.\n\n### EventsFilterTrait\n\n```rust\npub trait EventsFilterTrait {\n    fn emitted_by(self: @Events, contract_address: ContractAddress) -> Events;\n}\n```\nFilters events emitted by a given `ContractAddress`.\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/spy_messages_to_l1.md",
    "content": "# `spy_messages_to_l1`\n\n> `fn spy_messages_to_l1() -> MessageToL1Spy`\n\nCreates `MessageToL1Spy` instance that spies on all messages sent to L1 after its creation.\n\n```rust\nstruct MessageToL1Spy {\n    // ..\n}\n```\nMessage spy structure allowing to get messages emitted only after its creation.\n\n```rust\npub struct MessagesToL1 {\n    pub messages: Array<(ContractAddress, MessageToL1)>,\n}\n```\nA wrapper structure on an array of messages to handle filtering smoothly.\n`messages` is an array of `(l2_sender_address, message)` tuples. \n\n```rust\npub struct MessageToL1 {\n    /// An ethereum address where the message is destined to go\n    pub to_address: EthAddress,\n    /// Actual payload which will be delivered to L1 contract\n    pub payload: Array<felt252>,\n}\n```\nRaw message to L1 format (as seen via the RPC-API), can be used for asserting the sent messages.\n\n## Implemented traits\n\n### MessageToL1SpyTrait\n\n```rust\ntrait MessageToL1SpyTrait {\n    /// Gets all messages given [`MessageToL1Spy`] spies for.\n    fn get_messages(ref self: MessageToL1Spy) -> MessagesToL1;\n}\n```\nGets all messages since the creation of the given `MessageToL1Spy`. \n\n### MessageToL1SpyAssertionsTrait\n\n```rust\ntrait MessageToL1SpyAssertionsTrait {\n    fn assert_sent(ref self: MessageToL1Spy, messages: @Array<(ContractAddress, MessageToL1)>);\n    fn assert_not_sent(ref self: MessageToL1Spy, messages: @Array<(ContractAddress, MessageToL1)>);\n}\n```\nAllows to assert the expected sent messages (or lack thereof), in the scope of `MessageToL1Spy` structure.\n\n### MessageToL1FilterTrait\n\n```rust\ntrait MessageToL1FilterTrait {\n    /// Filter messages emitted by a sender of a given [`ContractAddress`]\n    fn sent_by(self: @MessagesToL1, contract_address: ContractAddress) -> MessagesToL1;\n    /// Filter messages emitted by a receiver of a given ethereum address\n    fn sent_to(self: @MessagesToL1, to_address: EthAddress) -> MessagesToL1;\n}\n```\n\nFilters messages emitted by a given `ContractAddress`, or sent to given `EthAddress`.\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/store.md",
    "content": "# `store`\n\n> `fn store(target: ContractAddress, storage_address: felt252, serialized_value: Span<felt252>)`\n\nStores felts from `serialized_value` in `target` contract's storage, starting at `storage_address`. \n\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/tip.md",
    "content": "# `tip`\n\nCheatcodes modifying `tip`:\n\n## `cheat_tip`\n> `fn cheat_tip(target: ContractAddress, tip: u128, span: CheatSpan)`\n\nChanges the transaction tip for the given target and span.\n\n## `start_cheat_tip_global`\n> `fn start_cheat_tip_global(tip: u128)`\n\nChanges the transaction tip for all targets.\n\n## `start_cheat_tip`\n> `fn start_cheat_tip(target: ContractAddress, tip: u128)`\n\nChanges the transaction tip for the given target.\n\n## `stop_cheat_tip`\n> `fn stop_cheat_tip(target: ContractAddress)`\n\nCancels the `cheat_tip` / `start_cheat_tip` for the given target.\n\n## `stop_cheat_tip_global`\n> `fn stop_cheat_tip_global()`\n\nCancels the `start_cheat_tip_global`.\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/token.md",
    "content": "# `Token`\n\n```rust\npub enum Token {\n    STRK,\n    ETH,\n    Custom: CustomToken,\n}\n\npub struct CustomToken {\n    pub contract_address: ContractAddress,\n    pub balances_variable_selector: felt252,\n}\n```\n\n`Token` is an enum used to specify ERC20 token for which the balance should be cheated. Possible variants are:\n- `STRK` is the default STRK token (predeployed in every test case).\n- `ETH` is the default ETH token (predeployed in every test case).\n- `Custom` allows to specify a custom token by providing its contract address and balances variable selector.\n\n```rust\npub impl TokenImpl of TokenTrait {\n    fn contract_address(self: Token) -> ContractAddress {\n        match self {\n            Token::STRK => STRK_CONTRACT_ADDRESS.try_into().unwrap(),\n            Token::ETH => ETH_CONTRACT_ADDRESS.try_into().unwrap(),\n            Token::Custom(CustomToken { contract_address, .. }) => contract_address,\n        }\n    }\n\n    fn balances_variable_selector(self: Token) -> felt252 {\n        match self {\n            Token::STRK | TOKEN::ETH => selector!(\"ERC20_balances\"),\n            Token::Custom(CustomToken { balances_variable_selector,\n            .., }) => balances_variable_selector,\n        }\n    }\n}\n```\n\n## Balances variable selector\n\n`balances_variable_selector` is simply a selector of the storage variable, which holds the mapping of balances -> amounts. The name of variable isn't specified by ERC20 standard (it can have any name), hence we allow to specify it. Let's have a part of example ERC20 contract storage:\n\n```rust\n    ...\n    #[storage]\n    struct Storage {\n        ...\n        balances: Map<ContractAddress, u256>,\n        ...\n    }\n    ...\n```\n\nIn the above example, `balances_variable_selector` would have following value:\n\n```rust\nlet token = Token::Custom(\n        CustomToken {\n            contract_address: ...,\n            balances_variable_selector: selector!(\"balances\"),\n        },\n    );\n```"
  },
  {
    "path": "docs/src/appendix/cheatcodes/transaction_hash.md",
    "content": "# `transaction_hash`\n\nCheatcodes modifying `transaction_hash`:\n\n## `cheat_transaction_hash`\n> `fn cheat_transaction_hash(target: ContractAddress, transaction_hash: felt252, span: CheatSpan)`\n\nChanges the transaction hash for the given target and span.\n\n## `start_cheat_transaction_hash_global`\n> `fn start_cheat_transaction_hash_global(transaction_hash: felt252)`\n\nChanges the transaction hash for all targets.\n\n## `start_cheat_transaction_hash`\n> `fn start_cheat_transaction_hash(target: ContractAddress, transaction_hash: felt252)`\n\nChanges the transaction hash for the given target.\n\n## `stop_cheat_transaction_hash`\n> `fn stop_cheat_transaction_hash(target: ContractAddress)`\n\nCancels the `cheat_transaction_hash` / `start_cheat_transaction_hash` for the given target.\n\n## `stop_cheat_transaction_hash_global`\n> `fn stop_cheat_transaction_hash_global()`\n\nCancels the `start_cheat_transaction_hash_global`.\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes/transaction_version.md",
    "content": "# Transaction `version`\n\nCheatcodes modifying transaction `version`:\n\n## `cheat_transaction_version`\n> `fn cheat_transaction_version(target: ContractAddress, version: felt252, span: CheatSpan)`\n\nChanges the transaction version for the given target and span.\n\n## `start_cheat_transaction_version_global`\n> `fn start_cheat_transaction_version_global(version: felt252)`\n\nChanges the transaction version for all targets.\n\n## `start_cheat_transaction_version`\n> `fn start_cheat_transaction_version(target: ContractAddress, version: felt252)`\n\nChanges the transaction version for the given target.\n\n## `stop_cheat_transaction_version`\n> `fn stop_cheat_transaction_version(target: ContractAddress)`\n\nCancels the `cheat_transaction_version` / `start_cheat_transaction_version` for the given target.\n\n## `stop_cheat_transaction_version_global`\n> `fn stop_cheat_transaction_version_global()`\n\nCancels the `start_cheat_transaction_version_global`.\n"
  },
  {
    "path": "docs/src/appendix/cheatcodes.md",
    "content": "# Cheatcodes Reference\n\n\n- [`mock_call`](cheatcodes/mock_call.md#mock_call) - mocks a number of contract calls to an entry point\n- [`start_mock_call`](cheatcodes/mock_call.md#start_mock_call) - mocks contract call to an entry point\n- [`stop_mock_call`](cheatcodes/mock_call.md#stop_mock_call) - cancels the `mock_call` / `start_mock_call` for an entry point\n- [`get_class_hash`](cheatcodes/get_class_hash.md) - retrieves a class hash of a contract\n- [`replace_bytecode`](cheatcodes/replace_bytecode.md) - replace the class hash of a contract\n- [`l1_handler`](cheatcodes/l1_handler.md) - executes a `#[l1_handler]` function to mock a message arriving from Ethereum\n- [`spy_events`](cheatcodes/spy_events.md) - creates `EventSpy` instance which spies on events emitted by contracts\n- [`spy_messages_to_l1`](cheatcodes/spy_messages_to_l1.md) - creates `L1MessageSpy` instance which spies on messages to L1 sent by contracts\n- [`store`](cheatcodes/store.md) - stores values in targeted contact's storage\n- [`load`](cheatcodes/load.md) - loads values directly from targeted contact's storage\n- [`set_balance`](cheatcodes/set_balance.md) - sets new balance of ERC20 token for target contract\n\n- [`CheatSpan`](cheatcodes/cheat_span.md) - enum for specifying the number of target calls for a cheat\n- [`Token`](cheatcodes/token.md) - enum for specifying ERC20 token for a cheat\n- [`interact_with_state`](cheatcodes/interact_with_state.md) - allows interacting with a contract's state in tests\n\n## Execution Info\n\n### Caller Address\n\n- [`cheat_caller_address`](cheatcodes/caller_address.md#cheat_caller_address) - changes the caller address for contracts, for a number of calls\n- [`start_cheat_caller_address_global`](cheatcodes/caller_address.md#start_cheat_caller_address_global) - changes the caller address for all contracts\n- [`start_cheat_caller_address`](cheatcodes/caller_address.md#start_cheat_caller_address) - changes the caller address for contracts\n- [`stop_cheat_caller_address`](cheatcodes/caller_address.md#stop_cheat_caller_address) - cancels the `cheat_caller_address` / `start_cheat_caller_address` for contracts\n- [`stop_cheat_caller_address_global`](cheatcodes/caller_address.md#stop_cheat_caller_address_global) - cancels the `start_cheat_caller_address_global`\n\n## Block Info\n\n### Block Number\n\n- [`cheat_block_number`](cheatcodes/block_number.md#cheat_block_number) - changes the block number for contracts, for a number of calls\n- [`start_cheat_block_number_global`](cheatcodes/block_number.md#start_cheat_block_number_global) - changes the block number for all contracts\n- [`start_cheat_block_number`](cheatcodes/block_number.md#start_cheat_block_number) - changes the block number for contracts\n- [`stop_cheat_block_number`](cheatcodes/block_number.md#stop_cheat_block_number) - cancels the `cheat_block_number` / `start_cheat_block_number` for contracts\n- [`stop_cheat_block_number_global`](cheatcodes/block_number.md#stop_cheat_block_number_global) - cancels the `start_cheat_block_number_global`\n\n### Block Timestamp\n\n- [`cheat_block_timestamp`](cheatcodes/block_timestamp.md#cheat_block_timestamp) - changes the block timestamp for contracts, for a number of calls\n- [`start_cheat_block_timestamp_global`](cheatcodes/block_timestamp.md#start_cheat_block_timestamp_global) - changes the block timestamp for all contracts\n- [`start_cheat_block_timestamp`](cheatcodes/block_timestamp.md#start_cheat_block_timestamp) - changes the block timestamp for contracts\n- [`stop_cheat_block_timestamp`](cheatcodes/block_timestamp.md#stop_cheat_block_timestamp) - cancels the `cheat_block_timestamp` / `start_cheat_block_timestamp` for contracts\n- [`stop_cheat_block_timestamp_global`](cheatcodes/block_timestamp.md#stop_cheat_block_timestamp_global) - cancels the `start_cheat_block_timestamp_global`\n\n### Sequencer Address\n\n- [`cheat_sequencer_address`](cheatcodes/sequencer_address.md#cheat_sequencer_address) - changes the sequencer address for contracts, for a number of calls\n- [`start_cheat_sequencer_address_global`](cheatcodes/sequencer_address.md#start_cheat_sequencer_address_global) - changes the sequencer address for all contracts\n- [`start_cheat_sequencer_address`](cheatcodes/sequencer_address.md#start_cheat_sequencer_address) - changes the sequencer address for contracts\n- [`stop_cheat_sequencer_address`](cheatcodes/sequencer_address.md#stop_cheat_sequencer_address) - cancels the `cheat_sequencer_address` / `start_cheat_sequencer_address` for contracts\n- [`stop_cheat_sequencer_address_global`](cheatcodes/sequencer_address.md#stop_cheat_sequencer_address_global) - cancels the `start_cheat_sequencer_address_global`\n\n## Transaction Info\n\n### Transaction Version\n\n- [`cheat_transaction_version`](cheatcodes/transaction_version.md#cheat_transaction_version) - changes the transaction version for contracts, for a number of calls\n- [`start_cheat_transaction_version_global`](cheatcodes/transaction_version.md#start_cheat_transaction_version_global) - changes the transaction version for all contracts\n- [`start_cheat_transaction_version`](cheatcodes/transaction_version.md#start_cheat_transaction_version) - changes the transaction version for contracts\n- [`stop_cheat_transaction_version`](cheatcodes/transaction_version.md#stop_cheat_transaction_version) - cancels the `cheat_transaction_version` / `start_cheat_transaction_version` for contracts\n- [`stop_cheat_transaction_version_global`](cheatcodes/transaction_version.md#stop_cheat_transaction_version_global) - cancels the `start_cheat_transaction_version_global`\n\n### Transaction Max Fee\n\n- [`cheat_max_fee`](cheatcodes/max_fee.md#cheat_max_fee) - changes the transaction max fee for contracts, for a number of calls\n- [`start_cheat_max_fee_global`](cheatcodes/max_fee.md#start_cheat_max_fee_global) - changes the transaction max fee for all contracts\n- [`start_cheat_max_fee`](cheatcodes/max_fee.md#start_cheat_max_fee) - changes the transaction max fee for contracts\n- [`stop_cheat_max_fee`](cheatcodes/max_fee.md#stop_cheat_max_fee) - cancels the `cheat_max_fee` / `start_cheat_max_fee` for contracts\n- [`stop_cheat_max_fee_global`](cheatcodes/max_fee.md#stop_cheat_max_fee_global) - cancels the `start_cheat_max_fee_global`\n\n### Transaction Signature\n\n- [`cheat_signature`](cheatcodes/signature.md#cheat_signature) - changes the transaction signature for contracts, for a number of calls\n- [`start_cheat_signature_global`](cheatcodes/signature.md#start_cheat_signature_global) - changes the transaction signature for all contracts\n- [`start_cheat_signature`](cheatcodes/signature.md#start_cheat_signature) - changes the transaction signature for contracts\n- [`stop_cheat_signature`](cheatcodes/signature.md#stop_cheat_signature) - cancels the `cheat_signature` / `start_cheat_signature` for contracts\n- [`stop_cheat_signature_global`](cheatcodes/signature.md#stop_cheat_signature_global) - cancels the `start_cheat_signature_global`\n\n### Transaction Hash\n\n- [`cheat_transaction_hash`](cheatcodes/transaction_hash.md#cheat_transaction_hash) - changes the transaction hash for contracts, for a number of calls\n- [`start_cheat_transaction_hash_global`](cheatcodes/transaction_hash.md#start_cheat_transaction_hash_global) - changes the transaction hash for all contracts\n- [`start_cheat_transaction_hash`](cheatcodes/transaction_hash.md#start_cheat_transaction_hash) - changes the transaction hash for contracts\n- [`stop_cheat_transaction_hash`](cheatcodes/transaction_hash.md#stop_cheat_transaction_hash) - cancels the `cheat_transaction_hash` / `start_cheat_transaction_hash` for contracts\n- [`stop_cheat_transaction_hash_global`](cheatcodes/transaction_hash.md#stop_cheat_transaction_hash_global) - cancels the `start_cheat_transaction_hash_global`\n\n### Transaction Chain ID\n\n- [`cheat_chain_id`](cheatcodes/chain_id.md#cheat_chain_id) - changes the transaction chain_id for contracts, for a number of calls\n- [`start_cheat_chain_id_global`](cheatcodes/chain_id.md#start_cheat_chain_id_global) - changes the transaction chain_id for all contracts\n- [`start_cheat_chain_id`](cheatcodes/chain_id.md#start_cheat_chain_id) - changes the transaction chain_id for contracts\n- [`stop_cheat_chain_id`](cheatcodes/chain_id.md#stop_cheat_chain_id) - cancels the `cheat_chain_id` / `start_cheat_chain_id` for contracts\n- [`stop_cheat_chain_id_global`](cheatcodes/chain_id.md#stop_cheat_chain_id_global) - cancels the `start_cheat_chain_id_global`\n\n### Transaction Nonce\n\n- [`cheat_nonce`](cheatcodes/nonce.md#cheat_nonce) - changes the transaction nonce for contracts, for a number of calls\n- [`start_cheat_nonce_global`](cheatcodes/nonce.md#start_cheat_nonce_global) - changes the transaction nonce for all contracts\n- [`start_cheat_nonce`](cheatcodes/nonce.md#start_cheat_nonce) - changes the transaction nonce for contracts\n- [`stop_cheat_nonce`](cheatcodes/nonce.md#stop_cheat_nonce) - cancels the `cheat_nonce` / `start_cheat_nonce` for contracts\n- [`stop_cheat_nonce_global`](cheatcodes/nonce.md#stop_cheat_nonce_global) - cancels the `start_cheat_nonce_global`\n\n### Transaction Resource Bounds\n\n- [`cheat_resource_bounds`](cheatcodes/resource_bounds.md#cheat_resource_bounds) - changes the transaction resource bounds for contracts, for a number of calls\n- [`start_cheat_resource_bounds_global`](cheatcodes/resource_bounds.md#start_cheat_resource_bounds_global) - changes the transaction resource bounds for all contracts\n- [`start_cheat_resource_bounds`](cheatcodes/resource_bounds.md#start_cheat_resource_bounds) - changes the transaction resource bounds for contracts\n- [`stop_cheat_resource_bounds`](cheatcodes/resource_bounds.md#stop_cheat_resource_bounds) - cancels the `cheat_resource_bounds` / `start_cheat_resource_bounds` for contracts\n- [`stop_cheat_resource_bounds_global`](cheatcodes/resource_bounds.md#stop_cheat_resource_bounds_global) - cancels the `start_cheat_resource_bounds_global`\n\n### Transaction Tip\n\n- [`cheat_tip`](cheatcodes/tip.md#cheat_tip) - changes the transaction tip for contracts, for a number of calls\n- [`start_cheat_tip_global`](cheatcodes/tip.md#start_cheat_tip_global) - changes the transaction tip for all contracts\n- [`start_cheat_tip`](cheatcodes/tip.md#start_cheat_tip) - changes the transaction tip for contracts\n- [`stop_cheat_tip`](cheatcodes/tip.md#stop_cheat_tip) - cancels the `cheat_tip` / `start_cheat_tip` for contracts\n- [`stop_cheat_tip_global`](cheatcodes/tip.md#stop_cheat_tip_global) - cancels the `start_cheat_tip_global`\n\n### Transaction Paymaster Data\n\n- [`cheat_paymaster_data`](cheatcodes/paymaster_data.md#cheat_paymaster_data) - changes the transaction paymaster data for contracts, for a number of calls\n- [`start_cheat_paymaster_data_global`](cheatcodes/paymaster_data.md#start_cheat_paymaster_data_global) - changes the transaction paymaster data for all contracts\n- [`start_cheat_paymaster_data`](cheatcodes/paymaster_data.md#start_cheat_paymaster_data) - changes the transaction paymaster data for contracts\n- [`stop_cheat_paymaster_data`](cheatcodes/paymaster_data.md#stop_cheat_paymaster_data) - cancels the `cheat_paymaster_data` / `start_cheat_paymaster_data` for contracts\n- [`stop_cheat_paymaster_data_global`](cheatcodes/paymaster_data.md#stop_cheat_paymaster_data_global) - cancels the `start_cheat_paymaster_data_global`\n\n### Transaction Nonce Data Availability Mode\n\n- [`cheat_nonce_data_availability_mode`](cheatcodes/nonce_data_availability_mode.md#cheat_nonce_data_availability_mode) - changes the transaction nonce data availability mode for contracts, for a number of calls\n- [`start_cheat_nonce_data_availability_mode_global`](cheatcodes/nonce_data_availability_mode.md#start_cheat_nonce_data_availability_mode_global) - changes the transaction nonce data availability mode for all contracts\n- [`start_cheat_nonce_data_availability_mode`](cheatcodes/nonce_data_availability_mode.md#start_cheat_nonce_data_availability_mode) - changes the transaction nonce data availability mode for contracts\n- [`stop_cheat_nonce_data_availability_mode`](cheatcodes/nonce_data_availability_mode.md#stop_cheat_nonce_data_availability_mode) - cancels the `cheat_nonce_data_availability_mode` / `start_cheat_nonce_data_availability_mode` for contracts\n- [`stop_cheat_nonce_data_availability_mode_global`](cheatcodes/nonce_data_availability_mode.md#stop_cheat_nonce_data_availability_mode_global) - cancels the `start_cheat_nonce_data_availability_mode_global`\n\n### Transaction Fee Data Availability Mode\n\n- [`cheat_fee_data_availability_mode`](cheatcodes/fee_data_availability_mode.md#cheat_fee_data_availability_mode) - changes the transaction fee data availability mode for contracts, for a number of calls\n- [`start_cheat_fee_data_availability_mode_global`](cheatcodes/fee_data_availability_mode.md#start_cheat_fee_data_availability_mode_global) - changes the transaction fee data availability mode for all contracts\n- [`start_cheat_fee_data_availability_mode`](cheatcodes/fee_data_availability_mode.md#start_cheat_fee_data_availability_mode) - changes the transaction fee data availability mode for contracts\n- [`stop_cheat_fee_data_availability_mode`](cheatcodes/fee_data_availability_mode.md#stop_cheat_fee_data_availability_mode) - cancels the `cheat_fee_data_availability_mode` / `start_cheat_fee_data_availability_mode` for contracts\n- [`stop_cheat_fee_data_availability_mode_global`](cheatcodes/fee_data_availability_mode.md#stop_cheat_fee_data_availability_mode_global) - cancels the `start_cheat_fee_data_availability_mode_global`\n\n### Transaction Account Deployment\n\n- [`cheat_account_deployment_data`](cheatcodes/account_deployment_data.md#cheat_account_deployment_data) - changes the transaction account deployment data for contracts, for a number of calls\n- [`start_cheat_account_deployment_data_global`](cheatcodes/account_deployment_data.md#start_cheat_account_deployment_data_global) - changes the transaction account deployment data for all contracts\n- [`start_cheat_account_deployment_data`](cheatcodes/account_deployment_data.md#start_cheat_account_deployment_data) - changes the transaction account deployment data for contracts\n- [`stop_cheat_account_deployment_data`](cheatcodes/account_deployment_data.md#stop_cheat_account_deployment_data) - cancels the `cheat_account_deployment_data` / `start_cheat_account_deployment_data` for contracts\n- [`stop_cheat_account_deployment_data_global`](cheatcodes/account_deployment_data.md#stop_cheat_account_deployment_data_global) - cancels the `start_cheat_account_deployment_data_global`\n\n### Transaction Proof Facts\n\n- [`cheat_proof_facts`](cheatcodes/proof_facts.md#cheat_proof_facts) - changes the transaction proof facts for contracts, for a number of calls\n- [`start_cheat_proof_facts_global`](cheatcodes/proof_facts.md#start_cheat_proof_facts_global) - changes the transaction proof facts for all contracts\n- [`start_cheat_proof_facts`](cheatcodes/proof_facts.md#start_cheat_proof_facts) - changes the transaction proof facts for contracts\n- [`stop_cheat_proof_facts`](cheatcodes/proof_facts.md#stop_cheat_proof_facts) - cancels the `cheat_proof_facts` / `start_cheat_proof_facts` for contracts\n- [`stop_cheat_proof_facts_global`](cheatcodes/proof_facts.md#stop_cheat_proof_facts_global) - cancels the `start_cheat_proof_facts_global`\n\n## Account Contract Address\n\n- [`cheat_account_contract_address`](cheatcodes/account_contract_address.md#cheat_account_contract_address) - changes the address of an account which the transaction originates from, for the given target and span\n- [`start_cheat_account_contract_address_global`](cheatcodes/account_contract_address.md#start_cheat_account_contract_address_global) - changes the address of an account which the transaction originates from, for all targets\n- [`start_cheat_account_contract_address`](cheatcodes/account_contract_address.md#start_cheat_account_contract_address) - changes the address of an account which the transaction originates from, for the given target \n- [`stop_cheat_account_contract_address`](cheatcodes/account_deployment_data.md#stop_cheat_account_contract_address) - cancels the `cheat_account_deployment_data` / `start_cheat_account_deployment_data` for the given target\n- [`stop_cheat_account_contract_address_global`](cheatcodes/account_deployment_data.md#stop_cheat_account_contract_address_global) - cancels the `start_cheat_account_contract_address_global`\n\n> ℹ️ **Info**\n> To use cheatcodes you need to add `snforge_std` package as a development dependency in\n> your [`Scarb.toml`](https://docs.swmansion.com/scarb/docs/guides/dependencies.html#development-dependencies)\n> using the appropriate version.\n>\n> ```toml\n> [dev-dependencies]\n> snforge_std = \"{{snforge_std_version}}\"\n> ```\n"
  },
  {
    "path": "docs/src/appendix/inlining-optimizer.md",
    "content": "# Inlining Optimizer\n\nThe inlining optimizer helps you find the optimal value for the Scarb compiler's `inlining-strategy`\nsetting. This setting controls how aggressively the compiler inlines function calls,\nwhich affects both runtime gas cost and contract bytecode size.\nThe optimizer tries to optimize the parameter for a subset of contracts that you choose from your project, against a benchmark you define as an snforge test case.\n\n## Overview\nDuring Cairo contracts compilation, the compiler applies an optimization called inlining. \nIt works by replacing some functions calls, with \"inlined\" source code of the called function. \nThis may make the resulting compilation artifacts larger, as we copy some of your code, but it can make the performance of the compiled code better. \nThe amount of inlining that should be applied to your code is a balance between those two. \nEach of the projects you write may have a different \"perfect\" amount of inlining it needs. \nAlso, the right amount of inlining may depend on your use case - sometimes, if your contract will be called rarely, it may make sense to use less inlining and save gas during the contract declaration. \nThere is really no way for the compiler to find this balance during the compilation. \nInstead, the compiler assumes some default \"weight\" of the function, and inlines all functions below this \"weight\". \nThis one-suit-all solution is practical, but leaves some leeway for you to optimize the compiler configuration to best suit your projects needs. \nThe inlinig optimizer built into snforge is a tool, that should help you look for the right amount of inlining that your project needs. \n\nThe inlining optimization during the compilation can be configured with [`inlining-strategy` key in your Scarb.toml file](https://docs.swmansion.com/scarb/docs/reference/manifest.html#inlining-strategy).\nThe `inlining-strategy` value determines the inlining threshold: the compiler inlines a function when its cost estimate is below this value. \nA higher threshold means more aggressive inlining, which can lower runtime gas but also increase contract bytecode size.\nNote, that defining how compiler measures function \"weight\" is outside the scope for this document. \nAlso, the exact definition may change between compiler releases! \nFrom practical standpoint, it should be enough to treat this as a blackbox hyperparameter of your compilation.\n\nThe `snforge optimize-inlining` helps you better understand the effects of changing the `inlining-strategy` key, by compiling your project for a range of inlining keys and benchmark them against a predefined benchmark. \n\n## Usage\n\nThe optimizer requires a single representative test to measure gas at each threshold. \nPass it with `--exact` and a fully qualified test name, the same way as `snforge test --exact`:\nIt also requires you to specify a subset of contracts from your project that should be benchmarked. \nYou can specify by passing their names / paths to  `--contracts` argument. \nNote, that only contracts specified with this argument will be changed before executing your benchmarks - all other contracts are compiled with default inlinig strategy.\n\n```shell\n$ snforge optimize-inlining --contracts MyContract --exact my_package::tests::my_test\n```\n\n> 📝 **Note**\n>\n> The test should exercise the hot paths you care about!\n\nThe optimizer works on a copy of the project in a temporary directory so that intermediate\n`Scarb.toml` edits do not affect your working tree.\n\n## Output\n\nAfter testing all thresholds the optimizer prints a results table:\n\n```\n┌──────────────┬─────────────────┬──────────────────┬──────────────────────────┬────────┐\n│  Threshold   │    Total Gas    │  Contract Size   │ Contract Bytecode L2 Gas │ Status │\n├──────────────┼─────────────────┼──────────────────┼──────────────────────────┼────────┤\n│          0   │        123456   │        204800    │                  512000  │   ✓    │\n│         25   │        118000   │        215040    │                  537600  │   ✓    │\n│         50   │        115200   │        225280    │                  563200  │   ✓    │\n│        ...                                                                           │\n└──────────────┴─────────────────┴──────────────────┴──────────────────────────┴────────┘\n\nLowest runtime gas cost:     threshold=50, gas=115200, contract bytecode L2 gas=563200\nLowest contract size cost:   threshold=0,  gas=123456, contract bytecode L2 gas=512000\n```\n\nA PNG graph is also saved to the project's `target` directory, showing how gas and contract\nbytecode L2 gas vary with the threshold.\n\n## Applying the Result\n\nAdd `--gas` or `--size` to automatically write the optimal threshold back to `Scarb.toml`:\n\n```shell\n# Minimize runtime gas cost\n$ snforge optimize-inlining --contracts MyContract --exact my_package::tests::my_test --gas\n\n# Minimize contract bytecode L2 gas (deployment cost)\n$ snforge optimize-inlining --contracts MyContract --exact my_package::tests::my_test --size\n```\n\nThis updates the active Scarb profile with:\n\n```toml\n[profile.dev.cairo]\ninlining-strategy = 50\n```\n\n> 📝 **Note**\n>\n> `--gas` and `--size` are mutually exclusive. Without either flag, `Scarb.toml` is not modified\n> and the results are only printed for your review.\n\n## Contract Size Limits\n\nBy default the optimizer skips thresholds that produce contracts exceeding Starknet's on-chain\nlimits. You can adjust these limits with `--max-contract-size` (bytes) and `--max-contract-program-len`:\n\n```shell\n$ snforge optimize-inlining \\\n    --contracts MyContract \\\n    --exact my_package::tests::my_test \\\n    --max-contract-size 3000000 \\\n    --max-contract-program-len 60000\n```\n\nThresholds that violate either limit are marked with `✗` in the results table and are excluded from\nthe optimal threshold selection.\n\n## Search Range and Step\n\nBy default the optimizer tests thresholds from `0` to `250` in steps of `25`. Adjust this with\n`--min-threshold`, `--max-threshold`, and `--step`:\n\n```shell\n$ snforge optimize-inlining \\\n    --contracts MyContract \\\n    --exact my_package::tests::my_test \\\n    --min-threshold 20 \\\n    --max-threshold 100 \\\n    --step 10\n```\n\nA smaller step gives a finer-grained result but requires more compilations and test runs.\n\n## Passing Test Arguments\n\n`snforge optimize-inlining` accepts the same flags as `snforge test` for controlling fuzzer runs,\nprofiles, features, and so on. For example, to run under the `release` profile:\n\n```shell\n$ snforge optimize-inlining --contracts MyContract --exact my_package::tests::my_test --release\n```\n"
  },
  {
    "path": "docs/src/appendix/scarb-toml.md",
    "content": "# The Manifest Format\n\nThe `Scarb.toml` contains the package manifest that is needed in package compilation process. It can be used to provide configuration for Starknet Foundry Forge. For more, see [official Scarb documentation](https://docs.swmansion.com/scarb/docs/reference/manifest.html).\n\n## `Scarb.toml` Contents\n\n### `[tool.snforge]`\n```toml\n[tool.snforge]\n# ...\n```\nAllows to configure `snforge` settings. All fields are optional.\n\n#### `exit_first`\nThe `exit_first` fields specifies whether to stop tests execution immediately upon the first failure. See more about [stopping test execution after first failed test](https://foundry-rs.github.io/starknet-foundry/testing/running-tests.html#stopping-test-execution-after-first-failed-test).\n\n```toml\n[tool.snforge]\nexit_first = true\n```\n\n#### `fuzzer_runs`\nThe `fuzzer_runs` field specifies the number of runs of the random fuzzer. \n\n#### `fuzzer_seed`\nThe `fuzzer_seed` field specifies the seed for the random fuzzer.\n\nSee more about [fuzzer](https://foundry-rs.github.io/starknet-foundry/testing/test-attributes.html#fuzzer).\n\n#### Example of fuzzer configuration\n\n```toml\n[tool.snforge]\nfuzzer_runs = 1234\nfuzzer_seed = 1111\n```\n\n### `[[tool.snforge.fork]]`\n```toml\n[[tool.snforge.fork]]\n# ...\n```\nAllows to configure forked tests. If defined, all fields outlined below must also be defined. See more about [fork testing](https://foundry-rs.github.io/starknet-foundry/testing/test-attributes.html#fork).\n\n#### `name`\nThe `name` field specifies the name of the fork.\n```toml\n[[tool.snforge.fork]]\nname = \"SOME_NAME\"\n```\n\n#### `url`\nThe `url` field specifies the address of RPC provider.\n```toml\n[[tool.snforge.fork]]\nurl = \"http://your.rpc.url\"\n```\n\n#### `block_id.<tag|number|hash>`\nThe `block_id` field specifies the block to fork from. It can be specified by `tag`, `number` or `hash`.\n\n```toml\n[[tool.snforge.fork]]\nblock_id.hash = \"0x123\"\n```\n\n#### Example configuration with two forks\n\n```toml\n[[tool.snforge.fork]]\nname = \"SOME_NAME\"\nurl = \"http://your.rpc.url\"\nblock_id.tag = \"latest\"\n\n[[tool.snforge.fork]]\nname = \"SOME_SECOND_NAME\"\nurl = \"http://your.second.rpc.url\"\nblock_id.number = \"123\"\n```\n\n### `[tool.scarb]`\n\n```toml\n[tool.scarb]\nallow-prebuilt-plugins = [\"snforge_std\"]\n```\n\nIt allows `scarb` to download precompiled dependencies used by `snforge_std` from [the registry](https://scarbs.xyz).\nThe `snforge_std` library depends on a Cairo plugin that is written in Rust, and otherwise is compiled locally on the user's side.\n\n### `[profile.<dev|release>.cairo]`\nBy default, these arguments do not need to be defined. Only set them to use [profiler](https://foundry-rs.github.io/starknet-foundry/snforge-advanced-features/profiling.html#profiling) or [coverage](https://foundry-rs.github.io/starknet-foundry/testing/coverage.html#coverage).\n\nAdjust Cairo compiler configuration parameters when compiling this package. These options are not taken into consideration when this package is used as a dependency for another package. All fields are optional.\n\n```toml\n[profile.dev.cairo]\n# ...\n```\n\n#### `unstable-add-statements-code-locations-debug-info`\nSee [`unstable-add-statements-code-locations-debug-info`](https://docs.swmansion.com/scarb/docs/reference/manifest.html#unstable-add-statements-code-locations-debug-info) in Scarb documentation.\n\n```toml\n[profile.dev.cairo]\nunstable-add-statements-code-locations-debug-info = true\n```\n\n#### `unstable-add-statements-functions-debug-info`\nSee [`unstable-add-statements-functions-debug-info`](https://docs.swmansion.com/scarb/docs/reference/manifest.html#unstable-add-statements-functions-debug-info) in Scarb documentation.\n```toml\n[profile.dev.cairo]\nunstable-add-statements-functions-debug-info = true\n```\n\n#### `inlining-strategy`\nSee [`inlining-strategy`](https://docs.swmansion.com/scarb/docs/reference/manifest.html#inlining-strategy) in Scarb documentation.\n```toml\n[profile.dev.cairo]\ninlining-strategy = \"avoid\"\n```\n\n#### Example of configuration which allows [coverage](https://foundry-rs.github.io/starknet-foundry/testing/coverage.html) report generation\n```toml\n[profile.dev.cairo]\nunstable-add-statements-code-locations-debug-info = true\nunstable-add-statements-functions-debug-info = true\ninlining-strategy = \"avoid\"\n```\n\n### `[features]`\nA package defines a set of named features in the `[features]` section of `Scarb.toml` file. Each defined feature can list other features that should be enabled with it. All fields are optional.\n```toml\n[features]\n# ...\n```\n\n#### `<feature-name>`\nThe `<feature-name>` field specifies the name of the feature and list of other features that should be enabled with it.\nSee [features](https://docs.swmansion.com/scarb/docs/reference/conditional-compilation.html#features) in Scarb documentation.\n```toml\n[features]\nenable_for_tests = []\n```\n\n#### Example of `Scarb.toml` allowing conditional contracts compilation\nFirstly, define a contract in the src directory with a `#[cfg(feature: '<FEATURE_NAME>')]` attribute:\n```rust\n#[starknet::contract]\n#[cfg(feature: 'enable_for_tests')]\nmod MockContract {\n    // ...\n}\n```\n\nThen update Scarb.toml so it includes the following lines:\n```toml\n[features]\nenable_for_tests = []\n```\n\n### `[[target.starknet-contract]]`\nThe `starknet-contract` target allows to build the package as a Starknet Contract. See more about [Starknet Contract Target](https://docs.swmansion.com/scarb/docs/extensions/starknet/contract-target.html#starknet-contract-target) in Scarb documentation.\n\n```toml\n[[target.starknet-contract]]\n# ...\n```\n\n#### `sierra`\nSee more about [Sierra contract class generation](https://docs.swmansion.com/scarb/docs/extensions/starknet/contract-target.html#sierra-contract-class-generation) in Scarb documentation.\n```toml\n[[target.starknet-contract]]\nsierra = true\n```\n\n#### `casm`\n\nEnabling `casm = true` in Scarb.toml causes unnecessary overhead and should be disabled unless required by other tools. Tools like `snforge` and `sncast` recompile Sierra to CASM separately, resulting in redundant processing. This duplicates CASM generation, significantly impacting performance, especially for large Sierra programs. See more about [CASM contract class generation](https://docs.swmansion.com/scarb/docs/extensions/starknet/contract-target.html#casm-contract-class-generation) in Scarb documentation.\n\n\n```toml\n[[target.starknet-contract]]\ncasm = true\n```\n\n#### `build-external-contracts`\nThe `build-external-contracts` allows to use contracts from your dependencies inside your tests. It accepts a list of strings, each of which is a reference to a contract defined in a dependency. You need to add dependency which implements this contracts to your Scarb.toml. See more about [compiling external contracts](https://docs.swmansion.com/scarb/docs/extensions/starknet/contract-target.html#compiling-external-contracts) in Scarb documentation. \n\n```toml\n[[target.starknet-contract]]\nbuild-external-contracts = [\"openzeppelin::account::account::Account\"]\n```\n\n#### Example of configuration which allows to use external contracts in tests\n```toml\n# ...\n[dependencies]\nstarknet = \">=2.8.2\"\nopenzeppelin = { git = \"https://github.com/OpenZeppelin/cairo-contracts.git\", branch = \"cairo-2\" }\n\n[[target.starknet-contract]]\nbuild-external-contracts = [\"openzeppelin::account::account::Account\"]\n# ...\n```\n\n#### Complete example of `Scarb.toml`\n```toml\n[package]\nname = \"example_package\"\nversion = \"0.1.0\"\nedition = \"2023_11\"\n\n# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html\n\n[dependencies]\nstarknet = \"2.8.2\"\n\n[dev-dependencies]\nsnforge_std = \"{{snforge_std_version}}\"\nstarknet = \">=2.8.2\"\nopenzeppelin = { git = \"https://github.com/OpenZeppelin/cairo-contracts.git\", branch = \"cairo-2\" }\n\n[[target.starknet-contract]]\nsierra = true\nbuild-external-contracts = [\"openzeppelin::account::account::Account\"]\n\n[scripts]\ntest = \"snforge test\"\n# foo = { path = \"vendor/foo\" }\n\n[tool.snforge]\nexit_first = true\nfuzzer_runs = 1234\nfuzzer_seed = 1111\n\n[[tool.snforge.fork]]\nname = \"SOME_NAME\"\nurl = \"http://your.rpc.url\"\nblock_id.tag = \"latest\"\n\n[[tool.snforge.fork]]\nname = \"SOME_SECOND_NAME\"\nurl = \"http://your.second.rpc.url\"\nblock_id.number = \"123\"\n\n[[tool.snforge.fork]]\nname = \"SOME_THIRD_NAME\"\nurl = \"http://your.third.rpc.url\"\nblock_id.hash = \"0x123\"\n\n[profile.dev.cairo]\nunstable-add-statements-code-locations-debug-info = true\nunstable-add-statements-functions-debug-info = true\ninlining-strategy = \"avoid\"\n\n[features]\nenable_for_tests = []\n```\n"
  },
  {
    "path": "docs/src/appendix/sncast/account/account.md",
    "content": "# `account`\nProvides a set of account management commands.\n\nIt has the following subcommands:\n* [`import`](./import.md)\n* [`create`](./create.md)\n* [`deploy`](./deploy.md)\n* [`delete`](./delete.md)\n* [`list`](./list.md)\n"
  },
  {
    "path": "docs/src/appendix/sncast/account/create.md",
    "content": "# `create`\nPrepare all prerequisites for account deployment.\n\nAccount information will be saved to the file specified by `--accounts-file` argument,\nwhich is `~/.starknet_accounts/starknet_open_zeppelin_accounts.json` by default.\n\n## `--name, -n <ACCOUNT_NAME>`\nOptional.\n\nAccount name under which account information is going to be saved.\n\nIf `--name` is not provided, it will be generated automatically.\n\n## `--url, -u <RPC_URL>`\nOptional.\n\nStarknet RPC node url address.\n\nOverrides url from `snfoundry.toml`.\n\n## `--network <NETWORK>`\nOptional.\n\nUse predefined network with a public provider\n\nPossible values: `mainnet`, `sepolia`, `devnet`.\n\nOverrides network from `snfoundry.toml`.\n\n## `--type, -t <ACCOUNT_TYPE>`\nOptional. Required if `--class-hash` is passed.\n\n<!-- TODO(#3556): Remove `argent` option once we drop Argent account type. -->\nType of the account. Possible values: `oz`, `argent`, `ready`, `braavos`. Defaults to oz.\n\n<!-- TODO(#3556): Remove warning once we drop Argent account type. -->\n> ⚠️ **Warning**\n>\n> Argent has rebranded as Ready. The `argent` option is deprecated, please use `ready` instead.\n\nVersions of the account contracts:\n\n<!-- TODO(#3556): Remove `argent` option once we drop Argent account type. -->\n\n| Account Contract   | Version | Class Hash                                                                                                                                                            |\n| ------------------ | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `oz`               | v1.0.0  | [0x05b4b537eaa2399e3aa99c4e2e0208ebd6c71bc1467938cd52c798c601e43564](https://voyager.online/class/0x05b4b537eaa2399e3aa99c4e2e0208ebd6c71bc1467938cd52c798c601e43564) |\n| `argent` / `ready` | v0.4.0  | [0x036078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f](https://voyager.online/class/0x036078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f) |\n| `braavos`          | v1.2.0  | [0x03957f9f5a1cbfe918cedc2015c85200ca51a5f7506ecb6de98a5207b759bf8a](https://voyager.online/class/0x03957f9f5a1cbfe918cedc2015c85200ca51a5f7506ecb6de98a5207b759bf8a) |\n\n## `--salt, -s <SALT>`\nOptional.\n\nSalt for the account address. If omitted random one will be generated.\n\n## `--add-profile <NAME>`\nOptional.\n\nIf passed, a profile with corresponding name will be added to the local snfoundry.toml.\n\n## `--class-hash, -c`\nOptional.\n\nClass hash of a custom openzeppelin account contract declared to the network.\n\n## `--ledger-path <HD_PATH>`\nOptional.\n\n[EIP-2645 derivation path](../../../starknet/eip-2645-hd-paths.md) of the Ledger key that will control this account (e.g., `m//starknet'/sncast'/0'/1'/0`).\n\nWhen provided, the public key is read from the Ledger device.\n\nConflicts with: [`--ledger-account-id`](#--ledger-account-id-account_id)\n\nSee [Ledger Hardware Wallet](../../../starknet/ledger.md) for details.\n\n## `--ledger-account-id <ACCOUNT_ID>`\nOptional.\n\nShorthand for `--ledger-path`. The account ID is used to derive the path `m//starknet'/sncast'/0'/<account-id>'/0`.\n\nConflicts with: [`--ledger-path`](#--ledger-path-hd_path)\n\nSee [Ledger Hardware Wallet](../../../starknet/ledger.md) for details.\n"
  },
  {
    "path": "docs/src/appendix/sncast/account/delete.md",
    "content": "# `delete`\nDelete an account from `accounts-file`.\n\n## `--name, -n <ACCOUNT_NAME>`\nRequired.\n\nAccount name which is going to be deleted.\n\n## `--url, -u <RPC_URL>`\nOptional.\n\nStarknet RPC node url address.\n\nOverrides url from `snfoundry.toml`.\n\n## `--network <NETWORK>`\nOptional.\n\nUse predefined network with a public provider\n\nPossible values: `mainnet`, `sepolia`, `devnet`.\n\nOverrides network from `snfoundry.toml`.\n\n## `--network-name`\nOptional.\n\nNetwork in `accounts-file` associated with the account. By default, the network passed as `--network` of RPC node.\n\n## `--yes`\nOptional.\n\nIf passed, assume \"yes\" as answer to confirmation prompt and run non-interactively\n"
  },
  {
    "path": "docs/src/appendix/sncast/account/deploy.md",
    "content": "# `deploy`\nDeploy previously created account to Starknet.\n\n## `--name, -n <ACCOUNT_NAME>`\nRequired.\n\nName of the (previously created) account to be deployed.\n\n## `--url, -u <RPC_URL>`\nOptional.\n\nStarknet RPC node url address.\n\nOverrides url from `snfoundry.toml`.\n\n## `--network <NETWORK>`\nOptional.\n\nUse predefined network with a public provider\n\nPossible values: `mainnet`, `sepolia`, `devnet`.\n\nOverrides network from `snfoundry.toml`.\n\n## `--max-fee, -m <MAX_FEE>`\nOptional.\n\nMaximum fee for the `deploy_account` denoted in FRI. Must be greater than zero. If provided, it is not possible to use any of the following fee related flags: `--l1-gas`, `--l1-gas-price`, `--l2-gas`, `--l2-gas-price`, `--l1-data-gas`, `--l1-data-gas-price`.\n\n## `--l1-gas <L1_GAS>`\nOptional.\n\nMaximum L1 gas for the `deploy_account` transaction. When not used, defaults to auto-estimation.\n\n## `--l1-gas-price <l1_gas_price>`\nOptional.\n\nMaximum L1 gas unit price for the `deploy_account` transaction. When not used, defaults to auto-estimation.\n\n## `--l2-gas <L2_GAS>`\nOptional.\n\nMaximum L2 gas for the `deploy_account` transaction. When not used, defaults to auto-estimation.\n\n## `--l2-gas-price <L2_GAS_PRICE>`\nOptional.\n\nMaximum L2 gas unit price for the `deploy_account` transaction. When not used, defaults to auto-estimation.\n\n## `--l1-data-gas <L1_DATA_GAS>`\nOptional.\n\nMaximum L1 data gas for the `deploy_account` transaction. When not used, defaults to auto-estimation.\n\n## `--l1-data-gas-price <l1_data_gas_price>`\nOptional.\n\nMaximum L1 data gas unit price for the `deploy_account` transaction. When not used, defaults to auto-estimation.\n\n## `--tip <TIP>`\nOptional.\nConflicts with: [`--estimate-tip`](#--estimate-tip-estimate_tip)\n\nTip for the transaction. When not provided, defaults to 0 unless [`--estimate-tip`](#--estimate-tip-estimate_tip) is used.\n\n## `--estimate-tip`\nOptional.\nConflicts with: [`--tip`](#--tip-tip)\n\nIf passed, an estimated tip will be added to pay for the transaction. The tip is estimated based on the current network conditions and added to the transaction fee.\n\n## `--silent`\nOptional.\n\nIf passed, the command will not trigger an interactive prompt to add an account as a default\n"
  },
  {
    "path": "docs/src/appendix/sncast/account/import.md",
    "content": "# `import`\nImport an account to accounts file.\n\nAccount information will be saved to the file specified by `--accounts-file` argument,\nwhich is `~/.starknet_accounts/starknet_open_zeppelin_accounts.json` by default.\n\n## `--name, -n <NAME>`\nOptional.\n\nName of the account to be imported.\n\n## `--address, -a <ADDRESS>`\nRequired.\n\nAddress of the account.\n\n## `--type, -t <ACCOUNT_TYPE>`\nRequired.\n\n<!-- TODO(#3556): Remove `argent` option once we drop Argent account type. -->\nType of the account. Possible values: `oz`, `argent`, `ready`, `braavos`.\n\n<!-- TODO(#3556): Remove warning once we drop Argent account type. -->\n> ⚠️ **Warning**\n>\n> Argent has rebranded as Ready. The `argent` option is deprecated, please use `ready` instead.\n\n## `--url, -u <RPC_URL>`\nOptional.\n\nStarknet RPC node url address.\n\nOverrides url from `snfoundry.toml`.\n\n## `--network <NETWORK>`\nOptional.\n\nUse predefined network with public provider\n\nPossible values: `mainnet`, `sepolia`, `devnet`.\n\nOverrides network from `snfoundry.toml`.\n\n## `--class-hash, -c <CLASS_HASH>`\nOptional.\n\nClass hash of the account.\n\n## `--private-key <PRIVATE_KEY>`\nOptional.\n\nAccount private key.\n\n## `--ledger-path <HD_PATH>`\nOptional.\n\n[EIP-2645 derivation path](../../../starknet/eip-2645-hd-paths.md) of the Ledger key that controls this account (e.g., `m//starknet'/sncast'/0'/1'/0`).\n\nWhen provided, the public key is read from the Ledger device instead of from `--private-key`.\n\nConflicts with: [`--private-key`](#--private-key-private_key), [`--private-key-file`](#--private-key-file-private_key_file_path), [`--ledger-account-id`](#--ledger-account-id-account_id)\n\nSee [Ledger Hardware Wallet](../../../starknet/ledger.md) for details.\n\n## `--ledger-account-id <ACCOUNT_ID>`\nOptional.\n\nShorthand for `--ledger-path`. The account ID is used to derive the path `m//starknet'/sncast'/0'/<account-id>'/0`.\n\nConflicts with: [`--ledger-path`](#--ledger-path-hd_path), [`--private-key`](#--private-key-private_key), [`--private-key-file`](#--private-key-file-private_key_file_path)\n\nSee [Ledger Hardware Wallet](../../../starknet/ledger.md) for details.\n\n## `--private-key-file <PRIVATE_KEY_FILE_PATH>`\nOptional. If neither `--private-key` nor `--private-key-file` is passed, the user will be prompted to enter the account private key.\n\nPath to the file holding account private key.\n\n## `--salt, -s <SALT>`\nOptional.\n\nSalt for the account address.\n\n## `--add-profile <NAME>`\nOptional.\n\nIf passed, a profile with corresponding name will be added to the local snfoundry.toml.\n\n## `--silent`\nOptional.\n\nIf passed, the command will not trigger an interactive prompt to add an account as a default\n"
  },
  {
    "path": "docs/src/appendix/sncast/account/list.md",
    "content": "# `list`\nList all available accounts.\n\nAccount information will be retrieved from the file specified in user's environment.\nThe output format is dependent on user's configuration, either provided via CLI or specified in `snfoundry.toml`.\nHides user's private keys by default.\n\n> ⚠️ **Warning**\n> This command outputs cryptographic information about accounts, e.g. user's private key.\n> Use it responsibly to not cause any vulnerabilities to your environment and confidential data.\n\n## Required Common Arguments — Passed By CLI or Specified in `snfoundry.toml`\n\n* [`accounts-file`](../common.md#--accounts-file--f-path_to_accounts_file)\n\n## Optional Common Arguments — Passed By CLI or Specified in `snfoundry.toml`\n\n* [`json`](../common.md#--json--j)\n\n## `--display-private-keys`, `-p`\nOptional.\n\nIf passed, show private keys along with the rest of the account information.\n\n"
  },
  {
    "path": "docs/src/appendix/sncast/balance.md",
    "content": "<!-- TODO(#4214): Remove moved sncast commands -->\n\n# `balance`\n\n> ⚠️ **This command has moved to [`sncast get balance`](./get/balance.md).**\n>\n> `sncast balance` still works but will be removed in the future.\n"
  },
  {
    "path": "docs/src/appendix/sncast/call.md",
    "content": "# `call`\nCall a smart contract on Starknet with the given parameters.\n\n## `--contract-address, -d <CONTRACT_ADDRESS>`\nRequired.\n\nThe address of the contract being called in hex (prefixed with '0x') or decimal representation.\n\n## `--function, -f <FUNCTION_NAME>`\nRequired.\n\nThe name of the function being called.\n\n## `--url, -u <RPC_URL>`\nOptional.\n\nStarknet RPC node url address.\n\nOverrides url from `snfoundry.toml`.\n\n## `--network <NETWORK>`\nOptional.\n\nUse predefined network with public provider\n\nPossible values: `mainnet`, `sepolia`, `devnet`.\n\nOverrides network from `snfoundry.toml`.\n\n## `--calldata, -c <CALLDATA>`\nOptional.\nConflicts with: [`--arguments`](#--arguments)\n\nInputs to the function, represented by a list of space-delimited values, e.g. `0x1 2 0x3`.\nCalldata arguments may be either 0x hex or decimal felts.\n\n## `--arguments`\nOptional.\nConflicts with: [`--calldata`](#--calldata--c-calldata)\n\nFunction arguments provided as a comma-separated string of Cairo expressions.\nFor example: `--arguments '1, 2, MyStruct { x: 1, y: 2 }, MyEnum::Variant'`\n\nFor more information on supported expressions and syntax, see [Calldata Transformation](../../starknet/calldata-transformation.md).\n\n## `--block-id, -b <BLOCK_ID>`\nOptional.\n\nBlock identifier on which call should be performed.\nPossible values: `pre_confirmed`, `latest`, block hash (0x prefixed string), and block number (u64).\n`pre_confirmed` is used as a default value.\n"
  },
  {
    "path": "docs/src/appendix/sncast/common.md",
    "content": "# `sncast` common flags\nThese flags must be specified directly after the `sncast` command and before the subcommand name.\n\n## `--profile, -p <PROFILE_NAME>`\nOptional.\n\nUsed for both `snfoundry.toml` and `Scarb.toml` if specified.\nDefaults to `default` (`snfoundry.toml`) and `release` (`Scarb.toml`) in most contexts.\n\n## `--account, -a <ACCOUNT_NAME>`\nOptional.\n\nAccount name used to interact with the network, aliased in the accounts file.\n\nOverrides account from `snfoundry.toml`.\n\nIf used with `--keystore`, should be a path to [starkli account JSON file](https://book.starkli.rs/accounts#accounts).\n\n## `--accounts-file, -f <PATH_TO_ACCOUNTS_FILE>`\nOptional.\n\nPath to the accounts file holding accounts information. Defaults to `~/.starknet_accounts/starknet_open_zeppelin_accounts.json`.\n\n## `--keystore, -k <PATH_TO_KEYSTORE_FILE>`\nOptional.\n\nPath to [keystore file](https://book.starkli.rs/signers#encrypted-keystores).\nWhen specified, the --account argument must be a path to [starkli account JSON file](https://book.starkli.rs/accounts#accounts).\n\n## `--json, -j`\nOptional.\n\nIf passed, output will be displayed in json format.\n\n## `--wait, -w`\nOptional.\n\nIf passed, command will wait until transaction is accepted or rejected.\n\n## `--wait-timeout <TIME_IN_SECONDS>`\nOptional.\n\nIf `--wait` is passed, this will set the time after which `sncast` times out. Defaults to 60s.\n\n## `--wait-retry-interval <TIME_IN_SECONDS>`\nOptional.\n\nIf `--wait` is passed, this will set the retry interval - how often `sncast` should fetch tx info from the node. Defaults to 5s.\n\n## `--version, -v`\n\nPrints out `sncast` version.\n\n## `--help, -h`\n\nPrints out help.\n"
  },
  {
    "path": "docs/src/appendix/sncast/completions.md",
    "content": "# `completions`\nGenerates a completions script for the specified shell and writes it to `stdout`.\n\n## `[SHELL]`\nOptional \n\nIf not specified, the script will be generated for the shell detected under `$SHELL` variable.\n\nPossible values: `bash`, `elvish`, `fish`, `powershell`, `zsh`\n\n## `-h`, `--help`\n\nPrint help.\n"
  },
  {
    "path": "docs/src/appendix/sncast/declare.md",
    "content": "# `declare`\nSend a declare transaction of Cairo contract to Starknet.\n\n## Required Common Arguments — Passed By CLI or Specified in `snfoundry.toml`\n\n* [`account`](./common.md#--account--a-account_name)\n\n## `--contract-name, -c <CONTRACT_NAME>`\nRequired.\n\nName of the contract. Contract name is a part after the mod keyword in your contract file.\n\n## `--url, -u <RPC_URL>`\nOptional.\n\nStarknet RPC node url address.\n\nOverrides url from `snfoundry.toml`.\n\n## `--network <NETWORK>`\nOptional.\n\nUse predefined network with public provider\n\nPossible values: `mainnet`, `sepolia`, `devnet`.\n\nOverrides network from `snfoundry.toml`.\n\n## `--max-fee, -m <MAX_FEE>`\nOptional.\n\nMaximum fee for the `declare` denoted in FRI. Must be greater than zero. If provided, it is not possible to use any of the following fee related flags: `--l1-gas`, `--l1-gas-price`, `--l2-gas`, `--l2-gas-price`, `--l1-data-gas`, `--l1-data-gas-price`.\n\n## `--l1-gas <L1_GAS>`\nOptional.\n\nMaximum L1 gas for the `declare` transaction. When not used, defaults to auto-estimation.\n\n## `--l1-gas-price <l1_gas_price>`\nOptional.\n\nMaximum L1 gas unit price for the `declare` transaction. When not used, defaults to auto-estimation.\n\n## `--l2-gas <L2_GAS>`\nOptional.\n\nMaximum L2 gas for the `declare` transaction. When not used, defaults to auto-estimation.\n\n## `--l2-gas-price <L2_GAS_PRICE>`\nOptional.\n\nMaximum L2 gas unit price for the `declare` transaction. When not used, defaults to auto-estimation.\n\n## `--l1-data-gas <L1_DATA_GAS>`\nOptional.\n\nMaximum L1 data gas for the `declare` transaction. When not used, defaults to auto-estimation.\n\n## `--l1-data-gas-price <l1_data_gas_price>`\nOptional.\n\nMaximum L1 data gas unit price for the `declare` transaction. When not used, defaults to auto-estimation.\n\n## `--tip <TIP>`\nOptional.\nConflicts with: [`--estimate-tip`](#--estimate-tip-estimate_tip)\n\nTip for the transaction. When not provided, defaults to 0 unless [`--estimate-tip`](#--estimate-tip-estimate_tip) is used.\n\n## `--estimate-tip`\nOptional.\nConflicts with: [`--tip`](#--tip-tip)\n\nIf passed, an estimated tip will be added to pay for the transaction. The tip is estimated based on the current network conditions and added to the transaction fee.\n\n## `--nonce, -n <NONCE>`\nOptional.\n\nNonce for transaction. If not provided, nonce will be set automatically.\n\n## `--package <NAME>`\nOptional.\n\nName of the package that should be used.\n\nIf supplied, a contract from this package will be used. Required if more than one package exists in a workspace."
  },
  {
    "path": "docs/src/appendix/sncast/declare_from.md",
    "content": "# `declare-from`\nDeclare a contract either: \n- from a compiled Sierra file\n- by fetching it from another Starknet instance.\n\nThe allowed args depend on the chosen contract source:\n- **File:** `--sierra-file` (required)\n- **Network:** `--class-hash` (required), `--block-id` (optional),  `--source-url` (optional), `--source-network` (optional)\n\nNote: **file** and **network** args are mutually exclusive.\n\n## Required Common Arguments — Passed By CLI or Specified in `snfoundry.toml`\n\n* [`account`](./common.md#--account--a-account_name)\n\n## `--sierra-file <SIERRA_FILE>`\nRequired in file mode.\n\nPath to the compiled Sierra contract class file (e.g. `target/dev/MyContract_MyContract.contract_class.json`).\n\n## `--class-hash, -g <CLASS_HASH>`\nRequired in network mode.\n\nClass hash of contract declared on a different network.\n\n## `--url, -u <RPC_URL>`\nOptional.\n\nStarknet RPC node url address.\n\nOverrides url from `snfoundry.toml`.\n\n## `--network <NETWORK>`\nOptional.\n\nUse predefined network with public provider\n\nPossible values: `mainnet`, `sepolia`, `devnet`.\n\nOverrides network from `snfoundry.toml`.\n\n## `--source-url, -s <RPC_URL>`\nOptional.\n\nStarknet RPC node url address of the source network where the contract is already declared.\n\n## `--source-network <NETWORK>`\nOptional.\n\nUse predefined network with public provider where the contract is already declared.\n\nPossible values: `mainnet`, `sepolia`, `devnet`.\n\n## `--max-fee, -m <MAX_FEE>`\nOptional.\n\nMaximum fee for the `declare` denoted in FRI. Must be greater than zero. If provided, it is not possible to use any of the following fee related flags: `--l1-gas`, `--l1-gas-price`, `--l2-gas`, `--l2-gas-price`, `--l1-data-gas`, `--l1-data-gas-price`.\n\n## `--l1-gas <L1_GAS>`\nOptional.\n\nMaximum L1 gas for the `declare` transaction. When not used, defaults to auto-estimation.\n\n## `--l1-gas-price <l1_gas_price>`\nOptional.\n\nMaximum L1 gas unit price for the `declare` transaction. When not used, defaults to auto-estimation.\n\n## `--l2-gas <L2_GAS>`\nOptional.\n\nMaximum L2 gas for the `declare` transaction. When not used, defaults to auto-estimation.\n\n## `--l2-gas-price <L2_GAS_PRICE>`\nOptional.\n\nMaximum L2 gas unit price for the `declare` transaction. When not used, defaults to auto-estimation.\n\n## `--l1-data-gas <L1_DATA_GAS>`\nOptional.\n\nMaximum L1 data gas for the `declare` transaction. When not used, defaults to auto-estimation.\n\n## `--l1-data-gas-price <l1_data_gas_price>`\nOptional.\n\nMaximum L1 data gas unit price for the `declare` transaction. When not used, defaults to auto-estimation.\n\n## `--tip <TIP>`\nOptional.\nConflicts with: [`--estimate-tip`](#--estimate-tip-estimate_tip)\n\nTip for the transaction. When not provided, defaults to 0 unless [`--estimate-tip`](#--estimate-tip-estimate_tip) is used.\n\n## `--estimate-tip`\nOptional.\nConflicts with: [`--tip`](#--tip-tip)\n\nIf passed, an estimated tip will be added to pay for the transaction. The tip is estimated based on the current network conditions and added to the transaction fee.\n\n## `--nonce, -n <NONCE>`\nOptional.\n\nNonce for transaction. If not provided, nonce will be set automatically.\n\n## `--block-id, -b <BLOCK_ID>`\nOptional.\n\nBlock identifier on which class of declared contract should be fetched.\nPossible values: `pre_confirmed`, `latest`, block hash (0x prefixed string), and block number (u64).\n`latest` is used as a default value.\n"
  },
  {
    "path": "docs/src/appendix/sncast/deploy.md",
    "content": "# `deploy`\nDeploy a contract to Starknet.\n\n## Required Common Arguments — Passed By CLI or Specified in `snfoundry.toml`\n\n* [`account`](./common.md#--account--a-account_name)\n\n## `--class-hash, -g <CLASS_HASH>`\nRequired if `--contract-name` is not provided.\n\nClass hash of contract to deploy.\n\n## `--contract-name <CONTRACT_NAME>`\nRequired if `--class-hash` is not provided.\n\nName of the contract to deploy. Can be used instead of `--class-hash`. Requires `--package` if more than one package exists in a workspace.\n\n## `--package <NAME>`\nOptional.\n\nName of the package that should be used.\n\nIf supplied, a contract from this package will be used. Required if more than one package exists in a workspace.\n\n## `--url, -u <RPC_URL>`\nOptional.\n\nStarknet RPC node url address.\n\nOverrides url from `snfoundry.toml`.\n\n## `--network <NETWORK>`\nOptional.\n\nUse predefined network with public provider\n\nPossible values: `mainnet`, `sepolia`, `devnet`.\n\nOverrides network from `snfoundry.toml`.\n\n## `--constructor-calldata, -c <CONSTRUCTOR_CALLDATA>`\nOptional.\nConflicts with: [`--arguments`](#--arguments)\n\nCalldata for the contract constructor.\n\n## `--arguments`\nOptional.\nConflicts with: [`--constructor-calldata`](#--constructor-calldata--c-constructor_calldata)\n\nConstructor arguments provided as a comma-separated string of Cairo expressions.\nFor example: `--arguments '1, 2, MyStruct { x: 1, y: 2 }, MyEnum::Variant'`\n\nFor more information on supported expressions and syntax, see [Calldata Transformation](../../starknet/calldata-transformation.md).\n\n## `--salt, -s <SALT>`\nOptional.\n\nSalt for the contract address.\n\n## `--unique`\nOptional.\n\nIf passed, the salt will be additionally modified with an account address.\n\n## `--max-fee, -m <MAX_FEE>`\nOptional.\n\nMaximum fee for the `deploy` denoted in FRI. Must be greater than zero. If provided, it is not possible to use any of the following fee related flags: `--l1-gas`, `--l1-gas-price`, `--l2-gas`, `--l2-gas-price`, `--l1-data-gas`, `--l1-data-gas-price`.\n\n## `--l1-gas <L1_GAS>`\nOptional.\n\nMaximum L1 gas for the `deploy` transaction. When not used, defaults to auto-estimation.\n\n## `--l1-gas-price <l1_gas_price>`\nOptional.\n\nMaximum L1 gas unit price for the `deploy` transaction. When not used, defaults to auto-estimation.\n\n## `--l2-gas <L2_GAS>`\nOptional.\n\nMaximum L2 gas for the `deploy` transaction. When not used, defaults to auto-estimation.\n\n## `--l2-gas-price <L2_GAS_PRICE>`\nOptional.\n\nMaximum L2 gas unit price for the `deploy` transaction. When not used, defaults to auto-estimation.\n\n## `--l1-data-gas <L1_DATA_GAS>`\nOptional.\n\nMaximum L1 data gas for the `deploy` transaction. When not used, defaults to auto-estimation.\n\n## `--l1-data-gas-price <l1_data_gas_price>`\nOptional.\n\nMaximum L1 data gas unit price for the `deploy` transaction. When not used, defaults to auto-estimation.\n\n## `--tip <TIP>`\nOptional.\nConflicts with: [`--estimate-tip`](#--estimate-tip-estimate_tip)\n\nTip for the transaction. When not provided, defaults to 0 unless [`--estimate-tip`](#--estimate-tip-estimate_tip) is used.\n\n## `--estimate-tip`\nOptional.\nConflicts with: [`--tip`](#--tip-tip)\n\nIf passed, an estimated tip will be added to pay for the transaction. The tip is estimated based on the current network conditions and added to the transaction fee.\n\n## `--nonce, -n <NONCE>`\nOptional.\n\nNonce for transaction. If not provided, nonce will be set automatically.\n"
  },
  {
    "path": "docs/src/appendix/sncast/get/balance.md",
    "content": "# `get balance`\nFetch balance of the account for specified token.\n\n## `--token, -t <TOKEN>`\nOptional.\nConflicts with: [`--token-address`](#--token-address--d-token_address)\n\nName of the token to check the balance for. Possible values\n- `strk` (default)\n- `eth`\n\n## `--token-address, -d <TOKEN_ADDRESS>`\nOptional.\nConflicts with: [`--token`](#--token--t-token)\n\nToken contract address to check the balance for. Token needs to be compatible with ERC-20 standard.\n\n## `--block-id, -b <BLOCK_ID>`\nOptional.\n\nBlock identifier on which balance should be fetched.\nPossible values: `pre_confirmed`, `latest`, block hash (0x prefixed string), and block number (u64).\n`pre_confirmed` is used as a default value.\n\n## `--url, -u <RPC_URL>`\nOptional.\n\nStarknet RPC node url address.\n\nOverrides url from `snfoundry.toml`.\n\n## `--network <NETWORK>`\nOptional.\n\nUse predefined network with public provider\n\nPossible values: `mainnet`, `sepolia`, `devnet`.\n\nOverrides network from `snfoundry.toml`.\n"
  },
  {
    "path": "docs/src/appendix/sncast/get/class_hash_at.md",
    "content": "# `get class-hash-at`\n\nGet the class hash of a contract deployed at a given address.\n\n## `<CONTRACT_ADDRESS>`\n\nRequired.\n\nAddress of the contract in hex (prefixed with '0x') or decimal representation.\n\n## `--block-id, -b <BLOCK_ID>`\n\nOptional.\n\nBlock identifier on which class hash should be fetched.\nPossible values: `pre_confirmed`, `latest`, block hash (0x prefixed string), and block number (u64).\n`pre_confirmed` is used as a default value.\n\n## `--url, -u <RPC_URL>`\n\nOptional.\n\nStarknet RPC node url address.\n\nOverrides url from `snfoundry.toml`.\n\n## `--network <NETWORK>`\n\nOptional.\n\nUse predefined network with public provider\n\nPossible values: `mainnet`, `sepolia`, `devnet`.\n\nOverrides network from `snfoundry.toml`.\n"
  },
  {
    "path": "docs/src/appendix/sncast/get/get.md",
    "content": "# `get`\nCommands for querying Starknet state.\n\nIt has the following subcommands:\n* [`balance`](./balance.md)\n* [`class-hash-at`](./class_hash_at.md)\n* [`nonce`](./nonce.md)\n* [`tx`](./tx.md)\n* [`tx-status`](./tx-status.md)\n"
  },
  {
    "path": "docs/src/appendix/sncast/get/nonce.md",
    "content": "# `get nonce`\n\nGet the nonce of the specified contract.\n\n## `<CONTRACT_ADDRESS>`\n\nRequired.\n\nAddress of the contract in hex (prefixed with '0x') or decimal representation.\n\n## `--block-id, -b <BLOCK_ID>`\nOptional.\n\nBlock identifier on which nonce should be fetched.\nPossible values: `pre_confirmed`, `latest`, block hash (0x prefixed string), and block number (u64).\n`pre_confirmed` is used as a default value.\n\n## `--url, -u <RPC_URL>`\nOptional.\n\nStarknet RPC node url address.\n\nOverrides url from `snfoundry.toml`.\n\n## `--network <NETWORK>`\nOptional.\n\nUse predefined network with public provider\n\nPossible values: `mainnet`, `sepolia`, `devnet`.\n\nOverrides network from `snfoundry.toml`.\n"
  },
  {
    "path": "docs/src/appendix/sncast/get/tx-status.md",
    "content": "# `get tx-status`\n\nGet the status of a transaction\n\n## `<TRANSACTION_HASH>`\n\nRequired.\n\nHash of the transaction\n\n## `--url, -u <RPC_URL>`\nOptional.\n\nStarknet RPC node url address.\n\nOverrides url from `snfoundry.toml`.\n\n## `--network <NETWORK>`\nOptional.\n\nUse predefined network with public provider\n\nPossible values: `mainnet`, `sepolia`, `devnet`.\n\nOverrides network from `snfoundry.toml`.\n"
  },
  {
    "path": "docs/src/appendix/sncast/get/tx.md",
    "content": "# `get tx`\n\nGet the details of a transaction\n\n## `<TRANSACTION_HASH>`\n\nRequired.\n\nHash of the transaction.\n\n## `--url, -u <RPC_URL>`\nOptional.\n\nStarknet RPC node url address.\n\nOverrides url from `snfoundry.toml`.\n\n## `--network <NETWORK>`\nOptional.\n\nUse predefined network with public provider\n\nPossible values: `mainnet`, `sepolia`, `devnet`.\n\nOverrides network from `snfoundry.toml`.\n\n## `--with-proof-facts`\nOptional.\n\nIf passed, includes proof facts in the transaction response (when supported by the connected RPC node).\n"
  },
  {
    "path": "docs/src/appendix/sncast/invoke.md",
    "content": "# `invoke`\nSend an invoke transaction to Starknet.\n\n## Required Common Arguments — Passed By CLI or Specified in `snfoundry.toml`\n\n* [`account`](./common.md#--account--a-account_name)\n\n## `--contract-address, -d <CONTRACT_ADDRESS>`\nRequired.\n\nThe address of the contract being called in hex (prefixed with '0x') or decimal representation.\n\n## `--function, -f <FUNCTION_NAME>`\nRequired.\n\nThe name of the function to call.\n\n## `--calldata, -c <CALLDATA>`\nOptional.\nConflicts with: [`--arguments`](#--arguments)\n\nInputs to the function, represented by a list of space-delimited values `0x1 2 0x3`.\nCalldata arguments may be either 0x hex or decimal felts.\n\n## `--arguments`\nOptional.\nConflicts with: [`--calldata`](#--calldata--c-calldata)\n\nFunction arguments provided as a comma-separated string of Cairo expressions.\nFor example: `--arguments '1, 2, MyStruct { x: 1, y: 2 }, MyEnum::Variant'`\n\nFor more information on supported expressions and syntax, see [Calldata Transformation](../../starknet/calldata-transformation.md).\n\n## `--url, -u <RPC_URL>`\nOptional.\n\nStarknet RPC node url address.\n\nOverrides url from `snfoundry.toml`.\n\n## `--network <NETWORK>`\nOptional.\n\nUse predefined network with public provider\n\nPossible values: `mainnet`, `sepolia`, `devnet`.\n\nOverrides network from `snfoundry.toml`.\n\n## `--max-fee, -m <MAX_FEE>`\nOptional.\n\nMaximum fee for the `invoke` denoted in FRI. Must be greater than zero. If provided, it is not possible to use any of the following fee related flags: `--l1-gas`, `--l1-gas-price`, `--l2-gas`, `--l2-gas-price`, `--l1-data-gas`, `--l1-data-gas-price`.\n\n## `--l1-gas <L1_GAS>`\nOptional.\n\nMaximum L1 gas for the `invoke` transaction. When not used, defaults to auto-estimation.\n\n## `--l1-gas-price <l1_gas_price>`\nOptional.\n\nMaximum L1 gas unit price for the `invoke` transaction. When not used, defaults to auto-estimation.\n\n## `--l2-gas <L2_GAS>`\nOptional.\n\nMaximum L2 gas for the `invoke` transaction. When not used, defaults to auto-estimation.\n\n## `--l2-gas-price <L2_GAS_PRICE>`\nOptional.\n\nMaximum L2 gas unit price for the `invoke` transaction. When not used, defaults to auto-estimation.\n\n## `--l1-data-gas <L1_DATA_GAS>`\nOptional.\n\nMaximum L1 data gas for the `invoke` transaction. When not used, defaults to auto-estimation.\n\n## `--l1-data-gas-price <l1_data_gas_price>`\nOptional.\n\nMaximum L1 data gas unit price for the `invoke` transaction. When not used, defaults to auto-estimation.\n\n## `--tip <TIP>`\nOptional.\nConflicts with: [`--estimate-tip`](#--estimate-tip-estimate_tip)\n\nTip for the transaction. When not provided, defaults to 0 unless [`--estimate-tip`](#--estimate-tip-estimate_tip) is used.\n\n## `--estimate-tip`\nOptional.\nConflicts with: [`--tip`](#--tip-tip)\n\nIf passed, an estimated tip will be added to pay for the transaction. The tip is estimated based on the current network conditions and added to the transaction fee.\n\n## `--nonce, -n <NONCE>`\nOptional.\n\nNonce for transaction. If not provided, nonce will be set automatically.\n\n## `--proof-file <PROOF_FILE>`\nOptional.\nMust be passed together with [`--proof-facts-file`](#--proof-facts-file-proof_facts_file)\n\nPath to a plain text file containing a proof (base64-encoded string).\n\n## `--proof-facts-file <PROOF_FACTS_FILE>`\nOptional.\nMust be passed together with [`--proof-file`](#--proof-file-proof_file)\n\nPath to a plain text file containing proof facts (comma-separated felt values).\n"
  },
  {
    "path": "docs/src/appendix/sncast/ledger/app-version.md",
    "content": "# `ledger app-version`\n\nGet the Starknet app version from the connected Ledger device.\n\nNo arguments are required. Make sure the Starknet app is open on the device before running.\n\n## Example\n\n<!-- { \"requires_ledger\": true } -->\n```shell\n$ sncast ledger app-version\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nApp Version: 2.3.4\n```\n</details>\n<br>\n"
  },
  {
    "path": "docs/src/appendix/sncast/ledger/get-public-key.md",
    "content": "# `ledger get-public-key`\n\nRead the public key at a given [EIP-2645 derivation path](../../../starknet/eip-2645-hd-paths.md) from the connected Ledger device.\n\nOne of `--path` or `--account-id` is required.\n\n## `--path <HD_PATH>`\n\n[EIP-2645 derivation path](../../../starknet/eip-2645-hd-paths.md) (e.g., `m//starknet'/sncast'/0'/1'/0`).\n\nConflicts with: [`--account-id`](#--account-id-account_id)\n\n## `--account-id <ACCOUNT_ID>`\n\nShorthand for `--path`. The account ID is used to derive the path `m//starknet'/sncast'/0'/<account-id>'/0`.\n\nConflicts with: [`--path`](#--path-hd_path)\n\n## `--no-display`\nOptional.\n\nIf passed, the public key will **not** be shown on the Ledger screen for confirmation. By default, confirmation is requested on the device.\n\n## Example\n\n<!-- { \"requires_ledger\": true } -->\n```shell\n$ sncast ledger get-public-key --path \"m//starknet'/sncast'/0'/1'/0\"\n```\n\n<!-- { \"requires_ledger\": true } -->\n```shell\n$ sncast ledger get-public-key --account-id 1\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nPublic Key: 0x[..]\n```\n</details>\n<br>\n"
  },
  {
    "path": "docs/src/appendix/sncast/ledger/ledger.md",
    "content": "# `ledger`\n\nInteract with a Ledger hardware wallet.\n\nSee [Ledger Hardware Wallet](../../../starknet/ledger.md) for a full guide.\n\n## Subcommands\n\n* [app-version](./app-version.md) — Get the Starknet app version from the device\n* [get-public-key](./get-public-key.md) — Read a public key from the device\n* [sign-hash](./sign-hash.md) — Blind-sign a raw hash with the device\n"
  },
  {
    "path": "docs/src/appendix/sncast/ledger/sign-hash.md",
    "content": "# `ledger sign-hash`\n\nBlind-sign a raw hash using the connected Ledger device.\n\n> ⚠️ **Warning**\n>\n> Blind signing a raw hash could be dangerous. Only sign hashes from trusted sources. If you are sending a transaction, [use Ledger as a signer](../../../starknet/ledger.md#using-ledger-as-signer) instead.\n\nOne of `--path` or `--account-id` is required.\n\n## `--path <HD_PATH>`\n\n[EIP-2645 derivation path](../../../starknet/eip-2645-hd-paths.md) (e.g., `m//starknet'/sncast'/0'/1'/0`).\n\nConflicts with: [`--account-id`](#--account-id-account_id)\n\n## `--account-id <ACCOUNT_ID>`\n\nShorthand for `--path`. The account ID is used to derive the path `m//starknet'/sncast'/0'/<account-id>'/0`.\n\nConflicts with: [`--path`](#--path-hd_path)\n\n## `<HASH>`\nRequired (positional).\n\nThe hash to sign, as a hex string with or without `0x` prefix.\n\n## Example\n\n<!-- { \"requires_ledger\": true } -->\n```shell\n$ sncast ledger sign-hash \\\n    --path \"m//starknet'/sncast'/0'/1'/0\" \\\n    0x0111111111111111111111111111111111111111111111111111111111111111\n```\n\n<!-- { \"requires_ledger\": true } -->\n```shell\n$ sncast ledger sign-hash \\\n    --account-id 1 \\\n    0x0111111111111111111111111111111111111111111111111111111111111111\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nHash signature:\nr: 0x[..]\ns: 0x[..]\n```\n</details>\n<br>\n"
  },
  {
    "path": "docs/src/appendix/sncast/multicall/execute/deploy.md",
    "content": "# `deploy`\nConfigure a deploy call as part of a multicall transaction.\n\n## `--id <ID>`\nOptional.\n\nAn optional identifier to reference this step in later steps. This is useful for referencing deployed contracts in later calls within the same multicall. Value can be later reference with `@id` syntax. It can be used with the `--contract-address` and `--calldata` flags in subsequent calls.\n\n> 📝 **Note**\n>\n> The `@id` reference cannot be used with the `--arguments` flag.\n\n## `--class-hash, -g <CLASS_HASH>`\nRequired.\n\nClass hash of contract to deploy.\n\n## `--constructor-calldata, -c <CONSTRUCTOR_CALLDATA>`\nOptional.\nConflicts with: [`--arguments`](#--arguments)\n\nCalldata for the contract constructor.\n\n## `--arguments`\nOptional.\nConflicts with: [`--constructor-calldata`](#--constructor-calldata--c-constructor_calldata)\n\nConstructor arguments provided as a comma-separated string of Cairo expressions.\nFor example: `--arguments '1, 2, MyStruct { x: 1, y: 2 }, MyEnum::Variant'`\n\nFor more information on supported expressions and syntax, see [Calldata Transformation](../../../../starknet/calldata-transformation.md).\n\n## `--salt, -s <SALT>`\nOptional.\n\nSalt for the contract address.\n\n## `--unique`\nOptional.\n\nIf passed, the salt will be additionally modified with an account address.\n"
  },
  {
    "path": "docs/src/appendix/sncast/multicall/execute/invoke.md",
    "content": "# `invoke`\nConfigure an invoke call as part of a multicall transaction.\n\n## `--contract-address, -d <CONTRACT_ADDRESS>`\nRequired.\n\nThe address of the contract being called in hex (prefixed with '0x') or decimal representation.\n\n## `--function, -f <FUNCTION_NAME>`\nRequired.\n\nThe name of the function to call.\n\n## `--calldata, -c <CALLDATA>`\nOptional.\nConflicts with: [`--arguments`](#--arguments)\n\nInputs to the function, represented by a list of space-delimited values `0x1 2 0x3`.\nCalldata arguments may be either 0x hex or decimal felts.\n\n## `--arguments`\nOptional.\nConflicts with: [`--calldata`](#--calldata--c-calldata)\n\nFunction arguments provided as a comma-separated string of Cairo expressions.\nFor example: `--arguments '1, 2, MyStruct { x: 1, y: 2 }, MyEnum::Variant'`\n\nFor more information on supported expressions and syntax, see [Calldata Transformation](../../../../starknet/calldata-transformation.md).\n"
  },
  {
    "path": "docs/src/appendix/sncast/multicall/execute.md",
    "content": "# `execute`\n\nExecute a single multicall transaction containing every call from passed CLI arguments.\n\nSupported call types:\n* [`deploy`](./execute/deploy.md)\n* [`invoke`](./execute/invoke.md)\n\nSubsequent calls need to be separated with a `/` delimiter. For example: `sncast multicall execute deploy ... / invoke ... / deploy ...`\n\n## Required Common Arguments — Passed By CLI or Specified in `snfoundry.toml`\n\n* [`account`](../common.md#--account--a-account_name)\n\n## `--url, -u <RPC_URL>`\nOptional.\n\nStarknet RPC node url address.\n\nOverrides url from `snfoundry.toml`.\n\n## `--network <NETWORK>`\nOptional.\n\nUse predefined network with public provider\n\nPossible values: `mainnet`, `sepolia`, `devnet`.\n\nOverrides network from `snfoundry.toml`.\n\n## `--max-fee, -m <MAX_FEE>`\nOptional.\n\nMaximum fee for the `invoke` denoted in FRI. Must be greater than zero. If provided, it is not possible to use any of the following fee related flags: `--l1-gas`, `--l1-gas-price`, `--l2-gas`, `--l2-gas-price`, `--l1-data-gas`, `--l1-data-gas-price`.\n\n## `--l1-gas <L1_GAS>`\nOptional.\n\nMaximum L1 gas for the `invoke` transaction. When not used, defaults to auto-estimation.\n\n## ` --l1-gas-price <l1_gas_price>`\nOptional.\n\nMaximum L1 gas unit price for the `invoke` transaction. When not used, defaults to auto-estimation.\n\n## `--l2-gas <L2_GAS>`\nOptional.\n\nMaximum L2 gas for the `invoke` transaction. When not used, defaults to auto-estimation.\n\n## `--l2-gas-price <L2_GAS_PRICE>`\nOptional.\n\nMaximum L2 gas unit price for the `invoke` transaction. When not used, defaults to auto-estimation.\n\n## `--l1-data-gas <L1_DATA_GAS>`\nOptional.\n\nMaximum L1 data gas for the `invoke` transaction. When not used, defaults to auto-estimation.\n\n## `--l1-data-gas-price <l1_data_gas_price>`\nOptional.\n\nMaximum L1 data gas unit price for the `invoke` transaction. When not used, defaults to auto-estimation.\n\n## `--tip <TIP>`\nOptional.\nConflicts with: [`--estimate-tip`](#--estimate-tip-estimate_tip)\n\nTip for the transaction. When not provided, defaults to 0 unless [`--estimate-tip`](#--estimate-tip-estimate_tip) is used.\n\n## `--estimate-tip`\nOptional.\nConflicts with: [`--tip`](#--tip-tip)\n\nIf passed, an estimated tip will be added to pay for the transaction. The tip is estimated based on the current network conditions and added to the transaction fee.\n\n## `--nonce, -n <NONCE>`\nOptional.\n\nNonce for transaction. If not provided, nonce will be set automatically.\n"
  },
  {
    "path": "docs/src/appendix/sncast/multicall/multicall.md",
    "content": "# `multicall`\nProvides utilities for performing multicalls on Starknet.\n\nMulticall has the following subcommands:\n* [`new`](./new.md)\n* [`run`](./run.md)\n* [`execute`](./execute.md)\n"
  },
  {
    "path": "docs/src/appendix/sncast/multicall/new.md",
    "content": "# `new`\n\nGenerates an empty template for the multicall `.toml` file that may be later used with the `run` subcommand. It writes it to a file provided as a required argument.\n\n## Usage\n## `multicall new <OUTPUT_PATH> [OPTIONS]`\n\n## Arguments\n`OUTPUT_PATH` - a path to a file to write the generated `.toml` to. Required.\n\n## `--overwrite, -o`\nOptional.\n\nIf the file specified by `<OUTPUT_PATH>` already exists, this flag overwrites it.\n"
  },
  {
    "path": "docs/src/appendix/sncast/multicall/run.md",
    "content": "# `run`\n\nExecute a single multicall transaction containing every call from passed file.\n\n## Required Common Arguments — Passed By CLI or Specified in `snfoundry.toml`\n\n* [`account`](../common.md#--account--a-account_name)\n\n## `--path, -p <PATH>`\nRequired.\n\nPath to a TOML file with call declarations.\n\n## `--url, -u <RPC_URL>`\nOptional.\n\nStarknet RPC node url address.\n\nOverrides url from `snfoundry.toml`.\n\n## `--network <NETWORK>`\nOptional.\n\nUse predefined network with public provider\n\nPossible values: `mainnet`, `sepolia`, `devnet`.\n\nOverrides network from `snfoundry.toml`.\n\n## `--max-fee, -m <MAX_FEE>`\nOptional.\n\nMaximum fee for the `invoke` denoted in FRI. Must be greater than zero. If provided, it is not possible to use any of the following fee related flags: `--l1-gas`, `--l1-gas-price`, `--l2-gas`, `--l2-gas-price`, `--l1-data-gas`, `--l1-data-gas-price`.\n\n## `--l1-gas <L1_GAS>`\nOptional.\n\nMaximum L1 gas for the `invoke` transaction. When not used, defaults to auto-estimation.\n\n## ` --l1-gas-price <l1_gas_price>`\nOptional.\n\nMaximum L1 gas unit price for the `invoke` transaction. When not used, defaults to auto-estimation.\n\n## `--l2-gas <L2_GAS>`\nOptional.\n\nMaximum L2 gas for the `invoke` transaction. When not used, defaults to auto-estimation.\n\n## `--l2-gas-price <L2_GAS_PRICE>`\nOptional.\n\nMaximum L2 gas unit price for the `invoke` transaction. When not used, defaults to auto-estimation.\n\n## `--l1-data-gas <L1_DATA_GAS>`\nOptional.\n\nMaximum L1 data gas for the `invoke` transaction. When not used, defaults to auto-estimation.\n\n## `--l1-data-gas-price <l1_data_gas_price>`\nOptional.\n\nMaximum L1 data gas unit price for the `invoke` transaction. When not used, defaults to auto-estimation.\n\n## `--nonce, -n <NONCE>`\nOptional.\n\nNonce of the transaction. If not provided, nonce will be set automatically.\n\n## `--tip <TIP>`\nOptional.\nConflicts with: [`--estimate-tip`](#--estimate-tip-estimate_tip)\n\nTip for the transaction. When not provided, defaults to 0 unless [`--estimate-tip`](#--estimate-tip-estimate_tip) is used.\n\n## `--estimate-tip`\nOptional.\nConflicts with: [`--tip`](#--tip-tip)\n\nIf passed, an estimated tip will be added to pay for the transaction. The tip is estimated based on the current network conditions and added to the transaction fee.\n\nFile example:\n\n```toml\n[[call]]\ncall_type = \"deploy\"\nclass_hash = \"0x076e94149fc55e7ad9c5fe3b9af570970ae2cf51205f8452f39753e9497fe849\"\ninputs = []\nid = \"map_contract\"\nunique = false\n\n[[call]]\ncall_type = \"invoke\"\ncontract_address = \"0x38b7b9507ccf73d79cb42c2cc4e58cf3af1248f342112879bfdf5aa4f606cc9\"\nfunction = \"put\"\ninputs = [\"0x123\", \"234\"]\n\n[[call]]\ncall_type = \"invoke\"\ncontract_address = \"map_contract\"\nfunction = \"put\"\ninputs = [\"0x123\", \"234\"]\n\n[[call]]\ncall_type = \"deploy\"\nclass_hash = \"0x2bb3d35dba2984b3d0cd0901b4e7de5411daff6bff5e072060bcfadbbd257b1\"\ninputs = [\"0x123\", \"map_contract\"]\nunique = false\n```\n"
  },
  {
    "path": "docs/src/appendix/sncast/script/init.md",
    "content": "# `init`\nCreate a deployment script template.\n\nThe command creates the following file and directory structure:\n```\n.\n└── scripts\n    └── my_script\n        ├── Scarb.toml\n        └── src\n            ├── lib.cairo\n            └── my_script.cairo\n```\n\n## `<SCRIPT_NAME>`\nRequired.\n\nName of a script to create.\n"
  },
  {
    "path": "docs/src/appendix/sncast/script/run.md",
    "content": "# `run`\nCompile and run a cairo deployment script.\n\n## Required Common Arguments — Passed By CLI or Specified in `snfoundry.toml`\n\n* [`account`](../common.md#--account--a-account_name)\n\n## `<MODULE_NAME>`\nRequired.\n\nScript module name that contains the 'main' function that will be executed.\n\n## `--url, -u <RPC_URL>`\nOptional.\n\nStarknet RPC node url address.\n\nOverrides url from `snfoundry.toml`.\n\n## `--network <NETWORK>`\nOptional.\n\nUse predefined network with public provider\n\nPossible values: `mainnet`, `sepolia`, `devnet`.\n\nOverrides network from `snfoundry.toml`.\n\n## `--package <NAME>`\nOptional.\n\nName of the package that should be used.\n\nIf supplied, a script from this package will be used. Required if more than one package exists in a workspace.\n\n## `--no-state-file`\nOptional.\n\nDo not read/write state from/to the state file.\n\nIf set, a script will not read the state from the state file, and will not write a state to it. \n"
  },
  {
    "path": "docs/src/appendix/sncast/script/script.md",
    "content": "# `script`\nProvides a set of commands to manage deployment scripts.\n\nScript has the following subcommands:\n* [`init`](./init.md)\n* [`run`](./run.md)\n"
  },
  {
    "path": "docs/src/appendix/sncast/show_config.md",
    "content": "# `show_config`\nPrints the config currently being used\n\n## `--url, -u <RPC_URL>`\nOptional.\n\nStarknet RPC node url address.\n\nOverrides url from `snfoundry.toml`.\n\n## `--network <NETWORK>`\nOptional.\n\nUse predefined network with public provider\n\nPossible values: `mainnet`, `sepolia`, `devnet`.\n\nOverrides network from `snfoundry.toml`.\n\n"
  },
  {
    "path": "docs/src/appendix/sncast/tx-status.md",
    "content": "<!-- TODO(#4214): Remove moved sncast commands -->\n\n# `tx-status`\n\n> ⚠️ **This command has moved to [`sncast get tx-status`](./get/tx-status.md).**\n>\n> `sncast tx-status` still works but will be removed in the future.\n"
  },
  {
    "path": "docs/src/appendix/sncast/utils/class_hash.md",
    "content": "# `class-hash`\nCalculate the class hash of a contract.\n\n## `--contract-name <CONTRACT_NAME>`\nRequired.\n\nThe name of the contract. The contract name is the part after the `mod` keyword in your contract file.\n\n## General Example\n\n```shell\n$ sncast utils \\\n  class-hash \\\n  --contract-name HelloSncast\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nClass Hash: 0x0[..]\n```\n</details>\n<br>"
  },
  {
    "path": "docs/src/appendix/sncast/utils/selector.md",
    "content": "# `selector`\nCalculate entrypoint selector from function name.\n\n## `<NAME>`\nRequired.\n\nThe function name (e.g. `transfer`, `balance_of`). Do not include parentheses or parameter types.\n\n## Example\n\n```shell\n$ sncast utils selector transfer\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSelector: 0x0[..]\n```\n</details>\n<br>\n"
  },
  {
    "path": "docs/src/appendix/sncast/utils/serialize.md",
    "content": "# `serialize`\nSerialize Cairo expressions into calldata.\n\n## `--arguments`\nRequired.\n\nFunction arguments provided as a comma-separated string of Cairo expressions.\nFor example: `--arguments '1, 2, MyStruct { x: 1, y: 2 }, MyEnum::Variant'`\n\nFor more information on supported expressions and syntax, see [Calldata Transformation](../../../starknet/calldata-transformation.md).\n\n## `--class-hash, -c <CLASS-HASH>`\nOptional.\nConflicts with: [`--contract-address`](#--contract-address), [`--abi-file`](#--abi-file)\n\nThe class hash of the contract class which contains the function, in hex (prefixed with '0x') or decimal representation.\n\n## `--contract-address, -d <CONTRACT_ADDRESS>`\nOptional.\nConflicts with: [`--class-hash`](#--class-hash), [`--abi-file`](#--abi-file)\n\nThe address of the contract which contains the function, in hex (prefixed with '0x') or decimal representation.\n\n## `--abi-file, <ABI_FILE_PATH>`\nOptional.\nConflicts with: [`--class-hash`](#--class-hash), [`--contract-address`](#--contract-address)\n\nPath to the file holding contract ABI.\n\n## `--function, -f <FUNCTION_NAME>`\nRequired.\n\nThe name of the function whose calldata should be serialized.\n\n## `--url, -u <RPC_URL>`\nOptional.\n\nStarknet RPC node url address.\n\nOverrides url from `snfoundry.toml`.\n\n## `--network <NETWORK>`\nOptional.\n\nUse predefined network with public provider\n\nPossible values: `mainnet`, `sepolia`, `devnet`.\n\nOverrides network from `snfoundry.toml`.\n\n"
  },
  {
    "path": "docs/src/appendix/sncast/utils/utils.md",
    "content": "# `utils`\nProvides a set of utility commands.\n\nIt has the following subcommands:\n* [`serialize`](./serialize.md)\n* [`class-hash`](./class_hash.md)\n* [`selector`](./selector.md)\n"
  },
  {
    "path": "docs/src/appendix/sncast/verify.md",
    "content": "# `verify`\nVerify Cairo contract on a chosen verification provider.\n\n## `--class-hash, -g <CLASS_HASH>`\n\nOptional. Required if `--contract-address` is not provided.\n\nThe class hash of the contract that is to be verified.\n\n## `--contract-address, -d <CONTRACT_ADDRESS>`\n\nOptional. Required if `--class-hash` is not provided.\n\nThe address of the contract that is to be verified.\n\n## `--contract-name <CONTRACT_NAME>`\nRequired.\n\nThe name of the contract. The contract name is the part after the `mod` keyword in your contract file.\n\n## `--verifier, -v <VERIFIER>`\nRequired.\n\nThe verification provider to use for the verification. Possible values are:\n* `walnut`\n* `voyager`\n\n## `--network, -n <NETWORK>`\nOptional.\n\nThe network on which block explorer will perform the verification. Possible values are:\n* `mainnet`\n* `sepolia`\n\n## `--url <RPC_URL>`\nOptional.\n\nStarknet RPC node url address. Will use public provider if not set.\n\n## `--package <NAME>`\nOptional.\n\nName of the package that should be used.\n\nIf supplied, a contract from this package will be used. Required if more than one package exists in a workspace.\n\n## `--confirm-verification`\nOptional.\n\nIf passed, assume \"yes\" as answer to confirmation prompt and run non-interactively.\n\n## `--test-files`\nOptional.\n\nInclude test files under `src/` for verification. Only applies to `voyager`.\n"
  },
  {
    "path": "docs/src/appendix/sncast-library/call.md",
    "content": "# `call`\n\n> `pub fn call(\n    contract_address: ContractAddress, function_selector: felt252, calldata: Array::<felt252>\n) -> Result<CallResult, ScriptCommandError>`\n\nCalls a contract and returns `CallResult`.\n\n- `contract_address` - address of the contract to call.\n- `function_selector` - the selector of the function to call.\n- `calldata` - inputs to the function to be called.\n\n```rust\n{{#include ../../../listings/call/src/lib.cairo}}\n```\n\nStructure used by the command:\n\n```rust\n#[derive(Drop, Clone, Debug)]\npub struct CallResult {\n    pub data: Array::<felt252>,\n}\n```\n"
  },
  {
    "path": "docs/src/appendix/sncast-library/declare.md",
    "content": "# `declare`\n\n> `pub fn declare(contract_name: ByteArray, fee_settings: FeeSettings, nonce: Option<felt252>) -> Result<DeclareResult, ScriptCommandError>`\n\nDeclares a contract and returns `DeclareResult`.\n\n- `contract_name` - name of a contract as Cairo string. It is a name of the contract (part after `mod` keyword) e.g. `\"HelloStarknet\"`.\n- `fee_settings` - fee settings for the transaction, see [`FeeSettingsTrait`](./fee_settings_trait.md).\n- `nonce` - nonce for declare transaction. If not provided, nonce will be set automatically.\n\n```rust\n{{#include ../../../listings/declare/src/lib.cairo}}\n```\n\n## Returned Type\n\n* If the contract has not been declared, `DeclareResult::Success` is returned containing respective transaction hash.\n* If the contract has already been declared, `DeclareResult::AlreadyDeclared` is returned.\n\n## Getting the Class Hash\n\nBoth variants contain `class_hash` of the declared contract. Import `DeclareResultTrait` to access it.\n\n```rust\npub trait DeclareResultTrait {\n    fn class_hash(self: @DeclareResult) -> @ClassHash;\n}\n```\n\n## Structures Used by the Command\n\n```rust\n#[derive(Drop, Copy, Debug, Serde)]\npub enum DeclareResult {\n    Success: DeclareTransactionResult,\n    AlreadyDeclared: AlreadyDeclaredResult,\n}\n\n#[derive(Drop, Copy, Debug, Serde)]\npub struct DeclareTransactionResult {\n    pub class_hash: ClassHash,\n    pub transaction_hash: felt252,\n}\n\n#[derive(Drop, Copy, Debug, Serde)]\npub struct AlreadyDeclaredResult {\n    pub class_hash: ClassHash,\n}\n```"
  },
  {
    "path": "docs/src/appendix/sncast-library/deploy.md",
    "content": "# `deploy`\n\n> `pub fn deploy(\n    class_hash: ClassHash,\n    constructor_calldata: Array::<felt252>,\n    salt: Option<felt252>,\n    unique: bool,\n    fee_settings: FeeSettings,\n    nonce: Option<felt252>\n) -> Result<DeployResult, ScriptCommandError>`\n\nDeploys a contract and returns `DeployResult`.\n\n```rust\n#[derive(Drop, Clone, Debug)]\npub struct DeployResult {\n    pub contract_address: ContractAddress,\n    pub transaction_hash: felt252,\n}\n```\n\n- `class_hash` - class hash of a contract to deploy.\n- `constructor_calldata` - calldata for the contract constructor.\n- `salt` - salt for the contract address.\n- `unique` - determines if salt should be further modified with the account address.\n- `fee_settings` - fee settings for the transaction, see [`FeeSettingsTrait](./fee_settings_trait.md).\n- `nonce` - nonce for deploy transaction. If not provided, nonce will be set automatically.\n\n```rust\n{{#include ../../../listings/deploy/src/lib.cairo}}\n```\n"
  },
  {
    "path": "docs/src/appendix/sncast-library/errors.md",
    "content": "# `errors`\n\n```rust\n#[derive(Drop, PartialEq, Serde, Debug)]\npub struct ErrorData {\n    msg: ByteArray\n}\n\n#[derive(Drop, PartialEq, Serde, Debug)]\npub struct ContractErrorData {\n    revert_error: ContractExecutionError\n}\n\n#[derive(Drop, PartialEq, Debug)]\npub struct TransactionExecutionErrorData {\n    transaction_index: felt252,\n    execution_error: ContractExecutionError,\n}\n\n#[derive(Drop, PartialEq, Debug)]\npub enum ContractExecutionError {\n    Nested: Box<ContractExecutionErrorInner>,\n    Message: ByteArray\n}\n\n#[derive(Drop, Serde, Debug)]\npub struct ContractExecutionErrorInner {\n    contract_address: ContractAddress,\n    class_hash: felt252,\n    selector: felt252,\n    error: ContractExecutionError,\n}\n\n#[derive(Drop, Serde, PartialEq, Debug)]\npub enum StarknetError {\n    /// Failed to receive transaction\n    FailedToReceiveTransaction,\n    /// Contract not found\n    ContractNotFound,\n    /// Requested entrypoint does not exist in the contract\n    EntryPointNotFound,\n    /// Block not found\n    BlockNotFound,\n    /// Invalid transaction index in a block\n    InvalidTransactionIndex,\n    /// Class hash not found\n    ClassHashNotFound,\n    /// Transaction hash not found\n    TransactionHashNotFound,\n    /// Contract error\n    ContractError: ContractErrorData,\n    /// Transaction execution error\n    TransactionExecutionError: TransactionExecutionErrorData,\n    /// Class already declared\n    ClassAlreadyDeclared,\n    /// Invalid transaction nonce\n    InvalidTransactionNonce,\n    /// The transaction's resources don't cover validation or the minimal transaction fee\n    InsufficientResourcesForValidate,\n    /// Account balance is smaller than the transaction's max_fee\n    InsufficientAccountBalance,\n    /// Account validation failed\n    ValidationFailure: ErrorData,\n    /// Compilation failed\n    CompilationFailed,\n    /// Contract class size it too large\n    ContractClassSizeIsTooLarge,\n    /// Sender address in not an account contract\n    NonAccount,\n    /// A transaction with the same hash already exists in the mempool\n    DuplicateTx,\n    /// the compiled class hash did not match the one supplied in the transaction\n    CompiledClassHashMismatch,\n    /// the transaction version is not supported\n    UnsupportedTxVersion,\n    /// the contract class version is not supported\n    UnsupportedContractClassVersion,\n    /// An unexpected error occurred\n    UnexpectedError: ErrorData,\n}\n\n#[derive(Drop, Serde, PartialEq, Debug)]\npub enum ProviderError {\n    StarknetError: StarknetError,\n    RateLimited,\n    UnknownError: ErrorData,\n}\n\n#[derive(Drop, Serde, PartialEq, Debug)]\npub enum TransactionError {\n    Reverted: ErrorData,\n}\n\n#[derive(Drop, Serde, PartialEq, Debug)]\npub enum WaitForTransactionError {\n    TransactionError: TransactionError,\n    TimedOut,\n    ProviderError: ProviderError,\n}\n\n#[derive(Drop, Serde, PartialEq, Debug)]\npub enum ScriptCommandError {\n    UnknownError: ErrorData,\n    ContractArtifactsNotFound: ErrorData,\n    WaitForTransactionError: WaitForTransactionError,\n    ProviderError: ProviderError,\n}\n```"
  },
  {
    "path": "docs/src/appendix/sncast-library/fee_settings_trait.md",
    "content": "# `FeeSettingsTrait`\n\n```rust\n#[generate_trait]\npub trait FeeSettingsTrait {\n    /// Sets transaction resource bounds with specified gas values.\n    fn resource_bounds(\n        l1_gas: u64,\n        l1_gas_price: u128,\n        l2_gas: u64,\n        l2_gas_price: u128,\n        l1_data_gas: u64,\n        l1_data_gas_price: u128\n    ) -> FeeSettings;\n\n    /// Ensures that total resource bounds of transaction execution won't exceed the given value.\n    fn max_fee(max_fee: felt252) -> FeeSettings;\n\n    /// Performs an automatic estimation of the resource bounds.\n    fn estimate() -> FeeSettings;\n}\n```"
  },
  {
    "path": "docs/src/appendix/sncast-library/get_nonce.md",
    "content": "# `get_nonce`\n\n> `pub fn get_nonce(block_tag: felt252) -> felt252`\n\nGets nonce of an account for a given block tag (`pre_confirmed` or `latest`) and returns nonce as `felt252`.\n\n- `block_tag` - block tag name, one of `pre_confirmed` or `latest`.\n\n```rust\n{{#include ../../../listings/get_nonce/src/lib.cairo}}\n```\n"
  },
  {
    "path": "docs/src/appendix/sncast-library/invoke.md",
    "content": "# `invoke`\n\n> `pub fn invoke(\n    contract_address: ContractAddress,\n    entry_point_selector: felt252,\n    calldata: Array::<felt252>,\n    fee_settings: FeeSettings,\n    nonce: Option<felt252>\n) -> Result<InvokeResult, ScriptCommandError>`\n\nInvokes a contract and returns `InvokeResult`.\n\n- `contract_address` - address of the contract to invoke.\n- `entry_point_selector` - the selector of the function to invoke.\n- `calldata` - inputs to the function to be invoked.\n- `fee_settings` - fee settings for the transaction, see [`FeeSettingsTrait](./fee_settings_trait.md).\n- `nonce` - nonce for invoke transaction. If not provided, nonce will be set automatically.\n\n```rust\n{{#include ../../../listings/invoke/src/lib.cairo}}\n```\n\nStructures used by the command:\n\n```rust\n#[derive(Drop, Clone, Debug)]\npub struct InvokeResult {\n    pub transaction_hash: felt252,\n}\n```\n"
  },
  {
    "path": "docs/src/appendix/sncast-library/tx_status.md",
    "content": "# `tx_status`\n\n> `pub fn tx_status(transaction_hash: felt252) -> Result<TxStatusResult, ScriptCommandError>`\n\nGets the status of a transaction using its hash and returns `TxStatusResult`.\n\n- `transaction_hash` - hash of the transaction\n\n```rust\n{{#include ../../../listings/tx_status/src/lib.cairo}}\n```\n\nStructures used by the command:\n\n```rust\n#[derive(Drop, Clone, Debug, Serde, PartialEq)]\npub enum FinalityStatus {\n    Received,\n    Candidate,\n    PreConfirmed,\n    AcceptedOnL2,\n    AcceptedOnL1,\n}\n\n\n#[derive(Drop, Copy, Debug, Serde, PartialEq)]\npub enum ExecutionStatus {\n    Succeeded,\n    Reverted,\n}\n\n\n#[derive(Drop, Clone, Debug, Serde, PartialEq)]\npub struct TxStatusResult {\n    pub finality_status: FinalityStatus,\n    pub execution_status: Option<ExecutionStatus>\n}\n```\n"
  },
  {
    "path": "docs/src/appendix/sncast-library.md",
    "content": "# Library Reference\n\n> ℹ️ **Info**\n> Full documentation for the `sncast` library can be found [here](https://foundry-rs.github.io/starknet-foundry/sncast_std/).\n\n* [`declare`](sncast-library/declare.md) - declares a contract\n* [`deploy`](sncast-library/deploy.md) - deploys a contract\n* [`invoke`](sncast-library/invoke.md) - invokes a contract's function\n* [`call`](sncast-library/call.md) - calls a contract's function\n* [`get_nonce`](sncast-library/get_nonce.md) - gets account's nonce for a given block tag\n* [`tx_status`](sncast-library/tx_status.md) - gets the status of a transaction using its hash\n* [`errors`](sncast-library/errors.md) - sncast_std error types reference\n\n> ℹ️ **Info**\n> To use the library functions you need to add `sncast_std` package as a dependency in\n> your [`Scarb.toml`](https://docs.swmansion.com/scarb/docs/guides/dependencies.html#adding-a-dependency)\n> using the appropriate version.\n>```toml\n> [dependencies]\n> sncast_std = \"{{snforge_std_version}}\"\n> ```\n"
  },
  {
    "path": "docs/src/appendix/sncast.md",
    "content": "# `sncast` CLI Reference\n\n* [common flags](./sncast/common.md)\n* [account](./sncast/account/account.md)\n    * [import](./sncast/account/import.md)\n    * [create](./sncast/account/create.md)\n    * [deploy](./sncast/account/deploy.md)\n    * [delete](./sncast/account/delete.md)\n* [declare](./sncast/declare.md)\n* [declare-from](./sncast/declare_from.md)\n* [deploy](./sncast/deploy.md)\n* [invoke](./sncast/invoke.md)\n* [call](./sncast/call.md)\n* [multicall](./sncast/multicall/multicall.md)\n    * [new](./sncast/multicall/new.md)\n    * [run](./sncast/multicall/run.md)\n    * [execute](./sncast/multicall/execute.md)\n      * [deploy](./sncast/multicall/execute/deploy.md)\n      * [invoke](./sncast/multicall/execute/invoke.md)\n* [script](./sncast/script/script.md)\n    * [init](./sncast/script/init.md)\n    * [run](./sncast/script/run.md)\n* [show-config](./sncast/show_config.md)\n* [get](./sncast/get/get.md)\n    * [balance](./sncast/get/balance.md)\n    * [class-hash-at](./sncast/get/class_hash_at.md)\n    * [nonce](./sncast/get/nonce.md)\n    * [tx](./sncast/get/tx.md)\n    * [tx-status](./sncast/get/tx-status.md)\n* [ledger](./sncast/ledger/ledger.md)\n    * [app-version](./sncast/ledger/app-version.md)\n    * [get-public-key](./sncast/ledger/get-public-key.md)\n    * [sign-hash](./sncast/ledger/sign-hash.md)\n* [utils](./sncast/utils/utils.md)\n    * [serialize](./sncast/utils/serialize.md)\n    * [class-hash](./sncast/utils/class_hash.md)\n    * [selector](./sncast/utils/selector.md)\n* [verify](./sncast/verify.md)\n* [completions](./sncast/completions.md)"
  },
  {
    "path": "docs/src/appendix/snforge/check-requirements.md",
    "content": "# `snforge check-requirements`\n\nValidate if all `snforge` requirements are installed.\n\n## `-h`, `--help`\n\nPrint help.\n"
  },
  {
    "path": "docs/src/appendix/snforge/clean-cache.md",
    "content": "# `snforge clean-cache`\n\nClean `snforge` cache directory.\n\n## `-h`, `--help`\n\nPrint help.\n\n> ⚠️ **Warning**\n>\n> The `snforge clean-cache` command is deprecated. Please use the [`snforge clean`](./clean.md) command instead.\n"
  },
  {
    "path": "docs/src/appendix/snforge/clean.md",
    "content": "# `snforge clean`\n\nRemove files generated by `snforge`.\n\n## `all`\n\nClean all generated directories\n\n## `cache`\n\nClean the `.snfoundry_cache` directory.\n\n## `trace`\n\nClean the `snfoundry_trace` directory.\n\n## `coverage`\n\nClean the `coverage` directory.\n\n## `profile`\n\nClean the `profile` directory.\n\n## `-h`, `--help`\n\nPrint help.\n"
  },
  {
    "path": "docs/src/appendix/snforge/completions.md",
    "content": "# `completions`\nGenerates a completions script for the specified shell and writes it to `stdout`.\n\n## `[SHELL]`\nOptional \n\nIf not specified, the script will be generated for the shell detected under via `$SHELL` variable.\n\nPossible values: `bash`, `elvish`, `fish`, `powershell`, `zsh`\n\n## `-h`, `--help`\n\nPrint help.\n"
  },
  {
    "path": "docs/src/appendix/snforge/new.md",
    "content": "# `snforge new`\n\nCreate a new StarkNet Foundry project at the provided path that should either be empty or not exist.\n\n## `<PATH>`\n\nPath to a location where the new project will be created.\n\n## `-n`, `--name`\n\nName of a package to create, defaults to the directory name.\n\n## `-t`, `--template`\n\nName of a template to use when creating a new project. Possible values:\n- `balance-contract` (default): Basic contract with example tests.\n- `cairo-program`: Simple Cairo program with unit tests.\n- `erc20-contract`: Includes an ERC-20 token contract and a contract that allows multiple transfers of a specific token.\n\n## `--no-vcs`\n\nDo not initialize a new Git repository.\n\n## `--overwrite`\n\nTry to create the project even if the specified directory is not empty, which can result in overwriting existing files\n\n## `-h`, `--help`\n\nPrint help.\n"
  },
  {
    "path": "docs/src/appendix/snforge/optimize-inlining.md",
    "content": "# `snforge optimize-inlining`\n\nFind the optimal `inlining-strategy` value to minimize gas cost or contract size.\n\nSee [Inlining Optimizer](../inlining-optimizer.md) for a full guide.\n\n## `<TEST_FILTER>`\n\nFully qualified name of the test to run at each threshold. Must be used together with `--exact`.\n\n## `--contracts <CONTRACTS>`\n\nComma-delimited list of contract names or Cairo module paths\n(e.g. `MyContract,my_package::MyOther`) to include in contract size checks.\n\nRequired.\n\n## `--min-threshold <MIN_THRESHOLD>`\n\nMinimum `inlining-strategy` value to test. Default: `0`.\n\n## `--max-threshold <MAX_THRESHOLD>`\n\nMaximum `inlining-strategy` value to test. Default: `250`.\n\n## `--step <STEP>`\n\nStep size between tested thresholds. Must be greater than zero. Default: `25`.\n\n## `--max-contract-size <MAX_CONTRACT_SIZE>`\n\nMaximum allowed contract file size in bytes. Thresholds that produce contracts exceeding this value are\nskipped. Default: `4089446`.\n\n## `--max-contract-felts <MAX_CONTRACT_FELTS>`\n\nMaximum allowed number of felts in a compiled contract. Thresholds that exceed this limit are\nskipped. Default: `81920`.\n\n## `--gas`\n\nAfter the search completes, update `Scarb.toml` with the threshold that minimizes runtime gas cost.\n\nConflicts with `--size`.\n\n## `--size`\n\nAfter the search completes, update `Scarb.toml` with the threshold that minimizes contract\nbytecode L2 gas (a proxy for deployment cost).\n\nConflicts with `--gas`.\n\n## `-e`, `--exact`\n\nRequired. Run only the test whose name exactly matches `TEST_FILTER`.\n\n## `--max-threads <MAX_THREADS>`\n\nMaximum number of threads used for test execution. Defaults to the number of available CPU cores.\n\n## `-P`, `--profile <PROFILE>`\n\nSpecify the Scarb profile to use by name.\n\n## `--release`\n\nUse Scarb release profile.\n\n## `--dev`\n\nUse Scarb dev profile.\n\n## `-F`, `--features <FEATURES>`\n\nComma separated list of features to activate.\n\n## `--all-features`\n\nActivate all available features.\n\n## `--no-default-features`\n\nDo not activate the `default` feature.\n\n## `-h`, `--help`\n\nPrint help.\n"
  },
  {
    "path": "docs/src/appendix/snforge/test.md",
    "content": "# `snforge test`\n\nRun tests for a project in the current directory.\n\n## `[TEST_FILTER]`\n\nPassing a test filter will only run tests with\nan [absolute module tree path](https://www.starknet.io/cairo-book/ch07-03-paths-for-referring-to-an-item-in-the-module-tree.html#paths-for-referring-to-an-item-in-the-module-tree)\ncontaining this filter.\n\n## `--trace-verbosity <TRACE_VERBOSITY>`\n\nSets the level of detail shown in execution traces.\n\nValid values:\n\n- `minimal`: Only test name, contract name, and selector\n- `standard`: Includes calldata and call result\n- `detailed`: Full trace, including nested calls, caller address, and panic reasons\n\nRead more [here](../../snforge-advanced-features/debugging.md#trace).\n\n## `--trace-components <TRACE_COMPONENTS>...`\n\nSelects specific trace elements to include in the execution flow output.\n\nAvailable components:\n\n- `contract-name`\n- `entry-point-type`\n- `calldata`\n- `contract-address`\n- `caller-address`\n- `call-type`\n- `call-result`\n- `gas`\n\nRead more [here](../../snforge-advanced-features/debugging.md#trace).\n\n\n## `--run-native`\n\n_This flag is only available if `snforge` was built with `cairo-native` feature enabled_\n\nRun contracts on [`cairo-native`](https://github.com/lambdaclass/cairo_native) instead of the default `cairo-vm`.\n\nNote: Only contracts execution through native is supported, test code itself will still run on `cairo-vm`.\n\n## `-e`, `--exact`\n\nWill only run a test with a name exactly matching the test filter.\nTest filter must be a whole qualified test name e.g. `package_name::my_test` instead of just `my_test`.\n\n## `--skip <SKIP>`\n\nSkips any tests whose name contains the given `SKIP` string.\n\nThis flag may be used multiple times with different `SKIP` strings.\n\n## `-x`, `--exit-first`\n\nStop executing tests after the first failed test.\n\n## `-p`, `--package <SPEC>`\n\nPackages to run this command on, can be a concrete package name (`foobar`) or a prefix glob (`foo*`).\n\n## `-w`, `--workspace`\n\nRun tests for all packages in the workspace.\n\n## `-r`, `--fuzzer-runs` `<FUZZER_RUNS>`\n\nNumber of fuzzer runs.\n\n## `-s`, `--fuzzer-seed` `<FUZZER_SEED>`; `SNFORGE_FUZZER_SEED` (environment variable)\n\nSeed for the fuzzer.\n\n## `--ignored`\n\nRun only tests marked with `#[ignore]` attribute.\n\n## `--include-ignored`\n\nRun all tests regardless of `#[ignore]` attribute.\n\n## `--rerun-failed`\n\nRun tests that failed during the last run\n\n## `--color` `<WHEN>`\n\nControl when colored output is used. Valid values:\n- `auto` (default): automatically detect if color support is available on the terminal. \n- `always`: always display colors.\n- `never`: never display colors.\n\n## `--detailed-resources`\n\nDisplay additional info about used resources for passed tests.\n\n## `--save-trace-data`\n\nSaves execution traces of test cases which pass and are not fuzz tests. You can use traces for profiling and coverage purposes.\n\n## `--build-profile`\n\nSaves trace data and then builds profiles of test cases which pass and are not fuzz tests. \nYou need [cairo-profiler](https://github.com/software-mansion/cairo-profiler) installed on your system. You can set a custom path to cairo-profiler with `CAIRO_PROFILER` env variable. Profile can be read with pprof, more information: [cairo-profiler](https://github.com/software-mansion/cairo-profiler), [pprof](https://github.com/google/pprof?tab=readme-ov-file#building-pprof)\n\n## `--coverage`\n\nSaves trace data and then generates coverage report of test cases which pass and are not fuzz tests.\nYou need [cairo-coverage](https://github.com/software-mansion/cairo-coverage) installed on your system. You can set a custom path to cairo-coverage with `CAIRO_COVERAGE` env variable.\n\n## `--max-n-steps` `<MAX_N_STEPS>`\n\nNumber of maximum steps during a single test. For fuzz tests this value is applied to each subtest separately.\n\n##  `-F`, `--features` `<FEATURES>`\nComma separated list of features to activate.\n\n## `--all-features`\nActivate all available features.\n\n## `--no-default-features`\nDo not activate the `default` feature.\n\n## `--no-optimization`\nBuild contract artifacts in a separate [starknet contract target](https://docs.swmansion.com/scarb/docs/extensions/starknet/contract-target.html#starknet-contract-target).\nEnabling this flag will slow down the compilation process, but the built contracts will more closely resemble the ones used on real networks. This is set to `true` when using Scarb version less than `2.8.3`.\n\n## `--tracked-resource`\n\nSet tracked resource for test execution. Impacts overall test gas cost. Valid values:\n- `sierra-gas` (default): track sierra gas, uses cairo native `CallExecution` (sierra gas consumption) to describe computation resources consumed by the test.\n- `cairo-steps`: track cairo steps, uses vm `ExecutionResources` (steps, builtins, memory holes) to describe resources consumed by the test.\nTo learn more about fee calculation formula (and the impact of tracking sierra gas on it) please consult [starknet docs](https://docs.starknet.io/learn/protocol/fees#overall-fee)\n\n## `--gas-report`\nDisplay a table of L2 gas breakdown for each contract and selector.\n\n## `--max-threads <MAX_THREADS>`\n\nMaximum number of threads used for test execution, which corresponds to tests run in parallel. \nDefaults to the number of available CPU cores.\n\n## `--partition <INDEX>/<TOTAL>`\n\nDivides tests into `TOTAL` partitions and runs partition `INDEX` (1-based), e.g. 1/4.\n\n##  `-P`, `--profile` `<PROFILE>`\nSpecify the profile to use by name.\n\n## `--release`\nUse Scarb release profile.\n\n## `--dev`\nUse Scarb dev profile.\n\n## `-h`, `--help`\n\nPrint help.\n\n## `SNFORGE_BACKTRACE` (environment variable)\n\nTrue values are `1`.\n\nWhen enabled, enables backtrace output on test failure. \nRead more [here](../../snforge-advanced-features/debugging.md#backtrace).\n\n## `SNFORGE_DETERMINISTIC_OUTPUT` (environment variable)\n\nTrue values are `1`, `true`, `t`, `yes`, `y`, and `on`.\nFalse values are `0`, `false`, `f`, `no`, `n`, and `off`.\n\nWhen enabled, sorts test result outputs by test name, for reproducible outputs.\n\n## `--launch-debugger`\n\nLaunch the given test in debug mode, making snforge act as a debug adapter.\nRead more [here](../../snforge-advanced-features/debugging.md#live-debugging).\n"
  },
  {
    "path": "docs/src/appendix/snforge-library/byte_array.md",
    "content": "# `byte_array` Module\n\nModule containing utilities for manipulating `ByteArray`s.\n\n## Functions\n\n> `fn try_deserialize_bytearray_error(x: Span<felt252>) -> Result<ByteArray, ByteArray>` \n\nThis function is meant to transform a serialized output from a contract call into a `ByteArray`.\nReturns the parsed `ByteArray`, or an `Err` with reason, if the parsing failed."
  },
  {
    "path": "docs/src/appendix/snforge-library/contract_class.md",
    "content": "# `ContractClass`\n\nA struct which enables interaction with given class hash.\nIt can be obtained by using [declare](./declare.md), or created with an arbitrary `ClassHash`.\n\n```rust\n#[derive(Drop, Serde, Copy)]\npub struct ContractClass {\n    pub class_hash: ClassHash,\n}\n```\n\n## Implemented traits\n\n### `ContractClassTrait`\n\n```rust\npub trait ContractClassTrait {\n    fn precalculate_address(\n        self: @ContractClass, constructor_calldata: @Array::<felt252>\n    ) -> ContractAddress;\n\n    fn deploy(\n        self: @ContractClass, constructor_calldata: @Array::<felt252>\n    ) -> SyscallResult<(ContractAddress, Span<felt252>)>;\n\n    fn deploy_at(\n        self: @ContractClass,\n        constructor_calldata: @Array::<felt252>,\n        contract_address: ContractAddress\n    ) -> SyscallResult<(ContractAddress, Span<felt252>)>;\n\n    fn new<T, +Into<T, ClassHash>>(class_hash: T) -> ContractClass;\n}\n```"
  },
  {
    "path": "docs/src/appendix/snforge-library/declare.md",
    "content": "# `declare`\n```rust\n#[derive(Drop, Serde, Clone)]\npub enum DeclareResult {\n    Success: ContractClass,\n    AlreadyDeclared: ContractClass,\n}\n\npub trait DeclareResultTrait {\n    /// Gets inner `ContractClass`\n    /// `self` - an instance of the struct `DeclareResult` which is obtained by calling `declare`\n    // Returns the `@ContractClass`\n    fn contract_class(self: @DeclareResult) -> @ContractClass;\n}\n\nfn declare(contract: ByteArray) -> Result<DeclareResult, Array<felt252>>\n```\n\nDeclares a contract for later deployment.\n\nReturns the `DeclareResult` that encapsulated possible outcomes in the enum:\n - `Success`: Contains the successfully declared `ContractClass`.\n - `AlreadyDeclared`: Contains `ContractClass` and signals that the contract has already been declared.\n\n\nSee [docs of `ContractClass`](./contract_class.md) for more info about the resulting struct.\n"
  },
  {
    "path": "docs/src/appendix/snforge-library/env.md",
    "content": "# `env` Module\n\nModule containing functions for interacting with the system environment.\n\n## `var`\n\n> `fn var(name: ByteArray) -> Array<felt252>`\n\nReads an environment variable, without parsing it.\n\nThe serialized output is correlated with the inferred input type, same as\nduring [reading from a file](./fs.md#file-format).\n\n> 📝 **Note**\n>\n> If you want snfoundry to treat your variable like a short string, surround it with 'single quotes'.\n>\n> If you would like it to be serialized as a `ByteArray`, use \"double quoting\". It will be then de-serializable\n> with `Serde`.\n"
  },
  {
    "path": "docs/src/appendix/snforge-library/fs/file.md",
    "content": "# `File`\n\nTrait for handling file operations in Starknet Foundry.\n\n```rust\ntrait FileTrait {\n    fn new(path: ByteArray) -> File;\n}\n```\n\n> ℹ️ **Info**\n>\n> Specific rules must be followed for snforge to correctly parse JSON and plain text files.\n>\n> Read [file format rules](./file_format_rules.md) for more.\n\n## Example\n\nFile content:\n```txt\n{{#include ../../../../listings/snforge_library_reference/data/hello_starknet.txt}}\n```\n\nTest code:\n```rust\n{{#include ../../../../listings/snforge_library_reference/tests/test_fs_file_trait.cairo}}\n```\n"
  },
  {
    "path": "docs/src/appendix/snforge-library/fs/file_format_rules.md",
    "content": "# File Format Rules\n\nSome rules have to be checked when providing a file for snforge, in order for correct parsing behavior.\nDifferent ones apply for JSON and plain text files.\n\n## Plain Text Files\n- Elements have to be separated with newlines\n- Elements have to be either:\n  - Cairo `felt252` values, surrounded by `''`\n  - byte arrays, surrounded by `\"\"`\n\n### Example\n\nBelow is an example of valid plain text file:\n```txt\n1\n2\n'hello'\n10\n\"world\"\n```\n\n## JSON Files\n- Elements have to be either:\n  - Cairo `felt252` values, surrounded by `''`\n  - byte arrays, surrounded by `\"\"`\n  - array of integers or strings fulfilling the above conditions\n\n> ⚠️ **Warning**\n>\n> A JSON object is an unordered data structure. To make reading JSONs deterministic, the values are read from the JSON in an order that is alphabetical in respect to JSON keys.\n> Nested JSON values are sorted by the flattened format keys `(a.b.c)`.\n\n### Example\n\nBelow is an example of valid JSON file:\n```json\n{\n  \"a\": 1,\n  \"nested\": {\n    \"b\": 2,\n    \"c\": 448378203247\n  },\n  \"d\": 10,\n  \"e\": \"world\"\n}\n```\n"
  },
  {
    "path": "docs/src/appendix/snforge-library/fs/file_parser.md",
    "content": "# `FileParser<T>`\n\nTrait used for parsing files in different formats, such as JSON and plain text.\n\n```rust\ntrait FileParser<T, +Serde<T>> {\n    fn parse_txt(file: @File) -> Option<T>;\n    fn parse_json(file: @File) -> Option<T>;\n}\n```\n\n> ℹ️ **Info**\n>\n> Specific rules must be followed for snforge to correctly parse JSON and plain text files.\n>\n> Read [file format rules](./file_format_rules.md) for more.\n\n## Example\n\nFile content:\n```json\n{{#include ../../../../listings/snforge_library_reference/data/user.json}}\n```\n\nTest code:\n```rust\n{{#include ../../../../listings/snforge_library_reference/tests/test_fs_parse_json.cairo}}\n```\n\nLet's run the test:\n\n<!-- { \"package_name\": \"snforge_library_reference\" } -->\n```shell\n$ snforge test parse_json_example\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 1 test(s) from snforge_library_reference package\nRunning 1 test(s) from tests/\nUser { age: 30, job: \"Software Engineer\", location: Location { city: \"New York\", country: \"USA\" }, name: \"John\", surname: \"Doe\" }\n[PASS] snforge_library_reference_integrationtest::test_fs_parse_json::parse_json_example ([..])\nRunning 0 test(s) from src/\nTests: 1 passed, 0 failed, 0 ignored, [..] filtered out\n```\n</details>\n<br>\n"
  },
  {
    "path": "docs/src/appendix/snforge-library/fs/read_json.md",
    "content": "# `read_json`\n\nFunction for reading JSON files.\n\n```rust\nfn read_json(file: @File) -> Array<felt252>;\n```\n\n> ℹ️ **Info**\n>\n> Specific rules must be followed for snforge to correctly parse JSON files.\n>\n> Read [file format rules](./file_format_rules.md#json-files) for more.\n\n## Example\n\nFile content:\n```json\n{{#include ../../../../listings/snforge_library_reference/data/user.json}}\n```\n\nTest code:\n```rust\n{{#include ../../../../listings/snforge_library_reference/tests/test_fs_read_json.cairo}}\n```\n\n<!-- { \"package_name\": \"snforge_library_reference\" } -->\nLet's run the test:\n```shell\n$ snforge test read_json_example\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 1 test(s) from snforge_library_reference package\nRunning 1 test(s) from tests/\n0x1e\n0x0\n0x536f66747761726520456e67696e656572\n0x11\n0x0\n0x4e657720596f726b\n0x8\n0x0\n0x555341\n0x3\n0x0\n0x4a6f686e\n0x4\n0x0\n0x446f65\n0x3\n[PASS] snforge_library_reference_integrationtest::test_fs_read_json::read_json_example ([..])\nRunning 0 test(s) from src/\nTests: 1 passed, 0 failed, 0 ignored, [..] filtered out\n```\n</details>\n<br>\n"
  },
  {
    "path": "docs/src/appendix/snforge-library/fs/read_txt.md",
    "content": "# `read_txt`\n\nFunction for reading plain text files.\n\n```rust\nfn read_txt(file: @File) -> Array<felt252>;\n```\n\n> ℹ️ **Info**\n>\n> Specific rules must be followed for snforge to correctly parse plain text files.\n>\n> Read [file format rules](./file_format_rules.md#plain-text-files) for more.\n\n## Example\n\nFile content:\n```txt\n{{#include ../../../../listings/snforge_library_reference/data/hello_starknet.txt}}\n```\n\nTest code:\n```rust\n{{#include ../../../../listings/snforge_library_reference/tests/test_fs_read_txt.cairo}}\n```\n\n<!-- { \"package_name\": \"snforge_library_reference\" } -->\nLet's run the test:\n```shell\n$ snforge test read_txt_example\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 1 test(s) from snforge_library_reference package\nRunning 1 test(s) from tests/\n0x48656c6c6f20537461726b6e657421\n0x4c6574277320636f646520696e20436169726f21\n0x0\n0x4578616d706c652062797465206172726179\n0x12\n[PASS] snforge_library_reference_integrationtest::test_fs_read_txt::read_txt_example ([..])\nRunning 0 test(s) from src/\nTests: 1 passed, 0 failed, 0 ignored, [..] filtered out\n```\n</details>\n<br>\n"
  },
  {
    "path": "docs/src/appendix/snforge-library/fs.md",
    "content": "# `fs` Module\n\nModule containing functions for interacting with the filesystem.\n\nFiles parsed by different functions must adhere to [file format rules](./fs/file_format_rules.md)\n\n## Traits\n\n* [`File`](./fs/file.md)\n* [`FileParser`](./fs/file_parser.md)\n\n## Functions\n\n* [`read_json`](./fs/read_json.md)\n* [`read_txt`](./fs/read_txt.md)"
  },
  {
    "path": "docs/src/appendix/snforge-library/fuzzable.md",
    "content": "# `fuzzable` Module\n\nModule containing `Fuzzable` trait needed for fuzz testing and its implementations for basic types.\n\n## `Fuzzable`\n\n```rust\npub trait Fuzzable<T, +Debug<T>> {\n    fn blank() -> T;\n    fn generate() -> T;\n}\n```\n\nThis trait is used by `snforge` to generate random data for fuzz testing.\nAny type that is used as a parameter in a test function with the [`#[fuzzer]`](../../testing/test-attributes.md#fuzzer) attribute must implement this trait.\n\n- `blank()` returns an empty or default value. The specific value used does not matter much, as it is only used by snforge internals and does not affect test execution. For types that implement the `Default` trait, it is recommended to return `Default::default()`.\n- `generate()` function is used to return a random value of the given type. To implement this function, it is necessary to either use a `Fuzzable` implementation from a different type,\nor use the [generate_arg](../cheatcodes/generate_arg.md) cheatcode, which can uniformly generate a random number within a specified range.\n\n## Example\n\nImplementation for a custom type `Message`:\n\n```rust\nuse core::num::traits::Bounded;\nuse snforge_std::fuzzable::{Fuzzable, generate_arg};\n\n#[derive(Debug, Drop)]\nstruct Message {\n    id: u64,\n    text: ByteArray\n}\n\nimpl FuzzableMessage of Fuzzable<Message> {\n    fn blank() -> Message {\n        Message {\n            // Implementation may consist of:\n            // Specifying a concrete value for the field\n            id: 0,\n            // Or using default value from `Default` trait\n            text: Default::default()\n        }\n    }\n\n    fn generate() -> Message {\n        Message {\n            // Using `generate_arg` cheatcode\n            id: generate_arg(0, Bounded::<u64>::MAX),\n            // Or calling `generate` function on a type that already implements `Fuzzable`\n            text: Fuzzable::<ByteArray>::generate()\n        }\n    }\n}\n```\n"
  },
  {
    "path": "docs/src/appendix/snforge-library/get_call_trace.md",
    "content": "# `get_call_trace`\n\n```rust\nfn get_call_trace() -> CallTrace;\n```\n\n(For whole structure definition, please refer\nto [`snforge-std` source](https://github.com/foundry-rs/starknet-foundry/tree/master/snforge_std))\n\nGets current call trace of the test, up to the last call made to a contract.\n\nThe whole structure is represented as a tree of calls, in which each contract interaction\nis a new execution scope - thus resulting in a new nested trace.\n\n> 📝 **Note**\n>\n> The topmost-call is representing the test call, which will always be present if you're running a test.\n\n## Displaying the trace\n\nThe `CallTrace` structure implements a `Display` trait, for a pretty-print with indentations\n\n```rust\nprintln!(\"{}\", get_call_trace());\n```"
  },
  {
    "path": "docs/src/appendix/snforge-library/signature.md",
    "content": "# `signature` Module\n\nModule containing `KeyPair` struct and interface for creating `ecdsa` signatures.\n\n* `signature::stark_curve` - implementation of `KeyPairTrait` for the STARK curve\n* `signature::secp256k1_curve` - implementation of `KeyPairTrait` for Secp256k1 Curve\n* `signature::secp256r1_curve` - implementation of `KeyPairTrait` for Secp256r1 Curve\n\n\n> ⚠️ **Security Warning**\n>\n> Please note that cryptography in Starknet Foundry is still experimental and **has not been audited**.\n>\n> Use at your own risk!\n\n\n## `KeyPair`\n\n```rust\nstruct KeyPair<SK, PK> {\n    secret_key: SK,\n    public_key: PK,\n}\n```\n\n\n## `KeyPairTrait`\n\n```rust\ntrait KeyPairTrait<SK, PK> {\n    fn generate() -> KeyPair<SK, PK>;\n    fn from_secret_key(secret_key: SK) -> KeyPair<SK, PK>;\n}\n```\n\n\n## `SignerTrait`\n\n```rust\ntrait SignerTrait<T, H, U> {\n    fn sign(self: T, message_hash: H) -> Result<U, SignError> ;\n}\n```\n\n\n## `VerifierTrait`\n\n```rust\ntrait VerifierTrait<T, H, U> {\n    fn verify(self: T, message_hash: H, signature: U) -> bool;\n}\n```\n\n## Example\n\n```rust\nuse snforge_std::signature::KeyPairTrait;\n\nuse snforge_std::signature::secp256r1_curve::{Secp256r1CurveKeyPairImpl, Secp256r1CurveSignerImpl, Secp256r1CurveVerifierImpl};\nuse snforge_std::signature::secp256k1_curve::{Secp256k1CurveKeyPairImpl, Secp256k1CurveSignerImpl, Secp256k1CurveVerifierImpl};\nuse snforge_std::signature::stark_curve::{StarkCurveKeyPairImpl, StarkCurveSignerImpl, StarkCurveVerifierImpl};\n\nuse starknet::secp256r1::{Secp256r1Point, Secp256r1PointImpl};\nuse starknet::secp256k1::{Secp256k1Point, Secp256k1PointImpl};\nuse core::starknet::SyscallResultTrait;\n\n#[test]\nfn test_using_curves() {\n    // Secp256r1\n    let key_pair = KeyPairTrait::<u256, Secp256r1Point>::generate();\n    let (r, s): (u256, u256) = key_pair.sign(msg_hash).unwrap();\n    let is_valid = key_pair.verify(msg_hash, (r, s));\n    \n    // Secp256k1\n    let key_pair = KeyPairTrait::<u256, Secp256k1Point>::generate();\n    let (r, s): (u256, u256) = key_pair.sign(msg_hash).unwrap();\n    let is_valid = key_pair.verify(msg_hash, (r, s));\n    \n    // StarkCurve\n    let key_pair = KeyPairTrait::<felt252, felt252>::generate();\n    let (r, s): (felt252, felt252) = key_pair.sign(msg_hash).unwrap();\n    let is_valid = key_pair.verify(msg_hash, (r, s));\n}\n```\n"
  },
  {
    "path": "docs/src/appendix/snforge-library/testing/get_current_vm_step.md",
    "content": "# `get_current_vm_step`\n\nGets the current step during test execution.\n\n```rust\nfn get_current_vm_step() -> u32;\n```\n\n## Example\n\nTest code:\n\n```rust\n{{#include ../../../../listings/testing_reference/tests/tests.cairo}}\n```\n\n<!-- { \"package_name\": \"testing_reference\" } -->\nLet's run the test:\n```shell\n$ snforge test test_setup_steps\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 1 test(s) from testing_reference package\nRunning 1 test(s) from tests/\n[PASS] testing_reference_integrationtest::tests::test_setup_steps ([..])\nRunning 0 test(s) from src/\nTests: 1 passed, 0 failed, 0 ignored, 0 filtered out\n```\n</details>\n<br>\n"
  },
  {
    "path": "docs/src/appendix/snforge-library/testing.md",
    "content": "# `testing` Module\n\nModule containing functions useful for testing.\n\n## Functions\n\n* [`get_current_vm_step`](./testing/get_current_vm_step.md)\n"
  },
  {
    "path": "docs/src/appendix/snforge-library.md",
    "content": "# Library Reference\n\n> ℹ️ **Info**\n> Full documentation for the `snforge` library can be found [here](https://foundry-rs.github.io/starknet-foundry/snforge_std/).\n\n* [`declare`](snforge-library/declare.md) - declares a contract and returns\n  a [`ContractClass`](snforge-library/contract_class.md) which can be interacted with later\n* [`get_call_trace`](snforge-library/get_call_trace.md) - gets current test call trace (with contracts interactions\n  included)\n* [`fs`](snforge-library/fs.md) - module containing functions for interacting with the filesystem\n* [`env`](snforge-library/env.md) - module containing functions for interacting with the system environment\n* [`signature`](snforge-library/signature.md) - module containing struct and trait for creating `ecdsa` signatures\n\n> ℹ️ **Info**\n> To use cheatcodes you need to add `snforge_std` package as a development dependency in\n> your [`Scarb.toml`](https://docs.swmansion.com/scarb/docs/guides/dependencies.html#development-dependencies)\n> using the appropriate version.\n> ```toml\n> [dev-dependencies]\n> snforge_std = \"{{snforge_std_version}}\"\n> ```\n"
  },
  {
    "path": "docs/src/appendix/snforge.md",
    "content": "# `snforge` CLI Reference\n\n* [`snforge test`](./snforge/test.md)\n* [`snforge new`](./snforge/new.md)\n* [`snforge clean`](./snforge/clean.md)\n* [`snforge clean-cache`](./snforge/clean-cache.md)\n* [`snforge check-requirements`](./snforge/check-requirements.md)\n* [`snforge completions`](./snforge/completions.md)\n* [`snforge optimize-inlining`](./snforge/optimize-inlining.md)\n\n\nYou can check your version of `snforge` via `snforge --version`.\nTo display help run `snforge --help`.\n"
  },
  {
    "path": "docs/src/appendix/snfoundry-toml.md",
    "content": "# The Manifest Format\n\nThe `snfoundry.toml` contains the project's manifest and allows specifying sncast settings.\nYou can configure sncast settings and arguments instead of providing them in the CLI along with the commands.\nIf `snfoundry.toml` is not found in the root directory, sncast will look for it in all parent directories. \nIf it is not found, default values will be used.\n\n## `snfoundry.toml` Contents\n\n### `[sncast.<profile-name>]`\n\n\n```toml\n[sncast.myprofile]\n# ...\n```\n\nAll fields are optional and do not have to be provided. In case a field is not defined in a manifest file, it must be provided in CLI when executing a relevant `sncast` command.\nProfiles allow you to define different sets of configurations for various environments or use cases. For more details, see the [profiles explanation](../projects/configuration.md).\n\n#### `url`\n\nThe `url` field specifies the address of RPC provider. It's mutually exclusive with the `network` field.\n\n```toml\n[sncast.myprofile]\nurl = \"http://example.com\"\n```\n\n#### `network`\n\nThe `network` field specifies the network to use. It's mutually exclusive with the `url` field.\n\n```toml\n[sncast.myprofile]\nnetwork = \"sepolia\"\n```\n\n#### `accounts-file`\n\nThe `accounts-file` field specifies the path to a file containing account information. \nIf not provided, the default path is `~/.starknet_accounts/starknet_open_zeppelin_accounts.json`.\n\n```toml\n[sncast.myprofile]\naccounts-file = \"path/to/accounts.json\"\n```\n\n#### `account`\n\nThe `account` field specifies which account from the `accounts-file` to use for transactions.\n\n```toml\n[sncast.myprofile]\naccount = \"user-dev\"\n```\n\n#### `keystore`\n\nThe `keystore` field specifies the path to the keystore file.\n\n```toml\n[sncast.myprofile]\nkeystore = \"path/to/keystore\"\n```\n\n#### `wait-params`\n\nThe `wait-params` field defines the waiting parameters for transactions. By default, timeout (in seconds) is set to `300` and retry-interval (in seconds) to `5`. \nThis means transactions will be checked every `5 seconds`, with a total of `60 attempts` before timing out.\n\n```toml\n[sncast.myprofile]\nwait-params = { timeout = 300, retry-interval = 5 }\n```\n\n#### `show-explorer-links`\nEnable printing links pointing to pages with transaction details in the chosen block explorer\n\n```toml\n[sncast.myprofile]\nshow-explorer-links = true\n```\n\n#### `block-explorer`\n\nThe `block-explorer` field specifies the block explorer service used to display links to transaction details. \n\n> 📝 **Note**\n> For details on how block explorers are used in `sncast` and when links are shown, see the [Block Explorers](../starknet/block_explorer.md) section.\n\n| Value     | URL                                    |\n|-----------|----------------------------------------|\n| Voyager   | `https://voyager.online`               |\n| ViewBlock | `https://viewblock.io/starknet`        |\n| OkLink    | `https://www.oklink.com/starknet`      |\n\n```toml\n[sncast.myprofile]\nblock-explorer = \"Voyager\"\n```\n\n#### `[sncast.<profile-name>.networks]`\n\nThe URLs of the predefined networks can be configured.\nWhen you use `--network <network_name>`, `sncast` first checks whether you have a custom URL configured for that network.\nIn the absence of a user-defined value, the default configuration is applied - public RPC provider is used for `mainnet` and `sepolia`, and the `devnet` endpoint is determined automatically.\n\n```toml\n[sncast.myprofile.networks]\nmainnet = \"https://mainnet.your-node.com\"\nsepolia = \"https://sepolia.your-node.com\"\ndevnet = \"http://127.0.0.1:5050\"\n```\n\n#### Complete Example of `snfoundry.toml` File\n\n```toml\n[sncast.myprofile1]\nurl = \"http://127.0.0.1:5050/\"\naccounts-file = \"../account-file\"\naccount = \"mainuser\"\nkeystore = \"~/keystore\"\nwait-params = { timeout = 500, retry-interval = 10 }\nblock-explorer = \"Voyager\"\nshow-explorer-links = true\n\n[sncast.myprofile1.networks]\nmainnet = \"https://mainnet.your-node.com\"\nsepolia = \"https://sepolia.your-node.com\"\ndevnet = \"http://127.0.0.1:5050\"\n\n[sncast.dev]\nurl = \"http://127.0.0.1:5056/rpc\"\naccount = \"devuser\"\n```"
  },
  {
    "path": "docs/src/appendix/starknet-foundry-github-action.md",
    "content": "# Starknet Foundry Github Action\n\nIf you wish to use Starknet Foundry in your Github Actions workflow, you can use the [setup-snfoundry](https://github.com/marketplace/actions/setup-starknet-foundry) action. This action installs the necessary `snforge` and `sncast` binaries.\n\n> 📝 **Note**\n> At this moment, only Linux and MacOS are supported.\n\n## Example workflow\n\nMake sure you pass the valid path to `Scarb.lock` to [setup-scarb](https://github.com/marketplace/actions/setup-scarb) action. This way, all dependencies including snforge_scarb_plugin will be cached between runs.\n\n```yml\n{{#include ../../example_workflows/basic_workflow.yml}}\n```\n\n## Workflow With Partitioned Tests\n\nIf you have a large number of tests, you can speed up your CI by partitioning tests and running them in parallel jobs. Here's an example workflow that demonstrates how to achieve this:\n\n```yml\n{{#include ../../example_workflows/partitioned_workflow.yml}}\n```\n\nRead more about [tests partitioning here](../snforge-advanced-features/tests-partitioning.md).\n"
  },
  {
    "path": "docs/src/development/environment-setup.md",
    "content": "# Environment Setup\n> 💡 **Info**\n> This tutorial is only relevant if you wish to contribute to Starknet Foundry. \n> If you plan to only use it as a tool for your project, you can skip this part.\n\n## Prerequisites\n\n### Rust\n\nInstall the latest stable [Rust](https://www.rust-lang.org/tools/install) version.\nIf you already have Rust installed make sure to upgrade it by running\n\n```shell\n$ rustup update\n```\n\n### Scarb\nYou can read more about installing Scarb [here](https://docs.swmansion.com/scarb/download.html).\n\nPlease make sure you're using Scarb installed via [asdf](https://asdf-vm.com/) - otherwise some tests may fail.\n> To verify, run:\n> \n> ```shell\n> $ which scarb\n> ```\n> the result of which should be:\n> ```shell\n> $HOME/.asdf/shims/scarb\n> ```\n> \n> If you previously installed scarb using an official installer, you may need to remove this installation or modify your PATH to make sure asdf installed one is always used.\n\n### cairo-profiler\nYou can read more\nabout installing `cairo-profiler` [here](https://github.com/software-mansion/cairo-profiler?tab=readme-ov-file#installation).\n\n> ❗️ **Warning**\n> \n> If you haven't pushed your branch to the remote yet (you've been working only locally) some tests may fail, including:\n> \n> - `e2e::running::simple_package_with_git_dependency`\n> \n> After pushing the branch to the remote, those tests should pass.\n\n### Starknet Devnet\nInstall [starknet-devnet](https://github.com/0xSpaceShard/starknet-devnet) via [asdf](https://asdf-vm.com/).\n\n### Universal sierra compiler\nInstall the latest [universal-sierra-compiler](https://github.com/software-mansion/universal-sierra-compiler) version.\n\n## Running Tests\nTests can be run with:\n\n```shell\n$ cargo test\n```\n\n## Cairo Native\n\nTo develop Starknet Foundry with Cairo Native support, you need to enable the `cairo-native` feature in Cargo and\ninstall the required dependencies.\n\n### LLVM\n\nLLVM 19 is required to build forge with Cairo Native support and to run it.\n\n#### macOS\n\nOn macOS in can be installed with\n\n```shell\n$ brew install llvm@19\n```\n\nNext, export the following environment variables:\n\n```\nLIBRARY_PATH=/opt/homebrew/lib\nMLIR_SYS_190_PREFIX=\"$(brew --prefix llvm@19)\"\nLLVM_SYS_191_PREFIX=\"$(brew --prefix llvm@19)\"\nTABLEGEN_190_PREFIX=\"$(brew --prefix llvm@19)\"\n```\n\n#### Linux\n\nLLVM installation varies between distributions.\nSee [here](https://llvm.org/docs/GettingStarted.html) and [here](https://releases.llvm.org/download.html) for more\ndetails.\n\nNext, export the following environment variables, note that the paths may differe depending on your distribution and\ninstallation method:\n\n```\nMLIR_SYS_190_PREFIX=/usr/lib/llvm-19\nLLVM_SYS_191_PREFIX=/usr/lib/llvm-19\nTABLEGEN_190_PREFIX=/usr/lib/llvm-19\n```\n\n## Formatting and Lints\n\nStarknet Foundry uses [rustfmt](https://github.com/rust-lang/rustfmt) for formatting. You can run the formatter with\n\n```shell\n$ cargo fmt\n```\n\nFor linting, it uses [clippy](https://github.com/rust-lang/rust-clippy). You can run it with this command:\n\n```shell\n$ cargo clippy --all-targets --all-features -- --no-deps -W clippy::pedantic -A clippy::missing_errors_doc -A clippy::missing_panics_doc -A clippy::default_trait_access\n```\n\nOr using our defined alias\n\n```shell\n$ cargo lint\n```\n\n## Spelling\n\nStarknet Foundry uses [typos](https://github.com/marketplace/actions/typos-action) for spelling checks.\n\nYou can run the checker with\n\n```shell\n$ typos\n```\n\nSome typos can be automatically fixed by running\n\n```shell\n$ typos -w\n```\n\n## Contributing\n\nRead the general contribution guideline [here](https://github.com/foundry-rs/starknet-foundry/blob/master/CONTRIBUTING.md)\n"
  },
  {
    "path": "docs/src/development/shell-snippets.md",
    "content": "# Shell Snippets in Documentation\n\n`snforge` and `sncast` snippets and their outputs present in the docs are automatically run and tested. Some of them need to be configured with specific values to work correctly.\n\n## Snippet configuration\n\nTo configure a snippet, you need to add a comment block right before it. The comment block should contain the configuration in JSON format. Example:\n\n`````markdown\n<!-- { \"package_name\": \"hello_starknet\", \"ignored_output\": true } -->\n```shell\n$ sncast \\\n    account create \\\n    --network sepolia \\\n    --name my_first_account\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Account created\n\nAddress: 0x[..]\n\nAccount successfully created but it needs to be deployed. The estimated deployment fee is [..] STRK. Prefund the account to cover deployment transaction fee\n   \nTo see account creation details, visit:\naccount: https://sepolia.voyager.online/contract/[..]\n```\n</details>\n`````\n\n## Available configuration options\n\n- `ignored` - if set to `true`, the snippet will be ignored and not run.\n- `package_name` - the name of the Scarb package in which the snippet should be run.\n- `ignored_output` - if set to `true`, the output of executed command will be ignored.\n- `replace_network` - if set to `true`, the snippet will replace the `--network` argument with devnet used in tests.\n- `scarb_version` - specifies the Scarb version required to run the snippet. If the current Scarb version does not match, the snippet will be ignored. The version should be in the format compatible with [semver](https://semver.org/).\n"
  },
  {
    "path": "docs/src/development/snapshot-tests.md",
    "content": "# Snapshot tests\n> 💡 **Info**\n> This tutorial is only relevant if you wish to contribute to Starknet Foundry. \n> If you plan to only use it as a tool for your project, you can skip this part.\n\nSome Forge tests use [insta](https://insta.rs/) to store expected test output. \nThis allows us to test behavior across Scarb versions supported by Starknet Foundry.\n\n## Prefix\n\nAll snapshot tests **must be** prefixed with `snap_` prefix.\n\nAs of writing of this document, these are the tests that use `assert_cleaned_output!`.\nThis allows us to explicitly run these on CI.\n\n## The check script\n\nLocally, **`scripts/check_snapshots.sh`** script can be used to run snapshot tests (and fix snapshots).\n\n### Usage\n\nTo make sure snapshot tests pass for all currently supported Scarb versions, run:\n```sh\n./scripts/check_snapshots.sh\n```\nIf some of the snapshot tests fail, run:\n```sh\n./scripts/check_snapshots.sh --fix\n```\nand review the newly generated snapshots.\n"
  },
  {
    "path": "docs/src/getting-started/blake-hash-support.md",
    "content": "# Blake Hash Support\n\nStarting from Starknet version 0.14.1, the network switched from Poseidon hash to Blake hash for compiled class hashes.\n\nStarknet Foundry version 0.53.0 and later includes support for Blake hash, ensuring compatibility with the new Starknet version.\n\n## Common Issue: Mismatch Compiled Class Hash\n\nIf you encounter a `Mismatch compiled class hash` error, it likely means you're using an older version of Starknet Foundry that doesn't support Blake hash.\n\n**Solution**: Upgrade to Starknet Foundry version 0.53.0 or later:\n\n```shell\nasdf install starknet-foundry latest\n```\n\n```shell\nasdf set --home starknet-foundry latest\n```\n\nThis will update your installation to the latest version with Blake hash support.\n\n> 📝 **Note**\n>\n> For more detailed installation instructions, see the [Installation](../getting-started/installation.md) guide.\n"
  },
  {
    "path": "docs/src/getting-started/first-steps.md",
    "content": "# First Steps With Starknet Foundry\n\nIn this section we provide an overview of Starknet Foundry `snforge` command line tool.\nWe demonstrate how to create a new project, compile, and test it.\n\nTo start a new project with Starknet Foundry, run `snforge new`\n\n```shell\n$ snforge new hello_starknet\n```\n\n> 📝 **Note**\n>\n> By default, `snforge new` creates a project with a simple `HelloStarknet` contract. You can create a different project using the `--template` flag. \n> To see the list of available templates, refer to the [snforge new documentation](../appendix/snforge/new.md#-t---template)\n\nLet's check out the project structure\n\n```shell\n$ cd hello_starknet\n$ tree . -L 1\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\n.\n├── Scarb.lock\n├── Scarb.toml\n├── snfoundry.toml\n├── src\n└── tests\n\n2 directories, 3 files\n```\n</details>\n<br>\n\n* `src/` contains source code of all your contracts.\n* `tests/` contains tests.\n* `Scarb.toml` contains configuration of the project as well as of `snforge`\n* `Scarb.lock` a locking mechanism to achieve reproducible dependencies when installing the project locally  \n\nAnd run tests with `snforge test`\n\n```shell\n$ snforge test\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 2 test(s) from hello_starknet package\nRunning 0 test(s) from src/\nRunning 2 test(s) from tests/\n[PASS] hello_starknet_integrationtest::test_contract::test_cannot_increase_balance_with_zero_value (l1_gas: ~0, l1_data_gas: ~96, l2_gas: ~360000)\n[PASS] hello_starknet_integrationtest::test_contract::test_increase_balance (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~480000)\nTests: 2 passed, 0 failed, 0 ignored, 0 filtered out\n```\n</details>\n<br>\n\n## Using `snforge` With Existing Scarb Projects\n\nTo use `snforge` with existing Scarb projects, make sure you have declared the `snforge_std` package as your project\ndevelopment dependency.\n\nAdd the following line under `[dev-dependencies]` section in the `Scarb.toml` file.\n\n```toml\n# ...\n\n[dev-dependencies]\nsnforge_std = \"{{snforge_std_version}}\"\n```\n\nMake sure that the above version matches the installed `snforge` version. You can check the currently installed version with\n\n<!-- { \"ignored\": true } -->\n```shell\n$ snforge --version\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nsnforge {{snforge_std_version}}\n```\n</details>\n<br>\n\nIt is also possible to add this dependency\nusing [`scarb add`](https://docs.swmansion.com/scarb/docs/guides/dependencies.html#adding-a-dependency-via-scarb-add)\ncommand.\n\n```shell\n$ scarb add snforge_std@{{snforge_std_version}} --dev\n```\n\nAdditionally, ensure that starknet-contract target is enabled in the `Scarb.toml` file.\n\n```toml\n# ...\n[[target.starknet-contract]]\n```\n\n> 📝 **Note**\n>\n> You can additionally specify `scarb` settings to avoid compiling Cairo plugin which `snforge_std` depends on. The plugin is written in Rust and, by default, is compiled locally on the user's side.\n> ```\n> [tool.scarb]  \n> allow-prebuilt-plugins = [\"snforge_std\"]\n> ```\n"
  },
  {
    "path": "docs/src/getting-started/installation.md",
    "content": "# Installation\n\nStarknet Foundry is easy to install on Linux, macOS and WSL.\nIn this section, we will walk through the process of installing Starknet Foundry.\n\n## Contents\n\n<!-- TOC -->\n\n* [Installation](#installation)\n    * [Contents](#contents)\n    * [With Starkup](#with-starkup)\n    * [Manual Installation](#manual-installation)\n      * [Requirements](#requirements)\n      * [Linux and macOS](#linux-and-macos)\n          * [Install asdf](#install-asdf)\n          * [Install Scarb version >= 2.12.0](#install-scarb-version--2120)\n          * [(Optional) Rust Installation](#optional-rust-installation)\n          * [Install Starknet Foundry](#install-starknet-foundry)\n      * [Windows](#windows)\n    * [Common Errors](#common-errors)\n        * [No Version Set (Linux and macOS Only)](#no-version-set-linux-and-macos-only)\n        * [Invalid Rust Version](#invalid-rust-version)\n            * [Linux and macOS](#linux-and-macos-1)\n        * [`scarb test` Isn’t Running `snforge`](#scarb-test-isnt-running-snforge)\n    * [Shell completions (Optional)](#set-up-shell-completions-optional)\n    * [Universal-Sierra-Compiler update](#universal-sierra-compiler-update)\n        * [Linux and macOS](#linux-and-macos-2)\n    * [How to build Starknet Foundry from source code](#how-to-build-starknet-foundry-from-source-code)\n* [Uninstallation](#uninstallation)\n\n<!-- TOC -->\n\n## With Starkup\n\n[Starkup](https://github.com/software-mansion/starkup) helps you install all the tools used to develop packages in Cairo and write contracts for Starknet, including Starknet Foundry.\n\n> ℹ️ **Info**\n>\n> When using starkup on Windows, please\n> use [WSL](https://learn.microsoft.com/en-us/windows/wsl/install), as it only works on macOS and Linux.\n\nRun the following in your terminal, then follow the onscreen instructions:\n\n```shell\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.starkup.sh | sh\n```\n\nTo verify that Starknet Foundry was installed, open a new terminal and run\n\n```shell\nsnforge --version\n```\n\n## Manual Installation\n\n### Requirements\n\n> 📝 **Note**\n>\n> Ensure all requirements are installed and follow the required minimal versions.\n> Starknet Foundry will not run if not following these requirements.\n\nTo use Starknet Foundry, you need:\n\n- [Scarb](https://docs.swmansion.com/scarb/download.html) version >= 2.12.0\n- [Universal-Sierra-Compiler](https://github.com/software-mansion/universal-sierra-compiler)\n- _(Optional for Scarb >= 2.10.0)_[^note] [Rust](https://www.rust-lang.org/tools/install) version >= 1.80.1\n\nall installed and added to your `PATH` environment variable.\n\n[^note]: Additionally, your platform must be one of the supported:\n* `aarch64-apple-darwin`\n* `aarch64-unknown-linux-gnu`\n* `x86_64-apple-darwin`\n* `x86_64-unknown-linux-gnu`\n\n> 📝 **Note**\n>\n> `Universal-Sierra-Compiler` will be automatically installed if you use `asdf` or `snfoundryup`.\n> You can also create `UNIVERSAL_SIERRA_COMPILER` env var to make it visible for `snforge`.\n\n### Linux and macOS\n\n> ℹ️ **Info**\n>\n> If you already have installed Rust, Scarb and asdf simply run\n> `asdf plugin add starknet-foundry`\n\n#### Install asdf\n\nFollow the instructions from [asdf docs](https://asdf-vm.com/guide/getting-started.html#getting-started).\n\nTo verify that asdf was installed, run\n\n```shell\nasdf --version\n```\n\n#### Install Scarb version >= 2.12.0\n\nFirst, add Scarb plugin to asdf\n\n```shell\nasdf plugin add scarb\n```\n\nInstall Scarb\n\n```shell\nasdf install scarb latest\n```\n\nSet a version globally (in your ~/.tool-versions file):\n\n```shell\nasdf set --home scarb latest\n```\n\nTo verify that Scarb was installed, run\n\n```shell\nscarb --version\n```\n\nand verify that version is >= 2.12.0\n\n#### (Optional) Rust Installation\n\n> ℹ️️ **Info**\n>\n> Rust installation is only required if your platform is not one of the following supported platforms:\n>   * `aarch64-apple-darwin`\n>   * `aarch64-unknown-linux-gnu`\n>   * `x86_64-apple-darwin`\n>   * `x86_64-unknown-linux-gnu`\n\n```shell\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n```\n\nTo verify that correct Rust version was installed, run\n\n```shell\nrustc --version\n```\n\nand verify that version is >= 1.80.1\n\nSee [Rust docs](https://doc.rust-lang.org/beta/book/ch01-01-installation.html#installation) for more details.\n\n#### Install Starknet Foundry\n\nFirst, add Starknet Foundry plugin to asdf\n\n```shell\nasdf plugin add starknet-foundry\n```\n\nInstall Starknet Foundry\n\n```shell\nasdf install starknet-foundry latest\n```\n\nSet a version globally (in your ~/.tool-versions file):\n\n```shell\nasdf set --home starknet-foundry latest\n```\n\nTo verify that Starknet Foundry was installed, run\n\n```shell\nsnforge --version\n```\n\nor\n\n```shell\nsncast --version\n```\n\n### Windows\n\n> 🐧 **Info** - WSL (Windows Subsystem for Linux)\n>\n> Starknet Foundry can be installed on Windows using [WSL](https://learn.microsoft.com/en-us/windows/wsl/install).\n>\n> Please follow the [Linux and macOS](#linux-and-macos) guide within your WSL environment.\n\n## Common Errors\n\n### No Version Set\n\nUsers may encounter this error when trying to use `snforge` or `sncast` without setting a version:\n\n```shell\nNo version is set for command snforge\nConsider adding one of the following versions in your config file at $HOME/.tool_versions\nstarknet-foundry {{snforge_std_version}}\n```\n\nThis error indicates that `Starknet Foundry` version is unset. To resolve it, set the version globally using asdf:\n\n```shell\nasdf set --home starknet-foundry latest\n```\n\nFor additional information on asdf version management, see\nthe [asdf](https://asdf-vm.com/guide/getting-started.html#_6-set-a-version)\n\n### Invalid Rust Version\n\nWhen running any `snforge` command, error similar to this is displayed\n\n```shell\nCompiling snforge_scarb_plugin v{{snforge_std_version}}\nerror: package snforge_scarb_plugin {{snforge_std_version}} cannot be built because it requires rustc 1.80.1 or newer, while the currently active rustc version is 1.76.0\n```\n\nThis indicates incorrect Rust version is installed or set.\n\nVerify if rust version >= 1.80.1 is installed\n\n```shell\nrustc --version\n1.80.1\n```\n\nTo fix, follow the platform specific instructions:\n\nIf the version is incorrect or the error persists, try changing the global version of Rust\n\n```shell\nrustup default stable\n```\n\nand local version of Rust\n\n```shell\nrustup override set stable\n```\n\n### `scarb test` Isn’t Running `snforge`\n\nBy default, `scarb test` doesn't use `snforge` to run tests, and it needs to be configured.\nMake sure to include this section in `Scarb.toml`\n\n```toml\n[scripts]\ntest = \"snforge test\"\n```\n\n## Set up shell completions (optional)\n\nShell completions allow your terminal to suggest and automatically complete commands and options when you press `Tab`.\n\n> ⚠️ **Warning**\n>\n> Most users **DO NOT** need to install shell completions manually.\n> [Starkup](#install-via-starkup-installation-script) automatically set up shell completions for the supported shells.\n> However, if these installation methods do not support the target shell, or for any reason fail to set up completions, you can follow the instructions below to set them up manually.\n\n<details>\n  <summary><strong>Bash</strong></summary>\n\nAdd the following to `~/.bashrc` or `~/.bash_profile` (macOS):\n\n```bash\n# BEGIN FOUNDRY COMPLETIONS\n_snforge() {\n  if ! snforge completions bash >/dev/null 2>&1; then\n    return 0\n  fi\n  source <(snforge completions bash)\n  _snforge \"$@\"\n}\n\n_sncast() {\n  if ! sncast completions bash >/dev/null 2>&1; then\n    return 0\n  fi\n  source <(sncast completions bash)\n  _sncast \"$@\"\n}\n\ncomplete -o default -F _snforge snforge\ncomplete -o default -F _sncast sncast\n# END FOUNDRY COMPLETIONS\n```\n\nRun `source ~/.bashrc` (or `source ~/.bash_profile`), or open a new terminal session to apply the changes.\n\n</details>\n\n<details>\n  <summary><strong>ZSH</strong></summary>\n\nAdd the following to `~/.zshrc`:\n\n```bash\n# BEGIN FOUNDRY COMPLETIONS\n_snforge() {\n  if ! snforge completions zsh >/dev/null 2>&1; then\n    return 0\n  fi\n  eval \"$(snforge completions zsh)\"\n  _snforge \"$@\"\n}\n\n_sncast() {\n  if ! sncast completions zsh >/dev/null 2>&1; then\n    return 0\n  fi\n  eval \"$(sncast completions zsh)\"\n  _sncast \"$@\"\n}\n\nautoload -Uz compinit && compinit\ncompdef _snforge snforge\ncompdef _sncast sncast\n# END FOUNDRY COMPLETIONS\n```\n\n> 📝 **Note**\n>\n> If you already have `autoload -Uz compinit && compinit` in your `~/.zshrc` (for example, from another completions such as `scarb`), do not add it again. Only one call is needed.\n\nRun `source ~/.zshrc`, or open a new terminal session to apply the changes.\n\nFor more information about Zsh completions, see the [Zsh documentation](https://zsh.sourceforge.io/Doc/Release/Completion-System.html) or the [Arch Wiki](https://wiki.archlinux.org/title/Zsh#Command_completion).\n\n</details>\n\n<details>\n  <summary><strong>Fish</strong></summary>\n\nAdd the following to `~/.config/fish/config.fish`:\n\n```bash\n# BEGIN FOUNDRY COMPLETIONS\nfunction _snforge\n  if not snforge completions fish >/dev/null 2>&1\n    return 0\n  end\n  source (snforge completions fish | psub)\n  complete -C (commandline -cp)\nend\n\nfunction _sncast\n  if not sncast completions fish >/dev/null 2>&1\n    return 0\n  end\n  source (sncast completions fish | psub)\n  complete -C (commandline -cp)\nend\n\ncomplete -c snforge -f -a '(_snforge)'\ncomplete -c sncast -f -a '(_sncast)'\n# END FOUNDRY COMPLETIONS\n```\n\nRun `source ~/.config/fish/config.fish`, or open a new terminal session to apply the changes.\n\n</details>\n\n<details>\n  <summary><strong>Elvish</strong></summary>\n\nAdd the following to your `~/.config/elvish/rc.elv` file:\n\n```bash\n# BEGIN FOUNDRY COMPLETIONS\ntry {\n  eval (snforge completions elvish | slurp)\n} catch { return }\n\ntry {\n  eval (sncast completions elvish | slurp)\n} catch { return }\n# END FOUNDRY COMPLETIONS\n```\n\nRun `eval (slurp <  ~/.config/elvish/rc.elv)`, or open a new terminal session to apply the changes.\n\n</details>\n\n## Universal-Sierra-Compiler update\n\nIf you would like to bump the USC manually (e.g. when the new Sierra version is released) you can do it by running:\n\n```shell\ncurl -L https://raw.githubusercontent.com/software-mansion/universal-sierra-compiler/master/scripts/install.sh | sh\n```\n\n## How to build Starknet Foundry from source code\n\nIf you are unable to install Starknet Foundry using the instructions above, you can try building it from\nthe [source code](https://github.com/foundry-rs/starknet-foundry) as follows:\n\n1. [Set up a development environment.](../development/environment-setup.md)\n2. Run `cd starknet-foundry && cargo build --release`. This will create a `target` directory.\n3. Move the `target` directory to the desired location (e.g. `~/.starknet-foundry`).\n4. Add `DESIRED_LOCATION/target/release/` to your `PATH`.\n\n# Uninstallation\n\n## Remove the Starknet Foundry Plugin\n\nFollow the official asdf documentation to remove the Starknet Foundry plugin:\n\n```bash\nasdf plugin remove starknet-foundry\n```\n\nFor more details, refer to the [asdf plugin documentation](https://asdf-vm.com/manage/plugins.html#remove).\n\n## Verify Uninstallation\n\nTo confirm Starknet Foundry has been completely removed, run:\n\n```bash\nsnforge --version\n```\n\nIf the uninstallation was successful, you should see `command not found: snforge`\n"
  },
  {
    "path": "docs/src/getting-started/scarb.md",
    "content": "# Scarb\n\n[Scarb](https://docs.swmansion.com/scarb) is the package manager and build toolchain for Starknet ecosystem.\nThose coming from Rust ecosystem will find Scarb very similar to [Cargo](https://doc.rust-lang.org/cargo/).\n\nStarknet Foundry uses [Scarb](https://docs.swmansion.com/scarb) to:\n- [manage dependencies](https://docs.swmansion.com/scarb/docs/reference/specifying-dependencies.html)\n- [build contracts](https://docs.swmansion.com/scarb/docs/extensions/starknet/contract-target.html)\n\nOne of the core concepts of Scarb is its [manifest file](https://docs.swmansion.com/scarb/docs/reference/manifest.html) - `Scarb.toml`.\nIt can be also used to provide [configuration](../projects/configuration.md) for Starknet Foundry Forge.\nMoreover, you can modify behaviour of `scarb test` to run `snforge test` as \ndescribed [here](https://docs.swmansion.com/scarb/docs/extensions/testing.html#using-third-party-test-runners).\n\n> 📝 **Note**\n> \n>`Scarb.toml` is specifically designed for configuring scarb packages and, by extension, is suitable for `snforge` configurations, \n> which are package-specific. On the other hand, `sncast` can operate independently of scarb workspaces/packages \n> and therefore utilizes a different configuration file, `snfoundry.toml`. This distinction ensures that configurations \n> are appropriately aligned with their respective tools' operational contexts.\n\nLast but not least, remember that in order to use Starknet Foundry, you must have Scarb\n[installed](https://docs.swmansion.com/scarb/download.html) and added to the `PATH` environment variable.\n"
  },
  {
    "path": "docs/src/projects/configuration.md",
    "content": "# Project Configuration\n\n## `snforge`\n\n### Configuring `snforge` Settings in `Scarb.toml`\n\nIt is possible to configure `snforge` for all test runs through `Scarb.toml`.\nInstead of passing arguments in the command line, set them directly in the file.\n\n```toml\n# ...\n[tool.snforge]\nexit_first = true\n# ...\n```\n\n`snforge` automatically looks for `Scarb.toml` in the directory you are running the tests in or in any of its parents.\n\n## `sncast`\n\n### Defining Profiles in `snfoundry.toml`\n\nTo be able to work with the network, you need to supply `sncast` with a few parameters —\nnamely the rpc node url and an account name that should be used to interact with it.\nThis can be done\nby either supplying `sncast` with those parameters directly [see more detailed CLI description,](../appendix/sncast.md)\nor you can put them into `snfoundry.toml` file:\n\n```toml\n# ...\n[sncast.myprofile]\naccount = \"user\"\naccounts-file = \"~/my_accounts.json\"\nurl = \"http://127.0.0.1:5050/rpc\"\n# ...\n```\n\nWith `snfoundry.toml` configured this way, we can just pass `--profile myprofile` argument to make sure `sncast` uses parameters\ndefined in the profile.\n\n> 📝 **Note**\n> `snfoundry.toml` file has to be present in current or any of the parent directories.\n\n> 📝 **Note**\n> If there is a profile with the same name in Scarb.toml, scarb will use this profile. If not, scarb will default to using the dev profile.\n> (This applies only to subcommands using scarb - namely `declare` and `script`).\n\n> 💡 **Info**\n> Not all parameters have to be present in the configuration - you can choose to include only some of them and supply\n> the rest of them using CLI flags. You can also override parameters from the configuration using CLI flags.\n\n```shell\n$ sncast --profile myprofile \\\n    call \\\n    --contract-address 0x0589a8b8bf819b7820cb699ea1f6c409bc012c9b9160106ddc3dacd6a89653cf \\\n    --function get_balance \\\n    --block-id latest\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Call completed\n\nResponse:     0x0\nResponse Raw: [0x0]\n```\n</details>\n<br>\n\n### Multiple Profiles\n\nYou can have multiple profiles defined in the `snfoundry.toml`.\n\n### Default Profile\n\nThere is also an option to set up a default profile, which can be utilized without the need to specify a `--profile`. Here's an example:\n\n```toml\n# ...\n[sncast.default]\naccount = \"user123\"\naccounts-file = \"~/my_accounts.json\"\nurl = \"http://127.0.0.1:5050/rpc\"\n# ...\n```\n\nWith this, there's no need to include the `--profile` argument when using `sncast`.\n\n```shell\n$ sncast call \\\n    --contract-address 0x0589a8b8bf819b7820cb699ea1f6c409bc012c9b9160106ddc3dacd6a89653cf \\\n    --function get_balance \\\n    --block-id latest\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Call completed\n\nResponse:     0x0\nResponse Raw: [0x0]\n```\n</details>\n<br>\n\n### Global Configuration\n\nGlobal configuration file is a [`snfoundry.toml`](https://foundry-rs.github.io/starknet-foundry/appendix/snfoundry-toml.html), \nwhich is a common storage for configurations to apply to multiple projects across various directories.\nThis file is stored in a predefined location and is used to store profiles that can be used from any location on your computer.\n\n#### Interaction Between Local and Global Profiles\n\nGlobal config can be overridden by a local config.\n\nIf both local and global profiles with the same name are present, local profile will be combined with global profile. For any setting defined in both profiles, the local setting will take precedence. For settings not defined in the local profile, values from the corresponding global profile will be used, or if not defined, values from the global default profile will be used instead.\n\nThis same behavior applies for [default profiles](#default-profile) as well. A local default profile will override a global default profile.\n\n> 📝 **Note**\n> Remember that arguments passed in the CLI have the highest priority and will always override the configuration file settings.\n\n\n#### Global Configuration File Location\nThe global configuration is stored in a specific location depending on the operating system:\n\n- macOS/Linux : The global configuration file is located at `$HOME/.config/starknet-foundry/snfoundry.toml`\n\n> 📝 **Note**\n> If missing, global configuration file will be created automatically on running any `sncast` command for the first time.\n\n### Config Interaction Example\n\n```\nroot/\n├── .config/\n│   └── starknet-foundry/\n│       └── snfoundry.toml -> A\n└── /../../\n        └── projects/\n            ├── snfoundry.toml -> B\n            └── cairo-projects/\n                └── opus-magnum/\n```\n\n**Glossary:**\n\n- **A:** Global configuration file containing the profiles `default` and `testnet`.\n- **B:** Local configuration file containing the profiles `default` and `mainnet`.\n\nIn any directory in the file system, a user can run the `sncast` command using the `default` and `testnet` profiles, \nbecause they are defined in global config (file A). \n\nIf no profiles are explicitly specified, the `default` profile from the global configuration file will be used.\n\nWhen running `sncast` from the `opus-magnum` directory, there is a configuration file in the parent directory (file B). \nThis setup allows for the use of the following profiles: `default`, `testnet`, and `mainnet`. If the `mainnet` profile is specified, \nthe configuration from the local file will be used to override the global `default` profile, as the `mainnet` profile does not exist in the global configuration.\n\n## Environmental Variables\n\nProgrammers can use environmental variables in both `Scarb.toml::tool::snforge` and in `snfoundry.toml`. To use an environmental variable as a value, use its name either with or without curly braces, prefixed with `$` (e.g. `${MY_ENV}` or `$MY_ENV`).\nThis might be useful, for example, to hide node urls in the public repositories. \nAs an example:\n\n```toml\n# ...\n[sncast.default]\naccount = \"my_account\"\naccounts-file = \"~/my_accounts.json\"\nurl = \"$NODE_URL\"\n# ...\n```\n\nVariable values are automatically resolved to numbers and booleans (strings `true`, `false`) where possible.\n"
  },
  {
    "path": "docs/src/snforge-advanced-features/debugging.md",
    "content": "# Debugging\n\nWhen a contract call fails, the error message alone may not always provide enough information to identify the root cause\nof the issue. To aid in debugging, `snforge` offers the following features:\n\n- [live debugging](debugging.md#live-debugging)\n- [trace](debugging.md#trace)\n- [backtrace](debugging.md#backtrace)\n\n\n## Live Debugging\n\nThe `--launch-debugger` flag enables step-through, breakpoint-based debugging of a Cairo test. When used, `snforge`\nacts as a debug adapter communicating over [Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-protocol/),\nenabling an editor/IDE to connect and control the execution of the test.\n\n> 📝 **Note**\n>\n> `--launch-debugger` requires `--exact` - only a single test can be debugged at a time.\n\n### Prerequisites\n\nLive debugging relies on debug information provided by Scarb. To generate the necessary debug information, you need\nto have:\n\n1. [Scarb](https://github.com/software-mansion/scarb) version `2.18.0` or higher\n2. `Scarb.toml` file with the following Cairo compiler configuration:\n\n```toml\n[profile.dev.cairo]\nunstable-add-statements-code-locations-debug-info = true\nunstable-add-statements-functions-debug-info = true\nadd-functions-debug-info = true\nskip-optimizations = true\n```\n\n### Debugging in VSCode\n\n1. Open your Cairo project in VSCode.\n2. Make sure the latest [Cairo extension](https://marketplace.visualstudio.com/items?itemName=starkware.cairo1) is installed.\n3. Set breakpoints in your cairo files.\n4. Start a debugging session:\n   - Use the extension's **▶ Debug Test** code lens (displayed above each test function) to launch the debugger - \n     it will invoke `snforge` with `--launch-debugger` automatically and start a debugging session.\n   \n     ![debugger lens image](images/debugger_lens.png)\n   \n   - Alternatively, create the debug configuration manually in `.vscode/launch.json` file and then start a debugging\n     session using **Run and Debug** view. Example content of the `.vscode/launch.json` file:\n   ```json\n   {\n       \"version\": \"0.2.0\",\n       \"configurations\": [\n           {\n               \"type\": \"cairo\",\n               \"request\": \"launch\",\n               \"name\": \"my_pkg::tests::my_test debug\",\n               \"program\": \"snforge test --package my_pkg --launch-debugger --exact my_pkg::tests::my_test\",\n               \"processCwd\": \"${workspaceFolder}\"\n           }\n       ]\n   }\n   ```\n\nCheck [here](https://code.visualstudio.com/docs/debugtest/debugging) for details on how to interact with the VSCode UI.\n\n### Debugging in another IDE\n\nIf you are using another IDE, you need to make sure that your DAP client establishes the connection with snforge's \ndebug adapter after it is launched. If you run:\n\n```shell\n$ snforge test --exact my_package::my_module::test_name --launch-debugger\n```\n\n`snforge` will start a TCP server and print the port it is listening on to stdout in the following format:\n\n```shell\nDEBUGGER PORT: 12345\n```\n\nConnect your DAP client to `localhost` on that port to begin the debugging session.\n\n\n## Trace\n\n### Usage\n\n> 📝 Note  \n> Currently, the flow of execution trace is only available at the contract level. In future versions, it will also be\n> available at the function level.\n\nYou can inspect the flow of execution for your tests using the `--trace-verbosity` or `--trace-components`  flags when\nrunning the `snforge test` command. This is useful for understanding how contracts are interacting with each other\nduring your tests, especially in complex nested scenarios.\n\n### Trace Components\n\nThe `--trace-components` flag allows you to specify which components of the trace you want to see. You can choose from:\n\n- `contract-name`: the name of the contract being called\n- `entry-point-type`: the type of the entry point being called (e.g., `External`, `L1Handler`, etc.)\n- `calldata`: the calldata of the call, transformed for display\n- `contract-address`: the address of the contract being called\n- `caller-address`: the address of the caller contract\n- `call-type`: the type of the call (e.g., `Call`, `Delegate`, etc.)\n- `call-result`: the result of the call, transformed for display\n- `gas`: estimated L2 gas consumed by the call \n\nExample usage:\n\n<!-- { \"package_name\": \"debugging\" } -->\n```shell\n$ snforge test --trace-components contract-name call-result call-type\n```\n<details>\n<summary>Output:</summary>\n\n```shell\n[test name] debugging_integrationtest::test_trace::test_debugging_trace_success\n├─ [selector] execute_calls\n│  ├─ [contract name] SimpleContract\n│  ├─ [call type] Call\n│  ├─ [call result] success: array![RecursiveCall { contract_address: ContractAddress([..]), payload: array![RecursiveCall { contract_address: ContractAddress([..]), payload: array![] }, RecursiveCall { contract_address: ContractAddress([..]), payload: array![] }] }, RecursiveCall { contract_address: ContractAddress([..]), payload: array![] }]\n│  ├─ [selector] execute_calls\n│  │  ├─ [contract name] SimpleContract\n│  │  ├─ [call type] Call\n│  │  ├─ [call result] success: array![RecursiveCall { contract_address: ContractAddress([..]), payload: array![] }, RecursiveCall { contract_address: ContractAddress([..]), payload: array![] }]\n│  │  ├─ [selector] execute_calls\n│  │  │  ├─ [contract name] SimpleContract\n│  │  │  ├─ [call type] Call\n│  │  │  └─ [call result] success: array![]\n│  │  └─ [selector] execute_calls\n│  │     ├─ [contract name] SimpleContract\n│  │     ├─ [call type] Call\n│  │     └─ [call result] success: array![]\n│  └─ [selector] execute_calls\n│     ├─ [contract name] SimpleContract\n│     ├─ [call type] Call\n│     └─ [call result] success: array![]\n└─ [selector] fail\n   ├─ [contract name] SimpleContract\n   ├─ [call type] Call\n   └─ [call result] panic: (0x1, 0x2, 0x3, 0x4, 0x5)\n```\n</details>\n<br>\n\n### Verbosity Levels\n\nThe `--trace-verbosity` flag accepts the following values:\n\n- `minimal`: shows test name, contract name, and selector\n- `standard`: includes test name, contract name, selector, calldata, and call result\n- `detailed`: displays the entire trace, including internal calls, caller addresses, and panic reasons\n\nExample usage:\n\n<!-- { \"package_name\": \"debugging\" } -->\n```shell\n$ snforge test --trace-verbosity standard\n```\n<details>\n<summary>Output:</summary>\n\n```shell\n[test name] debugging_integrationtest::test_trace::test_debugging_trace_success\n├─ [selector] execute_calls\n│  ├─ [contract name] SimpleContract\n│  ├─ [calldata] array![RecursiveCall { contract_address: ContractAddress([..]), payload: array![RecursiveCall { contract_address: ContractAddress([..]), payload: array![] }, RecursiveCall { contract_address: ContractAddress([..]), payload: array![] }] }, RecursiveCall { contract_address: ContractAddress([..]), payload: array![] }]\n│  ├─ [call result] success: array![RecursiveCall { contract_address: ContractAddress([..]), payload: array![RecursiveCall { contract_address: ContractAddress([..]), payload: array![] }, RecursiveCall { contract_address: ContractAddress([..]), payload: array![] }] }, RecursiveCall { contract_address: ContractAddress([..]), payload: array![] }]\n│  ├─ [selector] execute_calls\n│  │  ├─ [contract name] SimpleContract\n│  │  ├─ [calldata] array![RecursiveCall { contract_address: ContractAddress([..]), payload: array![] }, RecursiveCall { contract_address: ContractAddress([..]), payload: array![] }]\n│  │  ├─ [call result] success: array![RecursiveCall { contract_address: ContractAddress([..]), payload: array![] }, RecursiveCall { contract_address: ContractAddress([..]), payload: array![] }]\n│  │  ├─ [selector] execute_calls\n│  │  │  ├─ [contract name] SimpleContract\n│  │  │  ├─ [calldata] array![]\n│  │  │  └─ [call result] success: array![]\n│  │  └─ [selector] execute_calls\n│  │     ├─ [contract name] SimpleContract\n│  │     ├─ [calldata] array![]\n│  │     └─ [call result] success: array![]\n│  └─ [selector] execute_calls\n│     ├─ [contract name] SimpleContract\n│     ├─ [calldata] array![]\n│     └─ [call result] success: array![]\n└─ [selector] fail\n   ├─ [contract name] SimpleContract\n   ├─ [calldata] array![0x1, 0x2, 0x3, 0x4, 0x5]\n   └─ [call result] panic: (0x1, 0x2, 0x3, 0x4, 0x5)\n```\n</details>\n<br>\n\n---\n\n## Trace Output Explained\n\nHere's what each tag in the trace represents:\n\n| Tag                  | Description                                                                                                                                                                      |\n|----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `[test name]`        | The path to the test being executed, using the Cairo module structure. Indicates which test case produced this trace.                                                            |\n| `[selector]`         | The name of the contract function being called. The structure shows nested calls when one function triggers another.                                                             |\n| `[contract name]`    | The name of the contract where the selector (function) was invoked. Helps trace calls across contracts.                                                                          |\n| `[entry point type]` | (In detailed view) Type of entry point used: External, Constructor, L1Handler. Useful to differentiate the context in which the call is executed.                                |\n| `[calldata]`         | (In standard view and above) The arguments passed into the function call.                                                                                                        |\n| `[storage address]`  | (In detailed view) The storage address of the specific contract instance called. Helps identify which deployment is used if you're testing multiple.                             |\n| `[caller address]`   | (In detailed view) The address of the account or contract that made this call. Important to identify who triggered the function.                                                 |\n| `[call type]`        | (In detailed view) Call, Delegate. Describes how the function is being invoked.                                                                                                  |\n| `[call result]`      | (In standard view and above) The return value of the call, success or panic.                                                                                                     |\n| `[gas]`              | (In detailed view) L2 gas needed to execute the call. The calculation ignores state changes, calldata and signature lengths, L1 handler payload length and Starknet OS overhead. |\n\n\n\n## Backtrace\n\n### Prerequisites\n\nBacktrace feature relies on debug information provided by Scarb. To generate the necessary debug information, you need\nto have:\n\n1. [Scarb](https://github.com/software-mansion/scarb) version `2.12.0` or higher\n2. `Scarb.toml` file with the following Cairo compiler configuration:\n\n```toml\n[profile.dev.cairo]\nunstable-add-statements-code-locations-debug-info = true\nunstable-add-statements-functions-debug-info = true\npanic-backtrace = true\n```\n\n> 📝 **Note**\n>\n> That `unstable-add-statements-code-locations-debug-info = true` and\n> `unstable-add-statements-functions-debug-info = true` will slow down the compilation and cause it to use more system\n> memory. It will also make the compilation artifacts larger. So it is only recommended to add these flags when you need\n> their functionality.\n\n### Usage\n\nIf your contract fails and a backtrace can be generated, `snforge` will prompt you to run the operation again with the\n`SNFORGE_BACKTRACE=1` environment variable (if it’s not already configured). For example, you may see failure data like\nthis:\n\n\n<!-- { \"package_name\": \"backtrace_panic\" } -->\n```shell\n$ snforge test\n```\n<details>\n<summary>Output:</summary>\n\n```shell\nFailure data:\n    (0x417373657274206661696c6564 ('Assert failed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\nnote: run with `SNFORGE_BACKTRACE=1` environment variable to display a backtrace\n```\n</details>\n<br>\n\n\nTo enable backtrace, simply set the `SNFORGE_BACKTRACE=1` environment variable and rerun the operation.\n\nWhen enabled, the backtrace will display the call tree of the execution, including the specific line numbers in the\ncontracts where the errors occurred. Here's an example of what you might see:\n\n<!-- TODO(#2713) -->\n\n<!-- { \"ignored\": true, \"package_name\": \"backtrace_vm_error\" } -->\n```shell\n$ SNFORGE_BACKTRACE=1 snforge test\n```\n<details>\n<summary>Output:</summary>\n\n```shell\n\"Failure data:\n    (0x417373657274206661696c6564 ('Assert failed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\nerror occurred in contract 'InnerContract'\nstack backtrace:\n   0: (inlined) core::array::ArrayImpl::append\n       at [..]array.cairo:135:9\n   1: core::array_inline_macro\n       at [..]lib.cairo:364:11\n   2: (inlined) core::Felt252PartialEq::eq\n       at [..]lib.cairo:231:9\n   3: (inlined) backtrace_panic::InnerContract::inner_call\n       at [..]traits.cairo:442:10\n   4: (inlined) backtrace_panic::InnerContract::InnerContract::inner\n       at [..]lib.cairo:40:16\n   5: backtrace_panic::InnerContract::__wrapper__InnerContract__inner\n       at [..]lib.cairo:35:13\n\nerror occurred in contract 'OuterContract'\nstack backtrace:\n   0: (inlined) backtrace_panic::IInnerContractDispatcherImpl::inner\n       at [..]lib.cairo:22:1\n   1: (inlined) backtrace_panic::OuterContract::OuterContract::outer\n       at [..]lib.cairo:17:13\n   2: backtrace_panic::OuterContract::__wrapper__OuterContract__outer\n       at [..]lib.cairo:15:9\"\n```\n</details>\n<br>\n\n### Advanced Configuration\n\nFor the most detailed backtrace information, you can add `skip-optimizations = true` to your `Scarb.toml` (requires Scarb >= 2.14.0).\nThis skips as much compiler optimizations as possible, keeping the compiled code closer to the original and allowing `snforge` to provide more complete and accurate backtrace information.\n\n```toml\n[cairo]\nskip-optimizations = true\n```\n\nLearn more about this option in the [Scarb documentation](https://docs.swmansion.com/scarb/docs/reference/manifest.html#skip-optimizations).\n\n> ⚠️ **Warning**: Setting `skip-optimizations = true` may result in faster compilation, but **much** slower execution\n> of the compiled code. If you need to deploy your contracts on Starknet, you should **never** compile them with this\n> field set to `true`.\n"
  },
  {
    "path": "docs/src/snforge-advanced-features/fork-testing.md",
    "content": "# Fork Testing\n\n`snforge` supports testing in a forked environment.\nForking allows using state and contracts from a real instance Starknet network, including Mainnet and Sepolia.\nEach test can fork the state of a specified real\nnetwork and perform actions on top of it.\n\n> 📝 **Note**\n>\n> Actions are performed on top of the `forked` state which means real network is not affected.\n\n## Test Contract\n\nWe will demonstrate fork testing on an example of the `Pokemons` contract deployed on Sepolia network.\nWe are going to use a free, open RPC endpoint - [Zan](https://zan.top/blockchain/starknet).\n\nWe first need to define the contract's interface along with all the structures used by its externals:\n```rust\n{{#include ../../listings/fork_testing/src/lib.cairo}}\n```\n\n## Fork Configuration\n\nThere are two ways of configuring a fork:\n- by specifying `url` and block-related parameters in the `#[fork(...)]` attribute\n- or by providing a fork name defined in your `Scarb.toml` to the `#[fork(...)]` attribute\n\n> 📝 **Note**\n> Using fork tests means `snforge` will make (often multiple) requests to the configured RPC URL.\n> These requests are relatively slow as they happen over the network.\n>\n> `snforge` can cache these requests automatically in `.snfoundry_cache` but only if `block_hash` or `block_number` is provided.\n> **Using `block_tag`, especially `\"latest\"` disables the caching functionality.**\n\n### Configure a Fork in the Attribute\n\nIt is possible to pass `url` and only one of `block_number`, `block_hash`, `block_tag` arguments to the `fork` attribute:\n- `url` — RPC URL\n- `block_number` — number of a block which fork will be pinned to\n- `block_hash` — hash of block which fork will be pinned to\n- `block_tag` — tag of block which fork will be pinned to. Currently only `latest` is supported\n\n> 📝 **Note**\n> `block_hash` and `block_number` can be provided as a decimal or hex number.\n\nOnce such a configuration is passed, it is possible to use state and contracts defined on the specified network.\n\nWe are going to test a basic scenario:\n1. Obtain a dispatcher generated by the `#[starknet::interface]`\n2. Instantiate it with a real contract address present in the forked state\n3. Call a method modifying the contract's state\n4. Make some assertion about the changed state\n\nExample uses of all methods:\n\n#### `block_number`\n```rust\n{{#include ../../listings/fork_testing/tests/explicit/block_number.cairo}}\n```\n\n#### `block_hash`\n```rust\n{{#include ../../listings/fork_testing/tests/explicit/block_hash.cairo}}\n```\n\n#### `block_tag`\n```rust\n{{#include ../../listings/fork_testing/tests/explicit/block_tag.cairo}}\n```\n\n### Configure Fork in `Scarb.toml`\n\nAlthough passing named arguments works fine, you have to copy-paste it each time you want to use\nthe same fork in tests.\n\n`snforge` solves this issue by allowing fork configuration inside the `Scarb.toml` file.\n```toml\n[[tool.snforge.fork]]\nname = \"SEPOLIA_LATEST\"\nurl = \"https://api.zan.top/public/starknet-sepolia/rpc/v0_10\"\nblock_id.tag = \"latest\"\n```\n\nFrom this moment forks can be set using their name in the `fork` attribute.\n\n```rust\n{{#include ../../listings/fork_testing/tests/name.cairo}}\n```\n\nIn some cases you may want to override `block_id` defined in the `Scarb.toml` file.\nYou can do it by passing `block_number`, `block_hash`, `block_tag` arguments to the `fork` attribute.\n\n```rust\n{{#include ../../listings/fork_testing/tests/overridden_name.cairo}}\n```\n\n## Testing Forked Contracts\n\nOnce the fork is configured, the test will run on top of the forked state, meaning that it will have access to every contract deployed on the real network.\n\nWith that, you can now interact with any contract from the chain [the same way you would in a standard test](../testing/contracts.md).\n\n> ⚠️ **Warning**\n>\n> Some cheats aren't supported and won't work for forked contracts written in **Cairo 0**.\n> Only those cheats are going to have an effect:\n>\n> - `caller_address`\n> - `block_number`\n> - `block_timestamp`\n> - `sequencer_address`\n> - `spy_events`\n> - `spy_messages_to_l1`\n>\n"
  },
  {
    "path": "docs/src/snforge-advanced-features/fuzz-testing.md",
    "content": "# Fuzz Testing\n\nIn many cases, a test needs to verify function behavior for multiple possible values.\nWhile it is possible to come up with these cases on your own, it is often impractical, especially when you want to test\nagainst a large number of possible arguments.\n\n> ℹ️ **Info**\n> Currently, `snforge` fuzzer only supports using randomly generated values.\n> This way of fuzzing doesn't support any kind of value generation based on code analysis, test coverage or results of\n> other fuzzer runs.\n> In the future, more advanced fuzzing execution modes will be added.\n\n## Random Fuzzing\n\nTo convert a standard test into a random fuzz test, you need to add parameters to the test function\nand include the [`#[fuzzer]`](../testing/test-attributes.md#fuzzer) attribute.\nThese arguments can then be used in the test body.\nThe test will be run many times against different randomly generated values.\n\n```rust\n{{#include ../../listings/fuzz_testing/src/basic_example.cairo}}\n```\n\nThen run `snforge test` like usual.\n\n```shell\n$ snforge test\n```\n\n<details>\n<summary>Output:</summary>\n\n<!-- TODO (#2926) -->\n```shell\nCollected 2 test(s) from fuzz_testing package\nRunning 2 test(s) from src/\n[PASS] fuzz_testing::with_parameters::tests::test_sum (runs: 22, (l1_gas: {max: ~0, min: ~0, mean: ~0, std deviation: ~0}, l1_data_gas: {max: ~0, min: ~0, mean: ~0, std deviation: ~0}, l2_gas: {max: ~1888390, min: ~1852630, mean: ~1881888, std deviation: ~9322}))\n[PASS] fuzz_testing::basic_example::tests::test_sum (runs: 256, (l1_gas: {max: ~0, min: ~0, mean: ~0, std deviation: ~0}, l1_data_gas: {max: ~0, min: ~0, mean: ~0, std deviation: ~0}, l2_gas: {max: ~1888390, min: ~1828790, mean: ~1882058, std deviation: ~8807}))\nTests: 2 passed, 0 failed, 0 ignored, 0 filtered out\nFuzzer seed: [..]\n```\n</details>\n<br>\n\n## Types Supported by the Fuzzer\n\nFuzzer currently supports generating values for these types out of the box:\n\n- `felt252`\n- `u8`, `u16`, `u32`, `u64`, `u128`, `u256`\n- `i8`, `i16`, `i32`, `i64`, `i128`\n- `ByteArray`\n\nTo use other types, it is required to implement the [`Fuzzable`](../appendix/snforge-library/fuzzable.md) trait for them.\nProviding non-fuzzable types will result in a compilation error.\n\n## Fuzzer Configuration\n\nIt is possible to configure the number of runs of the random fuzzer as well as its seed for a specific test case:\n\n```rust\n{{#include ../../listings/fuzz_testing/src/with_parameters.cairo}}\n```\n\nIt can also be configured globally, via command line arguments:\n\n```shell\n$ snforge test --fuzzer-runs 1234 --fuzzer-seed 1111\n```\n\nOr in `Scarb.toml` file:\n\n```toml\n# ...\n[tool.snforge]\nfuzzer_runs = 1234\nfuzzer_seed = 1111\n# ...\n```\n"
  },
  {
    "path": "docs/src/snforge-advanced-features/oracles.md",
    "content": "# Oracles\n\n> ⚠️ **Warning**\n>\n> Oracles are fully supported starting from Scarb 2.13.1.\n> Using oracles in Starknet Foundry with older versions of Scarb is not supported and may result in unexpected behavior.\n\nAn [oracle][oracle docs] is an external process (like a script, binary, or web service)\nthat exposes custom logic or data to a Cairo program at runtime. You use it to perform tasks the Cairo VM can't, such as\naccessing real-world data or executing complex, non-provable computations.\n\nStarknet Foundry supports oracles in `snforge` tests. This feature allows your tests to interact with the outside world\nin ways that aren't possible in the standard Starknet execution environment or with `snforge_std` cheatcodes.\n\n## Using oracles\n\nThe [`oracle`][oracle library] library provides a type-safe interface for interacting with external\noracles in Cairo applications. Invoking oracles via this package is the recommended way, as it provides a well-tested,\nsecure, and maintainable interface for oracle interactions.\n\nThe [documentation][oracle docs] for this package provides a bird's-eye overview,\nguidelines, and instructions on how to invoke oracles from Cairo code.\n\nIn the [oracle repository][oracle repo] there is also an end-to-end example\nshowcasing the feature. It implements a simple Cairo executable script that invokes an oracle written in Rust that\nruns as a child process.\n\n## Runtime\n\n`snforge` ships with the same oracle runtime used by [`scarb execute`][oracles in scarb]. The bundled version is fixed\nat the time of a Starknet Foundry release and may differ from the one used by your currently running Scarb version. For\ndetails on behaviour, protocol, and configuration, see Scarb’s documentation.\n\n[oracle library]: https://scarbs.xyz/packages/oracle\n\n[oracle docs]: https://docs.swmansion.com/cairo-oracle\n\n[oracle repo]: https://github.com/software-mansion/cairo-oracle\n\n[oracles in scarb]: https://docs.swmansion.com/scarb/docs/extensions/oracles/overview.html\n"
  },
  {
    "path": "docs/src/snforge-advanced-features/parametrized-testing.md",
    "content": "# Parametrized Testing\n\nSometimes, you want to run the same test logic with different inputs.\nInstead of duplicating code into separate test functions, you can use parameterized tests.\n\nParameterized tests allow you to define multiple test cases for a single function by attaching the\n`#[test_case]` attribute.\n\nEach test case provides its own set of arguments, and `snforge` will automatically generate separate test instances for them.\n\n## Basic Example\n\nTo turn a regular test into a parameterized one, add the `#[test_case(...)]` attribute above it.\nYou can provide any valid Cairo expressions as arguments.\n\nBelow is a simple example which checks addition of two numbers.\n\n```rust\n{{#include ../../listings/parametrized_testing_basic/tests/example.cairo}}\n```\n\nNow run:\n\n<!-- { \"package_name\": \"parametrized_testing_basic\", \"scarb_version\": \">=2.12.0\" } -->\n```shell\n$ snforge test\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 2 test(s) from parametrized_testing_basic package\nRunning 0 test(s) from src/\nRunning 2 test(s) from tests/\n[PASS] parametrized_testing_basic_integrationtest::example::test_sum_1_2_3 ([..])\n[PASS] parametrized_testing_basic_integrationtest::example::test_sum_3_4_7 ([..])\nTests: 2 passed, 0 failed, 0 ignored, [..] filtered out\n```\n</details>\n<br>\n\n## Naming Test Cases\n\nEach parameterized test gets its own generated name. There are two ways to control it:\n\n - **Unnamed test case** - the name is generated based on the function name and the arguments provided.\n\n    ```rust\n    #[test_case(1, 2, 3)]\n    fn test_sum(x: felt252, y: felt252, expected: felt252) {\n        assert_eq!(sum(x, y), expected);\n    }\n    ``` \n    This will generate a test named `test_sum_1_2_3`.\n\n - **Named test case** - you can provide a custom name for the test case using the `name` parameter.\n\n    ```rust\n    #[test_case(name: \"one_plus_two\", 1, 2, 3)]\n    fn test_sum(x: felt252, y: felt252, expected: felt252) {\n        assert_eq!(sum(x, y), expected);\n    }\n    ```\n    This will generate a test named `test_sum_one_plus_two`.\n\n> 📝 **Note**\n> For unnamed test cases, it's possible that two different input values of the same type can generate the same test case name.\n> In such cases we emit a diagnostic error.\n> To resolve it, simply provide an explicit `name` for the case.\n\n## Advanced Example\n\nNow let's look at an addvanced example which uses structs as parameters.\n\n```rust\n{{#include ../../listings/parametrized_testing_advanced/tests/example.cairo}}\n```\n\nNow run:\n\n<!-- { \"package_name\": \"parametrized_testing_advanced\", \"scarb_version\": \">=2.12.0\" } -->\n```shell\n$ snforge test\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 3 test(s) from parametrized_testing_advanced package\nRunning 3 test(s) from tests/\n[PASS] parametrized_testing_advanced_integrationtest::example::test_is_adult_user_name_alice_age_20_true ([..])\n[PASS] parametrized_testing_advanced_integrationtest::example::test_is_adult_user_name_josh_age_18_true ([..])\n[PASS] parametrized_testing_advanced_integrationtest::example::test_is_adult_user_name_bob_age_14_false ([..])\nRunning 0 test(s) from src/\nTests: 3 passed, 0 failed, 0 ignored, [..] filtered out\n```\n</details>\n<br>\n\n## Combining With Fuzzer Attribute\n\n`#[test_case]` can be freely combined with the `#[fuzzer]` attribute.\n\nBelow is an example in which we will fuzz the test but also run the specific defined cases.\n\n```rust\n{{#include ../../listings/parametrized_testing_fuzzer/tests/example.cairo}}\n```\n\nNow run:\n\n<!-- { \"package_name\": \"parametrized_testing_fuzzer\", \"scarb_version\": \">=2.12.0\" } -->\n```shell\n$ snforge test\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 3 test(s) from parametrized_testing_fuzzer package\nRunning 3 test(s) from tests/\n[PASS] parametrized_testing_fuzzer_integrationtest::example::test_sum_1_2 ([..])\n[PASS] parametrized_testing_fuzzer_integrationtest::example::test_sum_3_4 ([..])\n[PASS] parametrized_testing_fuzzer_integrationtest::example::test_sum ([..])\nRunning 0 test(s) from src/\nTests: 3 passed, 0 failed, 0 ignored, 0 filtered out\nFuzzer seed: [..]\n```\n</details>\n<br>"
  },
  {
    "path": "docs/src/snforge-advanced-features/profiling.md",
    "content": "# Profiling\n\nProfiling is what allows developers to get more insight into how the transaction is executed.\nYou can inspect the call tree, see how many resources are used for different parts of the execution, and more!\n\n## Integration with [cairo-profiler](https://github.com/software-mansion/cairo-profiler)\n\n`snforge` is able to produce a file with a trace for each passing test (excluding fuzz tests). \nAll you have to do is use the [`--save-trace-data`](../appendix/snforge/test.md#--save-trace-data) flag:\n\n```shell\n$ snforge test --save-trace-data\n```\n\n> 💡 **Tip**\n>\n> You can choose which resource to track (cairo-steps or sierra-gas) using `--tracked-resource` flag\n> Tracking sierra gas is only available for sierra 1.7.0+\n\nThe files with traces will be saved to `snfoundry_trace` directory. Each one of these files can then be used as an input\nfor the [cairo-profiler](https://github.com/software-mansion/cairo-profiler).\n\nIf you want `snforge` to call `cairo-profiler` on generated files automatically, use [`--build-profile`](../appendix/snforge/test.md#--build-profile) flag:\n\n```shell\n$ snforge test --build-profile\n``` \nThe files with profiling data will be saved to `profile` directory.\n\n## Passing arguments to `cairo-profiler`\n\nYou can pass additional arguments to `cairo-profiler` by using the `--` separator. Everything after `--` will be passed\nto `cairo-profiler`:\n\n```shell\n$ snforge test --build-profile -- --show-inlined-functions\n```\n\n> 📝 **Note**\n>\n> Running `snforge test --help` won't show info about `cairo-profiler` flags. To see them, run `snforge test --build-profile -- --help`.\n"
  },
  {
    "path": "docs/src/snforge-advanced-features/storage-cheatcodes.md",
    "content": "# Direct Storage Access\n\nIn some instances, it's not possible for contracts to expose API that we'd like to use in order to initialize\nthe contracts before running some tests. For those cases `snforge` exposes storage-related cheatcodes,\nwhich allow manipulating the storage directly (reading and writing).\n\nIn order to obtain the variable address that you'd like to write to, or read from, you need to use either:\n- `selector!` macro - if the variable is not a mapping\n- `map_entry_address` function in tandem with `selector!` - for key-value pair of a map variable\n- `starknet::storage_access::storage_address_from_base`\n\n> 📝 **Note**\n>\n> For more user friendly access to storage, consider using the [`interact_with_state`](../appendix/cheatcodes/interact_with_state.md) cheatcode.\n\n## Example: Felt-only storage\nThis example uses only felts for simplicity.\n\n1. Exact storage fields\n\n```rust\n{{#include ../../listings/direct_storage_access/tests/felts_only/field.cairo}}\n```\n\n2. Map entries\n\n```rust\n{{#include ../../listings/direct_storage_access/tests/felts_only/map_entry.cairo}}\n```\n\n## Example: Complex structures in storage\nThis example uses a complex key and value, with default derived serialization methods (via `#[derive(starknet::Store)]`).\n\nWe use a contract along with helper structs:\n\n```rust\n{{#include ../../listings/direct_storage_access/src/complex_structures.cairo}}\n```\n\nAnd perform a test checking `load` and `store` behavior in context of those structs:\n\n```rust\n{{#include ../../listings/direct_storage_access/tests/complex_structures.cairo}}\n```\n\n> ⚠️ **Warning**\n>\n> Complex data can often times be packed in a custom manner (see [this pattern](https://www.starknet.io/cairo-book/ch103-01-optimizing-storage-costs.html)) to optimize costs.\n> If that's the case for your contract, make sure to handle deserialization properly - standard methods might not work.\n> **Use those cheatcode as a last-resort, for cases that cannot be handled via contract's API!**\n\n## Example: Using enums in storage\n\nEnums use 0-based layout for serialization. For example, `FirstVariantOfSomeEnum(100)` will be serialized as `[0, 100]`. However, their Starknet storage layout is 1-based for most enums, especially for these with derived `Store` trait implementation. Therefore, `FirstVariantOfSomeEnum(100)` will be stored on Starknet as `[1, 100]`. \n\nRemember that this rule may not hold for enums that with manual `Store` trait implementation. The most notable example is `Option`, e.g. `Option::None` will be stored as `[0]` and `Option::Some(100)` will be stored as `[1, 100]`.\n\nBelow is an example of a contract which can store `Option<u256>` values:\n\n```rust\n{{#include ../../listings/direct_storage_access/src/using_enums.cairo}}\n```\n\nAnd a test which uses `store` and reads the value:\n\n```rust\n{{#include ../../listings/direct_storage_access/tests/using_enums.cairo}}\n```\n\n```shell\nsnforge test test_store_and_read\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 1 test(s) from direct_storage_access package\nRunning 1 test(s) from tests/\n[PASS] direct_storage_access_tests::using_enums::test_store_and_read (gas: ~233)\nRunning 0 test(s) from src/\nTests: 1 passed, 0 failed, 0 ignored, 4 filtered out\n```\n\n</details>\n\n> 📝 **Note**\n>\n> The `load` cheatcode will return zeros for memory you haven't written into yet (it is a default storage value for Starknet contracts' storage).\n\n## Example with `storage_address_from_base`\nThis example uses `storage_address_from_base` with entry's of the storage variable.\n\n```rust\n{{#include ../../listings/direct_storage_access/tests/using_storage_address_from_base.cairo}}\n```"
  },
  {
    "path": "docs/src/snforge-advanced-features/tests-partitioning.md",
    "content": "# Tests Partitioning\n\nWhen your test suite contains a large number of tests (especially fuzz tests), it can be helpful to split them into partitions and run each partition separately, for example in parallel CI jobs.\n\n\n`snforge` supports this via the `--partition <INDEX>/<TOTAL>` flag.\n\nWhen this flag is provided, `snforge` will divide all collected tests into `TOTAL` partitions and run only the partition with the given `INDEX` (1-based).\n\n## Example\n\nLet's consider package a with the following 7 tests:\n\n```rust\n{{#include ../../listings/tests_partitioning/tests/example.cairo}}\n```\n\nRunning `snforge test --partition 1/2` will run tests `test_a`, `test_c`, `test_e`, `test_g` (4 tests), while running `snforge test --partition 2/2` will run tests `test_b`, `test_d`, `test_f` (3 tests).\n\n<!-- { \"package_name\": \"tests_partitioning\" } -->\n```shell\n$ snforge test --partition 1/2\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\n\nRunning partition run: 1/2\n\nCollected 4 test(s) from tests_partitioning package\nRunning 4 test(s) from tests/\n[PASS] tests_partitioning_integrationtest::example::test_a ([..])\n[PASS] tests_partitioning_integrationtest::example::test_e ([..])\n[PASS] tests_partitioning_integrationtest::example::test_c ([..])\n[PASS] tests_partitioning_integrationtest::example::test_g ([..])\nRunning 0 test(s) from src/\nTests: 4 passed, 0 failed, 0 ignored, 0 filtered out\n\nFinished partition run: 1/2, included 4 out of total 7 tests\n```\n\n</details>\n\n\nSee example GitHub Actions workflow demonstrating partitioned test execution [here](../appendix/starknet-foundry-github-action.html#workflow-with-partitioned-tests).\n"
  },
  {
    "path": "docs/src/starknet/101.md",
    "content": "# `sncast` 101\n\nThis page showcases the standard usage of various `sncast` commands.\nFor more in-depth explanation, please follow other guides from \"sncast Overview\".\n\n## Create and Deploy an Account\n\nFirst, create an account contract ready for deployment.\nThis generates the account details but doesn't put it on the network yet.\n\n<!-- { \"ignored\": true } -->\n```shell\n$ sncast account create \\\n  --name my_account \\\n  --network sepolia\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Account created\n\nAddress: 0x[..]\n\nAccount successfully created but it needs to be deployed. The estimated deployment fee is [..] STRK. Prefund the account to cover deployment transaction fee\n\nAfter prefunding the account, run:\nsncast account deploy --network sepolia --name my_account\n```\n\n</details>\n\nAfter creating an account, send enough STRK tokens to the address to cover the price of the\naccount deployment.\nIn the output of `account create` command, you can find the estimated deployment fee.\n\n> 💡 **Tip**\n> On Sepolia, [this free faucet](https://starknet-faucet.vercel.app/) can be used to fund the account.\n\n\nThen, deploy the account using the command that was provided in output, below `After prefunding the account, run`:\n\n<!-- { \"ignored\": true } -->\n```shell\n$ sncast account deploy \\\n  --network sepolia \\\n  --name my_account\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Account deployed\n\nTransaction Hash: 0x[..]\n\nTo see invocation details, visit:\ntransaction: https://sepolia.voyager.online/tx/0x[..]\n```\n\n</details>\n\nFinally, you can check the account balance:\n\n<!-- { \"ignored\": true } -->\n```shell\n$ sncast --account my_account balance --network sepolia\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nBalance: [..] fri\n```\n</details>\n\nRead more about accounts [here](./account-import.md)\n\n> 💡 **Tip**\n> Existing accounts can be imported to `sncast` as well. See [Importing Accounts](./account-import.md) for more\n> information.\n\n## Calling a Contract\n\nCalling a contract doesn't require an account\n\n<!-- { \"ignored_output\": true } -->\n```shell\n$ sncast call \\\n  --contract-address 0x00cd8f9ab31324bb93251837e4efb4223ee195454f6304fcfcb277e277653008 \\\n  --function get \\\n  --arguments '0x123' \\\n  --network sepolia\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Call completed\n\nResponse:     0x0\nResponse Raw: [0x0]\n```\n\n</details>\n\n[Read more about calling contracts here](./call.md)\n\n## Sending a Transaction\n\nTo send a transaction, invoke a contract.\n\n> 📝 **Note**\n> `--account` argument must be passed before invoke subcommand.\n> This is the same for other commands that send transactions as well.\n\n```shell\n$ sncast \\\n  --account my_account \\\n  invoke \\\n  --contract-address 0x00cd8f9ab31324bb93251837e4efb4223ee195454f6304fcfcb277e277653008 \\\n  --function put \\\n  --arguments '0x123, 100' \\\n  --network sepolia\n```\n\n> 💡 **Tip**\n> `--arguments` flag supports various kinds of Cairo types including\n> structs `--arguments 'MyStruct { a: 1, b: 2 }` and enums `--arguments MyEnum::Variant1`.\n>\n> See [Calldata Transformation](./calldata-transformation.md) for more details.\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Invoke completed\n\nTransaction Hash: 0x[..]\n\nTo see invocation details, visit:\ntransaction: https://sepolia.voyager.online/tx/0x[..]\n```\n\n</details>\n\n[Read more about sending transactions here](./invoke.md)\n\n## Declare a Contract\n\n`sncast` uses `scarb` to build contracts and can find contracts by their names (part after `mod` for\n`#[starknet::contract]`).\nTo declare a contract, simply pass it name to `sncast`.\n\n> 💡 **Tip**\n> There is no need to run `scarb build` before declaration.\n> `sncast` will do that automatically\n\nCreate a project\n\n```shell\nsnforge new my_project\n```\n\nFrom inside the `my_project` directory run\n\n<!-- { \"ignored\": true, \"package_name\": \"hello_starknet\" }  -->\n```shell\n$ sncast \\\n  --account my_account \\\n  declare \\\n  --contract-name HelloStarknet \\\n  --network sepolia\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Declaration completed\n\nContract Address: 0x0[..]\nTransaction Hash: 0x0[..]\n\nTo see declaration details, visit:\nclass: https://sepolia.voyager.online/class/0x[..]\ntransaction: https://sepolia.voyager.online/tx/0x[..]\n\nTo deploy a contract of this class, run:\nsncast --account my_account deploy --class-hash 0x[..] --network sepolia\n```\n\n</details>\n\n[Read more about declaring contracts here](./declare.md)\n\n## Deploy a Contract\n\nProvide a class hash of your contract obtained from declaring it. It's the part after `class_hash:`.\n\n<!-- { \"ignored\": true }  -->\n```shell\n$ sncast \\\n  --account my_account \\\n  deploy \\\n  --class-hash 0x06813150c8b6256546fe2324b49f85021a207b6a383fc207d587f4bfacec00d8 \\\n  --network sepolia\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Deployment completed\n\nContract Address: 0x0[..]\nTransaction Hash: 0x0[..]\n\nTo see deployment details, visit:\ncontract: https://sepolia.voyager.online/contract/0x[..]\ntransaction: https://sepolia.voyager.online/tx/0x[..]\n```\n\n</details>\n\n[Read more about deploying contracts here](./deploy.md)\n\n> 🔎 **Tip**\n> Instead of passing `--class-hash`, you can also pass `--contract-name` to automatically run declare under the hood.\n> See [documentation](deploy.md#deploying-by-contract-name) for more details.\n"
  },
  {
    "path": "docs/src/starknet/account-balance.md",
    "content": "# Account Balance\n\n`sncast` allows you to check the balance of your account using the `sncast get balance` command.\n\n## Basic Example\n\n```shell\n$ sncast --account my_account get balance --network devnet\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nBalance: [..] fri\n```\n</details>\n\nBy default, it shows the balance in STRK tokens. Other possible tokens can be specified using the `--token` flag, read more [here](../appendix/sncast/get/balance.html#--token--t-token).\n\n## Checking Balance of a Custom Token\n\nYou can check the balance of a custom token by providing the `--token-address` flag followed by the token's contract address.\n\n> 📝 **Note**\n>\n> Token address must be a valid ERC-20 token contract.\n\n<!-- { \"ignored\": true } -->\n```shell\n$ sncast --account user1 get balance \\\n    --token-address <YOUR_TOKEN_ADDRESS> \\\n    --network sepolia\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nBalance: [..]\n```\n</details>\n\nRead more about `sncast get balance` command [here](../appendix/sncast/get/balance.md)."
  },
  {
    "path": "docs/src/starknet/account-import.md",
    "content": "# Importing Accounts\n\nYou can export your private key from wallet (Ready) and import it into the file holding the accounts info (`~/.starknet_accounts/starknet_open_zeppelin_accounts.json` by default).\n\n> ⚠️ **Warning**\n>\n> **Never share your private key!**\n> Anyone with access to your private key can access your account and funds. You are doing this at your own risk.\n\n## Exporting Your Private Key\n\nThis section shows how to export your private key from specific wallets.\n\n### Examples\n\n#### Ready (formerly Argent)\n\n1. Open the Ready app > Settings.\n<br/>\n<br/>\n<img src=\"./img/ready_export_1.png\" width=\"300\"/>\n\n2. Click on the current account.\n<br/>\n<br/>\n<img src=\"./img/ready_export_2.png\" width=\"300\"/>\n\n3. Click on \"Export private key\".\n<br/>\n<br/>\n<img src=\"./img/ready_export_3.png\" width=\"300\"/>\n\n4. Enter your password.\n<br/>\n<br/>\n<img src=\"./img/ready_export_4.png\" width=\"300\"/>\n\n5. Copy your private key.\n<br/>\n<br/>\n<img src=\"./img/ready_export_5.png\" width=\"300\"/>\n\n\n#### Braavos\n\n1. Open the Braavos app > Wallet settings.\n<br/>\n<br/>\n<img src=\"./img/braavos_export_1.png\" width=\"300\"/>\n\n2. Click on \"Privacy & Security\".\n<br/>\n<br/>\n<img src=\"./img/braavos_export_2.png\" width=\"300\"/>\n\n3. Click on \"Export private key\".\n<br/>\n<br/>\n<img src=\"./img/braavos_export_3.png\" width=\"300\"/>\n\n4. Enter your password.\n<br/>\n<br/>\n<img src=\"./img/braavos_export_4.png\" width=\"300\"/>\n\n5. Copy your private key.\n<br/>\n<br/>\n<img src=\"./img/braavos_export_5.png\" width=\"300\"/>\n\n## Importing an Account\n\n### Examples\n\n#### General Example\n\nTo import an account into the file holding the accounts info (`~/.starknet_accounts/starknet_open_zeppelin_accounts.json` by default), use the `account import` command.\n\n```shell\n$ sncast \\\n    account import \\\n\t--network sepolia \\\n    --name account_123 \\\n    --address 0x1 \\\n    --private-key 0x2 \\\n    --type oz\n```\n> 📝 **Note** \n> The `--name` can be omitted as this is optional. A default name will be generated for the account.\n\n#### Passing Private Key in an Interactive\n\nIf you don't want to pass the private key in the command (because of safety aspect), you can skip `--private-key` flag. You will be prompted to enter the private key in interactive mode.\n\n<!-- { \"ignored\": true } -->\n```shell\n$ sncast \\\n    account import \\\n\t--network sepolia \\\n    --name account_123 \\\n    --address 0x1 \\\n    --type oz\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nType in your private key and press enter: \n```\n</details>\n<br>\n\n#### Ready (formerly Argent)\n\nTo import Ready account, set the `--type` flag to `ready`.\n\n```shell\n$ sncast \\\n    account import \\\n\t--network sepolia \\\n    --name account_ready \\\n    --address 0x1 \\\n    --private-key 0x2 \\\n    --type ready\n```\n\n#### Braavos\n\nTo import Braavos account, set the `--type` flag to `braavos`.\n\n```shell\n$ sncast \\\n    account import \\\n\t--network sepolia \\\n    --name account_braavos \\\n    --address 0x1 \\\n    --private-key 0x2 \\\n    --type braavos\n```\n\n#### OpenZeppelin\n\nTo import OpenZeppelin account, set the `--type` flag to `oz` or  `open_zeppelin`.\n\n```shell\n$ sncast \\\n    account import \\\n\t--network sepolia \\\n    --name account_oz \\\n    --address 0x1 \\\n    --private-key 0x2 \\\n    --type oz\n```\n\n#### Ledger Hardware Wallet\n\nTo import an account whose signing key lives on a [Ledger device](./ledger.md), pass `--ledger-path` (or `--ledger-account-id` as a shorthand) instead of `--private-key`. The public key is read directly from the device.\n\n<!-- { \"requires_ledger\": true } -->\n```shell\n$ sncast \\\n    account import \\\n    --network sepolia \\\n    --name account_ledger \\\n    --address 0x1 \\\n    --ledger-path \"m//starknet'/sncast'/0'/1'/0\" \\\n    --type oz\n```\n\n<!-- { \"requires_ledger\": true } -->\n```shell\n$ sncast \\\n    account import \\\n    --network sepolia \\\n    --name account_ledger \\\n    --address 0x1 \\\n    --ledger-account-id 1 \\\n    --type oz\n```\n"
  },
  {
    "path": "docs/src/starknet/account.md",
    "content": "# Creating And Deploying Accounts\n\nAccount is required to perform interactions with Starknet (only calls can be done without it). Starknet Foundry `sncast`\nsupports\nentire account management flow with the `sncast account create` and `sncast account deploy` commands.\n\nDifference between those two commands is that the first one creates account information (private key, address and more)\nand the second one deploys it to the network. After deployment, account can be used to interact with Starknet.\n\nTo remove an account from the accounts file, you can use  `sncast account delete`. Please note this only removes the\naccount information stored locally - this will not remove the account from Starknet.\n\n> 💡 **Info**\n> Accounts creation and deployment is supported for\n>  - OpenZeppelin\n>  - Ready (with guardian set to 0)\n>  - Braavos\n\n## Examples\n\n### Creating an Account\n\nDo the following to start interacting with the Starknet:\n\n#### Create account with the `sncast account create` command\n\n```shell\n$ sncast \\\n    account create \\\n    --network sepolia \\\n    --name new_account\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Account created\n\nAddress: 0x[..]\n\nAccount successfully created but it needs to be deployed. The estimated deployment fee is [..] STRK. Prefund the account to cover deployment transaction fee\n\nAfter prefunding the account, run:\nsncast --accounts-file [..]accounts.json account deploy --url [..] --name new_account\n\nTo see account creation details, visit:\naccount: https://sepolia.voyager.online/contract/[..]\n```\n\n</details>\n<br>\n\nFor a detailed CLI description, see [account create command reference](../appendix/sncast/account/create.md).\n\nSee more advanced use cases below or jump directly to the section [here](#advanced-use-cases).\n\n#### Prefund generated address with tokens\n\nTo deploy an account in the next step, you need to prefund it with STRK tokens (read more about them [here](https://docs.starknet.io/learn/protocol/accounts#deploying-a-new-account)).\nYou can do it both by sending tokens from another starknet account or by bridging them\nwith [StarkGate](https://starkgate.starknet.io/).\n\n> 💡 **Info**\n> When deploying on a Sepolia test network, you can also fund your account with artificial tokens via\n> the [Starknet Faucet](https://starknet-faucet.vercel.app)\n> ![image](images/starknet-faucet-sepolia.png)\n\n#### Deploy account with the `sncast account deploy` command\n\n<!-- TODO(#2736) -->\n<!-- { \"ignored\": true } -->\n```shell\n$ sncast \\\n    account deploy \\\n    --network sepolia \\\n\t--name new_account\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Account deployed\n\nTransaction Hash: 0x[..]\n\nTo see invocation details, visit:\ntransaction: https://sepolia.voyager.online/tx/[..]\n```\n\n</details>\n<br>\n\nFor a detailed CLI description, see [account deploy command reference](../appendix/sncast/account/deploy.md).\n\n## Managing Accounts\n\nIf you created an account with `sncast account create` it by default it will be saved in\n`~/.starknet_accounts/starknet_open_zeppelin_accounts.json` file which we call `default accounts file` in the following\nsections.\n\n### [`account import`](../appendix/sncast/account/import.md)\n\nTo import an account to the `default accounts file`, use the `account import` command.\n\n```shell\n$ sncast \\\n    account import \\\n\t--network sepolia \\\n    --name my_imported_account \\\n    --address 0x3a0bcb72428d8056cc7c2bbe5168ddfc844db2737dda3b4c67ff057691177e1 \\\n    --private-key 0x2 \\\n    --type oz\n```\n\n### [`account list`](../appendix/sncast/account/list.md)\n\nList all accounts saved in `accounts file`, grouped based on the networks they are defined on.\n\n<!-- TODO(#2736) -->\n<!-- { \"ignored_output\": true } -->\n```shell\n$ sncast account list\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nAvailable accounts (at [..]):\n- new_account:\n  network: alpha-sepolia\n  public key: [..]\n  address: [..]\n  salt: [..]\n  class hash: [..]\n  deployed: false\n  legacy: false\n  type: OpenZeppelin\n\n- my_account:\n  network: alpha-sepolia\n  public key: 0x48234b9bc6c1e749f4b908d310d8c53dae6564110b05ccf79016dca8ce7dfac\n  address: 0x6f4621e7ad43707b3f69f9df49425c3d94fdc5ab2e444bfa0e7e4edeff7992d\n  deployed: true\n  type: OpenZeppelin\n```\n\n</details>\n<br>\n\nYou can specify a custom location for the accounts file with the `--accounts-file` or `-f` flag.\nThere is also possibility to show private keys with the `--display-private-keys` or `-p` flag.\n\n### [`account delete`](../appendix/sncast/account/delete.md)\n\nDelete an account from `accounts-file` and its associated Scarb profile. If you pass this command, you will be asked to\nconfirm the deletion.\n\n```shell\n$ sncast account delete \\\n    --name new_account \\\n    --network-name alpha-sepolia\n```\n\n### Advanced Use Cases\n\n#### Custom Account Contract\n\nBy default, `sncast` creates/deploys an account\nusing [OpenZeppelin's account contract class hash](https://voyager.online/class/0x05b4b537eaa2399e3aa99c4e2e0208ebd6c71bc1467938cd52c798c601e43564).\nIt is possible to create an account using custom openzeppelin, ready or braavos contract declared to starknet. This can\nbe achieved\nwith `--class-hash` flag:\n\n```shell\n$ sncast \\\n    account create \\\n    --name new_account_2 \\\n    --network sepolia \\\n    --class-hash 0x05b4b537eaa2399e3aa99c4e2e0208ebd6c71bc1467938cd52c798c601e43564\n    --type oz\n```\n\n#### [`account create`](../appendix/sncast/account/create.md) With Salt Argument\n\nInstead of random generation, salt can be specified with `--salt`.\n\n```shell\n$ sncast \\\n    account create \\\n    --network sepolia \\\n    --name another_account_3 \\\n    --salt 0x1\n```\n\n#### Additional features provided with `account import/create`\n\n##### Specifying [`--accounts-file`](../appendix/sncast/account/create.md#create)\n\nAccount information such as `private_key`, `class_hash`, `address` etc. will be saved to the file specified by\n`--accounts-file` argument,\nif not provided, the `default accounts file` will be used.\n\n##### Specifying [`--add-profile`](../appendix/sncast/account/create.md#--add-profile-name)\n\nWhen the `--add-profile` flag is used, the [profile](../projects/configuration.md#defining-profiles-in-snfoundrytoml)\nis automatically created for the account.\nSimply use the `--profile` argument followed by the account name in subsequent requests.\n\n#### Using Ledger Hardware Wallet\n\nAccounts can be created and deployed using a [Ledger hardware wallet](./ledger.md) as the signer. Pass `--ledger-path` (or `--ledger-account-id` as a shorthand) to the `account create` subcommand with an [EIP-2645 derivation path](./eip-2645-hd-paths.md).\n\n<!-- { \"requires_ledger\": true } -->\n```shell\n$ sncast \\\n    account create \\\n    --ledger-path \"m//starknet'/sncast'/0'/1'/0\" \\\n    --network sepolia \\\n    --name my_ledger_account\n```\n\n<!-- { \"requires_ledger\": true } -->\n```shell\n$ sncast \\\n    account create \\\n    --ledger-account-id 1 \\\n    --network sepolia \\\n    --name my_ledger_account\n```\n\nThe public key is read from the device at the specified path and the account address is calculated from it. The path is saved in the accounts file, so subsequent commands only need `--account`:\n\n<!-- { \"ignored\": true } -->\n```shell\n$ sncast \\\n    --account my_ledger_account \\\n    account deploy \\\n    --network sepolia\n```\n\nA signing confirmation will appear on the Ledger device. See [Ledger Hardware Wallet](./ledger.md) for full details.\n\n#### Using Keystore and Starkli Account\n\nAccounts created and deployed with [starkli](https://book.starkli.rs/accounts#accounts) can be used by specifying the [\n`--keystore` argument](../appendix/sncast/common.md#--keystore--k-path_to_keystore_file).\n\n> 💡 **Info**\n> When passing the `--keystore` argument, `--account` argument must be a path to the starkli account JSON file.\n\n<!-- Snippets is ignored, because typing password for keystore uses interactive mode -->\n<!-- { \"ignored\": true } -->\n```shell\n$ sncast \\\n    --keystore keystore.json \\\n    --account account.json  \\\n    declare \\\n\t--network sepolia \\\n    --contract-name my_contract \\\n```\n\n#### Creating an Account With Starkli-Style Keystore\n\nIt is possible to create an openzeppelin account with keystore in a similar\nway [starkli](https://book.starkli.rs/accounts#accounts) does.\n\n<!-- Snippets is ignored, because typing password for keystore uses interactive mode -->\n<!-- { \"ignored\": true } -->\n```shell\n$ sncast \\\n    --keystore my_key.json \\\n    --account my_account.json \\\n    account create \\\n    --network sepolia\n```\n\nThe command above will generate a keystore file containing the private key, as well as an account file containing the\nopenzeppelin account info that can later be used with starkli.\n"
  },
  {
    "path": "docs/src/starknet/block_explorer.md",
    "content": "# Block Explorers\n\nWhen you use commands like `sncast deploy`, `sncast declare`, or `sncast account create`, `sncast` will display block explorer links in the output if the network supports it. These links allow you to quickly inspect the transaction, contract, or class on a public block explorer such as Voyager.\n\n> 💡 **Tip**\n> If you want to use a specific block explorer, see the [`block-explorer` configuration details](../appendix/snfoundry-toml.md#block-explorer).\n\n## When Are Explorer Links Shown?\n\n### Shown by Default\n\n**Public Networks:** Explorer links are enabled by default for public networks (e.g., Sepolia, Mainnet) if the tool can detect a supported explorer for the network.\n\n### Hidden\n\n**Devnet:** Explorer links are not shown for localhost or devnet URLs (e.g., `http://localhost:5050/rpc` or `http://127.0.0.1:5050/rpc`). This prevents confusion, as local network transactions are not visible in public explorers.\n\n## Disabling Explorer Links\n\nYou can turn off explorer links by setting `show-explorer-links = false` in your `snfoundry.toml` profile. See the [snfoundry.toml appendix](../appendix/snfoundry-toml.md#show-explorer-links) for details.\n\n## Environment Variable Override\n\nIt's possible to force explorer links to be shown by setting the environment variable `SNCAST_FORCE_SHOW_EXPLORER_LINKS`:\n\n```shell\n$ SNCAST_FORCE_SHOW_EXPLORER_LINKS=1\n```\n\n## Example Output\n\n```shell\nSuccess: Deployment completed\n\nContract Address: 0x0...\nTransaction Hash: 0x0...\n\nTo see deployment details, visit:\ncontract: https://sepolia.voyager.online/contract/0x0...\ntransaction: https://sepolia.voyager.online/tx/0x0...\n```\n"
  },
  {
    "path": "docs/src/starknet/call.md",
    "content": "# Calling Contracts\n\n## Overview\n\nStarknet Foundry `sncast` supports calling smart contracts on a given network with the `sncast call` command.\n\nThe basic inputs that you need for this command are:\n\n- Contract address\n- Function name\n- Inputs to the function\n\nFor a detailed CLI description, see the [call command reference](../appendix/sncast/call.md).\n\n## Examples\n\n### General Example\n\n```shell\n$ sncast \\\n  call \\\n  --network sepolia \\\n  --contract-address 0x522dc7cbe288037382a02569af5a4169531053d284193623948eac8dd051716 \\\n  --function \"balance_of\" \\\n  --arguments '0x0554d15a839f0241ba465bb176d231730c01cf89cdcb95fe896c51d4a6f4bb8f'\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Call completed\n\nResponse:     0_u256\nResponse Raw: [0x0, 0x0]\n```\n</details>\n<br>\n\n> 📝 **Note**\n> Call does not require passing account-connected parameters (`account` and `accounts-file`) because it doesn't create a transaction.\n\n### Passing `block-id` Argument\n\nYou can call a contract at the specific block by passing `--block-id` argument.\n\n```shell\n$ sncast call \\\n  --network sepolia \\\n  --contract-address 0x522dc7cbe288037382a02569af5a4169531053d284193623948eac8dd051716 \\\n  --function \"balance_of\" \\\n  --arguments '0x0554d15a839f0241ba465bb176d231730c01cf89cdcb95fe896c51d4a6f4bb8f' \\\n  --block-id 77864\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Call completed\n\nResponse:     0_u256\nResponse Raw: [0x0, 0x0]\n```\n</details>\n"
  },
  {
    "path": "docs/src/starknet/calldata-transformation.md",
    "content": "# Calldata Transformation\n\nFor the examples below, we will consider a dedicated contract - `DataTransformerContract`, defined\nin `data_transformer_contract` project namespace.\n\nIt's declared on Sepolia network with class hash `0x02a9b456118a86070a8c116c41b02e490f3dcc9db3cad945b4e9a7fd7cec9168`.\n\nIt has a few methods accepting different types and items defined in its namespace:\n\n```rust\n{{#include ../../listings/hello_sncast/src/data_transformer_contract.cairo}}\n```\n\nA default form of calldata passed to commands requiring it is a series of hex-encoded felts:\n\n```shell\n$ sncast call \\\n    --network sepolia \\\n    --contract-address 0x05075f6d418f7c53c6cdc21cbb5aca2b69c83b6fbcc8256300419a9f101c8b77 \\\n    --function tuple_fn \\\n    --calldata 0x10 0x3 0x0 \\\n    --block-id latest\n```\n\n> 💡 **Info**\n> `sncast` **doesn't verify serialized calldata against the ABI**.\\\n> Only expression transformation checks types and arities of functions called on chain.\n\n## Using `--arguments`\n\nInstead of serializing calldata yourself, `sncast` allows passing it in a far more handy, human-readable form - as a\nlist of comma-separated Cairo expressions wrapped in single quotes. This can be achieved by using the `--arguments`\nflag.\n`sncast` will perform serialization automatically, based on an ABI of the contract\nwe interact with, following\nthe [Starknet specification](https://www.starknet.io/cairo-book/ch102-04-serialization-of-cairo-types.html).\n\n### Basic example\n\nWe can write the same command as above, but with arguments:\n\n```shell\n$ sncast call \\\n    --network sepolia \\\n    --contract-address 0x05075f6d418f7c53c6cdc21cbb5aca2b69c83b6fbcc8256300419a9f101c8b77 \\\n    --function tuple_fn \\\n    --arguments '(0x10, 3, hello_sncast::data_transformer_contract::Enum::One)' \\\n    --block-id latest\n```\n\ngetting the same result.\nNote that the arguments must be:\n\n* provided as a single string\n* comma (`,`) separated\n\n> 📝 **Note**\n> User-defined items such as enums and structs should be referred to depending on a way they are defined in ABI.\\\n> In general, paths to items have form: `<project-name>::<module-path>::<item-name>`.\n\n### Standalone Serialization\n\nIn case you just want to serialize a Cairo expression into calldata for use in other tools, scripts, etc., you can use the `sncast serialize` command.\n\n```shell\n$ sncast utils serialize \\\n    --contract-address 0x00351c816183324878714973f3da1a43c1a40d661b8dac5cb69294cc333342ed \\\n    --function nested_struct_fn \\\n    --arguments 'NestedStructWithField { a: SimpleStruct { a: 0x24 }, b: 96 }' \\\n    --network sepolia\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCalldata: [0x24, 0x60]\n```\n</details>\n<br>\n\nSerialization can also be performed by passing the path to a file containing the contract ABI, instead of using `--class-hash` or `--contract-address`. This allows the command to run without making a network request to fetch the ABI.\n\n```shell\n$ sncast utils serialize \\\n    --abi-file data_transformer_contract_abi.json \\\n    --function nested_struct_fn \\\n    --arguments 'NestedStructWithField { a: SimpleStruct { a: 0x24 }, b: 96 }' \\\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCalldata: [0x24, 0x60]\n```\n</details>\n<br>\n\n## Supported Expressions\n\n`sncast` supports most important Cairo corelib types:\n\n* `bool`\n* signed integers (`i8`, `i16`, `i32`, `i64`, `i128`)\n* unsigned integers (`u8`, `u16`, `u32`, `u64`, `u96`, `u128`, `u256`, `u384`, `u512`)\n* `felt252` (numeric literals and `'shortstrings'`)\n* `ByteArray`\n* `ContractAddress`\n* `ClassHash`\n* `StorageAddress`\n* `EthAddress`\n* `bytes31`\n* `Array` - using `array![]` macro\n* `Span` - using `array![].span()` macro and function call\n\nNumeric types (primitives and `felt252`) can be paseed with type suffix specified for example `--arguments 420_u64`.\n\n> 📝 **Note**\n> Only **constant** expressions are supported. Defining and referencing variables and calling functions (either builtin,\n> user-defined or external) is not allowed.\n\n### More Complex Examples\n\n1. `complex_fn` - different data types:\n\n```shell\n$ sncast call \\\n    --network sepolia \\\n    --contract-address 0x05075f6d418f7c53c6cdc21cbb5aca2b69c83b6fbcc8256300419a9f101c8b77 \\\n    --function complex_fn \\\n    --arguments \\\n'array![array![1, 2], array![3, 4, 5], array![6]],'\\\n'12,'\\\n'-128_i8,'\\\n'\"Some string (a ByteArray)\",'\\\n\"('a shortstring', 32_u32),\"\\\n'true,'\\\n'0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff' \\\n    --block-id latest\n```\n\n> 📝 **Note**\n> In bash and similar shells indentation and whitespace matters when providing multiline strings with `\\`\n>\n> Remember  **not to indent** any line and **not to add whitespace before the `\\` character**.\n\nAlternatively, you can continue the single quote for multiple lines.\n\n```shell\n$ sncast call \\\n    --network sepolia \\\n    --contract-address 0x05075f6d418f7c53c6cdc21cbb5aca2b69c83b6fbcc8256300419a9f101c8b77 \\\n    --function complex_fn \\\n    --arguments 'array![array![1, 2], array![3, 4, 5], array![6]],\n12,\n-128_i8,\n\"Some string (a ByteArray)\",\n('\\''a shortstring'\\'', 32_u32),\ntrue,\n0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff' \\\n    --block-id latest\n```\n\n> 📝 **Note**\n> In bash and similar shells any `'` must be escaped correctly.\n>\n> This is also true for `\"` when using `\"` to wrap the arguments instead of `'`.\n\n2. `nested_struct_fn` - struct nesting:\n\n```shell\n$ sncast call \\\n    --network sepolia \\\n    --contract-address 0x05075f6d418f7c53c6cdc21cbb5aca2b69c83b6fbcc8256300419a9f101c8b77 \\\n    --function nested_struct_fn \\\n    --arguments \\\n'hello_sncast::data_transformer_contract::NestedStructWithField {'\\\n'    a: hello_sncast::data_transformer_contract::SimpleStruct { a: 10 },'\\\n'    b: 12'\\\n'}'\\\n      --block-id latest\n```\n"
  },
  {
    "path": "docs/src/starknet/declare.md",
    "content": "# Declaring New Contracts\n\nStarknet provides a distinction between contract class and instance. This is similar to the difference between writing the code of a `class MyClass {}` and creating a new instance of it `let myInstance = MyClass()` in object-oriented programming languages.\n\nDeclaring a contract is a necessary step to have your contract available on the network. Once a contract is declared, it then can be deployed and then interacted with.\n\nFor a detailed CLI description, see [declare command reference](../appendix/sncast/declare.md).\n\n## Examples\n\n### General Example\n\n> 📝 **Note**\n> Building a contract before running `declare` is not required. Starknet Foundry `sncast` builds a contract during declaration under the hood using [Scarb](https://docs.swmansion.com/scarb).\n\nFirst make sure that you have created a `Scarb.toml` file for your contract (it should be present in project directory or one of its parent directories).\n\nThen run:\n\n<!-- TODO(#2736) -->\n<!-- { \"ignored\": true } -->\n```shell\n$ sncast --account my_account \\\n    declare \\\n\t--network sepolia \\\n    --contract-name HelloSncast\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Declaration completed\n\nContract Address: 0x0[..]\nTransaction Hash: 0x0[..]\n\nTo see declaration details, visit:\nclass: https://voyager.online/search/[..]\ntransaction: https://voyager.online/search/[..]\n\nTo deploy a contract of this class, run:\nsncast --account my_account deploy --class-hash 0x[..] --network sepolia\n```\n</details>\n<br>\n\n> 📝 **Note**\n> Contract name is a part after the `mod` keyword in your contract file. It may differ from package name defined in `Scarb.toml` file.\n\n> 📝 **Note**\n> In the above example we supply `sncast` with `--account` and `--network` flags. If `snfoundry.toml` is present, and has\n> the properties set, values provided using these flags will override values from `snfoundry.toml`. Learn more about `snfoundry.toml`\n> configuration [here](../projects/configuration.md#sncast).\n\n> 💡 **Info**\n> Transaction fee limit can be set either as a single upper bound by `--max-fee` or broken down\n> into individual resource components using `--l1-gas`, `--l1-gas-price`, `--l2-gas`,\n> `--l2-gas-price`, `--l1-data-gas`, and `--l1-data-gas-price`.\n> `--max-fee` and the individual resource flags are mutually exclusive.\n> Any individual resource flag that is not provided will be estimated automatically\n\n# Declaring a Contract by Fetching It From a Different Starknet Instance\n\nIn some cases, you may need to declare a contract that was already compiled elsewhere and reuse the exact same class hash across multiple networks.\nThis is especially important for some contracts, e.g. Universal Deployer Contract (UDC), which must preserve the same class hash across mainnet, testnets, and appchains.\n\nCompiling a contract locally with a different Cairo compiler version may result in a different class hash.\n\nTo avoid this, you can use the [`declare-from`](../appendix/sncast/declare_from.md) which allows you to declare a contract by providing its class hash and the source network where it is already declared.\n\n## Example\n\nLet's consider a basic contract, which is already declared on Sepolia network.\n\nTo declare it on another network, e.g. local devnet, run:\n\n```shell\n$ sncast --account my_account \\\n    declare-from \\\n    --class-hash 0x283a4f96ee7de15894d9205a93db7cec648562cfe90db14cb018c039e895e78 \\\n    --source-network sepolia \\\n    --url http://127.0.0.1:5055/rpc\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Declaration completed\n\nClass Hash:       0x283a4f96ee7de15894d9205a93db7cec648562cfe90db14cb018c039e895e78\nTransaction Hash: 0x[..]\n```\n</details>\n<br>\n\n\n"
  },
  {
    "path": "docs/src/starknet/deploy.md",
    "content": "# Deploying New Contracts\n\n## Overview\n\nStarknet Foundry `sncast` supports deploying smart contracts to a given network with the `sncast deploy` command.\n\nIt works by invoking a [Universal Deployer Contract](https://docs.openzeppelin.com/contracts-cairo/2.x/udc), which\ndeploys the contract with the given class hash and constructor arguments.\n\nFor contract to be deployed on starknet, it must be declared first.\nIt can be done with the [declare command](./declare.md) or by using the [`--contract-name`](#deploying-by-contract-name)\nflag in the `deploy` command.\n\nFor detailed CLI description, see [deploy command reference](../appendix/sncast/deploy.md).\n\n## Usage Examples\n\n### General Example\n\nAfter [declaring your contract](./declare.md), you can deploy it the following way:\n\n```shell\n$ sncast \\\n    --account my_account \\\n    deploy \\\n    --network sepolia \\\n    --class-hash 0x0227f52a4d2138816edf8231980d5f9e6e0c8a3deab45b601a1fcee3d4427b02\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Deployment completed\n\nContract Address: 0x0[..]\nTransaction Hash: 0x0[..]\n\nTo see deployment details, visit:\ncontract: https://sepolia.voyager.online/contract/[..]\ntransaction: https://sepolia.voyager.online/tx/[..]\n```\n</details>\n<br>\n\n> 💡 **Info**\n> Transaction fee limit can be set either as a single upper bound by `--max-fee` or broken down\n> into individual resource components using `--l1-gas`, `--l1-gas-price`, `--l2-gas`,\n> `--l2-gas-price`, `--l1-data-gas`, and `--l1-data-gas-price`.\n> `--max-fee` and the individual resource flags are mutually exclusive.\n> Any individual resource flag that is not provided will be estimated automatically\n\n\n### Deploying Contract With Constructor\n\nFor such a constructor in the declared contract\n\n```rust    \n#[constructor]\nfn constructor(ref self: ContractState, first: felt252, second: u256) {\n    ...\n}\n```\n\nyou have to pass constructor calldata to deploy it.\n\n```shell\n$ sncast deploy \\\n    --class-hash 0x02e93ad9922ac92f3eed232be8ca2601fe19f843b7af8233a2e722c9975bc4ea \\\n    --constructor-calldata 0x1 0x2 0x3\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Deployment completed\n\nContract Address: 0x0[..]\nTransaction Hash: 0x0[..]\n\nTo see deployment details, visit:\ncontract: https://sepolia.voyager.online/contract/[..]\ntransaction: https://sepolia.voyager.online/tx/[..]\n```\n</details>\n<br>\n\n> 📝 **Note**\n> Although the constructor has only two params you have to pass more because u256 is serialized to two felts.\n> It is important to know how types are serialized because all values passed as constructor calldata are\n> interpreted as a field elements (felt252).\n\n### Deploying by Contract Name\n\nInstead of providing the `--class-hash` of an already declared contract, you can pass the name of the\ncontract from a Scarb project by providing the `--contract-name` flag.\nUnder the hood, if the passed contract was never declared to starknet, it will run the [declare](../starknet/declare.md)\ncommand first and then execute the contract deployment.\n\n> 📝 **Note**\n> When passing `--contract-name` flag, `sncast` must wait for the declare transaction to be completed first.\n> The contract might wait for a few seconds before executing the deployment.\n\n> 📝 **Note**\n> If fee arguments are provided to the method, same fee arguments will be used for **each** transaction separately.\n> That is, the total fee paid for the operation will be **2 times the fee limits provided**.\n>\n> For better control over fee, use `declare` and `deploy` with  `--class-hash` separately.\n\n<!-- TODO(#2736) -->\n<!-- { \"ignored\": true } -->\n```shell\n$ sncast deploy \\\n    --contract-name HelloSncast\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Deployment completed\n\nContract Address:         0x0[..]\nClass Hash:               0x0[..]\nDeclare Transaction Hash: 0x0[..]\nDeploy Transaction Hash:  0x0[..]\n\nTo see deployment details, visit:\ncontract: [..]\nclass: [..]\ndeploy transaction: [..]\ndeclare transaction: [..]\n```\n</details>\n\n### Passing `salt` Argument\n\nSalt is a parameter which modifies contract's address, if not passed it will be automatically generated.\n\n```shell\n$ sncast deploy \\\n    --class-hash 0x0227f52a4d2138816edf8231980d5f9e6e0c8a3deab45b601a1fcee3d4427b02 \\\n    --salt 0x123\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Deployment completed\n\nContract Address: 0x0[..]\nTransaction Hash: 0x0[..]\n\nTo see deployment details, visit:\ncontract: https://sepolia.voyager.online/contract/[..]\ntransaction: https://sepolia.voyager.online/tx/[..]\n```\n</details>\n<br>\n\n### Passing `unique` Argument\n\nUnique is a parameter which modifies contract's salt with the deployer address.\nIt can be passed even if the `salt` argument was not provided.\n\n```shell\n$ sncast deploy \\\n    --class-hash 0x0227f52a4d2138816edf8231980d5f9e6e0c8a3deab45b601a1fcee3d4427b02 \\\n    --unique\n```\n\n<details>\n<summary>Output:</summary>\n    \n```shell\nSuccess: Deployment completed\n\nContract Address: 0x0[..]\nTransaction Hash: 0x0[..]\n\nDetails:\ncontract: https://sepolia.voyager.online/contract/[..]\ntransaction: https://sepolia.voyager.online/tx/[..]\n```\n</details>\n"
  },
  {
    "path": "docs/src/starknet/developer.md",
    "content": "# Developer Functionalities\n\n## Logging\n\n`sncast` supports emitting logs, including the logs from the requests sent to the network.\nLogs can be enabled by setting `SNCAST_LOG` environment variable to desired log level.\n\nFor example, to enable logs with level `debug` and higher, run:\n\n```shell\n$ SNCAST_LOG=\"debug\" sncast ...\n```\n\nAdditional filtering can be set to the `SNCAST_LOG` environment variable,\nsee [tracing-subscriber](https://docs.rs/tracing-subscriber/0.3.20/tracing_subscriber/filter/struct.EnvFilter.html#directives)\ndocumentation for more details.\n\n> ⚠️ **Warning**\n>\n> Logs can expose sensitive information, such as private keys. Never use logging in production environments.\n"
  },
  {
    "path": "docs/src/starknet/eip-2645-hd-paths.md",
    "content": "# EIP-2645 HD Paths\n\nLedger derives private keys using [Hierarchical Deterministic Wallet derivation paths](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) (HD paths). A single Ledger device can use an unlimited number of keys — any given combination of seed phrase + path always produces the same key pair.\n\nTherefore, it's important to decide on, and **document** the HD paths used for your accounts. While it's trivial to use a key pair given an HD path, the reverse is not true — recovering which path corresponds to a given public key can be extremely difficult. Following [established patterns](#path-management-best-practices) (e.g. incrementing from zero) is strongly recommended.\n\n## The EIP-2645 Standard\n\nIf you've used hardware wallets before, you may be familiar with paths like `m/44'/60'/0'/0/0`. This format will _not_ work with the Starknet Ledger app — it only accepts the [EIP-2645 HD path](https://github.com/ethereum/ercs/blob/master/ERCS/erc-2645.md) format:\n\n```\nm/2645'/layer'/application'/eth_address_1'/eth_address_2'/index\n```\n\nwhere `layer`, `application`, `eth_address_1`, `eth_address_2`, and `index` are 31-bit unsigned numbers.\n\n## The `sncast` Extension\n\nEIP-2645 paths in raw numeric form are difficult to read and write (e.g. `m/2645'/1195502025'/355113700'/0'/0'/0`). `sncast` provides two extensions to make them more user-friendly.\n\n### Using Non-Numerical Strings\n\nThe `layer` and `application` levels are defined in EIP-2645 as hashes of names. Instead of manually computing those hashes, `sncast` lets you write the names directly:\n\n```\nm/2645'/starknet'/sncast'/0'/0'/0\n```\n\n`sncast` automatically converts the string segments into their SHA-256-derived numeric values. The hash of `\"starknet\"` is `1195502025`, so the two forms below are equivalent:\n\n```\nm/2645'/starknet'/sncast'/0'/0'/0\nm/2645'/1195502025'/355113700'/0'/0'/0\n```\n\n> 📝 **Note**\n>\n> String-based path segments are an extension of `sncast` and are not understood by other HD wallet tools. To see the resolved derivation path stored for an account, use `sncast account list`, which always displays the canonical numeric form:\n>\n> ```shell\n> $ sncast account list\n> ```\n>\n> ```shell\n> - my_ledger_account:\n>   ledger path: m/2645'/1195502025'/355113700'/0'/1'/0\n>   ...\n> ```\n\n### Omitting the `2645'` Segment\n\nSince `sncast` only works with EIP-2645 paths, the `2645'` prefix can be omitted using the `m//` shorthand:\n\n```\nm//starknet'/sncast'/0'/0'/0\n```\n\nThis is equivalent to `m/2645'/starknet'/sncast'/0'/0'/0`.\n\n## Path Validation Rules\n\n`sncast` enforces these rules when parsing a derivation path:\n\n- Must have exactly 6 levels after `m/`\n- The first level must be `2645'` (or omitted via `m//`)\n- The `layer`, `application`, `eth_address_1`, and `eth_address_2` levels must be hardened (marked with `'`)\n- The `index` level must be a plain number (string names are not allowed here)\n\n## Path Management Best Practices\n\nThe single most important rule is to **document the paths you've used**, especially if you deviate from common patterns.\n\n`sncast` recommends the following convention:\n\n1. Always use `m//starknet'/sncast'/` as the prefix for levels `layer` and `application`\n2. Keep `eth_address_1` fixed at `0'`\n3. Start `eth_address_2` at `0'` for your first account and increment it for each additional account\n4. Keep `index` at `0`\n\nExamples following this convention:\n\n| Account | Path |\n|---------|------|\n| First | `m//starknet'/sncast'/0'/0'/0` |\n| Second | `m//starknet'/sncast'/0'/1'/0` |\n| Third | `m//starknet'/sncast'/0'/2'/0` |\n\n> ️️️️📝 **Note**\n>\n> Some guides suggest incrementing `index` instead of `eth_address_2`. This carries a small security risk: if any single private key in the set is compromised _and_ the attacker obtains the `xpub` key at the `eth_address_2` level, they can derive all sibling keys. Incrementing `eth_address_2` prevents this vulnerability.\n"
  },
  {
    "path": "docs/src/starknet/integration_with_devnet.md",
    "content": "# Integration With Devnet\n\n[`starknet-devnet`](https://0xspaceshard.github.io/starknet-devnet/) is a local Starknet node used for development and testing. `sncast` provides inbuilt support for some of its features, making it easier to work with it.\n\n## Automatic Devnet Detection\n\nYou can use `--network devnet` to automatically detect and connect to a running `starknet-devnet` instance. `sncast` will look for running `starknet-devnet` processes, including those running in Docker/Podman containers, and automatically connect to them.\n\nThis eliminates the need to manually specify the URL when working with devnet.\n\n## Predeployed Accounts\n\nWhen you start `starknet-devnet`, it automatically predeploys some contracts, including set of accounts with known details (read more about them [here](https://0xspaceshard.github.io/starknet-devnet/docs/predeployed)).\n\nYou can use these accounts directly in `sncast` without needing to import them. \nThey are available under specific names - `devnet-1`, `devnet-2`, ..., `devnet-<N>` (where N is the number of predeployed accounts, by default it's 10). \n\n> 📝 **Note**\n>\n> Devnet accounts can't be used together with `sepolia` and `mainnet` values for `--network` flag.\n\n\n### Example\n\nLet's invoke a contract using `devnet-1` account.\n\n```shell\n$ sncast --account devnet-1 invoke \\\n  --contract-address 0x0589a8b8bf819b7820cb699ea1f6c409bc012c9b9160106ddc3dacd6a89653cf \\\n  --function \"get_balance\" --network devnet\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Invoke completed\n\nTransaction Hash: [..]\n\nTo see invocation details, visit:\ntransaction: https://sepolia.voyager.online/tx/[..]\n```\n</details>\n\n> 📝 **Note**\n>\n> If you have an account named `devnet-1` (or any other predeployed account name) in your accounts file, `sncast` will prioritize using that one instead of the inbuilt devnet account.\n"
  },
  {
    "path": "docs/src/starknet/invoke.md",
    "content": "# Invoking Contracts\n\n## Overview\n\nStarknet Foundry `sncast` supports invoking smart contracts on a given network with the `sncast invoke` command.\n\nIn most cases, you have to provide:\n\n- Contract address\n- Function name\n- Function arguments\n\nFor detailed CLI description, see [invoke command reference](../appendix/sncast/invoke.md).\n\n## Examples\n\n### General Example\n\n<!-- TODO(#2736) -->\n<!-- { \"ignored_output\": true } -->\n```shell\n$ sncast \\\n  --account my_account \\\n  invoke \\\n  --network sepolia \\\n  --contract-address 0x522dc7cbe288037382a02569af5a4169531053d284193623948eac8dd051716 \\\n  --function \"add\" \\\n  --arguments 'pokemons::model::PokemonData {'\\\n'name: \"Magmar\",'\\\n'element: pokemons::model::Element::Fire'\\\n'}'\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Invoke completed\n\nTransaction Hash: [..]\n\nTo see invocation details, visit:\ntransaction: https://sepolia.voyager.online/tx/[..]\n```\n</details>\n<br>\n\n> 💡 **Info**\n> Transaction fee limit can be set either as a single upper bound by `--max-fee` or broken down\n> into individual resource components using `--l1-gas`, `--l1-gas-price`, `--l2-gas`,\n> `--l2-gas-price`, `--l1-data-gas`, and `--l1-data-gas-price`.\n> `--max-fee` and the individual resource flags are mutually exclusive.\n> Any individual resource flag that is not provided will be estimated automatically\n\n### Invoking Function Without Arguments\n\nNot every function accepts parameters. Here is how to call it.\n\n```shell\n$ sncast invoke \\\n  --contract-address 0x0589a8b8bf819b7820cb699ea1f6c409bc012c9b9160106ddc3dacd6a89653cf \\\n  --function \"get_balance\"\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Invoke completed\n\nTransaction Hash: [..]\n\nTo see invocation details, visit:\ntransaction: https://sepolia.voyager.online/tx/[..]\n```\n</details>\n"
  },
  {
    "path": "docs/src/starknet/ledger.md",
    "content": "# Ledger Hardware Wallet\n\n`sncast` supports Ledger hardware wallets as a signing device. Use it anywhere a signer is required, or run `sncast ledger` subcommands for device-specific operations.\n\n## Prerequisites\n\n`sncast` communicates with the [Starknet Ledger app](https://github.com/LedgerHQ/app-starknet) running on your device (currently supported version: 2.3.4). Make sure the Starknet app is installed and open before running any `sncast ledger` commands.\n\n> 📝 **Note**\n>\n> As of this writing, the latest version of the Starknet Ledger app only supports blind signing a single hash. While not ideal, it's the most secure signer available.\n\n## Deciding on Wallet Paths\n\nBefore using the Ledger app, you must decide which wallet paths to use with your accounts.\n\nThe Starknet Ledger app requires [EIP-2645 HD paths](./eip-2645-hd-paths.md). Learn more about path management and best practices on the [EIP-2645 HD Paths](./eip-2645-hd-paths.md) page.\n\n## Checking App Version\n\nChecking the app version is a simple way to verify that `sncast` can communicate with your Ledger. With the Starknet app open on the device, run:\n\n<!-- { \"requires_ledger\": true } -->\n```shell\n$ sncast ledger app-version\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nApp Version: 2.3.4\n```\n</details>\n<br>\n\n## Getting Public Key\n\nOnce you've decided on a path, you can read the corresponding public key from your device.\n\n<!-- { \"requires_ledger\": true } -->\n```shell\n$ sncast ledger get-public-key --path \"m//starknet'/sncast'/0'/1'/0\"\n```\n\n> 📝 **Note**\n>\n> Wherever a derivation path is accepted, you can also pass `--account-id` (or `--ledger-account-id` for account commands) instead. An account ID `N` expands to `m//starknet'/sncast'/0'/<N>'/0`.\n\n<!-- { \"requires_ledger\": true } -->\n```shell\n$ sncast ledger get-public-key --account-id 1\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nPublic Key: 0x[..]\n```\n</details>\n<br>\n\nBy default, the public key is shown on the Ledger device for manual confirmation. You can skip this confirmation with `--no-display`:\n\n<!-- { \"requires_ledger\": true } -->\n```shell\n$ sncast ledger get-public-key --account-id 1 --no-display\n```\n\n## Using Ledger as Signer\n\nThe most common use case is controlling Starknet accounts with Ledger. Pass `--ledger-path` or `--ledger-account-id` to `account create` or `account import` to bind the derivation path to the account.\n\n### Derivation Path Binding\n\nWhen an account is created or imported using `--ledger-path` or `--ledger-account-id`, its derivation path is stored in the accounts file (`ledger_path` field). As a result, subsequent commands like invoke, declare, or deploy only require `--account my_ledger_account`, there's no need to specify `--ledger-path` again.\n\n### Creating and Deploying an Account\n\n<!-- { \"requires_ledger\": true } -->\n```shell\n$ sncast \\\n    account create \\\n    --ledger-path \"m//starknet'/sncast'/0'/1'/0\" \\\n    --network sepolia \\\n    --name my_ledger_account\n```\n\n<!-- { \"requires_ledger\": true } -->\n```shell\n$ sncast \\\n    account create \\\n    --ledger-account-id 1 \\\n    --network sepolia \\\n    --name my_ledger_account\n```\n\nThis fetches the public key from the Ledger device at the specified path and calculates the account address. Prefund the address with STRK tokens, then deploy:\n\n<!-- { \"ignored\": true } -->\n```shell\n$ sncast \\\n    --account my_ledger_account \\\n    account deploy \\\n    --network sepolia\n```\n\nA signing confirmation will be shown on the Ledger device. Once approved, the deployment transaction is sent.\n\n### Importing an Existing Account\n\nIf you already have a deployed account managed by your Ledger, you can import it:\n\n<!-- { \"requires_ledger\": true } -->\n```shell\n$ sncast \\\n    account import \\\n    --network sepolia \\\n    --name my_ledger_account \\\n    --address 0x1 \\\n    --ledger-path \"m//starknet'/sncast'/0'/1'/0\" \\\n    --type oz\n```\n\n<!-- { \"requires_ledger\": true } -->\n```shell\n$ sncast \\\n    account import \\\n    --network sepolia \\\n    --name my_ledger_account \\\n    --address 0x1 \\\n    --ledger-account-id 1 \\\n    --type oz\n```\n\n### Sending Transactions\n\nOnce an account is set up, use it with any command that requires signing. A Ledger confirmation will appear on the device for each transaction:\n\n<!-- { \"ignored\": true } -->\n```shell\n$ sncast \\\n    --account my_ledger_account \\\n    invoke \\\n    --network sepolia \\\n    --contract-address 0x1 \\\n    --function \"transfer\" \\\n    --arguments '0x2, u256:100'\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nLedger device will display a confirmation screen — approve it to continue...\n\nSuccess: Invoke completed\n\nTransaction Hash: 0x[..]\n\nTo see invocation details, visit:\ntransaction: https://sepolia.voyager.online/tx/[..]\n```\n</details>\n<br>\n\n## Signing Raw Hashes\n\n> ⚠️ **Warning**\n>\n> Blind signing a raw hash could be dangerous. Make sure you ONLY sign hashes from trusted sources. If you're sending transactions, [use Ledger as a signer](#using-ledger-as-signer) instead of using this command.\n\nYou can sign a single raw hash with your Ledger device:\n\n<!-- { \"requires_ledger\": true } -->\n```shell\n$ sncast ledger sign-hash \\\n    --path \"m//starknet'/sncast'/0'/1'/0\" \\\n    0x0111111111111111111111111111111111111111111111111111111111111111\n```\n\n<!-- { \"requires_ledger\": true } -->\n```shell\n$ sncast ledger sign-hash \\\n    --account-id 1 \\\n    0x0111111111111111111111111111111111111111111111111111111111111111\n```\n\nA confirmation screen will be displayed on the device. Once approved, the signature is printed to the console.\n\n<details>\n<summary>Output:</summary>\n\n```shell\nHash signature:\nr: 0x[..]\ns: 0x[..]\n```\n</details>\n<br>\n"
  },
  {
    "path": "docs/src/starknet/multicall.md",
    "content": "# Performing Multicall\n\nMulticall allows you to execute multiple calls in a single transaction. `sncast` comes with two interfaces:\n- `sncast multicall execute` which allows executing multicall inline using a single command, by passing all calls as CLI arguments (see [`execute`](../appendix/sncast/multicall/execute.md) docs)\n- `sncast multicall run` which uses `.toml` file (see [`run`](../appendix/sncast/multicall/run.md) docs)\n\n> 📝 **Note**\n> Multicall executes only one transaction containing all the prepared calls. This means the fee is paid once.\n\n## Multicall with CLI arguments\n\nYou can prepare and execute multiple calls in a single transaction using CLI arguments. To separate different calls, use `/` as a delimiter.\n\n> 📝 **Note**\n>\n> Currently, `invoke` and `deploy` calls are supported. Their syntax is the same as for `sncast invoke` and `sncast deploy` commands (with additional id argument for deploy calls). For more details on the syntax of these calls, see the [invoke](../appendix/sncast/multicall/execute/invoke.md) and [deploy](../appendix/sncast/multicall/execute/deploy.md) command references.\n\n### Example\n\n```shell\n$ sncast multicall execute \\\n    deploy --id map_contract --class-hash 0x02a09379665a749e609b4a8459c86fe954566a6beeaddd0950e43f6c700ed321 \\\n    / invoke --contract-address @map_contract --function put --calldata 0x1 0x2 \\\n    / invoke --contract-address @map_contract --function put --calldata 0x3 0x4\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Multicall completed\n\nTransaction Hash: 0x[..]\n\nTo see invocation details, visit:\ntransaction: https://sepolia.voyager.online/tx/[..]\n```\n</details>\n<br>\n\n## Using `id` references\n\nSimilarly in both `sncast multicall execute` and `sncast multicall run`, you can assign an identifier to a `deploy` call and then reference its output in later calls.\n\n- In `deploy` calls, set the id (`--id <id>` for CLI / `id = \"<id>\"` in TOML).\n- In later calls, reference it using `@<id>`:\n  - As the `contract address` in `invoke` calls\n  - Inside `deploy`/`invoke` inputs (constructor calldata / calldata), to reference outputs of previous calls\n\n## Multicall with file\n\nYou need to pass `--path` flag with a `.toml` file which contains desired operations that you want to execute.\n\nYou can also compose such config `.toml` file with the `sncast multicall new` command.\n\nFor a detailed CLI description, see the [multicall command reference](../appendix/sncast/multicall/multicall.md).\n\n### Example\n\nLet's consider the following file:\n\n```toml\n[[call]]\ncall_type = \"deploy\"\nclass_hash = \"0x076e94149fc55e7ad9c5fe3b9af570970ae2cf51205f8452f39753e9497fe849\"\ninputs = []\nid = \"map_contract\"\nunique = false\n\n[[call]]\ncall_type = \"invoke\"\ncontract_address = \"@map_contract\"\nfunction = \"put\"\ninputs = [\"0x123\", 234]  # Numbers can be used directly without quotes\n```\n\nAfter running `sncast multicall run --path file.toml`, a declared contract will be first deployed, and then its function `put` will be invoked.\n\n> 💡 **Info**\n> Inputs can be either strings (like `\"0x123\"`) or numbers (like `234`).\n\n> 📝 **Note**\n> For numbers larger than 2^63 - 1 (that can't fit into `i64`), use string format (e.g., `\"9223372036854775808\"`) due to TOML parser limitations.\n\n<!-- TODO: Adjust snippet and check remove ignoring output -->\n<!-- { \"ignored_output\": true } -->\n```shell\n$ sncast multicall run --path multicall_example.toml\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Multicall completed\n\nTransaction Hash: 0x[..]\n\nTo see invocation details, visit:\ntransaction: https://sepolia.voyager.online/tx/[..]\n```\n</details>\n<br>\n\nYou can also generate multicall template with `multicall new` command, specifying output path.\n```shell\n$ sncast multicall new ./template.toml\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Multicall template created successfully\n\nPath:    ./template.toml\nContent: [[call]]\n\ncall_type = \"deploy\"\nclass_hash = \"\"\ninputs = []\nid = \"\"\nunique = false\n\n[[call]]\ncall_type = \"invoke\"\ncontract_address = \"\"\nfunction = \"\"\ninputs = []\n```\n</details>\n<br>\n\n> ⚠️ **Warning**\n> Trying to pass any existing file as an output for `multicall new` will result in error, as the command doesn't overwrite by default.\n> You can use `--overwrite` flag to allow overwriting existing files.\n"
  },
  {
    "path": "docs/src/starknet/script.md",
    "content": "# Cairo Deployment Scripts\n\n## Overview\n\n> ⚠️⚠️⚠️ Highly experimental code, a subject to change ⚠️⚠️⚠️\n\n`sncast` can be used to run deployment scripts written in Cairo, using `script run` subcommand.\nIt aims to provide similar functionality to Foundry's `forge script`.\n\nTo start writing a deployment script in Cairo just add `sncast_std` as a dependency to you scarb package and make sure to\nhave a `main` function in the module you want to run. `sncast_std` docs can be found [here](../appendix/sncast-library.md).\n\nPlease note that **`sncast script` is in development**. While it is already possible to declare, deploy, invoke and call\ncontracts from within Cairo, its interface, internals and feature set can change rapidly each version.\n\n> ⚠️⚠️ By default, the nonce for each transaction is being taken from the pre_confirmed block ⚠️⚠️\n>\n> Some RPC nodes can be configured with higher poll intervals, which means they may return \"older\" nonces\n> in pre_confirmed blocks, or even not be able to obtain pre_confirmed blocks at all. This might be the case if you get\n> an error like \"Invalid transaction nonce\" when running a script, and you may need to manually set both nonce\n> and max_fee for transactions.\n>\n> Example:\n>\n> ```rust\n>      let fee_settings = FeeSettingsTrait::estimate();\n>      let declare_result = declare(\n>        \"Map\",\n>        fee_settings,\n>        Option::Some(nonce)\n>    )\n>        .expect('declare failed');\n> ```\n\nSome of the planned features that will be included in future versions are:\n\n- dispatchers support\n- logging\n- account creation/deployment\n- multicall support\n- dry running the scripts\n\nand more!\n\n## State file\n\nBy default, when you run a script a state file containing information about previous runs will be created. This file\ncan later be used to skip making changes to the network if they were done previously.\n\nTo determine if an operation (a function like declare, deploy or invoke) has to be sent to the network, the script will\nfirst check if such operation with given arguments already exists in state file. If it does, and previously ended with\na success, its execution will be skipped. Otherwise, sncast will attempt to execute this function, and will write its status\nto the state file afterwards.\n\nTo prevent sncast from using the state file, you can set [the --no-state-file flag](../appendix/sncast/script/run.md#--no-state-file).\n\nA state file is typically named in a following manner:\n\n```\n{script name}_{network name}_state.json\n```\n\n## Suggested directory structures\n\nAs sncast scripts are just regular scarb packages, there are multiple ways to incorporate scripts into your existing scarb workspace.\nMost common directory structures include:\n\n### 1. `scripts` directory with all the scripts in the same workspace with cairo contracts (default for `sncast script init`)\n\n```shell\n$ tree\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\n.\n├── scripts\n│   └── my_script\n│       ├── Scarb.toml\n│       └── src\n│           ├── my_script.cairo\n│           └── lib.cairo\n├── src\n│   ├── my_contract.cairo\n│   └── lib.cairo\n└── Scarb.toml\n```\n</details>\n<br>\n\n> 📝 **Note**\n> You should add `scripts` to `members` field in your top-level Scarb.toml to be able to run the script from\n> anywhere in the workspace - otherwise you will have to run the script from within its directory. To learn more consult\n> [Scarb documentation](https://docs.swmansion.com/scarb/docs/reference/workspaces.html#members).\n\nYou can also have multiple scripts as separate packages, or multiple modules inside one package, like so:\n\n#### 1a. multiple scripts in one package\n\n```shell\n$ tree\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\n.\n├── scripts\n│   └── my_script\n│       ├── Scarb.toml\n│       └── src\n│           ├── my_script1.cairo\n│           ├── my_script2.cairo\n│           └── lib.cairo\n├── src\n│   ├── my_contract.cairo\n│   └── lib.cairo\n└── Scarb.toml\n```\n</details>\n<br>\n\n#### 1b. multiple scripts as separate packages\n\n```shell\n$ tree\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\n.\n├── scripts\n│   ├── Scarb.toml\n│   ├── first_script\n│   │   ├── Scarb.toml\n│   │   └── src\n│   │       ├── first_script.cairo\n│   │       └── lib.cairo\n│   └── second_script\n│       ├── Scarb.toml\n│       └── src\n│           ├── second_script.cairo\n│           └── lib.cairo\n├── src\n│   ├── my_contract.cairo\n│   └── lib.cairo\n└── Scarb.toml\n```\n</details>\n<br>\n\n#### 1c. single script with flat directory structure\n\n```shell\n$ tree\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\n.\n├── Scarb.toml\n├── scripts\n│   ├── Scarb.toml\n│   └── src\n│       ├── my_script.cairo\n│       └── lib.cairo\n└── src\n    └── lib.cairo\n```\n</details>\n<br>\n\n### 2. scripts disjointed from the workspace with cairo contracts\n\n```shell\n$ tree\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\n.\n├── Scarb.toml\n└── src\n    ├── lib.cairo\n    └── my_script.cairo\n```\n</details>\n<br>\n\nIn order to use this directory structure you must set any contracts you're using as dependencies in script's Scarb.toml,\nand override `build-external-contracts` property to build those contracts. To learn more consult [Scarb documentation](https://docs.swmansion.com/scarb/docs/extensions/starknet/contract-target.html#compiling-external-contracts).\n\nThis setup can be seen in action in [Full Example below](#full-example-with-contract-deployment).\n\n## Examples\n\n### Initialize a script\n\nTo get started, a deployment script with all required elements can be initialized using the following command:\n\n```shell\n$ sncast script init my_script\n```\n\nFor more details, see [init command](../appendix/sncast/script/init.md).\n\n> 📝 **Note**\n> To include a newly created script in an existing workspace, it must be manually added to the members list in the `Scarb.toml` file, under the defined workspace.\n> For more detailed information about workspaces, please refer to the [Scarb documentation](https://docs.swmansion.com/scarb/docs/reference/workspaces.html).\n\n### Minimal Example (Without Contract Deployment)\n\nThis example shows how to call an already deployed contract. Please find full example with contract deployment [here](#full-example-with-contract-deployment).\n\n```rust\n{{#include ../../listings/basic_example/src/basic_example.cairo}}\n```\n\nThe script should be included in a Scarb package. The directory structure and config for this example looks like this:\n\n```shell\n$ tree\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\n.\n├── src\n│   ├── my_script.cairo\n│   └── lib.cairo\n└── Scarb.toml\n```\n</details>\n<br>\n\n```toml\n[package]\nname = \"my_script\"\nversion = \"0.1.0\"\n\n[dependencies]\nstarknet = \">=2.8.0\"\nsncast_std = \"0.33.0\"\n```\n\nTo run the script, do:\n\n<!-- TODO(#2736) -->\n<!-- { \"ignored_output\": true } -->\n```shell\n$ sncast \\\n  script run my_script\n  --network sepolia\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCallResult { data: [0, 96231036770510887841935600920878740513, 16] }\ncommand: script run\nstatus: success\n```\n</details>\n\n### Full Example (With Contract Deployment)\n\nThis example script declares, deploys and interacts with an example `MapContract`:\n\n```rust\n{{#include ../../listings/map3/src/lib.cairo}}\n```\n\nWe prepare a script:\n\n```rust\n{{#include ../../listings/full_example/src/full_example.cairo}}\n```\n\nThe script should be included in a Scarb package. The directory structure and config for this example looks like this:\n\n```shell\n$ tree\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\n.\n├── contracts\n│    ├── Scarb.toml\n│    └── src\n│        └── lib.cairo\n└── scripts\n    ├── Scarb.toml\n    └── src\n        ├── lib.cairo\n        └── map_script.cairo\n```\n</details>\n<br>\n\n```toml\n[package]\nname = \"map_script\"\nversion = \"0.1.0\"\n\n[dependencies]\nstarknet = \">=2.8.0\"\nsncast_std = \"0.33.0\"\nmap = { path = \"../contracts\" }\n\n[lib]\nsierra = true\n\n[[target.starknet-contract]]\nbuild-external-contracts = [\n    \"map::MapContract\"\n]\n```\n\nPlease note that `map` contract was specified as the dependency. In our example, it resides in the filesystem. To generate the artifacts for it that will be accessible from the script you need to use the `build-external-contracts` property.\n\nTo run the script, do:\n\n<!-- { \"ignored_output\": true } -->\n```shell\n$ sncast \\\n  --account example_user \\\n  script run map_script \\\n  --network sepolia\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nClass hash of the declared contract: 685896493695476540388232336434993540241192267040651919145140488413686992233\n...\nDeployed the contract to address: 2993684914933159551622723238457226804366654523161908704282792530334498925876\n...\nInvoke tx hash is: 2455538849277152825594824366964313930331085452149746033747086127466991639149\nCall result: [2]\n\ncommand: script run\nstatus: success\n```\n</details>\n<br>\n\nAs [an idempotency](#state-file) feature is turned on by default, executing the same script once again ends with a success\nand only `call` functions are being executed (as they do not change the network state):\n\n<!-- { \"ignored_output\": true } -->\n```shell\n$ sncast \\\n  --account example_user \\\n  script run map_script \\\n  --network sepolia\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nClass hash of the declared contract: 1922774777685257258886771026518018305931014651657879651971507142160195873652\nDeployed the contract to address: 3478557462226312644848472512920965457566154264259286784215363579593349825684\nInvoke tx hash is: 1373185562410761200747829131886166680837022579434823960660735040169785115611\nCall result: [2]\ncommand: script run\nstatus: success\n```\n</details>\n<br>\n\n\nwhereas, when we run the same script once again with `--no-state-file` flag set, it fails (as the `Map` contract is already deployed):\n\n<!-- { \"ignored_output\": true } -->\n```shell\n$ sncast \\\n  --account example_user \\\n  script run map_script \\\n  --network sepolia \\\n  --no-state-file\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Script execution completed\n\nStatus: script panicked\n\n\n    0x6d6170206465706c6f79206661696c6564 ('map deploy failed')\n```\n</details>\n<br>\n\n### Fee settings\n\nPassing fee settings is possible in a few different ways:\n\n### Using auto estimation:\n\n```rust\nlet fee_settings = FeeSettingsTrait::estimate();\n```\n\n### Manually setting the resource bounds (denoted in FRI):\n\n```rust\nlet fee_settings = FeeSettingsTrait::resource_bounds(\n  100000, // l1 gas\n  10000000000000, // l1 gas price\n  1000000000, // l2 gas\n  100000000000000000000, // l2 gas price\n  100000, // l1 data gas\n  10000000000000, // l1 data gas price\n);\n```\n\n### Specifying the maximum fee (denoted in FRI):\n\n```rust\nlet fee_settings = FeeSettingsTrait::max_fee(100000000000000000000);\n```\n\n## Error handling\n\nEach of `declare`, `deploy`, `invoke`, `call` functions return `Result<T, ScriptCommandError>`, where `T` is a corresponding response struct.\nThis allows for various script errors to be handled programmatically.\nScript errors implement `Debug` trait, allowing the error to be printed to stdout.\n\n### Minimal example with `assert!` and `println!`\n\n```rust\n{{#include ../../listings/error_handling/src/error_handling.cairo}}\n```\n\nMore on deployment scripts errors [here](../appendix/sncast-library/errors.md).\n"
  },
  {
    "path": "docs/src/starknet/show_config.md",
    "content": "# Printing Current Configuration\n\n## Overview\n\nSometimes, before executing any other `sncast` command, one may want to make sure that the right\nconfiguration settings are being used (eg proper network or account is used).\n\nTo see just that, a `show-config` subcommand can be used. You can just\nreplace any subcommand (and its parameters) with `show-config` and it will show currently used configuration.\n\n\n## Examples\n\n### General Example\n\n```shell\n$ sncast \\\n  --account my_account \\\n  show-config \n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nChain ID:            alpha-sepolia\nRPC URL:             http://127.0.0.1:5055/rpc\nAccount:             my_account\nAccounts File Path:  [..]/accounts.json\nWait Timeout:        300s\nWait Retry Interval: 5s\nShow Explorer Links: true\n```\n</details>\n<br>"
  },
  {
    "path": "docs/src/starknet/sncast-overview.md",
    "content": "# `sncast` Overview\n\nStarknet Foundry `sncast` is a command line tool for performing Starknet RPC calls. With it, you can easily interact with Starknet contracts!\n\n> ⚠️ **Warning**\n> Currently, support is only provided for accounts that use the default signature based on the [Stark curve](https://docs.starknet.io/learn/protocol/cryptography#the-stark-curve).\n\n## How to Use `sncast`\n\nTo use `sncast`, run the `sncast` command followed by a subcommand (see [available commands](../appendix/sncast.md)):\n\n<!-- { \"ignored\": true } -->\n```shell\n$ sncast <subcommand>\n```\n\nIf `snfoundry.toml` is present and configured with `[sncast.default]`, `url`, `accounts-file` and `account` name will be taken from it.\nYou can, however, overwrite their values by supplying them as flags directly to `sncast` cli.\n\n> 💡 **Info**\n> Some transactions (like declaring, deploying or invoking) require paying a fee, and they must be signed.\n\n## Examples\n\n### General Example\n\nLet's use `sncast` to call a contract's function:\n\n<!-- TODO(#2736) -->\n<!-- { \"ignored\": true } -->\n```shell\n$ sncast \\\n    call \\\n    --network sepolia \\\n    --contract-address 0x522dc7cbe288037382a02569af5a4169531053d284193623948eac8dd051716 \\\n    --function \"pokemon\" \\\n    --arguments '\"Charizard\"' \\\n    --block-id latest\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Call completed\n\nResponse: [0x0, 0x0, 0x43686172697a617264, 0x9, 0x0, 0x0, 0x41a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf]\n```\n</details>\n<br>\n\n> 📝 **Note**\n> In the above example we supply `sncast` with `--account` flag. If `snfoundry.toml` is present, and have this property set, value provided using this flags will override value from `snfoundry.toml`. Learn more about `snfoundry.toml` configuration [here](../projects/configuration.md#sncast).\n\n### Network and RPC Providers\n\nThe `--network` flag supports the following networks:\n\n- **mainnet** - Connects to Starknet mainnet using a free RPC provider\n- **sepolia** - Connects to Starknet Sepolia testnet using a free RPC provider\n- **devnet** - Attempts to auto-detect running starknet-devnet instance\n\n> 📝 **Note**\n> When using **mainnet** or **sepolia**, `sncast` will randomly select one of the free RPC providers.\n> When using free providers you may experience rate limits and other unexpected behavior.\n\nFor **devnet**, `sncast` will try to detect running `starknet-devnet` instance and connect to it, but detection is not guaranteed. If `sncast` is unable to detect your devnet instance, provide the `--url` directly.\n\nIf using `sncast` extensively, we recommend getting access to a dedicated RPC node and providing its URL to sncast with\n`--url` flag.\n\n> 📝 **Note**\n> You can configure URLs for predefined networks (used by the `--network` flag) in `snfoundry.toml` profiles. Read more in [snfoundry.toml Reference](../appendix/snfoundry-toml.md#sncastprofile-namenetworks).\n\n### Arguments\n\nSome `sncast` commands (namely `call`, `deploy` and `invoke`) allow passing arguments to perform an action with on the blockchain.\n\nUnder the hood `sncast` always sends request with a serialized form of arguments, but it can be passed in \nhuman-readable form thanks to the [calldata transformation](./calldata-transformation.md) feature present in `sncast`.\n\nIn the example above we called a function with a deserialized argument: `'\"Charizard\"'`, passed using `--arguments` flag.\n\n> ⚠️ **Warning**\n> `sncast` will not verify the serialized calldata. Any errors caused by passing improper calldata in a serialized form will originate from the network.\n> Basic static analysis is possible only when passing expressions - see [calldata transformation](./calldata-transformation.md).\n\n\n### Using Serialized Calldata\n\nThe same result can be achieved by passing serialized calldata, which is a list of hexadecimal-encoded field elements.\n\nFor example, this is equivalent to using the `--calldata` option with the following value: `0x0 0x43686172697a617264 0x9`.\n\nTo obtain the serialized form of the wished data, you can write a Cairo program that calls `Serde::serialize` on subsequent arguments and displays the results.\n\nRead more about it in the [Cairo documentation](https://www.starknet.io/cairo-book/appendix-03-derivable-traits.html#serializing-with-serde).\n\n### How to Use `--wait` Flag\n\nLet's invoke a transaction and wait for it to be `ACCEPTED_ON_L2`.\n\n<!-- { \"ignored_output\": true } -->\n```shell\n$ sncast --account my_account \\\n    --wait \\\n    deploy \\\n\t--network sepolia \\\n    --class-hash 0x0227f52a4d2138816edf8231980d5f9e6e0c8a3deab45b601a1fcee3d4427b02 \\\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nTransaction hash: [..]\nWaiting for transaction to be received. Retries left: 11\nWaiting for transaction to be received. Retries left: 10\nWaiting for transaction to be received. Retries left: 9\nWaiting for transaction to be received. Retries left: 8\nWaiting for transaction to be received. Retries left: 7\nReceived transaction. Status: Pre confirmed\nReceived transaction. Status: Pre confirmed\nReceived transaction. Status: Pre confirmed\nReceived transaction. Status: Pre confirmed\nReceived transaction. Status: Pre confirmed\nReceived transaction. Status: Pre confirmed\nSuccess: Deployment completed\n\nContract Address: 0x0[..]\nTransaction Hash: 0x0[..]\n\nTo see deployment details, visit:\ncontract: https://voyager.online/search/[..]\ntransaction: https://voyager.online/search/[..]\n```\n</details>\n<br>\n\nAs you can see command waited for the transaction until it was `ACCEPTED_ON_L2`.\n\nAfter setting up the `--wait` flag, command waits 60 seconds for a transaction to be received and (another not specified\namount of time) to be included in the block.\n\n> 📝 **Note**\n> By default, all commands don't wait for transactions.\n"
  },
  {
    "path": "docs/src/starknet/tx-status.md",
    "content": "# Inspecting Transactions\n\n## Overview\n\nStarknet Foundry `sncast` supports the inspection of transaction statuses on a given network with the `sncast get tx-status` command.\n\nFor a detailed CLI description, refer to the [get tx-status command reference](../appendix/sncast/get/tx-status.md).\n\n## Usage Examples\n\n### Inspecting Transaction Status\n\nYou can track the details about the execution and finality status of a transaction in the given network by using the transaction hash as shown below:\n\n```shell\n$ sncast \\\n get tx-status \\\n 0x07d2067cd7675f88493a9d773b456c8d941457ecc2f6201d2fe6b0607daadfd1 \\\n --network sepolia\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nSuccess: Transaction status retrieved\n\nFinality Status:  Accepted on L1\nExecution Status: Succeeded\n```\n\n</details>\n"
  },
  {
    "path": "docs/src/starknet/verify.md",
    "content": "# Verifying Contracts\n\n## Overview\n\nStarknet Foundry `sncast` supports verifying Cairo contract classes with the `sncast verify` command by submitting the source code to a selected verification provider. Verification provides transparency, making the code accessible to users and aiding debugging tools.\n\nThe verification provider guarantees that the submitted source code aligns with the deployed contract class on the network by compiling the source code into Sierra bytecode and comparing it with the network-deployed Sierra bytecode.\n\nFor detailed CLI description, see [verify command reference](../appendix/sncast/verify.md).\n\n> ⚠️ **Warning**\n> Please be aware that submitting the source code means it will be publicly exposed through the provider's APIs.\n\n## Verification Providers\n\n### Walnut\n\nWalnut is a tool for step-by-step debugging of Starknet transactions. You can learn more about Walnut here [walnut.dev](https://walnut.dev). Note that Walnut requires you to specify the Starknet version in your `Scarb.toml` config file.\n\n### Voyager\n\n[Voyager](https://voyager.online) is a Starknet block explorer that provides contract verification services. It allows you to verify your contracts and make their source code publicly available on the explorer. Voyager supports both mainnet and testnet (Sepolia) networks.\n\n## Examples\n\nFirst, ensure that you have created a `Scarb.toml` file for your contract (it should be present in the project directory or one of its parent directories). Make sure the contract has already been deployed on the network.\n\n### Using Walnut\n\n<!-- { \"ignored_output\": true, \"replace_network\": false } -->\n```shell\n$ sncast \\\n    verify \\\n    --class-hash 0x031966c9fe618bcee61d267750b9d46e3d71469e571e331f35f0ca26efe306dc \\\n    --contract-name SimpleBalance \\\n    --verifier walnut \\\n    --network sepolia\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\n\n    You are about to submit the entire workspace code to the third-party verifier at walnut.\n\n    Important: Make sure your project does not include sensitive information like private keys.\n\n    Are you sure you want to proceed? (Y/n): Y\n\nSuccess: Verification completed\n\nContract successfully verified\n```\n\n</details>\n\n### Using Voyager\n\n<!-- { \"ignored_output\": true, \"replace_network\": false } -->\n```shell\n$ sncast \\\n    verify \\\n    --class-hash 0x031966c9fe618bcee61d267750b9d46e3d71469e571e331f35f0ca26efe306dc \\\n    --contract-name SimpleBalance \\\n    --verifier voyager \\\n    --network sepolia\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\n\n    You are about to submit the entire workspace code to the third-party verifier at voyager.\n\n    Important: Make sure your project's Scarb.toml does not include sensitive information like private keys.\n\n    Are you sure you want to proceed? (Y/n): Y\n\nSuccess: Verification completed\n\nSimpleBalance submitted for verification, you can query the status at: https://sepolia-api.voyager.online/beta/class-verify/job/[..]\n```\n\n</details>\n<br>\n\n> 📝 **Note**\n> Contract name is a part after the `mod` keyword in your contract file. It may differ from package name defined in `Scarb.toml` file.\n"
  },
  {
    "path": "docs/src/testing/contract-collection/new-mechanism.md",
    "content": "# How Contracts Are Collected\n\nFor the [`declare`](../../appendix/snforge-library/declare.md) to work, snforge must collect and call build on\ncontracts in the package. By default, snforge will combine test\ncollection and contract collection steps.\n\nWhen running `snforge test`, snforge will, under the hood, call the `scarb build --test` command. This command builds\nall the test and contracts along them. Snforge collects these contracts and makes them available for declaring in tests.\n\nContracts are collected from both `src` and `tests` directory, including modules marked with `#[cfg(test)]`.\nInternally, snforge collects contracts from all `[[test]]` targets compiled by Scarb.\nYou can read more about that in [test collection](../test-collection.md) documentation.\n\n## Collection Order\n\nWhen multiple `[[test]]` targets are present, snforge will first try to collect contracts from `integration` `test-type`\ntarget. If `integration` is not present, snforge will first collect contracts from the first encountered `[[test]]`\ntarget.\n\nAfter collecting from initial `[[test]]` target, snforge will collect contracts from any other encountered targets.\nNo specific order of collection is guaranteed.\n\n> 📝 **Note**\n>\n> If multiple contracts with the same name are present, snforge will use the first encountered implementation and will\n> not collect others.\n\n## Using External Contracts in Tests\n\nTo use contract from dependencies in tests, `Scarb.toml` must be updated to include these contracts under\n`[[target.starknet-contract]]`.\n\n```toml\n[[target.starknet-contract]]\nbuild-external-contracts = [\"path::to::Contract1\", \"other::path::to::Contract2\"]\n```\n\nFor more information about `build-external-contracts`,\nsee [Scarb documentation](https://docs.swmansion.com/scarb/docs/extensions/starknet/contract-target.html#compiling-external-contracts).\n"
  },
  {
    "path": "docs/src/testing/contract-collection/old-mechanism.md",
    "content": "# How Contracts Are Collected\n\nWhen you call `snforge test`, one of the things that `snforge` does is that it calls Scarb, particularly `scarb build`.\nIt makes Scarb build all contracts from your package and save them to the `target/{current_profile}` directory\n(read more on [Scarb website](https://docs.swmansion.com/scarb/docs/extensions/starknet/contract-target.html)).\n\nThen, `snforge` loads compiled contracts from the package your tests are located, allowing you to declare the contracts\nin\ntests.\n\nOnly contracts from `src/` directory are loaded. Contracts from `/tests` and modules marked with `#[cfg(test)]` are not\nbuild or collected. To create contracts to be specifically used in tests, [Scarb conditional compilation](https://docs.swmansion.com/scarb/docs/reference/conditional-compilation.html#features) can be used.\n\n> ⚠️ **Warning**\n>\n> Make sure to define `[[target.starknet-contract]]` section in your `Scarb.toml`, otherwise Scarb won't build your\n> contracts.\n\n## Using External Contracts In Tests\n\nIf you wish to use contracts from your dependencies inside your tests (e.g. an ERC20 token, an account contract),\nyou must first make Scarb build them. You can do that by using `build-external-contracts` key in `Scarb.toml`,\ne.g.:\n\n```toml\n[[target.starknet-contract]]\nbuild-external-contracts = [\"openzeppelin::account::account::Account\"]\n```\n\nFor more information about `build-external-contracts`,\nsee [Scarb documentation](https://docs.swmansion.com/scarb/docs/extensions/starknet/contract-target.html#compiling-external-contracts).\n"
  },
  {
    "path": "docs/src/testing/contracts-collection.md",
    "content": "# How Contracts Are Collected\n\n`snforge` supports two mechanisms for collecting contracts used in tests.\n\n- By default, [optimized collection mechanism](contract-collection/new-mechanism.md) is used.\n- If running `snforge test` with `--no-optimization` flag, the [old collection mechanism](contract-collection/old-mechanism.md) is used.\n\n## Differences Between Collection Mechanisms\n\n| Feature                                                 | Old Mechanism | Optimised Mechanism |\n|---------------------------------------------------------|---------------|---------------------|\n| Using contracts from `/src`                             | ✅             | ✅                   |\n| Using contracts from `/tests`                           | ❌             | ✅                   |\n| Using contracts from modules marked with `#[cfg(test)]` | ❌             | ✅                   |\n| Using contracts from dependencies                       | ✅             | ✅                   |\n| Contracts more closely resemble ones from real network  | ✅             | ❌                   |\n| Less compilation steps required (faster compilation)    | ❌             | ✅                   |\n| Additional compilation step required (`scarb build`)    | ✅             | ❌                   |\n"
  },
  {
    "path": "docs/src/testing/contracts.md",
    "content": "# Testing Smart Contracts\n\n> ℹ️ **Info**\n>\n> To use the library functions designed for testing smart contracts,\n> you need to add `snforge_std` package as a dependency in\n> your [`Scarb.toml`](https://docs.swmansion.com/scarb/docs/guides/dependencies.html#development-dependencies)\n> using the appropriate version.\n>```toml\n> [dev-dependencies]\n> snforge_std = \"{{snforge_std_version}}\"\n> ```\n\nUsing unit testing as much as possible is a good practice, as it makes your test suites run faster. However, when\nwriting smart contracts, you often want to test their interactions with the blockchain state and with other contracts.\n\n## The Test Contract\n\nLet's consider a simple smart contract with two methods.\n\n```rust\n{{#include ../../listings/testing_smart_contracts_writing_tests/src/lib.cairo}}\n```\n\nNote that the name after `mod` will be used as the contract name for testing purposes.\n\n## Writing Tests\n\nLet's write a test that will deploy the `SimpleContract` contract and call some functions.\n\n```rust\n{{#include ../../listings/testing_smart_contracts_writing_tests/tests/simple_contract.cairo}}\n```\n\n```shell\n$ snforge test\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 1 test(s) from testing_smart_contracts_writing_tests package\nRunning 0 test(s) from src/\nRunning 1 test(s) from tests/\n[PASS] testing_smart_contracts_writing_tests_integrationtest::simple_contract::call_and_invoke (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~513510)\nTests: 1 passed, 0 failed, 0 ignored, 0 filtered out\n```\n</details>\n<br>\n\n## Passing Constructor Arguments\n\nThe previous example was a basic one. However, sometimes you may need to pass arguments to contract's constructor. This can be done in two ways:\n- With manual serialization\n- With `deploy_for_test` function (available since Cairo 2.12)\n\nLet's compare both approaches.\n\n### Test Contract\n\nBelow contract simulates a basic shopping cart. Its constructor takes initial products which are vector of `Product` structs.\n\n```rust\n{{#include ../../listings/deployment_with_constructor_args/src/lib.cairo}}\n```\n\n### Deployment with `deploy_for_test`\n\n`deploy_for_test` is an utility function that simplifies the deployment process by automatically handling serialization of constructor parameters.\n\n```rust\n{{#include ../../listings/deployment_with_constructor_args/tests/test_with_deploy_for_test.cairo}}\n```\n\n### Deployment with Manual Serialization\n\nIn this case we need to manually serialize the constructor parameters and pass them as calldata to the `deploy` function.\n\n```rust\n{{#include ../../listings/deployment_with_constructor_args/tests/test_with_serialization.cairo}}\n```\n\n## Handling Errors\n\nSometimes we want to test contracts functions that can panic, like testing that function that verifies caller address\npanics on invalid address. For that purpose Starknet also provides a `SafeDispatcher`, that returns a `Result` instead of\npanicking.\n\nFirst, let's add a new, panicking function to our contract.\n\n```rust\n{{#include ../../listings/testing_smart_contracts_handling_errors/src/lib.cairo}}\n```\n\nIf we called this function in a test, it would result in a failure.\n\n```rust\n{{#include ../../listings/testing_smart_contracts_handling_errors/tests/panic.cairo:first_half}}\n{{#include ../../listings/testing_smart_contracts_handling_errors/tests/panic.cairo:second_half}}\n```\n\n```shell\n$ snforge test\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 2 test(s) from testing_smart_contracts_handling_errors package\nRunning 2 test(s) from tests/\n[FAIL] testing_smart_contracts_handling_errors_integrationtest::panic::failing\n\nFailure data:\n    (0x50414e4943 ('PANIC'), 0x444159544148 ('DAYTAH'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\n[PASS] testing_smart_contracts_handling_errors_integrationtest::handle_panic::handling_string_errors (l1_gas: ~0, l1_data_gas: ~96, l2_gas: ~280000)\nRunning 0 test(s) from src/\nTests: 1 passed, 1 failed, 0 ignored, 0 filtered out\n\nFailures:\n    testing_smart_contracts_handling_errors_integrationtest::panic::failing\n```\n</details>\n<br>\n\n### `SafeDispatcher`\n\nUsing `SafeDispatcher` we can test that the function in fact panics with an expected message.\nSafe dispatcher is a special kind of dispatcher that allows using the contract without automatically unwrapping the result, thereby making possible to catch the error like shown below.\n\n```rust\n{{#include ../../listings/testing_smart_contracts_safe_dispatcher/tests/safe_dispatcher.cairo}}\n```\n\nNow the test passes as expected.\n\n```shell\n$ snforge test\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 1 test(s) from testing_smart_contracts_safe_dispatcher package\nRunning 0 test(s) from src/\nRunning 1 test(s) from tests/\n[PASS] testing_smart_contracts_safe_dispatcher_integrationtest::safe_dispatcher::handling_errors (l1_gas: ~0, l1_data_gas: ~96, l2_gas: ~280000)\nTests: 1 passed, 0 failed, 0 ignored, 0 filtered out\n```\n</details>\n<br>\n\n> 📝 **Note**\n>\n> It is not possible to catch errors that cause immediate termination of execution, e.g. calling a contract with a nonexistent address.\n> A full list of such errors can be found [here](https://community.starknet.io/t/starknet-v0-13-4-pre-release-notes/115257#p-2358763-catching-errors-12).\n\nSimilarly, you can handle the panics which use `ByteArray` as an argument (like an `assert!` or `panic!` macro)\n\n```rust\n{{#include ../../listings/testing_smart_contracts_handling_errors/tests/handle_panic.cairo}}\n```\nYou also could skip the de-serialization of the `panic_data`, and not use `try_deserialize_bytearray_error`, but this way you can actually use assertions on the `ByteArray` that was used to panic.\n\n> 📝 **Note**\n>\n> To operate with `SafeDispatcher` it's required to annotate its usage with `#[feature(\"safe_dispatcher\")]`.\n>\n> There are 3 options:\n> - module-level declaration\n>   ```rust\n>   #[feature(\"safe_dispatcher\")]\n>   mod my_module;\n>   ```\n> - function-level declaration\n>   ```rust\n>   #[feature(\"safe_dispatcher\")]\n>   fn my_function() { ... }\n>   ```\n> - directly before the usage\n>   ```rust\n>   #[feature(\"safe_dispatcher\")]\n>   let result = safe_dispatcher.some_function();\n>   ```\n\n### Expecting Test Failure\n\nSometimes the test code failing can be a desired behavior.\nInstead of manually handling it, you can simply mark your test as `#[should_panic(...)]`.\n[See here](./testing.md#expected-failures) for more details.\n"
  },
  {
    "path": "docs/src/testing/coverage.md",
    "content": "# Coverage\n\nCoverage reporting allows developers to gain comprehensive insights into how their code is executed.\nWith `cairo-coverage`, you can generate a coverage report that can later be analyzed for detailed coverage statistics.\n\n## Prerequisites\n\n`cairo-coverage` relies on debug information provided by Scarb. \nTo generate the necessary debug information, you need to have `Scarb.toml` file with the following Cairo compiler configuration:\n\n```toml\n[profile.dev.cairo]\nunstable-add-statements-code-locations-debug-info = true\nunstable-add-statements-functions-debug-info = true\ninlining-strategy = \"avoid\"\n```\n\n> 📝 **Note**\n>\n> That `unstable-add-statements-code-locations-debug-info = true` and\n`unstable-add-statements-functions-debug-info = true` will slow down the compilation and cause it to use more system\n> memory. It will also make the compilation artifacts larger. So it is only recommended to add these flags when you need\n> their functionality.\n\nFor more information about these sections, please refer to the [Scarb documentation](https://docs.swmansion.com/scarb/docs/reference/manifest.html#cairo).\n\n## Installation and usage\n\nIn order to run coverage report with `cairo-coverage` you need to install it first. \nPlease refer to the instructions provided in the README for guidance:\n<https://github.com/software-mansion/cairo-coverage#installation>\n\nUsage details and limitations are also described there - make sure to check it out as well.  \n\n## Integration with [cairo-coverage](https://github.com/software-mansion/cairo-coverage)\n\n`snforge` is able to produce a file with a trace for each passing test (excluding fuzz tests).\nAll you have to do is use the [`--save-trace-data`](../appendix/snforge/test.md#--save-trace-data) flag:\n\n```shell\n$ snforge test --save-trace-data\n```\n\nThe files with traces will be saved to `snfoundry_trace` directory. Each one of these files can then be used as an input\nfor the [cairo-coverage](https://github.com/software-mansion/cairo-coverage).\n\nIf you want `snforge` to call `cairo-coverage` on generated files automatically, use [`--coverage`](../appendix/snforge/test.md#--coverage) flag:\n\n```shell\n$ snforge test --coverage\n```\n\nThis will generate a coverage report in the `coverage` directory named `coverage.lcov`.\n\n## Passing arguments to `cairo-coverage`\n\nYou can pass additional arguments to `cairo-coverage` by using the `--` separator. Everything after `--` will be passed\nto `cairo-coverage`:\n\n```shell\n$ snforge test --coverage -- --include macros\n```\n\n> 📝 **Note**\n> \n> Running `snforge test --help` won't show info about `cairo-coverage` flags. To see them, run `snforge test --coverage -- --help`.\n\n## Coverage report\n\n`cairo-coverage` generates coverage data as an `.lcov` file. A summary report with aggregated data can be produced by one of many tools that accept the `lcov` format.\nIn this example we will use the `genhtml` tool from the [lcov package](https://github.com/linux-test-project/lcov/tree/master) to generate an HTML report.\n\nRun the following command in the directory containing your `coverage.lcov` file:\n\n```shell\n$ genhtml -o coverage_report coverage.lcov\n```\n\nYou can now open the `index.html` file in the `coverage_report` directory to see the generated coverage report."
  },
  {
    "path": "docs/src/testing/gas-and-resource-estimation.md",
    "content": "# Gas and VM Resources Estimation\n\n`snforge` supports gas and VM resources estimation for each individual test case.\n\nIt does not calculate the final transaction fee, for details on how fees are calculated, \nplease refer to fee mechanism in [Starknet documentation](https://docs.starknet.io/learn/protocol/fees#overview).\n\n## Gas Estimation\n\n### Single Test\n\nWhen the test passes with no errors, estimated gas is displayed this way:\n```shell\n[PASS] tests::simple_test (l1_gas: ~1, l1_data_gas: ~1, l2_gas: ~1)\n```\n\nThis gas calculation is based on the collected Sierra gas or VM resources (that you can [display additionally on demand](#usage)),\nstorage updates, events and l1 <> l2 messages.\n\n#### Gas Report\n\nFor individual tests, more detailed L2 gas usage can be displayed by passing the [`--gas-report`](../appendix/snforge/test.md#--gas-report) flag.\nThis will generate a table that shows gas statistics for each contract and function.\n\n<!-- { \"ignored\": true } -->\n```shell\n$ snforge test --gas-report\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 1 test(s) from hello_starknet package\nRunning 1 test(s) from tests/\n[PASS] hello_starknet_integrationtest::test_contract::test_increase_balance (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~998280)\n╭------------------------+-------+-------+-------+---------+---------╮\n| HelloStarknet Contract |       |       |       |         |         |\n+====================================================================+\n| Function Name          | Min   | Max   | Avg   | Std Dev | # Calls |\n|------------------------+-------+-------+-------+---------+---------|\n| get_balance            | 13340 | 13340 | 13340 | 0       | 4       |\n|------------------------+-------+-------+-------+---------+---------|\n| increase_balance       | 25540 | 61240 | 37440 | 16829   | 3       |\n╰------------------------+-------+-------+-------+---------+---------╯\n```\n\n</details>\n<br>\n\n> 📝 **Note**\n>\n> Gas report data calculation ignores state changes, the cost of declared classes, Starknet OS overhead, L1 handler payload length and calldata payload length.\n\n### Fuzzed Tests\n\nWhile using the fuzzing feature additional gas statistics will be displayed:\n```shell\n[PASS] tests::fuzzing_test (runs: 256, l1_gas: {max: ~126, min: ~1, mean: ~65, std deviation: ~37}, l1_data_gas: {max: ~96, min: ~96, mean: ~96, std deviation: ~0}, l2_gas: {max: ~1888390, min: ~1852630, mean: ~1881888, std deviation: ~9322}})\n```\n\n> 📝 **Note**\n>  \n> Starknet-Foundry uses blob-based gas calculation formula in order to calculate gas usage. \n> For details on the exact formula, [see the docs](https://docs.starknet.io/learn/protocol/fees#overall-fee).\n\n## Resources Estimation \n\nIt is possible to enable more detailed breakdown of resources, on which the gas calculations are based on.\nDepending on `--tracked-resource`, vm resources or sierra gas will be displayed (by default, Sierra gas is used).\nTo learn more about the tracked resource flag, see [--tracked-resource](../appendix/snforge/test.md#--tracked-resource).\n\n### Usage\nIn order to run tests with this feature, run the `test` command with the `--detailed-resources` flag:\n\n```shell\n$ snforge test --detailed-resources\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 2 test(s) from hello_starknet package\nRunning 2 test(s) from tests/\n[PASS] hello_starknet_integrationtest::test_contract::test_cannot_increase_balance_with_zero_value (l1_gas: ~0, l1_data_gas: ~96, l2_gas: ~406680)\n        sierra gas: 406680\n        syscalls: (CallContract: 2, Deploy: 1, StorageRead: 1)\n        events: (count: 0, keys: 0, data size: 0)\n        messages: (l2 to l1: 0, l1 handler: 0)\n\n[PASS] hello_starknet_integrationtest::test_contract::test_increase_balance (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~511980)\n        sierra gas: 511980\n        syscalls: (CallContract: 3, StorageRead: 3, StorageWrite: 1, Deploy: 1)\n        events: (count: 0, keys: 0, data size: 0)\n        messages: (l2 to l1: 0, l1 handler: 0)\n\nRunning 0 test(s) from src/\nTests: 2 passed, 0 failed, 0 ignored, 0 filtered out\n```\n</details>\n<br>\n\n## Analyzing the results\nNormally in transaction receipt (or block explorer transaction details), you would see some additional OS resources\nthat starknet-foundry does not include for a test (since it's not a normal transaction per-se):\n\n#### Not included in the gas/resource estimations\n- Fee transfer costs\n- Transaction type related resources - in real Starknet additional cost depending on the transaction type (e.g., `Invoke`/`Declare`/`DeployAccount`) is added\n- Declaration gas costs (CASM/Sierra bytecode or ABIs)\n- Call validation gas costs (if you did not call `__validate__` endpoint explicitly)\n- Client side proving costs (when using `proof_facts` in `Invoke` transaction)\n\n#### Included in the gas/resource estimations\n- Cost of syscalls (additional steps or builtins needed for syscalls execution)"
  },
  {
    "path": "docs/src/testing/running-tests.md",
    "content": "# Running Tests\n\nTo run tests with `snforge`, simply run the `snforge test` command from the package directory.\n\n```shell\n$ snforge test\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 3 test(s) from hello_snforge package\nRunning 0 test(s) from src/\nRunning 3 test(s) from tests/\n[PASS] hello_snforge_integrationtest::test_contract::test_calling (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\n[PASS] hello_snforge_integrationtest::test_contract::test_executing (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\n[PASS] hello_snforge_integrationtest::test_contract::test_calling_another (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\nTests: 3 passed, 0 failed, 0 ignored, 0 filtered out\n```\n</details>\n<br>\n\n## Filtering Tests\n\nYou can pass a filter string after the `snforge test` command to filter tests.\nBy default, any test with an [absolute module tree path](https://www.starknet.io/cairo-book/ch07-03-paths-for-referring-to-an-item-in-the-module-tree.html#paths-for-referring-to-an-item-in-the-module-tree) matching the filter will be run.\n\n```shell\n$ snforge test calling\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 2 test(s) from hello_snforge package\nRunning 0 test(s) from src/\nRunning 2 test(s) from tests/\n[PASS] hello_snforge_integrationtest::test_contract::test_calling_another (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\n[PASS] hello_snforge_integrationtest::test_contract::test_calling (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\nTests: 2 passed, 0 failed, 0 ignored, 1 filtered out\n```\n</details>\n<br>\n\n## Running a Specific Test\n\nTo run a specific test, you can pass a filter string along with an `--exact` flag.\nNote, you have to use a fully qualified test name, including a module name.\n\n> 📝 **Note**\n>\n> Running a specific test results in optimized compilation. `snforge` will try to compile only the desired test, unlike the case of running all tests where all of them are compiled.\n>\n\n```shell\n$ snforge test hello_snforge_integrationtest::test_contract::test_calling --exact\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 1 test(s) from hello_snforge package\nRunning 1 test(s) from tests/\n[PASS] hello_snforge_integrationtest::test_contract::test_calling (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\nRunning 0 test(s) from src/\nTests: 1 passed, 0 failed, 0 ignored, other filtered out\n```\n</details>\n<br>\n\n## Skipping tests\n\nYou can use the `--skip` flag to exclude tests matching a specified filter pattern.\nThis is useful for temporarily disabling problematic tests or focusing on a subset of tests by excluding others.\n\nYou can skip tests by function name, module name or full path:\n- Skip a specific test: `--skip test_feature_a`\n- Skip tests in a module: `--skip nested_module`\n- Skip by full path: `--skip my_tests::nested_module::test_feature_b`\n\n<!-- { \"package_name\": \"failing_example\"} -->\n```shell\n$ snforge test --skip test_failing --skip failing_example_tests::test_xyz\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 1 test(s) from failing_example package\nRunning 0 test(s) from src/\nRunning 1 test(s) from tests/\n[PASS] failing_example_tests::test_abc (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\nTests: 1 passed, 0 failed, 0 ignored, 2 filtered out\n```\n\n</details>\n<br>\n\n## Stopping Test Execution After First Failed Test\n\nTo stop the test execution after first failed test, you can pass an `--exit-first` flag along with `snforge test` command.\n\n<!-- { \"ignored\": true } -->\n```shell\n$ snforge test --exit-first\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 3 test(s) from failing_example package\nRunning 3 test(s) from tests/\n[FAIL] failing_example_tests::test_failing\n\nFailure data:\n    0x6661696c696e6720636865636b ('failing check')\n\n\nFailures:\n    failing_example_tests::test_failing\n\nTests: 0 passed, 1 failed, 0 ignored, 0 filtered out\nInterrupted execution of 2 test(s).\n```\n</details>\n<br>\n\n## Displaying Resources Used During Tests\n\nTo track resources like `builtins` / `syscalls` that are used when running tests, use `snforge test --detailed-resources`.\n\n```shell\n$ snforge test --detailed-resources\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 2 test(s) from hello_starknet package\nRunning 2 test(s) from tests/\n[PASS] hello_starknet_integrationtest::test_contract::test_cannot_increase_balance_with_zero_value (l1_gas: ~0, l1_data_gas: ~96, l2_gas: ~406680)\n        sierra gas: 406680\n        syscalls: (CallContract: 2, Deploy: 1, StorageRead: 1)\n        events: (count: 0, keys: 0, data size: 0)\n        messages: (l2 to l1: 0, l1 handler: 0)\n\n[PASS] hello_starknet_integrationtest::test_contract::test_increase_balance (l1_gas: ~0, l1_data_gas: ~192, l2_gas: ~511980)\n        sierra gas: 511980\n        syscalls: (CallContract: 3, StorageRead: 3, StorageWrite: 1, Deploy: 1)\n        events: (count: 0, keys: 0, data size: 0)\n        messages: (l2 to l1: 0, l1 handler: 0)\n\nRunning 0 test(s) from src/\nTests: 2 passed, 0 failed, 0 ignored, 0 filtered out\n```\n</details>\n<br>\n\nFor more information about how starknet-foundry calculates those, see [gas and resource estimation](gas-and-resource-estimation.md) section."
  },
  {
    "path": "docs/src/testing/test-attributes.md",
    "content": "## Test Attributes\n\n`snforge` allows setting test attributes for test cases in order to modify their behavior.\n\nCurrently, those attributes are supported:\n\n- `#[test]`\n- `#[ignore]`\n- `#[should_panic]`\n- `#[available_gas]`\n- `#[fork]`\n- `#[fuzzer]`\n- `#[disable_predeployed_contracts]`\n- `#[test_case]`\n\n> 📝 **Note**\n>\n> If you want to use other attributes (for example custom ones or from different packages) on the test function, they should be placed above the `snforge` attributes.\n> This ensures that they execute first on the raw code, rather than on the code generated by `snforge`. Otherwise, it may result in unexpected behavior.\n\n### `#[test]`\n\nMarks the function as a test case, to be visible for test collector.\nRead more about test collection [here](./test-collection.md).\n\n### `#[ignore]`\n\nMarks the function as ignored, it will be skipped after collecting.\nUse this if you don't want the test to be run (the runner will display how many tests were ignored in the summary).\n\nRead more about the behavior and how to override\nthis [here](./testing.md#ignoring-some-tests-unless-specifically-requested).\n\n### `#[should_panic]`\n\nA test function can be marked with this attribute, in order to assert that the test function itself will panic.\nIf the test panics when marked with this attribute, it's considered as \"passed\".\n\nMoreover, it can be used with either a tuple of shortstrings or a string for assessment of the exit panic data\n(depending on what your contract throws).\n\n#### Usage\n\nAsserting the panic data can be done with multiple types of inputs:\n\nByteArray:\n\n```rust\n#[should_panic(expected: \"No such file or directory (os error 2)\")]\n```\n\nShortstring:\n\n```rust\n#[should_panic(expected: 'panic message')]\n```\n\nTuple of shortstrings:\n\n```rust\n#[should_panic(expected: ('panic message', 'second message', )]\n```\n\nAsserting that the function panics (with any panic data):\n\n```rust\n#[should_panic]\n```\n\n> 📝 **Note**\n>\n> If generic `ENTRYPOINT_FAILED` errors are included in the expected field, the full panic data (including all such errors) will be checked.\n> If they’re not included, these generic errors will be ignored and only the actual user-defined error will be validated.\n> \n> ###### Example:\n> ```rust\n> #[should_panic(expected: ('panic', 'message', 'ENTRYPOINT_FAILED')]\n> ```\n> ```rust\n> #[should_panic(expected: ('panic', 'message')]\n> ```\n\n### `#[available_gas]`\n\nSets a gas limit for the test.\nIf the test exceeds the limit, it fails with an appropriate error.\n\n#### Usage\n\nAsserts that the test does not use more than 5 units of l2 gas:\n\n```rust\n#[available_gas(l2_gas: 5)]\n```\n\nAsserts that the test does not use more than 5 units of l1 gas, l1 data gas and l2 gas each:\n\n```rust\n#[available_gas(l1_gas: 5, l1_data_gas: 5, l2_gas: 5)]\n```\n\n### `#[fork]`\n\nEnables state forking for the given test case.\n\nRead more about fork testing [here](../snforge-advanced-features/fork-testing.md).\n\n#### Usage\n\nConfigures the fork endpoint with a given URL and a reference point for forking, which can be a block number, block\nhash, or a named tag (only \"latest\" is supported).\n\n| Reference Type | Example Usage                                                   |\n|----------------|-----------------------------------------------------------------|\n| `block_number` | `#[fork(url: \"http://example.com\", block_number: 123)]`         |\n| `block_hash`   | `#[fork(url: \"http://example.com\", block_hash: 0x123deadbeef)]` |\n| `block_tag`    | `#[fork(url: \"http://example.com\", block_tag: latest)]`         |\n\nYou can also define your frequently used fork configs in your `Scarb.toml`:\n\n```toml\n[[tool.snforge.fork]]\nname = \"TESTNET\"\nurl = \"http://your.rpc.url\"\nblock_id.tag = \"latest\"\n```\n\nThen, instead of repeating them inside the attribute, you can reference them by the given name of the config declared\nin `Scarb.toml`:\n\n```rust\n#[fork(\"TESTNET\")] \n```\n\n### `#[fuzzer]`\n\nEnables fuzzing for a given test case.\n\nRead more about test case fuzzing [here](../snforge-advanced-features/fuzz-testing.md).\n\n#### Usage\n\nMark the test as fuzzed test, and configure the fuzzer itself.\nConfigures how many runs will be performed, and the starting seed (for repeatability).\n\n```rust\n#[fuzzer(runs: 10, seed: 123)]\n```\n\nAny parameter of `fuzzer` attribute can be omitted:\n\n```rust\n#[fuzzer]\n#[fuzzer(runs: 10)]\n#[fuzzer(seed: 123)]\n```\n\nAnd will be filled in with default values in that case (default `runs` value is 256).\n\n> ⚠️ **Warning**\n>\n> Please note, that the test function needs to have some parameters in order for fuzzer to have something to fuzz.\n> Otherwise it will fail to execute and crash the runner. \n\n### `#[disable_predeployed_contracts]`\n\nDisables predeployment of default contracts in the test case.\nCurrently predeployed contracts are:\n- `STRK`\n- `ETH`\n\n### `#[test_case]`\n\nGenerates multiple test cases from a single function by providing different sets of arguments.\n\nRead more about parametrized tests [here](../snforge-advanced-features/parametrized-testing.md).\n\n#### Usage\n\nYou can define multiple test cases by specifying different sets of arguments using the `#[test_case]` attribute.\n\n```rust\n#[test]\n#[test_case(1, 2, 3)]\n#[test_case(3, 4, 7)]\nfn test_small_sum(a: felt252, b: felt252, expected: felt252) {\n    assert_eq!(a + b, expected);\n}\n```\n\nTest cases can also be named for better identification in the test reports.\n\n```rust\n#[test]\n#[test_case(name: \"one_plus_two\", 1, 2, 3)]\n#[test_case(name: \"three_plus_four\", 3, 4, 7)]\nfn test_small_sum(a: u32, b: u32, expected: u32) {\n    assert_eq!(a + b, expected);\n}\n```\n"
  },
  {
    "path": "docs/src/testing/test-collection.md",
    "content": "# How Tests Are Collected\n\nSnforge executes tests, but it does not compile them directly.\nInstead, it compiles tests by internally running `scarb build --test` command.\n\nThe `snforge_scarb_plugin` dependency, which is included with `snforge_std` dependency makes all functions\nmarked with `#[test]` executable and indicates to Scarb they should be compiled.\nWithout the plugin, no snforge tests can be compiled, that's why `snforge_std` dependency is always required in all\nsnforge projects.\n\nThanks to that, Scarb collects all functions marked with `#[test]`\nfrom [valid locations](https://docs.swmansion.com/scarb/docs/extensions/testing.html#tests-organization) and compiles\nthem into tests that are executed by snforge.\n\n## `[[test]]` Target\n\nUnder the hood, Scarb utilizes the `[[test]]` target mechanism to compile the tests. More information about the\n`[[test]]` target is available in\nthe [Scarb documentation](https://docs.swmansion.com/scarb/docs/reference/targets.html#test-targets).\n\nBy default, `[[test]]]` target is implicitly configured and user does not have to define it.\nSee [Scarb documentation](https://docs.swmansion.com/scarb/docs/reference/targets.html#auto-detection-of-test-targets)\nfor more details about the mechanism.\n\n## Tests Organization\n\nTest can be placed in both `src` and `test` directories. When adding tests to files in `src` you must wrap them in tests\nmodule.\n\nYou can read more about tests organization\nin [Scarb documentation](https://docs.swmansion.com/scarb/docs/extensions/testing.html#tests-organization).\n\n### Unit Tests\n\nTest placed in `src` directory are often called unit tests.\nFor these test to function in snforge, they must be wrapped in a module marked with `#[cfg(test)]` attribute.\n\n```rust\n// src/example.rs\n// ...\n\n// This test is not in module marked with `#[cfg(test)]` so it won't work\n#[test]\nfn my_invalid_test() {\n    // ...\n}\n\n#[cfg(test)]\nmod tests {\n    // This test is in module marked with `#[cfg(test)]` so it will work\n    #[test]\n    fn my_test() {\n        // ..\n    }\n}\n```\n\n### Integration Tests\n\nIntegration tests are placed in `tests` directory.\nThis directory is a special directory in Scarb.\nTests do not have to be wrapped in `#[cfg(test)]` and each file is treated as a separate module.\n\n```rust\n// tests/example.rs\n// ...\n\n// This test is in `tests` directory\n// so it works without being in module with `#[cfg(test)]` \n#[test]\nfn my_test_1() {\n    // ..\n}\n```\n\n#### Modules and `lib.cairo`\n\nAs written above, each file in `tests` directory is treated as a separate module\n\n```shell\n$ tree\n```\n\n<details open>\n<summary>Output:</summary>\n\n```shell\ntests/\n├── module1.cairo <-- is collected\n├── module2.cairo <-- is collected\n└── module3.cairo <-- is collected\n```\n\n</details>\n\nScarb will collect each file and compile it as a\nseparate [test target](https://docs.swmansion.com/scarb/docs/reference/targets.html#test-targets).\nEach of these targets will be run separately by `snforge`.\n\nHowever, it is also possible to define `lib.cairo` file in `tests`.\nThis stops files in `tests` from being treated as separate modules.\nInstead, Scarb will only create a single test target for that `lib.cairo` file.\nOnly tests that are reachable from this file will be collected and compiled.\n\n```rust\n// tests/lib.cairo\n\nmod module1;\nmod module2;\n```\n\n```shell\n$ tree\n```\n\n<details open>\n<summary>Output:</summary>\n\n```shell\ntests/\n├── lib.cairo\n├── module1.cairo  <-- is collected\n├── module2.cairo  <-- is collected\n└── module3.cairo  <-- is not collected\n```\n\n</details>\n"
  },
  {
    "path": "docs/src/testing/testing-contract-internals.md",
    "content": "# Testing Contracts' Internals\n\nSometimes, you want to test a function that uses Starknet context such as block number, timestamp or storage access.\n\nSince every test is treated like a contract (with the address [`test_address`](#snforge_stdtest_address---address-of-test-contract)), you can use the aforementioned pattern to test:\n- functions which are not available through the interface (but your contract uses them)\n- functions which are internal\n- functions performing specific operations on the contracts' storage or context data\n- library calls directly in the tests\n\n## Utilities For Testing Internals\n\n### `contract_state_for_testing()` - State of Test Contract\n\nThis function is generated by the `#[starknet::contract]` macro.\nIt can be used to test functions that accept the state as an argument.\n\nIn the example below, we will use the following contract:\n\n```rust\n{{#include ../../listings/testing_contract_internals/src/contract.cairo}}\n```\n\n#### Modifying the state of an existing contract\n\nThere is a special [`interact_with_state`](../appendix/cheatcodes/interact_with_state.md) cheatcode dedicated for using `contract_state_for_testing` with a deployed contract.\nBy using this function, the state will be modified for the provided contract address.\n\n```rust\n{{#include ../../listings/testing_contract_internals/tests/interact_with_state.cairo}}\n```\n\n> ⚠️ **Warning**\n>\n> When using `contract_state_for_testing` without the `interact_with_state` cheatcode, the storage is modified in the context of the [`test_address`](#snforge_stdtest_address---address-of-test-contract) contract.\n> Therefore, it is not recommended to use `contract_state_for_testing` without the cheatcode, as it can lead to unexpected results.\n\n### `snforge_std::test_address()` - Address of Test Contract\n\nThat function returns the contract address of the test.\nIt is useful, when you want to:\n- Mock the context (`cheat_caller_address`, `cheat_block_timestamp`, `cheat_block_number`, ...)\n- Spy for events emitted in the test\n\nExample usages:\n#### 1. Mocking the context info\nExample for `cheat_block_number`, same can be implemented for `cheat_caller_address`/`cheat_block_timestamp`/`elect` etc.\n\n```rust\n{{#include ../../listings/testing_contract_internals/tests/mocking_the_context_info.cairo}}\n```\n#### 2. Spying for events\nYou can use both `starknet::emit_event_syscall`, and the spies will capture the events,\nemitted in a `#[test]` function, if you pass the `test_address()` as a spy parameter (or spy on all events).\n\n\nGiven the emitting contract implementation:\n```rust\n{{#include ../../listings/testing_contract_internals/src/spying_for_events.cairo}}\n```\nYou can implement this test:\n\n```rust\n{{#include ../../listings/testing_contract_internals/tests/spying_for_events/tests.cairo}}\n```\n\nYou can also use the `starknet::emit_event_syscall` directly in the tests:\n```rust\n{{#include ../../listings/testing_contract_internals/tests/spying_for_events/syscall_tests.cairo}}\n```\n\n## Using Library Calls With the Test State Context\n\nUsing the above utilities, you can avoid deploying a mock contract, to test a `library_call` with a `LibraryCallDispatcher`.\n\nFor contract implementation:\n\n```rust\n{{#include ../../listings/testing_contract_internals/src/using_library_calls.cairo}}\n```\nWe use the `SafeLibraryDispatcher` like this:\n```rust\n{{#include ../../listings/testing_contract_internals/tests/using_library_calls.cairo}}\n```\n\n> 📝 **Note**\n>\n> Library calls don't trigger [cheat spans](https://foundry-rs.github.io/starknet-foundry/testing/using-cheatcodes.html#setting-cheatcode-span) progression. As a result, the cheatcode is still in effect when making subsequent library calls.\n\n> ⚠️ **Warning**\n>\n> This library call will write to the `test_address` memory segment, so it can potentially **overwrite** the changes\n> you make to the memory through `contract_state_for_testing` object and vice-versa.\n"
  },
  {
    "path": "docs/src/testing/testing-events.md",
    "content": "# Testing events\nExamples are based on the following `SpyEventsChecker` contract implementation:\n\n```rust\n{{#include ../../listings/testing_events/src/contract.cairo}}\n```\n\n## Asserting emission with `assert_emitted` method\n\nThis is the simpler way, in which you don't have to fetch the events explicitly.\nSee the below code for reference:\n\n```rust\n{{#include ../../listings/testing_events/tests/assert_emitted.cairo}}\n```\n\nLet's go through the code:\n\n1. After contract deployment, we created the spy using `spy_events` cheatcode. From this moment all emitted events\nwill be spied.\n2. Asserting is done using the `assert_emitted` method. It takes an array snapshot of `(ContractAddress, event)`\ntuples we expect that were emitted.\n\n> 📝 **Note**\n> We can pass events defined in the contract and construct them like in the `self.emit` method!\n\n\n## Asserting lack of event emission with `assert_not_emitted`\n\nIn cases where you want to test an event was *not* emitted, use the `assert_not_emitted` function.\nIt works similarly as `assert_emitted` with the only difference that it panics if an event was emitted during the execution.\n\nGiven the example above, we can check that a different `FirstEvent` was not emitted:\n\n```rust\nspy.assert_not_emitted(@array![\n    (\n        contract_address,\n        SpyEventsChecker::Event::FirstEvent(\n            SpyEventsChecker::FirstEvent { some_data: 456 }\n        )\n    )\n]);\n```\n\nNote that both the event name and event data are checked.\nIf a function emitted an event with the same name but a different payload, the `assert_not_emitted` function will pass.\n\n## Asserting the events manually\nIf you wish to assert the data manually, you can do that on the `Events` structure.\nSimply call `get_events()` on your `EventSpy` and access `events`  field on the returned `Events` value.\nThen, you can access the events and assert data by yourself.\n\n```rust\n{{#include ../../listings/testing_events/tests/assert_manually.cairo}}\n```\n\nLet's go through important parts of the provided code:\n\n1. After contract deployment we created the spy with `spy_events` cheatcode.\nFrom this moment all events emitted by the `SpyEventsChecker` contract will be spied.\n2. We have to call `get_events` method on the created spy to fetch our events and get the `Events` structure.\n3. We can check if certain event was emitted.\n4. Emitted events can be explicitly compared.\n5. To get our particular event, we need to access the `events` property and get the event under an index.\nSince `events` is an array holding a tuple of `ContractAddress` and `Event`, we unpack it using `let (from, event)`.\n6. If the event is emitted by calling `self.emit` method, its hashed name is saved under the `keys.at(0)`\n(this way Starknet handles events)\n\n> 📝 **Note**\n> To assert the `name` property we have to hash a string with the `selector!` macro.\n\n\n## Filtering Events\n\nSometimes, when you assert the events manually, you might not want to get all the events, but only ones from\na particular address. You can address that by using the method `emitted_by` on the `Events` structure.\n\n```rust\n{{#include ../../listings/testing_events/tests/filter.cairo}}\n```\n\n`events_from_first_address` has events emitted by the first contract only.\nSimilarly, `events_from_second_address` has events emitted by the second contract.\n\n## Asserting Events Emitted With `emit_event_syscall`\n\nEvents emitted with `emit_event_syscall` could have nonstandard (not defined anywhere) keys and data.\nThey can also be asserted with `spy.assert_emitted` method.\n\nLet's extend our `SpyEventsChecker` with `emit_event_with_syscall` method:\n\n```rust\n{{#include ../../listings/testing_events/src/syscall_dummy.cairo}}\n```\n\nAnd add a test for it:\n\n```rust\n{{#include ../../listings/testing_events/tests/syscall.cairo}}\n```\n\nUsing `Event` struct from the `snforge_std` library we can easily assert nonstandard events.\nThis also allows for testing the events you don't have the code of, or you don't want to import those.\n\n## Events and ABI Stability\n\nThe testing approach where event structs from the contract are used may lead to accidental breaking changes in the\ncontracts ABI.\n\nFor example, removing a `#[key]` attribute from this event would not lead to any code changes in the event tests.\n\n```rust\n#[derive(Drop, starknet::Event)]\n pub struct FirstEvent {\n     #[key]\n     pub some_key: felt252,\n     pub some_data: felt252,\n }\n```\n\nA recommended solution to this problem is using the base `snforge_std::Event` struct in tests.\n\n```rust\n{{#include ../../listings/testing_events/tests/assert_base.cairo}}\n```\n"
  },
  {
    "path": "docs/src/testing/testing-messages-to-l1.md",
    "content": "# Testing messages to L1\n\nThere exists a functionality allowing you to spy on messages sent to L1, similar to [spying events](./testing-events.md).\n\n[Check the appendix for an exact API, structures and traits reference](../appendix/cheatcodes/spy_messages_to_l1.md)\n\nAsserting messages to L1 is much simpler, since they are not wrapped with any structures in Cairo code (they are a plain `felt252` array and an L1 address).\nIn `snforge` they are expressed with a structure:\n\n```rust\n/// Raw message to L1 format (as seen via the RPC-API), can be used for asserting the sent messages.\nstruct MessageToL1 {\n    /// An ethereum address where the message is destined to go\n    to_address: starknet::EthAddress,\n    /// Actual payload which will be delivered to L1 contract\n    payload: Array<felt252>\n}\n```\n\nSimilarly, you can use `snforge` library and call `spy_messages_to_l1()` to initiate a spy:\n\n```rust\nuse snforge_std::{spy_messages_to_l1};\n\n#[test]\nfn test_spying_l1_messages() {\n    let mut spy = spy_messages_to_l1();\n    // ...\n}\n```\n\nWith the spy ready to use, you can execute some code, and make the assertions:\n\n1. Either with the spy directly by using `assert_sent`/`assert_not_sent` methods from `MessageToL1SpyAssertionsTrait` trait:\n\n```rust\n{{#include ../../listings/testing_messages_to_l1/tests/simple.cairo}}\n```\n\n2. Or use the messages' contents directly via `get_messages()` method of the `MessageToL1SpyTrait`:\n\n```rust\n{{#include ../../listings/testing_messages_to_l1/tests/detailed.cairo}}\n```\n"
  },
  {
    "path": "docs/src/testing/testing-workspaces.md",
    "content": "# Testing Scarb Workspaces\n\n`snforge` supports Scarb Workspaces.\nTo make sure you know how workspaces work,\ncheck Scarb documentation [here](https://docs.swmansion.com/scarb/docs/reference/workspaces.html).\n\n## Workspaces With Root Package\n\nWhen running `snforge test` in a Scarb workspace with a root package, it will only run tests inside the root package.  \n\nFor a project structure like this\n\n```shell\n$ tree . -L 3\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\n.\n├── Scarb.toml\n├── crates\n│   ├── addition_docs\n│   │   ├── Scarb.toml\n│   │   ├── src\n│   │   └── tests\n│   └── fibonacci_docs\n│       ├── Scarb.toml\n│       └── src\n├── tests\n│   └── test.cairo\n└── src\n    └── lib.cairo\n```\n</details>\n<br>\n\nonly the tests in `./src` and `./tests` folders will be executed.\n\n```shell\n$ snforge test\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 3 test(s) from hello_workspaces_docs package\nRunning 1 test(s) from src/\n[PASS] hello_workspaces_docs::tests::test_simple (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\nRunning 2 test(s) from tests/\n[FAIL] hello_workspaces_docs_integrationtest::test_failing::test_failing\n\nFailure data:\n    0x6661696c696e6720636865636b ('failing check')\n\n[FAIL] hello_workspaces_docs_integrationtest::test_failing::test_another_failing\n\nFailure data:\n    0x6661696c696e6720636865636b ('failing check')\n\nTests: 1 passed, 2 failed, 0 ignored, 0 filtered out\n\nFailures:\n    hello_workspaces_docs_integrationtest::test_failing::test_failing\n    hello_workspaces_docs_integrationtest::test_failing::test_another_failing\n```\n</details>\n<br>\n\nTo select the specific package to test, pass a `--package package_name` (or `-p package_name` for short) flag.\nYou can also run `snforge test` from the package directory to achieve the same effect.\n\n<!-- { \"package_name\": \"hello_workspaces_docs\" }  -->\n```shell\n$ snforge test --package addition_docs\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 5 test(s) from addition_docs package\nRunning 4 test(s) from tests/\n[PASS] addition_docs_integrationtest::nested::test_nested::test_two (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\n[PASS] addition_docs_integrationtest::nested::test_nested::test_two_and_two (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\n[PASS] addition_docs_integrationtest::nested::simple_case (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\n[PASS] addition_docs_integrationtest::nested::contract_test (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\nRunning 1 test(s) from src/\n[PASS] addition_docs::tests::it_works (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\nTests: 5 passed, 0 failed, 0 ignored, 0 filtered out\n```\n</details>\n<br>\n\nYou can also pass `--workspace` flag to run tests for all packages in the workspace.\n\n```shell\n$ snforge test --workspace\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 5 test(s) from addition_docs package\nRunning 4 test(s) from tests/\n[PASS] addition_docs_integrationtest::nested::test_nested::test_two (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\n[PASS] addition_docs_integrationtest::nested::simple_case (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\n[PASS] addition_docs_integrationtest::nested::test_nested::test_two_and_two (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\n[PASS] addition_docs_integrationtest::nested::contract_test (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\nRunning 1 test(s) from src/\n[PASS] addition_docs::tests::it_works (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\nTests: 5 passed, 0 failed, 0 ignored, 0 filtered out\n\n\nCollected 6 test(s) from fibonacci_docs package\nRunning 2 test(s) from src/\n[PASS] fibonacci_docs::tests::it_works (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\n[PASS] fibonacci_docs::tests::contract_test (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\nRunning 4 test(s) from tests/\n[FAIL] fibonacci_docs_tests::abc::efg::failing_test\n\nFailure data:\n    0x0 ('')\n\n[PASS] fibonacci_docs_tests::abc::efg::efg_test (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\n[PASS] fibonacci_docs_tests::lib_test (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\n[PASS] fibonacci_docs_tests::abc::abc_test (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\nTests: 5 passed, 1 failed, 0 ignored, 0 filtered out\n\n\nCollected 3 test(s) from hello_workspaces_docs package\nRunning 1 test(s) from src/\n[PASS] hello_workspaces_docs::tests::test_simple (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\nRunning 2 test(s) from tests/\n[FAIL] hello_workspaces_docs_integrationtest::test_failing::test_another_failing\n\nFailure data:\n    0x6661696c696e6720636865636b ('failing check')\n\n[FAIL] hello_workspaces_docs_integrationtest::test_failing::test_failing\n\nFailure data:\n    0x6661696c696e6720636865636b ('failing check')\n\nTests: 1 passed, 2 failed, 0 ignored, 0 filtered out\n\nFailures:\n    fibonacci_docs_tests::abc::efg::failing_test\n    hello_workspaces_docs_integrationtest::test_failing::test_another_failing\n    hello_workspaces_docs_integrationtest::test_failing::test_failing\n\nTests summary: 11 passed, 3 failed, 0 ignored, 0 filtered out\n```\n\n</details>\n<br>\n\n`--package` and `--workspace` flags are mutually exclusive, adding both of them to a `snforge test` command will result in an error.\n\n## Virtual Workspaces\n\nRunning `snforge test` command in a virtual workspace (a workspace without a root package)\noutside any package will by default run tests for all the packages. \nIt is equivalent to running `snforge test` with the `--workspace` flag.\n\nTo select a specific package to test,\nyou can use the `--package` flag the same way as in regular workspaces or run `snforge test` from the package directory.\n"
  },
  {
    "path": "docs/src/testing/testing.md",
    "content": "# Writing Tests\n\n`snforge` lets you test standalone functions from your smart contracts. This technique is referred to as unit testing. You\nshould write as many unit tests as possible as these are faster than integration tests.\n\n## Writing Your First Test\n\nFirst, add the following code to the `src/lib.cairo` file:\n\n```rust\n{{#include ../../listings/first_test/src/lib.cairo}}\n```\n\nIt is a common practice to keep your unit tests in the same file as the tested code.\nKeep in mind that all tests in `src` folder have to be in a module annotated with `#[cfg(test)]`.\nWhen it comes to integration tests, you can keep them in separate files in the `tests` directory.\nYou can find a detailed explanation of how `snforge` collects tests [here](test-collection.md).\n\nNow run `snforge` using a command:\n\n```shell\n$ snforge test\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 1 test(s) from first_test package\nRunning 1 test(s) from src/\n[PASS] first_test::tests::test_sum (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\nTests: 1 passed, 0 failed, 0 ignored, 0 filtered out\n```\n</details>\n<br>\n\n## Failing Tests\n\nIf your code panics, the test is considered failed. Here's an example of a failing test.\n\n```rust\n{{#include ../../listings/panicking_test/src/lib.cairo}}\n```\n\n```shell\n$ snforge test\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 1 test(s) from panicking_test package\nRunning 1 test(s) from src/\n[FAIL] panicking_test::tests::failing\n\nFailure data:\n    0x70616e6963206d657373616765 ('panic message')\n\nTests: 0 passed, 1 failed, 0 ignored, 0 filtered out\n\nFailures:\n    panicking_test::tests::failing\n```\n</details>\n<br>\n\nWhen contract fails, you can get backtrace information by setting the `SNFORGE_BACKTRACE=1` environment variable. Read more about it [here](../snforge-advanced-features/debugging.md).\n\n## Expected Failures\n\nSometimes you want to mark a test as expected to fail. This is useful when you want to verify that an action fails as\nexpected.\n\nTo mark a test as expected to fail, use the `#[should_panic]` attribute.\n\nYou can specify the expected failure message in three ways:\n\n1. **With ByteArray**:\n```rust\n{{#include ../../listings/should_panic_example/src/lib.cairo:byte_array}}\n```\nWith this format, the expected error message needs to be a substring of the actual error message. This is particularly useful when the error message includes dynamic data such as a hash or address.\n\n2. **With felt**\n```rust\n{{#include ../../listings/should_panic_example/src/lib.cairo:felt}}\n```\n\n3. **With tuple of felts**:\n```rust\n{{#include ../../listings/should_panic_example/src/lib.cairo:tuple}}\n```\n\n\n```shell\n$ snforge test\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 5 test(s) from should_panic_example package\nRunning 5 test(s) from src/\n[PASS] should_panic_example::tests::should_panic_felt_matching (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\n[PASS] should_panic_example::tests::should_panic_multiple_messages (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\n[PASS] should_panic_example::tests::should_panic_exact (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\n[PASS] should_panic_example::tests::should_panic_expected_is_substring (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\n[PASS] should_panic_example::tests::should_panic_check_data (l1_gas: ~0, l1_data_gas: ~0, l2_gas: ~40000)\nTests: 5 passed, 0 failed, 0 ignored, 0 filtered out\n```\n</details>\n<br>\n\n## Ignoring Tests\n\nSometimes you may have tests that you want to exclude during most runs of `snforge test`.\nYou can achieve it using `#[ignore]` - tests marked with this attribute will be skipped by default.\n\n```rust\n{{#include ../../listings/ignoring_example/src/lib.cairo}}\n```\n\n```shell\n$ snforge test\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 1 test(s) from ignoring_example package\nRunning 1 test(s) from src/\n[IGNORE] ignoring_example::tests::ignored_test\nTests: 0 passed, 0 failed, 1 ignored, 0 filtered out\n```\n</details>\n<br>\n\nTo run only tests marked with the  `#[ignore]` attribute use `snforge test --ignored`.\nTo run all tests regardless of the `#[ignore]` attribute use `snforge test --include-ignored`.\n\n## Writing Assertions and `assert_macros` Package\n> ⚠️ **Recommended only for development** ️⚠️\n> \n> Assert macros package provides a set of macros that can be used to write assertions such as `assert_eq!`.\nIn order to use it, your project must have the `assert_macros` dependency added to the `Scarb.toml` file.\nThese macros are very expensive to run on Starknet, as they result a huge amount of steps and are not recommended for production use. \nThey are only meant to be used in tests.\nThis dependency is added automatically when creating a project using `snforge new`.\n\n```toml\n[dev-dependencies]\nsnforge_std = ...\nassert_macros = \"<scarb-version>\"\n```\n\nAvailable assert macros are \n- `assert_eq!`\n- `assert_ne!`\n- `assert_lt!`\n- `assert_le!`\n- `assert_gt!`\n- `assert_ge!`\n"
  },
  {
    "path": "docs/src/testing/using-cheatcodes.md",
    "content": "# Using Cheatcodes\n\n> ℹ️ **Info**\n> To use cheatcodes you need to add `snforge_std` package as a dependency in\n> your [`Scarb.toml`](https://docs.swmansion.com/scarb/docs/guides/dependencies.html#development-dependencies)\n> using the appropriate version.\n>\n> ```toml\n> [dev-dependencies]\n> snforge_std = \"{{snforge_std_version}}\"\n> ```\n\nWhen testing smart contracts, often there are parts of code that are dependent on a specific blockchain state.\nInstead of trying to replicate these conditions in tests, you can emulate them\nusing [cheatcodes](../appendix/cheatcodes.md).\n\n> ⚠️ **Warning**\n> \n> These examples make use of `assert_macros`, so it's recommended to get familiar with them first. [Learn more about `assert_macros`](testing.md#writing-assertions-and-assert_macros-package)\n\n## The Test Contract\n\nIn this tutorial, we will be using the following Starknet contract:\n\n```rust\n{{#include ../../listings/using_cheatcodes/src/lib.cairo}}\n```\n\n## Writing Tests\n\nWe can try to create a test that will increase and verify the balance.\n\n```rust\n{{#include ../../listings/using_cheatcodes/tests/lib.cairo}}\n```\n\nThis test fails, which means that `increase_balance` method panics as we expected.\n\n```shell\n$ snforge test\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 1 test(s) from using_cheatcodes package\nRunning 0 test(s) from src/\nRunning 1 test(s) from tests/\n[FAIL] using_cheatcodes_tests::call_and_invoke\n\nFailure data:\n    (0x75736572206973206e6f7420616c6c6f776564 ('user is not allowed'), 0x454e545259504f494e545f4641494c4544 ('ENTRYPOINT_FAILED'))\n\nTests: 0 passed, 1 failed, 0 ignored, 0 filtered out\n\nFailures:\n    using_cheatcodes_tests::call_and_invoke\n```\n</details>\n<br>\n\nOur user validation is not letting us call the contract, because the default caller address is not `123`.\n\n## Using Cheatcodes in Tests\n\nBy using cheatcodes, we can change various properties of transaction info, block info, etc.\nFor example, we can use the [`start_cheat_caller_address`](../appendix/cheatcodes/caller_address.md) cheatcode to change the caller\naddress, so it passes our validation.\n\n### Cheating an Address\n\n```rust\n{{#include ../../listings/using_cheatcodes_cheat_address/tests/lib.cairo}}\n```\n\nThe test will now pass without an error\n\n```shell\n$ snforge test\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 1 test(s) from using_cheatcodes_cheat_address package\nRunning 0 test(s) from src/\nRunning 1 test(s) from tests/\n[PASS] using_cheatcodes_cheat_address_tests::call_and_invoke (l1_gas: ~0, l1_data_gas: ~288, l2_gas: ~600000)\nTests: 1 passed, 0 failed, 0 ignored, 0 filtered out\n```\n</details>\n<br>\n\n### Cancelling the Cheat\n\nMost cheatcodes come with corresponding `start_` and `stop_` functions that can be used to start and stop the state\nchange.\nIn case of the `start_cheat_caller_address`, we can cancel the address change\nusing [`stop_cheat_caller_address`](../appendix/cheatcodes/caller_address.md#stop_cheat_caller_address).\nWe will demonstrate its behavior using `SafeDispatcher` to show when exactly the fail occurs:\n\n```rust\n{{#include ../../listings/using_cheatcodes_cancelling_cheat/tests/lib.cairo}}\n```\n\n```shell\n$ snforge test\n```\n\n<details>\n<summary>Output:</summary>\n\n```shell\nCollected 1 test(s) from using_cheatcodes_cancelling_cheat package\nRunning 1 test(s) from tests/\n[FAIL] using_cheatcodes_cancelling_cheat_tests::call_and_invoke\n\nFailure data:\n    0x5365636f6e642063616c6c206661696c656421 ('Second call failed!')\n\nRunning 0 test(s) from src/\nTests: 0 passed, 1 failed, 0 ignored, 0 filtered out\n\nFailures:\n    using_cheatcodes_cancelling_cheat_tests::call_and_invoke\n```\n</details>\n<br>\n\nWe see that the second `increase_balance` fails since we cancelled the cheatcode.\n\n### Cheating Addresses Globally\n\nIn case you want to cheat the caller address for all contracts, you can use the global cheatcode which has the `_global` suffix. Note, that we don't specify target, nor the span, because this cheatcode type works globally and indefinitely.\n\n```rust\n{{#include ../../listings/using_cheatcodes_others/tests/caller_address/proper_use_global.cairo}}\n```\n\n### Cheating the Constructor\n\nMost of the cheatcodes like `cheat_caller_address`, `mock_call`, `cheat_block_timestamp`, `cheat_block_number` do work in the constructor of the contracts.\n\nLet's say, that you have a contract that saves the caller address (deployer) in the constructor, and you want it to be pre-set to a certain value.\n\nTo `cheat_caller_address` the constructor, you need to `start_cheat_caller_address` before it is invoked, with the right address. To achieve this, you need to precalculate the address of the contract by using the `precalculate_address` function of `ContractClassTrait` on the declared contract, and then use it in `start_cheat_caller_address` as an argument:\n\n```rust\n{{#include ../../listings/using_cheatcodes_others/tests/cheat_constructor.cairo}}\n```\n\n### Setting Cheatcode Span\n\nSometimes it's useful to have a cheatcode work only for a certain number of target calls.\n\nThat's where [`CheatSpan`](../appendix/cheatcodes/cheat_span.md) comes in handy.\n\n```rust\nenum CheatSpan {\n    Indefinite: (),\n    TargetCalls: NonZero<usize>,\n}\n```\n\nTo set span for a cheatcode, use `cheat_caller_address` / `cheat_block_timestamp` / `cheat_block_number` / etc.\n\n```rust\ncheat_caller_address(contract_address, new_caller_address, CheatSpan::TargetCalls(1))\n```\n\nCalling a cheatcode with `CheatSpan::TargetCalls(N)` is going to activate the cheatcode for `N` calls to a specified contract address, after which it's going to be automatically canceled.\n\nOf course the cheatcode can still be canceled before its `CheatSpan` goes down to 0 - simply call `stop_cheat_caller_address` on the target manually.\n\n> ℹ️ **Info**\n>\n> Using `start_cheat_caller_address` is **equivalent** to using `cheat_caller_address` with `CheatSpan::Indefinite`.\n\n\nTo better understand the functionality of `CheatSpan`, here's a full example:\n\n```rust\n{{#include ../../listings/using_cheatcodes_others/tests/caller_address/span.cairo}}\n```\n\n> 📝 **Note**\n>\n> [Library calls](https://foundry-rs.github.io/starknet-foundry/testing/testing-contract-internals.html#using-library-calls-with-the-test-state-context) don't trigger cheat spans progression. As a result, the cheatcode is still in effect when making subsequent library calls.\n\n### Cheating ERC-20 Token balance\n\nIf you want to cheat the balance of an ERC-20 token (STRK, ETH or custom one), you can use the [`set_balance`](../appendix/cheatcodes/set_balance.md) cheatcode.\n\n> ℹ️ **Info**\n>\n> STRK and ETH are predeployed in every test case by default, so you can use them without any additional setup.\n> The predeployment can be disabled by the `#[disable_predeployed_contracts]` attribute.\n\nBelow is a basic example of setting and reading STRK balance:\n\n```rust\n{{#include ../../listings/using_cheatcodes_others/tests/set_balance_strk.cairo}}\n```\n\nYou can also use `CustomToken` (see [`Token`](../appendix/cheatcodes/token.md) docs). It needs `contract_address` and `balances_variable_selector` (which refers to storage variable, holding the mapping of balances -> amounts):\n\n```rust\n{{#include ../../listings/using_cheatcodes_others/tests/set_balance_custom_token.cairo}}\n```"
  },
  {
    "path": "docs/theme/head.hbs",
    "content": "    <meta httpEquiv=\"Content-Language\" content=\"en-US\">\n    <meta name=\"twitter:card\" content=\"summary_large_image\">\n    <meta name=\"twitter:site\" content=\"@swmansionxyz\">\n    <meta property=\"og:title\" content=\"The Starknet Foundry Book\">\n    <meta property=\"og:description\" content=\"{{ chapter_title }}\">\n    <meta property=\"og:type\" content=\"website\">\n    <meta property=\"og:image\" content=\"https://foundry-rs.github.io/starknet-foundry/images/foundry.png\">\n    <meta property=\"og:image:alt\" content=\"Starknet Foundry toolkit for developing Starknet smart contracts\">\n    <meta property=\"og:image:type\" content=\"image/png\">\n    <meta property=\"og:image:width\" content=\"1280\">\n    <meta property=\"og:image:height\" content=\"640\">\n    <meta name=\"google-site-verification\" content=\"6xl6OpoHaaMgbaLUMlPvZxV37223AVo--OYigbvsxGk\" />\n    <script>\n        window.goatcounter = { endpoint: \"https://gc-snfoundry.swmtest.xyz/count\" }\n    </script>\n"
  },
  {
    "path": "docs/theme/header.hbs",
    "content": "<div class=\"blake-banner\">\n  <p>\n    <strong>Important:</strong>\n    If you're encountering any problem declaring contracts, please read the\n    <a href=\"{{path_to_root}}getting-started/blake-hash-support.html\">\n      Blake Hash Support</a>\n    information.\n  </p>\n</div>\n\n<style>\n  .blake-banner { position: relative; z-index: 100; background-color: #f8d7da;\n  color: #721c24; border: 0.0625rem solid #f5c6cb; border-radius: 0; text-align:\n  center; padding: 5rem 1rem 0 1rem; width: calc(100% + 8px +\n  var(--page-padding)); margin-left: calc((8px + var(--page-padding)) * -1); }\n  .blake-banner a { color: #721c24; font-weight: bold; text-decoration:\n  underline; }\n</style>\n"
  },
  {
    "path": "docs/theme/index.hbs",
    "content": "<!DOCTYPE HTML>\n<html lang=\"{{ language }}\" class=\"{{ default_theme }} sidebar-visible\" dir=\"{{ text_direction }}\">\n    <head>\n        <!-- Book generated using mdBook -->\n        <meta charset=\"UTF-8\">\n        <title>{{ title }}</title>\n        {{#if is_print }}\n        <meta name=\"robots\" content=\"noindex\">\n        {{/if}}\n        {{#if base_url}}\n        <base href=\"{{ base_url }}\">\n        {{/if}}\n\n\n        <!-- Custom HTML head -->\n        {{> head}}\n\n        <meta name=\"description\" content=\"{{ description }}\">\n        <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n        <meta name=\"theme-color\" content=\"#ffffff\">\n\n        {{#if favicon_svg}}\n        <link rel=\"icon\" href=\"{{ resource \"favicon.svg\" }}\">\n        {{/if}}\n        {{#if favicon_png}}\n        <link rel=\"shortcut icon\" href=\"{{ resource \"favicon.png\" }}\">\n        {{/if}}\n        <link rel=\"stylesheet\" href=\"{{ resource \"css/variables.css\" }}\">\n        <link rel=\"stylesheet\" href=\"{{ resource \"css/general.css\" }}\">\n        <link rel=\"stylesheet\" href=\"{{ resource \"css/chrome.css\" }}\">\n        {{#if print_enable}}\n        <link rel=\"stylesheet\" href=\"{{ resource \"css/print.css\" }}\" media=\"print\">\n        {{/if}}\n\n        <!-- Fonts -->\n        <link rel=\"stylesheet\" href=\"{{ resource \"FontAwesome/css/font-awesome.css\" }}\">\n        {{#if copy_fonts}}\n        <link rel=\"stylesheet\" href=\"{{ resource \"fonts/fonts.css\" }}\">\n        {{/if}}\n\n        <!-- Highlight.js Stylesheets -->\n        <link rel=\"stylesheet\" id=\"highlight-css\" href=\"{{ resource \"highlight.css\" }}\">\n        <link rel=\"stylesheet\" id=\"tomorrow-night-css\" href=\"{{ resource \"tomorrow-night.css\" }}\">\n        <link rel=\"stylesheet\" id=\"ayu-highlight-css\" href=\"{{ resource \"ayu-highlight.css\" }}\">\n\n        <!-- Custom theme stylesheets -->\n        {{#each additional_css}}\n        <link rel=\"stylesheet\" href=\"{{ resource this }}\">\n        {{/each}}\n\n        {{#if mathjax_support}}\n        <!-- MathJax -->\n        <script async src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML\"></script>\n        {{/if}}\n\n        <!-- Provide site root and default themes to javascript -->\n        <script>\n            const path_to_root = \"{{ path_to_root }}\";\n            const default_light_theme = \"{{ default_theme }}\";\n            const default_dark_theme = \"{{ preferred_dark_theme }}\";\n        {{#if search_js}}\n            window.path_to_searchindex_js = \"{{ resource \"searchindex.js\" }}\";\n        {{/if}}\n        </script>\n        <!-- Start loading toc.js asap -->\n        <script src=\"{{ resource \"toc.js\" }}\"></script>\n    </head>\n    <body>\n    <div id=\"mdbook-help-container\">\n        <div id=\"mdbook-help-popup\">\n            <h2 class=\"mdbook-help-title\">Keyboard shortcuts</h2>\n            <div>\n                <p>Press <kbd>←</kbd> or <kbd>→</kbd> to navigate between chapters</p>\n                {{#if search_enabled}}\n                <p>Press <kbd>S</kbd> or <kbd>/</kbd> to search in the book</p>\n                {{/if}}\n                <p>Press <kbd>?</kbd> to show this help</p>\n                <p>Press <kbd>Esc</kbd> to hide this help</p>\n            </div>\n        </div>\n    </div>\n    <div id=\"body-container\">\n        <!-- Work around some values being stored in localStorage wrapped in quotes -->\n        <script>\n            try {\n                let theme = localStorage.getItem('mdbook-theme');\n                let sidebar = localStorage.getItem('mdbook-sidebar');\n\n                if (theme.startsWith('\"') && theme.endsWith('\"')) {\n                    localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));\n                }\n\n                if (sidebar.startsWith('\"') && sidebar.endsWith('\"')) {\n                    localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));\n                }\n            } catch (e) { }\n        </script>\n\n        <!-- Set the theme before any content is loaded, prevents flash -->\n        <script>\n            const default_theme = window.matchMedia(\"(prefers-color-scheme: dark)\").matches ? default_dark_theme : default_light_theme;\n            let theme;\n            try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }\n            if (theme === null || theme === undefined) { theme = default_theme; }\n            const html = document.documentElement;\n            html.classList.remove('{{ default_theme }}')\n            html.classList.add(theme);\n            html.classList.add(\"js\");\n        </script>\n\n        <input type=\"checkbox\" id=\"sidebar-toggle-anchor\" class=\"hidden\">\n\n        <!-- Hide / unhide sidebar before it is displayed -->\n        <script>\n            let sidebar = null;\n            const sidebar_toggle = document.getElementById(\"sidebar-toggle-anchor\");\n            if (document.body.clientWidth >= 1080) {\n                try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }\n                sidebar = sidebar || 'visible';\n            } else {\n                sidebar = 'hidden';\n                sidebar_toggle.checked = false;\n            }\n            if (sidebar === 'visible') {\n                sidebar_toggle.checked = true;\n            } else {\n                html.classList.remove('sidebar-visible');\n            }\n        </script>\n\n        <nav id=\"sidebar\" class=\"sidebar\" aria-label=\"Table of contents\">\n            <!-- populated by js -->\n            <mdbook-sidebar-scrollbox class=\"sidebar-scrollbox\"></mdbook-sidebar-scrollbox>\n            <noscript>\n                <iframe class=\"sidebar-iframe-outer\" src=\"{{ path_to_root }}toc.html\"></iframe>\n            </noscript>\n            <div id=\"sidebar-resize-handle\" class=\"sidebar-resize-handle\">\n                <div class=\"sidebar-resize-indicator\"></div>\n            </div>\n        </nav>\n\n        <div id=\"page-wrapper\" class=\"page-wrapper\">\n\n            <div class=\"page\">\n                {{> header}}\n                <div id=\"menu-bar\" class=\"menu-bar sticky\">\n                    <div class=\"left-buttons\">\n                        <label id=\"sidebar-toggle\" class=\"icon-button\" for=\"sidebar-toggle-anchor\" title=\"Toggle Table of Contents\" aria-label=\"Toggle Table of Contents\" aria-controls=\"sidebar\">\n                            <i class=\"fa fa-bars\"></i>\n                        </label>\n                        <button id=\"theme-toggle\" class=\"icon-button\" type=\"button\" title=\"Change theme\" aria-label=\"Change theme\" aria-haspopup=\"true\" aria-expanded=\"false\" aria-controls=\"theme-list\">\n                            <i class=\"fa fa-paint-brush\"></i>\n                        </button>\n                        <ul id=\"theme-list\" class=\"theme-popup\" aria-label=\"Themes\" role=\"menu\">\n                            <li role=\"none\"><button role=\"menuitem\" class=\"theme\" id=\"default_theme\">Auto</button></li>\n                            <li role=\"none\"><button role=\"menuitem\" class=\"theme\" id=\"light\">Light</button></li>\n                            <li role=\"none\"><button role=\"menuitem\" class=\"theme\" id=\"rust\">Rust</button></li>\n                            <li role=\"none\"><button role=\"menuitem\" class=\"theme\" id=\"coal\">Coal</button></li>\n                            <li role=\"none\"><button role=\"menuitem\" class=\"theme\" id=\"navy\">Navy</button></li>\n                            <li role=\"none\"><button role=\"menuitem\" class=\"theme\" id=\"ayu\">Ayu</button></li>\n                        </ul>\n                        {{#if search_enabled}}\n                        <button id=\"search-toggle\" class=\"icon-button\" type=\"button\" title=\"Search (`/`)\" aria-label=\"Toggle Searchbar\" aria-expanded=\"false\" aria-keyshortcuts=\"/ s\" aria-controls=\"searchbar\">\n                            <i class=\"fa fa-search\"></i>\n                        </button>\n                        {{/if}}\n                    </div>\n\n                    <h1 class=\"menu-title\">{{ book_title }}</h1>\n\n                    <div class=\"right-buttons\">\n                        {{#if print_enable}}\n                        <a href=\"{{ path_to_root }}print.html\" title=\"Print this book\" aria-label=\"Print this book\">\n                            <i id=\"print-button\" class=\"fa fa-print\"></i>\n                        </a>\n                        {{/if}}\n                        {{#if git_repository_url}}\n                        <a href=\"{{git_repository_url}}\" title=\"Git repository\" aria-label=\"Git repository\">\n                            <i id=\"git-repository-button\" class=\"fa {{git_repository_icon}}\"></i>\n                        </a>\n                        {{/if}}\n                        {{#if git_repository_edit_url}}\n                        <a href=\"{{git_repository_edit_url}}\" title=\"Suggest an edit\" aria-label=\"Suggest an edit\" rel=\"edit\">\n                            <i id=\"git-edit-button\" class=\"fa fa-edit\"></i>\n                        </a>\n                        {{/if}}\n\n                    </div>\n                </div>\n\n                {{#if search_enabled}}\n                <div id=\"search-wrapper\" class=\"hidden\">\n                    <form id=\"searchbar-outer\" class=\"searchbar-outer\">\n                        <div class=\"search-wrapper\">\n                            <input type=\"search\" id=\"searchbar\" name=\"searchbar\" placeholder=\"Search this book ...\" aria-controls=\"searchresults-outer\" aria-describedby=\"searchresults-header\">\n                            <div class=\"spinner-wrapper\">\n                                <i class=\"fa fa-spinner fa-spin\"></i>\n                            </div>\n                        </div>\n                    </form>\n                    <div id=\"searchresults-outer\" class=\"searchresults-outer hidden\">\n                        <div id=\"searchresults-header\" class=\"searchresults-header\"></div>\n                        <ul id=\"searchresults\">\n                        </ul>\n                    </div>\n                </div>\n                {{/if}}\n\n                <!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->\n                <script>\n                    document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');\n                    document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');\n                    Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {\n                        link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);\n                    });\n                </script>\n\n                <div id=\"content\" class=\"content\">\n                    <main>\n                        {{{ content }}}\n                    </main>\n\n                    <nav class=\"nav-wrapper\" aria-label=\"Page navigation\">\n                        <!-- Mobile navigation buttons -->\n                        {{#previous}}\n                            <a rel=\"prev\" href=\"{{ path_to_root }}{{link}}\" class=\"mobile-nav-chapters previous\" title=\"Previous chapter\" aria-label=\"Previous chapter\" aria-keyshortcuts=\"Left\">\n                                <i class=\"fa fa-angle-left\"></i>\n                            </a>\n                        {{/previous}}\n\n                        {{#next}}\n                            <a rel=\"next prefetch\" href=\"{{ path_to_root }}{{link}}\" class=\"mobile-nav-chapters next\" title=\"Next chapter\" aria-label=\"Next chapter\" aria-keyshortcuts=\"Right\">\n                                <i class=\"fa fa-angle-right\"></i>\n                            </a>\n                        {{/next}}\n\n                        <div style=\"clear: both\"></div>\n                    </nav>\n                </div>\n            </div>\n\n            <nav class=\"nav-wide-wrapper\" aria-label=\"Page navigation\">\n                {{#previous}}\n                    <a rel=\"prev\" href=\"{{ path_to_root }}{{link}}\" class=\"nav-chapters previous\" title=\"Previous chapter\" aria-label=\"Previous chapter\" aria-keyshortcuts=\"Left\">\n                        <i class=\"fa fa-angle-left\"></i>\n                    </a>\n                {{/previous}}\n\n                {{#next}}\n                    <a rel=\"next prefetch\" href=\"{{ path_to_root }}{{link}}\" class=\"nav-chapters next\" title=\"Next chapter\" aria-label=\"Next chapter\" aria-keyshortcuts=\"Right\">\n                        <i class=\"fa fa-angle-right\"></i>\n                    </a>\n                {{/next}}\n            </nav>\n\n        </div>\n\n        {{#if live_reload_endpoint}}\n        <!-- Livereload script (if served using the cli tool) -->\n        <script>\n            const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';\n            const wsAddress = wsProtocol + \"//\" + location.host + \"/\" + \"{{{live_reload_endpoint}}}\";\n            const socket = new WebSocket(wsAddress);\n            socket.onmessage = function (event) {\n                if (event.data === \"reload\") {\n                    socket.close();\n                    location.reload();\n                }\n            };\n\n            window.onbeforeunload = function() {\n                socket.close();\n            }\n        </script>\n        {{/if}}\n\n        {{#if google_analytics}}\n        <!-- Google Analytics Tag -->\n        <script>\n            const localAddrs = [\"localhost\", \"127.0.0.1\", \"\"];\n\n            // make sure we don't activate google analytics if the developer is\n            // inspecting the book locally...\n            if (localAddrs.indexOf(document.location.hostname) === -1) {\n                (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n                (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n                m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n                })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n\n                ga('create', '{{google_analytics}}', 'auto');\n                ga('send', 'pageview');\n            }\n        </script>\n        {{/if}}\n\n        {{#if playground_line_numbers}}\n        <script>\n            window.playground_line_numbers = true;\n        </script>\n        {{/if}}\n\n        {{#if playground_copyable}}\n        <script>\n            window.playground_copyable = true;\n        </script>\n        {{/if}}\n\n        {{#if playground_js}}\n        <script src=\"{{ resource \"ace.js\" }}\"></script>\n        <script src=\"{{ resource \"mode-rust.js\" }}\"></script>\n        <script src=\"{{ resource \"editor.js\" }}\"></script>\n        <script src=\"{{ resource \"theme-dawn.js\" }}\"></script>\n        <script src=\"{{ resource \"theme-tomorrow_night.js\" }}\"></script>\n        {{/if}}\n\n        {{#if search_js}}\n        <script src=\"{{ resource \"elasticlunr.min.js\" }}\"></script>\n        <script src=\"{{ resource \"mark.min.js\" }}\"></script>\n        <script src=\"{{ resource \"searcher.js\" }}\"></script>\n        {{/if}}\n\n        <script src=\"{{ resource \"clipboard.min.js\" }}\"></script>\n        <script src=\"{{ resource \"highlight.js\" }}\"></script>\n        <script src=\"{{ resource \"book.js\" }}\"></script>\n\n        <!-- Custom JS scripts -->\n        {{#each additional_js}}\n        <script src=\"{{ resource this}}\"></script>\n        {{/each}}\n\n        {{#if is_print}}\n        {{#if mathjax_support}}\n        <script>\n        window.addEventListener('load', function() {\n            MathJax.Hub.Register.StartupHook('End', function() {\n                window.setTimeout(window.print, 100);\n            });\n        });\n        </script>\n        {{else}}\n        <script>\n        window.addEventListener('load', function() {\n            window.setTimeout(window.print, 100);\n        });\n        </script>\n        {{/if}}\n        {{/if}}\n\n        {{#if fragment_map}}\n        <script>\n            document.addEventListener('DOMContentLoaded', function() {\n                const fragmentMap =\n                    {{{fragment_map}}}\n                ;\n                const target = fragmentMap[window.location.hash];\n                if (target) {\n                    let url = new URL(target, window.location.href);\n                    window.location.replace(url.href);\n                }\n            });\n        </script>\n        {{/if}}\n\n    </div>\n    </body>\n</html>\n"
  },
  {
    "path": "scripts/build_docs.sh",
    "content": "#!/bin/bash\n\n# TODO(#2781)\n\npushd docs\n\nOUTPUT=$(mdbook build 2>&1)\n\necho \"$OUTPUT\"\n\nif echo \"$OUTPUT\" | grep -q \"\\[ERROR\\]\"; then\n    exit 1\nfi\n"
  },
  {
    "path": "scripts/check_snapshots.sh",
    "content": "#!/bin/sh\n\n# This is internal script used to check correctness of snapshots used in snapshots tests.\n# Runs mentioned tests for all Scarb versions from ./get_scarb_versions.sh.\n#\n# NOTE: this requires ./get_scarb_versions.sh to be present in the CWD.\n\nset -eu\n\nSCRIPT_DIR=\"$(cd \"$(dirname \"$0\")\" && pwd)\"\nREPO_ROOT=\"$(cd \"$SCRIPT_DIR/..\" && pwd)\"\n\nBOLD=\"\"\nRED=\"\"\nYELLOW=\"\"\nGREEN=\"\"\nRESET=\"\"\n\n# Check whether colors are supported and should be enabled\nif [ -z \"${NO_COLOR:-}\" ] && echo \"${TERM:-}\" | grep -q \"^xterm\"; then\n  BOLD=\"\\033[1m\"\n  RED=\"\\033[31m\"\n  YELLOW=\"\\033[33m\"\n  GREEN=\"\\033[32m\"\n  RESET=\"\\033[0m\"\nfi\n\nSEPARATOR=\"━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\"\n\nusage() {\n  cat <<EOF\nRuns e2e snapshot tests (prefixed with \\`snap_\\`) for each Scarb version.\n\nUsage: $0 [OPTIONS]\n\nOptions:\n  --fix                  Update snapshots (run with \\`INSTA_UPDATE=always\\`)\n  -h, --help             Print help\nEOF\n}\n\nrun_tests() {\n  _fix=\"${1:-0}\"\n  if [ \"$_fix\" = \"1\" ]; then\n    SNFORGE_DETERMINISTIC_OUTPUT=1 INSTA_UPDATE=always cargo test -p forge --test main snap_\n  else\n    SNFORGE_DETERMINISTIC_OUTPUT=1 cargo test -p forge --test main snap_\n  fi\n}\n\n\nmain() {\n  UPDATE_SNAPSHOTS=0\n  while [ $# -gt 0 ]; do\n    case \"$1\" in\n      --fix)\n        UPDATE_SNAPSHOTS=1;\n        shift ;;\n      -h|--help)\n        usage\n        exit 0\n        ;;\n      *)\n        err \"unknown option: $1 (use --help)\" ;;\n    esac\n  done\n\n  need_cmd asdf\n  need_cmd cargo\n\n  [ -f \"$SCRIPT_DIR/get_scarb_versions.sh\" ] || err \"get_scarb_versions.sh not found\"\n  _versions_output=$(cd \"$REPO_ROOT\" && \"$SCRIPT_DIR/get_scarb_versions.sh\")\n  [ -n \"$_versions_output\" ] || err \"get_scarb_versions.sh produced no output\"\n  info \"Scarb versions: $_versions_output\"\n  _versions=$(parse_scarb_versions \"$_versions_output\")\n  [ -n \"$_versions\" ] || err \"no scarb versions found\"\n\n  cd \"$REPO_ROOT\" || exit 1\n\n  # Reset Scarb version in `.tool-versions` to original on exit\n  _original_scarb=$(asdf current --no-header scarb 2>/dev/null | awk '{print $2}')\n  trap cleanup EXIT\n\n  _failed=\"\"\n  _ok=0\n  _total=0\n  for _ver in $_versions; do\n    _total=$((_total + 1))\n    info \"$SEPARATOR\"\n    info \"scarb $_ver\"\n    info \"$SEPARATOR\"\n    install_version \"scarb\" \"$_ver\"\n    set_tool_version \"scarb\" \"$_ver\"\n    if run_tests \"$UPDATE_SNAPSHOTS\"; then\n      _ok=$((_ok + 1))\n    else\n      _failed=\"${_failed}${_failed:+, }$_ver\"\n    fi\n  done\n\n  if [ -n \"$_failed\" ]; then\n    warn \"failed: $_failed\"\n    if [ \"$UPDATE_SNAPSHOTS\" = \"1\" ]; then\n      exit 0\n    fi\n    err \"run with --fix to update snapshots\"\n  fi\n  info \"${GREEN}${_ok}/${_total} passed${RESET}\"\n}\n\n\nsay() {\n  printf 'check_snapshots: %b\\n' \"$1\"\n}\n\ninfo() {\n  say \"${BOLD}info:${RESET} $1\"\n}\n\nwarn() {\n  say \"${BOLD}${YELLOW}warn:${RESET} ${YELLOW}$1${RESET}\"\n}\n\nerr() {\n  say \"${BOLD}${RED}error:${RESET} ${RED}$1${RESET}\" >&2\n  exit 1\n}\n\nneed_cmd() {\n  if ! check_cmd \"$1\"; then\n    err \"need '$1' (command not found)\"\n  fi\n}\n\ncheck_cmd() {\n  command -v \"$1\" >/dev/null 2>&1\n}\n\nensure() {\n  if ! \"$@\"; then err \"command failed: $*\"; fi\n}\n\ninstall_version() {\n  _tool=\"$1\"\n  _installed_version=\"$2\"\n  if check_version_installed \"$_tool\" \"$_installed_version\"; then\n    info \"$_tool $_installed_version is already installed\"\n  else\n    info \"Installing $_tool $_version...\"\n    ensure asdf install \"$_tool\" \"$_installed_version\"\n  fi\n}\n\ncheck_version_installed() {\n  _tool=\"$1\"\n  _version=\"$2\"\n  asdf list \"$_tool\" | grep -q \"^[^0-9]*${_version}$\"\n}\n\nset_tool_version() {\n  _tool=\"$1\"\n  _version=\"$2\"\n  info \"Setting $_tool version to $_version...\"\n  ensure asdf set \"$_tool\" \"$_version\"\n}\n\nparse_scarb_versions() {\n  echo \"$1\" | sed 's/\"//g' | tr ',' '\\n' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | grep -v '^$'\n}\n\ncleanup() {\n  if [ -n \"${_original_scarb:-}\" ]; then\n    asdf set scarb \"$_original_scarb\" 2>/dev/null || true\n  fi\n}\n\nmain \"$@\" || exit 1\n"
  },
  {
    "path": "scripts/compareVersions.js",
    "content": "const semver = require('semver')\n\nif (process.argv.length !== 4) {\n    console.error('Two arguments required');\n    process.exit(1);\n}\n\nconst old_version = process.argv[2];\nconst new_version = process.argv[3];\n\nconsole.log((semver.gt(new_version, old_version)).toString())\n"
  },
  {
    "path": "scripts/get_scarb_versions.sh",
    "content": "#!/bin/bash\nset -e\n\n# This script is used to find the following Scarb versions:\n# The current major.minor version along with all its patch versions\n# The latest patch versions for the two versions preceding the current one\n#\n# Options:\n#   --previous    List only versions older than the current Scarb version (from repo root .tool-versions).\n\nfunction get_all_patch_versions() {\n  asdf list all scarb \"$1\" | grep -v \"rc\"\n}\n\nfunction get_latest_patch_version() {\n  get_all_patch_versions \"$1\" | sort -uV | tail -1\n}\n\nfunction version_less_than() {\n  _version1=\"$1\"\n  _version2=\"$2\"\n  printf '%s\\n%s' \"$_version1\" \"$_version2\" | sort -V | head -n1 | grep -xqvF \"$_version2\"\n}\n\nPREVIOUS_ONLY=0\nfor arg in \"$@\"; do\n  case \"$arg\" in\n    --previous) PREVIOUS_ONLY=1 ;;\n  esac\ndone\n\nif [[ \"$PREVIOUS_ONLY\" -eq 1 ]]; then\n  repo_root=\"$(git rev-parse --show-toplevel)\"\n  tool_versions=\"$repo_root/.tool-versions\"\n  if [[ ! -f \"$tool_versions\" ]]; then\n    echo \".tool-versions not found at $tool_versions\" >&2\n    exit 1\n  fi\n  current=$(grep -E '^\\s*scarb\\s+' \"$tool_versions\" | awk '{ print $2 }')\n  if [[ -z \"$current\" ]]; then\n    echo \"no scarb version in $tool_versions\" >&2\n    exit 1\n  fi\nfi\n\nmajor_minor_versions=($(get_all_patch_versions | cut -d . -f 1,2 | sort -uV | tail -3))\n\ndeclare -a scarb_versions\n\nver=$(get_latest_patch_version \"${major_minor_versions[0]}\")\nif [[ \"$PREVIOUS_ONLY\" -eq 0 ]] || version_less_than \"$ver\" \"$current\"; then\n  scarb_versions+=(\"$ver\")\nfi\nver=$(get_latest_patch_version \"${major_minor_versions[1]}\")\nif [[ \"$PREVIOUS_ONLY\" -eq 0 ]] || version_less_than \"$ver\" \"$current\"; then\n  scarb_versions+=(\"$ver\")\nfi\nfor ver in $(get_all_patch_versions \"${major_minor_versions[2]}\" | sort -uV); do\n  if [[ \"$PREVIOUS_ONLY\" -eq 0 ]] || version_less_than \"$ver\" \"$current\"; then\n    scarb_versions+=(\"$ver\")\n  fi\ndone\n\nprintf '\"%s\", ' \"${scarb_versions[@]}\" | sed 's/, $/\\n/'\n"
  },
  {
    "path": "scripts/handle_version.sh",
    "content": "#!/bin/bash\n\nget_version() {\n  local overridden_version=$1\n  local plugin_path=$2\n  local default_version\n  default_version=$(grep \"^version =\" \"$plugin_path\" | cut -d '\"' -f 2)\n\n  if [ -z \"$overridden_version\" ]; then\n    echo \"$default_version\"\n  else\n    echo \"$overridden_version\"\n  fi\n}\n\nupdate_version_in_file() {\n  local file=$1\n  local version=$2\n\n  if [ -n \"$version\" ]; then\n    sed -i.bak \"/\\[package\\]/,/version =/ s/version = \\\".*/version = \\\"$version\\\"/\" \"$file\"\n    rm \"$file.bak\" 2> /dev/null\n  fi\n}\n\nexport -f get_version\nexport -f update_version_in_file\n"
  },
  {
    "path": "scripts/install.sh",
    "content": "#!/usr/bin/env sh\nset -e\n\necho Installing snfoundryup...\n\nLOCAL_BIN=\"${HOME}/.local/bin\"\n\nSNFOUNDRYUP_URL=\"https://raw.githubusercontent.com/foundry-rs/starknet-foundry/master/scripts/snfoundryup\"\nSNFOUNDRYUP_PATH=\"${LOCAL_BIN}/snfoundryup\"\n\n# Check for curl\nif ! command -v curl > /dev/null 2>&1; then\n    echo \"curl could not be found, please install it first.\"\n    exit 1\nfi\n\n\n# Create the ${HOME}/.local/bin bin directory and snfoundryup binary if it doesn't exist.\nmkdir -p \"${LOCAL_BIN}\"\ncurl -# -L \"${SNFOUNDRYUP_URL}\" -o \"${SNFOUNDRYUP_PATH}\"\nchmod +x \"${SNFOUNDRYUP_PATH}\"\n\n\n# Store the correct profile file (i.e. .profile for bash or .zshenv for ZSH).\ncase $SHELL in\n*/zsh)\n    PROFILE=${ZDOTDIR-\"$HOME\"}/.zshenv\n    PREF_SHELL=zsh\n    ;;\n*/bash)\n    PROFILE=$HOME/.bashrc\n    PREF_SHELL=bash\n    ;;\n*/fish)\n    PROFILE=$HOME/.config/fish/config.fish\n    PREF_SHELL=fish\n    ;;\n*/ash)\n    PROFILE=$HOME/.profile\n    PREF_SHELL=ash\n    ;;\n*)\n    echo \"snfoundryup: could not detect shell, manually add ${LOCAL_BIN} to your PATH.\"\n    exit 0\nesac\n\n# Only add snfoundryup if it isn't already in PATH.\ncase \":$PATH:\" in\n    *\":${LOCAL_BIN}:\"*)\n        # The path is already in PATH, do nothing\n        ;;\n    *)\n        # Add the snfoundryup directory to the path\n        echo >> \"$PROFILE\" && echo \"export PATH=\\\"\\$PATH:$LOCAL_BIN\\\"\" >> \"$PROFILE\"\n        ;;\nesac\n\nprintf \"\\nDetected your preferred shell is %s and added snfoundryup to PATH. Run 'source %s' or start a new terminal session to use snfoundryup.\\n\" \"$PREF_SHELL\" \"$PROFILE\"\nprintf \"Then, simply run 'snfoundryup' to install Starknet-Foundry.\\n\"\n"
  },
  {
    "path": "scripts/package.json",
    "content": "{\n  \"dependencies\": {\n    \"semver\": \"^7.5.4\"\n  }\n}\n"
  },
  {
    "path": "scripts/package.sh",
    "content": "#!/usr/bin/env bash\nset -euxo pipefail\n\nTARGET=\"$1\"\nPKG_FULL_NAME=\"$2\"\n\nrm -rf \"$PKG_FULL_NAME\"\nmkdir -p \"$PKG_FULL_NAME/bin\"\n\nbinary_crates=(\"snforge\" \"sncast\")\nfor crate in \"${binary_crates[@]}\"; do\n  cp \"./target/${TARGET}/release/${crate}\" \"$PKG_FULL_NAME/bin/\"\ndone\n\ncp -r README.md LICENSE \"$PKG_FULL_NAME/\"\n\ntar czvf \"${PKG_FULL_NAME}.tar.gz\" \"$PKG_FULL_NAME\"\n"
  },
  {
    "path": "scripts/release.sh",
    "content": "#!/bin/bash\nset -euxo pipefail\n\nVERSION=$1\n\nsed -i.bak \"s/## \\[Unreleased\\]/## \\[Unreleased\\]\\n\\n## \\[${VERSION}\\] - $(TZ=Europe/Krakow date '+%Y-%m-%d')/\" CHANGELOG.md\nrm CHANGELOG.md.bak 2> /dev/null\n\nsed -i.bak \"/\\[workspace.package\\]/,/version =/ s/version = \\\".*/version = \\\"${VERSION}\\\"/\" Cargo.toml\nrm Cargo.toml.bak 2> /dev/null\n\nsed -i.bak \"/\\[package\\]/,/version =/ s/version = \\\".*/version = \\\"${VERSION}\\\"/\" sncast_std/Scarb.toml\nrm sncast_std/Scarb.toml.bak 2> /dev/null\n\nscarb --manifest-path sncast_std/Scarb.toml build\n\nsed -i.bak \"/\\[package\\]/,/version =/ s/version = \\\".*/version = \\\"${VERSION}\\\"/\" snforge_std/Scarb.toml\nrm snforge_std/Scarb.toml.bak 2> /dev/null\n\nsed -i.bak \"/\\[package\\]/,/version =/ s/version = \\\".*/version = \\\"${VERSION}\\\"/\" crates/snforge-scarb-plugin/Scarb.toml\nrm crates/snforge-scarb-plugin/Scarb.toml.bak 2> /dev/null\n\nsed -i.bak \"/\\[package\\]/,/version =/ s/version = \\\".*/version = \\\"${VERSION}\\\"/\" crates/snforge-scarb-plugin/Cargo.toml\nrm crates/snforge-scarb-plugin/Cargo.toml.bak 2> /dev/null\n\nsed -i.bak \"/\\[preprocessor.variables.variables\\]/,/snforge_std_version =/ s/snforge_std_version = \\\".*/snforge_std_version = \\\"${VERSION}\\\"/\" docs/book.toml\nrm docs/book.toml.bak 2> /dev/null\n\n# start: Update cache test data\nVERSION_UNDERSCORED=$(echo \"$VERSION\" | tr '.' '_')\n\nDIRECTORY=\"crates/forge/tests/data/forking/.snfoundry_cache\"\nOLD_FILE_PATH=$(find \"$DIRECTORY\" -type f -regex '.*_v[0-9][a-z0-9_-]*\\.json')\n\n# Strip the shortest match of \"_v*\" starting from the end of the string\nOLD_FILE_PATH_BASE=\"${OLD_FILE_PATH%_v*}\"\nNEW_FILE_PATH=\"${OLD_FILE_PATH_BASE}_v${VERSION_UNDERSCORED}.json\"\n\nmv \"$OLD_FILE_PATH\" \"$NEW_FILE_PATH\"\n\nsed -i.bak -E \"s/\\\"cache_version\\\":\\\"[a-z0-9_-]+\\\"/\\\"cache_version\\\":\\\"${VERSION_UNDERSCORED}\\\"/\" \"$NEW_FILE_PATH\"\nrm \"$NEW_FILE_PATH.bak\" 2> /dev/null\n# end\n\nscarb --manifest-path snforge_std/Scarb.toml build\n\ncargo update\ncargo update --manifest-path crates/snforge-scarb-plugin/Cargo.toml\n"
  },
  {
    "path": "scripts/scarbfmt.sh",
    "content": "#!/usr/bin/env bash\n\nSNFOUNDRY_ROOT=\"$(git rev-parse --show-toplevel)\"\n\npushd \"$SNFOUNDRY_ROOT\" || exit\n\nfind . -type f -name \"Scarb.toml\" -execdir sh -c '\n  echo \"Running \\\"scarb fmt\\\" in directory: $PWD\"\n  scarb fmt\n' \\;\n\npopd || exit\n"
  },
  {
    "path": "scripts/smoke_test.sh",
    "content": "#!/bin/bash\n\nexport DEV_DISABLE_SNFORGE_STD_DEPENDENCY=true\n\nRPC_URL=\"$1\"\nSNFORGE_PATH=\"$2\"\nSNCAST_PATH=\"$3\"\nREPO_URL=\"$4\"\nREVISION=\"$5\"\nVERSION=\"$6\"\n\n# Check snforge_std from github repository\n\n$SNFORGE_PATH new my_project_0\npushd my_project_0 || exit\nscarb add --dev snforge_std --git \"$REPO_URL\" --rev \"$REVISION\"\n$SNFORGE_PATH test || exit\npopd || exit\nscarb cache clean\n\n# Check snforge_std from registry with prebuilt plugin\n\n$SNFORGE_PATH new my_project_1\npushd my_project_1 || exit\nsed -i.bak \"/^\\[dev-dependencies\\]/a\\\\\nsnforge_std = { version = \\\"=${VERSION}\\\", registry = \\\"https://scarbs.dev/\\\" }\\\\\n\" Scarb.toml\nrm Scarb.toml.bak 2>/dev/null\n\ntest_output=$($SNFORGE_PATH test)\ntest_exit=$?\n\necho $test_output\n\nif [[ $test_exit -ne 0 ]] || echo \"$test_output\" | grep -q 'Compiling snforge_scarb_plugin'; then\n    exit 1\nfi\npopd || exit\nscarb cache clean\n\n# Check snforge_std from registry without prebuilt plugin\n\n$SNFORGE_PATH new my_project_2\npushd my_project_2 || exit\nsed -i.bak \"/^\\[dev-dependencies\\]/a\\\\\nsnforge_std = { version = \\\"=${VERSION}\\\", registry = \\\"https://scarbs.dev/\\\" }\\\\\n\" Scarb.toml\nsed -i.bak '/^allow-prebuilt-plugins = \\[\"snforge_std\"\\]$/d' Scarb.toml\nrm Scarb.toml.bak 2>/dev/null\n$SNFORGE_PATH test || exit\npopd || exit\nscarb cache clean\n\n# Check cast\n\n if ! $SNCAST_PATH call \\\n     --url \"$RPC_URL\" \\\n     --contract-address 0x06b248bde9ce00d69099304a527640bc9515a08f0b49e5168e2096656f207e1d \\\n     --function \"get\" --calldata 0x1 | grep -q $'Success: Call completed\\n\\nResponse:     0x0\\nResponse Raw: [0x0]'; then\n   exit 1\n fi\n"
  },
  {
    "path": "scripts/snfoundryup",
    "content": "#!/bin/sh\n# shellcheck shell=dash\n# shellcheck disable=SC2039\n\n# This is just a little script that can be downloaded from the internet to install Starknet Foundry.\n# It just does platform detection, downloads the release archive, extracts it and tries to make\n# the `snforge` and `sncast` binaries available in $PATH in least invasive way possible.\n#\n# It runs on Unix shells like {a,ba,da,k,z}sh. It uses the common `local` extension.\n# Note: Most shells limit `local` to 1 var per line, contra bash.\n#\n# Most of this code is based on/copy-pasted from rustup and protostar installers.\n\nset -u\n\nREPO=\"https://github.com/foundry-rs/starknet-foundry\"\nXDG_DATA_HOME=\"${XDG_DATA_HOME:-\"${HOME}/.local/share\"}\"\nINSTALL_ROOT=\"${XDG_DATA_HOME}/starknet-foundry-install\"\nLOCAL_BIN=\"${HOME}/.local/bin\"\nLOCAL_BIN_ESCAPED=\"\\$HOME/.local/bin\"\nBINARIES=\"snforge sncast\" # Array syntax for shells. List can be expanded for new binaries\nusage() {\n  cat <<EOF\nThe installer for Starknet Foundry\n\nUsage: install.sh [OPTIONS]\n\nOptions:\n  -p, --no-modify-path   Skip PATH variable modification\n  -h, --help             Print help\n  -v, --version          Specify Starknet Foundry version to install\n  -c, --commit           Specify a specific commit hash to install from\n\nFor more information, check out https://foundry-rs.github.io/starknet-foundry/getting-started/installation.html\nEOF\n}\nprint_docs_and_community_info() {\n  cat <<EOF\n\nRead the docs:\n- Starknet Foundry Book: https://foundry-rs.github.io/starknet-foundry/\n- Cairo Book: https://book.cairo-lang.org/\n- Starknet Book: https://book.starknet.io/\n- Starknet Documentation: https://docs.starknet.io/\n- Scarb Documentation: https://docs.swmansion.com/scarb/docs.html\n\nJoin the community:\n- Follow core developers on X: https://twitter.com/swmansionxyz\n- Get support via Telegram: https://t.me/starknet_foundry_support\n- Or discord: https://discord.gg/starknet-community\n- Or join our general chat (Telegram): https://t.me/starknet_foundry\n\nReport bugs: https://github.com/foundry-rs/starknet-foundry/issues/new/choose\n\nEOF\n}\n\nmain() {\n  need_cmd chmod\n  need_cmd curl\n  need_cmd grep\n  need_cmd mkdir\n  need_cmd mktemp\n  need_cmd rm\n  need_cmd sed\n  need_cmd tar\n  need_cmd uname\n\n  # Transform long options to short ones.\n  for arg in \"$@\"; do\n  shift\n  case \"$arg\" in\n    '--help')           set -- \"$@\" '-h'   ;;\n    '--no-modify-path') set -- \"$@\" '-p'   ;;\n    '--version')        set -- \"$@\" '-v'   ;;\n    '--commit')         set -- \"$@\" '-c'   ;;\n    *)                  set -- \"$@\" \"$arg\" ;;\n  esac\n  done\n\n  download_universal_sierra_compiler\n\n  local _requested_ref=\"latest\"\n  local _requested_version=\"latest\"\n  local _do_modify_path=1\n  local _commit_hash=\"\"\n  while getopts \":hpv:c:\" opt; do\n    case $opt in\n    p)\n      _do_modify_path=0\n      ;;\n    h)\n      usage\n      exit 0\n      ;;\n    v)\n      _requested_ref=\"tag/v${OPTARG}\"\n      _requested_version=\"$OPTARG\"\n      ;;\n    c)\n      need_cmd cargo\n      _commit_hash=\"$OPTARG\"\n      clone_and_build \"$_commit_hash\"\n      exit 0\n      ;;\n    \\?)\n      err \"invalid option -$OPTARG\"\n      ;;\n    :)\n      err \"option -$OPTARG requires an argument\"\n      ;;\n    esac\n  done\n  resolve_version \"$_requested_version\" \"$_requested_ref\" || return 1\n  local _resolved_version=$RETVAL\n  assert_nz \"$_resolved_version\" \"resolved_version\"\n\n  get_architecture || return 1\n  local _arch=\"$RETVAL\"\n  assert_nz \"$_arch\" \"arch\"\n\n  local _tempdir\n  if ! _tempdir=\"$(ensure mktemp -d)\"; then\n    # Because the previous command ran in a subshell, we must manually propagate exit status.\n    exit 1\n  fi\n\n  ensure mkdir -p \"$_tempdir\"\n\n  create_install_dir \"$(echo \"$_resolved_version\" | sed 's/^.//')\" # truncating first character\n  local _installdir=$RETVAL\n  assert_nz \"$_installdir\" \"installdir\"\n\n  download \"$_resolved_version\" \"$_arch\" \"$_installdir\" \"$_tempdir\"\n\n  say \"installed snforge and sncast to ${_installdir}\"\n\n  create_symlinks \"$_installdir\"\n  local _retval=$?\n\n  echo\n  print_docs_and_community_info\n  if echo \":$PATH:\" | grep -q \":${LOCAL_BIN}:\"; then\n    echo \"Starknet Foundry has been successfully installed and should be already available in your PATH.\"\n    echo \"Run 'snforge --version' and 'sncast --version' to verify your installation. Happy coding!\"\n  else\n    if [ $_do_modify_path -eq 1 ]; then\n      add_local_bin_to_path\n      _retval=$?\n    else\n      echo \"Skipping PATH modification, please manually add '${LOCAL_BIN_ESCAPED}' to your PATH.\"\n    fi\n\n    echo \"Then, run 'snforge --version' and 'sncast --version' to verify your installation. Happy coding!\"\n  fi\n\n  ignore rm -rf \"$_tempdir\"\n  return \"$_retval\"\n}\n\n# This function has been copied verbatim from rustup install script.\ncheck_proc() {\n    # Check for /proc by looking for the /proc/self/exe link\n    # This is only run on Linux\n    if ! test -L /proc/self/exe ; then\n        err \"fatal: Unable to find /proc/self/exe.  Is /proc mounted?  Installation cannot proceed without /proc.\"\n    fi\n}\n\n# This function has been copied verbatim from rustup install script.\nget_bitness() {\n    need_cmd head\n    # Architecture detection without dependencies beyond coreutils.\n    # ELF files start out \"\\x7fELF\", and the following byte is\n    #   0x01 for 32-bit and\n    #   0x02 for 64-bit.\n    # The printf builtin on some shells like dash only supports octal\n    # escape sequences, so we use those.\n    local _current_exe_head\n    _current_exe_head=$(head -c 5 /proc/self/exe )\n    if [ \"$_current_exe_head\" = \"$(printf '\\177ELF\\001')\" ]; then\n        echo 32\n    elif [ \"$_current_exe_head\" = \"$(printf '\\177ELF\\002')\" ]; then\n        echo 64\n    else\n        err \"unknown platform bitness\"\n    fi\n}\n\nsay() {\n  printf 'starknet-foundry-install: %s\\n' \"$1\"\n}\n\nerr() {\n  say \"$1\" >&2\n  exit 1\n}\n\nneed_cmd() {\n  if ! check_cmd \"$1\"; then\n    err \"need '$1' (command not found)\"\n  fi\n}\n\ncheck_cmd() {\n  command -v \"$1\" >/dev/null 2>&1\n}\n\nassert_nz() {\n  if [ -z \"$1\" ]; then err \"assert_nz $2\"; fi\n}\n\n# Run a command that should never fail.\n# If the command fails execution will immediately terminate with an error showing the failing command.\nensure() {\n  if ! \"$@\"; then err \"command failed: $*\"; fi\n}\n\n# This is just for indicating that commands' results are being intentionally ignored.\n# Usually, because it's being executed as part of error handling.\nignore() {\n  \"$@\"\n}\n\ndownload_universal_sierra_compiler() {\n  curl -L https://raw.githubusercontent.com/software-mansion/universal-sierra-compiler/master/scripts/install.sh | sh\n}\n\n# This function has been copied verbatim from rustup install script.\nget_architecture() {\n  local _ostype _cputype _bitness _arch _clibtype\n  _ostype=\"$(uname -s)\"\n  _cputype=\"$(uname -m)\"\n  _clibtype=\"gnu\"\n\n  if [ \"$_ostype\" = Linux ]; then\n    if [ \"$(uname -o)\" = Android ]; then\n      _ostype=Android\n    fi\n    if ldd --_requested_version 2>&1 | grep -q 'musl'; then\n      _clibtype=\"musl\"\n    fi\n  fi\n\n  if [ \"$_ostype\" = Darwin ] && [ \"$_cputype\" = i386 ]; then\n    # Darwin `uname -m` lies\n    if sysctl hw.optional.x86_64 | grep -q ': 1'; then\n      _cputype=x86_64\n    fi\n  fi\n\n  if [ \"$_ostype\" = SunOS ]; then\n    # Both Solaris and illumos presently announce as \"SunOS\" in \"uname -s\"\n    # so use \"uname -o\" to disambiguate.  We use the full path to the\n    # system uname in case the user has coreutils uname first in PATH,\n    # which has historically sometimes printed the wrong value here.\n    if [ \"$(/usr/bin/uname -o)\" = illumos ]; then\n      _ostype=illumos\n    fi\n\n    # illumos systems have multi-arch userlands, and \"uname -m\" reports the\n    # machine hardware name; e.g., \"i86pc\" on both 32- and 64-bit x86\n    # systems.  Check for the native (widest) instruction set on the\n    # running kernel:\n    if [ \"$_cputype\" = i86pc ]; then\n      _cputype=\"$(isainfo -n)\"\n    fi\n  fi\n\n  case \"$_ostype\" in\n  Android)\n    _ostype=linux-android\n    ;;\n\n  Linux)\n    check_proc\n    _ostype=unknown-linux-$_clibtype\n    _bitness=$(get_bitness)\n    ;;\n\n  FreeBSD)\n    _ostype=unknown-freebsd\n    ;;\n\n  NetBSD)\n    _ostype=unknown-netbsd\n    ;;\n\n  DragonFly)\n    _ostype=unknown-dragonfly\n    ;;\n\n  Darwin)\n    _ostype=apple-darwin\n    ;;\n\n  illumos)\n    _ostype=unknown-illumos\n    ;;\n\n  MINGW* | MSYS* | CYGWIN* | Windows_NT)\n    _ostype=pc-windows-gnu\n    ;;\n\n  *)\n    err \"unrecognized OS type: $_ostype\"\n    ;;\n  esac\n\n  case \"$_cputype\" in\n  i386 | i486 | i686 | i786 | x86)\n    _cputype=i686\n    ;;\n\n  xscale | arm)\n    _cputype=arm\n    if [ \"$_ostype\" = \"linux-android\" ]; then\n      _ostype=linux-androideabi\n    fi\n    ;;\n\n  armv6l)\n    _cputype=arm\n    if [ \"$_ostype\" = \"linux-android\" ]; then\n      _ostype=linux-androideabi\n    else\n      _ostype=\"${_ostype}eabihf\"\n    fi\n    ;;\n\n  armv7l | armv8l)\n    _cputype=armv7\n    if [ \"$_ostype\" = \"linux-android\" ]; then\n      _ostype=linux-androideabi\n    else\n      _ostype=\"${_ostype}eabihf\"\n    fi\n    ;;\n\n  aarch64 | arm64)\n    _cputype=aarch64\n    ;;\n\n  x86_64 | x86-64 | x64 | amd64)\n    _cputype=x86_64\n    ;;\n\n  mips)\n    _cputype=$(get_endianness mips '' el)\n    ;;\n\n  mips64)\n    if [ \"$_bitness\" -eq 64 ]; then\n      # only n64 ABI is supported for now\n      _ostype=\"${_ostype}abi64\"\n      _cputype=$(get_endianness mips64 '' el)\n    fi\n    ;;\n\n  ppc)\n    _cputype=powerpc\n    ;;\n\n  ppc64)\n    _cputype=powerpc64\n    ;;\n\n  ppc64le)\n    _cputype=powerpc64le\n    ;;\n\n  s390x)\n    _cputype=s390x\n    ;;\n  riscv64)\n    _cputype=riscv64gc\n    ;;\n  loongarch64)\n    _cputype=loongarch64\n    ;;\n  *)\n    err \"unknown CPU type: $_cputype\"\n    ;;\n  esac\n\n  # Detect 64-bit linux with 32-bit userland\n  if [ \"${_ostype}\" = unknown-linux-gnu ] && [ \"${_bitness}\" -eq 32 ]; then\n    case $_cputype in\n    x86_64)\n      if [ -n \"${RUSTUP_CPUTYPE:-}\" ]; then\n        _cputype=\"$RUSTUP_CPUTYPE\"\n      else {\n        # 32-bit executable for amd64 = x32\n        if is_host_amd64_elf; then\n          err \"x86_64 linux with x86 userland unsupported\"\n        else\n          _cputype=i686\n        fi\n      }; fi\n      ;;\n    mips64)\n      _cputype=$(get_endianness mips '' el)\n      ;;\n    powerpc64)\n      _cputype=powerpc\n      ;;\n    aarch64)\n      _cputype=armv7\n      if [ \"$_ostype\" = \"linux-android\" ]; then\n        _ostype=linux-androideabi\n      else\n        _ostype=\"${_ostype}eabihf\"\n      fi\n      ;;\n    riscv64gc)\n      err \"riscv64 with 32-bit userland unsupported\"\n      ;;\n    esac\n  fi\n\n  # Detect armv7 but without the CPU features Rust needs in that build,\n  # and fall back to arm.\n  # See https://github.com/rust-lang/rustup.rs/issues/587.\n  if [ \"$_ostype\" = \"unknown-linux-gnueabihf\" ] && [ \"$_cputype\" = armv7 ]; then\n    if ensure grep '^Features' /proc/cpuinfo | grep -q -v neon; then\n      # At least one processor does not have NEON.\n      _cputype=arm\n    fi\n  fi\n\n  _arch=\"${_cputype}-${_ostype}\"\n\n  RETVAL=\"$_arch\"\n}\n\nresolve_version() {\n  local _requested_version=$1\n  local _requested_ref=$2\n\n  local _response\n\n  say \"retrieving $_requested_version version from ${REPO}...\"\n  _response=$(ensure curl -# -Ls -H 'Accept: application/json' \"${REPO}/releases/${_requested_ref}\")\n  if [ \"{\\\"error\\\":\\\"Not Found\\\"}\" = \"$_response\" ]; then\n    err \"version $_requested_version not found\"\n  fi\n\n  RETVAL=$(echo \"$_response\" | sed -e 's/.*\"tag_name\":\"\\([^\"]*\\)\".*/\\1/')\n}\n\ncreate_install_dir() {\n  local _requested_version=$1\n\n  local _installdir=\"${INSTALL_ROOT}/${_requested_version}\"\n\n  if [ -d \"$_installdir\" ]; then\n    ensure rm -rf \"$_installdir\"\n    say \"removed existing snforge and sncast installation at ${_installdir}\"\n  fi\n\n  ensure mkdir -p \"$_installdir\"\n\n  RETVAL=$_installdir\n}\n\ndownload() {\n  local _resolved_version=$1\n  local _arch=$2\n  local _installdir=$3\n  local _tempdir=$4\n\n  local _tarball=\"starknet-foundry-${_resolved_version}-${_arch}.tar.gz\"\n  local _url=\"${REPO}/releases/download/${_resolved_version}/${_tarball}\"\n  local _dl=\"$_tempdir/starknet-foundry.tar.gz\"\n\n  say \"downloading ${_tarball}...\"\n\n  ensure curl -# -fLS -o \"$_dl\" \"$_url\"\n  ensure tar -xz -C \"$_installdir\" --strip-components=1 -f \"$_dl\"\n}\n\ncreate_symlinks() {\n  local _installdir=$1\n  for binary in $BINARIES; do\n    local _binary=\"${_installdir}/bin/${binary}\"\n    local _symlink=\"${LOCAL_BIN}/${binary}\"\n\n    ensure mkdir -p \"$LOCAL_BIN\"\n    ensure ln -fs \"$_binary\" \"$_symlink\"\n    ensure chmod u+x \"$_symlink\"\n    say \"created symlink ${_symlink} -> ${_binary}\"\n  done\n}\n\nadd_local_bin_to_path() {\n  local _profile\n  local _pref_shell\n  case ${SHELL:-\"\"} in\n  */zsh)\n    _profile=$HOME/.zshrc\n    _pref_shell=zsh\n    ;;\n  */ash)\n    _profile=$HOME/.profile\n    _pref_shell=ash\n    ;;\n  */bash)\n    _profile=$HOME/.bashrc\n    _pref_shell=bash\n    ;;\n  */fish)\n    _profile=$HOME/.config/fish/config.fish\n    _pref_shell=fish\n    ;;\n  *)\n    err \"could not detect shell, manually add '${LOCAL_BIN_ESCAPED}' to your PATH.\"\n    ;;\n  esac\n\n  echo >>\"$_profile\" && echo \"export PATH=\\\"\\$PATH:${LOCAL_BIN_ESCAPED}\\\"\" >>\"$_profile\"\n  echo \\\n    \"Detected your preferred shell is ${_pref_shell} and added '${LOCAL_BIN_ESCAPED}' to PATH.\" \\\n    \"Run 'source ${_profile}' or start a new terminal session to use Starknet Foundry.\"\n}\n\nclone_and_build() {\n  local _commit_hash=$1\n  local _tempdir\n\n  if ! _tempdir=\"$(ensure mktemp -d)\"; then\n    exit 1\n  fi\n\n  say \"Cloning repository at commit $_commit_hash...\"\n  ensure git clone \"$REPO\" \"$_tempdir\"\n  ensure cd \"$_tempdir\"\n  ensure git fetch --all\n  ensure git checkout \"$_commit_hash\"\n\n  say \"Building binaries with cargo...\"\n  ensure cargo build --release\n\n  local _build_output_dir=\"$PWD/target/release\"\n\n  create_install_dir \"${_commit_hash}/bin\"\n  local _installdir=${RETVAL%????} # create_symlinks expects a PATH with /bin stripped, rather than modifying the function, we just strip it here.\n  assert_nz \"$_installdir\" \"installdir\"\n\n  ensure cp \"$_build_output_dir/snforge\" \"$_installdir/bin/snforge\"\n  ensure cp \"$_build_output_dir/sncast\" \"$_installdir/bin/sncast\"\n\n  create_symlinks \"$_installdir\"\n\n  ensure cd - > /dev/null  # Go back to the previous directory and suppress output\n}\n\nmain \"$@\" || exit 1\n"
  },
  {
    "path": "scripts/verify_cairo_listings.sh",
    "content": "#!/bin/bash\nset -xe\n\nfor d in ./docs/listings/*; do (cd \"$d\" && scarb check); done\n"
  },
  {
    "path": "sncast_std/README.md",
    "content": "# sncast_std\n\nFor a library reference please visit https://foundry-rs.github.io/starknet-foundry/appendix/sncast-library.html\n\nFull documentation can be found at https://foundry-rs.github.io/starknet-foundry/sncast_std/\n"
  },
  {
    "path": "sncast_std/Scarb.lock",
    "content": "# Code generated by scarb DO NOT EDIT.\nversion = 1\n\n[[package]]\nname = \"sncast_std\"\nversion = \"0.59.0\"\n"
  },
  {
    "path": "sncast_std/Scarb.toml",
    "content": "[package]\nname = \"sncast_std\"\nversion = \"0.59.0\"\nedition = \"2023_11\"\ndescription = \"Library used for writing deployment scripts in Cairo\"\nhomepage = \"https://foundry-rs.github.io/starknet-foundry/starknet/script.html\"\ndocumentation = \"https://foundry-rs.github.io/starknet-foundry/appendix/sncast-library.html\"\nrepository = \"https://github.com/foundry-rs/starknet-foundry\"\nlicense-file = \"../LICENSE\"\n"
  },
  {
    "path": "sncast_std/src/lib.cairo",
    "content": "use core::array::ArrayTrait;\nuse core::fmt::{Debug, Display, Error, Formatter};\nuse core::serde::Serde;\nuse starknet::testing::cheatcode;\nuse starknet::{ClassHash, ContractAddress};\n\n#[derive(Drop, PartialEq, Serde, Debug)]\npub struct ErrorData {\n    msg: ByteArray,\n}\n\n#[derive(Drop, PartialEq, Serde, Debug)]\npub struct ContractErrorData {\n    revert_error: ContractExecutionError,\n}\n\n#[derive(Drop, PartialEq, Debug)]\npub struct TransactionExecutionErrorData {\n    transaction_index: felt252,\n    execution_error: ContractExecutionError,\n}\n\nimpl TransactionExecutionErrorDataSerde of Serde<TransactionExecutionErrorData> {\n    fn serialize(self: @TransactionExecutionErrorData, ref output: Array<felt252>) {\n        output.append(*self.transaction_index);\n        self.execution_error.serialize(ref output);\n    }\n    fn deserialize(ref serialized: Span<felt252>) -> Option<TransactionExecutionErrorData> {\n        let transaction_index = (*serialized.pop_front()?);\n        let execution_error = Serde::<ContractExecutionError>::deserialize(ref serialized)\n            .expect('Failed to deserialize');\n        Option::Some(TransactionExecutionErrorData { transaction_index, execution_error })\n    }\n}\n\n#[derive(Drop, PartialEq, Debug)]\npub enum ContractExecutionError {\n    Nested: Box<ContractExecutionErrorInner>,\n    Message: ByteArray,\n}\n\n#[derive(Drop, Serde, Debug)]\npub struct ContractExecutionErrorInner {\n    contract_address: ContractAddress,\n    class_hash: felt252,\n    selector: felt252,\n    error: ContractExecutionError,\n}\n\nimpl ContractExecutionErrorInnerPartialEq of PartialEq<ContractExecutionErrorInner> {\n    fn eq(lhs: @ContractExecutionErrorInner, rhs: @ContractExecutionErrorInner) -> bool {\n        lhs.contract_address == rhs.contract_address\n            && lhs.class_hash == rhs.class_hash\n            && lhs.selector == rhs.selector\n            && lhs.error == rhs.error\n    }\n}\n\nimpl BoxContractExecutionErrorInnerPartialEq of PartialEq<Box<ContractExecutionErrorInner>> {\n    fn eq(lhs: @Box<ContractExecutionErrorInner>, rhs: @Box<ContractExecutionErrorInner>) -> bool {\n        let lhs = (lhs).as_snapshot().unbox();\n        let rhs = (rhs).as_snapshot().unbox();\n        ContractExecutionErrorInnerPartialEq::eq(lhs, rhs)\n    }\n}\n\nimpl ContractExecutionErrorSerde of Serde<ContractExecutionError> {\n    fn serialize(self: @ContractExecutionError, ref output: Array<felt252>) {\n        // We need to add 0 and 1 because of enum variants serialization\n        match self {\n            ContractExecutionError::Nested(inner) => {\n                let inner = inner.as_snapshot().unbox();\n                output.append(0);\n                inner.serialize(ref output);\n            },\n            ContractExecutionError::Message(msg) => {\n                output.append(1);\n                msg.serialize(ref output);\n            },\n        }\n    }\n    fn deserialize(ref serialized: Span<felt252>) -> Option<ContractExecutionError> {\n        let first = (*serialized.pop_front()?);\n\n        if first == 0 {\n            let inner = Serde::<ContractExecutionErrorInner>::deserialize(ref serialized)\n                .expect('Failed to deserialize');\n            let inner = BoxTrait::new(inner);\n            Option::Some(ContractExecutionError::Nested(inner))\n        } else {\n            let message = Serde::<ByteArray>::deserialize(ref serialized)\n                .expect('Failed to deserialize');\n            Option::Some(ContractExecutionError::Message(message))\n        }\n    }\n}\n\nimpl BoxContractExecutionErrorSerde of Serde<Box<ContractExecutionError>> {\n    fn serialize(self: @Box<ContractExecutionError>, ref output: Array<felt252>) {\n        let unboxed = self.as_snapshot().unbox();\n        Serde::<ContractExecutionError>::serialize(unboxed, ref output)\n    }\n    fn deserialize(ref serialized: Span<felt252>) -> Option<Box<ContractExecutionError>> {\n        Option::Some(BoxTrait::new(ContractExecutionErrorSerde::deserialize(ref serialized)?))\n    }\n}\n\n#[derive(Drop, Serde, PartialEq, Debug)]\npub enum StarknetError {\n    /// Failed to receive transaction\n    FailedToReceiveTransaction,\n    /// Contract not found\n    ContractNotFound,\n    /// Requested entrypoint does not exist in the contract\n    EntryPointNotFound,\n    /// Block not found\n    BlockNotFound,\n    /// Invalid transaction index in a block\n    InvalidTransactionIndex,\n    /// Class hash not found\n    ClassHashNotFound,\n    /// Transaction hash not found\n    TransactionHashNotFound,\n    /// Contract error\n    ContractError: ContractErrorData,\n    /// Transaction execution error\n    TransactionExecutionError: TransactionExecutionErrorData,\n    /// Class already declared\n    ClassAlreadyDeclared,\n    /// Invalid transaction nonce\n    InvalidTransactionNonce,\n    /// The transaction's resources don't cover validation or the minimal transaction fee\n    InsufficientResourcesForValidate,\n    /// Account balance is smaller than the transaction's max_fee\n    InsufficientAccountBalance,\n    /// Account validation failed\n    ValidationFailure: ErrorData,\n    /// Compilation failed\n    CompilationFailed,\n    /// Contract class size it too large\n    ContractClassSizeIsTooLarge,\n    /// Sender address in not an account contract\n    NonAccount,\n    /// A transaction with the same hash already exists in the mempool\n    DuplicateTx,\n    /// the compiled class hash did not match the one supplied in the transaction\n    CompiledClassHashMismatch,\n    /// the transaction version is not supported\n    UnsupportedTxVersion,\n    /// the contract class version is not supported\n    UnsupportedContractClassVersion,\n    /// An unexpected error occurred\n    UnexpectedError: ErrorData,\n}\n\n#[derive(Drop, Serde, PartialEq, Debug)]\npub enum ProviderError {\n    StarknetError: StarknetError,\n    RateLimited,\n    UnknownError: ErrorData,\n}\n\n#[derive(Drop, Serde, PartialEq, Debug)]\npub enum TransactionError {\n    Reverted: ErrorData,\n}\n\n#[derive(Drop, Serde, PartialEq, Debug)]\npub enum WaitForTransactionError {\n    TransactionError: TransactionError,\n    TimedOut,\n    ProviderError: ProviderError,\n}\n\n#[derive(Drop, Serde, PartialEq, Debug)]\npub enum ScriptCommandError {\n    UnknownError: ErrorData,\n    ContractArtifactsNotFound: ErrorData,\n    WaitForTransactionError: WaitForTransactionError,\n    ProviderError: ProviderError,\n}\n\npub impl DisplayClassHash of Display<ClassHash> {\n    fn fmt(self: @ClassHash, ref f: Formatter) -> Result<(), Error> {\n        let class_hash: felt252 = (*self).into();\n        Display::fmt(@class_hash, ref f)\n    }\n}\n\npub impl DisplayContractAddress of Display<ContractAddress> {\n    fn fmt(self: @ContractAddress, ref f: Formatter) -> Result<(), Error> {\n        let addr: felt252 = (*self).into();\n        Display::fmt(@addr, ref f)\n    }\n}\n\n#[derive(Drop, Clone, Debug, Serde)]\npub struct CallResult {\n    pub data: Array<felt252>,\n}\n\nimpl DisplayCallResult of Display<CallResult> {\n    fn fmt(self: @CallResult, ref f: Formatter) -> Result<(), Error> {\n        Debug::fmt(self.data, ref f)\n    }\n}\n\npub fn call(\n    contract_address: ContractAddress, function_selector: felt252, calldata: Array<felt252>,\n) -> Result<CallResult, ScriptCommandError> {\n    let contract_address_felt: felt252 = contract_address.into();\n    let mut inputs = array![contract_address_felt, function_selector];\n\n    let mut calldata_serialized = array![];\n    calldata.serialize(ref calldata_serialized);\n\n    inputs.append_span(calldata_serialized.span());\n\n    let mut buf = handle_cheatcode(cheatcode::<'call'>(inputs.span()));\n\n    let mut result_data: Result<CallResult, ScriptCommandError> =\n        match Serde::<Result<CallResult>>::deserialize(ref buf) {\n        Option::Some(result_data) => result_data,\n        Option::None => panic!(\"call deserialize failed\"),\n    };\n\n    result_data\n}\n\n#[derive(Drop, Copy, Debug, Serde)]\npub enum DeclareResult {\n    AlreadyDeclared: AlreadyDeclaredResult,\n    Success: DeclareTransactionResult,\n}\n\n#[derive(Drop, Copy, Debug, Serde)]\npub struct DeclareTransactionResult {\n    pub class_hash: ClassHash,\n    pub transaction_hash: felt252,\n}\n\n#[derive(Drop, Copy, Debug, Serde)]\npub struct AlreadyDeclaredResult {\n    pub class_hash: ClassHash,\n}\n\npub trait DeclareResultTrait {\n    fn class_hash(self: @DeclareResult) -> @ClassHash;\n}\n\nimpl DeclareResultImpl of DeclareResultTrait {\n    fn class_hash(self: @DeclareResult) -> @ClassHash {\n        match self {\n            DeclareResult::Success(result) => result.class_hash,\n            DeclareResult::AlreadyDeclared(result) => result.class_hash,\n        }\n    }\n}\n\nimpl DisplayDeclareResult of Display<DeclareResult> {\n    fn fmt(self: @DeclareResult, ref f: Formatter) -> Result<(), Error> {\n        match self {\n            DeclareResult::Success(result) => write!(\n                f,\n                \"class_hash: {}, transaction_hash: {}\",\n                result.class_hash,\n                result.transaction_hash,\n            ),\n            DeclareResult::AlreadyDeclared(result) => write!(\n                f, \"class_hash: {}\", result.class_hash,\n            ),\n        }\n    }\n}\n\npub fn declare(\n    contract_name: ByteArray, fee_settings: FeeSettings, nonce: Option<felt252>,\n) -> Result<DeclareResult, ScriptCommandError> {\n    let mut inputs = array![];\n\n    contract_name.serialize(ref inputs);\n\n    let mut fee_settings_serialized = array![];\n    fee_settings.serialize(ref fee_settings_serialized);\n\n    let mut nonce_serialized = array![];\n    nonce.serialize(ref nonce_serialized);\n\n    inputs.append_span(fee_settings_serialized.span());\n    inputs.append_span(nonce_serialized.span());\n\n    let mut buf = handle_cheatcode(cheatcode::<'declare'>(inputs.span()));\n\n    let mut result_data: Result<DeclareResult, ScriptCommandError> =\n        match Serde::<Result<DeclareResult>>::deserialize(ref buf) {\n        Option::Some(result_data) => result_data,\n        Option::None => panic!(\"declare deserialize failed\"),\n    };\n\n    result_data\n}\n\n#[derive(Drop, Copy, Debug, Serde)]\npub struct DeployResult {\n    pub contract_address: ContractAddress,\n    pub transaction_hash: felt252,\n}\n\nimpl DisplayDeployResult of Display<DeployResult> {\n    fn fmt(self: @DeployResult, ref f: Formatter) -> Result<(), Error> {\n        write!(\n            f,\n            \"contract_address: {}, transaction_hash: {}\",\n            *self.contract_address,\n            *self.transaction_hash,\n        )\n    }\n}\n\n#[derive(Drop, Copy, Debug, Serde, PartialEq)]\npub struct FeeSettings {\n    max_fee: Option<felt252>,\n    l1_gas: Option<u64>,\n    l1_gas_price: Option<u128>,\n    l2_gas: Option<u64>,\n    l2_gas_price: Option<u128>,\n    l1_data_gas: Option<u64>,\n    l1_data_gas_price: Option<u128>,\n}\n\n#[generate_trait]\npub impl FeeSettingsImpl of FeeSettingsTrait {\n    fn resource_bounds(\n        l1_gas: u64,\n        l1_gas_price: u128,\n        l2_gas: u64,\n        l2_gas_price: u128,\n        l1_data_gas: u64,\n        l1_data_gas_price: u128,\n    ) -> FeeSettings {\n        FeeSettings {\n            max_fee: Option::None,\n            l1_gas: Option::Some(l1_gas),\n            l1_gas_price: Option::Some(l1_gas_price),\n            l2_gas: Option::Some(l2_gas),\n            l2_gas_price: Option::Some(l2_gas_price),\n            l1_data_gas: Option::Some(l1_data_gas),\n            l1_data_gas_price: Option::Some(l1_data_gas_price),\n        }\n    }\n\n    fn max_fee(max_fee: felt252) -> FeeSettings {\n        FeeSettings {\n            max_fee: Option::Some(max_fee),\n            l1_gas: Option::None,\n            l1_gas_price: Option::None,\n            l2_gas: Option::None,\n            l2_gas_price: Option::None,\n            l1_data_gas: Option::None,\n            l1_data_gas_price: Option::None,\n        }\n    }\n\n    fn estimate() -> FeeSettings {\n        FeeSettings {\n            max_fee: Option::None,\n            l1_gas: Option::None,\n            l1_gas_price: Option::None,\n            l2_gas: Option::None,\n            l2_gas_price: Option::None,\n            l1_data_gas: Option::None,\n            l1_data_gas_price: Option::None,\n        }\n    }\n}\n\npub fn deploy(\n    class_hash: ClassHash,\n    constructor_calldata: Array<felt252>,\n    salt: Option<felt252>,\n    unique: bool,\n    fee_settings: FeeSettings,\n    nonce: Option<felt252>,\n) -> Result<DeployResult, ScriptCommandError> {\n    let class_hash_felt: felt252 = class_hash.into();\n    let mut inputs = array![class_hash_felt];\n\n    let mut constructor_calldata_serialized = array![];\n    constructor_calldata.serialize(ref constructor_calldata_serialized);\n\n    let mut salt_serialized = array![];\n    salt.serialize(ref salt_serialized);\n\n    let mut fee_settings_serialized = array![];\n    fee_settings.serialize(ref fee_settings_serialized);\n\n    let mut nonce_serialized = array![];\n    nonce.serialize(ref nonce_serialized);\n\n    inputs.append_span(constructor_calldata_serialized.span());\n    inputs.append_span(salt_serialized.span());\n    inputs.append(unique.into());\n    inputs.append_span(fee_settings_serialized.span());\n    inputs.append_span(nonce_serialized.span());\n\n    let mut buf = handle_cheatcode(cheatcode::<'deploy'>(inputs.span()));\n\n    let mut result_data: Result<DeployResult, ScriptCommandError> =\n        match Serde::<Result<DeployResult>>::deserialize(ref buf) {\n        Option::Some(result_data) => result_data,\n        Option::None => panic!(\"deploy deserialize failed\"),\n    };\n\n    result_data\n}\n\n#[derive(Drop, Clone, Debug, Serde)]\npub struct InvokeResult {\n    pub transaction_hash: felt252,\n}\n\nimpl DisplayInvokeResult of Display<InvokeResult> {\n    fn fmt(self: @InvokeResult, ref f: Formatter) -> Result<(), Error> {\n        write!(f, \"{}\", *self.transaction_hash)\n    }\n}\n\npub fn invoke(\n    contract_address: ContractAddress,\n    entry_point_selector: felt252,\n    calldata: Array<felt252>,\n    fee_settings: FeeSettings,\n    nonce: Option<felt252>,\n) -> Result<InvokeResult, ScriptCommandError> {\n    let contract_address_felt: felt252 = contract_address.into();\n    let mut inputs = array![contract_address_felt, entry_point_selector];\n\n    let mut calldata_serialized = array![];\n    calldata.serialize(ref calldata_serialized);\n\n    let mut fee_settings_serialized = array![];\n    fee_settings.serialize(ref fee_settings_serialized);\n\n    let mut nonce_serialized = array![];\n    nonce.serialize(ref nonce_serialized);\n\n    inputs.append_span(calldata_serialized.span());\n    inputs.append_span(fee_settings_serialized.span());\n    inputs.append_span(nonce_serialized.span());\n\n    let mut buf = handle_cheatcode(cheatcode::<'invoke'>(inputs.span()));\n\n    let mut result_data: Result<InvokeResult, ScriptCommandError> =\n        match Serde::<Result<InvokeResult>>::deserialize(ref buf) {\n        Option::Some(result_data) => result_data,\n        Option::None => panic!(\"invoke deserialize failed\"),\n    };\n\n    result_data\n}\n\npub fn get_nonce(block_tag: felt252) -> felt252 {\n    let inputs = array![block_tag];\n    let buf = handle_cheatcode(cheatcode::<'get_nonce'>(inputs.span()));\n    *buf[0]\n}\n\n#[derive(Drop, Copy, Debug, Serde, PartialEq)]\npub enum FinalityStatus {\n    Received,\n    Candidate,\n    PreConfirmed,\n    AcceptedOnL2,\n    AcceptedOnL1,\n}\n\npub impl DisplayFinalityStatus of Display<FinalityStatus> {\n    fn fmt(self: @FinalityStatus, ref f: Formatter) -> Result<(), Error> {\n        let finality_status: ByteArray = match self {\n            FinalityStatus::Received => \"Received\",\n            FinalityStatus::Candidate => \"Candidate\",\n            FinalityStatus::PreConfirmed => \"PreConfirmed\",\n            FinalityStatus::AcceptedOnL2 => \"AcceptedOnL2\",\n            FinalityStatus::AcceptedOnL1 => \"AcceptedOnL1\",\n        };\n        write!(f, \"{finality_status}\")\n    }\n}\n\n\n#[derive(Drop, Copy, Debug, Serde, PartialEq)]\npub enum ExecutionStatus {\n    Succeeded,\n    Reverted,\n}\n\npub impl DisplayExecutionStatus of Display<ExecutionStatus> {\n    fn fmt(self: @ExecutionStatus, ref f: Formatter) -> Result<(), Error> {\n        let execution_status: ByteArray = match self {\n            ExecutionStatus::Succeeded => \"Succeeded\",\n            ExecutionStatus::Reverted => \"Reverted\",\n        };\n        write!(f, \"{execution_status}\")\n    }\n}\n\n\n#[derive(Drop, Copy, Debug, Serde, PartialEq)]\npub struct TxStatusResult {\n    pub finality_status: FinalityStatus,\n    pub execution_status: Option<ExecutionStatus>,\n}\n\npub impl DisplayTxStatusResult of Display<TxStatusResult> {\n    fn fmt(self: @TxStatusResult, ref f: Formatter) -> Result<(), Error> {\n        match self.execution_status {\n            Option::Some(status) => write!(\n                f, \"finality_status: {}, execution_status: {}\", self.finality_status, status,\n            ),\n            Option::None => write!(f, \"finality_status: {}\", self.finality_status),\n        }\n    }\n}\n\npub fn tx_status(transaction_hash: felt252) -> Result<TxStatusResult, ScriptCommandError> {\n    let mut inputs = array![transaction_hash];\n\n    let mut buf = handle_cheatcode(cheatcode::<'tx_status'>(inputs.span()));\n\n    let mut result_data: Result<TxStatusResult, ScriptCommandError> =\n        match Serde::<Result<TxStatusResult>>::deserialize(ref buf) {\n        Option::Some(result_data) => result_data,\n        Option::None => panic!(\"tx_status deserialize failed\"),\n    };\n\n    result_data\n}\n\nfn handle_cheatcode(input: Span<felt252>) -> Span<felt252> {\n    let first = *input.at(0);\n    let input = input.slice(1, input.len() - 1);\n\n    if first == 1 {\n        // it's in fact core::byte_array::BYTE_ARRAY_MAGIC but it can't be imported here\n        let mut arr = array![0x46a6158a16a947e5916b2a2ca68501a45e93d7110e81aa2d6438b1c57c879a3];\n\n        arr.append_span(input);\n\n        panic(arr)\n    } else {\n        input\n    }\n}\n"
  },
  {
    "path": "snforge_std/README.md",
    "content": "# snforge_std\n\nFor a library reference please visit https://foundry-rs.github.io/starknet-foundry/appendix/snforge-library.html\n\nFull documentation can be found at https://foundry-rs.github.io/starknet-foundry/snforge_std/\n"
  },
  {
    "path": "snforge_std/Scarb.lock",
    "content": "# Code generated by scarb DO NOT EDIT.\nversion = 1\n\n[[package]]\nname = \"snforge_scarb_plugin\"\nversion = \"0.59.0\"\n\n[[package]]\nname = \"snforge_std\"\nversion = \"0.59.0\"\ndependencies = [\n \"snforge_scarb_plugin\",\n]\n"
  },
  {
    "path": "snforge_std/Scarb.toml",
    "content": "[package]\nname = \"snforge_std\"\nversion = \"0.59.0\"\nedition = \"2024_07\"\ndescription = \"Cairo testing library\"\ndocumentation = \"https://foundry-rs.github.io/starknet-foundry/appendix/snforge-library.html\"\nrepository = \"https://github.com/foundry-rs/starknet-foundry\"\nlicense-file = \"../LICENSE\"\nre-export-cairo-plugins = [\"snforge_scarb_plugin\"]\n\n[dependencies]\nsnforge_scarb_plugin = { path = \"../crates/snforge-scarb-plugin\" }\n"
  },
  {
    "path": "snforge_std/src/byte_array.cairo",
    "content": "use core::byte_array::BYTE_ARRAY_MAGIC;\n\npub fn byte_array_as_felt_array(self: @ByteArray) -> Array<felt252> {\n    let mut serialized = array![];\n\n    self.serialize(ref serialized);\n\n    serialized\n}\n\n/// This function is meant to transform a serialized output from a contract call into a `ByteArray`.\n/// `x` - Span of `felt252`s returned from a contract call (panic data)\n/// Returns the parsed `ByteArray`, or an `Err` if the parsing failed.\npub fn try_deserialize_bytearray_error(x: Span<felt252>) -> Result<ByteArray, ByteArray> {\n    if x.len() > 0 && *x.at(0) == BYTE_ARRAY_MAGIC {\n        let mut x_span = x.slice(1, x.len() - 1);\n        return Serde::<ByteArray>::deserialize(ref x_span).ok_or(\"Malformed input provided\");\n    }\n    Result::Err(\"Input is not a ByteArray-formatted error\")\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcode.cairo",
    "content": "pub(crate) fn execute_cheatcode<const selector: felt252>(input: Span<felt252>) -> Span<felt252> {\n    let result = starknet::testing::cheatcode::<selector>(input);\n    let enum_variant = *result.at(0);\n    let result_content = result.slice(1, result.len() - 1);\n\n    if enum_variant == 1 { // Check if the result is an `Err`\n        let mut arr = array![core::byte_array::BYTE_ARRAY_MAGIC];\n\n        arr.append_span(result_content);\n\n        panic(arr)\n    } else {\n        result_content\n    }\n}\n\npub(crate) fn execute_cheatcode_and_deserialize<const selector: felt252, T, +Serde<T>>(\n    input: Span<felt252>,\n) -> T {\n    let mut serialized_output = execute_cheatcode::<selector>(input);\n\n    match Serde::deserialize(ref serialized_output) {\n        Option::Some(output) => output,\n        Option::None => panic!(\"snforge_std version mismatch: check the warning above\"),\n    }\n}\n\n// Do not use this function directly.\n// It is an internal part of the snforge architecture used by macros.\npub fn is_config_run() -> bool {\n    execute_cheatcode_and_deserialize::<'is_config_mode'>(array![].span())\n}\n\n// Do not use this function directly.\n// It is an internal part of the snforge fuzzer logic used by macros.\npub fn save_fuzzer_arg<T, +core::fmt::Debug<T>>(input: @T) {\n    let input = format!(\"{input:?}\");\n    let mut serialized = array![];\n    input.serialize(ref serialized);\n    execute_cheatcode::<'save_fuzzer_arg'>(serialized.span());\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/block_hash.cairo",
    "content": "use starknet::ContractAddress;\nuse crate::cheatcode::execute_cheatcode_and_deserialize;\nuse super::CheatSpan;\nuse super::execution_info::{CheatArguments, Operation};\n\n/// Changes the block hash for the given block number and contract address.\n/// - `contract_address` - The contract address to which the cheat applies.\n/// - `block_number` - Block number to be modified.\n/// - `block_hash` - `felt252` representing the new block hash.\n/// - `span` - instance of `CheatSpan` specifying the number of syscalls with the cheat\npub fn cheat_block_hash(\n    contract_address: ContractAddress, block_number: u64, block_hash: felt252, span: CheatSpan,\n) {\n    _cheat_block_hash(\n        block_number,\n        Operation::Start(CheatArguments { value: block_hash, span, target: contract_address }),\n    );\n}\n\n/// Starts a global block hash modification.\n/// - `block_number` - Block number to be modified.\n/// - `block_hash` - The block hash value to set globally.\npub fn start_cheat_block_hash_global(block_number: u64, block_hash: felt252) {\n    _cheat_block_hash(block_number, Operation::StartGlobal(block_hash));\n}\n\n/// Cancels the `start_cheat_block_hash_global`.\n/// - `block_number` - Block number for which the cheat should be stopped.\npub fn stop_cheat_block_hash_global(block_number: u64) {\n    _cheat_block_hash(block_number, Operation::StopGlobal);\n}\n\n/// Starts a block hash modification for a specific contract.\n/// - `contract_address` - Contract address associated with the modification.\n/// - `block_number` - Block number to be modified.\n/// - `block_hash` - The block hash to set.\npub fn start_cheat_block_hash(\n    contract_address: ContractAddress, block_number: u64, block_hash: felt252,\n) {\n    _cheat_block_hash(\n        block_number,\n        Operation::Start(\n            CheatArguments {\n                value: block_hash, span: CheatSpan::Indefinite, target: contract_address,\n            },\n        ),\n    );\n}\n\n/// Cancels the `cheat_block_hash`/`start_cheat_block_hash` for a specific contract.\n/// - `block_number` - Block number for which the cheat should be stopped.\n/// - `contract_address` - The contract affected by the previous cheat.\npub fn stop_cheat_block_hash(contract_address: ContractAddress, block_number: u64) {\n    _cheat_block_hash(block_number, Operation::Stop(contract_address));\n}\n\nfn _cheat_block_hash(block_number: u64, operation: Operation<felt252>) {\n    let mut inputs = array![block_number.into()];\n    operation.serialize(ref inputs);\n\n    execute_cheatcode_and_deserialize::<'set_block_hash', ()>(inputs.span());\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/contract_class.cairo",
    "content": "use starknet::{ClassHash, ContractAddress, SyscallResult};\nuse crate::byte_array::byte_array_as_felt_array;\nuse crate::cheatcode::execute_cheatcode_and_deserialize;\n\n#[derive(Drop, Serde, Copy)]\npub struct ContractClass {\n    pub class_hash: ClassHash,\n}\n\n#[derive(Drop, Serde, Clone)]\npub enum DeclareResult {\n    Success: ContractClass,\n    AlreadyDeclared: ContractClass,\n}\n\npub trait ContractClassTrait {\n    /// Calculates an address of a contract in advance that would be returned when calling `deploy`\n    /// The precalculated address is only correct for the very next deployment\n    /// The `constructor_calldata` has a direct impact on the resulting contract address\n    /// `self` - an instance of the struct `ContractClass` which is obtained by calling `declare`\n    /// and unpacking `DeclareResult`\n    /// `constructor_calldata` - serialized calldata for the deploy constructor\n    /// Returns the precalculated `ContractAddress`\n    fn precalculate_address(\n        self: @ContractClass, constructor_calldata: @Array::<felt252>,\n    ) -> ContractAddress;\n\n    /// Deploys a contract\n    /// `self` - an instance of the struct `ContractClass` which is obtained by calling `declare`\n    /// and unpacking `DeclareResult`\n    /// `constructor_calldata` - calldata for the constructor, serialized with `Serde`\n    /// Returns the address the contract was deployed at and serialized constructor return data, or\n    /// panic data if it failed\n    fn deploy(\n        self: @ContractClass, constructor_calldata: @Array::<felt252>,\n    ) -> SyscallResult<(ContractAddress, Span<felt252>)>;\n\n    /// Deploys a contract at a given address\n    /// `self` - an instance of the struct `ContractClass` which is obtained by calling `declare`\n    /// and unpacking `DeclareResult`\n    /// `constructor_calldata` - serialized calldata for the constructor\n    /// `contract_address` - address the contract should be deployed at\n    /// Returns the address the contract was deployed at and serialized constructor return data, or\n    /// panic data if it failed\n    fn deploy_at(\n        self: @ContractClass,\n        constructor_calldata: @Array::<felt252>,\n        contract_address: ContractAddress,\n    ) -> SyscallResult<(ContractAddress, Span<felt252>)>;\n\n    /// Utility method for creating a new `ContractClass` instance\n    /// `class_hash` - a numeric value that can be converted into the class hash of `ContractClass`\n    /// Returns the created `ContractClass`\n    fn new<T, +Into<T, ClassHash>>(class_hash: T) -> ContractClass;\n}\n\nimpl ContractClassImpl of ContractClassTrait {\n    fn precalculate_address(\n        self: @ContractClass, constructor_calldata: @Array::<felt252>,\n    ) -> ContractAddress {\n        let mut inputs = _prepare_calldata(self.class_hash, constructor_calldata);\n\n        execute_cheatcode_and_deserialize::<'precalculate_address'>(inputs.span())\n    }\n\n    fn deploy(\n        self: @ContractClass, constructor_calldata: @Array::<felt252>,\n    ) -> SyscallResult<(ContractAddress, Span<felt252>)> {\n        let salt: felt252 = execute_cheatcode_and_deserialize::<'get_salt'>(array![].span());\n\n        // Internal cheatcode to mark next `deploy_syscall` as coming from cheatcode.\n        // This allows `deploy_syscall` to be handled differently when coming from cheatcode.\n        execute_cheatcode_and_deserialize::<'set_next_syscall_from_cheatcode', ()>(array![].span());\n\n        starknet::syscalls::deploy_syscall(\n            *self.class_hash, salt, constructor_calldata.span(), false,\n        )\n    }\n\n    fn deploy_at(\n        self: @ContractClass,\n        constructor_calldata: @Array::<felt252>,\n        contract_address: ContractAddress,\n    ) -> SyscallResult<(ContractAddress, Span<felt252>)> {\n        execute_cheatcode_and_deserialize::<\n            'set_deploy_at_address', (),\n        >(array![contract_address.into()].span());\n\n        self.deploy(constructor_calldata)\n    }\n\n    fn new<T, +Into<T, ClassHash>>(class_hash: T) -> ContractClass {\n        ContractClass { class_hash: class_hash.into() }\n    }\n}\n\npub trait DeclareResultTrait {\n    /// Gets inner `ContractClass`\n    /// `self` - an instance of the struct `DeclareResult` which is obtained by calling `declare`\n    // Returns the `@ContractClass`\n    fn contract_class(self: @DeclareResult) -> @ContractClass;\n}\n\nimpl DeclareResultImpl of DeclareResultTrait {\n    fn contract_class(self: @DeclareResult) -> @ContractClass {\n        match self {\n            DeclareResult::Success(contract_class) => contract_class,\n            DeclareResult::AlreadyDeclared(contract_class) => contract_class,\n        }\n    }\n}\n\n/// Declares a contract\n/// `contract` - name of a contract as Cairo string. It is a name of the contract (part after mod\n/// keyword) e.g. \"HelloStarknet\"\n/// Returns the `DeclareResult` that encapsulated possible outcomes in the enum:\n/// - `Success`: Contains the successfully declared `ContractClass`.\n/// - `AlreadyDeclared`: Contains `ContractClass` and signals that the contract has already been\n/// declared.\npub fn declare(contract: ByteArray) -> Result<DeclareResult, Array<felt252>> {\n    execute_cheatcode_and_deserialize::<'declare'>(byte_array_as_felt_array(@contract).span())\n}\n\n/// Retrieves a class hash of a contract deployed under the given address\n/// `contract_address` - target contract address\n/// Returns the `ClassHash` under given address\npub fn get_class_hash(contract_address: ContractAddress) -> ClassHash {\n    execute_cheatcode_and_deserialize::<'get_class_hash'>(array![contract_address.into()].span())\n}\n\nfn _prepare_calldata(\n    class_hash: @ClassHash, constructor_calldata: @Array::<felt252>,\n) -> Array<felt252> {\n    let class_hash: felt252 = (*class_hash).into();\n    let mut inputs: Array<felt252> = array![class_hash];\n    constructor_calldata.serialize(ref inputs);\n    inputs\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/erc20.cairo",
    "content": "use snforge_std::cheatcodes::storage::{map_entry_address, store};\nuse starknet::ContractAddress;\n\nconst STRK_CONTRACT_ADDRESS: felt252 =\n    0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d;\nconst ETH_CONTRACT_ADDRESS: felt252 =\n    0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7;\nconst BALANCES_VARIABLE_SELECTOR: felt252 =\n    0x3a4e8ec16e258a799fe707996fd5d21d42b29adc1499a370edf7f809d8c458a; // selector!(\"ERC20_balances\");\n\n#[derive(Drop, Serde, Copy, Debug)]\npub struct CustomToken {\n    pub contract_address: ContractAddress,\n    pub balances_variable_selector: felt252,\n}\n\n#[derive(Drop, Copy, Clone, Debug)]\npub enum Token {\n    STRK,\n    ETH,\n    Custom: CustomToken,\n}\n\n#[generate_trait]\npub impl TokenImpl of TokenTrait {\n    fn contract_address(self: Token) -> ContractAddress {\n        match self {\n            Token::STRK => STRK_CONTRACT_ADDRESS.try_into().unwrap(),\n            Token::ETH => ETH_CONTRACT_ADDRESS.try_into().unwrap(),\n            Token::Custom(CustomToken { contract_address, .. }) => contract_address,\n        }\n    }\n\n    fn balances_variable_selector(self: Token) -> felt252 {\n        match self {\n            Token::STRK | Token::ETH => BALANCES_VARIABLE_SELECTOR,\n            Token::Custom(CustomToken {\n                balances_variable_selector, ..,\n            }) => balances_variable_selector,\n        }\n    }\n}\n\n/// Sets the balance of `token`` for `target`` contract to `new_balance`\n/// - `target` - address of the contract, which balance you want to modify\n/// - `new_balance` - new balance value\n/// - `token` - token for which the balance is being set\npub fn set_balance(target: ContractAddress, new_balance: u256, token: Token) {\n    let balance_low_address = map_entry_address(\n        token.balances_variable_selector(), [target.into()].span(),\n    );\n    let balance_high_address = balance_low_address + 1;\n\n    store(token.contract_address(), balance_low_address, array![new_balance.low.into()].span());\n    store(token.contract_address(), balance_high_address, array![new_balance.high.into()].span());\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/events.cairo",
    "content": "use starknet::ContractAddress;\nuse crate::cheatcode::execute_cheatcode_and_deserialize;\n\n\n/// Creates `EventSpy` instance that spies on all events emitted after its creation.\npub fn spy_events() -> EventSpy {\n    execute_cheatcode_and_deserialize::<'spy_events'>(array![].span())\n}\n\n/// Raw event format (as seen via the RPC-API), can be used for asserting the emitted events.\n#[derive(Drop, Clone, Serde, Debug, PartialEq)]\npub struct Event {\n    pub keys: Array<felt252>,\n    pub data: Array<felt252>,\n}\n\n/// An event spy structure allowing to get events emitted only after its creation.\n#[derive(Drop, Serde)]\npub struct EventSpy {\n    event_offset: usize,\n}\n\n/// A wrapper structure on an array of events to handle filtering smoothly.\n#[derive(Drop, Serde, Clone, Debug, PartialEq)]\npub struct Events {\n    pub events: Array<(ContractAddress, Event)>,\n}\n\npub trait EventSpyTrait {\n    /// Gets all events given [`EventSpy`] spies for.\n    fn get_events(ref self: EventSpy) -> Events;\n}\n\nimpl EventSpyTraitImpl of EventSpyTrait {\n    fn get_events(ref self: EventSpy) -> Events {\n        execute_cheatcode_and_deserialize::<'get_events'>(array![self.event_offset.into()].span())\n    }\n}\n\npub trait EventsFilterTrait {\n    /// Filter events emitted by a given [`ContractAddress`].\n    fn emitted_by(self: @Events, contract_address: ContractAddress) -> Events;\n}\n\nimpl EventsFilterTraitImpl of EventsFilterTrait {\n    fn emitted_by(self: @Events, contract_address: ContractAddress) -> Events {\n        let mut new_events = array![];\n\n        for (from, event) in self.events.span() {\n            if *from == contract_address {\n                new_events.append((*from, event.clone()));\n            };\n        }\n        Events { events: new_events }\n    }\n}\n\n/// Allows to assert the expected events emission (or lack thereof),\n/// in the scope of [`EventSpy`] structure.\npub trait EventSpyAssertionsTrait<T, +starknet::Event<T>, +Drop<T>> {\n    fn assert_emitted(ref self: EventSpy, events: @Array<(ContractAddress, T)>);\n    fn assert_not_emitted(ref self: EventSpy, events: @Array<(ContractAddress, T)>);\n}\n\nimpl EventSpyAssertionsTraitImpl<T, +starknet::Event<T>, +Drop<T>> of EventSpyAssertionsTrait<T> {\n    fn assert_emitted(ref self: EventSpy, events: @Array<(ContractAddress, T)>) {\n        let received_events = self.get_events();\n\n        for (from, event) in events.span() {\n            if !received_events.is_emitted(*from, event) {\n                let from: felt252 = (*from).into();\n                panic!(\"Event with matching data and keys was not emitted from {}\", from);\n            }\n        };\n    }\n\n    fn assert_not_emitted(ref self: EventSpy, events: @Array<(ContractAddress, T)>) {\n        let received_events = self.get_events();\n\n        for (from, event) in events.span() {\n            if received_events.is_emitted(*from, event) {\n                let from: felt252 = (*from).into();\n                panic!(\"Event with matching data and keys was emitted from {}\", from);\n            }\n        };\n    }\n}\n\npub trait IsEmitted<T, +starknet::Event<T>, +Drop<T>> {\n    fn is_emitted(self: @Events, expected_emitted_by: ContractAddress, expected_event: @T) -> bool;\n}\n\npub impl IsEmittedImpl<T, +starknet::Event<T>, +Drop<T>> of IsEmitted<T> {\n    fn is_emitted(self: @Events, expected_emitted_by: ContractAddress, expected_event: @T) -> bool {\n        let expected_event: Event = expected_event.into();\n\n        let mut is_emitted = false;\n        for (from, event) in self.events.span() {\n            if from == @expected_emitted_by && event == @expected_event {\n                is_emitted = true;\n                break;\n            };\n        }\n        return is_emitted;\n    }\n}\n\n\nimpl EventIntoImpl<T, +starknet::Event<T>, +Drop<T>> of Into<T, Event> {\n    fn into(self: T) -> Event {\n        let mut keys = array![];\n        let mut data = array![];\n        self.append_keys_and_data(ref keys, ref data);\n        Event { keys, data }\n    }\n}\n\nimpl EventSnapIntoImpl<T, +starknet::Event<T>, +Drop<T>> of Into<@T, Event> {\n    fn into(self: @T) -> Event {\n        let mut keys = array![];\n        let mut data = array![];\n        self.append_keys_and_data(ref keys, ref data);\n        Event { keys, data }\n    }\n}\n\nimpl EventTraitImpl of starknet::Event<Event> {\n    fn append_keys_and_data(self: @Event, ref keys: Array<felt252>, ref data: Array<felt252>) {\n        keys.append_span(self.keys.span());\n        data.append_span(self.data.span());\n    }\n    fn deserialize(ref keys: Span<felt252>, ref data: Span<felt252>) -> Option<Event> {\n        Option::None\n    }\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/execution_info/account_contract_address.cairo",
    "content": "use super::{\n    CheatArguments, CheatSpan, ContractAddress, ExecutionInfoMock, Operation, cheat_execution_info,\n};\n\n/// Changes the address of an account which the transaction originates from, for the given contract\n/// address and span.\n/// - `contract_address` - instance of `ContractAddress` specifying which contracts to cheat\n/// - `account_contract_address` - transaction account deployment data to be set\n/// - `span` - instance of `CheatSpan` specifying the number of contract calls with the cheat\n/// applied\npub fn cheat_account_contract_address(\n    contract_address: ContractAddress, account_contract_address: ContractAddress, span: CheatSpan,\n) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info\n        .tx_info\n        .account_contract_address =\n            Operation::Start(\n                CheatArguments { value: account_contract_address, span, target: contract_address },\n            );\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the address of an account which the transaction originates from.\n/// - `account_contract_address` - transaction account deployment data to be set\npub fn start_cheat_account_contract_address_global(account_contract_address: ContractAddress) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info\n        .tx_info\n        .account_contract_address = Operation::StartGlobal(account_contract_address);\n\n    cheat_execution_info(execution_info);\n}\n\n/// Cancels the `start_cheat_account_contract_address_global`.\npub fn stop_cheat_account_contract_address_global() {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.account_contract_address = Operation::StopGlobal;\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the address of an account which the transaction originates from, for the given\n/// contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `account_contract_address` - transaction account deployment data to be set\npub fn start_cheat_account_contract_address(\n    contract_address: ContractAddress, account_contract_address: ContractAddress,\n) {\n    cheat_account_contract_address(\n        contract_address, account_contract_address, CheatSpan::Indefinite,\n    );\n}\n\n/// Cancels the `cheat_account_contract_address` / `start_cheat_account_contract_address` for the\n/// given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to stop cheating\npub fn stop_cheat_account_contract_address(contract_address: ContractAddress) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.account_contract_address = Operation::Stop(contract_address);\n\n    cheat_execution_info(execution_info);\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/execution_info/account_deployment_data.cairo",
    "content": "use super::{\n    CheatArguments, CheatSpan, ContractAddress, ExecutionInfoMock, Operation, cheat_execution_info,\n};\n\n/// Changes the transaction account deployment data for the given contract address and span.\n/// - `contract_address` - instance of `ContractAddress` specifying which contracts to cheat\n/// - `account_deployment_data` - transaction account deployment data to be set\n/// - `span` - instance of `CheatSpan` specifying the number of contract calls with the cheat\n/// applied\npub fn cheat_account_deployment_data(\n    contract_address: ContractAddress, account_deployment_data: Span<felt252>, span: CheatSpan,\n) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info\n        .tx_info\n        .account_deployment_data =\n            Operation::Start(\n                CheatArguments { value: account_deployment_data, span, target: contract_address },\n            );\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the transaction account deployment data.\n/// - `account_deployment_data` - transaction account deployment data to be set\npub fn start_cheat_account_deployment_data_global(account_deployment_data: Span<felt252>) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info\n        .tx_info\n        .account_deployment_data = Operation::StartGlobal(account_deployment_data);\n\n    cheat_execution_info(execution_info);\n}\n\n/// Cancels the `cheat_account_deployment_data_global`.\npub fn stop_cheat_account_deployment_data_global() {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.account_deployment_data = Operation::StopGlobal;\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the transaction account deployment data for the given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `account_deployment_data` - transaction account deployment data to be set\npub fn start_cheat_account_deployment_data(\n    contract_address: ContractAddress, account_deployment_data: Span<felt252>,\n) {\n    cheat_account_deployment_data(contract_address, account_deployment_data, CheatSpan::Indefinite);\n}\n\n/// Cancels the `cheat_account_deployment_data` / `start_cheat_account_deployment_data` for the\n/// given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to stop cheating\npub fn stop_cheat_account_deployment_data(contract_address: ContractAddress) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.account_deployment_data = Operation::Stop(contract_address);\n\n    cheat_execution_info(execution_info);\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/execution_info/block_number.cairo",
    "content": "use super::{\n    CheatArguments, CheatSpan, ContractAddress, ExecutionInfoMock, Operation, cheat_execution_info,\n};\n\n/// Changes the block number for the given contract address and span.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `block_number` - block number to be set\n/// - `span` - instance of `CheatSpan` specifying the number of contract calls with the cheat\n/// applied\npub fn cheat_block_number(contract_address: ContractAddress, block_number: u64, span: CheatSpan) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info\n        .block_info\n        .block_number =\n            Operation::Start(\n                CheatArguments { value: block_number, span, target: contract_address },\n            );\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the block number.\n/// - `block_number` - block number to be set\npub fn start_cheat_block_number_global(block_number: u64) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.block_info.block_number = Operation::StartGlobal(block_number);\n\n    cheat_execution_info(execution_info);\n}\n\n/// Cancels the `start_cheat_block_number_global`.\npub fn stop_cheat_block_number_global() {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.block_info.block_number = Operation::StopGlobal;\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the block number for the given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `block_number` - block number to be set\npub fn start_cheat_block_number(contract_address: ContractAddress, block_number: u64) {\n    cheat_block_number(contract_address, block_number, CheatSpan::Indefinite);\n}\n\n/// Cancels the `cheat_block_number` / `start_cheat_block_number` for the given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to stop cheating\npub fn stop_cheat_block_number(contract_address: ContractAddress) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.block_info.block_number = Operation::Stop(contract_address);\n\n    cheat_execution_info(execution_info);\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/execution_info/block_timestamp.cairo",
    "content": "use super::{\n    CheatArguments, CheatSpan, ContractAddress, ExecutionInfoMock, Operation, cheat_execution_info,\n};\n\n/// Changes the block timestamp for the given contract address and span.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `block_timestamp` - block timestamp to be set\n/// - `span` - instance of `CheatSpan` specifying the number of contract calls with the cheat\n/// applied\npub fn cheat_block_timestamp(\n    contract_address: ContractAddress, block_timestamp: u64, span: CheatSpan,\n) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info\n        .block_info\n        .block_timestamp =\n            Operation::Start(\n                CheatArguments { value: block_timestamp, span, target: contract_address },\n            );\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the block timestamp.\n/// - `block_timestamp` - block timestamp to be set\npub fn start_cheat_block_timestamp_global(block_timestamp: u64) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.block_info.block_timestamp = Operation::StartGlobal(block_timestamp);\n\n    cheat_execution_info(execution_info);\n}\n\n/// Cancels the `start_cheat_block_timestamp_global`.\npub fn stop_cheat_block_timestamp_global() {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.block_info.block_timestamp = Operation::StopGlobal;\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the block timestamp for the given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `block_timestamp` - block timestamp to be set\npub fn start_cheat_block_timestamp(contract_address: ContractAddress, block_timestamp: u64) {\n    cheat_block_timestamp(contract_address, block_timestamp, CheatSpan::Indefinite);\n}\n\n/// Cancels the `cheat_block_timestamp` / `start_cheat_block_timestamp` for the given\n/// contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to stop cheating\npub fn stop_cheat_block_timestamp(contract_address: ContractAddress) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.block_info.block_timestamp = Operation::Stop(contract_address);\n\n    cheat_execution_info(execution_info);\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/execution_info/caller_address.cairo",
    "content": "use super::{\n    CheatArguments, CheatSpan, ContractAddress, ExecutionInfoMock, Operation, cheat_execution_info,\n};\n\n/// Changes the caller address for the given contract address and span.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `caller_address` - caller address to be set\n/// - `span` - instance of `CheatSpan` specifying the number of contract calls with the cheat\n/// applied\npub fn cheat_caller_address(\n    contract_address: ContractAddress, caller_address: ContractAddress, span: CheatSpan,\n) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info\n        .caller_address =\n            Operation::Start(\n                CheatArguments { value: caller_address, span, target: contract_address },\n            );\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the caller address.\n/// - `caller_address` - caller address to be set\npub fn start_cheat_caller_address_global(caller_address: ContractAddress) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.caller_address = Operation::StartGlobal(caller_address);\n\n    cheat_execution_info(execution_info);\n}\n\n/// Cancels the `start_cheat_caller_address_global`.\npub fn stop_cheat_caller_address_global() {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.caller_address = Operation::StopGlobal;\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the caller address for the given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `caller_address` - caller address to be set\npub fn start_cheat_caller_address(\n    contract_address: ContractAddress, caller_address: ContractAddress,\n) {\n    cheat_caller_address(contract_address, caller_address, CheatSpan::Indefinite);\n}\n\n/// Cancels the `cheat_caller_address` / `start_cheat_caller_address` for the given\n/// contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to stop cheating\npub fn stop_cheat_caller_address(contract_address: ContractAddress) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.caller_address = Operation::Stop(contract_address);\n\n    cheat_execution_info(execution_info);\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/execution_info/chain_id.cairo",
    "content": "use super::{\n    CheatArguments, CheatSpan, ContractAddress, ExecutionInfoMock, Operation, cheat_execution_info,\n};\n\n/// Changes the transaction chain_id for the given contract address and span.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `chain_id` - transaction chain_id to be set\n/// - `span` - instance of `CheatSpan` specifying the number of contract calls with the cheat\n/// applied\npub fn cheat_chain_id(contract_address: ContractAddress, chain_id: felt252, span: CheatSpan) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info\n        .tx_info\n        .chain_id =\n            Operation::Start(CheatArguments { value: chain_id, span, target: contract_address });\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the transaction chain_id.\n/// - `chain_id` - transaction chain_id to be set\npub fn start_cheat_chain_id_global(chain_id: felt252) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.chain_id = Operation::StartGlobal(chain_id);\n\n    cheat_execution_info(execution_info);\n}\n\n/// Cancels the `start_cheat_chain_id_global`.\npub fn stop_cheat_chain_id_global() {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.chain_id = Operation::StopGlobal;\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the transaction chain_id for the given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `chain_id` - transaction chain_id to be set\npub fn start_cheat_chain_id(contract_address: ContractAddress, chain_id: felt252) {\n    cheat_chain_id(contract_address, chain_id, CheatSpan::Indefinite);\n}\n\n/// Cancels the `cheat_chain_id` / `start_cheat_chain_id` for the given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to stop cheating\npub fn stop_cheat_chain_id(contract_address: ContractAddress) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.chain_id = Operation::Stop(contract_address);\n\n    cheat_execution_info(execution_info);\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/execution_info/contract_address.cairo",
    "content": "//! These cheatcodes are currently used only internally by the `interact_with_state` cheatcode,\n//! and are specifically intended to cheat on the `TEST_ADDRESS`.\n//! They are not exposed through the public API in a general form, as there are no known use cases\n//! that would require them.\n\nuse crate::test_address;\nuse super::{\n    CheatArguments, CheatSpan, ContractAddress, ExecutionInfoMock, Operation, cheat_execution_info,\n};\n\n/// Overrides the contract address for the default test address.\n/// After this function is called, any call to `starknet::get_contract_address()`\n/// within the test context will return the provided `contract_address`.\n/// - `contract_address` - The contract address to use for the default test address.\npub(crate) fn start_cheat_contract_address(contract_address: ContractAddress) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info\n        .contract_address =\n            Operation::Start(\n                CheatArguments {\n                    value: contract_address, span: CheatSpan::Indefinite, target: test_address(),\n                },\n            );\n\n    cheat_execution_info(execution_info);\n}\n\n/// Cancels the `start_cheat_contract_address`.\npub(crate) fn stop_cheat_contract_address() {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.contract_address = Operation::Stop(test_address());\n\n    cheat_execution_info(execution_info);\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/execution_info/fee_data_availability_mode.cairo",
    "content": "use super::{\n    CheatArguments, CheatSpan, ContractAddress, ExecutionInfoMock, Operation, cheat_execution_info,\n};\n\n/// Changes the transaction fee data availability mode for the given contract address and span.\n/// - `contract_address` - instance of `ContractAddress` specifying which contracts to cheat\n/// - `fee_data_availability_mode` - transaction fee data availability mode to be set\n/// - `span` - instance of `CheatSpan` specifying the number of contract calls with the cheat\n/// applied\npub fn cheat_fee_data_availability_mode(\n    contract_address: ContractAddress, fee_data_availability_mode: u32, span: CheatSpan,\n) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info\n        .tx_info\n        .fee_data_availability_mode =\n            Operation::Start(\n                CheatArguments {\n                    value: fee_data_availability_mode, span, target: contract_address,\n                },\n            );\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the transaction fee data availability mode.\n/// - `fee_data_availability_mode` - transaction fee data availability mode to be set\npub fn start_cheat_fee_data_availability_mode_global(fee_data_availability_mode: u32) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info\n        .tx_info\n        .fee_data_availability_mode = Operation::StartGlobal(fee_data_availability_mode);\n\n    cheat_execution_info(execution_info);\n}\n\n/// Cancels the `start_cheat_fee_data_availability_mode_global`.\npub fn stop_cheat_fee_data_availability_mode_global() {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.fee_data_availability_mode = Operation::StopGlobal;\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the transaction fee data availability mode for the given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `fee_data_availability_mode` - transaction fee data availability mode to be set\npub fn start_cheat_fee_data_availability_mode(\n    contract_address: ContractAddress, fee_data_availability_mode: u32,\n) {\n    cheat_fee_data_availability_mode(\n        contract_address, fee_data_availability_mode, CheatSpan::Indefinite,\n    );\n}\n\n/// Cancels the `cheat_fee_data_availability_mode` / `start_cheat_fee_data_availability_mode` for\n/// the given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to stop cheating\npub fn stop_cheat_fee_data_availability_mode(contract_address: ContractAddress) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.fee_data_availability_mode = Operation::Stop(contract_address);\n\n    cheat_execution_info(execution_info);\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/execution_info/max_fee.cairo",
    "content": "use super::{\n    CheatArguments, CheatSpan, ContractAddress, ExecutionInfoMock, Operation, cheat_execution_info,\n};\n\n/// Changes the transaction max fee for the given contract address and span.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `max_fee` - transaction max fee to be set\n/// - `span` - instance of `CheatSpan` specifying the number of contract calls with the cheat\n/// applied\npub fn cheat_max_fee(contract_address: ContractAddress, max_fee: u128, span: CheatSpan) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info\n        .tx_info\n        .max_fee =\n            Operation::Start(CheatArguments { value: max_fee, span, target: contract_address });\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the transaction max fee.\n/// - `max_fee` - transaction max fee to be set\npub fn start_cheat_max_fee_global(max_fee: u128) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.max_fee = Operation::StartGlobal(max_fee);\n\n    cheat_execution_info(execution_info);\n}\n\n/// Cancels the `start_cheat_max_fee_global`.\npub fn stop_cheat_max_fee_global() {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.max_fee = Operation::StopGlobal;\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the transaction max fee for the given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `max_fee` - transaction max fee to be set\npub fn start_cheat_max_fee(contract_address: ContractAddress, max_fee: u128) {\n    cheat_max_fee(contract_address, max_fee, CheatSpan::Indefinite);\n}\n\n/// Cancels the `cheat_max_fee` / `start_cheat_max_fee` for the given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to stop cheating\npub fn stop_cheat_max_fee(contract_address: ContractAddress) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.max_fee = Operation::Stop(contract_address);\n\n    cheat_execution_info(execution_info);\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/execution_info/nonce.cairo",
    "content": "use super::{\n    CheatArguments, CheatSpan, ContractAddress, ExecutionInfoMock, Operation, cheat_execution_info,\n};\n\n/// Changes the transaction nonce for the given contract address and span.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `nonce` - transaction nonce to be set\n/// - `span` - instance of `CheatSpan` specifying the number of contract calls with the cheat\n/// applied\npub fn cheat_nonce(contract_address: ContractAddress, nonce: felt252, span: CheatSpan) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info\n        .tx_info\n        .nonce = Operation::Start(CheatArguments { value: nonce, span, target: contract_address });\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the transaction nonce.\n/// - `nonce` - transaction nonce to be set\npub fn start_cheat_nonce_global(nonce: felt252) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.nonce = Operation::StartGlobal(nonce);\n\n    cheat_execution_info(execution_info);\n}\n\n/// Cancels the `start_cheat_nonce_global`.\npub fn stop_cheat_nonce_global() {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.nonce = Operation::StopGlobal;\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the transaction nonce for the given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `nonce` - transaction nonce to be set\npub fn start_cheat_nonce(contract_address: ContractAddress, nonce: felt252) {\n    cheat_nonce(contract_address, nonce, CheatSpan::Indefinite);\n}\n\n/// Cancels the `cheat_nonce` / `start_cheat_nonce` for the given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to stop cheating\npub fn stop_cheat_nonce(contract_address: ContractAddress) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.nonce = Operation::Stop(contract_address);\n\n    cheat_execution_info(execution_info);\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/execution_info/nonce_data_availability_mode.cairo",
    "content": "use super::{\n    CheatArguments, CheatSpan, ContractAddress, ExecutionInfoMock, Operation, cheat_execution_info,\n};\n\n/// Changes the transaction nonce data availability mode for the given contract address and span.\n/// - `contract_address` - instance of `ContractAddress` specifying which contracts to cheat\n/// - `nonce_data_availability_mode` - transaction nonce data availability mode to be set\n/// - `span` - instance of `CheatSpan` specifying the number of contract calls with the cheat\n/// applied\npub fn cheat_nonce_data_availability_mode(\n    contract_address: ContractAddress, nonce_data_availability_mode: u32, span: CheatSpan,\n) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info\n        .tx_info\n        .nonce_data_availability_mode =\n            Operation::Start(\n                CheatArguments {\n                    value: nonce_data_availability_mode, span, target: contract_address,\n                },\n            );\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the transaction nonce data availability mode.\n/// - `nonce_data_availability_mode` - transaction nonce data availability mode to be set\npub fn start_cheat_nonce_data_availability_mode_global(nonce_data_availability_mode: u32) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info\n        .tx_info\n        .nonce_data_availability_mode = Operation::StartGlobal(nonce_data_availability_mode);\n\n    cheat_execution_info(execution_info);\n}\n\n/// Cancels the `start_cheat_nonce_data_availability_mode_global`.\npub fn stop_cheat_nonce_data_availability_mode_global() {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.nonce_data_availability_mode = Operation::StopGlobal;\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the transaction nonce data availability mode for the given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `nonce_data_availability_mode` - transaction nonce data availability mode to be set\npub fn start_cheat_nonce_data_availability_mode(\n    contract_address: ContractAddress, nonce_data_availability_mode: u32,\n) {\n    cheat_nonce_data_availability_mode(\n        contract_address, nonce_data_availability_mode, CheatSpan::Indefinite,\n    );\n}\n\n/// Cancels the `cheat_nonce_data_availability_mode` / `start_cheat_nonce_data_availability_mode`\n/// for the given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to stop cheating\npub fn stop_cheat_nonce_data_availability_mode(contract_address: ContractAddress) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.nonce_data_availability_mode = Operation::Stop(contract_address);\n\n    cheat_execution_info(execution_info);\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/execution_info/paymaster_data.cairo",
    "content": "use super::{\n    CheatArguments, CheatSpan, ContractAddress, ExecutionInfoMock, Operation, cheat_execution_info,\n};\n\n/// Changes the transaction paymaster data for the given contract address and span.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `paymaster_data` - transaction paymaster data to be set\n/// - `span` - instance of `CheatSpan` specifying the number of contract calls with the cheat\n/// applied\npub fn cheat_paymaster_data(\n    contract_address: ContractAddress, paymaster_data: Span<felt252>, span: CheatSpan,\n) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info\n        .tx_info\n        .paymaster_data =\n            Operation::Start(\n                CheatArguments { value: paymaster_data, span, target: contract_address },\n            );\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the transaction paymaster data.\n/// - `paymaster_data` - transaction paymaster data to be set\npub fn start_cheat_paymaster_data_global(paymaster_data: Span<felt252>) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.paymaster_data = Operation::StartGlobal(paymaster_data);\n\n    cheat_execution_info(execution_info);\n}\n\n/// Cancels the `start_cheat_paymaster_data_global`.\npub fn stop_cheat_paymaster_data_global() {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.paymaster_data = Operation::StopGlobal;\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the transaction paymaster data for the given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `paymaster_data` - transaction paymaster data to be set\npub fn start_cheat_paymaster_data(\n    contract_address: ContractAddress, paymaster_data: Span<felt252>,\n) {\n    cheat_paymaster_data(contract_address, paymaster_data, CheatSpan::Indefinite);\n}\n\n/// Cancels the `cheat_paymaster_data` / `start_cheat_paymaster_data` for the given\n/// contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to stop cheating\npub fn stop_cheat_paymaster_data(contract_address: ContractAddress) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.paymaster_data = Operation::Stop(contract_address);\n\n    cheat_execution_info(execution_info);\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/execution_info/proof_facts.cairo",
    "content": "use super::{\n    CheatArguments, CheatSpan, ContractAddress, ExecutionInfoMock, Operation, cheat_execution_info,\n};\n\n/// Changes the transaction proof facts for the given contract address and span.\n/// - `contract_address` - instance of `ContractAddress` specifying which contracts to cheat\n/// - `proof_facts` - transaction proof facts to be set\n/// - `span` - instance of `CheatSpan` specifying the number of contract calls with the cheat\n/// applied\npub fn cheat_proof_facts(\n    contract_address: ContractAddress, proof_facts: Span<felt252>, span: CheatSpan,\n) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info\n        .tx_info\n        .proof_facts =\n            Operation::Start(CheatArguments { value: proof_facts, span, target: contract_address });\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the transaction proof facts.\n/// - `proof_facts` - transaction proof facts to be set\npub fn start_cheat_proof_facts_global(proof_facts: Span<felt252>) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.proof_facts = Operation::StartGlobal(proof_facts);\n\n    cheat_execution_info(execution_info);\n}\n\n/// Cancels the `cheat_proof_facts_global`.\npub fn stop_cheat_proof_facts_global() {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.proof_facts = Operation::StopGlobal;\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the transaction proof facts for the given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `proof_facts` - transaction proof facts to be set\npub fn start_cheat_proof_facts(contract_address: ContractAddress, proof_facts: Span<felt252>) {\n    cheat_proof_facts(contract_address, proof_facts, CheatSpan::Indefinite);\n}\n\n/// Cancels the `cheat_proof_facts` / `start_cheat_proof_facts` for the\n/// given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to stop cheating\npub fn stop_cheat_proof_facts(contract_address: ContractAddress) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.proof_facts = Operation::Stop(contract_address);\n\n    cheat_execution_info(execution_info);\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/execution_info/resource_bounds.cairo",
    "content": "use starknet::ResourcesBounds;\nuse super::{\n    CheatArguments, CheatSpan, ContractAddress, ExecutionInfoMock, Operation, cheat_execution_info,\n};\n\n\n/// Changes the transaction resource bounds for the given contract address and span.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `resource_bounds` - transaction resource bounds to be set\n/// - `span` - instance of `CheatSpan` specifying the number of contract calls with the cheat\n/// applied\npub fn cheat_resource_bounds(\n    contract_address: ContractAddress, resource_bounds: Span<ResourcesBounds>, span: CheatSpan,\n) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info\n        .tx_info\n        .resource_bounds =\n            Operation::Start(\n                CheatArguments { value: resource_bounds, span, target: contract_address },\n            );\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the transaction resource bounds.\n/// - `resource_bounds` - transaction resource bounds to be set\npub fn start_cheat_resource_bounds_global(resource_bounds: Span<ResourcesBounds>) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.resource_bounds = Operation::StartGlobal(resource_bounds);\n\n    cheat_execution_info(execution_info);\n}\n\n/// Cancels the `start_cheat_resource_bounds_global`.\npub fn stop_cheat_resource_bounds_global() {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.resource_bounds = Operation::StopGlobal;\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the transaction resource bounds for the given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `resource_bounds` - transaction resource bounds to be set\npub fn start_cheat_resource_bounds(\n    contract_address: ContractAddress, resource_bounds: Span<ResourcesBounds>,\n) {\n    cheat_resource_bounds(contract_address, resource_bounds, CheatSpan::Indefinite);\n}\n\n/// Cancels the `cheat_resource_bounds` / `start_cheat_resource_bounds` for the given\n/// contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to stop cheating\npub fn stop_cheat_resource_bounds(contract_address: ContractAddress) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.resource_bounds = Operation::Stop(contract_address);\n\n    cheat_execution_info(execution_info);\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/execution_info/sequencer_address.cairo",
    "content": "use super::{\n    CheatArguments, CheatSpan, ContractAddress, ExecutionInfoMock, Operation, cheat_execution_info,\n};\n\n/// Changes the sequencer address for the given contract address and span.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `sequencer_address` - sequencer address to be set\n/// - `span` - instance of `CheatSpan` specifying the number of contract calls with the cheat\n/// applied\npub fn cheat_sequencer_address(\n    contract_address: ContractAddress, sequencer_address: ContractAddress, span: CheatSpan,\n) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info\n        .block_info\n        .sequencer_address =\n            Operation::Start(\n                CheatArguments { value: sequencer_address, span, target: contract_address },\n            );\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the sequencer address.\n/// - `sequencer_address` - sequencer address to be set\npub fn start_cheat_sequencer_address_global(sequencer_address: ContractAddress) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.block_info.sequencer_address = Operation::StartGlobal(sequencer_address);\n\n    cheat_execution_info(execution_info);\n}\n\n/// Cancels the `start_cheat_sequencer_address_global`.\npub fn stop_cheat_sequencer_address_global() {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.block_info.sequencer_address = Operation::StopGlobal;\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the sequencer address for the given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `sequencer_address` - sequencer address to be set\npub fn start_cheat_sequencer_address(\n    contract_address: ContractAddress, sequencer_address: ContractAddress,\n) {\n    cheat_sequencer_address(contract_address, sequencer_address, CheatSpan::Indefinite);\n}\n\n/// Cancels the `cheat_sequencer_address` / `start_cheat_sequencer_address` for the given\n/// contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to stop cheating\npub fn stop_cheat_sequencer_address(contract_address: ContractAddress) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.block_info.sequencer_address = Operation::Stop(contract_address);\n\n    cheat_execution_info(execution_info);\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/execution_info/signature.cairo",
    "content": "use super::{\n    CheatArguments, CheatSpan, ContractAddress, ExecutionInfoMock, Operation, cheat_execution_info,\n};\n\n/// Changes the transaction signature for the given contract address and span.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `signature` - transaction signature to be set\n/// - `span` - instance of `CheatSpan` specifying the number of contract calls with the cheat\n/// applied\npub fn cheat_signature(\n    contract_address: ContractAddress, signature: Span<felt252>, span: CheatSpan,\n) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info\n        .tx_info\n        .signature =\n            Operation::Start(CheatArguments { value: signature, span, target: contract_address });\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the transaction signature.\n/// - `signature` - transaction signature to be set\npub fn start_cheat_signature_global(signature: Span<felt252>) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.signature = Operation::StartGlobal(signature);\n\n    cheat_execution_info(execution_info);\n}\n\n/// Cancels the `start_cheat_signature_global`.\npub fn stop_cheat_signature_global() {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.signature = Operation::StopGlobal;\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the transaction signature for the given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `signature` - transaction signature to be set\npub fn start_cheat_signature(contract_address: ContractAddress, signature: Span<felt252>) {\n    cheat_signature(contract_address, signature, CheatSpan::Indefinite);\n}\n\n/// Cancels the `cheat_signature` / `start_cheat_signature` for the given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to stop cheating\npub fn stop_cheat_signature(contract_address: ContractAddress) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.signature = Operation::Stop(contract_address);\n\n    cheat_execution_info(execution_info);\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/execution_info/tip.cairo",
    "content": "use super::{\n    CheatArguments, CheatSpan, ContractAddress, ExecutionInfoMock, Operation, cheat_execution_info,\n};\n\n/// Changes the transaction tip for the given contract address and span.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `tip` - transaction tip to be set\n/// - `span` - instance of `CheatSpan` specifying the number of contract calls with the cheat\n/// applied\npub fn cheat_tip(contract_address: ContractAddress, tip: u128, span: CheatSpan) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info\n        .tx_info\n        .tip = Operation::Start(CheatArguments { value: tip, span, target: contract_address });\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the transaction tip.\n/// - `tip` - transaction tip to be set\npub fn start_cheat_tip_global(tip: u128) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.tip = Operation::StartGlobal(tip);\n\n    cheat_execution_info(execution_info);\n}\n\n/// Cancels the `start_cheat_tip_global`.\npub fn stop_cheat_tip_global() {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.tip = Operation::StopGlobal;\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the transaction tip for the given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `tip` - transaction tip to be set\npub fn start_cheat_tip(contract_address: ContractAddress, tip: u128) {\n    cheat_tip(contract_address, tip, CheatSpan::Indefinite);\n}\n\n/// Cancels the `cheat_tip` / `start_cheat_tip` for the given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to stop cheating\npub fn stop_cheat_tip(contract_address: ContractAddress) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.tip = Operation::Stop(contract_address);\n\n    cheat_execution_info(execution_info);\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/execution_info/transaction_hash.cairo",
    "content": "use super::{\n    CheatArguments, CheatSpan, ContractAddress, ExecutionInfoMock, Operation, cheat_execution_info,\n};\n\n/// Changes the transaction hash for the given contract address and span.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `transaction_hash` - transaction hash to be set\n/// - `span` - instance of `CheatSpan` specifying the number of contract calls with the cheat\n/// applied\npub fn cheat_transaction_hash(\n    contract_address: ContractAddress, transaction_hash: felt252, span: CheatSpan,\n) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info\n        .tx_info\n        .transaction_hash =\n            Operation::Start(\n                CheatArguments { value: transaction_hash, span, target: contract_address },\n            );\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the transaction hash.\n/// - `transaction_hash` - transaction hash to be set\npub fn start_cheat_transaction_hash_global(transaction_hash: felt252) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.transaction_hash = Operation::StartGlobal(transaction_hash);\n\n    cheat_execution_info(execution_info);\n}\n\n/// Cancels the `start_cheat_transaction_hash_global`.\npub fn stop_cheat_transaction_hash_global() {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.transaction_hash = Operation::StopGlobal;\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the transaction hash for the given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `transaction_hash` - transaction hash to be set\npub fn start_cheat_transaction_hash(contract_address: ContractAddress, transaction_hash: felt252) {\n    cheat_transaction_hash(contract_address, transaction_hash, CheatSpan::Indefinite);\n}\n\n/// Cancels the `cheat_transaction_hash` / `start_cheat_transaction_hash` for the given\n/// contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to stop cheating\npub fn stop_cheat_transaction_hash(contract_address: ContractAddress) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.transaction_hash = Operation::Stop(contract_address);\n\n    cheat_execution_info(execution_info);\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/execution_info/version.cairo",
    "content": "use super::{\n    CheatArguments, CheatSpan, ContractAddress, ExecutionInfoMock, Operation, cheat_execution_info,\n};\n\n/// Changes the transaction version for the given contract address and span.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `version` - transaction version to be set\n/// - `span` - instance of `CheatSpan` specifying the number of contract calls with the cheat\n/// applied\npub fn cheat_transaction_version(\n    contract_address: ContractAddress, version: felt252, span: CheatSpan,\n) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info\n        .tx_info\n        .version =\n            Operation::Start(CheatArguments { value: version, span, target: contract_address });\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the transaction version.\n/// - `version` - transaction version to be set\npub fn start_cheat_transaction_version_global(version: felt252) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.version = Operation::StartGlobal(version);\n\n    cheat_execution_info(execution_info);\n}\n\n/// Cancels the `start_cheat_transaction_version_global`.\npub fn stop_cheat_transaction_version_global() {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.version = Operation::StopGlobal;\n\n    cheat_execution_info(execution_info);\n}\n\n/// Changes the transaction version for the given contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to cheat\n/// - `version` - transaction version to be set\npub fn start_cheat_transaction_version(contract_address: ContractAddress, version: felt252) {\n    cheat_transaction_version(contract_address, version, CheatSpan::Indefinite);\n}\n\n/// Cancels the `cheat_transaction_version` / `start_cheat_transaction_version` for the given\n/// contract_address.\n/// - `contract_address` - instance of `ContractAddress` specifying which contract to stop cheating\npub fn stop_cheat_transaction_version(contract_address: ContractAddress) {\n    let mut execution_info: ExecutionInfoMock = Default::default();\n\n    execution_info.tx_info.version = Operation::Stop(contract_address);\n\n    cheat_execution_info(execution_info);\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/execution_info.cairo",
    "content": "use snforge_std::cheatcodes::CheatSpan;\nuse starknet::{ContractAddress, ResourcesBounds};\nuse crate::cheatcode::execute_cheatcode_and_deserialize;\n\npub mod account_contract_address;\npub mod account_deployment_data;\npub mod block_number;\npub mod block_timestamp;\npub mod caller_address;\npub mod chain_id;\n#[doc(hidden)]\npub mod contract_address;\npub mod fee_data_availability_mode;\npub mod max_fee;\npub mod nonce;\npub mod nonce_data_availability_mode;\npub mod paymaster_data;\npub mod proof_facts;\npub mod resource_bounds;\npub mod sequencer_address;\npub mod signature;\npub mod tip;\npub mod transaction_hash;\npub mod version;\n\n\n#[derive(Serde, Drop, Copy)]\npub(crate) struct CheatArguments<T> {\n    pub(crate) value: T,\n    pub(crate) span: CheatSpan,\n    pub(crate) target: ContractAddress,\n}\n\n#[derive(Serde, Drop, Copy)]\npub(crate) enum Operation<T> {\n    StartGlobal: T,\n    Start: CheatArguments<T>,\n    Stop: ContractAddress,\n    StopGlobal,\n    Retain,\n}\n\n/// A structure used for setting individual fields in `TxInfo`\n/// All fields are wrapped into `Operation`, meaning that the field will be:\n/// - `Retain` - unchanged\n/// - `Start` - changed for given contract and span\n/// - `Stop` - reset to the initial value for given contract and span\n/// - `StartGlobal` - changed for all contracts until overridden or stopped\n/// - `StopGlobal` - reset to the initial value for all contracts\n#[derive(Copy, Drop, Serde)]\nstruct TxInfoMock {\n    version: Operation<felt252>,\n    account_contract_address: Operation<ContractAddress>,\n    max_fee: Operation<u128>,\n    signature: Operation<Span<felt252>>,\n    transaction_hash: Operation<felt252>,\n    chain_id: Operation<felt252>,\n    nonce: Operation<felt252>,\n    // starknet::info::v2::TxInfo fields\n    resource_bounds: Operation<Span<ResourcesBounds>>,\n    tip: Operation<u128>,\n    paymaster_data: Operation<Span<felt252>>,\n    nonce_data_availability_mode: Operation<u32>,\n    fee_data_availability_mode: Operation<u32>,\n    account_deployment_data: Operation<Span<felt252>>,\n    proof_facts: Operation<Span<felt252>>,\n}\n\nimpl TxInfoMockImpl of Default<TxInfoMock> {\n    /// Returns a default object initialized with Operation::Retain for each field\n    /// Useful for setting only a few of fields instead of all of them\n    fn default() -> TxInfoMock {\n        TxInfoMock {\n            version: Operation::Retain,\n            account_contract_address: Operation::Retain,\n            max_fee: Operation::Retain,\n            signature: Operation::Retain,\n            transaction_hash: Operation::Retain,\n            chain_id: Operation::Retain,\n            nonce: Operation::Retain,\n            resource_bounds: Operation::Retain,\n            tip: Operation::Retain,\n            paymaster_data: Operation::Retain,\n            nonce_data_availability_mode: Operation::Retain,\n            fee_data_availability_mode: Operation::Retain,\n            account_deployment_data: Operation::Retain,\n            proof_facts: Operation::Retain,\n        }\n    }\n}\n\n/// A structure used for setting individual fields in `BlockInfo`\n/// All fields are wrapped into `Operation`, meaning that the field will be:\n/// - `Retain` - unchanged\n/// - `Start` - changed for given contract and span\n/// - `Stop` - reset to the initial value for given contract and span\n/// - `StartGlobal` - changed for all contracts until overridden or stopped\n/// - `StopGlobal` - reset to the initial value for all contracts\n#[derive(Copy, Drop, Serde)]\nstruct BlockInfoMock {\n    block_number: Operation<u64>,\n    block_timestamp: Operation<u64>,\n    sequencer_address: Operation<ContractAddress>,\n}\n\nimpl BlockInfoMockImpl of Default<BlockInfoMock> {\n    /// Returns a default object initialized with Operation::Retain for each field\n    /// Useful for setting only a few of fields instead of all of them\n    fn default() -> BlockInfoMock {\n        BlockInfoMock {\n            block_number: Operation::Retain,\n            block_timestamp: Operation::Retain,\n            sequencer_address: Operation::Retain,\n        }\n    }\n}\n\n/// A structure used for setting individual fields in `ExecutionInfo`\n/// All fields are wrapped into `Operation`, meaning that the field will be:\n/// - `Retain` - unchanged\n/// - `Start` - changed for given contract and span\n/// - `Stop` - reset to the initial value for given contract and span\n/// - `StartGlobal` - changed for all contracts until overridden or stopped\n/// - `StopGlobal` - reset to the initial value for all contracts\n#[derive(Copy, Drop, Serde)]\nstruct ExecutionInfoMock {\n    block_info: BlockInfoMock,\n    tx_info: TxInfoMock,\n    caller_address: Operation<ContractAddress>,\n    contract_address: Operation<ContractAddress>,\n}\n\nimpl ExecutionInfoMockImpl of Default<ExecutionInfoMock> {\n    /// Returns a default object initialized with Operation::Retain for each field\n    /// Useful for setting only a few of fields instead of all of them\n    fn default() -> ExecutionInfoMock {\n        ExecutionInfoMock {\n            block_info: Default::default(),\n            tx_info: Default::default(),\n            caller_address: Operation::Retain,\n            contract_address: Operation::Retain,\n        }\n    }\n}\n\n/// Changes `ExecutionInfo` returned by `get_execution_info()`\n/// - `execution_info_mock` - a struct with same structure as `ExecutionInfo` (returned by\n/// `get_execution_info()`)\nfn cheat_execution_info(execution_info_mock: ExecutionInfoMock) {\n    let mut inputs = array![];\n\n    execution_info_mock.serialize(ref inputs);\n\n    execute_cheatcode_and_deserialize::<'cheat_execution_info', ()>(inputs.span());\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/generate_arg.cairo",
    "content": "use crate::cheatcode::execute_cheatcode_and_deserialize;\n\n// Generates a random number that is used for creating data for fuzz tests\npub fn generate_arg<T, +Serde<T>, +Drop<T>, +Into<T, felt252>>(min_value: T, max_value: T) -> T {\n    execute_cheatcode_and_deserialize::<\n        'generate_arg',\n    >(array![min_value.into(), max_value.into()].span())\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/generate_random_felt.cairo",
    "content": "use crate::cheatcode::execute_cheatcode_and_deserialize;\n\n\n/// Generates a random felt value\n///\n/// Returns a random felt within the range of 0 and 2^252 - 1\npub fn generate_random_felt() -> felt252 {\n    execute_cheatcode_and_deserialize::<'generate_random_felt'>(array![].span())\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/l1_handler.cairo",
    "content": "use starknet::{ContractAddress, SyscallResult};\nuse crate::cheatcode::execute_cheatcode_and_deserialize;\n\n#[derive(Drop, Clone)]\npub struct L1Handler {\n    target: ContractAddress,\n    selector: felt252,\n}\n\npub trait L1HandlerTrait {\n    fn new(target: ContractAddress, selector: felt252) -> L1Handler;\n    fn execute(self: L1Handler, from_address: felt252, payload: Span<felt252>) -> SyscallResult<()>;\n}\n\nimpl L1HandlerImpl of L1HandlerTrait {\n    /// `target` - The target starknet contract address\n    /// `selector` - Selector of a `#[l1_handler]` function. Can be acquired with\n    /// `selector!(\"function_handler_name\")` macro Returns a structure referring to a L1 handler\n    /// function\n    fn new(target: ContractAddress, selector: felt252) -> L1Handler {\n        L1Handler { target, selector }\n    }\n\n    /// Mocks L1 -> L2 message from Ethereum handled by the given L1 handler function\n    /// `self` - `L1Handler` structure referring to a L1 handler function\n    /// `from_address` - Ethereum address of the contract that you want to be the message sender\n    /// `payload` - The handlers' function arguments serialized with `Serde`\n    /// Returns () or panic data if it failed\n    fn execute(\n        self: L1Handler, from_address: felt252, payload: Span<felt252>,\n    ) -> SyscallResult<()> {\n        let mut inputs: Array<felt252> = array![\n            self.target.into(), self.selector, from_address.into(),\n        ];\n        payload.serialize(ref inputs);\n\n        execute_cheatcode_and_deserialize::<'l1_handler_execute'>(inputs.span())\n    }\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/message_to_l1.cairo",
    "content": "use starknet::{ContractAddress, EthAddress};\nuse crate::cheatcode::execute_cheatcode_and_deserialize;\n\n/// Creates `MessageToL1Spy` instance that spies on all messages sent to L1\npub fn spy_messages_to_l1() -> MessageToL1Spy {\n    execute_cheatcode_and_deserialize::<'spy_messages_to_l1'>(array![].span())\n}\n\n/// Raw message to L1 format (as seen via the RPC-API), can be used for asserting the sent messages.\n#[derive(Drop, Clone, Serde)]\npub struct MessageToL1 {\n    /// An ethereum address where the message is destined to go\n    pub to_address: EthAddress,\n    /// Actual payload which will be delivered to L1 contract\n    pub payload: Array<felt252>,\n}\n\n/// A message spy structure allowing to get messages emitted only after its creation.\n#[derive(Drop, Serde)]\npub struct MessageToL1Spy {\n    message_offset: usize,\n}\n\n/// A wrapper structure on an array of messages to handle filtering smoothly.\n#[derive(Drop, Serde)]\npub struct MessagesToL1 {\n    pub messages: Array<(ContractAddress, MessageToL1)>,\n}\n\npub trait MessageToL1SpyTrait {\n    /// Gets all messages given [`MessageToL1Spy`] spies for.\n    fn get_messages(ref self: MessageToL1Spy) -> MessagesToL1;\n}\n\nimpl MessageToL1SpyTraitImpl of MessageToL1SpyTrait {\n    fn get_messages(ref self: MessageToL1Spy) -> MessagesToL1 {\n        execute_cheatcode_and_deserialize::<\n            'get_messages_to_l1',\n        >(array![self.message_offset.into()].span())\n    }\n}\n\npub trait MessageToL1FilterTrait {\n    /// Filter messages emitted by a sender of a given [`ContractAddress`]\n    fn sent_by(self: @MessagesToL1, contract_address: ContractAddress) -> MessagesToL1;\n    /// Filter messages emitted by a receiver of a given ethereum address\n    fn sent_to(self: @MessagesToL1, to_address: EthAddress) -> MessagesToL1;\n}\n\nimpl MessageToL1FilterTraitImpl of MessageToL1FilterTrait {\n    fn sent_by(self: @MessagesToL1, contract_address: ContractAddress) -> MessagesToL1 {\n        let mut counter = 0;\n        let mut new_messages = array![];\n        while counter < self.messages.len() {\n            let (sent_by, msg) = self.messages.at(counter);\n            if *sent_by == contract_address {\n                new_messages.append((*sent_by, msg.clone()));\n            }\n            counter += 1;\n        }\n        MessagesToL1 { messages: new_messages }\n    }\n    fn sent_to(self: @MessagesToL1, to_address: EthAddress) -> MessagesToL1 {\n        let mut counter = 0;\n        let mut new_messages = array![];\n        while counter < self.messages.len() {\n            let (sent_by, msg) = self.messages.at(counter);\n            if *msg.to_address == to_address {\n                new_messages.append((*sent_by, msg.clone()));\n            }\n            counter += 1;\n        }\n        MessagesToL1 { messages: new_messages }\n    }\n}\n\n/// Allows to assert the expected sent messages (or lack thereof),\n/// in the scope of [`MessageToL1Spy`] structure.\npub trait MessageToL1SpyAssertionsTrait {\n    fn assert_sent(ref self: MessageToL1Spy, messages: @Array<(ContractAddress, MessageToL1)>);\n    fn assert_not_sent(ref self: MessageToL1Spy, messages: @Array<(ContractAddress, MessageToL1)>);\n}\n\nimpl MessageToL1SpyAssertionsTraitImpl of MessageToL1SpyAssertionsTrait {\n    fn assert_sent(ref self: MessageToL1Spy, messages: @Array<(ContractAddress, MessageToL1)>) {\n        let mut i = 0;\n        let sent_messages = self.get_messages();\n\n        while i < messages.len() {\n            let (from, message) = messages.at(i);\n            let sent = is_sent(@sent_messages, from, message);\n\n            if !sent {\n                let from: felt252 = (*from).into();\n                panic!(\"Message with matching data and receiver was not emitted from {}\", from);\n            }\n            i += 1;\n        };\n    }\n    fn assert_not_sent(ref self: MessageToL1Spy, messages: @Array<(ContractAddress, MessageToL1)>) {\n        let mut i = 0;\n        let sent_messages = self.get_messages();\n\n        while i < messages.len() {\n            let (from, message) = messages.at(i);\n            let emitted = is_sent(@sent_messages, from, message);\n\n            if emitted {\n                let from: felt252 = (*from).into();\n                panic!(\"Message with matching data and receiver was sent from {}\", from);\n            }\n\n            i += 1;\n        };\n    }\n}\n\nfn is_sent(\n    messages: @MessagesToL1, expected_sent_by: @ContractAddress, expected_message: @MessageToL1,\n) -> bool {\n    let mut i = 0;\n    let mut is_emitted = false;\n    while i < messages.messages.len() {\n        let (from, message) = messages.messages.at(i);\n\n        if from == expected_sent_by\n            && message.payload == expected_message.payload\n            && message.to_address == expected_message.to_address {\n            is_emitted = true;\n            break;\n        }\n\n        i += 1;\n    }\n    return is_emitted;\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes/storage.cairo",
    "content": "use starknet::{ContractAddress, StorageAddress};\nuse crate::cheatcode::execute_cheatcode_and_deserialize;\nuse crate::cheatcodes::execution_info::contract_address::{\n    start_cheat_contract_address, stop_cheat_contract_address,\n};\n\nfn validate_storage_address_felt(storage_address_felt: felt252) {\n    let result: Option<StorageAddress> = storage_address_felt.try_into();\n\n    match result {\n        Option::Some(_) => {},\n        // Panics in order not to leave inconsistencies in the state\n        Option::None(()) => panic!(\"storage_address out of range {}\", storage_address_felt),\n    }\n}\n\nfn store_felt252(target: ContractAddress, storage_address: felt252, value: felt252) {\n    validate_storage_address_felt(storage_address);\n    let inputs = array![target.into(), storage_address.into(), value];\n    execute_cheatcode_and_deserialize::<'store', ()>(inputs.span());\n}\n\nfn load_felt252(target: ContractAddress, storage_address: felt252) -> felt252 {\n    validate_storage_address_felt(storage_address);\n    let inputs = array![target.into(), storage_address];\n    execute_cheatcode_and_deserialize::<'load'>(inputs.span())\n}\n\n/// Stores felts from `serialized_value` in `target` contract's storage, starting at\n/// `storage_address`.\n/// - `target` - address of the contract, which storage you want to modify\n/// - `storage_address` - offset of the data in the contract's storage\n/// - `serialized_value` - a sequence of felts that will be inserted starting at `storage_address`\npub fn store(target: ContractAddress, storage_address: felt252, serialized_value: Span<felt252>) {\n    let mut offset: usize = 0;\n    while offset != serialized_value.len() {\n        store_felt252(target, storage_address + offset.into(), *serialized_value.at(offset));\n        offset += 1;\n    }\n}\n\n/// Loads `size` felts from `target` contract's storage into an `Array`, starting at\n/// `storage_address`.\n/// - `target` - address of the contract, which storage you want to modify\n/// - `storage_address` - offset of the data in the contract's storage\n/// - `size` - how many felts will be loaded into the result `Array`\npub fn load(target: ContractAddress, storage_address: felt252, size: felt252) -> Array<felt252> {\n    let mut output_array: Array<felt252> = array![];\n    let mut offset: usize = 0;\n\n    while offset.into() != size {\n        let loaded = load_felt252(target, storage_address + offset.into());\n        output_array.append(loaded);\n        offset += 1;\n    }\n    output_array\n}\n\npub fn map_entry_address(map_selector: felt252, keys: Span<felt252>) -> felt252 {\n    let mut inputs = array![map_selector];\n    keys.serialize(ref inputs);\n    execute_cheatcode_and_deserialize::<'map_entry_address'>(inputs.span())\n}\n\npub fn interact_with_state<F, +Drop<F>, impl func: core::ops::FnOnce<F, ()>, +Drop<func::Output>>(\n    contract_address: ContractAddress, f: F,\n) -> func::Output {\n    start_cheat_contract_address(contract_address);\n    let res = f();\n    stop_cheat_contract_address();\n    res\n}\n"
  },
  {
    "path": "snforge_std/src/cheatcodes.cairo",
    "content": "use starknet::{ClassHash, ContractAddress};\nuse super::cheatcode::execute_cheatcode_and_deserialize;\npub mod block_hash;\npub mod contract_class;\npub mod erc20;\n\npub mod events;\npub mod execution_info;\npub mod generate_arg;\npub mod generate_random_felt;\npub mod l1_handler;\npub mod message_to_l1;\npub mod storage;\n\n/// Enum used to specify how long the target should be cheated for.\n#[derive(Copy, Drop, Serde, PartialEq, Clone, Debug)]\npub enum CheatSpan {\n    /// Applies the cheatcode indefinitely, until the cheat is canceled manually (e.g. using\n    /// `stop_cheat_block_timestamp`).\n    Indefinite,\n    /// Applies the cheatcode for a specified number of calls to the target,\n    /// after which the cheat is canceled (or until the cheat is canceled manually).\n    TargetCalls: NonZero<usize>,\n}\n\npub fn test_selector() -> felt252 {\n    // Result of selector!(\"TEST_CONTRACT_SELECTOR\") since `selector!` macro requires dependency on\n    // `starknet`.\n    655947323460646800722791151288222075903983590237721746322261907338444055163\n}\n\npub fn test_address() -> ContractAddress {\n    469394814521890341860918960550914.try_into().expect('Test address should be valid')\n}\n\n/// Mocks contract call to a `function_selector` of a contract at the given address, for `n_times`\n/// first calls that are made to the contract.\n/// A call to function `function_selector` will return data provided in `ret_data` argument.\n/// An address with no contract can be mocked as well.\n/// An entrypoint that is not present on the deployed contract is also possible to mock.\n/// Note that the function is not meant for mocking internal calls - it works only for contract\n/// entry points.\n/// - `contract_address` - target contract address\n/// - `function_selector` - hashed name of the target function (can be obtained with `selector!`\n/// macro)\n/// - `ret_data` - data to return by the function `function_selector`\n/// - `n_times` - number of calls to mock the function for\npub fn mock_call<T, impl TSerde: core::serde::Serde<T>, impl TDestruct: Destruct<T>>(\n    contract_address: ContractAddress, function_selector: felt252, ret_data: T, n_times: u32,\n) {\n    assert!(n_times > 0, \"cannot `mock_call` 0 times, `n_times` argument must be greater than 0\");\n\n    let contract_address_felt: felt252 = contract_address.into();\n    let mut inputs = array![contract_address_felt, function_selector];\n\n    CheatSpan::TargetCalls(n_times.try_into().expect('`n_times` must be > 0'))\n        .serialize(ref inputs);\n\n    let mut ret_data_arr = ArrayTrait::new();\n    ret_data.serialize(ref ret_data_arr);\n\n    ret_data_arr.serialize(ref inputs);\n\n    execute_cheatcode_and_deserialize::<'mock_call', ()>(inputs.span());\n}\n\n\n/// Mocks contract call to a function of a contract at the given address, indefinitely.\n/// See `mock_call` for comprehensive definition of how it can be used.\n/// - `contract_address` - targeted contracts' address\n/// - `function_selector` - hashed name of the target function (can be obtained with `selector!`\n/// macro)\n/// - `ret_data` - data to be returned by the function\npub fn start_mock_call<T, impl TSerde: core::serde::Serde<T>, impl TDestruct: Destruct<T>>(\n    contract_address: ContractAddress, function_selector: felt252, ret_data: T,\n) {\n    let contract_address_felt: felt252 = contract_address.into();\n    let mut inputs = array![contract_address_felt, function_selector];\n\n    CheatSpan::Indefinite.serialize(ref inputs);\n\n    let mut ret_data_arr = ArrayTrait::new();\n    ret_data.serialize(ref ret_data_arr);\n\n    ret_data_arr.serialize(ref inputs);\n\n    execute_cheatcode_and_deserialize::<'mock_call', ()>(inputs.span());\n}\n\n/// Cancels the `mock_call` / `start_mock_call` for the function with given name and contract\n/// address.\n/// - `contract_address` - targeted contracts' address\n/// - `function_selector` - hashed name of the target function (can be obtained with `selector!`\n/// macro)\npub fn stop_mock_call(contract_address: ContractAddress, function_selector: felt252) {\n    let contract_address_felt: felt252 = contract_address.into();\n    execute_cheatcode_and_deserialize::<\n        'stop_mock_call', (),\n    >(array![contract_address_felt, function_selector].span());\n}\n\n#[derive(Drop, Serde, PartialEq, Debug)]\npub enum ReplaceBytecodeError {\n    /// Means that the contract does not exist, and thus bytecode cannot be replaced\n    ContractNotDeployed,\n    /// Means that the given class for replacement is not declared\n    UndeclaredClassHash,\n}\n\n/// Replaces class for given contract address.\n/// The `new_class` hash has to be declared in order for the replacement class to execute the code,\n/// when interacting with the contract.\n/// - `contract` - address specifying which address will be replaced\n/// - `new_class` - class hash, that will be used now for given address\n/// Returns `Result::Ok` if the replacement succeeded, and a `ReplaceBytecodeError` with appropriate\n/// error type otherwise\npub fn replace_bytecode(\n    contract: ContractAddress, new_class: ClassHash,\n) -> Result<(), ReplaceBytecodeError> {\n    execute_cheatcode_and_deserialize::<\n        'replace_bytecode',\n    >(array![contract.into(), new_class.into()].span())\n}\n"
  },
  {
    "path": "snforge_std/src/config_types.cairo",
    "content": "#[derive(Drop, Serde)]\npub struct AvailableResourceBoundsConfig {\n    pub l1_gas: felt252,\n    pub l1_data_gas: felt252,\n    pub l2_gas: felt252,\n}\n\n#[derive(Drop, Serde)]\npub enum AvailableGasConfig {\n    MaxGas: felt252,\n    MaxResourceBounds: AvailableResourceBoundsConfig,\n}\n\n#[derive(Drop, Serde)]\npub enum BlockId {\n    BlockTag,\n    BlockHash: felt252,\n    BlockNumber: felt252,\n}\n\n#[derive(Drop, Serde)]\npub struct InlineForkConfig {\n    pub url: ByteArray,\n    pub block: BlockId,\n}\n\n#[derive(Drop, Serde)]\npub struct OverriddenForkConfig {\n    pub name: ByteArray,\n    pub block: BlockId,\n}\n\n#[derive(Drop, Serde)]\npub enum ForkConfig {\n    Inline: InlineForkConfig,\n    Named: ByteArray,\n    Overridden: OverriddenForkConfig,\n}\n\n#[derive(Drop, Serde)]\npub struct FuzzerConfig {\n    pub runs: Option<felt252>,\n    pub seed: Option<felt252>,\n}\n\n#[derive(Drop, Serde)]\npub enum Expected {\n    ShortString: felt252,\n    ByteArray: ByteArray,\n    Array: Array<felt252>,\n    Any,\n}\n\n#[derive(Drop, Serde)]\npub struct ShouldPanicConfig {\n    pub expected: Expected,\n}\n\n#[derive(Drop, Serde)]\npub struct IgnoreConfig {\n    pub is_ignored: bool,\n}\n\n#[derive(Drop, Serde)]\npub struct PredeployedContractsConfig {\n    pub is_disabled: bool,\n}\n"
  },
  {
    "path": "snforge_std/src/env/env_vars.cairo",
    "content": "use crate::byte_array::byte_array_as_felt_array;\nuse crate::cheatcode::execute_cheatcode;\n\n/// Reads an environment variable, without parsing it\n/// `name` - name of an environment variable\n/// Returns the read array of felts\npub fn var(name: ByteArray) -> Array<felt252> {\n    execute_cheatcode::<'var'>(byte_array_as_felt_array(@name).span()).into()\n}\n"
  },
  {
    "path": "snforge_std/src/env.cairo",
    "content": "mod env_vars;\n\npub use env_vars::var;\n"
  },
  {
    "path": "snforge_std/src/fs/file_operations.cairo",
    "content": "use crate::byte_array::byte_array_as_felt_array;\nuse crate::cheatcode::execute_cheatcode;\n\n#[derive(Drop, Clone)]\npub struct File {\n    path: ByteArray,\n}\n\npub trait FileTrait {\n    /// Creates a file struct used for reading json / text\n    /// `path` - a path to file in ByteArray form, relative to the package root\n    fn new(path: ByteArray) -> File;\n}\n\nimpl FileTraitImpl of FileTrait {\n    fn new(path: ByteArray) -> File {\n        File { path }\n    }\n}\n\n/// `file` - a `File` struct to read text data from\n/// Returns an array of felts read from the file, panics if read was not possible\npub fn read_txt(file: @File) -> Array<felt252> {\n    execute_cheatcode::<'read_txt'>(byte_array_as_felt_array(file.path).span()).into()\n}\n\n/// `file` - a `File` struct to read json data from\n/// Returns an array of felts read from the file, panics if read was not possible, or json was\n/// incorrect\npub fn read_json(file: @File) -> Array<felt252> {\n    execute_cheatcode::<'read_json'>(byte_array_as_felt_array(file.path).span()).into()\n}\n\npub trait FileParser<T, impl TSerde: Serde<T>> {\n    /// Reads from the text file and tries to deserialize the result into given type with `Serde`\n    /// `file` - File instance\n    /// Returns an instance of `T` if deserialization was possible\n    fn parse_txt(file: @File) -> Option<T>;\n    /// Reads from the json file and tries to deserialize the result into given type with `Serde`\n    /// `file` - File instance\n    /// Returns an instance of `T` if deserialization was possible\n    fn parse_json(file: @File) -> Option<T>;\n}\n\nimpl FileParserImpl<T, impl TSerde: Serde<T>> of FileParser<T> {\n    fn parse_txt(file: @File) -> Option<T> {\n        let mut content = execute_cheatcode::<\n            'read_txt',\n        >(byte_array_as_felt_array(file.path).span());\n        Serde::<T>::deserialize(ref content)\n    }\n\n    fn parse_json(file: @File) -> Option<T> {\n        let mut content = execute_cheatcode::<\n            'read_json',\n        >(byte_array_as_felt_array(file.path).span());\n        Serde::<T>::deserialize(ref content)\n    }\n}\n"
  },
  {
    "path": "snforge_std/src/fs.cairo",
    "content": "mod file_operations;\n\npub use file_operations::File;\npub use file_operations::{FileParser, FileTrait, read_json, read_txt};\n"
  },
  {
    "path": "snforge_std/src/fuzzable.cairo",
    "content": "use core::fmt::Debug;\nuse starknet::ContractAddress;\npub use super::cheatcodes::generate_arg::generate_arg;\n\nconst MAX_FELT: felt252 = 0x800000000000011000000000000000000000000000000000000000000000000;\n\npub trait Fuzzable<T, +Debug<T>> {\n    fn blank() -> T;\n    fn generate() -> T;\n}\n\nimpl FuzzableFelt of Fuzzable<felt252> {\n    fn blank() -> felt252 {\n        0x0\n    }\n\n    fn generate() -> felt252 {\n        generate_arg(0x0, MAX_FELT)\n    }\n}\n\nmod nums {\n    use core::num::traits::{Bounded, Zero};\n    use super::{Debug, Fuzzable, generate_arg};\n\n    pub impl FuzzableNum<\n        T, +Zero<T>, +Bounded<T>, +Drop<T>, +Serde<T>, +Into<T, felt252>, +Debug<T>,\n    > of Fuzzable<T> {\n        fn blank() -> T {\n            Zero::<T>::zero()\n        }\n\n        fn generate() -> T {\n            generate_arg(Bounded::<T>::MIN, Bounded::<T>::MAX)\n        }\n    }\n}\n\npub impl FuzzableU8 = nums::FuzzableNum<u8>;\npub impl FuzzableU16 = nums::FuzzableNum<u16>;\npub impl FuzzableU32 = nums::FuzzableNum<u32>;\npub impl FuzzableU64 = nums::FuzzableNum<u64>;\npub impl FuzzableU128 = nums::FuzzableNum<u128>;\n\npub impl FuzzableI8 = nums::FuzzableNum<i8>;\npub impl FuzzableI16 = nums::FuzzableNum<i16>;\npub impl FuzzableI32 = nums::FuzzableNum<i32>;\npub impl FuzzableI64 = nums::FuzzableNum<i64>;\npub impl FuzzableI128 = nums::FuzzableNum<i128>;\n\n\npub impl FuzzableU256 of Fuzzable<u256> {\n    fn blank() -> u256 {\n        0\n    }\n\n    fn generate() -> u256 {\n        let mut serialized: Span<felt252> = array![\n            Fuzzable::<u128>::generate().into(), Fuzzable::<u128>::generate().into(),\n        ]\n            .span();\n        Serde::deserialize(ref serialized).unwrap()\n    }\n}\n\n\npub impl FuzzableByteArray1000ASCII of Fuzzable<ByteArray> {\n    fn blank() -> ByteArray {\n        \"\"\n    }\n\n    // Generates a random string of length 0 to 1000\n    fn generate() -> ByteArray {\n        let mut ba_len: u32 = generate_arg(0, 1000);\n\n        let mut ba = \"\";\n        while ba_len > 0 {\n            // Limit only to printable characters with ASCII codes 32-126\n            let letter = Fuzzable::<u8>::generate() % 95;\n            ba.append_byte(letter + 32);\n            ba_len = ba_len - 1;\n        }\n\n        ba\n    }\n}\n\npub impl FuzzableBool of Fuzzable<bool> {\n    fn blank() -> bool {\n        false\n    }\n\n    fn generate() -> bool {\n        generate_arg(0, 1) == 1\n    }\n}\n\npub impl FuzzableContractAddress of Fuzzable<ContractAddress> {\n    fn blank() -> ContractAddress {\n        0x1.try_into().expect('0x1 should be a valid address')\n    }\n\n    fn generate() -> ContractAddress {\n        // [0, 2 ** 251)\n        let arg = generate_arg(\n            0x0, 3618502788666131106986593281521497120414687020801267626233049500247285301247,\n        );\n        arg.try_into().expect('Should be a valid address')\n    }\n}\n"
  },
  {
    "path": "snforge_std/src/lib.cairo",
    "content": "pub mod cheatcodes;\n\npub use cheatcodes::CheatSpan;\n\npub use cheatcodes::block_hash::cheat_block_hash;\npub use cheatcodes::block_hash::{\n    start_cheat_block_hash, start_cheat_block_hash_global, stop_cheat_block_hash,\n    stop_cheat_block_hash_global,\n};\n\npub use cheatcodes::contract_class::declare;\npub use cheatcodes::contract_class::{\n    ContractClass, ContractClassTrait, DeclareResult, DeclareResultTrait, get_class_hash,\n};\n\npub use cheatcodes::erc20::set_balance;\npub use cheatcodes::erc20::{CustomToken, Token, TokenImpl, TokenTrait};\n\npub use cheatcodes::events::Event;\npub use cheatcodes::events::{\n    EventSpy, EventSpyAssertionsTrait, EventSpyTrait, EventsFilterTrait, IsEmitted, spy_events,\n};\npub use cheatcodes::execution_info::account_contract_address::{\n    cheat_account_contract_address, start_cheat_account_contract_address,\n    start_cheat_account_contract_address_global, stop_cheat_account_contract_address,\n    stop_cheat_account_contract_address_global,\n};\npub use cheatcodes::execution_info::account_deployment_data::{\n    cheat_account_deployment_data, start_cheat_account_deployment_data,\n    start_cheat_account_deployment_data_global, stop_cheat_account_deployment_data,\n    stop_cheat_account_deployment_data_global,\n};\npub use cheatcodes::execution_info::block_number::{\n    cheat_block_number, start_cheat_block_number, start_cheat_block_number_global,\n    stop_cheat_block_number, stop_cheat_block_number_global,\n};\npub use cheatcodes::execution_info::block_timestamp::{\n    cheat_block_timestamp, start_cheat_block_timestamp, start_cheat_block_timestamp_global,\n    stop_cheat_block_timestamp, stop_cheat_block_timestamp_global,\n};\n\npub use cheatcodes::execution_info::caller_address::cheat_caller_address;\npub use cheatcodes::execution_info::caller_address::{\n    start_cheat_caller_address, start_cheat_caller_address_global, stop_cheat_caller_address,\n    stop_cheat_caller_address_global,\n};\npub use cheatcodes::execution_info::chain_id::{\n    cheat_chain_id, start_cheat_chain_id, start_cheat_chain_id_global, stop_cheat_chain_id,\n    stop_cheat_chain_id_global,\n};\npub use cheatcodes::execution_info::fee_data_availability_mode::{\n    cheat_fee_data_availability_mode, start_cheat_fee_data_availability_mode,\n    start_cheat_fee_data_availability_mode_global, stop_cheat_fee_data_availability_mode,\n    stop_cheat_fee_data_availability_mode_global,\n};\npub use cheatcodes::execution_info::max_fee::{\n    cheat_max_fee, start_cheat_max_fee, start_cheat_max_fee_global, stop_cheat_max_fee,\n    stop_cheat_max_fee_global,\n};\npub use cheatcodes::execution_info::nonce::{\n    cheat_nonce, start_cheat_nonce, start_cheat_nonce_global, stop_cheat_nonce,\n    stop_cheat_nonce_global,\n};\npub use cheatcodes::execution_info::nonce_data_availability_mode::{\n    cheat_nonce_data_availability_mode, start_cheat_nonce_data_availability_mode,\n    start_cheat_nonce_data_availability_mode_global, stop_cheat_nonce_data_availability_mode,\n    stop_cheat_nonce_data_availability_mode_global,\n};\npub use cheatcodes::execution_info::paymaster_data::{\n    cheat_paymaster_data, start_cheat_paymaster_data, start_cheat_paymaster_data_global,\n    stop_cheat_paymaster_data, stop_cheat_paymaster_data_global,\n};\npub use cheatcodes::execution_info::proof_facts::{\n    cheat_proof_facts, start_cheat_proof_facts, start_cheat_proof_facts_global,\n    stop_cheat_proof_facts, stop_cheat_proof_facts_global,\n};\npub use cheatcodes::execution_info::resource_bounds::{\n    cheat_resource_bounds, start_cheat_resource_bounds, start_cheat_resource_bounds_global,\n    stop_cheat_resource_bounds, stop_cheat_resource_bounds_global,\n};\npub use cheatcodes::execution_info::sequencer_address::{\n    cheat_sequencer_address, start_cheat_sequencer_address, start_cheat_sequencer_address_global,\n    stop_cheat_sequencer_address, stop_cheat_sequencer_address_global,\n};\npub use cheatcodes::execution_info::signature::{\n    cheat_signature, start_cheat_signature, start_cheat_signature_global, stop_cheat_signature,\n    stop_cheat_signature_global,\n};\npub use cheatcodes::execution_info::tip::{\n    cheat_tip, start_cheat_tip, start_cheat_tip_global, stop_cheat_tip, stop_cheat_tip_global,\n};\npub use cheatcodes::execution_info::transaction_hash::{\n    cheat_transaction_hash, start_cheat_transaction_hash, start_cheat_transaction_hash_global,\n    stop_cheat_transaction_hash, stop_cheat_transaction_hash_global,\n};\npub use cheatcodes::execution_info::version::{\n    cheat_transaction_version, start_cheat_transaction_version,\n    start_cheat_transaction_version_global, stop_cheat_transaction_version,\n    stop_cheat_transaction_version_global,\n};\n\npub use cheatcodes::generate_random_felt::generate_random_felt;\n\npub use cheatcodes::l1_handler::L1Handler;\npub use cheatcodes::l1_handler::L1HandlerTrait;\n\npub use cheatcodes::message_to_l1::{\n    MessageToL1, MessageToL1FilterTrait, MessageToL1Spy, MessageToL1SpyAssertionsTrait,\n    MessageToL1SpyTrait, spy_messages_to_l1,\n};\n\npub use cheatcodes::storage::store;\npub use cheatcodes::storage::{interact_with_state, load, map_entry_address};\npub use cheatcodes::{\n    ReplaceBytecodeError, mock_call, replace_bytecode, start_mock_call, stop_mock_call,\n    test_address, test_selector,\n};\n\npub mod byte_array;\n\nmod cheatcode;\n\nmod config_types;\n\npub mod env;\n\npub mod fs;\n\npub mod fuzzable;\n\npub mod signature;\n\npub mod testing;\n\npub mod trace;\n\n#[doc(hidden)]\npub mod _internals {\n    pub use cheatcode::{is_config_run, save_fuzzer_arg};\n    use super::cheatcode;\n\n    pub use super::config_types;\n}\n"
  },
  {
    "path": "snforge_std/src/signature/secp256k1_curve.cairo",
    "content": "use core::option::OptionTrait;\nuse core::serde::Serde;\nuse snforge_std::signature::{KeyPair, KeyPairTrait, SignerTrait, VerifierTrait};\nuse starknet::SyscallResultTrait;\nuse starknet::secp256_trait::{Secp256PointTrait, Secp256Trait, is_valid_signature};\nuse starknet::secp256k1::Secp256k1Point;\nuse crate::cheatcode::execute_cheatcode_and_deserialize;\nuse super::SignError;\n\npub type Secp256k1CurveKeyPair = KeyPair<u256, Secp256k1Point>;\n\npub impl Secp256k1CurveKeyPairImpl of KeyPairTrait<u256, Secp256k1Point> {\n    fn generate() -> Secp256k1CurveKeyPair {\n        let (secret_key, pk_x, pk_y) = execute_cheatcode_and_deserialize::<\n            'generate_ecdsa_keys', (u256, u256, u256),\n        >(array!['Secp256k1'].span());\n\n        let public_key = Secp256Trait::secp256_ec_new_syscall(pk_x, pk_y).unwrap_syscall().unwrap();\n\n        KeyPair { secret_key, public_key }\n    }\n\n    fn from_secret_key(secret_key: u256) -> Secp256k1CurveKeyPair {\n        if (secret_key == 0_u256\n            || secret_key >= Secp256Trait::<Secp256k1Point>::get_curve_size()) {\n            core::panic_with_felt252('invalid secret_key');\n        }\n\n        let generator = Secp256Trait::get_generator_point();\n\n        let public_key = Secp256PointTrait::mul(generator, secret_key).unwrap_syscall();\n\n        KeyPair { secret_key, public_key }\n    }\n}\n\npub impl Secp256k1CurveSignerImpl of SignerTrait<Secp256k1CurveKeyPair, u256, (u256, u256)> {\n    fn sign(self: Secp256k1CurveKeyPair, message_hash: u256) -> Result<(u256, u256), SignError> {\n        let mut input = array!['Secp256k1'];\n        self.secret_key.serialize(ref input);\n        message_hash.serialize(ref input);\n\n        execute_cheatcode_and_deserialize::<'ecdsa_sign_message'>(input.span())\n    }\n}\n\npub impl Secp256k1CurveVerifierImpl of VerifierTrait<Secp256k1CurveKeyPair, u256, (u256, u256)> {\n    fn verify(self: Secp256k1CurveKeyPair, message_hash: u256, signature: (u256, u256)) -> bool {\n        let (r, s) = signature;\n        is_valid_signature::<Secp256k1Point>(message_hash, r, s, self.public_key)\n    }\n}\n"
  },
  {
    "path": "snforge_std/src/signature/secp256r1_curve.cairo",
    "content": "use snforge_std::signature::{KeyPair, KeyPairTrait, SignerTrait, VerifierTrait};\nuse starknet::SyscallResultTrait;\nuse starknet::secp256_trait::{Secp256PointTrait, Secp256Trait, is_valid_signature};\nuse starknet::secp256r1::Secp256r1Point;\nuse crate::cheatcode::execute_cheatcode_and_deserialize;\nuse super::SignError;\n\npub type Secp256r1CurveKeyPair = KeyPair<u256, Secp256r1Point>;\n\npub impl Secp256r1CurveKeyPairImpl of KeyPairTrait<u256, Secp256r1Point> {\n    fn generate() -> Secp256r1CurveKeyPair {\n        let (secret_key, pk_x, pk_y) = execute_cheatcode_and_deserialize::<\n            'generate_ecdsa_keys', (u256, u256, u256),\n        >(array!['Secp256r1'].span());\n\n        let public_key = Secp256Trait::secp256_ec_new_syscall(pk_x, pk_y).unwrap_syscall().unwrap();\n\n        KeyPair { secret_key, public_key }\n    }\n\n    fn from_secret_key(secret_key: u256) -> Secp256r1CurveKeyPair {\n        if (secret_key == 0_u256\n            || secret_key >= Secp256Trait::<Secp256r1Point>::get_curve_size()) {\n            core::panic_with_felt252('invalid secret_key');\n        }\n\n        let generator = Secp256Trait::get_generator_point();\n\n        let public_key = Secp256PointTrait::mul(generator, secret_key).unwrap_syscall();\n\n        KeyPair { secret_key, public_key }\n    }\n}\n\npub impl Secp256r1CurveSignerImpl of SignerTrait<Secp256r1CurveKeyPair, u256, (u256, u256)> {\n    fn sign(self: Secp256r1CurveKeyPair, message_hash: u256) -> Result<(u256, u256), SignError> {\n        let mut input = array!['Secp256r1'];\n        self.secret_key.serialize(ref input);\n        message_hash.serialize(ref input);\n\n        execute_cheatcode_and_deserialize::<'ecdsa_sign_message'>(input.span())\n    }\n}\n\npub impl Secp256r1CurveVerifierImpl of VerifierTrait<Secp256r1CurveKeyPair, u256, (u256, u256)> {\n    fn verify(self: Secp256r1CurveKeyPair, message_hash: u256, signature: (u256, u256)) -> bool {\n        let (r, s) = signature;\n        is_valid_signature::<Secp256r1Point>(message_hash, r, s, self.public_key)\n    }\n}\n"
  },
  {
    "path": "snforge_std/src/signature/stark_curve.cairo",
    "content": "use core::ec::{EcPoint, EcPointImpl, stark_curve};\nuse core::ecdsa::check_ecdsa_signature;\nuse snforge_std::signature::{KeyPair, KeyPairTrait, SignerTrait, VerifierTrait};\nuse crate::cheatcode::execute_cheatcode_and_deserialize;\nuse super::SignError;\n\npub type StarkCurveKeyPair = KeyPair<felt252, felt252>;\n\npub impl StarkCurveKeyPairImpl of KeyPairTrait<felt252, felt252> {\n    fn generate() -> StarkCurveKeyPair {\n        let (secret_key, public_key) = execute_cheatcode_and_deserialize::<\n            'generate_stark_keys', (felt252, felt252),\n        >(array![].span());\n\n        KeyPair { secret_key, public_key }\n    }\n\n    fn from_secret_key(secret_key: felt252) -> StarkCurveKeyPair {\n        if (secret_key == 0) {\n            core::panic_with_felt252('invalid secret_key');\n        }\n\n        let generator = EcPointImpl::new(stark_curve::GEN_X, stark_curve::GEN_Y).unwrap();\n\n        let public_key: EcPoint = EcPointImpl::mul(generator, secret_key);\n\n        let (pk_x, _pk_y) = public_key.try_into().unwrap().coordinates();\n\n        KeyPair { secret_key, public_key: pk_x }\n    }\n}\n\npub impl StarkCurveSignerImpl of SignerTrait<StarkCurveKeyPair, felt252, (felt252, felt252)> {\n    fn sign(\n        self: StarkCurveKeyPair, message_hash: felt252,\n    ) -> Result<(felt252, felt252), SignError> {\n        execute_cheatcode_and_deserialize::<\n            'stark_sign_message',\n        >(array![self.secret_key, message_hash].span())\n    }\n}\n\npub impl StarkCurveVerifierImpl of VerifierTrait<StarkCurveKeyPair, felt252, (felt252, felt252)> {\n    fn verify(\n        self: StarkCurveKeyPair, message_hash: felt252, signature: (felt252, felt252),\n    ) -> bool {\n        let (r, s) = signature;\n        check_ecdsa_signature(message_hash, self.public_key, r, s)\n    }\n}\n"
  },
  {
    "path": "snforge_std/src/signature.cairo",
    "content": "pub mod secp256k1_curve;\npub mod secp256r1_curve;\npub mod stark_curve;\n\n#[derive(Copy, Drop)]\npub struct KeyPair<SK, PK> {\n    /// A key that is used for signing the messages\n    pub secret_key: SK,\n    /// A (x, y) point on the elliptic curve used for verification of the signature\n    pub public_key: PK,\n}\n\npub trait KeyPairTrait<SK, PK> {\n    /// Generates the private and public keys using the built-in random generator\n    fn generate() -> KeyPair<SK, PK>;\n    /// Derives the KeyPair (`secret_key` + `public_key`) using `secret_key`\n    fn from_secret_key(secret_key: SK) -> KeyPair<SK, PK>;\n}\n\npub trait SignerTrait<T, H, U> {\n    /// Signs given message hash\n    /// `self` - KeyPair used for signing\n    /// `message_hash` - input to sign bounded by the curve type (u256 for 256bit curves, felt252\n    /// for StarkCurve)\n    /// Returns the signature components (usually r,s tuple) or error\n    fn sign(self: T, message_hash: H) -> Result<U, SignError>;\n}\n\npub trait VerifierTrait<T, H, U> {\n    /// `self` - KeyPair used for verifying\n    /// `message_hash` - input to verify bounded by the curve type (u256 for 256bit curves, felt252\n    /// for StarkCurve)\n    /// `signature` - the signature components (usually r,s tuple)\n    /// Returns a boolean representing the validity of the signature\n    fn verify(self: T, message_hash: H, signature: U) -> bool;\n}\n\n#[derive(Copy, Drop, Serde, PartialEq)]\npub enum SignError {\n    InvalidSecretKey,\n    HashOutOfRange,\n}\n"
  },
  {
    "path": "snforge_std/src/testing.cairo",
    "content": "use crate::cheatcode::execute_cheatcode_and_deserialize;\n\n/// Gets the current step during test execution\npub fn get_current_vm_step() -> u32 {\n    execute_cheatcode_and_deserialize::<'get_current_vm_step', u32>(array![].span())\n}\n"
  },
  {
    "path": "snforge_std/src/trace.cairo",
    "content": "use starknet::ContractAddress;\nuse crate::cheatcode::execute_cheatcode_and_deserialize;\n\n/// Tree-like structure which contains all of the starknet calls and sub-calls along with the\n/// results\n#[derive(Drop, Serde, PartialEq, Clone, Debug)]\npub struct CallTrace {\n    pub entry_point: CallEntryPoint,\n    /// All the calls that happened in the scope of `entry_point`\n    pub nested_calls: Array<CallTrace>,\n    pub result: CallResult,\n}\n\n/// A single function entry point summary\n#[derive(Drop, Serde, PartialEq, Clone, Debug)]\npub struct CallEntryPoint {\n    pub entry_point_type: EntryPointType,\n    /// Hashed selector of the invoked function\n    pub entry_point_selector: felt252,\n    /// Serialized arguments calldata\n    pub calldata: Array<felt252>,\n    /// Contract address targeted by the call\n    pub contract_address: ContractAddress,\n    /// Address that the call originates from\n    pub caller_address: ContractAddress,\n    pub call_type: CallType,\n}\n\n/// Type of the function being invoked\n#[derive(Drop, Serde, PartialEq, Clone, Debug)]\npub enum EntryPointType {\n    /// Constructor of a contract\n    Constructor,\n    /// Contract interface entry point\n    External,\n    /// An entrypoint for handling messages from L1\n    L1Handler,\n}\n\n/// Denotes type of the call\n#[derive(Drop, Serde, PartialEq, Clone, Debug)]\npub enum CallType {\n    /// Regular call\n    Call,\n    /// Library call\n    Delegate,\n}\n\n/// Result of a contract or a library call\n#[derive(Drop, Serde, PartialEq, Clone, Debug)]\npub enum CallResult {\n    /// A successful call with it's result\n    Success: Array<felt252>,\n    /// A failed call along with it's panic data\n    Failure: CallFailure,\n}\n\n/// Represents a pre-processed failure of a call\n#[derive(Drop, Serde, PartialEq, Clone, Debug)]\npub enum CallFailure {\n    /// Contains raw panic data\n    Panic: Array<felt252>,\n    /// Contains panic data in parsed form, if parsing is applicable\n    Error: ByteArray,\n}\n\n/// Returns current call trace of the test, up to the last call made to a contract\npub fn get_call_trace() -> CallTrace {\n    execute_cheatcode_and_deserialize::<'get_call_trace'>(array![].span())\n}\nuse core::fmt::{Debug, Display, Error, Formatter};\n\nimpl DisplayCallResult of Display<CallResult> {\n    fn fmt(self: @CallResult, ref f: Formatter) -> Result<(), Error> {\n        match self {\n            CallResult::Success(val) => {\n                write!(f, \"Success: \")?;\n                Debug::fmt(val, ref f)?;\n            },\n            CallResult::Failure(call_failure) => {\n                write!(f, \"Failure: \")?;\n\n                match call_failure {\n                    CallFailure::Panic(val) => { Debug::fmt(val, ref f)?; },\n                    CallFailure::Error(msg) => { Display::fmt(msg, ref f)?; },\n                };\n            },\n        }\n        Result::Ok(())\n    }\n}\n\nimpl DisplayEntryPointType of Display<EntryPointType> {\n    fn fmt(self: @EntryPointType, ref f: Formatter) -> Result<(), Error> {\n        let str: ByteArray = match self {\n            EntryPointType::Constructor => \"Constructor\",\n            EntryPointType::External => \"External\",\n            EntryPointType::L1Handler => \"L1 Handler\",\n        };\n        f.buffer.append(@str);\n        Result::Ok(())\n    }\n}\n\nimpl DisplayCallType of Display<CallType> {\n    fn fmt(self: @CallType, ref f: Formatter) -> Result<(), Error> {\n        let str: ByteArray = match self {\n            CallType::Call => \"Call\",\n            CallType::Delegate => \"Delegate\",\n        };\n        f.buffer.append(@str);\n        Result::Ok(())\n    }\n}\n\nimpl DisplayCallTrace of Display<CallTrace> {\n    fn fmt(self: @CallTrace, ref f: Formatter) -> Result<(), Error> {\n        Display::fmt(@IndentedCallTrace { struct_ref: self, base_indents: 0 }, ref f).unwrap();\n        Result::Ok(())\n    }\n}\n\n#[derive(Drop)]\nstruct Indented<T> {\n    struct_ref: @T,\n    base_indents: u8,\n}\n\ntype IndentedEntryPoint = Indented<CallEntryPoint>;\ntype IndentedCallTraceArray = Indented<Array<CallTrace>>;\ntype IndentedCallTrace = Indented<CallTrace>;\ntype IndentedCallResult = Indented<CallResult>;\n\n\nimpl DisplayIndentedCallTrace of Display<Indented<CallTrace>> {\n    fn fmt(self: @Indented<CallTrace>, ref f: Formatter) -> Result<(), Error> {\n        Display::fmt(\n            @IndentedEntryPoint {\n                base_indents: *self.base_indents, struct_ref: *self.struct_ref.entry_point,\n            },\n            ref f,\n        )\n            .unwrap();\n        write!(f, \"\\n\").unwrap();\n        write_indents_to_formatter(*self.base_indents, ref f);\n        write!(f, \"Nested Calls: [\").unwrap();\n        if (*self.struct_ref.nested_calls).len() > 0 {\n            write!(f, \"\\n\").unwrap();\n            Display::fmt(\n                @IndentedCallTraceArray {\n                    base_indents: (*self.base_indents) + 1,\n                    struct_ref: *self.struct_ref.nested_calls,\n                },\n                ref f,\n            )\n                .unwrap();\n            write!(f, \"\\n\").unwrap();\n            write_indents_to_formatter(*self.base_indents, ref f);\n        }\n        write!(f, \"]\").unwrap();\n\n        write!(f, \"\\n\").unwrap();\n        Display::fmt(\n            @IndentedCallResult {\n                base_indents: *self.base_indents, struct_ref: *self.struct_ref.result,\n            },\n            ref f,\n        )\n            .unwrap();\n\n        Result::Ok(())\n    }\n}\n\nimpl DisplayIndentedCallTraceArray of Display<Indented<Array<CallTrace>>> {\n    fn fmt(self: @Indented<Array<CallTrace>>, ref f: Formatter) -> Result<(), Error> {\n        let mut i: u32 = 0;\n        let trace_len = (*self.struct_ref).len();\n        while i < trace_len {\n            write_indents_to_formatter(*self.base_indents, ref f);\n            write!(f, \"(\\n\").unwrap();\n\n            Display::fmt(\n                @IndentedCallTrace {\n                    base_indents: *self.base_indents + 1, struct_ref: (*self.struct_ref)[i],\n                },\n                ref f,\n            )\n                .unwrap();\n            write!(f, \"\\n\").unwrap();\n            write_indents_to_formatter(*self.base_indents, ref f);\n            write!(f, \")\").unwrap();\n\n            i = i + 1;\n            if i != trace_len {\n                write!(f, \",\\n\").unwrap();\n            }\n        }\n\n        Result::Ok(())\n    }\n}\n\nimpl DisplayIndentedEntryPoint of Display<Indented<CallEntryPoint>> {\n    fn fmt(self: @Indented<CallEntryPoint>, ref f: Formatter) -> Result<(), Error> {\n        write_indents_to_formatter(*self.base_indents, ref f);\n        write!(f, \"Entry point type: \")?;\n        Display::fmt(*self.struct_ref.entry_point_type, ref f)?;\n\n        write!(f, \"\\n\")?;\n        write_indents_to_formatter(*self.base_indents, ref f);\n        write!(f, \"Selector: \")?;\n        Display::fmt(*self.struct_ref.entry_point_selector, ref f)?;\n\n        write!(f, \"\\n\")?;\n        write_indents_to_formatter(*self.base_indents, ref f);\n        write!(f, \"Calldata: \")?;\n        Debug::fmt(*self.struct_ref.calldata, ref f)?;\n\n        write!(f, \"\\n\")?;\n        write_indents_to_formatter(*self.base_indents, ref f);\n        write!(f, \"Storage address: \")?;\n        Debug::fmt(*self.struct_ref.contract_address, ref f)?;\n\n        write!(f, \"\\n\")?;\n        write_indents_to_formatter(*self.base_indents, ref f);\n        write!(f, \"Caller address: \")?;\n        Debug::fmt(*self.struct_ref.caller_address, ref f)?;\n\n        write!(f, \"\\n\")?;\n        write_indents_to_formatter(*self.base_indents, ref f);\n        write!(f, \"Call type: \")?;\n        Display::fmt(*self.struct_ref.call_type, ref f)?;\n\n        Result::Ok(())\n    }\n}\n\nimpl DisplayIndentedCallResult of Display<Indented<CallResult>> {\n    fn fmt(self: @Indented<CallResult>, ref f: Formatter) -> Result<(), Error> {\n        write_indents_to_formatter(*self.base_indents, ref f);\n        write!(f, \"Call Result: \")?;\n        Display::fmt(*self.struct_ref, ref f)?;\n\n        Result::Ok(())\n    }\n}\n\n\nfn write_indents_to_formatter(indents: u8, ref f: Formatter) {\n    let mut i: u8 = 0;\n    while i < indents {\n        write!(f, \"    \").unwrap();\n        i = i + 1;\n    }\n}\n"
  },
  {
    "path": "snforge_templates/balance_contract/src/lib.cairo",
    "content": "/// Interface representing `HelloContract`.\n/// This interface allows modification and retrieval of the contract balance.\n#[starknet::interface]\npub trait IHelloStarknet<TContractState> {\n    /// Increase contract balance.\n    fn increase_balance(ref self: TContractState, amount: felt252);\n    /// Retrieve contract balance.\n    fn get_balance(self: @TContractState) -> felt252;\n}\n\n/// Simple contract for managing balance.\n#[starknet::contract]\nmod HelloStarknet {\n    use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n\n    #[storage]\n    struct Storage {\n        balance: felt252,\n    }\n\n    #[abi(embed_v0)]\n    impl HelloStarknetImpl of super::IHelloStarknet<ContractState> {\n        fn increase_balance(ref self: ContractState, amount: felt252) {\n            assert(amount != 0, 'Amount cannot be 0');\n            self.balance.write(self.balance.read() + amount);\n        }\n\n        fn get_balance(self: @ContractState) -> felt252 {\n            self.balance.read()\n        }\n    }\n}\n"
  },
  {
    "path": "snforge_templates/balance_contract/tests/test_contract.cairo",
    "content": "use starknet::ContractAddress;\n\nuse snforge_std::{declare, ContractClassTrait, DeclareResultTrait};\n\nuse {{ PROJECT_NAME }}::IHelloStarknetSafeDispatcher;\nuse {{ PROJECT_NAME }}::IHelloStarknetSafeDispatcherTrait;\nuse {{ PROJECT_NAME }}::IHelloStarknetDispatcher;\nuse {{ PROJECT_NAME }}::IHelloStarknetDispatcherTrait;\n\nfn deploy_contract(name: ByteArray) -> ContractAddress {\n    let contract = declare(name).unwrap().contract_class();\n    let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();\n    contract_address\n}\n\n#[test]\nfn test_increase_balance() {\n    let contract_address = deploy_contract(\"HelloStarknet\");\n\n    let dispatcher = IHelloStarknetDispatcher { contract_address };\n\n    let balance_before = dispatcher.get_balance();\n    assert(balance_before == 0, 'Invalid balance');\n\n    dispatcher.increase_balance(42);\n\n    let balance_after = dispatcher.get_balance();\n    assert(balance_after == 42, 'Invalid balance');\n}\n\n#[test]\n#[feature(\"safe_dispatcher\")]\nfn test_cannot_increase_balance_with_zero_value() {\n    let contract_address = deploy_contract(\"HelloStarknet\");\n\n    let safe_dispatcher = IHelloStarknetSafeDispatcher { contract_address };\n\n    let balance_before = safe_dispatcher.get_balance().unwrap();\n    assert(balance_before == 0, 'Invalid balance');\n\n    match safe_dispatcher.increase_balance(0) {\n        Result::Ok(_) => core::panic_with_felt252('Should have panicked'),\n        Result::Err(panic_data) => {\n            assert(*panic_data.at(0) == 'Amount cannot be 0', *panic_data.at(0));\n        }\n    };\n}\n"
  },
  {
    "path": "snforge_templates/cairo_program/src/lib.cairo",
    "content": "fn main() -> u32 {\n    fib(16)\n}\n\nfn fib(mut n: u32) -> u32 {\n    let mut a: u32 = 0;\n    let mut b: u32 = 1;\n    while n != 0 {\n        n = n - 1;\n        let temp = b;\n        b = a + b;\n        a = temp;\n    };\n    a\n}\n\n#[cfg(test)]\nmod tests {\n    use super::fib;\n\n    #[test]\n    fn it_works() {\n        assert(fib(16) == 987, 'it works!');\n    }\n}\n"
  },
  {
    "path": "snforge_templates/erc20_contract/src/lib.cairo",
    "content": "pub mod mock_erc20;\npub mod token_sender;\n"
  },
  {
    "path": "snforge_templates/erc20_contract/src/mock_erc20.cairo",
    "content": "/// Example ERC20 token contract created with openzeppelin dependency.\n/// Full guide and documentation can be found at:\n/// https://docs.openzeppelin.com/contracts-cairo/1.0.0/guides/erc20-supply\n#[starknet::contract]\npub mod MockERC20 {\n    use openzeppelin_token::erc20::{DefaultConfig, ERC20Component, ERC20HooksEmptyImpl};\n    use starknet::ContractAddress;\n\n    /// Declare the ERC20 component for this contract.\n    /// This allows the contract to inherit ERC20 functionalities.\n    component!(path: ERC20Component, storage: erc20, event: ERC20Event);\n\n    /// Define ERC20 public interface.\n    #[abi(embed_v0)]\n    impl ERC20MixinImpl = ERC20Component::ERC20MixinImpl<ContractState>;\n\n    /// Define internal implementation, allowing internal modifications like minting.\n    impl ERC20InternalImpl = ERC20Component::InternalImpl<ContractState>;\n\n    #[storage]\n    struct Storage {\n        #[substorage(v0)]\n        erc20: ERC20Component::Storage,\n    }\n\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    enum Event {\n        #[flat]\n        ERC20Event: ERC20Component::Event,\n    }\n\n    #[constructor]\n    fn constructor(ref self: ContractState, initial_supply: u256, recipient: ContractAddress) {\n        let name = \"MockToken\";\n        let symbol = \"MTK\";\n\n        /// Initialize the contract by setting the token name and symbol.\n        self.erc20.initializer(name, symbol);\n        /// Create `initial_supply` amount of tokens and assigns them to `recipient`.\n        self.erc20.mint(recipient, initial_supply);\n    }\n}\n"
  },
  {
    "path": "snforge_templates/erc20_contract/src/token_sender.cairo",
    "content": "use starknet::ContractAddress;\n\n#[derive(Drop, Serde, Copy)]\npub struct TransferRequest {\n    pub recipient: ContractAddress,\n    pub amount: u256,\n}\n\n/// Interface representing `TokenSender` contract functionality.\n#[starknet::interface]\npub trait ITokenSender<TContractState> {\n    /// Function to send tokens to multiple recipients in a single transaction.\n    /// - `token_address` - The address of the token contract\n    /// - `transfer_list` - The list of transfers to perform\n    fn multisend(\n        ref self: TContractState,\n        token_address: ContractAddress,\n        transfer_list: Array<TransferRequest>,\n    );\n}\n\n#[starknet::contract]\npub mod TokenSender {\n    use openzeppelin_interfaces::erc20::{IERC20Dispatcher, IERC20DispatcherTrait};\n    use starknet::{ContractAddress, get_caller_address, get_contract_address};\n    use super::TransferRequest;\n\n\n    #[event]\n    #[derive(Drop, starknet::Event)]\n    pub enum Event {\n        TransferSent: TransferSent,\n    }\n\n    #[derive(Drop, starknet::Event)]\n    pub struct TransferSent {\n        #[key]\n        pub recipient: ContractAddress,\n        pub token_address: ContractAddress,\n        pub amount: u256,\n    }\n\n\n    #[constructor]\n    fn constructor(ref self: ContractState) {}\n\n    #[storage]\n    struct Storage {}\n\n    #[abi(embed_v0)]\n    impl TokenSender of super::ITokenSender<ContractState> {\n        fn multisend(\n            ref self: ContractState,\n            token_address: ContractAddress,\n            transfer_list: Array<TransferRequest>,\n        ) {\n            // Create an ERC20 dispatcher to interact with the given token contract.\n            let erc20 = IERC20Dispatcher { contract_address: token_address };\n\n            // Compute total amount to be transferred.\n            let mut total_amount: u256 = 0;\n            for t in transfer_list.span() {\n                total_amount += *t.amount;\n            };\n\n            // Transfer the total amount from the caller to this contract.\n            erc20.transfer_from(get_caller_address(), get_contract_address(), total_amount);\n\n            // Distribute tokens to each recipient in the transfer list.\n            for t in transfer_list.span() {\n                erc20.transfer(*t.recipient, *t.amount);\n                self\n                    .emit(\n                        TransferSent {\n                            recipient: *t.recipient,\n                            token_address: token_address,\n                            amount: *t.amount,\n                        },\n                    );\n            };\n        }\n    }\n}\n"
  },
  {
    "path": "snforge_templates/erc20_contract/tests/test_erc20.cairo",
    "content": "use openzeppelin_interfaces::erc20::{IERC20Dispatcher, IERC20DispatcherTrait};\nuse openzeppelin_token::erc20::ERC20Component;\nuse snforge_std::{\n    CheatSpan, ContractClassTrait, DeclareResultTrait, EventSpyAssertionsTrait,\n    cheat_caller_address, declare, spy_events,\n};\nuse starknet::ContractAddress;\n\nconst STRK_TOKEN_ADDRESS: ContractAddress =\n    0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d\n    .try_into()\n    .unwrap();\n\nconst sender_account: ContractAddress = 1.try_into().unwrap();\nconst target_account: ContractAddress = 2.try_into().unwrap();\n\nconst INITIAL_SUPPLY: u256 = 10_000_000_000;\n\nfn setup() -> ContractAddress {\n    let erc20_class_hash = declare(\"MockERC20\").unwrap().contract_class();\n\n    let mut calldata = ArrayTrait::new();\n    INITIAL_SUPPLY.serialize(ref calldata);\n    sender_account.serialize(ref calldata);\n\n    let (contract_address, _) = erc20_class_hash.deploy(@calldata).unwrap();\n\n    contract_address\n}\n\n#[test]\nfn test_get_balance() {\n    let contract_address = setup();\n    let erc20 = IERC20Dispatcher { contract_address };\n\n    assert!(erc20.balance_of(sender_account) == INITIAL_SUPPLY, \"Balance should be > 0\");\n}\n\n#[test]\nfn test_transfer() {\n    let contract_address = setup();\n    let erc20 = IERC20Dispatcher { contract_address };\n\n    let balance_before = erc20.balance_of(target_account);\n    assert!(balance_before == 0, \"Invalid balance\");\n\n    cheat_caller_address(contract_address, sender_account, CheatSpan::TargetCalls(1));\n\n    let transfer_value: u256 = 100;\n    erc20.transfer(target_account, transfer_value);\n\n    let balance_after = erc20.balance_of(target_account);\n    assert!(balance_after == transfer_value, \"No value transferred\");\n}\n\n#[test]\n#[fork(\"SEPOLIA_LATEST\", block_number: 61804)]\nfn test_fork_transfer() {\n    let erc20 = IERC20Dispatcher { contract_address: STRK_TOKEN_ADDRESS };\n    let owner_account: ContractAddress =\n        0x04337e199aa6a8959aeb2a6afcd2f82609211104191a041e7b9ba2f4039768f0\n        .try_into()\n        .unwrap();\n\n    let balance_before = erc20.balance_of(target_account);\n    assert!(balance_before == 0, \"Invalid balance\");\n\n    cheat_caller_address(STRK_TOKEN_ADDRESS, owner_account, CheatSpan::TargetCalls(1));\n\n    let transfer_value: u256 = 100;\n    erc20.transfer(target_account, transfer_value);\n\n    let balance_after = erc20.balance_of(target_account);\n    assert!(balance_after == transfer_value, \"No value transferred\");\n}\n\n#[test]\nfn test_transfer_event() {\n    let contract_address = setup();\n    let erc20 = IERC20Dispatcher { contract_address };\n\n    cheat_caller_address(contract_address, sender_account, CheatSpan::TargetCalls(1));\n\n    let mut spy = spy_events();\n\n    let transfer_value: u256 = 100;\n    erc20.transfer(target_account, transfer_value);\n\n    spy\n        .assert_emitted(\n            @array![\n                (\n                    contract_address,\n                    ERC20Component::Event::Transfer(\n                        ERC20Component::Transfer {\n                            from: sender_account, to: target_account, value: transfer_value,\n                        },\n                    ),\n                ),\n            ],\n        );\n}\n\n#[test]\n#[should_panic(expected: ('ERC20: insufficient balance',))]\nfn should_panic_transfer() {\n    let contract_address = setup();\n    let erc20 = IERC20Dispatcher { contract_address };\n\n    let balance_before = erc20.balance_of(target_account);\n    assert!(balance_before == 0, \"Invalid balance\");\n\n    cheat_caller_address(contract_address, sender_account, CheatSpan::TargetCalls(1));\n\n    let transfer_value: u256 = INITIAL_SUPPLY + 1;\n\n    erc20.transfer(target_account, transfer_value);\n}\n"
  },
  {
    "path": "snforge_templates/erc20_contract/tests/test_token_sender.cairo",
    "content": "use openzeppelin_interfaces::erc20::{IERC20Dispatcher, IERC20DispatcherTrait};\nuse snforge_std::{\n    CheatSpan, ContractClassTrait, DeclareResultTrait, EventSpyAssertionsTrait,\n    cheat_caller_address, declare, spy_events,\n};\nuse starknet::ContractAddress;\nuse {{ PROJECT_NAME }}::token_sender::{\n    ITokenSenderDispatcher, ITokenSenderDispatcherTrait, TokenSender, TransferRequest,\n};\n\nconst INITIAL_SUPPLY: u256 = 10_000_000_000;\n\nconst sender_account: ContractAddress = 1.try_into().unwrap();\nconst target_account: ContractAddress = 2.try_into().unwrap();\n\nfn setup() -> (ContractAddress, ContractAddress) {\n    let erc20_class_hash = declare(\"MockERC20\").unwrap().contract_class();\n\n    let mut calldata = ArrayTrait::new();\n    INITIAL_SUPPLY.serialize(ref calldata);\n    sender_account.serialize(ref calldata);\n\n    let (erc20_address, _) = erc20_class_hash.deploy(@calldata).unwrap();\n\n    let token_sender_class_hash = declare(\"TokenSender\").unwrap().contract_class();\n\n    let mut calldata = ArrayTrait::new();\n\n    let (token_sender_address, _) = token_sender_class_hash.deploy(@calldata).unwrap();\n\n    (erc20_address, token_sender_address)\n}\n\n#[test]\nfn test_single_send() {\n    let (erc20_address, token_sender_address) = setup();\n    let erc20 = IERC20Dispatcher { contract_address: erc20_address };\n\n    assert!(erc20.balance_of(sender_account) == INITIAL_SUPPLY, \"Balance should be > 0\");\n\n    cheat_caller_address(erc20_address, sender_account, CheatSpan::TargetCalls(1));\n\n    let transfer_value: u256 = 100;\n    erc20.approve(token_sender_address, transfer_value * 2);\n\n    assert!(\n        erc20.allowance(sender_account, token_sender_address) == transfer_value * 2,\n        \"Allowance not set\",\n    );\n\n    let token_sender = ITokenSenderDispatcher { contract_address: token_sender_address };\n    let request = TransferRequest { recipient: target_account, amount: transfer_value };\n\n    let mut transfer_list = ArrayTrait::<TransferRequest>::new();\n    transfer_list.append(request);\n\n    cheat_caller_address(token_sender_address, sender_account, CheatSpan::TargetCalls(1));\n    token_sender.multisend(erc20_address, transfer_list);\n\n    let balance_after = erc20.balance_of(target_account);\n    assert!(balance_after == transfer_value, \"Balance should be > 0\");\n}\n\n#[test]\n#[fuzzer]\nfn test_single_send_fuzz(transfer_value: u256) {\n    let (erc20_address, token_sender_address) = setup();\n    let erc20 = IERC20Dispatcher { contract_address: erc20_address };\n\n    assert!(erc20.balance_of(sender_account) == INITIAL_SUPPLY, \"Balance should be > 0\");\n\n    cheat_caller_address(erc20_address, sender_account, CheatSpan::TargetCalls(1));\n\n    let transfer_value: u256 = 100;\n    erc20.approve(token_sender_address, transfer_value * 2);\n\n    assert!(\n        erc20.allowance(sender_account, token_sender_address) == transfer_value * 2,\n        \"Allowance not set\",\n    );\n\n    let token_sender = ITokenSenderDispatcher { contract_address: token_sender_address };\n    let request = TransferRequest { recipient: target_account, amount: transfer_value };\n\n    let mut transfer_list = ArrayTrait::<TransferRequest>::new();\n    transfer_list.append(request);\n\n    let mut spy = spy_events();\n\n    cheat_caller_address(token_sender_address, sender_account, CheatSpan::TargetCalls(1));\n    token_sender.multisend(erc20_address, transfer_list);\n\n    spy\n        .assert_emitted(\n            @array![\n                (\n                    token_sender_address,\n                    TokenSender::Event::TransferSent(\n                        TokenSender::TransferSent {\n                            recipient: target_account,\n                            token_address: erc20_address,\n                            amount: transfer_value,\n                        },\n                    ),\n                ),\n            ],\n        );\n\n    let balance_after = erc20.balance_of(target_account);\n    assert!(balance_after == transfer_value, \"Balance should be > 0\");\n}\n\n#[test]\nfn test_multisend() {\n    let (erc20_address, token_sender_address) = setup();\n    let erc20 = IERC20Dispatcher { contract_address: erc20_address };\n\n    let other_target_account = 3.try_into().unwrap();\n\n    assert!(erc20.balance_of(sender_account) == INITIAL_SUPPLY, \"Balance should be > 0\");\n\n    cheat_caller_address(erc20_address, sender_account, CheatSpan::TargetCalls(1));\n\n    let transfer_value: u256 = 100;\n    erc20.approve(token_sender_address, transfer_value * 2);\n\n    assert!(\n        erc20.allowance(sender_account, token_sender_address) == transfer_value * 2,\n        \"Allowance not set\",\n    );\n\n    let token_sender = ITokenSenderDispatcher { contract_address: token_sender_address };\n    let request_1 = TransferRequest { recipient: target_account, amount: transfer_value };\n    let request_2 = TransferRequest { recipient: other_target_account, amount: transfer_value };\n\n    let mut transfer_list = ArrayTrait::<TransferRequest>::new();\n    transfer_list.append(request_1);\n    transfer_list.append(request_2);\n\n    cheat_caller_address(token_sender_address, sender_account, CheatSpan::TargetCalls(1));\n    token_sender.multisend(erc20_address, transfer_list);\n\n    let balance_after = erc20.balance_of(target_account);\n    assert!(balance_after == transfer_value, \"Balance should be > 0\");\n\n    let balance_after = erc20.balance_of(other_target_account);\n    assert!(balance_after == transfer_value, \"Balance should be > 0\");\n}\n"
  }
]