diff --git a/.yarn/install-state.gz b/.yarn/install-state.gz index abca5e03..622a3c62 100644 Binary files a/.yarn/install-state.gz and b/.yarn/install-state.gz differ diff --git a/Cargo.lock b/Cargo.lock index 50b3d1e2..e65d003e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,12 +14,6 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "allocator-api2" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" - [[package]] name = "android-tzdata" version = "0.1.1" @@ -50,22 +44,10 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" dependencies = [ - "ark-ec 0.4.2", - "ark-ff 0.4.2", - "ark-serialize 0.4.2", - "ark-std 0.4.0", -] - -[[package]] -name = "ark-bls12-381" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" -dependencies = [ - "ark-ec 0.5.0", - "ark-ff 0.5.0", - "ark-serialize 0.5.0", - "ark-std 0.5.0", + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", ] [[package]] @@ -74,20 +56,9 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" dependencies = [ - "ark-ec 0.4.2", - "ark-ff 0.4.2", - "ark-std 0.4.0", -] - -[[package]] -name = "ark-bn254" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d69eab57e8d2663efa5c63135b2af4f396d66424f88954c21104125ab6b3e6bc" -dependencies = [ - "ark-ec 0.5.0", - "ark-ff 0.5.0", - "ark-std 0.5.0", + "ark-ec", + "ark-ff", + "ark-std", ] [[package]] @@ -96,34 +67,13 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" dependencies = [ - "ark-ff 0.4.2", - "ark-poly 0.4.2", - "ark-serialize 0.4.2", - "ark-std 0.4.0", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", "derivative", "hashbrown 0.13.2", - "itertools 0.10.5", - "num-traits", - "zeroize", -] - -[[package]] -name = "ark-ec" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" -dependencies = [ - "ahash", - "ark-ff 0.5.0", - "ark-poly 0.5.0", - "ark-serialize 0.5.0", - "ark-std 0.5.0", - "educe", - "fnv", - "hashbrown 0.15.3", - "itertools 0.13.0", - "num-bigint", - "num-integer", + "itertools", "num-traits", "zeroize", ] @@ -134,13 +84,13 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" dependencies = [ - "ark-ff-asm 0.4.2", - "ark-ff-macros 0.4.2", - "ark-serialize 0.4.2", - "ark-std 0.4.0", + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", "derivative", "digest", - "itertools 0.10.5", + "itertools", "num-bigint", "num-traits", "paste", @@ -148,26 +98,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "ark-ff" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" -dependencies = [ - "ark-ff-asm 0.5.0", - "ark-ff-macros 0.5.0", - "ark-serialize 0.5.0", - "ark-std 0.5.0", - "arrayvec", - "digest", - "educe", - "itertools 0.13.0", - "num-bigint", - "num-traits", - "paste", - "zeroize", -] - [[package]] name = "ark-ff-asm" version = "0.4.2" @@ -178,16 +108,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "ark-ff-asm" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" -dependencies = [ - "quote", - "syn 2.0.101", -] - [[package]] name = "ark-ff-macros" version = "0.4.2" @@ -201,68 +121,27 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "ark-ff-macros" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" -dependencies = [ - "num-bigint", - "num-traits", - "proc-macro2", - "quote", - "syn 2.0.101", -] - [[package]] name = "ark-poly" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" dependencies = [ - "ark-ff 0.4.2", - "ark-serialize 0.4.2", - "ark-std 0.4.0", + "ark-ff", + "ark-serialize", + "ark-std", "derivative", "hashbrown 0.13.2", ] -[[package]] -name = "ark-poly" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" -dependencies = [ - "ahash", - "ark-ff 0.5.0", - "ark-serialize 0.5.0", - "ark-std 0.5.0", - "educe", - "fnv", - "hashbrown 0.15.3", -] - [[package]] name = "ark-serialize" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" dependencies = [ - "ark-serialize-derive 0.4.2", - "ark-std 0.4.0", - "digest", - "num-bigint", -] - -[[package]] -name = "ark-serialize" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" -dependencies = [ - "ark-serialize-derive 0.5.0", - "ark-std 0.5.0", - "arrayvec", + "ark-serialize-derive", + "ark-std", "digest", "num-bigint", ] @@ -278,17 +157,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "ark-serialize-derive" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.101", -] - [[package]] name = "ark-std" version = "0.4.0" @@ -299,22 +167,6 @@ dependencies = [ "rand 0.8.5", ] -[[package]] -name = "ark-std" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" -dependencies = [ - "num-traits", - "rand 0.8.5", -] - -[[package]] -name = "arrayvec" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56" - [[package]] name = "autocfg" version = "1.4.0" @@ -689,18 +541,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "educe" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" -dependencies = [ - "enum-ordinalize", - "proc-macro2", - "quote", - "syn 2.0.101", -] - [[package]] name = "either" version = "1.15.0" @@ -725,26 +565,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "enum-ordinalize" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89dd01549b09589510cf0647475075d12071456586d70f5c75c98ae2a5537677" -dependencies = [ - "enum-ordinalize-derive", -] - -[[package]] -name = "enum-ordinalize-derive" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a65863d15a4ce2888bd2f0f543cc963d3879c3a022c8ee43f6141d479a3ac815" -dependencies = [ - "proc-macro2", - "quote", - "syn 3.0.4", -] - [[package]] name = "equivalent" version = "1.0.2" @@ -877,9 +697,6 @@ name = "hashbrown" version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3" -dependencies = [ - "allocator-api2", -] [[package]] name = "heapless" @@ -988,15 +805,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.15" @@ -1202,7 +1010,7 @@ name = "prompt-hash" version = "0.0.1" dependencies = [ "proptest", - "soroban-sdk 25.3.2", + "soroban-sdk", "stellar-access", "stellar-macros", "stellar-tokens", @@ -1524,59 +1332,18 @@ version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" -[[package]] -name = "soroban-builtin-sdk-macros" -version = "23.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9336adeabcd6f636a4e0889c8baf494658ef5a3c4e7e227569acd2ce9091e85" -dependencies = [ - "itertools 0.10.5", - "proc-macro2", - "quote", - "syn 2.0.101", -] - [[package]] name = "soroban-builtin-sdk-macros" version = "25.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ade35a1b0ff1e1d441937e7bd9751ca1abf1f821de6dba20a97c3d2a9839487" dependencies = [ - "itertools 0.10.5", - "proc-macro2", - "quote", - "syn 2.0.101", -] - -[[package]] -name = "soroban-builtin-sdk-macros" -version = "26.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc4a09f48a67357fdad682b601f4a2f3fdd8d897f3a97c2e1704fa22b0a474e0" -dependencies = [ - "itertools 0.13.0", + "itertools", "proc-macro2", "quote", "syn 2.0.101", ] -[[package]] -name = "soroban-env-common" -version = "23.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00067f52e8bbf1abf0de03fe3e2fbb06910893cfbe9a7d9093d6425658833ff3" -dependencies = [ - "crate-git-revision", - "ethnum", - "num-derive", - "num-traits", - "soroban-env-macros 23.0.1", - "soroban-wasmi", - "static_assertions", - "stellar-xdr 23.0.0", - "wasmparser", -] - [[package]] name = "soroban-env-common" version = "25.2.2" @@ -1589,94 +1356,21 @@ dependencies = [ "num-derive", "num-traits", "serde", - "soroban-env-macros 25.2.2", - "soroban-wasmi", - "static_assertions", - "stellar-xdr 25.0.0", - "wasmparser", -] - -[[package]] -name = "soroban-env-common" -version = "26.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ededa4063061c00886490bb3290e416ee0b03d7732a7378ccba7bb19211fb00c" -dependencies = [ - "crate-git-revision", - "ethnum", - "num-derive", - "num-traits", - "soroban-env-macros 26.1.4", + "soroban-env-macros", "soroban-wasmi", "static_assertions", - "stellar-xdr 26.0.1", + "stellar-xdr", "wasmparser", ] -[[package]] -name = "soroban-env-guest" -version = "23.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccd1e40963517b10963a8e404348d3fe6caf9c278ac47a6effd48771297374d6" -dependencies = [ - "soroban-env-common 23.0.1", - "static_assertions", -] - [[package]] name = "soroban-env-guest" version = "25.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54672105913cdee84f9b724d907b0ee1fb5ef13274b631733f82d513b41bbbc9" dependencies = [ - "soroban-env-common 25.2.2", - "static_assertions", -] - -[[package]] -name = "soroban-env-guest" -version = "26.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ff2525f31e2453b52e90400a2952ce4618f8925bd03167938573e83c320c33f" -dependencies = [ - "soroban-env-common 26.1.4", - "static_assertions", -] - -[[package]] -name = "soroban-env-host" -version = "23.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9766c5ad78e9d8ae10afbc076301f7d610c16407a1ebb230766dbe007a48725" -dependencies = [ - "ark-bls12-381 0.4.0", - "ark-ec 0.4.2", - "ark-ff 0.4.2", - "ark-serialize 0.4.2", - "curve25519-dalek", - "ecdsa", - "ed25519-dalek", - "elliptic-curve", - "generic-array", - "getrandom 0.2.16", - "hex-literal", - "hmac", - "k256", - "num-derive", - "num-integer", - "num-traits", - "p256", - "rand 0.8.5", - "rand_chacha 0.3.1", - "sec1", - "sha2", - "sha3", - "soroban-builtin-sdk-macros 23.0.1", - "soroban-env-common 23.0.1", - "soroban-wasmi", + "soroban-env-common", "static_assertions", - "stellar-strkey 0.0.13", - "wasmparser", ] [[package]] @@ -1685,48 +1379,11 @@ version = "25.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dc699ee49eb479b10243e92141ce5055bce93370b15bbc288e3a04460522b11" dependencies = [ - "ark-bls12-381 0.4.0", - "ark-bn254 0.4.0", - "ark-ec 0.4.2", - "ark-ff 0.4.2", - "ark-serialize 0.4.2", - "curve25519-dalek", - "ecdsa", - "ed25519-dalek", - "elliptic-curve", - "generic-array", - "getrandom 0.2.16", - "hex-literal", - "hmac", - "k256", - "num-derive", - "num-integer", - "num-traits", - "p256", - "rand 0.8.5", - "rand_chacha 0.3.1", - "sec1", - "sha2", - "sha3", - "soroban-builtin-sdk-macros 25.2.2", - "soroban-env-common 25.2.2", - "soroban-wasmi", - "static_assertions", - "stellar-strkey 0.0.13", - "wasmparser", -] - -[[package]] -name = "soroban-env-host" -version = "26.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "755806fedf2c948e882dff4bf69a8e844c9950b1d534abcadba4026150180274" -dependencies = [ - "ark-bls12-381 0.5.0", - "ark-bn254 0.5.0", - "ark-ec 0.5.0", - "ark-ff 0.5.0", - "ark-serialize 0.5.0", + "ark-bls12-381", + "ark-bn254", + "ark-ec", + "ark-ff", + "ark-serialize", "curve25519-dalek", "ecdsa", "ed25519-dalek", @@ -1745,56 +1402,26 @@ dependencies = [ "sec1", "sha2", "sha3", - "soroban-builtin-sdk-macros 26.1.4", - "soroban-env-common 26.1.4", + "soroban-builtin-sdk-macros", + "soroban-env-common", "soroban-wasmi", "static_assertions", "stellar-strkey 0.0.13", "wasmparser", ] -[[package]] -name = "soroban-env-macros" -version = "23.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0e6a1c5844257ce96f5f54ef976035d5bd0ee6edefaf9f5e0bcb8ea4b34228c" -dependencies = [ - "itertools 0.10.5", - "proc-macro2", - "quote", - "serde", - "serde_json", - "stellar-xdr 23.0.0", - "syn 2.0.101", -] - [[package]] name = "soroban-env-macros" version = "25.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bfa1fced23738aa5d7f0931f0021193824dd3902094b41aba93bd54e2490b64" dependencies = [ - "itertools 0.10.5", - "proc-macro2", - "quote", - "serde", - "serde_json", - "stellar-xdr 25.0.0", - "syn 2.0.101", -] - -[[package]] -name = "soroban-env-macros" -version = "26.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e446ac7f005d89cb77cc4e2cc006377e1a8c970c9b05d11968a32f78e10e4ef4" -dependencies = [ - "itertools 0.13.0", + "itertools", "proc-macro2", "quote", "serde", "serde_json", - "stellar-xdr 26.0.1", + "stellar-xdr", "syn 2.0.101", ] @@ -1807,30 +1434,11 @@ dependencies = [ "serde", "serde_json", "serde_with", - "soroban-env-common 25.2.2", - "soroban-env-host 25.2.2", + "soroban-env-common", + "soroban-env-host", "thiserror", ] -[[package]] -name = "soroban-sdk" -version = "23.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd1e11f9fd537f9df29ec1a66c1b78d666094df56e196565d292ebf9a72732b4" -dependencies = [ - "bytes-lit", - "crate-git-revision", - "rand 0.8.5", - "rustc_version", - "serde", - "serde_json", - "soroban-env-guest 23.0.1", - "soroban-env-host 23.0.1", - "soroban-sdk-macros 23.5.3", - "stellar-strkey 0.0.16", - "visibility", -] - [[package]] name = "soroban-sdk" version = "25.3.2" @@ -1847,53 +1455,14 @@ dependencies = [ "rustc_version", "serde", "serde_json", - "soroban-env-guest 25.2.2", - "soroban-env-host 25.2.2", + "soroban-env-guest", + "soroban-env-host", "soroban-ledger-snapshot", - "soroban-sdk-macros 25.3.2", - "stellar-strkey 0.0.16", - "visibility", -] - -[[package]] -name = "soroban-sdk" -version = "26.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce2a22afcbfc9407fe32ce789f441636d62cd078a4cc126191932b74b1e6c4" -dependencies = [ - "bytes-lit", - "crate-git-revision", - "rand 0.8.5", - "rustc_version", - "serde", - "serde_json", - "soroban-env-guest 26.1.4", - "soroban-env-host 26.1.4", - "soroban-sdk-macros 26.1.1", + "soroban-sdk-macros", "stellar-strkey 0.0.16", "visibility", ] -[[package]] -name = "soroban-sdk-macros" -version = "23.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caa7114e2f031b6fbd30376e844f3c55f6daf56f6f9d33ce309f846ffced316d" -dependencies = [ - "darling", - "heck", - "itertools 0.10.5", - "macro-string", - "proc-macro2", - "quote", - "sha2", - "soroban-env-common 23.0.1", - "soroban-spec 23.5.3", - "soroban-spec-rust 23.5.3", - "stellar-xdr 23.0.0", - "syn 2.0.101", -] - [[package]] name = "soroban-sdk-macros" version = "25.3.2" @@ -1902,50 +1471,18 @@ checksum = "85096a9b56a5ba3e8b2c7baa8d66fd6a806799ed68c8f50ed7c3092f5d110268" dependencies = [ "darling", "heck", - "itertools 0.10.5", - "macro-string", - "proc-macro2", - "quote", - "sha2", - "soroban-env-common 25.2.2", - "soroban-spec 25.3.2", - "soroban-spec-rust 25.3.2", - "stellar-xdr 25.0.0", - "syn 2.0.101", -] - -[[package]] -name = "soroban-sdk-macros" -version = "26.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6538ceb7d40c01499c2779b449a697c56c62a60bae6e5c5705d3a782075b5028" -dependencies = [ - "darling", - "heck", - "itertools 0.13.0", + "itertools", "macro-string", "proc-macro2", "quote", "sha2", - "soroban-env-common 26.1.4", - "soroban-spec 26.1.1", - "soroban-spec-rust 26.1.1", - "stellar-xdr 26.0.1", + "soroban-env-common", + "soroban-spec", + "soroban-spec-rust", + "stellar-xdr", "syn 2.0.101", ] -[[package]] -name = "soroban-spec" -version = "23.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1303589e67e7c76d0571b8d797b75f9fa33a1ceb1b4361a981570a3ebf00ac19" -dependencies = [ - "base64", - "stellar-xdr 23.0.0", - "thiserror", - "wasmparser", -] - [[package]] name = "soroban-spec" version = "25.3.2" @@ -1954,40 +1491,11 @@ checksum = "ddff27bf9f759efca36eef385a098b36392266e2604df756e1a70a4c45089f70" dependencies = [ "base64", "sha2", - "stellar-xdr 25.0.0", - "thiserror", - "wasmparser", -] - -[[package]] -name = "soroban-spec" -version = "26.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca18ced644f86e1e36a0fddb856d45a6a8478296e6b54941fb5e2daa96076bf7" -dependencies = [ - "base64", - "sha2", - "stellar-xdr 26.0.1", + "stellar-xdr", "thiserror", "wasmparser", ] -[[package]] -name = "soroban-spec-rust" -version = "23.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956188f28b750b80a2bb4cd5698038746edae1be51ec19a29c7efc6dcd922e5f" -dependencies = [ - "prettyplease", - "proc-macro2", - "quote", - "sha2", - "soroban-spec 23.5.3", - "stellar-xdr 23.0.0", - "syn 2.0.101", - "thiserror", -] - [[package]] name = "soroban-spec-rust" version = "25.3.2" @@ -1998,24 +1506,8 @@ dependencies = [ "proc-macro2", "quote", "sha2", - "soroban-spec 25.3.2", - "stellar-xdr 25.0.0", - "syn 2.0.101", - "thiserror", -] - -[[package]] -name = "soroban-spec-rust" -version = "26.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f3e3933a8ca588de7fb70460a48a5e0b043f43836aeb11b6aa0128143d95814" -dependencies = [ - "prettyplease", - "proc-macro2", - "quote", - "sha2", - "soroban-spec 26.1.1", - "stellar-xdr 26.0.1", + "soroban-spec", + "stellar-xdr", "syn 2.0.101", "thiserror", ] @@ -2063,32 +1555,32 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "stellar-access" -version = "0.5.1" -source = "git+https://github.com/OpenZeppelin/stellar-contracts?tag=v0.5.1#372a162a6df8aed108befa5573d30a8ca49cb271" +version = "0.7.0" +source = "git+https://github.com/OpenZeppelin/stellar-contracts?tag=v0.7.0#9e8df92a065bff9ffa595b3697f4bd3c243a6d02" dependencies = [ - "soroban-sdk 23.5.3", + "soroban-sdk", ] [[package]] name = "stellar-contract-utils" -version = "0.7.2" -source = "git+https://github.com/OpenZeppelin/stellar-contracts?tag=v0.7.2#a9c42169000638da937577f592ebf61a7a3c94ca" +version = "0.7.0" +source = "git+https://github.com/OpenZeppelin/stellar-contracts?tag=v0.7.0#9e8df92a065bff9ffa595b3697f4bd3c243a6d02" dependencies = [ - "soroban-sdk 26.1.1", + "soroban-sdk", ] [[package]] name = "stellar-governance" -version = "0.7.2" -source = "git+https://github.com/OpenZeppelin/stellar-contracts?tag=v0.7.2#a9c42169000638da937577f592ebf61a7a3c94ca" +version = "0.7.0" +source = "git+https://github.com/OpenZeppelin/stellar-contracts?tag=v0.7.0#9e8df92a065bff9ffa595b3697f4bd3c243a6d02" dependencies = [ - "soroban-sdk 26.1.1", + "soroban-sdk", ] [[package]] name = "stellar-macros" -version = "0.7.2" -source = "git+https://github.com/OpenZeppelin/stellar-contracts?tag=v0.7.2#a9c42169000638da937577f592ebf61a7a3c94ca" +version = "0.7.0" +source = "git+https://github.com/OpenZeppelin/stellar-contracts?tag=v0.7.0#9e8df92a065bff9ffa595b3697f4bd3c243a6d02" dependencies = [ "proc-macro2", "quote", @@ -2118,32 +1610,14 @@ dependencies = [ [[package]] name = "stellar-tokens" -version = "0.7.2" -source = "git+https://github.com/OpenZeppelin/stellar-contracts?tag=v0.7.2#a9c42169000638da937577f592ebf61a7a3c94ca" +version = "0.7.0" +source = "git+https://github.com/OpenZeppelin/stellar-contracts?tag=v0.7.0#9e8df92a065bff9ffa595b3697f4bd3c243a6d02" dependencies = [ - "soroban-sdk 26.1.1", + "soroban-sdk", "stellar-contract-utils", "stellar-governance", ] -[[package]] -name = "stellar-xdr" -version = "23.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d2848e1694b0c8db81fd812bfab5ea71ee28073e09ccc45620ef3cf7a75a9b" -dependencies = [ - "base64", - "cfg_eval", - "crate-git-revision", - "escape-bytes", - "ethnum", - "hex", - "serde", - "serde_with", - "sha2", - "stellar-strkey 0.0.13", -] - [[package]] name = "stellar-xdr" version = "25.0.0" @@ -2163,24 +1637,6 @@ dependencies = [ "stellar-strkey 0.0.13", ] -[[package]] -name = "stellar-xdr" -version = "26.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6e29c7e1f071c2767916460d006668197843d5d93f0ec8893a26f72a14f595" -dependencies = [ - "base64", - "cfg_eval", - "crate-git-revision", - "escape-bytes", - "ethnum", - "hex", - "serde", - "serde_with", - "sha2", - "stellar-strkey 0.0.13", -] - [[package]] name = "strsim" version = "0.11.1" @@ -2215,17 +1671,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "syn" -version = "3.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6275cddf4610d1775e6d1fe9469b2e77d0f39fd98fb7450901b821e0c53649f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - [[package]] name = "tempfile" version = "3.23.0" diff --git a/Cargo.toml b/Cargo.toml index 5bb04893..f6548500 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ version = "25.3.1" [workspace.dependencies.stellar-access] git = "https://github.com/OpenZeppelin/stellar-contracts" -tag = "v0.5.1" +tag = "v0.7.0" [workspace.dependencies.stellar-default-impl-macro] git = "https://github.com/OpenZeppelin/stellar-contracts" @@ -26,7 +26,7 @@ tag = "v0.3.0" [workspace.dependencies.stellar-macros] git = "https://github.com/OpenZeppelin/stellar-contracts" -tag = "v0.5.1" +tag = "v0.7.0" [workspace.dependencies.stellar-non-fungible] git = "https://github.com/OpenZeppelin/stellar-contracts" @@ -42,7 +42,7 @@ tag = "v0.3.0" [workspace.dependencies.stellar-tokens] git = "https://github.com/OpenZeppelin/stellar-contracts" -tag = "v0.5.1" +tag = "v0.7.0" [profile.release] opt-level = "z" diff --git a/contracts/prompt-hash/gas-baselines.json b/contracts/prompt-hash/gas-baselines.json index e7da8b9b..03d0c6f0 100644 --- a/contracts/prompt-hash/gas-baselines.json +++ b/contracts/prompt-hash/gas-baselines.json @@ -6,6 +6,7 @@ "operations": { "constructor": { "cpu": 0, "mem": 0 }, "create_prompt": { "cpu": 0, "mem": 0 }, + "create_prompt_batch": { "cpu": 0, "mem": 0 }, "set_prompt_sale_status": { "cpu": 0, "mem": 0 }, "set_prompt_max_supply": { "cpu": 0, "mem": 0 }, "update_prompt_price": { "cpu": 0, "mem": 0 }, diff --git a/contracts/prompt-hash/src/contract.rs b/contracts/prompt-hash/src/contract.rs index b868c0f0..8edf6f6d 100644 --- a/contracts/prompt-hash/src/contract.rs +++ b/contracts/prompt-hash/src/contract.rs @@ -2,9 +2,10 @@ use super::events::Events; use super::storage::Storage; use super::types::{ Bundle, BundlePurchase, ClassificationOverride, DataKey, Error, ListingConfig, - PriceHistoryEntry, Prompt, PromptEncryptedPayload, PromptHashTrait, Purchase, ReferralCode, - Settlement, Split, Stake, Subscription, SubscriptionConfig, ALL_CLASSIFICATIONS, - MAX_BUNDLE_DESC_LEN, MAX_BUNDLE_ITEMS, MAX_BUNDLE_TITLE_LEN, VALID_DISCLOSURE_FLAGS, + PriceHistoryEntry, Prompt, PromptEncryptedPayload, PromptHashTrait, PromptInput, Purchase, + ReferralCode, Settlement, Split, Stake, Subscription, SubscriptionConfig, + Discount, ALL_CLASSIFICATIONS, MAX_BUNDLE_DESC_LEN, MAX_BUNDLE_ITEMS, MAX_BUNDLE_TITLE_LEN, + VALID_DISCLOSURE_FLAGS, }; use soroban_sdk::{contract, contractimpl, token, Address, Bytes, BytesN, Env, String, Vec}; use stellar_access::ownable::{self as ownable, Ownable}; @@ -166,6 +167,93 @@ impl PromptHashTrait for PromptHashContract { Ok(prompt_id) } + fn create_prompt_batch( + env: Env, + creator: Address, + prompts: Vec, + ) -> Result, Error> { + creator.require_auth(); + Storage::require_no_reentrancy(&env)?; + ensure(!Storage::is_paused(&env), Error::ContractIsPaused)?; + ensure(!prompts.is_empty(), Error::InvalidPrice)?; + + let mut ids = Vec::new(&env); + for input in prompts.iter() { + validate_prompt_fields( + &input.image_url, + &input.title, + &input.category, + &input.preview_text, + &input.encrypted_prompt, + &input.encryption_iv, + &input.wrapped_key, + input.listing.price, + )?; + + validate_token_contract(&env, &input.listing.asset)?; + + if input.listing.expires_at != 0 { + ensure( + input.listing.expires_at > env.ledger().timestamp(), + Error::InvalidPrice, + )?; + } + + validate_splits(&env, &input.listing.splits)?; + + let classification = String::from_str(&env, "general"); + let safety_flags: Vec = Vec::new(&env); + + let prompt_id = Storage::get_prompt_counter(&env); + let prompt = Prompt { + id: prompt_id, + creator: creator.clone(), + image_url: input.image_url.clone(), + title: input.title.clone(), + category: input.category.clone(), + preview_text: input.preview_text.clone(), + encrypted_prompt: input.encrypted_prompt.clone(), + encryption_iv: input.encryption_iv.clone(), + wrapped_key: input.wrapped_key.clone(), + content_hash: input.content_hash.clone(), + price_stroops: input.listing.price, + asset: input.listing.asset.clone(), + active: true, + sales_count: 0, + max_supply: 0, + expires_at: input.listing.expires_at, + splits: input.listing.splits.clone(), + classification, + safety_flags, + encryption_version: 1, + }; + + Storage::save_prompt(&env, &prompt)?; + Storage::set_encryption_version_counter(&env, prompt_id, 1); + Storage::add_prompt_to_creator(&env, &creator, prompt_id); + Storage::add_price_history_entry( + &env, + prompt_id, + &PriceHistoryEntry { + previous_price: 0, + new_price: input.listing.price, + changed_at: env.ledger().timestamp(), + seq: 1, + }, + ); + Events::emit_prompt_created( + &env, + prompt_id, + creator.clone(), + input.listing.price, + input.listing.asset.clone(), + ); + ids.push_back(prompt_id); + } + + Ok(ids) + } + fn set_prompt_sale_status( env: Env, creator: Address, diff --git a/contracts/prompt-hash/src/storage.rs b/contracts/prompt-hash/src/storage.rs index 739be88c..06f6f8e7 100644 --- a/contracts/prompt-hash/src/storage.rs +++ b/contracts/prompt-hash/src/storage.rs @@ -3,6 +3,7 @@ use super::types::{ Prompt, PromptEncryptedPayload, Purchase, ReferralCode, Settlement, Stake, Subscription, SubscriptionConfig, }; +use soroban_sdk::String; use soroban_sdk::{token, Address, BytesN, Env, Vec}; pub const DAY_IN_LEDGERS: u32 = 17280; @@ -607,38 +608,6 @@ impl Storage { addr } - // ─── #272: Prompt Bundles ────────────────────────────────────────────── - - pub fn get_bundle_counter(env: &Env) -> u128 { - let key = DataKey::BundleCounter; - let count = env.storage().persistent().get(&key).unwrap_or(0); - if env.storage().persistent().has(&key) { - Self::extend_key_ttl(env, &key); - } - count - } - - pub fn save_bundle(env: &Env, bundle: &Bundle) -> Result<(), Error> { - let key = DataKey::Bundle(bundle.id); - env.storage().persistent().set(&key, bundle); - Self::extend_key_ttl(env, &key); - - let counter_key = DataKey::BundleCounter; - let next_id = bundle.id.checked_add(1).ok_or(Error::ArithmeticOverflow)?; - env.storage().persistent().set(&counter_key, &next_id); - Self::extend_key_ttl(env, &counter_key); - Ok(()) - } - - pub fn get_bundle(env: &Env, bundle_id: u128) -> Option { - let key = DataKey::Bundle(bundle_id); - let bundle = env.storage().persistent().get(&key); - if env.storage().persistent().has(&key) { - Self::extend_key_ttl(env, &key); - } - bundle - } - // ─── Promotional Pricing ────────────────────────────────────────────── pub fn set_active_promotion(env: &Env, prompt_id: u128, promotion: &super::types::Promotion) { diff --git a/contracts/prompt-hash/src/test.rs b/contracts/prompt-hash/src/test.rs index 52504fb9..aa2970ca 100644 --- a/contracts/prompt-hash/src/test.rs +++ b/contracts/prompt-hash/src/test.rs @@ -1,7 +1,7 @@ use crate::contract::{PromptHashContract, PromptHashContractClient}; use crate::mock_asset::FungibleTokenContract; use crate::storage::Storage; -use crate::types::{Error, ListingConfig, Split}; +use crate::types::{Error, ListingConfig, PromptInput, Split}; extern crate std; use soroban_sdk::{ testutils::{Address as _, Events as _, Ledger}, @@ -6628,3 +6628,105 @@ fn test_repeated_operations_preserve_idempotency() { assert!(!client.get_prompt(&prompt_id).active); } + +// ═══════════════════════════════════════════════════════════════════════════════ +// Batch Prompt Creation Tests +// ═══════════════════════════════════════════════════════════════════════════════ + +fn make_batch_input( + env: &Env, + title: &str, + price: i128, + asset: &Address, +) -> PromptInput { + PromptInput { + image_url: String::from_str(env, "https://example.com/prompt.png"), + title: String::from_str(env, title), + category: String::from_str(env, "Software Development"), + preview_text: String::from_str(env, "Generate a production-ready implementation plan."), + encrypted_prompt: String::from_str(env, "ciphertext"), + encryption_iv: String::from_str(env, "iv"), + wrapped_key: String::from_str(env, "wrapped-key"), + content_hash: hash(env, 7), + listing: ListingConfig { + price, + asset: asset.clone(), + expires_at: 0, + splits: Vec::new(env), + }, + } +} + +#[test] +fn test_create_prompt_batch_creates_multiple_prompts() { + let env: Env = Default::default(); + let context = setup(&env); + let client = PromptHashContractClient::new(&env, &context.contract); + + let creator = Address::generate(&env); + let mut inputs = Vec::::new(&env); + inputs.push_back(make_batch_input(&env, "Batch Prompt A", 10_000, &context.xlm)); + inputs.push_back(make_batch_input(&env, "Batch Prompt B", 20_000, &context.xlm)); + inputs.push_back(make_batch_input(&env, "Batch Prompt C", 30_000, &context.xlm)); + + let ids = client.create_prompt_batch(&creator, &inputs); + assert_eq!(ids.len(), 3); + assert_eq!(ids.get(0).unwrap(), 0); + assert_eq!(ids.get(1).unwrap(), 1); + assert_eq!(ids.get(2).unwrap(), 2); + + // Verify each prompt was stored correctly + let p0 = client.get_prompt(&0); + assert_eq!(p0.title, String::from_str(&env, "Batch Prompt A")); + assert_eq!(p0.price_stroops, 10_000); + assert!(p0.active); + + let p1 = client.get_prompt(&1); + assert_eq!(p1.title, String::from_str(&env, "Batch Prompt B")); + assert_eq!(p1.price_stroops, 20_000); + + let p2 = client.get_prompt(&2); + assert_eq!(p2.title, String::from_str(&env, "Batch Prompt C")); + assert_eq!(p2.price_stroops, 30_000); + + // Verify creator catalog + let by_creator = client.get_prompts_by_creator(&creator); + assert_eq!(by_creator.len(), 3); +} + +#[test] +fn test_create_prompt_batch_single_item() { + let env: Env = Default::default(); + let context = setup(&env); + let client = PromptHashContractClient::new(&env, &context.contract); + + let creator = Address::generate(&env); + let mut inputs = Vec::::new(&env); + inputs.push_back(make_batch_input(&env, "Solo Batch", 5_000, &context.xlm)); + + let ids = client.create_prompt_batch(&creator, &inputs); + assert_eq!(ids.len(), 1); + assert_eq!(ids.get(0).unwrap(), 0); + + let p = client.get_prompt(&0); + assert_eq!(p.title, String::from_str(&env, "Solo Batch")); +} + +#[test] +fn test_create_prompt_batch_empty_fails() { + let env: Env = Default::default(); + let context = setup(&env); + let client = PromptHashContractClient::new(&env, &context.contract); + + let creator = Address::generate(&env); + let inputs = Vec::::new(&env); + + let result = client.try_create_prompt_batch(&creator, &inputs); + match result { + Err(Ok(Error::InvalidPrice)) => {} + other => panic!( + "expected InvalidPrice for empty batch, got {:?}", + other + ), + } +} diff --git a/contracts/prompt-hash/src/types.rs b/contracts/prompt-hash/src/types.rs index 3a5ad48b..131013d4 100644 --- a/contracts/prompt-hash/src/types.rs +++ b/contracts/prompt-hash/src/types.rs @@ -147,6 +147,7 @@ pub enum DataKey { Discount(u128), // #192 – per-prompt price history log. PriceHistory(u128), + PromptExpiryWarning(u128), } /// #192 – A single recorded price change for a prompt. @@ -166,7 +167,6 @@ pub struct PriceHistoryEntry { /// Monotonic per-prompt sequence number, starting at 1 for the initial /// listing price. Used to keep history entries ordered and de-duplicated. pub seq: u64, - PromptExpiryWarning(u128), } #[contracttype] @@ -214,6 +214,17 @@ pub struct Promotion { pub asset: Address, } +#[contracttype] +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct Settlement { + pub buyer_amount: i128, + pub creator_amount: i128, + pub platform_amount: i128, + pub referrer: Option
, + pub referrer_amount: i128, + pub split_amount: i128, +} + #[contracttype] #[derive(Clone, Debug, Eq, PartialEq)] pub struct Purchase { @@ -263,6 +274,24 @@ pub struct ListingConfig { pub splits: Vec, } +/// Input payload for a single prompt in a batch-creation call. +/// Mirrors the individual parameters of `create_prompt` but packaged into +/// one Soroban-transportable struct so the batch entrypoint can accept a +/// `Vec` instead of repeating the full parameter list. +#[contracttype] +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct PromptInput { + pub image_url: String, + pub title: String, + pub category: String, + pub preview_text: String, + pub encrypted_prompt: String, + pub encryption_iv: String, + pub wrapped_key: String, + pub content_hash: BytesN<32>, + pub listing: ListingConfig, +} + /// Canonical taxonomy for content classification. /// Creators attest one of these categories for each listing. /// Uses `None` variant as default (unnamed). @@ -406,6 +435,12 @@ pub trait PromptHashTrait { listing: ListingConfig, ) -> Result; + fn create_prompt_batch( + env: Env, + creator: Address, + prompts: Vec, + ) -> Result, Error>; + fn set_prompt_sale_status( env: Env, creator: Address, @@ -543,12 +578,18 @@ pub trait PromptHashTrait { fn get_fee_percentage(env: Env) -> u32; fn get_fee_wallet(env: Env) -> Option
; fn set_referral_percentage(env: Env, new_referral_percentage: u32) -> Result<(), Error>; - fn get_referral_percentage(env: Env) -> u32; - fn register_referral_code( + fn get_referral_percentage(env: Env) -> u32; fn register_referral_code( env: Env, referrer: Address, code_hash: BytesN<32>, ) -> Result<(), Error>; + + fn revoke_referral_code( + env: Env, + referrer: Address, + code_hash: BytesN<32>, + ) -> Result<(), Error>; + fn set_pause_status( env: Env, paused: bool,