diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 8c8d028a18..66bba6e674 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -17,6 +17,9 @@ RUN curl -s https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gp RUN echo "deb http://apt.llvm.org/${VARIANT}/ llvm-toolchain-${VARIANT}-17 main" | tee /etc/apt/sources.list.d/llvm.list && apt-get update RUN apt-get -y install -t llvm-toolchain-${VARIANT}-17 llvm-17 llvm-17-dev llvm-17-runtime clang-17 clang-tools-17 lld-17 libpolly-17-dev libmlir-17-dev mlir-17-tools +RUN curl -L https://foundry.paradigm.xyz/ | bash && . /root/.bashrc && foundryup +ENV PATH="${PATH}:/root/.foundry/bin" + # To build Katana with 'native' feature, we need to set the following environment variables ENV MLIR_SYS_170_PREFIX=/usr/lib/llvm-17 ENV LLVM_SYS_170_PREFIX=/usr/lib/llvm-17 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 2bc351e17b..ec5debbc8c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ // https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/rust { "name": "Rust", - "image": "ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.4", + "image": "ghcr.io/dojoengine/dojo-dev:v0.7.2", "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 41dc041da9..a1c2b4ffd7 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -14,7 +14,7 @@ jobs: build: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.4 + image: ghcr.io/dojoengine/dojo-dev:v0.7.2 steps: - uses: actions/checkout@v3 - run: git config --global --add safe.directory "$GITHUB_WORKSPACE" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25b08d52fd..a01131d856 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,16 +11,35 @@ env: RUST_VERSION: 1.76.0 jobs: + build: + runs-on: ubuntu-latest-4-cores + steps: + - uses: actions/checkout@v3 + - uses: Swatinem/rust-cache@v2 + - run: | + cargo build -r --bin katana + mkdir -p bins + cp ./target/release/katana bins/ + - uses: actions/upload-artifact@v4 + with: + name: katana-binary + path: bins + test: - runs-on: ubuntu-latest-16-cores + needs: ensure-docker + runs-on: ubuntu-latest-32-cores container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.4 + image: ghcr.io/dojoengine/dojo-dev:v0.7.2 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 + - uses: actions/download-artifact@v4 + with: + name: katana-binary + path: /tmp/bins - run: | - cargo build -r --bin katana - KATANA_RUNNER_BIN=$(pwd)/target/release/katana cargo llvm-cov nextest --no-report --all-features --workspace --exclude katana --build-jobs 10 + chmod +x /tmp/bins/katana + KATANA_RUNNER_BIN=/tmp/bins/katana cargo llvm-cov nextest --no-report --all-features --workspace --exclude katana --build-jobs 20 cargo llvm-cov nextest --no-report -p katana # TODO(kariy): uncomment this line when `sir` feature support Cairo 2.6.3 # cargo llvm-cov nextest --no-report -p katana --no-default-features --features sir @@ -33,13 +52,14 @@ jobs: ensure-wasm: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.4 + image: ghcr.io/dojoengine/dojo-dev:v0.7.2 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 - run: cargo build -r --target wasm32-unknown-unknown -p torii-client ensure-windows: + needs: ensure-docker runs-on: windows-latest steps: - uses: actions/checkout@v3 @@ -52,6 +72,28 @@ jobs: with: repo-token: ${{ secrets.github_token }} - run: cargo build --target x86_64-pc-windows-msvc --bins + + # This job is used to ensure the built katana image doesn't depend on any + # libraries that don't exist in the base docker image we use for distribution + ensure-docker: + needs: build + runs-on: ubuntu-latest + container: + image: debian:bookworm-slim + steps: + - uses: actions/download-artifact@v4 + with: + name: katana-binary + - run: | + chmod +x ./katana + ./katana & + KATANA_PID=$! + sleep 2 + if ! kill -0 $KATANA_PID; then + echo "Katana exited with an error" + exit 1 + fi + kill $KATANA_PID cairofmt: runs-on: ubuntu-latest @@ -67,7 +109,7 @@ jobs: dojo-core-test: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.4 + image: ghcr.io/dojoengine/dojo-dev:v0.7.2 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -76,7 +118,7 @@ jobs: dojo-spawn-and-move-example-test: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.4 + image: ghcr.io/dojoengine/dojo-dev:v0.7.2 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -85,7 +127,7 @@ jobs: dojo-world-bindings-check: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.4 + image: ghcr.io/dojoengine/dojo-dev:v0.7.2 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -94,7 +136,7 @@ jobs: clippy: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.4 + image: ghcr.io/dojoengine/dojo-dev:v0.7.2 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -103,7 +145,7 @@ jobs: fmt: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.4 + image: ghcr.io/dojoengine/dojo-dev:v0.7.2 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -112,7 +154,7 @@ jobs: docs: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.4 + image: ghcr.io/dojoengine/dojo-dev:v0.7.2 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 diff --git a/.github/workflows/release-dispatch.yml b/.github/workflows/release-dispatch.yml index 7c86630132..f53e873184 100644 --- a/.github/workflows/release-dispatch.yml +++ b/.github/workflows/release-dispatch.yml @@ -14,7 +14,7 @@ jobs: contents: write runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.4 + image: ghcr.io/dojoengine/dojo-dev:v0.7.2 env: VERSION: "" steps: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9e733fc12f..ee55da80f6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,7 +46,7 @@ jobs: platform: linux target: x86_64-unknown-linux-gnu arch: amd64 - - os: ubuntu-latest-8-cores + - os: ubuntu-latest-8-cores-arm64 platform: linux target: aarch64-unknown-linux-gnu arch: arm64 @@ -93,7 +93,6 @@ jobs: run: | sudo apt-get update -y sudo apt-get install -y gcc-aarch64-linux-gnu libssl-dev - echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV # We build jemalloc with 64KB pagesize so that it works for all linux/arm64 pagesize variants # See: https://github.com/jemalloc/jemalloc/issues/467 echo "JEMALLOC_SYS_WITH_LG_PAGE=16" >> $GITHUB_ENV diff --git a/.gitignore b/.gitignore index 6498958892..09a5b8fd5f 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ crates/benches/bench_results.txt **/generated .vscode bindings +justfile diff --git a/Cargo.lock b/Cargo.lock index a4158a0ae4..87fe8db017 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -915,8 +915,8 @@ dependencies = [ "memchr", "pin-project-lite", "tokio", - "zstd", - "zstd-safe", + "zstd 0.13.1", + "zstd-safe 7.1.0", ] [[package]] @@ -1338,7 +1338,7 @@ dependencies = [ [[package]] name = "benches" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "anyhow", "clap", @@ -1538,7 +1538,7 @@ dependencies = [ "cairo-lang-runner 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-vm", + "cairo-vm 0.9.2", "derive_more", "indexmap 2.2.6", "itertools 0.10.5", @@ -1690,6 +1690,27 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + [[package]] name = "c-kzg" version = "1.0.2" @@ -1834,6 +1855,20 @@ dependencies = [ "serde", ] +[[package]] +name = "cairo-lang-casm" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10d9c31baeb6b52586b5adc88f01e90f86389d63d94363c562de5c79352e545b" +dependencies = [ + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "indoc 2.0.5", + "num-bigint", + "num-traits 0.2.19", + "parity-scale-codec", + "serde", +] + [[package]] name = "cairo-lang-casm" version = "2.6.3" @@ -1850,9 +1885,9 @@ dependencies = [ [[package]] name = "cairo-lang-casm" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "indoc 2.0.5", "num-bigint", "num-traits 0.2.19", @@ -1860,6 +1895,29 @@ dependencies = [ "serde", ] +[[package]] +name = "cairo-lang-compiler" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7148cb2d72a3db24a6d2ef2b2602102cc5099cb9f6b913e5047fb009cb3a22a1" +dependencies = [ + "anyhow", + "cairo-lang-defs 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-diagnostics 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-lowering 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-parser 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-project 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-semantic 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra-generator 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "salsa", + "smol_str", + "thiserror", +] + [[package]] name = "cairo-lang-compiler" version = "2.6.3" @@ -1885,26 +1943,35 @@ dependencies = [ [[package]] name = "cairo-lang-compiler" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ "anyhow", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "indoc 2.0.5", "salsa", "smol_str", "thiserror", ] +[[package]] +name = "cairo-lang-debug" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a761eb8e31ea65a2dd45f729c74f1770315f97124dad93d1f6853a10d460c6b" +dependencies = [ + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "cairo-lang-debug" version = "2.6.3" @@ -1916,9 +1983,26 @@ dependencies = [ [[package]] name = "cairo-lang-debug" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", +] + +[[package]] +name = "cairo-lang-defs" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6d60bc5d72fe7a95ba34e041dcbdf1cf3bfccb87008a515514b74913fa8ff05" +dependencies = [ + "cairo-lang-debug 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-diagnostics 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-parser 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.11.0", + "salsa", + "smol_str", ] [[package]] @@ -1940,19 +2024,31 @@ dependencies = [ [[package]] name = "cairo-lang-defs" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" -dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +dependencies = [ + "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "itertools 0.12.1", "salsa", "smol_str", ] +[[package]] +name = "cairo-lang-diagnostics" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "356089e1b0a0ba9e115566191745613b3806a20259ad76764df82ab534d5412a" +dependencies = [ + "cairo-lang-debug 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.11.0", +] + [[package]] name = "cairo-lang-diagnostics" version = "2.6.3" @@ -1967,14 +2063,24 @@ dependencies = [ [[package]] name = "cairo-lang-diagnostics" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "itertools 0.12.1", ] +[[package]] +name = "cairo-lang-eq-solver" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc43246cc2e5afd5a028bcdd63876ac3f8b1f4fb3ff785daaa0f0fbb51c9d906" +dependencies = [ + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "good_lp", +] + [[package]] name = "cairo-lang-eq-solver" version = "2.6.3" @@ -1987,12 +2093,26 @@ dependencies = [ [[package]] name = "cairo-lang-eq-solver" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "good_lp", ] +[[package]] +name = "cairo-lang-filesystem" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bcb9a4a40e53fa099774bd08bbcc3430f51213cc7fb1b50c2e9d01155731798" +dependencies = [ + "cairo-lang-debug 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "path-clean", + "salsa", + "serde", + "smol_str", +] + [[package]] name = "cairo-lang-filesystem" version = "2.6.3" @@ -2009,10 +2129,10 @@ dependencies = [ [[package]] name = "cairo-lang-filesystem" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "path-clean", "salsa", "serde", @@ -2022,14 +2142,14 @@ dependencies = [ [[package]] name = "cairo-lang-formatter" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ "anyhow", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "diffy", "ignore", "itertools 0.12.1", @@ -2042,22 +2162,22 @@ dependencies = [ [[package]] name = "cairo-lang-language-server" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ "anyhow", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-formatter", - "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-test-plugin", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "salsa", "scarb-metadata 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde", @@ -2069,6 +2189,31 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "cairo-lang-lowering" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ba60e1e2477aa0f610ccf29189097d580464607c94b51741e1c18e64d6cee5f" +dependencies = [ + "cairo-lang-debug 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-defs 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-diagnostics 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-parser 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-proc-macros 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-semantic 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "id-arena", + "itertools 0.11.0", + "log", + "num-bigint", + "num-traits 0.2.19", + "once_cell", + "salsa", + "smol_str", +] + [[package]] name = "cairo-lang-lowering" version = "2.6.3" @@ -2096,17 +2241,17 @@ dependencies = [ [[package]] name = "cairo-lang-lowering" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" -dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-proc-macros 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +dependencies = [ + "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-proc-macros 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "id-arena", "itertools 0.12.1", "log", @@ -2120,7 +2265,7 @@ dependencies = [ [[package]] name = "cairo-lang-macro" version = "0.0.1" -source = "git+https://github.com/software-mansion/scarb?rev=e813dbab8f0ec606b5846827ad65951ef8bd6b92#e813dbab8f0ec606b5846827ad65951ef8bd6b92" +source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" dependencies = [ "cairo-lang-macro-attributes", "cairo-lang-macro-stable", @@ -2130,7 +2275,7 @@ dependencies = [ [[package]] name = "cairo-lang-macro-attributes" version = "0.0.1" -source = "git+https://github.com/software-mansion/scarb?rev=e813dbab8f0ec606b5846827ad65951ef8bd6b92#e813dbab8f0ec606b5846827ad65951ef8bd6b92" +source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" dependencies = [ "quote", "scarb-stable-hash", @@ -2140,7 +2285,27 @@ dependencies = [ [[package]] name = "cairo-lang-macro-stable" version = "1.0.0" -source = "git+https://github.com/software-mansion/scarb?rev=e813dbab8f0ec606b5846827ad65951ef8bd6b92#e813dbab8f0ec606b5846827ad65951ef8bd6b92" +source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" + +[[package]] +name = "cairo-lang-parser" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f16ba1535e0cc5e79c2eff6592859bbdac03dc53d4dcdd26dbdbc04a77c3f5c" +dependencies = [ + "cairo-lang-diagnostics 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax-codegen 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "colored", + "itertools 0.11.0", + "num-bigint", + "num-traits 0.2.19", + "salsa", + "smol_str", + "unescaper", +] [[package]] name = "cairo-lang-parser" @@ -2164,13 +2329,13 @@ dependencies = [ [[package]] name = "cairo-lang-parser" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax-codegen 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax-codegen 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "colored", "itertools 0.12.1", "num-bigint", @@ -2180,6 +2345,25 @@ dependencies = [ "unescaper", ] +[[package]] +name = "cairo-lang-plugins" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81c8cf6e0ee3d6b19429cc1663738b22f1ecea7d51bf7452e8e1086f08798baf" +dependencies = [ + "cairo-lang-defs 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-diagnostics 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-parser 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "indent", + "indoc 2.0.5", + "itertools 0.11.0", + "salsa", + "smol_str", +] + [[package]] name = "cairo-lang-plugins" version = "2.6.3" @@ -2201,14 +2385,14 @@ dependencies = [ [[package]] name = "cairo-lang-plugins" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" -dependencies = [ - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +dependencies = [ + "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "indent", "indoc 2.0.5", "itertools 0.12.1", @@ -2216,6 +2400,17 @@ dependencies = [ "smol_str", ] +[[package]] +name = "cairo-lang-proc-macros" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67f9da66325ce7ed6c002360f26106fe79deb9f8a2fca30abdbb8d388da7bb46" +dependencies = [ + "cairo-lang-debug 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "quote", + "syn 2.0.64", +] + [[package]] name = "cairo-lang-proc-macros" version = "2.6.3" @@ -2229,13 +2424,27 @@ dependencies = [ [[package]] name = "cairo-lang-proc-macros" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "quote", "syn 2.0.64", ] +[[package]] +name = "cairo-lang-project" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e198af1ab3d05c7fb8b6a9a7a2e9bce245a6c855df5f770b751d29874a23b152" +dependencies = [ + "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", + "smol_str", + "thiserror", + "toml 0.8.13", +] + [[package]] name = "cairo-lang-project" version = "2.6.3" @@ -2252,10 +2461,10 @@ dependencies = [ [[package]] name = "cairo-lang-project" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "serde", "smol_str", "thiserror", @@ -2281,7 +2490,7 @@ dependencies = [ "cairo-lang-sierra-type-size 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-vm", + "cairo-vm 0.9.2", "itertools 0.11.0", "keccak", "num-bigint", @@ -2295,22 +2504,21 @@ dependencies = [ [[package]] name = "cairo-lang-runner" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ "ark-ff 0.4.2", "ark-secp256k1", "ark-secp256r1", - "cairo-felt", - "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-ap-change 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-type-size 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-vm", + "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-ap-change 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-type-size 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-vm 1.0.0-rc3", "itertools 0.12.1", "keccak", "num-bigint", @@ -2320,9 +2528,35 @@ dependencies = [ "sha2 0.10.8", "smol_str", "starknet-crypto 0.6.2", + "starknet-types-core 0.1.2", "thiserror", ] +[[package]] +name = "cairo-lang-semantic" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d7df81521c2125e3e95b683cc99374db1aebd7ddb317c5ca3dd92a235a9eb13" +dependencies = [ + "cairo-lang-debug 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-defs 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-diagnostics 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-parser 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-plugins 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-proc-macros 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "id-arena", + "indoc 2.0.5", + "itertools 0.11.0", + "num-bigint", + "num-traits 0.2.19", + "once_cell", + "salsa", + "smol_str", +] + [[package]] name = "cairo-lang-semantic" version = "2.6.3" @@ -2350,18 +2584,18 @@ dependencies = [ [[package]] name = "cairo-lang-semantic" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" -dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-proc-macros 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +dependencies = [ + "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-proc-macros 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-test-utils", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "id-arena", "indoc 2.0.5", "itertools 0.12.1", @@ -2373,6 +2607,32 @@ dependencies = [ "toml 0.8.13", ] +[[package]] +name = "cairo-lang-sierra" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07da3ca1434c62a7cc7cd77d2941ef47a1c23b37325781b59407b78d8c61d863" +dependencies = [ + "anyhow", + "cairo-felt", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "const-fnv1a-hash", + "convert_case 0.6.0", + "derivative", + "itertools 0.11.0", + "lalrpop", + "lalrpop-util", + "num-bigint", + "num-traits 0.2.19", + "regex", + "salsa", + "serde", + "serde_json", + "sha3", + "smol_str", + "thiserror", +] + [[package]] name = "cairo-lang-sierra" version = "2.6.3" @@ -2401,11 +2661,10 @@ dependencies = [ [[package]] name = "cairo-lang-sierra" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ "anyhow", - "cairo-felt", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "const-fnv1a-hash", "convert_case 0.6.0", "derivative", @@ -2420,6 +2679,22 @@ dependencies = [ "serde_json", "sha3", "smol_str", + "starknet-types-core 0.1.2", + "thiserror", +] + +[[package]] +name = "cairo-lang-sierra-ap-change" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "122c9055eb609a511178e3dce577de061819fd4c4c6b7452804557f76ca43bbf" +dependencies = [ + "cairo-lang-eq-solver 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra-type-size 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.11.0", + "num-traits 0.2.19", "thiserror", ] @@ -2440,18 +2715,33 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-ap-change" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-lang-eq-solver 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-type-size 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-eq-solver 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-type-size 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "itertools 0.12.1", "num-bigint", "num-traits 0.2.19", "thiserror", ] +[[package]] +name = "cairo-lang-sierra-gas" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf049d9aea65c6e38da219a3700c72f78795d11449d9adcec28047ef8d63bd23" +dependencies = [ + "cairo-lang-eq-solver 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra-type-size 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.11.0", + "num-traits 0.2.19", + "thiserror", +] + [[package]] name = "cairo-lang-sierra-gas" version = "2.6.3" @@ -2469,18 +2759,41 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-gas" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-lang-eq-solver 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-type-size 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-eq-solver 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-type-size 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "itertools 0.12.1", "num-bigint", "num-traits 0.2.19", "thiserror", ] +[[package]] +name = "cairo-lang-sierra-generator" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e1d75e0830279ca1bd0189e3326720d6e081225f7d81ed060bbd22c6b37e980" +dependencies = [ + "cairo-lang-debug 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-defs 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-diagnostics 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-lowering 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-parser 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-semantic 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.11.0", + "num-traits 0.2.19", + "once_cell", + "salsa", + "smol_str", +] + [[package]] name = "cairo-lang-sierra-generator" version = "2.6.3" @@ -2506,18 +2819,18 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-generator" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" -dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +dependencies = [ + "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "itertools 0.12.1", "num-traits 0.2.19", "once_cell", @@ -2527,6 +2840,27 @@ dependencies = [ "smol_str", ] +[[package]] +name = "cairo-lang-sierra-to-casm" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a3c3be88c8562fbf93b0803c186e7282f6daad93576c07f61b04a591fde468f" +dependencies = [ + "assert_matches", + "cairo-felt", + "cairo-lang-casm 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra-ap-change 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra-gas 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra-type-size 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "indoc 2.0.5", + "itertools 0.11.0", + "num-bigint", + "num-traits 0.2.19", + "thiserror", +] + [[package]] name = "cairo-lang-sierra-to-casm" version = "2.6.3" @@ -2550,23 +2884,33 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-to-casm" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ "assert_matches", - "cairo-felt", - "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-ap-change 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-gas 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-type-size 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-ap-change 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-gas 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-type-size 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "indoc 2.0.5", "itertools 0.12.1", "num-bigint", "num-traits 0.2.19", + "starknet-types-core 0.1.2", "thiserror", ] +[[package]] +name = "cairo-lang-sierra-type-size" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a38da6f98c6b16945c89d2ae351c82d636ed38d3e6eb02f7c8679e3e03a63988" +dependencies = [ + "cairo-lang-sierra 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "cairo-lang-sierra-type-size" version = "2.6.3" @@ -2579,10 +2923,41 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-type-size" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", +] + +[[package]] +name = "cairo-lang-starknet" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9ffa8b3b8c47138c36b1907cebb5047dfc4de29ec10ece5bd6d6853243ec50" +dependencies = [ + "anyhow", + "cairo-felt", + "cairo-lang-compiler 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-defs 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-diagnostics 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-lowering 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-plugins 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-semantic 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra-generator 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-starknet-classes 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "const_format", + "indent", + "indoc 2.0.5", + "itertools 0.11.0", + "once_cell", + "serde", + "serde_json", + "smol_str", + "thiserror", ] [[package]] @@ -2618,22 +2993,21 @@ dependencies = [ [[package]] name = "cairo-lang-starknet" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ "anyhow", - "cairo-felt", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "const_format", "indent", "indoc 2.0.5", @@ -2642,6 +3016,32 @@ dependencies = [ "serde", "serde_json", "smol_str", + "starknet-types-core 0.1.2", + "thiserror", +] + +[[package]] +name = "cairo-lang-starknet-classes" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47c64ae2bb00173e3a88760128bf72de356fa80eb19fa47602479063648b4003" +dependencies = [ + "cairo-felt", + "cairo-lang-casm 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra-to-casm 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "convert_case 0.6.0", + "itertools 0.11.0", + "num-bigint", + "num-integer", + "num-traits 0.2.19", + "once_cell", + "serde", + "serde_json", + "sha3", + "smol_str", + "starknet-crypto 0.6.2", "thiserror", ] @@ -2672,13 +3072,12 @@ dependencies = [ [[package]] name = "cairo-lang-starknet-classes" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-felt", - "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "convert_case 0.6.0", "itertools 0.12.1", "num-bigint", @@ -2690,9 +3089,26 @@ dependencies = [ "sha3", "smol_str", "starknet-crypto 0.6.2", + "starknet-types-core 0.1.2", "thiserror", ] +[[package]] +name = "cairo-lang-syntax" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8262c426a57e1e5ec297db24278464841500613445e2cb1c43d5f71ad91ee8d6" +dependencies = [ + "cairo-lang-debug 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "num-bigint", + "num-traits 0.2.19", + "salsa", + "smol_str", + "unescaper", +] + [[package]] name = "cairo-lang-syntax" version = "2.6.3" @@ -2711,11 +3127,11 @@ dependencies = [ [[package]] name = "cairo-lang-syntax" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "num-bigint", "num-traits 0.2.19", "salsa", @@ -2723,6 +3139,16 @@ dependencies = [ "unescaper", ] +[[package]] +name = "cairo-lang-syntax-codegen" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e2d692eae4bb4179a4a1148fd5eb738a91653d86750c813658ffad4a99fa97" +dependencies = [ + "genco", + "xshell", +] + [[package]] name = "cairo-lang-syntax-codegen" version = "2.6.3" @@ -2735,7 +3161,7 @@ dependencies = [ [[package]] name = "cairo-lang-syntax-codegen" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ "genco", "xshell", @@ -2744,64 +3170,79 @@ dependencies = [ [[package]] name = "cairo-lang-test-plugin" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ "anyhow", - "cairo-felt", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "indoc 2.0.5", "itertools 0.12.1", "num-bigint", "num-traits 0.2.19", "serde", + "starknet-types-core 0.1.2", ] [[package]] name = "cairo-lang-test-runner" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ "anyhow", - "cairo-felt", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-runner 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-runner 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-test-plugin", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "colored", "itertools 0.12.1", "num-traits 0.2.19", "rayon", + "starknet-types-core 0.1.2", ] [[package]] name = "cairo-lang-test-utils" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ "cairo-lang-formatter", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "colored", "log", "pretty_assertions", ] +[[package]] +name = "cairo-lang-utils" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf733a7cdc4166d0baf0ed8a98d9ada827daee6653b37d9326e334e53481c6d3" +dependencies = [ + "hashbrown 0.14.5", + "indexmap 2.2.6", + "itertools 0.11.0", + "num-bigint", + "num-traits 0.2.19", + "schemars", + "serde", +] + [[package]] name = "cairo-lang-utils" version = "2.6.3" @@ -2820,7 +3261,7 @@ dependencies = [ [[package]] name = "cairo-lang-utils" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ "env_logger 0.11.3", "hashbrown 0.14.5", @@ -2848,25 +3289,54 @@ dependencies = [ "serde_json", "starknet", "starknet-crypto 0.6.2", - "tokio", - "url", + "tokio", + "url", +] + +[[package]] +name = "cairo-vm" +version = "0.9.2" +source = "git+https://github.com/dojoengine/cairo-rs.git?rev=1031381#10313816b4ba7891e3c8ba90f6d0068a9149d682" +dependencies = [ + "anyhow", + "bincode 2.0.0-rc.3", + "bitvec", + "cairo-felt", + "generic-array", + "hashbrown 0.14.5", + "hex", + "keccak", + "lazy_static", + "mimalloc", + "nom", + "num-bigint", + "num-integer", + "num-prime", + "num-traits 0.2.19", + "rand", + "serde", + "serde_json", + "sha2 0.10.8", + "sha3", + "starknet-crypto 0.6.2", + "starknet-curve 0.4.2", + "thiserror-no-std", ] [[package]] name = "cairo-vm" -version = "0.9.2" -source = "git+https://github.com/dojoengine/cairo-rs.git?rev=1031381#10313816b4ba7891e3c8ba90f6d0068a9149d682" +version = "1.0.0-rc3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0fa4c74b86c0f17b58ced4fdab5c1da0a41fb12725ad7601e12bb27d8d90435" dependencies = [ "anyhow", "bincode 2.0.0-rc.3", "bitvec", - "cairo-felt", "generic-array", "hashbrown 0.14.5", "hex", "keccak", "lazy_static", - "mimalloc", "nom", "num-bigint", "num-integer", @@ -2878,8 +3348,9 @@ dependencies = [ "sha2 0.10.8", "sha3", "starknet-crypto 0.6.2", - "starknet-curve 0.4.2", + "starknet-types-core 0.1.2", "thiserror-no-std", + "zip", ] [[package]] @@ -3293,7 +3764,19 @@ dependencies = [ [[package]] name = "common" -version = "0.7.0-alpha.4" +version = "0.1.0" +source = "git+https://github.com/cartridge-gg/http-prover?rev=7d00b05#7d00b05fec6bdf533d4110656c635a086d5872b7" +dependencies = [ + "ed25519-dalek", + "prefix-hex", + "serde", + "serde_json", + "serde_with 3.8.1", +] + +[[package]] +name = "common" +version = "0.7.2" dependencies = [ "anyhow", "reqwest 0.12.4", @@ -3393,6 +3876,12 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + [[package]] name = "convert_case" version = "0.4.0" @@ -3408,6 +3897,34 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "cookie" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7efb37c3e1ccb1ff97164ad95ac1606e8ccd35b3fa0a7d99a304c7f4a428cc24" +dependencies = [ + "percent-encoding", + "time", + "version_check", +] + +[[package]] +name = "cookie_store" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "387461abbc748185c3a6e1673d826918b450b87ff22639429c694619a83b6cf6" +dependencies = [ + "cookie", + "idna 0.3.0", + "log", + "publicsuffix", + "serde", + "serde_derive", + "serde_json", + "time", + "url", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -3478,7 +3995,7 @@ dependencies = [ [[package]] name = "create-output-dir" version = "1.0.0" -source = "git+https://github.com/software-mansion/scarb?rev=e813dbab8f0ec606b5846827ad65951ef8bd6b92#e813dbab8f0ec606b5846827ad65951ef8bd6b92" +source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" dependencies = [ "anyhow", "core-foundation", @@ -4060,14 +4577,16 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "dojo-bindgen" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "async-trait", "cainome", "camino", "chrono", "convert_case 0.6.0", + "dojo-test-utils", "dojo-world", + "scarb", "serde", "serde_json", "starknet", @@ -4076,35 +4595,35 @@ dependencies = [ [[package]] name = "dojo-core" -version = "0.7.0-alpha.4" +version = "0.7.2" [[package]] name = "dojo-examples-spawn-and-move" -version = "0.7.0-alpha.4" +version = "0.7.2" [[package]] name = "dojo-lang" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "anyhow", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-formatter", - "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-test-plugin", "cairo-lang-test-utils", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "camino", "convert_case 0.6.0", "directories", @@ -4123,7 +4642,7 @@ dependencies = [ "semver 1.0.23", "serde", "serde_json", - "serde_with", + "serde_with 2.3.3", "smol_str", "starknet", "test-log", @@ -4135,29 +4654,16 @@ dependencies = [ [[package]] name = "dojo-language-server" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ - "anyhow", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", "cairo-lang-language-server", - "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-test-plugin", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", "clap", "dojo-lang", - "log", - "salsa", - "smol_str", - "tokio", - "tower-lsp", ] [[package]] name = "dojo-metrics" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "anyhow", "hyper 0.14.28", @@ -4175,15 +4681,15 @@ dependencies = [ [[package]] name = "dojo-test-utils" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "anyhow", "assert_fs", "async-trait", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "camino", "dojo-lang", "dojo-world", @@ -4197,7 +4703,7 @@ dependencies = [ "scarb-ui", "serde", "serde_json", - "serde_with", + "serde_with 2.3.3", "smol_str", "starknet", "thiserror", @@ -4209,7 +4715,7 @@ dependencies = [ [[package]] name = "dojo-types" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "cainome", "crypto-bigint", @@ -4225,17 +4731,17 @@ dependencies = [ [[package]] name = "dojo-world" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "anyhow", "assert_fs", "assert_matches", "async-trait", "cainome", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "camino", "convert_case 0.6.0", "dojo-lang", @@ -4248,7 +4754,7 @@ dependencies = [ "scarb", "serde", "serde_json", - "serde_with", + "serde_with 2.3.3", "similar-asserts", "smol_str", "starknet", @@ -4257,16 +4763,17 @@ dependencies = [ "thiserror", "tokio", "toml 0.8.13", + "topological-sort", "tracing", "url", ] [[package]] name = "dojo-world-abigen" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "camino", "scarb", "scarb-ui", @@ -4319,6 +4826,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ "pkcs8", + "serde", "signature", ] @@ -6502,6 +7010,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "idna" version = "0.4.0" @@ -7305,7 +7823,7 @@ dependencies = [ [[package]] name = "katana" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "alloy-primitives", "anyhow", @@ -7313,7 +7831,7 @@ dependencies = [ "cfg-if", "clap", "clap_complete", - "common", + "common 0.7.2", "console", "dojo-metrics", "katana-core", @@ -7332,7 +7850,7 @@ dependencies = [ [[package]] name = "katana-cairo" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", "cairo-lang-runner 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", @@ -7340,12 +7858,12 @@ dependencies = [ "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-vm", + "cairo-vm 0.9.2", ] [[package]] name = "katana-codecs" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "bytes", "katana-primitives", @@ -7353,7 +7871,7 @@ dependencies = [ [[package]] name = "katana-codecs-derive" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "proc-macro2", "quote", @@ -7363,7 +7881,7 @@ dependencies = [ [[package]] name = "katana-core" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "alloy-contract", "alloy-network", @@ -7377,9 +7895,9 @@ dependencies = [ "anyhow", "assert_matches", "async-trait", - "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-vm", + "cairo-lang-casm 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-starknet 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-vm 0.9.2", "convert_case 0.6.0", "derive_more", "dojo-metrics", @@ -7399,7 +7917,7 @@ dependencies = [ "reqwest 0.12.4", "serde", "serde_json", - "serde_with", + "serde_with 2.3.3", "starknet", "starknet_api", "tempfile", @@ -7411,11 +7929,11 @@ dependencies = [ [[package]] name = "katana-db" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "anyhow", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-vm", + "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-vm 0.9.2", "criterion", "katana-primitives", "page_size", @@ -7433,7 +7951,7 @@ dependencies = [ [[package]] name = "katana-executor" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "alloy-primitives", "anyhow", @@ -7460,7 +7978,7 @@ dependencies = [ [[package]] name = "katana-primitives" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "alloy-primitives", "anyhow", @@ -7473,7 +7991,7 @@ dependencies = [ "rayon", "serde", "serde_json", - "serde_with", + "serde_with 2.3.3", "similar-asserts", "starknet", "starknet-crypto 0.6.2", @@ -7485,7 +8003,7 @@ dependencies = [ [[package]] name = "katana-provider" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "alloy-primitives", "anyhow", @@ -7511,12 +8029,12 @@ dependencies = [ [[package]] name = "katana-rpc" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "anyhow", "assert_matches", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "dojo-metrics", "dojo-test-utils", "dojo-world", @@ -7536,7 +8054,7 @@ dependencies = [ "metrics", "serde", "serde_json", - "serde_with", + "serde_with 2.3.3", "starknet", "starknet_api", "thiserror", @@ -7549,7 +8067,7 @@ dependencies = [ [[package]] name = "katana-rpc-api" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "jsonrpsee 0.16.3", "katana-core", @@ -7560,7 +8078,7 @@ dependencies = [ [[package]] name = "katana-rpc-types" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "alloy-primitives", "anyhow", @@ -7574,14 +8092,14 @@ dependencies = [ "rstest 0.18.2", "serde", "serde_json", - "serde_with", + "serde_with 2.3.3", "starknet", "thiserror", ] [[package]] name = "katana-rpc-types-builder" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "anyhow", "katana-executor", @@ -7593,7 +8111,7 @@ dependencies = [ [[package]] name = "katana-runner" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "anyhow", "assert_fs", @@ -7612,7 +8130,7 @@ dependencies = [ [[package]] name = "katana-tasks" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "futures", "rayon", @@ -7708,12 +8226,34 @@ dependencies = [ "regex-automata 0.4.6", ] +[[package]] +name = "lambdaworks-crypto" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fb5d4f22241504f7c7b8d2c3a7d7835d7c07117f10bff2a7d96a9ef6ef217c3" +dependencies = [ + "lambdaworks-math 0.7.0", + "serde", + "sha2 0.10.8", + "sha3", +] + [[package]] name = "lambdaworks-math" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ee7dcab3968c71896b8ee4dc829147acc918cffe897af6265b1894527fe3add" +[[package]] +name = "lambdaworks-math" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "358e172628e713b80a530a59654154bfc45783a6ed70ea284839800cebdf8f97" +dependencies = [ + "serde", + "serde_json", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -9426,6 +9966,17 @@ dependencies = [ "windows-targets 0.52.5", ] +[[package]] +name = "password-hash" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" +dependencies = [ + "base64ct", + "rand_core", + "subtle", +] + [[package]] name = "paste" version = "1.0.15" @@ -9463,6 +10014,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ "digest 0.10.7", + "hmac", + "password-hash", + "sha2 0.10.8", ] [[package]] @@ -9850,6 +10404,15 @@ dependencies = [ "termtree", ] +[[package]] +name = "prefix-hex" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f1799f398371ad6957951ec446d3ff322d35c46d9db2e217b67e828b311c249" +dependencies = [ + "hex", +] + [[package]] name = "pretty_assertions" version = "1.4.0" @@ -10151,6 +10714,45 @@ dependencies = [ "prost 0.12.4", ] +[[package]] +name = "prover-sdk" +version = "0.1.0" +source = "git+https://github.com/cartridge-gg/http-prover?rev=7d00b05#7d00b05fec6bdf533d4110656c635a086d5872b7" +dependencies = [ + "bytes", + "common 0.1.0", + "ed25519-dalek", + "http 1.1.0", + "hyper-util", + "prefix-hex", + "rand", + "reqwest 0.12.4", + "reqwest_cookie_store", + "serde", + "serde_json", + "serde_with 3.8.1", + "thiserror", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "psl-types" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33cb294fe86a74cbcf50d4445b37da762029549ebeea341421c7c70370f86cac" + +[[package]] +name = "publicsuffix" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96a8c1bda5ae1af7f99a2962e49df150414a43d62404644d98dd5c3a93d07457" +dependencies = [ + "idna 0.3.0", + "psl-types", +] + [[package]] name = "quanta" version = "0.11.1" @@ -10535,6 +11137,8 @@ checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" dependencies = [ "base64 0.22.1", "bytes", + "cookie", + "cookie_store", "futures-channel", "futures-core", "futures-util", @@ -10569,6 +11173,18 @@ dependencies = [ "winreg 0.52.0", ] +[[package]] +name = "reqwest_cookie_store" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93ea5c6f30c19d766efe8d823c88f9abd1c56516648a0d4264ab2dc04cc19472" +dependencies = [ + "bytes", + "cookie_store", + "reqwest 0.12.4", + "url", +] + [[package]] name = "resolv-conf" version = "0.7.0" @@ -10887,7 +11503,7 @@ checksum = "f86854cf50259291520509879a5c294c3c9a4c334e9ff65071c51e42ef1e2343" [[package]] name = "runner-macro" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "quote", "syn 2.0.64", @@ -11155,9 +11771,10 @@ dependencies = [ [[package]] name = "saya" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "anyhow", + "cairo-proof-parser", "clap", "clap_complete", "console", @@ -11166,6 +11783,7 @@ dependencies = [ "katana-rpc-api", "saya-core", "serde_json", + "starknet-crypto 0.6.2", "tokio", "tracing", "tracing-subscriber", @@ -11174,13 +11792,13 @@ dependencies = [ [[package]] name = "saya-core" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "anyhow", "async-trait", "cairo-felt", "cairo-proof-parser", - "cairo-vm", + "cairo-vm 0.9.2", "celestia-rpc", "celestia-types", "convert_case 0.6.0", @@ -11195,16 +11813,18 @@ dependencies = [ "katana-rpc-types", "lazy_static", "num-bigint", + "num-traits 0.2.19", "parking_lot 0.12.2", + "prover-sdk", "rand", "reqwest 0.12.4", "saya-provider", "serde", "serde_json", - "serde_with", + "serde_with 2.3.3", "starknet", "starknet-crypto 0.6.2", - "starknet-types-core", + "starknet-types-core 0.0.9", "starknet_api", "thiserror", "tokio", @@ -11214,7 +11834,7 @@ dependencies = [ [[package]] name = "saya-provider" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "alloy-primitives", "anyhow", @@ -11233,7 +11853,7 @@ dependencies = [ "lazy_static", "serde", "serde_json", - "serde_with", + "serde_with 2.3.3", "starknet", "starknet_api", "thiserror", @@ -11245,25 +11865,25 @@ dependencies = [ [[package]] name = "scarb" version = "2.6.3" -source = "git+https://github.com/software-mansion/scarb?rev=e813dbab8f0ec606b5846827ad65951ef8bd6b92#e813dbab8f0ec606b5846827ad65951ef8bd6b92" +source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" dependencies = [ "anyhow", "async-trait", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-formatter", "cairo-lang-macro", "cairo-lang-macro-stable", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-test-plugin", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "camino", "clap", "create-output-dir", @@ -11288,7 +11908,7 @@ dependencies = [ "redb", "reqwest 0.11.27", "scarb-build-metadata", - "scarb-metadata 1.12.0 (git+https://github.com/software-mansion/scarb?rev=e813dbab8f0ec606b5846827ad65951ef8bd6b92)", + "scarb-metadata 1.12.0 (git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43)", "scarb-stable-hash", "scarb-ui", "semver 1.0.23", @@ -11313,13 +11933,13 @@ dependencies = [ "which 5.0.0", "windows-sys 0.52.0", "zip", - "zstd", + "zstd 0.13.1", ] [[package]] name = "scarb-build-metadata" version = "2.6.3" -source = "git+https://github.com/software-mansion/scarb?rev=e813dbab8f0ec606b5846827ad65951ef8bd6b92#e813dbab8f0ec606b5846827ad65951ef8bd6b92" +source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" dependencies = [ "cargo_metadata", ] @@ -11340,7 +11960,7 @@ dependencies = [ [[package]] name = "scarb-metadata" version = "1.12.0" -source = "git+https://github.com/software-mansion/scarb?rev=e813dbab8f0ec606b5846827ad65951ef8bd6b92#e813dbab8f0ec606b5846827ad65951ef8bd6b92" +source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" dependencies = [ "camino", "derive_builder", @@ -11353,7 +11973,7 @@ dependencies = [ [[package]] name = "scarb-stable-hash" version = "1.0.0" -source = "git+https://github.com/software-mansion/scarb?rev=e813dbab8f0ec606b5846827ad65951ef8bd6b92#e813dbab8f0ec606b5846827ad65951ef8bd6b92" +source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" dependencies = [ "data-encoding", "xxhash-rust", @@ -11362,14 +11982,14 @@ dependencies = [ [[package]] name = "scarb-ui" version = "0.1.5" -source = "git+https://github.com/software-mansion/scarb?rev=e813dbab8f0ec606b5846827ad65951ef8bd6b92#e813dbab8f0ec606b5846827ad65951ef8bd6b92" +source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" dependencies = [ "anyhow", "camino", "clap", "console", "indicatif", - "scarb-metadata 1.12.0 (git+https://github.com/software-mansion/scarb?rev=e813dbab8f0ec606b5846827ad65951ef8bd6b92)", + "scarb-metadata 1.12.0 (git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43)", "serde", "serde_json", "tracing-core", @@ -11384,6 +12004,20 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "scheduler" +version = "0.7.2" +dependencies = [ + "clap", + "clap_complete", + "katana-primitives", + "saya-core", + "serde", + "serde_json", + "tokio", + "url", +] + [[package]] name = "schemars" version = "0.8.19" @@ -11661,7 +12295,25 @@ dependencies = [ "indexmap 1.9.3", "serde", "serde_json", - "serde_with_macros", + "serde_with_macros 2.3.3", + "time", +] + +[[package]] +name = "serde_with" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" +dependencies = [ + "base64 0.22.1", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.2.6", + "serde", + "serde_derive", + "serde_json", + "serde_with_macros 3.8.1", "time", ] @@ -11677,6 +12329,18 @@ dependencies = [ "syn 2.0.64", ] +[[package]] +name = "serde_with_macros" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" +dependencies = [ + "darling 0.20.9", + "proc-macro2", + "quote", + "syn 2.0.64", +] + [[package]] name = "serdect" version = "0.2.0" @@ -11978,24 +12642,24 @@ dependencies = [ [[package]] name = "sozo" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "anyhow", "assert_fs", "async-trait", "bigdecimal 0.4.3", "cainome", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-test-plugin", "cairo-lang-test-runner", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "camino", "clap", "clap-verbosity-flag", @@ -12037,23 +12701,24 @@ dependencies = [ [[package]] name = "sozo-ops" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "anyhow", "assert_fs", "async-trait", "cainome", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-test-plugin", "cairo-lang-test-runner", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "camino", "clap", "clap-verbosity-flag", @@ -12077,13 +12742,14 @@ dependencies = [ "semver 1.0.23", "serde", "serde_json", - "serde_with", + "serde_with 2.3.3", "smol_str", "snapbox", "starknet", "starknet-crypto 0.6.2", "thiserror", "tokio", + "toml 0.8.13", "tracing", "tracing-log 0.1.4", "url", @@ -12091,7 +12757,7 @@ dependencies = [ [[package]] name = "sozo-signers" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "anyhow", "starknet", @@ -12394,7 +13060,7 @@ checksum = "cb3b73d437b4d62241612d13fce612602de6684c149cccf696e76a20757e2156" dependencies = [ "serde", "serde_json", - "serde_with", + "serde_with 2.3.3", "starknet-accounts", "starknet-core", "starknet-providers", @@ -12413,7 +13079,7 @@ dependencies = [ "serde", "serde_json", "serde_json_pythonic", - "serde_with", + "serde_with 2.3.3", "sha3", "starknet-crypto 0.6.2", "starknet-ff", @@ -12527,7 +13193,7 @@ dependencies = [ "reqwest 0.11.27", "serde", "serde_json", - "serde_with", + "serde_with 2.3.3", "starknet-core", "thiserror", "url", @@ -12556,7 +13222,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d53160556d1f23425100f42b3230df747ea05763efee685a2cd939dfb640701" dependencies = [ "bitvec", - "lambdaworks-math", + "lambdaworks-math 0.5.0", + "lazy_static", + "num-bigint", + "num-integer", + "num-traits 0.2.19", + "serde", +] + +[[package]] +name = "starknet-types-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4098ac4ad57621cc7ec133b80fe72814d2cc4bee63ca8e7be4450ba6f42a07e8" +dependencies = [ + "lambdaworks-crypto", + "lambdaworks-math 0.7.0", "lazy_static", "num-bigint", "num-integer", @@ -12570,7 +13251,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "365ec5c0662466f299762bd012012da30e9a28319000cfade372b8787111f202" dependencies = [ - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-starknet-classes 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "derive_more", "hex", "indexmap 2.2.6", @@ -13339,9 +14020,15 @@ dependencies = [ "web-sys", ] +[[package]] +name = "topological-sort" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea68304e134ecd095ac6c3574494fc62b909f416c4fca77e440530221e549d3d" + [[package]] name = "torii" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "anyhow", "async-trait", @@ -13349,7 +14036,7 @@ dependencies = [ "camino", "chrono", "clap", - "common", + "common 0.7.2", "ctrlc", "dojo-metrics", "dojo-types", @@ -13386,7 +14073,7 @@ dependencies = [ [[package]] name = "torii-client" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "async-trait", "camino", @@ -13414,7 +14101,7 @@ dependencies = [ [[package]] name = "torii-core" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "anyhow", "async-trait", @@ -13429,6 +14116,7 @@ dependencies = [ "futures-channel", "futures-util", "hex", + "katana-runner", "lazy_static", "log", "once_cell", @@ -13452,7 +14140,7 @@ dependencies = [ [[package]] name = "torii-graphql" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "anyhow", "async-graphql", @@ -13493,9 +14181,10 @@ dependencies = [ [[package]] name = "torii-grpc" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "bytes", + "camino", "crypto-bigint", "dojo-test-utils", "dojo-types", @@ -13536,10 +14225,11 @@ dependencies = [ [[package]] name = "torii-relay" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "anyhow", "async-trait", + "cainome", "chrono", "crypto-bigint", "dojo-test-utils", @@ -13571,7 +14261,7 @@ dependencies = [ [[package]] name = "torii-server" -version = "0.7.0-alpha.4" +version = "0.7.2" dependencies = [ "anyhow", "async-trait", @@ -13894,7 +14584,7 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "types-test" -version = "0.7.0-alpha.4" +version = "0.7.2" [[package]] name = "ucd-trie" @@ -15142,10 +15832,27 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" dependencies = [ + "aes", "byteorder", + "bzip2", + "constant_time_eq", "crc32fast", "crossbeam-utils", "flate2", + "hmac", + "pbkdf2", + "sha1", + "time", + "zstd 0.11.2+zstd.1.5.2", +] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe 5.0.2+zstd.1.5.2", ] [[package]] @@ -15154,7 +15861,17 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d789b1514203a1120ad2429eae43a7bd32b90976a7bb8a05f7ec02fa88cc23a" dependencies = [ - "zstd-safe", + "zstd-safe 7.1.0", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 8c2d72ad0a..6bf2173cee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,7 @@ members = [ "bin/dojo-language-server", "bin/katana", "bin/saya", + "bin/scheduler", "bin/sozo", "bin/torii", "crates/benches", @@ -45,7 +46,7 @@ edition = "2021" license = "Apache-2.0" license-file = "LICENSE" repository = "https://github.com/dojoengine/dojo/" -version = "0.7.0-alpha.4" +version = "0.7.2" [profile.performance] codegen-units = 1 @@ -68,6 +69,9 @@ dojo-test-utils = { path = "crates/dojo-test-utils" } dojo-types = { path = "crates/dojo-types" } dojo-world = { path = "crates/dojo-world" } +# dojo-world +topological-sort = "0.2" + # katana katana-cairo = { path = "crates/katana/cairo" } katana-codecs = { path = "crates/katana/storage/codecs" } @@ -107,28 +111,28 @@ async-trait = "0.1.77" auto_impl = "1.2.0" base64 = "0.21.2" bytes = "1.6" -cairo-lang-compiler = "=2.6.3" -cairo-lang-debug = "=2.6.3" -cairo-lang-defs = "=2.6.3" -cairo-lang-diagnostics = "=2.6.3" -cairo-lang-filesystem = "=2.6.3" -cairo-lang-formatter = "=2.6.3" -cairo-lang-language-server = "=2.6.3" -cairo-lang-lowering = "=2.6.3" -cairo-lang-parser = "=2.6.3" -cairo-lang-plugins = { version = "=2.6.3", features = [ "testing" ] } -cairo-lang-project = "=2.6.3" -cairo-lang-semantic = { version = "=2.6.3", features = [ "testing" ] } -cairo-lang-sierra = "=2.6.3" -cairo-lang-sierra-generator = "=2.6.3" -cairo-lang-sierra-to-casm = "=2.6.3" -cairo-lang-starknet = "=2.6.3" -cairo-lang-starknet-classes = "=2.6.3" -cairo-lang-syntax = "=2.6.3" -cairo-lang-test-plugin = "=2.6.3" -cairo-lang-test-runner = "=2.6.3" -cairo-lang-test-utils = "=2.6.3" -cairo-lang-utils = "=2.6.3" +cairo-lang-compiler = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-debug = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-defs = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-diagnostics = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-filesystem = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-formatter = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-language-server = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-lowering = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-parser = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-plugins = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632", features = [ "testing" ] } +cairo-lang-project = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-semantic = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632", features = [ "testing" ] } +cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-sierra-generator = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-sierra-to-casm = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-starknet-classes = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-syntax = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-test-plugin = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-test-runner = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-test-utils = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } cairo-proof-parser = { git = "https://github.com/cartridge-gg/cairo-proof-parser", tag = "v0.3.0" } cairo-vm = "0.9.2" camino = { version = "1.1.2", features = [ "serde1" ] } @@ -162,8 +166,8 @@ regex = "1.10.3" reqwest = { version = "0.12", features = [ "blocking", "rustls-tls" ], default-features = false } rpassword = "7.2.0" salsa = "0.16.1" -scarb = { git = "https://github.com/software-mansion/scarb", rev = "e813dbab8f0ec606b5846827ad65951ef8bd6b92" } -scarb-ui = { git = "https://github.com/software-mansion/scarb", rev = "e813dbab8f0ec606b5846827ad65951ef8bd6b92" } +scarb = { git = "https://github.com/software-mansion/scarb", rev = "f1aa7b09507a84d209d83b2fa80472c82605cc43" } +scarb-ui = { git = "https://github.com/software-mansion/scarb", rev = "f1aa7b09507a84d209d83b2fa80472c82605cc43" } semver = "1.0.5" serde = { version = "1.0", features = [ "derive" ] } serde_json = { version = "1.0", features = [ "arbitrary_precision" ] } @@ -186,7 +190,6 @@ tower-http = "0.4.4" tracing = "0.1.34" tracing-subscriber = { version = "0.3.16", features = [ "env-filter", "json" ] } url = { version = "2.4.0", features = [ "serde" ] } - rstest = "0.18.2" rstest_reuse = "0.6.0" @@ -224,31 +227,3 @@ alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "4655f8e437 alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "4655f8e4372ecc0b056e83abbc60c3912902ee64" } alloy-signer-wallet = { git = "https://github.com/alloy-rs/alloy", rev = "4655f8e4372ecc0b056e83abbc60c3912902ee64" } alloy-transport = { git = "https://github.com/alloy-rs/alloy", rev = "4655f8e4372ecc0b056e83abbc60c3912902ee64" } - -cairo-lang-compiler = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-debug = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-defs = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-diagnostics = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-filesystem = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-formatter = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-language-server = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-lowering = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-parser = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-plugins = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-project = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-semantic = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-sierra-generator = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-sierra-to-casm = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-starknet-classes = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-syntax = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-test-plugin = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-test-runner = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-test-utils = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } - -# Runner -cairo-lang-casm = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-runner = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } - diff --git a/bin/dojo-language-server/Cargo.toml b/bin/dojo-language-server/Cargo.toml index 62e08a7c9b..8dc16e26b0 100644 --- a/bin/dojo-language-server/Cargo.toml +++ b/bin/dojo-language-server/Cargo.toml @@ -6,19 +6,6 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -anyhow.workspace = true -cairo-lang-compiler.workspace = true -cairo-lang-filesystem.workspace = true cairo-lang-language-server.workspace = true -cairo-lang-plugins.workspace = true -cairo-lang-semantic.workspace = true -cairo-lang-starknet.workspace = true -cairo-lang-test-plugin.workspace = true -cairo-lang-utils.workspace = true clap.workspace = true dojo-lang.workspace = true -log.workspace = true -salsa.workspace = true -smol_str.workspace = true -tokio = { version = "1.18.2", features = [ "full", "sync" ] } -tower-lsp = "0.20.0" diff --git a/bin/dojo-language-server/src/main.rs b/bin/dojo-language-server/src/main.rs index 3c01cbc792..d6516351a2 100644 --- a/bin/dojo-language-server/src/main.rs +++ b/bin/dojo-language-server/src/main.rs @@ -1,7 +1,15 @@ use cairo_lang_language_server::Tricks; +use clap::Parser; use dojo_lang::plugin::dojo_plugin_suite; +/// Dojo Language Server +#[derive(Parser, Debug)] +#[command(author, version, about, long_about = None)] +struct Args {} + fn main() { + let _args = Args::parse(); + let mut tricks = Tricks::default(); tricks.extra_plugin_suites = Some(&|| vec![dojo_plugin_suite()]); cairo_lang_language_server::start_with_tricks(tricks); diff --git a/bin/saya/Cargo.toml b/bin/saya/Cargo.toml index add58c0e63..1021bf1706 100644 --- a/bin/saya/Cargo.toml +++ b/bin/saya/Cargo.toml @@ -20,3 +20,7 @@ tokio.workspace = true tracing-subscriber.workspace = true tracing.workspace = true url.workspace = true + +[dev-dependencies] +cairo-proof-parser.workspace = true +starknet-crypto.workspace = true diff --git a/bin/saya/README.md b/bin/saya/README.md index acdc21d51f..913b6ad039 100644 --- a/bin/saya/README.md +++ b/bin/saya/README.md @@ -1,18 +1,21 @@ - # Saya Executable Documentation This documentation outlines the operation of the Saya executable, a CLI-based service designed to interact with blockchain components for state management and updates. Saya supports operations on Celestia nodes and integrates with Katana blocks to provide a streamlined blockchain interaction process. ## Key Features + - **Celestia Node Integration**: Allows publishing state updates to a Celestia node (WIP). - **Katana Block Fetching**: Saya can fetch blocks from Katana, aiding in local blockchain simulations and testing. ## Prerequisites + Ensure you have the following set up: + - Rust and Cargo installed on your system. - Access to Celestia and/or Katana node URLs if needed. ## Basic Usage Example + Below is a command-line example that demonstrates how to run the Saya executable with necessary parameters: ```bash @@ -21,38 +24,160 @@ cargo run --bin saya -- --rpc-url http://localhost:5050 --da-chain celestia --ce ## Detailed Workflow -### 1. Deploy a New World Contract -First, deploy a new smart contract using the Saya framework: -```bash -cargo run -r -p sozo -- build --manifest-path examples/spawn-and-move/Scarb.toml +1. Prepare fact registry contract + + Declare or use already declared `class-hash`: `0x7f6076572e04d7182a1c5c9f1f4c15aafcb069b1bfdb3de4d7c9e47c99deeb4`. + + Deploy or use already deployed `contract`: `0x217746a5f74c2e5b6fa92c97e902d8cd78b1fabf1e8081c4aa0d2fe159bc0eb`. + + In the repository https://github.com/HerodotusDev/integrity run -cargo run -r -p sozo -- migrate apply --manifest-path examples/spawn-and-move/Scarb.toml --rpc-url <> --fee-estimate-multiplier 1000 --private-key <> --account-address <> --name saya-world-v1 +```bash + fact_registry/1-declare.sh # extract `class-hash` + fact_registry/1-deploy.sh # use at ``` -### 2. Initialize a Local Katana Instance -Start a local instance of Katana configured to work with the newly deployed contract: +2. Spawn world + +You must choose a world's name as you may deploy the exact same code as an other person trying this example. The world's name must fit into 31 characters. + +**IMPORTANT NOTE:** +At the moment until a bug is fixed, you must comment out the `world_address` that is present into the `examples/spawn-and-move/Scarb.toml` file to allow the use of the `--name` flag. + ```bash -cargo run -r -p katana -- -b 30000 --rpc-url <> --fork-block-number +cargo run -r --bin sozo -- \ + build \ + --manifest-path examples/spawn-and-move/Scarb.toml + +cargo run -r --bin sozo -- \ + migrate apply \ + --manifest-path examples/spawn-and-move/Scarb.toml \ + --rpc-url \ + --private-key \ + --account-address \ + --fee-estimate-multiplier 20 \ + --name ``` +Once the migration is done, please take note of the address of the world as it will be re-used in the commands below. + +1. Set world configs -### 3. Launch the Saya Service -Execute the Saya process to interact with the blockchain network: ```bash -cargo run -r --bin saya -- --rpc-url http://localhost:5050 --registry 0x217746a5f74c2e5b6fa92c97e902d8cd78b1fabf1e8081c4aa0d2fe159bc0eb --world <> --start-block <> +cargo run -r --bin sozo -- \ + execute set_differ_program_hash \ + -c 0xa73dd9546f9858577f9fdbe43fd629b6f12dc638652e11b6e29155f4c6328 \ + --manifest-path examples/spawn-and-move/Scarb.toml \ + --rpc-url \ + --private-key \ + --account-address \ + --fee-estimate-multiplier 20 \ + --world \ + --wait + +cargo run -r --bin sozo -- \ + execute set_merger_program_hash \ + -c 0xc105cf2c69201005df3dad0050f5289c53d567d96df890f2142ad43a540334 \ + --manifest-path examples/spawn-and-move/Scarb.toml \ + --rpc-url \ + --private-key \ + --account-address \ + --fee-estimate-multiplier 20 \ + --world \ + --wait + +cargo run -r --bin sozo -- \ + execute set_facts_registry \ + -c 0x217746a5f74c2e5b6fa92c97e902d8cd78b1fabf1e8081c4aa0d2fe159bc0eb \ + --manifest-path examples/spawn-and-move/Scarb.toml \ + --rpc-url \ + --private-key \ + --account-address \ + --fee-estimate-multiplier 20 \ + --world \ + --wait ``` -Currently the Stone prover in use is optimized for AMD64. Hence, running it on a ARM64 machine will be relatively slow or even not compatible if emulation is now available. -If you can't run Saya on a AMD64 machine, you may choose to use the HTTP wrapper currently proposed by Visoft. +4. Start katana + +Start a local instance of Katana configured to work with the newly deployed contract. You should wait your world to be integrated into the latest block (and not the pending). +Once block in which the transaction that deploys the world is mined, you can start `katana` in forking mode. + ```bash -cargo run -r --bin saya -- --rpc-url http://localhost:5050 --prover-url http://prover.visoft.dev:3618/prove/state-diff-commitment --registry 0x217746a5f74c2e5b6fa92c97e902d8cd78b1fabf1e8081c4aa0d2fe159bc0eb --world <> --start-block <> +cargo run -r --bin katana -- \ + --rpc-url \ + --fork-block-number ``` -### 4. Modify the World State Using `sozo` +5. Run transactions on `katana` + Finally, modify the state of the world using specific actions: + +```bash +cargo run -r --bin sozo -- execute dojo_examples::actions::actions spawn \ + --manifest-path examples/spawn-and-move/Scarb.toml \ + --rpc-url http://localhost:5050 \ + --private-key \ + --account-address \ + --world \ + --wait +``` + +Before running `saya`, we can check the actual value for some models on Sepolia, to then see them updated by the proof being verified and the state of the world being updated. +In the `spawn-and-move` example, the `Position` model is used to store some data associated with the player, +being the contract address of the contract that called `spawn` (hence, your account address). +By default on Sepolia, it should be set like to unknown position, being like: + +```bash +cargo run -r --bin sozo -- model get Position \ + --manifest-path examples/spawn-and-move/Scarb.toml \ + --rpc-url \ + --world +``` +```json +// Expected on Sepolia as we've executed the transaction on the Katana shard. +{ + player : , + vec : { + x : 0, + y : 0 + } +} + +// Expected on Katana. +{ + player : , + vec : { + x : 10, + y : 10 + } +} +``` + +6. Run saya + +The could be `http://prover.visoft.dev:3618` if you have a registered key or a link to a self hosted instance of `https://github.com/neotheprogramist/http-prover`. +The is the private key produced by `keygen` installed with `cargo install --git https://github.com/neotheprogramist/http-prover keygen`. Pass the public key to server operator or the prover program. + +If you are on an `amd64` architecture, go ahead and run the `http-prover` locally to see how it works and run this whole pipeline locally. +If not (this includes Apple Silicon), some emulation will take place to run the prover on your machine, and this is very very slow. + +It's important that the `--start-block` of Saya is the first block produced by Katana as for now Katana is not fetching events from the forked network. + +**IMPORTANT NOTE:** +For now, please add your account address and account private key in `saya/core/src/dojo_os/mod.rs` as those parameters are still not exposed currently. As you are using `cargo run`, it will rebuild with your account configuration before running `saya`. + ```bash -cargo run -r -p sozo -- execute --rpc-url http://localhost:5050 --private-key <> --account-address <> --world <> dojo_examples::actions::actions spawn +cargo run -r --bin saya -- \ + --rpc-url http://localhost:5050 \ + --registry \ + --world \ + --url \ + --private-key \ + --start-block ``` After this command, Saya will pick up the blocks with transactions, generate the proof for the state transition, and send it to the base layer world contract. +Once the world on Sepolia is updated, you can issue again the `model get` command as seen before, and you should see the `katana` shard state reflected on Sepolia. + Ensure to replace placeholders (`<>`) with appropriate values for your configuration and environment. This documentation provides a comprehensive overview for developers and operators to effectively utilize the Saya service in blockchain applications. diff --git a/bin/saya/programs/cairo0differ.json b/bin/saya/programs/cairo0differ.json new file mode 100644 index 0000000000..0188ed1f08 --- /dev/null +++ b/bin/saya/programs/cairo0differ.json @@ -0,0 +1 @@ +{ "attributes": [], "builtins": [ "output", "pedersen", "range_check", "bitwise" ], "compiler_version": "0.13.1", "data": [ "0x40780017fff7fff", "0x4", "0x1104800180018000", "0xcc", "0x10780017fff7fff", "0x0", "0x400380007ffb7ffc", "0x400380017ffb7ffd", "0x482680017ffb8000", "0x3", "0x480280027ffb8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x8", "0x480a80047fff8000", "0x480a80057fff8000", "0x480a80067fff8000", "0x480a80077fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x2", "0x480a80007fff8000", "0x480a80017fff8000", "0x208b7fff7fff7ffe", "0x20780017fff7ffd", "0x5", "0x480a7ffa7fff8000", "0x480a7ffb7fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x0", "0x480a7ffa7fff8000", "0x480a7ffb7fff8000", "0x480280007ffc8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffe5", "0x482680017ffc8000", "0x1", "0x482680017ffd8000", "0x800000000000011000000000000000000000000000000000000000000000000", "0x1104800180018000", "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffff1", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x4", "0x480a80007fff8000", "0x480a80017fff8000", "0x480a80027fff8000", "0x480a80037fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x2", "0x480a80007fff8000", "0x480a80017fff8000", "0x208b7fff7fff7ffe", "0x480a7ffc7fff8000", "0x480280007ffd8000", "0x480280017ffd8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffcd", "0x208b7fff7fff7ffe", "0x20780017fff7ffd", "0x5", "0x480a7ffa7fff8000", "0x480a7ffb7fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x0", "0x480a7ffa7fff8000", "0x480280007ffc8000", "0x1104800180018000", "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffff2", "0x48127ffe7fff8000", "0x480a7ffb7fff8000", "0x48127ffd7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffbc", "0x482680017ffc8000", "0x1", "0x482680017ffd8000", "0x800000000000011000000000000000000000000000000000000000000000000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffed", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x2", "0x480a80007fff8000", "0x480a80017fff8000", "0x208b7fff7fff7ffe", "0x480a7ffc7fff8000", "0x480280007ffd8000", "0x480280017ffd8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffab", "0x480280027ffd8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffa8", "0x208b7fff7fff7ffe", "0x20780017fff7ffd", "0x5", "0x480a7ffa7fff8000", "0x480a7ffb7fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x0", "0x480a7ffa7fff8000", "0x480280007ffc8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffef", "0x48127ffe7fff8000", "0x480a7ffb7fff8000", "0x48127ffd7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff97", "0x482680017ffc8000", "0x1", "0x482680017ffd8000", "0x800000000000011000000000000000000000000000000000000000000000000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffed", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x2", "0x480a80007fff8000", "0x480a80017fff8000", "0x208b7fff7fff7ffe", "0x480a7ffc7fff8000", "0x480280007ffd8000", "0x480280017ffd8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff86", "0x208b7fff7fff7ffe", "0x20780017fff7ffd", "0x5", "0x480a7ffa7fff8000", "0x480a7ffb7fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x0", "0x480a7ffa7fff8000", "0x480280007ffc8000", "0x1104800180018000", "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffff2", "0x48127ffe7fff8000", "0x480a7ffb7fff8000", "0x48127ffd7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff75", "0x482680017ffc8000", "0x1", "0x482680017ffd8000", "0x800000000000011000000000000000000000000000000000000000000000000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffed", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x2", "0x480a80007fff8000", "0x480a80017fff8000", "0x208b7fff7fff7ffe", "0x480a7ffc7fff8000", "0x480280007ffd8000", "0x480280017ffd8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff64", "0x208b7fff7fff7ffe", "0x20780017fff7ffd", "0x5", "0x480a7ffa7fff8000", "0x480a7ffb7fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x0", "0x480a7ffa7fff8000", "0x480280007ffc8000", "0x1104800180018000", "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffff2", "0x48127ffe7fff8000", "0x480a7ffb7fff8000", "0x48127ffd7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff53", "0x482680017ffc8000", "0x1", "0x482680017ffd8000", "0x800000000000011000000000000000000000000000000000000000000000000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffed", "0x208b7fff7fff7ffe", "0x20780017fff7ffd", "0x4", "0x480a7ffb7fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x0", "0x480280007ffc8000", "0x400280007ffb7fff", "0x482680017ffb8000", "0x1", "0x482680017ffc8000", "0x1", "0x482680017ffd8000", "0x800000000000011000000000000000000000000000000000000000000000000", "0x1104800180018000", "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffff3", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0xd", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff3d", "0x40137ffc7fff8000", "0x40137ffd7fff8001", "0x40137ffe7fff8002", "0x40137fff7fff8003", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff5d", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff7d", "0x40137ffe7fff8004", "0x40137fff7fff8005", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff9e", "0x40137ffe7fff8006", "0x40137fff7fff8007", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffbc", "0x40137ffe7fff8008", "0x40137fff7fff8009", "0x480a7ffb7fff8000", "0x480a80007fff8000", "0x480a80017fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff20", "0x480a80027fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff1d", "0x480a80037fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff1a", "0x48127fdb7fff8000", "0x48127fdb7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff4d", "0x480a80047fff8000", "0x480a80057fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff6e", "0x480a80067fff8000", "0x480a80077fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff8c", "0x480a80087fff8000", "0x480a80097fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffaa", "0x400380007ffa8000", "0x400280017ffa7fff", "0x400380027ffa8001", "0x400380037ffa8002", "0x400380047ffa8003", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff10", "0x48127ff87fff8000", "0x480680017fff8000", "0x0", "0x48127ffc7fff8000", "0x48127ffc7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff0e", "0x40137ffe7fff800a", "0x400280057ffa7fff", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff1d", "0x40137fff7fff800b", "0x40137ffe7fff800c", "0x400280067ffa7ffd", "0x482680017ffa8000", "0x7", "0x48127ffb7fff8000", "0x48127ffb7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffa6", "0x400180007fff800b", "0x482480017fff8000", "0x1", "0x480a800c7fff8000", "0x480a800b7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff9f", "0x480a800a7fff8000", "0x480a7ffc7fff8000", "0x480a7ffd7fff8000", "0x208b7fff7fff7ffe" ], "debug_info": { "file_contents": { "": "__start__:\nap += main.Args.SIZE + main.ImplicitArgs.SIZE;\ncall main;\n\n__end__:\njmp rel 0;\n" }, "instruction_locations": { "0": { "accessible_scopes": [ "__main__" ], "flow_tracking_data": { "ap_tracking": { "group": 0, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 46, "end_line": 2, "input_file": { "filename": "" }, "start_col": 1, "start_line": 2 } }, "2": { "accessible_scopes": [ "__main__" ], "flow_tracking_data": { "ap_tracking": { "group": 0, "offset": 4 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 10, "end_line": 3, "input_file": { "filename": "" }, "start_col": 1, "start_line": 3 } }, "4": { "accessible_scopes": [ "__main__" ], "flow_tracking_data": { "ap_tracking": { "group": 1, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 10, "end_line": 6, "input_file": { "filename": "" }, "start_col": 1, "start_line": 6 } }, "6": { "accessible_scopes": [ "starkware.cairo.common.hash", "starkware.cairo.common.hash.hash2" ], "flow_tracking_data": { "ap_tracking": { "group": 2, "offset": 0 }, "reference_ids": { "starkware.cairo.common.hash.hash2.hash_ptr": 2, "starkware.cairo.common.hash.hash2.x": 0, "starkware.cairo.common.hash.hash2.y": 1 } }, "hints": [], "inst": { "end_col": 19, "end_line": 14, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "start_col": 5, "start_line": 14 } }, "7": { "accessible_scopes": [ "starkware.cairo.common.hash", "starkware.cairo.common.hash.hash2" ], "flow_tracking_data": { "ap_tracking": { "group": 2, "offset": 0 }, "reference_ids": { "starkware.cairo.common.hash.hash2.hash_ptr": 2, "starkware.cairo.common.hash.hash2.x": 0, "starkware.cairo.common.hash.hash2.y": 1 } }, "hints": [], "inst": { "end_col": 19, "end_line": 15, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "start_col": 5, "start_line": 15 } }, "8": { "accessible_scopes": [ "starkware.cairo.common.hash", "starkware.cairo.common.hash.hash2" ], "flow_tracking_data": { "ap_tracking": { "group": 2, "offset": 0 }, "reference_ids": { "starkware.cairo.common.hash.hash2.hash_ptr": 4, "starkware.cairo.common.hash.hash2.result": 3, "starkware.cairo.common.hash.hash2.x": 0, "starkware.cairo.common.hash.hash2.y": 1 } }, "hints": [], "inst": { "end_col": 47, "end_line": 17, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "parent_location": [ { "end_col": 34, "end_line": 13, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "parent_location": [ { "end_col": 28, "end_line": 18, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "start_col": 5, "start_line": 18 }, "While trying to retrieve the implicit argument 'hash_ptr' in:" ], "start_col": 12, "start_line": 13 }, "While expanding the reference 'hash_ptr' in:" ], "start_col": 20, "start_line": 17 } }, "10": { "accessible_scopes": [ "starkware.cairo.common.hash", "starkware.cairo.common.hash.hash2" ], "flow_tracking_data": { "ap_tracking": { "group": 2, "offset": 1 }, "reference_ids": { "starkware.cairo.common.hash.hash2.hash_ptr": 4, "starkware.cairo.common.hash.hash2.result": 3, "starkware.cairo.common.hash.hash2.x": 0, "starkware.cairo.common.hash.hash2.y": 1 } }, "hints": [], "inst": { "end_col": 33, "end_line": 16, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 18, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "start_col": 20, "start_line": 18 }, "While expanding the reference 'result' in:" ], "start_col": 18, "start_line": 16 } }, "11": { "accessible_scopes": [ "starkware.cairo.common.hash", "starkware.cairo.common.hash.hash2" ], "flow_tracking_data": { "ap_tracking": { "group": 2, "offset": 2 }, "reference_ids": { "starkware.cairo.common.hash.hash2.hash_ptr": 4, "starkware.cairo.common.hash.hash2.result": 3, "starkware.cairo.common.hash.hash2.x": 0, "starkware.cairo.common.hash.hash2.y": 1 } }, "hints": [], "inst": { "end_col": 28, "end_line": 18, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "start_col": 5, "start_line": 18 } }, "12": { "accessible_scopes": [ "__main__", "__main__.get_hashes" ], "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 15, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 15 } }, "14": { "accessible_scopes": [ "__main__", "__main__.get_hashes" ], "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 8 }, "reference_ids": { "__main__.get_hashes.block_hash": 8, "__main__.get_hashes.block_number": 7, "__main__.get_hashes.config_hash": 9, "__main__.get_hashes.input_config": 5, "__main__.get_hashes.prev_state_root": 6 } }, "hints": [ { "location": { "end_col": 7, "end_line": 26, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 21 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 26, "end_line": 17, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 29, "input_file": { "filename": "src/differ.cairo" }, "start_col": 29, "start_line": 29 }, "While expanding the reference 'prev_state_root' in:" ], "start_col": 11, "start_line": 17 } }, "15": { "accessible_scopes": [ "__main__", "__main__.get_hashes" ], "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 9 }, "reference_ids": { "__main__.get_hashes.block_hash": 8, "__main__.get_hashes.block_number": 7, "__main__.get_hashes.config_hash": 9, "__main__.get_hashes.input_config": 5, "__main__.get_hashes.prev_state_root": 6 } }, "hints": [], "inst": { "end_col": 23, "end_line": 18, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 38, "end_line": 30, "input_file": { "filename": "src/differ.cairo" }, "start_col": 26, "start_line": 30 }, "While expanding the reference 'block_number' in:" ], "start_col": 11, "start_line": 18 } }, "16": { "accessible_scopes": [ "__main__", "__main__.get_hashes" ], "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 10 }, "reference_ids": { "__main__.get_hashes.block_hash": 8, "__main__.get_hashes.block_number": 7, "__main__.get_hashes.config_hash": 9, "__main__.get_hashes.input_config": 5, "__main__.get_hashes.prev_state_root": 6 } }, "hints": [], "inst": { "end_col": 21, "end_line": 19, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 34, "end_line": 31, "input_file": { "filename": "src/differ.cairo" }, "start_col": 24, "start_line": 31 }, "While expanding the reference 'block_hash' in:" ], "start_col": 11, "start_line": 19 } }, "17": { "accessible_scopes": [ "__main__", "__main__.get_hashes" ], "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 11 }, "reference_ids": { "__main__.get_hashes.block_hash": 8, "__main__.get_hashes.block_number": 7, "__main__.get_hashes.config_hash": 9, "__main__.get_hashes.input_config": 5, "__main__.get_hashes.prev_state_root": 6 } }, "hints": [], "inst": { "end_col": 22, "end_line": 20, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 36, "end_line": 32, "input_file": { "filename": "src/differ.cairo" }, "start_col": 25, "start_line": 32 }, "While expanding the reference 'config_hash' in:" ], "start_col": 11, "start_line": 20 } }, "18": { "accessible_scopes": [ "__main__", "__main__.get_hashes" ], "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 12 }, "reference_ids": { "__main__.get_hashes.block_hash": 8, "__main__.get_hashes.block_number": 7, "__main__.get_hashes.config_hash": 9, "__main__.get_hashes.input_config": 5, "__main__.get_hashes.prev_state_root": 6 } }, "hints": [], "inst": { "end_col": 7, "end_line": 34, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 27 } }, "19": { "accessible_scopes": [ "__main__", "__main__.get_world_da" ], "flow_tracking_data": { "ap_tracking": { "group": 4, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 41, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 41 } }, "21": { "accessible_scopes": [ "__main__", "__main__.get_world_da" ], "flow_tracking_data": { "ap_tracking": { "group": 4, "offset": 2 }, "reference_ids": { "__main__.get_world_da.world_da": 10, "__main__.get_world_da.world_da_len": 11 } }, "hints": [ { "location": { "end_col": 7, "end_line": 48, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 44 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 19, "end_line": 42, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 51, "input_file": { "filename": "src/differ.cairo" }, "start_col": 18, "start_line": 51 }, "While expanding the reference 'world_da' in:" ], "start_col": 11, "start_line": 42 } }, "22": { "accessible_scopes": [ "__main__", "__main__.get_world_da" ], "flow_tracking_data": { "ap_tracking": { "group": 4, "offset": 3 }, "reference_ids": { "__main__.get_world_da.world_da": 10, "__main__.get_world_da.world_da_len": 11 } }, "hints": [], "inst": { "end_col": 23, "end_line": 43, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 34, "end_line": 52, "input_file": { "filename": "src/differ.cairo" }, "start_col": 22, "start_line": 52 }, "While expanding the reference 'world_da_len' in:" ], "start_col": 11, "start_line": 43 } }, "23": { "accessible_scopes": [ "__main__", "__main__.get_world_da" ], "flow_tracking_data": { "ap_tracking": { "group": 4, "offset": 4 }, "reference_ids": { "__main__.get_world_da.world_da": 10, "__main__.get_world_da.world_da_len": 11 } }, "hints": [], "inst": { "end_col": 7, "end_line": 53, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 50 } }, "24": { "accessible_scopes": [ "__main__", "__main__.hash_world_da_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 0 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 7, "end_line": 59, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 59 } }, "26": { "accessible_scopes": [ "__main__", "__main__.hash_world_da_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 0 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 51, "end_line": 56, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 51, "end_line": 56, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 60, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 60 }, "While trying to retrieve the implicit argument 'pedersen_ptr' in:" ], "start_col": 25, "start_line": 56 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 25, "start_line": 56 } }, "27": { "accessible_scopes": [ "__main__", "__main__.hash_world_da_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 1 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 14, "end_line": 57, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 24, "end_line": 60, "input_file": { "filename": "src/differ.cairo" }, "start_col": 21, "start_line": 60 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 57 } }, "28": { "accessible_scopes": [ "__main__", "__main__.hash_world_da_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 2 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 26, "end_line": 60, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 60 } }, "29": { "accessible_scopes": [ "__main__", "__main__.hash_world_da_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 0 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 18, "end_line": 62, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 62 } }, "31": { "accessible_scopes": [ "__main__", "__main__.hash_world_da_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 0 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 51, "end_line": 56, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 64, "input_file": { "filename": "src/differ.cairo" }, "start_col": 32, "start_line": 64 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 25, "start_line": 56 } }, "32": { "accessible_scopes": [ "__main__", "__main__.hash_world_da_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 1 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 14, "end_line": 57, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 65, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 65 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 57 } }, "33": { "accessible_scopes": [ "__main__", "__main__.hash_world_da_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 2 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 27, "end_line": 63, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 19, "end_line": 65, "input_file": { "filename": "src/differ.cairo" }, "start_col": 14, "start_line": 65 }, "While expanding the reference 'value' in:" ], "start_col": 17, "start_line": 63 } }, "34": { "accessible_scopes": [ "__main__", "__main__.hash_world_da_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 3 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 6, "end_line": 66, "input_file": { "filename": "src/differ.cairo" }, "start_col": 17, "start_line": 64 } }, "36": { "accessible_scopes": [ "__main__", "__main__.hash_world_da_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 7 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 17, "__main__.hash_world_da_loop.res": 18, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 30, "end_line": 69, "input_file": { "filename": "src/differ.cairo" }, "start_col": 18, "start_line": 69 } }, "38": { "accessible_scopes": [ "__main__", "__main__.hash_world_da_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 8 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 17, "__main__.hash_world_da_loop.res": 18, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 38, "end_line": 70, "input_file": { "filename": "src/differ.cairo" }, "start_col": 22, "start_line": 70 } }, "40": { "accessible_scopes": [ "__main__", "__main__.hash_world_da_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 9 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 17, "__main__.hash_world_da_loop.res": 18, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 6, "end_line": 71, "input_file": { "filename": "src/differ.cairo" }, "start_col": 12, "start_line": 67 } }, "42": { "accessible_scopes": [ "__main__", "__main__.hash_world_da_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 6, "offset": 0 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 19, "__main__.hash_world_da_loop.res": 18, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 7, "end_line": 71, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 67 } }, "43": { "accessible_scopes": [ "__main__", "__main__.get_messages" ], "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 80, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 80 } }, "45": { "accessible_scopes": [ "__main__", "__main__.get_messages" ], "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 4 }, "reference_ids": { "__main__.get_messages.message_to_appchain_segment": 22, "__main__.get_messages.message_to_appchain_segment_len": 23, "__main__.get_messages.message_to_starknet_segment": 20, "__main__.get_messages.message_to_starknet_segment_len": 21 } }, "hints": [ { "location": { "end_col": 7, "end_line": 99, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 85 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 38, "end_line": 81, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 64, "end_line": 101, "input_file": { "filename": "src/differ.cairo" }, "start_col": 37, "start_line": 101 }, "While expanding the reference 'message_to_starknet_segment' in:" ], "start_col": 11, "start_line": 81 } }, "46": { "accessible_scopes": [ "__main__", "__main__.get_messages" ], "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 5 }, "reference_ids": { "__main__.get_messages.message_to_appchain_segment": 22, "__main__.get_messages.message_to_appchain_segment_len": 23, "__main__.get_messages.message_to_starknet_segment": 20, "__main__.get_messages.message_to_starknet_segment_len": 21 } }, "hints": [], "inst": { "end_col": 42, "end_line": 82, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 72, "end_line": 102, "input_file": { "filename": "src/differ.cairo" }, "start_col": 41, "start_line": 102 }, "While expanding the reference 'message_to_starknet_segment_len' in:" ], "start_col": 11, "start_line": 82 } }, "47": { "accessible_scopes": [ "__main__", "__main__.get_messages" ], "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 6 }, "reference_ids": { "__main__.get_messages.message_to_appchain_segment": 22, "__main__.get_messages.message_to_appchain_segment_len": 23, "__main__.get_messages.message_to_starknet_segment": 20, "__main__.get_messages.message_to_starknet_segment_len": 21 } }, "hints": [], "inst": { "end_col": 38, "end_line": 83, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 64, "end_line": 103, "input_file": { "filename": "src/differ.cairo" }, "start_col": 37, "start_line": 103 }, "While expanding the reference 'message_to_appchain_segment' in:" ], "start_col": 11, "start_line": 83 } }, "48": { "accessible_scopes": [ "__main__", "__main__.get_messages" ], "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 7 }, "reference_ids": { "__main__.get_messages.message_to_appchain_segment": 22, "__main__.get_messages.message_to_appchain_segment_len": 23, "__main__.get_messages.message_to_starknet_segment": 20, "__main__.get_messages.message_to_starknet_segment_len": 21 } }, "hints": [], "inst": { "end_col": 42, "end_line": 84, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 72, "end_line": 104, "input_file": { "filename": "src/differ.cairo" }, "start_col": 41, "start_line": 104 }, "While expanding the reference 'message_to_appchain_segment_len' in:" ], "start_col": 11, "start_line": 84 } }, "49": { "accessible_scopes": [ "__main__", "__main__.get_messages" ], "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 8 }, "reference_ids": { "__main__.get_messages.message_to_appchain_segment": 22, "__main__.get_messages.message_to_appchain_segment_len": 23, "__main__.get_messages.message_to_starknet_segment": 20, "__main__.get_messages.message_to_starknet_segment_len": 21 } }, "hints": [], "inst": { "end_col": 7, "end_line": 105, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 100 } }, "50": { "accessible_scopes": [ "__main__", "__main__.get_nonce_updates" ], "flow_tracking_data": { "ap_tracking": { "group": 8, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 114, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 114 } }, "52": { "accessible_scopes": [ "__main__", "__main__.get_nonce_updates" ], "flow_tracking_data": { "ap_tracking": { "group": 8, "offset": 2 }, "reference_ids": { "__main__.get_nonce_updates.nonce_updates": 24, "__main__.get_nonce_updates.nonce_updates_len": 25 } }, "hints": [ { "location": { "end_col": 7, "end_line": 129, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 117 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 24, "end_line": 115, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 40, "end_line": 130, "input_file": { "filename": "src/differ.cairo" }, "start_col": 27, "start_line": 130 }, "While expanding the reference 'nonce_updates' in:" ], "start_col": 11, "start_line": 115 } }, "53": { "accessible_scopes": [ "__main__", "__main__.get_nonce_updates" ], "flow_tracking_data": { "ap_tracking": { "group": 8, "offset": 3 }, "reference_ids": { "__main__.get_nonce_updates.nonce_updates": 24, "__main__.get_nonce_updates.nonce_updates_len": 25 } }, "hints": [], "inst": { "end_col": 28, "end_line": 116, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 77, "end_line": 130, "input_file": { "filename": "src/differ.cairo" }, "start_col": 60, "start_line": 130 }, "While expanding the reference 'nonce_updates_len' in:" ], "start_col": 11, "start_line": 116 } }, "54": { "accessible_scopes": [ "__main__", "__main__.get_nonce_updates" ], "flow_tracking_data": { "ap_tracking": { "group": 8, "offset": 4 }, "reference_ids": { "__main__.get_nonce_updates.nonce_updates": 24, "__main__.get_nonce_updates.nonce_updates_len": 25 } }, "hints": [], "inst": { "end_col": 79, "end_line": 130, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 130 } }, "55": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_update" ], "flow_tracking_data": { "ap_tracking": { "group": 9, "offset": 0 }, "reference_ids": { "__main__.hash_nonce_update.nonce_update": 26, "__main__.hash_nonce_update.pedersen_ptr": 27, "__main__.hash_nonce_update.res": 28 } }, "hints": [], "inst": { "end_col": 50, "end_line": 133, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 137, "input_file": { "filename": "src/differ.cairo" }, "start_col": 32, "start_line": 137 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 24, "start_line": 133 } }, "56": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_update" ], "flow_tracking_data": { "ap_tracking": { "group": 9, "offset": 1 }, "reference_ids": { "__main__.hash_nonce_update.nonce_update": 26, "__main__.hash_nonce_update.pedersen_ptr": 27, "__main__.hash_nonce_update.res": 28 } }, "hints": [], "inst": { "end_col": 44, "end_line": 136, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 138, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 138 }, "While expanding the reference 'res' in:" ], "start_col": 15, "start_line": 136 } }, "57": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_update" ], "flow_tracking_data": { "ap_tracking": { "group": 9, "offset": 2 }, "reference_ids": { "__main__.hash_nonce_update.nonce_update": 26, "__main__.hash_nonce_update.pedersen_ptr": 27, "__main__.hash_nonce_update.res": 28 } }, "hints": [], "inst": { "end_col": 32, "end_line": 138, "input_file": { "filename": "src/differ.cairo" }, "start_col": 14, "start_line": 138 } }, "58": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_update" ], "flow_tracking_data": { "ap_tracking": { "group": 9, "offset": 3 }, "reference_ids": { "__main__.hash_nonce_update.nonce_update": 26, "__main__.hash_nonce_update.pedersen_ptr": 27, "__main__.hash_nonce_update.res": 28 } }, "hints": [], "inst": { "end_col": 6, "end_line": 139, "input_file": { "filename": "src/differ.cairo" }, "start_col": 17, "start_line": 137 } }, "60": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_update" ], "flow_tracking_data": { "ap_tracking": { "group": 9, "offset": 7 }, "reference_ids": { "__main__.hash_nonce_update.nonce_update": 26, "__main__.hash_nonce_update.pedersen_ptr": 29, "__main__.hash_nonce_update.res": 30 } }, "hints": [], "inst": { "end_col": 22, "end_line": 140, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 140 } }, "61": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 0 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 7, "end_line": 146, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 146 } }, "63": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 0 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 56, "end_line": 143, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 56, "end_line": 143, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 147, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 147 }, "While trying to retrieve the implicit argument 'pedersen_ptr' in:" ], "start_col": 30, "start_line": 143 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 30, "start_line": 143 } }, "64": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 1 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 14, "end_line": 144, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 24, "end_line": 147, "input_file": { "filename": "src/differ.cairo" }, "start_col": 21, "start_line": 147 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 144 } }, "65": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 2 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 26, "end_line": 147, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 147 } }, "66": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 0 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 18, "end_line": 149, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 149 } }, "68": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 0 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 56, "end_line": 143, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 61, "end_line": 151, "input_file": { "filename": "src/differ.cairo" }, "start_col": 49, "start_line": 151 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 30, "start_line": 143 } }, "69": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 1 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 39, "end_line": 150, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 75, "end_line": 151, "input_file": { "filename": "src/differ.cairo" }, "start_col": 63, "start_line": 151 }, "While expanding the reference 'nonce_update' in:" ], "start_col": 24, "start_line": 150 } }, "70": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 2 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 76, "end_line": 151, "input_file": { "filename": "src/differ.cairo" }, "start_col": 18, "start_line": 151 } }, "72": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 11 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 36, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 61, "end_line": 151, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 152, "input_file": { "filename": "src/differ.cairo" }, "start_col": 32, "start_line": 152 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 49, "start_line": 151 } }, "73": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 12 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 36, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 14, "end_line": 144, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 153, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 153 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 144 } }, "74": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 13 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 36, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 14, "end_line": 151, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 18, "end_line": 153, "input_file": { "filename": "src/differ.cairo" }, "start_col": 14, "start_line": 153 }, "While expanding the reference 'hash' in:" ], "start_col": 10, "start_line": 151 } }, "75": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 14 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 36, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 6, "end_line": 154, "input_file": { "filename": "src/differ.cairo" }, "start_col": 17, "start_line": 152 } }, "77": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 18 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 38, "__main__.hash_nonce_updates_loop.res": 39 } }, "hints": [], "inst": { "end_col": 40, "end_line": 157, "input_file": { "filename": "src/differ.cairo" }, "start_col": 23, "start_line": 157 } }, "79": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 19 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 38, "__main__.hash_nonce_updates_loop.res": 39 } }, "hints": [], "inst": { "end_col": 48, "end_line": 158, "input_file": { "filename": "src/differ.cairo" }, "start_col": 27, "start_line": 158 } }, "81": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 20 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 38, "__main__.hash_nonce_updates_loop.res": 39 } }, "hints": [], "inst": { "end_col": 6, "end_line": 159, "input_file": { "filename": "src/differ.cairo" }, "start_col": 12, "start_line": 155 } }, "83": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 11, "offset": 0 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 40, "__main__.hash_nonce_updates_loop.res": 39 } }, "hints": [], "inst": { "end_col": 7, "end_line": 159, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 155 } }, "84": { "accessible_scopes": [ "__main__", "__main__.get_storage_updates" ], "flow_tracking_data": { "ap_tracking": { "group": 12, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 169, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 169 } }, "86": { "accessible_scopes": [ "__main__", "__main__.get_storage_updates" ], "flow_tracking_data": { "ap_tracking": { "group": 12, "offset": 2 }, "reference_ids": { "__main__.get_storage_updates.storage_updates": 41, "__main__.get_storage_updates.storage_updates_len": 42 } }, "hints": [ { "location": { "end_col": 7, "end_line": 189, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 172 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 26, "end_line": 170, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 190, "input_file": { "filename": "src/differ.cairo" }, "start_col": 29, "start_line": 190 }, "While expanding the reference 'storage_updates' in:" ], "start_col": 11, "start_line": 170 } }, "87": { "accessible_scopes": [ "__main__", "__main__.get_storage_updates" ], "flow_tracking_data": { "ap_tracking": { "group": 12, "offset": 3 }, "reference_ids": { "__main__.get_storage_updates.storage_updates": 41, "__main__.get_storage_updates.storage_updates_len": 42 } }, "hints": [], "inst": { "end_col": 30, "end_line": 171, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 85, "end_line": 190, "input_file": { "filename": "src/differ.cairo" }, "start_col": 66, "start_line": 190 }, "While expanding the reference 'storage_updates_len' in:" ], "start_col": 11, "start_line": 171 } }, "88": { "accessible_scopes": [ "__main__", "__main__.get_storage_updates" ], "flow_tracking_data": { "ap_tracking": { "group": 12, "offset": 4 }, "reference_ids": { "__main__.get_storage_updates.storage_updates": 41, "__main__.get_storage_updates.storage_updates_len": 42 } }, "hints": [], "inst": { "end_col": 87, "end_line": 190, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 190 } }, "89": { "accessible_scopes": [ "__main__", "__main__.hash_storage_update" ], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 0 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 44, "__main__.hash_storage_update.res": 45, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 52, "end_line": 193, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 197, "input_file": { "filename": "src/differ.cairo" }, "start_col": 32, "start_line": 197 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 26, "start_line": 193 } }, "90": { "accessible_scopes": [ "__main__", "__main__.hash_storage_update" ], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 1 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 44, "__main__.hash_storage_update.res": 45, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 46, "end_line": 196, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 198, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 198 }, "While expanding the reference 'res' in:" ], "start_col": 15, "start_line": 196 } }, "91": { "accessible_scopes": [ "__main__", "__main__.hash_storage_update" ], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 2 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 44, "__main__.hash_storage_update.res": 45, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 40, "end_line": 198, "input_file": { "filename": "src/differ.cairo" }, "start_col": 14, "start_line": 198 } }, "92": { "accessible_scopes": [ "__main__", "__main__.hash_storage_update" ], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 3 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 44, "__main__.hash_storage_update.res": 45, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 6, "end_line": 199, "input_file": { "filename": "src/differ.cairo" }, "start_col": 17, "start_line": 197 } }, "94": { "accessible_scopes": [ "__main__", "__main__.hash_storage_update" ], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 7 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 46, "__main__.hash_storage_update.res": 47, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 42, "end_line": 201, "input_file": { "filename": "src/differ.cairo" }, "start_col": 14, "start_line": 201 } }, "95": { "accessible_scopes": [ "__main__", "__main__.hash_storage_update" ], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 8 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 46, "__main__.hash_storage_update.res": 47, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 6, "end_line": 202, "input_file": { "filename": "src/differ.cairo" }, "start_col": 17, "start_line": 200 } }, "97": { "accessible_scopes": [ "__main__", "__main__.hash_storage_update" ], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 12 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 48, "__main__.hash_storage_update.res": 49, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 22, "end_line": 203, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 203 } }, "98": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 0 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 7, "end_line": 209, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 209 } }, "100": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 0 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 58, "end_line": 206, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 58, "end_line": 206, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 210, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 210 }, "While trying to retrieve the implicit argument 'pedersen_ptr' in:" ], "start_col": 32, "start_line": 206 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 32, "start_line": 206 } }, "101": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 1 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 14, "end_line": 207, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 24, "end_line": 210, "input_file": { "filename": "src/differ.cairo" }, "start_col": 21, "start_line": 210 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 207 } }, "102": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 2 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 26, "end_line": 210, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 210 } }, "103": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 0 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 18, "end_line": 212, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 212 } }, "105": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 0 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 58, "end_line": 206, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 63, "end_line": 214, "input_file": { "filename": "src/differ.cairo" }, "start_col": 51, "start_line": 214 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 32, "start_line": 206 } }, "106": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 1 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 43, "end_line": 213, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 79, "end_line": 214, "input_file": { "filename": "src/differ.cairo" }, "start_col": 65, "start_line": 214 }, "While expanding the reference 'storage_update' in:" ], "start_col": 26, "start_line": 213 } }, "107": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 2 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 80, "end_line": 214, "input_file": { "filename": "src/differ.cairo" }, "start_col": 18, "start_line": 214 } }, "109": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 16 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 55, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 63, "end_line": 214, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 215, "input_file": { "filename": "src/differ.cairo" }, "start_col": 32, "start_line": 215 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 51, "start_line": 214 } }, "110": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 17 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 55, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 14, "end_line": 207, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 216, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 216 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 207 } }, "111": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 18 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 55, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 14, "end_line": 214, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 18, "end_line": 216, "input_file": { "filename": "src/differ.cairo" }, "start_col": 14, "start_line": 216 }, "While expanding the reference 'hash' in:" ], "start_col": 10, "start_line": 214 } }, "112": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 19 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 55, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 6, "end_line": 217, "input_file": { "filename": "src/differ.cairo" }, "start_col": 17, "start_line": 215 } }, "114": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 23 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 57, "__main__.hash_storage_updates_loop.res": 58, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 44, "end_line": 220, "input_file": { "filename": "src/differ.cairo" }, "start_col": 25, "start_line": 220 } }, "116": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 24 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 57, "__main__.hash_storage_updates_loop.res": 58, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 52, "end_line": 221, "input_file": { "filename": "src/differ.cairo" }, "start_col": 29, "start_line": 221 } }, "118": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 25 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 57, "__main__.hash_storage_updates_loop.res": 58, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 6, "end_line": 222, "input_file": { "filename": "src/differ.cairo" }, "start_col": 12, "start_line": 218 } }, "120": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 15, "offset": 0 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 59, "__main__.hash_storage_updates_loop.res": 58, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 7, "end_line": 222, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 218 } }, "121": { "accessible_scopes": [ "__main__", "__main__.get_contract_updates" ], "flow_tracking_data": { "ap_tracking": { "group": 16, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 232, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 232 } }, "123": { "accessible_scopes": [ "__main__", "__main__.get_contract_updates" ], "flow_tracking_data": { "ap_tracking": { "group": 16, "offset": 2 }, "reference_ids": { "__main__.get_contract_updates.contract_updates": 60, "__main__.get_contract_updates.contract_updates_len": 61 } }, "hints": [ { "location": { "end_col": 7, "end_line": 247, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 235 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 27, "end_line": 233, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 46, "end_line": 248, "input_file": { "filename": "src/differ.cairo" }, "start_col": 30, "start_line": 248 }, "While expanding the reference 'contract_updates' in:" ], "start_col": 11, "start_line": 233 } }, "124": { "accessible_scopes": [ "__main__", "__main__.get_contract_updates" ], "flow_tracking_data": { "ap_tracking": { "group": 16, "offset": 3 }, "reference_ids": { "__main__.get_contract_updates.contract_updates": 60, "__main__.get_contract_updates.contract_updates_len": 61 } }, "hints": [], "inst": { "end_col": 31, "end_line": 234, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 89, "end_line": 248, "input_file": { "filename": "src/differ.cairo" }, "start_col": 69, "start_line": 248 }, "While expanding the reference 'contract_updates_len' in:" ], "start_col": 11, "start_line": 234 } }, "125": { "accessible_scopes": [ "__main__", "__main__.get_contract_updates" ], "flow_tracking_data": { "ap_tracking": { "group": 16, "offset": 4 }, "reference_ids": { "__main__.get_contract_updates.contract_updates": 60, "__main__.get_contract_updates.contract_updates_len": 61 } }, "hints": [], "inst": { "end_col": 91, "end_line": 248, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 248 } }, "126": { "accessible_scopes": [ "__main__", "__main__.hash_contract_update" ], "flow_tracking_data": { "ap_tracking": { "group": 17, "offset": 0 }, "reference_ids": { "__main__.hash_contract_update.contract_update": 62, "__main__.hash_contract_update.pedersen_ptr": 63, "__main__.hash_contract_update.res": 64 } }, "hints": [], "inst": { "end_col": 53, "end_line": 251, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 255, "input_file": { "filename": "src/differ.cairo" }, "start_col": 32, "start_line": 255 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 27, "start_line": 251 } }, "127": { "accessible_scopes": [ "__main__", "__main__.hash_contract_update" ], "flow_tracking_data": { "ap_tracking": { "group": 17, "offset": 1 }, "reference_ids": { "__main__.hash_contract_update.contract_update": 62, "__main__.hash_contract_update.pedersen_ptr": 63, "__main__.hash_contract_update.res": 64 } }, "hints": [], "inst": { "end_col": 47, "end_line": 254, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 256, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 256 }, "While expanding the reference 'res' in:" ], "start_col": 15, "start_line": 254 } }, "128": { "accessible_scopes": [ "__main__", "__main__.hash_contract_update" ], "flow_tracking_data": { "ap_tracking": { "group": 17, "offset": 2 }, "reference_ids": { "__main__.hash_contract_update.contract_update": 62, "__main__.hash_contract_update.pedersen_ptr": 63, "__main__.hash_contract_update.res": 64 } }, "hints": [], "inst": { "end_col": 40, "end_line": 256, "input_file": { "filename": "src/differ.cairo" }, "start_col": 14, "start_line": 256 } }, "129": { "accessible_scopes": [ "__main__", "__main__.hash_contract_update" ], "flow_tracking_data": { "ap_tracking": { "group": 17, "offset": 3 }, "reference_ids": { "__main__.hash_contract_update.contract_update": 62, "__main__.hash_contract_update.pedersen_ptr": 63, "__main__.hash_contract_update.res": 64 } }, "hints": [], "inst": { "end_col": 6, "end_line": 257, "input_file": { "filename": "src/differ.cairo" }, "start_col": 17, "start_line": 255 } }, "131": { "accessible_scopes": [ "__main__", "__main__.hash_contract_update" ], "flow_tracking_data": { "ap_tracking": { "group": 17, "offset": 7 }, "reference_ids": { "__main__.hash_contract_update.contract_update": 62, "__main__.hash_contract_update.pedersen_ptr": 65, "__main__.hash_contract_update.res": 66 } }, "hints": [], "inst": { "end_col": 22, "end_line": 258, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 258 } }, "132": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 0 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 7, "end_line": 264, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 264 } }, "134": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 0 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 59, "end_line": 261, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 59, "end_line": 261, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 265, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 265 }, "While trying to retrieve the implicit argument 'pedersen_ptr' in:" ], "start_col": 33, "start_line": 261 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 33, "start_line": 261 } }, "135": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 1 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 14, "end_line": 262, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 24, "end_line": 265, "input_file": { "filename": "src/differ.cairo" }, "start_col": 21, "start_line": 265 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 262 } }, "136": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 2 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 26, "end_line": 265, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 265 } }, "137": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 0 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 18, "end_line": 267, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 267 } }, "139": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 0 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 59, "end_line": 261, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 64, "end_line": 269, "input_file": { "filename": "src/differ.cairo" }, "start_col": 52, "start_line": 269 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 33, "start_line": 261 } }, "140": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 1 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 45, "end_line": 268, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 81, "end_line": 269, "input_file": { "filename": "src/differ.cairo" }, "start_col": 66, "start_line": 269 }, "While expanding the reference 'contract_update' in:" ], "start_col": 27, "start_line": 268 } }, "141": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 2 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 82, "end_line": 269, "input_file": { "filename": "src/differ.cairo" }, "start_col": 18, "start_line": 269 } }, "143": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 11 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 72, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 64, "end_line": 269, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 270, "input_file": { "filename": "src/differ.cairo" }, "start_col": 32, "start_line": 270 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 52, "start_line": 269 } }, "144": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 12 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 72, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 14, "end_line": 262, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 271, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 271 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 262 } }, "145": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 13 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 72, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 14, "end_line": 269, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 18, "end_line": 271, "input_file": { "filename": "src/differ.cairo" }, "start_col": 14, "start_line": 271 }, "While expanding the reference 'hash' in:" ], "start_col": 10, "start_line": 269 } }, "146": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 14 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 72, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 6, "end_line": 272, "input_file": { "filename": "src/differ.cairo" }, "start_col": 17, "start_line": 270 } }, "148": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 18 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 74, "__main__.hash_contract_updates_loop.res": 75 } }, "hints": [], "inst": { "end_col": 46, "end_line": 275, "input_file": { "filename": "src/differ.cairo" }, "start_col": 26, "start_line": 275 } }, "150": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 19 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 74, "__main__.hash_contract_updates_loop.res": 75 } }, "hints": [], "inst": { "end_col": 54, "end_line": 276, "input_file": { "filename": "src/differ.cairo" }, "start_col": 30, "start_line": 276 } }, "152": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 20 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 74, "__main__.hash_contract_updates_loop.res": 75 } }, "hints": [], "inst": { "end_col": 6, "end_line": 277, "input_file": { "filename": "src/differ.cairo" }, "start_col": 12, "start_line": 273 } }, "154": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 19, "offset": 0 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 76, "__main__.hash_contract_updates_loop.res": 75 } }, "hints": [], "inst": { "end_col": 7, "end_line": 277, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 273 } }, "155": { "accessible_scopes": [ "__main__", "__main__.get_declared_classes" ], "flow_tracking_data": { "ap_tracking": { "group": 20, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 286, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 286 } }, "157": { "accessible_scopes": [ "__main__", "__main__.get_declared_classes" ], "flow_tracking_data": { "ap_tracking": { "group": 20, "offset": 2 }, "reference_ids": { "__main__.get_declared_classes.declared_classes": 77, "__main__.get_declared_classes.declared_classes_len": 78 } }, "hints": [ { "location": { "end_col": 7, "end_line": 301, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 289 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 27, "end_line": 287, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 46, "end_line": 302, "input_file": { "filename": "src/differ.cairo" }, "start_col": 30, "start_line": 302 }, "While expanding the reference 'declared_classes' in:" ], "start_col": 11, "start_line": 287 } }, "158": { "accessible_scopes": [ "__main__", "__main__.get_declared_classes" ], "flow_tracking_data": { "ap_tracking": { "group": 20, "offset": 3 }, "reference_ids": { "__main__.get_declared_classes.declared_classes": 77, "__main__.get_declared_classes.declared_classes_len": 78 } }, "hints": [], "inst": { "end_col": 31, "end_line": 288, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 89, "end_line": 302, "input_file": { "filename": "src/differ.cairo" }, "start_col": 69, "start_line": 302 }, "While expanding the reference 'declared_classes_len' in:" ], "start_col": 11, "start_line": 288 } }, "159": { "accessible_scopes": [ "__main__", "__main__.get_declared_classes" ], "flow_tracking_data": { "ap_tracking": { "group": 20, "offset": 4 }, "reference_ids": { "__main__.get_declared_classes.declared_classes": 77, "__main__.get_declared_classes.declared_classes_len": 78 } }, "hints": [], "inst": { "end_col": 91, "end_line": 302, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 302 } }, "160": { "accessible_scopes": [ "__main__", "__main__.hash_declared_class" ], "flow_tracking_data": { "ap_tracking": { "group": 21, "offset": 0 }, "reference_ids": { "__main__.hash_declared_class.declared_class": 79, "__main__.hash_declared_class.pedersen_ptr": 80, "__main__.hash_declared_class.res": 81 } }, "hints": [], "inst": { "end_col": 52, "end_line": 305, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 309, "input_file": { "filename": "src/differ.cairo" }, "start_col": 32, "start_line": 309 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 26, "start_line": 305 } }, "161": { "accessible_scopes": [ "__main__", "__main__.hash_declared_class" ], "flow_tracking_data": { "ap_tracking": { "group": 21, "offset": 1 }, "reference_ids": { "__main__.hash_declared_class.declared_class": 79, "__main__.hash_declared_class.pedersen_ptr": 80, "__main__.hash_declared_class.res": 81 } }, "hints": [], "inst": { "end_col": 40, "end_line": 308, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 310, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 310 }, "While expanding the reference 'res' in:" ], "start_col": 15, "start_line": 308 } }, "162": { "accessible_scopes": [ "__main__", "__main__.hash_declared_class" ], "flow_tracking_data": { "ap_tracking": { "group": 21, "offset": 2 }, "reference_ids": { "__main__.hash_declared_class.declared_class": 79, "__main__.hash_declared_class.pedersen_ptr": 80, "__main__.hash_declared_class.res": 81 } }, "hints": [], "inst": { "end_col": 48, "end_line": 310, "input_file": { "filename": "src/differ.cairo" }, "start_col": 14, "start_line": 310 } }, "163": { "accessible_scopes": [ "__main__", "__main__.hash_declared_class" ], "flow_tracking_data": { "ap_tracking": { "group": 21, "offset": 3 }, "reference_ids": { "__main__.hash_declared_class.declared_class": 79, "__main__.hash_declared_class.pedersen_ptr": 80, "__main__.hash_declared_class.res": 81 } }, "hints": [], "inst": { "end_col": 6, "end_line": 311, "input_file": { "filename": "src/differ.cairo" }, "start_col": 17, "start_line": 309 } }, "165": { "accessible_scopes": [ "__main__", "__main__.hash_declared_class" ], "flow_tracking_data": { "ap_tracking": { "group": 21, "offset": 7 }, "reference_ids": { "__main__.hash_declared_class.declared_class": 79, "__main__.hash_declared_class.pedersen_ptr": 82, "__main__.hash_declared_class.res": 83 } }, "hints": [], "inst": { "end_col": 22, "end_line": 312, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 312 } }, "166": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 0 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 7, "end_line": 318, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 318 } }, "168": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 0 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 59, "end_line": 315, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 59, "end_line": 315, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 319, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 319 }, "While trying to retrieve the implicit argument 'pedersen_ptr' in:" ], "start_col": 33, "start_line": 315 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 33, "start_line": 315 } }, "169": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 1 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 14, "end_line": 316, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 24, "end_line": 319, "input_file": { "filename": "src/differ.cairo" }, "start_col": 21, "start_line": 319 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 316 } }, "170": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 2 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 26, "end_line": 319, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 319 } }, "171": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 0 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 18, "end_line": 321, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 321 } }, "173": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 0 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 59, "end_line": 315, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 63, "end_line": 323, "input_file": { "filename": "src/differ.cairo" }, "start_col": 51, "start_line": 323 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 33, "start_line": 315 } }, "174": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 1 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 44, "end_line": 322, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 79, "end_line": 323, "input_file": { "filename": "src/differ.cairo" }, "start_col": 65, "start_line": 323 }, "While expanding the reference 'declared_class' in:" ], "start_col": 26, "start_line": 322 } }, "175": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 2 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 80, "end_line": 323, "input_file": { "filename": "src/differ.cairo" }, "start_col": 18, "start_line": 323 } }, "177": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 11 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 89, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 63, "end_line": 323, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 324, "input_file": { "filename": "src/differ.cairo" }, "start_col": 32, "start_line": 324 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 51, "start_line": 323 } }, "178": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 12 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 89, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 14, "end_line": 316, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 325, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 325 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 316 } }, "179": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 13 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 89, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 14, "end_line": 323, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 18, "end_line": 325, "input_file": { "filename": "src/differ.cairo" }, "start_col": 14, "start_line": 325 }, "While expanding the reference 'hash' in:" ], "start_col": 10, "start_line": 323 } }, "180": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 14 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 89, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 6, "end_line": 326, "input_file": { "filename": "src/differ.cairo" }, "start_col": 17, "start_line": 324 } }, "182": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 18 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 91, "__main__.hash_declared_classes_loop.res": 92 } }, "hints": [], "inst": { "end_col": 46, "end_line": 329, "input_file": { "filename": "src/differ.cairo" }, "start_col": 26, "start_line": 329 } }, "184": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 19 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 91, "__main__.hash_declared_classes_loop.res": 92 } }, "hints": [], "inst": { "end_col": 54, "end_line": 330, "input_file": { "filename": "src/differ.cairo" }, "start_col": 30, "start_line": 330 } }, "186": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 20 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 91, "__main__.hash_declared_classes_loop.res": 92 } }, "hints": [], "inst": { "end_col": 6, "end_line": 331, "input_file": { "filename": "src/differ.cairo" }, "start_col": 12, "start_line": 327 } }, "188": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 23, "offset": 0 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 93, "__main__.hash_declared_classes_loop.res": 92 } }, "hints": [], "inst": { "end_col": 7, "end_line": 331, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 327 } }, "189": { "accessible_scopes": [ "__main__", "__main__.output_array" ], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 0 }, "reference_ids": { "__main__.output_array.array": 94, "__main__.output_array.len": 95, "__main__.output_array.output_ptr": 96 } }, "hints": [], "inst": { "end_col": 7, "end_line": 335, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 335 } }, "191": { "accessible_scopes": [ "__main__", "__main__.output_array" ], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 0 }, "reference_ids": { "__main__.output_array.array": 94, "__main__.output_array.len": 95, "__main__.output_array.output_ptr": 96 } }, "hints": [], "inst": { "end_col": 36, "end_line": 334, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 36, "end_line": 334, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 19, "end_line": 336, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 336 }, "While trying to retrieve the implicit argument 'output_ptr' in:" ], "start_col": 19, "start_line": 334 }, "While expanding the reference 'output_ptr' in:" ], "start_col": 19, "start_line": 334 } }, "192": { "accessible_scopes": [ "__main__", "__main__.output_array" ], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 1 }, "reference_ids": { "__main__.output_array.array": 94, "__main__.output_array.len": 95, "__main__.output_array.output_ptr": 96 } }, "hints": [], "inst": { "end_col": 19, "end_line": 336, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 336 } }, "193": { "accessible_scopes": [ "__main__", "__main__.output_array" ], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 0 }, "reference_ids": { "__main__.output_array.array": 94, "__main__.output_array.len": 95, "__main__.output_array.output_ptr": 96 } }, "hints": [], "inst": { "end_col": 18, "end_line": 338, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 338 } }, "195": { "accessible_scopes": [ "__main__", "__main__.output_array" ], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 0 }, "reference_ids": { "__main__.output_array.array": 94, "__main__.output_array.len": 95, "__main__.output_array.output_ptr": 96, "__main__.output_array.value": 97 } }, "hints": [], "inst": { "end_col": 24, "end_line": 339, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 33, "end_line": 340, "input_file": { "filename": "src/differ.cairo" }, "start_col": 28, "start_line": 340 }, "While expanding the reference 'value' in:" ], "start_col": 17, "start_line": 339 } }, "196": { "accessible_scopes": [ "__main__", "__main__.output_array" ], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 1 }, "reference_ids": { "__main__.output_array.__temp0": 98, "__main__.output_array.array": 94, "__main__.output_array.len": 95, "__main__.output_array.output_ptr": 96, "__main__.output_array.value": 97 } }, "hints": [], "inst": { "end_col": 34, "end_line": 340, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 340 } }, "197": { "accessible_scopes": [ "__main__", "__main__.output_array" ], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 1 }, "reference_ids": { "__main__.output_array.__temp0": 98, "__main__.output_array.array": 94, "__main__.output_array.len": 95, "__main__.output_array.output_ptr": 99, "__main__.output_array.value": 97 } }, "hints": [], "inst": { "end_col": 36, "end_line": 341, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 46, "end_line": 342, "input_file": { "filename": "src/differ.cairo" }, "start_col": 36, "start_line": 342 }, "While expanding the reference 'output_ptr' in:" ], "start_col": 22, "start_line": 341 } }, "199": { "accessible_scopes": [ "__main__", "__main__.output_array" ], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 2 }, "reference_ids": { "__main__.output_array.__temp0": 98, "__main__.output_array.array": 94, "__main__.output_array.len": 95, "__main__.output_array.output_ptr": 99, "__main__.output_array.value": 97 } }, "hints": [], "inst": { "end_col": 57, "end_line": 342, "input_file": { "filename": "src/differ.cairo" }, "start_col": 48, "start_line": 342 } }, "201": { "accessible_scopes": [ "__main__", "__main__.output_array" ], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 3 }, "reference_ids": { "__main__.output_array.__temp0": 98, "__main__.output_array.array": 94, "__main__.output_array.len": 95, "__main__.output_array.output_ptr": 99, "__main__.output_array.value": 97 } }, "hints": [], "inst": { "end_col": 66, "end_line": 342, "input_file": { "filename": "src/differ.cairo" }, "start_col": 59, "start_line": 342 } }, "203": { "accessible_scopes": [ "__main__", "__main__.output_array" ], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 4 }, "reference_ids": { "__main__.output_array.__temp0": 98, "__main__.output_array.array": 94, "__main__.output_array.len": 95, "__main__.output_array.output_ptr": 99, "__main__.output_array.value": 97 } }, "hints": [], "inst": { "end_col": 67, "end_line": 342, "input_file": { "filename": "src/differ.cairo" }, "start_col": 12, "start_line": 342 } }, "205": { "accessible_scopes": [ "__main__", "__main__.output_array" ], "flow_tracking_data": { "ap_tracking": { "group": 25, "offset": 0 }, "reference_ids": { "__main__.output_array.__temp0": 98, "__main__.output_array.array": 94, "__main__.output_array.len": 95, "__main__.output_array.output_ptr": 100, "__main__.output_array.value": 97 } }, "hints": [], "inst": { "end_col": 68, "end_line": 342, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 342 } }, "206": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103 } }, "hints": [], "inst": { "end_col": 18, "end_line": 346, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 346 } }, "208": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 13 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103 } }, "hints": [], "inst": { "end_col": 21, "end_line": 350, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 350 } }, "210": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 27 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.input_config": 105, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103 } }, "hints": [], "inst": { "end_col": 34, "end_line": 349, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 34, "end_line": 349, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 349 }, "While auto generating local variable for 'input_config'." ], "start_col": 9, "start_line": 349 } }, "211": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 27 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.input_config": 105, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103 } }, "hints": [], "inst": { "end_col": 34, "end_line": 349, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 34, "end_line": 349, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 349 }, "While auto generating local variable for 'input_config'." ], "start_col": 9, "start_line": 349 } }, "212": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 27 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.input_config": 105, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103 } }, "hints": [], "inst": { "end_col": 34, "end_line": 349, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 34, "end_line": 349, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 349 }, "While auto generating local variable for 'input_config'." ], "start_col": 9, "start_line": 349 } }, "213": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 27 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.input_config": 105, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103 } }, "hints": [], "inst": { "end_col": 34, "end_line": 349, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 34, "end_line": 349, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 349 }, "While auto generating local variable for 'input_config'." ], "start_col": 9, "start_line": 349 } }, "214": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 27 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.input_config": 106, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103 } }, "hints": [], "inst": { "end_col": 28, "end_line": 354, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 354 } }, "216": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 33 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103 } }, "hints": [], "inst": { "end_col": 30, "end_line": 358, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 358 } }, "218": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 39 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103, "__main__.main.storage_updates": 109, "__main__.main.storage_updates_len": 110 } }, "hints": [], "inst": { "end_col": 41, "end_line": 356, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 41, "end_line": 356, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 356 }, "While auto generating local variable for 'storage_updates'." ], "start_col": 9, "start_line": 356 } }, "219": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 39 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 110 } }, "hints": [], "inst": { "end_col": 34, "end_line": 357, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 34, "end_line": 357, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 357 }, "While auto generating local variable for 'storage_updates_len'." ], "start_col": 9, "start_line": 357 } }, "220": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 39 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 31, "end_line": 362, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 362 } }, "222": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 45 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 113, "__main__.main.contract_updates_len": 114, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 43, "end_line": 360, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 43, "end_line": 360, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 360 }, "While auto generating local variable for 'contract_updates'." ], "start_col": 9, "start_line": 360 } }, "223": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 45 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 114, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 35, "end_line": 361, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 35, "end_line": 361, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 361 }, "While auto generating local variable for 'contract_updates_len'." ], "start_col": 9, "start_line": 361 } }, "224": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 45 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 31, "end_line": 366, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 366 } }, "226": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 51 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 117, "__main__.main.declared_classes_len": 118, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 42, "end_line": 364, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 42, "end_line": 364, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 364 }, "While auto generating local variable for 'declared_classes'." ], "start_col": 9, "start_line": 364 } }, "227": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 51 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 118, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 35, "end_line": 365, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 35, "end_line": 365, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 365 }, "While auto generating local variable for 'declared_classes_len'." ], "start_col": 9, "start_line": 365 } }, "228": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 51 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 56, "end_line": 345, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 43, "end_line": 368, "input_file": { "filename": "src/differ.cairo" }, "start_col": 31, "start_line": 368 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 30, "start_line": 345 } }, "229": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 52 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 37, "end_line": 369, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 369 } }, "230": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 53 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 64, "end_line": 369, "input_file": { "filename": "src/differ.cairo" }, "start_col": 39, "start_line": 369 } }, "231": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 54 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 6, "end_line": 370, "input_file": { "filename": "src/differ.cairo" }, "start_col": 16, "start_line": 368 } }, "233": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 58 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 121, "__main__.main.range_check_ptr": 103, "__main__.main.res": 122, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 37, "end_line": 372, "input_file": { "filename": "src/differ.cairo" }, "start_col": 14, "start_line": 372 } }, "234": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 59 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 121, "__main__.main.range_check_ptr": 103, "__main__.main.res": 122, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 6, "end_line": 373, "input_file": { "filename": "src/differ.cairo" }, "start_col": 16, "start_line": 371 } }, "236": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 63 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 123, "__main__.main.range_check_ptr": 103, "__main__.main.res": 124, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 38, "end_line": 375, "input_file": { "filename": "src/differ.cairo" }, "start_col": 14, "start_line": 375 } }, "237": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 64 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 123, "__main__.main.range_check_ptr": 103, "__main__.main.res": 124, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 6, "end_line": 376, "input_file": { "filename": "src/differ.cairo" }, "start_col": 16, "start_line": 374 } }, "239": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 68 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 125, "__main__.main.range_check_ptr": 103, "__main__.main.res": 126, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 37, "end_line": 352, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 22, "end_line": 379, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 379 }, "While expanding the reference 'nonce_updates' in:" ], "start_col": 9, "start_line": 352 } }, "240": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 69 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 125, "__main__.main.range_check_ptr": 103, "__main__.main.res": 126, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 32, "end_line": 353, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 380, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 380 }, "While expanding the reference 'nonce_updates_len' in:" ], "start_col": 9, "start_line": 353 } }, "241": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 70 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 125, "__main__.main.range_check_ptr": 103, "__main__.main.res": 126, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 6, "end_line": 381, "input_file": { "filename": "src/differ.cairo" }, "start_col": 16, "start_line": 377 } }, "243": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 27, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 127, "__main__.main.range_check_ptr": 103, "__main__.main.res": 128, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 41, "end_line": 356, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 41, "end_line": 356, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 24, "end_line": 384, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 384 }, "While expanding the reference 'storage_updates' in:" ], "start_col": 9, "start_line": 356 }, "While auto generating local variable for 'storage_updates'." ], "start_col": 9, "start_line": 356 } }, "244": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 27, "offset": 1 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 127, "__main__.main.range_check_ptr": 103, "__main__.main.res": 128, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 34, "end_line": 357, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 34, "end_line": 357, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 28, "end_line": 385, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 385 }, "While expanding the reference 'storage_updates_len' in:" ], "start_col": 9, "start_line": 357 }, "While auto generating local variable for 'storage_updates_len'." ], "start_col": 9, "start_line": 357 } }, "245": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 27, "offset": 2 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 127, "__main__.main.range_check_ptr": 103, "__main__.main.res": 128, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 6, "end_line": 386, "input_file": { "filename": "src/differ.cairo" }, "start_col": 16, "start_line": 382 } }, "247": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 28, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 129, "__main__.main.range_check_ptr": 103, "__main__.main.res": 130, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 43, "end_line": 360, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 43, "end_line": 360, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 25, "end_line": 389, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 389 }, "While expanding the reference 'contract_updates' in:" ], "start_col": 9, "start_line": 360 }, "While auto generating local variable for 'contract_updates'." ], "start_col": 9, "start_line": 360 } }, "248": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 28, "offset": 1 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 129, "__main__.main.range_check_ptr": 103, "__main__.main.res": 130, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 35, "end_line": 361, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 35, "end_line": 361, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 29, "end_line": 390, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 390 }, "While expanding the reference 'contract_updates_len' in:" ], "start_col": 9, "start_line": 361 }, "While auto generating local variable for 'contract_updates_len'." ], "start_col": 9, "start_line": 361 } }, "249": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 28, "offset": 2 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 129, "__main__.main.range_check_ptr": 103, "__main__.main.res": 130, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 6, "end_line": 391, "input_file": { "filename": "src/differ.cairo" }, "start_col": 16, "start_line": 387 } }, "251": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 131, "__main__.main.range_check_ptr": 103, "__main__.main.res": 132, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 42, "end_line": 364, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 42, "end_line": 364, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 25, "end_line": 394, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 394 }, "While expanding the reference 'declared_classes' in:" ], "start_col": 9, "start_line": 364 }, "While auto generating local variable for 'declared_classes'." ], "start_col": 9, "start_line": 364 } }, "252": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 1 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 131, "__main__.main.range_check_ptr": 103, "__main__.main.res": 132, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 35, "end_line": 365, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 35, "end_line": 365, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 29, "end_line": 395, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 395 }, "While expanding the reference 'declared_classes_len' in:" ], "start_col": 9, "start_line": 365 }, "While auto generating local variable for 'declared_classes_len'." ], "start_col": 9, "start_line": 365 } }, "253": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 2 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 131, "__main__.main.range_check_ptr": 103, "__main__.main.res": 132, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 6, "end_line": 396, "input_file": { "filename": "src/differ.cairo" }, "start_col": 16, "start_line": 392 } }, "255": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 133, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 57, "end_line": 398, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 398 } }, "256": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 133, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 32, "end_line": 399, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 399 } }, "257": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 133, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 54, "end_line": 400, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 400 } }, "258": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 133, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 52, "end_line": 401, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 401 } }, "259": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 133, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 53, "end_line": 402, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 402 } }, "260": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 133, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 63, "end_line": 404, "input_file": { "filename": "src/differ.cairo" }, "start_col": 49, "start_line": 404 } }, "262": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 6 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 133, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 137, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 68, "end_line": 392, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 71, "end_line": 406, "input_file": { "filename": "src/differ.cairo" }, "start_col": 59, "start_line": 406 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 56, "start_line": 392 } }, "263": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 7 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 133, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 137, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 26, "end_line": 405, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 22, "end_line": 407, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 407 }, "While expanding the reference 'world_da_hash' in:" ], "start_col": 25, "start_line": 405 } }, "265": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 8 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 133, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 137, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 25, "end_line": 404, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 32, "end_line": 407, "input_file": { "filename": "src/differ.cairo" }, "start_col": 24, "start_line": 407 }, "While expanding the reference 'world_da' in:" ], "start_col": 10, "start_line": 404 } }, "266": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 9 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 133, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 137, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 45, "end_line": 404, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 46, "end_line": 407, "input_file": { "filename": "src/differ.cairo" }, "start_col": 34, "start_line": 407 }, "While expanding the reference 'world_da_len' in:" ], "start_col": 27, "start_line": 404 } }, "267": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 10 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 133, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 137, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 6, "end_line": 408, "input_file": { "filename": "src/differ.cairo" }, "start_col": 27, "start_line": 406 } }, "269": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 138, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 71, "end_line": 406, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 71, "end_line": 406, "input_file": { "filename": "src/differ.cairo" }, "start_col": 59, "start_line": 406 }, "While auto generating local variable for 'pedersen_ptr'." ], "start_col": 59, "start_line": 406 } }, "270": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 42, "end_line": 410, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 410 } }, "271": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 141, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 23, "end_line": 419, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 419 } }, "273": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 10 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 144, "__main__.main.message_to_appchain_segment_len": 145, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 141, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 46, "end_line": 418, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 46, "end_line": 418, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 418 }, "While auto generating local variable for 'message_to_appchain_segment_len'." ], "start_col": 9, "start_line": 418 } }, "274": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 10 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 144, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 141, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 43, "end_line": 417, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 43, "end_line": 417, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 417 }, "While auto generating local variable for 'message_to_appchain_segment'." ], "start_col": 9, "start_line": 417 } }, "275": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 10 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 141, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 60, "end_line": 421, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 421 } }, "276": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 10 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 148, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 36, "end_line": 422, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 39, "end_line": 423, "input_file": { "filename": "src/differ.cairo" }, "start_col": 29, "start_line": 423 }, "While expanding the reference 'output_ptr' in:" ], "start_col": 22, "start_line": 422 } }, "278": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 11 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 148, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 43, "end_line": 415, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 68, "end_line": 423, "input_file": { "filename": "src/differ.cairo" }, "start_col": 41, "start_line": 423 }, "While expanding the reference 'message_to_starknet_segment' in:" ], "start_col": 9, "start_line": 415 } }, "279": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 12 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 148, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 46, "end_line": 416, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 101, "end_line": 423, "input_file": { "filename": "src/differ.cairo" }, "start_col": 70, "start_line": 423 }, "While expanding the reference 'message_to_starknet_segment_len' in:" ], "start_col": 9, "start_line": 416 } }, "280": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 13 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 148, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 102, "end_line": 423, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 423 } }, "282": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 32, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 149, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 60, "end_line": 424, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 424 } }, "283": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 32, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 150, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 36, "end_line": 425, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 39, "end_line": 426, "input_file": { "filename": "src/differ.cairo" }, "start_col": 29, "start_line": 426 }, "While expanding the reference 'output_ptr' in:" ], "start_col": 22, "start_line": 425 } }, "285": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 32, "offset": 1 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 150, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 43, "end_line": 417, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 43, "end_line": 417, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 68, "end_line": 426, "input_file": { "filename": "src/differ.cairo" }, "start_col": 41, "start_line": 426 }, "While expanding the reference 'message_to_appchain_segment' in:" ], "start_col": 9, "start_line": 417 }, "While auto generating local variable for 'message_to_appchain_segment'." ], "start_col": 9, "start_line": 417 } }, "286": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 32, "offset": 2 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 150, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 46, "end_line": 418, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 46, "end_line": 418, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 101, "end_line": 426, "input_file": { "filename": "src/differ.cairo" }, "start_col": 70, "start_line": 426 }, "While expanding the reference 'message_to_appchain_segment_len' in:" ], "start_col": 9, "start_line": 418 }, "While auto generating local variable for 'message_to_appchain_segment_len'." ], "start_col": 9, "start_line": 418 } }, "287": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 32, "offset": 3 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 150, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 102, "end_line": 426, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 426 } }, "289": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 33, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 151, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 71, "end_line": 406, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 71, "end_line": 406, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 56, "end_line": 345, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 15, "end_line": 428, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 428 }, "While trying to retrieve the implicit argument 'pedersen_ptr' in:" ], "start_col": 30, "start_line": 345 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 59, "start_line": 406 }, "While auto generating local variable for 'pedersen_ptr'." ], "start_col": 59, "start_line": 406 } }, "290": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 33, "offset": 1 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 151, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 79, "end_line": 345, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 79, "end_line": 345, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 15, "end_line": 428, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 428 }, "While trying to retrieve the implicit argument 'range_check_ptr' in:" ], "start_col": 58, "start_line": 345 }, "While expanding the reference 'range_check_ptr' in:" ], "start_col": 58, "start_line": 345 } }, "291": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 33, "offset": 2 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 151, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 99, "end_line": 345, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 99, "end_line": 345, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 15, "end_line": 428, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 428 }, "While trying to retrieve the implicit argument 'bitwise_ptr' in:" ], "start_col": 81, "start_line": 345 }, "While expanding the reference 'bitwise_ptr' in:" ], "start_col": 81, "start_line": 345 } }, "292": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 33, "offset": 3 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 151, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 15, "end_line": 428, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 428 } } } }, "hints": { "14": [ { "accessible_scopes": [ "__main__", "__main__.get_hashes" ], "code": "ids.prev_state_root = int(program_input[\"prev_state_root\"])\nids.block_number = int(program_input[\"block_number\"])\nids.block_hash = int(program_input[\"block_hash\"])\nids.config_hash = int(program_input[\"config_hash\"])", "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 8 }, "reference_ids": { "__main__.get_hashes.block_hash": 8, "__main__.get_hashes.block_number": 7, "__main__.get_hashes.config_hash": 9, "__main__.get_hashes.input_config": 5, "__main__.get_hashes.prev_state_root": 6 } } } ], "21": [ { "accessible_scopes": [ "__main__", "__main__.get_world_da" ], "code": "world_da = [int(wd) for wd in program_input[\"world_da\"]]\nids.world_da = segments.gen_arg(world_da)\nids.world_da_len = len(world_da)", "flow_tracking_data": { "ap_tracking": { "group": 4, "offset": 2 }, "reference_ids": { "__main__.get_world_da.world_da": 10, "__main__.get_world_da.world_da_len": 11 } } } ], "45": [ { "accessible_scopes": [ "__main__", "__main__.get_messages" ], "code": "message_to_starknet_segment = \\\n [int(x) for x in program_input[\"message_to_starknet_segment\"]]\nmessage_to_appchain_segment = \\\n[int(x) for x in program_input[\"message_to_appchain_segment\"]]\n\nids.message_to_starknet_segment = \\\n segments.gen_arg(message_to_starknet_segment)\nids.message_to_starknet_segment_len = \\\n len(message_to_starknet_segment)\nids.message_to_appchain_segment = \\\n segments.gen_arg(message_to_appchain_segment)\nids.message_to_appchain_segment_len = \\\n len(message_to_appchain_segment)", "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 4 }, "reference_ids": { "__main__.get_messages.message_to_appchain_segment": 22, "__main__.get_messages.message_to_appchain_segment_len": 23, "__main__.get_messages.message_to_starknet_segment": 20, "__main__.get_messages.message_to_starknet_segment_len": 21 } } } ], "52": [ { "accessible_scopes": [ "__main__", "__main__.get_nonce_updates" ], "code": "program_input_nonce_updates = program_input[\"nonce_updates\"]\n\nnonce_updates = [\n (\n int(key),\n int(value),\n )\n for key, value in program_input_nonce_updates.items()\n]\nids.nonce_updates = segments.gen_arg(nonce_updates)\nids.nonce_updates_len = len(nonce_updates)", "flow_tracking_data": { "ap_tracking": { "group": 8, "offset": 2 }, "reference_ids": { "__main__.get_nonce_updates.nonce_updates": 24, "__main__.get_nonce_updates.nonce_updates_len": 25 } } } ], "86": [ { "accessible_scopes": [ "__main__", "__main__.get_storage_updates" ], "code": "program_input_storage_updates = program_input[\"storage_updates\"]\n\nstorage_updates = [\n (\n int(contract),\n int(key),\n int(value),\n )\n for \n contract, update in \n program_input_storage_updates.items() \n for \n key, value in update.items()\n]\nids.storage_updates = segments.gen_arg(storage_updates)\nids.storage_updates_len = len(storage_updates)", "flow_tracking_data": { "ap_tracking": { "group": 12, "offset": 2 }, "reference_ids": { "__main__.get_storage_updates.storage_updates": 41, "__main__.get_storage_updates.storage_updates_len": 42 } } } ], "123": [ { "accessible_scopes": [ "__main__", "__main__.get_contract_updates" ], "code": "program_input_contract_updates = program_input[\"contract_updates\"]\n\ncontract_updates = [\n (\n int(key),\n int(value),\n )\n for key, value in program_input_contract_updates.items()\n]\nids.contract_updates = segments.gen_arg(contract_updates)\nids.contract_updates_len = len(contract_updates)", "flow_tracking_data": { "ap_tracking": { "group": 16, "offset": 2 }, "reference_ids": { "__main__.get_contract_updates.contract_updates": 60, "__main__.get_contract_updates.contract_updates_len": 61 } } } ], "157": [ { "accessible_scopes": [ "__main__", "__main__.get_declared_classes" ], "code": "program_input_declared_classes = program_input[\"declared_classes\"]\n\ndeclared_classes = [\n (\n int(key),\n int(value),\n )\n for key, value in program_input_declared_classes.items()\n]\nids.declared_classes = segments.gen_arg(declared_classes)\nids.declared_classes_len = len(declared_classes)", "flow_tracking_data": { "ap_tracking": { "group": 20, "offset": 2 }, "reference_ids": { "__main__.get_declared_classes.declared_classes": 77, "__main__.get_declared_classes.declared_classes_len": 78 } } } ] }, "identifiers": { "__main__.ContractUpdate": { "full_name": "__main__.ContractUpdate", "members": { "class_hash": { "cairo_type": "felt", "offset": 1 }, "contract_address": { "cairo_type": "felt", "offset": 0 } }, "size": 2, "type": "struct" }, "__main__.DeclaredClass": { "full_name": "__main__.DeclaredClass", "members": { "class_hash": { "cairo_type": "felt", "offset": 0 }, "compiled_class_hash": { "cairo_type": "felt", "offset": 1 } }, "size": 2, "type": "struct" }, "__main__.HashBuiltin": { "destination": "starkware.cairo.common.cairo_builtins.HashBuiltin", "type": "alias" }, "__main__.InputConfig": { "full_name": "__main__.InputConfig", "members": { "block_hash": { "cairo_type": "felt", "offset": 2 }, "block_number": { "cairo_type": "felt", "offset": 1 }, "config_hash": { "cairo_type": "felt", "offset": 3 }, "prev_state_root": { "cairo_type": "felt", "offset": 0 } }, "size": 4, "type": "struct" }, "__main__.NonceUpdate": { "full_name": "__main__.NonceUpdate", "members": { "contract_address": { "cairo_type": "felt", "offset": 0 }, "nonce": { "cairo_type": "felt", "offset": 1 } }, "size": 2, "type": "struct" }, "__main__.StorageUpdate": { "full_name": "__main__.StorageUpdate", "members": { "contract_address": { "cairo_type": "felt", "offset": 0 }, "storage_key": { "cairo_type": "felt", "offset": 1 }, "storage_value": { "cairo_type": "felt", "offset": 2 } }, "size": 3, "type": "struct" }, "__main__.__end__": { "pc": 4, "type": "label" }, "__main__.__start__": { "pc": 0, "type": "label" }, "__main__.get_contract_updates": { "decorators": [], "pc": 121, "type": "function" }, "__main__.get_contract_updates.Args": { "full_name": "__main__.get_contract_updates.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_contract_updates.ImplicitArgs": { "full_name": "__main__.get_contract_updates.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_contract_updates.Return": { "cairo_type": "(contract_updates: __main__.ContractUpdate**, contract_updates_len: felt)", "type": "type_definition" }, "__main__.get_contract_updates.SIZEOF_LOCALS": { "type": "const", "value": 2 }, "__main__.get_contract_updates.contract_updates": { "cairo_type": "__main__.ContractUpdate**", "full_name": "__main__.get_contract_updates.contract_updates", "references": [ { "ap_tracking_data": { "group": 16, "offset": 2 }, "pc": 123, "value": "[cast(fp, __main__.ContractUpdate***)]" } ], "type": "reference" }, "__main__.get_contract_updates.contract_updates_len": { "cairo_type": "felt", "full_name": "__main__.get_contract_updates.contract_updates_len", "references": [ { "ap_tracking_data": { "group": 16, "offset": 2 }, "pc": 123, "value": "[cast(fp + 1, felt*)]" } ], "type": "reference" }, "__main__.get_declared_classes": { "decorators": [], "pc": 155, "type": "function" }, "__main__.get_declared_classes.Args": { "full_name": "__main__.get_declared_classes.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_declared_classes.ImplicitArgs": { "full_name": "__main__.get_declared_classes.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_declared_classes.Return": { "cairo_type": "(declared_classes: __main__.DeclaredClass**, declared_classes_len: felt)", "type": "type_definition" }, "__main__.get_declared_classes.SIZEOF_LOCALS": { "type": "const", "value": 2 }, "__main__.get_declared_classes.declared_classes": { "cairo_type": "__main__.DeclaredClass**", "full_name": "__main__.get_declared_classes.declared_classes", "references": [ { "ap_tracking_data": { "group": 20, "offset": 2 }, "pc": 157, "value": "[cast(fp, __main__.DeclaredClass***)]" } ], "type": "reference" }, "__main__.get_declared_classes.declared_classes_len": { "cairo_type": "felt", "full_name": "__main__.get_declared_classes.declared_classes_len", "references": [ { "ap_tracking_data": { "group": 20, "offset": 2 }, "pc": 157, "value": "[cast(fp + 1, felt*)]" } ], "type": "reference" }, "__main__.get_hashes": { "decorators": [], "pc": 12, "type": "function" }, "__main__.get_hashes.Args": { "full_name": "__main__.get_hashes.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_hashes.ImplicitArgs": { "full_name": "__main__.get_hashes.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_hashes.Return": { "cairo_type": "(input_config: __main__.InputConfig)", "type": "type_definition" }, "__main__.get_hashes.SIZEOF_LOCALS": { "type": "const", "value": 8 }, "__main__.get_hashes.block_hash": { "cairo_type": "felt", "full_name": "__main__.get_hashes.block_hash", "references": [ { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 6, felt*)]" } ], "type": "reference" }, "__main__.get_hashes.block_number": { "cairo_type": "felt", "full_name": "__main__.get_hashes.block_number", "references": [ { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 5, felt*)]" } ], "type": "reference" }, "__main__.get_hashes.config_hash": { "cairo_type": "felt", "full_name": "__main__.get_hashes.config_hash", "references": [ { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 7, felt*)]" } ], "type": "reference" }, "__main__.get_hashes.input_config": { "cairo_type": "__main__.InputConfig", "full_name": "__main__.get_hashes.input_config", "references": [ { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp, __main__.InputConfig*)]" } ], "type": "reference" }, "__main__.get_hashes.prev_state_root": { "cairo_type": "felt", "full_name": "__main__.get_hashes.prev_state_root", "references": [ { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 4, felt*)]" } ], "type": "reference" }, "__main__.get_messages": { "decorators": [], "pc": 43, "type": "function" }, "__main__.get_messages.Args": { "full_name": "__main__.get_messages.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_messages.ImplicitArgs": { "full_name": "__main__.get_messages.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_messages.Return": { "cairo_type": "(message_to_starknet_segment: felt*, message_to_starknet_segment_len: felt, message_to_appchain_segment: felt*, message_to_appchain_segment_len: felt)", "type": "type_definition" }, "__main__.get_messages.SIZEOF_LOCALS": { "type": "const", "value": 4 }, "__main__.get_messages.message_to_appchain_segment": { "cairo_type": "felt*", "full_name": "__main__.get_messages.message_to_appchain_segment", "references": [ { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp + 2, felt**)]" } ], "type": "reference" }, "__main__.get_messages.message_to_appchain_segment_len": { "cairo_type": "felt", "full_name": "__main__.get_messages.message_to_appchain_segment_len", "references": [ { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp + 3, felt*)]" } ], "type": "reference" }, "__main__.get_messages.message_to_starknet_segment": { "cairo_type": "felt*", "full_name": "__main__.get_messages.message_to_starknet_segment", "references": [ { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp, felt**)]" } ], "type": "reference" }, "__main__.get_messages.message_to_starknet_segment_len": { "cairo_type": "felt", "full_name": "__main__.get_messages.message_to_starknet_segment_len", "references": [ { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp + 1, felt*)]" } ], "type": "reference" }, "__main__.get_nonce_updates": { "decorators": [], "pc": 50, "type": "function" }, "__main__.get_nonce_updates.Args": { "full_name": "__main__.get_nonce_updates.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_nonce_updates.ImplicitArgs": { "full_name": "__main__.get_nonce_updates.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_nonce_updates.Return": { "cairo_type": "(nonce_updates: __main__.NonceUpdate**, nonce_updates_len: felt)", "type": "type_definition" }, "__main__.get_nonce_updates.SIZEOF_LOCALS": { "type": "const", "value": 2 }, "__main__.get_nonce_updates.nonce_updates": { "cairo_type": "__main__.NonceUpdate**", "full_name": "__main__.get_nonce_updates.nonce_updates", "references": [ { "ap_tracking_data": { "group": 8, "offset": 2 }, "pc": 52, "value": "[cast(fp, __main__.NonceUpdate***)]" } ], "type": "reference" }, "__main__.get_nonce_updates.nonce_updates_len": { "cairo_type": "felt", "full_name": "__main__.get_nonce_updates.nonce_updates_len", "references": [ { "ap_tracking_data": { "group": 8, "offset": 2 }, "pc": 52, "value": "[cast(fp + 1, felt*)]" } ], "type": "reference" }, "__main__.get_storage_updates": { "decorators": [], "pc": 84, "type": "function" }, "__main__.get_storage_updates.Args": { "full_name": "__main__.get_storage_updates.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_storage_updates.ImplicitArgs": { "full_name": "__main__.get_storage_updates.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_storage_updates.Return": { "cairo_type": "(storage_updates: __main__.StorageUpdate**, storage_updates_len: felt)", "type": "type_definition" }, "__main__.get_storage_updates.SIZEOF_LOCALS": { "type": "const", "value": 2 }, "__main__.get_storage_updates.storage_updates": { "cairo_type": "__main__.StorageUpdate**", "full_name": "__main__.get_storage_updates.storage_updates", "references": [ { "ap_tracking_data": { "group": 12, "offset": 2 }, "pc": 86, "value": "[cast(fp, __main__.StorageUpdate***)]" } ], "type": "reference" }, "__main__.get_storage_updates.storage_updates_len": { "cairo_type": "felt", "full_name": "__main__.get_storage_updates.storage_updates_len", "references": [ { "ap_tracking_data": { "group": 12, "offset": 2 }, "pc": 86, "value": "[cast(fp + 1, felt*)]" } ], "type": "reference" }, "__main__.get_world_da": { "decorators": [], "pc": 19, "type": "function" }, "__main__.get_world_da.Args": { "full_name": "__main__.get_world_da.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_world_da.ImplicitArgs": { "full_name": "__main__.get_world_da.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_world_da.Return": { "cairo_type": "(world_da: felt*, world_da_len: felt)", "type": "type_definition" }, "__main__.get_world_da.SIZEOF_LOCALS": { "type": "const", "value": 2 }, "__main__.get_world_da.world_da": { "cairo_type": "felt*", "full_name": "__main__.get_world_da.world_da", "references": [ { "ap_tracking_data": { "group": 4, "offset": 2 }, "pc": 21, "value": "[cast(fp, felt**)]" } ], "type": "reference" }, "__main__.get_world_da.world_da_len": { "cairo_type": "felt", "full_name": "__main__.get_world_da.world_da_len", "references": [ { "ap_tracking_data": { "group": 4, "offset": 2 }, "pc": 21, "value": "[cast(fp + 1, felt*)]" } ], "type": "reference" }, "__main__.hash2": { "destination": "starkware.cairo.common.hash.hash2", "type": "alias" }, "__main__.hash_contract_update": { "decorators": [], "pc": 126, "type": "function" }, "__main__.hash_contract_update.Args": { "full_name": "__main__.hash_contract_update.Args", "members": { "contract_update": { "cairo_type": "__main__.ContractUpdate*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_contract_update.ImplicitArgs": { "full_name": "__main__.hash_contract_update.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_contract_update.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_contract_update.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_contract_update.contract_update": { "cairo_type": "__main__.ContractUpdate*", "full_name": "__main__.hash_contract_update.contract_update", "references": [ { "ap_tracking_data": { "group": 17, "offset": 0 }, "pc": 126, "value": "[cast(fp + (-3), __main__.ContractUpdate**)]" } ], "type": "reference" }, "__main__.hash_contract_update.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_contract_update.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 17, "offset": 0 }, "pc": 126, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 17, "offset": 7 }, "pc": 131, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_contract_update.res": { "cairo_type": "felt", "full_name": "__main__.hash_contract_update.res", "references": [ { "ap_tracking_data": { "group": 17, "offset": 0 }, "pc": 126, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 17, "offset": 7 }, "pc": 131, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_contract_updates_loop": { "decorators": [], "pc": 132, "type": "function" }, "__main__.hash_contract_updates_loop.Args": { "full_name": "__main__.hash_contract_updates_loop.Args", "members": { "contract_updates": { "cairo_type": "__main__.ContractUpdate**", "offset": 1 }, "contract_updates_len": { "cairo_type": "felt", "offset": 2 }, "res": { "cairo_type": "felt", "offset": 0 } }, "size": 3, "type": "struct" }, "__main__.hash_contract_updates_loop.ImplicitArgs": { "full_name": "__main__.hash_contract_updates_loop.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_contract_updates_loop.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_contract_updates_loop.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_contract_updates_loop.contract_update": { "cairo_type": "__main__.ContractUpdate*", "full_name": "__main__.hash_contract_updates_loop.contract_update", "references": [ { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 139, "value": "[cast([fp + (-4)], __main__.ContractUpdate**)]" } ], "type": "reference" }, "__main__.hash_contract_updates_loop.contract_updates": { "cairo_type": "__main__.ContractUpdate**", "full_name": "__main__.hash_contract_updates_loop.contract_updates", "references": [ { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-4), __main__.ContractUpdate***)]" } ], "type": "reference" }, "__main__.hash_contract_updates_loop.contract_updates_len": { "cairo_type": "felt", "full_name": "__main__.hash_contract_updates_loop.contract_updates_len", "references": [ { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "__main__.hash_contract_updates_loop.hash": { "cairo_type": "felt", "full_name": "__main__.hash_contract_updates_loop.hash", "references": [ { "ap_tracking_data": { "group": 18, "offset": 11 }, "pc": 143, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_contract_updates_loop.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_contract_updates_loop.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 18, "offset": 11 }, "pc": 143, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 18, "offset": 18 }, "pc": 148, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 19, "offset": 0 }, "pc": 154, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_contract_updates_loop.res": { "cairo_type": "felt", "full_name": "__main__.hash_contract_updates_loop.res", "references": [ { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 18, "offset": 18 }, "pc": 148, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_declared_class": { "decorators": [], "pc": 160, "type": "function" }, "__main__.hash_declared_class.Args": { "full_name": "__main__.hash_declared_class.Args", "members": { "declared_class": { "cairo_type": "__main__.DeclaredClass*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_declared_class.ImplicitArgs": { "full_name": "__main__.hash_declared_class.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_declared_class.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_declared_class.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_declared_class.declared_class": { "cairo_type": "__main__.DeclaredClass*", "full_name": "__main__.hash_declared_class.declared_class", "references": [ { "ap_tracking_data": { "group": 21, "offset": 0 }, "pc": 160, "value": "[cast(fp + (-3), __main__.DeclaredClass**)]" } ], "type": "reference" }, "__main__.hash_declared_class.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_declared_class.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 21, "offset": 0 }, "pc": 160, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 21, "offset": 7 }, "pc": 165, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_declared_class.res": { "cairo_type": "felt", "full_name": "__main__.hash_declared_class.res", "references": [ { "ap_tracking_data": { "group": 21, "offset": 0 }, "pc": 160, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 21, "offset": 7 }, "pc": 165, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_declared_classes_loop": { "decorators": [], "pc": 166, "type": "function" }, "__main__.hash_declared_classes_loop.Args": { "full_name": "__main__.hash_declared_classes_loop.Args", "members": { "declared_classes": { "cairo_type": "__main__.DeclaredClass**", "offset": 1 }, "declared_classes_len": { "cairo_type": "felt", "offset": 2 }, "res": { "cairo_type": "felt", "offset": 0 } }, "size": 3, "type": "struct" }, "__main__.hash_declared_classes_loop.ImplicitArgs": { "full_name": "__main__.hash_declared_classes_loop.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_declared_classes_loop.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_declared_classes_loop.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_declared_classes_loop.declared_class": { "cairo_type": "__main__.DeclaredClass*", "full_name": "__main__.hash_declared_classes_loop.declared_class", "references": [ { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 173, "value": "[cast([fp + (-4)], __main__.DeclaredClass**)]" } ], "type": "reference" }, "__main__.hash_declared_classes_loop.declared_classes": { "cairo_type": "__main__.DeclaredClass**", "full_name": "__main__.hash_declared_classes_loop.declared_classes", "references": [ { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-4), __main__.DeclaredClass***)]" } ], "type": "reference" }, "__main__.hash_declared_classes_loop.declared_classes_len": { "cairo_type": "felt", "full_name": "__main__.hash_declared_classes_loop.declared_classes_len", "references": [ { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "__main__.hash_declared_classes_loop.hash": { "cairo_type": "felt", "full_name": "__main__.hash_declared_classes_loop.hash", "references": [ { "ap_tracking_data": { "group": 22, "offset": 11 }, "pc": 177, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_declared_classes_loop.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_declared_classes_loop.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 22, "offset": 11 }, "pc": 177, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 22, "offset": 18 }, "pc": 182, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 23, "offset": 0 }, "pc": 188, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_declared_classes_loop.res": { "cairo_type": "felt", "full_name": "__main__.hash_declared_classes_loop.res", "references": [ { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 22, "offset": 18 }, "pc": 182, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_nonce_update": { "decorators": [], "pc": 55, "type": "function" }, "__main__.hash_nonce_update.Args": { "full_name": "__main__.hash_nonce_update.Args", "members": { "nonce_update": { "cairo_type": "__main__.NonceUpdate*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_nonce_update.ImplicitArgs": { "full_name": "__main__.hash_nonce_update.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_nonce_update.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_nonce_update.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_nonce_update.nonce_update": { "cairo_type": "__main__.NonceUpdate*", "full_name": "__main__.hash_nonce_update.nonce_update", "references": [ { "ap_tracking_data": { "group": 9, "offset": 0 }, "pc": 55, "value": "[cast(fp + (-3), __main__.NonceUpdate**)]" } ], "type": "reference" }, "__main__.hash_nonce_update.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_nonce_update.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 9, "offset": 0 }, "pc": 55, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 9, "offset": 7 }, "pc": 60, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_nonce_update.res": { "cairo_type": "felt", "full_name": "__main__.hash_nonce_update.res", "references": [ { "ap_tracking_data": { "group": 9, "offset": 0 }, "pc": 55, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 9, "offset": 7 }, "pc": 60, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_nonce_updates_loop": { "decorators": [], "pc": 61, "type": "function" }, "__main__.hash_nonce_updates_loop.Args": { "full_name": "__main__.hash_nonce_updates_loop.Args", "members": { "nonce_updates": { "cairo_type": "__main__.NonceUpdate**", "offset": 1 }, "nonce_updates_len": { "cairo_type": "felt", "offset": 2 }, "res": { "cairo_type": "felt", "offset": 0 } }, "size": 3, "type": "struct" }, "__main__.hash_nonce_updates_loop.ImplicitArgs": { "full_name": "__main__.hash_nonce_updates_loop.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_nonce_updates_loop.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_nonce_updates_loop.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_nonce_updates_loop.hash": { "cairo_type": "felt", "full_name": "__main__.hash_nonce_updates_loop.hash", "references": [ { "ap_tracking_data": { "group": 10, "offset": 11 }, "pc": 72, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_nonce_updates_loop.nonce_update": { "cairo_type": "__main__.NonceUpdate*", "full_name": "__main__.hash_nonce_updates_loop.nonce_update", "references": [ { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 68, "value": "[cast([fp + (-4)], __main__.NonceUpdate**)]" } ], "type": "reference" }, "__main__.hash_nonce_updates_loop.nonce_updates": { "cairo_type": "__main__.NonceUpdate**", "full_name": "__main__.hash_nonce_updates_loop.nonce_updates", "references": [ { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-4), __main__.NonceUpdate***)]" } ], "type": "reference" }, "__main__.hash_nonce_updates_loop.nonce_updates_len": { "cairo_type": "felt", "full_name": "__main__.hash_nonce_updates_loop.nonce_updates_len", "references": [ { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "__main__.hash_nonce_updates_loop.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_nonce_updates_loop.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 10, "offset": 11 }, "pc": 72, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 10, "offset": 18 }, "pc": 77, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 11, "offset": 0 }, "pc": 83, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_nonce_updates_loop.res": { "cairo_type": "felt", "full_name": "__main__.hash_nonce_updates_loop.res", "references": [ { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 10, "offset": 18 }, "pc": 77, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_storage_update": { "decorators": [], "pc": 89, "type": "function" }, "__main__.hash_storage_update.Args": { "full_name": "__main__.hash_storage_update.Args", "members": { "storage_update": { "cairo_type": "__main__.StorageUpdate*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_storage_update.ImplicitArgs": { "full_name": "__main__.hash_storage_update.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_storage_update.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_storage_update.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_storage_update.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_storage_update.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 13, "offset": 0 }, "pc": 89, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 13, "offset": 7 }, "pc": 94, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 13, "offset": 12 }, "pc": 97, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_storage_update.res": { "cairo_type": "felt", "full_name": "__main__.hash_storage_update.res", "references": [ { "ap_tracking_data": { "group": 13, "offset": 0 }, "pc": 89, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 13, "offset": 7 }, "pc": 94, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 13, "offset": 12 }, "pc": 97, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_storage_update.storage_update": { "cairo_type": "__main__.StorageUpdate*", "full_name": "__main__.hash_storage_update.storage_update", "references": [ { "ap_tracking_data": { "group": 13, "offset": 0 }, "pc": 89, "value": "[cast(fp + (-3), __main__.StorageUpdate**)]" } ], "type": "reference" }, "__main__.hash_storage_updates_loop": { "decorators": [], "pc": 98, "type": "function" }, "__main__.hash_storage_updates_loop.Args": { "full_name": "__main__.hash_storage_updates_loop.Args", "members": { "res": { "cairo_type": "felt", "offset": 0 }, "storage_updates": { "cairo_type": "__main__.StorageUpdate**", "offset": 1 }, "storage_updates_len": { "cairo_type": "felt", "offset": 2 } }, "size": 3, "type": "struct" }, "__main__.hash_storage_updates_loop.ImplicitArgs": { "full_name": "__main__.hash_storage_updates_loop.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_storage_updates_loop.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_storage_updates_loop.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_storage_updates_loop.hash": { "cairo_type": "felt", "full_name": "__main__.hash_storage_updates_loop.hash", "references": [ { "ap_tracking_data": { "group": 14, "offset": 16 }, "pc": 109, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_storage_updates_loop.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_storage_updates_loop.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 14, "offset": 16 }, "pc": 109, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 14, "offset": 23 }, "pc": 114, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 15, "offset": 0 }, "pc": 120, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_storage_updates_loop.res": { "cairo_type": "felt", "full_name": "__main__.hash_storage_updates_loop.res", "references": [ { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 14, "offset": 23 }, "pc": 114, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_storage_updates_loop.storage_update": { "cairo_type": "__main__.StorageUpdate*", "full_name": "__main__.hash_storage_updates_loop.storage_update", "references": [ { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 105, "value": "[cast([fp + (-4)], __main__.StorageUpdate**)]" } ], "type": "reference" }, "__main__.hash_storage_updates_loop.storage_updates": { "cairo_type": "__main__.StorageUpdate**", "full_name": "__main__.hash_storage_updates_loop.storage_updates", "references": [ { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-4), __main__.StorageUpdate***)]" } ], "type": "reference" }, "__main__.hash_storage_updates_loop.storage_updates_len": { "cairo_type": "felt", "full_name": "__main__.hash_storage_updates_loop.storage_updates_len", "references": [ { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "__main__.hash_world_da_loop": { "decorators": [], "pc": 24, "type": "function" }, "__main__.hash_world_da_loop.Args": { "full_name": "__main__.hash_world_da_loop.Args", "members": { "res": { "cairo_type": "felt", "offset": 0 }, "world_da": { "cairo_type": "felt*", "offset": 1 }, "world_da_len": { "cairo_type": "felt", "offset": 2 } }, "size": 3, "type": "struct" }, "__main__.hash_world_da_loop.ImplicitArgs": { "full_name": "__main__.hash_world_da_loop.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_world_da_loop.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_world_da_loop.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_world_da_loop.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_world_da_loop.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 5, "offset": 7 }, "pc": 36, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 6, "offset": 0 }, "pc": 42, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_world_da_loop.res": { "cairo_type": "felt", "full_name": "__main__.hash_world_da_loop.res", "references": [ { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 5, "offset": 7 }, "pc": 36, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_world_da_loop.value": { "cairo_type": "felt", "full_name": "__main__.hash_world_da_loop.value", "references": [ { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 31, "value": "[cast([fp + (-4)], felt*)]" } ], "type": "reference" }, "__main__.hash_world_da_loop.world_da": { "cairo_type": "felt*", "full_name": "__main__.hash_world_da_loop.world_da", "references": [ { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-4), felt**)]" } ], "type": "reference" }, "__main__.hash_world_da_loop.world_da_len": { "cairo_type": "felt", "full_name": "__main__.hash_world_da_loop.world_da_len", "references": [ { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "__main__.main": { "decorators": [], "pc": 206, "type": "function" }, "__main__.main.Args": { "full_name": "__main__.main.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.main.ImplicitArgs": { "full_name": "__main__.main.ImplicitArgs", "members": { "bitwise_ptr": { "cairo_type": "felt*", "offset": 3 }, "output_ptr": { "cairo_type": "felt*", "offset": 0 }, "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 1 }, "range_check_ptr": { "cairo_type": "felt", "offset": 2 } }, "size": 4, "type": "struct" }, "__main__.main.Return": { "cairo_type": "()", "type": "type_definition" }, "__main__.main.SIZEOF_LOCALS": { "type": "const", "value": 13 }, "__main__.main.bitwise_ptr": { "cairo_type": "felt*", "full_name": "__main__.main.bitwise_ptr", "references": [ { "ap_tracking_data": { "group": 26, "offset": 0 }, "pc": 206, "value": "[cast(fp + (-3), felt**)]" } ], "type": "reference" }, "__main__.main.contract_updates": { "cairo_type": "__main__.ContractUpdate**", "full_name": "__main__.main.contract_updates", "references": [ { "ap_tracking_data": { "group": 26, "offset": 45 }, "pc": 222, "value": "[cast(ap + (-2), __main__.ContractUpdate***)]" }, { "ap_tracking_data": { "group": 26, "offset": 45 }, "pc": 223, "value": "[cast(fp + 6, __main__.ContractUpdate***)]" } ], "type": "reference" }, "__main__.main.contract_updates_len": { "cairo_type": "felt", "full_name": "__main__.main.contract_updates_len", "references": [ { "ap_tracking_data": { "group": 26, "offset": 45 }, "pc": 222, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 45 }, "pc": 224, "value": "[cast(fp + 7, felt*)]" } ], "type": "reference" }, "__main__.main.declared_classes": { "cairo_type": "__main__.DeclaredClass**", "full_name": "__main__.main.declared_classes", "references": [ { "ap_tracking_data": { "group": 26, "offset": 51 }, "pc": 226, "value": "[cast(ap + (-2), __main__.DeclaredClass***)]" }, { "ap_tracking_data": { "group": 26, "offset": 51 }, "pc": 227, "value": "[cast(fp + 8, __main__.DeclaredClass***)]" } ], "type": "reference" }, "__main__.main.declared_classes_len": { "cairo_type": "felt", "full_name": "__main__.main.declared_classes_len", "references": [ { "ap_tracking_data": { "group": 26, "offset": 51 }, "pc": 226, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 51 }, "pc": 228, "value": "[cast(fp + 9, felt*)]" } ], "type": "reference" }, "__main__.main.input_config": { "cairo_type": "__main__.InputConfig", "full_name": "__main__.main.input_config", "references": [ { "ap_tracking_data": { "group": 26, "offset": 27 }, "pc": 210, "value": "[cast(ap + (-4), __main__.InputConfig*)]" }, { "ap_tracking_data": { "group": 26, "offset": 27 }, "pc": 214, "value": "[cast(fp, __main__.InputConfig*)]" } ], "type": "reference" }, "__main__.main.message_to_appchain_segment": { "cairo_type": "felt*", "full_name": "__main__.main.message_to_appchain_segment", "references": [ { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 273, "value": "[cast(ap + (-2), felt**)]" }, { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 275, "value": "[cast(fp + 12, felt**)]" } ], "type": "reference" }, "__main__.main.message_to_appchain_segment_len": { "cairo_type": "felt", "full_name": "__main__.main.message_to_appchain_segment_len", "references": [ { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 273, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 274, "value": "[cast(fp + 11, felt*)]" } ], "type": "reference" }, "__main__.main.message_to_starknet_segment": { "cairo_type": "felt*", "full_name": "__main__.main.message_to_starknet_segment", "references": [ { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 273, "value": "[cast(ap + (-4), felt**)]" } ], "type": "reference" }, "__main__.main.message_to_starknet_segment_len": { "cairo_type": "felt", "full_name": "__main__.main.message_to_starknet_segment_len", "references": [ { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 273, "value": "[cast(ap + (-3), felt*)]" } ], "type": "reference" }, "__main__.main.nonce_updates": { "cairo_type": "__main__.NonceUpdate**", "full_name": "__main__.main.nonce_updates", "references": [ { "ap_tracking_data": { "group": 26, "offset": 33 }, "pc": 216, "value": "[cast(ap + (-2), __main__.NonceUpdate***)]" } ], "type": "reference" }, "__main__.main.nonce_updates_len": { "cairo_type": "felt", "full_name": "__main__.main.nonce_updates_len", "references": [ { "ap_tracking_data": { "group": 26, "offset": 33 }, "pc": 216, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.main.output_ptr": { "cairo_type": "felt*", "full_name": "__main__.main.output_ptr", "references": [ { "ap_tracking_data": { "group": 26, "offset": 0 }, "pc": 206, "value": "[cast(fp + (-6), felt**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 260, "value": "cast([fp + (-6)] + 6, felt*)" }, { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 263, "value": "cast([fp + (-6)] + 7, felt*)" }, { "ap_tracking_data": { "group": 32, "offset": 0 }, "pc": 269, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 32, "offset": 0 }, "pc": 270, "value": "cast([ap + (-1)] + 1, felt*)" }, { "ap_tracking_data": { "group": 33, "offset": 0 }, "pc": 276, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 271, "value": "cast([fp + (-6)] + 6, felt*)" }, { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 276, "value": "cast([fp + (-6)] + 7, felt*)" }, { "ap_tracking_data": { "group": 32, "offset": 0 }, "pc": 282, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 32, "offset": 0 }, "pc": 283, "value": "cast([ap + (-1)] + 1, felt*)" }, { "ap_tracking_data": { "group": 33, "offset": 0 }, "pc": 289, "value": "[cast(ap + (-1), felt**)]" } ], "type": "reference" }, "__main__.main.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.main.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 26, "offset": 0 }, "pc": 206, "value": "[cast(fp + (-5), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 26, "offset": 45 }, "pc": 223, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 26, "offset": 50 }, "pc": 226, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 26, "offset": 55 }, "pc": 229, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 27, "offset": 0 }, "pc": 233, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 28, "offset": 0 }, "pc": 237, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 29, "offset": 0 }, "pc": 241, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 30, "offset": 0 }, "pc": 245, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 259, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 26, "offset": 58 }, "pc": 233, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 26, "offset": 63 }, "pc": 236, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 26, "offset": 68 }, "pc": 239, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 27, "offset": 0 }, "pc": 243, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 28, "offset": 0 }, "pc": 247, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 29, "offset": 0 }, "pc": 251, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 30, "offset": 0 }, "pc": 255, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 269, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 270, "value": "[cast(fp + 10, starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.main.range_check_ptr": { "cairo_type": "felt", "full_name": "__main__.main.range_check_ptr", "references": [ { "ap_tracking_data": { "group": 26, "offset": 0 }, "pc": 206, "value": "[cast(fp + (-4), felt*)]" } ], "type": "reference" }, "__main__.main.res": { "cairo_type": "felt", "full_name": "__main__.main.res", "references": [ { "ap_tracking_data": { "group": 26, "offset": 58 }, "pc": 233, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 63 }, "pc": 236, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 68 }, "pc": 239, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 27, "offset": 0 }, "pc": 243, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 28, "offset": 0 }, "pc": 247, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 29, "offset": 0 }, "pc": 251, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 30, "offset": 0 }, "pc": 255, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.main.storage_updates": { "cairo_type": "__main__.StorageUpdate**", "full_name": "__main__.main.storage_updates", "references": [ { "ap_tracking_data": { "group": 26, "offset": 39 }, "pc": 218, "value": "[cast(ap + (-2), __main__.StorageUpdate***)]" }, { "ap_tracking_data": { "group": 26, "offset": 39 }, "pc": 219, "value": "[cast(fp + 4, __main__.StorageUpdate***)]" } ], "type": "reference" }, "__main__.main.storage_updates_len": { "cairo_type": "felt", "full_name": "__main__.main.storage_updates_len", "references": [ { "ap_tracking_data": { "group": 26, "offset": 39 }, "pc": 218, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 39 }, "pc": 220, "value": "[cast(fp + 5, felt*)]" } ], "type": "reference" }, "__main__.main.world_da": { "cairo_type": "felt*", "full_name": "__main__.main.world_da", "references": [ { "ap_tracking_data": { "group": 30, "offset": 6 }, "pc": 262, "value": "[cast(ap + (-2), felt**)]" } ], "type": "reference" }, "__main__.main.world_da_hash": { "cairo_type": "felt", "full_name": "__main__.main.world_da_hash", "references": [ { "ap_tracking_data": { "group": 30, "offset": 6 }, "pc": 262, "value": "cast(0, felt)" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 269, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.main.world_da_len": { "cairo_type": "felt", "full_name": "__main__.main.world_da_len", "references": [ { "ap_tracking_data": { "group": 30, "offset": 6 }, "pc": 262, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.output_array": { "decorators": [], "pc": 189, "type": "function" }, "__main__.output_array.Args": { "full_name": "__main__.output_array.Args", "members": { "array": { "cairo_type": "felt*", "offset": 0 }, "len": { "cairo_type": "felt", "offset": 1 } }, "size": 2, "type": "struct" }, "__main__.output_array.ImplicitArgs": { "full_name": "__main__.output_array.ImplicitArgs", "members": { "output_ptr": { "cairo_type": "felt*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.output_array.Return": { "cairo_type": "()", "type": "type_definition" }, "__main__.output_array.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.output_array.__temp0": { "cairo_type": "felt", "full_name": "__main__.output_array.__temp0", "references": [ { "ap_tracking_data": { "group": 24, "offset": 1 }, "pc": 196, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.output_array.array": { "cairo_type": "felt*", "full_name": "__main__.output_array.array", "references": [ { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-4), felt**)]" } ], "type": "reference" }, "__main__.output_array.len": { "cairo_type": "felt", "full_name": "__main__.output_array.len", "references": [ { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "__main__.output_array.output_ptr": { "cairo_type": "felt*", "full_name": "__main__.output_array.output_ptr", "references": [ { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-5), felt**)]" }, { "ap_tracking_data": { "group": 24, "offset": 1 }, "pc": 197, "value": "cast([fp + (-5)] + 1, felt*)" }, { "ap_tracking_data": { "group": 25, "offset": 0 }, "pc": 205, "value": "[cast(ap + (-1), felt**)]" } ], "type": "reference" }, "__main__.output_array.value": { "cairo_type": "felt", "full_name": "__main__.output_array.value", "references": [ { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 195, "value": "[cast([fp + (-4)], felt*)]" } ], "type": "reference" }, "starkware.cairo.common.cairo_builtins.BitwiseBuiltin": { "full_name": "starkware.cairo.common.cairo_builtins.BitwiseBuiltin", "members": { "x": { "cairo_type": "felt", "offset": 0 }, "x_and_y": { "cairo_type": "felt", "offset": 2 }, "x_or_y": { "cairo_type": "felt", "offset": 4 }, "x_xor_y": { "cairo_type": "felt", "offset": 3 }, "y": { "cairo_type": "felt", "offset": 1 } }, "size": 5, "type": "struct" }, "starkware.cairo.common.cairo_builtins.EcOpBuiltin": { "full_name": "starkware.cairo.common.cairo_builtins.EcOpBuiltin", "members": { "m": { "cairo_type": "felt", "offset": 4 }, "p": { "cairo_type": "starkware.cairo.common.ec_point.EcPoint", "offset": 0 }, "q": { "cairo_type": "starkware.cairo.common.ec_point.EcPoint", "offset": 2 }, "r": { "cairo_type": "starkware.cairo.common.ec_point.EcPoint", "offset": 5 } }, "size": 7, "type": "struct" }, "starkware.cairo.common.cairo_builtins.EcPoint": { "destination": "starkware.cairo.common.ec_point.EcPoint", "type": "alias" }, "starkware.cairo.common.cairo_builtins.HashBuiltin": { "full_name": "starkware.cairo.common.cairo_builtins.HashBuiltin", "members": { "result": { "cairo_type": "felt", "offset": 2 }, "x": { "cairo_type": "felt", "offset": 0 }, "y": { "cairo_type": "felt", "offset": 1 } }, "size": 3, "type": "struct" }, "starkware.cairo.common.cairo_builtins.KeccakBuiltin": { "full_name": "starkware.cairo.common.cairo_builtins.KeccakBuiltin", "members": { "input": { "cairo_type": "starkware.cairo.common.keccak_state.KeccakBuiltinState", "offset": 0 }, "output": { "cairo_type": "starkware.cairo.common.keccak_state.KeccakBuiltinState", "offset": 8 } }, "size": 16, "type": "struct" }, "starkware.cairo.common.cairo_builtins.KeccakBuiltinState": { "destination": "starkware.cairo.common.keccak_state.KeccakBuiltinState", "type": "alias" }, "starkware.cairo.common.cairo_builtins.PoseidonBuiltin": { "full_name": "starkware.cairo.common.cairo_builtins.PoseidonBuiltin", "members": { "input": { "cairo_type": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", "offset": 0 }, "output": { "cairo_type": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", "offset": 3 } }, "size": 6, "type": "struct" }, "starkware.cairo.common.cairo_builtins.PoseidonBuiltinState": { "destination": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", "type": "alias" }, "starkware.cairo.common.cairo_builtins.SignatureBuiltin": { "full_name": "starkware.cairo.common.cairo_builtins.SignatureBuiltin", "members": { "message": { "cairo_type": "felt", "offset": 1 }, "pub_key": { "cairo_type": "felt", "offset": 0 } }, "size": 2, "type": "struct" }, "starkware.cairo.common.ec_point.EcPoint": { "full_name": "starkware.cairo.common.ec_point.EcPoint", "members": { "x": { "cairo_type": "felt", "offset": 0 }, "y": { "cairo_type": "felt", "offset": 1 } }, "size": 2, "type": "struct" }, "starkware.cairo.common.hash.HashBuiltin": { "destination": "starkware.cairo.common.cairo_builtins.HashBuiltin", "type": "alias" }, "starkware.cairo.common.hash.hash2": { "decorators": [], "pc": 6, "type": "function" }, "starkware.cairo.common.hash.hash2.Args": { "full_name": "starkware.cairo.common.hash.hash2.Args", "members": { "x": { "cairo_type": "felt", "offset": 0 }, "y": { "cairo_type": "felt", "offset": 1 } }, "size": 2, "type": "struct" }, "starkware.cairo.common.hash.hash2.ImplicitArgs": { "full_name": "starkware.cairo.common.hash.hash2.ImplicitArgs", "members": { "hash_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "starkware.cairo.common.hash.hash2.Return": { "cairo_type": "(result: felt)", "type": "type_definition" }, "starkware.cairo.common.hash.hash2.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "starkware.cairo.common.hash.hash2.hash_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "starkware.cairo.common.hash.hash2.hash_ptr", "references": [ { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 6, "value": "[cast(fp + (-5), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 8, "value": "cast([fp + (-5)] + 3, starkware.cairo.common.cairo_builtins.HashBuiltin*)" } ], "type": "reference" }, "starkware.cairo.common.hash.hash2.result": { "cairo_type": "felt", "full_name": "starkware.cairo.common.hash.hash2.result", "references": [ { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 8, "value": "[cast([fp + (-5)] + 2, felt*)]" } ], "type": "reference" }, "starkware.cairo.common.hash.hash2.x": { "cairo_type": "felt", "full_name": "starkware.cairo.common.hash.hash2.x", "references": [ { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 6, "value": "[cast(fp + (-4), felt*)]" } ], "type": "reference" }, "starkware.cairo.common.hash.hash2.y": { "cairo_type": "felt", "full_name": "starkware.cairo.common.hash.hash2.y", "references": [ { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 6, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "starkware.cairo.common.keccak_state.KeccakBuiltinState": { "full_name": "starkware.cairo.common.keccak_state.KeccakBuiltinState", "members": { "s0": { "cairo_type": "felt", "offset": 0 }, "s1": { "cairo_type": "felt", "offset": 1 }, "s2": { "cairo_type": "felt", "offset": 2 }, "s3": { "cairo_type": "felt", "offset": 3 }, "s4": { "cairo_type": "felt", "offset": 4 }, "s5": { "cairo_type": "felt", "offset": 5 }, "s6": { "cairo_type": "felt", "offset": 6 }, "s7": { "cairo_type": "felt", "offset": 7 } }, "size": 8, "type": "struct" }, "starkware.cairo.common.poseidon_state.PoseidonBuiltinState": { "full_name": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", "members": { "s0": { "cairo_type": "felt", "offset": 0 }, "s1": { "cairo_type": "felt", "offset": 1 }, "s2": { "cairo_type": "felt", "offset": 2 } }, "size": 3, "type": "struct" } }, "main_scope": "__main__", "prime": "0x800000000000011000000000000000000000000000000000000000000000001", "reference_manager": { "references": [ { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 6, "value": "[cast(fp + (-4), felt*)]" }, { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 6, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 6, "value": "[cast(fp + (-5), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 8, "value": "[cast([fp + (-5)] + 2, felt*)]" }, { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 8, "value": "cast([fp + (-5)] + 3, starkware.cairo.common.cairo_builtins.HashBuiltin*)" }, { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp, __main__.InputConfig*)]" }, { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 4, felt*)]" }, { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 5, felt*)]" }, { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 6, felt*)]" }, { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 7, felt*)]" }, { "ap_tracking_data": { "group": 4, "offset": 2 }, "pc": 21, "value": "[cast(fp, felt**)]" }, { "ap_tracking_data": { "group": 4, "offset": 2 }, "pc": 21, "value": "[cast(fp + 1, felt*)]" }, { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-4), felt**)]" }, { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 31, "value": "[cast([fp + (-4)], felt*)]" }, { "ap_tracking_data": { "group": 5, "offset": 7 }, "pc": 36, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 5, "offset": 7 }, "pc": 36, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 6, "offset": 0 }, "pc": 42, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp, felt**)]" }, { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp + 1, felt*)]" }, { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp + 2, felt**)]" }, { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp + 3, felt*)]" }, { "ap_tracking_data": { "group": 8, "offset": 2 }, "pc": 52, "value": "[cast(fp, __main__.NonceUpdate***)]" }, { "ap_tracking_data": { "group": 8, "offset": 2 }, "pc": 52, "value": "[cast(fp + 1, felt*)]" }, { "ap_tracking_data": { "group": 9, "offset": 0 }, "pc": 55, "value": "[cast(fp + (-3), __main__.NonceUpdate**)]" }, { "ap_tracking_data": { "group": 9, "offset": 0 }, "pc": 55, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 9, "offset": 0 }, "pc": 55, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 9, "offset": 7 }, "pc": 60, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 9, "offset": 7 }, "pc": 60, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-4), __main__.NonceUpdate***)]" }, { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 68, "value": "[cast([fp + (-4)], __main__.NonceUpdate**)]" }, { "ap_tracking_data": { "group": 10, "offset": 11 }, "pc": 72, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 10, "offset": 11 }, "pc": 72, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 10, "offset": 18 }, "pc": 77, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 10, "offset": 18 }, "pc": 77, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 11, "offset": 0 }, "pc": 83, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 12, "offset": 2 }, "pc": 86, "value": "[cast(fp, __main__.StorageUpdate***)]" }, { "ap_tracking_data": { "group": 12, "offset": 2 }, "pc": 86, "value": "[cast(fp + 1, felt*)]" }, { "ap_tracking_data": { "group": 13, "offset": 0 }, "pc": 89, "value": "[cast(fp + (-3), __main__.StorageUpdate**)]" }, { "ap_tracking_data": { "group": 13, "offset": 0 }, "pc": 89, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 13, "offset": 0 }, "pc": 89, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 13, "offset": 7 }, "pc": 94, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 13, "offset": 7 }, "pc": 94, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 13, "offset": 12 }, "pc": 97, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 13, "offset": 12 }, "pc": 97, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-4), __main__.StorageUpdate***)]" }, { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 105, "value": "[cast([fp + (-4)], __main__.StorageUpdate**)]" }, { "ap_tracking_data": { "group": 14, "offset": 16 }, "pc": 109, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 14, "offset": 16 }, "pc": 109, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 14, "offset": 23 }, "pc": 114, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 14, "offset": 23 }, "pc": 114, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 15, "offset": 0 }, "pc": 120, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 16, "offset": 2 }, "pc": 123, "value": "[cast(fp, __main__.ContractUpdate***)]" }, { "ap_tracking_data": { "group": 16, "offset": 2 }, "pc": 123, "value": "[cast(fp + 1, felt*)]" }, { "ap_tracking_data": { "group": 17, "offset": 0 }, "pc": 126, "value": "[cast(fp + (-3), __main__.ContractUpdate**)]" }, { "ap_tracking_data": { "group": 17, "offset": 0 }, "pc": 126, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 17, "offset": 0 }, "pc": 126, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 17, "offset": 7 }, "pc": 131, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 17, "offset": 7 }, "pc": 131, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-4), __main__.ContractUpdate***)]" }, { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 139, "value": "[cast([fp + (-4)], __main__.ContractUpdate**)]" }, { "ap_tracking_data": { "group": 18, "offset": 11 }, "pc": 143, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 18, "offset": 11 }, "pc": 143, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 18, "offset": 18 }, "pc": 148, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 18, "offset": 18 }, "pc": 148, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 19, "offset": 0 }, "pc": 154, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 20, "offset": 2 }, "pc": 157, "value": "[cast(fp, __main__.DeclaredClass***)]" }, { "ap_tracking_data": { "group": 20, "offset": 2 }, "pc": 157, "value": "[cast(fp + 1, felt*)]" }, { "ap_tracking_data": { "group": 21, "offset": 0 }, "pc": 160, "value": "[cast(fp + (-3), __main__.DeclaredClass**)]" }, { "ap_tracking_data": { "group": 21, "offset": 0 }, "pc": 160, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 21, "offset": 0 }, "pc": 160, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 21, "offset": 7 }, "pc": 165, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 21, "offset": 7 }, "pc": 165, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-4), __main__.DeclaredClass***)]" }, { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 173, "value": "[cast([fp + (-4)], __main__.DeclaredClass**)]" }, { "ap_tracking_data": { "group": 22, "offset": 11 }, "pc": 177, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 22, "offset": 11 }, "pc": 177, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 22, "offset": 18 }, "pc": 182, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 22, "offset": 18 }, "pc": 182, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 23, "offset": 0 }, "pc": 188, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-4), felt**)]" }, { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-5), felt**)]" }, { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 195, "value": "[cast([fp + (-4)], felt*)]" }, { "ap_tracking_data": { "group": 24, "offset": 1 }, "pc": 196, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 24, "offset": 1 }, "pc": 197, "value": "cast([fp + (-5)] + 1, felt*)" }, { "ap_tracking_data": { "group": 25, "offset": 0 }, "pc": 205, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 26, "offset": 0 }, "pc": 206, "value": "[cast(fp + (-6), felt**)]" }, { "ap_tracking_data": { "group": 26, "offset": 0 }, "pc": 206, "value": "[cast(fp + (-5), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 26, "offset": 0 }, "pc": 206, "value": "[cast(fp + (-4), felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 0 }, "pc": 206, "value": "[cast(fp + (-3), felt**)]" }, { "ap_tracking_data": { "group": 26, "offset": 27 }, "pc": 210, "value": "[cast(ap + (-4), __main__.InputConfig*)]" }, { "ap_tracking_data": { "group": 26, "offset": 27 }, "pc": 214, "value": "[cast(fp, __main__.InputConfig*)]" }, { "ap_tracking_data": { "group": 26, "offset": 33 }, "pc": 216, "value": "[cast(ap + (-2), __main__.NonceUpdate***)]" }, { "ap_tracking_data": { "group": 26, "offset": 33 }, "pc": 216, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 39 }, "pc": 218, "value": "[cast(ap + (-2), __main__.StorageUpdate***)]" }, { "ap_tracking_data": { "group": 26, "offset": 39 }, "pc": 218, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 39 }, "pc": 219, "value": "[cast(fp + 4, __main__.StorageUpdate***)]" }, { "ap_tracking_data": { "group": 26, "offset": 39 }, "pc": 220, "value": "[cast(fp + 5, felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 45 }, "pc": 222, "value": "[cast(ap + (-2), __main__.ContractUpdate***)]" }, { "ap_tracking_data": { "group": 26, "offset": 45 }, "pc": 222, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 45 }, "pc": 223, "value": "[cast(fp + 6, __main__.ContractUpdate***)]" }, { "ap_tracking_data": { "group": 26, "offset": 45 }, "pc": 224, "value": "[cast(fp + 7, felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 51 }, "pc": 226, "value": "[cast(ap + (-2), __main__.DeclaredClass***)]" }, { "ap_tracking_data": { "group": 26, "offset": 51 }, "pc": 226, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 51 }, "pc": 227, "value": "[cast(fp + 8, __main__.DeclaredClass***)]" }, { "ap_tracking_data": { "group": 26, "offset": 51 }, "pc": 228, "value": "[cast(fp + 9, felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 58 }, "pc": 233, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 26, "offset": 58 }, "pc": 233, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 63 }, "pc": 236, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 26, "offset": 63 }, "pc": 236, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 68 }, "pc": 239, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 26, "offset": 68 }, "pc": 239, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 27, "offset": 0 }, "pc": 243, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 27, "offset": 0 }, "pc": 243, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 28, "offset": 0 }, "pc": 247, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 28, "offset": 0 }, "pc": 247, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 29, "offset": 0 }, "pc": 251, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 29, "offset": 0 }, "pc": 251, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 30, "offset": 0 }, "pc": 255, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 30, "offset": 0 }, "pc": 255, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 30, "offset": 6 }, "pc": 262, "value": "[cast(ap + (-2), felt**)]" }, { "ap_tracking_data": { "group": 30, "offset": 6 }, "pc": 262, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 30, "offset": 6 }, "pc": 262, "value": "cast(0, felt)" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 269, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 269, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 270, "value": "[cast(fp + 10, starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 271, "value": "cast([fp + (-6)] + 6, felt*)" }, { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 273, "value": "[cast(ap + (-4), felt**)]" }, { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 273, "value": "[cast(ap + (-3), felt*)]" }, { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 273, "value": "[cast(ap + (-2), felt**)]" }, { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 273, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 274, "value": "[cast(fp + 11, felt*)]" }, { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 275, "value": "[cast(fp + 12, felt**)]" }, { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 276, "value": "cast([fp + (-6)] + 7, felt*)" }, { "ap_tracking_data": { "group": 32, "offset": 0 }, "pc": 282, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 32, "offset": 0 }, "pc": 283, "value": "cast([ap + (-1)] + 1, felt*)" }, { "ap_tracking_data": { "group": 33, "offset": 0 }, "pc": 289, "value": "[cast(ap + (-1), felt**)]" } ] }} \ No newline at end of file diff --git a/bin/saya/programs/cairo0merger.json b/bin/saya/programs/cairo0merger.json new file mode 100644 index 0000000000..210139f64c --- /dev/null +++ b/bin/saya/programs/cairo0merger.json @@ -0,0 +1 @@ +{ "attributes": [], "builtins": ["output", "pedersen", "range_check", "bitwise"], "compiler_version": "0.13.1", "data": [ "0x40780017fff7fff", "0x4", "0x1104800180018000", "0x10e", "0x10780017fff7fff", "0x0", "0x400380007ffb7ffc", "0x400380017ffb7ffd", "0x482680017ffb8000", "0x3", "0x480280027ffb8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x8", "0x480a80047fff8000", "0x480a80057fff8000", "0x480a80067fff8000", "0x480a80077fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x2", "0x480a80007fff8000", "0x480a80017fff8000", "0x208b7fff7fff7ffe", "0x20780017fff7ffd", "0x5", "0x480a7ffa7fff8000", "0x480a7ffb7fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x0", "0x480a7ffa7fff8000", "0x480a7ffb7fff8000", "0x480280007ffc8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffe5", "0x482680017ffc8000", "0x1", "0x482680017ffd8000", "0x800000000000011000000000000000000000000000000000000000000000000", "0x1104800180018000", "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffff1", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x4", "0x480a80007fff8000", "0x480a80017fff8000", "0x480a80027fff8000", "0x480a80037fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x2", "0x480a80007fff8000", "0x480a80017fff8000", "0x208b7fff7fff7ffe", "0x480a7ffc7fff8000", "0x480280007ffd8000", "0x480280017ffd8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffcd", "0x208b7fff7fff7ffe", "0x20780017fff7ffd", "0x5", "0x480a7ffa7fff8000", "0x480a7ffb7fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x0", "0x480a7ffa7fff8000", "0x480280007ffc8000", "0x1104800180018000", "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffff2", "0x48127ffe7fff8000", "0x480a7ffb7fff8000", "0x48127ffd7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffbc", "0x482680017ffc8000", "0x1", "0x482680017ffd8000", "0x800000000000011000000000000000000000000000000000000000000000000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffed", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x2", "0x480a80007fff8000", "0x480a80017fff8000", "0x208b7fff7fff7ffe", "0x480a7ffc7fff8000", "0x480280007ffd8000", "0x480280017ffd8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffab", "0x480280027ffd8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffa8", "0x208b7fff7fff7ffe", "0x20780017fff7ffd", "0x5", "0x480a7ffa7fff8000", "0x480a7ffb7fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x0", "0x480a7ffa7fff8000", "0x480280007ffc8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffef", "0x48127ffe7fff8000", "0x480a7ffb7fff8000", "0x48127ffd7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff97", "0x482680017ffc8000", "0x1", "0x482680017ffd8000", "0x800000000000011000000000000000000000000000000000000000000000000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffed", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x2", "0x480a80007fff8000", "0x480a80017fff8000", "0x208b7fff7fff7ffe", "0x480a7ffc7fff8000", "0x480280007ffd8000", "0x480280017ffd8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff86", "0x208b7fff7fff7ffe", "0x20780017fff7ffd", "0x5", "0x480a7ffa7fff8000", "0x480a7ffb7fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x0", "0x480a7ffa7fff8000", "0x480280007ffc8000", "0x1104800180018000", "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffff2", "0x48127ffe7fff8000", "0x480a7ffb7fff8000", "0x48127ffd7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff75", "0x482680017ffc8000", "0x1", "0x482680017ffd8000", "0x800000000000011000000000000000000000000000000000000000000000000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffed", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x2", "0x480a80007fff8000", "0x480a80017fff8000", "0x208b7fff7fff7ffe", "0x480a7ffc7fff8000", "0x480280007ffd8000", "0x480280017ffd8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff64", "0x208b7fff7fff7ffe", "0x20780017fff7ffd", "0x5", "0x480a7ffa7fff8000", "0x480a7ffb7fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x0", "0x480a7ffa7fff8000", "0x480280007ffc8000", "0x1104800180018000", "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffff2", "0x48127ffe7fff8000", "0x480a7ffb7fff8000", "0x48127ffd7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff53", "0x482680017ffc8000", "0x1", "0x482680017ffd8000", "0x800000000000011000000000000000000000000000000000000000000000000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffed", "0x208b7fff7fff7ffe", "0x20780017fff7ffb", "0xb", "0x482a7ffb7ffa8000", "0x400180007fff7ffc", "0x482680017ffb8000", "0x1", "0x48327fff7ffa8000", "0x400180007fff7ffd", "0x480680017fff8000", "0x0", "0x208b7fff7fff7ffe", "0x480280007ffa8000", "0x48287ffc80007fff", "0x20680017fff7fff", "0x6", "0x400380017ffa7ffd", "0x480680017fff8000", "0x1", "0x208b7fff7fff7ffe", "0x482680017ffa8000", "0x2", "0x482680017ffb8000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffff", "0x480a7ffc7fff8000", "0x480a7ffd7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffe8", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x2", "0x480a80007fff8000", "0x480a80017fff8000", "0x208b7fff7fff7ffe", "0x20780017fff7ffd", "0x4", "0x480a7ffb7fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x0", "0x480280007ffc8000", "0x400280007ffb7fff", "0x482680017ffb8000", "0x1", "0x482680017ffc8000", "0x1", "0x482680017ffd8000", "0x800000000000011000000000000000000000000000000000000000000000000", "0x1104800180018000", "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffff3", "0x208b7fff7fff7ffe", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff1e", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff42", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff62", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff85", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffa5", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff33", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff19", "0x48127fd47fff8000", "0x48127fd47fff8000", "0x48127fd47fff8000", "0x48127fd47fff8000", "0x48127fd97fff8000", "0x48127fd77fff8000", "0x48127fdd7fff8000", "0x48127fdb7fff8000", "0x48127fe17fff8000", "0x48127fdf7fff8000", "0x48127fe57fff8000", "0x48127fe37fff8000", "0x48127fea7fff8000", "0x48127fea7fff8000", "0x48127fea7fff8000", "0x48127fea7fff8000", "0x48127fee7fff8000", "0x48127fee7fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x25", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffde", "0x40137fee7fff8000", "0x40137fef7fff8001", "0x40137ff07fff8002", "0x40137ff17fff8003", "0x40137ff27fff8004", "0x40137ff37fff8005", "0x40137ff47fff8006", "0x40137ff57fff8007", "0x40137ff67fff8008", "0x40137ff77fff8009", "0x40137ff87fff800a", "0x40137ff97fff800b", "0x40137ffa7fff800c", "0x40137ffb7fff800d", "0x40137ffc7fff800e", "0x40137ffd7fff800f", "0x40137ffe7fff8010", "0x40137fff7fff8011", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffca", "0x40137fee7fff8012", "0x40137fef7fff8013", "0x40137ff07fff8014", "0x40137ff17fff8015", "0x40137ff27fff8016", "0x40137ff37fff8017", "0x40137ff47fff8018", "0x40137ff57fff8019", "0x40137ff67fff801a", "0x40137ff77fff801b", "0x40137ff87fff801c", "0x40137ff97fff801d", "0x40137ffa7fff801e", "0x40137ffb7fff801f", "0x40137ffc7fff8020", "0x40137ffd7fff8021", "0x40137ffe7fff8022", "0x40137fff7fff8023", "0x400380007ffa8000", "0x480680017fff8000", "0x0", "0x400280017ffa7fff", "0x400380027ffa8013", "0x400380037ffa8014", "0x400380047ffa8003", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff99", "0x480a7ffb7fff8000", "0x480680017fff8000", "0x0", "0x48127ffc7fff8000", "0x48127ffc7fff8000", "0x1104800180018000", "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffed1", "0x40137ffe7fff8024", "0x400280057ffa7fff", "0x482a801f800d8000", "0x400280067ffa7fff", "0x482680017ffa8000", "0x7", "0x480a800c7fff8000", "0x480a800d7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff8d", "0x480a801e7fff8000", "0x480a801f7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff89", "0x482a8021800f8000", "0x400080007ffe7fff", "0x482480017ffe8000", "0x1", "0x480a800e7fff8000", "0x480a800f7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff81", "0x480a80207fff8000", "0x480a80217fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff7d", "0x480a80247fff8000", "0x480a7ffc7fff8000", "0x480a7ffd7fff8000", "0x208b7fff7fff7ffe" ], "debug_info": { "file_contents": { "": "__start__:\nap += main.Args.SIZE + main.ImplicitArgs.SIZE;\ncall main;\n\n__end__:\njmp rel 0;\n" }, "instruction_locations": { "0": { "accessible_scopes": ["__main__"], "flow_tracking_data": { "ap_tracking": { "group": 0, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 46, "end_line": 2, "input_file": { "filename": "" }, "start_col": 1, "start_line": 2 } }, "2": { "accessible_scopes": ["__main__"], "flow_tracking_data": { "ap_tracking": { "group": 0, "offset": 4 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 10, "end_line": 3, "input_file": { "filename": "" }, "start_col": 1, "start_line": 3 } }, "4": { "accessible_scopes": ["__main__"], "flow_tracking_data": { "ap_tracking": { "group": 1, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 10, "end_line": 6, "input_file": { "filename": "" }, "start_col": 1, "start_line": 6 } }, "6": { "accessible_scopes": [ "starkware.cairo.common.hash", "starkware.cairo.common.hash.hash2" ], "flow_tracking_data": { "ap_tracking": { "group": 2, "offset": 0 }, "reference_ids": { "starkware.cairo.common.hash.hash2.hash_ptr": 2, "starkware.cairo.common.hash.hash2.x": 0, "starkware.cairo.common.hash.hash2.y": 1 } }, "hints": [], "inst": { "end_col": 19, "end_line": 14, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "start_col": 5, "start_line": 14 } }, "7": { "accessible_scopes": [ "starkware.cairo.common.hash", "starkware.cairo.common.hash.hash2" ], "flow_tracking_data": { "ap_tracking": { "group": 2, "offset": 0 }, "reference_ids": { "starkware.cairo.common.hash.hash2.hash_ptr": 2, "starkware.cairo.common.hash.hash2.x": 0, "starkware.cairo.common.hash.hash2.y": 1 } }, "hints": [], "inst": { "end_col": 19, "end_line": 15, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "start_col": 5, "start_line": 15 } }, "8": { "accessible_scopes": [ "starkware.cairo.common.hash", "starkware.cairo.common.hash.hash2" ], "flow_tracking_data": { "ap_tracking": { "group": 2, "offset": 0 }, "reference_ids": { "starkware.cairo.common.hash.hash2.hash_ptr": 4, "starkware.cairo.common.hash.hash2.result": 3, "starkware.cairo.common.hash.hash2.x": 0, "starkware.cairo.common.hash.hash2.y": 1 } }, "hints": [], "inst": { "end_col": 47, "end_line": 17, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "parent_location": [ { "end_col": 34, "end_line": 13, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "parent_location": [ { "end_col": 28, "end_line": 18, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "start_col": 5, "start_line": 18 }, "While trying to retrieve the implicit argument 'hash_ptr' in:" ], "start_col": 12, "start_line": 13 }, "While expanding the reference 'hash_ptr' in:" ], "start_col": 20, "start_line": 17 } }, "10": { "accessible_scopes": [ "starkware.cairo.common.hash", "starkware.cairo.common.hash.hash2" ], "flow_tracking_data": { "ap_tracking": { "group": 2, "offset": 1 }, "reference_ids": { "starkware.cairo.common.hash.hash2.hash_ptr": 4, "starkware.cairo.common.hash.hash2.result": 3, "starkware.cairo.common.hash.hash2.x": 0, "starkware.cairo.common.hash.hash2.y": 1 } }, "hints": [], "inst": { "end_col": 33, "end_line": 16, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 18, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "start_col": 20, "start_line": 18 }, "While expanding the reference 'result' in:" ], "start_col": 18, "start_line": 16 } }, "11": { "accessible_scopes": [ "starkware.cairo.common.hash", "starkware.cairo.common.hash.hash2" ], "flow_tracking_data": { "ap_tracking": { "group": 2, "offset": 2 }, "reference_ids": { "starkware.cairo.common.hash.hash2.hash_ptr": 4, "starkware.cairo.common.hash.hash2.result": 3, "starkware.cairo.common.hash.hash2.x": 0, "starkware.cairo.common.hash.hash2.y": 1 } }, "hints": [], "inst": { "end_col": 28, "end_line": 18, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "start_col": 5, "start_line": 18 } }, "12": { "accessible_scopes": ["__main__", "__main__.get_hashes"], "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 15, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 15 } }, "14": { "accessible_scopes": ["__main__", "__main__.get_hashes"], "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 8 }, "reference_ids": { "__main__.get_hashes.block_hash": 8, "__main__.get_hashes.block_number": 7, "__main__.get_hashes.config_hash": 9, "__main__.get_hashes.input_config": 5, "__main__.get_hashes.prev_state_root": 6 } }, "hints": [ { "location": { "end_col": 7, "end_line": 26, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 21 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 26, "end_line": 17, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 29, "input_file": { "filename": "src/merger.cairo" }, "start_col": 29, "start_line": 29 }, "While expanding the reference 'prev_state_root' in:" ], "start_col": 11, "start_line": 17 } }, "15": { "accessible_scopes": ["__main__", "__main__.get_hashes"], "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 9 }, "reference_ids": { "__main__.get_hashes.block_hash": 8, "__main__.get_hashes.block_number": 7, "__main__.get_hashes.config_hash": 9, "__main__.get_hashes.input_config": 5, "__main__.get_hashes.prev_state_root": 6 } }, "hints": [], "inst": { "end_col": 23, "end_line": 18, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 38, "end_line": 30, "input_file": { "filename": "src/merger.cairo" }, "start_col": 26, "start_line": 30 }, "While expanding the reference 'block_number' in:" ], "start_col": 11, "start_line": 18 } }, "16": { "accessible_scopes": ["__main__", "__main__.get_hashes"], "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 10 }, "reference_ids": { "__main__.get_hashes.block_hash": 8, "__main__.get_hashes.block_number": 7, "__main__.get_hashes.config_hash": 9, "__main__.get_hashes.input_config": 5, "__main__.get_hashes.prev_state_root": 6 } }, "hints": [], "inst": { "end_col": 21, "end_line": 19, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 34, "end_line": 31, "input_file": { "filename": "src/merger.cairo" }, "start_col": 24, "start_line": 31 }, "While expanding the reference 'block_hash' in:" ], "start_col": 11, "start_line": 19 } }, "17": { "accessible_scopes": ["__main__", "__main__.get_hashes"], "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 11 }, "reference_ids": { "__main__.get_hashes.block_hash": 8, "__main__.get_hashes.block_number": 7, "__main__.get_hashes.config_hash": 9, "__main__.get_hashes.input_config": 5, "__main__.get_hashes.prev_state_root": 6 } }, "hints": [], "inst": { "end_col": 22, "end_line": 20, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 36, "end_line": 32, "input_file": { "filename": "src/merger.cairo" }, "start_col": 25, "start_line": 32 }, "While expanding the reference 'config_hash' in:" ], "start_col": 11, "start_line": 20 } }, "18": { "accessible_scopes": ["__main__", "__main__.get_hashes"], "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 12 }, "reference_ids": { "__main__.get_hashes.block_hash": 8, "__main__.get_hashes.block_number": 7, "__main__.get_hashes.config_hash": 9, "__main__.get_hashes.input_config": 5, "__main__.get_hashes.prev_state_root": 6 } }, "hints": [], "inst": { "end_col": 7, "end_line": 34, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 27 } }, "19": { "accessible_scopes": ["__main__", "__main__.get_world_da"], "flow_tracking_data": { "ap_tracking": { "group": 4, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 43, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 43 } }, "21": { "accessible_scopes": ["__main__", "__main__.get_world_da"], "flow_tracking_data": { "ap_tracking": { "group": 4, "offset": 2 }, "reference_ids": { "__main__.get_world_da.world_da": 10, "__main__.get_world_da.world_da_len": 11 } }, "hints": [ { "location": { "end_col": 7, "end_line": 50, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 46 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 19, "end_line": 44, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 30, "end_line": 54, "input_file": { "filename": "src/merger.cairo" }, "start_col": 22, "start_line": 54 }, "While expanding the reference 'world_da' in:" ], "start_col": 11, "start_line": 44 } }, "22": { "accessible_scopes": ["__main__", "__main__.get_world_da"], "flow_tracking_data": { "ap_tracking": { "group": 4, "offset": 3 }, "reference_ids": { "__main__.get_world_da.world_da": 10, "__main__.get_world_da.world_da_len": 11 } }, "hints": [], "inst": { "end_col": 23, "end_line": 45, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 38, "end_line": 55, "input_file": { "filename": "src/merger.cairo" }, "start_col": 26, "start_line": 55 }, "While expanding the reference 'world_da_len' in:" ], "start_col": 11, "start_line": 45 } }, "23": { "accessible_scopes": ["__main__", "__main__.get_world_da"], "flow_tracking_data": { "ap_tracking": { "group": 4, "offset": 4 }, "reference_ids": { "__main__.get_world_da.world_da": 10, "__main__.get_world_da.world_da_len": 11 } }, "hints": [], "inst": { "end_col": 7, "end_line": 57, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 53 } }, "24": { "accessible_scopes": ["__main__", "__main__.hash_world_da_loop"], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 0 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 7, "end_line": 63, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 63 } }, "26": { "accessible_scopes": ["__main__", "__main__.hash_world_da_loop"], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 0 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 51, "end_line": 60, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 51, "end_line": 60, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 64, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 64 }, "While trying to retrieve the implicit argument 'pedersen_ptr' in:" ], "start_col": 25, "start_line": 60 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 25, "start_line": 60 } }, "27": { "accessible_scopes": ["__main__", "__main__.hash_world_da_loop"], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 1 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 14, "end_line": 61, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 24, "end_line": 64, "input_file": { "filename": "src/merger.cairo" }, "start_col": 21, "start_line": 64 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 61 } }, "28": { "accessible_scopes": ["__main__", "__main__.hash_world_da_loop"], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 2 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 26, "end_line": 64, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 64 } }, "29": { "accessible_scopes": ["__main__", "__main__.hash_world_da_loop"], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 0 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 18, "end_line": 66, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 66 } }, "31": { "accessible_scopes": ["__main__", "__main__.hash_world_da_loop"], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 0 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 51, "end_line": 60, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 68, "input_file": { "filename": "src/merger.cairo" }, "start_col": 32, "start_line": 68 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 25, "start_line": 60 } }, "32": { "accessible_scopes": ["__main__", "__main__.hash_world_da_loop"], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 1 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 14, "end_line": 61, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 69, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 69 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 61 } }, "33": { "accessible_scopes": ["__main__", "__main__.hash_world_da_loop"], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 2 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 27, "end_line": 67, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 19, "end_line": 69, "input_file": { "filename": "src/merger.cairo" }, "start_col": 14, "start_line": 69 }, "While expanding the reference 'value' in:" ], "start_col": 17, "start_line": 67 } }, "34": { "accessible_scopes": ["__main__", "__main__.hash_world_da_loop"], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 3 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 6, "end_line": 70, "input_file": { "filename": "src/merger.cairo" }, "start_col": 17, "start_line": 68 } }, "36": { "accessible_scopes": ["__main__", "__main__.hash_world_da_loop"], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 7 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 17, "__main__.hash_world_da_loop.res": 18, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 30, "end_line": 73, "input_file": { "filename": "src/merger.cairo" }, "start_col": 18, "start_line": 73 } }, "38": { "accessible_scopes": ["__main__", "__main__.hash_world_da_loop"], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 8 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 17, "__main__.hash_world_da_loop.res": 18, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 38, "end_line": 74, "input_file": { "filename": "src/merger.cairo" }, "start_col": 22, "start_line": 74 } }, "40": { "accessible_scopes": ["__main__", "__main__.hash_world_da_loop"], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 9 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 17, "__main__.hash_world_da_loop.res": 18, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 6, "end_line": 75, "input_file": { "filename": "src/merger.cairo" }, "start_col": 12, "start_line": 71 } }, "42": { "accessible_scopes": ["__main__", "__main__.hash_world_da_loop"], "flow_tracking_data": { "ap_tracking": { "group": 6, "offset": 0 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 19, "__main__.hash_world_da_loop.res": 18, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 7, "end_line": 75, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 71 } }, "43": { "accessible_scopes": ["__main__", "__main__.get_messages"], "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 86, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 86 } }, "45": { "accessible_scopes": ["__main__", "__main__.get_messages"], "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 4 }, "reference_ids": { "__main__.get_messages.message_to_appchain_segment": 22, "__main__.get_messages.message_to_appchain_segment_len": 23, "__main__.get_messages.message_to_starknet_segment": 20, "__main__.get_messages.message_to_starknet_segment_len": 21 } }, "hints": [ { "location": { "end_col": 7, "end_line": 105, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 91 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 38, "end_line": 87, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 68, "end_line": 107, "input_file": { "filename": "src/merger.cairo" }, "start_col": 41, "start_line": 107 }, "While expanding the reference 'message_to_starknet_segment' in:" ], "start_col": 11, "start_line": 87 } }, "46": { "accessible_scopes": ["__main__", "__main__.get_messages"], "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 5 }, "reference_ids": { "__main__.get_messages.message_to_appchain_segment": 22, "__main__.get_messages.message_to_appchain_segment_len": 23, "__main__.get_messages.message_to_starknet_segment": 20, "__main__.get_messages.message_to_starknet_segment_len": 21 } }, "hints": [], "inst": { "end_col": 42, "end_line": 88, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 76, "end_line": 108, "input_file": { "filename": "src/merger.cairo" }, "start_col": 45, "start_line": 108 }, "While expanding the reference 'message_to_starknet_segment_len' in:" ], "start_col": 11, "start_line": 88 } }, "47": { "accessible_scopes": ["__main__", "__main__.get_messages"], "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 6 }, "reference_ids": { "__main__.get_messages.message_to_appchain_segment": 22, "__main__.get_messages.message_to_appchain_segment_len": 23, "__main__.get_messages.message_to_starknet_segment": 20, "__main__.get_messages.message_to_starknet_segment_len": 21 } }, "hints": [], "inst": { "end_col": 38, "end_line": 89, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 68, "end_line": 109, "input_file": { "filename": "src/merger.cairo" }, "start_col": 41, "start_line": 109 }, "While expanding the reference 'message_to_appchain_segment' in:" ], "start_col": 11, "start_line": 89 } }, "48": { "accessible_scopes": ["__main__", "__main__.get_messages"], "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 7 }, "reference_ids": { "__main__.get_messages.message_to_appchain_segment": 22, "__main__.get_messages.message_to_appchain_segment_len": 23, "__main__.get_messages.message_to_starknet_segment": 20, "__main__.get_messages.message_to_starknet_segment_len": 21 } }, "hints": [], "inst": { "end_col": 42, "end_line": 90, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 76, "end_line": 110, "input_file": { "filename": "src/merger.cairo" }, "start_col": 45, "start_line": 110 }, "While expanding the reference 'message_to_appchain_segment_len' in:" ], "start_col": 11, "start_line": 90 } }, "49": { "accessible_scopes": ["__main__", "__main__.get_messages"], "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 8 }, "reference_ids": { "__main__.get_messages.message_to_appchain_segment": 22, "__main__.get_messages.message_to_appchain_segment_len": 23, "__main__.get_messages.message_to_starknet_segment": 20, "__main__.get_messages.message_to_starknet_segment_len": 21 } }, "hints": [], "inst": { "end_col": 7, "end_line": 112, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 106 } }, "50": { "accessible_scopes": ["__main__", "__main__.get_nonce_updates"], "flow_tracking_data": { "ap_tracking": { "group": 8, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 121, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 121 } }, "52": { "accessible_scopes": ["__main__", "__main__.get_nonce_updates"], "flow_tracking_data": { "ap_tracking": { "group": 8, "offset": 2 }, "reference_ids": { "__main__.get_nonce_updates.nonce_updates": 24, "__main__.get_nonce_updates.nonce_updates_len": 25 } }, "hints": [ { "location": { "end_col": 7, "end_line": 136, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 124 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 24, "end_line": 122, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 40, "end_line": 137, "input_file": { "filename": "src/merger.cairo" }, "start_col": 27, "start_line": 137 }, "While expanding the reference 'nonce_updates' in:" ], "start_col": 11, "start_line": 122 } }, "53": { "accessible_scopes": ["__main__", "__main__.get_nonce_updates"], "flow_tracking_data": { "ap_tracking": { "group": 8, "offset": 3 }, "reference_ids": { "__main__.get_nonce_updates.nonce_updates": 24, "__main__.get_nonce_updates.nonce_updates_len": 25 } }, "hints": [], "inst": { "end_col": 28, "end_line": 123, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 77, "end_line": 137, "input_file": { "filename": "src/merger.cairo" }, "start_col": 60, "start_line": 137 }, "While expanding the reference 'nonce_updates_len' in:" ], "start_col": 11, "start_line": 123 } }, "54": { "accessible_scopes": ["__main__", "__main__.get_nonce_updates"], "flow_tracking_data": { "ap_tracking": { "group": 8, "offset": 4 }, "reference_ids": { "__main__.get_nonce_updates.nonce_updates": 24, "__main__.get_nonce_updates.nonce_updates_len": 25 } }, "hints": [], "inst": { "end_col": 79, "end_line": 137, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 137 } }, "55": { "accessible_scopes": ["__main__", "__main__.hash_nonce_update"], "flow_tracking_data": { "ap_tracking": { "group": 9, "offset": 0 }, "reference_ids": { "__main__.hash_nonce_update.nonce_update": 26, "__main__.hash_nonce_update.pedersen_ptr": 27, "__main__.hash_nonce_update.res": 28 } }, "hints": [], "inst": { "end_col": 50, "end_line": 140, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 144, "input_file": { "filename": "src/merger.cairo" }, "start_col": 32, "start_line": 144 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 24, "start_line": 140 } }, "56": { "accessible_scopes": ["__main__", "__main__.hash_nonce_update"], "flow_tracking_data": { "ap_tracking": { "group": 9, "offset": 1 }, "reference_ids": { "__main__.hash_nonce_update.nonce_update": 26, "__main__.hash_nonce_update.pedersen_ptr": 27, "__main__.hash_nonce_update.res": 28 } }, "hints": [], "inst": { "end_col": 44, "end_line": 143, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 145, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 145 }, "While expanding the reference 'res' in:" ], "start_col": 15, "start_line": 143 } }, "57": { "accessible_scopes": ["__main__", "__main__.hash_nonce_update"], "flow_tracking_data": { "ap_tracking": { "group": 9, "offset": 2 }, "reference_ids": { "__main__.hash_nonce_update.nonce_update": 26, "__main__.hash_nonce_update.pedersen_ptr": 27, "__main__.hash_nonce_update.res": 28 } }, "hints": [], "inst": { "end_col": 32, "end_line": 145, "input_file": { "filename": "src/merger.cairo" }, "start_col": 14, "start_line": 145 } }, "58": { "accessible_scopes": ["__main__", "__main__.hash_nonce_update"], "flow_tracking_data": { "ap_tracking": { "group": 9, "offset": 3 }, "reference_ids": { "__main__.hash_nonce_update.nonce_update": 26, "__main__.hash_nonce_update.pedersen_ptr": 27, "__main__.hash_nonce_update.res": 28 } }, "hints": [], "inst": { "end_col": 6, "end_line": 146, "input_file": { "filename": "src/merger.cairo" }, "start_col": 17, "start_line": 144 } }, "60": { "accessible_scopes": ["__main__", "__main__.hash_nonce_update"], "flow_tracking_data": { "ap_tracking": { "group": 9, "offset": 7 }, "reference_ids": { "__main__.hash_nonce_update.nonce_update": 26, "__main__.hash_nonce_update.pedersen_ptr": 29, "__main__.hash_nonce_update.res": 30 } }, "hints": [], "inst": { "end_col": 22, "end_line": 147, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 147 } }, "61": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 0 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 7, "end_line": 153, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 153 } }, "63": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 0 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 56, "end_line": 150, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 56, "end_line": 150, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 154, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 154 }, "While trying to retrieve the implicit argument 'pedersen_ptr' in:" ], "start_col": 30, "start_line": 150 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 30, "start_line": 150 } }, "64": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 1 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 14, "end_line": 151, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 24, "end_line": 154, "input_file": { "filename": "src/merger.cairo" }, "start_col": 21, "start_line": 154 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 151 } }, "65": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 2 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 26, "end_line": 154, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 154 } }, "66": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 0 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 18, "end_line": 156, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 156 } }, "68": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 0 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 56, "end_line": 150, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 61, "end_line": 158, "input_file": { "filename": "src/merger.cairo" }, "start_col": 49, "start_line": 158 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 30, "start_line": 150 } }, "69": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 1 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 39, "end_line": 157, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 75, "end_line": 158, "input_file": { "filename": "src/merger.cairo" }, "start_col": 63, "start_line": 158 }, "While expanding the reference 'nonce_update' in:" ], "start_col": 24, "start_line": 157 } }, "70": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 2 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 76, "end_line": 158, "input_file": { "filename": "src/merger.cairo" }, "start_col": 18, "start_line": 158 } }, "72": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 11 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 36, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 61, "end_line": 158, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 159, "input_file": { "filename": "src/merger.cairo" }, "start_col": 32, "start_line": 159 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 49, "start_line": 158 } }, "73": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 12 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 36, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 14, "end_line": 151, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 160, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 160 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 151 } }, "74": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 13 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 36, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 14, "end_line": 158, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 18, "end_line": 160, "input_file": { "filename": "src/merger.cairo" }, "start_col": 14, "start_line": 160 }, "While expanding the reference 'hash' in:" ], "start_col": 10, "start_line": 158 } }, "75": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 14 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 36, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 6, "end_line": 161, "input_file": { "filename": "src/merger.cairo" }, "start_col": 17, "start_line": 159 } }, "77": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 18 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 38, "__main__.hash_nonce_updates_loop.res": 39 } }, "hints": [], "inst": { "end_col": 40, "end_line": 164, "input_file": { "filename": "src/merger.cairo" }, "start_col": 23, "start_line": 164 } }, "79": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 19 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 38, "__main__.hash_nonce_updates_loop.res": 39 } }, "hints": [], "inst": { "end_col": 48, "end_line": 165, "input_file": { "filename": "src/merger.cairo" }, "start_col": 27, "start_line": 165 } }, "81": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 20 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 38, "__main__.hash_nonce_updates_loop.res": 39 } }, "hints": [], "inst": { "end_col": 6, "end_line": 166, "input_file": { "filename": "src/merger.cairo" }, "start_col": 12, "start_line": 162 } }, "83": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 11, "offset": 0 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 40, "__main__.hash_nonce_updates_loop.res": 39 } }, "hints": [], "inst": { "end_col": 7, "end_line": 166, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 162 } }, "84": { "accessible_scopes": ["__main__", "__main__.get_storage_updates"], "flow_tracking_data": { "ap_tracking": { "group": 12, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 176, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 176 } }, "86": { "accessible_scopes": ["__main__", "__main__.get_storage_updates"], "flow_tracking_data": { "ap_tracking": { "group": 12, "offset": 2 }, "reference_ids": { "__main__.get_storage_updates.storage_updates": 41, "__main__.get_storage_updates.storage_updates_len": 42 } }, "hints": [ { "location": { "end_col": 7, "end_line": 196, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 179 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 26, "end_line": 177, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 197, "input_file": { "filename": "src/merger.cairo" }, "start_col": 29, "start_line": 197 }, "While expanding the reference 'storage_updates' in:" ], "start_col": 11, "start_line": 177 } }, "87": { "accessible_scopes": ["__main__", "__main__.get_storage_updates"], "flow_tracking_data": { "ap_tracking": { "group": 12, "offset": 3 }, "reference_ids": { "__main__.get_storage_updates.storage_updates": 41, "__main__.get_storage_updates.storage_updates_len": 42 } }, "hints": [], "inst": { "end_col": 30, "end_line": 178, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 85, "end_line": 197, "input_file": { "filename": "src/merger.cairo" }, "start_col": 66, "start_line": 197 }, "While expanding the reference 'storage_updates_len' in:" ], "start_col": 11, "start_line": 178 } }, "88": { "accessible_scopes": ["__main__", "__main__.get_storage_updates"], "flow_tracking_data": { "ap_tracking": { "group": 12, "offset": 4 }, "reference_ids": { "__main__.get_storage_updates.storage_updates": 41, "__main__.get_storage_updates.storage_updates_len": 42 } }, "hints": [], "inst": { "end_col": 87, "end_line": 197, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 197 } }, "89": { "accessible_scopes": ["__main__", "__main__.hash_storage_update"], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 0 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 44, "__main__.hash_storage_update.res": 45, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 52, "end_line": 200, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 204, "input_file": { "filename": "src/merger.cairo" }, "start_col": 32, "start_line": 204 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 26, "start_line": 200 } }, "90": { "accessible_scopes": ["__main__", "__main__.hash_storage_update"], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 1 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 44, "__main__.hash_storage_update.res": 45, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 46, "end_line": 203, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 205, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 205 }, "While expanding the reference 'res' in:" ], "start_col": 15, "start_line": 203 } }, "91": { "accessible_scopes": ["__main__", "__main__.hash_storage_update"], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 2 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 44, "__main__.hash_storage_update.res": 45, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 40, "end_line": 205, "input_file": { "filename": "src/merger.cairo" }, "start_col": 14, "start_line": 205 } }, "92": { "accessible_scopes": ["__main__", "__main__.hash_storage_update"], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 3 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 44, "__main__.hash_storage_update.res": 45, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 6, "end_line": 206, "input_file": { "filename": "src/merger.cairo" }, "start_col": 17, "start_line": 204 } }, "94": { "accessible_scopes": ["__main__", "__main__.hash_storage_update"], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 7 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 46, "__main__.hash_storage_update.res": 47, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 42, "end_line": 208, "input_file": { "filename": "src/merger.cairo" }, "start_col": 14, "start_line": 208 } }, "95": { "accessible_scopes": ["__main__", "__main__.hash_storage_update"], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 8 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 46, "__main__.hash_storage_update.res": 47, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 6, "end_line": 209, "input_file": { "filename": "src/merger.cairo" }, "start_col": 17, "start_line": 207 } }, "97": { "accessible_scopes": ["__main__", "__main__.hash_storage_update"], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 12 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 48, "__main__.hash_storage_update.res": 49, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 22, "end_line": 210, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 210 } }, "98": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 0 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 7, "end_line": 216, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 216 } }, "100": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 0 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 58, "end_line": 213, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 58, "end_line": 213, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 217, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 217 }, "While trying to retrieve the implicit argument 'pedersen_ptr' in:" ], "start_col": 32, "start_line": 213 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 32, "start_line": 213 } }, "101": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 1 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 14, "end_line": 214, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 24, "end_line": 217, "input_file": { "filename": "src/merger.cairo" }, "start_col": 21, "start_line": 217 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 214 } }, "102": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 2 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 26, "end_line": 217, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 217 } }, "103": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 0 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 18, "end_line": 219, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 219 } }, "105": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 0 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 58, "end_line": 213, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 63, "end_line": 221, "input_file": { "filename": "src/merger.cairo" }, "start_col": 51, "start_line": 221 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 32, "start_line": 213 } }, "106": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 1 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 43, "end_line": 220, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 79, "end_line": 221, "input_file": { "filename": "src/merger.cairo" }, "start_col": 65, "start_line": 221 }, "While expanding the reference 'storage_update' in:" ], "start_col": 26, "start_line": 220 } }, "107": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 2 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 80, "end_line": 221, "input_file": { "filename": "src/merger.cairo" }, "start_col": 18, "start_line": 221 } }, "109": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 16 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 55, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 63, "end_line": 221, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 222, "input_file": { "filename": "src/merger.cairo" }, "start_col": 32, "start_line": 222 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 51, "start_line": 221 } }, "110": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 17 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 55, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 14, "end_line": 214, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 223, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 223 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 214 } }, "111": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 18 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 55, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 14, "end_line": 221, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 18, "end_line": 223, "input_file": { "filename": "src/merger.cairo" }, "start_col": 14, "start_line": 223 }, "While expanding the reference 'hash' in:" ], "start_col": 10, "start_line": 221 } }, "112": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 19 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 55, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 6, "end_line": 224, "input_file": { "filename": "src/merger.cairo" }, "start_col": 17, "start_line": 222 } }, "114": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 23 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 57, "__main__.hash_storage_updates_loop.res": 58, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 44, "end_line": 227, "input_file": { "filename": "src/merger.cairo" }, "start_col": 25, "start_line": 227 } }, "116": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 24 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 57, "__main__.hash_storage_updates_loop.res": 58, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 52, "end_line": 228, "input_file": { "filename": "src/merger.cairo" }, "start_col": 29, "start_line": 228 } }, "118": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 25 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 57, "__main__.hash_storage_updates_loop.res": 58, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 6, "end_line": 229, "input_file": { "filename": "src/merger.cairo" }, "start_col": 12, "start_line": 225 } }, "120": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 15, "offset": 0 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 59, "__main__.hash_storage_updates_loop.res": 58, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 7, "end_line": 229, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 225 } }, "121": { "accessible_scopes": ["__main__", "__main__.get_contract_updates"], "flow_tracking_data": { "ap_tracking": { "group": 16, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 239, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 239 } }, "123": { "accessible_scopes": ["__main__", "__main__.get_contract_updates"], "flow_tracking_data": { "ap_tracking": { "group": 16, "offset": 2 }, "reference_ids": { "__main__.get_contract_updates.contract_updates": 60, "__main__.get_contract_updates.contract_updates_len": 61 } }, "hints": [ { "location": { "end_col": 7, "end_line": 254, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 242 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 27, "end_line": 240, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 46, "end_line": 255, "input_file": { "filename": "src/merger.cairo" }, "start_col": 30, "start_line": 255 }, "While expanding the reference 'contract_updates' in:" ], "start_col": 11, "start_line": 240 } }, "124": { "accessible_scopes": ["__main__", "__main__.get_contract_updates"], "flow_tracking_data": { "ap_tracking": { "group": 16, "offset": 3 }, "reference_ids": { "__main__.get_contract_updates.contract_updates": 60, "__main__.get_contract_updates.contract_updates_len": 61 } }, "hints": [], "inst": { "end_col": 31, "end_line": 241, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 89, "end_line": 255, "input_file": { "filename": "src/merger.cairo" }, "start_col": 69, "start_line": 255 }, "While expanding the reference 'contract_updates_len' in:" ], "start_col": 11, "start_line": 241 } }, "125": { "accessible_scopes": ["__main__", "__main__.get_contract_updates"], "flow_tracking_data": { "ap_tracking": { "group": 16, "offset": 4 }, "reference_ids": { "__main__.get_contract_updates.contract_updates": 60, "__main__.get_contract_updates.contract_updates_len": 61 } }, "hints": [], "inst": { "end_col": 91, "end_line": 255, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 255 } }, "126": { "accessible_scopes": ["__main__", "__main__.hash_contract_update"], "flow_tracking_data": { "ap_tracking": { "group": 17, "offset": 0 }, "reference_ids": { "__main__.hash_contract_update.contract_update": 62, "__main__.hash_contract_update.pedersen_ptr": 63, "__main__.hash_contract_update.res": 64 } }, "hints": [], "inst": { "end_col": 53, "end_line": 258, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 262, "input_file": { "filename": "src/merger.cairo" }, "start_col": 32, "start_line": 262 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 27, "start_line": 258 } }, "127": { "accessible_scopes": ["__main__", "__main__.hash_contract_update"], "flow_tracking_data": { "ap_tracking": { "group": 17, "offset": 1 }, "reference_ids": { "__main__.hash_contract_update.contract_update": 62, "__main__.hash_contract_update.pedersen_ptr": 63, "__main__.hash_contract_update.res": 64 } }, "hints": [], "inst": { "end_col": 47, "end_line": 261, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 263, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 263 }, "While expanding the reference 'res' in:" ], "start_col": 15, "start_line": 261 } }, "128": { "accessible_scopes": ["__main__", "__main__.hash_contract_update"], "flow_tracking_data": { "ap_tracking": { "group": 17, "offset": 2 }, "reference_ids": { "__main__.hash_contract_update.contract_update": 62, "__main__.hash_contract_update.pedersen_ptr": 63, "__main__.hash_contract_update.res": 64 } }, "hints": [], "inst": { "end_col": 40, "end_line": 263, "input_file": { "filename": "src/merger.cairo" }, "start_col": 14, "start_line": 263 } }, "129": { "accessible_scopes": ["__main__", "__main__.hash_contract_update"], "flow_tracking_data": { "ap_tracking": { "group": 17, "offset": 3 }, "reference_ids": { "__main__.hash_contract_update.contract_update": 62, "__main__.hash_contract_update.pedersen_ptr": 63, "__main__.hash_contract_update.res": 64 } }, "hints": [], "inst": { "end_col": 6, "end_line": 264, "input_file": { "filename": "src/merger.cairo" }, "start_col": 17, "start_line": 262 } }, "131": { "accessible_scopes": ["__main__", "__main__.hash_contract_update"], "flow_tracking_data": { "ap_tracking": { "group": 17, "offset": 7 }, "reference_ids": { "__main__.hash_contract_update.contract_update": 62, "__main__.hash_contract_update.pedersen_ptr": 65, "__main__.hash_contract_update.res": 66 } }, "hints": [], "inst": { "end_col": 22, "end_line": 265, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 265 } }, "132": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 0 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 7, "end_line": 271, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 271 } }, "134": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 0 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 59, "end_line": 268, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 59, "end_line": 268, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 272, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 272 }, "While trying to retrieve the implicit argument 'pedersen_ptr' in:" ], "start_col": 33, "start_line": 268 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 33, "start_line": 268 } }, "135": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 1 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 14, "end_line": 269, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 24, "end_line": 272, "input_file": { "filename": "src/merger.cairo" }, "start_col": 21, "start_line": 272 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 269 } }, "136": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 2 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 26, "end_line": 272, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 272 } }, "137": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 0 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 18, "end_line": 274, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 274 } }, "139": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 0 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 59, "end_line": 268, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 64, "end_line": 276, "input_file": { "filename": "src/merger.cairo" }, "start_col": 52, "start_line": 276 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 33, "start_line": 268 } }, "140": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 1 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 45, "end_line": 275, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 81, "end_line": 276, "input_file": { "filename": "src/merger.cairo" }, "start_col": 66, "start_line": 276 }, "While expanding the reference 'contract_update' in:" ], "start_col": 27, "start_line": 275 } }, "141": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 2 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 82, "end_line": 276, "input_file": { "filename": "src/merger.cairo" }, "start_col": 18, "start_line": 276 } }, "143": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 11 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 72, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 64, "end_line": 276, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 277, "input_file": { "filename": "src/merger.cairo" }, "start_col": 32, "start_line": 277 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 52, "start_line": 276 } }, "144": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 12 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 72, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 14, "end_line": 269, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 278, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 278 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 269 } }, "145": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 13 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 72, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 14, "end_line": 276, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 18, "end_line": 278, "input_file": { "filename": "src/merger.cairo" }, "start_col": 14, "start_line": 278 }, "While expanding the reference 'hash' in:" ], "start_col": 10, "start_line": 276 } }, "146": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 14 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 72, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 6, "end_line": 279, "input_file": { "filename": "src/merger.cairo" }, "start_col": 17, "start_line": 277 } }, "148": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 18 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 74, "__main__.hash_contract_updates_loop.res": 75 } }, "hints": [], "inst": { "end_col": 46, "end_line": 282, "input_file": { "filename": "src/merger.cairo" }, "start_col": 26, "start_line": 282 } }, "150": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 19 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 74, "__main__.hash_contract_updates_loop.res": 75 } }, "hints": [], "inst": { "end_col": 54, "end_line": 283, "input_file": { "filename": "src/merger.cairo" }, "start_col": 30, "start_line": 283 } }, "152": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 20 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 74, "__main__.hash_contract_updates_loop.res": 75 } }, "hints": [], "inst": { "end_col": 6, "end_line": 284, "input_file": { "filename": "src/merger.cairo" }, "start_col": 12, "start_line": 280 } }, "154": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 19, "offset": 0 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 76, "__main__.hash_contract_updates_loop.res": 75 } }, "hints": [], "inst": { "end_col": 7, "end_line": 284, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 280 } }, "155": { "accessible_scopes": ["__main__", "__main__.get_declared_classes"], "flow_tracking_data": { "ap_tracking": { "group": 20, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 293, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 293 } }, "157": { "accessible_scopes": ["__main__", "__main__.get_declared_classes"], "flow_tracking_data": { "ap_tracking": { "group": 20, "offset": 2 }, "reference_ids": { "__main__.get_declared_classes.declared_classes": 77, "__main__.get_declared_classes.declared_classes_len": 78 } }, "hints": [ { "location": { "end_col": 7, "end_line": 308, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 296 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 27, "end_line": 294, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 46, "end_line": 309, "input_file": { "filename": "src/merger.cairo" }, "start_col": 30, "start_line": 309 }, "While expanding the reference 'declared_classes' in:" ], "start_col": 11, "start_line": 294 } }, "158": { "accessible_scopes": ["__main__", "__main__.get_declared_classes"], "flow_tracking_data": { "ap_tracking": { "group": 20, "offset": 3 }, "reference_ids": { "__main__.get_declared_classes.declared_classes": 77, "__main__.get_declared_classes.declared_classes_len": 78 } }, "hints": [], "inst": { "end_col": 31, "end_line": 295, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 89, "end_line": 309, "input_file": { "filename": "src/merger.cairo" }, "start_col": 69, "start_line": 309 }, "While expanding the reference 'declared_classes_len' in:" ], "start_col": 11, "start_line": 295 } }, "159": { "accessible_scopes": ["__main__", "__main__.get_declared_classes"], "flow_tracking_data": { "ap_tracking": { "group": 20, "offset": 4 }, "reference_ids": { "__main__.get_declared_classes.declared_classes": 77, "__main__.get_declared_classes.declared_classes_len": 78 } }, "hints": [], "inst": { "end_col": 91, "end_line": 309, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 309 } }, "160": { "accessible_scopes": ["__main__", "__main__.hash_declared_class"], "flow_tracking_data": { "ap_tracking": { "group": 21, "offset": 0 }, "reference_ids": { "__main__.hash_declared_class.declared_class": 79, "__main__.hash_declared_class.pedersen_ptr": 80, "__main__.hash_declared_class.res": 81 } }, "hints": [], "inst": { "end_col": 52, "end_line": 312, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 316, "input_file": { "filename": "src/merger.cairo" }, "start_col": 32, "start_line": 316 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 26, "start_line": 312 } }, "161": { "accessible_scopes": ["__main__", "__main__.hash_declared_class"], "flow_tracking_data": { "ap_tracking": { "group": 21, "offset": 1 }, "reference_ids": { "__main__.hash_declared_class.declared_class": 79, "__main__.hash_declared_class.pedersen_ptr": 80, "__main__.hash_declared_class.res": 81 } }, "hints": [], "inst": { "end_col": 40, "end_line": 315, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 317, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 317 }, "While expanding the reference 'res' in:" ], "start_col": 15, "start_line": 315 } }, "162": { "accessible_scopes": ["__main__", "__main__.hash_declared_class"], "flow_tracking_data": { "ap_tracking": { "group": 21, "offset": 2 }, "reference_ids": { "__main__.hash_declared_class.declared_class": 79, "__main__.hash_declared_class.pedersen_ptr": 80, "__main__.hash_declared_class.res": 81 } }, "hints": [], "inst": { "end_col": 48, "end_line": 317, "input_file": { "filename": "src/merger.cairo" }, "start_col": 14, "start_line": 317 } }, "163": { "accessible_scopes": ["__main__", "__main__.hash_declared_class"], "flow_tracking_data": { "ap_tracking": { "group": 21, "offset": 3 }, "reference_ids": { "__main__.hash_declared_class.declared_class": 79, "__main__.hash_declared_class.pedersen_ptr": 80, "__main__.hash_declared_class.res": 81 } }, "hints": [], "inst": { "end_col": 6, "end_line": 318, "input_file": { "filename": "src/merger.cairo" }, "start_col": 17, "start_line": 316 } }, "165": { "accessible_scopes": ["__main__", "__main__.hash_declared_class"], "flow_tracking_data": { "ap_tracking": { "group": 21, "offset": 7 }, "reference_ids": { "__main__.hash_declared_class.declared_class": 79, "__main__.hash_declared_class.pedersen_ptr": 82, "__main__.hash_declared_class.res": 83 } }, "hints": [], "inst": { "end_col": 22, "end_line": 319, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 319 } }, "166": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 0 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 7, "end_line": 325, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 325 } }, "168": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 0 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 59, "end_line": 322, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 59, "end_line": 322, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 326, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 326 }, "While trying to retrieve the implicit argument 'pedersen_ptr' in:" ], "start_col": 33, "start_line": 322 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 33, "start_line": 322 } }, "169": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 1 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 14, "end_line": 323, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 24, "end_line": 326, "input_file": { "filename": "src/merger.cairo" }, "start_col": 21, "start_line": 326 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 323 } }, "170": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 2 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 26, "end_line": 326, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 326 } }, "171": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 0 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 18, "end_line": 328, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 328 } }, "173": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 0 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 59, "end_line": 322, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 63, "end_line": 330, "input_file": { "filename": "src/merger.cairo" }, "start_col": 51, "start_line": 330 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 33, "start_line": 322 } }, "174": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 1 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 44, "end_line": 329, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 79, "end_line": 330, "input_file": { "filename": "src/merger.cairo" }, "start_col": 65, "start_line": 330 }, "While expanding the reference 'declared_class' in:" ], "start_col": 26, "start_line": 329 } }, "175": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 2 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 80, "end_line": 330, "input_file": { "filename": "src/merger.cairo" }, "start_col": 18, "start_line": 330 } }, "177": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 11 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 89, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 63, "end_line": 330, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 331, "input_file": { "filename": "src/merger.cairo" }, "start_col": 32, "start_line": 331 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 51, "start_line": 330 } }, "178": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 12 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 89, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 14, "end_line": 323, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 332, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 332 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 323 } }, "179": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 13 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 89, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 14, "end_line": 330, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 18, "end_line": 332, "input_file": { "filename": "src/merger.cairo" }, "start_col": 14, "start_line": 332 }, "While expanding the reference 'hash' in:" ], "start_col": 10, "start_line": 330 } }, "180": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 14 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 89, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 6, "end_line": 333, "input_file": { "filename": "src/merger.cairo" }, "start_col": 17, "start_line": 331 } }, "182": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 18 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 91, "__main__.hash_declared_classes_loop.res": 92 } }, "hints": [], "inst": { "end_col": 46, "end_line": 336, "input_file": { "filename": "src/merger.cairo" }, "start_col": 26, "start_line": 336 } }, "184": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 19 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 91, "__main__.hash_declared_classes_loop.res": 92 } }, "hints": [], "inst": { "end_col": 54, "end_line": 337, "input_file": { "filename": "src/merger.cairo" }, "start_col": 30, "start_line": 337 } }, "186": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 20 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 91, "__main__.hash_declared_classes_loop.res": 92 } }, "hints": [], "inst": { "end_col": 6, "end_line": 338, "input_file": { "filename": "src/merger.cairo" }, "start_col": 12, "start_line": 334 } }, "188": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 23, "offset": 0 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 93, "__main__.hash_declared_classes_loop.res": 92 } }, "hints": [], "inst": { "end_col": 7, "end_line": 338, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 334 } }, "189": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 0 }, "reference_ids": { "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 7, "end_line": 343, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 343 } }, "191": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 0 }, "reference_ids": { "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 26, "end_line": 344, "input_file": { "filename": "src/merger.cairo" }, "start_col": 16, "start_line": 344 } }, "192": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 1 }, "reference_ids": { "__main__.replace_or_append.__temp0": 98, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 33, "end_line": 344, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 344 } }, "193": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 1 }, "reference_ids": { "__main__.replace_or_append.__temp0": 98, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 27, "end_line": 345, "input_file": { "filename": "src/merger.cairo" }, "start_col": 22, "start_line": 345 } }, "195": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 2 }, "reference_ids": { "__main__.replace_or_append.__temp0": 98, "__main__.replace_or_append.__temp1": 99, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 28, "end_line": 345, "input_file": { "filename": "src/merger.cairo" }, "start_col": 16, "start_line": 345 } }, "196": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 3 }, "reference_ids": { "__main__.replace_or_append.__temp0": 98, "__main__.replace_or_append.__temp1": 99, "__main__.replace_or_append.__temp2": 100, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 37, "end_line": 345, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 345 } }, "197": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 3 }, "reference_ids": { "__main__.replace_or_append.__temp0": 98, "__main__.replace_or_append.__temp1": 99, "__main__.replace_or_append.__temp2": 100, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 27, "end_line": 346, "input_file": { "filename": "src/merger.cairo" }, "start_col": 26, "start_line": 346 } }, "199": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 4 }, "reference_ids": { "__main__.replace_or_append.__temp0": 98, "__main__.replace_or_append.__temp1": 99, "__main__.replace_or_append.__temp2": 100, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 29, "end_line": 346, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 346 } }, "200": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 0 }, "reference_ids": { "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 17, "end_line": 349, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 349 } }, "201": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 1 }, "reference_ids": { "__main__.replace_or_append.__temp3": 101, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 24, "end_line": 349, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 349 } }, "202": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 2 }, "reference_ids": { "__main__.replace_or_append.__temp3": 101, "__main__.replace_or_append.__temp4": 102, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 7, "end_line": 349, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 349 } }, "204": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 2 }, "reference_ids": { "__main__.replace_or_append.__temp3": 101, "__main__.replace_or_append.__temp4": 102, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 25, "end_line": 350, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 350 } }, "205": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 2 }, "reference_ids": { "__main__.replace_or_append.__temp3": 101, "__main__.replace_or_append.__temp4": 102, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 27, "end_line": 351, "input_file": { "filename": "src/merger.cairo" }, "start_col": 26, "start_line": 351 } }, "207": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 3 }, "reference_ids": { "__main__.replace_or_append.__temp3": 101, "__main__.replace_or_append.__temp4": 102, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 29, "end_line": 351, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 351 } }, "208": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 2 }, "reference_ids": { "__main__.replace_or_append.__temp3": 101, "__main__.replace_or_append.__temp4": 102, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 39, "end_line": 354, "input_file": { "filename": "src/merger.cairo" }, "start_col": 30, "start_line": 354 } }, "210": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 3 }, "reference_ids": { "__main__.replace_or_append.__temp3": 101, "__main__.replace_or_append.__temp4": 102, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 48, "end_line": 354, "input_file": { "filename": "src/merger.cairo" }, "start_col": 41, "start_line": 354 } }, "212": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 4 }, "reference_ids": { "__main__.replace_or_append.__temp3": 101, "__main__.replace_or_append.__temp4": 102, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 58, "end_line": 342, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 53, "end_line": 354, "input_file": { "filename": "src/merger.cairo" }, "start_col": 50, "start_line": 354 }, "While expanding the reference 'key' in:" ], "start_col": 49, "start_line": 342 } }, "213": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 5 }, "reference_ids": { "__main__.replace_or_append.__temp3": 101, "__main__.replace_or_append.__temp4": 102, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 71, "end_line": 342, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 60, "end_line": 354, "input_file": { "filename": "src/merger.cairo" }, "start_col": 55, "start_line": 354 }, "While expanding the reference 'value' in:" ], "start_col": 60, "start_line": 342 } }, "214": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 6 }, "reference_ids": { "__main__.replace_or_append.__temp3": 101, "__main__.replace_or_append.__temp4": 102, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 61, "end_line": 354, "input_file": { "filename": "src/merger.cairo" }, "start_col": 12, "start_line": 354 } }, "216": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 25, "offset": 0 }, "reference_ids": { "__main__.replace_or_append.__temp3": 101, "__main__.replace_or_append.__temp4": 102, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 62, "end_line": 354, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 354 } }, "217": { "accessible_scopes": ["__main__", "__main__.get_merged_da"], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 358, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 358 } }, "219": { "accessible_scopes": ["__main__", "__main__.get_merged_da"], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 2 }, "reference_ids": { "__main__.get_merged_da.merged": 103, "__main__.get_merged_da.merged_len": 104 } }, "hints": [ { "location": { "end_col": 7, "end_line": 389, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 361 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 17, "end_line": 359, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 28, "end_line": 392, "input_file": { "filename": "src/merger.cairo" }, "start_col": 22, "start_line": 392 }, "While expanding the reference 'merged' in:" ], "start_col": 11, "start_line": 359 } }, "220": { "accessible_scopes": ["__main__", "__main__.get_merged_da"], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 3 }, "reference_ids": { "__main__.get_merged_da.merged": 103, "__main__.get_merged_da.merged_len": 104 } }, "hints": [], "inst": { "end_col": 21, "end_line": 360, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 36, "end_line": 393, "input_file": { "filename": "src/merger.cairo" }, "start_col": 26, "start_line": 393 }, "While expanding the reference 'merged_len' in:" ], "start_col": 11, "start_line": 360 } }, "221": { "accessible_scopes": ["__main__", "__main__.get_merged_da"], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 4 }, "reference_ids": { "__main__.get_merged_da.merged": 103, "__main__.get_merged_da.merged_len": 104 } }, "hints": [], "inst": { "end_col": 7, "end_line": 395, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 391 } }, "222": { "accessible_scopes": ["__main__", "__main__.output_array"], "flow_tracking_data": { "ap_tracking": { "group": 27, "offset": 0 }, "reference_ids": { "__main__.output_array.array": 105, "__main__.output_array.len": 106, "__main__.output_array.output_ptr": 107 } }, "hints": [], "inst": { "end_col": 7, "end_line": 399, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 399 } }, "224": { "accessible_scopes": ["__main__", "__main__.output_array"], "flow_tracking_data": { "ap_tracking": { "group": 27, "offset": 0 }, "reference_ids": { "__main__.output_array.array": 105, "__main__.output_array.len": 106, "__main__.output_array.output_ptr": 107 } }, "hints": [], "inst": { "end_col": 36, "end_line": 398, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 36, "end_line": 398, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 19, "end_line": 400, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 400 }, "While trying to retrieve the implicit argument 'output_ptr' in:" ], "start_col": 19, "start_line": 398 }, "While expanding the reference 'output_ptr' in:" ], "start_col": 19, "start_line": 398 } }, "225": { "accessible_scopes": ["__main__", "__main__.output_array"], "flow_tracking_data": { "ap_tracking": { "group": 27, "offset": 1 }, "reference_ids": { "__main__.output_array.array": 105, "__main__.output_array.len": 106, "__main__.output_array.output_ptr": 107 } }, "hints": [], "inst": { "end_col": 19, "end_line": 400, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 400 } }, "226": { "accessible_scopes": ["__main__", "__main__.output_array"], "flow_tracking_data": { "ap_tracking": { "group": 27, "offset": 0 }, "reference_ids": { "__main__.output_array.array": 105, "__main__.output_array.len": 106, "__main__.output_array.output_ptr": 107 } }, "hints": [], "inst": { "end_col": 18, "end_line": 402, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 402 } }, "228": { "accessible_scopes": ["__main__", "__main__.output_array"], "flow_tracking_data": { "ap_tracking": { "group": 27, "offset": 0 }, "reference_ids": { "__main__.output_array.array": 105, "__main__.output_array.len": 106, "__main__.output_array.output_ptr": 107, "__main__.output_array.value": 108 } }, "hints": [], "inst": { "end_col": 24, "end_line": 403, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 33, "end_line": 404, "input_file": { "filename": "src/merger.cairo" }, "start_col": 28, "start_line": 404 }, "While expanding the reference 'value' in:" ], "start_col": 17, "start_line": 403 } }, "229": { "accessible_scopes": ["__main__", "__main__.output_array"], "flow_tracking_data": { "ap_tracking": { "group": 27, "offset": 1 }, "reference_ids": { "__main__.output_array.__temp5": 109, "__main__.output_array.array": 105, "__main__.output_array.len": 106, "__main__.output_array.output_ptr": 107, "__main__.output_array.value": 108 } }, "hints": [], "inst": { "end_col": 34, "end_line": 404, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 404 } }, "230": { "accessible_scopes": ["__main__", "__main__.output_array"], "flow_tracking_data": { "ap_tracking": { "group": 27, "offset": 1 }, "reference_ids": { "__main__.output_array.__temp5": 109, "__main__.output_array.array": 105, "__main__.output_array.len": 106, "__main__.output_array.output_ptr": 110, "__main__.output_array.value": 108 } }, "hints": [], "inst": { "end_col": 36, "end_line": 405, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 46, "end_line": 406, "input_file": { "filename": "src/merger.cairo" }, "start_col": 36, "start_line": 406 }, "While expanding the reference 'output_ptr' in:" ], "start_col": 22, "start_line": 405 } }, "232": { "accessible_scopes": ["__main__", "__main__.output_array"], "flow_tracking_data": { "ap_tracking": { "group": 27, "offset": 2 }, "reference_ids": { "__main__.output_array.__temp5": 109, "__main__.output_array.array": 105, "__main__.output_array.len": 106, "__main__.output_array.output_ptr": 110, "__main__.output_array.value": 108 } }, "hints": [], "inst": { "end_col": 57, "end_line": 406, "input_file": { "filename": "src/merger.cairo" }, "start_col": 48, "start_line": 406 } }, "234": { "accessible_scopes": ["__main__", "__main__.output_array"], "flow_tracking_data": { "ap_tracking": { "group": 27, "offset": 3 }, "reference_ids": { "__main__.output_array.__temp5": 109, "__main__.output_array.array": 105, "__main__.output_array.len": 106, "__main__.output_array.output_ptr": 110, "__main__.output_array.value": 108 } }, "hints": [], "inst": { "end_col": 66, "end_line": 406, "input_file": { "filename": "src/merger.cairo" }, "start_col": 59, "start_line": 406 } }, "236": { "accessible_scopes": ["__main__", "__main__.output_array"], "flow_tracking_data": { "ap_tracking": { "group": 27, "offset": 4 }, "reference_ids": { "__main__.output_array.__temp5": 109, "__main__.output_array.array": 105, "__main__.output_array.len": 106, "__main__.output_array.output_ptr": 110, "__main__.output_array.value": 108 } }, "hints": [], "inst": { "end_col": 67, "end_line": 406, "input_file": { "filename": "src/merger.cairo" }, "start_col": 12, "start_line": 406 } }, "238": { "accessible_scopes": ["__main__", "__main__.output_array"], "flow_tracking_data": { "ap_tracking": { "group": 28, "offset": 0 }, "reference_ids": { "__main__.output_array.__temp5": 109, "__main__.output_array.array": 105, "__main__.output_array.len": 106, "__main__.output_array.output_ptr": 111, "__main__.output_array.value": 108 } }, "hints": [], "inst": { "end_col": 68, "end_line": 406, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 406 } }, "239": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 21, "end_line": 426, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 426 } }, "241": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 14 }, "reference_ids": { "__main__.get_input.input_config": 112 } }, "hints": [], "inst": { "end_col": 28, "end_line": 430, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 430 } }, "243": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 20 }, "reference_ids": { "__main__.get_input.input_config": 112, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114 } }, "hints": [], "inst": { "end_col": 30, "end_line": 434, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 434 } }, "245": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 26 }, "reference_ids": { "__main__.get_input.input_config": 112, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116 } }, "hints": [], "inst": { "end_col": 31, "end_line": 438, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 438 } }, "247": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 32 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.input_config": 112, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116 } }, "hints": [], "inst": { "end_col": 31, "end_line": 442, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 442 } }, "249": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 38 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116 } }, "hints": [], "inst": { "end_col": 51, "end_line": 444, "input_file": { "filename": "src/merger.cairo" }, "start_col": 37, "start_line": 444 } }, "251": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 48 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116 } }, "hints": [], "inst": { "end_col": 50, "end_line": 445, "input_file": { "filename": "src/merger.cairo" }, "start_col": 36, "start_line": 445 } }, "253": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 54 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 34, "end_line": 425, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 38, "end_line": 448, "input_file": { "filename": "src/merger.cairo" }, "start_col": 26, "start_line": 448 }, "While expanding the reference 'input_config' in:" ], "start_col": 9, "start_line": 425 } }, "254": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 55 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 34, "end_line": 425, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 38, "end_line": 448, "input_file": { "filename": "src/merger.cairo" }, "start_col": 26, "start_line": 448 }, "While expanding the reference 'input_config' in:" ], "start_col": 9, "start_line": 425 } }, "255": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 56 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 34, "end_line": 425, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 38, "end_line": 448, "input_file": { "filename": "src/merger.cairo" }, "start_col": 26, "start_line": 448 }, "While expanding the reference 'input_config' in:" ], "start_col": 9, "start_line": 425 } }, "256": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 57 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 34, "end_line": 425, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 38, "end_line": 448, "input_file": { "filename": "src/merger.cairo" }, "start_col": 26, "start_line": 448 }, "While expanding the reference 'input_config' in:" ], "start_col": 9, "start_line": 425 } }, "257": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 58 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 32, "end_line": 429, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 48, "end_line": 449, "input_file": { "filename": "src/merger.cairo" }, "start_col": 31, "start_line": 449 }, "While expanding the reference 'nonce_updates_len' in:" ], "start_col": 9, "start_line": 429 } }, "258": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 59 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 37, "end_line": 428, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 40, "end_line": 450, "input_file": { "filename": "src/merger.cairo" }, "start_col": 27, "start_line": 450 }, "While expanding the reference 'nonce_updates' in:" ], "start_col": 9, "start_line": 428 } }, "259": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 60 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 34, "end_line": 433, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 52, "end_line": 451, "input_file": { "filename": "src/merger.cairo" }, "start_col": 33, "start_line": 451 }, "While expanding the reference 'storage_updates_len' in:" ], "start_col": 9, "start_line": 433 } }, "260": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 61 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 41, "end_line": 432, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 452, "input_file": { "filename": "src/merger.cairo" }, "start_col": 29, "start_line": 452 }, "While expanding the reference 'storage_updates' in:" ], "start_col": 9, "start_line": 432 } }, "261": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 62 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 35, "end_line": 437, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 54, "end_line": 453, "input_file": { "filename": "src/merger.cairo" }, "start_col": 34, "start_line": 453 }, "While expanding the reference 'contract_updates_len' in:" ], "start_col": 9, "start_line": 437 } }, "262": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 63 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 43, "end_line": 436, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 46, "end_line": 454, "input_file": { "filename": "src/merger.cairo" }, "start_col": 30, "start_line": 454 }, "While expanding the reference 'contract_updates' in:" ], "start_col": 9, "start_line": 436 } }, "263": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 64 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 35, "end_line": 441, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 54, "end_line": 455, "input_file": { "filename": "src/merger.cairo" }, "start_col": 34, "start_line": 455 }, "While expanding the reference 'declared_classes_len' in:" ], "start_col": 9, "start_line": 441 } }, "264": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 65 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 42, "end_line": 440, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 46, "end_line": 456, "input_file": { "filename": "src/merger.cairo" }, "start_col": 30, "start_line": 456 }, "While expanding the reference 'declared_classes' in:" ], "start_col": 9, "start_line": 440 } }, "265": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 66 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 33, "end_line": 444, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 30, "end_line": 457, "input_file": { "filename": "src/merger.cairo" }, "start_col": 22, "start_line": 457 }, "While expanding the reference 'messages' in:" ], "start_col": 10, "start_line": 444 } }, "266": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 67 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 33, "end_line": 444, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 30, "end_line": 457, "input_file": { "filename": "src/merger.cairo" }, "start_col": 22, "start_line": 457 }, "While expanding the reference 'messages' in:" ], "start_col": 10, "start_line": 444 } }, "267": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 68 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 33, "end_line": 444, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 30, "end_line": 457, "input_file": { "filename": "src/merger.cairo" }, "start_col": 22, "start_line": 457 }, "While expanding the reference 'messages' in:" ], "start_col": 10, "start_line": 444 } }, "268": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 69 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 33, "end_line": 444, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 30, "end_line": 457, "input_file": { "filename": "src/merger.cairo" }, "start_col": 22, "start_line": 457 }, "While expanding the reference 'messages' in:" ], "start_col": 10, "start_line": 444 } }, "269": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 70 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 32, "end_line": 445, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 30, "end_line": 458, "input_file": { "filename": "src/merger.cairo" }, "start_col": 22, "start_line": 458 }, "While expanding the reference 'world_da' in:" ], "start_col": 10, "start_line": 445 } }, "270": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 71 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 32, "end_line": 445, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 30, "end_line": 458, "input_file": { "filename": "src/merger.cairo" }, "start_col": 22, "start_line": 458 }, "While expanding the reference 'world_da' in:" ], "start_col": 10, "start_line": 445 } }, "271": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 72 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 7, "end_line": 460, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 447 } }, "272": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 18, "end_line": 464, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 464 } }, "274": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 37 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [ { "location": { "end_col": 7, "end_line": 469, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 467 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 46, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 35, "start_line": 470 } }, "276": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "277": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "278": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "279": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "280": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "281": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "282": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "283": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "284": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "285": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "286": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "287": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "288": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "289": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "290": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "291": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "292": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "293": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "294": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [ { "location": { "end_col": 7, "end_line": 474, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 472 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 46, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 35, "start_line": 475 } }, "296": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "297": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "298": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "299": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "300": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "301": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "302": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "303": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "304": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "305": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "306": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "307": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "308": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "309": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "310": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "311": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "312": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "313": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "314": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 65, "end_line": 478, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 478 } }, "315": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 29, "end_line": 479, "input_file": { "filename": "src/merger.cairo" }, "start_col": 28, "start_line": 479 } }, "317": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 186 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 30, "end_line": 479, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 479 } }, "318": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 186 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 62, "end_line": 480, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 480 } }, "319": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 186 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 60, "end_line": 481, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 481 } }, "320": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 186 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 61, "end_line": 482, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 482 } }, "321": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 186 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 58, "end_line": 486, "input_file": { "filename": "src/merger.cairo" }, "start_col": 43, "start_line": 486 } }, "323": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 192 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 133 } }, "hints": [], "inst": { "end_col": 56, "end_line": 463, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 71, "end_line": 488, "input_file": { "filename": "src/merger.cairo" }, "start_col": 59, "start_line": 488 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 30, "start_line": 463 } }, "324": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 193 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 133 } }, "hints": [], "inst": { "end_col": 26, "end_line": 487, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 22, "end_line": 489, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 489 }, "While expanding the reference 'world_da_hash' in:" ], "start_col": 25, "start_line": 487 } }, "326": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 194 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 133 } }, "hints": [], "inst": { "end_col": 48, "end_line": 489, "input_file": { "filename": "src/merger.cairo" }, "start_col": 24, "start_line": 489 } }, "327": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 195 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 133 } }, "hints": [], "inst": { "end_col": 78, "end_line": 489, "input_file": { "filename": "src/merger.cairo" }, "start_col": 50, "start_line": 489 } }, "328": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 196 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 133 } }, "hints": [], "inst": { "end_col": 6, "end_line": 490, "input_file": { "filename": "src/merger.cairo" }, "start_col": 27, "start_line": 488 } }, "330": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 0 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 134, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 71, "end_line": 488, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 71, "end_line": 488, "input_file": { "filename": "src/merger.cairo" }, "start_col": 59, "start_line": 488 }, "While auto generating local variable for 'pedersen_ptr'." ], "start_col": 59, "start_line": 488 } }, "331": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 0 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 42, "end_line": 491, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 491 } }, "332": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 0 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 137, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 127, "end_line": 496, "input_file": { "filename": "src/merger.cairo" }, "start_col": 28, "start_line": 496 } }, "333": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 1 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 137, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 128, "end_line": 496, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 496 } }, "334": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 1 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 139, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 36, "end_line": 497, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 39, "end_line": 498, "input_file": { "filename": "src/merger.cairo" }, "start_col": 29, "start_line": 498 }, "While expanding the reference 'output_ptr' in:" ], "start_col": 22, "start_line": 497 } }, "336": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 2 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 139, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 85, "end_line": 498, "input_file": { "filename": "src/merger.cairo" }, "start_col": 41, "start_line": 498 } }, "337": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 3 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 139, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 135, "end_line": 498, "input_file": { "filename": "src/merger.cairo" }, "start_col": 87, "start_line": 498 } }, "338": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 4 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 139, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 136, "end_line": 498, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 498 } }, "340": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 32, "offset": 0 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 140, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 85, "end_line": 499, "input_file": { "filename": "src/merger.cairo" }, "start_col": 41, "start_line": 499 } }, "341": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 32, "offset": 1 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 140, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 135, "end_line": 499, "input_file": { "filename": "src/merger.cairo" }, "start_col": 87, "start_line": 499 } }, "342": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 32, "offset": 2 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 140, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 136, "end_line": 499, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 499 } }, "344": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 33, "offset": 0 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 141, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 127, "end_line": 501, "input_file": { "filename": "src/merger.cairo" }, "start_col": 28, "start_line": 501 } }, "345": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 33, "offset": 1 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.__temp8": 142, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 141, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 128, "end_line": 501, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 501 } }, "346": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 33, "offset": 1 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.__temp8": 142, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 143, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 36, "end_line": 502, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 39, "end_line": 503, "input_file": { "filename": "src/merger.cairo" }, "start_col": 29, "start_line": 503 }, "While expanding the reference 'output_ptr' in:" ], "start_col": 22, "start_line": 502 } }, "348": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 33, "offset": 2 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.__temp8": 142, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 143, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 85, "end_line": 503, "input_file": { "filename": "src/merger.cairo" }, "start_col": 41, "start_line": 503 } }, "349": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 33, "offset": 3 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.__temp8": 142, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 143, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 135, "end_line": 503, "input_file": { "filename": "src/merger.cairo" }, "start_col": 87, "start_line": 503 } }, "350": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 33, "offset": 4 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.__temp8": 142, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 143, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 136, "end_line": 503, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 503 } }, "352": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 34, "offset": 0 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.__temp8": 142, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 144, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 85, "end_line": 504, "input_file": { "filename": "src/merger.cairo" }, "start_col": 41, "start_line": 504 } }, "353": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 34, "offset": 1 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.__temp8": 142, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 144, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 135, "end_line": 504, "input_file": { "filename": "src/merger.cairo" }, "start_col": 87, "start_line": 504 } }, "354": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 34, "offset": 2 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.__temp8": 142, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 144, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 136, "end_line": 504, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 504 } }, "356": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 35, "offset": 0 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.__temp8": 142, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 145, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 71, "end_line": 488, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 71, "end_line": 488, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 56, "end_line": 463, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 15, "end_line": 508, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 508 }, "While trying to retrieve the implicit argument 'pedersen_ptr' in:" ], "start_col": 30, "start_line": 463 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 59, "start_line": 488 }, "While auto generating local variable for 'pedersen_ptr'." ], "start_col": 59, "start_line": 488 } }, "357": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 35, "offset": 1 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.__temp8": 142, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 145, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 79, "end_line": 463, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 79, "end_line": 463, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 15, "end_line": 508, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 508 }, "While trying to retrieve the implicit argument 'range_check_ptr' in:" ], "start_col": 58, "start_line": 463 }, "While expanding the reference 'range_check_ptr' in:" ], "start_col": 58, "start_line": 463 } }, "358": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 35, "offset": 2 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.__temp8": 142, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 145, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 99, "end_line": 463, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 99, "end_line": 463, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 15, "end_line": 508, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 508 }, "While trying to retrieve the implicit argument 'bitwise_ptr' in:" ], "start_col": 81, "start_line": 463 }, "While expanding the reference 'bitwise_ptr' in:" ], "start_col": 81, "start_line": 463 } }, "359": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 35, "offset": 3 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.__temp8": 142, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 145, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 15, "end_line": 508, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 508 } } } }, "hints": { "14": [ { "accessible_scopes": ["__main__", "__main__.get_hashes"], "code": "ids.prev_state_root = int(prepared_program_input[\"prev_state_root\"])\nids.block_number = int(prepared_program_input[\"block_number\"])\nids.block_hash = int(prepared_program_input[\"block_hash\"])\nids.config_hash = int(prepared_program_input[\"config_hash\"])", "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 8 }, "reference_ids": { "__main__.get_hashes.block_hash": 8, "__main__.get_hashes.block_number": 7, "__main__.get_hashes.config_hash": 9, "__main__.get_hashes.input_config": 5, "__main__.get_hashes.prev_state_root": 6 } } } ], "21": [ { "accessible_scopes": ["__main__", "__main__.get_world_da"], "code": "world_da = [int(wd) for wd in prepared_program_input[\"world_da\"]]\nids.world_da = segments.gen_arg(world_da)\nids.world_da_len = len(world_da)", "flow_tracking_data": { "ap_tracking": { "group": 4, "offset": 2 }, "reference_ids": { "__main__.get_world_da.world_da": 10, "__main__.get_world_da.world_da_len": 11 } } } ], "45": [ { "accessible_scopes": ["__main__", "__main__.get_messages"], "code": "message_to_starknet_segment = \\\n [int(x) for x in prepared_program_input[\"message_to_starknet_segment\"]]\nmessage_to_appchain_segment = \\\n [int(x) for x in prepared_program_input[\"message_to_appchain_segment\"]]\n\nids.message_to_starknet_segment = \\\n segments.gen_arg(message_to_starknet_segment)\nids.message_to_starknet_segment_len = \\\n len(message_to_starknet_segment)\nids.message_to_appchain_segment = \\\n segments.gen_arg(message_to_appchain_segment)\nids.message_to_appchain_segment_len = \\\n len(message_to_appchain_segment)", "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 4 }, "reference_ids": { "__main__.get_messages.message_to_appchain_segment": 22, "__main__.get_messages.message_to_appchain_segment_len": 23, "__main__.get_messages.message_to_starknet_segment": 20, "__main__.get_messages.message_to_starknet_segment_len": 21 } } } ], "52": [ { "accessible_scopes": ["__main__", "__main__.get_nonce_updates"], "code": "program_input_nonce_updates = prepared_program_input[\"nonce_updates\"]\n\nnonce_updates = [\n (\n int(key),\n int(value),\n )\n for key, value in program_input_nonce_updates.items()\n]\nids.nonce_updates = segments.gen_arg(nonce_updates)\nids.nonce_updates_len = len(nonce_updates)", "flow_tracking_data": { "ap_tracking": { "group": 8, "offset": 2 }, "reference_ids": { "__main__.get_nonce_updates.nonce_updates": 24, "__main__.get_nonce_updates.nonce_updates_len": 25 } } } ], "86": [ { "accessible_scopes": ["__main__", "__main__.get_storage_updates"], "code": "program_input_storage_updates = prepared_program_input[\"storage_updates\"]\n\nstorage_updates = [\n (\n int(contract),\n int(key),\n int(value),\n )\n for \n contract, update in \n program_input_storage_updates.items() \n for \n key, value in update.items()\n]\nids.storage_updates = segments.gen_arg(storage_updates)\nids.storage_updates_len = len(storage_updates)", "flow_tracking_data": { "ap_tracking": { "group": 12, "offset": 2 }, "reference_ids": { "__main__.get_storage_updates.storage_updates": 41, "__main__.get_storage_updates.storage_updates_len": 42 } } } ], "123": [ { "accessible_scopes": ["__main__", "__main__.get_contract_updates"], "code": "program_input_contract_updates = prepared_program_input[\"contract_updates\"]\n\ncontract_updates = [\n (\n int(key),\n int(value),\n )\n for key, value in program_input_contract_updates.items()\n]\nids.contract_updates = segments.gen_arg(contract_updates)\nids.contract_updates_len = len(contract_updates)", "flow_tracking_data": { "ap_tracking": { "group": 16, "offset": 2 }, "reference_ids": { "__main__.get_contract_updates.contract_updates": 60, "__main__.get_contract_updates.contract_updates_len": 61 } } } ], "157": [ { "accessible_scopes": ["__main__", "__main__.get_declared_classes"], "code": "program_input_declared_classes = prepared_program_input[\"declared_classes\"]\n\ndeclared_classes = [\n (\n int(key),\n int(value),\n )\n for key, value in program_input_declared_classes.items()\n]\nids.declared_classes = segments.gen_arg(declared_classes)\nids.declared_classes_len = len(declared_classes)", "flow_tracking_data": { "ap_tracking": { "group": 20, "offset": 2 }, "reference_ids": { "__main__.get_declared_classes.declared_classes": 77, "__main__.get_declared_classes.declared_classes_len": 78 } } } ], "219": [ { "accessible_scopes": ["__main__", "__main__.get_merged_da"], "code": "# Load da.\nda = program_input[\"earlier\"][\"world_da\"]\nupdates = program_input[\"later\"][\"world_da\"]\nids.merged = merged = segments.add()\n\n# Find value after updates.\nafter = {}\nfor i in range(0, len(da), 2):\n after[da[i]] = da[i + 1]\nfor i in range(0, len(updates), 2):\n after[updates[i]] = updates[i + 1]\n\n# Update the da array.\nincluded = {}\nfor i in range(0, len(da), 2):\n da[i+1] = after[da[i]]\n included[da[i]] = True\n\nfor i in range(0, len(updates), 2):\n if updates[i] not in included:\n da.append(updates[i])\n da.append(updates[i + 1])\n\n# Pass da to cairo.\nids.merged_len = len(da)\nfor i in range(0, len(da)):\n memory[merged + i] = int(da[i])", "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 2 }, "reference_ids": { "__main__.get_merged_da.merged": 103, "__main__.get_merged_da.merged_len": 104 } } } ], "274": [ { "accessible_scopes": ["__main__", "__main__.main"], "code": "prepared_program_input = program_input[\"earlier\"]", "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 37 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } } } ], "294": [ { "accessible_scopes": ["__main__", "__main__.main"], "code": "prepared_program_input = program_input[\"later\"]", "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } } } ] }, "identifiers": { "__main__.ContractUpdate": { "full_name": "__main__.ContractUpdate", "members": { "class_hash": { "cairo_type": "felt", "offset": 1 }, "contract_address": { "cairo_type": "felt", "offset": 0 } }, "size": 2, "type": "struct" }, "__main__.DeclaredClass": { "full_name": "__main__.DeclaredClass", "members": { "class_hash": { "cairo_type": "felt", "offset": 0 }, "compiled_class_hash": { "cairo_type": "felt", "offset": 1 } }, "size": 2, "type": "struct" }, "__main__.HashBuiltin": { "destination": "starkware.cairo.common.cairo_builtins.HashBuiltin", "type": "alias" }, "__main__.InputConfig": { "full_name": "__main__.InputConfig", "members": { "block_hash": { "cairo_type": "felt", "offset": 2 }, "block_number": { "cairo_type": "felt", "offset": 1 }, "config_hash": { "cairo_type": "felt", "offset": 3 }, "prev_state_root": { "cairo_type": "felt", "offset": 0 } }, "size": 4, "type": "struct" }, "__main__.MassagesInput": { "full_name": "__main__.MassagesInput", "members": { "message_to_appchain_segment": { "cairo_type": "felt*", "offset": 2 }, "message_to_appchain_segment_len": { "cairo_type": "felt", "offset": 3 }, "message_to_starknet_segment": { "cairo_type": "felt*", "offset": 0 }, "message_to_starknet_segment_len": { "cairo_type": "felt", "offset": 1 } }, "size": 4, "type": "struct" }, "__main__.NonceUpdate": { "full_name": "__main__.NonceUpdate", "members": { "contract_address": { "cairo_type": "felt", "offset": 0 }, "nonce": { "cairo_type": "felt", "offset": 1 } }, "size": 2, "type": "struct" }, "__main__.ProgramInput": { "full_name": "__main__.ProgramInput", "members": { "contract_updates": { "cairo_type": "__main__.ContractUpdate**", "offset": 9 }, "contract_updates_len": { "cairo_type": "felt", "offset": 8 }, "declared_classes": { "cairo_type": "__main__.DeclaredClass**", "offset": 11 }, "declared_classes_len": { "cairo_type": "felt", "offset": 10 }, "input_config": { "cairo_type": "__main__.InputConfig", "offset": 0 }, "messages": { "cairo_type": "__main__.MassagesInput", "offset": 12 }, "nonce_updates": { "cairo_type": "__main__.NonceUpdate**", "offset": 5 }, "nonce_updates_len": { "cairo_type": "felt", "offset": 4 }, "storage_updates": { "cairo_type": "__main__.StorageUpdate**", "offset": 7 }, "storage_updates_len": { "cairo_type": "felt", "offset": 6 }, "world_da": { "cairo_type": "__main__.WorldDaInput", "offset": 16 } }, "size": 18, "type": "struct" }, "__main__.StorageUpdate": { "full_name": "__main__.StorageUpdate", "members": { "contract_address": { "cairo_type": "felt", "offset": 0 }, "storage_key": { "cairo_type": "felt", "offset": 1 }, "storage_value": { "cairo_type": "felt", "offset": 2 } }, "size": 3, "type": "struct" }, "__main__.WorldDaInput": { "full_name": "__main__.WorldDaInput", "members": { "world_da": { "cairo_type": "felt*", "offset": 0 }, "world_da_len": { "cairo_type": "felt", "offset": 1 } }, "size": 2, "type": "struct" }, "__main__.__end__": { "pc": 4, "type": "label" }, "__main__.__start__": { "pc": 0, "type": "label" }, "__main__.get_contract_updates": { "decorators": [], "pc": 121, "type": "function" }, "__main__.get_contract_updates.Args": { "full_name": "__main__.get_contract_updates.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_contract_updates.ImplicitArgs": { "full_name": "__main__.get_contract_updates.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_contract_updates.Return": { "cairo_type": "(contract_updates: __main__.ContractUpdate**, contract_updates_len: felt)", "type": "type_definition" }, "__main__.get_contract_updates.SIZEOF_LOCALS": { "type": "const", "value": 2 }, "__main__.get_contract_updates.contract_updates": { "cairo_type": "__main__.ContractUpdate**", "full_name": "__main__.get_contract_updates.contract_updates", "references": [ { "ap_tracking_data": { "group": 16, "offset": 2 }, "pc": 123, "value": "[cast(fp, __main__.ContractUpdate***)]" } ], "type": "reference" }, "__main__.get_contract_updates.contract_updates_len": { "cairo_type": "felt", "full_name": "__main__.get_contract_updates.contract_updates_len", "references": [ { "ap_tracking_data": { "group": 16, "offset": 2 }, "pc": 123, "value": "[cast(fp + 1, felt*)]" } ], "type": "reference" }, "__main__.get_declared_classes": { "decorators": [], "pc": 155, "type": "function" }, "__main__.get_declared_classes.Args": { "full_name": "__main__.get_declared_classes.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_declared_classes.ImplicitArgs": { "full_name": "__main__.get_declared_classes.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_declared_classes.Return": { "cairo_type": "(declared_classes: __main__.DeclaredClass**, declared_classes_len: felt)", "type": "type_definition" }, "__main__.get_declared_classes.SIZEOF_LOCALS": { "type": "const", "value": 2 }, "__main__.get_declared_classes.declared_classes": { "cairo_type": "__main__.DeclaredClass**", "full_name": "__main__.get_declared_classes.declared_classes", "references": [ { "ap_tracking_data": { "group": 20, "offset": 2 }, "pc": 157, "value": "[cast(fp, __main__.DeclaredClass***)]" } ], "type": "reference" }, "__main__.get_declared_classes.declared_classes_len": { "cairo_type": "felt", "full_name": "__main__.get_declared_classes.declared_classes_len", "references": [ { "ap_tracking_data": { "group": 20, "offset": 2 }, "pc": 157, "value": "[cast(fp + 1, felt*)]" } ], "type": "reference" }, "__main__.get_hashes": { "decorators": [], "pc": 12, "type": "function" }, "__main__.get_hashes.Args": { "full_name": "__main__.get_hashes.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_hashes.ImplicitArgs": { "full_name": "__main__.get_hashes.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_hashes.Return": { "cairo_type": "(input_config: __main__.InputConfig)", "type": "type_definition" }, "__main__.get_hashes.SIZEOF_LOCALS": { "type": "const", "value": 8 }, "__main__.get_hashes.block_hash": { "cairo_type": "felt", "full_name": "__main__.get_hashes.block_hash", "references": [ { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 6, felt*)]" } ], "type": "reference" }, "__main__.get_hashes.block_number": { "cairo_type": "felt", "full_name": "__main__.get_hashes.block_number", "references": [ { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 5, felt*)]" } ], "type": "reference" }, "__main__.get_hashes.config_hash": { "cairo_type": "felt", "full_name": "__main__.get_hashes.config_hash", "references": [ { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 7, felt*)]" } ], "type": "reference" }, "__main__.get_hashes.input_config": { "cairo_type": "__main__.InputConfig", "full_name": "__main__.get_hashes.input_config", "references": [ { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp, __main__.InputConfig*)]" } ], "type": "reference" }, "__main__.get_hashes.prev_state_root": { "cairo_type": "felt", "full_name": "__main__.get_hashes.prev_state_root", "references": [ { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 4, felt*)]" } ], "type": "reference" }, "__main__.get_input": { "decorators": [], "pc": 239, "type": "function" }, "__main__.get_input.Args": { "full_name": "__main__.get_input.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_input.ImplicitArgs": { "full_name": "__main__.get_input.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_input.Return": { "cairo_type": "(res: __main__.ProgramInput)", "type": "type_definition" }, "__main__.get_input.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.get_input.contract_updates": { "cairo_type": "__main__.ContractUpdate**", "full_name": "__main__.get_input.contract_updates", "references": [ { "ap_tracking_data": { "group": 29, "offset": 32 }, "pc": 247, "value": "[cast(ap + (-2), __main__.ContractUpdate***)]" } ], "type": "reference" }, "__main__.get_input.contract_updates_len": { "cairo_type": "felt", "full_name": "__main__.get_input.contract_updates_len", "references": [ { "ap_tracking_data": { "group": 29, "offset": 32 }, "pc": 247, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.get_input.declared_classes": { "cairo_type": "__main__.DeclaredClass**", "full_name": "__main__.get_input.declared_classes", "references": [ { "ap_tracking_data": { "group": 29, "offset": 38 }, "pc": 249, "value": "[cast(ap + (-2), __main__.DeclaredClass***)]" } ], "type": "reference" }, "__main__.get_input.declared_classes_len": { "cairo_type": "felt", "full_name": "__main__.get_input.declared_classes_len", "references": [ { "ap_tracking_data": { "group": 29, "offset": 38 }, "pc": 249, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.get_input.input_config": { "cairo_type": "__main__.InputConfig", "full_name": "__main__.get_input.input_config", "references": [ { "ap_tracking_data": { "group": 29, "offset": 14 }, "pc": 241, "value": "[cast(ap + (-4), __main__.InputConfig*)]" } ], "type": "reference" }, "__main__.get_input.messages": { "cairo_type": "__main__.MassagesInput", "full_name": "__main__.get_input.messages", "references": [ { "ap_tracking_data": { "group": 29, "offset": 48 }, "pc": 251, "value": "[cast(ap + (-4), __main__.MassagesInput*)]" } ], "type": "reference" }, "__main__.get_input.nonce_updates": { "cairo_type": "__main__.NonceUpdate**", "full_name": "__main__.get_input.nonce_updates", "references": [ { "ap_tracking_data": { "group": 29, "offset": 20 }, "pc": 243, "value": "[cast(ap + (-2), __main__.NonceUpdate***)]" } ], "type": "reference" }, "__main__.get_input.nonce_updates_len": { "cairo_type": "felt", "full_name": "__main__.get_input.nonce_updates_len", "references": [ { "ap_tracking_data": { "group": 29, "offset": 20 }, "pc": 243, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.get_input.storage_updates": { "cairo_type": "__main__.StorageUpdate**", "full_name": "__main__.get_input.storage_updates", "references": [ { "ap_tracking_data": { "group": 29, "offset": 26 }, "pc": 245, "value": "[cast(ap + (-2), __main__.StorageUpdate***)]" } ], "type": "reference" }, "__main__.get_input.storage_updates_len": { "cairo_type": "felt", "full_name": "__main__.get_input.storage_updates_len", "references": [ { "ap_tracking_data": { "group": 29, "offset": 26 }, "pc": 245, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.get_input.world_da": { "cairo_type": "__main__.WorldDaInput", "full_name": "__main__.get_input.world_da", "references": [ { "ap_tracking_data": { "group": 29, "offset": 54 }, "pc": 253, "value": "[cast(ap + (-2), __main__.WorldDaInput*)]" } ], "type": "reference" }, "__main__.get_merged_da": { "decorators": [], "pc": 217, "type": "function" }, "__main__.get_merged_da.Args": { "full_name": "__main__.get_merged_da.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_merged_da.ImplicitArgs": { "full_name": "__main__.get_merged_da.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_merged_da.Return": { "cairo_type": "(res: __main__.WorldDaInput)", "type": "type_definition" }, "__main__.get_merged_da.SIZEOF_LOCALS": { "type": "const", "value": 2 }, "__main__.get_merged_da.merged": { "cairo_type": "felt*", "full_name": "__main__.get_merged_da.merged", "references": [ { "ap_tracking_data": { "group": 26, "offset": 2 }, "pc": 219, "value": "[cast(fp, felt**)]" } ], "type": "reference" }, "__main__.get_merged_da.merged_len": { "cairo_type": "felt", "full_name": "__main__.get_merged_da.merged_len", "references": [ { "ap_tracking_data": { "group": 26, "offset": 2 }, "pc": 219, "value": "[cast(fp + 1, felt*)]" } ], "type": "reference" }, "__main__.get_messages": { "decorators": [], "pc": 43, "type": "function" }, "__main__.get_messages.Args": { "full_name": "__main__.get_messages.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_messages.ImplicitArgs": { "full_name": "__main__.get_messages.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_messages.Return": { "cairo_type": "(__main__.MassagesInput,)", "type": "type_definition" }, "__main__.get_messages.SIZEOF_LOCALS": { "type": "const", "value": 4 }, "__main__.get_messages.message_to_appchain_segment": { "cairo_type": "felt*", "full_name": "__main__.get_messages.message_to_appchain_segment", "references": [ { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp + 2, felt**)]" } ], "type": "reference" }, "__main__.get_messages.message_to_appchain_segment_len": { "cairo_type": "felt", "full_name": "__main__.get_messages.message_to_appchain_segment_len", "references": [ { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp + 3, felt*)]" } ], "type": "reference" }, "__main__.get_messages.message_to_starknet_segment": { "cairo_type": "felt*", "full_name": "__main__.get_messages.message_to_starknet_segment", "references": [ { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp, felt**)]" } ], "type": "reference" }, "__main__.get_messages.message_to_starknet_segment_len": { "cairo_type": "felt", "full_name": "__main__.get_messages.message_to_starknet_segment_len", "references": [ { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp + 1, felt*)]" } ], "type": "reference" }, "__main__.get_nonce_updates": { "decorators": [], "pc": 50, "type": "function" }, "__main__.get_nonce_updates.Args": { "full_name": "__main__.get_nonce_updates.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_nonce_updates.ImplicitArgs": { "full_name": "__main__.get_nonce_updates.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_nonce_updates.Return": { "cairo_type": "(nonce_updates: __main__.NonceUpdate**, nonce_updates_len: felt)", "type": "type_definition" }, "__main__.get_nonce_updates.SIZEOF_LOCALS": { "type": "const", "value": 2 }, "__main__.get_nonce_updates.nonce_updates": { "cairo_type": "__main__.NonceUpdate**", "full_name": "__main__.get_nonce_updates.nonce_updates", "references": [ { "ap_tracking_data": { "group": 8, "offset": 2 }, "pc": 52, "value": "[cast(fp, __main__.NonceUpdate***)]" } ], "type": "reference" }, "__main__.get_nonce_updates.nonce_updates_len": { "cairo_type": "felt", "full_name": "__main__.get_nonce_updates.nonce_updates_len", "references": [ { "ap_tracking_data": { "group": 8, "offset": 2 }, "pc": 52, "value": "[cast(fp + 1, felt*)]" } ], "type": "reference" }, "__main__.get_storage_updates": { "decorators": [], "pc": 84, "type": "function" }, "__main__.get_storage_updates.Args": { "full_name": "__main__.get_storage_updates.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_storage_updates.ImplicitArgs": { "full_name": "__main__.get_storage_updates.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_storage_updates.Return": { "cairo_type": "(storage_updates: __main__.StorageUpdate**, storage_updates_len: felt)", "type": "type_definition" }, "__main__.get_storage_updates.SIZEOF_LOCALS": { "type": "const", "value": 2 }, "__main__.get_storage_updates.storage_updates": { "cairo_type": "__main__.StorageUpdate**", "full_name": "__main__.get_storage_updates.storage_updates", "references": [ { "ap_tracking_data": { "group": 12, "offset": 2 }, "pc": 86, "value": "[cast(fp, __main__.StorageUpdate***)]" } ], "type": "reference" }, "__main__.get_storage_updates.storage_updates_len": { "cairo_type": "felt", "full_name": "__main__.get_storage_updates.storage_updates_len", "references": [ { "ap_tracking_data": { "group": 12, "offset": 2 }, "pc": 86, "value": "[cast(fp + 1, felt*)]" } ], "type": "reference" }, "__main__.get_world_da": { "decorators": [], "pc": 19, "type": "function" }, "__main__.get_world_da.Args": { "full_name": "__main__.get_world_da.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_world_da.ImplicitArgs": { "full_name": "__main__.get_world_da.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_world_da.Return": { "cairo_type": "(res: __main__.WorldDaInput)", "type": "type_definition" }, "__main__.get_world_da.SIZEOF_LOCALS": { "type": "const", "value": 2 }, "__main__.get_world_da.world_da": { "cairo_type": "felt*", "full_name": "__main__.get_world_da.world_da", "references": [ { "ap_tracking_data": { "group": 4, "offset": 2 }, "pc": 21, "value": "[cast(fp, felt**)]" } ], "type": "reference" }, "__main__.get_world_da.world_da_len": { "cairo_type": "felt", "full_name": "__main__.get_world_da.world_da_len", "references": [ { "ap_tracking_data": { "group": 4, "offset": 2 }, "pc": 21, "value": "[cast(fp + 1, felt*)]" } ], "type": "reference" }, "__main__.hash2": { "destination": "starkware.cairo.common.hash.hash2", "type": "alias" }, "__main__.hash_contract_update": { "decorators": [], "pc": 126, "type": "function" }, "__main__.hash_contract_update.Args": { "full_name": "__main__.hash_contract_update.Args", "members": { "contract_update": { "cairo_type": "__main__.ContractUpdate*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_contract_update.ImplicitArgs": { "full_name": "__main__.hash_contract_update.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_contract_update.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_contract_update.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_contract_update.contract_update": { "cairo_type": "__main__.ContractUpdate*", "full_name": "__main__.hash_contract_update.contract_update", "references": [ { "ap_tracking_data": { "group": 17, "offset": 0 }, "pc": 126, "value": "[cast(fp + (-3), __main__.ContractUpdate**)]" } ], "type": "reference" }, "__main__.hash_contract_update.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_contract_update.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 17, "offset": 0 }, "pc": 126, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 17, "offset": 7 }, "pc": 131, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_contract_update.res": { "cairo_type": "felt", "full_name": "__main__.hash_contract_update.res", "references": [ { "ap_tracking_data": { "group": 17, "offset": 0 }, "pc": 126, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 17, "offset": 7 }, "pc": 131, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_contract_updates_loop": { "decorators": [], "pc": 132, "type": "function" }, "__main__.hash_contract_updates_loop.Args": { "full_name": "__main__.hash_contract_updates_loop.Args", "members": { "contract_updates": { "cairo_type": "__main__.ContractUpdate**", "offset": 1 }, "contract_updates_len": { "cairo_type": "felt", "offset": 2 }, "res": { "cairo_type": "felt", "offset": 0 } }, "size": 3, "type": "struct" }, "__main__.hash_contract_updates_loop.ImplicitArgs": { "full_name": "__main__.hash_contract_updates_loop.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_contract_updates_loop.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_contract_updates_loop.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_contract_updates_loop.contract_update": { "cairo_type": "__main__.ContractUpdate*", "full_name": "__main__.hash_contract_updates_loop.contract_update", "references": [ { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 139, "value": "[cast([fp + (-4)], __main__.ContractUpdate**)]" } ], "type": "reference" }, "__main__.hash_contract_updates_loop.contract_updates": { "cairo_type": "__main__.ContractUpdate**", "full_name": "__main__.hash_contract_updates_loop.contract_updates", "references": [ { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-4), __main__.ContractUpdate***)]" } ], "type": "reference" }, "__main__.hash_contract_updates_loop.contract_updates_len": { "cairo_type": "felt", "full_name": "__main__.hash_contract_updates_loop.contract_updates_len", "references": [ { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "__main__.hash_contract_updates_loop.hash": { "cairo_type": "felt", "full_name": "__main__.hash_contract_updates_loop.hash", "references": [ { "ap_tracking_data": { "group": 18, "offset": 11 }, "pc": 143, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_contract_updates_loop.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_contract_updates_loop.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 18, "offset": 11 }, "pc": 143, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 18, "offset": 18 }, "pc": 148, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 19, "offset": 0 }, "pc": 154, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_contract_updates_loop.res": { "cairo_type": "felt", "full_name": "__main__.hash_contract_updates_loop.res", "references": [ { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 18, "offset": 18 }, "pc": 148, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_declared_class": { "decorators": [], "pc": 160, "type": "function" }, "__main__.hash_declared_class.Args": { "full_name": "__main__.hash_declared_class.Args", "members": { "declared_class": { "cairo_type": "__main__.DeclaredClass*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_declared_class.ImplicitArgs": { "full_name": "__main__.hash_declared_class.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_declared_class.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_declared_class.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_declared_class.declared_class": { "cairo_type": "__main__.DeclaredClass*", "full_name": "__main__.hash_declared_class.declared_class", "references": [ { "ap_tracking_data": { "group": 21, "offset": 0 }, "pc": 160, "value": "[cast(fp + (-3), __main__.DeclaredClass**)]" } ], "type": "reference" }, "__main__.hash_declared_class.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_declared_class.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 21, "offset": 0 }, "pc": 160, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 21, "offset": 7 }, "pc": 165, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_declared_class.res": { "cairo_type": "felt", "full_name": "__main__.hash_declared_class.res", "references": [ { "ap_tracking_data": { "group": 21, "offset": 0 }, "pc": 160, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 21, "offset": 7 }, "pc": 165, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_declared_classes_loop": { "decorators": [], "pc": 166, "type": "function" }, "__main__.hash_declared_classes_loop.Args": { "full_name": "__main__.hash_declared_classes_loop.Args", "members": { "declared_classes": { "cairo_type": "__main__.DeclaredClass**", "offset": 1 }, "declared_classes_len": { "cairo_type": "felt", "offset": 2 }, "res": { "cairo_type": "felt", "offset": 0 } }, "size": 3, "type": "struct" }, "__main__.hash_declared_classes_loop.ImplicitArgs": { "full_name": "__main__.hash_declared_classes_loop.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_declared_classes_loop.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_declared_classes_loop.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_declared_classes_loop.declared_class": { "cairo_type": "__main__.DeclaredClass*", "full_name": "__main__.hash_declared_classes_loop.declared_class", "references": [ { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 173, "value": "[cast([fp + (-4)], __main__.DeclaredClass**)]" } ], "type": "reference" }, "__main__.hash_declared_classes_loop.declared_classes": { "cairo_type": "__main__.DeclaredClass**", "full_name": "__main__.hash_declared_classes_loop.declared_classes", "references": [ { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-4), __main__.DeclaredClass***)]" } ], "type": "reference" }, "__main__.hash_declared_classes_loop.declared_classes_len": { "cairo_type": "felt", "full_name": "__main__.hash_declared_classes_loop.declared_classes_len", "references": [ { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "__main__.hash_declared_classes_loop.hash": { "cairo_type": "felt", "full_name": "__main__.hash_declared_classes_loop.hash", "references": [ { "ap_tracking_data": { "group": 22, "offset": 11 }, "pc": 177, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_declared_classes_loop.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_declared_classes_loop.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 22, "offset": 11 }, "pc": 177, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 22, "offset": 18 }, "pc": 182, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 23, "offset": 0 }, "pc": 188, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_declared_classes_loop.res": { "cairo_type": "felt", "full_name": "__main__.hash_declared_classes_loop.res", "references": [ { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 22, "offset": 18 }, "pc": 182, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_nonce_update": { "decorators": [], "pc": 55, "type": "function" }, "__main__.hash_nonce_update.Args": { "full_name": "__main__.hash_nonce_update.Args", "members": { "nonce_update": { "cairo_type": "__main__.NonceUpdate*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_nonce_update.ImplicitArgs": { "full_name": "__main__.hash_nonce_update.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_nonce_update.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_nonce_update.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_nonce_update.nonce_update": { "cairo_type": "__main__.NonceUpdate*", "full_name": "__main__.hash_nonce_update.nonce_update", "references": [ { "ap_tracking_data": { "group": 9, "offset": 0 }, "pc": 55, "value": "[cast(fp + (-3), __main__.NonceUpdate**)]" } ], "type": "reference" }, "__main__.hash_nonce_update.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_nonce_update.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 9, "offset": 0 }, "pc": 55, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 9, "offset": 7 }, "pc": 60, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_nonce_update.res": { "cairo_type": "felt", "full_name": "__main__.hash_nonce_update.res", "references": [ { "ap_tracking_data": { "group": 9, "offset": 0 }, "pc": 55, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 9, "offset": 7 }, "pc": 60, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_nonce_updates_loop": { "decorators": [], "pc": 61, "type": "function" }, "__main__.hash_nonce_updates_loop.Args": { "full_name": "__main__.hash_nonce_updates_loop.Args", "members": { "nonce_updates": { "cairo_type": "__main__.NonceUpdate**", "offset": 1 }, "nonce_updates_len": { "cairo_type": "felt", "offset": 2 }, "res": { "cairo_type": "felt", "offset": 0 } }, "size": 3, "type": "struct" }, "__main__.hash_nonce_updates_loop.ImplicitArgs": { "full_name": "__main__.hash_nonce_updates_loop.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_nonce_updates_loop.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_nonce_updates_loop.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_nonce_updates_loop.hash": { "cairo_type": "felt", "full_name": "__main__.hash_nonce_updates_loop.hash", "references": [ { "ap_tracking_data": { "group": 10, "offset": 11 }, "pc": 72, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_nonce_updates_loop.nonce_update": { "cairo_type": "__main__.NonceUpdate*", "full_name": "__main__.hash_nonce_updates_loop.nonce_update", "references": [ { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 68, "value": "[cast([fp + (-4)], __main__.NonceUpdate**)]" } ], "type": "reference" }, "__main__.hash_nonce_updates_loop.nonce_updates": { "cairo_type": "__main__.NonceUpdate**", "full_name": "__main__.hash_nonce_updates_loop.nonce_updates", "references": [ { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-4), __main__.NonceUpdate***)]" } ], "type": "reference" }, "__main__.hash_nonce_updates_loop.nonce_updates_len": { "cairo_type": "felt", "full_name": "__main__.hash_nonce_updates_loop.nonce_updates_len", "references": [ { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "__main__.hash_nonce_updates_loop.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_nonce_updates_loop.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 10, "offset": 11 }, "pc": 72, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 10, "offset": 18 }, "pc": 77, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 11, "offset": 0 }, "pc": 83, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_nonce_updates_loop.res": { "cairo_type": "felt", "full_name": "__main__.hash_nonce_updates_loop.res", "references": [ { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 10, "offset": 18 }, "pc": 77, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_storage_update": { "decorators": [], "pc": 89, "type": "function" }, "__main__.hash_storage_update.Args": { "full_name": "__main__.hash_storage_update.Args", "members": { "storage_update": { "cairo_type": "__main__.StorageUpdate*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_storage_update.ImplicitArgs": { "full_name": "__main__.hash_storage_update.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_storage_update.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_storage_update.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_storage_update.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_storage_update.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 13, "offset": 0 }, "pc": 89, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 13, "offset": 7 }, "pc": 94, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 13, "offset": 12 }, "pc": 97, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_storage_update.res": { "cairo_type": "felt", "full_name": "__main__.hash_storage_update.res", "references": [ { "ap_tracking_data": { "group": 13, "offset": 0 }, "pc": 89, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 13, "offset": 7 }, "pc": 94, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 13, "offset": 12 }, "pc": 97, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_storage_update.storage_update": { "cairo_type": "__main__.StorageUpdate*", "full_name": "__main__.hash_storage_update.storage_update", "references": [ { "ap_tracking_data": { "group": 13, "offset": 0 }, "pc": 89, "value": "[cast(fp + (-3), __main__.StorageUpdate**)]" } ], "type": "reference" }, "__main__.hash_storage_updates_loop": { "decorators": [], "pc": 98, "type": "function" }, "__main__.hash_storage_updates_loop.Args": { "full_name": "__main__.hash_storage_updates_loop.Args", "members": { "res": { "cairo_type": "felt", "offset": 0 }, "storage_updates": { "cairo_type": "__main__.StorageUpdate**", "offset": 1 }, "storage_updates_len": { "cairo_type": "felt", "offset": 2 } }, "size": 3, "type": "struct" }, "__main__.hash_storage_updates_loop.ImplicitArgs": { "full_name": "__main__.hash_storage_updates_loop.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_storage_updates_loop.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_storage_updates_loop.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_storage_updates_loop.hash": { "cairo_type": "felt", "full_name": "__main__.hash_storage_updates_loop.hash", "references": [ { "ap_tracking_data": { "group": 14, "offset": 16 }, "pc": 109, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_storage_updates_loop.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_storage_updates_loop.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 14, "offset": 16 }, "pc": 109, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 14, "offset": 23 }, "pc": 114, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 15, "offset": 0 }, "pc": 120, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_storage_updates_loop.res": { "cairo_type": "felt", "full_name": "__main__.hash_storage_updates_loop.res", "references": [ { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 14, "offset": 23 }, "pc": 114, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_storage_updates_loop.storage_update": { "cairo_type": "__main__.StorageUpdate*", "full_name": "__main__.hash_storage_updates_loop.storage_update", "references": [ { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 105, "value": "[cast([fp + (-4)], __main__.StorageUpdate**)]" } ], "type": "reference" }, "__main__.hash_storage_updates_loop.storage_updates": { "cairo_type": "__main__.StorageUpdate**", "full_name": "__main__.hash_storage_updates_loop.storage_updates", "references": [ { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-4), __main__.StorageUpdate***)]" } ], "type": "reference" }, "__main__.hash_storage_updates_loop.storage_updates_len": { "cairo_type": "felt", "full_name": "__main__.hash_storage_updates_loop.storage_updates_len", "references": [ { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "__main__.hash_world_da_loop": { "decorators": [], "pc": 24, "type": "function" }, "__main__.hash_world_da_loop.Args": { "full_name": "__main__.hash_world_da_loop.Args", "members": { "res": { "cairo_type": "felt", "offset": 0 }, "world_da": { "cairo_type": "felt*", "offset": 1 }, "world_da_len": { "cairo_type": "felt", "offset": 2 } }, "size": 3, "type": "struct" }, "__main__.hash_world_da_loop.ImplicitArgs": { "full_name": "__main__.hash_world_da_loop.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_world_da_loop.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_world_da_loop.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_world_da_loop.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_world_da_loop.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 5, "offset": 7 }, "pc": 36, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 6, "offset": 0 }, "pc": 42, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_world_da_loop.res": { "cairo_type": "felt", "full_name": "__main__.hash_world_da_loop.res", "references": [ { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 5, "offset": 7 }, "pc": 36, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_world_da_loop.value": { "cairo_type": "felt", "full_name": "__main__.hash_world_da_loop.value", "references": [ { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 31, "value": "[cast([fp + (-4)], felt*)]" } ], "type": "reference" }, "__main__.hash_world_da_loop.world_da": { "cairo_type": "felt*", "full_name": "__main__.hash_world_da_loop.world_da", "references": [ { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-4), felt**)]" } ], "type": "reference" }, "__main__.hash_world_da_loop.world_da_len": { "cairo_type": "felt", "full_name": "__main__.hash_world_da_loop.world_da_len", "references": [ { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "__main__.main": { "decorators": [], "pc": 272, "type": "function" }, "__main__.main.Args": { "full_name": "__main__.main.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.main.ImplicitArgs": { "full_name": "__main__.main.ImplicitArgs", "members": { "bitwise_ptr": { "cairo_type": "felt*", "offset": 3 }, "output_ptr": { "cairo_type": "felt*", "offset": 0 }, "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 1 }, "range_check_ptr": { "cairo_type": "felt", "offset": 2 } }, "size": 4, "type": "struct" }, "__main__.main.Return": { "cairo_type": "()", "type": "type_definition" }, "__main__.main.SIZEOF_LOCALS": { "type": "const", "value": 37 }, "__main__.main.__temp6": { "cairo_type": "felt", "full_name": "__main__.main.__temp6", "references": [ { "ap_tracking_data": { "group": 30, "offset": 186 }, "pc": 317, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.main.__temp7": { "cairo_type": "felt", "full_name": "__main__.main.__temp7", "references": [ { "ap_tracking_data": { "group": 31, "offset": 1 }, "pc": 333, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.main.__temp8": { "cairo_type": "felt", "full_name": "__main__.main.__temp8", "references": [ { "ap_tracking_data": { "group": 33, "offset": 1 }, "pc": 345, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.main.bitwise_ptr": { "cairo_type": "felt*", "full_name": "__main__.main.bitwise_ptr", "references": [ { "ap_tracking_data": { "group": 30, "offset": 0 }, "pc": 272, "value": "[cast(fp + (-3), felt**)]" } ], "type": "reference" }, "__main__.main.input_1": { "cairo_type": "__main__.ProgramInput", "full_name": "__main__.main.input_1", "references": [ { "ap_tracking_data": { "group": 30, "offset": 111 }, "pc": 276, "value": "[cast(ap + (-18), __main__.ProgramInput*)]" }, { "ap_tracking_data": { "group": 30, "offset": 111 }, "pc": 294, "value": "[cast(fp, __main__.ProgramInput*)]" } ], "type": "reference" }, "__main__.main.input_2": { "cairo_type": "__main__.ProgramInput", "full_name": "__main__.main.input_2", "references": [ { "ap_tracking_data": { "group": 30, "offset": 185 }, "pc": 296, "value": "[cast(ap + (-18), __main__.ProgramInput*)]" }, { "ap_tracking_data": { "group": 30, "offset": 185 }, "pc": 314, "value": "[cast(fp + 18, __main__.ProgramInput*)]" } ], "type": "reference" }, "__main__.main.merged_world_da": { "cairo_type": "__main__.WorldDaInput", "full_name": "__main__.main.merged_world_da", "references": [ { "ap_tracking_data": { "group": 30, "offset": 192 }, "pc": 323, "value": "[cast(ap + (-2), __main__.WorldDaInput*)]" } ], "type": "reference" }, "__main__.main.output_ptr": { "cairo_type": "felt*", "full_name": "__main__.main.output_ptr", "references": [ { "ap_tracking_data": { "group": 30, "offset": 0 }, "pc": 272, "value": "[cast(fp + (-6), felt**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 295, "value": "cast([fp + (-6)] + 6, felt*)" }, { "ap_tracking_data": { "group": 31, "offset": 1 }, "pc": 297, "value": "cast([fp + (-6)] + 7, felt*)" }, { "ap_tracking_data": { "group": 32, "offset": 0 }, "pc": 303, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 33, "offset": 0 }, "pc": 307, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 33, "offset": 1 }, "pc": 309, "value": "cast([ap + (-2)] + 1, felt*)" }, { "ap_tracking_data": { "group": 34, "offset": 0 }, "pc": 315, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 35, "offset": 0 }, "pc": 319, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 332, "value": "cast([fp + (-6)] + 6, felt*)" }, { "ap_tracking_data": { "group": 31, "offset": 1 }, "pc": 334, "value": "cast([fp + (-6)] + 7, felt*)" }, { "ap_tracking_data": { "group": 32, "offset": 0 }, "pc": 340, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 33, "offset": 0 }, "pc": 344, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 33, "offset": 1 }, "pc": 346, "value": "cast([ap + (-2)] + 1, felt*)" }, { "ap_tracking_data": { "group": 34, "offset": 0 }, "pc": 352, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 35, "offset": 0 }, "pc": 356, "value": "[cast(ap + (-1), felt**)]" } ], "type": "reference" }, "__main__.main.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.main.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 30, "offset": 0 }, "pc": 272, "value": "[cast(fp + (-5), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 294, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 330, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 331, "value": "[cast(fp + 36, starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.main.range_check_ptr": { "cairo_type": "felt", "full_name": "__main__.main.range_check_ptr", "references": [ { "ap_tracking_data": { "group": 30, "offset": 0 }, "pc": 272, "value": "[cast(fp + (-4), felt*)]" } ], "type": "reference" }, "__main__.main.world_da_hash": { "cairo_type": "felt", "full_name": "__main__.main.world_da_hash", "references": [ { "ap_tracking_data": { "group": 30, "offset": 192 }, "pc": 323, "value": "cast(0, felt)" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 330, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.output_array": { "decorators": [], "pc": 222, "type": "function" }, "__main__.output_array.Args": { "full_name": "__main__.output_array.Args", "members": { "array": { "cairo_type": "felt*", "offset": 0 }, "len": { "cairo_type": "felt", "offset": 1 } }, "size": 2, "type": "struct" }, "__main__.output_array.ImplicitArgs": { "full_name": "__main__.output_array.ImplicitArgs", "members": { "output_ptr": { "cairo_type": "felt*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.output_array.Return": { "cairo_type": "()", "type": "type_definition" }, "__main__.output_array.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.output_array.__temp5": { "cairo_type": "felt", "full_name": "__main__.output_array.__temp5", "references": [ { "ap_tracking_data": { "group": 27, "offset": 1 }, "pc": 229, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.output_array.array": { "cairo_type": "felt*", "full_name": "__main__.output_array.array", "references": [ { "ap_tracking_data": { "group": 27, "offset": 0 }, "pc": 222, "value": "[cast(fp + (-4), felt**)]" } ], "type": "reference" }, "__main__.output_array.len": { "cairo_type": "felt", "full_name": "__main__.output_array.len", "references": [ { "ap_tracking_data": { "group": 27, "offset": 0 }, "pc": 222, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "__main__.output_array.output_ptr": { "cairo_type": "felt*", "full_name": "__main__.output_array.output_ptr", "references": [ { "ap_tracking_data": { "group": 27, "offset": 0 }, "pc": 222, "value": "[cast(fp + (-5), felt**)]" }, { "ap_tracking_data": { "group": 27, "offset": 1 }, "pc": 230, "value": "cast([fp + (-5)] + 1, felt*)" }, { "ap_tracking_data": { "group": 28, "offset": 0 }, "pc": 238, "value": "[cast(ap + (-1), felt**)]" } ], "type": "reference" }, "__main__.output_array.value": { "cairo_type": "felt", "full_name": "__main__.output_array.value", "references": [ { "ap_tracking_data": { "group": 27, "offset": 0 }, "pc": 228, "value": "[cast([fp + (-4)], felt*)]" } ], "type": "reference" }, "__main__.replace_or_append": { "decorators": [], "pc": 189, "type": "function" }, "__main__.replace_or_append.Args": { "full_name": "__main__.replace_or_append.Args", "members": { "array": { "cairo_type": "felt*", "offset": 0 }, "key": { "cairo_type": "felt", "offset": 2 }, "len": { "cairo_type": "felt", "offset": 1 }, "value": { "cairo_type": "felt", "offset": 3 } }, "size": 4, "type": "struct" }, "__main__.replace_or_append.ImplicitArgs": { "full_name": "__main__.replace_or_append.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.replace_or_append.Return": { "cairo_type": "(replaced: felt)", "type": "type_definition" }, "__main__.replace_or_append.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.replace_or_append.__temp0": { "cairo_type": "felt", "full_name": "__main__.replace_or_append.__temp0", "references": [ { "ap_tracking_data": { "group": 24, "offset": 1 }, "pc": 192, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.replace_or_append.__temp1": { "cairo_type": "felt", "full_name": "__main__.replace_or_append.__temp1", "references": [ { "ap_tracking_data": { "group": 24, "offset": 2 }, "pc": 195, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.replace_or_append.__temp2": { "cairo_type": "felt", "full_name": "__main__.replace_or_append.__temp2", "references": [ { "ap_tracking_data": { "group": 24, "offset": 3 }, "pc": 196, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.replace_or_append.__temp3": { "cairo_type": "felt", "full_name": "__main__.replace_or_append.__temp3", "references": [ { "ap_tracking_data": { "group": 24, "offset": 1 }, "pc": 201, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.replace_or_append.__temp4": { "cairo_type": "felt", "full_name": "__main__.replace_or_append.__temp4", "references": [ { "ap_tracking_data": { "group": 24, "offset": 2 }, "pc": 202, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.replace_or_append.array": { "cairo_type": "felt*", "full_name": "__main__.replace_or_append.array", "references": [ { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-6), felt**)]" } ], "type": "reference" }, "__main__.replace_or_append.key": { "cairo_type": "felt", "full_name": "__main__.replace_or_append.key", "references": [ { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-4), felt*)]" } ], "type": "reference" }, "__main__.replace_or_append.len": { "cairo_type": "felt", "full_name": "__main__.replace_or_append.len", "references": [ { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-5), felt*)]" } ], "type": "reference" }, "__main__.replace_or_append.value": { "cairo_type": "felt", "full_name": "__main__.replace_or_append.value", "references": [ { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "starkware.cairo.common.cairo_builtins.BitwiseBuiltin": { "full_name": "starkware.cairo.common.cairo_builtins.BitwiseBuiltin", "members": { "x": { "cairo_type": "felt", "offset": 0 }, "x_and_y": { "cairo_type": "felt", "offset": 2 }, "x_or_y": { "cairo_type": "felt", "offset": 4 }, "x_xor_y": { "cairo_type": "felt", "offset": 3 }, "y": { "cairo_type": "felt", "offset": 1 } }, "size": 5, "type": "struct" }, "starkware.cairo.common.cairo_builtins.EcOpBuiltin": { "full_name": "starkware.cairo.common.cairo_builtins.EcOpBuiltin", "members": { "m": { "cairo_type": "felt", "offset": 4 }, "p": { "cairo_type": "starkware.cairo.common.ec_point.EcPoint", "offset": 0 }, "q": { "cairo_type": "starkware.cairo.common.ec_point.EcPoint", "offset": 2 }, "r": { "cairo_type": "starkware.cairo.common.ec_point.EcPoint", "offset": 5 } }, "size": 7, "type": "struct" }, "starkware.cairo.common.cairo_builtins.EcPoint": { "destination": "starkware.cairo.common.ec_point.EcPoint", "type": "alias" }, "starkware.cairo.common.cairo_builtins.HashBuiltin": { "full_name": "starkware.cairo.common.cairo_builtins.HashBuiltin", "members": { "result": { "cairo_type": "felt", "offset": 2 }, "x": { "cairo_type": "felt", "offset": 0 }, "y": { "cairo_type": "felt", "offset": 1 } }, "size": 3, "type": "struct" }, "starkware.cairo.common.cairo_builtins.KeccakBuiltin": { "full_name": "starkware.cairo.common.cairo_builtins.KeccakBuiltin", "members": { "input": { "cairo_type": "starkware.cairo.common.keccak_state.KeccakBuiltinState", "offset": 0 }, "output": { "cairo_type": "starkware.cairo.common.keccak_state.KeccakBuiltinState", "offset": 8 } }, "size": 16, "type": "struct" }, "starkware.cairo.common.cairo_builtins.KeccakBuiltinState": { "destination": "starkware.cairo.common.keccak_state.KeccakBuiltinState", "type": "alias" }, "starkware.cairo.common.cairo_builtins.PoseidonBuiltin": { "full_name": "starkware.cairo.common.cairo_builtins.PoseidonBuiltin", "members": { "input": { "cairo_type": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", "offset": 0 }, "output": { "cairo_type": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", "offset": 3 } }, "size": 6, "type": "struct" }, "starkware.cairo.common.cairo_builtins.PoseidonBuiltinState": { "destination": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", "type": "alias" }, "starkware.cairo.common.cairo_builtins.SignatureBuiltin": { "full_name": "starkware.cairo.common.cairo_builtins.SignatureBuiltin", "members": { "message": { "cairo_type": "felt", "offset": 1 }, "pub_key": { "cairo_type": "felt", "offset": 0 } }, "size": 2, "type": "struct" }, "starkware.cairo.common.ec_point.EcPoint": { "full_name": "starkware.cairo.common.ec_point.EcPoint", "members": { "x": { "cairo_type": "felt", "offset": 0 }, "y": { "cairo_type": "felt", "offset": 1 } }, "size": 2, "type": "struct" }, "starkware.cairo.common.hash.HashBuiltin": { "destination": "starkware.cairo.common.cairo_builtins.HashBuiltin", "type": "alias" }, "starkware.cairo.common.hash.hash2": { "decorators": [], "pc": 6, "type": "function" }, "starkware.cairo.common.hash.hash2.Args": { "full_name": "starkware.cairo.common.hash.hash2.Args", "members": { "x": { "cairo_type": "felt", "offset": 0 }, "y": { "cairo_type": "felt", "offset": 1 } }, "size": 2, "type": "struct" }, "starkware.cairo.common.hash.hash2.ImplicitArgs": { "full_name": "starkware.cairo.common.hash.hash2.ImplicitArgs", "members": { "hash_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "starkware.cairo.common.hash.hash2.Return": { "cairo_type": "(result: felt)", "type": "type_definition" }, "starkware.cairo.common.hash.hash2.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "starkware.cairo.common.hash.hash2.hash_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "starkware.cairo.common.hash.hash2.hash_ptr", "references": [ { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 6, "value": "[cast(fp + (-5), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 8, "value": "cast([fp + (-5)] + 3, starkware.cairo.common.cairo_builtins.HashBuiltin*)" } ], "type": "reference" }, "starkware.cairo.common.hash.hash2.result": { "cairo_type": "felt", "full_name": "starkware.cairo.common.hash.hash2.result", "references": [ { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 8, "value": "[cast([fp + (-5)] + 2, felt*)]" } ], "type": "reference" }, "starkware.cairo.common.hash.hash2.x": { "cairo_type": "felt", "full_name": "starkware.cairo.common.hash.hash2.x", "references": [ { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 6, "value": "[cast(fp + (-4), felt*)]" } ], "type": "reference" }, "starkware.cairo.common.hash.hash2.y": { "cairo_type": "felt", "full_name": "starkware.cairo.common.hash.hash2.y", "references": [ { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 6, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "starkware.cairo.common.keccak_state.KeccakBuiltinState": { "full_name": "starkware.cairo.common.keccak_state.KeccakBuiltinState", "members": { "s0": { "cairo_type": "felt", "offset": 0 }, "s1": { "cairo_type": "felt", "offset": 1 }, "s2": { "cairo_type": "felt", "offset": 2 }, "s3": { "cairo_type": "felt", "offset": 3 }, "s4": { "cairo_type": "felt", "offset": 4 }, "s5": { "cairo_type": "felt", "offset": 5 }, "s6": { "cairo_type": "felt", "offset": 6 }, "s7": { "cairo_type": "felt", "offset": 7 } }, "size": 8, "type": "struct" }, "starkware.cairo.common.poseidon_state.PoseidonBuiltinState": { "full_name": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", "members": { "s0": { "cairo_type": "felt", "offset": 0 }, "s1": { "cairo_type": "felt", "offset": 1 }, "s2": { "cairo_type": "felt", "offset": 2 } }, "size": 3, "type": "struct" } }, "main_scope": "__main__", "prime": "0x800000000000011000000000000000000000000000000000000000000000001", "reference_manager": { "references": [ { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 6, "value": "[cast(fp + (-4), felt*)]" }, { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 6, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 6, "value": "[cast(fp + (-5), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 8, "value": "[cast([fp + (-5)] + 2, felt*)]" }, { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 8, "value": "cast([fp + (-5)] + 3, starkware.cairo.common.cairo_builtins.HashBuiltin*)" }, { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp, __main__.InputConfig*)]" }, { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 4, felt*)]" }, { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 5, felt*)]" }, { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 6, felt*)]" }, { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 7, felt*)]" }, { "ap_tracking_data": { "group": 4, "offset": 2 }, "pc": 21, "value": "[cast(fp, felt**)]" }, { "ap_tracking_data": { "group": 4, "offset": 2 }, "pc": 21, "value": "[cast(fp + 1, felt*)]" }, { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-4), felt**)]" }, { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 31, "value": "[cast([fp + (-4)], felt*)]" }, { "ap_tracking_data": { "group": 5, "offset": 7 }, "pc": 36, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 5, "offset": 7 }, "pc": 36, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 6, "offset": 0 }, "pc": 42, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp, felt**)]" }, { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp + 1, felt*)]" }, { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp + 2, felt**)]" }, { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp + 3, felt*)]" }, { "ap_tracking_data": { "group": 8, "offset": 2 }, "pc": 52, "value": "[cast(fp, __main__.NonceUpdate***)]" }, { "ap_tracking_data": { "group": 8, "offset": 2 }, "pc": 52, "value": "[cast(fp + 1, felt*)]" }, { "ap_tracking_data": { "group": 9, "offset": 0 }, "pc": 55, "value": "[cast(fp + (-3), __main__.NonceUpdate**)]" }, { "ap_tracking_data": { "group": 9, "offset": 0 }, "pc": 55, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 9, "offset": 0 }, "pc": 55, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 9, "offset": 7 }, "pc": 60, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 9, "offset": 7 }, "pc": 60, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-4), __main__.NonceUpdate***)]" }, { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 68, "value": "[cast([fp + (-4)], __main__.NonceUpdate**)]" }, { "ap_tracking_data": { "group": 10, "offset": 11 }, "pc": 72, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 10, "offset": 11 }, "pc": 72, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 10, "offset": 18 }, "pc": 77, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 10, "offset": 18 }, "pc": 77, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 11, "offset": 0 }, "pc": 83, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 12, "offset": 2 }, "pc": 86, "value": "[cast(fp, __main__.StorageUpdate***)]" }, { "ap_tracking_data": { "group": 12, "offset": 2 }, "pc": 86, "value": "[cast(fp + 1, felt*)]" }, { "ap_tracking_data": { "group": 13, "offset": 0 }, "pc": 89, "value": "[cast(fp + (-3), __main__.StorageUpdate**)]" }, { "ap_tracking_data": { "group": 13, "offset": 0 }, "pc": 89, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 13, "offset": 0 }, "pc": 89, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 13, "offset": 7 }, "pc": 94, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 13, "offset": 7 }, "pc": 94, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 13, "offset": 12 }, "pc": 97, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 13, "offset": 12 }, "pc": 97, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-4), __main__.StorageUpdate***)]" }, { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 105, "value": "[cast([fp + (-4)], __main__.StorageUpdate**)]" }, { "ap_tracking_data": { "group": 14, "offset": 16 }, "pc": 109, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 14, "offset": 16 }, "pc": 109, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 14, "offset": 23 }, "pc": 114, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 14, "offset": 23 }, "pc": 114, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 15, "offset": 0 }, "pc": 120, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 16, "offset": 2 }, "pc": 123, "value": "[cast(fp, __main__.ContractUpdate***)]" }, { "ap_tracking_data": { "group": 16, "offset": 2 }, "pc": 123, "value": "[cast(fp + 1, felt*)]" }, { "ap_tracking_data": { "group": 17, "offset": 0 }, "pc": 126, "value": "[cast(fp + (-3), __main__.ContractUpdate**)]" }, { "ap_tracking_data": { "group": 17, "offset": 0 }, "pc": 126, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 17, "offset": 0 }, "pc": 126, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 17, "offset": 7 }, "pc": 131, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 17, "offset": 7 }, "pc": 131, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-4), __main__.ContractUpdate***)]" }, { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 139, "value": "[cast([fp + (-4)], __main__.ContractUpdate**)]" }, { "ap_tracking_data": { "group": 18, "offset": 11 }, "pc": 143, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 18, "offset": 11 }, "pc": 143, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 18, "offset": 18 }, "pc": 148, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 18, "offset": 18 }, "pc": 148, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 19, "offset": 0 }, "pc": 154, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 20, "offset": 2 }, "pc": 157, "value": "[cast(fp, __main__.DeclaredClass***)]" }, { "ap_tracking_data": { "group": 20, "offset": 2 }, "pc": 157, "value": "[cast(fp + 1, felt*)]" }, { "ap_tracking_data": { "group": 21, "offset": 0 }, "pc": 160, "value": "[cast(fp + (-3), __main__.DeclaredClass**)]" }, { "ap_tracking_data": { "group": 21, "offset": 0 }, "pc": 160, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 21, "offset": 0 }, "pc": 160, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 21, "offset": 7 }, "pc": 165, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 21, "offset": 7 }, "pc": 165, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-4), __main__.DeclaredClass***)]" }, { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 173, "value": "[cast([fp + (-4)], __main__.DeclaredClass**)]" }, { "ap_tracking_data": { "group": 22, "offset": 11 }, "pc": 177, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 22, "offset": 11 }, "pc": 177, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 22, "offset": 18 }, "pc": 182, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 22, "offset": 18 }, "pc": 182, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 23, "offset": 0 }, "pc": 188, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-6), felt**)]" }, { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-4), felt*)]" }, { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 24, "offset": 1 }, "pc": 192, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 24, "offset": 2 }, "pc": 195, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 24, "offset": 3 }, "pc": 196, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 24, "offset": 1 }, "pc": 201, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 24, "offset": 2 }, "pc": 202, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 2 }, "pc": 219, "value": "[cast(fp, felt**)]" }, { "ap_tracking_data": { "group": 26, "offset": 2 }, "pc": 219, "value": "[cast(fp + 1, felt*)]" }, { "ap_tracking_data": { "group": 27, "offset": 0 }, "pc": 222, "value": "[cast(fp + (-4), felt**)]" }, { "ap_tracking_data": { "group": 27, "offset": 0 }, "pc": 222, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 27, "offset": 0 }, "pc": 222, "value": "[cast(fp + (-5), felt**)]" }, { "ap_tracking_data": { "group": 27, "offset": 0 }, "pc": 228, "value": "[cast([fp + (-4)], felt*)]" }, { "ap_tracking_data": { "group": 27, "offset": 1 }, "pc": 229, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 27, "offset": 1 }, "pc": 230, "value": "cast([fp + (-5)] + 1, felt*)" }, { "ap_tracking_data": { "group": 28, "offset": 0 }, "pc": 238, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 29, "offset": 14 }, "pc": 241, "value": "[cast(ap + (-4), __main__.InputConfig*)]" }, { "ap_tracking_data": { "group": 29, "offset": 20 }, "pc": 243, "value": "[cast(ap + (-2), __main__.NonceUpdate***)]" }, { "ap_tracking_data": { "group": 29, "offset": 20 }, "pc": 243, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 29, "offset": 26 }, "pc": 245, "value": "[cast(ap + (-2), __main__.StorageUpdate***)]" }, { "ap_tracking_data": { "group": 29, "offset": 26 }, "pc": 245, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 29, "offset": 32 }, "pc": 247, "value": "[cast(ap + (-2), __main__.ContractUpdate***)]" }, { "ap_tracking_data": { "group": 29, "offset": 32 }, "pc": 247, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 29, "offset": 38 }, "pc": 249, "value": "[cast(ap + (-2), __main__.DeclaredClass***)]" }, { "ap_tracking_data": { "group": 29, "offset": 38 }, "pc": 249, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 29, "offset": 48 }, "pc": 251, "value": "[cast(ap + (-4), __main__.MassagesInput*)]" }, { "ap_tracking_data": { "group": 29, "offset": 54 }, "pc": 253, "value": "[cast(ap + (-2), __main__.WorldDaInput*)]" }, { "ap_tracking_data": { "group": 30, "offset": 0 }, "pc": 272, "value": "[cast(fp + (-6), felt**)]" }, { "ap_tracking_data": { "group": 30, "offset": 0 }, "pc": 272, "value": "[cast(fp + (-5), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 30, "offset": 0 }, "pc": 272, "value": "[cast(fp + (-4), felt*)]" }, { "ap_tracking_data": { "group": 30, "offset": 0 }, "pc": 272, "value": "[cast(fp + (-3), felt**)]" }, { "ap_tracking_data": { "group": 30, "offset": 111 }, "pc": 276, "value": "[cast(ap + (-18), __main__.ProgramInput*)]" }, { "ap_tracking_data": { "group": 30, "offset": 111 }, "pc": 294, "value": "[cast(fp, __main__.ProgramInput*)]" }, { "ap_tracking_data": { "group": 30, "offset": 185 }, "pc": 296, "value": "[cast(ap + (-18), __main__.ProgramInput*)]" }, { "ap_tracking_data": { "group": 30, "offset": 185 }, "pc": 314, "value": "[cast(fp + 18, __main__.ProgramInput*)]" }, { "ap_tracking_data": { "group": 30, "offset": 186 }, "pc": 317, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 30, "offset": 192 }, "pc": 323, "value": "[cast(ap + (-2), __main__.WorldDaInput*)]" }, { "ap_tracking_data": { "group": 30, "offset": 192 }, "pc": 323, "value": "cast(0, felt)" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 330, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 330, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 331, "value": "[cast(fp + 36, starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 332, "value": "cast([fp + (-6)] + 6, felt*)" }, { "ap_tracking_data": { "group": 31, "offset": 1 }, "pc": 333, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 31, "offset": 1 }, "pc": 334, "value": "cast([fp + (-6)] + 7, felt*)" }, { "ap_tracking_data": { "group": 32, "offset": 0 }, "pc": 340, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 33, "offset": 0 }, "pc": 344, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 33, "offset": 1 }, "pc": 345, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 33, "offset": 1 }, "pc": 346, "value": "cast([ap + (-2)] + 1, felt*)" }, { "ap_tracking_data": { "group": 34, "offset": 0 }, "pc": 352, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 35, "offset": 0 }, "pc": 356, "value": "[cast(ap + (-1), felt**)]" } ] }} \ No newline at end of file diff --git a/bin/saya/src/args/mod.rs b/bin/saya/src/args/mod.rs index e9199126ae..7c40bd4935 100644 --- a/bin/saya/src/args/mod.rs +++ b/bin/saya/src/args/mod.rs @@ -6,7 +6,7 @@ use std::path::PathBuf; use clap::Parser; use saya_core::data_availability::celestia::CelestiaConfig; use saya_core::data_availability::DataAvailabilityConfig; -use saya_core::SayaConfig; +use saya_core::{ProverAccessKey, SayaConfig}; use tracing::Subscriber; use tracing_subscriber::{fmt, EnvFilter}; use url::Url; @@ -32,7 +32,19 @@ pub struct SayaArgs { #[arg(long)] #[arg(value_name = "PROVER URL")] #[arg(help = "The Prover URL for remote proving.")] - pub prover_url: Url, + pub url: Url, + + /// Specify the Prover Key. + #[arg(long)] + #[arg(value_name = "PROVER KEY")] + #[arg(help = "An authorized prover key for remote proving.")] + pub private_key: String, + + #[arg(long)] + #[arg(value_name = "STORE PROOFS")] + #[arg(help = "When enabled all proofs are saved as a file.")] + #[arg(default_value_t = false)] + pub store_proofs: bool, /// Enable JSON logging. #[arg(long)] @@ -50,6 +62,10 @@ pub struct SayaArgs { #[arg(short, long, default_value = "0")] pub start_block: u64, + #[arg(short, long, default_value = "1")] + #[arg(help = "The number of blocks to be merged into a single proof.")] + pub batch_size: usize, + #[command(flatten)] #[command(next_help_heading = "Data availability options")] pub data_availability: DataAvailabilityOptions, @@ -117,10 +133,17 @@ impl TryFrom for SayaConfig { None => None, }; + let prover_key = ProverAccessKey::from_hex_string(&args.private_key).map_err(|e| { + Box::new(std::io::Error::new(std::io::ErrorKind::InvalidInput, e.to_string())) + })?; + Ok(SayaConfig { katana_rpc: args.rpc_url, - prover_url: args.prover_url, + url: args.url, + private_key: prover_key, + store_proofs: args.store_proofs, start_block: args.start_block, + batch_size: args.batch_size, data_availability: da_config, world_address: args.proof.world_address, fact_registry_address: args.proof.fact_registry_address, @@ -145,9 +168,13 @@ mod tests { let args = SayaArgs { config_file: Some(config_file_path.clone()), rpc_url: Url::parse("http://localhost:5050").unwrap(), - prover_url: Url::parse("http://localhost:5050").unwrap(), + url: Url::parse("http://localhost:5050").unwrap(), + private_key: "0xd0fa91f4949e9a777ebec071ca3ca6acc1f5cd6c6827f123b798f94e73425027" + .into(), + store_proofs: true, json_log: false, start_block: 0, + batch_size: 4, data_availability: DataAvailabilityOptions { da_chain: None, celestia: CelestiaOptions { @@ -165,7 +192,13 @@ mod tests { let config: SayaConfig = args.try_into().unwrap(); assert_eq!(config.katana_rpc.as_str(), "http://localhost:5050/"); - assert_eq!(config.prover_url.as_str(), "http://localhost:1234/"); + assert_eq!(config.url.as_str(), "http://localhost:1234/"); + assert_eq!(config.batch_size, 4); + assert_eq!( + config.private_key.signing_key_as_hex_string(), + "0xd0fa91f4949e9a777ebec071ca3ca6acc1f5cd6c6827f123b798f94e73425027" + ); + assert!(!config.store_proofs); assert_eq!(config.start_block, 0); if let Some(DataAvailabilityConfig::Celestia(celestia_config)) = config.data_availability { assert_eq!(celestia_config.node_url.as_str(), "http://localhost:26657/"); diff --git a/bin/saya/src/args/test_saya_config_file.json b/bin/saya/src/args/test_saya_config_file.json index b3445089fd..478f88faf6 100644 --- a/bin/saya/src/args/test_saya_config_file.json +++ b/bin/saya/src/args/test_saya_config_file.json @@ -1,6 +1,9 @@ { "katana_rpc": "http://localhost:5050", - "prover_url": "http://localhost:1234", + "url": "http://localhost:1234", + "private_key": "0xd0fa91f4949e9a777ebec071ca3ca6acc1f5cd6c6827f123b798f94e73425027", + "store_proofs": false, + "batch_size": 4, "world_address": "0x332b8ff41b1b026991fa9b7f0ec352909f8bc33416b65a80527edc988a9b082", "fact_registry_address": "0x217746a5f74c2e5b6fa92c97e902d8cd78b1fabf1e8081c4aa0d2fe159bc0eb", "start_block": 0, diff --git a/bin/saya/src/main.rs b/bin/saya/src/main.rs index 9ed0796eb9..376a337b21 100644 --- a/bin/saya/src/main.rs +++ b/bin/saya/src/main.rs @@ -6,6 +6,9 @@ use tokio::signal::ctrl_c; mod args; +#[cfg(test)] +mod tests; + use args::SayaArgs; #[tokio::main] @@ -54,7 +57,7 @@ CONFIGURATION if let Some(da_config) = &config.data_availability { println!( r" -DATA AVAILBILITY +DATA AVAILABILITY ================== {da_config} ", diff --git a/bin/saya/src/tests.rs b/bin/saya/src/tests.rs new file mode 100644 index 0000000000..fbb9b4b727 --- /dev/null +++ b/bin/saya/src/tests.rs @@ -0,0 +1,408 @@ +use std::env; +use std::str::FromStr; +use std::sync::Arc; +use std::time::Duration; + +use cairo_proof_parser::output::extract_output; +use katana_primitives::contract::ContractAddress; +use katana_primitives::state::StateUpdates; +use saya_core::prover::extract::program_input_from_program_output; +use saya_core::prover::{ + prove_diff, HttpProverParams, MessageToAppchain, MessageToStarknet, ProgramInput, ProveProgram, + ProverIdentifier, ProvingState, Scheduler, +}; +use saya_core::ProverAccessKey; +use starknet_crypto::FieldElement; +use tokio::time::sleep; + +fn prover_identifier() -> ProverIdentifier { + let prover_key = env::var("PROVER_ACCESS_KEY").expect("PROVER_ACCESS_KEY not set."); + + ProverIdentifier::Http(Arc::new(HttpProverParams { + prover_url: "http://prover.visoft.dev:3618".parse().unwrap(), + prover_key: ProverAccessKey::from_hex_string(&prover_key) + .expect("Failed to parse prover key."), + })) +} + +fn sorted(mut v: Vec) -> Vec +where + E: std::cmp::Ord, +{ + v.sort(); + v +} + +#[ignore] +#[tokio::test] +async fn test_program_input_from_program_output() -> anyhow::Result<()> { + let mut input = ProgramInput { + prev_state_root: FieldElement::from_str("101").unwrap(), + block_number: 102, + block_hash: FieldElement::from_str("103").unwrap(), + config_hash: FieldElement::from_str("104").unwrap(), + message_to_starknet_segment: vec![ + MessageToStarknet { + from_address: ContractAddress::from(FieldElement::from_str("105").unwrap()), + to_address: ContractAddress::from(FieldElement::from_str("106").unwrap()), + payload: vec![FieldElement::from_str("107").unwrap()], + }, + MessageToStarknet { + from_address: ContractAddress::from(FieldElement::from_str("105").unwrap()), + to_address: ContractAddress::from(FieldElement::from_str("106").unwrap()), + payload: vec![FieldElement::from_str("107").unwrap()], + }, + ], + message_to_appchain_segment: vec![ + MessageToAppchain { + from_address: ContractAddress::from(FieldElement::from_str("108").unwrap()), + to_address: ContractAddress::from(FieldElement::from_str("109").unwrap()), + nonce: FieldElement::from_str("110").unwrap(), + selector: FieldElement::from_str("111").unwrap(), + payload: vec![FieldElement::from_str("112").unwrap()], + }, + MessageToAppchain { + from_address: ContractAddress::from(FieldElement::from_str("108").unwrap()), + to_address: ContractAddress::from(FieldElement::from_str("109").unwrap()), + nonce: FieldElement::from_str("110").unwrap(), + selector: FieldElement::from_str("111").unwrap(), + payload: vec![FieldElement::from_str("112").unwrap()], + }, + ], + state_updates: StateUpdates { + nonce_updates: { + let mut map = std::collections::HashMap::new(); + map.insert( + ContractAddress::from(FieldElement::from_str("1111").unwrap()), + FieldElement::from_str("22222").unwrap(), + ); + map + }, + storage_updates: vec![( + ContractAddress::from(FieldElement::from_str("333")?), + vec![(FieldElement::from_str("4444")?, FieldElement::from_str("555")?)] + .into_iter() + .collect(), + )] + .into_iter() + .collect(), + contract_updates: { + let mut map = std::collections::HashMap::new(); + map.insert( + ContractAddress::from(FieldElement::from_str("66666").unwrap()), + FieldElement::from_str("7777").unwrap(), + ); + map + }, + declared_classes: { + let mut map = std::collections::HashMap::new(); + map.insert( + FieldElement::from_str("88888").unwrap(), + FieldElement::from_str("99999").unwrap(), + ); + map + }, + }, + world_da: None, + }; + + input.fill_da(333u64.into()); + + let serialized_input = serde_json::to_string(&input).unwrap(); + let proof = + prove_diff(serialized_input, prover_identifier(), ProveProgram::Differ).await.unwrap(); + + let program_output_from_proof = extract_output(&proof).unwrap().program_output; + let program_input_from_proof = program_input_from_program_output( + program_output_from_proof, + input.clone().state_updates, + 333u64.into(), + ) + .unwrap(); + assert_eq!(input, program_input_from_proof); + Ok(()) +} + +#[ignore] +#[tokio::test] +async fn test_combine_proofs() { + let input1 = r#"{ + "prev_state_root": "101", + "block_number": 102, + "block_hash": "103", + "config_hash": "104", + "message_to_starknet_segment": [ + "105", + "106", + "1", + "107" + ], + "message_to_appchain_segment": [ + "108", + "109", + "110", + "111", + "1", + "112" + ], + "nonce_updates": { + "1111": "22222" + }, + "storage_updates": { + "333": { + "4444": "555" + } + }, + "contract_updates": { + "66666": "7777" + }, + "declared_classes": { + "88888": "99999" + }, + "world_da": [] + }"#; + let input2 = r#"{ + "prev_state_root": "201", + "block_number": 103, + "block_hash": "203", + "config_hash": "204", + "message_to_starknet_segment": [ + "205", + "206", + "1", + "207" + ], + "message_to_appchain_segment": [ + "208", + "209", + "210", + "211", + "1", + "207" + ], + "nonce_updates": { + "12334": "214354" + }, + "storage_updates": { + "333": { + "44536346444": "565474555" + } + }, + "contract_updates": { + "4356345": "775468977" + }, + "declared_classes": { + "88556753888": "9995764599" + }, + "world_da": [] + }"#; + let expected = r#"{ + "prev_state_root": "101", + "block_number": 103, + "block_hash": "203", + "config_hash": "104", + "message_to_starknet_segment": [ + "105", + "106", + "1", + "107", + "205", + "206", + "1", + "207" + ], + "message_to_appchain_segment": [ + "108", + "109", + "110", + "111", + "1", + "112", + "208", + "209", + "210", + "211", + "1", + "207" + ], + "nonce_updates": { + "12334": "214354", + "1111": "22222" + }, + "storage_updates": { + "333": { + "44536346444": "565474555", + "4444": "555" + } + }, + "contract_updates": { + "4356345": "775468977", + "66666": "7777" + }, + "declared_classes": { + "88556753888": "9995764599", + "88888": "99999" + }, + "world_da": [ + "4444", + "555", + "44536346444", + "565474555" + ] + }"#; + + let mut inputs = vec![input1, input2] + .into_iter() + .map(|s| serde_json::from_str::(s).unwrap()) + .collect::>(); + + let world = FieldElement::from_dec_str("333").unwrap(); + for input in &mut inputs { + input.fill_da(world) + } + + let mut scheduler = Scheduler::new(2, world, prover_identifier()); + scheduler.push_diff(inputs.remove(0)).unwrap(); + + sleep(Duration::from_millis(5)).await; + + assert!(!scheduler.is_full()); + assert_eq!(scheduler.query(102).await.unwrap(), ProvingState::Proving); + assert_eq!(scheduler.query(103).await.unwrap(), ProvingState::NotPushed); + + scheduler.push_diff(inputs.remove(0)).unwrap(); + sleep(Duration::from_millis(5)).await; + + assert!(scheduler.is_full()); + assert_eq!(scheduler.query(102).await.unwrap(), ProvingState::Proving); + assert_eq!(scheduler.query(103).await.unwrap(), ProvingState::Proving); + + let (_, output, block_range) = scheduler.proved().await.unwrap(); + let expected: ProgramInput = serde_json::from_str(expected).unwrap(); + assert_eq!(output, expected); + assert_eq!(block_range, (102, 103)); +} + +#[ignore] +#[tokio::test] +async fn test_4_combine_proofs() -> anyhow::Result<()> { + let world = FieldElement::from_dec_str("42")?; + + let input_1 = r#"{ + "prev_state_root": "101", + "block_number": 101, + "block_hash": "103", + "config_hash": "104", + "message_to_starknet_segment": ["105", "106", "1", "1"], + "message_to_appchain_segment": ["108", "109", "110", "111", "1", "112"], + "storage_updates": { + "42": { + "2010": "1200", + "2012": "1300" + } + }, + "nonce_updates": {}, + "contract_updates": {}, + "declared_classes": {} + } + "#; + + let input_2 = r#"{ + "prev_state_root": "1011", + "block_number": 102, + "block_hash": "1033", + "config_hash": "104", + "message_to_starknet_segment": ["135", "136", "1", "1"], + "message_to_appchain_segment": ["158", "159", "150", "151", "1", "152"], + "storage_updates": { + "42": { + "2010": "1250", + "2032": "1300" + } + }, + "nonce_updates": {}, + "contract_updates": {}, + "declared_classes": {} + }"#; + + let input_3 = r#"{ + "prev_state_root": "10111", + "block_number": 103, + "block_hash": "10333", + "config_hash": "104", + "message_to_starknet_segment": [], + "message_to_appchain_segment": [], + "storage_updates": { + "42": { + "2013": "2" + } + }, + "nonce_updates": {}, + "contract_updates": {}, + "declared_classes": {} + }"#; + + let input_4 = r#"{ + "prev_state_root": "101111", + "block_number": 104, + "block_hash": "103333", + "config_hash": "104", + "message_to_starknet_segment": ["165", "166", "1", "1"], + "message_to_appchain_segment": ["168", "169", "160", "161", "1", "162"], + "storage_updates": { + "42": { + "2010": "1700" + } + }, + "nonce_updates": {}, + "contract_updates": {}, + "declared_classes": {} + } + "#; + + let expected = r#"{ + "prev_state_root": "101", + "block_number": 104, + "block_hash": "103333", + "config_hash": "104", + "message_to_starknet_segment": ["105", "106", "1", "1", "135", "136", "1", "1", "165", "166", "1", "1"], + "message_to_appchain_segment": ["108", "109", "110", "111", "1", "112", "158", "159", "150", "151", "1", "152", "168", "169", "160", "161", "1", "162"], + "storage_updates": { + "42": { + "2010": "1700", + "2012": "1300", + "2032": "1300", + "2013": "2" + } + }, + "nonce_updates": {}, + "contract_updates": {}, + "declared_classes": {}, + "world_da": ["2010", "1700", "2012", "1300", "2032", "1300", "2013", "2"] + }"#; + + let inputs = vec![input_1, input_2, input_3, input_4] + .into_iter() + .map(|input| { + let mut input = serde_json::from_str::(input).unwrap(); + input.fill_da(world); + input + }) + .collect::>(); + + let expected = serde_json::from_str::(expected).unwrap(); + + let (_proof, output) = Scheduler::merge(inputs, world, prover_identifier()).await?; + assert_eq!(output.message_to_appchain_segment, expected.message_to_appchain_segment); + assert_eq!(output.message_to_starknet_segment, expected.message_to_starknet_segment); + + assert_eq!(sorted(output.world_da.unwrap()), sorted(expected.world_da.unwrap())); + assert_eq!(output.state_updates, expected.state_updates); + + assert_eq!(expected.prev_state_root, output.prev_state_root); + assert_eq!(expected.block_number, output.block_number); + assert_eq!(expected.block_hash, output.block_hash); + assert_eq!(expected.config_hash, output.config_hash); + + Ok(()) +} diff --git a/bin/scheduler/Cargo.toml b/bin/scheduler/Cargo.toml new file mode 100644 index 0000000000..2db9f60385 --- /dev/null +++ b/bin/scheduler/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "scheduler" +edition.workspace = true +license.workspace = true +repository.workspace = true +version.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +saya-core.workspace = true +katana-primitives.workspace = true +tokio.workspace = true +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +clap.workspace = true +clap_complete.workspace = true +url = "2.5.0" diff --git a/bin/scheduler/README.md b/bin/scheduler/README.md new file mode 100644 index 0000000000..baa673141b --- /dev/null +++ b/bin/scheduler/README.md @@ -0,0 +1,36 @@ +# `scheduler` + +```sh +cargo run --bin scheduler -- --world --key your_input.json your_input2.json ... your_input2^n +``` +## number of inputs have to be power of 2 +# input format example + +```json +{ + "prev_state_root":101, + "block_number":102, + "block_hash":103, + "config_hash":104, + "message_to_starknet_segment":[105,106,1,1], + "message_to_appchain_segment":[108,109,110,111,1,112], + "nonce_updates":{}, + "storage_updates":{ + "42": { + "2010": 1200, + "2012": 1300 + } + }, + "contract_updates":{}, + "declared_classes":{} +} +``` + +# output +## scheduler outputs map of proofs in result.json file +```json +{ + "proof1": proof, + "proof2": proof, +} +``` \ No newline at end of file diff --git a/bin/scheduler/src/main.rs b/bin/scheduler/src/main.rs new file mode 100644 index 0000000000..275b4036ed --- /dev/null +++ b/bin/scheduler/src/main.rs @@ -0,0 +1,78 @@ +use std::fs; +use std::sync::Arc; + +use clap::Parser; +use katana_primitives::FieldElement; +use saya_core::prover::{HttpProverParams, ProgramInput, ProverIdentifier, Scheduler}; +use saya_core::ProverAccessKey; +use serde::{Deserialize, Serialize}; +use serde_json::{Map, Value}; +use tokio::fs::File; +use tokio::io::AsyncWriteExt; + +#[derive(Parser, Debug, Serialize, Deserialize)] +#[clap(author, version, about, long_about = None)] +pub struct CliInput { + #[arg(short, long)] + pub world: FieldElement, + #[arg(short, long)] + pub key: String, + pub files: Vec, +} + +fn read_json_file(file_path: &str) -> Value { + let data = fs::read_to_string(file_path).expect("Unable to read file"); + serde_json::from_str(&data).expect("Unable to parse JSON") +} + +fn program_input_from_json(json_data: Value) -> ProgramInput { + serde_json::from_value(json_data).unwrap() +} + +async fn prove_to_json(result: Vec) { + let mut file = File::create("result.json").await.expect("Failed to create file"); + + let mut json_map = Map::new(); + for (index, elem) in result.iter().enumerate() { + let v: Value = serde_json::from_str(elem).expect("Failed to parse JSON"); + json_map.insert(format!("proof {}", index + 1), v); // Labels start from "proof 1", "proof 2", ... + } + + let serialized = serde_json::to_string_pretty(&json_map).expect("Failed to serialize result"); + + file.write_all(serialized.as_bytes()).await.expect("Failed to write to file"); +} + +// Entry point of the program with async main function to handle I/O operations. + +#[tokio::main] +async fn main() { + use url::Url; + let args = CliInput::parse(); // Parse CLI arguments. + if args.files.is_empty() { + eprintln!("No files provided"); + std::process::exit(1); + } + if !args.files.len().is_power_of_two() { + eprintln!("Only 2^n files are supported. Got {} files", args.files.len()); + std::process::exit(1); + } + + // Process each file, converting JSON data to ProgramInput. + let inputs: Vec = args + .files + .iter() + .map(|file| { + let json_data = read_json_file(file.to_str().unwrap()); + program_input_from_json(json_data) + }) + .collect(); + let prover_params = Arc::new(HttpProverParams { + prover_url: Url::parse("http://localhost:3000").unwrap(), + prover_key: ProverAccessKey::from_hex_string(&args.key).unwrap(), + }); + + let result = + Scheduler::merge(inputs, args.world, ProverIdentifier::Http(prover_params)).await.unwrap(); + prove_to_json(vec![result.0]).await; +} diff --git a/bin/sozo/README.md b/bin/sozo/README.md index c88c71a7e2..bb864ed5b3 100644 --- a/bin/sozo/README.md +++ b/bin/sozo/README.md @@ -4,7 +4,7 @@ curl -L https://install.dojoengine.org | bash ``` -[Documentation](https://book.dojoengine.org/toolchain/sozo/overview) +[Documentation](https://book.dojoengine.org/toolchain/sozo) Some parts of sozo were inspired by [starkli](https://github.com/xJonathanLEI/starkli) created by Jonathan LEI. It is licensed under Apache 2.0 / MIT License. diff --git a/bin/sozo/src/args.rs b/bin/sozo/src/args.rs index ba11d6a5b1..928bc8a4b1 100644 --- a/bin/sozo/src/args.rs +++ b/bin/sozo/src/args.rs @@ -33,7 +33,7 @@ pub struct SozoArgs { #[arg(long)] #[arg(env = "SOZO_OFFLINE")] - #[arg(hide_short_help = true)] + #[arg(hide_short_help = true, global = true)] #[arg(help = "Run without accessing the network.")] pub offline: bool, @@ -70,15 +70,15 @@ impl SozoArgs { #[derive(Parser, Clone, Debug)] #[group(multiple = false)] pub struct ProfileSpec { - #[arg(short = 'P', long)] + #[arg(short = 'P', long, global = true)] #[arg(help = "Specify profile to use by name.")] pub profile: Option, - #[arg(long, hide_short_help = true)] + #[arg(long, hide_short_help = true, global = true)] #[arg(help = "Use release profile.")] pub release: bool, - #[arg(long, hide_short_help = true)] + #[arg(long, hide_short_help = true, global = true)] #[arg(help = "Use dev profile.")] pub dev: bool, } diff --git a/bin/sozo/src/commands/build.rs b/bin/sozo/src/commands/build.rs index 06e7967ccc..5d1d5df7cf 100644 --- a/bin/sozo/src/commands/build.rs +++ b/bin/sozo/src/commands/build.rs @@ -2,6 +2,8 @@ use anyhow::{Context, Result}; use clap::Args; use dojo_bindgen::{BuiltinPlugins, PluginManager}; use dojo_lang::scarb_internal::compile_workspace; +use dojo_world::manifest::MANIFESTS_DIR; +use dojo_world::metadata::dojo_metadata_from_workspace; use prettytable::format::consts::FORMAT_NO_LINESEP_WITH_TITLE; use prettytable::{format, Cell, Row, Table}; use scarb::core::{Config, TargetKind}; @@ -9,12 +11,20 @@ use scarb::ops::{CompileOpts, FeaturesOpts, FeaturesSelector}; use sozo_ops::statistics::{get_contract_statistics_for_dir, ContractStatistics}; use tracing::trace; +use crate::commands::clean::CleanArgs; + +const BYTECODE_SIZE_LABEL: &str = "Bytecode size [in felts]\n(Sierra, Casm)"; +const CONTRACT_CLASS_SIZE_LABEL: &str = "Contract Class size [in bytes]\n(Sierra, Casm)"; + +const CONTRACT_NAME_LABEL: &str = "Contract"; + #[derive(Debug, Args)] pub struct BuildArgs { - #[arg(long)] - #[arg(help = "Generate Typescript bindings.")] - pub typescript: bool, - + // Should we deprecate typescript bindings codegen? + // Disabled due to lack of support in dojo.js + // #[arg(long)] + // #[arg(help = "Generate Typescript bindings.")] + // pub typescript: bool, #[arg(long)] #[arg(help = "Generate Typescript bindings.")] pub typescript_v2: bool, @@ -33,6 +43,18 @@ pub struct BuildArgs { impl BuildArgs { pub fn run(self, config: &Config) -> Result<()> { + let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; + + let profile_name = + ws.current_profile().expect("Scarb profile is expected at this point.").to_string(); + + // Manifest path is always a file, we can unwrap safely to get the + // parent folder. + let manifest_dir = ws.manifest_path().parent().unwrap().to_path_buf(); + + let profile_dir = manifest_dir.join(MANIFESTS_DIR).join(profile_name); + CleanArgs::clean_manifests(&profile_dir)?; + let features_opts = FeaturesOpts { features: FeaturesSelector::AllFeatures, no_default_features: false }; @@ -47,9 +69,11 @@ impl BuildArgs { trace!(?compile_info, "Compiled workspace."); let mut builtin_plugins = vec![]; - if self.typescript { - builtin_plugins.push(BuiltinPlugins::Typescript); - } + + // Disable typescript for now. Due to lack of support and maintenance in dojo.js + // if self.typescript { + // builtin_plugins.push(BuiltinPlugins::Typescript); + // } if self.typescript_v2 { builtin_plugins.push(BuiltinPlugins::TypeScriptV2); @@ -61,7 +85,7 @@ impl BuildArgs { if self.stats { let target_dir = &compile_info.target_dir; - let contracts_statistics = get_contract_statistics_for_dir(target_dir) + let contracts_statistics = get_contract_statistics_for_dir(config.ui(), target_dir) .context("Error getting contracts stats")?; trace!( ?contracts_statistics, @@ -69,6 +93,22 @@ impl BuildArgs { "Read contract statistics for target directory." ); + let ui = config.ui(); + + ui.print( + "Bytecode: It is low-level code that constitutes smart contracts and is \ + represented by an array of felts.", + ); + ui.print("Bytecode size: It is number of felts in Bytecode."); + ui.print( + "Contract Class: It serve as the fundamental building blocks of smart contracts.", + ); + ui.print( + "Contract Class size: It denotes the file size of the minified JSON \ + representation of the contract class.", + ); + ui.print(" "); + let table = create_stats_table(contracts_statistics); table.printstd() } @@ -86,35 +126,52 @@ impl BuildArgs { }; trace!(pluginManager=?bindgen, "Generating bindings."); - tokio::runtime::Runtime::new() - .unwrap() - .block_on(bindgen.generate()) - .expect("Error generating bindings"); + // Only generate bindgen if a current package is defined with dojo metadata. + if let Some(dojo_metadata) = dojo_metadata_from_workspace(&ws) { + tokio::runtime::Runtime::new() + .unwrap() + .block_on(bindgen.generate(dojo_metadata.skip_migration)) + .expect("Error generating bindings"); + }; Ok(()) } } -fn create_stats_table(contracts_statistics: Vec) -> Table { +fn create_stats_table(mut contracts_statistics: Vec) -> Table { let mut table = Table::new(); table.set_format(*FORMAT_NO_LINESEP_WITH_TITLE); // Add table headers table.set_titles(Row::new(vec![ - Cell::new_align("Contract", format::Alignment::CENTER), - Cell::new_align("Bytecode size (felts)", format::Alignment::CENTER), - Cell::new_align("Class size (bytes)", format::Alignment::CENTER), + Cell::new_align(CONTRACT_NAME_LABEL, format::Alignment::CENTER), + Cell::new_align(BYTECODE_SIZE_LABEL, format::Alignment::CENTER), + Cell::new_align(CONTRACT_CLASS_SIZE_LABEL, format::Alignment::CENTER), ])); + // sort contracts in alphabetical order + contracts_statistics.sort_by(|a, b| a.contract_name.cmp(&b.contract_name)); + for contract_stats in contracts_statistics { // Add table rows let contract_name = contract_stats.contract_name; - let number_felts = contract_stats.number_felts; - let file_size = contract_stats.file_size; + + let sierra_bytecode_size = contract_stats.sierra_bytecode_size; + let sierra_contract_class_size = contract_stats.sierra_contract_class_size; + + let casm_bytecode_size = contract_stats.casm_bytecode_size; + let casm_contract_class_size = contract_stats.casm_contract_class_size; + table.add_row(Row::new(vec![ Cell::new_align(&contract_name, format::Alignment::LEFT), - Cell::new_align(format!("{}", number_felts).as_str(), format::Alignment::RIGHT), - Cell::new_align(format!("{}", file_size).as_str(), format::Alignment::RIGHT), + Cell::new_align( + format!("{}, {}", sierra_bytecode_size, casm_bytecode_size).as_str(), + format::Alignment::CENTER, + ), + Cell::new_align( + format!("{}, {}", sierra_contract_class_size, casm_contract_class_size).as_str(), + format::Alignment::CENTER, + ), ])); } @@ -129,7 +186,8 @@ mod tests { use prettytable::{format, Cell, Row, Table}; use sozo_ops::statistics::ContractStatistics; - use super::{create_stats_table, BuildArgs}; + use super::{create_stats_table, BuildArgs, *}; + use crate::commands::build::CONTRACT_NAME_LABEL; // Uncomment once bindings support arrays. #[test] @@ -141,9 +199,9 @@ mod tests { let build_args = BuildArgs { bindings_output: "generated".to_string(), - typescript: false, + // typescript: false, unity: true, - typescript_v2: false, + typescript_v2: true, stats: true, }; let result = build_args.run(&config); @@ -156,42 +214,48 @@ mod tests { let contracts_statistics = vec![ ContractStatistics { contract_name: "Test1".to_string(), - number_felts: 33, - file_size: 33, + sierra_bytecode_size: 33, + sierra_contract_class_size: 33, + casm_bytecode_size: 66, + casm_contract_class_size: 66, }, ContractStatistics { contract_name: "Test2".to_string(), - number_felts: 43, - file_size: 24, + sierra_bytecode_size: 43, + sierra_contract_class_size: 24, + casm_bytecode_size: 86, + casm_contract_class_size: 48, }, ContractStatistics { contract_name: "Test3".to_string(), - number_felts: 36, - file_size: 12, + sierra_bytecode_size: 36, + sierra_contract_class_size: 12, + casm_bytecode_size: 72, + casm_contract_class_size: 24, }, ]; let mut expected_table = Table::new(); expected_table.set_format(*FORMAT_NO_LINESEP_WITH_TITLE); expected_table.set_titles(Row::new(vec![ - Cell::new_align("Contract", format::Alignment::CENTER), - Cell::new_align("Bytecode size (felts)", format::Alignment::CENTER), - Cell::new_align("Class size (bytes)", format::Alignment::CENTER), + Cell::new_align(CONTRACT_NAME_LABEL, format::Alignment::CENTER), + Cell::new_align(BYTECODE_SIZE_LABEL, format::Alignment::CENTER), + Cell::new_align(CONTRACT_CLASS_SIZE_LABEL, format::Alignment::CENTER), ])); expected_table.add_row(Row::new(vec![ Cell::new_align("Test1", format::Alignment::LEFT), - Cell::new_align(format!("{}", 33).as_str(), format::Alignment::RIGHT), - Cell::new_align(format!("{}", 33).as_str(), format::Alignment::RIGHT), + Cell::new_align(format!("{}, {}", 33, 66).as_str(), format::Alignment::CENTER), + Cell::new_align(format!("{}, {}", 33, 66).as_str(), format::Alignment::CENTER), ])); expected_table.add_row(Row::new(vec![ Cell::new_align("Test2", format::Alignment::LEFT), - Cell::new_align(format!("{}", 43).as_str(), format::Alignment::RIGHT), - Cell::new_align(format!("{}", 24).as_str(), format::Alignment::RIGHT), + Cell::new_align(format!("{}, {}", 43, 86).as_str(), format::Alignment::CENTER), + Cell::new_align(format!("{}, {}", 24, 48).as_str(), format::Alignment::CENTER), ])); expected_table.add_row(Row::new(vec![ Cell::new_align("Test3", format::Alignment::LEFT), - Cell::new_align(format!("{}", 36).as_str(), format::Alignment::RIGHT), - Cell::new_align(format!("{}", 12).as_str(), format::Alignment::RIGHT), + Cell::new_align(format!("{}, {}", 36, 72).as_str(), format::Alignment::CENTER), + Cell::new_align(format!("{}, {}", 12, 24).as_str(), format::Alignment::CENTER), ])); // Act diff --git a/bin/sozo/src/commands/clean.rs b/bin/sozo/src/commands/clean.rs index 06fcd0a142..bf44226bb8 100644 --- a/bin/sozo/src/commands/clean.rs +++ b/bin/sozo/src/commands/clean.rs @@ -3,7 +3,7 @@ use std::fs; use anyhow::Result; use camino::Utf8PathBuf; use clap::Args; -use dojo_lang::compiler::{ABIS_DIR, BASE_DIR, MANIFESTS_DIR}; +use dojo_world::manifest::{ABIS_DIR, BASE_DIR, MANIFESTS_DIR}; use scarb::core::Config; use tracing::trace; @@ -21,7 +21,7 @@ impl CleanArgs { /// # Arguments /// /// * `profile_dir` - The directory where the profile files are located. - pub fn clean_manifests(&self, profile_dir: &Utf8PathBuf) -> Result<()> { + pub fn clean_manifests(profile_dir: &Utf8PathBuf) -> Result<()> { trace!(?profile_dir, "Cleaning manifests."); let dirs = vec![profile_dir.join(BASE_DIR), profile_dir.join(ABIS_DIR).join(BASE_DIR)]; @@ -51,7 +51,7 @@ impl CleanArgs { // By default, this command cleans the build manifests and scarb artifacts. trace!("Cleaning Scarb artifacts and build manifests."); scarb::ops::clean(config)?; - self.clean_manifests(&profile_dir)?; + Self::clean_manifests(&profile_dir)?; if self.all && profile_dir.exists() { trace!(?profile_dir, "Removing entire profile directory."); @@ -65,6 +65,7 @@ impl CleanArgs { #[cfg(test)] mod tests { use dojo_test_utils::compiler; + use dojo_world::metadata::dojo_metadata_from_workspace; use dojo_world::migration::TxnConfig; use katana_runner::KatanaRunner; use sozo_ops::migration; @@ -84,6 +85,10 @@ mod tests { let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); + let dojo_metadata = dojo_metadata_from_workspace(&ws).expect( + "No current package with dojo metadata found, clean is not yet support for workspaces.", + ); + // Plan the migration to generate some manifests other than base. config.tokio_handle().block_on(async { migration::migrate( @@ -94,6 +99,7 @@ mod tests { "dojo_examples", true, TxnConfig::default(), + dojo_metadata.skip_migration, ) .await .unwrap() diff --git a/bin/sozo/src/commands/dev.rs b/bin/sozo/src/commands/dev.rs index ae6f7aa55b..92b20e7c66 100644 --- a/bin/sozo/src/commands/dev.rs +++ b/bin/sozo/src/commands/dev.rs @@ -8,9 +8,8 @@ use cairo_lang_compiler::db::RootDatabase; use cairo_lang_filesystem::db::{AsFilesGroupMut, FilesGroupEx, PrivRawFileContentQuery}; use cairo_lang_filesystem::ids::FileId; use clap::Args; -use dojo_lang::compiler::{BASE_DIR, MANIFESTS_DIR}; use dojo_lang::scarb_internal::build_scarb_root_database; -use dojo_world::manifest::{BaseManifest, DeploymentManifest}; +use dojo_world::manifest::{BaseManifest, DeploymentManifest, BASE_DIR, MANIFESTS_DIR}; use dojo_world::metadata::dojo_metadata_from_workspace; use dojo_world::migration::world::WorldDiff; use dojo_world::migration::TxnConfig; @@ -20,10 +19,8 @@ use scarb::compiler::{CairoCompilationUnit, CompilationUnit, CompilationUnitAttr use scarb::core::{Config, Workspace}; use scarb::ops::{FeaturesOpts, FeaturesSelector}; use sozo_ops::migration; -use starknet::accounts::SingleOwnerAccount; +use starknet::accounts::ConnectedAccount; use starknet::core::types::FieldElement; -use starknet::providers::Provider; -use starknet::signers::Signer; use tracing::{error, trace}; use super::migrate::setup_env; @@ -48,13 +45,20 @@ pub struct DevArgs { #[command(flatten)] pub account: AccountOptions, } - impl DevArgs { pub fn run(self, config: &Config) -> Result<()> { let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; + let dojo_metadata = if let Some(metadata) = dojo_metadata_from_workspace(&ws) { + metadata + } else { + return Err(anyhow!( + "No current package with dojo metadata found, dev is not yet support for \ + workspaces." + )); + }; let env_metadata = if config.manifest_path().exists() { - dojo_metadata_from_workspace(&ws).env().cloned() + dojo_metadata.env().cloned() } else { trace!("Manifest path does not exist."); None @@ -70,7 +74,7 @@ impl DevArgs { RecursiveMode::Recursive, )?; - let name = self.name.unwrap_or_else(|| ws.root_package().unwrap().id.name.to_string()); + let name = self.name.unwrap_or_else(|| ws.current_package().unwrap().id.name.to_string()); let mut previous_manifest: Option = Option::None; let result = build(&mut context); @@ -98,6 +102,7 @@ impl DevArgs { &name, &context.ws, previous_manifest.clone(), + dojo_metadata.skip_migration.clone(), )) { Ok((manifest, address)) => { previous_manifest = Some(manifest); @@ -132,6 +137,7 @@ impl DevArgs { &name, &context.ws, previous_manifest.clone(), + dojo_metadata.skip_migration.clone(), )) { Ok((manifest, address)) => { previous_manifest = Some(manifest); @@ -223,16 +229,19 @@ fn build(context: &mut DevContext<'_>) -> Result<()> { Ok(()) } -async fn migrate( +// TODO: fix me +async fn migrate( mut world_address: Option, - account: &SingleOwnerAccount, + account: A, name: &str, ws: &Workspace<'_>, previous_manifest: Option, + skip_migration: Option>, ) -> Result<(DeploymentManifest, Option)> where - P: Provider + Sync + Send + 'static, - S: Signer + Sync + Send + 'static, + A: ConnectedAccount + Sync + Send, + A::Provider: Send, + A::SignError: 'static, { let target_dir = ws.target_dir().path_existent().unwrap(); let target_dir = target_dir.join(ws.config().profile().as_str()); @@ -244,9 +253,13 @@ where return Err(anyhow!("Build project using `sozo build` first")); } - let new_manifest = + let mut new_manifest = BaseManifest::load_from_path(&manifest_dir.join(MANIFESTS_DIR).join(BASE_DIR))?; + if let Some(skip_manifests) = skip_migration { + new_manifest.remove_items(skip_manifests); + } + let diff = WorldDiff::compute(new_manifest.clone(), previous_manifest); let total_diffs = diff.count_diffs(); let config = ws.config(); diff --git a/bin/sozo/src/commands/migrate.rs b/bin/sozo/src/commands/migrate.rs index 9cbd421951..239a78f58d 100644 --- a/bin/sozo/src/commands/migrate.rs +++ b/bin/sozo/src/commands/migrate.rs @@ -1,6 +1,6 @@ use anyhow::{anyhow, Context, Result}; use clap::{Args, Subcommand}; -use dojo_lang::compiler::MANIFESTS_DIR; +use dojo_world::manifest::MANIFESTS_DIR; use dojo_world::metadata::{dojo_metadata_from_workspace, Environment}; use dojo_world::migration::TxnConfig; use katana_rpc_api::starknet::RPC_SPEC_VERSION; @@ -50,6 +50,8 @@ pub enum MigrateCommand { #[command(flatten)] transaction: TransactionOptions, }, + #[command(about = "Generate overlays file.")] + GenerateOverlays, } impl MigrateArgs { @@ -57,8 +59,24 @@ impl MigrateArgs { trace!(args = ?self); let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; + let dojo_metadata = if let Some(metadata) = dojo_metadata_from_workspace(&ws) { + metadata + } else { + return Err(anyhow!( + "No current package with dojo metadata found, migrate is not yet support for \ + workspaces." + )); + }; + + // This variant is tested before the match on `self.command` to avoid + // having the need to spin up a Katana to generate the files. + if let MigrateCommand::GenerateOverlays = self.command { + trace!("Generating overlays."); + return migration::generate_overlays(&ws); + } + let env_metadata = if config.manifest_path().exists() { - dojo_metadata_from_workspace(&ws).env().cloned() + dojo_metadata.env().cloned() } else { trace!("Manifest path does not exist."); None @@ -72,7 +90,7 @@ impl MigrateArgs { let MigrateArgs { name, world, starknet, account, .. } = self; let name = name.unwrap_or_else(|| { - ws.root_package().expect("Root package to be present").id.name.to_string() + ws.current_package().expect("Root package to be present").id.name.to_string() }); let (world_address, account, rpc_url) = config.tokio_handle().block_on(async { @@ -81,6 +99,7 @@ impl MigrateArgs { match self.command { MigrateCommand::Plan => config.tokio_handle().block_on(async { + trace!(name, "Planning migration."); migration::migrate( &ws, world_address, @@ -89,6 +108,7 @@ impl MigrateArgs { &name, true, TxnConfig::default(), + dojo_metadata.skip_migration, ) .await }), @@ -96,9 +116,19 @@ impl MigrateArgs { trace!(name, "Applying migration."); let txn_config: TxnConfig = transaction.into(); - migration::migrate(&ws, world_address, rpc_url, account, &name, false, txn_config) - .await + migration::migrate( + &ws, + world_address, + rpc_url, + account, + &name, + false, + txn_config, + dojo_metadata.skip_migration, + ) + .await }), + _ => unreachable!("other case handled above."), } } } @@ -190,8 +220,8 @@ fn is_compatible_version(provided_version: &str, expected_version: &str) -> Resu .map_err(|e| anyhow!("Failed to parse expected version '{}': {}", expected_version, e))?; // Specific backward compatibility rule: 0.6 is compatible with 0.7. - if (provided_ver.major == 0 && provided_ver.minor == 6) - && (expected_ver.major == 0 && expected_ver.minor == 7) + if (provided_ver.major == 0 && provided_ver.minor == 7) + && (expected_ver.major == 0 && expected_ver.minor == 6) { return Ok(true); } @@ -224,7 +254,9 @@ mod tests { #[test] fn test_is_compatible_version_specific_backward_compatibility() { - assert!(is_compatible_version("0.6.0", "0.7.1").unwrap()); + let node_version = "0.7.1"; + let katana_version = "0.6.0"; + assert!(is_compatible_version(node_version, katana_version).unwrap()); } #[test] diff --git a/bin/sozo/src/commands/model.rs b/bin/sozo/src/commands/model.rs index d927b24578..c14297034a 100644 --- a/bin/sozo/src/commands/model.rs +++ b/bin/sozo/src/commands/model.rs @@ -41,6 +41,37 @@ pub enum ModelCommand { starknet: StarknetOptions, }, + #[command(about = "Displays the model's layout into dojo storage.\n +The Dojo storage system uses the poseidon_hash function to compute +hashes, called 'hash' in the following documentation. + + How storage locations are computed ? + + model key = hash(model_keys) + + fixed layout key = parent_key + struct layout field key = hash(parent_key, field_selector) + tuple layout item key = hash(parent_key, item_index) + enum layout + variant key = parent_key + data key = hash(parent_key, variant_index) + array layout + length key = parent_key + item key = hash(parent_key, item_index) + byte array layout = parent_key + + final storage location = hash('dojo_storage', model_selector, record_key)")] + Layout { + #[arg(help = "The name of the model")] + name: String, + + #[command(flatten)] + world: WorldOptions, + + #[command(flatten)] + starknet: StarknetOptions, + }, + #[command(about = "Retrieve the schema for a model")] Schema { #[arg(help = "The name of the model")] @@ -92,6 +123,11 @@ impl ModelArgs { let provider = starknet.provider(env_metadata.as_ref()).unwrap(); model::model_contract_address(name, world_address, provider).await } + ModelCommand::Layout { name, starknet, world } => { + let world_address = world.address(env_metadata.as_ref()).unwrap(); + let provider = starknet.provider(env_metadata.as_ref()).unwrap(); + model::model_layout(name, world_address, provider).await + } ModelCommand::Schema { name, to_json, starknet, world } => { let world_address = world.address(env_metadata.as_ref()).unwrap(); let provider = starknet.provider(env_metadata.as_ref()).unwrap(); diff --git a/bin/sozo/src/commands/print_env.rs b/bin/sozo/src/commands/print_env.rs index 23c273fe57..f8be7e1df4 100644 --- a/bin/sozo/src/commands/print_env.rs +++ b/bin/sozo/src/commands/print_env.rs @@ -1,4 +1,4 @@ -use anyhow::Result; +use anyhow::{anyhow, Result}; use clap::Args; use dojo_world::metadata::dojo_metadata_from_workspace; use scarb::core::Config; @@ -26,8 +26,17 @@ impl PrintEnvArgs { let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; let ui = ws.config().ui(); + let dojo_metadata = if let Some(metadata) = dojo_metadata_from_workspace(&ws) { + metadata + } else { + return Err(anyhow!( + "No current package with dojo metadata found, print-env is not yet support for \ + workspaces." + )); + }; + let env_metadata = if config.manifest_path().exists() { - dojo_metadata_from_workspace(&ws).env().cloned() + dojo_metadata.env().cloned() } else { trace!("Manifest path does not exist."); None diff --git a/bin/sozo/src/commands/test.rs b/bin/sozo/src/commands/test.rs index d89b1461ad..19f8279f18 100644 --- a/bin/sozo/src/commands/test.rs +++ b/bin/sozo/src/commands/test.rs @@ -85,7 +85,7 @@ impl TestArgs { continue; }; - let props: Props = unit.target().props()?; + let props: Props = unit.main_component().target_props()?; let db = build_root_database(&unit)?; if DiagnosticsReporter::stderr().allow_warnings().check(&db) { @@ -145,11 +145,13 @@ fn build_project_config(unit: &CairoCompilationUnit) -> Result { .components .iter() .filter(|model| !model.package.id.is_core()) - .map(|model| (model.cairo_package_name(), model.target.source_root().into())) + // NOTE: We're taking the first target of each compilation unit, which should always be the + // main package source root due to the order maintained by scarb. + .map(|model| (model.cairo_package_name(), model.targets[0].source_root().into())) .collect(); let corelib = - unit.core_package_component().map(|c| Directory::Real(c.target.source_root().into())); + unit.core_package_component().map(|c| Directory::Real(c.targets[0].source_root().into())); let crates_config = crates_config_for_compilation_unit(unit); diff --git a/bin/sozo/src/utils.rs b/bin/sozo/src/utils.rs index d277c8d910..e65c0a2838 100644 --- a/bin/sozo/src/utils.rs +++ b/bin/sozo/src/utils.rs @@ -1,6 +1,6 @@ use std::str::FromStr; -use anyhow::{Error, Result}; +use anyhow::{anyhow, Error, Result}; use camino::Utf8PathBuf; use dojo_world::contracts::world::WorldContract; use dojo_world::contracts::WorldContractReader; @@ -28,8 +28,15 @@ use crate::commands::options::world::WorldOptions; pub fn load_metadata_from_config(config: &Config) -> Result, Error> { let env_metadata = if config.manifest_path().exists() { let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; - - dojo_metadata_from_workspace(&ws).env().cloned() + let dojo_metadata = if let Some(metadata) = dojo_metadata_from_workspace(&ws) { + metadata + } else { + return Err(anyhow!( + "No current package with dojo metadata found, workspaces are not suppored yet." + )); + }; + + dojo_metadata.env().cloned() } else { None }; diff --git a/bin/sozo/tests/register_test.rs b/bin/sozo/tests/register_test.rs index 607b4634bd..8cc161abee 100644 --- a/bin/sozo/tests/register_test.rs +++ b/bin/sozo/tests/register_test.rs @@ -1,11 +1,11 @@ mod utils; -use dojo_test_utils::compiler::build_test_config; +use camino::Utf8PathBuf; +use dojo_test_utils::compiler; use dojo_test_utils::migration::prepare_migration; -use dojo_test_utils::sequencer::{ - get_default_test_starknet_config, SequencerConfig, TestSequencer, -}; +use dojo_world::metadata::dojo_metadata_from_workspace; use dojo_world::migration::TxnConfig; +use katana_runner::KatanaRunner; use scarb::ops; use sozo_ops::migration::execute_strategy; use starknet::accounts::Account; @@ -14,24 +14,32 @@ use utils::snapbox::get_snapbox; #[tokio::test(flavor = "multi_thread")] async fn reregister_models() { - let config = build_test_config("../../examples/spawn-and-move/Scarb.toml").unwrap(); + let source_project_dir = Utf8PathBuf::from("../../examples/spawn-and-move/"); + let dojo_core_path = Utf8PathBuf::from("../../crates/dojo-core"); + + let config = compiler::copy_tmp_config(&source_project_dir, &dojo_core_path); + let ws = ops::read_workspace(config.manifest_path(), &config) .unwrap_or_else(|op| panic!("Error building workspace: {op:?}")); + let dojo_metadata = + dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); + + let target_path = + ws.target_dir().path_existent().unwrap().join(ws.config().profile().to_string()); - let base_dir = "../../examples/spawn-and-move"; - let target_dir = format!("{}/target/dev", base_dir); - let migration = prepare_migration(base_dir.into(), target_dir.into()).unwrap(); + let migration = + prepare_migration(source_project_dir.clone(), target_path, dojo_metadata.skip_migration) + .unwrap(); - let sequencer = - TestSequencer::start(SequencerConfig::default(), get_default_test_starknet_config()).await; + let sequencer = KatanaRunner::new().expect("Failed to start runner."); - let mut account = sequencer.account(); + let mut account = sequencer.account(0); account.set_block_id(BlockId::Tag(BlockTag::Pending)); - execute_strategy(&ws, &migration, &account, TxnConfig::default()).await.unwrap(); + execute_strategy(&ws, &migration, &account, TxnConfig::init_wait()).await.unwrap(); let world_address = &format!("0x{:x}", &migration.world_address().unwrap()); let account_address = &format!("0x{:x}", account.address()); - let private_key = &format!("0x{:x}", sequencer.raw_account().private_key); + let private_key = &format!("0x{:x}", sequencer.account_data(0).1.private_key); let rpc_url = &sequencer.url().to_string(); let moves_model = @@ -49,6 +57,8 @@ async fn reregister_models() { rpc_url, "--private-key", private_key, + "--manifest-path", + config.manifest_path().as_ref(), ]; let assert = get_snapbox().args(args_vec.iter()).assert().success(); diff --git a/bin/torii/README.md b/bin/torii/README.md index 635eb16da0..21ff59ea1a 100644 --- a/bin/torii/README.md +++ b/bin/torii/README.md @@ -4,4 +4,4 @@ curl -L https://install.dojoengine.org | bash ``` -[Documentation](https://book.dojoengine.org/toolchain/torii/overview) +[Documentation](https://book.dojoengine.org/toolchain/torii) diff --git a/crates/benches/src/deployer.rs b/crates/benches/src/deployer.rs index abb0251c07..2a3aa0e08c 100644 --- a/crates/benches/src/deployer.rs +++ b/crates/benches/src/deployer.rs @@ -3,9 +3,9 @@ use std::path::PathBuf; use anyhow::{anyhow, bail, Context, Ok, Result}; use clap::Parser; -use dojo_lang::compiler::{DojoCompiler, DEPLOYMENTS_DIR, MANIFESTS_DIR}; +use dojo_lang::compiler::DojoCompiler; use dojo_lang::plugin::CairoPluginRepository; -use dojo_world::manifest::DeploymentManifest; +use dojo_world::manifest::{DeploymentManifest, DEPLOYMENTS_DIR, MANIFESTS_DIR}; use futures::executor::block_on; use katana_runner::KatanaRunner; use scarb::compiler::CompilerRepository; diff --git a/crates/dojo-bindgen/Cargo.toml b/crates/dojo-bindgen/Cargo.toml index 1d9f376db1..8a97d8c2c2 100644 --- a/crates/dojo-bindgen/Cargo.toml +++ b/crates/dojo-bindgen/Cargo.toml @@ -22,3 +22,7 @@ thiserror.workspace = true cainome.workspace = true dojo-world = { path = "../dojo-world", features = [ "manifest" ] } + +[dev-dependencies] +dojo-test-utils = { path = "../dojo-test-utils", features = [ "build-examples" ] } +scarb = { workspace = true } diff --git a/crates/dojo-bindgen/src/lib.rs b/crates/dojo-bindgen/src/lib.rs index ed2605f18a..c8cbe96172 100644 --- a/crates/dojo-bindgen/src/lib.rs +++ b/crates/dojo-bindgen/src/lib.rs @@ -73,13 +73,17 @@ pub struct PluginManager { impl PluginManager { /// Generates the bindings for all the given Plugin. - pub async fn generate(&self) -> BindgenResult<()> { + pub async fn generate(&self, skip_migration: Option>) -> BindgenResult<()> { if self.builtin_plugins.is_empty() && self.plugins.is_empty() { return Ok(()); } - let data = - gather_dojo_data(&self.manifest_path, &self.root_package_name, &self.profile_name)?; + let data = gather_dojo_data( + &self.manifest_path, + &self.root_package_name, + &self.profile_name, + skip_migration, + )?; for plugin in &self.builtin_plugins { // Get the plugin builder from the plugin enum. @@ -111,10 +115,15 @@ fn gather_dojo_data( manifest_path: &Utf8PathBuf, root_package_name: &str, profile_name: &str, + skip_migration: Option>, ) -> BindgenResult { let root_dir: Utf8PathBuf = manifest_path.parent().unwrap().into(); let base_manifest_dir: Utf8PathBuf = root_dir.join("manifests").join(profile_name).join("base"); - let base_manifest = BaseManifest::load_from_path(&base_manifest_dir)?; + let mut base_manifest = BaseManifest::load_from_path(&base_manifest_dir)?; + + if let Some(skip_manifests) = skip_migration { + base_manifest.remove_items(skip_manifests); + } let mut models = HashMap::new(); let mut contracts = HashMap::new(); @@ -244,6 +253,9 @@ fn model_name_from_fully_qualified_path(file_name: &str) -> Option { #[cfg(test)] mod tests { + use dojo_test_utils::compiler; + use dojo_world::metadata::dojo_metadata_from_workspace; + use super::*; #[test] @@ -254,14 +266,24 @@ mod tests { #[test] fn gather_data_ok() { - let data = gather_dojo_data( - &Utf8PathBuf::from("src/test_data/spawn-and-move/Scarb.toml"), - "dojo_example", - "dev", - ) - .unwrap(); + let manifest_path = Utf8PathBuf::from("src/test_data/spawn-and-move/Scarb.toml"); + + let config = compiler::copy_tmp_config( + &Utf8PathBuf::from("../../examples/spawn-and-move"), + &Utf8PathBuf::from("../dojo-core"), + ); + + let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); + let dojo_metadata = dojo_metadata_from_workspace(&ws).expect( + "No current package with dojo metadata found, bindgen is not yet supported for \ + workspaces.", + ); + + let data = + gather_dojo_data(&manifest_path, "dojo_example", "dev", dojo_metadata.skip_migration) + .unwrap(); - assert_eq!(data.models.len(), 5); + assert_eq!(data.models.len(), 7); assert_eq!(data.world.name, "dojo_example"); @@ -273,9 +295,9 @@ mod tests { assert_eq!(moves.name, "Moves"); assert_eq!(moves.qualified_path, "dojo_examples::models::Moves"); - let moved = data.models.get("EmoteMessage").unwrap(); - assert_eq!(moved.name, "EmoteMessage"); - assert_eq!(moved.qualified_path, "dojo_examples::models::EmoteMessage"); + let moved = data.models.get("Message").unwrap(); + assert_eq!(moved.name, "Message"); + assert_eq!(moved.qualified_path, "dojo_examples::models::Message"); let player_config = data.models.get("PlayerConfig").unwrap(); assert_eq!(player_config.name, "PlayerConfig"); diff --git a/crates/dojo-bindgen/src/plugins/typescript/mod.rs b/crates/dojo-bindgen/src/plugins/typescript/mod.rs index de2f11bc91..9b00739fe8 100644 --- a/crates/dojo-bindgen/src/plugins/typescript/mod.rs +++ b/crates/dojo-bindgen/src/plugins/typescript/mod.rs @@ -16,8 +16,8 @@ impl TypescriptPlugin { } // Maps cairo types to C#/Unity SDK defined types - fn map_type(type_name: &str) -> String { - match type_name { + fn map_type(token: &Token, generic_args: &Vec<(String, Token)>) -> String { + match token.type_name().as_str() { "bool" => "RecsType.Boolean".to_string(), "u8" => "RecsType.Number".to_string(), "u16" => "RecsType.Number".to_string(), @@ -30,8 +30,44 @@ impl TypescriptPlugin { "bytes31" => "RecsType.String".to_string(), "ClassHash" => "RecsType.BigInt".to_string(), "ContractAddress" => "RecsType.BigInt".to_string(), + "ByteArray" => "RecsType.String".to_string(), + "array" => { + if let Token::Array(array) = token { + format!("{}[]", TypescriptPlugin::map_type(&array.inner, generic_args)) + } else { + panic!("Invalid array token: {:?}", token); + } + } + "tuple" => { + if let Token::Tuple(tuple) = token { + let inners = tuple + .inners + .iter() + .map(|inner| TypescriptPlugin::map_type(inner, generic_args)) + .collect::>() + .join(", "); - _ => type_name.to_string(), + format!("[{}]", inners) + } else { + panic!("Invalid tuple token: {:?}", token); + } + } + "generic_arg" => { + if let Token::GenericArg(arg) = &token { + let arg_type = generic_args + .iter() + .find(|(name, _)| name == arg) + .unwrap_or_else(|| panic!("Generic arg not found: {}", arg)) + .1 + .clone(); + + TypescriptPlugin::map_type(&arg_type, generic_args) + } else { + panic!("Invalid generic arg token: {:?}", token); + } + } + + _ => token.type_name().to_string(), } } @@ -50,7 +86,7 @@ impl TypescriptPlugin { let mut fields = String::new(); for field in &token.inners { - let mapped = TypescriptPlugin::map_type(field.token.type_name().as_str()); + let mapped = TypescriptPlugin::map_type(&field.token, &token.generic_args); if mapped == field.token.type_name() { let token = handled_tokens .iter() @@ -93,24 +129,35 @@ export const {name}Definition = {{ // This will be formatted into a C# enum // Enum is mapped using index of cairo enum fn format_enum(token: &Composite) -> String { - let fields = token - .inners - .iter() - .map(|field| format!("{},", field.name,)) - .collect::>() - .join("\n "); + let name = token.type_name(); - format!( + let mut result = format!( " // Type definition for `{}` enum -export enum {} {{ - {} -}} -", - token.type_path, - token.type_name(), - fields - ) +type {} = ", + token.type_path, name + ); + + let mut variants = Vec::new(); + + for field in &token.inners { + let field_type = + TypescriptPlugin::map_type(&field.token, &token.generic_args).replace("()", ""); + + let variant_definition = if field_type.is_empty() { + // No associated data + format!("{{ type: '{}'; }}", field.name) + } else { + // With associated data + format!("{{ type: '{}'; data: {}; }}", field.name, field_type) + }; + + variants.push(variant_definition); + } + + result += &variants.join(" | "); + + result } // Token should be a model @@ -123,7 +170,7 @@ export enum {} {{ .inners .iter() .map(|field| { - let mapped = TypescriptPlugin::map_type(field.token.type_name().as_str()); + let mapped = TypescriptPlugin::map_type(&field.token, &model.generic_args); if mapped == field.token.type_name() { custom_types.push(format!("\"{}\"", field.token.type_name())); @@ -258,7 +305,7 @@ export function defineContractComponents(world: World) { fn format_system(system: &Function, handled_tokens: &[Composite]) -> String { fn map_type(token: &Token) -> String { match token { - Token::CoreBasic(t) => TypescriptPlugin::map_type(&t.type_name()) + Token::CoreBasic(_) => TypescriptPlugin::map_type(token, &vec![]) .replace("RecsType.", "") // types should be lowercased .to_lowercase(), diff --git a/crates/dojo-bindgen/src/plugins/typescript_v2/mod.rs b/crates/dojo-bindgen/src/plugins/typescript_v2/mod.rs index d894a340ad..d7846ceef0 100644 --- a/crates/dojo-bindgen/src/plugins/typescript_v2/mod.rs +++ b/crates/dojo-bindgen/src/plugins/typescript_v2/mod.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use std::path::{Path, PathBuf}; use async_trait::async_trait; -use cainome::parser::tokens::{Composite, CompositeType, Function}; +use cainome::parser::tokens::{Composite, CompositeType, Function, Token}; use convert_case::Casing; use crate::error::BindgenResult; @@ -17,8 +17,8 @@ impl TypeScriptV2Plugin { } // Maps cairo types to TypeScript defined types - fn map_type(type_name: &str) -> String { - match type_name { + fn map_type(token: &Token) -> String { + match token.type_name().as_str() { "bool" => "boolean".to_string(), "u8" => "number".to_string(), "u16" => "number".to_string(), @@ -28,10 +28,57 @@ impl TypeScriptV2Plugin { "u256" => "bigint".to_string(), "usize" => "number".to_string(), "felt252" => "string".to_string(), + "bytes31" => "string".to_string(), "ClassHash" => "string".to_string(), "ContractAddress" => "string".to_string(), + "ByteArray" => "string".to_string(), + "array" => { + if let Token::Array(array) = token { + format!("{}[]", TypeScriptV2Plugin::map_type(&array.inner)) + } else { + panic!("Invalid array token: {:?}", token); + } + } + "tuple" => { + if let Token::Tuple(tuple) = token { + let inners = tuple + .inners + .iter() + .map(TypeScriptV2Plugin::map_type) + .collect::>() + .join(", "); + format!("[{}]", inners) + } else { + panic!("Invalid tuple token: {:?}", token); + } + } + "generic_arg" => { + if let Token::GenericArg(generic_arg) = &token { + generic_arg.clone() + } else { + panic!("Invalid generic_arg token: {:?}", token); + } + } + + _ => { + let mut type_name = token.type_name(); + + if let Token::Composite(composite) = token { + if !composite.generic_args.is_empty() { + type_name += &format!( + "<{}>", + composite + .generic_args + .iter() + .map(|(_, t)| TypeScriptV2Plugin::map_type(t)) + .collect::>() + .join(", ") + ) + } + } - _ => type_name.to_string(), + type_name + } } } @@ -116,36 +163,21 @@ function convertQueryToToriiClause(query: Query): Clause | undefined {{ for model in models { let tokens = &model.tokens; - for token in &tokens.enums { - handled_tokens.push(token.to_composite().unwrap().to_owned()); - } for token in &tokens.structs { - handled_tokens.push(token.to_composite().unwrap().to_owned()); - } - - let mut structs = tokens.structs.to_owned(); - structs.sort_by(|a, b| { - if a.to_composite() - .unwrap() - .inners - .iter() - .any(|field| field.token.type_name() == b.type_name()) - { - std::cmp::Ordering::Greater - } else { - std::cmp::Ordering::Less + if handled_tokens.iter().any(|t| t.type_name() == token.type_name()) { + continue; } - }); - for token in &structs { - out += TypeScriptV2Plugin::format_struct( - token.to_composite().unwrap(), - handled_tokens, - ) - .as_str(); + handled_tokens.push(token.to_composite().unwrap().to_owned()); + out += TypeScriptV2Plugin::format_struct(token.to_composite().unwrap()).as_str(); } for token in &tokens.enums { + if handled_tokens.iter().any(|t| t.type_name() == token.type_name()) { + continue; + } + + handled_tokens.push(token.to_composite().unwrap().to_owned()); out += TypeScriptV2Plugin::format_enum(token.to_composite().unwrap()).as_str(); } @@ -205,7 +237,7 @@ function convertQueryToToriiClause(query: Query): Clause | undefined {{ constructor(contractAddress: string, account?: Account) {{ super(contractAddress, account); }} - + {} }} ", @@ -417,24 +449,13 @@ function convertQueryToToriiClause(query: Query): Clause | undefined {{ // Token should be a struct // This will be formatted into a TypeScript interface // using TypeScript defined types - fn format_struct(token: &Composite, handled_tokens: &[Composite]) -> String { + fn format_struct(token: &Composite) -> String { let mut native_fields: Vec = Vec::new(); for field in &token.inners { - let mapped = TypeScriptV2Plugin::map_type(field.token.type_name().as_str()); - if mapped == field.token.type_name() { - let token = handled_tokens - .iter() - .find(|t| t.type_name() == field.token.type_name()) - .unwrap_or_else(|| panic!("Token not found: {}", field.token.type_name())); - if token.r#type == CompositeType::Enum { - native_fields.push(format!("{}: {};", field.name, mapped)); - } else { - native_fields.push(format!("{}: {};", field.name, field.token.type_name())); - } - } else { - native_fields.push(format!("{}: {};", field.name, mapped)); - } + let mapped = TypeScriptV2Plugin::map_type(&field.token); + format!("{}: {};", field.name, mapped); + native_fields.push(format!("{}: {};", field.name, mapped)); } format!( @@ -454,24 +475,40 @@ export interface {name} {{ // This will be formatted into a C# enum // Enum is mapped using index of cairo enum fn format_enum(token: &Composite) -> String { - let fields = token - .inners - .iter() - .map(|field| format!("{},", field.name,)) - .collect::>() - .join("\n "); + let mut name = token.type_name(); + if !token.generic_args.is_empty() { + name += &format!( + "<{}>", + token.generic_args.iter().map(|(n, _)| n.clone()).collect::>().join(", ") + ) + } - format!( + let mut result = format!( " // Type definition for `{}` enum -export enum {} {{ - {} -}} -", - token.type_path, - token.type_name(), - fields - ) +type {} = ", + token.type_path, name + ); + + let mut variants = Vec::new(); + + for field in &token.inners { + let field_type = TypeScriptV2Plugin::map_type(&field.token).replace("()", ""); + + let variant_definition = if field_type.is_empty() { + // No associated data + format!("{{ type: '{}'; }}", field.name) + } else { + // With associated data + format!("{{ type: '{}'; data: {}; }}", field.name, field_type) + }; + + variants.push(variant_definition); + } + + result += &variants.join(" | "); + + result } // Formats a system into a JS method used by the contract class @@ -485,10 +522,10 @@ export enum {} {{ format!( "{}: {}", arg.0, - if TypeScriptV2Plugin::map_type(&arg.1.type_name()) == arg.1.type_name() { + if TypeScriptV2Plugin::map_type(&arg.1) == arg.1.type_name() { arg.1.type_name() } else { - TypeScriptV2Plugin::map_type(&arg.1.type_name()) + TypeScriptV2Plugin::map_type(&arg.1) } ) }) @@ -593,6 +630,8 @@ mod tests { use std::io::Read; use camino::Utf8PathBuf; + use dojo_test_utils::compiler; + use dojo_world::metadata::dojo_metadata_from_workspace; use super::*; use crate::gather_dojo_data; @@ -609,12 +648,20 @@ mod tests { let expected_output_without_header = expected_output.lines().skip(1).collect::>().join("\n"); - let data = gather_dojo_data( - &Utf8PathBuf::from("src/test_data/spawn-and-move/Scarb.toml"), - "dojo_examples", - "dev", - ) - .unwrap(); + let manifest_path = Utf8PathBuf::from("src/test_data/spawn-and-move/Scarb.toml"); + let config = compiler::copy_tmp_config( + &Utf8PathBuf::from("../../examples/spawn-and-move"), + &Utf8PathBuf::from("../dojo-core"), + ); + + let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); + let dojo_metadata = dojo_metadata_from_workspace(&ws).expect( + "No current package with dojo metadata found, bindgen is not yet support for \ + workspaces.", + ); + let data = + gather_dojo_data(&manifest_path, "dojo_examples", "dev", dojo_metadata.skip_migration) + .unwrap(); let actual_output = TypeScriptV2Plugin::generate_code_content(&data); let actual_output_without_header = diff --git a/crates/dojo-bindgen/src/plugins/unity/mod.rs b/crates/dojo-bindgen/src/plugins/unity/mod.rs index addee69930..8fe748a940 100644 --- a/crates/dojo-bindgen/src/plugins/unity/mod.rs +++ b/crates/dojo-bindgen/src/plugins/unity/mod.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use std::path::{Path, PathBuf}; use async_trait::async_trait; -use cainome::parser::tokens::{Composite, CompositeType, Function, Token}; +use cainome::parser::tokens::{Composite, CompositeType, Function, FunctionOutputKind, Token}; use crate::error::BindgenResult; use crate::plugins::BuiltinPlugin; @@ -16,8 +16,8 @@ impl UnityPlugin { } // Maps cairo types to C#/Unity SDK defined types - fn map_type(type_name: &str) -> String { - match type_name { + fn map_type(token: &Token) -> String { + match token.type_name().as_str() { "u8" => "byte".to_string(), "u16" => "ushort".to_string(), "u32" => "uint".to_string(), @@ -29,8 +29,54 @@ impl UnityPlugin { "bytes31" => "string".to_string(), "ClassHash" => "FieldElement".to_string(), "ContractAddress" => "FieldElement".to_string(), + "ByteArray" => "string".to_string(), + "array" => { + if let Token::Array(array) = token { + format!("{}[]", UnityPlugin::map_type(&array.inner)) + } else { + panic!("Invalid array token: {:?}", token); + } + } + "tuple" => { + if let Token::Tuple(tuple) = token { + let inners = tuple + .inners + .iter() + .map(UnityPlugin::map_type) + .collect::>() + .join(", "); + format!("({})", inners) + } else { + panic!("Invalid tuple token: {:?}", token); + } + } + "generic_arg" => { + if let Token::GenericArg(g) = &token { + g.clone() + } else { + panic!("Invalid generic arg token: {:?}", token); + } + } + + _ => { + let mut type_name = token.type_name().to_string(); - _ => type_name.to_string(), + if let Token::Composite(composite) = token { + if !composite.generic_args.is_empty() { + type_name += &format!( + "<{}>", + composite + .generic_args + .iter() + .map(|(_, t)| UnityPlugin::map_type(t)) + .collect::>() + .join(", ") + ) + } + } + + type_name + } } } @@ -41,6 +87,32 @@ impl UnityPlugin { ) } + fn contract_imports() -> String { + "using System; +using System.Threading.Tasks; +using Dojo; +using Dojo.Starknet; +using UnityEngine; +using dojo_bindings; +using System.Collections.Generic; +using System.Linq; +using Enum = Dojo.Starknet.Enum; +" + .to_string() + } + + fn model_imports() -> String { + "using System; +using Dojo; +using Dojo.Starknet; +using System.Reflection; +using System.Linq; +using System.Collections.Generic; +using Enum = Dojo.Starknet.Enum; +" + .to_string() + } + // Token should be a struct // This will be formatted into a C# struct // using C# and unity SDK types @@ -48,13 +120,7 @@ impl UnityPlugin { let fields = token .inners .iter() - .map(|field| { - format!( - "public {} {};", - UnityPlugin::map_type(field.token.clone().type_name().as_str()), - field.name - ) - }) + .map(|field| format!("public {} {};", UnityPlugin::map_type(&field.token), field.name)) .collect::>() .join("\n "); @@ -76,24 +142,36 @@ public struct {} {{ // This will be formatted into a C# enum // Enum is mapped using index of cairo enum fn format_enum(token: &Composite) -> String { - let fields = token - .inners - .iter() - .map(|field| format!("{},", field.name,)) - .collect::>() - .join("\n "); + let name = token.type_name(); + let mut name_with_generics = name.clone(); + if !token.generic_args.is_empty() { + name_with_generics += &format!( + "<{}>", + token.generic_args.iter().map(|(n, _)| n.clone()).collect::>().join(", ") + ); + } - format!( + let mut result = format!( " // Type definition for `{}` enum -public enum {} {{ - {} -}} -", - token.type_path, - token.type_name(), - fields - ) +public abstract record {}() : Enum {{", + token.type_path, name_with_generics + ); + + for field in &token.inners { + let type_name = UnityPlugin::map_type(&field.token).replace(['(', ')'], ""); + + result += format!( + "\n public record {}({}) : {name_with_generics};", + field.name, + if type_name.is_empty() { type_name } else { format!("{} value", type_name) } + ) + .as_str(); + } + + result += "\n}\n"; + + result } // Token should be a model @@ -107,7 +185,7 @@ public enum {} {{ format!( "[ModelField(\"{}\")]\n public {} {};", field.name, - UnityPlugin::map_type(field.token.type_name().as_str()), + UnityPlugin::map_type(&field.token), field.name, ) }) @@ -138,21 +216,23 @@ public class {} : ModelInstance {{ // Handles a model definition and its referenced tokens // Will map all structs and enums to C# types // Will format the model into a C# class - fn handle_model(&self, model: &DojoModel, handled_tokens: &mut Vec) -> String { + fn handle_model( + &self, + model: &DojoModel, + handled_tokens: &mut HashMap, + ) -> String { let mut out = String::new(); out += UnityPlugin::generated_header().as_str(); - out += "using System;\n"; - out += "using Dojo;\n"; - out += "using Dojo.Starknet;\n"; + out += UnityPlugin::model_imports().as_str(); let mut model_struct: Option<&Composite> = None; let tokens = &model.tokens; for token in &tokens.structs { - if handled_tokens.iter().any(|t| t.type_name() == token.type_name()) { + if handled_tokens.contains_key(&token.type_path()) { continue; } - handled_tokens.push(token.to_composite().unwrap().to_owned()); + handled_tokens.insert(token.type_path(), token.to_composite().unwrap().to_owned()); // first index is our model struct if token.type_name() == model.name { @@ -164,11 +244,11 @@ public class {} : ModelInstance {{ } for token in &tokens.enums { - if handled_tokens.iter().any(|t| t.type_name() == token.type_name()) { + if handled_tokens.contains_key(&token.type_path()) { continue; } - handled_tokens.push(token.to_composite().unwrap().to_owned()); + handled_tokens.insert(token.type_path(), token.to_composite().unwrap().to_owned()); out += UnityPlugin::format_enum(token.to_composite().unwrap()).as_str(); } @@ -182,58 +262,188 @@ public class {} : ModelInstance {{ // Formats a system into a C# method used by the contract class // Handled tokens should be a list of all structs and enums used by the contract // Such as a set of referenced tokens from a model - fn format_system(system: &Function, handled_tokens: &[Composite]) -> String { - fn map_type(token: &Token) -> String { + fn format_system(system: &Function, handled_tokens: &HashMap) -> String { + fn handle_arg_recursive( + arg_name: &str, + token: &Token, + handled_tokens: &HashMap, + // variant name + // if its an enum variant data + enum_variant: Option, + ) -> Vec<( + // formatted arg + String, + // if its an array + bool, + // enum name and variant name + // if its an enum variant data + Option, + )> { + let mapped_type = UnityPlugin::map_type(token); + match token { - Token::CoreBasic(t) => UnityPlugin::map_type(&t.type_name()), - Token::Composite(t) => t.type_name().to_string(), - Token::Array(t) => format!("{}[]", map_type(&t.inner)), - _ => panic!("Unsupported token type: {:?}", token), + Token::Composite(t) => { + let t = handled_tokens.get(&t.type_path).unwrap_or(t); + + // Need to flatten the struct members. + match t.r#type { + CompositeType::Struct if t.type_name() == "ByteArray" => vec![( + format!("ByteArray.Serialize({}).Select(f => f.Inner)", arg_name), + true, + enum_variant, + )], + CompositeType::Struct => { + let mut tokens = vec![]; + t.inners.iter().for_each(|f| { + tokens.extend(handle_arg_recursive( + &format!("{}.{}", arg_name, f.name), + &f.token, + handled_tokens, + enum_variant.clone(), + )); + }); + + tokens + } + CompositeType::Enum => { + let mut tokens = vec![( + format!("new FieldElement(Enum.GetIndex({})).Inner", arg_name), + false, + enum_variant, + )]; + + t.inners.iter().for_each(|field| { + if let Token::CoreBasic(basic) = &field.token { + // ignore unit type + if basic.type_path == "()" { + return; + } + } + + tokens.extend(handle_arg_recursive( + &format!( + "(({}.{}){}).value", + mapped_type, + field.name.clone(), + arg_name + ), + &if let Token::GenericArg(generic_arg) = &field.token { + let generic_token = t + .generic_args + .iter() + .find(|(name, _)| name == generic_arg) + .unwrap() + .1 + .clone(); + generic_token + } else { + field.token.clone() + }, + handled_tokens, + Some(field.name.clone()), + )) + }); + + tokens + } + CompositeType::Unknown => panic!("Unknown composite type: {:?}", t), + } + } + Token::Array(array) => { + let is_inner_array = matches!(array.inner.as_ref(), Token::Array(_)); + let inner = handle_arg_recursive( + &format!("{arg_name}Item"), + &array.inner, + handled_tokens, + enum_variant.clone(), + ); + + let inners = inner + .into_iter() + .map(|(arg, _, _)| arg) + .collect::>() + .join(", "); + + vec![ + ( + format!("new FieldElement({arg_name}.Length).Inner",), + false, + enum_variant.clone(), + ), + ( + if is_inner_array { + format!( + "{arg_name}.SelectMany({arg_name}Item => new \ + dojo.FieldElement[] {{ }}.Concat({inners}))" + ) + } else { + format!( + "{arg_name}.SelectMany({arg_name}Item => new [] {{ {inners} \ + }})" + ) + }, + true, + enum_variant.clone(), + ), + ] + } + Token::Tuple(tuple) => tuple + .inners + .iter() + .enumerate() + .flat_map(|(idx, token)| { + handle_arg_recursive( + &format!("{}.Item{}", arg_name, idx + 1), + token, + handled_tokens, + enum_variant.clone(), + ) + }) + .collect(), + _ => match mapped_type.as_str() { + "FieldElement" => vec![(format!("{}.Inner", arg_name), false, enum_variant)], + _ => { + vec![(format!("new FieldElement({}).Inner", arg_name), false, enum_variant)] + } + }, } } let args = system .inputs .iter() - .map(|arg| format!("{} {}", map_type(&arg.1), &arg.0)) + .map(|arg| format!("{} {}", UnityPlugin::map_type(&arg.1), &arg.0)) .collect::>() .join(", "); let calldata = system .inputs .iter() - .map(|arg| { - let token = &arg.1; - let type_name = &arg.0; - - match handled_tokens.iter().find(|t| t.type_name() == token.type_name()) { - Some(t) => { - // Need to flatten the struct members. - match t.r#type { - CompositeType::Struct => t - .inners - .iter() - .map(|field| { - format!( - "new FieldElement({}.{}).Inner()", - type_name, field.name - ) - }) - .collect::>() - .join(",\n "), - _ => { - format!("new FieldElement({}).Inner()", type_name) - } + .flat_map(|(name, token)| { + let tokens = handle_arg_recursive(name, token, handled_tokens, None); + + tokens + .iter() + .map(|(arg, is_array, enum_variant)| { + let calldata_op = if *is_array { + format!("calldata.AddRange({arg});") + } else { + format!("calldata.Add({arg});") + }; + + if let Some(variant) = enum_variant { + let mapped_token = UnityPlugin::map_type(token); + let mapped_variant_type = format!("{}.{}", mapped_token, variant); + + format!("if ({name} is {mapped_variant_type}) {calldata_op}",) + } else { + calldata_op } - } - None => match UnityPlugin::map_type(type_name).as_str() { - "FieldElement" => format!("{}.Inner()", type_name), - _ => format!("new FieldElement({}).Inner()", type_name), - }, - } + }) + .collect::>() }) .collect::>() - .join(",\n "); + .join("\n\t\t"); format!( " @@ -241,13 +451,14 @@ public class {} : ModelInstance {{ // Returns the transaction hash. Use `WaitForTransaction` to wait for the transaction to be \ confirmed. public async Task {system_name}(Account account{arg_sep}{args}) {{ + List calldata = new List(); + {calldata} + return await account.ExecuteRaw(new dojo.Call[] {{ new dojo.Call{{ to = contractAddress, selector = \"{system_name}\", - calldata = new dojo.FieldElement[] {{ - {calldata} - }} + calldata = calldata.ToArray() }} }}); }} @@ -276,19 +487,20 @@ public class {} : ModelInstance {{ // Will format the contract into a C# class and // all systems into C# methods // Handled tokens should be a list of all structs and enums used by the contract - fn handle_contract(&self, contract: &DojoContract, handled_tokens: &[Composite]) -> String { + fn handle_contract( + &self, + contract: &DojoContract, + handled_tokens: &HashMap, + ) -> String { let mut out = String::new(); out += UnityPlugin::generated_header().as_str(); - out += "using System;\n"; - out += "using System.Threading.Tasks;\n"; - out += "using Dojo;\n"; - out += "using Dojo.Starknet;\n"; - out += "using UnityEngine;\n"; - out += "using dojo_bindings;\n"; + out += UnityPlugin::contract_imports().as_str(); let systems = contract .systems .iter() + // we assume systems dont have outputs + .filter(|s| s.to_function().unwrap().get_output_kind() as u8 == FunctionOutputKind::NoOutput as u8) .map(|system| UnityPlugin::format_system(system.to_function().unwrap(), handled_tokens)) .collect::>() .join("\n\n "); @@ -317,7 +529,7 @@ public class {} : MonoBehaviour {{ impl BuiltinPlugin for UnityPlugin { async fn generate_code(&self, data: &DojoData) -> BindgenResult>> { let mut out: HashMap> = HashMap::new(); - let mut handled_tokens = Vec::::new(); + let mut handled_tokens = HashMap::::new(); // Handle codegen for models for (name, model) in &data.models { diff --git a/crates/dojo-bindgen/src/test_data/mocks/dojo_examples.ts b/crates/dojo-bindgen/src/test_data/mocks/dojo_examples.ts index 0e807cd262..1c1c19c7bb 100644 --- a/crates/dojo-bindgen/src/test_data/mocks/dojo_examples.ts +++ b/crates/dojo-bindgen/src/test_data/mocks/dojo_examples.ts @@ -1,4 +1,4 @@ -// Generated by dojo-bindgen on Wed, 17 Apr 2024 07:58:49 +0000. Do not modify this file manually. +// Generated by dojo-bindgen on Tue, 28 May 2024 15:30:47 +0000. Do not modify this file manually. import { Account } from "starknet"; import { Clause, @@ -14,22 +14,6 @@ import { createManifestFromJson, } from "@dojoengine/core"; -// Type definition for `dojo_examples::models::EmoteMessage` struct -export interface EmoteMessage { - identity: string; - emote: Emote; -} - -// Type definition for `dojo_examples::models::Emote` enum -export enum Emote { - None, - Happy, - Sad, - Angry, - Love, -} - - // Type definition for `dojo_examples::models::Vec2` struct export interface Vec2 { x: number; @@ -42,6 +26,15 @@ export interface Position { vec: Vec2; } +// Type definition for `core::byte_array::ByteArray` struct +export interface ByteArray { + data: string[]; + pending_word: string; + pending_word_len: number; +} + +// Type definition for `core::option::Option::` enum +type Option = { type: 'Some'; data: A; } | { type: 'None'; } // Type definition for `dojo_examples::actions::actions::Moved` struct export interface Moved { @@ -50,14 +43,7 @@ export interface Moved { } // Type definition for `dojo_examples::models::Direction` enum -export enum Direction { - None, - Left, - Right, - Up, - Down, -} - +type Direction = { type: 'None'; } | { type: 'Left'; } | { type: 'Right'; } | { type: 'Up'; } | { type: 'Down'; } // Type definition for `dojo_examples::models::Moves` struct export interface Moves { @@ -66,13 +52,28 @@ export interface Moves { last_direction: Direction; } -// Type definition for `dojo_examples::models::Direction` enum -export enum Direction { - None, - Left, - Right, - Up, - Down, + +// Type definition for `dojo_examples::models::EmoteMessage` struct +export interface EmoteMessage { + identity: string; + emote: Emote; +} + +// Type definition for `dojo_examples::models::Emote` enum +type Emote = { type: 'None'; } | { type: 'Happy'; } | { type: 'Sad'; } | { type: 'Angry'; } | { type: 'Love'; } + +// Type definition for `dojo_examples::models::PlayerItem` struct +export interface PlayerItem { + item_id: number; + quantity: number; +} + +// Type definition for `dojo_examples::models::PlayerConfig` struct +export interface PlayerConfig { + player: string; + name: string; + items: PlayerItem[]; + favorite_item: Option; } @@ -129,15 +130,6 @@ class ActionsCalls extends BaseCalls { } } - async dojoResource(): Promise { - try { - await this.execute("dojo_resource", []) - } catch (error) { - console.error("Error executing dojoResource:", error); - throw error; - } - } - async spawn(): Promise { try { await this.execute("spawn", []) @@ -155,20 +147,42 @@ class ActionsCalls extends BaseCalls { throw error; } } + + async setPlayerConfig(name: string): Promise { + try { + await this.execute("set_player_config", [props.name.data, + props.name.pending_word, + props.name.pending_word_len]) + } catch (error) { + console.error("Error executing setPlayerConfig:", error); + throw error; + } + } + + async dojoResource(): Promise { + try { + await this.execute("dojo_resource", []) + } catch (error) { + console.error("Error executing dojoResource:", error); + throw error; + } + } } type Query = Partial<{ - EmoteMessage: ModelClause; Position: ModelClause; Moved: ModelClause; Moves: ModelClause; + EmoteMessage: ModelClause; + PlayerConfig: ModelClause; }>; type ResultMapping = { - EmoteMessage: EmoteMessage; Position: Position; Moved: Moved; Moves: Moves; + EmoteMessage: EmoteMessage; + PlayerConfig: PlayerConfig; }; type QueryResult = { diff --git a/crates/dojo-core/.tool-versions b/crates/dojo-core/.tool-versions deleted file mode 100644 index 21cfc80772..0000000000 --- a/crates/dojo-core/.tool-versions +++ /dev/null @@ -1 +0,0 @@ -scarb 2.4.0 diff --git a/crates/dojo-core/Scarb.lock b/crates/dojo-core/Scarb.lock index 87f054ddd0..f6e3d948fe 100644 --- a/crates/dojo-core/Scarb.lock +++ b/crates/dojo-core/Scarb.lock @@ -3,7 +3,7 @@ version = 1 [[package]] name = "dojo" -version = "0.6.0" +version = "0.7.2" dependencies = [ "dojo_plugin", ] diff --git a/crates/dojo-core/Scarb.toml b/crates/dojo-core/Scarb.toml index 9e23066bca..5946ebcb71 100644 --- a/crates/dojo-core/Scarb.toml +++ b/crates/dojo-core/Scarb.toml @@ -2,7 +2,7 @@ cairo-version = "=2.6.3" description = "The Dojo Core library for autonomous worlds." name = "dojo" -version = "0.6.0" +version = "0.7.2" [dependencies] dojo_plugin = { git = "https://github.com/dojoengine/dojo", tag = "v0.3.11" } diff --git a/crates/dojo-core/src/base_test.cairo b/crates/dojo-core/src/base_test.cairo index 84ef74bf15..a90d40b071 100644 --- a/crates/dojo-core/src/base_test.cairo +++ b/crates/dojo-core/src/base_test.cairo @@ -52,12 +52,20 @@ fn deploy_world() -> IWorldDispatcher { spawn_test_world(array![]) } +// A test contract needs to be used instead of previously used base contract since. +// contracts now require a `dojo_init` method which normal base contract doesn't have +#[dojo::contract] +mod test_contract {} + #[test] #[available_gas(6000000)] fn test_upgrade_from_world() { let world = deploy_world(); - let base_address = world.deploy_contract('salt', base::TEST_CLASS_HASH.try_into().unwrap()); + let base_address = world + .deploy_contract( + 'salt', test_contract::TEST_CLASS_HASH.try_into().unwrap(), array![].span() + ); let new_class_hash: ClassHash = contract_upgrade::TEST_CLASS_HASH.try_into().unwrap(); world.upgrade_contract(base_address, new_class_hash); @@ -74,7 +82,10 @@ fn test_upgrade_from_world() { fn test_upgrade_from_world_not_world_provider() { let world = deploy_world(); - let base_address = world.deploy_contract('salt', base::TEST_CLASS_HASH.try_into().unwrap()); + let base_address = world + .deploy_contract( + 'salt', test_contract::TEST_CLASS_HASH.try_into().unwrap(), array![].span() + ); let new_class_hash: ClassHash = contract_invalid_upgrade::TEST_CLASS_HASH.try_into().unwrap(); world.upgrade_contract(base_address, new_class_hash); @@ -86,7 +97,10 @@ fn test_upgrade_from_world_not_world_provider() { fn test_upgrade_direct() { let world = deploy_world(); - let base_address = world.deploy_contract('salt', base::TEST_CLASS_HASH.try_into().unwrap()); + let base_address = world + .deploy_contract( + 'salt', test_contract::TEST_CLASS_HASH.try_into().unwrap(), array![].span() + ); let new_class_hash: ClassHash = contract_upgrade::TEST_CLASS_HASH.try_into().unwrap(); let upgradeable_dispatcher = IUpgradeableDispatcher { contract_address: base_address }; @@ -108,7 +122,7 @@ mod invalid_legacy_model { impl InvalidModelMetadata of super::IMetadataOnly { fn selector(self: @ContractState) -> felt252 { // Pre-computed address of a contract deployed through the world. - 0x742c3d09472a40914dedcbd609788fd547bde613d6c4d4c2f15d41f4e241f25 + 0x1b1edb46931b1a98d8c6ecf2703e8483ec1d85fb75b3e9c061eab383fc8f8f1 } fn name(self: @ContractState) -> ByteArray { @@ -144,8 +158,9 @@ mod invalid_model { #[abi(embed_v0)] impl InvalidModelSelector of super::IMetadataOnly { fn selector(self: @ContractState) -> felt252 { + // NOTE: Need to update this value if address changes // Pre-computed address of a contract deployed through the world. - 0x455fe9471cb954574b16581868043841391545b9225af00bf545f9acf923295 + 0x1b1edb46931b1a98d8c6ecf2703e8483ec1d85fb75b3e9c061eab383fc8f8f1 } fn name(self: @ContractState) -> ByteArray { @@ -179,12 +194,13 @@ mod invalid_model_world { fn test_deploy_from_world_invalid_model() { let world = deploy_world(); - let base_address = world.deploy_contract(0, base::TEST_CLASS_HASH.try_into().unwrap()); + let contract_address = world + .deploy_contract(0, test_contract::TEST_CLASS_HASH.try_into().unwrap(), array![].span()); // This print allows to know the address of the deployed contract which must be returned // by the selector() function of invalid model, to simulate a ACL issue // (see register_model function) - base_address.print(); + contract_address.print(); world.register_model(invalid_model::TEST_CLASS_HASH.try_into().unwrap()); } diff --git a/crates/dojo-core/src/benchmarks.cairo b/crates/dojo-core/src/benchmarks.cairo index 2aa7482f53..b0e827ed25 100644 --- a/crates/dojo-core/src/benchmarks.cairo +++ b/crates/dojo-core/src/benchmarks.cairo @@ -10,15 +10,14 @@ use dojo::database; use dojo::database::storage; use dojo::model::Model; use dojo::world_test::Foo; -use dojo::test_utils::end; - +use dojo::test_utils::GasCounterImpl; +use dojo::database::introspect::{Introspect, Layout}; #[test] #[available_gas(1000000000)] fn bench_reference_offset() { - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); - end(gas, 'bench empty'); + let gas = GasCounterImpl::start(); + gas.end("bench empty"); } #[test] @@ -26,15 +25,13 @@ fn bench_reference_offset() { fn bench_storage_single() { let keys = array!['database_test', '42'].span(); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); storage::set(0, keys, 420); - end(gas, 'storage set'); + gas.end("storage set"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let res = storage::get(0, keys); - end(gas, 'storage get'); + gas.end("storage get"); assert(res == 420, 'values differ'); } @@ -46,15 +43,13 @@ fn bench_storage_many() { let values = array![1, 2].span(); let layout = array![251, 251].span(); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); storage::set_many(0, keys, values, 0, layout).unwrap(); - end(gas, 'storage set mny'); + gas.end("storage set_many"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let res = storage::get_many(0, keys, layout).unwrap(); - end(gas, 'storage get mny'); + gas.end("storage get_many"); assert(res.len() == 2, 'wrong number of values'); assert(*res.at(0) == *values.at(0), 'value not set'); @@ -64,22 +59,19 @@ fn bench_storage_many() { #[test] #[available_gas(1000000000)] fn bench_native_storage() { - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let keys = array![0x1337].span(); let base = starknet::storage_base_address_from_felt252(poseidon_hash_span(keys)); let address = starknet::storage_address_from_base(base); - end(gas, 'native prep'); + gas.end("native prep"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); starknet::storage_write_syscall(0, address, 42).unwrap_syscall(); - end(gas, 'native write'); + gas.end("native write"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let value = starknet::storage_read_syscall(0, address).unwrap_syscall(); - end(gas, 'native read'); + gas.end("native read"); assert(value == 42, 'read invalid'); } @@ -87,22 +79,19 @@ fn bench_native_storage() { #[test] #[available_gas(1000000000)] fn bench_native_storage_offset() { - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let keys = array![0x1337].span(); let base = starknet::storage_base_address_from_felt252(poseidon_hash_span(keys)); let address = starknet::storage_address_from_base_and_offset(base, 42); - end(gas, 'native prep of'); + gas.end("native prep of"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); starknet::storage_write_syscall(0, address, 42).unwrap_syscall(); - end(gas, 'native writ of'); + gas.end("native writ of"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let value = starknet::storage_read_syscall(0, address).unwrap_syscall(); - end(gas, 'native read of'); + gas.end("native read of"); assert(value == 42, 'read invalid'); } @@ -129,15 +118,13 @@ fn bench_database_array() { i += 1; }; - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); database::set('table', 'key', values.span(), 0, layout.span()); - end(gas, 'db set arr'); + gas.end("db set arr"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let res = database::get('table', 'key', layout.span()); - end(gas, 'db get arr'); + gas.end("db get arr"); let mut i = 0; loop { @@ -155,23 +142,20 @@ fn bench_database_array() { fn bench_simple_struct() { let caller = starknet::contract_address_const::<0x42>(); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let mut foo = Foo { caller, a: 0x123456789abcdef, b: 0x123456789abcdef, }; - end(gas, 'foo init'); + gas.end("foo init"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let mut serialized = ArrayTrait::new(); serde::Serde::serialize(@foo.a, ref serialized); serde::Serde::serialize(@foo.b, ref serialized); let serialized = array::ArrayTrait::span(@serialized); - end(gas, 'foo serialize'); + gas.end("foo serialize"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let values: Span = foo.values(); - end(gas, 'foo values'); + gas.end("foo values"); assert(serialized.len() == 2, 'serialized wrong length'); assert(values.len() == 2, 'value wrong length'); @@ -179,7 +163,7 @@ fn bench_simple_struct() { assert(serialized.at(1) == values.at(1), 'serialized differ at 1'); } -#[derive(Introspect, Copy, Drop, Serde)] +#[derive(Copy, Drop, Serde, IntrospectPacked)] #[dojo::model] struct PositionWithQuaterions { #[key] @@ -195,11 +179,9 @@ struct PositionWithQuaterions { // TODO: this test should be adapted to benchmark the new layout system #[test] -#[ignore] #[available_gas(1000000000)] -fn test_struct_with_many_fields() { - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); +fn test_struct_with_many_fields_fixed() { + let gas = GasCounterImpl::start(); let mut pos = PositionWithQuaterions { id: 0x123456789abcdef, @@ -211,10 +193,9 @@ fn test_struct_with_many_fields() { c: 0x123456789abcdef, d: 0x123456789abcdef, }; - end(gas, 'pos init'); + gas.end("pos init"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let mut serialized = ArrayTrait::new(); serde::Serde::serialize(@pos.x, ref serialized); serde::Serde::serialize(@pos.y, ref serialized); @@ -224,12 +205,11 @@ fn test_struct_with_many_fields() { serde::Serde::serialize(@pos.c, ref serialized); serde::Serde::serialize(@pos.d, ref serialized); let serialized = array::ArrayTrait::span(@serialized); - end(gas, 'pos serialize'); + gas.end("pos serialize"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let values: Span = pos.values(); - end(gas, 'pos values'); + gas.end("pos values"); assert(serialized.len() == values.len(), 'serialized not equal'); let mut idx = 0; @@ -241,26 +221,27 @@ fn test_struct_with_many_fields() { idx += 1; }; - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let layout = match dojo::model::Model::::layout() { + Layout::Fixed(layout) => layout, + _ => panic!("expected fixed layout"), + }; - //database::set('positions', '42', pos.values(), 0, pos.instance_layout()); - end(gas, 'pos db set'); + let gas = GasCounterImpl::start(); + database::set('positions', '42', pos.values(), 0, layout); + gas.end("pos db set"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); - //database::get('positions', '42', pos.instance_layout()); - end(gas, 'pos db get'); + let gas = GasCounterImpl::start(); + database::get('positions', '42', layout); + gas.end("pos db get"); } - -#[derive(Introspect, Copy, Drop, Serde)] +#[derive(IntrospectPacked, Copy, Drop, Serde)] struct Sword { swordsmith: ContractAddress, damage: u32, } -#[derive(Introspect, Copy, Drop, Serde)] +#[derive(IntrospectPacked, Copy, Drop, Serde)] #[dojo::model] struct Case { #[key] @@ -269,35 +250,33 @@ struct Case { material: felt252, } - // TODO: this test should be adapted to benchmark the new layout system #[test] #[ignore] #[available_gas(1000000000)] -fn bench_nested_struct() { +fn bench_nested_struct_packed() { let caller = starknet::contract_address_const::<0x42>(); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let mut case = Case { owner: caller, sword: Sword { swordsmith: caller, damage: 0x12345678, }, material: 'wooden', }; - end(gas, 'case init'); + gas.end("case init"); + + // ???? let _gas = testing::get_available_gas(); gas::withdraw_gas().unwrap(); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let mut serialized = ArrayTrait::new(); serde::Serde::serialize(@case.sword, ref serialized); serde::Serde::serialize(@case.material, ref serialized); let serialized = array::ArrayTrait::span(@serialized); - end(gas, 'case serialize'); + gas.end("case serialize"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let values: Span = case.values(); - end(gas, 'case values'); + gas.end("case values"); assert(serialized.len() == values.len(), 'serialized not equal'); let mut idx = 0; @@ -309,19 +288,21 @@ fn bench_nested_struct() { idx += 1; }; - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let layout = match dojo::model::Model::::layout() { + Layout::Fixed(layout) => layout, + _ => panic!("expected fixed layout"), + }; - //database::set('cases', '42', values, case.instance_layout()); - end(gas, 'case db set'); + let gas = GasCounterImpl::start(); + database::set('cases', '42', values, 0, layout); + gas.end("case db set"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); - //database::get('cases', '42', case.instance_layout()); - end(gas, 'case db get'); + let gas = GasCounterImpl::start(); + database::get('cases', '42', layout); + gas.end("case db get"); } -#[derive(Introspect, Copy, Drop, Serde)] +#[derive(IntrospectPacked, Copy, Drop, Serde)] #[dojo::model] struct Character { #[key] @@ -333,7 +314,7 @@ struct Character { gold: u32, } -#[derive(Introspect, Copy, Drop, Serde)] +#[derive(IntrospectPacked, Copy, Drop, Serde)] struct Abilities { strength: u8, dexterity: u8, @@ -343,7 +324,7 @@ struct Abilities { charisma: u8, } -#[derive(Introspect, Copy, Drop, Serde)] +#[derive(IntrospectPacked, Copy, Drop, Serde)] struct Stats { kills: u128, deaths: u16, @@ -356,7 +337,7 @@ struct Stats { romances: u16, } -#[derive(Introspect, Copy, Drop, Serde)] +#[derive(IntrospectPacked, Copy, Drop, Serde)] enum Weapon { DualWield: (Sword, Sword), Fists: (Sword, Sword), // Introspect requires same arms @@ -366,9 +347,8 @@ enum Weapon { #[test] #[ignore] #[available_gas(1000000000)] -fn bench_complex_struct() { - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); +fn bench_complex_struct_packed() { + let gas = GasCounterImpl::start(); let char = Character { caller: starknet::contract_address_const::<0x42>(), @@ -404,10 +384,9 @@ fn bench_complex_struct() { ), gold: 0x12345678, }; - end(gas, 'chars init'); + gas.end("chars init"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let mut serialized = ArrayTrait::new(); serde::Serde::serialize(@char.heigth, ref serialized); serde::Serde::serialize(@char.abilities, ref serialized); @@ -415,12 +394,11 @@ fn bench_complex_struct() { serde::Serde::serialize(@char.weapon, ref serialized); serde::Serde::serialize(@char.gold, ref serialized); let serialized = array::ArrayTrait::span(@serialized); - end(gas, 'chars serialize'); + gas.end("chars serialize"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let values: Span = char.values(); - end(gas, 'chars values'); + gas.end("chars values"); assert(serialized.len() == values.len(), 'serialized not equal'); @@ -433,13 +411,16 @@ fn bench_complex_struct() { idx += 1; }; - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); - //database::set('chars', '42', char.values(), char.instance_layout()); - end(gas, 'chars db set'); + let layout = match dojo::model::Model::::layout() { + Layout::Fixed(layout) => layout, + _ => panic!("expected fixed layout"), + }; - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); - //database::get('chars', '42', char.instance_layout()); - end(gas, 'chars db get'); + let gas = GasCounterImpl::start(); + database::set('chars', '42', char.values(), 0, layout); + gas.end("chars db set"); + + let gas = GasCounterImpl::start(); + database::get('chars', '42', layout); + gas.end("chars db get"); } diff --git a/crates/dojo-core/src/config/component.cairo b/crates/dojo-core/src/config/component.cairo index eea1cebc4d..ce77eb5b49 100644 --- a/crates/dojo-core/src/config/component.cairo +++ b/crates/dojo-core/src/config/component.cairo @@ -15,13 +15,19 @@ mod Config { #[event] #[derive(Drop, starknet::Event, Debug, PartialEq)] pub enum Event { - ProgramHashUpdate: ProgramHashUpdate, + DifferProgramHashUpdate: DifferProgramHashUpdate, + MergerProgramHashUpdate: MergerProgramHashUpdate, FactsRegistryUpdate: FactsRegistryUpdate } #[derive(Drop, starknet::Event, Debug, PartialEq)] - pub struct ProgramHashUpdate { - program_hash: felt252 + pub struct DifferProgramHashUpdate { + program_hash: felt252, + } + + #[derive(Drop, starknet::Event, Debug, PartialEq)] + pub struct MergerProgramHashUpdate { + program_hash: felt252, } #[derive(Drop, starknet::Event, Debug, PartialEq)] @@ -31,7 +37,8 @@ mod Config { #[storage] struct Storage { - program_hash: felt252, + differ_program_hash: felt252, + merger_program_hash: felt252, facts_registry: ContractAddress, owner: ContractAddress } @@ -45,19 +52,32 @@ mod Config { } } - #[embeddable_as(ConfigImpl)] impl Config< TContractState, +HasComponent > of IConfig> { - fn set_program_hash(ref self: ComponentState, program_hash: felt252) { + fn set_differ_program_hash( + ref self: ComponentState, program_hash: felt252 + ) { + assert(get_caller_address() == self.owner.read(), errors::INVALID_CALLER); + self.differ_program_hash.write(program_hash); + self.emit(DifferProgramHashUpdate { program_hash }); + } + + fn set_merger_program_hash( + ref self: ComponentState, program_hash: felt252 + ) { assert(get_caller_address() == self.owner.read(), errors::INVALID_CALLER); - self.program_hash.write(program_hash); - self.emit(ProgramHashUpdate { program_hash: program_hash }); + self.merger_program_hash.write(program_hash); + self.emit(MergerProgramHashUpdate { program_hash }); + } + + fn get_differ_program_hash(self: @ComponentState) -> felt252 { + self.differ_program_hash.read() } - fn get_program_hash(self: @ComponentState) -> felt252 { - self.program_hash.read() + fn get_merger_program_hash(self: @ComponentState) -> felt252 { + self.merger_program_hash.read() } fn set_facts_registry(ref self: ComponentState, address: ContractAddress) { diff --git a/crates/dojo-core/src/config/interface.cairo b/crates/dojo-core/src/config/interface.cairo index da3aa19150..de82abcdec 100644 --- a/crates/dojo-core/src/config/interface.cairo +++ b/crates/dojo-core/src/config/interface.cairo @@ -9,7 +9,8 @@ trait IConfig { /// /// * `program_hash` - The program hash. /// * `config_hash` - The program's config hash. - fn set_program_hash(ref self: T, program_hash: felt252); + fn set_differ_program_hash(ref self: T, program_hash: felt252); + fn set_merger_program_hash(ref self: T, program_hash: felt252); /// Gets the information of the program that generates the /// state transition trace (namely DojoOS). @@ -17,7 +18,8 @@ trait IConfig { /// # Returns /// /// The program hash and it's configuration hash. - fn get_program_hash(self: @T) -> felt252; + fn get_differ_program_hash(self: @T) -> felt252; + fn get_merger_program_hash(self: @T) -> felt252; /// Sets the facts registry contract address, which is already /// initialized with the verifier information. diff --git a/crates/dojo-core/src/database/introspect.cairo b/crates/dojo-core/src/database/introspect.cairo index a7d2fed3a4..1eb1e2a1ad 100644 --- a/crates/dojo-core/src/database/introspect.cairo +++ b/crates/dojo-core/src/database/introspect.cairo @@ -16,7 +16,7 @@ enum Layout { ByteArray, // there is one layout per variant. // the `selector` field identifies the variant - // the `layout` field defines the full variant layout (variant value + optional variant data) + // the `layout` defines the variant data (could be empty for variant without data). Enum: Span, } @@ -60,7 +60,6 @@ trait Introspect { fn ty() -> Ty; } - impl Introspect_felt252 of Introspect { fn size() -> Option { Option::Some(1) @@ -73,7 +72,6 @@ impl Introspect_felt252 of Introspect { } } - impl Introspect_bool of Introspect { fn size() -> Option { Option::Some(1) @@ -182,7 +180,6 @@ impl Introspect_classhash of Introspect { } } - impl Introspect_bytearray of Introspect { fn size() -> Option { Option::None @@ -203,18 +200,10 @@ impl Introspect_option> of Introspect> { fn layout() -> Layout { Layout::Enum( array![ - FieldLayout { - // Some - selector: 0, - layout: Layout::Tuple( - array![Layout::Fixed(array![8].span()), Introspect::::layout()].span() - ) - }, - FieldLayout { - // None - selector: 1, - layout: Layout::Tuple(array![Layout::Fixed(array![8].span())].span()) - }, + FieldLayout { // Some + selector: 0, layout: Introspect::::layout() }, + FieldLayout { // None + selector: 1, layout: Layout::Fixed(array![].span()) }, ] .span() ) diff --git a/crates/dojo-core/src/database/introspect_test.cairo b/crates/dojo-core/src/database/introspect_test.cairo index 95a993e770..c62d9561bc 100644 --- a/crates/dojo-core/src/database/introspect_test.cairo +++ b/crates/dojo-core/src/database/introspect_test.cairo @@ -35,6 +35,24 @@ struct WithNestedArrayInTuple { arr: (u8, (u16, Array, u256), u32) } +#[derive(Drop, IntrospectPacked)] +struct Vec3 { + x: u32, + y: u32, + z: u32 +} + +#[derive(IntrospectPacked)] +struct Translation { + from: Vec3, + to: Vec3 +} + +#[derive(Drop, IntrospectPacked)] +struct StructInnerNotPacked { + x: Base +} + #[derive(Drop, Introspect)] enum EnumNoData { One, @@ -43,12 +61,45 @@ enum EnumNoData { } #[derive(Drop, Introspect)] -enum EnumWithData { +enum EnumWithSameData { + One: u256, + Two: u256, + Three: u256 +} + +#[derive(Drop, Introspect)] +enum EnumWithSameTupleData { + One: (u256, u32), + Two: (u256, u32), + Three: (u256, u32) +} + +#[derive(Drop, Introspect)] +enum EnumWithVariousData { One: u32, Two: (u8, u16), Three: Array, } + +#[derive(Drop, IntrospectPacked)] +enum EnumPacked { + A: u32, + B: u32, +} + +#[derive(Drop, IntrospectPacked)] +enum EnumInnerPacked { + A: (EnumPacked, Vec3), + B: (EnumPacked, Vec3), +} + +#[derive(Drop, IntrospectPacked)] +enum EnumInnerNotPacked { + A: (EnumPacked, Base), + B: (EnumPacked, Base), +} + #[derive(Drop, Introspect)] struct StructWithOption { x: Option @@ -82,10 +133,8 @@ fn _enum(values: Array>) -> Layout { let v = *values.at(i); match v { - Option::Some(v) => { - items.append(field(i.into(), tuple(array![fixed(array![8]), v]))); - }, - Option::None => { items.append(field(i.into(), fixed(array![8]))) } + Option::Some(v) => { items.append(field(i.into(), v)); }, + Option::None => { items.append(field(i.into(), fixed(array![]))) } } i += 1; @@ -144,9 +193,25 @@ fn test_size_with_nested_array_in_tuple() { #[test] fn test_size_of_enum_without_variant_data() { let size = Introspect::::size(); - assert!(size.is_none()); + assert!(size.is_some()); + assert!(size.unwrap() == 1); +} + +#[test] +fn test_size_of_enum_with_same_variant_data() { + let size = Introspect::::size(); + assert!(size.is_some()); + assert!(size.unwrap() == 3); } +#[test] +fn test_size_of_enum_with_same_tuple_variant_data() { + let size = Introspect::::size(); + assert!(size.is_some()); + assert!(size.unwrap() == 4); +} + + #[test] fn test_size_of_struct_with_option() { let size = Introspect::::size(); @@ -155,49 +220,39 @@ fn test_size_of_struct_with_option() { #[test] fn test_size_of_enum_with_variant_data() { - let size = Introspect::::size(); + let size = Introspect::::size(); assert!(size.is_none()); } #[test] fn test_layout_of_enum_without_variant_data() { let layout = Introspect::::layout(); - let expected = Layout::Enum( - array![ - // One - field(0, tuple(array![fixed(array![8])])), - // Two - field(1, tuple(array![fixed(array![8])])), - // Three - field(2, tuple(array![fixed(array![8])])), - ] - .span() - ); + let expected = _enum(array![ // One + Option::None, // Two + Option::None, // Three + Option::None,]); assert!(layout == expected); } #[test] fn test_layout_of_enum_with_variant_data() { - let layout = Introspect::::layout(); - let expected = Layout::Enum( + let layout = Introspect::::layout(); + let expected = _enum( array![ // One - field(0, tuple(array![fixed(array![8]), fixed(array![32]),])), + Option::Some(fixed(array![32])), // Two - field( - 1, - tuple(array![fixed(array![8]), tuple(array![fixed(array![8]), fixed(array![16]),])]) - ), + Option::Some(tuple(array![fixed(array![8]), fixed(array![16])])), // Three - field(2, tuple(array![fixed(array![8]), arr(fixed(array![128])),])), + Option::Some(arr(fixed(array![128]))), ] - .span() ); assert!(layout == expected); } +#[test] fn test_layout_of_struct_with_option() { let layout = Introspect::::layout(); let expected = Layout::Struct( @@ -207,3 +262,48 @@ fn test_layout_of_struct_with_option() { assert!(layout == expected); } + +#[test] +fn test_layout_of_packed_struct() { + let layout = Introspect::::layout(); + let expected = Layout::Fixed(array![32, 32, 32].span()); + + assert!(layout == expected); +} + +#[test] +fn test_layout_of_inner_packed_struct() { + let layout = Introspect::::layout(); + let expected = Layout::Fixed(array![32, 32, 32, 32, 32, 32].span()); + + assert!(layout == expected); +} + +#[test] +#[should_panic(expected: ("A packed model layout must contain Fixed layouts only.",))] +fn test_layout_of_not_packed_inner_struct() { + let _ = Introspect::::layout(); +} + + +#[test] +fn test_layout_of_packed_enum() { + let layout = Introspect::::layout(); + let expected = Layout::Fixed(array![8, 32].span()); + + assert!(layout == expected); +} + +#[test] +fn test_layout_of_inner_packed_enum() { + let layout = Introspect::::layout(); + let expected = Layout::Fixed(array![8, 8, 32, 32, 32, 32].span()); + + assert!(layout == expected); +} + +#[test] +#[should_panic(expected: ("A packed model layout must contain Fixed layouts only.",))] +fn test_layout_of_not_packed_inner_enum() { + let _ = Introspect::::layout(); +} diff --git a/crates/dojo-core/src/interfaces.cairo b/crates/dojo-core/src/interfaces.cairo index 4b944d22b0..853305fc4f 100644 --- a/crates/dojo-core/src/interfaces.cairo +++ b/crates/dojo-core/src/interfaces.cairo @@ -21,7 +21,10 @@ struct ProgramOutput { #[starknet::interface] trait IUpgradeableState { fn upgrade_state( - ref self: TContractState, new_state: Span, program_output: ProgramOutput + ref self: TContractState, + new_state: Span, + program_output: ProgramOutput, + program_hash: felt252 ); } diff --git a/crates/dojo-core/src/lib.cairo b/crates/dojo-core/src/lib.cairo index 2e66a3ac03..adbe199c73 100644 --- a/crates/dojo-core/src/lib.cairo +++ b/crates/dojo-core/src/lib.cairo @@ -14,7 +14,16 @@ mod world; #[cfg(test)] mod world_test; -#[cfg(test)] +// Since Scarb 2.6.0 there's an optimization that does not +// build tests for dependencies and it's not configurable. +// +// To expose correctly the test utils for a package using dojo-core, +// we need to it in the `lib` target or using the `#[cfg(target: "test")]` +// attribute. +// +// Since `test_utils` is using `TEST_CLASS_HASH` to factorize some deployment +// core, we place it under the test target manually. +#[cfg(target: "test")] mod test_utils; #[cfg(test)] diff --git a/crates/dojo-core/src/packing.cairo b/crates/dojo-core/src/packing.cairo index 759700428b..22676d53ed 100644 --- a/crates/dojo-core/src/packing.cairo +++ b/crates/dojo-core/src/packing.cairo @@ -156,9 +156,274 @@ fn fpow(x: u256, n: u8) -> u256 { } fn shl(x: u256, n: u8) -> u256 { - x * fpow(2, n) + x * pow2_const(n) } fn shr(x: u256, n: u8) -> u256 { - x / fpow(2, n) + x / pow2_const(n) } + +fn pow2_const(n: u8) -> u256 { + *POW_2.span().at(n.into()) +} + +const POW_2: [ + u256 + ; 256] = [ + 1, + 2, + 4, + 8, + 16, + 32, + 64, + 128, + 256, + 512, + 1024, + 2048, + 4096, + 8192, + 16384, + 32768, + 65536, + 131072, + 262144, + 524288, + 1048576, + 2097152, + 4194304, + 8388608, + 16777216, + 33554432, + 67108864, + 134217728, + 268435456, + 536870912, + 1073741824, + 2147483648, + 4294967296, + 8589934592, + 17179869184, + 34359738368, + 68719476736, + 137438953472, + 274877906944, + 549755813888, + 1099511627776, + 2199023255552, + 4398046511104, + 8796093022208, + 17592186044416, + 35184372088832, + 70368744177664, + 140737488355328, + 281474976710656, + 562949953421312, + 1125899906842624, + 2251799813685248, + 4503599627370496, + 9007199254740992, + 18014398509481984, + 36028797018963968, + 72057594037927936, + 144115188075855872, + 288230376151711744, + 576460752303423488, + 1152921504606846976, + 2305843009213693952, + 4611686018427387904, + 9223372036854775808, + 18446744073709551616, + 36893488147419103232, + 73786976294838206464, + 147573952589676412928, + 295147905179352825856, + 590295810358705651712, + 1180591620717411303424, + 2361183241434822606848, + 4722366482869645213696, + 9444732965739290427392, + 18889465931478580854784, + 37778931862957161709568, + 75557863725914323419136, + 151115727451828646838272, + 302231454903657293676544, + 604462909807314587353088, + 1208925819614629174706176, + 2417851639229258349412352, + 4835703278458516698824704, + 9671406556917033397649408, + 19342813113834066795298816, + 38685626227668133590597632, + 77371252455336267181195264, + 154742504910672534362390528, + 309485009821345068724781056, + 618970019642690137449562112, + 1237940039285380274899124224, + 2475880078570760549798248448, + 4951760157141521099596496896, + 9903520314283042199192993792, + 19807040628566084398385987584, + 39614081257132168796771975168, + 79228162514264337593543950336, + 158456325028528675187087900672, + 316912650057057350374175801344, + 633825300114114700748351602688, + 1267650600228229401496703205376, + 2535301200456458802993406410752, + 5070602400912917605986812821504, + 10141204801825835211973625643008, + 20282409603651670423947251286016, + 40564819207303340847894502572032, + 81129638414606681695789005144064, + 162259276829213363391578010288128, + 324518553658426726783156020576256, + 649037107316853453566312041152512, + 1298074214633706907132624082305024, + 2596148429267413814265248164610048, + 5192296858534827628530496329220096, + 10384593717069655257060992658440192, + 20769187434139310514121985316880384, + 41538374868278621028243970633760768, + 83076749736557242056487941267521536, + 166153499473114484112975882535043072, + 332306998946228968225951765070086144, + 664613997892457936451903530140172288, + 1329227995784915872903807060280344576, + 2658455991569831745807614120560689152, + 5316911983139663491615228241121378304, + 10633823966279326983230456482242756608, + 21267647932558653966460912964485513216, + 42535295865117307932921825928971026432, + 85070591730234615865843651857942052864, + 170141183460469231731687303715884105728, + 340282366920938463463374607431768211456, + 680564733841876926926749214863536422912, + 1361129467683753853853498429727072845824, + 2722258935367507707706996859454145691648, + 5444517870735015415413993718908291383296, + 10889035741470030830827987437816582766592, + 21778071482940061661655974875633165533184, + 43556142965880123323311949751266331066368, + 87112285931760246646623899502532662132736, + 174224571863520493293247799005065324265472, + 348449143727040986586495598010130648530944, + 696898287454081973172991196020261297061888, + 1393796574908163946345982392040522594123776, + 2787593149816327892691964784081045188247552, + 5575186299632655785383929568162090376495104, + 11150372599265311570767859136324180752990208, + 22300745198530623141535718272648361505980416, + 44601490397061246283071436545296723011960832, + 89202980794122492566142873090593446023921664, + 178405961588244985132285746181186892047843328, + 356811923176489970264571492362373784095686656, + 713623846352979940529142984724747568191373312, + 1427247692705959881058285969449495136382746624, + 2854495385411919762116571938898990272765493248, + 5708990770823839524233143877797980545530986496, + 11417981541647679048466287755595961091061972992, + 22835963083295358096932575511191922182123945984, + 45671926166590716193865151022383844364247891968, + 91343852333181432387730302044767688728495783936, + 182687704666362864775460604089535377456991567872, + 365375409332725729550921208179070754913983135744, + 730750818665451459101842416358141509827966271488, + 1461501637330902918203684832716283019655932542976, + 2923003274661805836407369665432566039311865085952, + 5846006549323611672814739330865132078623730171904, + 11692013098647223345629478661730264157247460343808, + 23384026197294446691258957323460528314494920687616, + 46768052394588893382517914646921056628989841375232, + 93536104789177786765035829293842113257979682750464, + 187072209578355573530071658587684226515959365500928, + 374144419156711147060143317175368453031918731001856, + 748288838313422294120286634350736906063837462003712, + 1496577676626844588240573268701473812127674924007424, + 2993155353253689176481146537402947624255349848014848, + 5986310706507378352962293074805895248510699696029696, + 11972621413014756705924586149611790497021399392059392, + 23945242826029513411849172299223580994042798784118784, + 47890485652059026823698344598447161988085597568237568, + 95780971304118053647396689196894323976171195136475136, + 191561942608236107294793378393788647952342390272950272, + 383123885216472214589586756787577295904684780545900544, + 766247770432944429179173513575154591809369561091801088, + 1532495540865888858358347027150309183618739122183602176, + 3064991081731777716716694054300618367237478244367204352, + 6129982163463555433433388108601236734474956488734408704, + 12259964326927110866866776217202473468949912977468817408, + 24519928653854221733733552434404946937899825954937634816, + 49039857307708443467467104868809893875799651909875269632, + 98079714615416886934934209737619787751599303819750539264, + 196159429230833773869868419475239575503198607639501078528, + 392318858461667547739736838950479151006397215279002157056, + 784637716923335095479473677900958302012794430558004314112, + 1569275433846670190958947355801916604025588861116008628224, + 3138550867693340381917894711603833208051177722232017256448, + 6277101735386680763835789423207666416102355444464034512896, + 12554203470773361527671578846415332832204710888928069025792, + 25108406941546723055343157692830665664409421777856138051584, + 50216813883093446110686315385661331328818843555712276103168, + 100433627766186892221372630771322662657637687111424552206336, + 200867255532373784442745261542645325315275374222849104412672, + 401734511064747568885490523085290650630550748445698208825344, + 803469022129495137770981046170581301261101496891396417650688, + 1606938044258990275541962092341162602522202993782792835301376, + 3213876088517980551083924184682325205044405987565585670602752, + 6427752177035961102167848369364650410088811975131171341205504, + 12855504354071922204335696738729300820177623950262342682411008, + 25711008708143844408671393477458601640355247900524685364822016, + 51422017416287688817342786954917203280710495801049370729644032, + 102844034832575377634685573909834406561420991602098741459288064, + 205688069665150755269371147819668813122841983204197482918576128, + 411376139330301510538742295639337626245683966408394965837152256, + 822752278660603021077484591278675252491367932816789931674304512, + 1645504557321206042154969182557350504982735865633579863348609024, + 3291009114642412084309938365114701009965471731267159726697218048, + 6582018229284824168619876730229402019930943462534319453394436096, + 13164036458569648337239753460458804039861886925068638906788872192, + 26328072917139296674479506920917608079723773850137277813577744384, + 52656145834278593348959013841835216159447547700274555627155488768, + 105312291668557186697918027683670432318895095400549111254310977536, + 210624583337114373395836055367340864637790190801098222508621955072, + 421249166674228746791672110734681729275580381602196445017243910144, + 842498333348457493583344221469363458551160763204392890034487820288, + 1684996666696914987166688442938726917102321526408785780068975640576, + 3369993333393829974333376885877453834204643052817571560137951281152, + 6739986666787659948666753771754907668409286105635143120275902562304, + 13479973333575319897333507543509815336818572211270286240551805124608, + 26959946667150639794667015087019630673637144422540572481103610249216, + 53919893334301279589334030174039261347274288845081144962207220498432, + 107839786668602559178668060348078522694548577690162289924414440996864, + 215679573337205118357336120696157045389097155380324579848828881993728, + 431359146674410236714672241392314090778194310760649159697657763987456, + 862718293348820473429344482784628181556388621521298319395315527974912, + 1725436586697640946858688965569256363112777243042596638790631055949824, + 3450873173395281893717377931138512726225554486085193277581262111899648, + 6901746346790563787434755862277025452451108972170386555162524223799296, + 13803492693581127574869511724554050904902217944340773110325048447598592, + 27606985387162255149739023449108101809804435888681546220650096895197184, + 55213970774324510299478046898216203619608871777363092441300193790394368, + 110427941548649020598956093796432407239217743554726184882600387580788736, + 220855883097298041197912187592864814478435487109452369765200775161577472, + 441711766194596082395824375185729628956870974218904739530401550323154944, + 883423532389192164791648750371459257913741948437809479060803100646309888, + 1766847064778384329583297500742918515827483896875618958121606201292619776, + 3533694129556768659166595001485837031654967793751237916243212402585239552, + 7067388259113537318333190002971674063309935587502475832486424805170479104, + 14134776518227074636666380005943348126619871175004951664972849610340958208, + 28269553036454149273332760011886696253239742350009903329945699220681916416, + 56539106072908298546665520023773392506479484700019806659891398441363832832, + 113078212145816597093331040047546785012958969400039613319782796882727665664, + 226156424291633194186662080095093570025917938800079226639565593765455331328, + 452312848583266388373324160190187140051835877600158453279131187530910662656, + 904625697166532776746648320380374280103671755200316906558262375061821325312, + 1809251394333065553493296640760748560207343510400633813116524750123642650624, + 3618502788666131106986593281521497120414687020801267626233049500247285301248, + 7237005577332262213973186563042994240829374041602535252466099000494570602496, + 14474011154664524427946373126085988481658748083205070504932198000989141204992, + 28948022309329048855892746252171976963317496166410141009864396001978282409984, + 57896044618658097711785492504343953926634992332820282019728792003956564819968, +]; diff --git a/crates/dojo-core/src/packing_test.cairo b/crates/dojo-core/src/packing_test.cairo index 49aad1f3e8..58d340aff6 100644 --- a/crates/dojo-core/src/packing_test.cairo +++ b/crates/dojo-core/src/packing_test.cairo @@ -1,6 +1,8 @@ use array::{ArrayTrait, SpanTrait}; use starknet::{ClassHash, ContractAddress, Felt252TryIntoContractAddress, Felt252TryIntoClassHash}; -use dojo::packing::{shl, shr, fpow, pack, unpack, pack_inner, unpack_inner, calculate_packed_size}; +use dojo::packing::{ + shl, shr, fpow, pack, unpack, pack_inner, unpack_inner, calculate_packed_size, pow2_const +}; use integer::U256BitAnd; use option::OptionTrait; use debug::PrintTrait; @@ -18,6 +20,17 @@ fn test_bit_fpow() { ) } + +#[test] +fn test_bit_pow2_const() { + assert( + pow2_const( + 250 + ) == 1809251394333065553493296640760748560207343510400633813116524750123642650624_u256, + '' + ) +} + #[test] #[available_gas(9000000)] fn test_bit_shift() { diff --git a/crates/dojo-core/src/test_utils.cairo b/crates/dojo-core/src/test_utils.cairo index 0079e18429..1bb6c91286 100644 --- a/crates/dojo-core/src/test_utils.cairo +++ b/crates/dojo-core/src/test_utils.cairo @@ -68,36 +68,40 @@ fn spawn_test_world(models: Array) -> IWorldDispatcher { } -const GAS_OFFSET: felt252 = 0x1_000000_000000_000000_000000_000000; // 15 bajtów +#[derive(Drop)] +struct GasCounter { + start: u128, +} -/// Measures gas used after previous measurement and prints it -/// -/// # Arguments -/// -/// * `start` - gas before measurement -/// * `name` - name of test, at most 15 bytes, will be padded with spaces -fn end(start: u128, name: felt252) { - let gas_after = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); - let mut name: u256 = name.into(); - - // overwriting zeros with spaces - let mut char = 0; - loop { - if char == 15 { - break; - } - // if given byte is zero - if shl(0xff, 8 * char) & name == 0 { - name = name | shl(0x20, 8 * char); // set space - } - char += 1; - }; +#[generate_trait] +impl GasCounterImpl of GasCounterTrait { + fn start() -> GasCounter { + let start = testing::get_available_gas(); + gas::withdraw_gas().unwrap(); + GasCounter { start } + } + + fn end(self: GasCounter, name: ByteArray) { + let end = testing::get_available_gas(); + let gas_used = self.start - end; - let name: felt252 = (name % GAS_OFFSET.into()).try_into().unwrap(); - // Q?: What's this 1070 value that needed to be adjusted? - let used_gas = (start - gas_after - 1070).into() * GAS_OFFSET; - (used_gas + name).print(); + println!("# GAS # {}: {}", Self::pad_start(name, 18), gas_used); + gas::withdraw_gas().unwrap(); + } + + fn pad_start(str: ByteArray, len: u32) -> ByteArray { + let mut missing: ByteArray = ""; + let missing_len = if str.len() >= len { + 0 + } else { + len - str.len() + }; + + while missing.len() < missing_len { + missing.append(@"."); + }; + missing + str + } } // assert that `value` and `expected` have the same size and the same content diff --git a/crates/dojo-core/src/world.cairo b/crates/dojo-core/src/world.cairo index 0544b1d385..e58610bdec 100644 --- a/crates/dojo-core/src/world.cairo +++ b/crates/dojo-core/src/world.cairo @@ -9,7 +9,9 @@ trait IWorld { fn set_metadata(ref self: T, metadata: ResourceMetadata); fn model(self: @T, selector: felt252) -> (ClassHash, ContractAddress); fn register_model(ref self: T, class_hash: ClassHash); - fn deploy_contract(ref self: T, salt: felt252, class_hash: ClassHash) -> ContractAddress; + fn deploy_contract( + ref self: T, salt: felt252, class_hash: ClassHash, init_calldata: Span + ) -> ContractAddress; fn upgrade_contract(ref self: T, address: ContractAddress, class_hash: ClassHash) -> ClassHash; fn uuid(ref self: T) -> usize; fn emit(self: @T, keys: Array, values: Span); @@ -97,13 +99,16 @@ mod world { const WORLD: felt252 = 0; - // the minimum internal size of an empty ByteArray + // the minimum internal size of an empty ByteArray const MIN_BYTE_ARRAY_SIZE: u32 = 3; + const DOJO_INIT_SELECTOR: felt252 = selector!("dojo_init"); + component!(path: Config, storage: config, event: ConfigEvent); #[abi(embed_v0)] impl ConfigImpl = Config::ConfigImpl; + impl ConfigInternalImpl = Config::InternalImpl; #[event] #[derive(Drop, starknet::Event)] @@ -204,6 +209,7 @@ mod world { writers: LegacyMap::<(felt252, ContractAddress), bool>, #[substorage(v0)] config: Config::Storage, + initialized_contract: LegacyMap::, } #[constructor] @@ -218,6 +224,8 @@ mod world { (resource_metadata::initial_class_hash(), resource_metadata::initial_address()) ); + self.config.initializer(creator); + EventEmitter::emit(ref self, WorldSpawned { address: get_contract_address(), creator }); } @@ -395,7 +403,9 @@ mod world { } // If model is already registered, validate permission to update. - let (current_class_hash, current_address) = self.models.read(selector); + let model_data: (ClassHash, ContractAddress) = self.models.read(selector); + let (current_class_hash, current_address) = model_data; + if current_class_hash.is_non_zero() { assert(self.is_owner(caller, selector), Errors::OWNER_ONLY_UPDATE); prev_class_hash = current_class_hash; @@ -430,12 +440,16 @@ mod world { /// /// * `salt` - The salt use for contract deployment. /// * `class_hash` - The class hash of the contract. + /// * `init_calldata` - Calldata used to initialize the contract. /// /// # Returns /// /// * `ContractAddress` - The address of the newly deployed contract. fn deploy_contract( - ref self: ContractState, salt: felt252, class_hash: ClassHash + ref self: ContractState, + salt: felt252, + class_hash: ClassHash, + init_calldata: Span, ) -> ContractAddress { let (contract_address, _) = deploy_syscall( self.contract_base.read(), salt, array![].span(), false @@ -444,6 +458,14 @@ mod world { let upgradeable_dispatcher = IUpgradeableDispatcher { contract_address }; upgradeable_dispatcher.upgrade(class_hash); + if self.initialized_contract.read(contract_address.into()) { + panic!("Contract has already been initialized"); + } else { + starknet::call_contract_syscall(contract_address, DOJO_INIT_SELECTOR, init_calldata) + .unwrap_syscall(); + self.initialized_contract.write(contract_address.into(), true); + } + self.owners.write((contract_address.into(), get_caller_address()), true); self.deployed_contracts.write(contract_address.into(), class_hash.into()); @@ -599,7 +621,10 @@ mod world { #[abi(embed_v0)] impl UpgradeableState of IUpgradeableState { fn upgrade_state( - ref self: ContractState, new_state: Span, program_output: ProgramOutput + ref self: ContractState, + new_state: Span, + program_output: ProgramOutput, + program_hash: felt252 ) { let mut da_hasher = PedersenImpl::new(0); let mut i = 0; @@ -614,11 +639,16 @@ mod world { let da_hash = da_hasher.finalize(); assert(da_hash == program_output.world_da_hash, 'wrong output hash'); + assert( + program_hash == self.config.get_differ_program_hash() + || program_hash == self.config.get_merger_program_hash(), + 'wrong program hash' + ); + let mut program_output_array = array![]; program_output.serialize(ref program_output_array); let program_output_hash = poseidon::poseidon_hash_span(program_output_array.span()); - let program_hash = self.config.get_program_hash(); let fact = poseidon::PoseidonImpl::new() .update(program_hash) .update(program_output_hash) @@ -638,7 +668,7 @@ mod world { 0, starknet::storage_address_from_base(base), *new_state.at(i).value ) .unwrap_syscall(); - i += 2; + i += 1; }; EventEmitter::emit(ref self, StateUpdated { da_hash: da_hash }); } @@ -796,7 +826,7 @@ mod world { } /// Write values to the world storage. - /// + /// /// # Arguments /// * `model` - the model selector. /// * `key` - the object key. @@ -829,7 +859,7 @@ mod world { } /// Write fixed layout model record to the world storage. - /// + /// /// # Arguments /// * `model` - the model selector. /// * `key` - the model record key. @@ -844,7 +874,7 @@ mod world { } /// Write array layout model record to the world storage. - /// + /// /// # Arguments /// * `model` - the model selector. /// * `key` - the model record key. @@ -894,7 +924,7 @@ mod world { // data: Array, // pending_word: felt252, // pending_word_len: usize, - // } + // } // // That means, the length of data to write from 'values' is: // 1 + len(data) + 1 + 1 = len(data) + 3 @@ -914,7 +944,7 @@ mod world { } /// Write struct layout model record to the world storage. - /// + /// /// # Arguments /// * `model` - the model selector. /// * `key` - the model record key. @@ -944,7 +974,7 @@ mod world { } /// Write tuple layout model record to the world storage. - /// + /// /// # Arguments /// * `model` - the model selector. /// * `key` - the model record key. @@ -984,9 +1014,17 @@ mod world { let variant = *values.at(offset); assert(variant.into() < 256_u256, 'invalid variant value'); + // and write it + database::set(model, key, values, offset, array![251].span()); + offset += 1; + // find the corresponding layout and then write the full variant + let variant_data_key = Self::_field_key(key, variant); + match Self::_find_variant_layout(variant, variant_layouts) { - Option::Some(layout) => Self::_write_layout(model, key, values, ref offset, layout), + Option::Some(layout) => Self::_write_layout( + model, variant_data_key, values, ref offset, layout + ), Option::None => panic!("Unable to find the variant layout") }; } @@ -1018,7 +1056,7 @@ mod world { // data: Array, // pending_word: felt252, // pending_word_len: usize, - // } + // } // // So, just set the 3 first values to 0 (len(data), pending_world and pending_word_len) @@ -1087,16 +1125,21 @@ mod world { } fn _delete_enum_layout(model: felt252, key: felt252, variant_layouts: Span) { - // read the variant value first which is the first stored felt252 + // read the variant value let res = database::get(model, key, array![251].span()); assert(res.len() == 1, 'internal database error'); let variant = *res.at(0); assert(variant.into() < 256_u256, 'invalid variant value'); + // reset the variant value + database::delete(model, key, array![251].span()); + // find the corresponding layout and the delete the full variant + let variant_data_key = Self::_field_key(key, variant); + match Self::_find_variant_layout(variant, variant_layouts) { - Option::Some(layout) => Self::_delete_layout(model, key, layout), + Option::Some(layout) => Self::_delete_layout(model, variant_data_key, layout), Option::None => panic!("Unable to find the variant layout") }; } @@ -1185,7 +1228,7 @@ mod world { // data: Array, // pending_word: felt252, // pending_word_len: usize, - // } + // } // // So, read the length of data and compute the full size to read @@ -1260,18 +1303,22 @@ mod world { ref read_data: Array, variant_layouts: Span ) { - // read the variant value first, which is the first element of the tuple - // (because an enum is stored as a tuple). - let variant_key = Self::_field_key(key, 0); - let res = database::get(model, variant_key, array![8].span()); + // read the variant value first + let res = database::get(model, key, array![8].span()); assert(res.len() == 1, 'internal database error'); let variant = *res.at(0); assert(variant.into() < 256_u256, 'invalid variant value'); - // find the corresponding layout and the read the full variant + read_data.append(variant); + + // find the corresponding layout and the read the variant data + let variant_data_key = Self::_field_key(key, variant); + match Self::_find_variant_layout(variant, variant_layouts) { - Option::Some(layout) => Self::_read_layout(model, key, ref read_data, layout), + Option::Some(layout) => Self::_read_layout( + model, variant_data_key, ref read_data, layout + ), Option::None => panic!("Unable to find the variant layout") }; } diff --git a/crates/dojo-core/src/world_test.cairo b/crates/dojo-core/src/world_test.cairo index 7cf10a7010..634309cd61 100644 --- a/crates/dojo-core/src/world_test.cairo +++ b/crates/dojo-core/src/world_test.cairo @@ -16,9 +16,11 @@ use dojo::world::{ use dojo::database::introspect::{Introspect, Layout, FieldLayout}; use dojo::database::MAX_ARRAY_LENGTH; use dojo::test_utils::{spawn_test_world, deploy_with_world_address, assert_array}; -use dojo::benchmarks::{Character, end}; -use dojo::config::component::Config::{ProgramHashUpdate, FactsRegistryUpdate}; +use dojo::config::component::Config::{ + DifferProgramHashUpdate, MergerProgramHashUpdate, FactsRegistryUpdate +}; use dojo::model::Model; +use dojo::benchmarks::{Character, GasCounterImpl}; #[derive(Introspect, Copy, Drop, Serde)] enum OneEnum { @@ -688,15 +690,14 @@ fn bench_execute() { let alice = starknet::contract_address_const::<0x1337>(); starknet::testing::set_contract_address(alice); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); + bar_contract.set_foo(1337, 1337); - end(gas, 'foo set call'); + gas.end("foo set call"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let data = get!(world, alice, Foo); - end(gas, 'foo get macro'); + gas.end("foo get macro"); assert(data.a == 1337, 'data not stored'); } @@ -711,15 +712,15 @@ fn bench_execute_complex() { let alice = starknet::contract_address_const::<0x1337>(); starknet::testing::set_contract_address(alice); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); + bar_contract.set_char(1337, 1337); - end(gas, 'char set call'); + gas.end("char set call"); + + let gas = GasCounterImpl::start(); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); let data = get!(world, alice, Character); - end(gas, 'char get macro'); + gas.end("char get macro"); assert(data.heigth == 1337, 'data not stored'); } @@ -807,18 +808,19 @@ fn drop_all_events(address: ContractAddress) { #[test] #[available_gas(6000000)] -fn test_program_hash_event_emit() { +fn test_differ_program_hash_event_emit() { let world = deploy_world(); drop_all_events(world.contract_address); let config = IConfigDispatcher { contract_address: world.contract_address }; - config.set_program_hash(program_hash: 98758347158781475198374598718743); + config.set_differ_program_hash(program_hash: 98758347158781475198374598718743); assert_eq!( starknet::testing::pop_log(world.contract_address), - Option::Some(ProgramHashUpdate { program_hash: 98758347158781475198374598718743 }) + Option::Some(DifferProgramHashUpdate { program_hash: 98758347158781475198374598718743 }) ); } + #[test] #[available_gas(6000000)] fn test_facts_registry_event_emit() { @@ -833,6 +835,29 @@ fn test_facts_registry_event_emit() { Option::Some(FactsRegistryUpdate { address: contract_address_const::<0x12>() }) ); } + +#[starknet::interface] +trait IDojoInit { + fn dojo_init(self: @ContractState) -> felt252; +} + +#[dojo::contract] +mod test_contract {} + +#[test] +#[available_gas(6000000)] +#[should_panic(expected: ('Only world can init', 'ENTRYPOINT_FAILED'))] +fn test_can_call_init() { + let world = deploy_world(); + let address = world + .deploy_contract( + 'salt1', test_contract::TEST_CLASS_HASH.try_into().unwrap(), array![].span() + ); + + let dojo_init = IDojoInitDispatcher { contract_address: address }; + dojo_init.dojo_init(); +} + #[test] fn test_set_entity_with_fixed_layout() { let world = deploy_world(); diff --git a/crates/dojo-lang/src/compiler.rs b/crates/dojo-lang/src/compiler.rs index b9fcaab338..e21edfe2bb 100644 --- a/crates/dojo-lang/src/compiler.rs +++ b/crates/dojo-lang/src/compiler.rs @@ -21,7 +21,8 @@ use camino::{Utf8Path, Utf8PathBuf}; use convert_case::{Case, Casing}; use dojo_world::manifest::{ AbiFormat, Class, ComputedValueEntrypoint, DojoContract, DojoModel, Manifest, ManifestMethods, - BASE_CONTRACT_NAME, WORLD_CONTRACT_NAME, + ABIS_DIR, BASE_CONTRACT_NAME, BASE_DIR, CONTRACTS_DIR, MANIFESTS_DIR, MODELS_DIR, + WORLD_CONTRACT_NAME, }; use itertools::Itertools; use scarb::compiler::helpers::{build_compiler_config, collect_main_crate_ids}; @@ -40,15 +41,6 @@ use crate::semantics::utils::find_module_rw; const CAIRO_PATH_SEPARATOR: &str = "::"; -pub const MANIFESTS_DIR: &str = "manifests"; -pub const BASE_DIR: &str = "base"; -pub const OVERLAYS_DIR: &str = "overlays"; -pub const DEPLOYMENTS_DIR: &str = "deployments"; -pub const ABIS_DIR: &str = "abis"; - -pub const CONTRACTS_DIR: &str = "contracts"; -pub const MODELS_DIR: &str = "models"; - pub const SOURCES_DIR: &str = "src"; pub(crate) const LOG_TARGET: &str = "dojo_lang::compiler"; @@ -90,7 +82,7 @@ impl Compiler for DojoCompiler { db: &mut RootDatabase, ws: &Workspace<'_>, ) -> Result<()> { - let props: Props = unit.target().props()?; + let props: Props = unit.main_component().target_props()?; let target_dir = unit.target_dir(ws); let sources_dir = target_dir.child(Utf8Path::new(SOURCES_DIR)); diff --git a/crates/dojo-lang/src/contract.rs b/crates/dojo-lang/src/contract.rs index 570d7606cf..1e4e5147e0 100644 --- a/crates/dojo-lang/src/contract.rs +++ b/crates/dojo-lang/src/contract.rs @@ -5,37 +5,32 @@ use cairo_lang_defs::plugin::{ DynGeneratedFileAuxData, PluginDiagnostic, PluginGeneratedFile, PluginResult, }; use cairo_lang_diagnostics::Severity; -use cairo_lang_syntax::attribute::structured::{ - Attribute, AttributeArg, AttributeArgVariant, AttributeListStructurize, -}; use cairo_lang_syntax::node::ast::MaybeModuleBody; use cairo_lang_syntax::node::db::SyntaxGroup; +use cairo_lang_syntax::node::helpers::QueryAttrs; use cairo_lang_syntax::node::{ast, ids, Terminal, TypedStablePtr, TypedSyntaxNode}; use cairo_lang_utils::unordered_hash_map::UnorderedHashMap; use dojo_types::system::Dependency; -use crate::plugin::{DojoAuxData, SystemAuxData, DOJO_CONTRACT_ATTR}; +use crate::plugin::{DojoAuxData, SystemAuxData}; +use crate::syntax::world_param::{self, WorldParamInjectionKind}; +use crate::syntax::{self_param, utils as syntax_utils}; -const ALLOW_REF_SELF_ARG: &str = "allow_ref_self"; +const DOJO_INIT_FN: &str = "dojo_init"; pub struct DojoContract { diagnostics: Vec, dependencies: HashMap, - do_allow_ref_self: bool, } impl DojoContract { pub fn from_module(db: &dyn SyntaxGroup, module_ast: ast::ItemModule) -> PluginResult { let name = module_ast.name(db).text(db); - let attrs = module_ast.attributes(db).structurize(db); - let dojo_contract_attr = attrs.iter().find(|attr| attr.id.as_str() == DOJO_CONTRACT_ATTR); - let do_allow_ref_self = extract_allow_ref_self(dojo_contract_attr, db).unwrap_or_default(); - - let mut system = - DojoContract { diagnostics: vec![], dependencies: HashMap::new(), do_allow_ref_self }; + let mut system = DojoContract { diagnostics: vec![], dependencies: HashMap::new() }; let mut has_event = false; let mut has_storage = false; + let mut has_init = false; if let MaybeModuleBody::Some(body) = module_ast.body(db) { let mut body_nodes: Vec<_> = body @@ -60,12 +55,44 @@ impl DojoContract { if trait_path.contains("") { return system.rewrite_impl(db, impl_ast.clone()); } + } else if let ast::ModuleItem::FreeFunction(fn_ast) = el { + let fn_decl = fn_ast.declaration(db); + let fn_name = fn_decl.name(db).text(db); + + if fn_name == DOJO_INIT_FN { + has_init = true; + return system.handle_init_fn(db, fn_ast); + } } vec![RewriteNode::Copied(el.as_syntax_node())] }) .collect(); + if !has_init { + let node = RewriteNode::interpolate_patched( + " + #[starknet::interface] + trait IDojoInit { + fn $init_name$(self: @ContractState); + } + + #[abi(embed_v0)] + impl IDojoInitImpl of IDojoInit { + fn $init_name$(self: @ContractState) { + assert(starknet::get_caller_address() == \ + self.world().contract_address, 'Only world can init'); + } + } + ", + &UnorderedHashMap::from([( + "init_name".to_string(), + RewriteNode::Text(DOJO_INIT_FN.to_string()), + )]), + ); + body_nodes.append(&mut vec![node]); + } + if !has_event { body_nodes.append(&mut system.create_event()) } @@ -84,8 +111,8 @@ impl DojoContract { use dojo::world::IWorldDispatcherTrait; use dojo::world::IWorldProvider; use dojo::world::IDojoResourceProvider; - - + + component!(path: dojo::components::upgradeable::upgradeable, storage: \ upgradeable, event: UpgradeableEvent); @@ -140,6 +167,55 @@ impl DojoContract { PluginResult::default() } + fn handle_init_fn( + &mut self, + db: &dyn SyntaxGroup, + fn_ast: &ast::FunctionWithBody, + ) -> Vec { + let fn_decl = fn_ast.declaration(db); + let fn_name = fn_decl.name(db).text(db); + + let (params_str, was_world_injected) = self.rewrite_parameters( + db, + fn_decl.signature(db).parameters(db), + fn_ast.stable_ptr().untyped(), + ); + + let mut world_read = ""; + if was_world_injected { + world_read = "let world = self.world_dispatcher.read();"; + } + + let body = fn_ast.body(db).as_syntax_node().get_text(db); + + let node = RewriteNode::interpolate_patched( + " + #[starknet::interface] + trait IDojoInit { + fn $name$($params_str$); + } + + #[abi(embed_v0)] + impl IDojoInitImpl of IDojoInit { + fn $name$($params_str$) { + $world_read$ + assert(starknet::get_caller_address() == self.world().contract_address, \ + 'Only world can init'); + $body$ + } + } + ", + &UnorderedHashMap::from([ + ("name".to_string(), RewriteNode::Text(fn_name.to_string())), + ("params_str".to_string(), RewriteNode::Text(params_str)), + ("body".to_string(), RewriteNode::Text(body)), + ("world_read".to_string(), RewriteNode::Text(world_read.to_string())), + ]), + ); + + vec![node] + } + pub fn merge_event( &mut self, db: &dyn SyntaxGroup, @@ -220,166 +296,74 @@ impl DojoContract { )] } - /// Gets name, modifiers and type from a function parameter. - pub fn get_parameter_info( - &mut self, - db: &dyn SyntaxGroup, - param: ast::Param, - ) -> (String, String, String) { - let name = param.name(db).text(db).trim().to_string(); - let modifiers = param.modifiers(db).as_syntax_node().get_text(db).trim().to_string(); - let param_type = - param.type_clause(db).ty(db).as_syntax_node().get_text(db).trim().to_string(); - - (name, modifiers, param_type) - } - - /// Check if the function has a self parameter. - /// - /// Returns - /// * a boolean indicating if `self` has to be added, - // * a boolean indicating if there is a `ref self` parameter. - pub fn check_self_parameter( - &mut self, - db: &dyn SyntaxGroup, - param_list: ast::ParamList, - ) -> (bool, bool) { - let mut add_self = true; - let mut has_ref_self = false; - if !param_list.elements(db).is_empty() { - let (param_name, param_modifiers, param_type) = - self.get_parameter_info(db, param_list.elements(db)[0].clone()); - - if param_name.eq(&"self".to_string()) { - if param_modifiers.contains(&"ref".to_string()) - && param_type.eq(&"ContractState".to_string()) - { - has_ref_self = true; - add_self = false; - } - - if param_type.eq(&"@ContractState".to_string()) { - add_self = false; - } - } - }; - - (add_self, has_ref_self) - } - - /// Check if the function has multiple IWorldDispatcher parameters. - /// - /// Returns - /// * a boolean indicating if the function has multiple world dispatchers. - pub fn check_world_dispatcher( - &mut self, - db: &dyn SyntaxGroup, - param_list: ast::ParamList, - ) -> bool { - let mut count = 0; - - param_list.elements(db).iter().for_each(|param| { - let (_, _, param_type) = self.get_parameter_info(db, param.clone()); - - if param_type.eq(&"IWorldDispatcher".to_string()) { - count += 1; - } - }); - - count > 1 - } - /// Rewrites parameter list by: - /// * adding `self` parameter if missing, - /// * removing `world` if present as first parameter (self excluded), as it will be read from - /// the first function statement. + /// * adding `self` parameter based on the `world` parameter mutability. If `world` is not + /// provided, a `View` is assumed. + /// * removing `world` if present as first parameter, as it will be read from the first + /// function statement. /// /// Reports an error in case of: - /// * `ref self`, as systems are supposed to be 100% stateless, - /// * multiple IWorldDispatcher parameters. - /// * the `IWorldDispatcher` is not the first parameter (self excluded) and named 'world'. + /// * `self` used explicitly, + /// * multiple world parameters, + /// * the `world` parameter is not the first parameter and named 'world'. /// /// Returns - /// * the list of parameters in a String - /// * a boolean indicating if `self` has been added - // * a boolean indicating if `world` parameter has been removed + /// * the list of parameters in a String. + /// * true if the world has to be injected (found as the first param). pub fn rewrite_parameters( &mut self, db: &dyn SyntaxGroup, param_list: ast::ParamList, - diagnostic_item: ids::SyntaxStablePtrId, - ) -> (String, bool, bool) { - let (add_self, has_ref_self) = self.check_self_parameter(db, param_list.clone()); - let has_multiple_world_dispatchers = self.check_world_dispatcher(db, param_list.clone()); + fn_diagnostic_item: ids::SyntaxStablePtrId, + ) -> (String, bool) { + let is_self_used = self_param::check_parameter(db, ¶m_list); + + let world_injection = world_param::parse_world_injection( + db, + param_list.clone(), + fn_diagnostic_item, + &mut self.diagnostics, + ); - let mut world_removed = false; + if is_self_used && world_injection != WorldParamInjectionKind::None { + self.diagnostics.push(PluginDiagnostic { + stable_ptr: fn_diagnostic_item, + message: "You cannot use `self` and `world` parameters together.".to_string(), + severity: Severity::Error, + }); + } let mut params = param_list .elements(db) .iter() - .enumerate() - .filter_map(|(idx, param)| { - let (name, modifiers, param_type) = self.get_parameter_info(db, param.clone()); - - if param_type.eq(&"IWorldDispatcher".to_string()) - && modifiers.eq(&"".to_string()) - && !has_multiple_world_dispatchers - { - let has_good_pos = (add_self && idx == 0) || (!add_self && idx == 1); - let has_good_name = name.eq(&"world".to_string()); - - if has_good_pos && has_good_name { - world_removed = true; - None - } else { - if !has_good_pos { - self.diagnostics.push(PluginDiagnostic { - stable_ptr: param.stable_ptr().untyped(), - message: "The IWorldDispatcher parameter must be the first \ - parameter of the function (self excluded)." - .to_string(), - severity: Severity::Error, - }); - } + .filter_map(|param| { + let (name, _, param_type) = syntax_utils::get_parameter_info(db, param.clone()); - if !has_good_name { - self.diagnostics.push(PluginDiagnostic { - stable_ptr: param.stable_ptr().untyped(), - message: "The IWorldDispatcher parameter must be named 'world'." - .to_string(), - severity: Severity::Error, - }); - } - Some(param.as_syntax_node().get_text(db)) - } + // If the param is `IWorldDispatcher`, we don't need to keep it in the param list + // as it is flatten in the first statement. + if world_param::is_world_param(&name, ¶m_type) { + None } else { Some(param.as_syntax_node().get_text(db)) } }) .collect::>(); - if has_multiple_world_dispatchers { - self.diagnostics.push(PluginDiagnostic { - stable_ptr: diagnostic_item, - message: "Only one parameter of type IWorldDispatcher is allowed.".to_string(), - severity: Severity::Error, - }); - } - - if has_ref_self && !self.do_allow_ref_self { - self.diagnostics.push(PluginDiagnostic { - stable_ptr: diagnostic_item, - message: "Functions of dojo::contract cannot have 'ref self' parameter." - .to_string(), - severity: Severity::Error, - }); - } - - if add_self { - params.insert(0, "self: @ContractState".to_string()); + match world_injection { + WorldParamInjectionKind::None => { + if !is_self_used { + params.insert(0, "self: @ContractState".to_string()); + } + } + WorldParamInjectionKind::View => { + params.insert(0, "self: @ContractState".to_string()); + } + WorldParamInjectionKind::External => { + params.insert(0, "ref self: ContractState".to_string()); + } } - (params.join(", "), add_self, world_removed) + (params.join(", "), world_injection != WorldParamInjectionKind::None) } /// Rewrites function statements by adding the reading of `world` at first statement. @@ -403,28 +387,43 @@ impl DojoContract { /// * removing `world` if present as first parameter (self excluded), /// * adding `let world = self.world_dispatcher.read();` statement at the beginning of the /// function to restore the removed `world` parameter. + /// * if `has_generate_trait` is true, the implementation containing the function has the + /// #[generate_trait] attribute. pub fn rewrite_function( &mut self, db: &dyn SyntaxGroup, fn_ast: ast::FunctionWithBody, + has_generate_trait: bool, ) -> Vec { let mut rewritten_fn = RewriteNode::from_ast(&fn_ast); - let (params_str, self_added, world_removed) = self.rewrite_parameters( + let (params_str, was_world_injected) = self.rewrite_parameters( db, fn_ast.declaration(db).signature(db).parameters(db), fn_ast.stable_ptr().untyped(), ); - if self_added || world_removed { - let rewritten_params = rewritten_fn - .modify_child(db, ast::FunctionWithBody::INDEX_DECLARATION) - .modify_child(db, ast::FunctionDeclaration::INDEX_SIGNATURE) - .modify_child(db, ast::FunctionSignature::INDEX_PARAMETERS); - rewritten_params.set_str(params_str); + if has_generate_trait && was_world_injected { + self.diagnostics.push(PluginDiagnostic { + stable_ptr: fn_ast.stable_ptr().untyped(), + message: "You cannot use `world` and `#[generate_trait]` together. Use `self` \ + instead." + .to_string(), + severity: Severity::Error, + }); } - if world_removed { + // We always rewrite the params as the self parameter is added based on the + // world mutability. + let rewritten_params = rewritten_fn + .modify_child(db, ast::FunctionWithBody::INDEX_DECLARATION) + .modify_child(db, ast::FunctionDeclaration::INDEX_SIGNATURE) + .modify_child(db, ast::FunctionSignature::INDEX_PARAMETERS); + rewritten_params.set_str(params_str); + + // If the world was injected, we also need to rewrite the statements of the function + // to ensure the `world` injection is effective. + if was_world_injected { let rewritten_statements = rewritten_fn .modify_child(db, ast::FunctionWithBody::INDEX_BODY) .modify_child(db, ast::ExprBlock::INDEX_STATEMENTS); @@ -438,6 +437,9 @@ impl DojoContract { /// Rewrites all the functions of a Impl block. fn rewrite_impl(&mut self, db: &dyn SyntaxGroup, impl_ast: ast::ItemImpl) -> Vec { + let generate_attrs = impl_ast.attributes(db).query_attr(db, "generate_trait"); + let has_generate_trait = !generate_attrs.is_empty(); + if let ast::MaybeImplBody::Some(body) = impl_ast.body(db) { let body_nodes: Vec<_> = body .items(db) @@ -445,7 +447,7 @@ impl DojoContract { .iter() .flat_map(|el| { if let ast::ImplItem::Function(fn_ast) = el { - return self.rewrite_function(db, fn_ast.clone()); + return self.rewrite_function(db, fn_ast.clone(), has_generate_trait); } vec![RewriteNode::Copied(el.as_syntax_node())] }) @@ -474,26 +476,3 @@ impl DojoContract { vec![RewriteNode::Copied(impl_ast.as_syntax_node())] } } - -/// Extract the allow_ref_self attribute. -pub(crate) fn extract_allow_ref_self( - allow_ref_self_attr: Option<&Attribute>, - db: &dyn SyntaxGroup, -) -> Option { - let Some(attr) = allow_ref_self_attr else { - return None; - }; - - #[allow(clippy::collapsible_match)] - match &attr.args[..] { - [AttributeArg { variant: AttributeArgVariant::Unnamed(value), .. }] => match value { - ast::Expr::Path(path) - if path.as_syntax_node().get_text_without_trivia(db) == ALLOW_REF_SELF_ARG => - { - Some(true) - } - _ => None, - }, - _ => None, - } -} diff --git a/crates/dojo-lang/src/interface.rs b/crates/dojo-lang/src/interface.rs index 54205335c0..1fc64b6759 100644 --- a/crates/dojo-lang/src/interface.rs +++ b/crates/dojo-lang/src/interface.rs @@ -5,6 +5,9 @@ use cairo_lang_syntax::node::db::SyntaxGroup; use cairo_lang_syntax::node::{ast, ids, Terminal, TypedStablePtr, TypedSyntaxNode}; use cairo_lang_utils::unordered_hash_map::UnorderedHashMap; +use crate::syntax::self_param; +use crate::syntax::world_param::{self, WorldParamInjectionKind}; + pub struct DojoInterface { diagnostics: Vec, } @@ -77,9 +80,7 @@ impl DojoInterface { } } - /// Rewrites parameter list by adding `self` parameter if missing. - /// - /// Reports an error in case of `ref self` as systems are supposed to be 100% stateless. + /// Rewrites parameter list by adding `self` parameter based on the `world` parameter. pub fn rewrite_parameters( &mut self, db: &dyn SyntaxGroup, @@ -92,50 +93,39 @@ impl DojoInterface { .map(|e| e.as_syntax_node().get_text(db)) .collect::>(); - let mut need_to_add_self = true; - if !params.is_empty() { - let first_param = param_list.elements(db)[0].clone(); - let param_name = first_param.name(db).text(db).to_string(); - - if param_name.eq(&"self".to_string()) { - let param_modifiers = first_param - .modifiers(db) - .elements(db) - .iter() - .map(|e| e.as_syntax_node().get_text(db).trim().to_string()) - .collect::>(); - - let param_type = first_param - .type_clause(db) - .ty(db) - .as_syntax_node() - .get_text(db) - .trim() - .to_string(); - - if param_modifiers.contains(&"ref".to_string()) - && param_type.eq(&"TContractState".to_string()) - { - self.diagnostics.push(PluginDiagnostic { - stable_ptr: diagnostic_item, - message: "Functions of dojo::interface cannot have `ref self` parameter." - .to_string(), - severity: Severity::Error, - }); + let is_self_used = self_param::check_parameter(db, ¶m_list); - need_to_add_self = false; - } + let world_injection = world_param::parse_world_injection( + db, + param_list, + diagnostic_item, + &mut self.diagnostics, + ); + + if is_self_used && world_injection != WorldParamInjectionKind::None { + self.diagnostics.push(PluginDiagnostic { + stable_ptr: diagnostic_item, + message: "You cannot use `self` and `world` parameters together.".to_string(), + severity: Severity::Error, + }); + } - if param_type.eq(&"@TContractState".to_string()) { - need_to_add_self = false; + match world_injection { + WorldParamInjectionKind::None => { + if !is_self_used { + params.insert(0, "self: @TContractState".to_string()); } } + WorldParamInjectionKind::View => { + params.remove(0); + params.insert(0, "self: @TContractState".to_string()); + } + WorldParamInjectionKind::External => { + params.remove(0); + params.insert(0, "ref self: TContractState".to_string()); + } }; - if need_to_add_self { - params.insert(0, "self: @TContractState".to_string()); - } - params.join(", ") } @@ -151,11 +141,13 @@ impl DojoInterface { .modify_child(db, ast::FunctionDeclaration::INDEX_SIGNATURE) .modify_child(db, ast::FunctionSignature::INDEX_PARAMETERS); - rewritten_params.set_str(self.rewrite_parameters( + let params_str = self.rewrite_parameters( db, fn_ast.declaration(db).signature(db).parameters(db), fn_ast.stable_ptr().untyped(), - )); + ); + + rewritten_params.set_str(params_str); vec![rewritten_fn] } } diff --git a/crates/dojo-lang/src/introspect/layout.rs b/crates/dojo-lang/src/introspect/layout.rs index 0b7e43386d..216b00678c 100644 --- a/crates/dojo-lang/src/introspect/layout.rs +++ b/crates/dojo-lang/src/introspect/layout.rs @@ -56,7 +56,9 @@ pub fn build_variant_layouts( let selector = format!("{i}"); let variant_layout = match v.type_clause(db) { - OptionTypeClause::Empty(_) => "".to_string(), + OptionTypeClause::Empty(_) => { + "dojo::database::introspect::Layout::Fixed(array![].span())".to_string() + } OptionTypeClause::TypeClause(type_clause) => { get_layout_from_type_clause(db, diagnostics, &type_clause) } @@ -65,12 +67,7 @@ pub fn build_variant_layouts( format!( "dojo::database::introspect::FieldLayout {{ selector: {selector}, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - {variant_layout} - ].span() - ) + layout: {variant_layout} }}" ) }) @@ -183,12 +180,16 @@ pub fn build_item_layout_from_type( } } +pub fn is_custom_layout(layout: &str) -> bool { + layout.starts_with("dojo::database::introspect::Introspect::") +} + pub fn build_packed_struct_layout( db: &dyn SyntaxGroup, diagnostics: &mut Vec, struct_ast: &ItemStruct, ) -> String { - struct_ast + let layouts = struct_ast .members(db) .elements(db) .iter() @@ -199,8 +200,64 @@ pub fn build_packed_struct_layout( Some(get_packed_field_layout_from_type_clause(db, diagnostics, &m.type_clause(db))) }) + .flatten() + .collect::>(); + + if layouts.iter().any(|v| is_custom_layout(v.as_str())) { + generate_cairo_code_for_fixed_layout_with_custom_types(&layouts) + } else { + format!( + "dojo::database::introspect::Layout::Fixed( + array![ + {} + ].span() + )", + layouts.join(",") + ) + } +} + +pub fn generate_cairo_code_for_fixed_layout_with_custom_types(layouts: &[String]) -> String { + let layouts_repr = layouts + .iter() + .map(|l| { + if is_custom_layout(l) { + l.to_string() + } else { + format!("dojo::database::introspect::Layout::Fixed(array![{l}].span())") + } + }) .collect::>() - .join(",") + .join(",\n"); + + format!( + "let mut layouts = array![ + {layouts_repr} + ]; + let mut merged_layout = ArrayTrait::::new(); + + loop {{ + match ArrayTrait::pop_front(ref layouts) {{ + Option::Some(mut layout) => {{ + match layout {{ + dojo::database::introspect::Layout::Fixed(mut l) => {{ + loop {{ + match SpanTrait::pop_front(ref l) {{ + Option::Some(x) => merged_layout.append(*x), + Option::None(_) => {{ break; }} + }}; + }}; + }}, + _ => panic!(\"A packed model layout must contain Fixed layouts only.\"), + }}; + }}, + Option::None(_) => {{ break; }} + }}; + }}; + + dojo::database::introspect::Layout::Fixed(merged_layout.span()) + ", + ) } // @@ -209,23 +266,36 @@ pub fn build_packed_enum_layout( diagnostics: &mut Vec, enum_ast: &ItemEnum, ) -> String { - let variant_layouts = enum_ast - .variants(db) - .elements(db) - .iter() - .map(|v| match v.type_clause(db) { - OptionTypeClause::Empty(_) => "".to_string(), + // to be packable, all variants data must have the same size. + // as this point has already been checked before calling `build_packed_enum_layout`, + // just use the first variant to generate the fixed layout. + let elements = enum_ast.variants(db).elements(db); + let mut variant_layout = if elements.is_empty() { + vec![] + } else { + match elements.first().unwrap().type_clause(db) { + OptionTypeClause::Empty(_) => vec![], OptionTypeClause::TypeClause(type_clause) => { get_packed_field_layout_from_type_clause(db, diagnostics, &type_clause) } - }) - .collect::>(); + } + }; - if variant_layouts.is_empty() { - return "8".to_string(); - } + // don't forget the store the variant value + variant_layout.insert(0, "8".to_string()); - format!("8,{}", variant_layouts[0]) + if variant_layout.iter().any(|v| is_custom_layout(v.as_str())) { + generate_cairo_code_for_fixed_layout_with_custom_types(&variant_layout) + } else { + format!( + "dojo::database::introspect::Layout::Fixed( + array![ + {} + ].span() + )", + variant_layout.join(",") + ) + } } // @@ -233,7 +303,7 @@ pub fn get_packed_field_layout_from_type_clause( db: &dyn SyntaxGroup, diagnostics: &mut Vec, type_clause: &TypeClause, -) -> String { +) -> Vec { match type_clause.ty(db) { Expr::Path(path) => { let path_type = path.as_syntax_node().get_text(db); @@ -253,7 +323,7 @@ pub fn get_packed_field_layout_from_type_clause( message: "Unexpected expression for variant data type.".to_string(), severity: Severity::Error, }); - "ERROR".to_string() + vec!["ERROR".to_string()] } } } @@ -263,28 +333,26 @@ pub fn get_packed_item_layout_from_type( diagnostics: &mut Vec, diagnostic_item: ids::SyntaxStablePtrId, item_type: &str, -) -> String { +) -> Vec { if is_array(item_type) || is_byte_array(item_type) { diagnostics.push(PluginDiagnostic { stable_ptr: diagnostic_item, message: "Array field cannot be packed.".into(), severity: Severity::Error, }); - "ERROR".to_string() + vec!["ERROR".to_string()] } else if is_tuple(item_type) { get_packed_tuple_layout_from_type(diagnostics, diagnostic_item, item_type) } else { let primitives = primitive_type_introspection(); if let Some(p) = primitives.get(item_type) { - p.1.iter().map(|x| x.to_string()).collect::>().join(",") + vec![p.1.iter().map(|x| x.to_string()).collect::>().join(",")] } else { - diagnostics.push(PluginDiagnostic { - stable_ptr: diagnostic_item, - message: "For now, field with custom type cannot be packed".into(), - severity: Severity::Error, - }); - "ERROR".to_string() + // as we cannot verify that an enum/struct custom type is packable, + // we suppose it is and let the user verify this. + // If it's not the case, the Dojo model layout function will panic. + vec![format!("dojo::database::introspect::Introspect::<{}>::layout()", item_type)] } } } @@ -294,10 +362,9 @@ pub fn get_packed_tuple_layout_from_type( diagnostics: &mut Vec, diagnostic_item: ids::SyntaxStablePtrId, item_type: &str, -) -> String { +) -> Vec { get_tuple_item_types(item_type) .iter() - .map(|x| get_packed_item_layout_from_type(diagnostics, diagnostic_item, x)) + .flat_map(|x| get_packed_item_layout_from_type(diagnostics, diagnostic_item, x)) .collect::>() - .join(",") } diff --git a/crates/dojo-lang/src/introspect/mod.rs b/crates/dojo-lang/src/introspect/mod.rs index fb788af004..856c3477e0 100644 --- a/crates/dojo-lang/src/introspect/mod.rs +++ b/crates/dojo-lang/src/introspect/mod.rs @@ -21,18 +21,11 @@ pub fn handle_introspect_struct( packed: bool, ) -> RewriteNode { let struct_name = struct_ast.name(db).text(db).into(); - let struct_size = size::compute_struct_layout_size(db, &struct_ast); + let struct_size = size::compute_struct_layout_size(db, &struct_ast, packed); let ty = ty::build_struct_ty(db, &struct_name, &struct_ast); let layout = if packed { - format!( - "dojo::database::introspect::Layout::Fixed( - array![ - {} - ].span() - )", - layout::build_packed_struct_layout(db, diagnostics, &struct_ast) - ) + layout::build_packed_struct_layout(db, diagnostics, &struct_ast) } else { format!( "dojo::database::introspect::Layout::Struct( @@ -57,24 +50,15 @@ pub fn handle_introspect_enum( packed: bool, ) -> RewriteNode { let enum_name = enum_ast.name(db).text(db).into(); - let identical_variants = utils::are_enum_variants_identical(db, &enum_ast); - let enum_size = size::compute_enum_layout_size(db, &enum_ast, identical_variants); - let ty = ty::build_enum_ty(db, &enum_name, &enum_ast); + let variant_sizes = size::compute_enum_variant_sizes(db, &enum_ast); let layout = if packed { - if identical_variants { - format!( - "dojo::database::introspect::Layout::Fixed( - array![ - {} - ].span() - )", - layout::build_packed_enum_layout(db, diagnostics, &enum_ast) - ) + if size::is_enum_packable(&variant_sizes) { + layout::build_packed_enum_layout(db, diagnostics, &enum_ast) } else { diagnostics.push(PluginDiagnostic { stable_ptr: enum_ast.name(db).stable_ptr().0, - message: "To be packed, all variants must have exactly the same layout." + message: "To be packed, all variants must have fixed layout of same size." .to_string(), severity: Severity::Error, }); @@ -92,6 +76,8 @@ pub fn handle_introspect_enum( }; let (gen_types, gen_impls) = build_generic_types_and_impls(db, enum_ast.generic_params(db)); + let enum_size = size::compute_enum_layout_size(&variant_sizes, packed); + let ty = ty::build_enum_ty(db, &enum_name, &enum_ast); generate_introspect(&enum_name, &enum_size, &gen_types, gen_impls, &layout, &ty) } @@ -115,7 +101,6 @@ impl $name$Introspect<$generics$> of \ $size$ } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { $layout$ } diff --git a/crates/dojo-lang/src/introspect/size.rs b/crates/dojo-lang/src/introspect/size.rs index d2bd078eee..9c056897bf 100644 --- a/crates/dojo-lang/src/introspect/size.rs +++ b/crates/dojo-lang/src/introspect/size.rs @@ -7,7 +7,11 @@ use super::utils::{ get_tuple_item_types, is_array, is_byte_array, is_tuple, primitive_type_introspection, }; -pub fn compute_struct_layout_size(db: &dyn SyntaxGroup, struct_ast: &ItemStruct) -> String { +pub fn compute_struct_layout_size( + db: &dyn SyntaxGroup, + struct_ast: &ItemStruct, + is_packed: bool, +) -> String { let mut cumulated_sizes = 0; let mut is_dynamic_size = false; @@ -29,32 +33,61 @@ pub fn compute_struct_layout_size(db: &dyn SyntaxGroup, struct_ast: &ItemStruct) }) .flatten() .collect::>(); - build_size_function_body(&mut sizes, cumulated_sizes, is_dynamic_size) + build_size_function_body(&mut sizes, cumulated_sizes, is_dynamic_size, is_packed) } -pub fn compute_enum_layout_size( +pub fn compute_enum_variant_sizes( db: &dyn SyntaxGroup, enum_ast: &ItemEnum, - identical_variants: bool, +) -> Vec<(Vec, u32, bool)> { + enum_ast + .variants(db) + .elements(db) + .iter() + .map(|v| match v.type_clause(db) { + OptionTypeClause::Empty(_) => (vec![], 0, false), + OptionTypeClause::TypeClause(type_clause) => { + get_field_size_from_type_clause(db, &type_clause) + } + }) + .collect::>() +} + +pub fn is_enum_packable(variant_sizes: &[(Vec, u32, bool)]) -> bool { + if variant_sizes.is_empty() { + return true; + } + + let v0_sizes = variant_sizes[0].0.clone(); + let v0_fixed_size = variant_sizes[0].1; + + variant_sizes.iter().all(|vs| { + vs.0.len() == v0_sizes.len() + && vs.0.iter().zip(v0_sizes.iter()).all(|(a, b)| a == b) + && vs.1 == v0_fixed_size + && !vs.2 + }) +} + +pub fn compute_enum_layout_size( + variant_sizes: &[(Vec, u32, bool)], + is_packed: bool, ) -> String { + if variant_sizes.is_empty() { + return "Option::None".to_string(); + } + + let v0 = variant_sizes[0].clone(); + let identical_variants = + variant_sizes.iter().all(|vs| vs.0 == v0.0 && vs.1 == v0.1 && vs.2 == v0.2); + if identical_variants { - match enum_ast.variants(db).elements(db).first() { - Some(first_variant) => { - let (mut sizes, cumulated_sizes, is_dynamic_size) = - match first_variant.type_clause(db) { - OptionTypeClause::Empty(_) => (vec![], 0, false), - OptionTypeClause::TypeClause(type_clause) => { - get_field_size_from_type_clause(db, &type_clause) - } - }; - - // add 8 bits to store the variant identifier - sizes.insert(0, "8".to_string()); - - build_size_function_body(&mut sizes, cumulated_sizes, is_dynamic_size) - } - None => "Option::None".to_string(), - } + let (mut sizes, mut cumulated_sizes, is_dynamic_size) = v0; + + // add one felt252 to store the variant identifier + cumulated_sizes += 1; + + build_size_function_body(&mut sizes, cumulated_sizes, is_dynamic_size, is_packed) } else { "Option::None".to_string() } @@ -64,6 +97,7 @@ pub fn build_size_function_body( sizes: &mut Vec, cumulated_sizes: u32, is_dynamic_size: bool, + is_packed: bool, ) -> String { if is_dynamic_size { return "Option::None".to_string(); @@ -77,16 +111,22 @@ pub fn build_size_function_body( 0 => "Option::None".to_string(), 1 => sizes[0].clone(), _ => { + let none_check = if is_packed { + "" + } else { + "if dojo::database::utils::any_none(@sizes) { + return Option::None; + }" + }; + format!( "let sizes : Array> = array![ - {} - ]; - - if dojo::database::utils::any_none(@sizes) {{ - return Option::None; - }} - Option::Some(dojo::database::utils::sum(sizes)) - ", + {} + ]; + + {none_check} + Option::Some(dojo::database::utils::sum(sizes)) + ", sizes.join(",\n") ) } diff --git a/crates/dojo-lang/src/introspect/utils.rs b/crates/dojo-lang/src/introspect/utils.rs index 6494e9f0fe..bf7be9964c 100644 --- a/crates/dojo-lang/src/introspect/utils.rs +++ b/crates/dojo-lang/src/introspect/utils.rs @@ -1,9 +1,5 @@ use std::collections::HashMap; -use cairo_lang_syntax::node::ast::ItemEnum; -use cairo_lang_syntax::node::db::SyntaxGroup; -use cairo_lang_syntax::node::TypedSyntaxNode; - #[derive(Clone, Default)] pub struct TypeIntrospection(pub usize, pub Vec); @@ -94,16 +90,6 @@ pub fn get_tuple_item_types(ty: &str) -> Vec { items } -pub fn are_enum_variants_identical(db: &dyn SyntaxGroup, enum_ast: &ItemEnum) -> bool { - let variants = enum_ast - .variants(db) - .elements(db) - .iter() - .map(|v| v.as_syntax_node().get_text(db)) - .collect::>(); - variants.iter().all(|item| item == &variants[0]) -} - #[test] pub fn test_get_tuple_item_types() { pub fn assert_array(got: Vec, expected: Vec) { diff --git a/crates/dojo-lang/src/lib.rs b/crates/dojo-lang/src/lib.rs index b76ea602c8..4f7e0e4bca 100644 --- a/crates/dojo-lang/src/lib.rs +++ b/crates/dojo-lang/src/lib.rs @@ -13,6 +13,7 @@ pub mod model; pub mod plugin; pub mod print; pub mod semantics; +pub mod syntax; pub(crate) mod version; // Copy of non pub functions from scarb + extension. diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/Scarb.lock b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/Scarb.lock index 6f542bc33a..440bb61dbe 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/Scarb.lock +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/Scarb.lock @@ -10,7 +10,7 @@ dependencies = [ [[package]] name = "dojo" -version = "0.6.0" +version = "0.7.0" dependencies = [ "dojo_plugin", ] diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo_world_world.json b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo_world_world.json index d800e7d191..c1a2447839 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo_world_world.json +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo_world_world.json @@ -205,6 +205,10 @@ { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "init_calldata", + "type": "core::array::Span::" } ], "outputs": [ @@ -551,6 +555,10 @@ { "name": "program_output", "type": "dojo::interfaces::ProgramOutput" + }, + { + "name": "program_hash", + "type": "core::felt252" } ], "outputs": [], @@ -569,7 +577,7 @@ "items": [ { "type": "function", - "name": "set_program_hash", + "name": "set_differ_program_hash", "inputs": [ { "name": "program_hash", @@ -581,7 +589,30 @@ }, { "type": "function", - "name": "get_program_hash", + "name": "set_merger_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_differ_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_merger_program_hash", "inputs": [], "outputs": [ { @@ -827,7 +858,19 @@ }, { "type": "event", - "name": "dojo::config::component::Config::ProgramHashUpdate", + "name": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::MergerProgramHashUpdate", "kind": "struct", "members": [ { @@ -855,8 +898,13 @@ "kind": "enum", "variants": [ { - "name": "ProgramHashUpdate", - "type": "dojo::config::component::Config::ProgramHashUpdate", + "name": "DifferProgramHashUpdate", + "type": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "nested" + }, + { + "name": "MergerProgramHashUpdate", + "type": "dojo::config::component::Config::MergerProgramHashUpdate", "kind": "nested" }, { diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/compiler_cairo_cairo_24_cairo_v240.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/compiler_cairo_cairo_24_cairo_v240.toml index a62805594e..d253e1bd66 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/compiler_cairo_cairo_24_cairo_v240.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/compiler_cairo_cairo_24_cairo_v240.toml @@ -6,4 +6,5 @@ abi = "manifests/dev/abis/base/contracts/compiler_cairo_cairo_24_cairo_v240.json reads = [] writes = [] computed = [] +init_calldata = [] name = "compiler_cairo::cairo_24::cairo_v240" diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/compiler_cairo_cairo_26_cairo_v260.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/compiler_cairo_cairo_26_cairo_v260.toml index e4f5304c0d..4ac01d6fdb 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/compiler_cairo_cairo_26_cairo_v260.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/compiler_cairo_cairo_26_cairo_v260.toml @@ -6,4 +6,5 @@ abi = "manifests/dev/abis/base/contracts/compiler_cairo_cairo_26_cairo_v260.json reads = [] writes = [] computed = [] +init_calldata = [] name = "compiler_cairo::cairo_26::cairo_v260" diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml index 5a021e2793..2555ec3eda 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml @@ -1,5 +1,5 @@ kind = "Class" -class_hash = "0x64728e0c0713811c751930f8d3292d683c23f107c89b0a101425d9e80adb1c0" -original_class_hash = "0x64728e0c0713811c751930f8d3292d683c23f107c89b0a101425d9e80adb1c0" +class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" +original_class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" abi = "manifests/dev/abis/base/dojo_world_world.json" name = "dojo::world::world" diff --git a/crates/dojo-lang/src/plugin.rs b/crates/dojo-lang/src/plugin.rs index 0be64f4c6e..2da354fded 100644 --- a/crates/dojo-lang/src/plugin.rs +++ b/crates/dojo-lang/src/plugin.rs @@ -126,8 +126,6 @@ impl BuiltinDojoPlugin { ) -> PluginResult { PluginResult { code: None, - // All diagnostics are for now error. Severity may be moved as argument - // if warnings are required in this file. diagnostics: vec![PluginDiagnostic { stable_ptr, message, severity: Severity::Error }], remove_original_item: false, } @@ -514,9 +512,9 @@ impl MacroPlugin for BuiltinDojoPlugin { DOJO_INTERFACE_ATTR.to_string(), DOJO_CONTRACT_ATTR.to_string(), DOJO_EVENT_ATTR.to_string(), + DOJO_MODEL_ATTR.to_string(), "key".to_string(), "computed".to_string(), - DOJO_MODEL_ATTR.to_string(), ] } } diff --git a/crates/dojo-lang/src/plugin_test_data/introspect b/crates/dojo-lang/src/plugin_test_data/introspect index c10b97e019..3582f86aad 100644 --- a/crates/dojo-lang/src/plugin_test_data/introspect +++ b/crates/dojo-lang/src/plugin_test_data/introspect @@ -14,8 +14,8 @@ struct Vec2 { #[derive(Serde, Copy, Drop, Introspect)] enum PlainEnum { - Left: (), - Right: (), + Left, + Right, } #[derive(Serde, Copy, Drop, Introspect)] @@ -55,9 +55,9 @@ enum EnumWithComplexTuple { } #[derive(Serde, Copy, Drop, Introspect)] -enum EnumTupleOnePrimitive { - Left: (u16,), - Right: (u16,), +enum EnumWithPrimitive { + Left: u32, + Right: u32, } #[derive(Serde, Copy, Drop, Introspect)] @@ -220,7 +220,7 @@ struct StructNotPackable1 { } #[derive(IntrospectPacked)] -struct StructNotPackable2 { +struct StructPackableWithInnerPacked { x: u8, y: StructPacked1 } @@ -245,6 +245,13 @@ enum EnumPacked3 { b: u256, } + +#[derive(IntrospectPacked)] +enum EnumPackableWithInnerPacked { + a: StructPacked1, + b: StructPacked1, +} + #[derive(IntrospectPacked)] enum EnumNotPackable1 { a: u8, @@ -262,8 +269,8 @@ struct Vec2 { #[derive(Serde, Copy, Drop, Introspect)] enum PlainEnum { - Left: (), - Right: (), + Left, + Right, } #[derive(Serde, Copy, Drop, Introspect)] @@ -303,9 +310,9 @@ enum EnumWithComplexTuple { } #[derive(Serde, Copy, Drop, Introspect)] -enum EnumTupleOnePrimitive { - Left: (u16,), - Right: (u16,), +enum EnumWithPrimitive { + Left: u32, + Right: u32, } #[derive(Serde, Copy, Drop, Introspect)] @@ -468,7 +475,7 @@ struct StructNotPackable1 { } #[derive(IntrospectPacked)] -struct StructNotPackable2 { +struct StructPackableWithInnerPacked { x: u8, y: StructPacked1 } @@ -493,6 +500,13 @@ enum EnumPacked3 { b: u256, } + +#[derive(IntrospectPacked)] +enum EnumPackableWithInnerPacked { + a: StructPacked1, + b: StructPacked1, +} + #[derive(IntrospectPacked)] enum EnumNotPackable1 { a: u8, @@ -519,7 +533,6 @@ impl Vec2Introspect<> of dojo::database::introspect::Introspect> { Option::Some(2) } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -583,38 +596,19 @@ impl PlainEnumDrop of core::traits::Drop::; impl PlainEnumIntrospect<> of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { - Option::None + Option::Some(1) } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ dojo::database::introspect::FieldLayout { selector: 0, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Layout::Tuple( - array![ - - ].span() - ) - ].span() - ) + layout: dojo::database::introspect::Layout::Fixed(array![].span()) }, dojo::database::introspect::FieldLayout { selector: 1, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Layout::Tuple( - array![ - - ].span() - ) - ].span() - ) + layout: dojo::database::introspect::Layout::Fixed(array![].span()) } ].span() ) @@ -627,16 +621,8 @@ dojo::database::introspect::FieldLayout { name: 'PlainEnum', attrs: array![].span(), children: array![ - ('Left', dojo::database::introspect::Ty::Tuple( - array![ - - ].span() - )), -('Right', dojo::database::introspect::Ty::Tuple( - array![ - - ].span() - )) + ('Left', dojo::database::introspect::Ty::Tuple(array![].span())), +('Right', dojo::database::introspect::Ty::Tuple(array![].span())) ].span() } @@ -667,30 +653,19 @@ impl EnumWithPrimitiveDrop of core::traits::Drop::; impl EnumWithPrimitiveIntrospect<> of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { - Option::None + Option::Some(2) } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ dojo::database::introspect::FieldLayout { selector: 0, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Introspect::::layout() - ].span() - ) + layout: dojo::database::introspect::Introspect::::layout() }, dojo::database::introspect::FieldLayout { selector: 1, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Introspect::::layout() - ].span() - ) + layout: dojo::database::introspect::Introspect::::layout() } ].span() ) @@ -735,30 +710,28 @@ impl EnumWithStructDrop of core::traits::Drop::; impl EnumWithStructIntrospect<> of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { - Option::None + let sizes : Array> = array![ + dojo::database::introspect::Introspect::::size(), +Option::Some(1) + ]; + + if dojo::database::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::database::utils::sum(sizes)) + } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ dojo::database::introspect::FieldLayout { selector: 0, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Introspect::::layout() - ].span() - ) + layout: dojo::database::introspect::Introspect::::layout() }, dojo::database::introspect::FieldLayout { selector: 1, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Introspect::::layout() - ].span() - ) + layout: dojo::database::introspect::Introspect::::layout() } ].span() ) @@ -806,27 +779,16 @@ impl EnumWithSimpleArrayIntrospect<> of dojo::database::introspect::Introspect dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ dojo::database::introspect::FieldLayout { selector: 0, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Introspect::>::layout() - ].span() - ) + layout: dojo::database::introspect::Introspect::>::layout() }, dojo::database::introspect::FieldLayout { selector: 1, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Introspect::>::layout() - ].span() - ) + layout: dojo::database::introspect::Introspect::>::layout() } ].span() ) @@ -882,27 +844,16 @@ impl EnumWithByteArrayIntrospect<> of dojo::database::introspect::Introspect dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ dojo::database::introspect::FieldLayout { selector: 0, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Introspect::::layout() - ].span() - ) + layout: dojo::database::introspect::Introspect::::layout() }, dojo::database::introspect::FieldLayout { selector: 1, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Introspect::::layout() - ].span() - ) + layout: dojo::database::introspect::Introspect::::layout() } ].span() ) @@ -947,40 +898,29 @@ impl EnumWithSimpleTupleDrop of core::traits::Drop::; impl EnumWithSimpleTupleIntrospect<> of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { - Option::None + Option::Some(4) } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ dojo::database::introspect::FieldLayout { selector: 0, layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Layout::Tuple( array![ dojo::database::introspect::Introspect::::layout(), dojo::database::introspect::Introspect::::layout() ].span() ) - ].span() - ) }, dojo::database::introspect::FieldLayout { selector: 1, layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Layout::Tuple( array![ dojo::database::introspect::Introspect::::layout(), dojo::database::introspect::Introspect::::layout() ].span() ) - ].span() - ) } ].span() ) @@ -1035,40 +975,38 @@ impl EnumWithComplexTupleDrop of core::traits::Drop::; impl EnumWithComplexTupleIntrospect<> of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { - Option::None + let sizes : Array> = array![ + dojo::database::introspect::Introspect::::size(), +Option::Some(2) + ]; + + if dojo::database::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::database::utils::sum(sizes)) + } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ dojo::database::introspect::FieldLayout { selector: 0, layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Layout::Tuple( array![ dojo::database::introspect::Introspect::::layout(), dojo::database::introspect::Introspect::::layout() ].span() ) - ].span() - ) }, dojo::database::introspect::FieldLayout { selector: 1, layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Layout::Tuple( array![ dojo::database::introspect::Introspect::::layout(), dojo::database::introspect::Introspect::::layout() ].span() ) - ].span() - ) } ].span() ) @@ -1099,62 +1037,43 @@ dojo::database::introspect::Introspect::::ty() ) } } -impl EnumTupleOnePrimitiveSerde of core::serde::Serde:: { - fn serialize(self: @EnumTupleOnePrimitive, ref output: core::array::Array) { +impl EnumWithPrimitiveSerde of core::serde::Serde:: { + fn serialize(self: @EnumWithPrimitive, ref output: core::array::Array) { match self { - EnumTupleOnePrimitive::Left(x) => { core::serde::Serde::serialize(@0, ref output); core::serde::Serde::serialize(x, ref output); }, - EnumTupleOnePrimitive::Right(x) => { core::serde::Serde::serialize(@1, ref output); core::serde::Serde::serialize(x, ref output); }, + EnumWithPrimitive::Left(x) => { core::serde::Serde::serialize(@0, ref output); core::serde::Serde::serialize(x, ref output); }, + EnumWithPrimitive::Right(x) => { core::serde::Serde::serialize(@1, ref output); core::serde::Serde::serialize(x, ref output); }, } } - fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { let idx: felt252 = core::serde::Serde::deserialize(ref serialized)?; core::option::Option::Some( match idx { - 0 => EnumTupleOnePrimitive::Left(core::serde::Serde::deserialize(ref serialized)?), - 1 => EnumTupleOnePrimitive::Right(core::serde::Serde::deserialize(ref serialized)?), + 0 => EnumWithPrimitive::Left(core::serde::Serde::deserialize(ref serialized)?), + 1 => EnumWithPrimitive::Right(core::serde::Serde::deserialize(ref serialized)?), _ => { return core::option::Option::None; } } ) } } -impl EnumTupleOnePrimitiveCopy of core::traits::Copy::; -impl EnumTupleOnePrimitiveDrop of core::traits::Drop::; +impl EnumWithPrimitiveCopy of core::traits::Copy::; +impl EnumWithPrimitiveDrop of core::traits::Drop::; -impl EnumTupleOnePrimitiveIntrospect<> of dojo::database::introspect::Introspect> { +impl EnumWithPrimitiveIntrospect<> of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { - Option::None + Option::Some(2) } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ dojo::database::introspect::FieldLayout { selector: 0, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Introspect::::layout() - ].span() - ) - ].span() - ) + layout: dojo::database::introspect::Introspect::::layout() }, dojo::database::introspect::FieldLayout { selector: 1, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Introspect::::layout() - ].span() - ) - ].span() - ) + layout: dojo::database::introspect::Introspect::::layout() } ].span() ) @@ -1164,19 +1083,11 @@ dojo::database::introspect::FieldLayout { fn ty() -> dojo::database::introspect::Ty { dojo::database::introspect::Ty::Enum( dojo::database::introspect::Enum { - name: 'EnumTupleOnePrimitive', + name: 'EnumWithPrimitive', attrs: array![].span(), children: array![ - ('Left', dojo::database::introspect::Ty::Tuple( - array![ - dojo::database::introspect::Introspect::::ty() - ].span() - )), -('Right', dojo::database::introspect::Ty::Tuple( - array![ - dojo::database::introspect::Introspect::::ty() - ].span() - )) + ('Left', dojo::database::introspect::Introspect::::ty()), +('Right', dojo::database::introspect::Introspect::::ty()) ].span() } @@ -1207,30 +1118,28 @@ impl EnumCustomDrop of core::traits::Drop::; impl EnumCustomIntrospect<> of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { - Option::None + let sizes : Array> = array![ + dojo::database::introspect::Introspect::::size(), +Option::Some(1) + ]; + + if dojo::database::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::database::utils::sum(sizes)) + } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ dojo::database::introspect::FieldLayout { selector: 0, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Introspect::::layout() - ].span() - ) + layout: dojo::database::introspect::Introspect::::layout() }, dojo::database::introspect::FieldLayout { selector: 1, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Introspect::::layout() - ].span() - ) + layout: dojo::database::introspect::Introspect::::layout() } ].span() ) @@ -1275,42 +1184,41 @@ impl EnumTupleMixDrop of core::traits::Drop::; impl EnumTupleMixIntrospect<> of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { - Option::None + let sizes : Array> = array![ + dojo::database::introspect::Introspect::::size(), +dojo::database::introspect::Introspect::::size(), +Option::Some(2) + ]; + + if dojo::database::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::database::utils::sum(sizes)) + } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ dojo::database::introspect::FieldLayout { selector: 0, layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Layout::Tuple( array![ dojo::database::introspect::Introspect::::layout(), dojo::database::introspect::Introspect::::layout(), dojo::database::introspect::Introspect::::layout() ].span() ) - ].span() - ) }, dojo::database::introspect::FieldLayout { selector: 1, layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Layout::Tuple( array![ dojo::database::introspect::Introspect::::layout(), dojo::database::introspect::Introspect::::layout(), dojo::database::introspect::Introspect::::layout() ].span() ) - ].span() - ) } ].span() ) @@ -1372,41 +1280,25 @@ impl EnumWithDifferentVariantDataIntrospect<> of dojo::database::introspect::Int Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ dojo::database::introspect::FieldLayout { selector: 0, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - - ].span() - ) + layout: dojo::database::introspect::Layout::Fixed(array![].span()) }, dojo::database::introspect::FieldLayout { selector: 1, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Introspect::::layout() - ].span() - ) + layout: dojo::database::introspect::Introspect::::layout() }, dojo::database::introspect::FieldLayout { selector: 2, layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Layout::Tuple( array![ dojo::database::introspect::Introspect::::layout(), dojo::database::introspect::Introspect::::layout() ].span() ) - ].span() - ) } ].span() ) @@ -1442,7 +1334,6 @@ impl StructWithPrimitivesIntrospect<> of dojo::database::introspect::Introspect< Option::Some(2) } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1493,18 +1384,17 @@ impl StructWithStructIntrospect<> of dojo::database::introspect::Introspect Option { let sizes : Array> = array![ - dojo::database::introspect::Introspect::::size(), + dojo::database::introspect::Introspect::::size(), Option::Some(1) - ]; + ]; - if dojo::database::utils::any_none(@sizes) { - return Option::None; - } - Option::Some(dojo::database::utils::sum(sizes)) - + if dojo::database::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::database::utils::sum(sizes)) + } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1557,7 +1447,6 @@ impl StructWithSimpleArrayIntrospect<> of dojo::database::introspect::Introspect Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1614,7 +1503,6 @@ impl StructWithByteArrayIntrospect<> of dojo::database::introspect::Introspect dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1667,7 +1555,6 @@ impl StructWithComplexArrayIntrospect<> of dojo::database::introspect::Introspec Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1724,7 +1611,6 @@ impl StructWithSimpleTupleIntrospect<> of dojo::database::introspect::Introspect Option::Some(4) } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1785,19 +1671,18 @@ impl StructWithComplexTupleIntrospect<> of dojo::database::introspect::Introspec #[inline(always)] fn size() -> Option { let sizes : Array> = array![ - dojo::database::introspect::Introspect::::size(), + dojo::database::introspect::Introspect::::size(), dojo::database::introspect::Introspect::::size(), Option::Some(2) - ]; + ]; - if dojo::database::utils::any_none(@sizes) { - return Option::None; - } - Option::Some(dojo::database::utils::sum(sizes)) - + if dojo::database::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::database::utils::sum(sizes)) + } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1862,7 +1747,6 @@ impl StructWithNestedArraysIntrospect<> of dojo::database::introspect::Introspec Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1933,19 +1817,18 @@ impl StructWithNestedTuplesIntrospect<> of dojo::database::introspect::Introspec #[inline(always)] fn size() -> Option { let sizes : Array> = array![ - dojo::database::introspect::Introspect::::size(), + dojo::database::introspect::Introspect::::size(), dojo::database::introspect::Introspect::::size(), Option::Some(3) - ]; + ]; - if dojo::database::utils::any_none(@sizes) { - return Option::None; - } - Option::Some(dojo::database::utils::sum(sizes)) - + if dojo::database::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::database::utils::sum(sizes)) + } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -2028,7 +1911,6 @@ impl StructWithNestedTuplesAndByteArrayIntrospect<> of dojo::database::introspec Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -2111,7 +1993,6 @@ impl StructWithNestedEverythingIntrospect<> of dojo::database::introspect::Intro Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -2244,7 +2125,6 @@ impl GenericStructIntrospect::size() } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -2293,7 +2173,6 @@ impl StructWithBadOptionIntrospect<> of dojo::database::introspect::Introspect>::size() } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -2347,29 +2226,23 @@ impl EnumWithBadOptionIntrospect<> of dojo::database::introspect::Introspect Option { let sizes : Array> = array![ - 8, -dojo::database::introspect::Introspect::>::size() - ]; + dojo::database::introspect::Introspect::>::size(), +Option::Some(1) + ]; - if dojo::database::utils::any_none(@sizes) { - return Option::None; - } - Option::Some(dojo::database::utils::sum(sizes)) - + if dojo::database::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::database::utils::sum(sizes)) + } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ dojo::database::introspect::FieldLayout { selector: 0, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Introspect::>::layout() - ].span() - ) + layout: dojo::database::introspect::Introspect::>::layout() } ].span() ) @@ -2396,7 +2269,6 @@ impl EnumIncompatibleAttrsIntrospect<> of dojo::database::introspect::Introspect Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ @@ -2426,7 +2298,6 @@ impl EnumIncompatibleAttrsIntrospect<> of dojo::database::introspect::Introspect Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Fixed( array![ @@ -2456,7 +2327,6 @@ impl StructIncompatibleAttrsIntrospect<> of dojo::database::introspect::Introspe Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -2486,7 +2356,6 @@ impl StructIncompatibleAttrsIntrospect<> of dojo::database::introspect::Introspe Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Fixed( array![ @@ -2516,7 +2385,6 @@ impl StructIncompatibleAttrs2Introspect<> of dojo::database::introspect::Introsp Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -2546,7 +2414,6 @@ impl StructIncompatibleAttrs2Introspect<> of dojo::database::introspect::Introsp Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Fixed( array![ @@ -2576,7 +2443,6 @@ impl EnumIncompatibleAttrs2Introspect<> of dojo::database::introspect::Introspec Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ @@ -2606,7 +2472,6 @@ impl EnumIncompatibleAttrs2Introspect<> of dojo::database::introspect::Introspec Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Fixed( array![ @@ -2636,7 +2501,6 @@ impl StructPacked1Introspect<> of dojo::database::introspect::Introspect dojo::database::introspect::Layout { dojo::database::introspect::Layout::Fixed( array![ @@ -2670,7 +2534,6 @@ impl StructPacked2Introspect<> of dojo::database::introspect::Introspect dojo::database::introspect::Layout { dojo::database::introspect::Layout::Fixed( array![ @@ -2709,7 +2572,6 @@ impl StructPacked3Introspect<> of dojo::database::introspect::Introspect dojo::database::introspect::Layout { dojo::database::introspect::Layout::Fixed( array![ @@ -2753,7 +2615,6 @@ impl StructNotPackable1Introspect<> of dojo::database::introspect::Introspect dojo::database::introspect::Layout { dojo::database::introspect::Layout::Fixed( array![ @@ -2790,35 +2651,54 @@ dojo::database::introspect::Member { } } -impl StructNotPackable2Introspect<> of dojo::database::introspect::Introspect> { +impl StructPackableWithInnerPackedIntrospect<> of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { let sizes : Array> = array![ - dojo::database::introspect::Introspect::::size(), + dojo::database::introspect::Introspect::::size(), Option::Some(1) - ]; + ]; - if dojo::database::utils::any_none(@sizes) { - return Option::None; - } - Option::Some(dojo::database::utils::sum(sizes)) - + + Option::Some(dojo::database::utils::sum(sizes)) + } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { - dojo::database::introspect::Layout::Fixed( - array![ - 8,ERROR - ].span() - ) + let mut layouts = array![ + dojo::database::introspect::Layout::Fixed(array![8].span()), +dojo::database::introspect::Introspect::::layout() + ]; + let mut merged_layout = ArrayTrait::::new(); + + loop { + match ArrayTrait::pop_front(ref layouts) { + Option::Some(mut layout) => { + match layout { + dojo::database::introspect::Layout::Fixed(mut l) => { + loop { + match SpanTrait::pop_front(ref l) { + Option::Some(x) => merged_layout.append(*x), + Option::None(_) => { break; } + }; + }; + }, + _ => panic!("A packed model layout must contain Fixed layouts only."), + }; + }, + Option::None(_) => { break; } + }; + }; + + dojo::database::introspect::Layout::Fixed(merged_layout.span()) + } #[inline(always)] fn ty() -> dojo::database::introspect::Ty { dojo::database::introspect::Ty::Struct( dojo::database::introspect::Struct { - name: 'StructNotPackable2', + name: 'StructPackableWithInnerPacked', attrs: array![].span(), children: array![ dojo::database::introspect::Member { @@ -2841,12 +2721,15 @@ dojo::database::introspect::Member { impl EnumPacked1Introspect<> of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { - Option::None + Option::Some(1) } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { - ERROR + dojo::database::introspect::Layout::Fixed( + array![ + 8 + ].span() + ) } #[inline(always)] @@ -2869,12 +2752,15 @@ impl EnumPacked1Introspect<> of dojo::database::introspect::Introspect of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { - Option::None + Option::Some(2) } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { - ERROR + dojo::database::introspect::Layout::Fixed( + array![ + 8,8 + ].span() + ) } #[inline(always)] @@ -2897,12 +2783,15 @@ impl EnumPacked2Introspect<> of dojo::database::introspect::Introspect of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { - Option::None + Option::Some(3) } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { - ERROR + dojo::database::introspect::Layout::Fixed( + array![ + 8,128,128 + ].span() + ) } #[inline(always)] @@ -2926,13 +2815,71 @@ dojo::database::introspect::Introspect::::ty() } } +impl EnumPackableWithInnerPackedIntrospect<> of dojo::database::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + let sizes : Array> = array![ + dojo::database::introspect::Introspect::::size(), +Option::Some(1) + ]; + + + Option::Some(dojo::database::utils::sum(sizes)) + + } + + fn layout() -> dojo::database::introspect::Layout { + let mut layouts = array![ + dojo::database::introspect::Layout::Fixed(array![8].span()), +dojo::database::introspect::Introspect::::layout() + ]; + let mut merged_layout = ArrayTrait::::new(); + + loop { + match ArrayTrait::pop_front(ref layouts) { + Option::Some(mut layout) => { + match layout { + dojo::database::introspect::Layout::Fixed(mut l) => { + loop { + match SpanTrait::pop_front(ref l) { + Option::Some(x) => merged_layout.append(*x), + Option::None(_) => { break; } + }; + }; + }, + _ => panic!("A packed model layout must contain Fixed layouts only."), + }; + }, + Option::None(_) => { break; } + }; + }; + + dojo::database::introspect::Layout::Fixed(merged_layout.span()) + + } + + #[inline(always)] + fn ty() -> dojo::database::introspect::Ty { + dojo::database::introspect::Ty::Enum( + dojo::database::introspect::Enum { + name: 'EnumPackableWithInnerPacked', + attrs: array![].span(), + children: array![ + ('a', dojo::database::introspect::Introspect::::ty()), +('b', dojo::database::introspect::Introspect::::ty()) + + ].span() + } + ) + } +} + impl EnumNotPackable1Introspect<> of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { ERROR } @@ -2989,27 +2936,7 @@ error: Array field cannot be packed. y: Array ^**********^ -error: For now, field with custom type cannot be packed - --> test_src/lib.cairo:219:6 - y: StructPacked1 - ^*************^ - -error: To be packed, all variants must have exactly the same layout. - --> test_src/lib.cairo:223:6 -enum EnumPacked1 { - ^*********^ - -error: To be packed, all variants must have exactly the same layout. - --> test_src/lib.cairo:230:6 -enum EnumPacked2 { - ^*********^ - -error: To be packed, all variants must have exactly the same layout. - --> test_src/lib.cairo:237:6 -enum EnumPacked3 { - ^*********^ - -error: To be packed, all variants must have exactly the same layout. - --> test_src/lib.cairo:243:6 +error: To be packed, all variants must have fixed layout of same size. + --> test_src/lib.cairo:250:6 enum EnumNotPackable1 { ^**************^ diff --git a/crates/dojo-lang/src/plugin_test_data/model b/crates/dojo-lang/src/plugin_test_data/model index f644db0710..092bee2438 100644 --- a/crates/dojo-lang/src/plugin_test_data/model +++ b/crates/dojo-lang/src/plugin_test_data/model @@ -277,7 +277,6 @@ impl BadModelMultipleAttrIntrospect<> of dojo::database::introspect::Introspect< dojo::database::introspect::Introspect::::size() } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -319,7 +318,6 @@ impl BadModelMultipleVersionsIntrospect<> of dojo::database::introspect::Introsp dojo::database::introspect::Introspect::::size() } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -496,7 +494,6 @@ impl BadModelBadVersionTypeIntrospect<> of dojo::database::introspect::Introspec dojo::database::introspect::Introspect::::size() } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -673,7 +670,6 @@ impl BadModelNoVersionValueIntrospect<> of dojo::database::introspect::Introspec dojo::database::introspect::Introspect::::size() } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -850,7 +846,6 @@ impl BadModelUnexpectedArgWithValueIntrospect<> of dojo::database::introspect::I dojo::database::introspect::Introspect::::size() } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1027,7 +1022,6 @@ impl BadModelUnexpectedArgIntrospect<> of dojo::database::introspect::Introspect dojo::database::introspect::Introspect::::size() } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1204,7 +1198,6 @@ impl BadModelNotSupportedVersionIntrospect<> of dojo::database::introspect::Intr dojo::database::introspect::Introspect::::size() } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1381,7 +1374,6 @@ impl Modelv0Introspect<> of dojo::database::introspect::Introspect> { dojo::database::introspect::Introspect::::size() } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1558,7 +1550,6 @@ impl PositionIntrospect<> of dojo::database::introspect::Introspect> dojo::database::introspect::Introspect::::size() } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1735,7 +1726,6 @@ impl RolesIntrospect<> of dojo::database::introspect::Introspect> { Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1912,7 +1902,6 @@ impl OnlyKeyModelIntrospect<> of dojo::database::introspect::Introspect dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -2081,7 +2070,6 @@ impl U256KeyModelIntrospect<> of dojo::database::introspect::Introspect dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -2250,7 +2238,6 @@ impl PlayerIntrospect<> of dojo::database::introspect::Introspect> { Option::Some(1) } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -2432,7 +2419,6 @@ impl ModelWithSimpleArrayIntrospect<> of dojo::database::introspect::Introspect< Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -2623,7 +2609,6 @@ impl ModelWithByteArrayIntrospect<> of dojo::database::introspect::Introspect dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -2810,7 +2795,6 @@ impl ModelWithComplexArrayIntrospect<> of dojo::database::introspect::Introspect Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -3001,7 +2985,6 @@ impl ModelWithTupleIntrospect<> of dojo::database::introspect::Introspect dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -3197,18 +3180,17 @@ impl ModelWithTupleNoPrimitivesIntrospect<> of dojo::database::introspect::Intro #[inline(always)] fn size() -> Option { let sizes : Array> = array![ - dojo::database::introspect::Introspect::::size(), + dojo::database::introspect::Introspect::::size(), Option::Some(3) - ]; + ]; - if dojo::database::utils::any_none(@sizes) { - return Option::None; - } - Option::Some(dojo::database::utils::sum(sizes)) - + if dojo::database::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::database::utils::sum(sizes)) + } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ diff --git a/crates/dojo-lang/src/plugin_test_data/system b/crates/dojo-lang/src/plugin_test_data/system index 7b55dc83b5..1cc4ec33cc 100644 --- a/crates/dojo-lang/src/plugin_test_data/system +++ b/crates/dojo-lang/src/plugin_test_data/system @@ -85,81 +85,80 @@ trait IEmptyTrait; trait IFaultyTrait { const ONE: u8; - fn do_ref_self(ref self: TContractState); - #[my_attr] fn do_with_attrs(p1: u8) -> u16; } -#[starknet::interface] -trait IAllowedRefSelf { - fn spawn(ref self: T); -} - -#[dojo::contract(allow_ref_self)] -mod ContractAllowedRefSelf { - #[abi(embed_v0)] - impl AllowedImpl of IAllowedRefSelf { - fn spawn(ref self: ContractState) {} - } -} - #[dojo::interface] trait INominalTrait { - fn do_no_param(); - fn do_no_param_but_self(self: @TContractState); - fn do_params(p1: dojo_examples::models::Direction, p2: u8); - fn do_params_and_self(self: @TContractState, p2: u8); - fn do_return_value(p1: u8) -> u16; + fn do_no_param() -> felt252; + fn do_no_param_but_world(world: @IWorldDispatcher) -> felt252; + fn do_no_param_but_world_ref(ref world: IWorldDispatcher) -> felt252; + fn do_params_no_world(p1: felt252, p2: u8) -> felt252; + fn do_params_and_world(world: @IWorldDispatcher, p2: u8) -> felt252; + fn do_params_and_world_ref(ref world: IWorldDispatcher, p2: u8) -> felt252; + + fn do_with_self(self: @ContractState) -> felt252; + fn do_with_ref_self(ref self: ContractState) -> felt252; } #[dojo::interface] -trait IWorldTrait { - fn do_with_ref_self(ref self: ContractState) -> felt252; - fn do_with_several_world_dispatchers( - world: IWorldDispatcher, vec: Vec2, another_world: IWorldDispatcher +trait IFaultyTrait { + fn do_with_self_and_world(self: @ContractState, world: @IWorldDispatcher) -> felt252; + fn do_with_ref_self_and_world(ref self: ContractState, ref world: IWorldDispatcher) -> felt252; + fn do_with_self_and_world_inv(world: @IWorldDispatcher, self: @ContractState) -> felt252; + fn do_with_ref_self_and_world_inv( + ref world: IWorldDispatcher, ref self: ContractState ) -> felt252; - fn do_with_world_not_named_world(another_world: IWorldDispatcher) -> felt252; - fn do_with_self_and_world_not_named_world( - self: @ContractState, another_world: IWorldDispatcher - ); - fn do_with_world_not_first(vec: Vec2, world: IWorldDispatcher) -> felt252; - fn do_with_self_and_world_not_first( - self: @ContractState, vec: Vec2, world: IWorldDispatcher + fn do_with_several_world_dispatchers( + world: @IWorldDispatcher, vec: Vec2, ref another_world: IWorldDispatcher ) -> felt252; + fn do_with_world_not_named_world(another_world: @IWorldDispatcher) -> felt252; + fn do_with_world_not_first(vec: Vec2, ref world: IWorldDispatcher) -> felt252; } #[dojo::contract] mod MyFaultyContract { #[abi(embed_v0)] - impl TestWorldImpl of IWorldTrait { - fn do_with_ref_self(ref self: ContractState) -> felt252 { + impl TestFaultyImpl of IFaultyTrait { + fn do_with_self_and_world(self: @ContractState, world: @IWorldDispatcher) -> felt252 { 'land' } - fn do_with_several_world_dispatchers( - world: IWorldDispatcher, vec: Vec2, another_world: IWorldDispatcher + fn do_with_ref_self_and_world( + ref self: ContractState, ref world: IWorldDispatcher ) -> felt252 { 'land' } - fn do_with_world_not_named_world(another_world: IWorldDispatcher) -> felt252 { + fn do_with_self_and_world_inv(world: @IWorldDispatcher, self: @ContractState) -> felt252 { 'land' } - fn do_with_self_and_world_not_named_world( - self: @ContractState, another_world: IWorldDispatcher + fn do_with_ref_self_and_world_inv( + ref world: IWorldDispatcher, ref self: ContractState ) -> felt252 { 'land' } - fn do_with_world_not_first(vec: Vec2, world: IWorldDispatcher) -> felt252 { + fn do_with_several_world_dispatchers( + world: @IWorldDispatcher, vec: Vec2, ref another_world: IWorldDispatcher + ) -> felt252 { 'land' } - fn do_with_self_and_world_not_first( - self: @ContractState, vec: Vec2, world: IWorldDispatcher - ) -> felt252 { + fn do_with_world_not_named_world(another_world: @IWorldDispatcher) -> felt252 { + 'land' + } + + fn do_with_world_not_first(vec: Vec2, ref world: IWorldDispatcher) -> felt252 { + 'land' + } + } + + #[generate_trait] + impl InternalImplBad of InternalUtils { + fn bad_func_using_generate(world: @IWorldDispatcher) -> felt252 { 'land' } } @@ -173,22 +172,36 @@ mod MyNominalContract { } #[abi(embed_v0)] - impl TestWorldImpl of IWorldTrait { - fn do(vec: Vec2) -> felt252 { + impl TestNominalImpl of INominalTrait { + fn do_no_param() -> felt252 { 'land' } - fn do_with_self(self: @ContractState, vec: Vec2) -> felt252 { + fn do_no_param_but_world(world: @IWorldDispatcher) -> felt252 { 'land' } - fn do_with_world_first(world: IWorldDispatcher, vec: Vec2) -> felt252 { + fn do_no_param_but_world_ref(ref world: IWorldDispatcher) -> felt252 { 'land' } - fn do_with_self_and_world_first( - self: @ContractState, world: IWorldDispatcher, vec: Vec2 - ) -> felt252 { + fn do_params_no_world(p1: felt252, p2: u8) -> felt252 { + 'land' + } + + fn do_params_and_world(world: @IWorldDispatcher, p2: u8) -> felt252 { + 'land' + } + + fn do_params_and_world_ref(ref world: IWorldDispatcher, p2: u8) -> felt252 { + 'land' + } + + fn do_with_self(self: @ContractState) -> felt252 { + 'land' + } + + fn do_with_ref_self(ref self: ContractState) -> felt252 { 'land' } } @@ -202,6 +215,26 @@ mod MyNominalContract { } } +#[dojo::contract] +mod init_test { + fn dojo_init( + world: IWorldDispatcher, + actions_address: ContractAddress, + actions_class: ClassHash, + value: u8 + ) { + emit!( + world, + ContractInitialized { + contract_address: actions_address, contract_class: actions_class, value + } + ); + } +} + +#[dojo::contract] +mod no_init_test {} + //! > generated_cairo_code #[starknet::contract] mod spawn { @@ -327,40 +360,65 @@ error: Anything other than functions is not supported in a dojo::interface const ONE: u8; ^************^ -error: Functions of dojo::interface cannot have `ref self` parameter. - --> test_src/lib.cairo:82:5 - fn do_ref_self(ref self: TContractState); - ^***************************************^ - -error: Functions of dojo::contract cannot have 'ref self' parameter. - --> test_src/lib.cairo:130:9 - fn do_with_ref_self(ref self: ContractState) -> felt252 { - ^*******************************************************^ - -error: Only one parameter of type IWorldDispatcher is allowed. - --> test_src/lib.cairo:134:9 - fn do_with_several_world_dispatchers( - ^***********************************^ - -error: The IWorldDispatcher parameter must be named 'world'. - --> test_src/lib.cairo:140:42 - fn do_with_world_not_named_world(another_world: IWorldDispatcher) -> felt252 { - ^*****************************^ - -error: The IWorldDispatcher parameter must be named 'world'. - --> test_src/lib.cairo:145:35 - self: @ContractState, another_world: IWorldDispatcher - ^*****************************^ +error: World parameter must be the first parameter. + --> test_src/lib.cairo:101:5 + fn do_with_self_and_world(self: @ContractState, world: @IWorldDispatcher) -> felt252; + ^***********************************************************************************^ -error: The IWorldDispatcher parameter must be the first parameter of the function (self excluded). - --> test_src/lib.cairo:150:47 - fn do_with_world_not_first(vec: Vec2, world: IWorldDispatcher) -> felt252 { - ^*********************^ +error: World parameter must be the first parameter. + --> test_src/lib.cairo:102:5 + fn do_with_ref_self_and_world(ref self: ContractState, ref world: IWorldDispatcher) -> felt252; + ^*********************************************************************************************^ -error: The IWorldDispatcher parameter must be the first parameter of the function (self excluded). - --> test_src/lib.cairo:155:46 - self: @ContractState, vec: Vec2, world: IWorldDispatcher - ^*********************^ +error: You cannot use `self` and `world` parameters together. + --> test_src/lib.cairo:103:5 + fn do_with_self_and_world_inv(world: @IWorldDispatcher, self: @ContractState) -> felt252; + ^***************************************************************************************^ + +error: You cannot use `self` and `world` parameters together. + --> test_src/lib.cairo:104:5 + fn do_with_ref_self_and_world_inv( + ^********************************^ + +error: World parameter must be the first parameter. + --> test_src/lib.cairo:111:5 + fn do_with_world_not_first(vec: Vec2, ref world: IWorldDispatcher) -> felt252; + ^****************************************************************************^ + +error: World parameter must be the first parameter. + --> test_src/lib.cairo:118:9 + fn do_with_self_and_world(self: @ContractState, world: @IWorldDispatcher) -> felt252 { + ^************************************************************************************^ + +error: World parameter must be the first parameter. + --> test_src/lib.cairo:122:9 + fn do_with_ref_self_and_world( + ^****************************^ + +error: You cannot use `self` and `world` parameters together. + --> test_src/lib.cairo:128:9 + fn do_with_self_and_world_inv(world: @IWorldDispatcher, self: @ContractState) -> felt252 { + ^****************************************************************************************^ + +error: You cannot use `self` and `world` parameters together. + --> test_src/lib.cairo:132:9 + fn do_with_ref_self_and_world_inv( + ^********************************^ + +error: World parameter must be the first parameter. + --> test_src/lib.cairo:148:9 + fn do_with_world_not_first(vec: Vec2, ref world: IWorldDispatcher) -> felt252 { + ^*****************************************************************************^ + +error: You cannot use `world` and `#[generate_trait]` together. Use `self` instead. + --> test_src/lib.cairo:155:9 + fn bad_func_using_generate(world: @IWorldDispatcher) -> felt252 { + ^***************************************************************^ + +error: World parameter must be a snapshot if `ref` is not used. + --> test_src/lib.cairo:214:5 + fn dojo_init( + ^***********^ error: Unsupported attribute. --> test_src/lib.cairo:1:1 @@ -388,22 +446,27 @@ error: Unsupported attribute. ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:84:5 + --> test_src/lib.cairo:82:5 #[my_attr] ^********^ error: Unsupported attribute. - --> test_src/lib.cairo:93:1 -#[dojo::contract(allow_ref_self)] -^*******************************^ + --> test_src/lib.cairo:114:1 +#[dojo::contract] +^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:126:1 + --> test_src/lib.cairo:161:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:162:1 + --> test_src/lib.cairo:212:1 +#[dojo::contract] +^***************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:229:1 #[dojo::contract] ^***************^ @@ -452,6 +515,11 @@ error: Unsupported attribute. #[dojo::contract] ^***************^ +error: Unsupported attribute. + --> test_src/lib.cairo:1:1 +#[dojo::contract] +^***************^ + error: Unknown inline item macro: 'component'. --> test_src/lib.cairo:11:1 #[dojo::contract] @@ -487,6 +555,11 @@ error: Unsupported attribute. #[dojo::contract] ^***************^ +error: Unsupported attribute. + --> test_src/lib.cairo:11:1 +#[dojo::contract] +^***************^ + error: Unknown inline item macro: 'component'. --> test_src/lib.cairo:18:1 #[dojo::contract] @@ -522,6 +595,11 @@ error: Unsupported attribute. #[dojo::contract] ^***************^ +error: Unsupported attribute. + --> test_src/lib.cairo:18:1 +#[dojo::contract] +^***************^ + error: Unknown inline item macro: 'component'. --> test_src/lib.cairo:28:1 #[dojo::contract] @@ -557,6 +635,11 @@ error: Unsupported attribute. #[dojo::contract] ^***************^ +error: Unsupported attribute. + --> test_src/lib.cairo:28:1 +#[dojo::contract] +^***************^ + error: Unknown inline item macro: 'component'. --> test_src/lib.cairo:54:1 #[dojo::contract] @@ -617,123 +700,183 @@ error: Unsupported attribute. #[dojo::contract] ^***************^ +error: Unsupported attribute. + --> test_src/lib.cairo:54:1 +#[dojo::contract] +^***************^ + error: Unknown inline item macro: 'component'. - --> test_src/lib.cairo:93:1 -#[dojo::contract(allow_ref_self)] -^*******************************^ + --> test_src/lib.cairo:114:1 +#[dojo::contract] +^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:93:1 -#[dojo::contract(allow_ref_self)] -^*******************************^ + --> test_src/lib.cairo:114:1 +#[dojo::contract] +^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:93:1 -#[dojo::contract(allow_ref_self)] -^*******************************^ + --> test_src/lib.cairo:114:1 +#[dojo::contract] +^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:93:1 -#[dojo::contract(allow_ref_self)] -^*******************************^ + --> test_src/lib.cairo:114:1 +#[dojo::contract] +^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:95:5 + --> test_src/lib.cairo:116:5 #[abi(embed_v0)] ^**************^ +error: Generated trait must have generic args matching the impl's generic params. + --> test_src/lib.cairo:154:29 + impl InternalImplBad of InternalUtils { + ^**************************^ + error: Unsupported attribute. - --> test_src/lib.cairo:93:1 -#[dojo::contract(allow_ref_self)] -^*******************************^ + --> test_src/lib.cairo:114:1 +#[dojo::contract] +^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:93:1 -#[dojo::contract(allow_ref_self)] -^*******************************^ + --> test_src/lib.cairo:114:1 +#[dojo::contract] +^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:93:1 -#[dojo::contract(allow_ref_self)] -^*******************************^ + --> test_src/lib.cairo:114:1 +#[dojo::contract] +^***************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:114:1 +#[dojo::contract] +^***************^ error: Unknown inline item macro: 'component'. - --> test_src/lib.cairo:126:1 + --> test_src/lib.cairo:161:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:126:1 + --> test_src/lib.cairo:161:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:126:1 + --> test_src/lib.cairo:161:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:126:1 + --> test_src/lib.cairo:161:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:128:5 + --> test_src/lib.cairo:168:5 #[abi(embed_v0)] ^**************^ error: Unsupported attribute. - --> test_src/lib.cairo:126:1 + --> test_src/lib.cairo:161:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:126:1 + --> test_src/lib.cairo:161:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:126:1 + --> test_src/lib.cairo:161:1 +#[dojo::contract] +^***************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:161:1 #[dojo::contract] ^***************^ error: Unknown inline item macro: 'component'. - --> test_src/lib.cairo:162:1 + --> test_src/lib.cairo:212:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:162:1 + --> test_src/lib.cairo:212:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:162:1 + --> test_src/lib.cairo:212:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:162:1 + --> test_src/lib.cairo:212:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:169:5 - #[abi(embed_v0)] - ^**************^ + --> test_src/lib.cairo:212:1 +#[dojo::contract] +^***************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:212:1 +#[dojo::contract] +^***************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:212:1 +#[dojo::contract] +^***************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:212:1 +#[dojo::contract] +^***************^ + +error: Unknown inline item macro: 'component'. + --> test_src/lib.cairo:229:1 +#[dojo::contract] +^***************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:229:1 +#[dojo::contract] +^***************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:229:1 +#[dojo::contract] +^***************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:229:1 +#[dojo::contract] +^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:162:1 + --> test_src/lib.cairo:229:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:162:1 + --> test_src/lib.cairo:229:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:162:1 + --> test_src/lib.cairo:229:1 +#[dojo::contract] +^***************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:229:1 #[dojo::contract] ^***************^ @@ -751,11 +894,6 @@ mod testcomponent2 { struct Storage {} } -#[starknet::interface] -trait IAllowedRefSelf { - fn spawn(ref self: T); -} - #[starknet::contract] mod spawn { use dojo::world; @@ -788,6 +926,18 @@ trait IAllowedRefSelf { return (); } + #[starknet::interface] + trait IDojoInit { + fn dojo_init(self: @ContractState); + } + + #[abi(embed_v0)] + impl IDojoInitImpl of IDojoInit { + fn dojo_init(self: @ContractState) { + assert(starknet::get_caller_address() == self.world().contract_address, 'Only world can init'); + } + } + #[event] #[derive(Drop, starknet::Event)] enum Event { @@ -833,6 +983,18 @@ impl EventDrop of core::traits::Drop::; value } + #[starknet::interface] + trait IDojoInit { + fn dojo_init(self: @ContractState); + } + + #[abi(embed_v0)] + impl IDojoInitImpl of IDojoInit { + fn dojo_init(self: @ContractState) { + assert(starknet::get_caller_address() == self.world().contract_address, 'Only world can init'); + } + } + #[event] #[derive(Drop, starknet::Event)] enum Event { @@ -881,6 +1043,18 @@ impl EventDrop of core::traits::Drop::; return (); } + #[starknet::interface] + trait IDojoInit { + fn dojo_init(self: @ContractState); + } + + #[abi(embed_v0)] + impl IDojoInitImpl of IDojoInit { + fn dojo_init(self: @ContractState) { + assert(starknet::get_caller_address() == self.world().contract_address, 'Only world can init'); + } + } + #[event] #[derive(Drop, starknet::Event)] enum Event { @@ -935,6 +1109,18 @@ impl EventDrop of core::traits::Drop::; address: ContractAddress, } + #[starknet::interface] + trait IDojoInit { + fn dojo_init(self: @ContractState); + } + + #[abi(embed_v0)] + impl IDojoInitImpl of IDojoInit { + fn dojo_init(self: @ContractState) { + assert(starknet::get_caller_address() == self.world().contract_address, 'Only world can init'); + } + } + #[storage] struct Storage { world_dispatcher: IWorldDispatcher, @@ -990,8 +1176,20 @@ impl TestEventDrop of core::traits::Drop::; testcomponent1_event: testcomponent1::Event, testcomponent2_event: testcomponent2::Event } -impl EventDrop of core::traits::Drop::; + #[starknet::interface] + trait IDojoInit { + fn dojo_init(self: @ContractState); + } + + #[abi(embed_v0)] + impl IDojoInitImpl of IDojoInit { + fn dojo_init(self: @ContractState) { + assert(starknet::get_caller_address() == self.world().contract_address, 'Only world can init'); + } + } +impl EventDrop of core::traits::Drop::; + } #[starknet::interface] @@ -1000,83 +1198,38 @@ impl EventDrop of core::traits::Drop::; #[starknet::interface] trait IFaultyTrait { - fn do_ref_self(ref self: TContractState); - #[my_attr] fn do_with_attrs(self: @TContractState, p1: u8) -> u16; } - #[starknet::contract] - mod ContractAllowedRefSelf { - use dojo::world; - use dojo::world::IWorldDispatcher; - use dojo::world::IWorldDispatcherTrait; - use dojo::world::IWorldProvider; - use dojo::world::IDojoResourceProvider; - - #[abi(embed_v0)] - impl DojoResourceProviderImpl of IDojoResourceProvider { - fn dojo_resource(self: @ContractState) -> felt252 { - 'ContractAllowedRefSelf' - } - } - - #[abi(embed_v0)] - impl WorldProviderImpl of IWorldProvider { - fn world(self: @ContractState) -> IWorldDispatcher { - self.world_dispatcher.read() - } - } - - #[abi(embed_v0)] - impl UpgradableImpl = dojo::components::upgradeable::upgradeable::UpgradableImpl; - - #[abi(embed_v0)] - impl AllowedImpl of IAllowedRefSelf { - fn spawn(ref self: ContractState) {} - } - - #[event] - #[derive(Drop, starknet::Event)] - enum Event { - UpgradeableEvent: dojo::components::upgradeable::upgradeable::Event, - } - - #[storage] - struct Storage { - world_dispatcher: IWorldDispatcher, - #[substorage(v0)] - upgradeable: dojo::components::upgradeable::upgradeable::Storage, - } -impl EventDrop of core::traits::Drop::; - - } - #[starknet::interface] trait INominalTrait { - fn do_no_param(self: @TContractState); - fn do_no_param_but_self(self: @TContractState); - fn do_params(self: @TContractState, p1: dojo_examples::models::Direction, p2: u8); - fn do_params_and_self(self: @TContractState, p2: u8); - fn do_return_value(self: @TContractState, p1: u8) -> u16; + fn do_no_param(self: @TContractState) -> felt252; + fn do_no_param_but_world(self: @TContractState) -> felt252; + fn do_no_param_but_world_ref(ref self: TContractState) -> felt252; + fn do_params_no_world(self: @TContractState, p1: felt252, p2: u8) -> felt252; + fn do_params_and_world(self: @TContractState, p2: u8) -> felt252; + fn do_params_and_world_ref(ref self: TContractState, p2: u8) -> felt252; + + fn do_with_self(self: @ContractState) -> felt252; + fn do_with_ref_self(ref self: ContractState) -> felt252; } #[starknet::interface] - trait IWorldTrait { - fn do_with_ref_self(self: @TContractState, ref self: ContractState) -> felt252; - fn do_with_several_world_dispatchers( -self: @TContractState, world: IWorldDispatcher, vec: Vec2, another_world: IWorldDispatcher + trait IFaultyTrait { + fn do_with_self_and_world(self: @ContractState, world: @IWorldDispatcher) -> felt252; + fn do_with_ref_self_and_world(ref self: ContractState, ref world: IWorldDispatcher) -> felt252; + fn do_with_self_and_world_inv(self: @TContractState, self: @ContractState) -> felt252; + fn do_with_ref_self_and_world_inv( +ref self: TContractState, ref self: ContractState ) -> felt252; - fn do_with_world_not_named_world(self: @TContractState, another_world: IWorldDispatcher) -> felt252; - fn do_with_self_and_world_not_named_world( -self: @TContractState, self: @ContractState, another_world: IWorldDispatcher - ); - fn do_with_world_not_first(self: @TContractState, vec: Vec2, world: IWorldDispatcher) -> felt252; - fn do_with_self_and_world_not_first( -self: @TContractState, self: @ContractState, vec: Vec2, world: IWorldDispatcher + fn do_with_several_world_dispatchers( +self: @TContractState, vec: Vec2, ref another_world: IWorldDispatcher ) -> felt252; + fn do_with_world_not_named_world(self: @TContractState, another_world: @IWorldDispatcher) -> felt252; + fn do_with_world_not_first(self: @TContractState, vec: Vec2, ref world: IWorldDispatcher) -> felt252; } @@ -1106,38 +1259,64 @@ self: @TContractState, self: @ContractState, vec: Vec2, world: IWorldDis impl UpgradableImpl = dojo::components::upgradeable::upgradeable::UpgradableImpl; #[abi(embed_v0)] - impl TestWorldImpl of IWorldTrait { - fn do_with_ref_self(ref self: ContractState) -> felt252 { + impl TestFaultyImpl of IFaultyTrait { + fn do_with_self_and_world(self: @ContractState) -> felt252 { 'land' } - fn do_with_several_world_dispatchers( -self: @ContractState, world: IWorldDispatcher, vec: Vec2, another_world: IWorldDispatcher - ) -> felt252 { + fn do_with_ref_self_and_world( + ref self: ContractState ) -> felt252 { + 'land' + } + + fn do_with_self_and_world_inv(self: @ContractState, self: @ContractState) -> felt252 { +let world = self.world_dispatcher.read(); 'land' } - fn do_with_world_not_named_world(self: @ContractState, another_world: IWorldDispatcher) -> felt252 { + fn do_with_ref_self_and_world_inv( +ref self: ContractState, ref self: ContractState + ) -> felt252 { +let world = self.world_dispatcher.read(); 'land' } - fn do_with_self_and_world_not_named_world( - self: @ContractState, another_world: IWorldDispatcher + fn do_with_several_world_dispatchers( +self: @ContractState, vec: Vec2, ref another_world: IWorldDispatcher ) -> felt252 { +let world = self.world_dispatcher.read(); 'land' } - fn do_with_world_not_first(self: @ContractState, vec: Vec2, world: IWorldDispatcher) -> felt252 { + fn do_with_world_not_named_world(self: @ContractState, another_world: @IWorldDispatcher) -> felt252 { 'land' } - fn do_with_self_and_world_not_first( - self: @ContractState, vec: Vec2, world: IWorldDispatcher - ) -> felt252 { + fn do_with_world_not_first(self: @ContractState, vec: Vec2) -> felt252 { 'land' } } + #[generate_trait] + impl InternalImplBad of InternalUtils { + fn bad_func_using_generate(self: @ContractState) -> felt252 { +let world = self.world_dispatcher.read(); + 'land' + } + } + + #[starknet::interface] + trait IDojoInit { + fn dojo_init(self: @ContractState); + } + + #[abi(embed_v0)] + impl IDojoInitImpl of IDojoInit { + fn dojo_init(self: @ContractState) { + assert(starknet::get_caller_address() == self.world().contract_address, 'Only world can init'); + } + } + #[event] #[derive(Drop, starknet::Event)] enum Event { @@ -1150,6 +1329,9 @@ self: @ContractState, world: IWorldDispatcher, vec: Vec2, another_wo #[substorage(v0)] upgradeable: dojo::components::upgradeable::upgradeable::Storage, } + trait InternalUtils{ + fn bad_func_using_generate(self: @ContractState) -> felt252; + } impl EventDrop of core::traits::Drop::; } @@ -1185,26 +1367,42 @@ impl EventDrop of core::traits::Drop::; } #[abi(embed_v0)] - impl TestWorldImpl of IWorldTrait { - fn do(self: @ContractState, vec: Vec2) -> felt252 { + impl TestNominalImpl of INominalTrait { + fn do_no_param(self: @ContractState) -> felt252 { 'land' } - fn do_with_self(self: @ContractState, vec: Vec2) -> felt252 { + fn do_no_param_but_world(self: @ContractState) -> felt252 { +let world = self.world_dispatcher.read(); 'land' } - fn do_with_world_first(self: @ContractState, vec: Vec2) -> felt252 { + fn do_no_param_but_world_ref(ref self: ContractState) -> felt252 { let world = self.world_dispatcher.read(); 'land' } - fn do_with_self_and_world_first( - self: @ContractState, vec: Vec2 - ) -> felt252 { + fn do_params_no_world(self: @ContractState, p1: felt252, p2: u8) -> felt252 { + 'land' + } + + fn do_params_and_world(self: @ContractState, p2: u8) -> felt252 { +let world = self.world_dispatcher.read(); + 'land' + } + + fn do_params_and_world_ref(ref self: ContractState, p2: u8) -> felt252 { let world = self.world_dispatcher.read(); 'land' } + + fn do_with_self(self: @ContractState) -> felt252 { + 'land' + } + + fn do_with_ref_self(ref self: ContractState) -> felt252 { + 'land' + } } #[generate_trait] @@ -1215,6 +1413,18 @@ let world = self.world_dispatcher.read(); } } + #[starknet::interface] + trait IDojoInit { + fn dojo_init(self: @ContractState); + } + + #[abi(embed_v0)] + impl IDojoInitImpl of IDojoInit { + fn dojo_init(self: @ContractState) { + assert(starknet::get_caller_address() == self.world().contract_address, 'Only world can init'); + } + } + #[event] #[derive(Drop, starknet::Event)] enum Event { @@ -1234,3 +1444,123 @@ impl ActionDrop of core::traits::Drop::; impl EventDrop of core::traits::Drop::; } + + #[starknet::contract] + mod init_test { + use dojo::world; + use dojo::world::IWorldDispatcher; + use dojo::world::IWorldDispatcherTrait; + use dojo::world::IWorldProvider; + use dojo::world::IDojoResourceProvider; + + #[abi(embed_v0)] + impl DojoResourceProviderImpl of IDojoResourceProvider { + fn dojo_resource(self: @ContractState) -> felt252 { + 'init_test' + } + } + + #[abi(embed_v0)] + impl WorldProviderImpl of IWorldProvider { + fn world(self: @ContractState) -> IWorldDispatcher { + self.world_dispatcher.read() + } + } + + #[abi(embed_v0)] + impl UpgradableImpl = dojo::components::upgradeable::upgradeable::UpgradableImpl; + + + #[starknet::interface] + trait IDojoInit { + fn dojo_init(self: @ContractState, actions_address: ContractAddress, actions_class: ClassHash, value: u8 +); + } + + #[abi(embed_v0)] + impl IDojoInitImpl of IDojoInit { + fn dojo_init(self: @ContractState, actions_address: ContractAddress, actions_class: ClassHash, value: u8 +) { + let world = self.world_dispatcher.read(); + assert(starknet::get_caller_address() == self.world().contract_address, 'Only world can init'); + { + emit!( + world, + ContractInitialized { + contract_address: actions_address, contract_class: actions_class, value + } + ); + } + + } + } + + #[event] + #[derive(Drop, starknet::Event)] + enum Event { + UpgradeableEvent: dojo::components::upgradeable::upgradeable::Event, + } + + #[storage] + struct Storage { + world_dispatcher: IWorldDispatcher, + #[substorage(v0)] + upgradeable: dojo::components::upgradeable::upgradeable::Storage, + } +impl EventDrop of core::traits::Drop::; + + } + + #[starknet::contract] + mod no_init_test { + use dojo::world; + use dojo::world::IWorldDispatcher; + use dojo::world::IWorldDispatcherTrait; + use dojo::world::IWorldProvider; + use dojo::world::IDojoResourceProvider; + + #[abi(embed_v0)] + impl DojoResourceProviderImpl of IDojoResourceProvider { + fn dojo_resource(self: @ContractState) -> felt252 { + 'no_init_test' + } + } + + #[abi(embed_v0)] + impl WorldProviderImpl of IWorldProvider { + fn world(self: @ContractState) -> IWorldDispatcher { + self.world_dispatcher.read() + } + } + + #[abi(embed_v0)] + impl UpgradableImpl = dojo::components::upgradeable::upgradeable::UpgradableImpl; + + + #[starknet::interface] + trait IDojoInit { + fn dojo_init(self: @ContractState); + } + + #[abi(embed_v0)] + impl IDojoInitImpl of IDojoInit { + fn dojo_init(self: @ContractState) { + assert(starknet::get_caller_address() == self.world().contract_address, 'Only world can init'); + } + } + + #[event] + #[derive(Drop, starknet::Event)] + enum Event { + UpgradeableEvent: dojo::components::upgradeable::upgradeable::Event, + } + + #[storage] + struct Storage { + world_dispatcher: IWorldDispatcher, + #[substorage(v0)] + upgradeable: dojo::components::upgradeable::upgradeable::Storage, + } +impl EventDrop of core::traits::Drop::; + + } diff --git a/crates/dojo-lang/src/scarb_internal/mod.rs b/crates/dojo-lang/src/scarb_internal/mod.rs index 15c56c7174..638c7a0d74 100644 --- a/crates/dojo-lang/src/scarb_internal/mod.rs +++ b/crates/dojo-lang/src/scarb_internal/mod.rs @@ -93,9 +93,10 @@ pub fn compile_workspace(config: &Config, opts: CompileOpts) -> Result>(); @@ -143,11 +144,15 @@ fn build_project_config(unit: &CairoCompilationUnit) -> Result { .components() .iter() .filter(|model| !model.package.id.is_core()) - .map(|model| (model.cairo_package_name(), model.target.source_root().into())) + // NOTE: We're taking the first target of each compilation unit, which should always be the + // main package source root due to the order maintained by scarb. + .map(|model| (model.cairo_package_name(), model.targets[0].source_root().into())) .collect(); let corelib = - unit.core_package_component().map(|c| Directory::Real(c.target.source_root().into())); + // NOTE: We're taking the first target of the corelib, which should always be the + // main package source root due to the order maintained by scarb. + unit.core_package_component().map(|c| Directory::Real(c.targets[0].source_root().into())); let content = ProjectConfigContent { crate_roots, diff --git a/crates/dojo-lang/src/semantics/test_utils.rs b/crates/dojo-lang/src/semantics/test_utils.rs index dc9db9a166..00e34b9b9b 100644 --- a/crates/dojo-lang/src/semantics/test_utils.rs +++ b/crates/dojo-lang/src/semantics/test_utils.rs @@ -12,7 +12,7 @@ use cairo_lang_filesystem::db::{ use cairo_lang_filesystem::ids::{ CrateId, CrateLongId, Directory, FileKind, FileLongId, VirtualFile, }; -use cairo_lang_parser::db::ParserDatabase; +use cairo_lang_parser::db::{ParserDatabase, ParserGroup}; use cairo_lang_semantic::db::{SemanticDatabase, SemanticGroup}; use cairo_lang_semantic::inline_macros::get_default_plugin_suite; use cairo_lang_semantic::items::functions::GenericFunctionId; @@ -100,6 +100,11 @@ impl Upcast for DojoSemanticDatabase { self } } +impl Upcast for DojoSemanticDatabase { + fn upcast(&self) -> &(dyn ParserGroup + 'static) { + self + } +} pub struct WithStringDiagnostics { value: T, diff --git a/crates/dojo-lang/src/syntax/mod.rs b/crates/dojo-lang/src/syntax/mod.rs new file mode 100644 index 0000000000..cfd40715a2 --- /dev/null +++ b/crates/dojo-lang/src/syntax/mod.rs @@ -0,0 +1,3 @@ +pub mod self_param; +pub mod utils; +pub mod world_param; diff --git a/crates/dojo-lang/src/syntax/self_param.rs b/crates/dojo-lang/src/syntax/self_param.rs new file mode 100644 index 0000000000..aaf3593fac --- /dev/null +++ b/crates/dojo-lang/src/syntax/self_param.rs @@ -0,0 +1,30 @@ +use cairo_lang_syntax::node::ast; +use cairo_lang_syntax::node::db::SyntaxGroup; + +use crate::syntax::utils as syntax_utils; + +pub const SELF_PARAM_NAME: &str = "self"; + +/// Checks if the given function parameter is using `self` instead of `world` param. +/// Adds diagnostic if that case. +/// +/// # Arguments +/// +/// - `db` - The syntax group. +/// - `param_list` - The parameter list of the function. +/// - `fn_diagnostic_item` - The diagnostic item of the function. +/// - `diagnostics` - The diagnostics vector. +/// +/// # Returns +/// +/// - `true` if the function first parameter is `self`. +pub fn check_parameter(db: &dyn SyntaxGroup, param_list: &ast::ParamList) -> bool { + if param_list.elements(db).is_empty() { + return false; + } + + let param_0 = param_list.elements(db)[0].clone(); + let (name, _, _) = syntax_utils::get_parameter_info(db, param_0.clone()); + + name.eq(SELF_PARAM_NAME) +} diff --git a/crates/dojo-lang/src/syntax/utils.rs b/crates/dojo-lang/src/syntax/utils.rs new file mode 100644 index 0000000000..b4bf5298a1 --- /dev/null +++ b/crates/dojo-lang/src/syntax/utils.rs @@ -0,0 +1,20 @@ +use cairo_lang_syntax::node::db::SyntaxGroup; +use cairo_lang_syntax::node::{ast, Terminal, TypedSyntaxNode}; + +/// Gets the name, modifiers and type of a function parameter. +/// +/// # Arguments +/// +/// * `db` - The syntax group. +/// * `param` - The parameter. +/// +/// # Returns +/// +/// * A tuple containing the name, modifiers and type of the parameter. +pub fn get_parameter_info(db: &dyn SyntaxGroup, param: ast::Param) -> (String, String, String) { + let name = param.name(db).text(db).trim().to_string(); + let modifiers = param.modifiers(db).as_syntax_node().get_text(db).trim().to_string(); + let param_type = param.type_clause(db).ty(db).as_syntax_node().get_text(db).trim().to_string(); + + (name, modifiers, param_type) +} diff --git a/crates/dojo-lang/src/syntax/world_param.rs b/crates/dojo-lang/src/syntax/world_param.rs new file mode 100644 index 0000000000..66ef198a5e --- /dev/null +++ b/crates/dojo-lang/src/syntax/world_param.rs @@ -0,0 +1,100 @@ +use cairo_lang_defs::plugin::PluginDiagnostic; +use cairo_lang_diagnostics::Severity; +use cairo_lang_syntax::node::db::SyntaxGroup; +use cairo_lang_syntax::node::{ast, ids}; + +use super::utils as syntax_utils; + +const WORLD_PARAM_NAME: &str = "world"; +const WORLD_PARAM_TYPE: &str = "IWorldDispatcher"; +const WORLD_PARAM_TYPE_SNAPSHOT: &str = "@IWorldDispatcher"; + +#[derive(Debug, PartialEq, Eq)] +pub enum WorldParamInjectionKind { + None, + View, + External, +} + +/// Checks if the given parameter is the `world` parameter. +/// +/// The `world` must be named `world`, and be placed first in the argument list. +pub fn is_world_param(param_name: &str, param_type: &str) -> bool { + param_name == WORLD_PARAM_NAME + && (param_type == WORLD_PARAM_TYPE || param_type == WORLD_PARAM_TYPE_SNAPSHOT) +} + +/// Extracts the state mutability of a function from the `world` parameter. +/// +/// Checks if the function has only one `world` parameter (or None). +/// The `world` must be named `world`, and be placed first in the argument list. +/// +/// `fn func1(ref world)` // would be external. +/// `fn func2(world)` // would be view. +/// `fn func3()` // would be view. +/// +/// Returns +/// * The [`WorldParamInjectionKind`] determined from the function's params list. +pub fn parse_world_injection( + db: &dyn SyntaxGroup, + param_list: ast::ParamList, + fn_diagnostic_item: ids::SyntaxStablePtrId, + diagnostics: &mut Vec, +) -> WorldParamInjectionKind { + let mut has_world_injected = false; + let mut injection_kind = WorldParamInjectionKind::None; + + param_list.elements(db).iter().enumerate().for_each(|(idx, param)| { + let (name, modifiers, param_type) = syntax_utils::get_parameter_info(db, param.clone()); + + if !is_world_param(&name, ¶m_type) { + if name.eq(super::self_param::SELF_PARAM_NAME) && has_world_injected { + diagnostics.push(PluginDiagnostic { + stable_ptr: fn_diagnostic_item, + message: "You cannot use `self` and `world` parameters together.".to_string(), + severity: Severity::Error, + }); + } + + return; + } + + if has_world_injected { + diagnostics.push(PluginDiagnostic { + stable_ptr: fn_diagnostic_item, + message: "Only one world parameter is allowed".to_string(), + severity: Severity::Error, + }); + + return; + } else { + has_world_injected = true; + } + + if idx != 0 { + diagnostics.push(PluginDiagnostic { + stable_ptr: fn_diagnostic_item, + message: "World parameter must be the first parameter.".to_string(), + severity: Severity::Error, + }); + + return; + } + + if modifiers.contains(&"ref".to_string()) { + injection_kind = WorldParamInjectionKind::External; + } else { + injection_kind = WorldParamInjectionKind::View; + + if param_type == WORLD_PARAM_TYPE { + diagnostics.push(PluginDiagnostic { + stable_ptr: fn_diagnostic_item, + message: "World parameter must be a snapshot if `ref` is not used.".to_string(), + severity: Severity::Error, + }); + } + } + }); + + injection_kind +} diff --git a/crates/dojo-test-utils/src/compiler.rs b/crates/dojo-test-utils/src/compiler.rs index c5c3e5a7f1..a48ef13435 100644 --- a/crates/dojo-test-utils/src/compiler.rs +++ b/crates/dojo-test-utils/src/compiler.rs @@ -58,7 +58,8 @@ pub fn copy_build_project_temp( let temp_project_path = temp_project_dir.join("Scarb").with_extension("toml").to_string(); let dojo_core_path = Utf8PathBuf::from(dojo_core_path); - let ignore_dirs = ["manifests", "target"]; + // we don't ignore `manifests` because `overylays` are required for successful migration + let ignore_dirs = ["target"]; copy_project_temp(&source_project_dir, &temp_project_dir, &dojo_core_path, &ignore_dirs) .unwrap(); @@ -194,7 +195,9 @@ pub fn corelib() -> PathBuf { let compilation_units = ops::generate_compilation_units(&resolve, &features_opts, &ws).unwrap(); if let CompilationUnit::Cairo(unit) = &compilation_units[0] { - unit.core_package_component().expect("should have component").target.source_root().into() + unit.core_package_component().expect("should have component").targets[0] + .source_root() + .into() } else { panic!("should have cairo compilation unit") } diff --git a/crates/dojo-test-utils/src/migration.rs b/crates/dojo-test-utils/src/migration.rs index fbf52d5e1c..d0ecc91126 100644 --- a/crates/dojo-test-utils/src/migration.rs +++ b/crates/dojo-test-utils/src/migration.rs @@ -1,7 +1,6 @@ use anyhow::Result; use camino::Utf8PathBuf; -use dojo_lang::compiler::{BASE_DIR, MANIFESTS_DIR, OVERLAYS_DIR}; -use dojo_world::manifest::{BaseManifest, OverlayManifest}; +use dojo_world::manifest::{BaseManifest, OverlayManifest, BASE_DIR, MANIFESTS_DIR, OVERLAYS_DIR}; use dojo_world::migration::strategy::{prepare_for_migration, MigrationStrategy}; use dojo_world::migration::world::WorldDiff; use katana_primitives::FieldElement; @@ -11,18 +10,34 @@ use starknet::macros::felt; pub fn prepare_migration( manifest_dir: Utf8PathBuf, target_dir: Utf8PathBuf, + skip_migration: Option>, ) -> Result { // In testing, profile name is always dev. let profile_name = "dev"; - let manifest = BaseManifest::load_from_path( + let mut manifest = BaseManifest::load_from_path( &manifest_dir.join(MANIFESTS_DIR).join(profile_name).join(BASE_DIR), ) .unwrap(); - let world = WorldDiff::compute(manifest, None); + if let Some(skip_manifests) = skip_migration { + manifest.remove_items(skip_manifests); + } + + let overlay_manifest = OverlayManifest::load_from_path( + &manifest_dir.join(MANIFESTS_DIR).join(profile_name).join(OVERLAYS_DIR), + ) + .unwrap(); + + manifest.merge(overlay_manifest); + + let mut world = WorldDiff::compute(manifest, None); + world.update_order().unwrap(); + + let mut strat = prepare_for_migration(None, felt!("0x12345"), &target_dir, world).unwrap(); + strat.resolve_variable(strat.world_address().unwrap()).unwrap(); - prepare_for_migration(None, felt!("0x12345"), &target_dir, world) + Ok(strat) } pub fn prepare_migration_with_world_and_seed( @@ -46,7 +61,8 @@ pub fn prepare_migration_with_world_and_seed( manifest.merge(overlay_manifest); - let world = WorldDiff::compute(manifest, None); + let mut world = WorldDiff::compute(manifest, None); + world.update_order().unwrap(); let seed = cairo_short_string_to_felt(seed).unwrap(); prepare_for_migration(world_address, seed, &target_dir, world) diff --git a/crates/dojo-types/src/schema.rs b/crates/dojo-types/src/schema.rs index e461dd8dfc..fa4f2819e7 100644 --- a/crates/dojo-types/src/schema.rs +++ b/crates/dojo-types/src/schema.rs @@ -196,16 +196,11 @@ impl Ty { let arr_len: u32 = felts.remove(0).try_into().map_err(PrimitiveError::ValueOutOfRange)?; - if arr_len > 0 { - let item_ty = items_ty[0].clone(); - - items_ty.clear(); - - for _ in 0..arr_len { - let mut cur_item_ty = item_ty.clone(); - cur_item_ty.deserialize(felts)?; - items_ty.push(cur_item_ty); - } + let item_ty = items_ty.pop().unwrap(); + for _ in 0..arr_len { + let mut cur_item_ty = item_ty.clone(); + cur_item_ty.deserialize(felts)?; + items_ty.push(cur_item_ty); } } Ty::ByteArray(bytes) => { @@ -250,7 +245,6 @@ impl std::fmt::Display for Ty { let str = self .iter() .filter_map(|ty| match ty { - Ty::Primitive(_) => None, Ty::Struct(s) => { let mut struct_str = format!("struct {} {{\n", s.name); for member in &s.children { @@ -272,6 +266,7 @@ impl std::fmt::Display for Ty { } Ty::Array(items_ty) => Some(format!("Array<{}>", items_ty[0].name())), Ty::ByteArray(_) => Some("ByteArray".to_string()), + _ => None, }) .collect::>() .join("\n\n"); diff --git a/crates/dojo-world/Cargo.toml b/crates/dojo-world/Cargo.toml index afc946495a..8504077caa 100644 --- a/crates/dojo-world/Cargo.toml +++ b/crates/dojo-world/Cargo.toml @@ -23,6 +23,7 @@ smol_str.workspace = true starknet-crypto.workspace = true starknet.workspace = true thiserror.workspace = true +topological-sort.workspace = true tracing.workspace = true cainome.workspace = true diff --git a/crates/dojo-world/src/contracts/abi/world.rs b/crates/dojo-world/src/contracts/abi/world.rs index 7e23eee81f..4f9016025e 100644 --- a/crates/dojo-world/src/contracts/abi/world.rs +++ b/crates/dojo-world/src/contracts/abi/world.rs @@ -211,6 +211,10 @@ abigen!( { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "init_calldata", + "type": "core::array::Span::" } ], "outputs": [ @@ -557,6 +561,10 @@ abigen!( { "name": "program_output", "type": "dojo::interfaces::ProgramOutput" + }, + { + "name": "program_hash", + "type": "core::felt252" } ], "outputs": [], @@ -575,7 +583,7 @@ abigen!( "items": [ { "type": "function", - "name": "set_program_hash", + "name": "set_differ_program_hash", "inputs": [ { "name": "program_hash", @@ -587,7 +595,30 @@ abigen!( }, { "type": "function", - "name": "get_program_hash", + "name": "set_merger_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_differ_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_merger_program_hash", "inputs": [], "outputs": [ { @@ -833,7 +864,19 @@ abigen!( }, { "type": "event", - "name": "dojo::config::component::Config::ProgramHashUpdate", + "name": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::MergerProgramHashUpdate", "kind": "struct", "members": [ { @@ -861,8 +904,13 @@ abigen!( "kind": "enum", "variants": [ { - "name": "ProgramHashUpdate", - "type": "dojo::config::component::Config::ProgramHashUpdate", + "name": "DifferProgramHashUpdate", + "type": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "nested" + }, + { + "name": "MergerProgramHashUpdate", + "type": "dojo::config::component::Config::MergerProgramHashUpdate", "kind": "nested" }, { diff --git a/crates/dojo-world/src/contracts/model_test.rs b/crates/dojo-world/src/contracts/model_test.rs index 1b581b0e5e..2fd460b729 100644 --- a/crates/dojo-world/src/contracts/model_test.rs +++ b/crates/dojo-world/src/contracts/model_test.rs @@ -9,6 +9,7 @@ use starknet::macros::felt; use crate::contracts::model::ModelReader; use crate::contracts::world::test::deploy_world; use crate::contracts::world::WorldContractReader; +use crate::metadata::dojo_metadata_from_workspace; #[tokio::test(flavor = "multi_thread")] async fn test_model() { @@ -24,7 +25,13 @@ async fn test_model() { let manifest_dir = config.manifest_path().parent().unwrap(); let target_dir = manifest_dir.join("target").join("dev"); - let world_address = deploy_world(&runner, &manifest_dir.into(), &target_dir).await; + let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); + let dojo_metadata = + dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); + + let world_address = + deploy_world(&runner, &manifest_dir.into(), &target_dir, dojo_metadata.skip_migration) + .await; let world = WorldContractReader::new(world_address, provider); let position = world.model_reader("Position").await.unwrap(); @@ -65,7 +72,7 @@ async fn test_model() { assert_eq!( position.class_hash(), - felt!("0x03c3632f38ab3ba550bd3c596e2af55002d43bc76b7b660a3a57b49795307c58") + felt!("0x027942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff") ); let moves = world.model_reader("Moves").await.unwrap(); diff --git a/crates/dojo-world/src/contracts/world_test.rs b/crates/dojo-world/src/contracts/world_test.rs index 3c5afe8886..5680d52c45 100644 --- a/crates/dojo-world/src/contracts/world_test.rs +++ b/crates/dojo-world/src/contracts/world_test.rs @@ -1,14 +1,14 @@ use std::time::Duration; use camino::Utf8PathBuf; -use dojo_lang::compiler::{BASE_DIR, MANIFESTS_DIR}; use dojo_test_utils::compiler; use katana_runner::KatanaRunner; use starknet::accounts::{Account, ConnectedAccount}; -use starknet::core::types::FieldElement; +use starknet::core::types::{BlockId, BlockTag, FieldElement}; use super::{WorldContract, WorldContractReader}; -use crate::manifest::BaseManifest; +use crate::manifest::{BaseManifest, OverlayManifest, BASE_DIR, MANIFESTS_DIR, OVERLAYS_DIR}; +use crate::metadata::dojo_metadata_from_workspace; use crate::migration::strategy::prepare_for_migration; use crate::migration::world::WorldDiff; use crate::migration::{Declarable, Deployable, TxnConfig}; @@ -24,10 +24,22 @@ async fn test_world_contract_reader() { let manifest_dir = config.manifest_path().parent().unwrap(); let target_dir = manifest_dir.join("target").join("dev"); - let account = runner.account(0); + let mut account = runner.account(0); + account.set_block_id(BlockId::Tag(BlockTag::Pending)); + let provider = account.provider(); - let world_address = - deploy_world(&runner, &manifest_dir.to_path_buf(), &target_dir.to_path_buf()).await; + + let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); + let dojo_metadata = + dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); + + let world_address = deploy_world( + &runner, + &manifest_dir.to_path_buf(), + &target_dir.to_path_buf(), + dojo_metadata.skip_migration, + ) + .await; let _world = WorldContractReader::new(world_address, provider); } @@ -36,24 +48,40 @@ pub async fn deploy_world( sequencer: &KatanaRunner, manifest_dir: &Utf8PathBuf, target_dir: &Utf8PathBuf, + skip_migration: Option>, ) -> FieldElement { // Dev profile is used by default for testing: let profile_name = "dev"; - let manifest = BaseManifest::load_from_path( + let mut manifest = BaseManifest::load_from_path( &manifest_dir.join(MANIFESTS_DIR).join(profile_name).join(BASE_DIR), ) .unwrap(); - let world = WorldDiff::compute(manifest.clone(), None); + + if let Some(skip_manifests) = skip_migration { + manifest.remove_items(skip_manifests); + } + + let overlay_manifest = OverlayManifest::load_from_path( + &manifest_dir.join(MANIFESTS_DIR).join(profile_name).join(OVERLAYS_DIR), + ) + .unwrap(); + + manifest.merge(overlay_manifest); + + let mut world = WorldDiff::compute(manifest.clone(), None); + world.update_order().unwrap(); + let account = sequencer.account(0); - let strategy = prepare_for_migration( + let mut strategy = prepare_for_migration( None, FieldElement::from_hex_be("0x12345").unwrap(), target_dir, world, ) .unwrap(); + strategy.resolve_variable(strategy.world_address().unwrap()).unwrap(); let base_class_hash = strategy.base.unwrap().declare(&account, &TxnConfig::default()).await.unwrap().class_hash; @@ -104,6 +132,7 @@ pub async fn deploy_world( base_class_hash, &account, &TxnConfig::default(), + &contract.diff.init_calldata, ) .await .unwrap(); diff --git a/crates/dojo-world/src/manifest/manifest_test.rs b/crates/dojo-world/src/manifest/manifest_test.rs index 33f09297b6..d19a69b01b 100644 --- a/crates/dojo-world/src/manifest/manifest_test.rs +++ b/crates/dojo-world/src/manifest/manifest_test.rs @@ -2,20 +2,27 @@ use std::io::Write; use cainome::cairo_serde::{ByteArray, CairoSerde}; use camino::Utf8PathBuf; -use dojo_lang::compiler::{BASE_DIR, MANIFESTS_DIR}; use dojo_test_utils::compiler; use dojo_test_utils::rpc::MockJsonRpcTransport; use katana_runner::KatanaRunner; use serde_json::json; +use smol_str::SmolStr; use starknet::accounts::ConnectedAccount; use starknet::core::types::contract::AbiEntry; use starknet::core::types::{EmittedEvent, FieldElement}; use starknet::macros::{felt, selector}; use starknet::providers::jsonrpc::{JsonRpcClient, JsonRpcMethod}; -use super::{parse_contracts_events, AbiFormat, BaseManifest, DojoContract, DojoModel}; +use super::{ + parse_contracts_events, AbiFormat, BaseManifest, DojoContract, DojoModel, OverlayDojoContract, + OverlayManifest, +}; use crate::contracts::world::test::deploy_world; -use crate::manifest::{parse_models_events, AbstractManifestError, DeploymentManifest, Manifest}; +use crate::manifest::{ + parse_models_events, AbstractManifestError, DeploymentManifest, Manifest, OverlayClass, + OverlayDojoModel, BASE_DIR, MANIFESTS_DIR, OVERLAYS_DIR, +}; +use crate::metadata::dojo_metadata_from_workspace; use crate::migration::world::WorldDiff; #[tokio::test] @@ -376,26 +383,47 @@ fn fetch_remote_manifest() { let (temp_project_dir, config, _) = compiler::copy_build_project_temp(source_project, dojo_core_path, true); + let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); + let dojo_metadata = + dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); + let artifacts_path = temp_project_dir.join(format!("target/{profile_name}")); - let world_address = config - .tokio_handle() - .block_on(async { deploy_world(&runner, &temp_project_dir, &artifacts_path).await }); + let world_address = config.tokio_handle().block_on(async { + deploy_world( + &runner, + &temp_project_dir, + &artifacts_path, + dojo_metadata.skip_migration.clone(), + ) + .await + }); - let local_manifest = BaseManifest::load_from_path( + let mut local_manifest = BaseManifest::load_from_path( &temp_project_dir.join(MANIFESTS_DIR).join(profile_name).join(BASE_DIR), ) .unwrap(); + if let Some(skip_manifests) = dojo_metadata.skip_migration { + local_manifest.remove_items(skip_manifests); + } + + let overlay_manifest = OverlayManifest::load_from_path( + &temp_project_dir.join(MANIFESTS_DIR).join(profile_name).join(OVERLAYS_DIR), + ) + .unwrap(); + + local_manifest.merge(overlay_manifest); + let remote_manifest = config.tokio_handle().block_on(async { DeploymentManifest::load_from_remote(provider, world_address).await.unwrap() }); - assert_eq!(local_manifest.models.len(), 5); - assert_eq!(local_manifest.contracts.len(), 1); + assert_eq!(local_manifest.models.len(), 7); + assert_eq!(local_manifest.contracts.len(), 3); - assert_eq!(remote_manifest.models.len(), 5); - assert_eq!(remote_manifest.contracts.len(), 1); + assert_eq!(remote_manifest.models.len(), 7); + assert_eq!(remote_manifest.contracts.len(), 3); // compute diff from local and remote manifest @@ -464,3 +492,202 @@ fn test_abi_format_load_abi_string() -> Result<(), Box> { Ok(()) } + +#[test] +fn overlay_merge_for_contract_and_model_work_as_expected() { + let other = OverlayManifest { + contracts: vec![ + OverlayDojoContract { name: "othercontract1".into(), ..Default::default() }, + OverlayDojoContract { name: "othercontract2".into(), ..Default::default() }, + OverlayDojoContract { name: "existingcontract".into(), ..Default::default() }, + ], + models: vec![ + OverlayDojoModel { name: "othermodel1".into(), ..Default::default() }, + OverlayDojoModel { name: "othermodel2".into(), ..Default::default() }, + OverlayDojoModel { name: "existingmodel".into(), ..Default::default() }, + ], + ..Default::default() + }; + + let mut current = OverlayManifest { + contracts: vec![ + OverlayDojoContract { name: "currentcontract1".into(), ..Default::default() }, + OverlayDojoContract { name: "currentcontract2".into(), ..Default::default() }, + OverlayDojoContract { name: "existingcontract".into(), ..Default::default() }, + ], + models: vec![ + OverlayDojoModel { name: "currentmodel1".into(), ..Default::default() }, + OverlayDojoModel { name: "currentmodel2".into(), ..Default::default() }, + OverlayDojoModel { name: "existingmodel".into(), ..Default::default() }, + ], + ..Default::default() + }; + + let expected = OverlayManifest { + contracts: vec![ + OverlayDojoContract { name: "currentcontract1".into(), ..Default::default() }, + OverlayDojoContract { name: "currentcontract2".into(), ..Default::default() }, + OverlayDojoContract { name: "existingcontract".into(), ..Default::default() }, + OverlayDojoContract { name: "othercontract1".into(), ..Default::default() }, + OverlayDojoContract { name: "othercontract2".into(), ..Default::default() }, + ], + models: vec![ + OverlayDojoModel { name: "currentmodel1".into(), ..Default::default() }, + OverlayDojoModel { name: "currentmodel2".into(), ..Default::default() }, + OverlayDojoModel { name: "existingmodel".into(), ..Default::default() }, + OverlayDojoModel { name: "othermodel1".into(), ..Default::default() }, + OverlayDojoModel { name: "othermodel2".into(), ..Default::default() }, + ], + ..Default::default() + }; + + current.merge(other); + + assert_eq!(current, expected); +} + +#[test] +fn overlay_merge_for_world_work_as_expected() { + // when other.world is none and current.world is some + let other = OverlayManifest { ..Default::default() }; + let mut current = OverlayManifest { + world: Some(OverlayClass { name: "world".into(), ..Default::default() }), + ..Default::default() + }; + let expected = OverlayManifest { + world: Some(OverlayClass { name: "world".into(), ..Default::default() }), + ..Default::default() + }; + current.merge(other); + + assert_eq!(current, expected); + + // when other.world is some and current.world is none + let other = OverlayManifest { + world: Some(OverlayClass { name: "world".into(), ..Default::default() }), + ..Default::default() + }; + let mut current = OverlayManifest { ..Default::default() }; + let expected = OverlayManifest { + world: Some(OverlayClass { name: "world".into(), ..Default::default() }), + ..Default::default() + }; + + current.merge(other); + assert_eq!(current, expected); + + // when other.world is some and current.world is some + let other = OverlayManifest { + world: Some(OverlayClass { name: "worldother".into(), ..Default::default() }), + ..Default::default() + }; + let mut current = OverlayManifest { + world: Some(OverlayClass { name: "worldcurrent".into(), ..Default::default() }), + ..Default::default() + }; + let expected = OverlayManifest { + world: Some(OverlayClass { name: "worldcurrent".into(), ..Default::default() }), + ..Default::default() + }; + + current.merge(other); + assert_eq!(current, expected); + + // when other.world is none and current.world is none + let other = OverlayManifest { ..Default::default() }; + let mut current = OverlayManifest { ..Default::default() }; + let expected = OverlayManifest { ..Default::default() }; + + current.merge(other); + assert_eq!(current, expected); +} + +#[test] +fn overlay_merge_for_base_work_as_expected() { + // when other.base is none and current.base is some + let other = OverlayManifest { ..Default::default() }; + let mut current = OverlayManifest { + base: Some(OverlayClass { name: "base".into(), ..Default::default() }), + ..Default::default() + }; + let expected = OverlayManifest { + base: Some(OverlayClass { name: "base".into(), ..Default::default() }), + ..Default::default() + }; + current.merge(other); + + assert_eq!(current, expected); + + // when other.base is some and current.base is none + let other = OverlayManifest { + base: Some(OverlayClass { name: "base".into(), ..Default::default() }), + ..Default::default() + }; + let mut current = OverlayManifest { ..Default::default() }; + let expected = OverlayManifest { + base: Some(OverlayClass { name: "base".into(), ..Default::default() }), + ..Default::default() + }; + + current.merge(other); + assert_eq!(current, expected); + + // when other.base is some and current.base is some + let other = OverlayManifest { + base: Some(OverlayClass { name: "baseother".into(), ..Default::default() }), + ..Default::default() + }; + let mut current = OverlayManifest { + base: Some(OverlayClass { name: "basecurrent".into(), ..Default::default() }), + ..Default::default() + }; + let expected = OverlayManifest { + base: Some(OverlayClass { name: "basecurrent".into(), ..Default::default() }), + ..Default::default() + }; + + current.merge(other); + assert_eq!(current, expected); + + // when other.base is none and current.base is none + let other = OverlayManifest { ..Default::default() }; + let mut current = OverlayManifest { ..Default::default() }; + let expected = OverlayManifest { ..Default::default() }; + + current.merge(other); + assert_eq!(current, expected); +} + +#[test] +fn base_manifest_remove_items_work_as_expected() { + let contracts = ["c1", "c2", "c3"]; + let models = ["m1", "m2", "m3"]; + + let world = Manifest { name: "world".into(), inner: Default::default() }; + let base = Manifest { name: "base".into(), inner: Default::default() }; + + let contracts = contracts + .iter() + .map(|c| Manifest { name: SmolStr::from(*c), inner: Default::default() }) + .collect(); + let models = models + .iter() + .map(|c| Manifest { name: SmolStr::from(*c), inner: Default::default() }) + .collect(); + + let mut base = BaseManifest { contracts, models, world, base }; + + base.remove_items(vec!["c1".to_string(), "c3".to_string(), "m2".to_string()]); + + assert_eq!(base.contracts.len(), 1); + assert_eq!( + base.contracts.iter().map(|c| c.name.clone().into()).collect::>(), + vec!["c2"] + ); + + assert_eq!(base.models.len(), 2); + assert_eq!( + base.models.iter().map(|c| c.name.clone().into()).collect::>(), + vec!["m1", "m3"] + ); +} diff --git a/crates/dojo-world/src/manifest/mod.rs b/crates/dojo-world/src/manifest/mod.rs index 04fc8624aa..d3906595ab 100644 --- a/crates/dojo-world/src/manifest/mod.rs +++ b/crates/dojo-world/src/manifest/mod.rs @@ -17,6 +17,7 @@ use starknet::macros::selector; use starknet::providers::{Provider, ProviderError}; use thiserror::Error; use toml; +use tracing::error; use crate::contracts::model::ModelError; use crate::contracts::world::WorldEvent; @@ -39,6 +40,15 @@ pub const BASE_CONTRACT_NAME: &str = "dojo::base::base"; pub const RESOURCE_METADATA_CONTRACT_NAME: &str = "dojo::resource_metadata::resource_metadata"; pub const RESOURCE_METADATA_MODEL_NAME: &str = "0x5265736f757263654d65746164617461"; +pub const MANIFESTS_DIR: &str = "manifests"; +pub const BASE_DIR: &str = "base"; +pub const OVERLAYS_DIR: &str = "overlays"; +pub const DEPLOYMENTS_DIR: &str = "deployments"; +pub const ABIS_DIR: &str = "abis"; + +pub const CONTRACTS_DIR: &str = "contracts"; +pub const MODELS_DIR: &str = "models"; + #[derive(Error, Debug)] pub enum AbstractManifestError { #[error("Remote World not found.")] @@ -56,7 +66,9 @@ pub enum AbstractManifestError { #[error(transparent)] Model(#[from] ModelError), #[error(transparent)] - TOML(#[from] toml::de::Error), + TomlDe(#[from] toml::de::Error), + #[error(transparent)] + TomlSer(#[from] toml::ser::Error), #[error(transparent)] IO(#[from] io::Error), #[error("Abi couldn't be loaded from path: {0}")] @@ -93,8 +105,8 @@ impl From for DeploymentManifest { impl BaseManifest { /// Load the manifest from a file at the given path. pub fn load_from_path(path: &Utf8PathBuf) -> Result { - let contract_dir = path.join("contracts"); - let model_dir = path.join("models"); + let contract_dir = path.join(CONTRACTS_DIR); + let model_dir = path.join(MODELS_DIR); let world: Manifest = toml::from_str(&fs::read_to_string( path.join(WORLD_CONTRACT_NAME.replace("::", "_")).with_extension("toml"), @@ -110,6 +122,12 @@ impl BaseManifest { Ok(Self { world, base, contracts, models }) } + /// Given a list of contract or model names, remove those from the manifest. + pub fn remove_items(&mut self, items: Vec) { + self.contracts.retain(|contract| !items.contains(&contract.name.to_string())); + self.models.retain(|model| !items.contains(&model.name.to_string())); + } + pub fn merge(&mut self, overlay: OverlayManifest) { let mut base_map = HashMap::new(); @@ -118,11 +136,15 @@ impl BaseManifest { } for contract in overlay.contracts { - base_map - .get_mut(&contract.name) - .expect("qed; overlay contract not found") - .inner - .merge(contract); + if let Some(manifest) = base_map.get_mut(&contract.name) { + manifest.inner.merge(contract); + } else { + error!( + "OverlayManifest configured for contract \"{}\", but contract is not present \ + in BaseManifest.", + contract.name + ); + } } if let Some(overlay_world) = overlay.world { @@ -136,6 +158,8 @@ impl BaseManifest { impl OverlayManifest { pub fn load_from_path(path: &Utf8PathBuf) -> Result { + fs::create_dir_all(path)?; + let mut world: Option = None; let world_path = path.join(WORLD_CONTRACT_NAME.replace("::", "_")).with_extension("toml"); @@ -151,15 +175,72 @@ impl OverlayManifest { base = Some(toml::from_str(&fs::read_to_string(base_path)?)?); } - let contract_dir = path.join("contracts"); - + let contract_dir = path.join(CONTRACTS_DIR); let contracts = if contract_dir.exists() { overlay_elements_from_path::(&contract_dir)? } else { vec![] }; - Ok(Self { world, base, contracts }) + let model_dir = path.join(MODELS_DIR); + let models = if model_dir.exists() { + overlay_elements_from_path::(&model_dir)? + } else { + vec![] + }; + + Ok(Self { world, base, contracts, models }) + } + + /// Writes `Self` to overlay manifests folder. + /// + /// - `world` and `base` manifest are written to root of the folder. + /// - `contracts` and `models` are written to their respective directories. + pub fn write_to_path_nested(&self, path: &Utf8PathBuf) -> Result<(), AbstractManifestError> { + fs::create_dir_all(path)?; + + if let Some(ref world) = self.world { + let world = toml::to_string(world)?; + let file_name = + path.join(WORLD_CONTRACT_NAME.replace("::", "_")).with_extension("toml"); + fs::write(file_name, world)?; + } + + if let Some(ref base) = self.base { + let base = toml::to_string(base)?; + let file_name = path.join(BASE_CONTRACT_NAME.replace("::", "_")).with_extension("toml"); + fs::write(file_name, base)?; + } + + overlay_dojo_contracts_to_path(&path.join(CONTRACTS_DIR), self.contracts.as_slice())?; + overlay_dojo_model_to_path(&path.join(MODELS_DIR), self.models.as_slice())?; + Ok(()) + } + + /// Add missing overlay items from `others` to `self`. + /// Note that this method don't override if certain item already exists in `self`. + pub fn merge(&mut self, other: OverlayManifest) { + if self.world.is_none() { + self.world = other.world; + } + + if self.base.is_none() { + self.base = other.base; + } + + for other_contract in other.contracts { + let found = self.contracts.iter().find(|c| c.name == other_contract.name); + if found.is_none() { + self.contracts.push(other_contract); + } + } + + for other_model in other.models { + let found = self.models.iter().find(|m| m.name == other_model.name); + if found.is_none() { + self.models.push(other_model); + } + } } } @@ -485,20 +566,6 @@ fn parse_models_events(events: Vec) -> Vec> { .collect() } -// fn elements_to_path(item_dir: &Utf8PathBuf, items: &Vec>) -> Result<()> -// where -// T: Serialize + ManifestMethods, -// { -// fs::create_dir_all(item_dir)?; -// for item in items { -// let item_toml = toml::to_string_pretty(&item)?; -// let item_name = item.name.split("::").last().unwrap(); -// fs::write(item_dir.join(item_name).with_extension("toml"), item_toml)?; -// } - -// Ok(()) -// } - fn elements_from_path(path: &Utf8PathBuf) -> Result>, AbstractManifestError> where T: DeserializeOwned + ManifestMethods, @@ -546,6 +613,32 @@ where Ok(elements) } +fn overlay_dojo_contracts_to_path( + path: &Utf8PathBuf, + elements: &[OverlayDojoContract], +) -> Result<(), AbstractManifestError> { + fs::create_dir_all(path)?; + + for element in elements { + let path = path.join(element.name.replace("::", "_")).with_extension("toml"); + fs::write(path, toml::to_string(&element)?)?; + } + Ok(()) +} + +fn overlay_dojo_model_to_path( + path: &Utf8PathBuf, + elements: &[OverlayDojoModel], +) -> Result<(), AbstractManifestError> { + fs::create_dir_all(path)?; + + for element in elements { + let path = path.join(element.name.replace("::", "_")).with_extension("toml"); + fs::write(path, toml::to_string(&element)?)?; + } + Ok(()) +} + impl ManifestMethods for DojoContract { type OverlayType = OverlayDojoContract; @@ -579,6 +672,9 @@ impl ManifestMethods for DojoContract { if let Some(writes) = old.writes { self.writes = writes; } + if let Some(init_calldata) = old.init_calldata { + self.init_calldata = init_calldata; + } } } diff --git a/crates/dojo-world/src/manifest/types.rs b/crates/dojo-world/src/manifest/types.rs index afc6f13406..5eb3e67d0c 100644 --- a/crates/dojo-world/src/manifest/types.rs +++ b/crates/dojo-world/src/manifest/types.rs @@ -36,12 +36,13 @@ pub struct DeploymentManifest { pub models: Vec>, } -#[derive(Clone, Debug, Serialize, Deserialize)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] #[cfg_attr(test, derive(PartialEq))] pub struct OverlayManifest { pub world: Option, pub base: Option, pub contracts: Vec, + pub models: Vec, } #[derive(Clone, Serialize, Deserialize, Debug)] @@ -94,9 +95,14 @@ pub struct DojoContract { #[serde_as(as = "UfeHex")] pub base_class_hash: FieldElement, pub abi: Option, + #[serde(default)] pub reads: Vec, + #[serde(default)] pub writes: Vec, + #[serde(default)] pub computed: Vec, + #[serde(default)] + pub init_calldata: Vec, } /// Represents a declaration of a model. @@ -152,6 +158,7 @@ pub struct OverlayDojoContract { pub original_class_hash: Option, pub reads: Option>, pub writes: Option>, + pub init_calldata: Option>, } #[serde_as] diff --git a/crates/dojo-world/src/metadata.rs b/crates/dojo-world/src/metadata.rs index 2d50f5fa70..d778476a2f 100644 --- a/crates/dojo-world/src/metadata.rs +++ b/crates/dojo-world/src/metadata.rs @@ -85,7 +85,7 @@ pub fn project_to_world_metadata(project_metadata: Option) /// /// # Returns /// A [`DojoMetadata`] object containing all Dojo metadata. -pub fn dojo_metadata_from_workspace(ws: &Workspace<'_>) -> DojoMetadata { +pub fn dojo_metadata_from_workspace(ws: &Workspace<'_>) -> Option { let profile = ws.config().profile(); let manifest_dir = ws.manifest_path().parent().unwrap().to_path_buf(); @@ -94,9 +94,19 @@ pub fn dojo_metadata_from_workspace(ws: &Workspace<'_>) -> DojoMetadata { let sources_dir = target_dir.join(profile.as_str()).join(SOURCES_DIR); let abis_dir = manifest_dir.join(ABIS_DIR).join(BASE_DIR); - let project_metadata = ws.current_package().unwrap().manifest.metadata.dojo(); - let mut dojo_metadata = - DojoMetadata { env: project_metadata.env.clone(), ..Default::default() }; + let project_metadata = if let Ok(current_package) = ws.current_package() { + current_package.manifest.metadata.dojo() + } else { + // On workspaces, dojo metadata are not accessible because if no current package is defined + // (being the only package or using --package). + return None; + }; + + let mut dojo_metadata = DojoMetadata { + env: project_metadata.env.clone(), + skip_migration: project_metadata.skip_migration.clone(), + ..Default::default() + }; let world_artifact = build_artifact_from_name(&sources_dir, &abis_dir, WORLD_CONTRACT_NAME); @@ -109,23 +119,37 @@ pub fn dojo_metadata_from_workspace(ws: &Workspace<'_>) -> DojoMetadata { if let Ok(manifest) = BaseManifest::load_from_path(&manifest_dir.join(BASE_DIR)) { for model in manifest.models { let name = model.name.to_string(); - dojo_metadata.artifacts.insert( + dojo_metadata.resources_artifacts.insert( name.clone(), - build_artifact_from_name(&sources_dir, &abis_dir.join("models"), &name), + ResourceMetadata { + name: name.clone(), + artifacts: build_artifact_from_name( + &sources_dir, + &abis_dir.join("models"), + &name, + ), + }, ); } for contract in manifest.contracts { let name = contract.name.to_string(); - dojo_metadata.artifacts.insert( + dojo_metadata.resources_artifacts.insert( name.clone(), - build_artifact_from_name(&sources_dir, &abis_dir.join("contracts"), &name), + ResourceMetadata { + name: name.clone(), + artifacts: build_artifact_from_name( + &sources_dir, + &abis_dir.join("contracts"), + &name, + ), + }, ); } } } - dojo_metadata + Some(dojo_metadata) } /// Metadata coming from project configuration (Scarb.toml) @@ -133,6 +157,14 @@ pub fn dojo_metadata_from_workspace(ws: &Workspace<'_>) -> DojoMetadata { pub struct ProjectMetadata { pub world: Option, pub env: Option, + pub skip_migration: Option>, +} + +/// Metadata for a user defined resource (models, contracts). +#[derive(Default, Serialize, Deserialize, Debug, Clone)] +pub struct ResourceMetadata { + pub name: String, + pub artifacts: ArtifactMetadata, } /// Metadata collected from the project configuration and the Dojo workspace @@ -140,7 +172,8 @@ pub struct ProjectMetadata { pub struct DojoMetadata { pub world: WorldMetadata, pub env: Option, - pub artifacts: HashMap, + pub resources_artifacts: HashMap, + pub skip_migration: Option>, } #[derive(Debug)] @@ -342,6 +375,34 @@ impl ArtifactMetadata { } } +impl ResourceMetadata { + pub async fn upload(&self) -> Result { + let mut meta = self.clone(); + let client = + IpfsClient::from_str(IPFS_CLIENT_URL)?.with_credentials(IPFS_USERNAME, IPFS_PASSWORD); + + if let Some(Uri::File(abi)) = &self.artifacts.abi { + let abi_data = std::fs::read(abi)?; + let reader = Cursor::new(abi_data); + let response = client.add(reader).await?; + meta.artifacts.abi = Some(Uri::Ipfs(format!("ipfs://{}", response.hash))) + }; + + if let Some(Uri::File(source)) = &self.artifacts.source { + let source_data = std::fs::read(source)?; + let reader = Cursor::new(source_data); + let response = client.add(reader).await?; + meta.artifacts.source = Some(Uri::Ipfs(format!("ipfs://{}", response.hash))) + }; + + let serialized = json!(meta).to_string(); + let reader = Cursor::new(serialized); + let response = client.add(reader).await?; + + Ok(response.hash) + } +} + impl DojoMetadata { pub fn env(&self) -> Option<&Environment> { self.env.as_ref() diff --git a/crates/dojo-world/src/metadata_test.rs b/crates/dojo-world/src/metadata_test.rs index 1245313aa9..e564e3a8e4 100644 --- a/crates/dojo-world/src/metadata_test.rs +++ b/crates/dojo-world/src/metadata_test.rs @@ -64,8 +64,6 @@ socials.x = "https://x.com/dojostarknet" assert_eq!(world.socials.unwrap().get("x"), Some(&"https://x.com/dojostarknet".to_string())); } -// TODO: remove ignore once IPFS node is running. -#[ignore] #[tokio::test] async fn world_metadata_hash_and_upload() { let meta = WorldMetadata { @@ -123,7 +121,8 @@ async fn get_full_dojo_metadata_from_workspace() { let sources_dir = target_dir.join(profile.as_str()).join(SOURCES_DIR); let abis_dir = manifest_dir.join(ABIS_DIR).join(BASE_DIR); - let dojo_metadata = dojo_metadata_from_workspace(&ws); + let dojo_metadata = + dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); // env assert!(dojo_metadata.env.is_some()); @@ -145,10 +144,9 @@ async fn get_full_dojo_metadata_from_workspace() { ); assert!(env.world_address.is_some()); - assert!( - env.world_address - .unwrap() - .eq("0x1c958955aedbc7b8e2f051767d3369168e88bc5074b0f39e5f8cd2539138281") + assert_eq!( + env.world_address.unwrap(), + "0x07efebb0c2d4cc285d48a97a7174def3be7fdd6b7bd29cca758fa2e17e03ef30" ); assert!(env.keystore_path.is_none()); @@ -175,14 +173,21 @@ async fn get_full_dojo_metadata_from_workspace() { let artifacts = get_artifacts_from_manifest(&manifest_dir); + dbg!(&artifacts); for (abi_subdir, name) in artifacts { - let artifact = dojo_metadata.artifacts.get(&name); - assert!(artifact.is_some(), "bad artifact for {}", name); - let artifact = artifact.unwrap(); + let resource = dojo_metadata.resources_artifacts.get(&name); + dbg!(&dojo_metadata.resources_artifacts); + assert!(resource.is_some(), "bad resource metadata for {}", name); + let resource = resource.unwrap(); let sanitized_name = name.replace("::", "_"); - check_artifact(artifact.clone(), sanitized_name, &abis_dir.join(abi_subdir), &sources_dir); + check_artifact( + resource.artifacts.clone(), + sanitized_name, + &abis_dir.join(abi_subdir), + &sources_dir, + ); } } @@ -224,6 +229,12 @@ fn get_artifacts_from_manifest(manifest_dir: &Utf8PathBuf) -> Vec<(String, Strin // Some models are inside actions, we need a better way to gather those. let name = name.replace("_actions_", "::actions::"); let name = name.replace("::actions_", "::actions::"); + + let name = name.replace("_others_", "::others::"); + let name = name.replace("::others_", "::others::"); + + let name = name.replace("_mock_token_", "::mock_token::"); + let name = name.replace("::mock_token_", "::mock_token::"); artifacts.push(("models".to_string(), name)); } @@ -231,6 +242,8 @@ fn get_artifacts_from_manifest(manifest_dir: &Utf8PathBuf) -> Vec<(String, Strin for entry in fs::read_dir(contracts_dir).unwrap().flatten() { let name = entry.path().file_stem().unwrap().to_string_lossy().to_string(); let name = name.replace("_actions_", "::actions::"); + let name = name.replace("_others_", "::others::"); + let name = name.replace("_mock_token_", "::mock_token::"); artifacts.push(("contracts".to_string(), name)); } diff --git a/crates/dojo-world/src/migration/class.rs b/crates/dojo-world/src/migration/class.rs index 7f2376694f..e5b29f16d9 100644 --- a/crates/dojo-world/src/migration/class.rs +++ b/crates/dojo-world/src/migration/class.rs @@ -38,7 +38,7 @@ impl Display for ClassDiff { } } -#[derive(Debug, Default)] +#[derive(Debug, Default, Clone)] pub struct ClassMigration { pub diff: ClassDiff, pub artifact_path: PathBuf, diff --git a/crates/dojo-world/src/migration/contract.rs b/crates/dojo-world/src/migration/contract.rs index 166fbfbed8..59e6c929f9 100644 --- a/crates/dojo-world/src/migration/contract.rs +++ b/crates/dojo-world/src/migration/contract.rs @@ -16,6 +16,7 @@ pub struct ContractDiff { pub original_class_hash: FieldElement, pub base_class_hash: FieldElement, pub remote_class_hash: Option, + pub init_calldata: Vec, } impl StateDiff for ContractDiff { @@ -44,7 +45,7 @@ impl Display for ContractDiff { } // Represents a contract that needs to be migrated to the remote state -#[derive(Debug, Default)] +#[derive(Debug, Default, Clone)] pub struct ContractMigration { pub salt: FieldElement, pub diff: ContractDiff, diff --git a/crates/dojo-world/src/migration/mod.rs b/crates/dojo-world/src/migration/mod.rs index eb83aa4b62..203b5d91de 100644 --- a/crates/dojo-world/src/migration/mod.rs +++ b/crates/dojo-world/src/migration/mod.rs @@ -1,12 +1,13 @@ use std::fs::File; use std::path::PathBuf; +use std::str::FromStr; use std::sync::Arc; use anyhow::{anyhow, Result}; use async_trait::async_trait; use cairo_lang_starknet_classes::casm_contract_class::CasmContractClass; use cairo_lang_starknet_classes::contract_class::ContractClass; -use starknet::accounts::{Account, AccountError, Call, ConnectedAccount, SingleOwnerAccount}; +use starknet::accounts::{Account, AccountError, Call, ConnectedAccount}; use starknet::core::types::contract::{CompiledClass, SierraClass}; use starknet::core::types::{ BlockId, BlockTag, DeclareTransactionResult, FieldElement, FlattenedSierraClass, @@ -15,7 +16,6 @@ use starknet::core::types::{ use starknet::core::utils::{get_contract_address, CairoShortStringToFeltError}; use starknet::macros::{felt, selector}; use starknet::providers::{Provider, ProviderError}; -use starknet::signers::Signer; use thiserror::Error; use crate::utils::{TransactionExt, TransactionWaiter, TransactionWaitingError}; @@ -72,6 +72,8 @@ pub enum MigrationError { WaitingError(#[from] TransactionWaitingError), #[error(transparent)] ArtifactError(#[from] anyhow::Error), + #[error("Bad init calldata.")] + BadInitCalldata, } /// Represents the type of migration that should be performed. @@ -124,14 +126,14 @@ impl TxnConfig { #[cfg_attr(not(target_arch = "wasm32"), async_trait)] #[cfg_attr(target_arch = "wasm32", async_trait(?Send))] pub trait Declarable { - async fn declare( + async fn declare( &self, - account: &SingleOwnerAccount, + account: A, txn_config: &TxnConfig, - ) -> Result as Account>::SignError>> + ) -> Result::SignError>> where - P: Provider + Sync + Send, - S: Signer + Sync + Send, + A: ConnectedAccount + Send + Sync, + ::Provider: Send, { let (flattened_class, casm_class_hash) = prepare_contract_declaration_params(self.artifact_path())?; @@ -165,19 +167,20 @@ pub trait Declarable { #[cfg_attr(not(target_arch = "wasm32"), async_trait)] #[cfg_attr(target_arch = "wasm32", async_trait(?Send))] pub trait Deployable: Declarable + Sync { - async fn deploy_dojo_contract( + async fn deploy_dojo_contract( &self, world_address: FieldElement, class_hash: FieldElement, base_class_hash: FieldElement, - account: &SingleOwnerAccount, + account: A, txn_config: &TxnConfig, - ) -> Result as Account>::SignError>> + calldata: &[String], + ) -> Result::SignError>> where - P: Provider + Sync + Send, - S: Signer + Sync + Send, + A: ConnectedAccount + Send + Sync, + ::Provider: Send, { - let declare = match self.declare(account, txn_config).await { + let declare = match self.declare(&account, txn_config).await { Ok(res) => Some(res), Err(MigrationError::ClassAlreadyDeclared) => None, Err(e) => return Err(e), @@ -203,11 +206,18 @@ pub trait Deployable: Declarable + Sync { } } - Err(ProviderError::StarknetError(StarknetError::ContractNotFound)) => Call { - calldata: vec![self.salt(), class_hash], - selector: selector!("deploy_contract"), - to: world_address, - }, + Err(ProviderError::StarknetError(StarknetError::ContractNotFound)) => { + let init_calldata: Vec = calldata + .iter() + .map(|s| FieldElement::from_str(s)) + .collect::, _>>() + .map_err(|_| MigrationError::BadInitCalldata)?; + + let mut calldata = + vec![self.salt(), class_hash, FieldElement::from(calldata.len())]; + calldata.extend(init_calldata); + Call { calldata, selector: selector!("deploy_contract"), to: world_address } + } Ok(_) => { return Err(MigrationError::ContractAlreadyDeployed(contract_address)); @@ -236,18 +246,18 @@ pub trait Deployable: Declarable + Sync { }) } - async fn deploy( + async fn deploy( &self, class_hash: FieldElement, constructor_calldata: Vec, - account: &SingleOwnerAccount, + account: A, txn_config: &TxnConfig, - ) -> Result as Account>::SignError>> + ) -> Result::SignError>> where - P: Provider + Sync + Send, - S: Signer + Sync + Send, + A: ConnectedAccount + Send + Sync, + ::Provider: Send, { - let declare = match self.declare(account, txn_config).await { + let declare = match self.declare(&account, txn_config).await { Ok(res) => Some(res), Err(MigrationError::ClassAlreadyDeclared) => None, Err(e) => return Err(e), @@ -311,19 +321,19 @@ pub trait Deployable: Declarable + Sync { #[cfg_attr(not(target_arch = "wasm32"), async_trait)] #[cfg_attr(target_arch = "wasm32", async_trait(?Send))] pub trait Upgradable: Deployable + Declarable + Sync { - async fn upgrade_world( + async fn upgrade_world( &self, class_hash: FieldElement, original_class_hash: FieldElement, original_base_class_hash: FieldElement, - account: &SingleOwnerAccount, + account: A, txn_config: &TxnConfig, - ) -> Result as Account>::SignError>> + ) -> Result::SignError>> where - P: Provider + Sync + Send, - S: Signer + Sync + Send, + A: ConnectedAccount + Send + Sync, + ::Provider: Send, { - let declare = match self.declare(account, txn_config).await { + let declare = match self.declare(&account, txn_config).await { Ok(res) => Some(res), Err(MigrationError::ClassAlreadyDeclared) => None, Err(e) => return Err(e), diff --git a/crates/dojo-world/src/migration/strategy.rs b/crates/dojo-world/src/migration/strategy.rs index 8dddb832b0..258b34ea68 100644 --- a/crates/dojo-world/src/migration/strategy.rs +++ b/crates/dojo-world/src/migration/strategy.rs @@ -13,13 +13,19 @@ use super::contract::{ContractDiff, ContractMigration}; use super::world::WorldDiff; use super::MigrationType; -#[derive(Debug)] +#[derive(Debug, Clone)] +pub enum MigrationMetadata { + Contract(ContractDiff), +} + +#[derive(Debug, Clone)] pub struct MigrationStrategy { pub world_address: Option, pub world: Option, pub base: Option, pub contracts: Vec, pub models: Vec, + pub metadata: HashMap, } #[derive(Debug)] @@ -59,6 +65,37 @@ impl MigrationStrategy { MigrationItemsInfo { new, update } } + + pub fn resolve_variable(&mut self, world_address: FieldElement) -> Result<()> { + for contract in self.contracts.iter_mut() { + for field in contract.diff.init_calldata.iter_mut() { + if let Some(dependency) = field.strip_prefix("$contract_address:") { + let dependency_contract = self.metadata.get(dependency).unwrap(); + + match dependency_contract { + MigrationMetadata::Contract(c) => { + let contract_address = get_contract_address( + generate_salt(&c.name), + c.base_class_hash, + &[], + world_address, + ); + *field = contract_address.to_string(); + } + } + } else if let Some(dependency) = field.strip_prefix("$class_hash:") { + let dependency_contract = self.metadata.get(dependency).unwrap(); + match dependency_contract { + MigrationMetadata::Contract(c) => { + *field = c.local_class_hash.to_string(); + } + } + } + } + } + + Ok(()) + } } /// construct migration strategy @@ -69,6 +106,7 @@ pub fn prepare_for_migration( target_dir: &Utf8PathBuf, diff: WorldDiff, ) -> Result { + let mut metadata = HashMap::new(); let entries = fs::read_dir(target_dir).with_context(|| { format!( "Failed trying to read target directory ({target_dir})\nNOTE: build files are profile \ @@ -97,8 +135,12 @@ pub fn prepare_for_migration( // else we need to evaluate which contracts need to be migrated. let mut world = evaluate_contract_to_migrate(&diff.world, &artifact_paths, false)?; let base = evaluate_class_to_migrate(&diff.base, &artifact_paths, world.is_some())?; - let contracts = - evaluate_contracts_to_migrate(&diff.contracts, &artifact_paths, world.is_some())?; + let contracts = evaluate_contracts_to_migrate( + &diff.contracts, + &artifact_paths, + &mut metadata, + world.is_some(), + )?; let models = evaluate_models_to_migrate(&diff.models, &artifact_paths, world.is_some())?; // If world needs to be migrated, then we expect the `seed` to be provided. @@ -126,7 +168,7 @@ pub fn prepare_for_migration( world.contract_address = generated_world_address; } - Ok(MigrationStrategy { world_address, world, base, contracts, models }) + Ok(MigrationStrategy { world_address, world, base, contracts, models, metadata }) } fn evaluate_models_to_migrate( @@ -166,11 +208,13 @@ fn evaluate_class_to_migrate( fn evaluate_contracts_to_migrate( contracts: &[ContractDiff], artifact_paths: &HashMap, + metadata: &mut HashMap, world_contract_will_migrate: bool, ) -> Result> { let mut comps_to_migrate = vec![]; for c in contracts { + metadata.insert(c.name.clone(), MigrationMetadata::Contract(c.clone())); match c.remote_class_hash { Some(remote) if remote == c.local_class_hash && !world_contract_will_migrate => { continue; diff --git a/crates/dojo-world/src/migration/world.rs b/crates/dojo-world/src/migration/world.rs index 7fdad6e43d..27adf6c69a 100644 --- a/crates/dojo-world/src/migration/world.rs +++ b/crates/dojo-world/src/migration/world.rs @@ -1,7 +1,11 @@ use std::fmt::Display; +use std::mem; +use std::str::FromStr; +use anyhow::{bail, Result}; use convert_case::{Case, Casing}; use starknet_crypto::FieldElement; +use topological_sort::TopologicalSort; use super::class::ClassDiff; use super::contract::ContractDiff; @@ -74,6 +78,7 @@ impl WorldDiff { .find(|r| r.inner.class_hash() == contract.inner.class_hash()) .map(|r| *r.inner.class_hash()) }), + init_calldata: contract.inner.init_calldata.clone(), } }) .collect::>(); @@ -91,6 +96,7 @@ impl WorldDiff { original_class_hash: *local.world.inner.original_class_hash(), base_class_hash: *local.base.inner.class_hash(), remote_class_hash: remote.map(|m| *m.world.inner.class_hash()), + init_calldata: vec![], }; WorldDiff { world, base, contracts, models } @@ -107,6 +113,63 @@ impl WorldDiff { count += self.contracts.iter().filter(|s| !s.is_same()).count(); count } + + pub fn update_order(&mut self) -> Result<()> { + let mut ts = TopologicalSort::<&str>::new(); + + // make the dependency graph by reading the constructor_calldata + for contract in self.contracts.iter() { + let curr_name: &str = &contract.name; + ts.insert(curr_name); + + for field in &contract.init_calldata { + if let Some(dependency) = field.strip_prefix("$contract_address:") { + ts.add_dependency(dependency, curr_name); + } else if let Some(dependency) = field.strip_prefix("$class_hash:") { + ts.add_dependency(dependency, curr_name); + } else { + // verify its a field element + match FieldElement::from_str(field) { + Ok(_) => continue, + Err(e) => bail!(format!( + "Expected init_calldata element to be a special variable (i.e. \ + starting with $contract_address or $class_hash) or be a \ + FieldElement. Failed with error: {e:?}" + )), + } + } + } + } + + let mut calculated_order = vec![]; + + while !ts.is_empty() { + let mut values = ts.pop_all(); + // if `ts` is not empty and `pop_all` returns an empty vector it means there is a cyclic + // dependency see: https://docs.rs/topological-sort/latest/topological_sort/struct.TopologicalSort.html#method.pop_all + if values.is_empty() { + bail!("Cyclic dependency detected in `init_calldata`"); + } + + values.sort(); + calculated_order.extend(values); + } + + let mut new_contracts = vec![]; + + for c_name in calculated_order { + let contract = match self.contracts.iter().find(|c| c.name == c_name) { + Some(c) => c, + None => bail!("Unidentified contract found in `init_calldata`"), + }; + + new_contracts.push(contract.clone()); + } + + mem::swap(&mut self.contracts, &mut new_contracts); + + Ok(()) + } } impl Display for WorldDiff { diff --git a/crates/dojo-world/src/migration/world_test.rs b/crates/dojo-world/src/migration/world_test.rs index be50a4044c..e84e1b2cec 100644 --- a/crates/dojo-world/src/migration/world_test.rs +++ b/crates/dojo-world/src/migration/world_test.rs @@ -105,3 +105,70 @@ fn diff_when_local_and_remote_are_different() { assert!(diff.models.iter().any(|m| m.name == "dojo_mock::models::model_2")); assert!(diff.contracts.iter().any(|c| c.name == "dojo_mock::contracts::my_contract")); } + +#[test] +fn updating_order_as_expected() { + let init_calldata = vec![ + ("c4", vec!["$contract_address:c1", "0x0"]), + ("c3", vec!["0x0"]), + ("c5", vec!["$contract_address:c4", "0x0"]), + ("c7", vec!["$contract_address:c4", "0x0"]), + ("c2", vec!["0x0"]), + ("c6", vec!["$contract_address:c4", "$contract_address:c3", "0x0"]), + ("c1", vec!["0x0"]), + ]; + + let mut contracts = vec![]; + for calldata in init_calldata { + contracts.push(ContractDiff { + init_calldata: calldata.1.iter().map(|c| c.to_string()).collect(), + name: calldata.0.to_string(), + ..Default::default() + }); + } + + let mut diff = WorldDiff { + world: ContractDiff::default(), + base: ClassDiff::default(), + contracts, + models: vec![], + }; + + diff.update_order().unwrap(); + + let expected_order = ["c1", "c2", "c3", "c4", "c5", "c6", "c7"]; + for (i, contract) in diff.contracts.iter().enumerate() { + assert_eq!(contract.name, expected_order[i]); + } +} + +#[test] +fn updating_order_when_cyclic_dependency_fail() { + let init_calldata = vec![ + ("c4", vec!["$contract_address:c1", "$contract_address:c6", "0x0"]), + ("c3", vec!["0x0"]), + ("c5", vec!["$contract_address:c4", "0x0"]), + ("c7", vec!["$contract_address:c4", "0x0"]), + ("c2", vec!["0x0"]), + ("c6", vec!["$contract_address:c4", "$contract_address:c3", "0x0"]), + ("c1", vec!["0x0"]), + ]; + + let mut contracts = vec![]; + for calldata in init_calldata { + contracts.push(ContractDiff { + init_calldata: calldata.1.iter().map(|c| c.to_string()).collect(), + name: calldata.0.to_string(), + ..Default::default() + }); + } + + let mut diff = WorldDiff { + world: ContractDiff::default(), + base: ClassDiff::default(), + contracts, + models: vec![], + }; + + assert!(diff.update_order().is_err_and(|e| e.to_string().contains("Cyclic"))); +} diff --git a/crates/katana/rpc/rpc/src/starknet.rs b/crates/katana/rpc/rpc/src/starknet.rs index 4bc8e544a7..603dcff366 100644 --- a/crates/katana/rpc/rpc/src/starknet.rs +++ b/crates/katana/rpc/rpc/src/starknet.rs @@ -228,10 +228,16 @@ impl StarknetApiServer for StarknetApi { sequencer_address: block_env.sequencer_address, }; + // TODO(kariy): create a method that can perform this filtering for us instead + // of doing it manually. + + // A block should only include successful transactions, we filter out the failed + // ones (didn't pass validation stage). let transactions = executor .read() .transactions() .iter() + .filter(|(_, receipt)| receipt.is_success()) .map(|(tx, _)| tx.hash) .collect::>(); @@ -307,10 +313,16 @@ impl StarknetApiServer for StarknetApi { sequencer_address: block_env.sequencer_address, }; + // TODO(kariy): create a method that can perform this filtering for us instead + // of doing it manually. + + // A block should only include successful transactions, we filter out the failed + // ones (didn't pass validation stage). let transactions = executor .read() .transactions() .iter() + .filter(|(_, receipt)| receipt.is_success()) .map(|(tx, _)| tx.clone()) .collect::>(); diff --git a/crates/katana/rpc/rpc/tests/torii.rs b/crates/katana/rpc/rpc/tests/torii.rs index a1afc99780..64f57da019 100644 --- a/crates/katana/rpc/rpc/tests/torii.rs +++ b/crates/katana/rpc/rpc/tests/torii.rs @@ -3,13 +3,14 @@ use std::sync::Arc; use std::time::Duration; use dojo_test_utils::sequencer::{get_default_test_starknet_config, TestSequencer}; +use dojo_world::utils::TransactionWaiter; use jsonrpsee::http_client::HttpClientBuilder; use katana_core::sequencer::SequencerConfig; use katana_rpc_api::dev::DevApiClient; use katana_rpc_api::starknet::StarknetApiClient; use katana_rpc_api::torii::ToriiApiClient; use katana_rpc_types::transaction::{TransactionsPage, TransactionsPageCursor}; -use starknet::accounts::{Account, Call}; +use starknet::accounts::{Account, Call, ConnectedAccount}; use starknet::core::types::{FieldElement, TransactionStatus}; use starknet::core::utils::get_selector_from_name; use tokio::time::sleep; @@ -90,6 +91,8 @@ async fn test_get_transactions() { let deploy_txn = account.execute(vec![deploy_call]); let deploy_txn_future = deploy_txn.send().await.unwrap(); + TransactionWaiter::new(deploy_txn_future.transaction_hash, &account.provider()).await.unwrap(); + // Should properly increment to new pending block let response: TransactionsPage = client .get_transactions(TransactionsPageCursor { diff --git a/crates/katana/runner/runner-macro/Cargo.toml b/crates/katana/runner/runner-macro/Cargo.toml index 3388fce369..19dab27834 100644 --- a/crates/katana/runner/runner-macro/Cargo.toml +++ b/crates/katana/runner/runner-macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "runner-macro" -version = "0.7.0-alpha.4" +version = "0.7.2" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/katana/runner/src/lib.rs b/crates/katana/runner/src/lib.rs index 13a19fe771..3ad87a63ef 100644 --- a/crates/katana/runner/src/lib.rs +++ b/crates/katana/runner/src/lib.rs @@ -45,6 +45,8 @@ pub struct KatanaRunnerConfig { pub block_time: Option, /// The port to run the katana runner on, if None, a random free port is chosen. pub port: Option, + /// The path where to log info, if None, logs are stored in a temp dir. + pub log_path: Option, } impl Default for KatanaRunnerConfig { @@ -56,6 +58,7 @@ impl Default for KatanaRunnerConfig { port: None, program_name: None, run_name: None, + log_path: None, } } } @@ -102,14 +105,18 @@ impl KatanaRunner { let stdout = child.stdout.take().context("failed to take subprocess stdout")?; - let log_dir = TempDir::new().unwrap(); - let log_filename = PathBuf::from(format!( "katana-{}.log", config.run_name.clone().unwrap_or_else(|| port.to_string()) )); - let log_file_path = log_dir.join(log_filename); + let log_file_path = if let Some(log_path) = config.log_path { + log_path + } else { + let log_dir = TempDir::new().unwrap(); + log_dir.join(log_filename) + }; + let log_file_path_sent = log_file_path.clone(); let (sender, receiver) = mpsc::channel(); diff --git a/crates/saya/README.md b/crates/saya/README.md index f33e6514e4..a291ec3ca2 100644 --- a/crates/saya/README.md +++ b/crates/saya/README.md @@ -69,15 +69,6 @@ However, papyrus and blockifier which we depend on are still in `-dev` version, - cairo-lang (we should support `2.5` now) - scarb (breaking changes between 2.4 and 2.5 to be addresses, not required to only build saya and SNOS) -## Local Testing - -```bash -cargo run -r -p katana # Start an appchain -cargo run -r -p sozo -- build --manifest-path examples/spawn-and-move/Scarb.toml -cargo run -r -p sozo -- migrate --manifest-path examples/spawn-and-move/Scarb.toml # Make some transactions -cargo run -r --bin saya -- --rpc-url http://localhost:5050 # Run Saya -``` - ## Additional documentation [Hackmd note](https://hackmd.io/@glihm/saya) diff --git a/crates/saya/core/Cargo.toml b/crates/saya/core/Cargo.toml index 246bd8253f..4881647506 100644 --- a/crates/saya/core/Cargo.toml +++ b/crates/saya/core/Cargo.toml @@ -19,7 +19,7 @@ async-trait.workspace = true cairo-proof-parser.workspace = true cairo-vm.workspace = true convert_case.workspace = true -dojo-world = { workspace = true, features = [ "contracts", "metadata", "migration" ] } +dojo-world = { workspace = true, features = [ "contracts", "manifest", "metadata", "migration" ] } flate2.workspace = true futures.workspace = true itertools.workspace = true @@ -45,3 +45,6 @@ celestia-types = "0.1.1" cairo-felt = "0.9.1" num-bigint = "0.4.4" +num-traits = "0.2.18" + +prover-sdk = { git = "https://github.com/cartridge-gg/http-prover", rev = "7d00b05" } diff --git a/crates/saya/core/src/dojo_os/mod.rs b/crates/saya/core/src/dojo_os/mod.rs index 824bfdda3b..bf479bc8d3 100644 --- a/crates/saya/core/src/dojo_os/mod.rs +++ b/crates/saya/core/src/dojo_os/mod.rs @@ -9,7 +9,7 @@ use std::time::Duration; -use anyhow::bail; +use anyhow::{bail, Context}; use dojo_world::migration::TxnConfig; use dojo_world::utils::TransactionExt; use itertools::chain; @@ -52,13 +52,16 @@ pub async fn starknet_apply_diffs( world: FieldElement, new_state: Vec, program_output: Vec, + program_hash: FieldElement, + nonce: FieldElement, ) -> anyhow::Result { let calldata = chain![ - vec![FieldElement::from_dec_str(&(new_state.len() / 2).to_string()).unwrap()].into_iter(), + vec![FieldElement::from(new_state.len() as u64 / 2)].into_iter(), new_state.clone().into_iter(), - program_output.into_iter() + program_output.into_iter(), + vec![program_hash], ] - .collect::>(); + .collect(); let txn_config = TxnConfig { wait: true, receipt: true, ..Default::default() }; let tx = STARKNET_ACCOUNT @@ -67,9 +70,10 @@ pub async fn starknet_apply_diffs( selector: get_selector_from_name("upgrade_state").expect("invalid selector"), calldata, }]) + .nonce(nonce) .send_with_cfg(&txn_config) .await - .unwrap(); + .context("Failed to send `upgrade state` transaction.")?; let start_fetching = std::time::Instant::now(); let wait_for = Duration::from_secs(60); diff --git a/crates/saya/core/src/lib.rs b/crates/saya/core/src/lib.rs index dfd9883533..f3c98ef1de 100644 --- a/crates/saya/core/src/lib.rs +++ b/crates/saya/core/src/lib.rs @@ -1,28 +1,34 @@ //! Saya core library. +use std::ops::RangeInclusive; use std::sync::Arc; -use std::time::Duration; +use anyhow::Context; use cairo_proof_parser::output::{extract_output, ExtractOutputResult}; use cairo_proof_parser::parse; use cairo_proof_parser::program::{extract_program, ExtractProgramResult}; +use futures::future; use katana_primitives::block::{BlockNumber, FinalityStatus, SealedBlock, SealedBlockWithStatus}; +use katana_primitives::state::StateUpdatesWithDeclaredClasses; use katana_primitives::transaction::Tx; use katana_primitives::FieldElement; -use prover::ProverIdentifier; +use katana_rpc_types::trace::TxExecutionInfo; +use prover::{HttpProverParams, ProverIdentifier}; +pub use prover_sdk::ProverAccessKey; use saya_provider::rpc::JsonRpcProvider; use saya_provider::Provider as SayaProvider; use serde::{Deserialize, Serialize}; use starknet_crypto::poseidon_hash_many; -use tokio::time::sleep; +use tokio::fs::File; +use tokio::io::AsyncWriteExt; use tracing::{error, info, trace}; use url::Url; -use verifier::VerifierIdentifier; use crate::blockchain::Blockchain; use crate::data_availability::{DataAvailabilityClient, DataAvailabilityConfig}; use crate::error::SayaResult; -use crate::prover::{extract_messages, ProgramInput}; +use crate::prover::{extract_messages, ProgramInput, Scheduler}; +use crate::verifier::VerifierIdentifier; pub mod blockchain; pub mod data_availability; @@ -39,8 +45,11 @@ pub struct SayaConfig { #[serde(deserialize_with = "url_deserializer")] pub katana_rpc: Url, #[serde(deserialize_with = "url_deserializer")] - pub prover_url: Url, + pub url: Url, + pub private_key: ProverAccessKey, + pub store_proofs: bool, pub start_block: u64, + pub batch_size: usize, pub data_availability: Option, pub world_address: FieldElement, pub fact_registry_address: FieldElement, @@ -66,6 +75,14 @@ pub struct Saya { blockchain: Blockchain, } +struct FetchedBlockInfo { + block_number: BlockNumber, + block: SealedBlock, + prev_state_root: FieldElement, + state_updates: StateUpdatesWithDeclaredClasses, + exec_infos: Vec, +} + impl Saya { /// Initializes a new [`Saya`] instance from the given [`SayaConfig`]. /// @@ -99,7 +116,19 @@ impl Saya { let mut block = self.config.start_block.max(1); // Genesis block is not proven. We advance to block 1 let block_before_the_first = self.provider.fetch_block(block - 1).await; - let mut previous_block = block_before_the_first?; + let mut previous_block_state_root = block_before_the_first?.header.header.state_root; + + let prover_identifier = ProverIdentifier::Http(Arc::new(HttpProverParams { + prover_url: self.config.url.clone(), + prover_key: self.config.private_key.clone(), + })); + + // The structure responsible for proving. + let mut prove_scheduler = Scheduler::new( + self.config.batch_size, + self.config.world_address, + prover_identifier.clone(), + ); loop { let latest_block = match self.provider.block_number().await { @@ -117,48 +146,125 @@ impl Saya { continue; } - let fetched_block = self.provider.fetch_block(block).await?; + let (last_state_root, params) = + self.prefetch_blocks(block..=latest_block, previous_block_state_root).await?; + previous_block_state_root = last_state_root; + + // Updating the local state sequentially, as there is only one instance of + // `self.blockchain` This part does no actual proving, so should not be a + // problem + for p in params { + self.process_block(&mut prove_scheduler, block, p)?; + + if prove_scheduler.is_full() { + self.process_proven(prove_scheduler).await?; - self.process_block(block, (&fetched_block, previous_block)).await?; + prove_scheduler = Scheduler::new( + self.config.batch_size, + self.config.world_address, + prover_identifier.clone(), + ); + } - previous_block = fetched_block; - block += 1; + block += 1; + } } } + async fn prefetch_blocks( + &mut self, + block_numbers: RangeInclusive, + previous_block_state_root: FieldElement, + ) -> SayaResult<(FieldElement, Vec)> { + // Fetch all blocks from the current block to the latest block + let fetched_blocks = future::try_join_all( + block_numbers.clone().map(|block_number| self.provider.fetch_block(block_number)), + ) + .await?; + + // Shift the state roots to the right by one, as proof of each block is based on the + // previous state root + let mut state_roots = vec![previous_block_state_root]; + state_roots.extend(fetched_blocks.iter().map(|block| block.header.header.state_root)); + let previous_block_state_root = state_roots.pop().unwrap(); + + let mut state_updates_and_exec_info = vec![]; + + let (state_updates, da_state_updates): (Vec<_>, Vec<_>) = future::try_join_all( + block_numbers + .clone() + .map(|block_number| self.provider.fetch_state_updates(block_number)), + ) + .await? + .into_iter() + .unzip(); + let transactions_executions = future::try_join_all( + block_numbers + .clone() + .map(|block_number| self.provider.fetch_transactions_executions(block_number)), + ) + .await?; + + for da_state_update in da_state_updates { + if let Some(da) = &self.da_client { + // Publish state difference if DA client is available + da.publish_state_diff_felts(&da_state_update).await?; + } + } + + state_updates.into_iter().zip(transactions_executions.into_iter()).for_each( + |(state_updates, exec_info)| { + state_updates_and_exec_info.push((state_updates, exec_info)); + }, + ); + + // Prepare parameters + let params = fetched_blocks + .into_iter() + .zip(state_roots) + .zip(state_updates_and_exec_info) + .map(|((block, prev_state_root), (state_updates, exec_infos))| FetchedBlockInfo { + block_number: block.header.header.number, + block, + prev_state_root, + state_updates, + exec_infos, + }) + .collect::>(); + + trace!(target: LOG_TARGET, block_number = block_numbers.start(), to = block_numbers.end(), "Fetched blocks."); + + Ok((previous_block_state_root, params)) + } + /// Processes the given block number. /// /// # Summary /// - /// 1. Pulls state update to update local state accordingly. We may publish DA at this point. + /// 1. Update local state accordingly to pulled state. We may publish DA at this point. /// /// 2. Pulls all transactions and data required to generate the trace. /// /// 3. Computes facts for this state transition. We may optimistically register the facts. /// - /// 4. Computes the proof from the trace with a prover. - /// - /// 5. Registers the facts + the send the proof to verifier. Not all provers require this step - /// (a.k.a. SHARP). + /// 4. Starts computing the proof from the trace with a prover. /// /// # Arguments /// + /// * `prove_scheduler` - A parallel prove scheduler. /// * `block_number` - The block number. - async fn process_block( + /// * `block_info` - The block to process, along with the state roots of the previous block and + /// the genesis block. + fn process_block( &mut self, + prove_scheduler: &mut Scheduler, block_number: BlockNumber, - blocks: (&SealedBlock, SealedBlock), + block_info: FetchedBlockInfo, ) -> SayaResult<()> { trace!(target: LOG_TARGET, block_number = %block_number, "Processing block."); - let (block, prev_block) = blocks; - - let (state_updates, da_state_update) = - self.provider.fetch_state_updates(block_number).await?; - - if let Some(da) = &self.da_client { - da.publish_state_diff_felts(&da_state_update).await?; - } + let FetchedBlockInfo { block, prev_state_root, state_updates, exec_infos, block_number } = + block_info; let block = SealedBlockWithStatus { block: block.clone(), status: FinalityStatus::AcceptedOnL2 }; @@ -170,8 +276,6 @@ impl Saya { return Ok(()); } - let exec_infos = self.provider.fetch_transactions_executions(block_number).await?; - if exec_infos.is_empty() { trace!(target: LOG_TARGET, block_number, "Skipping empty block."); return Ok(()); @@ -191,50 +295,69 @@ impl Saya { let (message_to_starknet_segment, message_to_appchain_segment) = extract_messages(&exec_infos, &transactions); - let new_program_input = ProgramInput { - prev_state_root: prev_block.header.header.state_root, - block_number: FieldElement::from(block_number), + let mut state_diff_prover_input = ProgramInput { + prev_state_root, + block_number, block_hash: block.block.header.hash, config_hash: FieldElement::from(0u64), message_to_starknet_segment, message_to_appchain_segment, state_updates: state_updates_to_prove, + world_da: None, }; + state_diff_prover_input.fill_da(self.config.world_address); - let world_da = new_program_input.da_as_calldata(self.config.world_address); - let world_da_printable: Vec = world_da.iter().map(|x| x.to_string()).collect(); - trace!(target: LOG_TARGET, world_da = ?world_da_printable, "World DA computed."); + prove_scheduler.push_diff(state_diff_prover_input)?; - trace!(target: LOG_TARGET, "Proving block {block_number}."); - let proof = prover::prove( - new_program_input.serialize(self.config.world_address)?, - ProverIdentifier::Http(self.config.prover_url.clone()), - ) - .await?; - info!(target: LOG_TARGET, block_number, "Block proven."); + info!(target: LOG_TARGET, block_number, "Block processed."); + + Ok(()) + } + + /// Registers the facts + the send the proof to verifier. Not all provers require this step + /// (a.k.a. SHARP). + /// + /// # Arguments + /// + /// * `prove_scheduler` - A full parallel prove scheduler. + /// * `last_block` - The last block number in the `prove_scheduler`. + async fn process_proven(&self, prove_scheduler: Scheduler) -> SayaResult<()> { + // Prove each of the leaf nodes of the recursion tree and merge them into one + let (proof, state_diff, (_, last_block)) = + prove_scheduler.proved().await.context("Failed to prove.")?; + + if self.config.store_proofs { + let filename = format!("proof_{}.json", last_block); + let mut file = File::create(filename).await.context("Failed to create proof file.")?; + file.write_all(proof.as_bytes()).await.context("Failed to write proof.")?; + } let serialized_proof: Vec = parse(&proof)?.into(); + let world_da = state_diff.world_da.unwrap(); - trace!(target: LOG_TARGET, block_number, "Verifying block."); - let transaction_hash = verifier::verify( + trace!(target: LOG_TARGET, last_block, "Verifying block."); + let (transaction_hash, nonce_after) = verifier::verify( VerifierIdentifier::HerodotusStarknetSepolia(self.config.fact_registry_address), serialized_proof, ) .await?; - info!(target: LOG_TARGET, block_number, transaction_hash, "Block verified."); + info!(target: LOG_TARGET, last_block, transaction_hash, "Block verified."); let ExtractProgramResult { program: _, program_hash } = extract_program(&proof)?; let ExtractOutputResult { program_output, program_output_hash } = extract_output(&proof)?; let expected_fact = poseidon_hash_many(&[program_hash, program_output_hash]).to_string(); info!(target: LOG_TARGET, expected_fact, "Expected fact."); - sleep(Duration::from_millis(5000)).await; - - trace!(target: LOG_TARGET, block_number, "Applying diffs."); - let transaction_hash = - dojo_os::starknet_apply_diffs(self.config.world_address, world_da, program_output) - .await?; - info!(target: LOG_TARGET, block_number, transaction_hash, "Diffs applied."); + trace!(target: LOG_TARGET, last_block, "Applying diffs."); + let transaction_hash = dojo_os::starknet_apply_diffs( + self.config.world_address, + world_da, + program_output, + program_hash, + nonce_after + 1u64.into(), + ) + .await?; + info!(target: LOG_TARGET, last_block, transaction_hash, "Diffs applied."); Ok(()) } diff --git a/crates/saya/core/src/prover/client.rs b/crates/saya/core/src/prover/client.rs index 644b24e8a7..43f23b3a50 100644 --- a/crates/saya/core/src/prover/client.rs +++ b/crates/saya/core/src/prover/client.rs @@ -1,8 +1,36 @@ +use std::sync::Arc; + +use anyhow::Context; +use prover_sdk::{ProverSDK, ProverSdkErrors}; +use tokio::sync::OnceCell; +use tracing::trace; use url::Url; -pub async fn http_prove(prover_url: Url, input: String) -> anyhow::Result { - let client = reqwest::Client::new(); - let resp = client.post(prover_url).body(input).send().await?; - let result = resp.text().await?; - Ok(result) +use super::ProveProgram; +use crate::prover::loader::prepare_input_cairo0; +use crate::LOG_TARGET; + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct HttpProverParams { + pub prover_url: Url, + pub prover_key: prover_sdk::ProverAccessKey, +} + +static ONCE: OnceCell> = OnceCell::const_new(); + +pub async fn http_prove( + prover_params: Arc, + input: String, + prove_program: ProveProgram, +) -> anyhow::Result { + let prover = ONCE + .get_or_init(|| async { + trace!(target: LOG_TARGET, "Proving with cairo0."); + ProverSDK::new(prover_params.prover_key.clone(), prover_params.prover_url.clone()).await + }) + .await; + let prover = prover.as_ref().map_err(|e| anyhow::anyhow!(e.to_string()))?; + + let input = prepare_input_cairo0(input, prove_program).await?; + prover.prove_cairo0(input).await.context("Failed to prove using the http prover") } diff --git a/crates/saya/core/src/prover/extract.rs b/crates/saya/core/src/prover/extract.rs new file mode 100644 index 0000000000..7ae3cf7bdd --- /dev/null +++ b/crates/saya/core/src/prover/extract.rs @@ -0,0 +1,98 @@ +use anyhow::anyhow; +use katana_primitives::contract::ContractAddress; +use katana_primitives::state::StateUpdates; +use katana_primitives::FieldElement; +use num_traits::ToPrimitive; + +use super::{MessageToAppchain, MessageToStarknet, ProgramInput}; + +pub fn program_input_from_program_output( + output: Vec, + state_updates: StateUpdates, + world: FieldElement, +) -> anyhow::Result { + let prev_state_root = output[0]; + let block_number = serde_json::from_str(&output[2].to_string()).unwrap(); + let block_hash = output[3]; + let config_hash = output[4]; + let mut decimal = output[6].clone().to_big_decimal(0); // Convert with no decimal places + let num = decimal.to_u64().ok_or_else(|| anyhow!("Conversion to u64 failed"))?; + + let message_to_starknet_segment = match num { + 0..=3 => Default::default(), + 4..=u64::MAX => get_message_to_starknet_segment(&output[7..7 + num as usize])?, + }; + + let index = 7 + num as usize; + decimal = output[index].clone().to_big_decimal(0); + let num = decimal.to_u64().ok_or_else(|| anyhow!("Conversion to u64 failed"))?; + let message_to_appchain_segment = match num { + 0..=4 => Default::default(), + 5..=u64::MAX => { + get_message_to_appchain_segment(&output[index + 1..index + 1 + num as usize])? + } + }; + + let mut input = ProgramInput { + prev_state_root, + block_number, + block_hash, + config_hash, + message_to_starknet_segment, + message_to_appchain_segment, + state_updates, + world_da: None, + }; + + input.fill_da(world); + Ok(input) +} + +fn get_message_to_starknet_segment( + output: &[FieldElement], +) -> anyhow::Result> { + let mut message_to_starknet_segment: Vec = vec![]; + let mut index = 0; + loop { + if index >= output.len() { + break; + } + let from_address = ContractAddress::from(output[index]); + let to_address = ContractAddress::from(output[index + 1]); + let decimal = output[index + 2].to_big_decimal(0); + let num = decimal.to_u64().ok_or_else(|| anyhow!("Conversion to u64 failed"))?; + let payload = output[index + 3..index + 3 + num as usize].to_vec(); + message_to_starknet_segment.push(MessageToStarknet { from_address, to_address, payload }); + index += 3 + num as usize; + } + Ok(message_to_starknet_segment) +} + +fn get_message_to_appchain_segment( + output: &[FieldElement], +) -> anyhow::Result> { + let mut message_to_appchain_segment: Vec = vec![]; + let mut index = 0; + loop { + if index >= output.len() { + break; + } + let from_address = ContractAddress::from(output[index]); + let to_address = ContractAddress::from(output[index + 1]); + let nonce = output[index + 2]; + let selector = output[index + 3]; + let decimal = output[index + 4].to_big_decimal(0); + let num = decimal.to_u64().ok_or_else(|| anyhow!("Conversion to u64 failed"))?; + let payload = output[index + 5..index + 5 + num as usize].to_vec(); + + message_to_appchain_segment.push(MessageToAppchain { + from_address, + to_address, + nonce, + selector, + payload, + }); + index += 5 + num as usize; + } + Ok(message_to_appchain_segment) +} diff --git a/crates/saya/core/src/prover/loader.rs b/crates/saya/core/src/prover/loader.rs new file mode 100644 index 0000000000..9ae585aef7 --- /dev/null +++ b/crates/saya/core/src/prover/loader.rs @@ -0,0 +1,36 @@ +use std::env; +use std::path::PathBuf; + +use prover_sdk::Cairo0ProverInput; +use serde_json::Value; +use tokio::fs::File; +use tokio::io::AsyncReadExt; + +use super::ProveProgram; + +pub async fn load_program(prove_program: ProveProgram) -> anyhow::Result { + let manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR")?); + let program_file = match prove_program { + ProveProgram::Differ => manifest_dir.join("programs/cairo0differ.json"), + ProveProgram::Merger => manifest_dir.join("programs/cairo0merger.json"), + }; + let mut program_file = File::open(program_file).await?; + + let mut data = String::new(); + program_file.read_to_string(&mut data).await?; + let json_value: Value = serde_json::from_str(&data)?; + + Ok(json_value) +} + +pub async fn prepare_input_cairo0( + arguments: String, + prove_program: ProveProgram, +) -> anyhow::Result { + let program = load_program(prove_program).await?; + + let program = serde_json::from_str(&serde_json::to_string(&program)?)?; + let program_input: Value = serde_json::from_str(&arguments)?; + + Ok(Cairo0ProverInput { program, program_input, layout: "recursive".into() }) +} diff --git a/crates/saya/core/src/prover/mod.rs b/crates/saya/core/src/prover/mod.rs index 1739881ef7..420cce9bde 100644 --- a/crates/saya/core/src/prover/mod.rs +++ b/crates/saya/core/src/prover/mod.rs @@ -2,39 +2,52 @@ //! //! The prover is in charge of generating a proof from the cairo execution trace. use std::str::FromStr; +use std::sync::Arc; use anyhow::bail; use async_trait::async_trait; mod client; +pub mod extract; +mod loader; mod program_input; +mod scheduler; pub mod state_diff; mod stone_image; mod vec252; +pub use client::HttpProverParams; pub use program_input::*; -use serde::{Deserialize, Serialize}; +pub use scheduler::*; pub use stone_image::*; -use url::Url; use self::client::http_prove; /// The prover used to generate the proof. -#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Default)] pub enum ProverIdentifier { #[default] Stone, Sharp, Platinum, - Http(Url), + Http(Arc), } -pub async fn prove(input: String, prover: ProverIdentifier) -> anyhow::Result { +pub enum ProveProgram { + Differ, + Merger, +} + +pub async fn prove_diff( + input: String, + prover: ProverIdentifier, + program: ProveProgram, +) -> anyhow::Result { match prover { + ProverIdentifier::Http(params) => http_prove(params, input, program).await, + ProverIdentifier::Stone => prove_stone(input, program).await, ProverIdentifier::Sharp => todo!(), - ProverIdentifier::Stone => todo!(), ProverIdentifier::Platinum => todo!(), - ProverIdentifier::Http(prover_url) => http_prove(prover_url, input).await, } } @@ -44,10 +57,8 @@ pub trait ProverClient { fn identifier() -> ProverIdentifier; /// Generates the proof from the given trace. - /// At the moment prover is coupled with the program it proves. Because of this input should - /// correspond to the program. + /// The proven input has to be valid for the proving program. async fn prove(&self, input: String) -> anyhow::Result; - async fn local_verify(&self, proof: String) -> anyhow::Result<()>; } impl FromStr for ProverIdentifier { diff --git a/crates/saya/core/src/prover/program_input.rs b/crates/saya/core/src/prover/program_input.rs index 3bffdb6c9c..146f9ce111 100644 --- a/crates/saya/core/src/prover/program_input.rs +++ b/crates/saya/core/src/prover/program_input.rs @@ -1,22 +1,55 @@ +use std::str::FromStr; + +use anyhow::bail; use katana_primitives::contract::ContractAddress; use katana_primitives::state::StateUpdates; use katana_primitives::trace::{CallInfo, EntryPointType}; use katana_primitives::transaction::{L1HandlerTx, TxHash}; use katana_rpc_types::trace::TxExecutionInfo; +use serde::ser::{SerializeSeq, Serializer}; +use serde::{Deserialize, Deserializer, Serialize}; use starknet::core::types::FieldElement; -use super::state_diff::state_updates_to_json_like; - /// Based on https://github.com/cartridge-gg/piltover/blob/2be9d46f00c9c71e2217ab74341f77b09f034c81/src/snos_output.cairo#L19-L20 /// With the new state root computed by the prover. +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, Default)] pub struct ProgramInput { pub prev_state_root: FieldElement, - pub block_number: FieldElement, + pub block_number: u64, pub block_hash: FieldElement, pub config_hash: FieldElement, + #[serde(serialize_with = "MessageToStarknet::serialize_message_to_starknet")] + #[serde(deserialize_with = "MessageToStarknet::deserialize_message_to_starknet")] pub message_to_starknet_segment: Vec, + #[serde(serialize_with = "MessageToAppchain::serialize_message_to_appchain")] + #[serde(deserialize_with = "MessageToAppchain::deserialize_message_to_appchain")] pub message_to_appchain_segment: Vec, + #[serde(flatten)] pub state_updates: StateUpdates, + #[serde(serialize_with = "serialize_world_da")] + pub world_da: Option>, +} + +fn serialize_world_da( + element: &Option>, + serializer: S, +) -> Result +where + S: Serializer, +{ + if let Some(da) = element { + let mut seq = serializer.serialize_seq(Some(da.len()))?; + + for d in da { + let decimal = d.to_big_decimal(0); // Convert with no decimal places + let num = decimal.to_string(); + seq.serialize_element(&num)?; + } + + seq.end() + } else { + Err(serde::ser::Error::custom("Compute `world_da` first")) + } } fn get_messages_recursively(info: &CallInfo) -> Vec { @@ -43,7 +76,7 @@ fn get_messages_recursively(info: &CallInfo) -> Vec { pub fn extract_messages( exec_infos: &[TxExecutionInfo], - transactions: &[(TxHash, &L1HandlerTx)], + l1_transactions: &[(TxHash, &L1HandlerTx)], ) -> (Vec, Vec) { // extract messages to starknet (ie l2 -> l1) let message_to_starknet_segment = exec_infos @@ -57,8 +90,8 @@ pub fn extract_messages( // get the call infos from the trace and the corresponding tx hash let calls = exec_infos.iter().filter_map(|t| { let calls = t.trace.execute_call_info.as_ref()?; - let tx = transactions.iter().find(|tx| tx.0 == t.hash).expect("qed; tx must exist"); - Some((tx.1, calls)) + // Not present if not a l1 handler tx. + l1_transactions.iter().find(|tx| tx.0 == t.hash).map(|(_, tx)| (tx, calls)) }); // filter only the l1 handler tx @@ -80,49 +113,76 @@ pub fn extract_messages( } impl ProgramInput { - pub fn serialize(&self, world: FieldElement) -> anyhow::Result { - let message_to_starknet = self - .message_to_starknet_segment + /// Extracts the storage updates for the given world, and flattens them into a single vector + /// that represent the serialized DA. The length is not included as the array contains + /// serialiazed struct with two members: key and value. + /// TODO: migrate to cainome + simple rust vec for better devX in the future. + pub fn fill_da(&mut self, world: FieldElement) { + let updates = self + .state_updates + .storage_updates + .get(&ContractAddress::from(world)) + .unwrap_or(&std::collections::HashMap::new()) .iter() - .map(MessageToStarknet::serialize) - .collect::>>()? - .into_iter() - .flatten() - .map(|e| format!("{}", e)) - .collect::>() - .join(","); + .flat_map(|(k, v)| vec![*k, *v]) + .collect::>(); - let message_to_appchain = self - .message_to_appchain_segment - .iter() - .map(|m| m.serialize()) - .collect::>>()? - .into_iter() - .flatten() - .map(|e| format!("{}", e)) - .collect::>() - .join(","); + self.world_da = Some(updates); + } - let mut result = String::from('{'); - result.push_str(&format!(r#""prev_state_root":{},"#, self.prev_state_root)); - result.push_str(&format!(r#""block_number":{},"#, self.block_number)); - result.push_str(&format!(r#""block_hash":{},"#, self.block_hash)); - result.push_str(&format!(r#""config_hash":{},"#, self.config_hash)); + pub fn combine(mut self, latter: ProgramInput) -> anyhow::Result { + self.message_to_appchain_segment.extend(latter.message_to_appchain_segment); + self.message_to_starknet_segment.extend(latter.message_to_starknet_segment); - result.push_str(&format!(r#""message_to_starknet_segment":[{}],"#, message_to_starknet)); - result.push_str(&format!(r#""message_to_appchain_segment":[{}],"#, message_to_appchain)); + // the later state should overwrite the previous one. + latter.state_updates.contract_updates.into_iter().for_each(|(k, v)| { + self.state_updates.contract_updates.insert(k, v); + }); + latter.state_updates.declared_classes.into_iter().for_each(|(k, v)| { + self.state_updates.declared_classes.insert(k, v); + }); + latter.state_updates.nonce_updates.into_iter().for_each(|(k, v)| { + self.state_updates.nonce_updates.insert(k, v); + }); + latter.state_updates.storage_updates.into_iter().for_each(|(c, h)| { + h.into_iter().for_each(|(k, v)| { + self.state_updates.storage_updates.entry(c).or_default().insert(k, v); + }); + }); - result.push_str(&state_updates_to_json_like(&self.state_updates, world)); + if self.world_da.is_none() || latter.world_da.is_none() { + bail!("Both world_da must be present to combine them"); + } - result.push('}'); + let mut world_da = self.world_da.unwrap_or_default(); + for later in latter.world_da.unwrap_or_default().chunks(2) { + let mut replaced = false; + for earlier in world_da.chunks_mut(2) { + if later[0] == earlier[0] { + earlier[1] = later[1]; + replaced = true; + continue; + } + } - Ok(result) + if !replaced { + world_da.extend(later) + } + } + + // The block number is the one from the last block. + Ok(ProgramInput { + prev_state_root: self.prev_state_root, + block_number: latter.block_number, + block_hash: latter.block_hash, + config_hash: self.config_hash, + message_to_appchain_segment: self.message_to_appchain_segment, + message_to_starknet_segment: self.message_to_starknet_segment, + state_updates: self.state_updates, + world_da: Some(world_da), + }) } - /// Extracts the storage updates for the given world, and flattens them into a single vector - /// that represent the serialized DA. The length is not included as the array contains - /// serialiazed struct with two members: key and value. - /// TODO: migrate to cainome + simple rust vec for better devX in the future. pub fn da_as_calldata(&self, world: FieldElement) -> Vec { let updates = self .state_updates @@ -135,9 +195,80 @@ impl ProgramInput { updates } + + fn serialize_to_prover_args(&self) -> Vec { + let mut out = vec![ + self.prev_state_root, + FieldElement::from(self.block_number), + self.block_hash, + self.config_hash, + ]; + + out.push(FieldElement::from(self.state_updates.nonce_updates.len())); + for (k, v) in &self.state_updates.nonce_updates { + out.push(**k); + out.push(*v); + } + + out.push(FieldElement::from(self.state_updates.storage_updates.len())); + for (c, h) in &self.state_updates.storage_updates { + out.push(**c); + out.push(FieldElement::from(h.len())); + for (k, v) in h { + out.push(*k); + out.push(*v); + } + } + + out.push(FieldElement::from(self.state_updates.contract_updates.len())); + for (k, v) in &self.state_updates.contract_updates { + out.push(**k); + out.push(*v); + } + + out.push(FieldElement::from(self.state_updates.declared_classes.len())); + for (k, v) in &self.state_updates.declared_classes { + out.push(*k); + out.push(*v); + } + + let starknet_messages = self + .message_to_starknet_segment + .iter() + .flat_map(|m| m.serialize().unwrap()) + .collect::>(); + out.push(FieldElement::from(starknet_messages.len())); + out.extend(starknet_messages); + + let appchain_messages = self + .message_to_appchain_segment + .iter() + .flat_map(|m| m.serialize().unwrap()) + .collect::>(); + + out.push(FieldElement::from(appchain_messages.len())); + out.extend(appchain_messages); + + out.push(FieldElement::from(self.world_da.as_ref().unwrap().len() / 2)); + out.extend(self.world_da.as_ref().unwrap().iter().cloned()); + + out.push(FieldElement::from(0u64)); // Proofs + + out + } + + pub fn prepare_differ_args(inputs: Vec) -> String { + let serialized = + inputs.iter().flat_map(|input| input.serialize_to_prover_args()).collect::>(); + + let joined = serialized.iter().map(|f| f.to_big_decimal(0).to_string()).collect::>(); + + format!("[{} {}]", inputs.len(), joined.join(" ")) + } } /// Based on https://github.com/cartridge-gg/piltover/blob/2be9d46f00c9c71e2217ab74341f77b09f034c81/src/messaging/output_process.cairo#L16 +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, Default, PartialOrd, Ord)] pub struct MessageToStarknet { pub from_address: ContractAddress, pub to_address: ContractAddress, @@ -145,15 +276,88 @@ pub struct MessageToStarknet { } impl MessageToStarknet { + pub fn serialize_message_to_starknet( + messages: &[MessageToStarknet], + serializer: S, + ) -> Result + where + S: Serializer, + { + let mut seq = serializer.serialize_seq(Some(messages.len()))?; + for message in messages { + let serialized = message.serialize().unwrap(); + // Instead of adding serialized as an array, add each element individually + for field_element in serialized { + let decimal = field_element.to_big_decimal(0); // Assuming no decimal places for simplicity + let num = decimal.to_string(); + seq.serialize_element(&num)?; + } + } + seq.end() + } + pub fn serialize(&self) -> anyhow::Result> { let mut result = vec![*self.from_address, *self.to_address]; result.push(FieldElement::from(self.payload.len())); result.extend(self.payload.iter().cloned()); Ok(result) } + + fn deserialize_message_to_starknet<'de, D>( + deserializer: D, + ) -> Result, D::Error> + where + D: Deserializer<'de>, + { + struct MessageToStarknetVisitor; + + impl<'de> serde::de::Visitor<'de> for MessageToStarknetVisitor { + type Value = Vec; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("a flat list of integers for MessageToStarknet") + } + + fn visit_seq(self, mut seq: V) -> Result + where + V: serde::de::SeqAccess<'de>, + { + let mut messages = Vec::new(); + while let Some(from_address) = seq + .next_element::()? + .map(|num| FieldElement::from_str(&num.to_string()).unwrap()) + { + let to_address = seq + .next_element::()? + .map(|num| FieldElement::from_str(&num.to_string()).unwrap()) + .unwrap_or_default(); + let payload_length_str = seq.next_element::()?.unwrap_or_default(); + let payload_length: usize = payload_length_str.parse().unwrap_or_default(); + let mut payload = Vec::new(); + for _ in 0..payload_length { + if let Some(element) = seq + .next_element::()? + .map(|num| FieldElement::from_str(&num.to_string()).unwrap()) + { + payload.push(element); + } + } + messages.push(MessageToStarknet { + from_address: ContractAddress::from(from_address), + to_address: ContractAddress::from(to_address), + payload, + }); + } + Ok(messages) + } + } + + deserializer.deserialize_seq(MessageToStarknetVisitor) + } } /// Based on https://github.com/cartridge-gg/piltover/blob/2be9d46f00c9c71e2217ab74341f77b09f034c81/src/messaging/output_process.cairo#L28 +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, Default, PartialOrd, Ord)] pub struct MessageToAppchain { pub from_address: ContractAddress, pub to_address: ContractAddress, @@ -163,27 +367,210 @@ pub struct MessageToAppchain { } impl MessageToAppchain { + pub fn serialize_message_to_appchain( + messages: &[MessageToAppchain], + serializer: S, + ) -> Result + where + S: Serializer, + { + let mut seq = serializer.serialize_seq(Some(messages.len()))?; + for message in messages { + let serialized = message.serialize().unwrap(); + for field_element in serialized { + let decimal = field_element.to_big_decimal(0); // Assuming no decimal places for simplicity + let num = decimal.to_string(); + seq.serialize_element(&num)?; + } + } + seq.end() + } + pub fn serialize(&self) -> anyhow::Result> { let mut result = vec![*self.from_address, *self.to_address, self.nonce, self.selector]; result.push(FieldElement::from(self.payload.len())); result.extend(self.payload.iter().cloned()); Ok(result) } + + fn deserialize_message_to_appchain<'de, D>( + deserializer: D, + ) -> Result, D::Error> + where + D: Deserializer<'de>, + { + struct MessageToAppchainVisitor; + + impl<'de> serde::de::Visitor<'de> for MessageToAppchainVisitor { + type Value = Vec; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("a flat list of integers for MessageToAppchain") + } + + fn visit_seq(self, mut seq: V) -> Result + where + V: serde::de::SeqAccess<'de>, + { + let mut messages = Vec::new(); + while let Some(from_address) = seq + .next_element::()? + .map(|num| FieldElement::from_str(&num.to_string()).unwrap()) + { + let to_address = seq + .next_element::()? + .map(|num| FieldElement::from_str(&num.to_string()).unwrap()) + .unwrap_or_default(); + let nonce = seq + .next_element::()? + .map(|num| FieldElement::from_str(&num.to_string()).unwrap()) + .unwrap_or_default(); + let selector = seq + .next_element::()? + .map(|num| FieldElement::from_str(&num.to_string()).unwrap()) + .unwrap_or_default(); + let payload_length_str = seq.next_element::()?.unwrap_or_default(); + let payload_length: usize = payload_length_str.parse().unwrap_or_default(); + let mut payload = Vec::new(); + for _ in 0..payload_length { + if let Some(element) = seq + .next_element::()? + .map(|num| FieldElement::from_str(&num.to_string()).unwrap()) + { + payload.push(element); + } + } + messages.push(MessageToAppchain { + from_address: ContractAddress::from(from_address), + to_address: ContractAddress::from(to_address), + nonce, + selector, + payload, + }); + } + Ok(messages) + } + } + + deserializer.deserialize_seq(MessageToAppchainVisitor) + } +} + +#[test] +fn test_deserialize_input() -> anyhow::Result<()> { + use std::str::FromStr; + + let input = r#"{ + "prev_state_root":"101", + "block_number":102, + "block_hash":"103", + "config_hash":"104", + "message_to_starknet_segment":["105","106","1","1"], + "message_to_appchain_segment":["108","109","110","111","1","112"], + "storage_updates":{ + "42": { + "2010": "1200", + "2012": "1300" + } + }, + "nonce_updates":{ + "1111": "22222", + "1116": "22223" + }, + "contract_updates":{ + "3": "437267489" + }, + "declared_classes":{ + "1234": "12345" + } + }"#; + + let mut expected = ProgramInput { + prev_state_root: FieldElement::from_str("101")?, + block_number: 102, + block_hash: FieldElement::from_str("103")?, + config_hash: FieldElement::from_str("104")?, + message_to_starknet_segment: vec![MessageToStarknet { + from_address: ContractAddress::from(FieldElement::from_str("105")?), + to_address: ContractAddress::from(FieldElement::from_str("106")?), + payload: vec![FieldElement::from_str("1")?], + }], + message_to_appchain_segment: vec![MessageToAppchain { + from_address: ContractAddress::from(FieldElement::from_str("108")?), + to_address: ContractAddress::from(FieldElement::from_str("109")?), + nonce: FieldElement::from_str("110")?, + selector: FieldElement::from_str("111")?, + payload: vec![FieldElement::from_str("112")?], + }], + state_updates: StateUpdates { + storage_updates: vec![( + ContractAddress::from(FieldElement::from_str("42")?), + vec![ + (FieldElement::from_str("2010")?, FieldElement::from_str("1200")?), + (FieldElement::from_str("2012")?, FieldElement::from_str("1300")?), + ] + .into_iter() + .collect(), + )] + .into_iter() + .collect(), + + nonce_updates: vec![ + ( + ContractAddress::from(FieldElement::from_str("1111")?), + FieldElement::from_str("22222")?, + ), + ( + ContractAddress::from(FieldElement::from_str("1116")?), + FieldElement::from_str("22223")?, + ), + ] + .into_iter() + .collect(), + + contract_updates: vec![( + ContractAddress::from(FieldElement::from_str("3")?), + FieldElement::from_str("437267489")?, + )] + .into_iter() + .collect(), + + declared_classes: vec![( + FieldElement::from_str("1234")?, + FieldElement::from_str("12345")?, + )] + .into_iter() + .collect(), + }, + world_da: None, + }; + let mut deserialized = serde_json::from_str::(input)?; + assert_eq!(expected, deserialized); + + deserialized.fill_da(FieldElement::from_str("42")?); + expected.world_da = Some(vec![ + FieldElement::from_str("2010")?, + FieldElement::from_str("1200")?, + FieldElement::from_str("2012")?, + FieldElement::from_str("1300")?, + ]); + + Ok(()) } #[test] -fn test_program_input() -> anyhow::Result<()> { +fn test_serialize_input() -> anyhow::Result<()> { use std::str::FromStr; let input = ProgramInput { prev_state_root: FieldElement::from_str("101")?, - block_number: FieldElement::from_str("102")?, + block_number: 102, block_hash: FieldElement::from_str("103")?, config_hash: FieldElement::from_str("104")?, message_to_starknet_segment: vec![MessageToStarknet { from_address: ContractAddress::from(FieldElement::from_str("105")?), to_address: ContractAddress::from(FieldElement::from_str("106")?), - payload: vec![FieldElement::from_str("107")?], + payload: vec![FieldElement::from_str("1")?], }], message_to_appchain_segment: vec![MessageToAppchain { from_address: ContractAddress::from(FieldElement::from_str("108")?), @@ -193,45 +580,100 @@ fn test_program_input() -> anyhow::Result<()> { payload: vec![FieldElement::from_str("112")?], }], state_updates: StateUpdates { - nonce_updates: std::collections::HashMap::new(), storage_updates: vec![( - ContractAddress::from(FieldElement::from_str("113")?), - vec![(FieldElement::from_str("114")?, FieldElement::from_str("115")?)] - .into_iter() - .collect(), + ContractAddress::from(FieldElement::from_str("42")?), + vec![ + (FieldElement::from_str("2010")?, FieldElement::from_str("1200")?), + (FieldElement::from_str("2012")?, FieldElement::from_str("1300")?), + ] + .into_iter() + .collect(), + )] + .into_iter() + .collect(), + + nonce_updates: vec![ + ( + ContractAddress::from(FieldElement::from_str("1111")?), + FieldElement::from_str("22222")?, + ), + ( + ContractAddress::from(FieldElement::from_str("1116")?), + FieldElement::from_str("22223")?, + ), + ] + .into_iter() + .collect(), + + contract_updates: vec![( + ContractAddress::from(FieldElement::from_str("3")?), + FieldElement::from_str("437267489")?, + )] + .into_iter() + .collect(), + + declared_classes: vec![( + FieldElement::from_str("1234")?, + FieldElement::from_str("12345")?, )] .into_iter() .collect(), - contract_updates: std::collections::HashMap::new(), - declared_classes: std::collections::HashMap::new(), }, + world_da: Some(vec![ + FieldElement::from_str("2010")?, + FieldElement::from_str("1200")?, + FieldElement::from_str("2012")?, + FieldElement::from_str("1300")?, + ]), }; - // Serialize with the DA. - let serialized_with_da = input.serialize(FieldElement::from_str("113")?).unwrap(); - println!("Serialized: {}", serialized_with_da); - pub const EXPECTED_WITH_DA: &str = r#"{ - "prev_state_root": 101, - "block_number": 102, - "block_hash": 103, - "config_hash": 104, - "message_to_starknet_segment": [105,106,1,107], - "message_to_appchain_segment": [108,109,110,111,1,112], - "nonce_updates": {}, - "storage_updates": {"113":{"114":115}}, - "contract_updates": {}, - "declared_classes": {}, - "world_da": [114, 115] - }"#; - - let expected = EXPECTED_WITH_DA.chars().filter(|c| !c.is_whitespace()).collect::(); - println!("{}", expected); - assert_eq!(serialized_with_da, expected); - - // Serialize just the DA as calldata. The length is not included, only the array of - // updates [key, value, key, value...]. - let da_calldata = input.da_as_calldata(FieldElement::from_str("113")?); - assert_eq!(da_calldata, vec![FieldElement::from_str("114")?, FieldElement::from_str("115")?]); + let serialized = serde_json::to_string::(&input.clone())?; + let deserialized = serde_json::from_str::(&serialized)?; + assert_eq!(input, deserialized); + + Ok(()) +} + +#[test] +fn test_serialize_to_prover_args() -> anyhow::Result<()> { + let input = r#"{ + "prev_state_root":"101", + "block_number":102, + "block_hash":"103", + "config_hash":"104", + "nonce_updates":{ + "1111": "22222" + }, + "storage_updates":{ + "333": { + "4444": "555" + } + }, + "contract_updates":{ + "66666": "7777" + }, + "declared_classes":{ + "88888": "99999" + }, + "message_to_starknet_segment":["123","456","123","128"], + "message_to_appchain_segment":["108","109","110","111","1","112"] + }"#; + let mut input = serde_json::from_str::(input)?; + input.fill_da(FieldElement::from_str("333")?); + + println!("{:?}", input); + + let serialized = input.serialize_to_prover_args(); + + let expected = vec![ + 101, 102, 103, 104, 1, 1111, 22222, 1, 333, 1, 4444, 555, 1, 66666, 7777, 1, 88888, 99999, + 4, 123, 456, 1, 128, 6, 108, 109, 110, 111, 1, 112, 1, 4444, 555, 0u64, + ] + .into_iter() + .map(FieldElement::from) + .collect::>(); + + assert_eq!(serialized, expected); Ok(()) } diff --git a/crates/saya/core/src/prover/scheduler.rs b/crates/saya/core/src/prover/scheduler.rs new file mode 100644 index 0000000000..3f90eab46f --- /dev/null +++ b/crates/saya/core/src/prover/scheduler.rs @@ -0,0 +1,222 @@ +use anyhow::{bail, Context}; +use cairo_proof_parser::output::{extract_output, ExtractOutputResult}; +use futures::future::BoxFuture; +use futures::FutureExt; +use katana_primitives::state::StateUpdates; +use katana_primitives::FieldElement; +use tokio::sync::{mpsc, oneshot}; +use tracing::{info, trace}; + +use super::{prove_diff, ProgramInput, ProverIdentifier}; +use crate::prover::extract::program_input_from_program_output; +use crate::prover::ProveProgram; +use crate::LOG_TARGET; + +type Proof = String; + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum ProvingState { + Proving, + Proved, + NotPushed, +} +type ProvingStateWithBlock = (u64, ProvingState); + +pub struct Scheduler { + root_task: BoxFuture<'static, anyhow::Result<(Proof, ProgramInput)>>, + free_differs: Vec>, + proving_tasks: Vec, + update_channel: mpsc::Receiver, + block_range: (u64, u64), +} + +impl Scheduler { + pub fn new(capacity: usize, world: FieldElement, prover: ProverIdentifier) -> Self { + let (senders, receivers): (Vec<_>, Vec<_>) = + (0..capacity).map(|_| oneshot::channel::()).unzip(); + + let (update_sender, update_channel) = mpsc::channel(capacity * 2); + let root_task = prove_recursively(receivers, world, prover, update_sender); + + Scheduler { + root_task, + free_differs: senders, + proving_tasks: Vec::with_capacity(capacity), + update_channel, + block_range: (u64::MAX, 0), + } + } + + pub fn is_full(&self) -> bool { + self.free_differs.is_empty() + } + + pub fn push_diff(&mut self, input: ProgramInput) -> anyhow::Result<()> { + if self.is_full() { + bail!("Scheduler is full"); + } + let block_number = input.block_number; + + let sender = self.free_differs.remove(0); + + if sender.send(input).is_err() { + bail!("Failed to send input to differ"); + } + + self.block_range = + (self.block_range.0.min(block_number), self.block_range.1.max(block_number)); + + Ok(()) + } + + pub async fn proved(self) -> anyhow::Result<(Proof, ProgramInput, (u64, u64))> { + let (proof, input) = self.root_task.await?; + Ok((proof, input, self.block_range)) + } + + pub async fn merge( + inputs: Vec, + world: FieldElement, + prover: ProverIdentifier, + ) -> anyhow::Result<(Proof, ProgramInput)> { + let mut scheduler = Scheduler::new(inputs.len(), world, prover); + let number_of_inputs = inputs.len(); + trace!(target: LOG_TARGET, number_of_inputs, "Pushing inputs to scheduler"); + for input in inputs { + scheduler.push_diff(input)?; + } + info!(target: LOG_TARGET, number_of_inputs, "inputs pushed to scheduler"); + let (merged_proof, merged_input, _) = scheduler.proved().await?; + Ok((merged_proof, merged_input)) + } + + pub async fn query(&mut self, block_number: u64) -> anyhow::Result { + while !self.update_channel.is_empty() { + let (block_number, state) = + self.update_channel.recv().await.context("Failed to recv")?; + + match state { + ProvingState::Proved => { + if let Some((_, s)) = + self.proving_tasks.iter_mut().find(|(n, _)| *n == block_number) + { + *s = ProvingState::Proved; + } else { + bail!("Block number {} was not found in proving tasks", block_number); + } + } + ProvingState::Proving => { + self.proving_tasks.push((block_number, ProvingState::Proved)); + } + _ => { + unreachable!("Update should be either Proving or Proved"); + } + } + } + + match self.proving_tasks.iter().find(|(n, _)| *n == block_number) { + Some((_, s)) => Ok(*s), + None => Ok(ProvingState::NotPushed), + } + } +} + +#[derive(serde::Serialize, serde::Deserialize)] +struct CombinedInputs { + earlier: ProgramInput, + later: ProgramInput, +} + +async fn combine_proofs( + first: Proof, + second: Proof, + prover: ProverIdentifier, + state_updates1: StateUpdates, + state_updates2: StateUpdates, + world: FieldElement, + number_of_inputs: usize, +) -> anyhow::Result { + let ExtractOutputResult { program_output: program_output1, program_output_hash: _ } = + extract_output(&first)?; + let ExtractOutputResult { program_output: program_output2, program_output_hash: _ } = + extract_output(&second)?; + + let earlier_input = + program_input_from_program_output(program_output1, state_updates1, world).unwrap(); + let later_input = + program_input_from_program_output(program_output2, state_updates2, world).unwrap(); + + let world = format!("{:x}", world); + trace!(target: LOG_TARGET, number_of_inputs, world, "Merging proofs"); + + let prover_input = + serde_json::to_string(&CombinedInputs { earlier: earlier_input, later: later_input })?; + + let merged_proof = prove_diff(prover_input, prover, ProveProgram::Merger).await?; + + Ok(merged_proof) +} + +/// Handles the recursive proving of blocks using asynchronous futures. +/// Returns a proof string asynchronously. +/// It returns a BoxFuture to allow for dynamic dispatch of futures, useful in recursive async +/// calls. +fn prove_recursively( + mut inputs: Vec>, + world: FieldElement, + prover: ProverIdentifier, + update_channel: mpsc::Sender<(u64, ProvingState)>, +) -> BoxFuture<'static, anyhow::Result<(Proof, ProgramInput)>> { + let handle = tokio::spawn(async move { + if inputs.len() == 1 { + let mut input = inputs.pop().unwrap().await.unwrap(); + input.fill_da(world); + let block_number = input.block_number; + trace!(target: LOG_TARGET, block_number, "Proving block"); + update_channel.send((block_number, ProvingState::Proving)).await.unwrap(); + + let prover_input = serde_json::to_string(&input.clone()).unwrap(); + let proof = prove_diff(prover_input, prover, ProveProgram::Differ).await?; + + info!(target: LOG_TARGET, block_number, "Block proven"); + update_channel.send((block_number, ProvingState::Proved)).await.unwrap(); + Ok((proof, input)) + } else { + let proof_count = inputs.len(); + let last = inputs.split_off(proof_count / 2); + + let provers = (prover.clone(), prover.clone()); + + let second_update_sender = update_channel.clone(); + let (earlier_result, later_result) = tokio::try_join!( + tokio::spawn(async move { + prove_recursively(inputs, world, provers.0, update_channel).await + }), + tokio::spawn(async move { + prove_recursively(last, world, provers.1, second_update_sender).await + }), + )?; + + let ((earlier_result, earlier_input), (later_result, later_input)) = + (earlier_result?, later_result?); + + let input = earlier_input.clone().combine(later_input.clone())?; + let merged_proofs = combine_proofs( + earlier_result, + later_result, + prover, + earlier_input.state_updates, + later_input.state_updates, + world, + proof_count, + ) + .await?; + + let first_proven = earlier_input.block_number; + info!(target: LOG_TARGET, first_proven, proof_count, "Merged proofs"); + Ok((merged_proofs, input)) + } + }); + + async move { handle.await? }.boxed() +} diff --git a/crates/saya/core/src/prover/state_diff.rs b/crates/saya/core/src/prover/state_diff.rs index 0c766b646e..2155688533 100644 --- a/crates/saya/core/src/prover/state_diff.rs +++ b/crates/saya/core/src/prover/state_diff.rs @@ -1,4 +1,3 @@ -use katana_primitives::contract::ContractAddress; use katana_primitives::state::StateUpdates; use starknet::core::types::FieldElement; @@ -55,64 +54,6 @@ pub const EXAMPLE_KATANA_DIFF: &str = r#"{ } }"#; -pub fn state_updates_to_json_like(state_updates: &StateUpdates, world: FieldElement) -> String { - let mut result = String::new(); - - result.push_str(&format!(r#""nonce_updates":{}"#, "{")); - let nonce_updates = state_updates - .nonce_updates - .iter() - .map(|(k, v)| format!(r#""{}":{}"#, k.0, v)) - .collect::>() - .join(","); - result.push_str(&format!("{}{}", nonce_updates, "}")); - - result.push_str(&format!(r#","storage_updates":{}"#, "{")); - let storage_updates = state_updates - .storage_updates - .iter() - .map(|(k, v)| { - let storage = - v.iter().map(|(k, v)| format!(r#""{}":{}"#, k, v)).collect::>().join(","); - - format!(r#""{}":{{{}}}"#, k.0, storage) - }) - .collect::>() - .join(","); - result.push_str(&format!("{}{}", storage_updates, "}")); - - result.push_str(&format!(r#","contract_updates":{}"#, "{")); - let contract_updates = state_updates - .contract_updates - .iter() - .map(|(k, v)| format!(r#""{}":{}"#, k.0, v)) - .collect::>() - .join(","); - result.push_str(&format!("{}{}", contract_updates, "}")); - - result.push_str(&format!(r#","declared_classes":{}"#, "{")); - let declared_classes = state_updates - .declared_classes - .iter() - .map(|(k, v)| format!(r#""{}":{}"#, k, v)) - .collect::>() - .join(","); - - result.push_str(&format!("{}{}", declared_classes, "}")); - - result.push_str(r#","world_da":"#); - let storage = - if let Some(storage) = state_updates.storage_updates.get(&ContractAddress::from(world)) { - storage.iter().map(|(k, v)| format!("{},{}", k, v)).collect::>().join(",") - } else { - String::new() - }; - - result.push_str(&format!("[{}]", storage)); - - result -} - /// We need custom implementation because of dynamic keys in json impl ProvedStateDiff { pub fn serialize(&self) -> String { diff --git a/crates/saya/core/src/prover/stone_image.rs b/crates/saya/core/src/prover/stone_image.rs index c5ad5de5d9..b6d3e655d0 100644 --- a/crates/saya/core/src/prover/stone_image.rs +++ b/crates/saya/core/src/prover/stone_image.rs @@ -1,3 +1,4 @@ +use std::fs::File; use std::process::Stdio; use anyhow::{bail, Context}; @@ -5,22 +6,27 @@ use async_trait::async_trait; use tokio::io::{AsyncBufReadExt, AsyncReadExt, AsyncWriteExt, BufReader}; use tokio::process::Command; use tokio::sync::OnceCell; -use tracing::warn; +use tracing::trace; -use super::{ProverClient, ProverIdentifier}; +use super::{ProveProgram, ProverClient, ProverIdentifier}; +use crate::prover::loader::prepare_input_cairo0; +use crate::LOG_TARGET; + +const PROVER_IMAGE: &str = "neotheprogramist/stone-cairo0:latest"; #[derive(Clone)] pub struct StoneProver(pub String); -pub async fn prove_stone(input: String) -> anyhow::Result { +pub async fn prove_stone(input: String, prove_program: ProveProgram) -> anyhow::Result { let prover = StoneProver::new().await?; - prover.prove(input).await -} + trace!(target: LOG_TARGET, "Proving with cairo0."); -pub async fn local_verify(input: String) -> anyhow::Result { - let prover = StoneProver::new().await?; - prover.local_verify(input).await?; - Ok(String::from("ok")) + let input = prepare_input_cairo0(input, prove_program).await?; + let input = serde_json::to_string(&input).context("Failed to serialize input")?; + + std::io::Write::write_all(&mut File::create("input.json")?, input.as_bytes())?; + + prover.prove(input).await.context("Failed to prove using the http prover") } #[async_trait] @@ -35,47 +41,26 @@ impl ProverClient for StoneProver { run(command, Some(input)).await } - - async fn local_verify(&self, proof: String) -> anyhow::Result<()> { - let mut command = Command::new("podman"); - command.arg("run").arg("-i").arg("--rm").arg("verifier"); - - run(command, Some(proof)).await?; - - Ok(()) - } } impl StoneProver { async fn new() -> anyhow::Result { - static STONE_PROVER: OnceCell<(anyhow::Result, anyhow::Result)> = - OnceCell::const_new(); - - let source = "piniom/state-diff-commitment"; - let verifier = "piniom/verifier:latest"; + static STONE_PROVER: OnceCell> = OnceCell::const_new(); let result = STONE_PROVER .get_or_init(|| async { let mut command = Command::new("podman"); - command.arg("pull").arg(format!("docker.io/{}", source)); - - let mut verifier_command = Command::new("podman"); - verifier_command.arg("pull").arg(format!("docker.io/{}", verifier)); + command.arg("pull").arg(format!("docker.io/{}", PROVER_IMAGE)); - ( - run(command, None).await.context("Failed to pull prover"), - run(verifier_command, None).await.context("Failed to pull prover"), - ) + run(command, None).await.context("Failed to pull prover") }) .await; - if result.0.is_err() { + if result.is_err() { bail!("Failed to pull prover"); - } else if result.1.is_err() { - warn!("Failed to pull verifier"); } - Ok(StoneProver(source.to_string())) + Ok(StoneProver(PROVER_IMAGE.to_string())) } } diff --git a/crates/saya/core/src/verifier/mod.rs b/crates/saya/core/src/verifier/mod.rs index 83edf92b64..28323f3e30 100644 --- a/crates/saya/core/src/verifier/mod.rs +++ b/crates/saya/core/src/verifier/mod.rs @@ -23,7 +23,7 @@ pub enum VerifierIdentifier { pub async fn verify( verifier: VerifierIdentifier, serialized_proof: Vec, -) -> anyhow::Result { +) -> anyhow::Result<(String, FieldElement)> { match verifier { VerifierIdentifier::HerodotusStarknetSepolia(fact_registry_address) => { starknet::starknet_verify(fact_registry_address, serialized_proof).await diff --git a/crates/saya/core/src/verifier/starknet.rs b/crates/saya/core/src/verifier/starknet.rs index 1a99132dd4..f948336575 100644 --- a/crates/saya/core/src/verifier/starknet.rs +++ b/crates/saya/core/src/verifier/starknet.rs @@ -1,5 +1,6 @@ use std::time::Duration; +use anyhow::Context; use dojo_world::migration::TxnConfig; use dojo_world::utils::TransactionExt; use starknet::accounts::{Account, Call, ConnectedAccount}; @@ -13,17 +14,19 @@ use crate::dojo_os::STARKNET_ACCOUNT; pub async fn starknet_verify( fact_registry_address: FieldElement, serialized_proof: Vec, -) -> anyhow::Result { +) -> anyhow::Result<(String, FieldElement)> { let txn_config = TxnConfig { wait: true, receipt: true, ..Default::default() }; + let nonce = STARKNET_ACCOUNT.get_nonce().await?; let tx = STARKNET_ACCOUNT .execute(vec![Call { to: fact_registry_address, selector: get_selector_from_name("verify_and_register_fact").expect("invalid selector"), calldata: serialized_proof, }]) + .nonce(nonce) .send_with_cfg(&txn_config) .await - .unwrap(); + .context("Failed to send `verify_and_register_fact` transaction.")?; let start_fetching = std::time::Instant::now(); let wait_for = Duration::from_secs(60); @@ -64,5 +67,5 @@ pub async fn starknet_verify( } } - Ok(format!("{:#x}", tx.transaction_hash)) + Ok((format!("{:#x}", tx.transaction_hash), nonce)) } diff --git a/crates/sozo/ops/Cargo.toml b/crates/sozo/ops/Cargo.toml index 78c10e0dd5..f4144ae66b 100644 --- a/crates/sozo/ops/Cargo.toml +++ b/crates/sozo/ops/Cargo.toml @@ -16,6 +16,7 @@ cairo-lang-plugins.workspace = true cairo-lang-project.workspace = true cairo-lang-sierra-to-casm.workspace = true cairo-lang-sierra.workspace = true +cairo-lang-starknet-classes.workspace = true cairo-lang-starknet.workspace = true cairo-lang-test-plugin.workspace = true cairo-lang-test-runner.workspace = true @@ -49,6 +50,7 @@ tokio.workspace = true tracing-log = "0.1.3" tracing.workspace = true url.workspace = true +toml.workspace = true [dev-dependencies] assert_fs.workspace = true diff --git a/crates/sozo/ops/src/auth.rs b/crates/sozo/ops/src/auth.rs index 35c805376f..9edb851b48 100644 --- a/crates/sozo/ops/src/auth.rs +++ b/crates/sozo/ops/src/auth.rs @@ -7,7 +7,7 @@ use dojo_world::contracts::{cairo_utils, WorldContractReader}; use dojo_world::migration::TxnConfig; use dojo_world::utils::TransactionExt; use scarb_ui::Ui; -use starknet::accounts::ConnectedAccount; +use starknet::accounts::{Account, ConnectedAccount}; use starknet::core::types::{BlockId, BlockTag}; use starknet::core::utils::{get_selector_from_name, parse_cairo_short_string}; use starknet_crypto::FieldElement; @@ -88,14 +88,15 @@ impl FromStr for OwnerResource { } } -pub async fn grant_writer( - ui: &Ui, +pub async fn grant_writer<'a, A>( + ui: &'a Ui, world: &WorldContract, models_contracts: Vec, txn_config: TxnConfig, ) -> Result<()> where - A: ConnectedAccount + Sync + Send + 'static, + A: ConnectedAccount + Sync + Send, + ::SignError: 'static, { let mut calls = Vec::new(); diff --git a/crates/sozo/ops/src/events.rs b/crates/sozo/ops/src/events.rs index c524fc2e96..b567157201 100644 --- a/crates/sozo/ops/src/events.rs +++ b/crates/sozo/ops/src/events.rs @@ -5,8 +5,7 @@ use anyhow::{anyhow, Result}; use cainome::parser::tokens::{CompositeInner, CompositeInnerKind, CoreBasic, Token}; use cainome::parser::AbiParser; use camino::Utf8PathBuf; -use dojo_lang::compiler::MANIFESTS_DIR; -use dojo_world::manifest::{AbiFormat, DeploymentManifest, ManifestMethods}; +use dojo_world::manifest::{AbiFormat, DeploymentManifest, ManifestMethods, MANIFESTS_DIR}; use starknet::core::types::{BlockId, EventFilter, FieldElement}; use starknet::core::utils::{parse_cairo_short_string, starknet_keccak}; use starknet::providers::jsonrpc::HttpTransport; @@ -249,8 +248,7 @@ fn process_inners( mod tests { use cainome::parser::tokens::{Array, Composite, CompositeInner, CompositeType}; use camino::Utf8Path; - use dojo_lang::compiler::{BASE_DIR, MANIFESTS_DIR}; - use dojo_world::manifest::BaseManifest; + use dojo_world::manifest::{BaseManifest, BASE_DIR}; use starknet::core::types::EmittedEvent; use super::*; @@ -267,7 +265,7 @@ mod tests { let result = extract_events(&manifest, &manifest_dir).unwrap(); // we are just collecting all events from manifest file so just verifying count should work - assert_eq!(result.len(), 14); + assert_eq!(result.len(), 15); } #[test] diff --git a/crates/sozo/ops/src/migration/auto_auth.rs b/crates/sozo/ops/src/migration/auto_auth.rs index 08d67772d9..df213e144c 100644 --- a/crates/sozo/ops/src/migration/auto_auth.rs +++ b/crates/sozo/ops/src/migration/auto_auth.rs @@ -10,15 +10,16 @@ use super::ui::MigrationUi; use super::MigrationOutput; use crate::auth::{grant_writer, ModelContract}; -pub async fn auto_authorize<'a, A>( +pub async fn auto_authorize( ws: &Workspace<'_>, - world: &'a WorldContract, + world: &WorldContract, txn_config: &TxnConfig, local_manifest: &BaseManifest, migration_output: &MigrationOutput, ) -> Result<()> where - A: ConnectedAccount + Sync + Send + 'static, + A: ConnectedAccount + Sync + Send, + A::SignError: 'static, { let ui = ws.config().ui(); diff --git a/crates/sozo/ops/src/migration/migrate.rs b/crates/sozo/ops/src/migration/migrate.rs index 70a9eb1c74..420c269237 100644 --- a/crates/sozo/ops/src/migration/migrate.rs +++ b/crates/sozo/ops/src/migration/migrate.rs @@ -2,14 +2,14 @@ use std::path::Path; use anyhow::{anyhow, bail, Context, Result}; use camino::Utf8PathBuf; -use dojo_lang::compiler::{ABIS_DIR, BASE_DIR, DEPLOYMENTS_DIR, MANIFESTS_DIR}; use dojo_world::contracts::abi::world; use dojo_world::contracts::{cairo_utils, WorldContract}; use dojo_world::manifest::{ AbiFormat, BaseManifest, DeploymentManifest, DojoContract, DojoModel, Manifest, - ManifestMethods, WorldContract as ManifestWorldContract, WorldMetadata, + ManifestMethods, WorldContract as ManifestWorldContract, WorldMetadata, ABIS_DIR, BASE_DIR, + DEPLOYMENTS_DIR, MANIFESTS_DIR, }; -use dojo_world::metadata::{dojo_metadata_from_workspace, ArtifactMetadata}; +use dojo_world::metadata::{dojo_metadata_from_workspace, ResourceMetadata}; use dojo_world::migration::class::ClassMigration; use dojo_world::migration::contract::ContractMigration; use dojo_world::migration::strategy::{generate_salt, prepare_for_migration, MigrationStrategy}; @@ -21,7 +21,7 @@ use dojo_world::utils::{TransactionExt, TransactionWaiter}; use futures::future; use scarb::core::Workspace; use scarb_ui::Ui; -use starknet::accounts::{Account, ConnectedAccount, SingleOwnerAccount}; +use starknet::accounts::ConnectedAccount; use starknet::core::types::{ BlockId, BlockTag, FunctionCall, InvokeTransactionResult, StarknetError, }; @@ -29,7 +29,6 @@ use starknet::core::utils::{ cairo_short_string_to_felt, get_contract_address, get_selector_from_name, }; use starknet::providers::{Provider, ProviderError}; -use starknet::signers::Signer; use starknet_crypto::FieldElement; use tokio::fs; @@ -64,15 +63,16 @@ pub fn prepare_migration( Ok(migration) } -pub async fn apply_diff( +pub async fn apply_diff( ws: &Workspace<'_>, - account: &SingleOwnerAccount, + account: A, txn_config: TxnConfig, strategy: &mut MigrationStrategy, ) -> Result where - P: Provider + Sync + Send + 'static, - S: Signer + Sync + Send + 'static, + A: ConnectedAccount + Sync + Send, + ::Provider: Send, + A::SignError: 'static, { let ui = ws.config().ui(); @@ -116,15 +116,16 @@ where Ok(migration_output) } -pub async fn execute_strategy( +pub async fn execute_strategy( ws: &Workspace<'_>, strategy: &MigrationStrategy, - migrator: &SingleOwnerAccount, + migrator: A, txn_config: TxnConfig, ) -> Result where - P: Provider + Sync + Send + 'static, - S: Signer + Sync + Send + 'static, + A: ConnectedAccount + Sync + Send, + A::Provider: Send, + A::SignError: 'static, { let ui = ws.config().ui(); let mut world_tx_hash: Option = None; @@ -134,7 +135,7 @@ where Some(base) => { ui.print_header("# Base Contract"); - match base.declare(migrator, &txn_config).await { + match base.declare(&migrator, &txn_config).await { Ok(res) => { ui.print_sub(format!("Class Hash: {:#x}", res.class_hash)); } @@ -165,7 +166,7 @@ where "world", world.diff.original_class_hash, strategy.base.as_ref().unwrap().diff.original_class_hash, - migrator, + &migrator, &ui, &txn_config, ) @@ -182,7 +183,7 @@ where } else { let calldata = vec![strategy.base.as_ref().unwrap().diff.local_class_hash]; let deploy_result = - deploy_contract(world, "world", calldata.clone(), migrator, &ui, &txn_config) + deploy_contract(world, "world", calldata.clone(), &migrator, &ui, &txn_config) .await .map_err(|e| { ui.verbose(format!("{e:?}")); @@ -215,7 +216,7 @@ where // Once Torii supports indexing arrays, we should declare and register the // ResourceMetadata model. - match register_dojo_models(&strategy.models, world_address, migrator, &ui, &txn_config).await { + match register_dojo_models(&strategy.models, world_address, &migrator, &ui, &txn_config).await { Ok(output) => { migration_output.models = output.registered_model_names; } @@ -255,13 +256,12 @@ where /// on success. async fn upload_on_ipfs_and_create_resource( ui: &Ui, - element_name: String, resource_id: FieldElement, - artifact: ArtifactMetadata, + metadata: ResourceMetadata, ) -> Result { - match artifact.upload().await { + match metadata.upload().await { Ok(hash) => { - ui.print_sub(format!("{}: ipfs://{}", element_name, hash)); + ui.print_sub(format!("{}: ipfs://{}", metadata.name, hash)); create_resource_metadata(resource_id, hash) } Err(_) => Err(anyhow!("Failed to upload IPFS resource.")), @@ -293,15 +293,15 @@ fn create_resource_metadata( /// * `ws` - the workspace /// * `migrator` - the account used to migrate /// * `migration_output` - the output after having applied the migration plan. -pub async fn upload_metadata( +pub async fn upload_metadata( ws: &Workspace<'_>, - migrator: &SingleOwnerAccount, + migrator: A, migration_output: MigrationOutput, txn_config: TxnConfig, ) -> Result<()> where - P: Provider + Sync + Send + 'static, - S: Signer + Sync + Send + 'static, + A: ConnectedAccount + Sync + Send, + ::Provider: Send, { let ui = ws.config().ui(); @@ -309,7 +309,11 @@ where ui.print_step(7, "🌐", "Uploading metadata..."); ui.print(" "); - let dojo_metadata = dojo_metadata_from_workspace(ws); + let dojo_metadata = if let Some(metadata) = dojo_metadata_from_workspace(ws) { + metadata + } else { + return Err(anyhow!("No current package with dojo metadata found.")); + }; let mut ipfs = vec![]; let mut resources = vec![]; @@ -330,10 +334,9 @@ where // models if !migration_output.models.is_empty() { for model_name in migration_output.models { - if let Some(m) = dojo_metadata.artifacts.get(&model_name) { + if let Some(m) = dojo_metadata.resources_artifacts.get(&model_name) { ipfs.push(upload_on_ipfs_and_create_resource( &ui, - model_name.clone(), get_selector_from_name(&model_name).expect("ASCII model name"), m.clone(), )); @@ -346,10 +349,9 @@ where if !migrated_contracts.is_empty() { for contract in migrated_contracts { - if let Some(m) = dojo_metadata.artifacts.get(&contract.name) { + if let Some(m) = dojo_metadata.resources_artifacts.get(&contract.name) { ipfs.push(upload_on_ipfs_and_create_resource( &ui, - contract.name.clone(), contract.contract_address, m.clone(), )); @@ -367,7 +369,7 @@ where ui.print("> All IPFS artifacts have been successfully uploaded.".to_string()); // update the resource registry - let world = WorldContract::new(migration_output.world_address, migrator); + let world = WorldContract::new(migration_output.world_address, &migrator); let calls = resources.iter().map(|r| world.set_metadata_getcall(r)).collect::>(); @@ -390,16 +392,16 @@ where Ok(()) } -async fn register_dojo_models( +async fn register_dojo_models( models: &[ClassMigration], world_address: FieldElement, - migrator: &SingleOwnerAccount, + migrator: A, ui: &Ui, txn_config: &TxnConfig, ) -> Result where - P: Provider + Sync + Send + 'static, - S: Signer + Sync + Send + 'static, + A: ConnectedAccount + Send + Sync, + ::Provider: Send, { if models.is_empty() { return Ok(RegisterOutput { @@ -417,7 +419,7 @@ where for c in models.iter() { ui.print(italic_message(&c.diff.name).to_string()); - let res = c.declare(migrator, txn_config).await; + let res = c.declare(&migrator, txn_config).await; match res { Ok(output) => { ui.print_hidden_sub(format!("Declare transaction: {:#x}", output.transaction_hash)); @@ -442,7 +444,7 @@ where ui.print_sub(format!("Class hash: {:#x}", c.diff.local_class_hash)); } - let world = WorldContract::new(world_address, migrator); + let world = WorldContract::new(world_address, &migrator); let calls = models .iter() @@ -465,16 +467,16 @@ where Ok(RegisterOutput { transaction_hash, declare_output, registered_model_names }) } -async fn register_dojo_contracts( +async fn register_dojo_contracts( contracts: &Vec, world_address: FieldElement, - migrator: &SingleOwnerAccount, + migrator: A, ui: &Ui, txn_config: &TxnConfig, ) -> Result>> where - P: Provider + Sync + Send + 'static, - S: Signer + Sync + Send + 'static, + A: ConnectedAccount + Send + Sync, + ::Provider: Send, { if contracts.is_empty() { return Ok(vec![]); @@ -492,8 +494,9 @@ where world_address, contract.diff.local_class_hash, contract.diff.base_class_hash, - migrator, + &migrator, txn_config, + &contract.diff.init_calldata, ) .await { @@ -541,7 +544,10 @@ where } Err(e) => { ui.verbose(format!("{e:?}")); - return Err(anyhow!("Failed to migrate {name}: {e}")); + return Err(anyhow!( + "Failed to migrate {name}: {e}. Please also verify init calldata is valid, if \ + any." + )); } } } @@ -549,17 +555,17 @@ where Ok(deploy_output) } -async fn deploy_contract( +async fn deploy_contract( contract: &ContractMigration, contract_id: &str, constructor_calldata: Vec, - migrator: &SingleOwnerAccount, + migrator: A, ui: &Ui, txn_config: &TxnConfig, ) -> Result where - P: Provider + Sync + Send + 'static, - S: Signer + Sync + Send + 'static, + A: ConnectedAccount + Send + Sync, + ::Provider: Send, { match contract .deploy(contract.diff.local_class_hash, constructor_calldata, migrator, txn_config) @@ -591,18 +597,18 @@ where } } -async fn upgrade_contract( +async fn upgrade_contract( contract: &ContractMigration, contract_id: &str, original_class_hash: FieldElement, original_base_class_hash: FieldElement, - migrator: &SingleOwnerAccount, + migrator: A, ui: &Ui, txn_config: &TxnConfig, ) -> Result where - P: Provider + Sync + Send + 'static, - S: Signer + Sync + Send + 'static, + A: ConnectedAccount + Send + Sync, + ::Provider: Send, { match contract .upgrade_world( @@ -648,12 +654,12 @@ pub fn handle_artifact_error(ui: &Ui, artifact_path: &Path, error: anyhow::Error } pub async fn get_contract_operation_name

( - provider: &P, + provider: P, contract: &ContractMigration, world_address: Option, ) -> String where - P: Provider + Sync + Send + 'static, + P: Provider + Sync + Send, { if let Some(world_address) = world_address { if let Ok(base_class_hash) = provider @@ -690,11 +696,11 @@ where pub async fn print_strategy

( ui: &Ui, - provider: &P, + provider: P, strategy: &MigrationStrategy, world_address: FieldElement, ) where - P: Provider + Sync + Send + 'static, + P: Provider + Sync + Send, { ui.print("\n📋 Migration Strategy\n"); @@ -729,7 +735,7 @@ pub async fn print_strategy

( if !&strategy.contracts.is_empty() { ui.print_header(format!("# Contracts ({})", &strategy.contracts.len())); for c in &strategy.contracts { - let op_name = get_contract_operation_name(provider, c, strategy.world_address).await; + let op_name = get_contract_operation_name(&provider, c, strategy.world_address).await; ui.print(op_name); ui.print_sub(format!("Class hash: {:#x}", c.diff.local_class_hash)); diff --git a/crates/sozo/ops/src/migration/mod.rs b/crates/sozo/ops/src/migration/mod.rs index e998b0fa36..21351004a2 100644 --- a/crates/sozo/ops/src/migration/mod.rs +++ b/crates/sozo/ops/src/migration/mod.rs @@ -1,15 +1,19 @@ use std::sync::Arc; +use std::{fs, io}; -use anyhow::{anyhow, Result}; -use dojo_lang::compiler::MANIFESTS_DIR; +use anyhow::{anyhow, Context, Result}; +use camino::Utf8PathBuf; use dojo_world::contracts::WorldContract; +use dojo_world::manifest::{ + DojoContract, DojoModel, Manifest, OverlayClass, OverlayDojoContract, OverlayDojoModel, + OverlayManifest, BASE_CONTRACT_NAME, BASE_DIR, CONTRACTS_DIR, MANIFESTS_DIR, MODELS_DIR, + OVERLAYS_DIR, WORLD_CONTRACT_NAME, +}; use dojo_world::migration::world::WorldDiff; use dojo_world::migration::{DeployOutput, TxnConfig, UpgradeOutput}; use scarb::core::Workspace; -use starknet::accounts::{ConnectedAccount, SingleOwnerAccount}; +use starknet::accounts::ConnectedAccount; use starknet::core::types::FieldElement; -use starknet::providers::Provider; -use starknet::signers::Signer; mod auto_auth; mod migrate; @@ -44,18 +48,20 @@ pub struct ContractMigrationOutput { } #[allow(clippy::too_many_arguments)] -pub async fn migrate( +pub async fn migrate( ws: &Workspace<'_>, world_address: Option, rpc_url: String, - account: SingleOwnerAccount, + account: A, name: &str, dry_run: bool, txn_config: TxnConfig, + skip_manifests: Option>, ) -> Result<()> where - P: Provider + Sync + Send + 'static, - S: Signer + Sync + Send + 'static, + A: ConnectedAccount + Sync + Send, + A::Provider: Send, + A::SignError: 'static, { let ui = ws.config().ui(); @@ -71,19 +77,21 @@ where // Load local and remote World manifests. let (local_manifest, remote_manifest) = - utils::load_world_manifests(&profile_dir, &account, world_address, &ui).await.map_err( - |e| { + utils::load_world_manifests(&profile_dir, &account, world_address, &ui, skip_manifests) + .await + .map_err(|e| { ui.error(e.to_string()); anyhow!( "\n Use `sozo clean` to clean your project.\nThen, rebuild your project with \ `sozo build`.", ) - }, - )?; + })?; // Calculate diff between local and remote World manifests. ui.print_step(2, "🧰", "Evaluating Worlds diff..."); - let diff = WorldDiff::compute(local_manifest.clone(), remote_manifest.clone()); + let mut diff = WorldDiff::compute(local_manifest.clone(), remote_manifest.clone()); + diff.update_order()?; + let total_diffs = diff.count_diffs(); ui.print_sub(format!("Total diffs found: {total_diffs}")); @@ -94,6 +102,7 @@ where let mut strategy = prepare_migration(&target_dir, diff, name, world_address, &ui)?; let world_address = strategy.world_address().expect("world address must exist"); + strategy.resolve_variable(world_address)?; if dry_run { print_strategy(&ui, account.provider(), &strategy, world_address).await; @@ -171,3 +180,87 @@ enum ContractDeploymentOutput { enum ContractUpgradeOutput { Output(UpgradeOutput), } + +pub fn generate_overlays(ws: &Workspace<'_>) -> Result<()> { + let profile_name = + ws.current_profile().expect("Scarb profile expected to be defined.").to_string(); + + // its path to a file so `parent` should never return `None` + let manifest_dir = ws.manifest_path().parent().unwrap().to_path_buf(); + let profile_dir = manifest_dir.join(MANIFESTS_DIR).join(profile_name); + + let base_manifests = profile_dir.join(BASE_DIR); + + let world = OverlayClass { name: WORLD_CONTRACT_NAME.into(), original_class_hash: None }; + let base = OverlayClass { name: BASE_CONTRACT_NAME.into(), original_class_hash: None }; + + // generate default OverlayManifest from base manifests + let contracts = overlay_dojo_contracts_from_path(&base_manifests.join(CONTRACTS_DIR)) + .with_context(|| "Failed to build default DojoContract Overlays from path.")?; + let models = overlay_model_from_path(&base_manifests.join(MODELS_DIR)) + .with_context(|| "Failed to build default DojoModel Overlays from path.")?; + + let default_overlay = + OverlayManifest { world: Some(world), base: Some(base), contracts, models }; + + let overlay_path = profile_dir.join(OVERLAYS_DIR); + + // read existing OverlayManifest from path + let mut overlay_manifest = OverlayManifest::load_from_path(&overlay_path) + .with_context(|| "Failed to load OverlayManifest from path.")?; + + // merge them to get OverlayManifest which contains all the contracts and models from base + // manifests + overlay_manifest.merge(default_overlay); + + overlay_manifest + .write_to_path_nested(&overlay_path) + .with_context(|| "Failed to write OverlayManifest to path.")?; + + Ok(()) +} + +fn overlay_dojo_contracts_from_path(path: &Utf8PathBuf) -> Result> { + let mut elements = vec![]; + + let entries = path + .read_dir()? + .map(|entry| entry.map(|e| e.path())) + .collect::, io::Error>>()?; + + for path in entries { + if path.is_file() { + let manifest: Manifest = toml::from_str(&fs::read_to_string(path)?)?; + + let overlay_manifest = + OverlayDojoContract { name: manifest.name, ..Default::default() }; + elements.push(overlay_manifest); + } else { + continue; + } + } + + Ok(elements) +} + +fn overlay_model_from_path(path: &Utf8PathBuf) -> Result> { + let mut elements = vec![]; + + let entries = path + .read_dir()? + .map(|entry| entry.map(|e| e.path())) + .collect::, io::Error>>()?; + + for path in entries { + if path.is_file() { + let manifest: Manifest = toml::from_str(&fs::read_to_string(path)?)?; + + let overlay_manifest = OverlayDojoModel { name: manifest.name, ..Default::default() }; + elements.push(overlay_manifest); + } else { + continue; + } + } + + Ok(elements) +} diff --git a/crates/sozo/ops/src/migration/utils.rs b/crates/sozo/ops/src/migration/utils.rs index d21e7c4c29..1afe38f305 100644 --- a/crates/sozo/ops/src/migration/utils.rs +++ b/crates/sozo/ops/src/migration/utils.rs @@ -1,13 +1,11 @@ use anyhow::{anyhow, Result}; use camino::Utf8PathBuf; -use dojo_lang::compiler::{BASE_DIR, OVERLAYS_DIR}; use dojo_world::manifest::{ - AbstractManifestError, BaseManifest, DeploymentManifest, OverlayManifest, + AbstractManifestError, BaseManifest, DeploymentManifest, OverlayManifest, BASE_DIR, + OVERLAYS_DIR, }; use scarb_ui::Ui; -use starknet::accounts::{ConnectedAccount, SingleOwnerAccount}; -use starknet::providers::Provider; -use starknet::signers::Signer; +use starknet::accounts::ConnectedAccount; use starknet_crypto::FieldElement; use super::ui::MigrationUi; @@ -15,21 +13,26 @@ use super::ui::MigrationUi; /// Loads: /// - `BaseManifest` from filesystem /// - `DeployedManifest` from onchain dataa if `world_address` is `Some` -pub(super) async fn load_world_manifests( +pub(super) async fn load_world_manifests( profile_dir: &Utf8PathBuf, - account: &SingleOwnerAccount, + account: A, world_address: Option, ui: &Ui, + skip_migration: Option>, ) -> Result<(BaseManifest, Option)> where - P: Provider + Sync + Send, - S: Signer + Sync + Send, + A: ConnectedAccount + Sync + Send, + ::Provider: Send, { ui.print_step(1, "🌎", "Building World state..."); let mut local_manifest = BaseManifest::load_from_path(&profile_dir.join(BASE_DIR)) .map_err(|e| anyhow!("Fail to load local manifest file: {e}."))?; + if let Some(skip_manifests) = skip_migration { + local_manifest.remove_items(skip_manifests); + } + let overlay_path = profile_dir.join(OVERLAYS_DIR); if overlay_path.exists() { let overlay_manifest = OverlayManifest::load_from_path(&profile_dir.join(OVERLAYS_DIR)) diff --git a/crates/sozo/ops/src/model.rs b/crates/sozo/ops/src/model.rs index 21d206ab19..1bfe108e96 100644 --- a/crates/sozo/ops/src/model.rs +++ b/crates/sozo/ops/src/model.rs @@ -1,10 +1,15 @@ use anyhow::Result; +use cainome::cairo_serde::{ByteArray, CairoSerde}; +use dojo_types::schema::Ty; use dojo_world::contracts::model::ModelReader; use dojo_world::contracts::world::WorldContractReader; use starknet::core::types::{BlockId, BlockTag, FieldElement}; +use starknet::core::utils::get_selector_from_name; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::JsonRpcClient; +const INDENT: &str = " "; + pub async fn model_class_hash( name: String, world_address: FieldElement, @@ -35,6 +40,29 @@ pub async fn model_contract_address( Ok(()) } +pub async fn model_layout( + name: String, + world_address: FieldElement, + provider: JsonRpcClient, +) -> Result<()> { + let mut world_reader = WorldContractReader::new(world_address, &provider); + world_reader.set_block(BlockId::Tag(BlockTag::Pending)); + + let model = world_reader.model_reader(&name).await?; + let layout = match model.layout().await { + Ok(x) => x, + Err(_) => anyhow::bail!( + "[Incorrect layout]\nThe model is packed but contains at least one custom type field \ + which is not packed.\nPlease check your model to fix this." + ), + }; + let schema = model.schema().await?; + + deep_print_layout(&name, &layout, &schema); + + Ok(()) +} + pub async fn model_schema( name: String, world_address: FieldElement, @@ -50,7 +78,7 @@ pub async fn model_schema( if to_json { println!("{}", serde_json::to_string_pretty(&schema)?) } else { - println!("{schema}"); + deep_print_ty(schema); } Ok(()) @@ -62,13 +90,568 @@ pub async fn model_get( world_address: FieldElement, provider: JsonRpcClient, ) -> Result<()> { + if keys.is_empty() { + anyhow::bail!("Models always have at least one key. Please provide it (or them)."); + } + let mut world_reader = WorldContractReader::new(world_address, &provider); world_reader.set_block(BlockId::Tag(BlockTag::Pending)); let model = world_reader.model_reader(&name).await?; - let entity = model.entity(&keys).await?; + let schema = model.schema().await?; + let values = model.entity_storage(&keys).await?; - println!("{entity}"); + deep_print_record(&schema, &keys, &values); Ok(()) } + +#[derive(Clone, Debug)] +struct LayoutInfo { + layout_type: LayoutInfoType, + name: String, + fields: Vec, +} + +#[derive(Clone, Debug)] +enum LayoutInfoType { + Struct, + Enum, + Tuple, + Array, +} + +#[derive(Clone, Debug)] +struct FieldLayoutInfo { + selector: String, + name: String, + layout: String, +} + +fn format_fixed(layout: &[u8]) -> String { + format!("[{}]", layout.iter().map(|x| x.to_string()).collect::>().join(", ")) +} + +fn format_layout_ref(type_name: &str) -> String { + format!("layout({type_name})") +} + +fn format_selector(selector: String) -> String { + if selector.starts_with("0x") { format!("[{}]", selector) } else { selector } +} + +fn format_name(name: String) -> String { + if !name.is_empty() { format!(" {} ", name) } else { name } +} + +fn format_field(selector: String, name: String, layout: String) -> String { + let layout = if layout.eq("[]") { "".to_string() } else { format!(": {layout}") }; + + format!("{INDENT}{:<20}{:<18}{}", format_selector(selector), format_name(name), layout) +} + +fn format_field_layout( + layout: &dojo_world::contracts::model::abigen::model::Layout, + schema: &dojo_types::schema::Ty, +) -> String { + match layout { + dojo_world::contracts::model::abigen::model::Layout::Fixed(x) => format_fixed(x), + dojo_world::contracts::model::abigen::model::Layout::ByteArray => { + "layout(ByteArray)".to_string() + } + _ => format_layout_ref(&get_name_from_schema(schema)), + } +} + +fn is_layout_in_list(list: &[LayoutInfo], name: &String) -> bool { + list.iter().any(|x| x.name.eq(name)) +} + +fn get_name_from_schema(schema: &dojo_types::schema::Ty) -> String { + match schema { + dojo_types::schema::Ty::Struct(s) => s.name.clone(), + dojo_types::schema::Ty::Enum(e) => e.name.clone(), + dojo_types::schema::Ty::Primitive(p) => match p { + dojo_types::primitive::Primitive::U8(_) => "u8".to_string(), + dojo_types::primitive::Primitive::U16(_) => "u16".to_string(), + dojo_types::primitive::Primitive::U32(_) => "u32".to_string(), + dojo_types::primitive::Primitive::U64(_) => "u64".to_string(), + dojo_types::primitive::Primitive::U128(_) => "u128".to_string(), + dojo_types::primitive::Primitive::U256(_) => "u256".to_string(), + dojo_types::primitive::Primitive::USize(_) => "usize".to_string(), + dojo_types::primitive::Primitive::Bool(_) => "bool".to_string(), + dojo_types::primitive::Primitive::Felt252(_) => "felt252".to_string(), + dojo_types::primitive::Primitive::ClassHash(_) => "ClassHash".to_string(), + dojo_types::primitive::Primitive::ContractAddress(_) => "ContractAddress".to_string(), + }, + dojo_types::schema::Ty::Tuple(t) => { + format!("({})", t.iter().map(get_name_from_schema).collect::>().join(", ")) + } + dojo_types::schema::Ty::Array(a) => format!("Array<{}>", get_name_from_schema(&a[0])), + _ => "".to_string(), + } +} + +fn get_printable_layout_list_from_struct( + field_layouts: &[dojo_world::contracts::model::abigen::model::FieldLayout], + schema: &dojo_types::schema::Ty, + layout_list: &mut Vec, +) { + if let dojo_types::schema::Ty::Struct(ss) = schema { + let name = get_name_from_schema(schema); + + // process main struct + if !is_layout_in_list(layout_list, &name) { + layout_list.push(LayoutInfo { + layout_type: LayoutInfoType::Struct, + name, + fields: field_layouts + .iter() + .zip(ss.children.iter().filter(|x| !x.key)) + .map(|(l, m)| FieldLayoutInfo { + selector: format!("{:#x}", l.selector), + name: m.name.clone(), + layout: format_field_layout(&l.layout, &m.ty), + }) + .collect::>(), + }); + } + + // process members + for (member_layout, member) in + field_layouts.iter().zip(ss.children.iter().filter(|x| !x.key)) + { + get_printable_layout_list(&member_layout.layout, &member.ty, layout_list); + } + }; +} + +fn get_printable_layout_list_from_enum( + field_layouts: &[dojo_world::contracts::model::abigen::model::FieldLayout], + schema: &dojo_types::schema::Ty, + layout_list: &mut Vec, +) { + if let dojo_types::schema::Ty::Enum(se) = schema { + let name = get_name_from_schema(schema); + + // proces main enum + if !is_layout_in_list(layout_list, &name) { + layout_list.push(LayoutInfo { + layout_type: LayoutInfoType::Enum, + name, + fields: field_layouts + .iter() + .zip(se.options.iter()) + .map(|(l, o)| FieldLayoutInfo { + selector: format!("{:#x}", l.selector), + name: o.name.to_string(), + layout: format_field_layout(&l.layout, &o.ty), + }) + .collect::>(), + }); + } + + // process variants + for (variant_layout, variant) in field_layouts.iter().zip(se.options.iter()) { + get_printable_layout_list(&variant_layout.layout, &variant.ty, layout_list); + } + } +} + +fn get_printable_layout_list_from_tuple( + item_layouts: &[dojo_world::contracts::model::abigen::model::Layout], + schema: &dojo_types::schema::Ty, + layout_list: &mut Vec, +) { + if let dojo_types::schema::Ty::Tuple(st) = schema { + let name = get_name_from_schema(schema); + + // process tuple + if !is_layout_in_list(layout_list, &name) { + layout_list.push(LayoutInfo { + layout_type: LayoutInfoType::Tuple, + name, + fields: item_layouts + .iter() + .enumerate() + .zip(st.iter()) + .map(|((i, l), s)| FieldLayoutInfo { + selector: format!("{:#x}", i), + name: "".to_string(), + layout: format_field_layout(l, s), + }) + .collect::>(), + }); + } + + // process tuple items + for (item_layout, item_schema) in item_layouts.iter().zip(st.iter()) { + get_printable_layout_list(item_layout, item_schema, layout_list); + } + } +} + +fn get_printable_layout_list_from_array( + item_layout: &dojo_world::contracts::model::abigen::model::Layout, + schema: &dojo_types::schema::Ty, + layout_list: &mut Vec, +) { + if let dojo_types::schema::Ty::Array(sa) = schema { + let name = get_name_from_schema(schema); + + // process array + if !is_layout_in_list(layout_list, &name) { + layout_list.push(LayoutInfo { + layout_type: LayoutInfoType::Array, + name, + fields: vec![FieldLayoutInfo { + selector: "[ItemIndex]".to_string(), + name: "".to_string(), + layout: format_field_layout(item_layout, &sa[0]), + }], + }); + } + + // process array item + get_printable_layout_list(item_layout, &sa[0], layout_list); + } +} + +fn get_printable_layout_list( + root_layout: &dojo_world::contracts::model::abigen::model::Layout, + schema: &dojo_types::schema::Ty, + layout_list: &mut Vec, +) { + match root_layout { + dojo_world::contracts::model::abigen::model::Layout::Struct(ls) => { + get_printable_layout_list_from_struct(ls, schema, layout_list); + } + dojo_world::contracts::model::abigen::model::Layout::Enum(le) => { + get_printable_layout_list_from_enum(le, schema, layout_list); + } + dojo_world::contracts::model::abigen::model::Layout::Tuple(lt) => { + get_printable_layout_list_from_tuple(lt, schema, layout_list); + } + dojo_world::contracts::model::abigen::model::Layout::Array(la) => { + get_printable_layout_list_from_array(&la[0], schema, layout_list); + } + _ => {} + }; +} + +fn print_layout_info(layout_info: LayoutInfo) { + let fields = layout_info + .fields + .into_iter() + .map(|f| format_field(f.selector, f.name, f.layout)) + .collect::>(); + let layout_title = match layout_info.layout_type { + LayoutInfoType::Struct => format!("Struct {} {{", layout_info.name), + + LayoutInfoType::Enum => { + format!("{:<42}: [251] (variant id)", format!("Enum {} {{", layout_info.name)) + } + LayoutInfoType::Tuple => format!("{} (", layout_info.name), + LayoutInfoType::Array => { + format!("{:<42}: [32] (length)", format!("{} (", layout_info.name)) + } + }; + let end_token = match layout_info.layout_type { + LayoutInfoType::Struct => '}', + LayoutInfoType::Enum => '}', + LayoutInfoType::Tuple => ')', + LayoutInfoType::Array => ')', + }; + + println!( + "{layout_title} +{} +{end_token}\n", + fields.join("\n") + ); +} + +// print the full Layout tree +fn deep_print_layout( + name: &String, + layout: &dojo_world::contracts::model::abigen::model::Layout, + schema: &dojo_types::schema::Ty, +) { + if let dojo_world::contracts::model::abigen::model::Layout::Fixed(lf) = layout { + println!("\n{} (packed)", name); + println!(" selector : {:#x}", get_selector_from_name(name).unwrap()); + println!(" layout : {}", format_fixed(lf)); + } else { + let mut layout_list = vec![]; + get_printable_layout_list(layout, schema, &mut layout_list); + + println!("\n{} selector: {:#x}\n", name, get_selector_from_name(name).unwrap()); + + for l in layout_list { + print_layout_info(l); + } + } +} + +fn _start_indent(level: usize, start_indent: bool) -> String { + if start_indent { INDENT.repeat(level) } else { "".to_string() } +} + +fn format_primitive( + p: &dojo_types::primitive::Primitive, + values: &mut Vec, + level: usize, + start_indent: bool, +) -> String { + let mut _p = *p; + let _ = _p.deserialize(values); + + format!("{}{}", _start_indent(level, start_indent), _p.to_sql_value().unwrap()) +} + +fn format_byte_array(values: &mut Vec, level: usize, start_indent: bool) -> String { + let bytearray = ByteArray::cairo_deserialize(values, 0).unwrap(); + values.drain(0..ByteArray::cairo_serialized_size(&bytearray)); + + format!("{}{}", _start_indent(level, start_indent), ByteArray::to_string(&bytearray).unwrap()) +} + +fn format_field_value( + member: &dojo_types::schema::Member, + values: &mut Vec, + level: usize, +) -> String { + let field_repr = format_record_value(&member.ty, values, level, false); + format!("{}{:<16}: {field_repr}", INDENT.repeat(level), member.name) +} + +fn format_array( + item: &dojo_types::schema::Ty, + values: &mut Vec, + level: usize, + start_indent: bool, +) -> String { + let length: u32 = values.remove(0).try_into().unwrap(); + let mut items = vec![]; + + for _ in 0..length { + items.push(format_record_value(item, values, level + 1, true)); + } + + format!( + "{}[\n{}\n{}]", + _start_indent(level, start_indent), + items.join(",\n"), + INDENT.repeat(level) + ) +} + +fn format_tuple( + items: &[dojo_types::schema::Ty], + values: &mut Vec, + level: usize, + start_indent: bool, +) -> String { + if items.is_empty() { + return "".to_string(); + } + + let items_repr = items + .iter() + .map(|x| format_record_value(x, values, level + 1, true)) + .collect::>() + .join(",\n"); + + format!("{}(\n{}\n{})", _start_indent(level, start_indent), items_repr, INDENT.repeat(level)) +} + +fn format_struct( + schema: &dojo_types::schema::Struct, + values: &mut Vec, + level: usize, + start_indent: bool, +) -> String { + let fields = schema + .children + .iter() + .map(|m| format_field_value(m, values, level + 1)) + .collect::>(); + + format!( + "{}{{\n{}\n{}}}", + _start_indent(level, start_indent), + fields.join(",\n"), + INDENT.repeat(level) + ) +} + +fn format_enum( + schema: &dojo_types::schema::Enum, + values: &mut Vec, + level: usize, + start_indent: bool, +) -> String { + let variant_index: u8 = values.remove(0).try_into().unwrap(); + let variant_index: usize = variant_index.into(); + let variant_name = format!("{}::{}", schema.name, schema.options[variant_index].name); + let variant_data = + format_record_value(&schema.options[variant_index].ty, values, level + 1, true); + + if variant_data.is_empty() { + format!("{}{variant_name}", _start_indent(level, start_indent),) + } else { + format!( + "{}{variant_name}(\n{}\n{})", + _start_indent(level, start_indent), + variant_data, + INDENT.repeat(level) + ) + } +} + +fn format_record_value( + schema: &dojo_types::schema::Ty, + values: &mut Vec, + level: usize, + start_indent: bool, +) -> String { + match schema { + dojo_types::schema::Ty::Primitive(p) => format_primitive(p, values, level, start_indent), + dojo_types::schema::Ty::ByteArray(_) => format_byte_array(values, level, start_indent), + dojo_types::schema::Ty::Struct(s) => format_struct(s, values, level, start_indent), + dojo_types::schema::Ty::Enum(e) => format_enum(e, values, level, start_indent), + dojo_types::schema::Ty::Array(a) => format_array(&a[0], values, level, start_indent), + dojo_types::schema::Ty::Tuple(t) => format_tuple(t, values, level, start_indent), + } +} + +// print the structured record values +fn deep_print_record( + schema: &dojo_types::schema::Ty, + keys: &[FieldElement], + values: &[FieldElement], +) { + let mut model_values = vec![]; + model_values.extend(keys); + model_values.extend(values); + + println!("{}", format_record_value(schema, &mut model_values, 0, true)); +} + +fn get_ty_repr(ty: &Ty) -> String { + match ty { + Ty::Primitive(p) => p.to_string(), + Ty::Struct(s) => s.name.clone(), + Ty::Enum(e) => e.name.clone(), + Ty::Tuple(items) => { + if items.is_empty() { + "".to_string() + } else { + format!("({},)", items.iter().map(get_ty_repr).collect::>().join(", ")) + } + } + Ty::Array(items) => format!("Array<{}>", get_ty_repr(&items[0])), + Ty::ByteArray(_) => "ByteArray".to_string(), + } +} + +// to verify if a Ty has already been processed (i.e is in the list), +// just compare their type representation. +fn is_ty_already_in_list(ty_list: &[Ty], ty: &Ty) -> bool { + let ty_repr = get_ty_repr(ty); + ty_list.iter().any(|t| get_ty_repr(t).eq(&ty_repr)) +} + +// parse the Ty tree from its root and extract Ty to print. +// (basically, structs and enums) +fn get_printable_ty_list(root_ty: &Ty, ty_list: &mut Vec) { + match root_ty { + Ty::Primitive(_) => {} + Ty::ByteArray(_) => {} + Ty::Struct(s) => { + if !is_ty_already_in_list(ty_list, root_ty) { + ty_list.push(root_ty.clone()); + } + + for member in &s.children { + if !is_ty_already_in_list(ty_list, &member.ty) { + get_printable_ty_list(&member.ty, ty_list); + } + } + } + Ty::Enum(e) => { + if !ty_list.contains(root_ty) { + ty_list.push(root_ty.clone()); + } + + for child in &e.options { + if !is_ty_already_in_list(ty_list, &child.ty) { + get_printable_ty_list(&child.ty, ty_list); + } + } + } + Ty::Tuple(tuple) => { + for item_ty in tuple { + if !is_ty_already_in_list(ty_list, item_ty) { + get_printable_ty_list(item_ty, ty_list); + } + } + } + Ty::Array(items_ty) => { + if !is_ty_already_in_list(ty_list, &items_ty[0]) { + get_printable_ty_list(&items_ty[0], ty_list) + } + } + }; +} + +pub fn format_ty_field(name: &String, ty: &Ty, is_key: bool) -> String { + let ty_repr = get_ty_repr(ty); + let ty_repr = if ty_repr.is_empty() { "".to_string() } else { format!(": {ty_repr}") }; + let key_repr = if is_key { " #[key]\n".to_string() } else { "".to_string() }; + + format! {"{key_repr} {name}{ty_repr}"} +} + +// print Ty representation if required. +// For example, there is no need to print any information about arrays or tuples +// as they are members of struct and their items will be printed. +pub fn print_ty(ty: &Ty) { + let ty_repr = match ty { + Ty::Struct(s) => { + let mut struct_str = format!("struct {} {{\n", s.name); + for member in &s.children { + struct_str.push_str(&format!( + "{},\n", + format_ty_field(&member.name, &member.ty, member.key) + )); + } + struct_str.push('}'); + Some(struct_str) + } + Ty::Enum(e) => { + let mut enum_str = format!("enum {} {{\n", e.name); + for child in &e.options { + enum_str + .push_str(&format!("{},\n", format_ty_field(&child.name, &child.ty, false))); + } + enum_str.push('}'); + Some(enum_str) + } + _ => None, + }; + + if let Some(ty_repr) = ty_repr { + println!("{}\n\n", ty_repr); + } +} + +// print the full Ty tree +pub fn deep_print_ty(root: Ty) { + let mut ty_list = vec![]; + get_printable_ty_list(&root, &mut ty_list); + + for ty in ty_list { + print_ty(&ty); + } +} diff --git a/crates/sozo/ops/src/statistics.rs b/crates/sozo/ops/src/statistics.rs index 81b77a15b7..b02a0dcbf8 100644 --- a/crates/sozo/ops/src/statistics.rs +++ b/crates/sozo/ops/src/statistics.rs @@ -1,45 +1,70 @@ use std::fs::{self, File}; -use std::io::{self, BufReader}; +use std::io::BufReader; use std::path::PathBuf; use anyhow::{Context, Result}; +use cairo_lang_starknet_classes::casm_contract_class::CasmContractClass; +use cairo_lang_starknet_classes::contract_class::ContractClass; use camino::Utf8PathBuf; -use starknet::core::types::contract::SierraClass; -use starknet::core::types::FlattenedSierraClass; +use scarb_ui::Ui; +use serde::Serialize; #[derive(Debug, PartialEq)] pub struct ContractStatistics { pub contract_name: String, - pub number_felts: u64, - pub file_size: u64, + + pub sierra_bytecode_size: u64, + pub sierra_contract_class_size: u64, + + pub casm_bytecode_size: u64, + pub casm_contract_class_size: u64, } -fn read_sierra_json_program(file: &File) -> Result { - let contract_artifact: SierraClass = serde_json::from_reader(BufReader::new(file))?; - let contract_artifact: FlattenedSierraClass = contract_artifact.flatten()?; +fn get_sierra_and_casm_class_from_file(file: &File) -> Result<(ContractClass, CasmContractClass)> { + let sierra_contract_class: ContractClass = serde_json::from_reader(BufReader::new(file))?; + let casm_contract_class: CasmContractClass = + CasmContractClass::from_contract_class(sierra_contract_class.clone(), false, usize::MAX)?; - Ok(contract_artifact) + Ok((sierra_contract_class, casm_contract_class)) } -fn get_sierra_byte_code_size(contract_artifact: FlattenedSierraClass) -> u64 { +fn get_sierra_byte_code_size(contract_artifact: ContractClass) -> u64 { contract_artifact.sierra_program.len() as u64 } -fn get_file_size(file: &File) -> Result { - file.metadata().map(|metadata| metadata.len()) +fn get_casm_byte_code_size(contract_artifact: CasmContractClass) -> u64 { + contract_artifact.bytecode.len() as u64 +} + +fn get_file_size_from_struct(t: &T) -> u64 +where + T: Serialize, +{ + serde_json::to_string(t).context("should be valid json").unwrap().len().try_into().unwrap() } fn get_contract_statistics_for_file( contract_name: String, - sierra_json_file: File, - contract_artifact: FlattenedSierraClass, + sierra_class: ContractClass, + casm_class: CasmContractClass, ) -> Result { - let file_size = get_file_size(&sierra_json_file).context("Error getting file size")?; - let number_felts = get_sierra_byte_code_size(contract_artifact); - Ok(ContractStatistics { file_size, contract_name, number_felts }) + let sierra_contract_class_size = get_file_size_from_struct(&sierra_class); + let sierra_bytecode_size = get_sierra_byte_code_size(sierra_class); + + let casm_contract_class_size = get_file_size_from_struct(&casm_class); + let casm_bytecode_size = get_casm_byte_code_size(casm_class); + + Ok(ContractStatistics { + contract_name, + sierra_bytecode_size, + sierra_contract_class_size, + casm_bytecode_size, + casm_contract_class_size, + }) } pub fn get_contract_statistics_for_dir( + ui: Ui, target_directory: &Utf8PathBuf, ) -> Result> { let mut contract_statistics = Vec::new(); @@ -55,19 +80,31 @@ pub fn get_contract_statistics_for_dir( let contract_name: String = path.file_stem().context("Error getting file name")?.to_string_lossy().to_string(); + // To ignore files like `contract.contract_class.json` or + // `contract.compiled_contract_class.json` + if contract_name.contains('.') { + continue; + } + let sierra_json_file: File = File::open(&path).context(format!("Error opening file: {}", path.to_string_lossy()))?; - let contract_artifact: FlattenedSierraClass = read_sierra_json_program(&sierra_json_file) - .context(format!( - "Error parsing Sierra class artifact: {}", - path.to_string_lossy() - ))?; + let (sierra_class, casm_class) = + match get_sierra_and_casm_class_from_file(&sierra_json_file) { + Ok(s) => s, + Err(e) => { + ui.verbose(format!("Unable to process file: {:?}\nWith error: {e:?}", &path)); + // skip any file which cannot be processed properly since there can be other + // file types in target folder for example casm contract + // class. + continue; + } + }; contract_statistics.push(get_contract_statistics_for_file( contract_name, - sierra_json_file, - contract_artifact, + sierra_class, + casm_class, )?); } Ok(contract_statistics) @@ -76,14 +113,18 @@ pub fn get_contract_statistics_for_dir( #[cfg(test)] mod tests { use std::fs::File; + use std::io::BufReader; use std::path::Path; + use cairo_lang_starknet_classes::contract_class::ContractClass; use camino::Utf8PathBuf; + use scarb_ui::Ui; use super::{ - get_contract_statistics_for_dir, get_contract_statistics_for_file, get_file_size, - get_sierra_byte_code_size, read_sierra_json_program, ContractStatistics, + get_contract_statistics_for_dir, get_contract_statistics_for_file, + get_sierra_and_casm_class_from_file, get_sierra_byte_code_size, ContractStatistics, }; + use crate::statistics::get_casm_byte_code_size; const TEST_SIERRA_JSON_CONTRACT: &str = "../../../bin/sozo/tests/test_data/compiled_contracts/test_contract.json"; @@ -94,16 +135,27 @@ mod tests { fn get_sierra_byte_code_size_returns_correct_size() { let sierra_json_file = File::open(TEST_SIERRA_JSON_CONTRACT) .unwrap_or_else(|err| panic!("Failed to open file: {}", err)); - let flattened_sierra_class = read_sierra_json_program(&sierra_json_file) - .unwrap_or_else(|err| panic!("Failed to read JSON program: {}", err)); - const EXPECTED_NUMBER_OF_FELTS: u64 = 2175; + let (flattened_sierra_class, casm_class) = + get_sierra_and_casm_class_from_file(&sierra_json_file) + .unwrap_or_else(|err| panic!("Failed to read JSON program: {}", err)); + + const SIERRA_EXPECTED_NUMBER_OF_FELTS: u64 = 2175; - let number_of_felts = get_sierra_byte_code_size(flattened_sierra_class); + let sierra_bytecode_size = get_sierra_byte_code_size(flattened_sierra_class); + let casm_bytecode_size = get_casm_byte_code_size(casm_class); + + const CASM_EXPECTED_NUMBER_OF_FELTS: u64 = 4412; + + assert_eq!( + sierra_bytecode_size, SIERRA_EXPECTED_NUMBER_OF_FELTS, + "[Sierra] Number of felts mismatch. Expected {}, got {}", + SIERRA_EXPECTED_NUMBER_OF_FELTS, sierra_bytecode_size + ); assert_eq!( - number_of_felts, EXPECTED_NUMBER_OF_FELTS, - "Number of felts mismatch. Expected {}, got {}", - EXPECTED_NUMBER_OF_FELTS, number_of_felts + casm_bytecode_size, CASM_EXPECTED_NUMBER_OF_FELTS, + "[Casm] Number of felts mismatch. Expected {}, got {}", + CASM_EXPECTED_NUMBER_OF_FELTS, casm_bytecode_size ); } @@ -111,21 +163,27 @@ mod tests { fn get_contract_statistics_for_file_returns_correct_statistics() { let sierra_json_file = File::open(TEST_SIERRA_JSON_CONTRACT) .unwrap_or_else(|err| panic!("Failed to open file: {}", err)); - let contract_artifact = read_sierra_json_program(&sierra_json_file) + + let (sierra_class, casm_class) = get_sierra_and_casm_class_from_file(&sierra_json_file) .unwrap_or_else(|err| panic!("Failed to read JSON program: {}", err)); + let filename = Path::new(TEST_SIERRA_JSON_CONTRACT) .file_stem() .expect("Error getting file name") .to_string_lossy() .to_string(); + let expected_contract_statistics: ContractStatistics = ContractStatistics { contract_name: String::from("test_contract"), - number_felts: 2175, - file_size: 114925, + sierra_bytecode_size: 2175, + sierra_contract_class_size: 106559, + + casm_bytecode_size: 4412, + casm_contract_class_size: 95806, }; let statistics = - get_contract_statistics_for_file(filename.clone(), sierra_json_file, contract_artifact) + get_contract_statistics_for_file(filename.clone(), sierra_class, casm_class) .expect("Error getting contract statistics for file"); assert_eq!(statistics, expected_contract_statistics); @@ -134,8 +192,9 @@ mod tests { #[test] fn get_contract_statistics_for_dir_returns_correct_statistics() { let target_dir = Utf8PathBuf::from(TEST_SIERRA_FOLDER_CONTRACTS); + let ui = Ui::new(scarb_ui::Verbosity::Normal, scarb_ui::OutputFormat::Text); - let contract_statistics = get_contract_statistics_for_dir(&target_dir) + let contract_statistics = get_contract_statistics_for_dir(ui, &target_dir) .unwrap_or_else(|_| panic!("Error getting contracts in dir {target_dir}")); assert_eq!(contract_statistics.len(), 1, "Mismatch number of contract statistics"); @@ -145,10 +204,13 @@ mod tests { fn get_file_size_returns_correct_size() { let sierra_json_file = File::open(TEST_SIERRA_JSON_CONTRACT) .unwrap_or_else(|err| panic!("Failed to open test file: {}", err)); - const EXPECTED_SIZE: u64 = 114925; + // file size of minified json + const EXPECTED_SIZE: u64 = 106559; - let file_size = get_file_size(&sierra_json_file) - .unwrap_or_else(|_| panic!("Error getting file size for test file")); + let sierra_contract_class: ContractClass = + serde_json::from_reader(BufReader::new(sierra_json_file)).unwrap(); + let file_size: u64 = + serde_json::to_string(&sierra_contract_class).unwrap().len().try_into().unwrap(); assert_eq!(file_size, EXPECTED_SIZE, "File size mismatch"); } @@ -159,7 +221,7 @@ mod tests { let sierra_json_file = File::open(TEST_SIERRA_JSON_CONTRACT) .unwrap_or_else(|err| panic!("Failed to open test file: {}", err)); - let result = read_sierra_json_program(&sierra_json_file); + let result = get_sierra_and_casm_class_from_file(&sierra_json_file); assert!(result.is_ok(), "Expected Ok result"); } diff --git a/crates/sozo/ops/src/tests/migration.rs b/crates/sozo/ops/src/tests/migration.rs index 45047fe345..1cc6b0b3a8 100644 --- a/crates/sozo/ops/src/tests/migration.rs +++ b/crates/sozo/ops/src/tests/migration.rs @@ -2,17 +2,17 @@ use std::str; use cainome::cairo_serde::ContractAddress; use camino::Utf8Path; -use dojo_lang::compiler::{BASE_DIR, MANIFESTS_DIR, OVERLAYS_DIR}; use dojo_test_utils::migration::prepare_migration_with_world_and_seed; use dojo_world::contracts::{WorldContract, WorldContractReader}; use dojo_world::manifest::{ - BaseManifest, DeploymentManifest, OverlayManifest, WORLD_CONTRACT_NAME, + BaseManifest, DeploymentManifest, OverlayManifest, BASE_DIR, MANIFESTS_DIR, OVERLAYS_DIR, + WORLD_CONTRACT_NAME, }; use dojo_world::metadata::{ dojo_metadata_from_workspace, ArtifactMetadata, DojoMetadata, Uri, WorldMetadata, IPFS_CLIENT_URL, IPFS_PASSWORD, IPFS_USERNAME, }; -use dojo_world::migration::strategy::prepare_for_migration; +use dojo_world::migration::strategy::{prepare_for_migration, MigrationMetadata}; use dojo_world::migration::world::WorldDiff; use dojo_world::migration::TxnConfig; use futures::TryStreamExt; @@ -91,6 +91,113 @@ async fn migrate_with_small_fee_multiplier_will_fail() { ); } +#[tokio::test] +async fn metadata_calculated_properly() { + let config = setup::load_config(); + let ws = setup::setup_ws(&config); + + let base = config.manifest_path().parent().unwrap(); + let target_dir = format!("{}/target/dev", base); + + let profile_name = ws.current_profile().unwrap().to_string(); + + let mut manifest = BaseManifest::load_from_path( + &base.to_path_buf().join(MANIFESTS_DIR).join(profile_name).join(BASE_DIR), + ) + .unwrap(); + + let overlay_manifest = + OverlayManifest::load_from_path(&base.join(MANIFESTS_DIR).join("dev").join(OVERLAYS_DIR)) + .unwrap(); + + manifest.merge(overlay_manifest); + + let world = WorldDiff::compute(manifest, None); + + let migration = prepare_for_migration( + None, + felt!("0x12345"), + &Utf8Path::new(&target_dir).to_path_buf(), + world, + ) + .unwrap(); + + // verifies that key name and actual item name are same + for (key, value) in migration.metadata.iter() { + match value { + MigrationMetadata::Contract(c) => { + assert_eq!(key, &c.name); + } + } + } +} + +#[tokio::test] +async fn migration_with_correct_calldata_second_time_work_as_expected() { + let config = setup::load_config(); + let ws = setup::setup_ws(&config); + + let base = config.manifest_path().parent().unwrap(); + let target_dir = format!("{}/target/dev", base); + + let sequencer = KatanaRunner::new().expect("Failed to start runner."); + + let account = sequencer.account(0); + + let profile_name = ws.current_profile().unwrap().to_string(); + + let mut manifest = BaseManifest::load_from_path( + &base.to_path_buf().join(MANIFESTS_DIR).join(&profile_name).join(BASE_DIR), + ) + .unwrap(); + + let world = WorldDiff::compute(manifest.clone(), None); + + let migration = prepare_for_migration( + None, + felt!("0x12345"), + &Utf8Path::new(&target_dir).to_path_buf(), + world, + ) + .unwrap(); + + let migration_output = + execute_strategy(&ws, &migration, &account, TxnConfig::init_wait()).await.unwrap(); + + // first time others will fail due to calldata error + assert!(!migration_output.full); + + let world_address = migration_output.world_address; + + let remote_manifest = DeploymentManifest::load_from_remote(sequencer.provider(), world_address) + .await + .expect("Failed to load remote manifest"); + + let overlay = OverlayManifest::load_from_path( + &base.join(MANIFESTS_DIR).join(&profile_name).join(OVERLAYS_DIR), + ) + .expect("Failed to load overlay"); + + // adding correct calldata + manifest.merge(overlay); + + let mut world = WorldDiff::compute(manifest, Some(remote_manifest)); + world.update_order().expect("Failed to update order"); + + let mut migration = prepare_for_migration( + Some(world_address), + felt!("0x12345"), + &Utf8Path::new(&target_dir).to_path_buf(), + world, + ) + .unwrap(); + migration.resolve_variable(migration.world_address().unwrap()).expect("Failed to resolve"); + + let migration_output = + execute_strategy(&ws, &migration, &account, TxnConfig::init_wait()).await.unwrap(); + assert!(migration_output.full); +} + #[tokio::test] async fn migration_from_remote() { let config = setup::load_config(); @@ -164,7 +271,8 @@ async fn migrate_with_metadata() { .unwrap_or_else(|_| panic!("Unable to initialize the IPFS Client")) .with_credentials(IPFS_USERNAME, IPFS_PASSWORD); - let dojo_metadata = dojo_metadata_from_workspace(&ws); + let dojo_metadata = + dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); // check world metadata let resource = world_reader.metadata(&FieldElement::ZERO).call().await.unwrap(); @@ -217,7 +325,8 @@ async fn migrate_with_auto_authorize() { let config = setup::load_config(); let ws = setup::setup_ws(&config); - let migration = setup::setup_migration(&config).unwrap(); + let mut migration = setup::setup_migration(&config).unwrap(); + migration.resolve_variable(migration.world_address().unwrap()).unwrap(); let manifest_base = config.manifest_path().parent().unwrap(); let mut manifest = @@ -483,19 +592,19 @@ async fn check_artifact_metadata( ) { let resource = world_reader.metadata(&resource_id).call().await.unwrap(); - let expected_artifact = dojo_metadata.artifacts.get(element_name); + let expected_resource = dojo_metadata.resources_artifacts.get(element_name); assert!( - expected_artifact.is_some(), + expected_resource.is_some(), "Unable to find local artifact metadata for {}", element_name ); - let expected_artifact = expected_artifact.unwrap(); + let expected_resource = expected_resource.unwrap(); check_ipfs_metadata( client, element_name, &resource.metadata_uri.to_string().unwrap(), - expected_artifact, + &expected_resource.artifacts, ) .await; } diff --git a/crates/torii/README.md b/crates/torii/README.md index 635eb16da0..21ff59ea1a 100644 --- a/crates/torii/README.md +++ b/crates/torii/README.md @@ -4,4 +4,4 @@ curl -L https://install.dojoengine.org | bash ``` -[Documentation](https://book.dojoengine.org/toolchain/torii/overview) +[Documentation](https://book.dojoengine.org/toolchain/torii) diff --git a/crates/torii/core/Cargo.toml b/crates/torii/core/Cargo.toml index 6f99f9e213..cf1cb8cdd3 100644 --- a/crates/torii/core/Cargo.toml +++ b/crates/torii/core/Cargo.toml @@ -43,3 +43,4 @@ camino.workspace = true dojo-test-utils = { path = "../../dojo-test-utils" } scarb.workspace = true sozo = { path = "../../../bin/sozo" } +katana-runner.workspace = true diff --git a/crates/torii/core/src/engine.rs b/crates/torii/core/src/engine.rs index 2fb4935e6d..dcf4918c1a 100644 --- a/crates/torii/core/src/engine.rs +++ b/crates/torii/core/src/engine.rs @@ -174,12 +174,11 @@ impl Engine

{ Err(e) => { match e.to_string().as_str() { "TransactionHashNotFound" => { - warn!(target: LOG_TARGET, error = %e, transaction_hash = %format!("{:#x}", transaction.transaction_hash()), "Processing pending transaction."); - // We failed to fetch the transaction, which might be due to us indexing - // the pending transaction too fast. We will - // fail silently and retry processing the transaction in the next - // iteration. - return Ok(pending_block_tx); + // We failed to fetch the transaction, which is because + // the transaction might not have passed the validation stage. + // So we can safely ignore this transaction and not process it, as it + // rejected. + warn!(target: LOG_TARGET, transaction_hash = %format!("{:#x}", transaction.transaction_hash()), "Ignored failed pending transaction."); } _ => { error!(target: LOG_TARGET, error = %e, transaction_hash = %format!("{:#x}", transaction.transaction_hash()), "Processing pending transaction."); diff --git a/crates/torii/core/src/model.rs b/crates/torii/core/src/model.rs index 05790a3851..fff8ae6c53 100644 --- a/crates/torii/core/src/model.rs +++ b/crates/torii/core/src/model.rs @@ -1,3 +1,4 @@ +use std::collections::HashMap; use std::str::FromStr; use async_trait::async_trait; @@ -211,46 +212,118 @@ pub fn build_sql_query( model_schemas: &Vec, entities_table: &str, entity_relation_column: &str, -) -> Result { - fn parse_struct( + where_clause: Option<&str>, + where_clause_arrays: Option<&str>, +) -> Result<(String, HashMap), Error> { + fn parse_ty( path: &str, - schema: &Struct, + name: &str, + ty: &Ty, selections: &mut Vec, tables: &mut Vec, + arrays_queries: &mut HashMap, Vec)>, ) { - for child in &schema.children { - match &child.ty { - Ty::Struct(s) => { - let table_name = format!("{}${}", path, child.name); - parse_struct(&table_name, s, selections, tables); + match &ty { + Ty::Struct(s) => { + // struct can be the main entrypoint to our model schema + // so we dont format the table name if the path is empty + let table_name = + if path.is_empty() { s.name.clone() } else { format!("{}${}", path, name) }; + + for child in &s.children { + parse_ty( + &table_name, + &child.name, + &child.ty, + selections, + tables, + arrays_queries, + ); + } - tables.push(table_name); + tables.push(table_name); + } + Ty::Tuple(t) => { + let table_name = format!("{}${}", path, name); + for (i, child) in t.iter().enumerate() { + parse_ty( + &table_name, + &format!("_{}", i), + child, + selections, + tables, + arrays_queries, + ); + } + + tables.push(table_name); + } + Ty::Array(t) => { + let table_name = format!("{}${}", path, name); + + let mut array_selections = Vec::new(); + let mut array_tables = vec![table_name.clone()]; + + parse_ty( + &table_name, + "data", + &t[0], + &mut array_selections, + &mut array_tables, + arrays_queries, + ); + + arrays_queries.insert(table_name, (array_selections, array_tables)); + } + Ty::Enum(e) => { + let table_name = format!("{}${}", path, name); + + let mut is_typed = false; + for option in &e.options { + if let Ty::Tuple(t) = &option.ty { + if t.is_empty() { + continue; + } + } + + parse_ty( + &table_name, + &option.name, + &option.ty, + selections, + tables, + arrays_queries, + ); + is_typed = true; } - _ => { - // alias selected columns to avoid conflicts in `JOIN` - selections.push(format!( - "{}.external_{} AS \"{}.{}\"", - path, child.name, path, child.name - )); + + selections.push(format!("{}.external_{} AS \"{}.{}\"", path, name, path, name)); + if is_typed { + tables.push(table_name); } } + _ => { + // alias selected columns to avoid conflicts in `JOIN` + selections.push(format!("{}.external_{} AS \"{}.{}\"", path, name, path, name)); + } } } let mut global_selections = Vec::new(); - let mut global_tables = - model_schemas.iter().enumerate().map(|(_, schema)| schema.name()).collect::>(); + let mut global_tables = Vec::new(); + + let mut arrays_queries = HashMap::new(); for ty in model_schemas { let schema = ty.as_struct().expect("schema should be struct"); - let model_table = &schema.name; - let mut selections = Vec::new(); - let mut tables = Vec::new(); - - parse_struct(model_table, schema, &mut selections, &mut tables); - - global_selections.push(selections.join(", ")); - global_tables.extend(tables); + parse_ty( + "", + &schema.name, + ty, + &mut global_selections, + &mut global_tables, + &mut arrays_queries, + ); } // TODO: Fallback to subqueries, SQLite has a max limit of 64 on 'table 'JOIN' @@ -267,91 +340,188 @@ pub fn build_sql_query( .collect::>() .join(" "); - Ok(format!( + let mut formatted_arrays_queries: HashMap = arrays_queries + .into_iter() + .map(|(table, (selections, tables))| { + let mut selections_clause = selections.join(", "); + if !selections_clause.is_empty() { + selections_clause = format!(", {}", selections_clause); + } + + let join_clause = tables + .iter() + .enumerate() + .map(|(idx, table)| { + if idx == 0 { + format!( + " JOIN {table} ON {entities_table}.id = \ + {table}.{entity_relation_column}" + ) + } else { + format!( + " JOIN {table} ON {table}.full_array_id = {prev_table}.full_array_id", + prev_table = tables[idx - 1] + ) + } + }) + .collect::>() + .join(" "); + + ( + table, + format!( + "SELECT {entities_table}.id, {entities_table}.keys{selections_clause} FROM \ + {entities_table}{join_clause}", + ), + ) + }) + .collect(); + + let mut query = format!( "SELECT {entities_table}.id, {entities_table}.keys, {selections_clause} FROM \ {entities_table}{join_clause}" - )) + ); + + if let Some(where_clause) = where_clause { + query = format!("{} WHERE {}", query, where_clause); + } + + if let Some(where_clause_arrays) = where_clause_arrays { + for (_, formatted_query) in formatted_arrays_queries.iter_mut() { + *formatted_query = format!("{} WHERE {}", formatted_query, where_clause_arrays); + } + } + + Ok((query, formatted_arrays_queries)) } /// Populate the values of a Ty (schema) from SQLite row. -pub fn map_row_to_ty(path: &str, struct_ty: &mut Struct, row: &SqliteRow) -> Result<(), Error> { - for member in struct_ty.children.iter_mut() { - let column_name = format!("{}.{}", path, member.name); - match &mut member.ty { - Ty::Primitive(primitive) => { - match &primitive { - Primitive::Bool(_) => { - let value = row.try_get::(&column_name)?; - primitive.set_bool(Some(value))?; - } - Primitive::USize(_) => { - let value = row.try_get::(&column_name)?; - primitive.set_usize(Some(value))?; - } - Primitive::U8(_) => { - let value = row.try_get::(&column_name)?; - primitive.set_u8(Some(value))?; - } - Primitive::U16(_) => { - let value = row.try_get::(&column_name)?; - primitive.set_u16(Some(value))?; - } - Primitive::U32(_) => { - let value = row.try_get::(&column_name)?; - primitive.set_u32(Some(value))?; - } - Primitive::U64(_) => { - let value = row.try_get::(&column_name)?; - let hex_str = value.trim_start_matches("0x"); - primitive.set_u64(Some( - u64::from_str_radix(hex_str, 16).map_err(ParseError::ParseIntError)?, - ))?; - } - Primitive::U128(_) => { - let value = row.try_get::(&column_name)?; - let hex_str = value.trim_start_matches("0x"); - primitive.set_u128(Some( - u128::from_str_radix(hex_str, 16).map_err(ParseError::ParseIntError)?, - ))?; - } - Primitive::U256(_) => { - let value = row.try_get::(&column_name)?; - let hex_str = value.trim_start_matches("0x"); - primitive.set_u256(Some(U256::from_be_hex(hex_str)))?; - } - Primitive::Felt252(_) => { - let value = row.try_get::(&column_name)?; - primitive.set_felt252(Some( - FieldElement::from_str(&value).map_err(ParseError::FromStr)?, - ))?; - } - Primitive::ClassHash(_) => { - let value = row.try_get::(&column_name)?; - primitive.set_contract_address(Some( - FieldElement::from_str(&value).map_err(ParseError::FromStr)?, - ))?; - } - Primitive::ContractAddress(_) => { - let value = row.try_get::(&column_name)?; - primitive.set_contract_address(Some( - FieldElement::from_str(&value).map_err(ParseError::FromStr)?, - ))?; - } - }; - } - Ty::Enum(enum_ty) => { - let value = row.try_get::(&column_name)?; - enum_ty.set_option(&value)?; +pub fn map_row_to_ty( + path: &str, + name: &str, + ty: &mut Ty, + // the row that contains non dynamic data for Ty + row: &SqliteRow, + // a hashmap where keys are the paths for the model + // arrays and values are the rows mapping to each element + // in the array + arrays_rows: &HashMap>, +) -> Result<(), Error> { + let column_name = format!("{}.{}", path, name); + match ty { + Ty::Primitive(primitive) => { + match &primitive { + Primitive::Bool(_) => { + let value = row.try_get::(&column_name)?; + primitive.set_bool(Some(value))?; + } + Primitive::USize(_) => { + let value = row.try_get::(&column_name)?; + primitive.set_usize(Some(value))?; + } + Primitive::U8(_) => { + let value = row.try_get::(&column_name)?; + primitive.set_u8(Some(value))?; + } + Primitive::U16(_) => { + let value = row.try_get::(&column_name)?; + primitive.set_u16(Some(value))?; + } + Primitive::U32(_) => { + let value = row.try_get::(&column_name)?; + primitive.set_u32(Some(value))?; + } + Primitive::U64(_) => { + let value = row.try_get::(&column_name)?; + let hex_str = value.trim_start_matches("0x"); + primitive.set_u64(Some( + u64::from_str_radix(hex_str, 16).map_err(ParseError::ParseIntError)?, + ))?; + } + Primitive::U128(_) => { + let value = row.try_get::(&column_name)?; + let hex_str = value.trim_start_matches("0x"); + primitive.set_u128(Some( + u128::from_str_radix(hex_str, 16).map_err(ParseError::ParseIntError)?, + ))?; + } + Primitive::U256(_) => { + let value = row.try_get::(&column_name)?; + let hex_str = value.trim_start_matches("0x"); + primitive.set_u256(Some(U256::from_be_hex(hex_str)))?; + } + Primitive::Felt252(_) => { + let value = row.try_get::(&column_name)?; + primitive.set_felt252(Some( + FieldElement::from_str(&value).map_err(ParseError::FromStr)?, + ))?; + } + Primitive::ClassHash(_) => { + let value = row.try_get::(&column_name)?; + primitive.set_contract_address(Some( + FieldElement::from_str(&value).map_err(ParseError::FromStr)?, + ))?; + } + Primitive::ContractAddress(_) => { + let value = row.try_get::(&column_name)?; + primitive.set_contract_address(Some( + FieldElement::from_str(&value).map_err(ParseError::FromStr)?, + ))?; + } + }; + } + Ty::Enum(enum_ty) => { + let option = row.try_get::(&column_name)?; + enum_ty.set_option(&option)?; + + let path = [path, &name].join("$"); + for option in &mut enum_ty.options { + map_row_to_ty(&path, &option.name, &mut option.ty, row, arrays_rows)?; } - Ty::Struct(struct_ty) => { - let path = [path, &member.name].join("$"); - map_row_to_ty(&path, struct_ty, row)?; + } + Ty::Struct(struct_ty) => { + // struct can be the main entrypoint to our model schema + // so we dont format the table name if the path is empty + let path = + if path.is_empty() { struct_ty.name.clone() } else { [path, &name].join("$") }; + + for member in &mut struct_ty.children { + map_row_to_ty(&path, &member.name, &mut member.ty, row, arrays_rows)?; } - ty => { - unimplemented!("unimplemented type_enum: {ty}"); + } + Ty::Tuple(ty) => { + let path = [path, &name].join("$"); + + for (i, member) in ty.iter_mut().enumerate() { + map_row_to_ty(&path, &format!("_{}", i), member, row, arrays_rows)?; } - }; - } + } + Ty::Array(ty) => { + let path = [path, &name].join("$"); + // filter by entity id in case we have multiple entities + let rows = arrays_rows + .get(&path) + .expect("qed; rows should exist") + .iter() + .filter(|array_row| array_row.get::("id") == row.get::("id")) + .collect::>(); + + // map each row to the ty of the array + let tys = rows + .iter() + .map(|row| { + let mut ty = ty[0].clone(); + map_row_to_ty(&path, "data", &mut ty, row, arrays_rows).map(|_| ty) + }) + .collect::, _>>()?; + + *ty = tys; + } + Ty::ByteArray(bytearray) => { + let value = row.try_get::(&column_name)?; + *bytearray = value; + } + }; Ok(()) } @@ -386,9 +556,19 @@ mod tests { type_enum: "Primitive".into(), enum_options: None, }, + SqlModelMember { + id: "PlayerConfig".into(), + name: "name".into(), + r#type: "ByteArray".into(), + key: false, + model_idx: 0, + member_idx: 0, + type_enum: "ByteArray".into(), + enum_options: None, + }, ]; - let expected_ty = Ty::Struct(Struct { + let expected_position = Ty::Struct(Struct { name: "Position".into(), children: vec![ dojo_types::schema::Member { @@ -404,7 +584,17 @@ mod tests { ], }); - assert_eq!(parse_sql_model_members("Position", &model_members), expected_ty); + let expected_player_config = Ty::Struct(Struct { + name: "PlayerConfig".into(), + children: vec![dojo_types::schema::Member { + name: "name".into(), + key: false, + ty: Ty::ByteArray("".to_string()), + }], + }); + + assert_eq!(parse_sql_model_members("Position", &model_members), expected_position); + assert_eq!(parse_sql_model_members("PlayerConfig", &model_members), expected_player_config); } #[test] @@ -460,9 +650,79 @@ mod tests { type_enum: "Primitive".into(), enum_options: None, }, + SqlModelMember { + id: "PlayerConfig".into(), + name: "favorite_item".into(), + r#type: "Option".into(), + key: false, + model_idx: 0, + member_idx: 0, + type_enum: "Enum".into(), + enum_options: Some("None,Some".into()), + }, + SqlModelMember { + id: "PlayerConfig".into(), + name: "items".into(), + r#type: "Array".into(), + key: false, + model_idx: 0, + member_idx: 1, + type_enum: "Array".into(), + enum_options: None, + }, + SqlModelMember { + id: "PlayerConfig$items".into(), + name: "data".into(), + r#type: "PlayerItem".into(), + key: false, + model_idx: 0, + member_idx: 1, + type_enum: "Struct".into(), + enum_options: None, + }, + SqlModelMember { + id: "PlayerConfig$items$data".into(), + name: "item_id".into(), + r#type: "u32".into(), + key: false, + model_idx: 0, + member_idx: 0, + type_enum: "Primitive".into(), + enum_options: None, + }, + SqlModelMember { + id: "PlayerConfig$items$data".into(), + name: "quantity".into(), + r#type: "u32".into(), + key: false, + model_idx: 0, + member_idx: 1, + type_enum: "Primitive".into(), + enum_options: None, + }, + SqlModelMember { + id: "PlayerConfig$favorite_item".into(), + name: "Some".into(), + r#type: "u32".into(), + key: false, + model_idx: 1, + member_idx: 0, + type_enum: "Primitive".into(), + enum_options: None, + }, + SqlModelMember { + id: "PlayerConfig$favorite_item".into(), + name: "option".into(), + r#type: "Option".into(), + key: false, + model_idx: 1, + member_idx: 0, + type_enum: "Enum".into(), + enum_options: Some("None,Some".into()), + }, ]; - let expected_ty = Ty::Struct(Struct { + let expected_position = Ty::Struct(Struct { name: "Position".into(), children: vec![ dojo_types::schema::Member { @@ -497,7 +757,48 @@ mod tests { ], }); - assert_eq!(parse_sql_model_members("Position", &model_members), expected_ty); + let expected_player_config = Ty::Struct(Struct { + name: "PlayerConfig".into(), + children: vec![ + dojo_types::schema::Member { + name: "favorite_item".into(), + key: false, + ty: Ty::Enum(Enum { + name: "Option".into(), + option: None, + options: vec![ + EnumOption { name: "None".into(), ty: Ty::Tuple(vec![]) }, + EnumOption { + name: "Some".into(), + ty: Ty::Primitive("u32".parse().unwrap()), + }, + ], + }), + }, + dojo_types::schema::Member { + name: "items".into(), + key: false, + ty: Ty::Array(vec![Ty::Struct(Struct { + name: "PlayerItem".into(), + children: vec![ + Member { + name: "item_id".into(), + key: false, + ty: Ty::Primitive("u32".parse().unwrap()), + }, + Member { + name: "quantity".into(), + key: false, + ty: Ty::Primitive("u32".parse().unwrap()), + }, + ], + })]), + }, + ], + }); + + assert_eq!(parse_sql_model_members("Position", &model_members), expected_position); + assert_eq!(parse_sql_model_members("PlayerConfig", &model_members), expected_player_config); } #[test] @@ -536,18 +837,13 @@ mod tests { #[test] fn struct_ty_to_query() { - let ty = Ty::Struct(Struct { + let position = Ty::Struct(Struct { name: "Position".into(), children: vec![ dojo_types::schema::Member { - name: "name".into(), - key: false, - ty: Ty::Primitive("felt252".parse().unwrap()), - }, - dojo_types::schema::Member { - name: "age".into(), - key: false, - ty: Ty::Primitive("u8".parse().unwrap()), + name: "player".into(), + key: true, + ty: Ty::Primitive("ContractAddress".parse().unwrap()), }, dojo_types::schema::Member { name: "vec".into(), @@ -558,23 +854,105 @@ mod tests { Member { name: "x".into(), key: false, - ty: Ty::Primitive("u256".parse().unwrap()), + ty: Ty::Primitive("u32".parse().unwrap()), }, Member { name: "y".into(), key: false, - ty: Ty::Primitive("u256".parse().unwrap()), + ty: Ty::Primitive("u32".parse().unwrap()), + }, + ], + }), + }, + dojo_types::schema::Member { + name: "test_everything".into(), + key: false, + ty: Ty::Array(vec![Ty::Struct(Struct { + name: "TestEverything".into(), + children: vec![Member { + name: "data".into(), + key: false, + ty: Ty::Tuple(vec![ + Ty::Array(vec![Ty::Primitive("u32".parse().unwrap())]), + Ty::Array(vec![Ty::Array(vec![Ty::Tuple(vec![ + Ty::Primitive("u32".parse().unwrap()), + Ty::Struct(Struct { + name: "Vec2".into(), + children: vec![ + Member { + name: "x".into(), + key: false, + ty: Ty::Primitive("u32".parse().unwrap()), + }, + Member { + name: "y".into(), + key: false, + ty: Ty::Primitive("u32".parse().unwrap()), + }, + ], + }), + ])])]), + ]), + }], + })]), + }, + ], + }); + + let player_config = Ty::Struct(Struct { + name: "PlayerConfig".into(), + children: vec![ + dojo_types::schema::Member { + name: "favorite_item".into(), + key: false, + ty: Ty::Enum(Enum { + name: "Option".into(), + option: None, + options: vec![ + EnumOption { name: "None".into(), ty: Ty::Tuple(vec![]) }, + EnumOption { + name: "Some".into(), + ty: Ty::Primitive("u32".parse().unwrap()), }, ], }), }, + dojo_types::schema::Member { + name: "items".into(), + key: false, + ty: Ty::Array(vec![Ty::Struct(Struct { + name: "PlayerItem".into(), + children: vec![ + Member { + name: "item_id".into(), + key: false, + ty: Ty::Primitive("u32".parse().unwrap()), + }, + Member { + name: "quantity".into(), + key: false, + ty: Ty::Primitive("u32".parse().unwrap()), + }, + ], + })]), + }, ], }); - let query = build_sql_query(&vec![ty], "entities", "entity_id").unwrap(); - assert_eq!( - query, - r#"SELECT entities.id, entities.keys, Position.external_name AS "Position.name", Position.external_age AS "Position.age", Position$vec.external_x AS "Position$vec.x", Position$vec.external_y AS "Position$vec.y" FROM entities JOIN Position ON entities.id = Position.entity_id JOIN Position$vec ON entities.id = Position$vec.entity_id"# - ); + let query = + build_sql_query(&vec![position, player_config], "entities", "entity_id", None, None) + .unwrap(); + + let expected_query = + "SELECT entities.id, entities.keys, Position.external_player AS \"Position.player\", \ + Position$vec.external_x AS \"Position$vec.x\", Position$vec.external_y AS \ + \"Position$vec.y\", PlayerConfig$favorite_item.external_Some AS \ + \"PlayerConfig$favorite_item.Some\", PlayerConfig.external_favorite_item AS \ + \"PlayerConfig.favorite_item\" FROM entities JOIN Position$vec ON entities.id = \ + Position$vec.entity_id JOIN Position ON entities.id = Position.entity_id JOIN \ + PlayerConfig$favorite_item ON entities.id = PlayerConfig$favorite_item.entity_id \ + JOIN PlayerConfig ON entities.id = PlayerConfig.entity_id"; + // todo: completely tests arrays + assert_eq!(query.0, expected_query); } } diff --git a/crates/torii/core/src/processors/metadata_update.rs b/crates/torii/core/src/processors/metadata_update.rs index 07859743b2..ed2432f712 100644 --- a/crates/torii/core/src/processors/metadata_update.rs +++ b/crates/torii/core/src/processors/metadata_update.rs @@ -4,11 +4,11 @@ use anyhow::{Error, Result}; use async_trait::async_trait; use base64::engine::general_purpose; use base64::Engine as _; +use cainome::cairo_serde::{ByteArray, CairoSerde}; use dojo_world::contracts::world::WorldContractReader; use dojo_world::metadata::{Uri, WorldMetadata}; use reqwest::Client; use starknet::core::types::{Event, MaybePendingTransactionReceipt}; -use starknet::core::utils::parse_cairo_short_string; use starknet::providers::Provider; use starknet_crypto::FieldElement; use tokio_util::bytes::Bytes; @@ -58,18 +58,7 @@ where event: &Event, ) -> Result<(), Error> { let resource = &event.data[0]; - let uri_len: u8 = event.data[1].try_into().unwrap(); - - let uri_str = if uri_len > 0 { - event.data[2..=uri_len as usize + 1] - .iter() - .map(parse_cairo_short_string) - .collect::, _>>()? - .concat() - } else { - "".to_string() - }; - + let uri_str = ByteArray::cairo_deserialize(&event.data, 1)?.to_string()?; info!( target: LOG_TARGET, resource = %format!("{:#x}", resource), diff --git a/crates/torii/core/src/sql.rs b/crates/torii/core/src/sql.rs index 5060bc7e07..02fe9ccb21 100644 --- a/crates/torii/core/src/sql.rs +++ b/crates/torii/core/src/sql.rs @@ -130,8 +130,8 @@ impl Sql { vec![model.name()], &mut model_idx, block_timestamp, - false, - false, + &mut 0, + &mut 0, ); self.query_queue.execute_all().await?; @@ -186,7 +186,7 @@ impl Sql { (&entity_id, false), &entity, block_timestamp, - None, + &vec![], ); self.query_queue.execute_all().await?; @@ -241,7 +241,7 @@ impl Sql { (&entity_id, true), &entity, block_timestamp, - None, + &vec![], ); self.query_queue.execute_all().await?; @@ -413,8 +413,8 @@ impl Sql { path: Vec, model_idx: &mut i64, block_timestamp: u64, - is_array: bool, - is_parent_array: bool, + array_idx: &mut usize, + parent_array_idx: &mut usize, ) { if let Ty::Enum(e) = model { if e.options.iter().all(|o| if let Ty::Tuple(t) = &o.ty { t.is_empty() } else { false }) @@ -428,8 +428,8 @@ impl Sql { model, *model_idx, block_timestamp, - is_array, - is_parent_array, + *array_idx, + *parent_array_idx, ); let mut build_member = |pathname: &str, member: &Ty| { @@ -447,9 +447,8 @@ impl Sql { path_clone, &mut (*model_idx + 1), block_timestamp, - // If the parent is an array, all children are also represented as table arrays - if let Ty::Array(_) = member { true } else { is_array }, - if let Ty::Array(_) = model { true } else { is_parent_array }, + &mut (*array_idx + if let Ty::Array(_) = member { 1 } else { 0 }), + &mut (*parent_array_idx + if let Ty::Array(_) = model { 1 } else { 0 }), ); }; @@ -486,12 +485,12 @@ impl Sql { entity_id: (&str, bool), entity: &Ty, block_timestamp: u64, - index: Option, + indexes: &Vec, ) { let (entity_id, is_event_message) = entity_id; let update_members = - |members: &[Member], query_queue: &mut QueryQueue, index: Option| { + |members: &[Member], query_queue: &mut QueryQueue, indexes: &Vec| { let table_id = path.join("$"); let mut columns = vec![ "id".to_string(), @@ -517,9 +516,19 @@ impl Sql { Argument::String(entity_id.to_string()), ]; - if let Some(idx) = index { - columns.push("idx".to_string()); - arguments.push(Argument::Int(idx)); + if !indexes.is_empty() { + columns.push("full_array_id".to_string()); + arguments.push(Argument::String( + std::iter::once(entity_id.to_string()) + .chain(indexes.iter().map(|i| i.to_string())) + .collect::>() + .join(FELT_DELIMITER), + )); + } + + for (column_idx, idx) in indexes.iter().enumerate() { + columns.push(format!("idx_{}", column_idx)); + arguments.push(Argument::Int(*idx)); } for member in members.iter() { @@ -552,7 +561,7 @@ impl Sql { match entity { Ty::Struct(s) => { - update_members(&s.children, &mut self.query_queue, index); + update_members(&s.children, &mut self.query_queue, indexes); for member in s.children.iter() { let mut path_clone = path.clone(); @@ -563,7 +572,7 @@ impl Sql { (entity_id, is_event_message), &member.ty, block_timestamp, - index, + indexes, ); } } @@ -584,7 +593,7 @@ impl Sql { Member { name: option.name.clone(), ty: option.ty.clone(), key: false }, ], &mut self.query_queue, - index, + indexes, ); match &option.ty { @@ -599,7 +608,7 @@ impl Sql { (entity_id, is_event_message), &option.ty, block_timestamp, - index, + indexes, ); } } @@ -616,7 +625,7 @@ impl Sql { .collect::>() .as_slice(), &mut self.query_queue, - index, + indexes, ); for (idx, member) in t.iter().enumerate() { @@ -628,25 +637,34 @@ impl Sql { (entity_id, is_event_message), member, block_timestamp, - index, + indexes, ); } } Ty::Array(array) => { - // delete all previous array elements - self.query_queue.enqueue( - format!( - "DELETE FROM [{table_id}] WHERE entity_id = ?", - table_id = path.join("$") - ), - vec![Argument::String(entity_id.to_string())], - ); + // delete all previous array elements with the array indexes + let table_id = path.join("$"); + let mut query = + format!("DELETE FROM [{table_id}] WHERE entity_id = ? ", table_id = table_id); + for idx in 0..indexes.len() { + query.push_str(&format!("AND idx_{} = ? ", idx)); + } + + // flatten indexes with entity id + let mut arguments = vec![Argument::String(entity_id.to_string())]; + arguments.extend(indexes.iter().map(|idx| Argument::Int(*idx))); + self.query_queue.enqueue(query, arguments); + + // insert the new array elements for (idx, member) in array.iter().enumerate() { + let mut indexes = indexes.clone(); + indexes.push(idx as i64); + update_members( &[Member { name: "data".to_string(), ty: member.clone(), key: false }], &mut self.query_queue, - Some(idx as i64), + &indexes, ); let mut path_clone = path.clone(); @@ -657,7 +675,7 @@ impl Sql { (entity_id, is_event_message), member, block_timestamp, - Some(idx as i64), + &indexes, ); } } @@ -678,22 +696,60 @@ impl Sql { self.query_queue .push_front(statement, vec![Argument::String(entity_id.to_string())]); for member in s.children.iter() { - if let Ty::Struct(_) = &member.ty { - let mut path_clone = path.clone(); - path_clone.push(member.name.clone()); - self.build_delete_entity_queries_recursive( - path_clone, entity_id, &member.ty, - ); - } + let mut path_clone = path.clone(); + path_clone.push(member.name.clone()); + self.build_delete_entity_queries_recursive(path_clone, entity_id, &member.ty); } } Ty::Enum(e) => { + if e.options + .iter() + .all(|o| if let Ty::Tuple(t) = &o.ty { t.is_empty() } else { false }) + { + return; + } + + let table_id = path.join("$"); + let statement = format!("DELETE FROM [{table_id}] WHERE entity_id = ?"); + self.query_queue + .push_front(statement, vec![Argument::String(entity_id.to_string())]); + for child in e.options.iter() { + if let Ty::Tuple(t) = &child.ty { + if t.is_empty() { + continue; + } + } + let mut path_clone = path.clone(); path_clone.push(child.name.clone()); self.build_delete_entity_queries_recursive(path_clone, entity_id, &child.ty); } } + Ty::Array(array) => { + let table_id = path.join("$"); + let statement = format!("DELETE FROM [{table_id}] WHERE entity_id = ?"); + self.query_queue + .push_front(statement, vec![Argument::String(entity_id.to_string())]); + + for member in array.iter() { + let mut path_clone = path.clone(); + path_clone.push("data".to_string()); + self.build_delete_entity_queries_recursive(path_clone, entity_id, member); + } + } + Ty::Tuple(t) => { + let table_id = path.join("$"); + let statement = format!("DELETE FROM [{table_id}] WHERE entity_id = ?"); + self.query_queue + .push_front(statement, vec![Argument::String(entity_id.to_string())]); + + for (idx, member) in t.iter().enumerate() { + let mut path_clone = path.clone(); + path_clone.push(format!("_{}", idx)); + self.build_delete_entity_queries_recursive(path_clone, entity_id, member); + } + } _ => {} } } @@ -704,8 +760,8 @@ impl Sql { model: &Ty, model_idx: i64, block_timestamp: u64, - is_array: bool, - is_parent_array: bool, + array_idx: usize, + parent_array_idx: usize, ) { let table_id = path.join("$"); let mut indices = Vec::new(); @@ -715,8 +771,14 @@ impl Sql { entity_id TEXT, event_message_id TEXT, " ); - if is_array { - create_table_query.push_str("idx INTEGER NOT NULL, "); + if array_idx > 0 { + // index columns + for i in 0..array_idx { + create_table_query.push_str(&format!("idx_{i} INTEGER NOT NULL, ", i = i)); + } + + // full array id column + create_table_query.push_str("full_array_id TEXT NOT NULL UNIQUE, "); } let mut build_member = |name: &str, ty: &Ty, options: &mut Option| { @@ -736,9 +798,12 @@ impl Sql { .join(", "); create_table_query.push_str(&format!( - "external_{name} TEXT CHECK(external_{name} IN ({all_options})) NOT NULL, ", + "external_{name} TEXT CHECK(external_{name} IN ({all_options})) ", )); + // if we're an array, we could have multiple enum options + create_table_query.push_str(if array_idx > 0 { ", " } else { "NOT NULL, " }); + indices.push(format!( "CREATE INDEX IF NOT EXISTS idx_{table_id}_{name} ON [{table_id}] \ (external_{name});" @@ -907,24 +972,26 @@ impl Sql { if path.len() > 1 { let parent_table_id = path[..path.len() - 1].join("$"); - if is_parent_array && path.len() > 2 { - create_table_query.push_str(&format!( - "FOREIGN KEY (id, idx) REFERENCES {parent_table_id} (id, idx) ON DELETE \ - CASCADE, " - )); - } else { - create_table_query.push_str(&format!( - "FOREIGN KEY (id) REFERENCES {parent_table_id} (id), ", - parent_table_id = parent_table_id - )); + create_table_query.push_str("FOREIGN KEY (id"); + for i in 0..parent_array_idx { + create_table_query.push_str(&format!(", idx_{i}", i = i)); } + create_table_query.push_str(&format!( + ") REFERENCES [{parent_table_id}] (id", + parent_table_id = parent_table_id + )); + for i in 0..parent_array_idx { + create_table_query.push_str(&format!(", idx_{i}", i = i)); + } + create_table_query.push_str(") ON DELETE CASCADE, "); }; - if is_array { - create_table_query.push_str("PRIMARY KEY (id, idx), "); - } else { - create_table_query.push_str("PRIMARY KEY (id), "); + create_table_query.push_str("PRIMARY KEY (id"); + for i in 0..array_idx { + create_table_query.push_str(&format!(", idx_{i}", i = i)); } + create_table_query.push_str("), "); + create_table_query.push_str("FOREIGN KEY (entity_id) REFERENCES entities(id), "); // create_table_query.push_str("FOREIGN KEY (event_id) REFERENCES events(id), "); create_table_query diff --git a/crates/torii/core/src/sql_test.rs b/crates/torii/core/src/sql_test.rs index 1b9d0ea9f6..92d45a68e8 100644 --- a/crates/torii/core/src/sql_test.rs +++ b/crates/torii/core/src/sql_test.rs @@ -3,12 +3,11 @@ use std::str::FromStr; use camino::Utf8PathBuf; use dojo_test_utils::compiler; use dojo_test_utils::migration::prepare_migration; -use dojo_test_utils::sequencer::{ - get_default_test_starknet_config, SequencerConfig, TestSequencer, -}; use dojo_world::contracts::world::WorldContractReader; +use dojo_world::metadata::dojo_metadata_from_workspace; use dojo_world::migration::TxnConfig; -use dojo_world::utils::TransactionWaiter; +use dojo_world::utils::{TransactionExt, TransactionWaiter}; +use katana_runner::KatanaRunner; use scarb::ops; use sozo_ops::migration::execute_strategy; use sqlx::sqlite::{SqliteConnectOptions, SqlitePoolOptions}; @@ -17,11 +16,12 @@ use starknet::core::types::{BlockId, BlockTag}; use starknet::core::utils::get_selector_from_name; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::{JsonRpcClient, Provider}; -use starknet_crypto::poseidon_hash_many; +use starknet_crypto::{poseidon_hash_many, FieldElement}; use tokio::sync::broadcast; use crate::engine::{Engine, EngineConfig, Processors}; use crate::processors::register_model::RegisterModelProcessor; +use crate::processors::store_del_record::StoreDelRecordProcessor; use crate::processors::store_set_record::StoreSetRecordProcessor; use crate::sql::Sql; @@ -39,7 +39,11 @@ where db, provider, Processors { - event: vec![Box::new(RegisterModelProcessor), Box::new(StoreSetRecordProcessor)], + event: vec![ + Box::new(RegisterModelProcessor), + Box::new(StoreSetRecordProcessor), + Box::new(StoreDelRecordProcessor), + ], ..Processors::default() }, EngineConfig::default(), @@ -63,21 +67,26 @@ async fn test_load_from_remote() { let dojo_core_path = Utf8PathBuf::from("../../dojo-core"); let config = compiler::copy_tmp_config(&source_project_dir, &dojo_core_path); + let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); + let dojo_metadata = + dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); let manifest_path = config.manifest_path(); let base_dir = manifest_path.parent().unwrap(); let target_dir = format!("{}/target/dev", base_dir); - let migration = prepare_migration(base_dir.into(), target_dir.into()).unwrap(); + let mut migration = + prepare_migration(base_dir.into(), target_dir.into(), dojo_metadata.skip_migration) + .unwrap(); + migration.resolve_variable(migration.world_address().unwrap()).unwrap(); - let sequencer = - TestSequencer::start(SequencerConfig::default(), get_default_test_starknet_config()).await; + let sequencer = KatanaRunner::new().expect("Failed to start runner."); let provider = JsonRpcClient::new(HttpTransport::new(sequencer.url())); let world = WorldContractReader::new(migration.world_address().unwrap(), &provider); - let mut account = sequencer.account(); + let mut account = sequencer.account(0); account.set_block_id(BlockId::Tag(BlockTag::Pending)); let ws = ops::read_workspace(config.manifest_path(), &config) @@ -114,7 +123,7 @@ async fn test_load_from_remote() { let _block_timestamp = 1710754478_u64; let models = sqlx::query("SELECT * FROM models").fetch_all(&pool).await.unwrap(); - assert_eq!(models.len(), 5); + assert_eq!(models.len(), 7); let (id, name, packed_size, unpacked_size): (String, String, u8, u8) = sqlx::query_as( "SELECT id, name, packed_size, unpacked_size FROM models WHERE name = 'Position'", @@ -125,7 +134,7 @@ async fn test_load_from_remote() { assert_eq!(id, format!("{:#x}", get_selector_from_name("Position").unwrap())); assert_eq!(name, "Position"); - assert_eq!(packed_size, 0); + assert_eq!(packed_size, 1); assert_eq!(unpacked_size, 2); let (id, name, packed_size, unpacked_size): (String, String, u8, u8) = sqlx::query_as( @@ -138,7 +147,7 @@ async fn test_load_from_remote() { assert_eq!(id, format!("{:#x}", get_selector_from_name("Moves").unwrap())); assert_eq!(name, "Moves"); assert_eq!(packed_size, 0); - assert_eq!(unpacked_size, 0); + assert_eq!(unpacked_size, 2); let (id, name, packed_size, unpacked_size): (String, String, u8, u8) = sqlx::query_as( "SELECT id, name, packed_size, unpacked_size FROM models WHERE name = 'PlayerConfig'", @@ -152,9 +161,7 @@ async fn test_load_from_remote() { assert_eq!(packed_size, 0); assert_eq!(unpacked_size, 0); - // print all entities - let entities = sqlx::query("SELECT * FROM entities").fetch_all(&pool).await.unwrap(); - assert_eq!(entities.len(), 1); + assert_eq!(count_table("entities", &pool).await, 2); let (id, keys): (String, String) = sqlx::query_as( format!( @@ -172,3 +179,131 @@ async fn test_load_from_remote() { db.execute().await.unwrap(); } + +#[tokio::test(flavor = "multi_thread")] +async fn test_load_from_remote_del() { + let options = + SqliteConnectOptions::from_str("sqlite::memory:").unwrap().create_if_missing(true); + let pool = SqlitePoolOptions::new().max_connections(5).connect_with(options).await.unwrap(); + sqlx::migrate!("../migrations").run(&pool).await.unwrap(); + + let source_project_dir = Utf8PathBuf::from("../../../examples/spawn-and-move/"); + let dojo_core_path = Utf8PathBuf::from("../../dojo-core"); + + let config = compiler::copy_tmp_config(&source_project_dir, &dojo_core_path); + let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); + let dojo_metadata = + dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); + + let manifest_path = config.manifest_path(); + let base_dir = manifest_path.parent().unwrap(); + let target_dir = format!("{}/target/dev", base_dir); + + let mut migration = + prepare_migration(base_dir.into(), target_dir.into(), dojo_metadata.skip_migration) + .unwrap(); + migration.resolve_variable(migration.world_address().unwrap()).unwrap(); + + let sequencer = KatanaRunner::new().expect("Failed to start runner."); + + let provider = JsonRpcClient::new(HttpTransport::new(sequencer.url())); + + let world = WorldContractReader::new(migration.world_address().unwrap(), &provider); + + let mut account = sequencer.account(0); + account.set_block_id(BlockId::Tag(BlockTag::Pending)); + + let ws = ops::read_workspace(config.manifest_path(), &config) + .unwrap_or_else(|op| panic!("Error building workspace: {op:?}")); + + let migration_output = + execute_strategy(&ws, &migration, &account, TxnConfig::init_wait()).await.unwrap(); + + let world_address = migration_output.world_address; + + assert!(migration.world_address().unwrap() == world_address); + + // spawn + account + .execute(vec![Call { + to: migration_output + .contracts + .first() + .expect("shouldn't be empty") + .as_ref() + .expect("should be deployed") + .contract_address, + selector: get_selector_from_name("spawn").unwrap(), + calldata: vec![], + }]) + .send_with_cfg(&TxnConfig::init_wait()) + .await + .unwrap(); + + tokio::time::sleep(tokio::time::Duration::from_secs(1)).await; + + // Set player config. + account + .execute(vec![Call { + to: migration_output + .contracts + .first() + .expect("shouldn't be empty") + .as_ref() + .expect("should be deployed") + .contract_address, + selector: get_selector_from_name("set_player_config").unwrap(), + // Empty ByteArray. + calldata: vec![FieldElement::ZERO, FieldElement::ZERO, FieldElement::ZERO], + }]) + .send_with_cfg(&TxnConfig::init_wait()) + .await + .unwrap(); + + tokio::time::sleep(tokio::time::Duration::from_secs(1)).await; + + account + .execute(vec![Call { + to: migration_output + .contracts + .first() + .expect("shouldn't be empty") + .as_ref() + .expect("should be deployed") + .contract_address, + selector: get_selector_from_name("reset_player_config").unwrap(), + calldata: vec![], + }]) + .send_with_cfg(&TxnConfig::init_wait()) + .await + .unwrap(); + + tokio::time::sleep(tokio::time::Duration::from_secs(1)).await; + + let mut db = Sql::new(pool.clone(), world_address).await.unwrap(); + let _ = bootstrap_engine(world, db.clone(), &provider).await; + + assert_eq!(count_table("PlayerConfig", &pool).await, 0); + assert_eq!(count_table("PlayerConfig$favorite_item", &pool).await, 0); + assert_eq!(count_table("PlayerConfig$items", &pool).await, 0); + + // TODO: check how we can have a test that is more chronological with Torii re-syncing + // to ensure we can test intermediate states. + + db.execute().await.unwrap(); +} + +/// Count the number of rows in a table. +/// +/// # Arguments +/// * `table_name` - The name of the table to count the rows of. +/// * `pool` - The database pool. +/// +/// # Returns +/// The number of rows in the table. +async fn count_table(table_name: &str, pool: &sqlx::Pool) -> i64 { + let count_query = format!("SELECT COUNT(*) FROM {}", table_name); + let count: (i64,) = sqlx::query_as(&count_query).fetch_one(pool).await.unwrap(); + + count.0 +} diff --git a/crates/torii/graphql/src/object/entity.rs b/crates/torii/graphql/src/object/entity.rs index c098f7b4d4..75013b4032 100644 --- a/crates/torii/graphql/src/object/entity.rs +++ b/crates/torii/graphql/src/object/entity.rs @@ -143,8 +143,9 @@ fn model_union_field() -> Field { &mut conn, vec![name.clone()], &entity_id, - None, + &[], &type_mapping, + false, ) .await? { @@ -169,20 +170,21 @@ pub async fn model_data_recursive_query( conn: &mut PoolConnection, path_array: Vec, entity_id: &str, - idx: Option, + indexes: &[i64], type_mapping: &TypeMapping, + is_list: bool, ) -> sqlx::Result { // For nested types, we need to remove prefix in path array let namespace = format!("{}_", path_array[0]); let table_name = &path_array.join("$").replace(&namespace, ""); let mut query = format!("SELECT * FROM {} WHERE entity_id = '{}' ", table_name, entity_id); - if let Some(idx) = idx { - query.push_str(&format!("AND idx = {}", idx)); + for (column_idx, index) in indexes.iter().enumerate() { + query.push_str(&format!("AND idx_{} = {} ", column_idx, index)); } let rows = sqlx::query(&query).fetch_all(conn.as_mut()).await?; if rows.is_empty() { - return Ok(Value::Null); + return Ok(Value::List(vec![])); } let value_mapping: Value; @@ -200,8 +202,15 @@ pub async fn model_data_recursive_query( conn, nested_path, entity_id, - if rows.len() > 1 { Some(idx as i64) } else { None }, + &if is_list { + let mut indexes = indexes.to_vec(); + indexes.push(idx as i64); + indexes + } else { + indexes.to_vec() + }, nested_mapping, + false, ) .await?; @@ -215,8 +224,15 @@ pub async fn model_data_recursive_query( nested_path, entity_id, // this might need to be changed to support 2d+ arrays - None, + &if is_list { + let mut indexes = indexes.to_vec(); + indexes.push(idx as i64); + indexes + } else { + indexes.to_vec() + }, &IndexMap::from([(Name::new("data"), *inner.clone())]), + true, ) .await? { @@ -226,10 +242,19 @@ pub async fn model_data_recursive_query( .iter() .map(|v| match v { Value::Object(map) => map.get(&Name::new("data")).unwrap().clone(), - _ => unreachable!(), + ty => unreachable!( + "Expected Value::Object for list \"data\" field, got {:?}", + ty + ), }) .collect(), - _ => unreachable!(), + Value::Object(map) => map.get(&Name::new("data")).unwrap().clone(), + ty => { + unreachable!( + "Expected Value::List or Value::Object for list, got {:?}", + ty + ); + } }; nested_value_mapping.insert(Name::new(field_name), data); @@ -239,7 +264,7 @@ pub async fn model_data_recursive_query( nested_value_mappings.push(Value::Object(nested_value_mapping)); } - if nested_value_mappings.len() > 1 { + if is_list { value_mapping = Value::List(nested_value_mappings); } else { value_mapping = nested_value_mappings.pop().unwrap(); diff --git a/crates/torii/graphql/src/object/model_data.rs b/crates/torii/graphql/src/object/model_data.rs index 2f05d6e592..4b221f9146 100644 --- a/crates/torii/graphql/src/object/model_data.rs +++ b/crates/torii/graphql/src/object/model_data.rs @@ -1,5 +1,3 @@ -use std::ops::Deref; - use async_graphql::dynamic::{Enum, Field, FieldFuture, InputObject, Object, TypeRef}; use async_graphql::Value; use chrono::{DateTime, Utc}; @@ -67,9 +65,8 @@ impl BasicObject for ModelDataObject { fn objects(&self) -> Vec { let mut objects = data_objects_recursion( - self.type_name(), - self.type_mapping(), - vec![self.type_name().to_string()], + &TypeData::Nested((TypeRef::named(self.type_name()), self.type_mapping.clone())), + &vec![self.type_name().to_string()], ); // root object requires entity_field association @@ -142,71 +139,28 @@ impl ResolvableObject for ModelDataObject { } } -// fn data_objects_recursion(type_data: &TypeData, path_array: Vec) -> Vec { -// let mut objects: Vec = vec![]; -// match type_data { -// TypeData::Nested((nested_type, nested_mapping)) => { -// let mut nested_path = path_array.clone(); -// nested_path.push(nested_type.to_string()); -// let nested_objects = nested_mapping.iter().flat_map(|(field_name, type_data)| { -// let mut nested_path = nested_path.clone(); -// nested_path.push(field_name.to_string()); -// data_objects_recursion(type_data, nested_path) -// }); - -// objects.extend(nested_objects); -// objects.push(object(&nested_type.to_string(), nested_mapping, path_array)); -// } -// TypeData::List(inner) => { -// let mut nested_path = path_array.clone(); -// nested_path.push(inner.type_ref().to_string()); -// let nested_objects = data_objects_recursion(inner, nested_path); - -// objects.extend(nested_objects); -// } -// _ => {} -// } - -// objects -// } - -fn data_objects_recursion( - type_name: &str, - type_mapping: &TypeMapping, - path_array: Vec, -) -> Vec { - let mut objects: Vec = type_mapping - .iter() - .filter_map(|(field_name, type_data)| { - if let TypeData::Nested((nested_type, nested_mapping)) = type_data { +fn data_objects_recursion(type_data: &TypeData, path_array: &Vec) -> Vec { + let mut objects: Vec = vec![]; + + match type_data { + TypeData::Nested((nested_type, nested_mapping)) => { + let nested_objects = nested_mapping.iter().flat_map(|(field_name, type_data)| { let mut nested_path = path_array.clone(); nested_path.push(field_name.to_string()); - let nested_objects = - data_objects_recursion(&nested_type.to_string(), nested_mapping, nested_path); - - Some(nested_objects) - } else if let TypeData::List(inner) = type_data { - if let TypeData::Nested((nested_type, nested_mapping)) = inner.deref() { - let mut nested_path = path_array.clone(); - nested_path.push(inner.type_ref().to_string()); - let nested_objects = data_objects_recursion( - &nested_type.to_string(), - nested_mapping, - nested_path, - ); - - return Some(nested_objects); - } + data_objects_recursion(type_data, &nested_path) + }); - None - } else { - None - } - }) - .flatten() - .collect(); + objects.extend(nested_objects); + objects.push(object(&nested_type.to_string(), nested_mapping, path_array.clone())); + } + TypeData::List(inner) => { + let nested_objects = data_objects_recursion(inner, path_array); + + objects.extend(nested_objects); + } + _ => {} + } - objects.push(object(type_name, type_mapping, path_array)); objects } diff --git a/crates/torii/graphql/src/query/mod.rs b/crates/torii/graphql/src/query/mod.rs index b2f8f8a005..b66c37b8fd 100644 --- a/crates/torii/graphql/src/query/mod.rs +++ b/crates/torii/graphql/src/query/mod.rs @@ -94,6 +94,11 @@ fn member_to_type_data(member: &ModelMember, nested_members: &[&ModelMember]) -> if !nested_members.iter().any(|&nested_member| { nested_member.model_id == member.model_id && nested_member.id.ends_with(&member.name) + && nested_member + .id + .split('$') + .collect::>() + .starts_with(&member.id.split('$').collect::>()) }) => { TypeData::Simple(TypeRef::named("Enum")) @@ -114,8 +119,9 @@ fn parse_nested_type(member: &ModelMember, nested_members: &[&ModelMember]) -> T && nested_member .id .split('$') + .take(nested_member.id.split('$').count() - 1) .collect::>() - .starts_with(&member.id.split('$').collect::>()) + .eq(&member.id.split('$').collect::>()) { // if the nested member is an Enum and the member is an Enum, we need to inject the // Enum type in order to have a "option" field in the nested Enum diff --git a/crates/torii/graphql/src/tests/mod.rs b/crates/torii/graphql/src/tests/mod.rs index 86fcf37ad3..ddfc8fa182 100644 --- a/crates/torii/graphql/src/tests/mod.rs +++ b/crates/torii/graphql/src/tests/mod.rs @@ -2,7 +2,8 @@ use std::str::FromStr; use anyhow::Result; use async_graphql::dynamic::Schema; -use dojo_test_utils::compiler::build_test_config; +use camino::Utf8PathBuf; +use dojo_test_utils::compiler::{self, build_test_config}; use dojo_test_utils::migration::prepare_migration; use dojo_test_utils::sequencer::{ get_default_test_starknet_config, SequencerConfig, TestSequencer, @@ -12,6 +13,7 @@ use dojo_types::schema::{Enum, EnumOption, Member, Struct, Ty}; use dojo_world::contracts::abi::model::Layout; use dojo_world::contracts::WorldContractReader; use dojo_world::manifest::DeploymentManifest; +use dojo_world::metadata::dojo_metadata_from_workspace; use dojo_world::migration::TxnConfig; use dojo_world::utils::TransactionWaiter; use scarb::ops; @@ -277,9 +279,19 @@ pub async fn spinup_types_test() -> Result { let pool = SqlitePoolOptions::new().max_connections(5).connect_with(options).await.unwrap(); sqlx::migrate!("../migrations").run(&pool).await.unwrap(); - let base_path = "../types-test"; - let target_path = format!("{}/target/dev", base_path); - let migration = prepare_migration(base_path.into(), target_path.into()).unwrap(); + let source_project_dir = Utf8PathBuf::from("../types-test"); + let dojo_core_path = Utf8PathBuf::from("../../dojo-core"); + + let config = compiler::copy_tmp_config(&source_project_dir, &dojo_core_path); + + let ws = ops::read_workspace(config.manifest_path(), &config) + .unwrap_or_else(|op| panic!("Error building workspace: {op:?}")); + let dojo_metadata = + dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); + + let target_path = ws.target_dir().path_existent().unwrap().join(config.profile().to_string()); + let migration = + prepare_migration(source_project_dir, target_path, dojo_metadata.skip_migration).unwrap(); let config = build_test_config("../types-test/Scarb.toml").unwrap(); let db = Sql::new(pool.clone(), migration.world_address().unwrap()).await.unwrap(); @@ -294,7 +306,7 @@ pub async fn spinup_types_test() -> Result { let ws = ops::read_workspace(config.manifest_path(), &config) .unwrap_or_else(|op| panic!("Error building workspace: {op:?}")); - execute_strategy(&ws, &migration, &account, TxnConfig::default()).await.unwrap(); + execute_strategy(&ws, &migration, &account, TxnConfig::init_wait()).await.unwrap(); let manifest = DeploymentManifest::load_from_remote(&provider, migration.world_address().unwrap()) diff --git a/crates/torii/grpc/Cargo.toml b/crates/torii/grpc/Cargo.toml index 48fd1a8c20..3673a790a2 100644 --- a/crates/torii/grpc/Cargo.toml +++ b/crates/torii/grpc/Cargo.toml @@ -31,6 +31,7 @@ tower.workspace = true tracing.workspace = true [dev-dependencies] +camino.workspace = true dojo-test-utils.workspace = true dojo-world = { path = "../../dojo-world", features = [ "contracts" ] } scarb.workspace = true diff --git a/crates/torii/grpc/src/client.rs b/crates/torii/grpc/src/client.rs index 4a11e04777..7f34a60209 100644 --- a/crates/torii/grpc/src/client.rs +++ b/crates/torii/grpc/src/client.rs @@ -3,7 +3,7 @@ use std::num::ParseIntError; use futures_util::stream::MapOk; use futures_util::{Stream, StreamExt, TryStreamExt}; -use starknet::core::types::{FromStrError, StateUpdate}; +use starknet::core::types::{FromStrError, StateDiff, StateUpdate}; use starknet_crypto::FieldElement; use crate::proto::world::{ @@ -105,9 +105,9 @@ impl WorldClient { .map_err(Error::Grpc) .map(|res| res.into_inner())?; - Ok(EntityUpdateStreaming(stream.map_ok(Box::new(|res| { - let entity = res.entity.expect("entity must exist"); - entity.try_into().expect("must able to serialize") + Ok(EntityUpdateStreaming(stream.map_ok(Box::new(|res| match res.entity { + Some(entity) => entity.try_into().expect("must able to serialize"), + None => Entity { hashed_keys: FieldElement::ZERO, models: vec![] }, })))) } @@ -144,9 +144,11 @@ impl WorldClient { .map_err(Error::Grpc) .map(|res| res.into_inner())?; - Ok(ModelDiffsStreaming(stream.map_ok(Box::new(|res| { - let update = res.model_update.expect("qed; state update must exist"); - TryInto::::try_into(update).expect("must able to serialize") + Ok(ModelDiffsStreaming(stream.map_ok(Box::new(|res| match res.model_update { + Some(update) => { + TryInto::::try_into(update).expect("must able to serialize") + } + None => empty_state_update(), })))) } } @@ -184,3 +186,19 @@ impl Stream for EntityUpdateStreaming { self.0.poll_next_unpin(cx) } } + +fn empty_state_update() -> StateUpdate { + StateUpdate { + block_hash: FieldElement::ZERO, + new_root: FieldElement::ZERO, + old_root: FieldElement::ZERO, + state_diff: StateDiff { + declared_classes: vec![], + deployed_contracts: vec![], + deprecated_declared_classes: vec![], + nonces: vec![], + replaced_classes: vec![], + storage_diffs: vec![], + }, + } +} diff --git a/crates/torii/grpc/src/server/mod.rs b/crates/torii/grpc/src/server/mod.rs index b4fec0933e..15db131a30 100644 --- a/crates/torii/grpc/src/server/mod.rs +++ b/crates/torii/grpc/src/server/mod.rs @@ -4,6 +4,7 @@ pub mod subscriptions; #[cfg(test)] mod tests; +use std::collections::HashMap; use std::future::Future; use std::net::SocketAddr; use std::pin::Pin; @@ -45,9 +46,9 @@ pub(crate) static ENTITIES_TABLE: &str = "entities"; pub(crate) static ENTITIES_MODEL_RELATION_TABLE: &str = "entity_model"; pub(crate) static ENTITIES_ENTITY_RELATION_COLUMN: &str = "entity_id"; -pub(crate) static EVENTS_MESSAGES_TABLE: &str = "events_messages"; -pub(crate) static EVENTS_MESSAGES_MODEL_RELATION_TABLE: &str = "event_model"; -pub(crate) static EVENTS_MESSAGES_ENTITY_RELATION_COLUMN: &str = "event_message_id"; +pub(crate) static EVENT_MESSAGES_TABLE: &str = "event_messages"; +pub(crate) static EVENT_MESSAGES_MODEL_RELATION_TABLE: &str = "event_model"; +pub(crate) static EVENT_MESSAGES_ENTITY_RELATION_COLUMN: &str = "event_message_id"; #[derive(Clone)] pub struct DojoWorld { @@ -132,7 +133,7 @@ impl DojoWorld { contract_address: model.3, packed_size: model.4, unpacked_size: model.5, - layout: hex::decode(&model.6).unwrap(), + layout: model.6.as_bytes().to_vec(), schema: serde_json::to_vec(&schema).unwrap(), }); } @@ -162,6 +163,22 @@ impl DojoWorld { .await } + async fn event_messages_all( + &self, + limit: u32, + offset: u32, + ) -> Result<(Vec, u32), Error> { + self.query_by_hashed_keys( + EVENT_MESSAGES_TABLE, + EVENT_MESSAGES_MODEL_RELATION_TABLE, + EVENT_MESSAGES_ENTITY_RELATION_COLUMN, + None, + limit, + offset, + ) + .await + } + async fn events_all(&self, limit: u32, offset: u32) -> Result, Error> { let query = r#" SELECT keys, data, transaction_hash @@ -235,19 +252,31 @@ impl DojoWorld { let model_ids: Vec<&str> = models_str.split(',').collect(); let schemas = self.model_cache.schemas(model_ids).await?; - let entity_query = format!( - "{} WHERE {table}.id = ?", - build_sql_query(&schemas, table, entity_relation_column)? - ); + let (entity_query, arrays_queries) = build_sql_query( + &schemas, + table, + entity_relation_column, + Some(&format!("{table}.id = ?")), + Some(&format!("{table}.id = ?")), + )?; + let row = sqlx::query(&entity_query).bind(&entity_id).fetch_one(&self.pool).await?; + let mut arrays_rows = HashMap::new(); + for (name, query) in arrays_queries { + let rows = sqlx::query(&query).bind(&entity_id).fetch_all(&self.pool).await?; + arrays_rows.insert(name, rows); + } let models = schemas - .iter() - .map(|s| { - let mut struct_ty = s.as_struct().expect("schema should be struct").to_owned(); - map_row_to_ty(&s.name(), &mut struct_ty, &row)?; - - Ok(struct_ty.try_into().unwrap()) + .into_iter() + .map(|mut s| { + map_row_to_ty("", &s.name(), &mut s, &row, &arrays_rows)?; + + Ok(s.as_struct() + .expect("schema should be struct") + .to_owned() + .try_into() + .unwrap()) }) .collect::, Error>>()?; @@ -317,21 +346,34 @@ impl DojoWorld { let schemas = self.model_cache.schemas(model_ids).await?; // query to filter with limit and offset - let entities_query = format!( - "{} WHERE {table}.keys LIKE ? ORDER BY {table}.event_id DESC LIMIT ? OFFSET ?", - build_sql_query(&schemas, table, entity_relation_column)? - ); + let (entities_query, arrays_queries) = build_sql_query( + &schemas, + table, + entity_relation_column, + Some(&format!("{table}.keys LIKE ? ORDER BY {table}.event_id DESC LIMIT ? OFFSET ?")), + Some(&format!("{table}.keys LIKE ? ORDER BY {table}.event_id DESC LIMIT ? OFFSET ?")), + )?; let db_entities = sqlx::query(&entities_query) .bind(&keys_pattern) .bind(limit) .bind(offset) .fetch_all(&self.pool) .await?; + let mut arrays_rows = HashMap::new(); + for (name, query) in arrays_queries { + let rows = sqlx::query(&query) + .bind(&keys_pattern) + .bind(limit) + .bind(offset) + .fetch_all(&self.pool) + .await?; + arrays_rows.insert(name, rows); + } Ok(( db_entities .iter() - .map(|row| Self::map_row_to_entity(row, &schemas)) + .map(|row| Self::map_row_to_entity(row, &arrays_rows, &schemas)) .collect::, Error>>()?, total_count, )) @@ -424,16 +466,26 @@ impl DojoWorld { let table_name = member_clause.model; let column_name = format!("external_{}", member_clause.member); - let member_query = format!( - "{} WHERE {table_name}.{column_name} {comparison_operator} ?", - build_sql_query(&schemas, table, entity_relation_column)? - ); + let (entity_query, arrays_queries) = build_sql_query( + &schemas, + table, + entity_relation_column, + Some(&format!("{table_name}.{column_name} {comparison_operator} ?")), + None, + )?; let db_entities = - sqlx::query(&member_query).bind(comparison_value).fetch_all(&self.pool).await?; + sqlx::query(&entity_query).bind(comparison_value.clone()).fetch_all(&self.pool).await?; + let mut arrays_rows = HashMap::new(); + for (name, query) in arrays_queries { + let rows = + sqlx::query(&query).bind(comparison_value.clone()).fetch_all(&self.pool).await?; + arrays_rows.insert(name, rows); + } + let entities_collection = db_entities .iter() - .map(|row| Self::map_row_to_entity(row, &schemas)) + .map(|row| Self::map_row_to_entity(row, &arrays_rows, &schemas)) .collect::, Error>>()?; // Since there is not limit and offset, total_count is same as number of entities let total_count = entities_collection.len() as u32; @@ -474,7 +526,7 @@ impl DojoWorld { .await?; let schema = self.model_cache.schema(&model).await?; - let layout = hex::decode(&layout).unwrap(); + let layout = layout.as_bytes().to_vec(); Ok(proto::types::ModelMetadata { name, @@ -604,7 +656,7 @@ impl DojoWorld { query: proto::types::Query, ) -> Result { let (entities, total_count) = match query.clause { - None => self.entities_all(query.limit, query.offset).await?, + None => self.event_messages_all(query.limit, query.offset).await?, Some(clause) => { let clause_type = clause.clause_type.ok_or(QueryError::MissingParam("clause_type".into()))?; @@ -616,9 +668,9 @@ impl DojoWorld { } self.query_by_hashed_keys( - EVENTS_MESSAGES_TABLE, - EVENTS_MESSAGES_MODEL_RELATION_TABLE, - EVENTS_MESSAGES_ENTITY_RELATION_COLUMN, + EVENT_MESSAGES_TABLE, + EVENT_MESSAGES_MODEL_RELATION_TABLE, + EVENT_MESSAGES_ENTITY_RELATION_COLUMN, Some(hashed_keys), query.limit, query.offset, @@ -635,9 +687,9 @@ impl DojoWorld { } self.query_by_keys( - EVENTS_MESSAGES_TABLE, - EVENTS_MESSAGES_MODEL_RELATION_TABLE, - EVENTS_MESSAGES_ENTITY_RELATION_COLUMN, + EVENT_MESSAGES_TABLE, + EVENT_MESSAGES_MODEL_RELATION_TABLE, + EVENT_MESSAGES_ENTITY_RELATION_COLUMN, keys, query.limit, query.offset, @@ -646,9 +698,9 @@ impl DojoWorld { } ClauseType::Member(member) => { self.query_by_member( - EVENTS_MESSAGES_TABLE, - EVENTS_MESSAGES_MODEL_RELATION_TABLE, - EVENTS_MESSAGES_ENTITY_RELATION_COLUMN, + EVENT_MESSAGES_TABLE, + EVENT_MESSAGES_MODEL_RELATION_TABLE, + EVENT_MESSAGES_ENTITY_RELATION_COLUMN, member, query.limit, query.offset, @@ -657,8 +709,8 @@ impl DojoWorld { } ClauseType::Composite(composite) => { self.query_by_composite( - EVENTS_MESSAGES_TABLE, - EVENTS_MESSAGES_MODEL_RELATION_TABLE, + EVENT_MESSAGES_TABLE, + EVENT_MESSAGES_MODEL_RELATION_TABLE, ENTITIES_ENTITY_RELATION_COLUMN, composite, query.limit, @@ -684,16 +736,24 @@ impl DojoWorld { Ok(RetrieveEventsResponse { events }) } - fn map_row_to_entity(row: &SqliteRow, schemas: &[Ty]) -> Result { + fn map_row_to_entity( + row: &SqliteRow, + arrays_rows: &HashMap>, + schemas: &[Ty], + ) -> Result { let hashed_keys = FieldElement::from_str(&row.get::("id")).map_err(ParseError::FromStr)?; let models = schemas .iter() .map(|schema| { - let mut struct_ty = schema.as_struct().expect("schema should be struct").to_owned(); - map_row_to_ty(&schema.name(), &mut struct_ty, row)?; - - Ok(struct_ty.try_into().unwrap()) + let mut schema = schema.to_owned(); + map_row_to_ty("", &schema.name(), &mut schema, row, arrays_rows)?; + Ok(schema + .as_struct() + .expect("schema should be struct") + .to_owned() + .try_into() + .unwrap()) }) .collect::, Error>>()?; diff --git a/crates/torii/grpc/src/server/subscriptions/entity.rs b/crates/torii/grpc/src/server/subscriptions/entity.rs index a92b88543d..f9d4ae0d96 100644 --- a/crates/torii/grpc/src/server/subscriptions/entity.rs +++ b/crates/torii/grpc/src/server/subscriptions/entity.rs @@ -20,6 +20,7 @@ use torii_core::types::Entity; use tracing::{error, trace}; use crate::proto; +use crate::proto::world::SubscribeEntityResponse; pub(crate) const LOG_TARGET: &str = "torii::grpc::server::subscriptions::entity"; @@ -43,6 +44,11 @@ impl EntityManager { let id = rand::thread_rng().gen::(); let (sender, receiver) = channel(1); + // NOTE: unlock issue with firefox/safari + // initially send empty stream message to return from + // initial subscribe call + let _ = sender.send(Ok(SubscribeEntityResponse { entity: None })).await; + self.subscribers.write().await.insert( id, EntitiesSubscriber { hashed_keys: hashed_keys.iter().cloned().collect(), sender }, @@ -102,20 +108,31 @@ impl Service { let model_ids: Vec<&str> = model_ids.split(',').collect(); let schemas = cache.schemas(model_ids).await?; - let entity_query = format!( - "{} WHERE entities.id = ?", - build_sql_query(&schemas, "entities", "entity_id")? - ); + let (entity_query, arrays_queries) = build_sql_query( + &schemas, + "entities", + "entity_id", + Some("entities.id = ?"), + Some("entities.id = ?"), + )?; + let row = sqlx::query(&entity_query).bind(hashed_keys).fetch_one(&pool).await?; + let mut arrays_rows = HashMap::new(); + for (name, query) in arrays_queries { + let row = sqlx::query(&query).bind(hashed_keys).fetch_all(&pool).await?; + arrays_rows.insert(name, row); + } let models = schemas - .iter() - .map(|s| { - let mut struct_ty = - s.as_struct().expect("schema should be struct").to_owned(); - map_row_to_ty(&s.name(), &mut struct_ty, &row)?; - - Ok(struct_ty.try_into().unwrap()) + .into_iter() + .map(|mut s| { + map_row_to_ty("", &s.name(), &mut s, &row, &arrays_rows)?; + + Ok(s.as_struct() + .expect("schema should be a struct") + .to_owned() + .try_into() + .unwrap()) }) .collect::, Error>>()?; diff --git a/crates/torii/grpc/src/server/subscriptions/event_message.rs b/crates/torii/grpc/src/server/subscriptions/event_message.rs index 76796e30de..67cf1cf172 100644 --- a/crates/torii/grpc/src/server/subscriptions/event_message.rs +++ b/crates/torii/grpc/src/server/subscriptions/event_message.rs @@ -20,6 +20,7 @@ use torii_core::types::EventMessage; use tracing::{error, trace}; use crate::proto; +use crate::proto::world::SubscribeEntityResponse; pub(crate) const LOG_TARGET: &str = "torii::grpc::server::subscriptions::event_message"; pub struct EventMessagesSubscriber { @@ -42,6 +43,11 @@ impl EventMessageManager { let id = rand::thread_rng().gen::(); let (sender, receiver) = channel(1); + // NOTE: unlock issue with firefox/safari + // initially send empty stream message to return from + // initial subscribe call + let _ = sender.send(Ok(SubscribeEntityResponse { entity: None })).await; + self.subscribers.write().await.insert( id, EventMessagesSubscriber { hashed_keys: hashed_keys.iter().cloned().collect(), sender }, @@ -101,20 +107,30 @@ impl Service { let model_ids: Vec<&str> = model_ids.split(',').collect(); let schemas = cache.schemas(model_ids).await?; - let entity_query = format!( - "{} WHERE event_messages.id = ?", - build_sql_query(&schemas, "event_messages", "event_message_id")? - ); + let (entity_query, arrays_queries) = build_sql_query( + &schemas, + "event_messages", + "event_message_id", + Some("event_messages.id = ?"), + Some("event_messages.id = ?"), + )?; + let row = sqlx::query(&entity_query).bind(hashed_keys).fetch_one(&pool).await?; + let mut arrays_rows = HashMap::new(); + for (name, query) in arrays_queries { + let rows = sqlx::query(&query).bind(hashed_keys).fetch_all(&pool).await?; + arrays_rows.insert(name, rows); + } let models = schemas - .iter() - .map(|s| { - let mut struct_ty = - s.as_struct().expect("schema should be struct").to_owned(); - map_row_to_ty(&s.name(), &mut struct_ty, &row)?; - - Ok(struct_ty.try_into().unwrap()) + .into_iter() + .map(|mut s| { + map_row_to_ty("", &s.name(), &mut s, &row, &arrays_rows)?; + Ok(s.as_struct() + .expect("schema should be a struct") + .to_owned() + .try_into() + .unwrap()) }) .collect::, Error>>()?; diff --git a/crates/torii/grpc/src/server/subscriptions/model_diff.rs b/crates/torii/grpc/src/server/subscriptions/model_diff.rs index ad257c719c..8e1f4e80cf 100644 --- a/crates/torii/grpc/src/server/subscriptions/model_diff.rs +++ b/crates/torii/grpc/src/server/subscriptions/model_diff.rs @@ -20,6 +20,7 @@ use tracing::{debug, error, trace}; use super::error::SubscriptionError; use crate::proto; +use crate::proto::world::SubscribeModelsResponse; use crate::types::KeysClause; pub(crate) const LOG_TARGET: &str = "torii::grpc::server::subscriptions::model_diff"; @@ -82,6 +83,11 @@ impl StateDiffManager { .flatten() .collect::>(); + // NOTE: unlock issue with firefox/safari + // initially send empty stream message to return from + // initial subscribe call + let _ = sender.send(Ok(SubscribeModelsResponse { model_update: None })).await; + self.subscribers .write() .await diff --git a/crates/torii/grpc/src/server/tests/entities_test.rs b/crates/torii/grpc/src/server/tests/entities_test.rs index 9c9a871280..6d5cdbe9a1 100644 --- a/crates/torii/grpc/src/server/tests/entities_test.rs +++ b/crates/torii/grpc/src/server/tests/entities_test.rs @@ -1,12 +1,14 @@ use std::str::FromStr; use std::sync::Arc; -use dojo_test_utils::compiler::build_test_config; +use camino::Utf8PathBuf; +use dojo_test_utils::compiler::{self, build_test_config}; use dojo_test_utils::migration::prepare_migration; use dojo_test_utils::sequencer::{ get_default_test_starknet_config, SequencerConfig, TestSequencer, }; use dojo_world::contracts::WorldContractReader; +use dojo_world::metadata::dojo_metadata_from_workspace; use dojo_world::migration::TxnConfig; use dojo_world::utils::TransactionWaiter; use scarb::ops; @@ -34,9 +36,25 @@ async fn test_entities_queries() { SqliteConnectOptions::from_str("sqlite::memory:").unwrap().create_if_missing(true); let pool = SqlitePoolOptions::new().max_connections(5).connect_with(options).await.unwrap(); sqlx::migrate!("../migrations").run(&pool).await.unwrap(); - let base_path = "../../../examples/spawn-and-move"; - let target_path = format!("{}/target/dev", base_path); - let migration = prepare_migration(base_path.into(), target_path.into()).unwrap(); + + let source_project_dir = Utf8PathBuf::from("../../../examples/spawn-and-move"); + let dojo_core_path = Utf8PathBuf::from("../../dojo-core"); + + let config = compiler::copy_tmp_config(&source_project_dir, &dojo_core_path); + + let ws = ops::read_workspace(config.manifest_path(), &config) + .unwrap_or_else(|op| panic!("Error building workspace: {op:?}")); + let dojo_metadata = + dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); + + let target_path = ws.target_dir().path_existent().unwrap().join(config.profile().to_string()); + + let mut migration = + prepare_migration(source_project_dir, target_path, dojo_metadata.skip_migration).unwrap(); + migration.resolve_variable(migration.world_address().unwrap()).unwrap(); + + dbg!(&migration); + let sequencer = TestSequencer::start(SequencerConfig::default(), get_default_test_starknet_config()).await; let provider = Arc::new(JsonRpcClient::new(HttpTransport::new(sequencer.url()))); diff --git a/crates/torii/grpc/src/types/schema.rs b/crates/torii/grpc/src/types/schema.rs index c1007d6e48..36c0e926b3 100644 --- a/crates/torii/grpc/src/types/schema.rs +++ b/crates/torii/grpc/src/types/schema.rs @@ -64,7 +64,7 @@ impl TryFrom for proto::types::Ty { Ty::Primitive(primitive) => { Some(proto::types::ty::TyType::Primitive(primitive.try_into()?)) } - Ty::Enum(r#enum) => Some(proto::types::ty::TyType::Enum(r#enum.into())), + Ty::Enum(r#enum) => Some(proto::types::ty::TyType::Enum(r#enum.try_into()?)), Ty::Struct(r#struct) => Some(proto::types::ty::TyType::Struct(r#struct.try_into()?)), Ty::Tuple(tuple) => Some(proto::types::ty::TyType::Tuple(proto::types::Array { children: tuple @@ -107,35 +107,50 @@ impl TryFrom for proto::types::Member { } } -impl From for EnumOption { - fn from(option: proto::types::EnumOption) -> Self { - EnumOption { name: option.name, ty: Ty::Tuple(vec![]) } +impl TryFrom for EnumOption { + type Error = SchemaError; + fn try_from(option: proto::types::EnumOption) -> Result { + Ok(EnumOption { + name: option.name, + ty: option.ty.ok_or(SchemaError::MissingExpectedData)?.try_into()?, + }) } } -impl From for proto::types::EnumOption { - fn from(option: EnumOption) -> Self { - proto::types::EnumOption { name: option.name, ty: None } +impl TryFrom for proto::types::EnumOption { + type Error = SchemaError; + fn try_from(option: EnumOption) -> Result { + Ok(proto::types::EnumOption { name: option.name, ty: Some(option.ty.try_into()?) }) } } -impl From for Enum { - fn from(r#enum: proto::types::Enum) -> Self { - Enum { +impl TryFrom for Enum { + type Error = SchemaError; + fn try_from(r#enum: proto::types::Enum) -> Result { + Ok(Enum { name: r#enum.name.clone(), option: Some(r#enum.option as u8), - options: r#enum.options.into_iter().map(Into::into).collect::>(), - } + options: r#enum + .options + .into_iter() + .map(TryInto::try_into) + .collect::, _>>()?, + }) } } -impl From for proto::types::Enum { - fn from(r#enum: Enum) -> Self { - proto::types::Enum { +impl TryFrom for proto::types::Enum { + type Error = SchemaError; + fn try_from(r#enum: Enum) -> Result { + Ok(proto::types::Enum { name: r#enum.name, option: r#enum.option.expect("option value") as u32, - options: r#enum.options.into_iter().map(Into::into).collect::>(), - } + options: r#enum + .options + .into_iter() + .map(TryInto::try_into) + .collect::, _>>()?, + }) } } @@ -280,7 +295,7 @@ impl TryFrom for Ty { Ok(Ty::Primitive(primitive.try_into()?)) } proto::types::ty::TyType::Struct(r#struct) => Ok(Ty::Struct(r#struct.try_into()?)), - proto::types::ty::TyType::Enum(r#enum) => Ok(Ty::Enum(r#enum.into())), + proto::types::ty::TyType::Enum(r#enum) => Ok(Ty::Enum(r#enum.try_into()?)), proto::types::ty::TyType::Tuple(array) => Ok(Ty::Tuple( array.children.into_iter().map(TryInto::try_into).collect::, _>>()?, )), diff --git a/crates/torii/libp2p/Cargo.toml b/crates/torii/libp2p/Cargo.toml index d95c0ff66a..08c0472988 100644 --- a/crates/torii/libp2p/Cargo.toml +++ b/crates/torii/libp2p/Cargo.toml @@ -26,6 +26,7 @@ starknet.workspace = true thiserror.workspace = true tracing-subscriber = { version = "0.3", features = [ "env-filter" ] } tracing.workspace = true +cainome.workspace = true [dev-dependencies] dojo-test-utils.workspace = true diff --git a/crates/torii/libp2p/src/server/mod.rs b/crates/torii/libp2p/src/server/mod.rs index fa88af09cd..4a78db033b 100644 --- a/crates/torii/libp2p/src/server/mod.rs +++ b/crates/torii/libp2p/src/server/mod.rs @@ -9,7 +9,7 @@ use std::{fs, io}; use chrono::Utc; use crypto_bigint::U256; use dojo_types::primitive::Primitive; -use dojo_types::schema::{Struct, Ty}; +use dojo_types::schema::Ty; use futures::StreamExt; use indexmap::IndexMap; use libp2p::core::multiaddr::Protocol; @@ -20,7 +20,6 @@ use libp2p::swarm::{NetworkBehaviour, SwarmEvent}; use libp2p::{identify, identity, noise, ping, relay, tcp, yamux, PeerId, Swarm, Transport}; use libp2p_webrtc as webrtc; use rand::thread_rng; -use serde_json::Number; use starknet::core::types::{BlockId, BlockTag, FunctionCall}; use starknet::core::utils::get_selector_from_name; use starknet::providers::Provider; @@ -443,175 +442,174 @@ fn ty_keys(ty: &Ty) -> Result, Error> { } } -pub fn parse_ty_to_object(ty: &Ty) -> Result, Error> { - match ty { - Ty::Struct(struct_ty) => { - let mut object = IndexMap::new(); - for member in &struct_ty.children { - let mut member_object = IndexMap::new(); - member_object.insert("key".to_string(), PrimitiveType::Bool(member.key)); - member_object.insert( - "type".to_string(), - PrimitiveType::String(ty_to_string_type(&member.ty)), - ); - member_object.insert("value".to_string(), parse_ty_to_primitive(&member.ty)?); - object.insert(member.name.clone(), PrimitiveType::Object(member_object)); +pub fn parse_value_to_ty(value: &PrimitiveType, ty: &mut Ty) -> Result<(), Error> { + match value { + PrimitiveType::Object(object) => match ty { + Ty::Struct(struct_) => { + for (key, value) in object { + let member = + struct_.children.iter_mut().find(|member| member.name == *key).ok_or_else( + || Error::InvalidMessageError(format!("Member {} not found", key)), + )?; + + parse_value_to_ty(value, &mut member.ty)?; + } } - Ok(object) - } - _ => Err(Error::InvalidMessageError("Expected Struct type".to_string())), - } -} + // U256 is an object with two u128 fields + // low and high + Ty::Primitive(Primitive::U256(u256)) => { + let mut low = Ty::Primitive(Primitive::U128(None)); + let mut high = Ty::Primitive(Primitive::U128(None)); -pub fn ty_to_string_type(ty: &Ty) -> String { - match ty { - Ty::Primitive(primitive) => match primitive { - Primitive::U8(_) => "u8".to_string(), - Primitive::U16(_) => "u16".to_string(), - Primitive::U32(_) => "u32".to_string(), - Primitive::USize(_) => "usize".to_string(), - Primitive::U64(_) => "u64".to_string(), - Primitive::U128(_) => "u128".to_string(), - Primitive::U256(_) => "u256".to_string(), - Primitive::Felt252(_) => "felt252".to_string(), - Primitive::ClassHash(_) => "class_hash".to_string(), - Primitive::ContractAddress(_) => "contract_address".to_string(), - Primitive::Bool(_) => "bool".to_string(), - }, - Ty::Struct(_) => "struct".to_string(), - Ty::Tuple(_) => "tuple".to_string(), - Ty::Array(_) => "array".to_string(), - Ty::ByteArray(_) => "bytearray".to_string(), - Ty::Enum(_) => "enum".to_string(), - } -} + // parse the low and high fields + parse_value_to_ty(&object["low"], &mut low)?; + parse_value_to_ty(&object["high"], &mut high)?; -pub fn parse_ty_to_primitive(ty: &Ty) -> Result { - match ty { - Ty::Primitive(primitive) => match primitive { - Primitive::U8(value) => { - Ok(PrimitiveType::Number(Number::from(value.map(|v| v as u64).unwrap_or(0u64)))) - } - Primitive::U16(value) => { - Ok(PrimitiveType::Number(Number::from(value.map(|v| v as u64).unwrap_or(0u64)))) - } - Primitive::U32(value) => { - Ok(PrimitiveType::Number(Number::from(value.map(|v| v as u64).unwrap_or(0u64)))) + let low = low.as_primitive().unwrap().as_u128().unwrap(); + let high = high.as_primitive().unwrap().as_u128().unwrap(); + + let mut bytes = [0u8; 32]; + bytes[..16].copy_from_slice(&high.to_be_bytes()); + bytes[16..].copy_from_slice(&low.to_be_bytes()); + + *u256 = Some(U256::from_be_slice(&bytes)); } - Primitive::USize(value) => { - Ok(PrimitiveType::Number(Number::from(value.map(|v| v as u64).unwrap_or(0u64)))) + // an enum is a SNIP-12 compliant object with a single key + // where the K is the variant name + // and the value is the variant value + Ty::Enum(enum_) => { + let (option_name, value) = object.first().ok_or_else(|| { + Error::InvalidMessageError("Enum variant not found".to_string()) + })?; + + enum_.options.iter_mut().for_each(|option| { + if option.name == *option_name { + parse_value_to_ty(value, &mut option.ty).unwrap(); + } + }); + + enum_.set_option(option_name).map_err(|e| { + Error::InvalidMessageError(format!("Failed to set enum option: {}", e)) + })?; } - Primitive::U64(value) => { - Ok(PrimitiveType::Number(Number::from(value.map(|v| v).unwrap_or(0u64)))) + _ => { + return Err(Error::InvalidMessageError(format!( + "Invalid object type for {}", + ty.name() + ))); } - Primitive::U128(value) => Ok(PrimitiveType::String( - value.map(|v| v.to_string()).unwrap_or_else(|| "0".to_string()), - )), - Primitive::U256(value) => Ok(PrimitiveType::String( - value.map(|v| format!("{:#x}", v)).unwrap_or_else(|| "0".to_string()), - )), - Primitive::Felt252(value) => Ok(PrimitiveType::String( - value.map(|v| format!("{:#x}", v)).unwrap_or_else(|| "0".to_string()), - )), - Primitive::ClassHash(value) => Ok(PrimitiveType::String( - value.map(|v| format!("{:#x}", v)).unwrap_or_else(|| "0".to_string()), - )), - Primitive::ContractAddress(value) => Ok(PrimitiveType::String( - value.map(|v| format!("{:#x}", v)).unwrap_or_else(|| "0".to_string()), - )), - Primitive::Bool(value) => Ok(PrimitiveType::Bool(value.unwrap_or(false))), }, - _ => Err(Error::InvalidMessageError("Expected Primitive type".to_string())), - } -} - -pub fn parse_object_to_ty( - model: &mut Struct, - object: &IndexMap, -) -> Result<(), Error> { - for (field_name, value) in object { - let field = model.children.iter_mut().find(|m| m.name == *field_name).ok_or_else(|| { - Error::InvalidMessageError(format!("Field {} not found in model", field_name)) - })?; + PrimitiveType::Array(values) => match ty { + Ty::Array(array) => { + let inner_type = array[0].clone(); + + // clear the array, which contains the inner type + array.clear(); + + // parse each value to the inner type + for value in values { + let mut ty = inner_type.clone(); + parse_value_to_ty(value, &mut ty)?; + array.push(ty); + } + } + Ty::Tuple(tuple) => { + // our array values need to match the length of the tuple + if tuple.len() != values.len() { + return Err(Error::InvalidMessageError("Tuple length mismatch".to_string())); + } - match value { - PrimitiveType::Object(object) => { - parse_object_to_ty(model, object)?; + for (i, value) in tuple.iter_mut().enumerate() { + parse_value_to_ty(&values[i], value)?; + } } - PrimitiveType::Array(_) => { - // tuples not supported yet - unimplemented!() + _ => { + return Err(Error::InvalidMessageError(format!( + "Invalid array type for {}", + ty.name() + ))); } - PrimitiveType::Number(number) => match &mut field.ty { - Ty::Primitive(primitive) => match *primitive { - Primitive::U8(ref mut u8) => { - *u8 = Some(number.as_u64().unwrap() as u8); - } - Primitive::U16(ref mut u16) => { - *u16 = Some(number.as_u64().unwrap() as u16); - } - Primitive::U32(ref mut u32) => { - *u32 = Some(number.as_u64().unwrap() as u32); - } - Primitive::USize(ref mut usize) => { - *usize = Some(number.as_u64().unwrap() as u32); - } - Primitive::U64(ref mut u64) => { - *u64 = Some(number.as_u64().unwrap()); - } - _ => { - return Err(Error::InvalidMessageError("Invalid number type".to_string())); - } - }, - Ty::Enum(enum_) => { - enum_.option = Some(number.as_u64().unwrap() as u8); + }, + PrimitiveType::Number(number) => match ty { + Ty::Primitive(primitive) => match *primitive { + Primitive::U8(ref mut u8) => { + *u8 = Some(number.as_u64().unwrap() as u8); + } + Primitive::U16(ref mut u16) => { + *u16 = Some(number.as_u64().unwrap() as u16); + } + Primitive::U32(ref mut u32) => { + *u32 = Some(number.as_u64().unwrap() as u32); + } + Primitive::USize(ref mut usize) => { + *usize = Some(number.as_u64().unwrap() as u32); + } + Primitive::U64(ref mut u64) => { + *u64 = Some(number.as_u64().unwrap()); + } + _ => { + return Err(Error::InvalidMessageError(format!( + "Invalid number type for {}", + ty.name() + ))); } - _ => return Err(Error::InvalidMessageError("Invalid number type".to_string())), }, - PrimitiveType::Bool(boolean) => { - field.ty = Ty::Primitive(Primitive::Bool(Some(*boolean))); + _ => { + return Err(Error::InvalidMessageError(format!( + "Invalid number type for {}", + ty.name() + ))); } - PrimitiveType::String(string) => match &mut field.ty { - Ty::Primitive(primitive) => match primitive { - Primitive::U8(v) => { - *v = Some(u8::from_str(string).unwrap()); - } - Primitive::U16(v) => { - *v = Some(u16::from_str(string).unwrap()); - } - Primitive::U32(v) => { - *v = Some(u32::from_str(string).unwrap()); - } - Primitive::USize(v) => { - *v = Some(u32::from_str(string).unwrap()); - } - Primitive::U64(v) => { - *v = Some(u64::from_str(string).unwrap()); - } - Primitive::U128(v) => { - *v = Some(u128::from_str(string).unwrap()); - } - Primitive::U256(v) => { - *v = Some(U256::from_be_hex(string)); - } - Primitive::Felt252(v) => { - *v = Some(FieldElement::from_str(string).unwrap()); - } - Primitive::ClassHash(v) => { - *v = Some(FieldElement::from_str(string).unwrap()); - } - Primitive::ContractAddress(v) => { - *v = Some(FieldElement::from_str(string).unwrap()); - } - Primitive::Bool(v) => { - *v = Some(bool::from_str(string).unwrap()); - } - }, + }, + PrimitiveType::Bool(boolean) => { + *ty = Ty::Primitive(Primitive::Bool(Some(*boolean))); + } + PrimitiveType::String(string) => match ty { + Ty::Primitive(primitive) => match primitive { + Primitive::U8(v) => { + *v = Some(u8::from_str(string).unwrap()); + } + Primitive::U16(v) => { + *v = Some(u16::from_str(string).unwrap()); + } + Primitive::U32(v) => { + *v = Some(u32::from_str(string).unwrap()); + } + Primitive::USize(v) => { + *v = Some(u32::from_str(string).unwrap()); + } + Primitive::U64(v) => { + *v = Some(u64::from_str(string).unwrap()); + } + Primitive::U128(v) => { + *v = Some(u128::from_str(string).unwrap()); + } + Primitive::Felt252(v) => { + *v = Some(FieldElement::from_str(string).unwrap()); + } + Primitive::ClassHash(v) => { + *v = Some(FieldElement::from_str(string).unwrap()); + } + Primitive::ContractAddress(v) => { + *v = Some(FieldElement::from_str(string).unwrap()); + } + Primitive::Bool(v) => { + *v = Some(bool::from_str(string).unwrap()); + } _ => { - return Err(Error::InvalidMessageError("Invalid string type".to_string())); + return Err(Error::InvalidMessageError("Invalid primitive type".to_string())); } }, - } + Ty::ByteArray(s) => { + *s = string.clone(); + } + _ => { + return Err(Error::InvalidMessageError(format!( + "Invalid string type for {}", + ty.name() + ))); + } + }, } Ok(()) @@ -649,18 +647,8 @@ async fn validate_message( )) })?; - let ty_struct = if let Ty::Struct(ty_struct) = &mut ty { - ty_struct - } else { - return Err(Error::InvalidMessageError("Model is not a struct".to_string())); - }; - if let Some(object) = message.get(model_name) { - if let PrimitiveType::Object(object) = object { - parse_object_to_ty(ty_struct, object)? - } else { - return Err(Error::InvalidMessageError("Model is not a struct".to_string())); - } + parse_value_to_ty(object, &mut ty)?; } else { return Err(Error::InvalidMessageError("Model is missing".to_string())); }; @@ -709,8 +697,8 @@ mod tests { use super::*; - #[tokio::test] - async fn test_read_or_create_identity() { + #[test] + fn test_read_or_create_identity() { let dir = tempdir().unwrap(); let identity_path = dir.path().join("identity"); @@ -725,8 +713,8 @@ mod tests { dir.close().unwrap(); } - #[tokio::test] - async fn test_read_or_create_certificate() { + #[test] + fn test_read_or_create_certificate() { let dir = tempdir().unwrap(); let cert_path = dir.path().join("certificate"); diff --git a/crates/torii/libp2p/src/tests.rs b/crates/torii/libp2p/src/tests.rs index 5220333683..7db5ab677b 100644 --- a/crates/torii/libp2p/src/tests.rs +++ b/crates/torii/libp2p/src/tests.rs @@ -3,30 +3,290 @@ mod test { use std::error::Error; use crate::client::RelayClient; + use crate::server::parse_value_to_ty; + use crate::typed_data::PrimitiveType; #[cfg(target_arch = "wasm32")] wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); + use crypto_bigint::U256; + use dojo_types::primitive::Primitive; + use dojo_types::schema::{Enum, EnumOption, Member, Struct, Ty}; + use serde_json::Number; + use starknet_crypto::FieldElement; #[cfg(target_arch = "wasm32")] use wasm_bindgen_test::*; + #[test] + fn test_parse_primitive_to_ty() { + // primitives + let mut ty = Ty::Primitive(Primitive::U8(None)); + let value = PrimitiveType::Number(Number::from(1u64)); + parse_value_to_ty(&value, &mut ty).unwrap(); + assert_eq!(ty, Ty::Primitive(Primitive::U8(Some(1)))); + + let mut ty = Ty::Primitive(Primitive::U16(None)); + let value = PrimitiveType::Number(Number::from(1u64)); + parse_value_to_ty(&value, &mut ty).unwrap(); + assert_eq!(ty, Ty::Primitive(Primitive::U16(Some(1)))); + + let mut ty = Ty::Primitive(Primitive::U32(None)); + let value = PrimitiveType::Number(Number::from(1u64)); + parse_value_to_ty(&value, &mut ty).unwrap(); + assert_eq!(ty, Ty::Primitive(Primitive::U32(Some(1)))); + + let mut ty = Ty::Primitive(Primitive::USize(None)); + let value = PrimitiveType::Number(Number::from(1u64)); + parse_value_to_ty(&value, &mut ty).unwrap(); + assert_eq!(ty, Ty::Primitive(Primitive::USize(Some(1)))); + + let mut ty = Ty::Primitive(Primitive::U64(None)); + let value = PrimitiveType::Number(Number::from(1u64)); + parse_value_to_ty(&value, &mut ty).unwrap(); + assert_eq!(ty, Ty::Primitive(Primitive::U64(Some(1)))); + + let mut ty = Ty::Primitive(Primitive::U128(None)); + let value = PrimitiveType::String("1".to_string()); + parse_value_to_ty(&value, &mut ty).unwrap(); + assert_eq!(ty, Ty::Primitive(Primitive::U128(Some(1)))); + + // test u256 with low high + let mut ty = Ty::Primitive(Primitive::U256(None)); + let value = PrimitiveType::Object( + vec![ + ("low".to_string(), PrimitiveType::String("1".to_string())), + ("high".to_string(), PrimitiveType::String("0".to_string())), + ] + .into_iter() + .collect(), + ); + parse_value_to_ty(&value, &mut ty).unwrap(); + assert_eq!(ty, Ty::Primitive(Primitive::U256(Some(U256::ONE)))); + + let mut ty = Ty::Primitive(Primitive::Felt252(None)); + let value = PrimitiveType::String("1".to_string()); + parse_value_to_ty(&value, &mut ty).unwrap(); + assert_eq!(ty, Ty::Primitive(Primitive::Felt252(Some(FieldElement::ONE)))); + + let mut ty = Ty::Primitive(Primitive::ClassHash(None)); + let value = PrimitiveType::String("1".to_string()); + parse_value_to_ty(&value, &mut ty).unwrap(); + assert_eq!(ty, Ty::Primitive(Primitive::ClassHash(Some(FieldElement::ONE)))); + + let mut ty = Ty::Primitive(Primitive::ContractAddress(None)); + let value = PrimitiveType::String("1".to_string()); + parse_value_to_ty(&value, &mut ty).unwrap(); + assert_eq!(ty, Ty::Primitive(Primitive::ContractAddress(Some(FieldElement::ONE)))); + + let mut ty = Ty::Primitive(Primitive::Bool(None)); + let value = PrimitiveType::Bool(true); + parse_value_to_ty(&value, &mut ty).unwrap(); + assert_eq!(ty, Ty::Primitive(Primitive::Bool(Some(true)))); + + // bytearray + let mut ty = Ty::ByteArray("".to_string()); + let value = PrimitiveType::String("mimi".to_string()); + parse_value_to_ty(&value, &mut ty).unwrap(); + assert_eq!(ty, Ty::ByteArray("mimi".to_string())); + } + + #[test] + fn test_parse_complex_to_ty() { + let mut ty = Ty::Struct(Struct { + name: "PlayerConfig".to_string(), + children: vec![ + Member { + name: "player".to_string(), + ty: Ty::Primitive(Primitive::ContractAddress(None)), + key: true, + }, + Member { name: "name".to_string(), ty: Ty::ByteArray("".to_string()), key: false }, + Member { + name: "items".to_string(), + // array of PlayerItem struct + ty: Ty::Array(vec![Ty::Struct(Struct { + name: "PlayerItem".to_string(), + children: vec![ + Member { + name: "item_id".to_string(), + ty: Ty::Primitive(Primitive::U32(None)), + key: false, + }, + Member { + name: "quantity".to_string(), + ty: Ty::Primitive(Primitive::U32(None)), + key: false, + }, + ], + })]), + key: false, + }, + // a favorite_item field with enum type Option + Member { + name: "favorite_item".to_string(), + ty: Ty::Enum(Enum { + name: "Option".to_string(), + option: None, + options: vec![ + EnumOption { name: "None".to_string(), ty: Ty::Tuple(vec![]) }, + EnumOption { + name: "Some".to_string(), + ty: Ty::Struct(Struct { + name: "PlayerItem".to_string(), + children: vec![ + Member { + name: "item_id".to_string(), + ty: Ty::Primitive(Primitive::U32(None)), + key: false, + }, + Member { + name: "quantity".to_string(), + ty: Ty::Primitive(Primitive::U32(None)), + key: false, + }, + ], + }), + }, + ], + }), + key: false, + }, + ], + }); + + let value = PrimitiveType::Object( + vec![ + ("player".to_string(), PrimitiveType::String("1".to_string())), + ("name".to_string(), PrimitiveType::String("mimi".to_string())), + ( + "items".to_string(), + PrimitiveType::Array(vec![PrimitiveType::Object( + vec![ + ("item_id".to_string(), PrimitiveType::String("1".to_string())), + ("quantity".to_string(), PrimitiveType::Number(Number::from(1u64))), + ] + .into_iter() + .collect(), + )]), + ), + ( + "favorite_item".to_string(), + PrimitiveType::Object( + vec![( + "Some".to_string(), + PrimitiveType::Object( + vec![ + ("item_id".to_string(), PrimitiveType::String("1".to_string())), + ( + "quantity".to_string(), + PrimitiveType::Number(Number::from(1u64)), + ), + ] + .into_iter() + .collect(), + ), + )] + .into_iter() + .collect(), + ), + ), + ] + .into_iter() + .collect(), + ); + + parse_value_to_ty(&value, &mut ty).unwrap(); + + assert_eq!( + ty, + Ty::Struct(Struct { + name: "PlayerConfig".to_string(), + children: vec![ + Member { + name: "player".to_string(), + ty: Ty::Primitive(Primitive::ContractAddress(Some(FieldElement::ONE))), + key: true, + }, + Member { + name: "name".to_string(), + ty: Ty::ByteArray("mimi".to_string()), + key: false, + }, + Member { + name: "items".to_string(), + ty: Ty::Array(vec![Ty::Struct(Struct { + name: "PlayerItem".to_string(), + children: vec![ + Member { + name: "item_id".to_string(), + ty: Ty::Primitive(Primitive::U32(Some(1))), + key: false, + }, + Member { + name: "quantity".to_string(), + ty: Ty::Primitive(Primitive::U32(Some(1))), + key: false, + }, + ], + })]), + key: false, + }, + Member { + name: "favorite_item".to_string(), + ty: Ty::Enum(Enum { + name: "Option".to_string(), + option: Some(1_u8), + options: vec![ + EnumOption { name: "None".to_string(), ty: Ty::Tuple(vec![]) }, + EnumOption { + name: "Some".to_string(), + ty: Ty::Struct(Struct { + name: "PlayerItem".to_string(), + children: vec![ + Member { + name: "item_id".to_string(), + ty: Ty::Primitive(Primitive::U32(Some(1))), + key: false, + }, + Member { + name: "quantity".to_string(), + ty: Ty::Primitive(Primitive::U32(Some(1))), + key: false, + }, + ], + }), + }, + ] + }), + key: false, + }, + ], + }) + ); + } + // This tests subscribing to a topic and receiving a message #[cfg(not(target_arch = "wasm32"))] #[tokio::test] async fn test_client_messaging() -> Result<(), Box> { + use std::time::Duration; + use dojo_test_utils::sequencer::{ get_default_test_starknet_config, SequencerConfig, TestSequencer, }; use dojo_types::schema::{Member, Struct, Ty}; + use dojo_world::contracts::abi::model::Layout; use indexmap::IndexMap; use sqlx::sqlite::{SqliteConnectOptions, SqlitePoolOptions}; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::JsonRpcClient; + use starknet::signers::SigningKey; use starknet_crypto::FieldElement; + use tokio::select; use tokio::time::sleep; use torii_core::sql::Sql; - use crate::server::{parse_ty_to_object, Relay}; - use crate::typed_data::{Domain, TypedData}; + use crate::server::Relay; + use crate::typed_data::{Domain, Field, SimpleField, TypedData}; use crate::types::Message; let _ = tracing_subscriber::fmt() @@ -45,7 +305,36 @@ mod test { .await; let provider = JsonRpcClient::new(HttpTransport::new(sequencer.url())); - let db = Sql::new(pool.clone(), FieldElement::from_bytes_be(&[0; 32]).unwrap()).await?; + let account = sequencer.raw_account(); + + let mut db = Sql::new(pool.clone(), FieldElement::from_bytes_be(&[0; 32]).unwrap()).await?; + + // Register the model of our Message + db.register_model( + Ty::Struct(Struct { + name: "Message".to_string(), + children: vec![ + Member { + name: "identity".to_string(), + ty: Ty::Primitive(Primitive::ContractAddress(None)), + key: true, + }, + Member { + name: "message".to_string(), + ty: Ty::ByteArray("".to_string()), + key: false, + }, + ], + }), + Layout::Fixed(vec![]), + FieldElement::ZERO, + FieldElement::ZERO, + 0, + 0, + 0, + ) + .await + .unwrap(); // Initialize the relay server let mut relay_server = Relay::new(db, provider, 9900, 9901, None, None)?; @@ -59,27 +348,57 @@ mod test { client.event_loop.lock().await.run().await; }); - let mut data = Struct { name: "Message".to_string(), children: vec![] }; - - data.children.push(Member { - name: "player".to_string(), - ty: dojo_types::schema::Ty::Primitive( - dojo_types::primitive::Primitive::ContractAddress(Some( - FieldElement::from_bytes_be(&[0; 32]).unwrap(), - )), - ), - key: true, - }); - - data.children.push(Member { - name: "message".to_string(), - ty: dojo_types::schema::Ty::Primitive(dojo_types::primitive::Primitive::U8(Some(0))), - key: false, - }); - let mut typed_data = TypedData::new( - IndexMap::new(), - "Message", + IndexMap::from_iter(vec![ + ( + "OffchainMessage".to_string(), + vec![ + Field::SimpleType(SimpleField { + name: "model".to_string(), + r#type: "shortstring".to_string(), + }), + Field::SimpleType(SimpleField { + name: "Message".to_string(), + r#type: "Model".to_string(), + }), + ], + ), + ( + "Model".to_string(), + vec![ + Field::SimpleType(SimpleField { + name: "identity".to_string(), + r#type: "ContractAddress".to_string(), + }), + Field::SimpleType(SimpleField { + name: "message".to_string(), + r#type: "string".to_string(), + }), + ], + ), + ( + "StarknetDomain".to_string(), + vec![ + Field::SimpleType(SimpleField { + name: "name".to_string(), + r#type: "shortstring".to_string(), + }), + Field::SimpleType(SimpleField { + name: "version".to_string(), + r#type: "shortstring".to_string(), + }), + Field::SimpleType(SimpleField { + name: "chainId".to_string(), + r#type: "shortstring".to_string(), + }), + Field::SimpleType(SimpleField { + name: "revision".to_string(), + r#type: "shortstring".to_string(), + }), + ], + ), + ]), + "OffchainMessage", Domain::new("Message", "1", "0x0", Some("1")), IndexMap::new(), ); @@ -91,39 +410,50 @@ mod test { typed_data.message.insert( "Message".to_string(), crate::typed_data::PrimitiveType::Object( - parse_ty_to_object(&Ty::Struct(data.clone())).unwrap(), + vec![ + ( + "identity".to_string(), + crate::typed_data::PrimitiveType::String( + account.account_address.to_string(), + ), + ), + ( + "message".to_string(), + crate::typed_data::PrimitiveType::String("mimi".to_string()), + ), + ] + .into_iter() + .collect(), ), ); - println!("object ty: {:?}", parse_ty_to_object(&Ty::Struct(data)).unwrap()); + let message_hash = typed_data.encode(account.account_address).unwrap(); + let signature = + SigningKey::from_secret_scalar(account.private_key).sign(&message_hash).unwrap(); client .command_sender .publish(Message { message: typed_data, - signature_r: FieldElement::from_bytes_be(&[0; 32]).unwrap(), - signature_s: FieldElement::from_bytes_be(&[0; 32]).unwrap(), + signature_r: signature.r, + signature_s: signature.s, }) .await?; sleep(std::time::Duration::from_secs(2)).await; - Ok(()) - // loop { - // select! { - // entity = sqlx::query("SELECT * FROM entities WHERE id = ?") - // .bind(format!("{:#x}", FieldElement::from_bytes_be(&[0; - // 32]).unwrap())).fetch_one(&pool) => { if let Ok(_) = entity { - // println!("Test OK: Received message within 5 seconds."); - // return Ok(()); - // } - // } - // _ = sleep(Duration::from_secs(5)) => { - // println!("Test Failed: Did not receive message within 5 seconds."); - // return Err("Timeout reached without receiving a message".into()); - // } - // } - // } + loop { + select! { + entity = sqlx::query("SELECT * FROM entities").fetch_one(&pool) => if entity.is_ok() { + println!("Test OK: Received message within 5 seconds."); + return Ok(()); + }, + _ = sleep(Duration::from_secs(5)) => { + println!("Test Failed: Did not receive message within 5 seconds."); + return Err("Timeout reached without receiving a message".into()); + } + } + } } #[cfg(target_arch = "wasm32")] diff --git a/crates/torii/libp2p/src/typed_data.rs b/crates/torii/libp2p/src/typed_data.rs index dc752f751b..733c7ca29d 100644 --- a/crates/torii/libp2p/src/typed_data.rs +++ b/crates/torii/libp2p/src/typed_data.rs @@ -1,11 +1,10 @@ use std::str::FromStr; +use cainome::cairo_serde::ByteArray; use indexmap::IndexMap; use serde::{Deserialize, Serialize}; use serde_json::Number; -use starknet::core::utils::{ - cairo_short_string_to_felt, get_selector_from_name, CairoShortStringToFeltError, -}; +use starknet::core::utils::{cairo_short_string_to_felt, get_selector_from_name}; use starknet_crypto::{poseidon_hash_many, FieldElement}; use crate::errors::Error; @@ -176,39 +175,6 @@ pub fn encode_type(name: &str, types: &IndexMap>) -> Result Result<(Vec, FieldElement, usize), CairoShortStringToFeltError> { - let short_strings: Vec<&str> = split_long_string(target_string); - let remainder = short_strings.last().unwrap_or(&""); - - let mut short_strings_encoded = short_strings - .iter() - .map(|&s| cairo_short_string_to_felt(s)) - .collect::, _>>()?; - - let (pending_word, pending_word_length) = if remainder.is_empty() || remainder.len() == 31 { - (FieldElement::ZERO, 0) - } else { - (short_strings_encoded.pop().unwrap(), remainder.len()) - }; - - Ok((short_strings_encoded, pending_word, pending_word_length)) -} - -fn split_long_string(long_str: &str) -> Vec<&str> { - let mut result = Vec::new(); - - let mut start = 0; - while start < long_str.len() { - let end = (start + 31).min(long_str.len()); - result.push(&long_str[start..end]); - start = end; - } - - result -} - #[derive(Debug, Default)] pub struct Ctx { pub base_type: String, @@ -273,7 +239,7 @@ fn get_hex(value: &str) -> Result { } else { // assume its a short string and encode cairo_short_string_to_felt(value) - .map_err(|_| Error::InvalidMessageError("Invalid short string".to_string())) + .map_err(|e| Error::InvalidMessageError(format!("Invalid shortstring for felt: {}", e))) } } @@ -330,8 +296,11 @@ impl PrimitiveType { let type_hash = encode_type(r#type, if ctx.is_preset { preset_types } else { types })?; - hashes.push(get_selector_from_name(&type_hash).map_err(|_| { - Error::InvalidMessageError(format!("Invalid type {} for selector", r#type)) + hashes.push(get_selector_from_name(&type_hash).map_err(|e| { + Error::InvalidMessageError(format!( + "Invalid type {} for selector: {}", + r#type, e + )) })?); for (field_name, value) in obj { @@ -368,24 +337,23 @@ impl PrimitiveType { "shortstring" => get_hex(string), "string" => { // split the string into short strings and encode - let byte_array = byte_array_from_string(string).map_err(|_| { - Error::InvalidMessageError("Invalid short string".to_string()) + let byte_array = ByteArray::from_string(string).map_err(|e| { + Error::InvalidMessageError(format!("Invalid string for bytearray: {}", e)) })?; - let mut hashes = vec![FieldElement::from(byte_array.0.len())]; + let mut hashes = vec![FieldElement::from(byte_array.data.len())]; - for hash in byte_array.0 { - hashes.push(hash); + for hash in byte_array.data { + hashes.push(hash.felt()); } - hashes.push(byte_array.1); - hashes.push(FieldElement::from(byte_array.2)); + hashes.push(byte_array.pending_word); + hashes.push(FieldElement::from(byte_array.pending_word_len)); Ok(poseidon_hash_many(hashes.as_slice())) } - "selector" => get_selector_from_name(string).map_err(|_| { - Error::InvalidMessageError(format!("Invalid type {} for selector", r#type)) - }), + "selector" => get_selector_from_name(string) + .map_err(|e| Error::InvalidMessageError(format!("Invalid selector: {}", e))), "felt" => get_hex(string), "ContractAddress" => get_hex(string), "ClassHash" => get_hex(string), diff --git a/crates/torii/server/src/proxy.rs b/crates/torii/server/src/proxy.rs index df9f4e26f5..23539b5d49 100644 --- a/crates/torii/server/src/proxy.rs +++ b/crates/torii/server/src/proxy.rs @@ -17,7 +17,7 @@ use tower::ServiceBuilder; use tower_http::cors::{AllowOrigin, CorsLayer}; use tracing::error; -const DEFAULT_ALLOW_HEADERS: [&str; 12] = [ +const DEFAULT_ALLOW_HEADERS: [&str; 11] = [ "accept", "origin", "content-type", @@ -27,7 +27,6 @@ const DEFAULT_ALLOW_HEADERS: [&str; 12] = [ "x-grpc-timeout", "x-user-agent", "connection", - "upgrade", "sec-websocket-key", "sec-websocket-version", ]; diff --git a/crates/torii/types-test/Scarb.lock b/crates/torii/types-test/Scarb.lock index 112ae6dbe9..e891786546 100644 --- a/crates/torii/types-test/Scarb.lock +++ b/crates/torii/types-test/Scarb.lock @@ -3,7 +3,7 @@ version = 1 [[package]] name = "dojo" -version = "0.6.0" +version = "0.7.2" dependencies = [ "dojo_plugin", ] @@ -15,7 +15,7 @@ source = "git+https://github.com/dojoengine/dojo?tag=v0.3.11#1e651b5d4d3b79b14a7 [[package]] name = "types_test" -version = "0.6.0" +version = "0.7.0" dependencies = [ "dojo", ] diff --git a/crates/torii/types-test/Scarb.toml b/crates/torii/types-test/Scarb.toml index 0f11558350..301b44469f 100644 --- a/crates/torii/types-test/Scarb.toml +++ b/crates/torii/types-test/Scarb.toml @@ -1,7 +1,7 @@ [package] cairo-version = "2.4.0" name = "types_test" -version = "0.6.0" +version = "0.7.2" [cairo] sierra-replace-ids = true diff --git a/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml b/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml index 5a021e2793..2555ec3eda 100644 --- a/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml +++ b/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml @@ -1,5 +1,5 @@ kind = "Class" -class_hash = "0x64728e0c0713811c751930f8d3292d683c23f107c89b0a101425d9e80adb1c0" -original_class_hash = "0x64728e0c0713811c751930f8d3292d683c23f107c89b0a101425d9e80adb1c0" +class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" +original_class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" abi = "manifests/dev/abis/base/dojo_world_world.json" name = "dojo::world::world" diff --git a/crates/torii/types-test/src/contracts.cairo b/crates/torii/types-test/src/contracts.cairo index 821e8f957a..df0ef8be39 100644 --- a/crates/torii/types-test/src/contracts.cairo +++ b/crates/torii/types-test/src/contracts.cairo @@ -1,9 +1,9 @@ use starknet::{ContractAddress, ClassHash}; -#[starknet::interface] -trait IRecords { - fn create(self: @TContractState, num_records: u8); - fn delete(self: @TContractState, record_id: u32); +#[dojo::interface] +trait IRecords { + fn create(ref world: IWorldDispatcher, num_records: u8); + fn delete(ref world: IWorldDispatcher, record_id: u32); } #[dojo::contract] @@ -33,8 +33,7 @@ mod records { #[abi(embed_v0)] impl RecordsImpl of IRecords { - fn create(self: @ContractState, num_records: u8) { - let world = self.world_dispatcher.read(); + fn create(ref world: IWorldDispatcher, num_records: u8) { let mut record_idx = 0; loop { @@ -118,7 +117,7 @@ mod records { return (); } // Implemment fn delete, input param: record_id - fn delete(self: @ContractState, record_id: u32) { + fn delete(ref world: IWorldDispatcher, record_id: u32) { let world = self.world_dispatcher.read(); let (record, record_sibling) = get!(world, record_id, (Record, RecordSibling)); let subrecord_id = record_id + 1; diff --git a/dojoup/README.md b/dojoup/README.md index 277e12a1a1..714d5d7c58 100644 --- a/dojoup/README.md +++ b/dojoup/README.md @@ -4,4 +4,10 @@ curl -L https://install.dojoengine.org | bash ``` -[Documentation](https://book.dojoengine.org/toolchain/dojoup) +For more details, you can then issue the following command: + +```sh +dojoup --help +``` + +[Documentation](https://book.dojoengine.org/getting-started#getting-started) diff --git a/dojoup/dojoup b/dojoup/dojoup index 494a288576..bf9c0d999f 100755 --- a/dojoup/dojoup +++ b/dojoup/dojoup @@ -254,7 +254,7 @@ EOF } usage() { - cat 1>&2 <&2 <<'EOF' The installer for Dojo. Update or revert to a specific Dojo version with ease. diff --git a/examples/spawn-and-move/Scarb.lock b/examples/spawn-and-move/Scarb.lock index 9525e9db0e..3fc3103280 100644 --- a/examples/spawn-and-move/Scarb.lock +++ b/examples/spawn-and-move/Scarb.lock @@ -3,14 +3,14 @@ version = 1 [[package]] name = "dojo" -version = "0.6.0" +version = "0.7.2" dependencies = [ "dojo_plugin", ] [[package]] name = "dojo_examples" -version = "0.6.0" +version = "0.7.1" dependencies = [ "dojo", ] diff --git a/examples/spawn-and-move/Scarb.toml b/examples/spawn-and-move/Scarb.toml index 87e2185eb9..a122b55aca 100644 --- a/examples/spawn-and-move/Scarb.toml +++ b/examples/spawn-and-move/Scarb.toml @@ -1,7 +1,7 @@ [package] cairo-version = "=2.6.3" name = "dojo_examples" -version = "0.6.0" +version = "0.7.2" # Use the prelude with the less imports as possible # from corelib. edition = "2023_10" @@ -15,6 +15,8 @@ dojo = { path = "../../crates/dojo-core" } [[target.dojo]] build-external-contracts = [ ] +# `dev` profile + [tool.dojo.world] description = "example world" name = "example" @@ -25,4 +27,28 @@ rpc_url = "http://localhost:5050/" # Default account for katana with seed = 0 account_address = "0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03" private_key = "0x1800000000300000180000000000030000000000003006001800006600" -world_address = "0x1c958955aedbc7b8e2f051767d3369168e88bc5074b0f39e5f8cd2539138281" +world_address = "0x07efebb0c2d4cc285d48a97a7174def3be7fdd6b7bd29cca758fa2e17e03ef30" + +# `release` profile +# +# for now configurations in `tool` are not merged recursively so to override +# `skip_migration` we need to redefine the whole `tool.dojo` table +[profile.release] + +[profile.release.tool.dojo.world] +description = "example world" +name = "example" + +[profile.release.tool.dojo.env] +rpc_url = "http://localhost:5050/" + +# Default account for katana with seed = 0 +account_address = "0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03" +private_key = "0x1800000000300000180000000000030000000000003006001800006600" +world_address = "0x07efebb0c2d4cc285d48a97a7174def3be7fdd6b7bd29cca758fa2e17e03ef30" + +[profile.release.tool.dojo] +skip_migration = [ + "dojo_examples::mock_token::mock_token", + "dojo_examples::models::mock_token", +] diff --git a/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json b/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json index 1e068262bb..4be28b68dd 100644 --- a/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json +++ b/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json @@ -182,7 +182,7 @@ "name": "spawn", "inputs": [], "outputs": [], - "state_mutability": "view" + "state_mutability": "external" }, { "type": "function", @@ -194,7 +194,7 @@ } ], "outputs": [], - "state_mutability": "view" + "state_mutability": "external" }, { "type": "function", @@ -206,6 +206,42 @@ } ], "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_player_position", + "inputs": [], + "outputs": [ + { + "type": "dojo_examples::models::Position" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "reset_player_config", + "inputs": [], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::actions::actions::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::actions::actions::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], "state_mutability": "view" } ] diff --git a/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_mock_token_mock_token.json b/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_mock_token_mock_token.json new file mode 100644 index 0000000000..f4bde33e6d --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_mock_token_mock_token.json @@ -0,0 +1,133 @@ +[ + { + "type": "impl", + "name": "DojoResourceProviderImpl", + "interface_name": "dojo::world::IDojoResourceProvider" + }, + { + "type": "interface", + "name": "dojo::world::IDojoResourceProvider", + "items": [ + { + "type": "function", + "name": "dojo_resource", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::mock_token::mock_token::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::mock_token::mock_token::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::mock_token::mock_token::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_others_others.json b/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_others_others.json new file mode 100644 index 0000000000..36d8c3ef78 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_others_others.json @@ -0,0 +1,146 @@ +[ + { + "type": "impl", + "name": "DojoResourceProviderImpl", + "interface_name": "dojo::world::IDojoResourceProvider" + }, + { + "type": "interface", + "name": "dojo::world::IDojoResourceProvider", + "items": [ + { + "type": "function", + "name": "dojo_resource", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::others::others::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::others::others::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [ + { + "name": "actions_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "actions_class", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "value", + "type": "core::integer::u8" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::others::others::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/abis/base/dojo_world_world.json b/examples/spawn-and-move/manifests/dev/abis/base/dojo_world_world.json index d800e7d191..c1a2447839 100644 --- a/examples/spawn-and-move/manifests/dev/abis/base/dojo_world_world.json +++ b/examples/spawn-and-move/manifests/dev/abis/base/dojo_world_world.json @@ -205,6 +205,10 @@ { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "init_calldata", + "type": "core::array::Span::" } ], "outputs": [ @@ -551,6 +555,10 @@ { "name": "program_output", "type": "dojo::interfaces::ProgramOutput" + }, + { + "name": "program_hash", + "type": "core::felt252" } ], "outputs": [], @@ -569,7 +577,7 @@ "items": [ { "type": "function", - "name": "set_program_hash", + "name": "set_differ_program_hash", "inputs": [ { "name": "program_hash", @@ -581,7 +589,30 @@ }, { "type": "function", - "name": "get_program_hash", + "name": "set_merger_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_differ_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_merger_program_hash", "inputs": [], "outputs": [ { @@ -827,7 +858,19 @@ }, { "type": "event", - "name": "dojo::config::component::Config::ProgramHashUpdate", + "name": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::MergerProgramHashUpdate", "kind": "struct", "members": [ { @@ -855,8 +898,13 @@ "kind": "enum", "variants": [ { - "name": "ProgramHashUpdate", - "type": "dojo::config::component::Config::ProgramHashUpdate", + "name": "DifferProgramHashUpdate", + "type": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "nested" + }, + { + "name": "MergerProgramHashUpdate", + "type": "dojo::config::component::Config::MergerProgramHashUpdate", "kind": "nested" }, { diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_message.json b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_message.json new file mode 100644 index 0000000000..ec760c99fb --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_message.json @@ -0,0 +1,371 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "messageImpl", + "interface_name": "dojo_examples::models::Imessage" + }, + { + "type": "struct", + "name": "dojo_examples::models::Message", + "members": [ + { + "name": "identity", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "channel", + "type": "core::felt252" + }, + { + "name": "message", + "type": "core::byte_array::ByteArray" + }, + { + "name": "salt", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Imessage", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::Message" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::message::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_mock_token.json b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_mock_token.json new file mode 100644 index 0000000000..b2c1c340fa --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_mock_token.json @@ -0,0 +1,363 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "mock_tokenImpl", + "interface_name": "dojo_examples::models::Imock_token" + }, + { + "type": "struct", + "name": "dojo_examples::models::MockToken", + "members": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u128" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Imock_token", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::MockToken" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::mock_token::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_others_others_contract_initialized.json b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_others_others_contract_initialized.json new file mode 100644 index 0000000000..1dbbd313d8 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_others_others_contract_initialized.json @@ -0,0 +1,367 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "contract_initializedImpl", + "interface_name": "dojo_examples::others::others::Icontract_initialized" + }, + { + "type": "struct", + "name": "dojo_examples::others::others::ContractInitialized", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "contract_class", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "value", + "type": "core::integer::u8" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::others::others::Icontract_initialized", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::others::others::ContractInitialized" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::others::others::contract_initialized::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json b/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json index 1e068262bb..4be28b68dd 100644 --- a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json @@ -182,7 +182,7 @@ "name": "spawn", "inputs": [], "outputs": [], - "state_mutability": "view" + "state_mutability": "external" }, { "type": "function", @@ -194,7 +194,7 @@ } ], "outputs": [], - "state_mutability": "view" + "state_mutability": "external" }, { "type": "function", @@ -206,6 +206,42 @@ } ], "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_player_position", + "inputs": [], + "outputs": [ + { + "type": "dojo_examples::models::Position" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "reset_player_config", + "inputs": [], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::actions::actions::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::actions::actions::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], "state_mutability": "view" } ] diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_mock_token_mock_token.json b/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_mock_token_mock_token.json new file mode 100644 index 0000000000..f4bde33e6d --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_mock_token_mock_token.json @@ -0,0 +1,133 @@ +[ + { + "type": "impl", + "name": "DojoResourceProviderImpl", + "interface_name": "dojo::world::IDojoResourceProvider" + }, + { + "type": "interface", + "name": "dojo::world::IDojoResourceProvider", + "items": [ + { + "type": "function", + "name": "dojo_resource", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::mock_token::mock_token::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::mock_token::mock_token::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::mock_token::mock_token::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_others_others.json b/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_others_others.json new file mode 100644 index 0000000000..36d8c3ef78 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_others_others.json @@ -0,0 +1,146 @@ +[ + { + "type": "impl", + "name": "DojoResourceProviderImpl", + "interface_name": "dojo::world::IDojoResourceProvider" + }, + { + "type": "interface", + "name": "dojo::world::IDojoResourceProvider", + "items": [ + { + "type": "function", + "name": "dojo_resource", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::others::others::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::others::others::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [ + { + "name": "actions_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "actions_class", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "value", + "type": "core::integer::u8" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::others::others::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/dojo_world_world.json b/examples/spawn-and-move/manifests/dev/abis/deployments/dojo_world_world.json index d800e7d191..c1a2447839 100644 --- a/examples/spawn-and-move/manifests/dev/abis/deployments/dojo_world_world.json +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/dojo_world_world.json @@ -205,6 +205,10 @@ { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "init_calldata", + "type": "core::array::Span::" } ], "outputs": [ @@ -551,6 +555,10 @@ { "name": "program_output", "type": "dojo::interfaces::ProgramOutput" + }, + { + "name": "program_hash", + "type": "core::felt252" } ], "outputs": [], @@ -569,7 +577,7 @@ "items": [ { "type": "function", - "name": "set_program_hash", + "name": "set_differ_program_hash", "inputs": [ { "name": "program_hash", @@ -581,7 +589,30 @@ }, { "type": "function", - "name": "get_program_hash", + "name": "set_merger_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_differ_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_merger_program_hash", "inputs": [], "outputs": [ { @@ -827,7 +858,19 @@ }, { "type": "event", - "name": "dojo::config::component::Config::ProgramHashUpdate", + "name": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::MergerProgramHashUpdate", "kind": "struct", "members": [ { @@ -855,8 +898,13 @@ "kind": "enum", "variants": [ { - "name": "ProgramHashUpdate", - "type": "dojo::config::component::Config::ProgramHashUpdate", + "name": "DifferProgramHashUpdate", + "type": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "nested" + }, + { + "name": "MergerProgramHashUpdate", + "type": "dojo::config::component::Config::MergerProgramHashUpdate", "kind": "nested" }, { diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_message.json b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_message.json new file mode 100644 index 0000000000..ec760c99fb --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_message.json @@ -0,0 +1,371 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "messageImpl", + "interface_name": "dojo_examples::models::Imessage" + }, + { + "type": "struct", + "name": "dojo_examples::models::Message", + "members": [ + { + "name": "identity", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "channel", + "type": "core::felt252" + }, + { + "name": "message", + "type": "core::byte_array::ByteArray" + }, + { + "name": "salt", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Imessage", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::Message" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::message::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_mock_token.json b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_mock_token.json new file mode 100644 index 0000000000..b2c1c340fa --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_mock_token.json @@ -0,0 +1,363 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "mock_tokenImpl", + "interface_name": "dojo_examples::models::Imock_token" + }, + { + "type": "struct", + "name": "dojo_examples::models::MockToken", + "members": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u128" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Imock_token", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::MockToken" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::mock_token::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_others_others_contract_initialized.json b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_others_others_contract_initialized.json new file mode 100644 index 0000000000..1dbbd313d8 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_others_others_contract_initialized.json @@ -0,0 +1,367 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "contract_initializedImpl", + "interface_name": "dojo_examples::others::others::Icontract_initialized" + }, + { + "type": "struct", + "name": "dojo_examples::others::others::ContractInitialized", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "contract_class", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "value", + "type": "core::integer::u8" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::others::others::Icontract_initialized", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::others::others::ContractInitialized" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::others::others::contract_initialized::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml index 1d97364950..b1680ae07c 100644 --- a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml @@ -1,9 +1,10 @@ kind = "DojoContract" -class_hash = "0x5b617d120767e91d40621dd939b092f48975a8fa1c5236ac68f97a4ffaf45b" -original_class_hash = "0x5b617d120767e91d40621dd939b092f48975a8fa1c5236ac68f97a4ffaf45b" +class_hash = "0x3b42f80dc8ac4628b0ed6c89af9055314c0aa2192ea0d9601f262138a1e50c3" +original_class_hash = "0x3b42f80dc8ac4628b0ed6c89af9055314c0aa2192ea0d9601f262138a1e50c3" base_class_hash = "0x0" abi = "manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json" reads = [] writes = [] computed = [] +init_calldata = [] name = "dojo_examples::actions::actions" diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_mock_token_mock_token.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_mock_token_mock_token.toml new file mode 100644 index 0000000000..572af4068e --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_mock_token_mock_token.toml @@ -0,0 +1,10 @@ +kind = "DojoContract" +class_hash = "0x5c32bc974f96f82ded691bb95bf26b2783f874fffb50fe84a331acb75ecf5b2" +original_class_hash = "0x5c32bc974f96f82ded691bb95bf26b2783f874fffb50fe84a331acb75ecf5b2" +base_class_hash = "0x0" +abi = "manifests/dev/abis/base/contracts/dojo_examples_mock_token_mock_token.json" +reads = [] +writes = [] +computed = [] +init_calldata = [] +name = "dojo_examples::mock_token::mock_token" diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_others_others.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_others_others.toml new file mode 100644 index 0000000000..0526bc5473 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_others_others.toml @@ -0,0 +1,10 @@ +kind = "DojoContract" +class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" +original_class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" +base_class_hash = "0x0" +abi = "manifests/dev/abis/base/contracts/dojo_examples_others_others.json" +reads = [] +writes = [] +computed = [] +init_calldata = [] +name = "dojo_examples::others::others" diff --git a/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml b/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml index 5a021e2793..2555ec3eda 100644 --- a/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml +++ b/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml @@ -1,5 +1,5 @@ kind = "Class" -class_hash = "0x64728e0c0713811c751930f8d3292d683c23f107c89b0a101425d9e80adb1c0" -original_class_hash = "0x64728e0c0713811c751930f8d3292d683c23f107c89b0a101425d9e80adb1c0" +class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" +original_class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" abi = "manifests/dev/abis/base/dojo_world_world.json" name = "dojo::world::world" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_actions_actions_moved.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_actions_actions_moved.toml index 1c55c2930f..8b79f5c317 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_actions_actions_moved.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_actions_actions_moved.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x5508ab47983d4842a780fe483cb9ba5d24ad4b8d0196f767cd5983398b9f4c4" -original_class_hash = "0x5508ab47983d4842a780fe483cb9ba5d24ad4b8d0196f767cd5983398b9f4c4" +class_hash = "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c" +original_class_hash = "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c" abi = "manifests/dev/abis/base/models/dojo_examples_actions_actions_moved.json" name = "dojo_examples::actions::actions::moved" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_emote_message.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_emote_message.toml deleted file mode 100644 index c408805a96..0000000000 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_emote_message.toml +++ /dev/null @@ -1,15 +0,0 @@ -kind = "DojoModel" -class_hash = "0x3c690e6a69960642e2e276299c04ee4eb57f8dabb0f59dc96b09faf39c82a9" -original_class_hash = "0x3c690e6a69960642e2e276299c04ee4eb57f8dabb0f59dc96b09faf39c82a9" -abi = "manifests/dev/abis/base/models/dojo_examples_models_emote_message.json" -name = "dojo_examples::models::emote_message" - -[[members]] -name = "identity" -type = "ContractAddress" -key = true - -[[members]] -name = "emote" -type = "Emote" -key = false diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_message.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_message.toml new file mode 100644 index 0000000000..15ad89aace --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_message.toml @@ -0,0 +1,25 @@ +kind = "DojoModel" +class_hash = "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5" +original_class_hash = "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5" +abi = "manifests/dev/abis/base/models/dojo_examples_models_message.json" +name = "dojo_examples::models::message" + +[[members]] +name = "identity" +type = "ContractAddress" +key = true + +[[members]] +name = "channel" +type = "felt252" +key = true + +[[members]] +name = "message" +type = "ByteArray" +key = false + +[[members]] +name = "salt" +type = "felt252" +key = true diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_mock_token.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_mock_token.toml new file mode 100644 index 0000000000..1bf036168c --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_mock_token.toml @@ -0,0 +1,15 @@ +kind = "DojoModel" +class_hash = "0x6a21c56878ba470ac7a51f336ca6a59781de38e1810d2d20866ab2b52138a6d" +original_class_hash = "0x6a21c56878ba470ac7a51f336ca6a59781de38e1810d2d20866ab2b52138a6d" +abi = "manifests/dev/abis/base/models/dojo_examples_models_mock_token.json" +name = "dojo_examples::models::mock_token" + +[[members]] +name = "account" +type = "ContractAddress" +key = true + +[[members]] +name = "amount" +type = "u128" +key = false diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_moves.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_moves.toml index 4b5c015a39..6241643aa4 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_moves.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_moves.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x6eeffc6c72945b6ef419d3c67ed377408437782fdc41fa7a52339cd30d6c563" -original_class_hash = "0x6eeffc6c72945b6ef419d3c67ed377408437782fdc41fa7a52339cd30d6c563" +class_hash = "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8" +original_class_hash = "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8" abi = "manifests/dev/abis/base/models/dojo_examples_models_moves.json" name = "dojo_examples::models::moves" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_player_config.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_player_config.toml index a285a51830..459eb9ebdb 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_player_config.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_player_config.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x74e835af876c9f95977537b91d60d656f6ff2a4a8b2bb8d47448f345980f612" -original_class_hash = "0x74e835af876c9f95977537b91d60d656f6ff2a4a8b2bb8d47448f345980f612" +class_hash = "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55" +original_class_hash = "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55" abi = "manifests/dev/abis/base/models/dojo_examples_models_player_config.json" name = "dojo_examples::models::player_config" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_position.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_position.toml index 88609b7a59..d29abaa4e0 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_position.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_position.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x3c3632f38ab3ba550bd3c596e2af55002d43bc76b7b660a3a57b49795307c58" -original_class_hash = "0x3c3632f38ab3ba550bd3c596e2af55002d43bc76b7b660a3a57b49795307c58" +class_hash = "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff" +original_class_hash = "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff" abi = "manifests/dev/abis/base/models/dojo_examples_models_position.json" name = "dojo_examples::models::position" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_others_others_contract_initialized.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_others_others_contract_initialized.toml new file mode 100644 index 0000000000..e4b4f0fdc3 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_others_others_contract_initialized.toml @@ -0,0 +1,20 @@ +kind = "DojoModel" +class_hash = "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c" +original_class_hash = "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c" +abi = "manifests/dev/abis/base/models/dojo_examples_others_others_contract_initialized.json" +name = "dojo_examples::others::others::contract_initialized" + +[[members]] +name = "contract_address" +type = "ContractAddress" +key = true + +[[members]] +name = "contract_class" +type = "ClassHash" +key = false + +[[members]] +name = "value" +type = "u8" +key = false diff --git a/examples/spawn-and-move/manifests/dev/manifest.json b/examples/spawn-and-move/manifests/dev/manifest.json index 727658b2bc..a1a575d4aa 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.json +++ b/examples/spawn-and-move/manifests/dev/manifest.json @@ -1,8 +1,8 @@ { "world": { "kind": "WorldContract", - "class_hash": "0x64728e0c0713811c751930f8d3292d683c23f107c89b0a101425d9e80adb1c0", - "original_class_hash": "0x64728e0c0713811c751930f8d3292d683c23f107c89b0a101425d9e80adb1c0", + "class_hash": "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9", + "original_class_hash": "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9", "abi": [ { "type": "impl", @@ -210,6 +210,10 @@ { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "init_calldata", + "type": "core::array::Span::" } ], "outputs": [ @@ -556,6 +560,10 @@ { "name": "program_output", "type": "dojo::interfaces::ProgramOutput" + }, + { + "name": "program_hash", + "type": "core::felt252" } ], "outputs": [], @@ -574,7 +582,19 @@ "items": [ { "type": "function", - "name": "set_program_hash", + "name": "set_differ_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_merger_program_hash", "inputs": [ { "name": "program_hash", @@ -586,7 +606,18 @@ }, { "type": "function", - "name": "get_program_hash", + "name": "get_differ_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_merger_program_hash", "inputs": [], "outputs": [ { @@ -832,7 +863,19 @@ }, { "type": "event", - "name": "dojo::config::component::Config::ProgramHashUpdate", + "name": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::MergerProgramHashUpdate", "kind": "struct", "members": [ { @@ -860,8 +903,13 @@ "kind": "enum", "variants": [ { - "name": "ProgramHashUpdate", - "type": "dojo::config::component::Config::ProgramHashUpdate", + "name": "DifferProgramHashUpdate", + "type": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "nested" + }, + { + "name": "MergerProgramHashUpdate", + "type": "dojo::config::component::Config::MergerProgramHashUpdate", "kind": "nested" }, { @@ -951,8 +999,8 @@ ] } ], - "address": "0x1c958955aedbc7b8e2f051767d3369168e88bc5074b0f39e5f8cd2539138281", - "transaction_hash": "0x703e38b6957635cccc0f9ddddd43356025f260de7f3593523157838e4443281", + "address": "0x7efebb0c2d4cc285d48a97a7174def3be7fdd6b7bd29cca758fa2e17e03ef30", + "transaction_hash": "0x60316eb232789f4d8352c6afdc36b76d33362d72b43bf78183b43f196779a9d", "block_number": 3, "seed": "dojo_examples", "metadata": { @@ -971,9 +1019,9 @@ "contracts": [ { "kind": "DojoContract", - "address": "0x21d87b58131a6879752e3b658d658fe3a80a42d85228ba8aec5220c4a5c364c", - "class_hash": "0x5b617d120767e91d40621dd939b092f48975a8fa1c5236ac68f97a4ffaf45b", - "original_class_hash": "0x5b617d120767e91d40621dd939b092f48975a8fa1c5236ac68f97a4ffaf45b", + "address": "0x5c70a663d6b48d8e4c6aaa9572e3735a732ac3765700d470463e670587852af", + "class_hash": "0x3b42f80dc8ac4628b0ed6c89af9055314c0aa2192ea0d9601f262138a1e50c3", + "original_class_hash": "0x3b42f80dc8ac4628b0ed6c89af9055314c0aa2192ea0d9601f262138a1e50c3", "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", "abi": [ { @@ -1159,7 +1207,7 @@ "name": "spawn", "inputs": [], "outputs": [], - "state_mutability": "view" + "state_mutability": "external" }, { "type": "function", @@ -1171,7 +1219,7 @@ } ], "outputs": [], - "state_mutability": "view" + "state_mutability": "external" }, { "type": "function", @@ -1183,6 +1231,190 @@ } ], "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_player_position", + "inputs": [], + "outputs": [ + { + "type": "dojo_examples::models::Position" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "reset_player_config", + "inputs": [], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::actions::actions::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::actions::actions::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::actions::actions::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } + ], + "reads": [], + "writes": [ + "Moves", + "Position" + ], + "computed": [], + "init_calldata": [], + "name": "dojo_examples::actions::actions" + }, + { + "kind": "DojoContract", + "address": "0x75961b2027c52948ecebfd347aa427436ea308d41997fa9b3c98380f7011d53", + "class_hash": "0x5c32bc974f96f82ded691bb95bf26b2783f874fffb50fe84a331acb75ecf5b2", + "original_class_hash": "0x5c32bc974f96f82ded691bb95bf26b2783f874fffb50fe84a331acb75ecf5b2", + "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", + "abi": [ + { + "type": "impl", + "name": "DojoResourceProviderImpl", + "interface_name": "dojo::world::IDojoResourceProvider" + }, + { + "type": "interface", + "name": "dojo::world::IDojoResourceProvider", + "items": [ + { + "type": "function", + "name": "dojo_resource", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::mock_token::mock_token::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::mock_token::mock_token::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], "state_mutability": "view" } ] @@ -1216,63 +1448,1029 @@ "kind": "struct", "members": [ { - "name": "class_hash", - "type": "core::starknet::class_hash::ClassHash", - "kind": "data" + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::mock_token::mock_token::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } + ], + "reads": [], + "writes": [], + "computed": [], + "init_calldata": [], + "name": "dojo_examples::mock_token::mock_token" + }, + { + "kind": "DojoContract", + "address": "0x3f51cd82daaf5907d2fd082ae3f45ae2ef96ab61677f46abc16e0a54d3392d1", + "class_hash": "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a", + "original_class_hash": "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a", + "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", + "abi": [ + { + "type": "impl", + "name": "DojoResourceProviderImpl", + "interface_name": "dojo::world::IDojoResourceProvider" + }, + { + "type": "interface", + "name": "dojo::world::IDojoResourceProvider", + "items": [ + { + "type": "function", + "name": "dojo_resource", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::others::others::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::others::others::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [ + { + "name": "actions_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "actions_class", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "value", + "type": "core::integer::u8" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::others::others::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } + ], + "reads": [], + "writes": [], + "computed": [], + "init_calldata": [ + "$contract_address:dojo_examples::actions::actions", + "$class_hash:dojo_examples::actions::actions", + "10" + ], + "name": "dojo_examples::others::others" + } + ], + "models": [ + { + "kind": "DojoModel", + "members": [ + { + "name": "player", + "type": "ContractAddress", + "key": true + }, + { + "name": "direction", + "type": "Direction", + "key": false + } + ], + "class_hash": "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c", + "original_class_hash": "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "movedImpl", + "interface_name": "dojo_examples::actions::actions::Imoved" + }, + { + "type": "enum", + "name": "dojo_examples::models::Direction", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Left", + "type": "()" + }, + { + "name": "Right", + "type": "()" + }, + { + "name": "Up", + "type": "()" + }, + { + "name": "Down", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::actions::actions::Moved", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "direction", + "type": "dojo_examples::models::Direction" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::actions::actions::Imoved", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::actions::actions::Moved" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::actions::actions::moved::Event", + "kind": "enum", + "variants": [] + } + ], + "name": "dojo_examples::actions::actions::moved" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "identity", + "type": "ContractAddress", + "key": true + }, + { + "name": "channel", + "type": "felt252", + "key": true + }, + { + "name": "message", + "type": "ByteArray", + "key": false + }, + { + "name": "salt", + "type": "felt252", + "key": true + } + ], + "class_hash": "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5", + "original_class_hash": "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "messageImpl", + "interface_name": "dojo_examples::models::Imessage" + }, + { + "type": "struct", + "name": "dojo_examples::models::Message", + "members": [ + { + "name": "identity", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "channel", + "type": "core::felt252" + }, + { + "name": "message", + "type": "core::byte_array::ByteArray" + }, + { + "name": "salt", + "type": "core::felt252" } ] }, { - "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", - "kind": "enum", - "variants": [ + "type": "interface", + "name": "dojo_examples::models::Imessage", + "items": [ { - "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", - "kind": "nested" + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::Message" + } + ], + "outputs": [], + "state_mutability": "view" } ] }, { "type": "event", - "name": "dojo_examples::actions::actions::Event", + "name": "dojo_examples::models::message::Event", "kind": "enum", - "variants": [ - { - "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", - "kind": "nested" - } - ] + "variants": [] } ], - "reads": [], - "writes": [ - "Moves", - "Position" - ], - "computed": [], - "name": "dojo_examples::actions::actions" - } - ], - "models": [ + "name": "dojo_examples::models::message" + }, { "kind": "DojoModel", "members": [ { - "name": "player", + "name": "account", "type": "ContractAddress", "key": true }, { - "name": "direction", - "type": "Direction", + "name": "amount", + "type": "u128", "key": false } ], - "class_hash": "0x5508ab47983d4842a780fe483cb9ba5d24ad4b8d0196f767cd5983398b9f4c4", - "original_class_hash": "0x5508ab47983d4842a780fe483cb9ba5d24ad4b8d0196f767cd5983398b9f4c4", + "class_hash": "0x6a21c56878ba470ac7a51f336ca6a59781de38e1810d2d20866ab2b52138a6d", + "original_class_hash": "0x6a21c56878ba470ac7a51f336ca6a59781de38e1810d2d20866ab2b52138a6d", "abi": [ { "type": "impl", @@ -1594,52 +2792,26 @@ }, { "type": "impl", - "name": "movedImpl", - "interface_name": "dojo_examples::actions::actions::Imoved" - }, - { - "type": "enum", - "name": "dojo_examples::models::Direction", - "variants": [ - { - "name": "None", - "type": "()" - }, - { - "name": "Left", - "type": "()" - }, - { - "name": "Right", - "type": "()" - }, - { - "name": "Up", - "type": "()" - }, - { - "name": "Down", - "type": "()" - } - ] + "name": "mock_tokenImpl", + "interface_name": "dojo_examples::models::Imock_token" }, { "type": "struct", - "name": "dojo_examples::actions::actions::Moved", + "name": "dojo_examples::models::MockToken", "members": [ { - "name": "player", + "name": "account", "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "direction", - "type": "dojo_examples::models::Direction" + "name": "amount", + "type": "core::integer::u128" } ] }, { "type": "interface", - "name": "dojo_examples::actions::actions::Imoved", + "name": "dojo_examples::models::Imock_token", "items": [ { "type": "function", @@ -1647,7 +2819,7 @@ "inputs": [ { "name": "model", - "type": "dojo_examples::actions::actions::Moved" + "type": "dojo_examples::models::MockToken" } ], "outputs": [], @@ -1657,29 +2829,34 @@ }, { "type": "event", - "name": "dojo_examples::actions::actions::moved::Event", + "name": "dojo_examples::models::mock_token::Event", "kind": "enum", "variants": [] } ], - "name": "dojo_examples::actions::actions::moved" + "name": "dojo_examples::models::mock_token" }, { "kind": "DojoModel", "members": [ { - "name": "identity", + "name": "player", "type": "ContractAddress", "key": true }, { - "name": "emote", - "type": "Emote", + "name": "remaining", + "type": "u8", + "key": false + }, + { + "name": "last_direction", + "type": "Direction", "key": false } ], - "class_hash": "0x3c690e6a69960642e2e276299c04ee4eb57f8dabb0f59dc96b09faf39c82a9", - "original_class_hash": "0x3c690e6a69960642e2e276299c04ee4eb57f8dabb0f59dc96b09faf39c82a9", + "class_hash": "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8", + "original_class_hash": "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8", "abi": [ { "type": "impl", @@ -2001,52 +3178,56 @@ }, { "type": "impl", - "name": "emote_messageImpl", - "interface_name": "dojo_examples::models::Iemote_message" + "name": "movesImpl", + "interface_name": "dojo_examples::models::Imoves" }, { "type": "enum", - "name": "dojo_examples::models::Emote", + "name": "dojo_examples::models::Direction", "variants": [ { "name": "None", "type": "()" }, { - "name": "Happy", + "name": "Left", "type": "()" }, { - "name": "Sad", + "name": "Right", "type": "()" }, { - "name": "Angry", + "name": "Up", "type": "()" }, { - "name": "Love", + "name": "Down", "type": "()" } ] }, { "type": "struct", - "name": "dojo_examples::models::EmoteMessage", + "name": "dojo_examples::models::Moves", "members": [ { - "name": "identity", + "name": "player", "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "emote", - "type": "dojo_examples::models::Emote" + "name": "remaining", + "type": "core::integer::u8" + }, + { + "name": "last_direction", + "type": "dojo_examples::models::Direction" } ] }, { "type": "interface", - "name": "dojo_examples::models::Iemote_message", + "name": "dojo_examples::models::Imoves", "items": [ { "type": "function", @@ -2054,7 +3235,7 @@ "inputs": [ { "name": "model", - "type": "dojo_examples::models::EmoteMessage" + "type": "dojo_examples::models::Moves" } ], "outputs": [], @@ -2064,12 +3245,12 @@ }, { "type": "event", - "name": "dojo_examples::models::emote_message::Event", + "name": "dojo_examples::models::moves::Event", "kind": "enum", "variants": [] } ], - "name": "dojo_examples::models::emote_message" + "name": "dojo_examples::models::moves" }, { "kind": "DojoModel", @@ -2080,18 +3261,23 @@ "key": true }, { - "name": "remaining", - "type": "u8", + "name": "name", + "type": "ByteArray", "key": false }, { - "name": "last_direction", - "type": "Direction", + "name": "items", + "type": "Array", + "key": false + }, + { + "name": "favorite_item", + "type": "Option", "key": false } ], - "class_hash": "0x6eeffc6c72945b6ef419d3c67ed377408437782fdc41fa7a52339cd30d6c563", - "original_class_hash": "0x6eeffc6c72945b6ef419d3c67ed377408437782fdc41fa7a52339cd30d6c563", + "class_hash": "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55", + "original_class_hash": "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55", "abi": [ { "type": "impl", @@ -2413,56 +3599,48 @@ }, { "type": "impl", - "name": "movesImpl", - "interface_name": "dojo_examples::models::Imoves" + "name": "player_configImpl", + "interface_name": "dojo_examples::models::Iplayer_config" }, { - "type": "enum", - "name": "dojo_examples::models::Direction", - "variants": [ - { - "name": "None", - "type": "()" - }, - { - "name": "Left", - "type": "()" - }, - { - "name": "Right", - "type": "()" - }, + "type": "struct", + "name": "dojo_examples::models::PlayerItem", + "members": [ { - "name": "Up", - "type": "()" + "name": "item_id", + "type": "core::integer::u32" }, { - "name": "Down", - "type": "()" + "name": "quantity", + "type": "core::integer::u32" } ] }, { "type": "struct", - "name": "dojo_examples::models::Moves", + "name": "dojo_examples::models::PlayerConfig", "members": [ { "name": "player", "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "remaining", - "type": "core::integer::u8" + "name": "name", + "type": "core::byte_array::ByteArray" }, { - "name": "last_direction", - "type": "dojo_examples::models::Direction" + "name": "items", + "type": "core::array::Array::" + }, + { + "name": "favorite_item", + "type": "core::option::Option::" } ] }, { "type": "interface", - "name": "dojo_examples::models::Imoves", + "name": "dojo_examples::models::Iplayer_config", "items": [ { "type": "function", @@ -2470,7 +3648,7 @@ "inputs": [ { "name": "model", - "type": "dojo_examples::models::Moves" + "type": "dojo_examples::models::PlayerConfig" } ], "outputs": [], @@ -2480,12 +3658,12 @@ }, { "type": "event", - "name": "dojo_examples::models::moves::Event", + "name": "dojo_examples::models::player_config::Event", "kind": "enum", "variants": [] } ], - "name": "dojo_examples::models::moves" + "name": "dojo_examples::models::player_config" }, { "kind": "DojoModel", @@ -2496,23 +3674,13 @@ "key": true }, { - "name": "name", - "type": "ByteArray", - "key": false - }, - { - "name": "items", - "type": "Array", - "key": false - }, - { - "name": "favorite_item", - "type": "Option", + "name": "vec", + "type": "Vec2", "key": false } ], - "class_hash": "0x74e835af876c9f95977537b91d60d656f6ff2a4a8b2bb8d47448f345980f612", - "original_class_hash": "0x74e835af876c9f95977537b91d60d656f6ff2a4a8b2bb8d47448f345980f612", + "class_hash": "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff", + "original_class_hash": "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff", "abi": [ { "type": "impl", @@ -2834,48 +4002,40 @@ }, { "type": "impl", - "name": "player_configImpl", - "interface_name": "dojo_examples::models::Iplayer_config" + "name": "positionImpl", + "interface_name": "dojo_examples::models::Iposition" }, { "type": "struct", - "name": "dojo_examples::models::PlayerItem", + "name": "dojo_examples::models::Vec2", "members": [ { - "name": "item_id", + "name": "x", "type": "core::integer::u32" }, { - "name": "quantity", + "name": "y", "type": "core::integer::u32" } ] }, { "type": "struct", - "name": "dojo_examples::models::PlayerConfig", + "name": "dojo_examples::models::Position", "members": [ { "name": "player", "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "name", - "type": "core::byte_array::ByteArray" - }, - { - "name": "items", - "type": "core::array::Array::" - }, - { - "name": "favorite_item", - "type": "core::option::Option::" + "name": "vec", + "type": "dojo_examples::models::Vec2" } ] }, { "type": "interface", - "name": "dojo_examples::models::Iplayer_config", + "name": "dojo_examples::models::Iposition", "items": [ { "type": "function", @@ -2883,7 +4043,7 @@ "inputs": [ { "name": "model", - "type": "dojo_examples::models::PlayerConfig" + "type": "dojo_examples::models::Position" } ], "outputs": [], @@ -2893,29 +4053,34 @@ }, { "type": "event", - "name": "dojo_examples::models::player_config::Event", + "name": "dojo_examples::models::position::Event", "kind": "enum", "variants": [] } ], - "name": "dojo_examples::models::player_config" + "name": "dojo_examples::models::position" }, { "kind": "DojoModel", "members": [ { - "name": "player", + "name": "contract_address", "type": "ContractAddress", "key": true }, { - "name": "vec", - "type": "Vec2", + "name": "contract_class", + "type": "ClassHash", + "key": false + }, + { + "name": "value", + "type": "u8", "key": false } ], - "class_hash": "0x3c3632f38ab3ba550bd3c596e2af55002d43bc76b7b660a3a57b49795307c58", - "original_class_hash": "0x3c3632f38ab3ba550bd3c596e2af55002d43bc76b7b660a3a57b49795307c58", + "class_hash": "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c", + "original_class_hash": "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c", "abi": [ { "type": "impl", @@ -3237,40 +4402,30 @@ }, { "type": "impl", - "name": "positionImpl", - "interface_name": "dojo_examples::models::Iposition" + "name": "contract_initializedImpl", + "interface_name": "dojo_examples::others::others::Icontract_initialized" }, { "type": "struct", - "name": "dojo_examples::models::Vec2", + "name": "dojo_examples::others::others::ContractInitialized", "members": [ { - "name": "x", - "type": "core::integer::u32" + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "y", - "type": "core::integer::u32" - } - ] - }, - { - "type": "struct", - "name": "dojo_examples::models::Position", - "members": [ - { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" + "name": "contract_class", + "type": "core::starknet::class_hash::ClassHash" }, { - "name": "vec", - "type": "dojo_examples::models::Vec2" + "name": "value", + "type": "core::integer::u8" } ] }, { "type": "interface", - "name": "dojo_examples::models::Iposition", + "name": "dojo_examples::others::others::Icontract_initialized", "items": [ { "type": "function", @@ -3278,7 +4433,7 @@ "inputs": [ { "name": "model", - "type": "dojo_examples::models::Position" + "type": "dojo_examples::others::others::ContractInitialized" } ], "outputs": [], @@ -3288,12 +4443,12 @@ }, { "type": "event", - "name": "dojo_examples::models::position::Event", + "name": "dojo_examples::others::others::contract_initialized::Event", "kind": "enum", "variants": [] } ], - "name": "dojo_examples::models::position" + "name": "dojo_examples::others::others::contract_initialized" } ] } \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/manifest.toml b/examples/spawn-and-move/manifests/dev/manifest.toml index e3324ca12e..c292ce25af 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.toml +++ b/examples/spawn-and-move/manifests/dev/manifest.toml @@ -1,10 +1,10 @@ [world] kind = "WorldContract" -class_hash = "0x64728e0c0713811c751930f8d3292d683c23f107c89b0a101425d9e80adb1c0" -original_class_hash = "0x64728e0c0713811c751930f8d3292d683c23f107c89b0a101425d9e80adb1c0" +class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" +original_class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" abi = "manifests/dev/abis/deployments/dojo_world_world.json" -address = "0x1c958955aedbc7b8e2f051767d3369168e88bc5074b0f39e5f8cd2539138281" -transaction_hash = "0x703e38b6957635cccc0f9ddddd43356025f260de7f3593523157838e4443281" +address = "0x7efebb0c2d4cc285d48a97a7174def3be7fdd6b7bd29cca758fa2e17e03ef30" +transaction_hash = "0x60316eb232789f4d8352c6afdc36b76d33362d72b43bf78183b43f196779a9d" block_number = 3 seed = "dojo_examples" name = "dojo::world::world" @@ -21,9 +21,9 @@ name = "dojo::base::base" [[contracts]] kind = "DojoContract" -address = "0x21d87b58131a6879752e3b658d658fe3a80a42d85228ba8aec5220c4a5c364c" -class_hash = "0x5b617d120767e91d40621dd939b092f48975a8fa1c5236ac68f97a4ffaf45b" -original_class_hash = "0x5b617d120767e91d40621dd939b092f48975a8fa1c5236ac68f97a4ffaf45b" +address = "0x5c70a663d6b48d8e4c6aaa9572e3735a732ac3765700d470463e670587852af" +class_hash = "0x3b42f80dc8ac4628b0ed6c89af9055314c0aa2192ea0d9601f262138a1e50c3" +original_class_hash = "0x3b42f80dc8ac4628b0ed6c89af9055314c0aa2192ea0d9601f262138a1e50c3" base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" abi = "manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json" reads = [] @@ -32,12 +32,43 @@ writes = [ "Position", ] computed = [] +init_calldata = [] name = "dojo_examples::actions::actions" +[[contracts]] +kind = "DojoContract" +address = "0x75961b2027c52948ecebfd347aa427436ea308d41997fa9b3c98380f7011d53" +class_hash = "0x5c32bc974f96f82ded691bb95bf26b2783f874fffb50fe84a331acb75ecf5b2" +original_class_hash = "0x5c32bc974f96f82ded691bb95bf26b2783f874fffb50fe84a331acb75ecf5b2" +base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" +abi = "manifests/dev/abis/deployments/contracts/dojo_examples_mock_token_mock_token.json" +reads = [] +writes = [] +computed = [] +init_calldata = [] +name = "dojo_examples::mock_token::mock_token" + +[[contracts]] +kind = "DojoContract" +address = "0x3f51cd82daaf5907d2fd082ae3f45ae2ef96ab61677f46abc16e0a54d3392d1" +class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" +original_class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" +base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" +abi = "manifests/dev/abis/deployments/contracts/dojo_examples_others_others.json" +reads = [] +writes = [] +computed = [] +init_calldata = [ + "$contract_address:dojo_examples::actions::actions", + "$class_hash:dojo_examples::actions::actions", + "10", +] +name = "dojo_examples::others::others" + [[models]] kind = "DojoModel" -class_hash = "0x5508ab47983d4842a780fe483cb9ba5d24ad4b8d0196f767cd5983398b9f4c4" -original_class_hash = "0x5508ab47983d4842a780fe483cb9ba5d24ad4b8d0196f767cd5983398b9f4c4" +class_hash = "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c" +original_class_hash = "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c" abi = "manifests/dev/abis/deployments/models/dojo_examples_actions_actions_moved.json" name = "dojo_examples::actions::actions::moved" @@ -53,10 +84,10 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x3c690e6a69960642e2e276299c04ee4eb57f8dabb0f59dc96b09faf39c82a9" -original_class_hash = "0x3c690e6a69960642e2e276299c04ee4eb57f8dabb0f59dc96b09faf39c82a9" -abi = "manifests/dev/abis/deployments/models/dojo_examples_models_emote_message.json" -name = "dojo_examples::models::emote_message" +class_hash = "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5" +original_class_hash = "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5" +abi = "manifests/dev/abis/deployments/models/dojo_examples_models_message.json" +name = "dojo_examples::models::message" [[models.members]] name = "identity" @@ -64,14 +95,41 @@ type = "ContractAddress" key = true [[models.members]] -name = "emote" -type = "Emote" +name = "channel" +type = "felt252" +key = true + +[[models.members]] +name = "message" +type = "ByteArray" +key = false + +[[models.members]] +name = "salt" +type = "felt252" +key = true + +[[models]] +kind = "DojoModel" +class_hash = "0x6a21c56878ba470ac7a51f336ca6a59781de38e1810d2d20866ab2b52138a6d" +original_class_hash = "0x6a21c56878ba470ac7a51f336ca6a59781de38e1810d2d20866ab2b52138a6d" +abi = "manifests/dev/abis/deployments/models/dojo_examples_models_mock_token.json" +name = "dojo_examples::models::mock_token" + +[[models.members]] +name = "account" +type = "ContractAddress" +key = true + +[[models.members]] +name = "amount" +type = "u128" key = false [[models]] kind = "DojoModel" -class_hash = "0x6eeffc6c72945b6ef419d3c67ed377408437782fdc41fa7a52339cd30d6c563" -original_class_hash = "0x6eeffc6c72945b6ef419d3c67ed377408437782fdc41fa7a52339cd30d6c563" +class_hash = "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8" +original_class_hash = "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8" abi = "manifests/dev/abis/deployments/models/dojo_examples_models_moves.json" name = "dojo_examples::models::moves" @@ -92,8 +150,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x74e835af876c9f95977537b91d60d656f6ff2a4a8b2bb8d47448f345980f612" -original_class_hash = "0x74e835af876c9f95977537b91d60d656f6ff2a4a8b2bb8d47448f345980f612" +class_hash = "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55" +original_class_hash = "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55" abi = "manifests/dev/abis/deployments/models/dojo_examples_models_player_config.json" name = "dojo_examples::models::player_config" @@ -119,8 +177,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x3c3632f38ab3ba550bd3c596e2af55002d43bc76b7b660a3a57b49795307c58" -original_class_hash = "0x3c3632f38ab3ba550bd3c596e2af55002d43bc76b7b660a3a57b49795307c58" +class_hash = "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff" +original_class_hash = "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff" abi = "manifests/dev/abis/deployments/models/dojo_examples_models_position.json" name = "dojo_examples::models::position" @@ -133,3 +191,25 @@ key = true name = "vec" type = "Vec2" key = false + +[[models]] +kind = "DojoModel" +class_hash = "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c" +original_class_hash = "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c" +abi = "manifests/dev/abis/deployments/models/dojo_examples_others_others_contract_initialized.json" +name = "dojo_examples::others::others::contract_initialized" + +[[models.members]] +name = "contract_address" +type = "ContractAddress" +key = true + +[[models.members]] +name = "contract_class" +type = "ClassHash" +key = false + +[[models.members]] +name = "value" +type = "u8" +key = false diff --git a/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_actions_actions.toml b/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_actions_actions.toml index b18cfcaedb..b21fc1adec 100644 --- a/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_actions_actions.toml +++ b/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_actions_actions.toml @@ -1,4 +1,4 @@ -computed = [ ] name = "dojo_examples::actions::actions" -reads = [ ] -writes = [ "Moves", "Position" ] +reads = [] +writes = ["Moves", "Position"] +init_calldata = [] diff --git a/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_others_others.toml b/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_others_others.toml new file mode 100644 index 0000000000..129f942bd8 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_others_others.toml @@ -0,0 +1,4 @@ +name = "dojo_examples::others::others" +reads = [] +writes = [] +init_calldata = ["$contract_address:dojo_examples::actions::actions", "$class_hash:dojo_examples::actions::actions", "10"] diff --git a/examples/spawn-and-move/manifests/dev/overlays/dojo_base_base.toml b/examples/spawn-and-move/manifests/dev/overlays/dojo_base_base.toml new file mode 100644 index 0000000000..f706470d45 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/overlays/dojo_base_base.toml @@ -0,0 +1 @@ +name = "dojo::base::base" diff --git a/examples/spawn-and-move/manifests/dev/overlays/dojo_world_world.toml b/examples/spawn-and-move/manifests/dev/overlays/dojo_world_world.toml new file mode 100644 index 0000000000..a3e686e3ef --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/overlays/dojo_world_world.toml @@ -0,0 +1 @@ +name = "dojo::world::world" diff --git a/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_actions_actions_moved.toml b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_actions_actions_moved.toml new file mode 100644 index 0000000000..4958a7a15c --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_actions_actions_moved.toml @@ -0,0 +1 @@ +name = "dojo_examples::actions::actions::moved" diff --git a/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_emote_message.toml b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_emote_message.toml new file mode 100644 index 0000000000..d60162cc72 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_emote_message.toml @@ -0,0 +1 @@ +name = "dojo_examples::models::emote_message" diff --git a/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_moves.toml b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_moves.toml new file mode 100644 index 0000000000..dc8784e746 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_moves.toml @@ -0,0 +1 @@ +name = "dojo_examples::models::moves" diff --git a/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_player_config.toml b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_player_config.toml new file mode 100644 index 0000000000..6af8240b36 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_player_config.toml @@ -0,0 +1 @@ +name = "dojo_examples::models::player_config" diff --git a/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_position.toml b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_position.toml new file mode 100644 index 0000000000..df38e71c32 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_position.toml @@ -0,0 +1 @@ +name = "dojo_examples::models::position" diff --git a/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_others_others_contract_initialized.toml b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_others_others_contract_initialized.toml new file mode 100644 index 0000000000..f8f3053fe5 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_others_others_contract_initialized.toml @@ -0,0 +1 @@ +name = "dojo_examples::others::others::contract_initialized" diff --git a/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_actions_actions.json b/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_actions_actions.json new file mode 100644 index 0000000000..21aed968a7 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_actions_actions.json @@ -0,0 +1,290 @@ +[ + { + "type": "impl", + "name": "DojoResourceProviderImpl", + "interface_name": "dojo::world::IDojoResourceProvider" + }, + { + "type": "interface", + "name": "dojo::world::IDojoResourceProvider", + "items": [ + { + "type": "function", + "name": "dojo_resource", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "ActionsComputedImpl", + "interface_name": "dojo_examples::actions::IActionsComputed" + }, + { + "type": "struct", + "name": "dojo_examples::models::Vec2", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::models::Position", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "vec", + "type": "dojo_examples::models::Vec2" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::actions::IActionsComputed", + "items": [ + { + "type": "function", + "name": "tile_terrain", + "inputs": [ + { + "name": "vec", + "type": "dojo_examples::models::Vec2" + } + ], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "quadrant", + "inputs": [ + { + "name": "pos", + "type": "dojo_examples::models::Position" + } + ], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "ActionsImpl", + "interface_name": "dojo_examples::actions::IActions" + }, + { + "type": "enum", + "name": "dojo_examples::models::Direction", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Left", + "type": "()" + }, + { + "name": "Right", + "type": "()" + }, + { + "name": "Up", + "type": "()" + }, + { + "name": "Down", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::actions::IActions", + "items": [ + { + "type": "function", + "name": "spawn", + "inputs": [], + "outputs": [], + "state_mutability": "view" + }, + { + "type": "function", + "name": "move", + "inputs": [ + { + "name": "direction", + "type": "dojo_examples::models::Direction" + } + ], + "outputs": [], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_player_config", + "inputs": [ + { + "name": "name", + "type": "core::byte_array::ByteArray" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::actions::actions::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::actions::actions::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::actions::actions::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_mock_token_mock_token.json b/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_mock_token_mock_token.json new file mode 100644 index 0000000000..f4bde33e6d --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_mock_token_mock_token.json @@ -0,0 +1,133 @@ +[ + { + "type": "impl", + "name": "DojoResourceProviderImpl", + "interface_name": "dojo::world::IDojoResourceProvider" + }, + { + "type": "interface", + "name": "dojo::world::IDojoResourceProvider", + "items": [ + { + "type": "function", + "name": "dojo_resource", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::mock_token::mock_token::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::mock_token::mock_token::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::mock_token::mock_token::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_others_others.json b/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_others_others.json new file mode 100644 index 0000000000..36d8c3ef78 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_others_others.json @@ -0,0 +1,146 @@ +[ + { + "type": "impl", + "name": "DojoResourceProviderImpl", + "interface_name": "dojo::world::IDojoResourceProvider" + }, + { + "type": "interface", + "name": "dojo::world::IDojoResourceProvider", + "items": [ + { + "type": "function", + "name": "dojo_resource", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::others::others::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::others::others::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [ + { + "name": "actions_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "actions_class", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "value", + "type": "core::integer::u8" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::others::others::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/base/dojo_world_world.json b/examples/spawn-and-move/manifests/release/abis/base/dojo_world_world.json new file mode 100644 index 0000000000..c1a2447839 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/base/dojo_world_world.json @@ -0,0 +1,996 @@ +[ + { + "type": "impl", + "name": "World", + "interface_name": "dojo::world::IWorld" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo::resource_metadata::ResourceMetadata", + "members": [ + { + "name": "resource_id", + "type": "core::felt252" + }, + { + "name": "metadata_uri", + "type": "core::byte_array::ByteArray" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorld", + "items": [ + { + "type": "function", + "name": "metadata", + "inputs": [ + { + "name": "resource_id", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "dojo::resource_metadata::ResourceMetadata" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_metadata", + "inputs": [ + { + "name": "metadata", + "type": "dojo::resource_metadata::ResourceMetadata" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "model", + "inputs": [ + { + "name": "selector", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "register_model", + "inputs": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "deploy_contract", + "inputs": [ + { + "name": "salt", + "type": "core::felt252" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "init_calldata", + "type": "core::array::Span::" + } + ], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "upgrade_contract", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [ + { + "type": "core::starknet::class_hash::ClassHash" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "uuid", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u32" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "emit", + "inputs": [ + { + "name": "keys", + "type": "core::array::Array::" + }, + { + "name": "values", + "type": "core::array::Span::" + } + ], + "outputs": [], + "state_mutability": "view" + }, + { + "type": "function", + "name": "entity", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "keys", + "type": "core::array::Span::" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ], + "outputs": [ + { + "type": "core::array::Span::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_entity", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "keys", + "type": "core::array::Span::" + }, + { + "name": "values", + "type": "core::array::Span::" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "delete_entity", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "keys", + "type": "core::array::Span::" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "base", + "inputs": [], + "outputs": [ + { + "type": "core::starknet::class_hash::ClassHash" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "is_owner", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "resource", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "grant_owner", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "resource", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "revoke_owner", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "resource", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "is_writer", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "grant_writer", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "revoke_writer", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "UpgradeableWorld", + "interface_name": "dojo::world::IUpgradeableWorld" + }, + { + "type": "interface", + "name": "dojo::world::IUpgradeableWorld", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "UpgradeableState", + "interface_name": "dojo::interfaces::IUpgradeableState" + }, + { + "type": "struct", + "name": "dojo::interfaces::StorageUpdate", + "members": [ + { + "name": "key", + "type": "core::felt252" + }, + { + "name": "value", + "type": "core::felt252" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::interfaces::ProgramOutput", + "members": [ + { + "name": "prev_state_root", + "type": "core::felt252" + }, + { + "name": "new_state_root", + "type": "core::felt252" + }, + { + "name": "block_number", + "type": "core::felt252" + }, + { + "name": "block_hash", + "type": "core::felt252" + }, + { + "name": "config_hash", + "type": "core::felt252" + }, + { + "name": "world_da_hash", + "type": "core::felt252" + }, + { + "name": "message_to_starknet_segment", + "type": "core::array::Span::" + }, + { + "name": "message_to_appchain_segment", + "type": "core::array::Span::" + } + ] + }, + { + "type": "interface", + "name": "dojo::interfaces::IUpgradeableState", + "items": [ + { + "type": "function", + "name": "upgrade_state", + "inputs": [ + { + "name": "new_state", + "type": "core::array::Span::" + }, + { + "name": "program_output", + "type": "dojo::interfaces::ProgramOutput" + }, + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "ConfigImpl", + "interface_name": "dojo::config::interface::IConfig" + }, + { + "type": "interface", + "name": "dojo::config::interface::IConfig", + "items": [ + { + "type": "function", + "name": "set_differ_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_merger_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_differ_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_merger_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_facts_registry", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_facts_registry", + "inputs": [], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "constructor", + "name": "constructor", + "inputs": [ + { + "name": "contract_base", + "type": "core::starknet::class_hash::ClassHash" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::WorldSpawned", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "creator", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::ContractDeployed", + "kind": "struct", + "members": [ + { + "name": "salt", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::ContractUpgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::WorldUpgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::MetadataUpdate", + "kind": "struct", + "members": [ + { + "name": "resource", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "uri", + "type": "core::byte_array::ByteArray", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::ModelRegistered", + "kind": "struct", + "members": [ + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "prev_class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "prev_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::StoreSetRecord", + "kind": "struct", + "members": [ + { + "name": "table", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "keys", + "type": "core::array::Span::", + "kind": "data" + }, + { + "name": "values", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::StoreDelRecord", + "kind": "struct", + "members": [ + { + "name": "table", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "keys", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::WriterUpdated", + "kind": "struct", + "members": [ + { + "name": "model", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "value", + "type": "core::bool", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::OwnerUpdated", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "resource", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "value", + "type": "core::bool", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::MergerProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::FactsRegistryUpdate", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::Event", + "kind": "enum", + "variants": [ + { + "name": "DifferProgramHashUpdate", + "type": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "nested" + }, + { + "name": "MergerProgramHashUpdate", + "type": "dojo::config::component::Config::MergerProgramHashUpdate", + "kind": "nested" + }, + { + "name": "FactsRegistryUpdate", + "type": "dojo::config::component::Config::FactsRegistryUpdate", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::StateUpdated", + "kind": "struct", + "members": [ + { + "name": "da_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::Event", + "kind": "enum", + "variants": [ + { + "name": "WorldSpawned", + "type": "dojo::world::world::WorldSpawned", + "kind": "nested" + }, + { + "name": "ContractDeployed", + "type": "dojo::world::world::ContractDeployed", + "kind": "nested" + }, + { + "name": "ContractUpgraded", + "type": "dojo::world::world::ContractUpgraded", + "kind": "nested" + }, + { + "name": "WorldUpgraded", + "type": "dojo::world::world::WorldUpgraded", + "kind": "nested" + }, + { + "name": "MetadataUpdate", + "type": "dojo::world::world::MetadataUpdate", + "kind": "nested" + }, + { + "name": "ModelRegistered", + "type": "dojo::world::world::ModelRegistered", + "kind": "nested" + }, + { + "name": "StoreSetRecord", + "type": "dojo::world::world::StoreSetRecord", + "kind": "nested" + }, + { + "name": "StoreDelRecord", + "type": "dojo::world::world::StoreDelRecord", + "kind": "nested" + }, + { + "name": "WriterUpdated", + "type": "dojo::world::world::WriterUpdated", + "kind": "nested" + }, + { + "name": "OwnerUpdated", + "type": "dojo::world::world::OwnerUpdated", + "kind": "nested" + }, + { + "name": "ConfigEvent", + "type": "dojo::config::component::Config::Event", + "kind": "nested" + }, + { + "name": "StateUpdated", + "type": "dojo::world::world::StateUpdated", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_emote_message.json b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_actions_actions_moved.json similarity index 93% rename from examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_emote_message.json rename to examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_actions_actions_moved.json index 9c63d0fc5d..89abdcfec5 100644 --- a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_emote_message.json +++ b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_actions_actions_moved.json @@ -319,52 +319,52 @@ }, { "type": "impl", - "name": "emote_messageImpl", - "interface_name": "dojo_examples::models::Iemote_message" + "name": "movedImpl", + "interface_name": "dojo_examples::actions::actions::Imoved" }, { "type": "enum", - "name": "dojo_examples::models::Emote", + "name": "dojo_examples::models::Direction", "variants": [ { "name": "None", "type": "()" }, { - "name": "Happy", + "name": "Left", "type": "()" }, { - "name": "Sad", + "name": "Right", "type": "()" }, { - "name": "Angry", + "name": "Up", "type": "()" }, { - "name": "Love", + "name": "Down", "type": "()" } ] }, { "type": "struct", - "name": "dojo_examples::models::EmoteMessage", + "name": "dojo_examples::actions::actions::Moved", "members": [ { - "name": "identity", + "name": "player", "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "emote", - "type": "dojo_examples::models::Emote" + "name": "direction", + "type": "dojo_examples::models::Direction" } ] }, { "type": "interface", - "name": "dojo_examples::models::Iemote_message", + "name": "dojo_examples::actions::actions::Imoved", "items": [ { "type": "function", @@ -372,7 +372,7 @@ "inputs": [ { "name": "model", - "type": "dojo_examples::models::EmoteMessage" + "type": "dojo_examples::actions::actions::Moved" } ], "outputs": [], @@ -382,7 +382,7 @@ }, { "type": "event", - "name": "dojo_examples::models::emote_message::Event", + "name": "dojo_examples::actions::actions::moved::Event", "kind": "enum", "variants": [] } diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_message.json b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_message.json new file mode 100644 index 0000000000..ec760c99fb --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_message.json @@ -0,0 +1,371 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "messageImpl", + "interface_name": "dojo_examples::models::Imessage" + }, + { + "type": "struct", + "name": "dojo_examples::models::Message", + "members": [ + { + "name": "identity", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "channel", + "type": "core::felt252" + }, + { + "name": "message", + "type": "core::byte_array::ByteArray" + }, + { + "name": "salt", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Imessage", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::Message" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::message::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_mock_token.json b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_mock_token.json new file mode 100644 index 0000000000..b2c1c340fa --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_mock_token.json @@ -0,0 +1,363 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "mock_tokenImpl", + "interface_name": "dojo_examples::models::Imock_token" + }, + { + "type": "struct", + "name": "dojo_examples::models::MockToken", + "members": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u128" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Imock_token", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::MockToken" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::mock_token::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_moves.json b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_moves.json new file mode 100644 index 0000000000..ee2cf17b26 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_moves.json @@ -0,0 +1,393 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "movesImpl", + "interface_name": "dojo_examples::models::Imoves" + }, + { + "type": "enum", + "name": "dojo_examples::models::Direction", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Left", + "type": "()" + }, + { + "name": "Right", + "type": "()" + }, + { + "name": "Up", + "type": "()" + }, + { + "name": "Down", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::models::Moves", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "remaining", + "type": "core::integer::u8" + }, + { + "name": "last_direction", + "type": "dojo_examples::models::Direction" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Imoves", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::Moves" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::moves::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_player_config.json b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_player_config.json new file mode 100644 index 0000000000..8c33ebabc4 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_player_config.json @@ -0,0 +1,385 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "player_configImpl", + "interface_name": "dojo_examples::models::Iplayer_config" + }, + { + "type": "struct", + "name": "dojo_examples::models::PlayerItem", + "members": [ + { + "name": "item_id", + "type": "core::integer::u32" + }, + { + "name": "quantity", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::models::PlayerConfig", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "name", + "type": "core::byte_array::ByteArray" + }, + { + "name": "items", + "type": "core::array::Array::" + }, + { + "name": "favorite_item", + "type": "core::option::Option::" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Iplayer_config", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::PlayerConfig" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::player_config::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_position.json b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_position.json new file mode 100644 index 0000000000..bceec42587 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_position.json @@ -0,0 +1,377 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "positionImpl", + "interface_name": "dojo_examples::models::Iposition" + }, + { + "type": "struct", + "name": "dojo_examples::models::Vec2", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::models::Position", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "vec", + "type": "dojo_examples::models::Vec2" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Iposition", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::Position" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::position::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_others_others_contract_initialized.json b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_others_others_contract_initialized.json new file mode 100644 index 0000000000..1dbbd313d8 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_others_others_contract_initialized.json @@ -0,0 +1,367 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "contract_initializedImpl", + "interface_name": "dojo_examples::others::others::Icontract_initialized" + }, + { + "type": "struct", + "name": "dojo_examples::others::others::ContractInitialized", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "contract_class", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "value", + "type": "core::integer::u8" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::others::others::Icontract_initialized", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::others::others::ContractInitialized" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::others::others::contract_initialized::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/contracts/dojo_examples_actions_actions.json b/examples/spawn-and-move/manifests/release/abis/deployments/contracts/dojo_examples_actions_actions.json new file mode 100644 index 0000000000..21aed968a7 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/deployments/contracts/dojo_examples_actions_actions.json @@ -0,0 +1,290 @@ +[ + { + "type": "impl", + "name": "DojoResourceProviderImpl", + "interface_name": "dojo::world::IDojoResourceProvider" + }, + { + "type": "interface", + "name": "dojo::world::IDojoResourceProvider", + "items": [ + { + "type": "function", + "name": "dojo_resource", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "ActionsComputedImpl", + "interface_name": "dojo_examples::actions::IActionsComputed" + }, + { + "type": "struct", + "name": "dojo_examples::models::Vec2", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::models::Position", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "vec", + "type": "dojo_examples::models::Vec2" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::actions::IActionsComputed", + "items": [ + { + "type": "function", + "name": "tile_terrain", + "inputs": [ + { + "name": "vec", + "type": "dojo_examples::models::Vec2" + } + ], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "quadrant", + "inputs": [ + { + "name": "pos", + "type": "dojo_examples::models::Position" + } + ], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "ActionsImpl", + "interface_name": "dojo_examples::actions::IActions" + }, + { + "type": "enum", + "name": "dojo_examples::models::Direction", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Left", + "type": "()" + }, + { + "name": "Right", + "type": "()" + }, + { + "name": "Up", + "type": "()" + }, + { + "name": "Down", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::actions::IActions", + "items": [ + { + "type": "function", + "name": "spawn", + "inputs": [], + "outputs": [], + "state_mutability": "view" + }, + { + "type": "function", + "name": "move", + "inputs": [ + { + "name": "direction", + "type": "dojo_examples::models::Direction" + } + ], + "outputs": [], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_player_config", + "inputs": [ + { + "name": "name", + "type": "core::byte_array::ByteArray" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::actions::actions::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::actions::actions::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::actions::actions::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/contracts/dojo_examples_others_others.json b/examples/spawn-and-move/manifests/release/abis/deployments/contracts/dojo_examples_others_others.json new file mode 100644 index 0000000000..36d8c3ef78 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/deployments/contracts/dojo_examples_others_others.json @@ -0,0 +1,146 @@ +[ + { + "type": "impl", + "name": "DojoResourceProviderImpl", + "interface_name": "dojo::world::IDojoResourceProvider" + }, + { + "type": "interface", + "name": "dojo::world::IDojoResourceProvider", + "items": [ + { + "type": "function", + "name": "dojo_resource", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::others::others::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::others::others::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [ + { + "name": "actions_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "actions_class", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "value", + "type": "core::integer::u8" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::others::others::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/dojo_world_world.json b/examples/spawn-and-move/manifests/release/abis/deployments/dojo_world_world.json new file mode 100644 index 0000000000..c1a2447839 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/deployments/dojo_world_world.json @@ -0,0 +1,996 @@ +[ + { + "type": "impl", + "name": "World", + "interface_name": "dojo::world::IWorld" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo::resource_metadata::ResourceMetadata", + "members": [ + { + "name": "resource_id", + "type": "core::felt252" + }, + { + "name": "metadata_uri", + "type": "core::byte_array::ByteArray" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorld", + "items": [ + { + "type": "function", + "name": "metadata", + "inputs": [ + { + "name": "resource_id", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "dojo::resource_metadata::ResourceMetadata" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_metadata", + "inputs": [ + { + "name": "metadata", + "type": "dojo::resource_metadata::ResourceMetadata" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "model", + "inputs": [ + { + "name": "selector", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "register_model", + "inputs": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "deploy_contract", + "inputs": [ + { + "name": "salt", + "type": "core::felt252" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "init_calldata", + "type": "core::array::Span::" + } + ], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "upgrade_contract", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [ + { + "type": "core::starknet::class_hash::ClassHash" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "uuid", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u32" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "emit", + "inputs": [ + { + "name": "keys", + "type": "core::array::Array::" + }, + { + "name": "values", + "type": "core::array::Span::" + } + ], + "outputs": [], + "state_mutability": "view" + }, + { + "type": "function", + "name": "entity", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "keys", + "type": "core::array::Span::" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ], + "outputs": [ + { + "type": "core::array::Span::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_entity", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "keys", + "type": "core::array::Span::" + }, + { + "name": "values", + "type": "core::array::Span::" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "delete_entity", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "keys", + "type": "core::array::Span::" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "base", + "inputs": [], + "outputs": [ + { + "type": "core::starknet::class_hash::ClassHash" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "is_owner", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "resource", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "grant_owner", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "resource", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "revoke_owner", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "resource", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "is_writer", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "grant_writer", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "revoke_writer", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "UpgradeableWorld", + "interface_name": "dojo::world::IUpgradeableWorld" + }, + { + "type": "interface", + "name": "dojo::world::IUpgradeableWorld", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "UpgradeableState", + "interface_name": "dojo::interfaces::IUpgradeableState" + }, + { + "type": "struct", + "name": "dojo::interfaces::StorageUpdate", + "members": [ + { + "name": "key", + "type": "core::felt252" + }, + { + "name": "value", + "type": "core::felt252" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::interfaces::ProgramOutput", + "members": [ + { + "name": "prev_state_root", + "type": "core::felt252" + }, + { + "name": "new_state_root", + "type": "core::felt252" + }, + { + "name": "block_number", + "type": "core::felt252" + }, + { + "name": "block_hash", + "type": "core::felt252" + }, + { + "name": "config_hash", + "type": "core::felt252" + }, + { + "name": "world_da_hash", + "type": "core::felt252" + }, + { + "name": "message_to_starknet_segment", + "type": "core::array::Span::" + }, + { + "name": "message_to_appchain_segment", + "type": "core::array::Span::" + } + ] + }, + { + "type": "interface", + "name": "dojo::interfaces::IUpgradeableState", + "items": [ + { + "type": "function", + "name": "upgrade_state", + "inputs": [ + { + "name": "new_state", + "type": "core::array::Span::" + }, + { + "name": "program_output", + "type": "dojo::interfaces::ProgramOutput" + }, + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "ConfigImpl", + "interface_name": "dojo::config::interface::IConfig" + }, + { + "type": "interface", + "name": "dojo::config::interface::IConfig", + "items": [ + { + "type": "function", + "name": "set_differ_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_merger_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_differ_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_merger_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_facts_registry", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_facts_registry", + "inputs": [], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "constructor", + "name": "constructor", + "inputs": [ + { + "name": "contract_base", + "type": "core::starknet::class_hash::ClassHash" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::WorldSpawned", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "creator", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::ContractDeployed", + "kind": "struct", + "members": [ + { + "name": "salt", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::ContractUpgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::WorldUpgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::MetadataUpdate", + "kind": "struct", + "members": [ + { + "name": "resource", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "uri", + "type": "core::byte_array::ByteArray", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::ModelRegistered", + "kind": "struct", + "members": [ + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "prev_class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "prev_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::StoreSetRecord", + "kind": "struct", + "members": [ + { + "name": "table", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "keys", + "type": "core::array::Span::", + "kind": "data" + }, + { + "name": "values", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::StoreDelRecord", + "kind": "struct", + "members": [ + { + "name": "table", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "keys", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::WriterUpdated", + "kind": "struct", + "members": [ + { + "name": "model", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "value", + "type": "core::bool", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::OwnerUpdated", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "resource", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "value", + "type": "core::bool", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::MergerProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::FactsRegistryUpdate", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::Event", + "kind": "enum", + "variants": [ + { + "name": "DifferProgramHashUpdate", + "type": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "nested" + }, + { + "name": "MergerProgramHashUpdate", + "type": "dojo::config::component::Config::MergerProgramHashUpdate", + "kind": "nested" + }, + { + "name": "FactsRegistryUpdate", + "type": "dojo::config::component::Config::FactsRegistryUpdate", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::StateUpdated", + "kind": "struct", + "members": [ + { + "name": "da_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::Event", + "kind": "enum", + "variants": [ + { + "name": "WorldSpawned", + "type": "dojo::world::world::WorldSpawned", + "kind": "nested" + }, + { + "name": "ContractDeployed", + "type": "dojo::world::world::ContractDeployed", + "kind": "nested" + }, + { + "name": "ContractUpgraded", + "type": "dojo::world::world::ContractUpgraded", + "kind": "nested" + }, + { + "name": "WorldUpgraded", + "type": "dojo::world::world::WorldUpgraded", + "kind": "nested" + }, + { + "name": "MetadataUpdate", + "type": "dojo::world::world::MetadataUpdate", + "kind": "nested" + }, + { + "name": "ModelRegistered", + "type": "dojo::world::world::ModelRegistered", + "kind": "nested" + }, + { + "name": "StoreSetRecord", + "type": "dojo::world::world::StoreSetRecord", + "kind": "nested" + }, + { + "name": "StoreDelRecord", + "type": "dojo::world::world::StoreDelRecord", + "kind": "nested" + }, + { + "name": "WriterUpdated", + "type": "dojo::world::world::WriterUpdated", + "kind": "nested" + }, + { + "name": "OwnerUpdated", + "type": "dojo::world::world::OwnerUpdated", + "kind": "nested" + }, + { + "name": "ConfigEvent", + "type": "dojo::config::component::Config::Event", + "kind": "nested" + }, + { + "name": "StateUpdated", + "type": "dojo::world::world::StateUpdated", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_actions_actions_moved.json b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_actions_actions_moved.json new file mode 100644 index 0000000000..89abdcfec5 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_actions_actions_moved.json @@ -0,0 +1,389 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "movedImpl", + "interface_name": "dojo_examples::actions::actions::Imoved" + }, + { + "type": "enum", + "name": "dojo_examples::models::Direction", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Left", + "type": "()" + }, + { + "name": "Right", + "type": "()" + }, + { + "name": "Up", + "type": "()" + }, + { + "name": "Down", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::actions::actions::Moved", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "direction", + "type": "dojo_examples::models::Direction" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::actions::actions::Imoved", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::actions::actions::Moved" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::actions::actions::moved::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_emote_message.json b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_emote_message.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_emote_message.json rename to examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_emote_message.json diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_message.json b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_message.json new file mode 100644 index 0000000000..ec760c99fb --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_message.json @@ -0,0 +1,371 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "messageImpl", + "interface_name": "dojo_examples::models::Imessage" + }, + { + "type": "struct", + "name": "dojo_examples::models::Message", + "members": [ + { + "name": "identity", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "channel", + "type": "core::felt252" + }, + { + "name": "message", + "type": "core::byte_array::ByteArray" + }, + { + "name": "salt", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Imessage", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::Message" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::message::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_moves.json b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_moves.json new file mode 100644 index 0000000000..ee2cf17b26 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_moves.json @@ -0,0 +1,393 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "movesImpl", + "interface_name": "dojo_examples::models::Imoves" + }, + { + "type": "enum", + "name": "dojo_examples::models::Direction", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Left", + "type": "()" + }, + { + "name": "Right", + "type": "()" + }, + { + "name": "Up", + "type": "()" + }, + { + "name": "Down", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::models::Moves", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "remaining", + "type": "core::integer::u8" + }, + { + "name": "last_direction", + "type": "dojo_examples::models::Direction" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Imoves", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::Moves" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::moves::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_player_config.json b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_player_config.json new file mode 100644 index 0000000000..8c33ebabc4 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_player_config.json @@ -0,0 +1,385 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "player_configImpl", + "interface_name": "dojo_examples::models::Iplayer_config" + }, + { + "type": "struct", + "name": "dojo_examples::models::PlayerItem", + "members": [ + { + "name": "item_id", + "type": "core::integer::u32" + }, + { + "name": "quantity", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::models::PlayerConfig", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "name", + "type": "core::byte_array::ByteArray" + }, + { + "name": "items", + "type": "core::array::Array::" + }, + { + "name": "favorite_item", + "type": "core::option::Option::" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Iplayer_config", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::PlayerConfig" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::player_config::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_position.json b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_position.json new file mode 100644 index 0000000000..bceec42587 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_position.json @@ -0,0 +1,377 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "positionImpl", + "interface_name": "dojo_examples::models::Iposition" + }, + { + "type": "struct", + "name": "dojo_examples::models::Vec2", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::models::Position", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "vec", + "type": "dojo_examples::models::Vec2" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Iposition", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::Position" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::position::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_others_others_contract_initialized.json b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_others_others_contract_initialized.json new file mode 100644 index 0000000000..1dbbd313d8 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_others_others_contract_initialized.json @@ -0,0 +1,367 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "contract_initializedImpl", + "interface_name": "dojo_examples::others::others::Icontract_initialized" + }, + { + "type": "struct", + "name": "dojo_examples::others::others::ContractInitialized", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "contract_class", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "value", + "type": "core::integer::u8" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::others::others::Icontract_initialized", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::others::others::ContractInitialized" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::others::others::contract_initialized::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_actions_actions.toml b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_actions_actions.toml new file mode 100644 index 0000000000..bf0f86489b --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_actions_actions.toml @@ -0,0 +1,10 @@ +kind = "DojoContract" +class_hash = "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767" +original_class_hash = "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767" +base_class_hash = "0x0" +abi = "manifests/release/abis/base/contracts/dojo_examples_actions_actions.json" +reads = [] +writes = [] +computed = [] +init_calldata = [] +name = "dojo_examples::actions::actions" diff --git a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_mock_token_mock_token.toml b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_mock_token_mock_token.toml new file mode 100644 index 0000000000..65fbfcc8ad --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_mock_token_mock_token.toml @@ -0,0 +1,10 @@ +kind = "DojoContract" +class_hash = "0x5c32bc974f96f82ded691bb95bf26b2783f874fffb50fe84a331acb75ecf5b2" +original_class_hash = "0x5c32bc974f96f82ded691bb95bf26b2783f874fffb50fe84a331acb75ecf5b2" +base_class_hash = "0x0" +abi = "manifests/release/abis/base/contracts/dojo_examples_mock_token_mock_token.json" +reads = [] +writes = [] +computed = [] +init_calldata = [] +name = "dojo_examples::mock_token::mock_token" diff --git a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_others_others.toml b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_others_others.toml new file mode 100644 index 0000000000..66cb83c9d6 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_others_others.toml @@ -0,0 +1,10 @@ +kind = "DojoContract" +class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" +original_class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" +base_class_hash = "0x0" +abi = "manifests/release/abis/base/contracts/dojo_examples_others_others.json" +reads = [] +writes = [] +computed = [] +init_calldata = [] +name = "dojo_examples::others::others" diff --git a/examples/spawn-and-move/manifests/release/base/dojo_base_base.toml b/examples/spawn-and-move/manifests/release/base/dojo_base_base.toml new file mode 100644 index 0000000000..6c4b5de67e --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/dojo_base_base.toml @@ -0,0 +1,4 @@ +kind = "Class" +class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" +original_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" +name = "dojo::base::base" diff --git a/examples/spawn-and-move/manifests/release/base/dojo_world_world.toml b/examples/spawn-and-move/manifests/release/base/dojo_world_world.toml new file mode 100644 index 0000000000..e9badcfe4c --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/dojo_world_world.toml @@ -0,0 +1,5 @@ +kind = "Class" +class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" +original_class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" +abi = "manifests/release/abis/base/dojo_world_world.json" +name = "dojo::world::world" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_actions_actions_moved.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_actions_actions_moved.toml new file mode 100644 index 0000000000..74c1e890a1 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_actions_actions_moved.toml @@ -0,0 +1,15 @@ +kind = "DojoModel" +class_hash = "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c" +original_class_hash = "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c" +abi = "manifests/release/abis/base/models/dojo_examples_actions_actions_moved.json" +name = "dojo_examples::actions::actions::moved" + +[[members]] +name = "player" +type = "ContractAddress" +key = true + +[[members]] +name = "direction" +type = "Direction" +key = false diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_message.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_message.toml new file mode 100644 index 0000000000..fdc87b27cb --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_message.toml @@ -0,0 +1,25 @@ +kind = "DojoModel" +class_hash = "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5" +original_class_hash = "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5" +abi = "manifests/release/abis/base/models/dojo_examples_models_message.json" +name = "dojo_examples::models::message" + +[[members]] +name = "identity" +type = "ContractAddress" +key = true + +[[members]] +name = "channel" +type = "felt252" +key = true + +[[members]] +name = "message" +type = "ByteArray" +key = false + +[[members]] +name = "salt" +type = "felt252" +key = true diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_mock_token.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_mock_token.toml new file mode 100644 index 0000000000..3d0147bc11 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_mock_token.toml @@ -0,0 +1,15 @@ +kind = "DojoModel" +class_hash = "0x6a21c56878ba470ac7a51f336ca6a59781de38e1810d2d20866ab2b52138a6d" +original_class_hash = "0x6a21c56878ba470ac7a51f336ca6a59781de38e1810d2d20866ab2b52138a6d" +abi = "manifests/release/abis/base/models/dojo_examples_models_mock_token.json" +name = "dojo_examples::models::mock_token" + +[[members]] +name = "account" +type = "ContractAddress" +key = true + +[[members]] +name = "amount" +type = "u128" +key = false diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_moves.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_moves.toml new file mode 100644 index 0000000000..8954550f5e --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_moves.toml @@ -0,0 +1,20 @@ +kind = "DojoModel" +class_hash = "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8" +original_class_hash = "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8" +abi = "manifests/release/abis/base/models/dojo_examples_models_moves.json" +name = "dojo_examples::models::moves" + +[[members]] +name = "player" +type = "ContractAddress" +key = true + +[[members]] +name = "remaining" +type = "u8" +key = false + +[[members]] +name = "last_direction" +type = "Direction" +key = false diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_player_config.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_player_config.toml new file mode 100644 index 0000000000..bbeae83193 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_player_config.toml @@ -0,0 +1,25 @@ +kind = "DojoModel" +class_hash = "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55" +original_class_hash = "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55" +abi = "manifests/release/abis/base/models/dojo_examples_models_player_config.json" +name = "dojo_examples::models::player_config" + +[[members]] +name = "player" +type = "ContractAddress" +key = true + +[[members]] +name = "name" +type = "ByteArray" +key = false + +[[members]] +name = "items" +type = "Array" +key = false + +[[members]] +name = "favorite_item" +type = "Option" +key = false diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_position.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_position.toml new file mode 100644 index 0000000000..562adaba78 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_position.toml @@ -0,0 +1,15 @@ +kind = "DojoModel" +class_hash = "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff" +original_class_hash = "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff" +abi = "manifests/release/abis/base/models/dojo_examples_models_position.json" +name = "dojo_examples::models::position" + +[[members]] +name = "player" +type = "ContractAddress" +key = true + +[[members]] +name = "vec" +type = "Vec2" +key = false diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_others_others_contract_initialized.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_others_others_contract_initialized.toml new file mode 100644 index 0000000000..51efb699ba --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_others_others_contract_initialized.toml @@ -0,0 +1,20 @@ +kind = "DojoModel" +class_hash = "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c" +original_class_hash = "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c" +abi = "manifests/release/abis/base/models/dojo_examples_others_others_contract_initialized.json" +name = "dojo_examples::others::others::contract_initialized" + +[[members]] +name = "contract_address" +type = "ContractAddress" +key = true + +[[members]] +name = "contract_class" +type = "ClassHash" +key = false + +[[members]] +name = "value" +type = "u8" +key = false diff --git a/examples/spawn-and-move/manifests/release/manifest.json b/examples/spawn-and-move/manifests/release/manifest.json new file mode 100644 index 0000000000..8ae464adc9 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/manifest.json @@ -0,0 +1,3910 @@ +{ + "world": { + "kind": "WorldContract", + "class_hash": "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9", + "original_class_hash": "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9", + "abi": [ + { + "type": "impl", + "name": "World", + "interface_name": "dojo::world::IWorld" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo::resource_metadata::ResourceMetadata", + "members": [ + { + "name": "resource_id", + "type": "core::felt252" + }, + { + "name": "metadata_uri", + "type": "core::byte_array::ByteArray" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorld", + "items": [ + { + "type": "function", + "name": "metadata", + "inputs": [ + { + "name": "resource_id", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "dojo::resource_metadata::ResourceMetadata" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_metadata", + "inputs": [ + { + "name": "metadata", + "type": "dojo::resource_metadata::ResourceMetadata" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "model", + "inputs": [ + { + "name": "selector", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "register_model", + "inputs": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "deploy_contract", + "inputs": [ + { + "name": "salt", + "type": "core::felt252" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "init_calldata", + "type": "core::array::Span::" + } + ], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "upgrade_contract", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [ + { + "type": "core::starknet::class_hash::ClassHash" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "uuid", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u32" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "emit", + "inputs": [ + { + "name": "keys", + "type": "core::array::Array::" + }, + { + "name": "values", + "type": "core::array::Span::" + } + ], + "outputs": [], + "state_mutability": "view" + }, + { + "type": "function", + "name": "entity", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "keys", + "type": "core::array::Span::" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ], + "outputs": [ + { + "type": "core::array::Span::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_entity", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "keys", + "type": "core::array::Span::" + }, + { + "name": "values", + "type": "core::array::Span::" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "delete_entity", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "keys", + "type": "core::array::Span::" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "base", + "inputs": [], + "outputs": [ + { + "type": "core::starknet::class_hash::ClassHash" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "is_owner", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "resource", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "grant_owner", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "resource", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "revoke_owner", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "resource", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "is_writer", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "grant_writer", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "revoke_writer", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "UpgradeableWorld", + "interface_name": "dojo::world::IUpgradeableWorld" + }, + { + "type": "interface", + "name": "dojo::world::IUpgradeableWorld", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "UpgradeableState", + "interface_name": "dojo::interfaces::IUpgradeableState" + }, + { + "type": "struct", + "name": "dojo::interfaces::StorageUpdate", + "members": [ + { + "name": "key", + "type": "core::felt252" + }, + { + "name": "value", + "type": "core::felt252" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::interfaces::ProgramOutput", + "members": [ + { + "name": "prev_state_root", + "type": "core::felt252" + }, + { + "name": "new_state_root", + "type": "core::felt252" + }, + { + "name": "block_number", + "type": "core::felt252" + }, + { + "name": "block_hash", + "type": "core::felt252" + }, + { + "name": "config_hash", + "type": "core::felt252" + }, + { + "name": "world_da_hash", + "type": "core::felt252" + }, + { + "name": "message_to_starknet_segment", + "type": "core::array::Span::" + }, + { + "name": "message_to_appchain_segment", + "type": "core::array::Span::" + } + ] + }, + { + "type": "interface", + "name": "dojo::interfaces::IUpgradeableState", + "items": [ + { + "type": "function", + "name": "upgrade_state", + "inputs": [ + { + "name": "new_state", + "type": "core::array::Span::" + }, + { + "name": "program_output", + "type": "dojo::interfaces::ProgramOutput" + }, + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "ConfigImpl", + "interface_name": "dojo::config::interface::IConfig" + }, + { + "type": "interface", + "name": "dojo::config::interface::IConfig", + "items": [ + { + "type": "function", + "name": "set_differ_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_merger_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_differ_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_merger_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_facts_registry", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_facts_registry", + "inputs": [], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "constructor", + "name": "constructor", + "inputs": [ + { + "name": "contract_base", + "type": "core::starknet::class_hash::ClassHash" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::WorldSpawned", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "creator", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::ContractDeployed", + "kind": "struct", + "members": [ + { + "name": "salt", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::ContractUpgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::WorldUpgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::MetadataUpdate", + "kind": "struct", + "members": [ + { + "name": "resource", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "uri", + "type": "core::byte_array::ByteArray", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::ModelRegistered", + "kind": "struct", + "members": [ + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "prev_class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "prev_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::StoreSetRecord", + "kind": "struct", + "members": [ + { + "name": "table", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "keys", + "type": "core::array::Span::", + "kind": "data" + }, + { + "name": "values", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::StoreDelRecord", + "kind": "struct", + "members": [ + { + "name": "table", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "keys", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::WriterUpdated", + "kind": "struct", + "members": [ + { + "name": "model", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "value", + "type": "core::bool", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::OwnerUpdated", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "resource", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "value", + "type": "core::bool", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::MergerProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::FactsRegistryUpdate", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::Event", + "kind": "enum", + "variants": [ + { + "name": "DifferProgramHashUpdate", + "type": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "nested" + }, + { + "name": "MergerProgramHashUpdate", + "type": "dojo::config::component::Config::MergerProgramHashUpdate", + "kind": "nested" + }, + { + "name": "FactsRegistryUpdate", + "type": "dojo::config::component::Config::FactsRegistryUpdate", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::StateUpdated", + "kind": "struct", + "members": [ + { + "name": "da_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::Event", + "kind": "enum", + "variants": [ + { + "name": "WorldSpawned", + "type": "dojo::world::world::WorldSpawned", + "kind": "nested" + }, + { + "name": "ContractDeployed", + "type": "dojo::world::world::ContractDeployed", + "kind": "nested" + }, + { + "name": "ContractUpgraded", + "type": "dojo::world::world::ContractUpgraded", + "kind": "nested" + }, + { + "name": "WorldUpgraded", + "type": "dojo::world::world::WorldUpgraded", + "kind": "nested" + }, + { + "name": "MetadataUpdate", + "type": "dojo::world::world::MetadataUpdate", + "kind": "nested" + }, + { + "name": "ModelRegistered", + "type": "dojo::world::world::ModelRegistered", + "kind": "nested" + }, + { + "name": "StoreSetRecord", + "type": "dojo::world::world::StoreSetRecord", + "kind": "nested" + }, + { + "name": "StoreDelRecord", + "type": "dojo::world::world::StoreDelRecord", + "kind": "nested" + }, + { + "name": "WriterUpdated", + "type": "dojo::world::world::WriterUpdated", + "kind": "nested" + }, + { + "name": "OwnerUpdated", + "type": "dojo::world::world::OwnerUpdated", + "kind": "nested" + }, + { + "name": "ConfigEvent", + "type": "dojo::config::component::Config::Event", + "kind": "nested" + }, + { + "name": "StateUpdated", + "type": "dojo::world::world::StateUpdated", + "kind": "nested" + } + ] + } + ], + "address": "0x7efebb0c2d4cc285d48a97a7174def3be7fdd6b7bd29cca758fa2e17e03ef30", + "transaction_hash": "0x60316eb232789f4d8352c6afdc36b76d33362d72b43bf78183b43f196779a9d", + "block_number": 3, + "seed": "dojo_examples", + "metadata": { + "profile_name": "release", + "rpc_url": "http://localhost:5050/" + }, + "name": "dojo::world::world" + }, + "base": { + "kind": "Class", + "class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", + "original_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", + "abi": null, + "name": "dojo::base::base" + }, + "contracts": [ + { + "kind": "DojoContract", + "address": "0x5c70a663d6b48d8e4c6aaa9572e3735a732ac3765700d470463e670587852af", + "class_hash": "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767", + "original_class_hash": "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767", + "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", + "abi": [ + { + "type": "impl", + "name": "DojoResourceProviderImpl", + "interface_name": "dojo::world::IDojoResourceProvider" + }, + { + "type": "interface", + "name": "dojo::world::IDojoResourceProvider", + "items": [ + { + "type": "function", + "name": "dojo_resource", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "ActionsComputedImpl", + "interface_name": "dojo_examples::actions::IActionsComputed" + }, + { + "type": "struct", + "name": "dojo_examples::models::Vec2", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::models::Position", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "vec", + "type": "dojo_examples::models::Vec2" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::actions::IActionsComputed", + "items": [ + { + "type": "function", + "name": "tile_terrain", + "inputs": [ + { + "name": "vec", + "type": "dojo_examples::models::Vec2" + } + ], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "quadrant", + "inputs": [ + { + "name": "pos", + "type": "dojo_examples::models::Position" + } + ], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "ActionsImpl", + "interface_name": "dojo_examples::actions::IActions" + }, + { + "type": "enum", + "name": "dojo_examples::models::Direction", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Left", + "type": "()" + }, + { + "name": "Right", + "type": "()" + }, + { + "name": "Up", + "type": "()" + }, + { + "name": "Down", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::actions::IActions", + "items": [ + { + "type": "function", + "name": "spawn", + "inputs": [], + "outputs": [], + "state_mutability": "view" + }, + { + "type": "function", + "name": "move", + "inputs": [ + { + "name": "direction", + "type": "dojo_examples::models::Direction" + } + ], + "outputs": [], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_player_config", + "inputs": [ + { + "name": "name", + "type": "core::byte_array::ByteArray" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::actions::actions::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::actions::actions::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::actions::actions::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } + ], + "reads": [], + "writes": [ + "Moves", + "Position" + ], + "computed": [], + "init_calldata": [], + "name": "dojo_examples::actions::actions" + }, + { + "kind": "DojoContract", + "address": "0x3f51cd82daaf5907d2fd082ae3f45ae2ef96ab61677f46abc16e0a54d3392d1", + "class_hash": "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a", + "original_class_hash": "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a", + "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", + "abi": [ + { + "type": "impl", + "name": "DojoResourceProviderImpl", + "interface_name": "dojo::world::IDojoResourceProvider" + }, + { + "type": "interface", + "name": "dojo::world::IDojoResourceProvider", + "items": [ + { + "type": "function", + "name": "dojo_resource", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::others::others::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::others::others::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [ + { + "name": "actions_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "actions_class", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "value", + "type": "core::integer::u8" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::others::others::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } + ], + "reads": [], + "writes": [], + "computed": [], + "init_calldata": [ + "$class_hash:dojo_examples::actions::actions", + "$contract_address:dojo_examples::actions::actions", + "10" + ], + "name": "dojo_examples::others::others" + } + ], + "models": [ + { + "kind": "DojoModel", + "members": [ + { + "name": "player", + "type": "ContractAddress", + "key": true + }, + { + "name": "direction", + "type": "Direction", + "key": false + } + ], + "class_hash": "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c", + "original_class_hash": "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "movedImpl", + "interface_name": "dojo_examples::actions::actions::Imoved" + }, + { + "type": "enum", + "name": "dojo_examples::models::Direction", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Left", + "type": "()" + }, + { + "name": "Right", + "type": "()" + }, + { + "name": "Up", + "type": "()" + }, + { + "name": "Down", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::actions::actions::Moved", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "direction", + "type": "dojo_examples::models::Direction" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::actions::actions::Imoved", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::actions::actions::Moved" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::actions::actions::moved::Event", + "kind": "enum", + "variants": [] + } + ], + "name": "dojo_examples::actions::actions::moved" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "identity", + "type": "ContractAddress", + "key": true + }, + { + "name": "channel", + "type": "felt252", + "key": true + }, + { + "name": "message", + "type": "ByteArray", + "key": false + }, + { + "name": "salt", + "type": "felt252", + "key": true + } + ], + "class_hash": "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5", + "original_class_hash": "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "messageImpl", + "interface_name": "dojo_examples::models::Imessage" + }, + { + "type": "struct", + "name": "dojo_examples::models::Message", + "members": [ + { + "name": "identity", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "channel", + "type": "core::felt252" + }, + { + "name": "message", + "type": "core::byte_array::ByteArray" + }, + { + "name": "salt", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Imessage", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::Message" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::message::Event", + "kind": "enum", + "variants": [] + } + ], + "name": "dojo_examples::models::message" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "player", + "type": "ContractAddress", + "key": true + }, + { + "name": "remaining", + "type": "u8", + "key": false + }, + { + "name": "last_direction", + "type": "Direction", + "key": false + } + ], + "class_hash": "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8", + "original_class_hash": "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "movesImpl", + "interface_name": "dojo_examples::models::Imoves" + }, + { + "type": "enum", + "name": "dojo_examples::models::Direction", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Left", + "type": "()" + }, + { + "name": "Right", + "type": "()" + }, + { + "name": "Up", + "type": "()" + }, + { + "name": "Down", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::models::Moves", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "remaining", + "type": "core::integer::u8" + }, + { + "name": "last_direction", + "type": "dojo_examples::models::Direction" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Imoves", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::Moves" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::moves::Event", + "kind": "enum", + "variants": [] + } + ], + "name": "dojo_examples::models::moves" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "player", + "type": "ContractAddress", + "key": true + }, + { + "name": "name", + "type": "ByteArray", + "key": false + }, + { + "name": "items", + "type": "Array", + "key": false + }, + { + "name": "favorite_item", + "type": "Option", + "key": false + } + ], + "class_hash": "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55", + "original_class_hash": "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "player_configImpl", + "interface_name": "dojo_examples::models::Iplayer_config" + }, + { + "type": "struct", + "name": "dojo_examples::models::PlayerItem", + "members": [ + { + "name": "item_id", + "type": "core::integer::u32" + }, + { + "name": "quantity", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::models::PlayerConfig", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "name", + "type": "core::byte_array::ByteArray" + }, + { + "name": "items", + "type": "core::array::Array::" + }, + { + "name": "favorite_item", + "type": "core::option::Option::" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Iplayer_config", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::PlayerConfig" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::player_config::Event", + "kind": "enum", + "variants": [] + } + ], + "name": "dojo_examples::models::player_config" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "player", + "type": "ContractAddress", + "key": true + }, + { + "name": "vec", + "type": "Vec2", + "key": false + } + ], + "class_hash": "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff", + "original_class_hash": "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "positionImpl", + "interface_name": "dojo_examples::models::Iposition" + }, + { + "type": "struct", + "name": "dojo_examples::models::Vec2", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::models::Position", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "vec", + "type": "dojo_examples::models::Vec2" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Iposition", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::Position" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::position::Event", + "kind": "enum", + "variants": [] + } + ], + "name": "dojo_examples::models::position" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "contract_address", + "type": "ContractAddress", + "key": true + }, + { + "name": "contract_class", + "type": "ClassHash", + "key": false + }, + { + "name": "value", + "type": "u8", + "key": false + } + ], + "class_hash": "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c", + "original_class_hash": "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "contract_initializedImpl", + "interface_name": "dojo_examples::others::others::Icontract_initialized" + }, + { + "type": "struct", + "name": "dojo_examples::others::others::ContractInitialized", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "contract_class", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "value", + "type": "core::integer::u8" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::others::others::Icontract_initialized", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::others::others::ContractInitialized" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::others::others::contract_initialized::Event", + "kind": "enum", + "variants": [] + } + ], + "name": "dojo_examples::others::others::contract_initialized" + } + ] +} \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/manifest.toml b/examples/spawn-and-move/manifests/release/manifest.toml new file mode 100644 index 0000000000..71ebf9944e --- /dev/null +++ b/examples/spawn-and-move/manifests/release/manifest.toml @@ -0,0 +1,185 @@ +[world] +kind = "WorldContract" +class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" +original_class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" +abi = "manifests/release/abis/deployments/dojo_world_world.json" +address = "0x7efebb0c2d4cc285d48a97a7174def3be7fdd6b7bd29cca758fa2e17e03ef30" +transaction_hash = "0x60316eb232789f4d8352c6afdc36b76d33362d72b43bf78183b43f196779a9d" +block_number = 3 +seed = "dojo_examples" +name = "dojo::world::world" + +[world.metadata] +profile_name = "release" +rpc_url = "http://localhost:5050/" + +[base] +kind = "Class" +class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" +original_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" +name = "dojo::base::base" + +[[contracts]] +kind = "DojoContract" +address = "0x5c70a663d6b48d8e4c6aaa9572e3735a732ac3765700d470463e670587852af" +class_hash = "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767" +original_class_hash = "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767" +base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" +abi = "manifests/release/abis/deployments/contracts/dojo_examples_actions_actions.json" +reads = [] +writes = [ + "Moves", + "Position", +] +computed = [] +init_calldata = [] +name = "dojo_examples::actions::actions" + +[[contracts]] +kind = "DojoContract" +address = "0x3f51cd82daaf5907d2fd082ae3f45ae2ef96ab61677f46abc16e0a54d3392d1" +class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" +original_class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" +base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" +abi = "manifests/release/abis/deployments/contracts/dojo_examples_others_others.json" +reads = [] +writes = [] +computed = [] +init_calldata = [ + "$class_hash:dojo_examples::actions::actions", + "$contract_address:dojo_examples::actions::actions", + "10", +] +name = "dojo_examples::others::others" + +[[models]] +kind = "DojoModel" +class_hash = "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c" +original_class_hash = "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c" +abi = "manifests/release/abis/deployments/models/dojo_examples_actions_actions_moved.json" +name = "dojo_examples::actions::actions::moved" + +[[models.members]] +name = "player" +type = "ContractAddress" +key = true + +[[models.members]] +name = "direction" +type = "Direction" +key = false + +[[models]] +kind = "DojoModel" +class_hash = "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5" +original_class_hash = "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5" +abi = "manifests/release/abis/deployments/models/dojo_examples_models_message.json" +name = "dojo_examples::models::message" + +[[models.members]] +name = "identity" +type = "ContractAddress" +key = true + +[[models.members]] +name = "channel" +type = "felt252" +key = true + +[[models.members]] +name = "message" +type = "ByteArray" +key = false + +[[models.members]] +name = "salt" +type = "felt252" +key = true + +[[models]] +kind = "DojoModel" +class_hash = "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8" +original_class_hash = "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8" +abi = "manifests/release/abis/deployments/models/dojo_examples_models_moves.json" +name = "dojo_examples::models::moves" + +[[models.members]] +name = "player" +type = "ContractAddress" +key = true + +[[models.members]] +name = "remaining" +type = "u8" +key = false + +[[models.members]] +name = "last_direction" +type = "Direction" +key = false + +[[models]] +kind = "DojoModel" +class_hash = "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55" +original_class_hash = "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55" +abi = "manifests/release/abis/deployments/models/dojo_examples_models_player_config.json" +name = "dojo_examples::models::player_config" + +[[models.members]] +name = "player" +type = "ContractAddress" +key = true + +[[models.members]] +name = "name" +type = "ByteArray" +key = false + +[[models.members]] +name = "items" +type = "Array" +key = false + +[[models.members]] +name = "favorite_item" +type = "Option" +key = false + +[[models]] +kind = "DojoModel" +class_hash = "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff" +original_class_hash = "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff" +abi = "manifests/release/abis/deployments/models/dojo_examples_models_position.json" +name = "dojo_examples::models::position" + +[[models.members]] +name = "player" +type = "ContractAddress" +key = true + +[[models.members]] +name = "vec" +type = "Vec2" +key = false + +[[models]] +kind = "DojoModel" +class_hash = "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c" +original_class_hash = "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c" +abi = "manifests/release/abis/deployments/models/dojo_examples_others_others_contract_initialized.json" +name = "dojo_examples::others::others::contract_initialized" + +[[models.members]] +name = "contract_address" +type = "ContractAddress" +key = true + +[[models.members]] +name = "contract_class" +type = "ClassHash" +key = false + +[[models.members]] +name = "value" +type = "u8" +key = false diff --git a/examples/spawn-and-move/manifests/release/overlays/contracts/dojo_examples_actions_actions.toml b/examples/spawn-and-move/manifests/release/overlays/contracts/dojo_examples_actions_actions.toml new file mode 100644 index 0000000000..188130a013 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/overlays/contracts/dojo_examples_actions_actions.toml @@ -0,0 +1,4 @@ +init_calldata = [ ] +name = "dojo_examples::actions::actions" +reads = [ ] +writes = [ "Moves", "Position" ] diff --git a/examples/spawn-and-move/manifests/release/overlays/contracts/dojo_examples_others_others.toml b/examples/spawn-and-move/manifests/release/overlays/contracts/dojo_examples_others_others.toml new file mode 100644 index 0000000000..82545bca81 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/overlays/contracts/dojo_examples_others_others.toml @@ -0,0 +1,8 @@ +init_calldata = [ + "$class_hash:dojo_examples::actions::actions", + "$contract_address:dojo_examples::actions::actions", + "10", +] +name = "dojo_examples::others::others" +reads = [ ] +writes = [ ] diff --git a/examples/spawn-and-move/manifests/release/overlays/dojo_base_base.toml b/examples/spawn-and-move/manifests/release/overlays/dojo_base_base.toml new file mode 100644 index 0000000000..f706470d45 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/overlays/dojo_base_base.toml @@ -0,0 +1 @@ +name = "dojo::base::base" diff --git a/examples/spawn-and-move/manifests/release/overlays/dojo_world_world.toml b/examples/spawn-and-move/manifests/release/overlays/dojo_world_world.toml new file mode 100644 index 0000000000..a3e686e3ef --- /dev/null +++ b/examples/spawn-and-move/manifests/release/overlays/dojo_world_world.toml @@ -0,0 +1 @@ +name = "dojo::world::world" diff --git a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_actions_actions_moved.toml b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_actions_actions_moved.toml new file mode 100644 index 0000000000..4958a7a15c --- /dev/null +++ b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_actions_actions_moved.toml @@ -0,0 +1 @@ +name = "dojo_examples::actions::actions::moved" diff --git a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_message.toml b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_message.toml new file mode 100644 index 0000000000..5d9412cae2 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_message.toml @@ -0,0 +1 @@ +name = "dojo_examples::models::message" diff --git a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_mock_token.toml b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_mock_token.toml new file mode 100644 index 0000000000..a5ba5684a6 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_mock_token.toml @@ -0,0 +1 @@ +name = "dojo_examples::models::mock_token" diff --git a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_moves.toml b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_moves.toml new file mode 100644 index 0000000000..dc8784e746 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_moves.toml @@ -0,0 +1 @@ +name = "dojo_examples::models::moves" diff --git a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_player_config.toml b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_player_config.toml new file mode 100644 index 0000000000..6af8240b36 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_player_config.toml @@ -0,0 +1 @@ +name = "dojo_examples::models::player_config" diff --git a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_position.toml b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_position.toml new file mode 100644 index 0000000000..df38e71c32 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_position.toml @@ -0,0 +1 @@ +name = "dojo_examples::models::position" diff --git a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_others_others_contract_initialized.toml b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_others_others_contract_initialized.toml new file mode 100644 index 0000000000..f8f3053fe5 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_others_others_contract_initialized.toml @@ -0,0 +1 @@ +name = "dojo_examples::others::others::contract_initialized" diff --git a/examples/spawn-and-move/src/actions.cairo b/examples/spawn-and-move/src/actions.cairo index 6b9156343b..6737cdea48 100644 --- a/examples/spawn-and-move/src/actions.cairo +++ b/examples/spawn-and-move/src/actions.cairo @@ -2,9 +2,11 @@ use dojo_examples::models::{Direction, Position, Vec2}; #[dojo::interface] trait IActions { - fn spawn(); - fn move(direction: Direction); - fn set_player_config(name: ByteArray); + fn spawn(ref world: IWorldDispatcher); + fn move(ref world: IWorldDispatcher, direction: Direction); + fn set_player_config(ref world: IWorldDispatcher, name: ByteArray); + fn get_player_position(world: @IWorldDispatcher) -> Position; + fn reset_player_config(ref world: IWorldDispatcher); } #[dojo::interface] @@ -61,22 +63,12 @@ mod actions { #[abi(embed_v0)] impl ActionsImpl of IActions { // ContractState is defined by system decorator expansion - fn spawn(world: IWorldDispatcher) { + fn spawn(ref world: IWorldDispatcher) { let player = get_caller_address(); - let position = get!(world, player, (Position)); - - set!( - world, - ( - Moves { player, remaining: 99, last_direction: Direction::None(()) }, - Position { - player, vec: Vec2 { x: position.vec.x + 10, y: position.vec.y + 10 } - }, - ) - ); + self.set_default_position(player, world); } - fn move(world: IWorldDispatcher, direction: Direction) { + fn move(ref world: IWorldDispatcher, direction: Direction) { let player = get_caller_address(); let (mut position, mut moves) = get!(world, player, (Position, Moves)); moves.remaining -= 1; @@ -86,7 +78,7 @@ mod actions { emit!(world, (Moved { player, direction })); } - fn set_player_config(world: IWorldDispatcher, name: ByteArray) { + fn set_player_config(ref world: IWorldDispatcher, name: ByteArray) { let player = get_caller_address(); let items = array![ @@ -97,6 +89,52 @@ mod actions { set!(world, (config)); } + + fn reset_player_config(ref world: IWorldDispatcher) { + let player = get_caller_address(); + + let (position, moves, config) = get!(world, player, (Position, Moves, PlayerConfig)); + + delete!(world, (position, moves, config)); + + let (position, moves, config) = get!(world, player, (Position, Moves, PlayerConfig)); + + assert(moves.remaining == 0, 'bad remaining'); + assert(moves.last_direction == Direction::None, 'bad last direction'); + + assert(position.vec.x == 0, 'bad x'); + assert(position.vec.y == 0, 'bad y'); + + assert(config.items.len() == 0, 'bad items'); + assert(config.favorite_item == Option::Some(0), 'bad favorite item'); + let empty_string: ByteArray = ""; + assert(config.name == empty_string, 'bad name'); + } + + fn get_player_position(world: @IWorldDispatcher) -> Position { + let player = get_caller_address(); + get!(world, player, (Position)) + } + } + + // The `generate_trait` attribute is not compatible with `world` parameter expansion. + // Hence, the use of `self` to access the contract state. + #[generate_trait] + impl InternalImpl of InternalUtils { + fn set_default_position( + self: @ContractState, player: ContractAddress, world: IWorldDispatcher + ) { + // The world is always accessible from `self` inside a `dojo::contract`. + // let world = self.world(); + + set!( + world, + ( + Moves { player, remaining: 99, last_direction: Direction::None }, + Position { player, vec: Vec2 { x: 10, y: 10 } }, + ) + ); + } } } @@ -123,7 +161,7 @@ mod tests { // deploy systems contract let contract_address = world - .deploy_contract('salt', actions::TEST_CLASS_HASH.try_into().unwrap()); + .deploy_contract('salt', actions::TEST_CLASS_HASH.try_into().unwrap(), array![].span()); let actions_system = IActionsDispatcher { contract_address }; // System calls diff --git a/examples/spawn-and-move/src/lib.cairo b/examples/spawn-and-move/src/lib.cairo index e3149f1627..b1273839ec 100644 --- a/examples/spawn-and-move/src/lib.cairo +++ b/examples/spawn-and-move/src/lib.cairo @@ -1,3 +1,5 @@ mod actions; mod models; mod utils; +mod others; +mod mock_token; diff --git a/examples/spawn-and-move/src/mock_token.cairo b/examples/spawn-and-move/src/mock_token.cairo new file mode 100644 index 0000000000..75b4c00e16 --- /dev/null +++ b/examples/spawn-and-move/src/mock_token.cairo @@ -0,0 +1,11 @@ +#[dojo::contract] +mod mock_token { + use dojo_examples::models::{MockToken}; + use starknet::{ContractAddress, get_caller_address}; + + fn dojo_init(world: @IWorldDispatcher) { + let account: ContractAddress = get_caller_address(); + + set!(world, MockToken { account: account, amount: 1000 }); + } +} diff --git a/examples/spawn-and-move/src/models.cairo b/examples/spawn-and-move/src/models.cairo index 635b9c312f..443c3a2e53 100644 --- a/examples/spawn-and-move/src/models.cairo +++ b/examples/spawn-and-move/src/models.cairo @@ -1,6 +1,6 @@ use starknet::ContractAddress; -#[derive(Serde, Copy, Drop, Introspect)] +#[derive(Serde, Copy, Drop, Introspect, PartialEq)] enum Direction { None, Left, @@ -21,21 +21,16 @@ impl DirectionIntoFelt252 of Into { } } -#[derive(Serde, Copy, Drop, Introspect)] -enum Emote { - None, - Happy, - Sad, - Angry, - Love, -} - -#[derive(Copy, Drop, Serde)] +#[derive(Drop, Serde)] #[dojo::model] -struct EmoteMessage { +struct Message { #[key] identity: ContractAddress, - emote: Emote, + #[key] + channel: felt252, + message: ByteArray, + #[key] + salt: felt252 } #[derive(Copy, Drop, Serde)] @@ -47,13 +42,25 @@ struct Moves { last_direction: Direction } -#[derive(Copy, Drop, Serde, Introspect)] +#[derive(Copy, Drop, Serde)] +#[dojo::model] +struct MockToken { + #[key] + account: ContractAddress, + amount: u128, +} + +#[derive(Copy, Drop, Serde, IntrospectPacked)] struct Vec2 { x: u32, y: u32 } -#[derive(Copy, Drop, Serde)] +// If `Vec2` wasn't packed, the `Position` would be invalid, +// and a runtime error would be thrown. +// Any field that is a custom type into a `IntrospectPacked` type +// must be packed. +#[derive(Copy, Drop, Serde, IntrospectPacked)] #[dojo::model] struct Position { #[key] @@ -61,6 +68,8 @@ struct Position { vec: Vec2, } +// Every field inside a model must derive `Introspect` or `IntrospectPacked`. +// `IntrospectPacked` can also be used into models that are only using `Introspect`. #[derive(Copy, Drop, Serde, Introspect)] struct PlayerItem { item_id: u32, diff --git a/examples/spawn-and-move/src/others.cairo b/examples/spawn-and-move/src/others.cairo new file mode 100644 index 0000000000..8b64df6a23 --- /dev/null +++ b/examples/spawn-and-move/src/others.cairo @@ -0,0 +1,31 @@ +#[dojo::contract] +mod others { + use starknet::{ContractAddress, ClassHash, get_caller_address}; + use dojo_examples::models::{Position, Moves, Direction, Vec2}; + use dojo_examples::utils::next_position; + + #[derive(Copy, Drop, Serde)] + #[dojo::event] + #[dojo::model] + struct ContractInitialized { + #[key] + contract_address: ContractAddress, + contract_class: ClassHash, + value: u8, + } + + + fn dojo_init( + world: @IWorldDispatcher, + actions_address: ContractAddress, + actions_class: ClassHash, + value: u8 + ) { + emit!( + world, + ContractInitialized { + contract_address: actions_address, contract_class: actions_class, value + } + ); + } +}