diff --git a/Cargo.lock b/Cargo.lock index 626b37d1e8..dc4b35dbe7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5,34 +5,31 @@ version = 4 [[package]] name = "account_sdk" version = "0.1.0" -source = "git+https://github.com/cartridge-gg/controller?rev=61d2fd0#61d2fd0cd856daa01b2da52b762368542c03da6f" +source = "git+https://github.com/cartridge-gg/controller?rev=05fe96f4#05fe96f46a81e45e98085b0d0bb263561c8af2a3" dependencies = [ + "alloy-primitives", + "alloy-signer", "anyhow", "async-trait", "auto_impl", - "base64 0.22.1", - "base64urlsafedata", - "cainome 0.2.3", - "coset", - "ecdsa", + "cainome 0.6.1", + "cainome-cairo-serde 0.2.0", + "chrono", "futures", - "gloo-net", "hex", "indexmap 2.7.1", "js-sys", "lazy_static", - "nom", "num-traits 0.2.19", - "p256", + "once_cell", "primitive-types", + "rand 0.8.5", "reqwest 0.11.27", "serde", "serde-wasm-bindgen", - "serde_cbor_2", "serde_json", "serde_with", - "sha2", - "starknet 0.12.0", + "starknet 0.14.0", "starknet-crypto 0.7.4", "starknet-types-core", "thiserror 1.0.63", @@ -46,7 +43,6 @@ dependencies = [ "wasm-bindgen-futures", "wasm-bindgen-test", "web-sys", - "webauthn-rs-proto", ] [[package]] @@ -82,7 +78,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", - "getrandom", + "getrandom 0.2.15", "once_cell", "version_check", "zerocopy", @@ -118,6 +114,58 @@ version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +[[package]] +name = "alloy-primitives" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c77490fe91a0ce933a1f219029521f20fc28c2c0ca95d53fa4da9c00b8d9d4e" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more", + "foldhash", + "hashbrown 0.15.2", + "indexmap 2.7.1", + "itoa", + "k256", + "keccak-asm", + "paste", + "proptest", + "rand 0.8.5", + "ruint", + "rustc-hash 2.1.1", + "serde", + "sha3", + "tiny-keccak", +] + +[[package]] +name = "alloy-rlp" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6c1d995bff8d011f7cd6c81820d51825e6e06d6db73914c1630ecf544d83d6" +dependencies = [ + "arrayvec 0.7.6", + "bytes", +] + +[[package]] +name = "alloy-signer" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c96fbde54bee943cd94ebacc8a62c50b38c7dfd2552dcd79ff61aea778b1bfcc" +dependencies = [ + "alloy-primitives", + "async-trait", + "auto_impl", + "either", + "elliptic-curve", + "k256", + "thiserror 2.0.11", +] + [[package]] name = "android-tzdata" version = "0.1.1" @@ -229,10 +277,10 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" dependencies = [ - "ark-ff", + "ark-ff 0.4.2", "ark-poly", - "ark-serialize", - "ark-std", + "ark-serialize 0.4.2", + "ark-std 0.4.0", "derivative", "hashbrown 0.13.2", "itertools 0.10.5", @@ -240,26 +288,54 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ark-ff" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" +dependencies = [ + "ark-ff-asm 0.3.0", + "ark-ff-macros 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "derivative", + "num-bigint", + "num-traits 0.2.19", + "paste", + "rustc_version 0.3.3", + "zeroize", +] + [[package]] name = "ark-ff" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" dependencies = [ - "ark-ff-asm", - "ark-ff-macros", - "ark-serialize", - "ark-std", + "ark-ff-asm 0.4.2", + "ark-ff-macros 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", "derivative", - "digest", + "digest 0.10.7", "itertools 0.10.5", "num-bigint", "num-traits 0.2.19", "paste", - "rustc_version", + "rustc_version 0.4.1", "zeroize", ] +[[package]] +name = "ark-ff-asm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" +dependencies = [ + "quote", + "syn 1.0.109", +] + [[package]] name = "ark-ff-asm" version = "0.4.2" @@ -270,6 +346,18 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ark-ff-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +dependencies = [ + "num-bigint", + "num-traits 0.2.19", + "quote", + "syn 1.0.109", +] + [[package]] name = "ark-ff-macros" version = "0.4.2" @@ -289,9 +377,9 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" dependencies = [ - "ark-ff", - "ark-serialize", - "ark-std", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", "derivative", "hashbrown 0.13.2", ] @@ -303,8 +391,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c02e954eaeb4ddb29613fee20840c2bbc85ca4396d53e33837e11905363c5f2" dependencies = [ "ark-ec", - "ark-ff", - "ark-std", + "ark-ff 0.4.2", + "ark-std 0.4.0", ] [[package]] @@ -314,8 +402,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3975a01b0a6e3eae0f72ec7ca8598a6620fc72fa5981f6f5cca33b7cd788f633" dependencies = [ "ark-ec", - "ark-ff", - "ark-std", + "ark-ff 0.4.2", + "ark-std 0.4.0", +] + +[[package]] +name = "ark-serialize" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" +dependencies = [ + "ark-std 0.3.0", + "digest 0.9.0", ] [[package]] @@ -325,8 +423,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" dependencies = [ "ark-serialize-derive", - "ark-std", - "digest", + "ark-std 0.4.0", + "digest 0.10.7", "num-bigint", ] @@ -341,6 +439,16 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ark-std" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +dependencies = [ + "num-traits 0.2.19", + "rand 0.8.5", +] + [[package]] name = "ark-std" version = "0.4.0" @@ -348,7 +456,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" dependencies = [ "num-traits 0.2.19", - "rand", + "rand 0.8.5", ] [[package]] @@ -737,16 +845,6 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" -[[package]] -name = "base64urlsafedata" -version = "0.5.0" -source = "git+https://github.com/cartridge-gg/webauthn-rs?rev=a6cea88#a6cea888b953382c6d0604bd08bbede195205140" -dependencies = [ - "base64 0.21.7", - "paste", - "serde", -] - [[package]] name = "bincode" version = "2.0.0-rc.3" @@ -785,7 +883,16 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" dependencies = [ - "bit-vec", + "bit-vec 0.6.3", +] + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec 0.8.0", ] [[package]] @@ -794,6 +901,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + [[package]] name = "bitflags" version = "1.3.2" @@ -934,22 +1047,24 @@ dependencies = [ [[package]] name = "cainome" -version = "0.2.3" -source = "git+https://github.com/cartridge-gg/cainome?tag=v0.4.2#4e3924fb82b7299d56d3619aa5d7b9863f581e0a" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ba516760bbf73cc71c4a7ba07663b0a7d0f3882f011b28d87b25fbd17bf77f1" dependencies = [ "anyhow", "async-trait", - "cainome-cairo-serde 0.1.0 (git+https://github.com/cartridge-gg/cainome?tag=v0.4.2)", - "cainome-parser 0.1.0 (git+https://github.com/cartridge-gg/cainome?tag=v0.4.2)", - "cainome-rs 0.1.0 (git+https://github.com/cartridge-gg/cainome?tag=v0.4.2)", - "cainome-rs-macro 0.1.0 (git+https://github.com/cartridge-gg/cainome?tag=v0.4.2)", + "cainome-cairo-serde 0.1.0", + "cainome-cairo-serde-derive", + "cainome-parser 0.1.0", + "cainome-rs 0.1.0", + "cainome-rs-macro 0.1.0", "camino", "clap", "clap_complete", "convert_case 0.6.0", "serde", "serde_json", - "starknet 0.12.0", + "starknet 0.13.0", "starknet-types-core", "thiserror 1.0.63", "tracing", @@ -959,24 +1074,24 @@ dependencies = [ [[package]] name = "cainome" -version = "0.5.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ba516760bbf73cc71c4a7ba07663b0a7d0f3882f011b28d87b25fbd17bf77f1" +checksum = "1e04a357fdab01f56b676c8c41e11b154bb69eef184204cae47a4209eb4e0035" dependencies = [ "anyhow", "async-trait", - "cainome-cairo-serde 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cainome-cairo-serde 0.2.0", "cainome-cairo-serde-derive", - "cainome-parser 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cainome-rs 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cainome-rs-macro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cainome-parser 0.2.0", + "cainome-rs 0.2.0", + "cainome-rs-macro 0.2.0", "camino", "clap", "clap_complete", "convert_case 0.6.0", "serde", "serde_json", - "starknet 0.13.0", + "starknet 0.14.0", "starknet-types-core", "thiserror 1.0.63", "tracing", @@ -999,11 +1114,14 @@ dependencies = [ [[package]] name = "cainome-cairo-serde" -version = "0.1.0" -source = "git+https://github.com/cartridge-gg/cainome?tag=v0.4.2#4e3924fb82b7299d56d3619aa5d7b9863f581e0a" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32790b9d4293a5ee97e4c646e2d40c186f6d2e0f5f9141e46bf187446bf4883f" dependencies = [ + "num-bigint", "serde", - "starknet 0.12.0", + "serde_with", + "starknet 0.14.0", "thiserror 1.0.63", ] @@ -1035,13 +1153,14 @@ dependencies = [ [[package]] name = "cainome-parser" -version = "0.1.0" -source = "git+https://github.com/cartridge-gg/cainome?tag=v0.4.2#4e3924fb82b7299d56d3619aa5d7b9863f581e0a" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "499219c70d1382b5f7defc6985b0266fb10b27b91dc4e8b0b0e4a10258e5d292" dependencies = [ "convert_case 0.6.0", "quote", "serde_json", - "starknet 0.12.0", + "starknet 0.14.0", "syn 2.0.90", "thiserror 1.0.63", ] @@ -1053,8 +1172,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0e16da812c3df59d3093df7dd7cfe7fd1ff051c870aae3807dee2180c511557" dependencies = [ "anyhow", - "cainome-cairo-serde 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cainome-parser 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cainome-cairo-serde 0.1.0", + "cainome-parser 0.1.0", "camino", "prettyplease", "proc-macro2", @@ -1067,18 +1186,19 @@ dependencies = [ [[package]] name = "cainome-rs" -version = "0.1.0" -source = "git+https://github.com/cartridge-gg/cainome?tag=v0.4.2#4e3924fb82b7299d56d3619aa5d7b9863f581e0a" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67adae2e76aeb14e514dcda34092c86170e0f84843727b1ad8e2b7398b3e0b56" dependencies = [ "anyhow", - "cainome-cairo-serde 0.1.0 (git+https://github.com/cartridge-gg/cainome?tag=v0.4.2)", - "cainome-parser 0.1.0 (git+https://github.com/cartridge-gg/cainome?tag=v0.4.2)", + "cainome-cairo-serde 0.2.0", + "cainome-parser 0.2.0", "camino", "prettyplease", "proc-macro2", "quote", "serde_json", - "starknet 0.12.0", + "starknet 0.14.0", "syn 2.0.90", "thiserror 1.0.63", ] @@ -1090,9 +1210,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71009b935b7b3056c8032c2369d022beb629ea903f167e37bff0a2c84dd43675" dependencies = [ "anyhow", - "cainome-cairo-serde 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cainome-parser 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cainome-rs 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cainome-cairo-serde 0.1.0", + "cainome-parser 0.1.0", + "cainome-rs 0.1.0", "proc-macro-error", "proc-macro2", "quote", @@ -1104,18 +1224,19 @@ dependencies = [ [[package]] name = "cainome-rs-macro" -version = "0.1.0" -source = "git+https://github.com/cartridge-gg/cainome?tag=v0.4.2#4e3924fb82b7299d56d3619aa5d7b9863f581e0a" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c4e39d654e8e5c94f31a59ae8583771abbd784f96215dae1d1592f1b7526b2" dependencies = [ "anyhow", - "cainome-cairo-serde 0.1.0 (git+https://github.com/cartridge-gg/cainome?tag=v0.4.2)", - "cainome-parser 0.1.0 (git+https://github.com/cartridge-gg/cainome?tag=v0.4.2)", - "cainome-rs 0.1.0 (git+https://github.com/cartridge-gg/cainome?tag=v0.4.2)", + "cainome-cairo-serde 0.2.0", + "cainome-parser 0.2.0", + "cainome-rs 0.2.0", "proc-macro-error", "proc-macro2", "quote", "serde_json", - "starknet 0.12.0", + "starknet 0.14.0", "syn 2.0.90", "thiserror 1.0.63", ] @@ -1155,7 +1276,7 @@ dependencies = [ "indoc", "rayon", "rust-analyzer-salsa", - "semver", + "semver 1.0.23", "smol_str", "thiserror 1.0.63", ] @@ -1244,7 +1365,7 @@ dependencies = [ "cairo-lang-utils", "path-clean", "rust-analyzer-salsa", - "semver", + "semver 1.0.23", "serde", "smol_str", "toml 0.8.19", @@ -1417,7 +1538,7 @@ version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e23ba8c8ade9c4f51d4fe4a350b86e132872eb168514184fff3139c163066d1b" dependencies = [ - "ark-ff", + "ark-ff 0.4.2", "ark-secp256k1", "ark-secp256r1", "cairo-lang-casm", @@ -1434,7 +1555,7 @@ dependencies = [ "num-bigint", "num-integer", "num-traits 0.2.19", - "rand", + "rand 0.8.5", "sha2", "smol_str", "starknet-types-core", @@ -1783,7 +1904,7 @@ dependencies = [ "num-integer", "num-prime", "num-traits 0.2.19", - "rand", + "rand 0.8.5", "rust_decimal", "serde", "serde_json", @@ -1821,7 +1942,7 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver", + "semver 1.0.23", "serde", "serde_json", "thiserror 1.0.63", @@ -1880,33 +2001,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half 2.4.1", -] - [[package]] name = "cipher" version = "0.4.4" @@ -2065,7 +2159,7 @@ dependencies = [ "http 0.2.12", "mime", "mime_guess", - "rand", + "rand 0.8.5", "thiserror 1.0.63", ] @@ -2107,6 +2201,19 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32b13ea120a812beba79e34316b3942a857c86ec1593cb34f27bb28272ce2cca" +[[package]] +name = "const-hex" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b0485bab839b018a8f1723fc5391819fea5f8f0f32288ef8a735fd096b6160c" +dependencies = [ + "cfg-if", + "cpufeatures", + "hex", + "proptest", + "serde", +] + [[package]] name = "const-oid" version = "0.9.6" @@ -2192,16 +2299,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "coset" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8cc80f631f8307b887faca24dcc3abc427cd0367f6eb6188f6e8f5b7ad8fb" -dependencies = [ - "ciborium", - "ciborium-io", -] - [[package]] name = "cpufeatures" version = "0.2.14" @@ -2302,7 +2399,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core", + "rand_core 0.6.4", "serdect", "subtle", "zeroize", @@ -2483,6 +2580,27 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", + "unicode-xid", +] + [[package]] name = "dialoguer" version = "0.11.0" @@ -2517,6 +2635,15 @@ dependencies = [ "nu-ansi-term", ] +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + [[package]] name = "digest" version = "0.10.7" @@ -2613,7 +2740,7 @@ dependencies = [ "anyhow", "assert_matches", "async-trait", - "cainome 0.5.0", + "cainome 0.6.1", "camino", "chrono", "convert_case 0.6.0", @@ -2624,7 +2751,7 @@ dependencies = [ "serde", "serde_json", "sozo-scarbext", - "starknet 0.12.0", + "starknet 0.14.0", "thiserror 1.0.63", "tokio", ] @@ -2654,7 +2781,7 @@ dependencies = [ "regex", "serde", "smol_str", - "starknet 0.12.0", + "starknet 0.14.0", "starknet-crypto 0.7.4", "tracing", ] @@ -2723,7 +2850,7 @@ name = "dojo-types" version = "1.5.0-alpha.2" dependencies = [ "anyhow", - "cainome 0.5.0", + "cainome 0.6.1", "crypto-bigint", "hex", "indexmap 2.7.1", @@ -2732,7 +2859,7 @@ dependencies = [ "regex", "serde", "serde_json", - "starknet 0.12.0", + "starknet 0.14.0", "starknet-crypto 0.7.4", "strum", "strum_macros", @@ -2774,7 +2901,7 @@ dependencies = [ "reqwest 0.11.27", "rpassword", "serde_json", - "starknet 0.12.0", + "starknet 0.14.0", "thiserror 1.0.63", "tokio", "tracing", @@ -2786,7 +2913,7 @@ version = "1.5.0-alpha.2" dependencies = [ "anyhow", "async-trait", - "cainome 0.5.0", + "cainome 0.6.1", "cairo-lang-starknet-classes", "dojo-types 1.5.0-alpha.2", "futures", @@ -2798,7 +2925,7 @@ dependencies = [ "serde", "serde_json", "serde_with", - "starknet 0.12.0", + "starknet 0.14.0", "starknet-crypto 0.7.4", "thiserror 1.0.63", "tokio", @@ -2812,7 +2939,7 @@ name = "dojo-world-abigen" version = "1.5.0-alpha.2" dependencies = [ "anyhow", - "cainome 0.5.0", + "cainome 0.6.1", "cairo-lang-starknet", "cairo-lang-starknet-classes", "camino", @@ -2847,7 +2974,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", - "digest", + "digest 0.10.7", "elliptic-curve", "rfc6979", "signature", @@ -2856,9 +2983,9 @@ dependencies = [ [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" dependencies = [ "serde", ] @@ -2871,13 +2998,12 @@ checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", - "digest", + "digest 0.10.7", "ff", "generic-array", "group", - "pem-rfc7468", "pkcs8", - "rand_core", + "rand_core 0.6.4", "sec1", "subtle", "zeroize", @@ -2987,11 +3113,11 @@ checksum = "1fda3bf123be441da5260717e0661c25a2fd9cb2b2c1d20bf2e05580047158ab" dependencies = [ "aes", "ctr", - "digest", + "digest 0.10.7", "hex", "hmac", "pbkdf2", - "rand", + "rand 0.8.5", "scrypt", "serde", "serde_json", @@ -3076,13 +3202,35 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +[[package]] +name = "fastrlp" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" +dependencies = [ + "arrayvec 0.7.6", + "auto_impl", + "bytes", +] + +[[package]] +name = "fastrlp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce8dba4714ef14b8274c371879b175aa55b16b30f269663f19d576f380018dc4" +dependencies = [ + "arrayvec 0.7.6", + "auto_impl", + "bytes", +] + [[package]] name = "ff" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -3105,7 +3253,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", - "rand", + "rand 0.8.5", "rustc-hex", "static_assertions", ] @@ -3383,10 +3531,22 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "wasm-bindgen", ] +[[package]] +name = "getrandom" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.13.3+wasi-0.2.2", + "windows-targets 0.52.6", +] + [[package]] name = "gimli" version = "0.31.0" @@ -4226,27 +4386,6 @@ dependencies = [ "walkdir", ] -[[package]] -name = "gloo-net" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06f627b1a58ca3d42b45d6104bf1e1a03799df472df00988b6ba21accc10580" -dependencies = [ - "futures-channel", - "futures-core", - "futures-sink", - "gloo-utils", - "http 1.1.0", - "js-sys", - "pin-project", - "serde", - "serde_json", - "thiserror 1.0.63", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - [[package]] name = "gloo-timers" version = "0.3.0" @@ -4347,7 +4486,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -4390,32 +4529,16 @@ dependencies = [ ] [[package]] -name = "half" -version = "1.8.3" +name = "hashbrown" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] -name = "half" -version = "2.4.1" +name = "hashbrown" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ "ahash", ] @@ -4436,6 +4559,9 @@ name = "hashbrown" version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "foldhash", +] [[package]] name = "hashlink" @@ -4497,7 +4623,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest", + "digest 0.10.7", ] [[package]] @@ -5181,6 +5307,19 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "k256" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "once_cell", + "sha2", +] + [[package]] name = "katana-node-bindings" version = "1.2.3" @@ -5197,8 +5336,8 @@ dependencies = [ [[package]] name = "katana-node-bindings" -version = "1.5.0-alpha.2" -source = "git+https://github.com/dojoengine/katana#fb99349294fd002a5db42cecc125a85810673fdd" +version = "1.5.0-alpha.4" +source = "git+https://github.com/dojoengine/katana#498e17aa89b126f7ed4eef75b13627d1a2900df5" dependencies = [ "regex", "serde", @@ -5224,13 +5363,13 @@ dependencies = [ [[package]] name = "katana-runner" -version = "1.5.0-alpha.2" -source = "git+https://github.com/dojoengine/katana#fb99349294fd002a5db42cecc125a85810673fdd" +version = "1.5.0-alpha.4" +source = "git+https://github.com/dojoengine/katana#498e17aa89b126f7ed4eef75b13627d1a2900df5" dependencies = [ "anyhow", "assert_fs", - "katana-node-bindings 1.5.0-alpha.2", - "katana-runner-macro 1.5.0-alpha.2", + "katana-node-bindings 1.5.0-alpha.4", + "katana-runner-macro 1.5.0-alpha.4", "starknet 0.12.0", "tokio", ] @@ -5247,8 +5386,8 @@ dependencies = [ [[package]] name = "katana-runner-macro" -version = "1.5.0-alpha.2" -source = "git+https://github.com/dojoengine/katana#fb99349294fd002a5db42cecc125a85810673fdd" +version = "1.5.0-alpha.4" +source = "git+https://github.com/dojoengine/katana#498e17aa89b126f7ed4eef75b13627d1a2900df5" dependencies = [ "proc-macro2", "quote", @@ -5264,6 +5403,16 @@ dependencies = [ "cpufeatures", ] +[[package]] +name = "keccak-asm" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "505d1856a39b200489082f90d897c3f07c455563880bc5952e38eabf731c83b6" +dependencies = [ + "digest 0.10.7", + "sha3-asm", +] + [[package]] name = "kqueue" version = "1.0.8" @@ -5309,7 +5458,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55cb077ad656299f160924eb2912aa147d7339ea7d69e1b5517326fdcec3c1ca" dependencies = [ "ascii-canvas", - "bit-set", + "bit-set 0.5.3", "ena", "itertools 0.11.0", "lalrpop-util", @@ -5372,9 +5521,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.158" +version = "0.2.172" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" [[package]] name = "libloading" @@ -5545,7 +5694,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ "cfg-if", - "digest", + "digest 0.10.7", ] [[package]] @@ -5716,7 +5865,7 @@ dependencies = [ "hermit-abi 0.3.9", "libc", "log", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", ] @@ -5906,7 +6055,7 @@ checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", "num-traits 0.2.19", - "rand", + "rand 0.8.5", "serde", ] @@ -5922,7 +6071,7 @@ dependencies = [ "num-integer", "num-iter", "num-traits 0.2.19", - "rand", + "rand 0.8.5", "smallvec", "zeroize", ] @@ -5987,7 +6136,7 @@ dependencies = [ "num-integer", "num-modular", "num-traits 0.2.19", - "rand", + "rand 0.8.5", ] [[package]] @@ -6158,18 +6307,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" -[[package]] -name = "p256" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" -dependencies = [ - "ecdsa", - "elliptic-curve", - "primeorder", - "sha2", -] - [[package]] name = "papergrid" version = "0.12.0" @@ -6245,7 +6382,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" dependencies = [ "base64ct", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -6285,7 +6422,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ - "digest", + "digest 0.10.7", "hmac", "password-hash", "sha2", @@ -6306,6 +6443,17 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +[[package]] +name = "pest" +version = "2.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdbef9d1d47087a895abd220ed25eb4ad973a5e26f6a4367b038c25e28dfc2d9" +dependencies = [ + "memchr", + "thiserror 1.0.63", + "ucd-trie", +] + [[package]] name = "petgraph" version = "0.6.5" @@ -6516,15 +6664,6 @@ dependencies = [ "syn 2.0.90", ] -[[package]] -name = "primeorder" -version = "0.13.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" -dependencies = [ - "elliptic-curve", -] - [[package]] name = "primitive-types" version = "0.12.2" @@ -6634,6 +6773,26 @@ dependencies = [ "human_format", ] +[[package]] +name = "proptest" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14cae93065090804185d3b75f0bf93b8eeda30c7a9b4a33d3bdb3988d6229e50" +dependencies = [ + "bit-set 0.8.0", + "bit-vec 0.8.0", + "bitflags 2.6.0", + "lazy_static", + "num-traits 0.2.19", + "rand 0.8.5", + "rand_chacha 0.3.1", + "rand_xorshift", + "regex-syntax 0.8.4", + "rusty-fork", + "tempfile", + "unarray", +] + [[package]] name = "pubgrub" version = "0.2.1" @@ -6642,7 +6801,7 @@ dependencies = [ "indexmap 2.7.1", "log", "priority-queue", - "rustc-hash 2.0.0", + "rustc-hash 2.1.1", "thiserror 1.0.63", "version-ranges", ] @@ -6657,11 +6816,17 @@ dependencies = [ "libc", "once_cell", "raw-cpuid", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "web-sys", "winapi", ] +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + [[package]] name = "quinn" version = "0.11.5" @@ -6672,7 +6837,7 @@ dependencies = [ "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash 2.0.0", + "rustc-hash 2.1.1", "rustls 0.23.13", "socket2 0.5.7", "thiserror 1.0.63", @@ -6687,9 +6852,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" dependencies = [ "bytes", - "rand", + "rand 0.8.5", "ring 0.17.8", - "rustc-hash 2.0.0", + "rustc-hash 2.1.1", "rustls 0.23.13", "slab", "thiserror 1.0.63", @@ -6752,8 +6917,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha", - "rand_core", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.3", ] [[package]] @@ -6763,7 +6938,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.3", ] [[package]] @@ -6772,7 +6957,25 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.15", +] + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.1", +] + +[[package]] +name = "rand_xorshift" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +dependencies = [ + "rand_core 0.6.4", ] [[package]] @@ -6840,7 +7043,7 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "getrandom", + "getrandom 0.2.15", "libredox", "thiserror 1.0.63", ] @@ -7028,7 +7231,7 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if", - "getrandom", + "getrandom 0.2.15", "libc", "spin 0.9.8", "untrusted 0.9.0", @@ -7072,13 +7275,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" dependencies = [ "const-oid", - "digest", + "digest 0.10.7", "num-bigint-dig", "num-integer", "num-traits 0.2.19", "pkcs1", "pkcs8", - "rand_core", + "rand_core 0.6.4", "signature", "spki", "subtle", @@ -7095,6 +7298,39 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "ruint" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78a46eb779843b2c4f21fac5773e25d6d5b7c8f0922876c91541790d2ca27eef" +dependencies = [ + "alloy-rlp", + "ark-ff 0.3.0", + "ark-ff 0.4.2", + "bytes", + "fastrlp 0.3.1", + "fastrlp 0.4.0", + "num-bigint", + "num-integer", + "num-traits 0.2.19", + "parity-scale-codec", + "primitive-types", + "proptest", + "rand 0.8.5", + "rand 0.9.1", + "rlp", + "ruint-macro", + "serde", + "valuable", + "zeroize", +] + +[[package]] +name = "ruint-macro" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" + [[package]] name = "rust-analyzer-salsa" version = "0.17.0-pre.6" @@ -7148,9 +7384,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc-hash" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" [[package]] name = "rustc-hex" @@ -7158,13 +7394,22 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + [[package]] name = "rustc_version" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver", + "semver 1.0.23", ] [[package]] @@ -7312,6 +7557,18 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +[[package]] +name = "rusty-fork" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + [[package]] name = "ryu" version = "1.0.18" @@ -7401,7 +7658,7 @@ dependencies = [ "scarb-proc-macro-server-types", "scarb-stable-hash 1.0.0 (git+https://github.com/remybar/scarb?rev=bf0b4448a1977e1fb74c6ad31022320d63edfd57)", "scarb-ui", - "semver", + "semver 1.0.23", "semver-pubgrub", "serde", "serde-untagged", @@ -7444,7 +7701,7 @@ source = "git+https://github.com/remybar/scarb?rev=bf0b4448a1977e1fb74c6ad310223 dependencies = [ "camino", "derive_builder", - "semver", + "semver 1.0.23", "serde", "serde_json", "thiserror 2.0.11", @@ -7600,6 +7857,15 @@ dependencies = [ "libc", ] +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + [[package]] name = "semver" version = "1.0.23" @@ -7609,13 +7875,22 @@ dependencies = [ "serde", ] +[[package]] +name = "semver-parser" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" +dependencies = [ + "pest", +] + [[package]] name = "semver-pubgrub" version = "0.1.0" source = "git+https://github.com/software-mansion-labs/semver-pubgrub.git#6c78141d940cda6d8e69aea794c2bf30cc3402df" dependencies = [ "pubgrub", - "semver", + "semver 1.0.23", ] [[package]] @@ -7659,16 +7934,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "serde_cbor_2" -version = "0.12.0-dev" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b46d75f449e01f1eddbe9b00f432d616fbbd899b809c837d0fbc380496a0dd55" -dependencies = [ - "half 1.8.3", - "serde", -] - [[package]] name = "serde_derive" version = "1.0.217" @@ -7693,9 +7958,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.133" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", "memchr", @@ -7804,7 +8069,7 @@ checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", - "digest", + "digest 0.10.7", ] [[package]] @@ -7821,7 +8086,7 @@ checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", - "digest", + "digest 0.10.7", ] [[package]] @@ -7830,10 +8095,20 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" dependencies = [ - "digest", + "digest 0.10.7", "keccak", ] +[[package]] +name = "sha3-asm" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28efc5e327c837aa837c59eae585fc250715ef939ac32881bcc11677cd02d46" +dependencies = [ + "cc", + "cfg-if", +] + [[package]] name = "sharded-slab" version = "0.1.7" @@ -7880,8 +8155,8 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "digest", - "rand_core", + "digest 0.10.7", + "rand_core 0.6.4", ] [[package]] @@ -7890,6 +8165,12 @@ version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +[[package]] +name = "size-of" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4e36eca171fddeda53901b0a436573b3f2391eaa9189d439b2bd8ea8cebd7e3" + [[package]] name = "sketches-ddsketch" version = "0.2.2" @@ -7907,20 +8188,22 @@ dependencies = [ [[package]] name = "slot" -version = "0.18.0" -source = "git+https://github.com/cartridge-gg/slot?rev=1298a30#1298a302db76767e28af5cbce842acdfb507bb29" +version = "0.39.3" +source = "git+https://github.com/cartridge-gg/slot?rev=adac33e#adac33ec683cca888ed9a5f449531b5467a84667" dependencies = [ "account_sdk", "anyhow", "axum", "base64 0.22.1", + "cainome-cairo-serde 0.2.0", "dirs 5.0.1", "graphql_client", "hyper 1.4.1", + "num-bigint", "reqwest 0.12.7", "serde", "serde_json", - "starknet 0.12.0", + "starknet 0.14.0", "tempfile", "thiserror 1.0.63", "tokio", @@ -7975,7 +8258,7 @@ version = "1.5.0-alpha.2" dependencies = [ "anyhow", "async-trait", - "cainome 0.5.0", + "cainome 0.6.1", "cairo-lang-sierra", "cairo-lang-test-plugin", "cairo-lang-test-runner", @@ -7995,7 +8278,7 @@ dependencies = [ "scarb", "scarb-metadata", "scarb-ui", - "semver", + "semver 1.0.23", "serde", "serde_json", "slot", @@ -8003,7 +8286,7 @@ dependencies = [ "sozo-ops", "sozo-scarbext", "sozo-walnut", - "starknet 0.12.0", + "starknet 0.14.0", "starknet-crypto 0.7.4", "tabled", "thiserror 1.0.63", @@ -8022,7 +8305,7 @@ dependencies = [ "anyhow", "assert_fs", "async-trait", - "cainome 0.5.0", + "cainome 0.6.1", "colored", "colored_json", "dojo-test-utils", @@ -8039,7 +8322,7 @@ dependencies = [ "sozo-scarbext", "sozo-walnut", "spinoff", - "starknet 0.12.0", + "starknet 0.14.0", "starknet-crypto 0.7.4", "thiserror 1.0.63", "tokio", @@ -8065,7 +8348,7 @@ name = "sozo-signers" version = "1.5.0-alpha.2" dependencies = [ "anyhow", - "starknet 0.12.0", + "starknet 0.14.0", ] [[package]] @@ -8081,7 +8364,7 @@ dependencies = [ "scarb-ui", "serde", "serde_json", - "starknet 0.12.0", + "starknet 0.14.0", "thiserror 1.0.63", "toml 0.8.19", "url", @@ -8255,7 +8538,7 @@ dependencies = [ "bytes", "chrono", "crc", - "digest", + "digest 0.10.7", "dotenvy", "either", "futures-channel", @@ -8272,7 +8555,7 @@ dependencies = [ "memchr", "once_cell", "percent-encoding", - "rand", + "rand 0.8.5", "rsa", "serde", "sha1", @@ -8313,7 +8596,7 @@ dependencies = [ "md-5", "memchr", "once_cell", - "rand", + "rand 0.8.5", "serde", "serde_json", "sha2", @@ -8366,11 +8649,11 @@ checksum = "6f0c9ac3809cc7630784e8c8565fa3013af819d83c97aa2720d566016d439011" dependencies = [ "starknet-accounts 0.11.0", "starknet-contract 0.11.0", - "starknet-core", + "starknet-core 0.12.1", "starknet-crypto 0.7.4", "starknet-macros", - "starknet-providers", - "starknet-signers", + "starknet-providers 0.12.1", + "starknet-signers 0.10.2", ] [[package]] @@ -8381,12 +8664,28 @@ checksum = "bc9b221c99a1ea1d65fb130e5b0dbaa6d362698430232902ebeb2a898a1ab531" dependencies = [ "starknet-accounts 0.12.0", "starknet-contract 0.12.0", - "starknet-core", + "starknet-core 0.12.1", "starknet-core-derive", "starknet-crypto 0.7.4", "starknet-macros", - "starknet-providers", - "starknet-signers", + "starknet-providers 0.12.1", + "starknet-signers 0.10.2", +] + +[[package]] +name = "starknet" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61e2e53e7705c9a9aad7f118a4bac7386afeb8db272b3eb445a464ca4c3dfee5" +dependencies = [ + "starknet-accounts 0.13.0", + "starknet-contract 0.13.0", + "starknet-core 0.13.0", + "starknet-core-derive", + "starknet-crypto 0.7.4", + "starknet-macros", + "starknet-providers 0.13.0", + "starknet-signers 0.11.0", ] [[package]] @@ -8397,10 +8696,10 @@ checksum = "0ee27ded58ade61da410fccafd57ed5429b0e79a9d62a4ae8b65818cb9d6f400" dependencies = [ "async-trait", "auto_impl", - "starknet-core", + "starknet-core 0.12.1", "starknet-crypto 0.7.4", - "starknet-providers", - "starknet-signers", + "starknet-providers 0.12.1", + "starknet-signers 0.10.2", "thiserror 1.0.63", ] @@ -8412,10 +8711,25 @@ checksum = "b3fc4364f5684e4a5dcb100847a9ea023deae3815f45526721a6fa94ab595651" dependencies = [ "async-trait", "auto_impl", - "starknet-core", + "starknet-core 0.12.1", + "starknet-crypto 0.7.4", + "starknet-providers 0.12.1", + "starknet-signers 0.10.2", + "thiserror 1.0.63", +] + +[[package]] +name = "starknet-accounts" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eca52534db01eda3bf3250f398bd4597aed3856d0d17d84070efbc7919abad71" +dependencies = [ + "async-trait", + "auto_impl", + "starknet-core 0.13.0", "starknet-crypto 0.7.4", - "starknet-providers", - "starknet-signers", + "starknet-providers 0.13.0", + "starknet-signers 0.11.0", "thiserror 1.0.63", ] @@ -8429,8 +8743,8 @@ dependencies = [ "serde_json", "serde_with", "starknet-accounts 0.11.0", - "starknet-core", - "starknet-providers", + "starknet-core 0.12.1", + "starknet-providers 0.12.1", "thiserror 1.0.63", ] @@ -8444,8 +8758,23 @@ dependencies = [ "serde_json", "serde_with", "starknet-accounts 0.12.0", - "starknet-core", - "starknet-providers", + "starknet-core 0.12.1", + "starknet-providers 0.12.1", + "thiserror 1.0.63", +] + +[[package]] +name = "starknet-contract" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67d8d5a5306527eedcb4bd70afecfc6824add631a08eac8fd1cf9c2bdfd21e77" +dependencies = [ + "serde", + "serde_json", + "serde_with", + "starknet-accounts 0.13.0", + "starknet-core 0.13.0", + "starknet-providers 0.13.0", "thiserror 1.0.63", ] @@ -8472,6 +8801,29 @@ dependencies = [ "starknet-types-core", ] +[[package]] +name = "starknet-core" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b53a16799e4a75173839d868a1a48ff5d3e10456febd4dec91b04ba6521741d5" +dependencies = [ + "base64 0.21.7", + "crypto-bigint", + "flate2", + "foldhash", + "hex", + "indexmap 2.7.1", + "num-traits 0.2.19", + "serde", + "serde_json", + "serde_json_pythonic", + "serde_with", + "sha3", + "starknet-core-derive", + "starknet-crypto 0.7.4", + "starknet-types-core", +] + [[package]] name = "starknet-core-derive" version = "0.1.0" @@ -8557,19 +8909,19 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7abf1b44ec5b18d87c1ae5f54590ca9d0699ef4dd5b2ffa66fc97f24613ec585" dependencies = [ - "ark-ff", + "ark-ff 0.4.2", "crypto-bigint", - "getrandom", + "getrandom 0.2.15", "hex", ] [[package]] name = "starknet-macros" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8986a940af916fc0a034f4e42c6ba76d94f1e97216d75447693dfd7aefaf3ef2" +checksum = "bb14b6714e7625aca063e91022e574ee0bca863df98071dd7191e24919a367b0" dependencies = [ - "starknet-core", + "starknet-core 0.13.0", "syn 2.0.90", ] @@ -8583,13 +8935,34 @@ dependencies = [ "auto_impl", "ethereum-types", "flate2", - "getrandom", + "getrandom 0.2.15", + "log", + "reqwest 0.11.27", + "serde", + "serde_json", + "serde_with", + "starknet-core 0.12.1", + "thiserror 1.0.63", + "url", +] + +[[package]] +name = "starknet-providers" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c74c3850a661fa1ffd3c3e2cb9db6e28c94ab9aaaa0496503014a814f09cd455" +dependencies = [ + "async-trait", + "auto_impl", + "ethereum-types", + "flate2", + "getrandom 0.2.15", "log", "reqwest 0.11.27", "serde", "serde_json", "serde_with", - "starknet-core", + "starknet-core 0.13.0", "thiserror 1.0.63", "url", ] @@ -8604,18 +8977,35 @@ dependencies = [ "auto_impl", "crypto-bigint", "eth-keystore", - "getrandom", - "rand", - "starknet-core", + "getrandom 0.2.15", + "rand 0.8.5", + "starknet-core 0.12.1", + "starknet-crypto 0.7.4", + "thiserror 1.0.63", +] + +[[package]] +name = "starknet-signers" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2aeca13b8c61165b69d4775880d74ff9bbb9bafa36a297899e0f160619631b3" +dependencies = [ + "async-trait", + "auto_impl", + "crypto-bigint", + "eth-keystore", + "getrandom 0.2.15", + "rand 0.8.5", + "starknet-core 0.13.0", "starknet-crypto 0.7.4", "thiserror 1.0.63", ] [[package]] name = "starknet-types-core" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa1b9e01ccb217ab6d475c5cda05dbb22c30029f7bb52b192a010a00d77a3d74" +checksum = "4037bcb26ce7c508448d221e570d075196fd4f6912ae6380981098937af9522a" dependencies = [ "lambdaworks-crypto", "lambdaworks-math", @@ -8624,6 +9014,8 @@ dependencies = [ "num-integer", "num-traits 0.2.19", "serde", + "size-of", + "zeroize", ] [[package]] @@ -9329,6 +9721,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ucd-trie" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" + [[package]] name = "uint" version = "0.9.5" @@ -9350,6 +9748,12 @@ dependencies = [ "arrayvec 0.7.6", ] +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + [[package]] name = "unescaper" version = "0.1.5" @@ -9499,7 +9903,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "getrandom", + "getrandom 0.2.15", "serde", ] @@ -9534,7 +9938,7 @@ dependencies = [ "clap", "num-traits 0.2.19", "sqlx", - "starknet 0.12.0", + "starknet 0.14.0", "tokio", "tracing", "tracing-subscriber", @@ -9581,6 +9985,15 @@ dependencies = [ "quote", ] +[[package]] +name = "wait-timeout" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" +dependencies = [ + "libc", +] + [[package]] name = "waker-fn" version = "1.2.0" @@ -9612,6 +10025,15 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasi" +version = "0.13.3+wasi-0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +dependencies = [ + "wit-bindgen-rt", +] + [[package]] name = "wasite" version = "0.1.0" @@ -9737,18 +10159,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webauthn-rs-proto" -version = "0.5.0" -source = "git+https://github.com/cartridge-gg/webauthn-rs?rev=a6cea88#a6cea888b953382c6d0604bd08bbede195205140" -dependencies = [ - "base64 0.21.7", - "base64urlsafedata", - "serde", - "serde_json", - "url", -] - [[package]] name = "webbrowser" version = "0.8.15" @@ -10187,6 +10597,15 @@ version = "0.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" +[[package]] +name = "wit-bindgen-rt" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +dependencies = [ + "bitflags 2.6.0", +] + [[package]] name = "wyz" version = "0.5.1" @@ -10230,12 +10649,12 @@ dependencies = [ "dojo-test-utils", "dojo-utils", "dojo-world", - "katana-runner 1.5.0-alpha.2", + "katana-runner 1.5.0-alpha.4", "reqwest 0.11.27", "scarb", "sozo-ops", "sozo-scarbext", - "starknet 0.12.0", + "starknet 0.14.0", "tokio", ] diff --git a/Cargo.toml b/Cargo.toml index ac7b085144..cc17a20110 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,8 +41,8 @@ debug = true inherits = "release" [workspace.dependencies] -cainome = { version = "0.5.0", features = [ "abigen-rs" ] } -cainome-cairo-serde = { version = "0.1.0" } +cainome = { version = "0.6.1", features = [ "abigen-rs" ] } +cainome-cairo-serde = { version = "0.2.0" } dojo-utils = { path = "crates/dojo/utils" } @@ -66,13 +66,13 @@ torii-client = { path = "crates/torii/client" } torii-graphql = { path = "crates/torii/graphql" } torii-grpc = { path = "crates/torii/grpc" } torii-indexer = { path = "crates/torii/indexer" } +torii-mcp = { path = "crates/torii/mcp" } torii-relay = { path = "crates/torii/libp2p" } torii-runner = { path = "crates/torii/runner" } torii-server = { path = "crates/torii/server" } torii-sqlite = { path = "crates/torii/sqlite/sqlite" } torii-sqlite-types = { path = "crates/torii/sqlite/types" } torii-typed-data = { path = "crates/torii/typed-data" } -torii-mcp = { path = "crates/torii/mcp" } # sozo sozo-ops = { path = "crates/sozo/ops" } @@ -83,6 +83,8 @@ sozo-walnut = { path = "crates/sozo/walnut" } # macros merge-options = { path = "crates/macros/merge-options" } +katana-runner = { git = "https://github.com/dojoengine/katana", branch = "rpc-0.8.0" } + anyhow = "1.0.89" arbitrary = { version = "1.3.2", features = [ "derive" ] } assert_fs = "1.1" @@ -189,7 +191,6 @@ walkdir = "2.5.0" ipfs-api-backend-hyper = { git = "https://github.com/ferristseng/rust-ipfs-api", rev = "af2c17f7b19ef5b9898f458d97a90055c3605633", features = [ "with-hyper-rustls", "with-send-sync" ] } mime_guess = "2.0" - # server hyper = "0.14.27" warp = "0.3" @@ -211,7 +212,7 @@ criterion = "0.5.1" pprof = { version = "0.13.0", features = [ "criterion", "flamegraph" ] } # Slot integration. Dojo don't need to manually include `account_sdk` as dependency as `slot` already re-exports it. -slot = { git = "https://github.com/cartridge-gg/slot", rev = "1298a30" } +slot = { git = "https://github.com/cartridge-gg/slot", rev = "adac33e" } # alloy core alloy-primitives = { version = "0.8", default-features = false } @@ -226,7 +227,7 @@ alloy-rpc-types-eth = { version = "0.4", default-features = false } alloy-signer = { version = "0.4", default-features = false } alloy-transport = { version = "0.4", default-features = false } -starknet = "0.12.0" +starknet = "0.14.0" starknet-crypto = "0.7.1" starknet-types-core = { version = "0.1.7", features = [ "arbitrary", "hash" ] } diff --git a/bin/sozo/src/commands/call.rs b/bin/sozo/src/commands/call.rs index 277d5e2043..1ec521cfa4 100644 --- a/bin/sozo/src/commands/call.rs +++ b/bin/sozo/src/commands/call.rs @@ -141,7 +141,10 @@ impl CallArgs { contract_address, match &e { ProviderError::StarknetError(StarknetError::ContractError(e)) => { - format!("Contract error: {}", e.revert_error.clone()) + format!( + "Contract error: {}", + format_execution_error(&e.revert_error) + ) } _ => e.to_string(), } @@ -153,3 +156,15 @@ impl CallArgs { }) } } + +fn format_execution_error(error: &starknet::core::types::ContractExecutionError) -> String { + match error { + starknet::core::types::ContractExecutionError::Message(msg) => msg.clone(), + starknet::core::types::ContractExecutionError::Nested(inner) => { + let address = format!("0x{:x}", inner.contract_address); + let selector = format!("0x{:x}", inner.selector); + let inner_error = format_execution_error(&inner.error); + format!("Error in contract at {address} when calling {selector}:\n {inner_error}",) + } + } +} diff --git a/bin/sozo/src/commands/options/account/controller.rs b/bin/sozo/src/commands/options/account/controller.rs index 4f54ad229e..5ec2771514 100644 --- a/bin/sozo/src/commands/options/account/controller.rs +++ b/bin/sozo/src/commands/options/account/controller.rs @@ -1,11 +1,11 @@ use std::collections::HashMap; -use std::sync::Arc; use anyhow::{bail, Result}; use dojo_world::contracts::contract_info::ContractInfo; -use slot::account_sdk::account::session::hash::{Policy, ProvedPolicy}; +use slot::account_sdk::account::session::account::SessionAccount; use slot::account_sdk::account::session::merkle::MerkleTree; -use slot::account_sdk::account::session::SessionAccount; +use slot::account_sdk::account::session::policy::{CallPolicy, MerkleLeaf, Policy, ProvedPolicy}; +use slot::account_sdk::provider::CartridgeJsonRpcProvider; use slot::session::{FullSessionInfo, PolicyMethod}; use starknet::core::types::Felt; use starknet::core::utils::get_selector_from_name; @@ -14,14 +14,8 @@ use starknet::providers::Provider; use tracing::trace; use url::Url; -// Why the Arc? becaues the Controller account implementation over on `account_sdk` crate is -// riddled with `+ Clone` bounds on its Provider generic. So we explicitly specify that the Provider -// impl here is wrapped in an Arc to satisfy the Clone bound. Otherwise, you would get a 'trait -// bound not satisfied' error. -// -// This type comes from account_sdk, which doesn't derive Debug. #[allow(missing_debug_implementations)] -pub type ControllerSessionAccount

= SessionAccount>; +pub type ControllerAccount = SessionAccount; /// Create a new Catridge Controller account based on session key. /// @@ -34,18 +28,14 @@ pub type ControllerSessionAccount

= SessionAccount>; /// * Starknet mainnet /// * Starknet sepolia /// * Slot hosted networks -#[tracing::instrument(name = "create_controller", skip(rpc_url, provider, contracts))] -pub async fn create_controller

( +#[tracing::instrument(name = "create_controller", skip(rpc_url, rpc_provider, contracts))] +pub async fn create_controller( // Ideally we can get the url from the provider so we dont have to pass an extra url param here rpc_url: Url, - provider: P, + rpc_provider: CartridgeJsonRpcProvider, contracts: &HashMap, -) -> Result> -where - P: Provider, - P: Send + Sync, -{ - let chain_id = provider.chain_id().await?; +) -> Result { + let chain_id = rpc_provider.chain_id().await?; trace!(target: "account::controller", "Loading Slot credentials."); let credentials = slot::credential::Credentials::load()?; @@ -62,7 +52,7 @@ where // Check if the session exists, if not create a new one let session_details = match slot::session::get(chain_id)? { Some(session) => { - trace!(target: "account::controller", expires_at = %session.session.expires_at, policies = session.session.policies.len(), "Found existing session."); + trace!(target: "account::controller", expires_at = %session.session.inner.expires_at, policies = session.session.proved_policies.len(), "Found existing session."); // Check if the policies have changed let is_equal = is_equal_to_existing(&policies, &session); @@ -73,7 +63,7 @@ where trace!( target: "account::controller", new_policies = policies.len(), - existing_policies = session.session.policies.len(), + existing_policies = session.session.requested_policies.len(), "Policies have changed. Creating new session." ); @@ -92,7 +82,7 @@ where } }; - Ok(session_details.into_account(Arc::new(provider))) + Ok(session_details.into_account(rpc_provider)) } // Check if the new policies are equal to the ones in the existing session @@ -102,7 +92,13 @@ where fn is_equal_to_existing(new_policies: &[PolicyMethod], session_info: &FullSessionInfo) -> bool { let new_policies = new_policies .iter() - .map(|p| Policy::new(p.target, get_selector_from_name(&p.method).unwrap())) + .map(|p| { + Policy::Call(CallPolicy { + authorized: Some(true), + contract_address: p.target, + selector: get_selector_from_name(&p.method).expect("valid selector"), + }) + }) .collect::>(); // Copied from Session::new @@ -118,7 +114,7 @@ fn is_equal_to_existing(new_policies: &[PolicyMethod], session_info: &FullSessio .collect::>(); let new_policies_root = MerkleTree::compute_root(hashes[0], new_policies[0].proof.clone()); - new_policies_root == session_info.session.authorization_root + new_policies_root == session_info.session.inner.allowed_policies_root } /// Policies are the building block of a session key. It's what defines what methods are allowed for diff --git a/bin/sozo/src/commands/options/account/mod.rs b/bin/sozo/src/commands/options/account/mod.rs index c98d41b9a3..59ce35fda4 100644 --- a/bin/sozo/src/commands/options/account/mod.rs +++ b/bin/sozo/src/commands/options/account/mod.rs @@ -1,11 +1,14 @@ use std::collections::HashMap; use std::str::FromStr; +use std::sync::Arc; use anyhow::{anyhow, Result}; use clap::Args; use dojo_utils::env::DOJO_ACCOUNT_ADDRESS_ENV_VAR; use dojo_world::config::Environment; use dojo_world::contracts::ContractInfo; +#[cfg(feature = "controller")] +use slot::account_sdk::provider::CartridgeJsonRpcProvider; use starknet::accounts::{ExecutionEncoding, SingleOwnerAccount}; use starknet::core::types::{BlockId, BlockTag, Felt}; use starknet::providers::Provider; @@ -17,10 +20,11 @@ use super::starknet::StarknetOptions; #[cfg(feature = "controller")] pub mod controller; +pub mod provider; mod r#type; #[cfg(feature = "controller")] -use controller::ControllerSessionAccount; +use controller::ControllerAccount; pub use r#type::*; // INVARIANT: @@ -76,7 +80,7 @@ impl AccountOptions { /// /// # Arguments /// - /// * `provider` - Starknet provider. + /// * `provider` - Starknet provider (only if you're NOT creating a Controller account). /// * `env_metadata` - Environment pulled from configuration. /// * `starknet` - Starknet options. /// * `contracts` - The [`ContractInfo`] mappings. This one could have been gated behind the @@ -96,8 +100,9 @@ impl AccountOptions { #[cfg(feature = "controller")] if self.controller { let url = starknet.url(env_metadata)?; - let account = self.controller(url, provider, contracts).await?; - return Ok(SozoAccount::Controller(account)); + let cartridge_provider = CartridgeJsonRpcProvider::new(url.clone()); + let account = self.controller(url, cartridge_provider.clone(), contracts).await?; + return Ok(SozoAccount::new_controller(cartridge_provider, account)); } let _ = starknet; @@ -109,9 +114,9 @@ impl AccountOptions { pub async fn std_account

( &self, - provider: P, + provider: Arc

, env_metadata: Option<&Environment>, - ) -> Result> + ) -> Result, LocalWallet>> where P: Provider, P: Send + Sync, @@ -153,6 +158,8 @@ impl AccountOptions { #[cfg(test)] mod tests { + use std::sync::Arc; + use clap::Parser; use katana_runner::RunnerCtx; use starknet::accounts::ExecutionEncoder; @@ -234,7 +241,7 @@ mod tests { // HACK: SingleOwnerAccount doesn't expose a way to check `encoding` type used in struct, so // checking it by encoding a dummy call and checking which method it used to encode the call - let account = cmd.account.std_account(runner.provider(), None).await.unwrap(); + let account = cmd.account.std_account(Arc::new(runner.provider()), None).await.unwrap(); let result = account.encode_calls(&dummy_call); // 0x0 is the data offset. assert!(*result.get(3).unwrap() == Felt::from_hex("0x0").unwrap()); @@ -252,7 +259,7 @@ mod tests { // HACK: SingleOwnerAccount doesn't expose a way to check `encoding` type used in struct, so // checking it by encoding a dummy call and checking which method it used to encode the call - let account = cmd.account.std_account(runner.provider(), None).await.unwrap(); + let account = cmd.account.std_account(Arc::new(runner.provider()), None).await.unwrap(); let result = account.encode_calls(&dummy_call); // 0x2 is the Calldata len. assert!(*result.get(3).unwrap() == Felt::from_hex("0x2").unwrap()); diff --git a/bin/sozo/src/commands/options/account/provider.rs b/bin/sozo/src/commands/options/account/provider.rs index 2bf5c5e384..0d74a3ff46 100644 --- a/bin/sozo/src/commands/options/account/provider.rs +++ b/bin/sozo/src/commands/options/account/provider.rs @@ -4,12 +4,13 @@ use async_trait::async_trait; use starknet::core::types::{ BlockHashAndNumber, BlockId, BroadcastedDeclareTransaction, BroadcastedDeployAccountTransaction, BroadcastedInvokeTransaction, BroadcastedTransaction, - ContractClass, DeclareTransactionResult, DeployAccountTransactionResult, EventFilter, - EventsPage, FeeEstimate, Felt, FunctionCall, InvokeTransactionResult, - MaybePendingBlockWithReceipts, MaybePendingBlockWithTxHashes, MaybePendingBlockWithTxs, - MaybePendingStateUpdate, MsgFromL1, SimulatedTransaction, SimulationFlag, - SimulationFlagForEstimateFee, SyncStatusType, Transaction, TransactionReceiptWithBlockInfo, - TransactionStatus, TransactionTrace, TransactionTraceWithHash, + ConfirmedBlockId, ContractClass, ContractStorageKeys, DeclareTransactionResult, + DeployAccountTransactionResult, EventFilter, EventsPage, FeeEstimate, Felt, FunctionCall, + Hash256, InvokeTransactionResult, MaybePendingBlockWithReceipts, MaybePendingBlockWithTxHashes, + MaybePendingBlockWithTxs, MaybePendingStateUpdate, MessageWithStatus, MsgFromL1, + SimulatedTransaction, SimulationFlag, SimulationFlagForEstimateFee, StorageProof, + SyncStatusType, Transaction, TransactionReceiptWithBlockInfo, TransactionStatus, + TransactionTrace, TransactionTraceWithHash, }; use starknet::providers::{Provider, ProviderError, ProviderRequestData, ProviderResponseData}; @@ -102,6 +103,16 @@ where } } + async fn get_messages_status( + &self, + transaction_hash: Hash256, + ) -> Result, ProviderError> { + match self { + Self::Left(p) => p.get_messages_status(transaction_hash).await, + Self::Right(q) => q.get_messages_status(transaction_hash).await, + } + } + async fn get_transaction_status( &self, transaction_hash: H, @@ -304,6 +315,41 @@ where } } + async fn get_storage_proof( + &self, + block_id: B, + class_hashes: H, + contract_addresses: A, + contracts_storage_keys: K, + ) -> Result + where + B: AsRef + Send + Sync, + H: AsRef<[Felt]> + Send + Sync, + A: AsRef<[Felt]> + Send + Sync, + K: AsRef<[ContractStorageKeys]> + Send + Sync, + { + match self { + Self::Left(p) => { + p.get_storage_proof( + block_id, + class_hashes, + contract_addresses, + contracts_storage_keys, + ) + .await + } + Self::Right(q) => { + q.get_storage_proof( + block_id, + class_hashes, + contract_addresses, + contracts_storage_keys, + ) + .await + } + } + } + async fn add_invoke_transaction( &self, invoke_transaction: I, diff --git a/bin/sozo/src/commands/options/account/type.rs b/bin/sozo/src/commands/options/account/type.rs index f9bd4d4484..5222bd36ac 100644 --- a/bin/sozo/src/commands/options/account/type.rs +++ b/bin/sozo/src/commands/options/account/type.rs @@ -1,18 +1,25 @@ use std::sync::Arc; use async_trait::async_trait; +#[cfg(feature = "controller")] +use slot::account_sdk::provider::CartridgeJsonRpcProvider; use starknet::accounts::{ - single_owner, Account, ConnectedAccount, DeclarationV2, DeclarationV3, ExecutionEncoder, - ExecutionV1, ExecutionV3, LegacyDeclaration, RawDeclarationV2, RawDeclarationV3, - RawExecutionV1, RawExecutionV3, RawLegacyDeclaration, SingleOwnerAccount, + single_owner, Account, ConnectedAccount, ExecutionEncoder, RawDeclarationV3, RawExecutionV3, + SingleOwnerAccount, }; -use starknet::core::types::contract::legacy::LegacyContractClass; -use starknet::core::types::{BlockId, Call, Felt, FlattenedSierraClass}; +use starknet::core::types::{BlockId, Call, Felt}; use starknet::providers::Provider; use starknet::signers::{local_wallet, LocalWallet, SignerInteractivityContext}; #[cfg(feature = "controller")] -use super::controller::ControllerSessionAccount; +use super::controller::ControllerAccount; +#[cfg(feature = "controller")] +use super::provider::EitherProvider; + +#[cfg(feature = "controller")] +type RpcProvider

= EitherProvider, CartridgeJsonRpcProvider>; +#[cfg(not(feature = "controller"))] +type RpcProvider

= Arc

; #[derive(Debug, thiserror::Error)] pub enum SozoAccountSignError { @@ -28,17 +35,49 @@ pub enum SozoAccountSignError { /// [ConnectedAccount] trait and wrap the different account types. /// /// This is the account type that should be used by the CLI. -#[must_use] -#[non_exhaustive] #[allow(missing_debug_implementations)] -pub enum SozoAccount

+pub enum SozoAccountKind

where P: Provider + Send + Sync, { - Standard(SingleOwnerAccount), + Standard(SingleOwnerAccount, LocalWallet>), + #[cfg(feature = "controller")] + Controller(ControllerAccount), +} + +pub struct SozoAccount

+where + P: Provider + Send + Sync, +{ + account: SozoAccountKind

, + provider: RpcProvider

, +} + +impl

SozoAccount

+where + P: Provider + Send + Sync, +{ + pub fn new_standard( + provider: Arc

, + account: SingleOwnerAccount, LocalWallet>, + ) -> Self { + let account = SozoAccountKind::Standard(account); + #[cfg(feature = "controller")] + let provider = EitherProvider::Left(provider); + #[cfg(not(feature = "controller"))] + let provider = provider; + Self { account, provider } + } #[cfg(feature = "controller")] - Controller(ControllerSessionAccount

), + pub fn new_controller( + provider: CartridgeJsonRpcProvider, + controller: ControllerAccount, + ) -> Self { + let account = SozoAccountKind::Controller(controller); + let provider = EitherProvider::Right(provider); + Self { account, provider } + } } #[cfg_attr(not(target_arch = "wasm32"), async_trait)] @@ -51,127 +90,41 @@ where type SignError = SozoAccountSignError; fn is_signer_interactive(&self, context: SignerInteractivityContext<'_>) -> bool { - match self { - Self::Standard(account) => account.is_signer_interactive(context), + match &self.account { + SozoAccountKind::Standard(account) => account.is_signer_interactive(context), #[cfg(feature = "controller")] - Self::Controller(account) => account.is_signer_interactive(context), + SozoAccountKind::Controller(account) => account.is_signer_interactive(context), } } fn address(&self) -> Felt { - match self { - Self::Standard(account) => account.address(), + match &self.account { + SozoAccountKind::Standard(account) => account.address(), #[cfg(feature = "controller")] - Self::Controller(account) => account.address(), + SozoAccountKind::Controller(account) => account.address(), } } fn chain_id(&self) -> Felt { - match self { - Self::Standard(account) => account.chain_id(), + match &self.account { + SozoAccountKind::Standard(account) => account.chain_id(), #[cfg(feature = "controller")] - Self::Controller(account) => account.chain_id(), + SozoAccountKind::Controller(account) => account.chain_id(), } } - fn declare_legacy( - &self, - contract_class: Arc, - ) -> LegacyDeclaration<'_, Self> { - LegacyDeclaration::new(contract_class, self) - } - - fn declare( - &self, - contract_class: Arc, - compiled_class_hash: Felt, - ) -> DeclarationV2<'_, Self> { - DeclarationV2::new(contract_class, compiled_class_hash, self) - } - - fn declare_v2( - &self, - contract_class: Arc, - compiled_class_hash: Felt, - ) -> DeclarationV2<'_, Self> { - DeclarationV2::new(contract_class, compiled_class_hash, self) - } - - fn declare_v3( - &self, - contract_class: Arc, - compiled_class_hash: Felt, - ) -> DeclarationV3<'_, Self> { - DeclarationV3::new(contract_class, compiled_class_hash, self) - } - - fn execute(&self, calls: Vec) -> ExecutionV1<'_, Self> { - ExecutionV1::new(calls, self) - } - - fn execute_v1(&self, calls: Vec) -> ExecutionV1<'_, Self> { - ExecutionV1::new(calls, self) - } - - fn execute_v3(&self, calls: Vec) -> ExecutionV3<'_, Self> { - ExecutionV3::new(calls, self) - } - - async fn sign_execution_v1( - &self, - execution: &RawExecutionV1, - query_only: bool, - ) -> Result, Self::SignError> { - let result = match self { - Self::Standard(account) => account.sign_execution_v1(execution, query_only).await?, - #[cfg(feature = "controller")] - Self::Controller(account) => account.sign_execution_v1(execution, query_only).await?, - }; - Ok(result) - } - async fn sign_execution_v3( &self, execution: &RawExecutionV3, query_only: bool, ) -> Result, Self::SignError> { - let result = match self { - Self::Standard(account) => account.sign_execution_v3(execution, query_only).await?, - #[cfg(feature = "controller")] - Self::Controller(account) => account.sign_execution_v3(execution, query_only).await?, - }; - Ok(result) - } - - async fn sign_legacy_declaration( - &self, - declaration: &RawLegacyDeclaration, - query_only: bool, - ) -> Result, Self::SignError> { - match self { - Self::Standard(account) => { - let result = account.sign_legacy_declaration(declaration, query_only).await?; - Ok(result) - } - #[cfg(feature = "controller")] - Self::Controller(account) => { - let result = account.sign_legacy_declaration(declaration, query_only).await?; - Ok(result) + let result = match &self.account { + SozoAccountKind::Standard(account) => { + account.sign_execution_v3(execution, query_only).await? } - } - } - - async fn sign_declaration_v2( - &self, - declaration: &RawDeclarationV2, - query_only: bool, - ) -> Result, Self::SignError> { - let result = match self { - Self::Standard(account) => account.sign_declaration_v2(declaration, query_only).await?, - #[cfg(feature = "controller")] - Self::Controller(account) => { - account.sign_declaration_v2(declaration, query_only).await? + SozoAccountKind::Controller(account) => { + account.sign_execution_v3(execution, query_only).await? } }; Ok(result) @@ -182,11 +135,12 @@ where declaration: &RawDeclarationV3, query_only: bool, ) -> Result, Self::SignError> { - let result = match self { - Self::Standard(account) => account.sign_declaration_v3(declaration, query_only).await?, - + let result = match &self.account { + SozoAccountKind::Standard(account) => { + account.sign_declaration_v3(declaration, query_only).await? + } #[cfg(feature = "controller")] - Self::Controller(account) => { + SozoAccountKind::Controller(account) => { account.sign_declaration_v3(declaration, query_only).await? } }; @@ -200,10 +154,10 @@ where P: Send + Sync, { fn encode_calls(&self, calls: &[Call]) -> Vec { - match self { - Self::Standard(account) => account.encode_calls(calls), + match &self.account { + SozoAccountKind::Standard(account) => account.encode_calls(calls), #[cfg(feature = "controller")] - Self::Controller(account) => account.encode_calls(calls), + SozoAccountKind::Controller(account) => account.encode_calls(calls), } } } @@ -213,21 +167,17 @@ where P: Provider, P: Send + Sync, { - type Provider = P; + type Provider = RpcProvider

; fn provider(&self) -> &Self::Provider { - match self { - Self::Standard(account) => account.provider(), - #[cfg(feature = "controller")] - Self::Controller(account) => account.provider(), - } + &self.provider } fn block_id(&self) -> BlockId { - match self { - Self::Standard(account) => account.block_id(), + match &self.account { + SozoAccountKind::Standard(account) => account.block_id(), #[cfg(feature = "controller")] - Self::Controller(account) => account.block_id(), + SozoAccountKind::Controller(account) => account.block_id(), } } } diff --git a/bin/sozo/src/commands/options/transaction.rs b/bin/sozo/src/commands/options/transaction.rs index 88786e9460..d5f15f7298 100644 --- a/bin/sozo/src/commands/options/transaction.rs +++ b/bin/sozo/src/commands/options/transaction.rs @@ -1,37 +1,10 @@ -use std::fmt::{Display, Formatter}; - use anyhow::{bail, Result}; -use clap::builder::PossibleValue; -use clap::{Args, ValueEnum}; -use dojo_utils::{EthFeeConfig, FeeConfig, StrkFeeConfig, TxnAction, TxnConfig}; -use starknet::core::types::Felt; +use clap::Args; +use dojo_utils::{FeeConfig, TxnAction, TxnConfig}; #[derive(Debug, Clone, Args, Default)] #[command(next_help_heading = "Transaction options")] pub struct TransactionOptions { - #[arg(long)] - #[arg(help = "Fee token to use.")] - #[arg(default_value_t = FeeToken::Strk)] - #[arg(global = true)] - pub fee: FeeToken, - - #[arg(help_heading = "Transaction options - ETH")] - #[arg(long, value_name = "MULTIPLIER")] - #[arg(help = "The multiplier to use for the fee estimate.")] - #[arg(long_help = "The multiplier to use for the fee estimate. This value will be used on \ - the estimated fee which will be used as the max fee for the transaction. \ - (max_fee = estimated_fee * multiplier)")] - #[arg(conflicts_with_all = ["max_fee_raw", "gas", "gas_price"])] - #[arg(global = true)] - pub fee_estimate_multiplier: Option, - - #[arg(help_heading = "Transaction options - ETH")] - #[arg(long)] - #[arg(help = "Maximum raw value to be used for fees, in Wei.")] - #[arg(conflicts_with_all = ["fee_estimate_multiplier", "gas", "gas_price"])] - #[arg(global = true)] - pub max_fee_raw: Option, - #[arg(help_heading = "Transaction options - STRK")] #[arg(long, help = "Maximum L1 gas amount.")] #[arg(conflicts_with_all = ["max_fee_raw", "fee_estimate_multiplier"])] @@ -81,15 +54,7 @@ impl TransactionOptions { (false, false) => Ok(TxnAction::Send { wait: self.wait || self.walnut, receipt: self.receipt, - fee_config: match self.fee { - FeeToken::Strk => { - FeeConfig::Strk(StrkFeeConfig { gas: self.gas, gas_price: self.gas_price }) - } - FeeToken::Eth => FeeConfig::Eth(EthFeeConfig { - max_fee_raw: self.max_fee_raw, - fee_estimate_multiplier: self.fee_estimate_multiplier, - }), - }, + fee_config: FeeConfig { gas: self.gas, gas_price: self.gas_price }, walnut: self.walnut, }), } @@ -100,71 +65,15 @@ impl TryFrom for TxnConfig { type Error = anyhow::Error; fn try_from(value: TransactionOptions) -> Result { - match value.fee { - FeeToken::Eth => { - if value.gas.is_some() || value.gas_price.is_some() { - bail!( - "Gas and gas price are not supported for ETH transactions. Use `--fee \ - strk` instead." - ); - } - } - FeeToken::Strk => { - if value.max_fee_raw.is_some() || value.fee_estimate_multiplier.is_some() { - bail!( - "Max fee raw and fee estimate multiplier are not supported for STRK \ - transactions. Use `--fee eth` instead." - ); - } - } - }; - Ok(Self { wait: value.wait || value.walnut, receipt: value.receipt, - fee_config: match value.fee { - FeeToken::Strk => { - FeeConfig::Strk(StrkFeeConfig { gas: value.gas, gas_price: value.gas_price }) - } - FeeToken::Eth => FeeConfig::Eth(EthFeeConfig { - max_fee_raw: value.max_fee_raw, - fee_estimate_multiplier: value.fee_estimate_multiplier, - }), - }, walnut: value.walnut, + fee_config: FeeConfig { gas: value.gas, gas_price: value.gas_price }, }) } } -#[derive(Debug, Default, Clone)] -pub enum FeeToken { - #[default] - Strk, - Eth, -} - -impl ValueEnum for FeeToken { - fn value_variants<'a>() -> &'a [Self] { - &[Self::Eth, Self::Strk] - } - - fn to_possible_value(&self) -> Option { - match self { - Self::Eth => Some(PossibleValue::new("ETH").alias("eth")), - Self::Strk => Some(PossibleValue::new("STRK").alias("strk")), - } - } -} - -impl Display for FeeToken { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - match self { - Self::Eth => write!(f, "ETH"), - Self::Strk => write!(f, "STRK"), - } - } -} - #[cfg(test)] mod tests { use anyhow::Result; @@ -176,11 +85,8 @@ mod tests { let opts = TransactionOptions { wait: true, receipt: true, - fee: FeeToken::Strk, gas: Some(1000), gas_price: Some(100), - max_fee_raw: None, - fee_estimate_multiplier: None, walnut: false, }; @@ -190,75 +96,9 @@ mod tests { assert!(config.receipt); assert!(!config.walnut); - match config.fee_config { - FeeConfig::Strk(strk_config) => { - assert_eq!(strk_config.gas, Some(1000)); - assert_eq!(strk_config.gas_price, Some(100)); - } - _ => panic!("Expected STRK fee config"), - } + assert_eq!(config.fee_config.gas, Some(1000)); + assert_eq!(config.fee_config.gas_price, Some(100)); Ok(()) } - - #[test] - fn test_eth_conversion() -> Result<()> { - let opts = TransactionOptions { - wait: false, - receipt: true, - fee: FeeToken::Eth, - gas: None, - gas_price: None, - max_fee_raw: Some(Felt::from(1000)), - fee_estimate_multiplier: Some(1.5), - walnut: true, - }; - - let config: TxnConfig = opts.try_into()?; - - assert!(config.wait); - assert!(config.receipt); - assert!(config.walnut); - - match config.fee_config { - FeeConfig::Eth(eth_config) => { - assert_eq!(eth_config.max_fee_raw, Some(Felt::from(1000))); - assert_eq!(eth_config.fee_estimate_multiplier, Some(1.5)); - } - _ => panic!("Expected ETH fee config"), - } - - Ok(()) - } - - #[test] - fn test_invalid_strk_config() { - let opts = TransactionOptions { - fee: FeeToken::Strk, - max_fee_raw: Some(Felt::from(1000)), - fee_estimate_multiplier: Some(1.5), - ..Default::default() - }; - - let result: Result = opts.try_into(); - assert!(result.is_err()); - } - - #[test] - fn test_invalid_eth_config() { - let opts = TransactionOptions { - fee: FeeToken::Eth, - gas: Some(1000), - gas_price: Some(100), - ..Default::default() - }; - let result: Result = opts.try_into(); - assert!(result.is_err()); - } - - #[test] - fn test_fee_token_display() { - assert_eq!(FeeToken::Eth.to_string(), "ETH"); - assert_eq!(FeeToken::Strk.to_string(), "STRK"); - } } diff --git a/crates/dojo/utils/Cargo.toml b/crates/dojo/utils/Cargo.toml index cb6cf05536..2078b93855 100644 --- a/crates/dojo/utils/Cargo.toml +++ b/crates/dojo/utils/Cargo.toml @@ -7,15 +7,15 @@ version.workspace = true [dependencies] anyhow.workspace = true +colored_json.workspace = true futures.workspace = true reqwest.workspace = true rpassword.workspace = true +serde_json.workspace = true starknet.workspace = true thiserror.workspace = true -tokio = { version = "1.39.2", features = [ "signal", "time", "macros" ], default-features = false } +tokio = { version = "1.39.2", features = [ "macros", "signal", "time" ], default-features = false } tracing.workspace = true -serde_json.workspace = true -colored_json.workspace = true [dev-dependencies] assert_matches.workspace = true diff --git a/crates/dojo/utils/src/tx/declarer.rs b/crates/dojo/utils/src/tx/declarer.rs index b8dca9509e..3addc87f77 100644 --- a/crates/dojo/utils/src/tx/declarer.rs +++ b/crates/dojo/utils/src/tx/declarer.rs @@ -16,9 +16,7 @@ use starknet::core::types::{ use starknet::providers::{Provider, ProviderError}; use tracing::trace; -use crate::{ - FeeConfig, TransactionError, TransactionExt, TransactionResult, TransactionWaiter, TxnConfig, -}; +use crate::{TransactionError, TransactionExt, TransactionResult, TransactionWaiter, TxnConfig}; #[derive(Debug, Clone)] pub struct LabeledClass { @@ -103,21 +101,10 @@ where "Declaring class." ); - let DeclareTransactionResult { transaction_hash, class_hash } = match txn_config.fee_config - { - FeeConfig::Strk(_) => { - account - .declare_v3(Arc::new(labeled_class.class), casm_class_hash) - .send_with_cfg(txn_config) - .await? - } - FeeConfig::Eth(_) => { - account - .declare_v2(Arc::new(labeled_class.class), casm_class_hash) - .send_with_cfg(txn_config) - .await? - } - }; + let DeclareTransactionResult { transaction_hash, class_hash } = account + .declare_v3(Arc::new(labeled_class.class), casm_class_hash) + .send_with_cfg(txn_config) + .await?; trace!( label = labeled_class.label, diff --git a/crates/dojo/utils/src/tx/deployer.rs b/crates/dojo/utils/src/tx/deployer.rs index fc6fa47547..0510832e1d 100644 --- a/crates/dojo/utils/src/tx/deployer.rs +++ b/crates/dojo/utils/src/tx/deployer.rs @@ -9,9 +9,7 @@ use starknet::macros::{felt, selector}; use starknet::providers::{Provider, ProviderError}; use tracing::trace; -use crate::{ - FeeConfig, TransactionError, TransactionExt, TransactionResult, TransactionWaiter, TxnConfig, -}; +use crate::{TransactionError, TransactionExt, TransactionResult, TransactionWaiter, TxnConfig}; const UDC_DEPLOY_SELECTOR: Felt = selector!("deployContract"); const UDC_ADDRESS: Felt = @@ -80,16 +78,8 @@ where None => return Ok(TransactionResult::Noop), }; - let InvokeTransactionResult { transaction_hash } = match self.txn_config.fee_config { - FeeConfig::Strk(_) => { - trace!("Deploying with STRK."); - self.account.execute_v3(vec![call]).send_with_cfg(&self.txn_config).await? - } - FeeConfig::Eth(_) => { - trace!("Deploying with ETH."); - self.account.execute_v1(vec![call]).send_with_cfg(&self.txn_config).await? - } - }; + let InvokeTransactionResult { transaction_hash } = + self.account.execute_v3(vec![call]).send_with_cfg(&self.txn_config).await?; trace!( transaction_hash = format!("{:#066x}", transaction_hash), diff --git a/crates/dojo/utils/src/tx/error.rs b/crates/dojo/utils/src/tx/error.rs index 9a5d92b550..3096a4d548 100644 --- a/crates/dojo/utils/src/tx/error.rs +++ b/crates/dojo/utils/src/tx/error.rs @@ -1,6 +1,6 @@ use starknet::accounts::AccountError; -use starknet::core::types::contract::{CompressProgramError, ComputeClassHashError}; -use starknet::core::types::StarknetError; +use starknet::core::types::contract::ComputeClassHashError; +use starknet::core::types::{StarknetError, TransactionExecutionErrorData}; use starknet::providers::ProviderError; use thiserror::Error; @@ -15,16 +15,14 @@ where SigningError(S), #[error(transparent)] Provider(ProviderError), - #[error("{0}")] - TransactionExecution(String), + #[error("Transaction execution error")] + TransactionExecution(TransactionExecutionErrorData), #[error("{0}")] TransactionValidation(String), #[error(transparent)] TransactionWaiting(#[from] TransactionWaitingError), #[error(transparent)] ComputeClassHash(#[from] ComputeClassHashError), - #[error(transparent)] - ClassCompression(#[from] CompressProgramError), #[error("Fee calculation overflow")] FeeOutOfRange, } @@ -38,7 +36,6 @@ where AccountError::Signing(e) => TransactionError::SigningError(e), AccountError::Provider(e) => Self::from(e), AccountError::ClassHashCalculation(e) => TransactionError::ComputeClassHash(e), - AccountError::ClassCompression(e) => TransactionError::ClassCompression(e), AccountError::FeeOutOfRange => TransactionError::FeeOutOfRange, } } @@ -49,12 +46,12 @@ where S: std::error::Error, { fn from(value: ProviderError) -> Self { - match &value { + match value { ProviderError::StarknetError(StarknetError::TransactionExecutionError(te)) => { - TransactionError::TransactionExecution(te.execution_error.clone()) + TransactionError::TransactionExecution(te) } ProviderError::StarknetError(StarknetError::ValidationFailure(ve)) => { - TransactionError::TransactionExecution(ve.to_string()) + TransactionError::TransactionValidation(ve) } _ => TransactionError::Provider(value), } diff --git a/crates/dojo/utils/src/tx/invoker.rs b/crates/dojo/utils/src/tx/invoker.rs index 9178bfaf80..0f9deb4d8f 100644 --- a/crates/dojo/utils/src/tx/invoker.rs +++ b/crates/dojo/utils/src/tx/invoker.rs @@ -5,7 +5,6 @@ use starknet::core::types::Call; use tracing::trace; use super::TransactionResult; -use crate::tx::FeeConfig; use crate::{TransactionError, TransactionExt, TransactionWaiter, TxnConfig}; #[derive(Debug)] @@ -55,16 +54,7 @@ where ) -> Result> { trace!(?call, "Invoke contract."); - let tx = match self.txn_config.fee_config { - FeeConfig::Strk(config) => { - trace!(?config, "Invoking with STRK."); - self.account.execute_v3(vec![call]).send_with_cfg(&self.txn_config).await? - } - FeeConfig::Eth(config) => { - trace!(?config, "Invoking with ETH."); - self.account.execute_v1(vec![call]).send_with_cfg(&self.txn_config).await? - } - }; + let tx = self.account.execute_v3(vec![call]).send_with_cfg(&self.txn_config).await?; trace!(transaction_hash = format!("{:#066x}", tx.transaction_hash), "Invoke contract."); @@ -88,16 +78,8 @@ where trace!(?self.calls, "Invoke contract multicall."); - let tx = match self.txn_config.fee_config { - FeeConfig::Strk(config) => { - trace!(?config, "Invoking with STRK."); - self.account.execute_v3(self.calls.clone()).send_with_cfg(&self.txn_config).await? - } - FeeConfig::Eth(config) => { - trace!(?config, "Invoking with ETH."); - self.account.execute_v1(self.calls.clone()).send_with_cfg(&self.txn_config).await? - } - }; + let tx = + self.account.execute_v3(self.calls.clone()).send_with_cfg(&self.txn_config).await?; trace!( transaction_hash = format!("{:#066x}", tx.transaction_hash), diff --git a/crates/dojo/utils/src/tx/mod.rs b/crates/dojo/utils/src/tx/mod.rs index 9bcf74b6d9..6cae1d289b 100644 --- a/crates/dojo/utils/src/tx/mod.rs +++ b/crates/dojo/utils/src/tx/mod.rs @@ -10,9 +10,8 @@ use anyhow::{anyhow, Result}; use colored_json::ToColoredJson; use reqwest::Url; use starknet::accounts::{ - AccountDeploymentV1, AccountDeploymentV3, AccountError, AccountFactory, AccountFactoryError, - ConnectedAccount, DeclarationV2, DeclarationV3, ExecutionEncoding, ExecutionV1, ExecutionV3, - SingleOwnerAccount, + AccountDeploymentV3, AccountError, AccountFactory, AccountFactoryError, ConnectedAccount, + DeclarationV3, ExecutionEncoding, ExecutionV3, SingleOwnerAccount, }; use starknet::core::types::{ BlockId, BlockTag, DeclareTransactionResult, DeployAccountTransactionResult, Felt, @@ -22,37 +21,14 @@ use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::{AnyProvider, JsonRpcClient, Provider}; use starknet::signers::{LocalWallet, SigningKey}; -#[derive(Debug, Copy, Clone, Default)] -pub struct StrkFeeConfig { +#[derive(Debug, Default, Copy, Clone)] +pub struct FeeConfig { /// The maximum L1 gas amount. pub gas: Option, /// The maximum L1 gas price in STRK. pub gas_price: Option, } -#[derive(Debug, Copy, Clone, Default)] -pub struct EthFeeConfig { - /// The multiplier for how much the actual transaction max fee should be relative to the - /// estimated fee. - pub fee_estimate_multiplier: Option, - /// The maximum fee to pay for the transaction. - pub max_fee_raw: Option, -} - -#[derive(Debug, Copy, Clone)] -pub enum FeeConfig { - /// The STRK fee configuration. - Strk(StrkFeeConfig), - /// The ETH fee configuration. - Eth(EthFeeConfig), -} - -impl Default for FeeConfig { - fn default() -> Self { - Self::Strk(StrkFeeConfig::default()) - } -} - /// The transaction configuration to use when sending a transaction. #[derive(Debug, Copy, Clone, Default)] pub struct TxnConfig { @@ -123,7 +99,7 @@ pub trait TransactionExt { async fn send_with_cfg(self, txn_config: &TxnConfig) -> Result; } -impl TransactionExt for ExecutionV1<'_, T> +impl TransactionExt for ExecutionV3<'_, T> where T: ConnectedAccount + Sync, { @@ -134,89 +110,12 @@ where mut self, txn_config: &TxnConfig, ) -> Result> { - if let FeeConfig::Eth(c) = txn_config.fee_config { - if let Some(fee_est_mul) = c.fee_estimate_multiplier { - self = self.fee_estimate_multiplier(fee_est_mul); - } - - if let Some(max_raw_f) = c.max_fee_raw { - self = self.max_fee(max_raw_f); - } + if let Some(g) = txn_config.fee_config.gas { + self = self.l1_gas(g); } - self.send().await - } -} - -impl TransactionExt for DeclarationV2<'_, T> -where - T: ConnectedAccount + Sync, -{ - type R = DeclareTransactionResult; - type U = AccountError; - - async fn send_with_cfg( - mut self, - txn_config: &TxnConfig, - ) -> Result> { - if let FeeConfig::Eth(c) = txn_config.fee_config { - if let Some(fee_est_mul) = c.fee_estimate_multiplier { - self = self.fee_estimate_multiplier(fee_est_mul); - } - - if let Some(max_raw_f) = c.max_fee_raw { - self = self.max_fee(max_raw_f); - } - } - - self.send().await - } -} - -impl TransactionExt for AccountDeploymentV1<'_, T> -where - T: AccountFactory + Sync, -{ - type R = DeployAccountTransactionResult; - type U = AccountFactoryError; - - async fn send_with_cfg( - mut self, - txn_config: &TxnConfig, - ) -> Result::SignError>> { - if let FeeConfig::Eth(c) = txn_config.fee_config { - if let Some(fee_est_mul) = c.fee_estimate_multiplier { - self = self.fee_estimate_multiplier(fee_est_mul); - } - - if let Some(max_raw_f) = c.max_fee_raw { - self = self.max_fee(max_raw_f); - } - } - - self.send().await - } -} - -impl TransactionExt for ExecutionV3<'_, T> -where - T: ConnectedAccount + Sync, -{ - type R = InvokeTransactionResult; - type U = AccountError; - - async fn send_with_cfg( - mut self, - txn_config: &TxnConfig, - ) -> Result> { - if let FeeConfig::Strk(c) = txn_config.fee_config { - if let Some(g) = c.gas { - self = self.gas(g); - } - - if let Some(gp) = c.gas_price { - self = self.gas_price(gp); - } + if let Some(gp) = txn_config.fee_config.gas_price { + self = self.l1_gas_price(gp); } self.send().await @@ -234,14 +133,12 @@ where mut self, txn_config: &TxnConfig, ) -> Result> { - if let FeeConfig::Strk(c) = txn_config.fee_config { - if let Some(g) = c.gas { - self = self.gas(g); - } - - if let Some(gp) = c.gas_price { - self = self.gas_price(gp); - } + if let Some(g) = txn_config.fee_config.gas { + self = self.l1_gas(g); + } + + if let Some(gp) = txn_config.fee_config.gas_price { + self = self.l1_gas_price(gp); } self.send().await @@ -259,14 +156,12 @@ where mut self, txn_config: &TxnConfig, ) -> Result::SignError>> { - if let FeeConfig::Strk(c) = txn_config.fee_config { - if let Some(g) = c.gas { - self = self.gas(g); - } - - if let Some(gp) = c.gas_price { - self = self.gas_price(gp); - } + if let Some(g) = txn_config.fee_config.gas { + self = self.l1_gas(g); + } + + if let Some(gp) = txn_config.fee_config.gas_price { + self = self.l1_gas_price(gp); } self.send().await diff --git a/crates/dojo/utils/src/tx/waiter.rs b/crates/dojo/utils/src/tx/waiter.rs index 2f583e2a2c..14f874dce6 100644 --- a/crates/dojo/utils/src/tx/waiter.rs +++ b/crates/dojo/utils/src/tx/waiter.rs @@ -309,9 +309,8 @@ mod tests { use starknet::core::types::ExecutionResult::{Reverted, Succeeded}; use starknet::core::types::TransactionFinalityStatus::{self, AcceptedOnL1, AcceptedOnL2}; use starknet::core::types::{ - ComputationResources, DataAvailabilityResources, DataResources, ExecutionResources, - ExecutionResult, FeePayment, InvokeTransactionReceipt, PriceUnit, ReceiptBlock, - TransactionReceipt, TransactionReceiptWithBlockInfo, + ExecutionResources, ExecutionResult, FeePayment, InvokeTransactionReceipt, PriceUnit, + ReceiptBlock, TransactionReceipt, TransactionReceiptWithBlockInfo, }; use starknet::macros::felt; use starknet::providers::jsonrpc::HttpTransport; @@ -338,6 +337,9 @@ mod tests { }, }; + const EXECUTION_RESOURCES: ExecutionResources = + ExecutionResources { l1_data_gas: 0, l1_gas: 0, l2_gas: 0 }; + fn mock_receipt( finality_status: TransactionFinalityStatus, execution_result: ExecutionResult, diff --git a/crates/dojo/world/abigen/src/main.rs b/crates/dojo/world/abigen/src/main.rs index 6ed928897f..7236a21140 100644 --- a/crates/dojo/world/abigen/src/main.rs +++ b/crates/dojo/world/abigen/src/main.rs @@ -15,7 +15,7 @@ use std::path::Path; use std::process::Command; use anyhow::{anyhow, Result}; -use cainome::rs::Abigen; +use cainome::rs::{Abigen, ExecutionVersion}; use camino::Utf8PathBuf; use scarb::core::{Config, TargetKind}; use scarb::ops::{CompileOpts, FeaturesOpts, FeaturesSelector}; @@ -66,6 +66,7 @@ fn generate_bindings( let tmp_file = format!("/tmp/{contract_name}.rs"); let abigen = Abigen::new(contract_name, contract_artifact_path) + .with_execution_version(ExecutionVersion::V3) .with_types_aliases(HashMap::from([( String::from("dojo::world::config::Config::Event"), String::from("DojoConfigEvent"), diff --git a/crates/dojo/world/src/contracts/abigen/world.rs b/crates/dojo/world/src/contracts/abigen/world.rs index 24aa299c90..6bd5bdf496 100644 --- a/crates/dojo/world/src/contracts/abigen/world.rs +++ b/crates/dojo/world/src/contracts/abigen/world.rs @@ -3574,7 +3574,7 @@ impl WorldContract { model_selector: &starknet::core::types::Felt, indexes: &Vec, layout: &Layout, - ) -> starknet::accounts::ExecutionV1 { + ) -> starknet::accounts::ExecutionV3 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(starknet::core::types::Felt::cairo_serialize(model_selector)); @@ -3585,7 +3585,7 @@ impl WorldContract { selector: starknet::macros::selector!("delete_entities"), calldata: __calldata, }; - self.account.execute_v1(vec![__call]) + self.account.execute_v3(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] @@ -3613,7 +3613,7 @@ impl WorldContract { model_selector: &starknet::core::types::Felt, index: &ModelIndex, layout: &Layout, - ) -> starknet::accounts::ExecutionV1 { + ) -> starknet::accounts::ExecutionV3 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(starknet::core::types::Felt::cairo_serialize(model_selector)); @@ -3624,7 +3624,7 @@ impl WorldContract { selector: starknet::macros::selector!("delete_entity"), calldata: __calldata, }; - self.account.execute_v1(vec![__call]) + self.account.execute_v3(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] @@ -3652,7 +3652,7 @@ impl WorldContract { event_selector: &starknet::core::types::Felt, keys: &Vec, values: &Vec, - ) -> starknet::accounts::ExecutionV1 { + ) -> starknet::accounts::ExecutionV3 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(starknet::core::types::Felt::cairo_serialize(event_selector)); @@ -3663,7 +3663,7 @@ impl WorldContract { selector: starknet::macros::selector!("emit_event"), calldata: __calldata, }; - self.account.execute_v1(vec![__call]) + self.account.execute_v3(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] @@ -3691,7 +3691,7 @@ impl WorldContract { event_selector: &starknet::core::types::Felt, keys: &Vec>, values: &Vec>, - ) -> starknet::accounts::ExecutionV1 { + ) -> starknet::accounts::ExecutionV3 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(starknet::core::types::Felt::cairo_serialize(event_selector)); @@ -3702,7 +3702,7 @@ impl WorldContract { selector: starknet::macros::selector!("emit_events"), calldata: __calldata, }; - self.account.execute_v1(vec![__call]) + self.account.execute_v3(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] @@ -3727,7 +3727,7 @@ impl WorldContract { &self, resource: &starknet::core::types::Felt, address: &cainome::cairo_serde::ContractAddress, - ) -> starknet::accounts::ExecutionV1 { + ) -> starknet::accounts::ExecutionV3 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(starknet::core::types::Felt::cairo_serialize(resource)); @@ -3737,7 +3737,7 @@ impl WorldContract { selector: starknet::macros::selector!("grant_owner"), calldata: __calldata, }; - self.account.execute_v1(vec![__call]) + self.account.execute_v3(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] @@ -3762,7 +3762,7 @@ impl WorldContract { &self, resource: &starknet::core::types::Felt, contract: &cainome::cairo_serde::ContractAddress, - ) -> starknet::accounts::ExecutionV1 { + ) -> starknet::accounts::ExecutionV3 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(starknet::core::types::Felt::cairo_serialize(resource)); @@ -3772,7 +3772,7 @@ impl WorldContract { selector: starknet::macros::selector!("grant_writer"), calldata: __calldata, }; - self.account.execute_v1(vec![__call]) + self.account.execute_v3(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] @@ -3797,7 +3797,7 @@ impl WorldContract { &self, selector: &starknet::core::types::Felt, init_calldata: &Vec, - ) -> starknet::accounts::ExecutionV1 { + ) -> starknet::accounts::ExecutionV3 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(starknet::core::types::Felt::cairo_serialize(selector)); @@ -3807,7 +3807,7 @@ impl WorldContract { selector: starknet::macros::selector!("init_contract"), calldata: __calldata, }; - self.account.execute_v1(vec![__call]) + self.account.execute_v3(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] @@ -3835,7 +3835,7 @@ impl WorldContract { salt: &starknet::core::types::Felt, namespace: &cainome::cairo_serde::ByteArray, class_hash: &cainome::cairo_serde::ClassHash, - ) -> starknet::accounts::ExecutionV1 { + ) -> starknet::accounts::ExecutionV3 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(starknet::core::types::Felt::cairo_serialize(salt)); @@ -3846,7 +3846,7 @@ impl WorldContract { selector: starknet::macros::selector!("register_contract"), calldata: __calldata, }; - self.account.execute_v1(vec![__call]) + self.account.execute_v3(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] @@ -3871,7 +3871,7 @@ impl WorldContract { &self, namespace: &cainome::cairo_serde::ByteArray, class_hash: &cainome::cairo_serde::ClassHash, - ) -> starknet::accounts::ExecutionV1 { + ) -> starknet::accounts::ExecutionV3 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(cainome::cairo_serde::ByteArray::cairo_serialize(namespace)); @@ -3881,7 +3881,7 @@ impl WorldContract { selector: starknet::macros::selector!("register_event"), calldata: __calldata, }; - self.account.execute_v1(vec![__call]) + self.account.execute_v3(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] @@ -3912,7 +3912,7 @@ impl WorldContract { class_hash: &cainome::cairo_serde::ClassHash, name: &cainome::cairo_serde::ByteArray, version: &cainome::cairo_serde::ByteArray, - ) -> starknet::accounts::ExecutionV1 { + ) -> starknet::accounts::ExecutionV3 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(cainome::cairo_serde::ByteArray::cairo_serialize(namespace)); @@ -3924,7 +3924,7 @@ impl WorldContract { selector: starknet::macros::selector!("register_library"), calldata: __calldata, }; - self.account.execute_v1(vec![__call]) + self.account.execute_v3(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] @@ -3949,7 +3949,7 @@ impl WorldContract { &self, namespace: &cainome::cairo_serde::ByteArray, class_hash: &cainome::cairo_serde::ClassHash, - ) -> starknet::accounts::ExecutionV1 { + ) -> starknet::accounts::ExecutionV3 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(cainome::cairo_serde::ByteArray::cairo_serialize(namespace)); @@ -3959,7 +3959,7 @@ impl WorldContract { selector: starknet::macros::selector!("register_model"), calldata: __calldata, }; - self.account.execute_v1(vec![__call]) + self.account.execute_v3(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] @@ -3981,7 +3981,7 @@ impl WorldContract { pub fn register_namespace( &self, namespace: &cainome::cairo_serde::ByteArray, - ) -> starknet::accounts::ExecutionV1 { + ) -> starknet::accounts::ExecutionV3 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(cainome::cairo_serde::ByteArray::cairo_serialize(namespace)); @@ -3990,7 +3990,7 @@ impl WorldContract { selector: starknet::macros::selector!("register_namespace"), calldata: __calldata, }; - self.account.execute_v1(vec![__call]) + self.account.execute_v3(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] @@ -4015,7 +4015,7 @@ impl WorldContract { &self, resource: &starknet::core::types::Felt, address: &cainome::cairo_serde::ContractAddress, - ) -> starknet::accounts::ExecutionV1 { + ) -> starknet::accounts::ExecutionV3 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(starknet::core::types::Felt::cairo_serialize(resource)); @@ -4025,7 +4025,7 @@ impl WorldContract { selector: starknet::macros::selector!("revoke_owner"), calldata: __calldata, }; - self.account.execute_v1(vec![__call]) + self.account.execute_v3(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] @@ -4050,7 +4050,7 @@ impl WorldContract { &self, resource: &starknet::core::types::Felt, contract: &cainome::cairo_serde::ContractAddress, - ) -> starknet::accounts::ExecutionV1 { + ) -> starknet::accounts::ExecutionV3 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(starknet::core::types::Felt::cairo_serialize(resource)); @@ -4060,7 +4060,7 @@ impl WorldContract { selector: starknet::macros::selector!("revoke_writer"), calldata: __calldata, }; - self.account.execute_v1(vec![__call]) + self.account.execute_v3(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] @@ -4091,7 +4091,7 @@ impl WorldContract { indexes: &Vec, values: &Vec>, layout: &Layout, - ) -> starknet::accounts::ExecutionV1 { + ) -> starknet::accounts::ExecutionV3 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(starknet::core::types::Felt::cairo_serialize(model_selector)); @@ -4103,7 +4103,7 @@ impl WorldContract { selector: starknet::macros::selector!("set_entities"), calldata: __calldata, }; - self.account.execute_v1(vec![__call]) + self.account.execute_v3(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] @@ -4134,7 +4134,7 @@ impl WorldContract { index: &ModelIndex, values: &Vec, layout: &Layout, - ) -> starknet::accounts::ExecutionV1 { + ) -> starknet::accounts::ExecutionV3 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(starknet::core::types::Felt::cairo_serialize(model_selector)); @@ -4146,7 +4146,7 @@ impl WorldContract { selector: starknet::macros::selector!("set_entity"), calldata: __calldata, }; - self.account.execute_v1(vec![__call]) + self.account.execute_v3(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] @@ -4162,7 +4162,7 @@ impl WorldContract { } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn set_metadata(&self, metadata: &ResourceMetadata) -> starknet::accounts::ExecutionV1 { + pub fn set_metadata(&self, metadata: &ResourceMetadata) -> starknet::accounts::ExecutionV3 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(ResourceMetadata::cairo_serialize(metadata)); @@ -4171,7 +4171,7 @@ impl WorldContract { selector: starknet::macros::selector!("set_metadata"), calldata: __calldata, }; - self.account.execute_v1(vec![__call]) + self.account.execute_v3(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] @@ -4193,7 +4193,7 @@ impl WorldContract { pub fn upgrade( &self, new_class_hash: &cainome::cairo_serde::ClassHash, - ) -> starknet::accounts::ExecutionV1 { + ) -> starknet::accounts::ExecutionV3 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(cainome::cairo_serde::ClassHash::cairo_serialize(new_class_hash)); @@ -4202,7 +4202,7 @@ impl WorldContract { selector: starknet::macros::selector!("upgrade"), calldata: __calldata, }; - self.account.execute_v1(vec![__call]) + self.account.execute_v3(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] @@ -4227,7 +4227,7 @@ impl WorldContract { &self, namespace: &cainome::cairo_serde::ByteArray, class_hash: &cainome::cairo_serde::ClassHash, - ) -> starknet::accounts::ExecutionV1 { + ) -> starknet::accounts::ExecutionV3 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(cainome::cairo_serde::ByteArray::cairo_serialize(namespace)); @@ -4237,7 +4237,7 @@ impl WorldContract { selector: starknet::macros::selector!("upgrade_contract"), calldata: __calldata, }; - self.account.execute_v1(vec![__call]) + self.account.execute_v3(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] @@ -4262,7 +4262,7 @@ impl WorldContract { &self, namespace: &cainome::cairo_serde::ByteArray, class_hash: &cainome::cairo_serde::ClassHash, - ) -> starknet::accounts::ExecutionV1 { + ) -> starknet::accounts::ExecutionV3 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(cainome::cairo_serde::ByteArray::cairo_serialize(namespace)); @@ -4272,7 +4272,7 @@ impl WorldContract { selector: starknet::macros::selector!("upgrade_event"), calldata: __calldata, }; - self.account.execute_v1(vec![__call]) + self.account.execute_v3(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] @@ -4297,7 +4297,7 @@ impl WorldContract { &self, namespace: &cainome::cairo_serde::ByteArray, class_hash: &cainome::cairo_serde::ClassHash, - ) -> starknet::accounts::ExecutionV1 { + ) -> starknet::accounts::ExecutionV3 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; __calldata.extend(cainome::cairo_serde::ByteArray::cairo_serialize(namespace)); @@ -4307,7 +4307,7 @@ impl WorldContract { selector: starknet::macros::selector!("upgrade_model"), calldata: __calldata, }; - self.account.execute_v1(vec![__call]) + self.account.execute_v3(vec![__call]) } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] @@ -4322,7 +4322,7 @@ impl WorldContract { } #[allow(clippy::ptr_arg)] #[allow(clippy::too_many_arguments)] - pub fn uuid(&self) -> starknet::accounts::ExecutionV1 { + pub fn uuid(&self) -> starknet::accounts::ExecutionV3 { use cainome::cairo_serde::CairoSerde; let mut __calldata = vec![]; let __call = starknet::core::types::Call { @@ -4330,7 +4330,7 @@ impl WorldContract { selector: starknet::macros::selector!("uuid"), calldata: __calldata, }; - self.account.execute_v1(vec![__call]) + self.account.execute_v3(vec![__call]) } } impl WorldContractReader

{ diff --git a/crates/sozo/ops/Cargo.toml b/crates/sozo/ops/Cargo.toml index 2a85047199..9a8015eb30 100644 --- a/crates/sozo/ops/Cargo.toml +++ b/crates/sozo/ops/Cargo.toml @@ -21,8 +21,8 @@ serde_json.workspace = true serde_with.workspace = true sozo-walnut = { workspace = true, optional = true } spinoff.workspace = true -starknet-crypto.workspace = true starknet.workspace = true +starknet-crypto.workspace = true thiserror.workspace = true toml.workspace = true tracing.workspace = true diff --git a/spawn-and-move-db.tar.gz b/spawn-and-move-db.tar.gz index 1a1736120f..7641a98838 100644 Binary files a/spawn-and-move-db.tar.gz and b/spawn-and-move-db.tar.gz differ