diff --git a/.gitignore b/.gitignore index 8cb6ce94..38e54451 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,6 @@ yarn-error.log* # Local Netlify folder .netlify + +# Storacha proof and keys +.storacha diff --git a/.soroban/soroban_domain_id b/.soroban/soroban_domain_id index 111d4875..a4408654 100644 --- a/.soroban/soroban_domain_id +++ b/.soroban/soroban_domain_id @@ -1 +1 @@ -CDGNT7DB7BC6LFAAQ4BZGZYOC5UMSR55KOZGALVOPODLKMINQWACHKZF +CDBITX57Q6Y7QP4BJZNATYKILHT2VTERXLZ6NYG353WMB4T7BCBNNUV2 diff --git a/.soroban/soroban_versioning_id b/.soroban/soroban_versioning_id index 3bf51721..8e6eca26 100644 --- a/.soroban/soroban_versioning_id +++ b/.soroban/soroban_versioning_id @@ -1 +1 @@ -CCHZAAUJJZOCFZVTQWGZU4PXR7SFB5PL3XBSHUBNQPXJ3KWE4VFHOBE5 +CB6EA5V4T5Z5XXOKHRU5MNYTZ2QESR4STUW6EBLA4HXYZ2BPVMCHRHUR diff --git a/Cargo.lock b/Cargo.lock index 55b4b6fa..b9e7d719 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,20 +3,17 @@ version = 3 [[package]] -name = "addr2line" -version = "0.24.2" +name = "ahash" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ - "gimli", + "cfg-if", + "once_cell", + "version_check", + "zerocopy", ] -[[package]] -name = "adler2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" - [[package]] name = "android-tzdata" version = "0.1.1" @@ -42,37 +39,134 @@ dependencies = [ ] [[package]] -name = "autocfg" -version = "1.4.0" +name = "ark-bls12-381" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] [[package]] -name = "backtrace" -version = "0.3.74" +name = "ark-ec" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools", + "num-traits", + "zeroize", ] [[package]] -name = "base16ct" -version = "0.2.0" +name = "ark-ff" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] -name = "base32" +name = "ark-std" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23ce669cd6c8588f79e15cf450314f9638f967fc5770ff1c7c1deb0925ea7cfa" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" @@ -128,14 +222,14 @@ dependencies = [ "num-bigint", "proc-macro2", "quote", - "syn", + "syn 2.0.90", ] [[package]] name = "cc" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc" +checksum = "27f657647bcff5394bf56c7317665bbf790a137a50eaaa5c6bfbb9e27a518f2d" dependencies = [ "shlex", ] @@ -220,7 +314,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501" dependencies = [ "quote", - "syn", + "syn 2.0.90", ] [[package]] @@ -247,7 +341,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.90", ] [[package]] @@ -271,7 +365,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn", + "syn 2.0.90", ] [[package]] @@ -282,9 +376,15 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn", + "syn 2.0.90", ] +[[package]] +name = "data-encoding" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" + [[package]] name = "der" version = "0.7.9" @@ -305,6 +405,17 @@ dependencies = [ "serde", ] +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "derive_arbitrary" version = "1.3.2" @@ -313,7 +424,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.90", ] [[package]] @@ -460,12 +571,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "gimli" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" - [[package]] name = "group" version = "0.13.0" @@ -483,6 +588,15 @@ 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" +dependencies = [ + "ahash", +] + [[package]] name = "hashbrown" version = "0.15.2" @@ -572,9 +686,9 @@ checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590" [[package]] name = "itertools" -version = "0.11.0" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ "either", ] @@ -587,9 +701,9 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "js-sys" -version = "0.3.74" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a865e038f7f6ed956f788f0d7d60c541fff74c7bd74272c5d4cf15c63743e705" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" dependencies = [ "once_cell", "wasm-bindgen", @@ -640,15 +754,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "miniz_oxide" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" -dependencies = [ - "adler2", -] - [[package]] name = "num-bigint" version = "0.4.6" @@ -673,7 +778,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.90", ] [[package]] @@ -694,15 +799,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "object" -version = "0.36.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" -dependencies = [ - "memchr", -] - [[package]] name = "once_cell" version = "1.20.2" @@ -759,7 +855,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn", + "syn 2.0.90", ] [[package]] @@ -829,12 +925,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - [[package]] name = "rustc_version" version = "0.4.1" @@ -886,7 +976,7 @@ checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.90", ] [[package]] @@ -928,7 +1018,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 2.0.90", ] [[package]] @@ -976,21 +1066,21 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "soroban-builtin-sdk-macros" -version = "21.2.1" +version = "22.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f57a68ef8777e28e274de0f3a88ad9a5a41d9a2eb461b4dd800b086f0e83b80" +checksum = "df6c3137afcdb5a62b9ed3b1994ff9439351eaa795d8d33f758b4386ce2d0060" dependencies = [ "itertools", "proc-macro2", "quote", - "syn", + "syn 2.0.90", ] [[package]] name = "soroban-env-common" -version = "21.2.1" +version = "22.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd1c89463835fe6da996318156d39f424b4f167c725ec692e5a7a2d4e694b3d" +checksum = "24deb45507c219d3608f04768c3b700b627bc345cc4c19e31c4cc57fc7d77be9" dependencies = [ "arbitrary", "crate-git-revision", @@ -1007,9 +1097,9 @@ dependencies = [ [[package]] name = "soroban-env-guest" -version = "21.2.1" +version = "22.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bfb2536811045d5cd0c656a324cbe9ce4467eb734c7946b74410d90dea5d0ce" +checksum = "6b010a822db635139fcfdb29be8a333606e5204c445e044d3450a5c47eaba20a" dependencies = [ "soroban-env-common", "static_assertions", @@ -1017,11 +1107,14 @@ dependencies = [ [[package]] name = "soroban-env-host" -version = "21.2.1" +version = "22.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b7a32c28f281c423189f1298960194f0e0fc4eeb72378028171e556d8cd6160" +checksum = "5ee57de1756bae449a52da032c8312113f355cbcf7e906fbb8957a44827999dc" dependencies = [ - "backtrace", + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", "curve25519-dalek", "ecdsa", "ed25519-dalek", @@ -1050,9 +1143,9 @@ dependencies = [ [[package]] name = "soroban-env-macros" -version = "21.2.1" +version = "22.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "242926fe5e0d922f12d3796cd7cd02dd824e5ef1caa088f45fce20b618309f64" +checksum = "1528c2d0d19ab70e9947f930f8707fdc0e9bfd4baf6d275b8a2f67482c2f2d99" dependencies = [ "itertools", "proc-macro2", @@ -1060,14 +1153,14 @@ dependencies = [ "serde", "serde_json", "stellar-xdr", - "syn", + "syn 2.0.90", ] [[package]] name = "soroban-ledger-snapshot" -version = "21.7.7" +version = "22.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6edf92749fd8399b417192d301c11f710b9cdce15789a3d157785ea971576fa" +checksum = "b06e52ea3d90c64d3e91c38bc028dc9d4efacb6c5fc9551dc4a7965a6bd2457d" dependencies = [ "serde", "serde_json", @@ -1079,9 +1172,9 @@ dependencies = [ [[package]] name = "soroban-sdk" -version = "21.7.7" +version = "22.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dcdf04484af7cc731a7a48ad1d9f5f940370edeea84734434ceaf398a6b862e" +checksum = "a905c0899728cd744f712486ae423a29e84d6f0a5f273e7731955fec0926eb01" dependencies = [ "arbitrary", "bytes-lit", @@ -1101,9 +1194,9 @@ dependencies = [ [[package]] name = "soroban-sdk-macros" -version = "21.7.7" +version = "22.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0974e413731aeff2443f2305b344578b3f1ffd18335a7ba0f0b5d2eb4e94c9ce" +checksum = "76115bd7be33f2d4424d1e6138a7e362713092f1ede069d24c8bf195da30270b" dependencies = [ "crate-git-revision", "darling", @@ -1116,14 +1209,14 @@ dependencies = [ "soroban-spec", "soroban-spec-rust", "stellar-xdr", - "syn", + "syn 2.0.90", ] [[package]] name = "soroban-spec" -version = "21.7.7" +version = "22.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2c70b20e68cae3ef700b8fa3ae29db1c6a294b311fba66918f90cb8f9fd0a1a" +checksum = "3e068bfda25b447ace1a11d1ed61cc6206cd7ef5ff1c7534042ca8b667ab7413" dependencies = [ "base64 0.13.1", "stellar-xdr", @@ -1133,9 +1226,9 @@ dependencies = [ [[package]] name = "soroban-spec-rust" -version = "21.7.7" +version = "22.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2dafbde981b141b191c6c036abc86097070ddd6eaaa33b273701449501e43d3" +checksum = "f18ff7db55d4db2477a458ede3bc03fee81057e5e128311e4f9a8813f27cbf4c" dependencies = [ "prettyplease", "proc-macro2", @@ -1143,7 +1236,7 @@ dependencies = [ "sha2", "soroban-spec", "stellar-xdr", - "syn", + "syn 2.0.90", "thiserror", ] @@ -1184,20 +1277,20 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "stellar-strkey" -version = "0.0.8" +version = "0.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12d2bf45e114117ea91d820a846fd1afbe3ba7d717988fee094ce8227a3bf8bd" +checksum = "5e3aa3ed00e70082cb43febc1c2afa5056b9bb3e348bbb43d0cd0aa88a611144" dependencies = [ - "base32", "crate-git-revision", + "data-encoding", "thiserror", ] [[package]] name = "stellar-xdr" -version = "21.2.0" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2675a71212ed39a806e415b0dbf4702879ff288ec7f5ee996dda42a135512b50" +checksum = "20c2130275cc730d042b3082f51145f0486f5a543d6d72fced02ed9048b82b57" dependencies = [ "arbitrary", "base64 0.13.1", @@ -1221,6 +1314,17 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "syn" version = "2.0.90" @@ -1249,7 +1353,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.90", ] [[package]] @@ -1317,9 +1421,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d15e63b4482863c109d70a7b8706c1e364eb6ea449b201a76c5b89cedcec2d5c" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" dependencies = [ "cfg-if", "once_cell", @@ -1328,24 +1432,23 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d36ef12e3aaca16ddd3f67922bc63e48e953f126de60bd33ccc0101ef9998cd" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.90", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "705440e08b42d3e4b36de7d66c944be628d579796b8090bfa3471478a2260051" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1353,22 +1456,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98c9ae5a76e46f4deecd0f0255cc223cfa18dc9b261213b8aa0c7b36f61b3f1d" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.90", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ee99da9c5ba11bd675621338ef6fa52296b76b83305e9b6e5c77d4c286d6d49" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" [[package]] name = "wasmi_arena" @@ -1498,7 +1601,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.90", ] [[package]] @@ -1506,3 +1609,17 @@ name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] diff --git a/Cargo.toml b/Cargo.toml index 9def65f9..a147020d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ members = [ ] [workspace.dependencies] -soroban-sdk = "21.7.7" +soroban-sdk = "22.0.1" [profile.release] opt-level = "z" diff --git a/Makefile b/Makefile index d6bd161a..45208c5e 100644 --- a/Makefile +++ b/Makefile @@ -83,25 +83,20 @@ contract_bindings: contract_build-release ## Create bindings --output-dir dapp/packages/soroban_versioning \ --overwrite && \ cd dapp/packages/soroban_versioning && \ - bun run build + bun run build && \ + cd ../.. && \ + bun formatter contract_deploy: ## Deploy Soroban contract to testnet stellar contract deploy \ --wasm target/wasm32-unknown-unknown/release/versioning.optimized.wasm \ --source-account mando-$(network) \ --network $(network) \ + -- \ + --admin $(shell soroban keys address mando-$(network)) \ > .soroban/soroban_versioning_id && \ cat .soroban/soroban_versioning_id -contract_init: - stellar contract invoke \ - --source-account mando-$(network) \ - --network $(network) \ - --id $(shell cat .soroban/soroban_versioning_id) \ - -- \ - init \ - --admin $(shell soroban keys address mando-$(network)) - contract_upgrade: ## After manually pulling the wasm from the pipeline, update the contract stellar contract invoke \ --source-account mando-$(network) \ diff --git a/contracts/versioning/src/contract_dao.rs b/contracts/versioning/src/contract_dao.rs index 36af5b95..7ea7c462 100644 --- a/contracts/versioning/src/contract_dao.rs +++ b/contracts/versioning/src/contract_dao.rs @@ -1,4 +1,4 @@ -use crate::{errors, types, DaoTrait, Tansu, TansuClient}; +use crate::{errors, types, DaoTrait, Tansu, TansuArgs, TansuClient}; use soroban_sdk::{contractimpl, panic_with_error, vec, Address, Bytes, Env, String, Vec}; const MAX_TITLE_LENGTH: u32 = 256; diff --git a/contracts/versioning/src/contract_tansu.rs b/contracts/versioning/src/contract_tansu.rs new file mode 100644 index 00000000..e85cfb90 --- /dev/null +++ b/contracts/versioning/src/contract_tansu.rs @@ -0,0 +1,25 @@ +use soroban_sdk::{contractimpl, Address, BytesN, Env}; + +use crate::{types, Tansu, TansuArgs, TansuClient, TansuTrait}; + +#[contractimpl] +impl TansuTrait for Tansu { + fn __constructor(env: Env, admin: Address) { + env.storage().instance().set(&types::DataKey::Admin, &admin); + } + + fn upgrade(env: Env, new_wasm_hash: BytesN<32>) { + let admin: Address = env + .storage() + .instance() + .get(&types::DataKey::Admin) + .unwrap(); + admin.require_auth(); + + env.deployer().update_current_contract_wasm(new_wasm_hash); + } + + fn version() -> u32 { + 1 + } +} diff --git a/contracts/versioning/src/contract_versioning.rs b/contracts/versioning/src/contract_versioning.rs index 6d6c4d05..210b6988 100644 --- a/contracts/versioning/src/contract_versioning.rs +++ b/contracts/versioning/src/contract_versioning.rs @@ -3,29 +3,10 @@ use soroban_sdk::{ String, Symbol, Val, Vec, }; -use crate::{domain_contract, errors, types, Tansu, TansuClient, VersioningTrait}; +use crate::{domain_contract, errors, types, Tansu, TansuArgs, TansuClient, VersioningTrait}; #[contractimpl] impl VersioningTrait for Tansu { - fn init(env: Env, admin: Address) { - env.storage().instance().set(&types::DataKey::Admin, &admin); - } - - fn upgrade(env: Env, new_wasm_hash: BytesN<32>) { - let admin: Address = env - .storage() - .instance() - .get(&types::DataKey::Admin) - .unwrap(); - admin.require_auth(); - - env.deployer().update_current_contract_wasm(new_wasm_hash); - } - - fn version() -> u32 { - 1 - } - /// Register a new Git projects and associated metadata. fn register( env: Env, diff --git a/contracts/versioning/src/lib.rs b/contracts/versioning/src/lib.rs index 9003518b..9d7a99ba 100755 --- a/contracts/versioning/src/lib.rs +++ b/contracts/versioning/src/lib.rs @@ -10,6 +10,7 @@ mod domain_contract { } mod contract_dao; +mod contract_tansu; mod contract_versioning; mod errors; mod test; @@ -20,13 +21,15 @@ contractmeta!(key = "Description", val = "Tansu - Soroban Versioning"); #[contract] pub struct Tansu; -pub trait VersioningTrait { - fn init(env: Env, admin: Address); +pub trait TansuTrait { + fn __constructor(env: Env, admin: Address); fn upgrade(env: Env, hash: BytesN<32>); fn version() -> u32; +} +pub trait VersioningTrait { fn register( env: Env, maintainer: Address, diff --git a/contracts/versioning/src/test.rs b/contracts/versioning/src/test.rs index 41f088e4..503947a8 100755 --- a/contracts/versioning/src/test.rs +++ b/contracts/versioning/src/test.rs @@ -15,7 +15,7 @@ fn test() { env.mock_all_auths(); // setup for Soroban Domain - let domain_contract_id = env.register_contract_wasm(None, domain_contract::WASM); + let domain_contract_id = env.register(domain_contract::WASM, ()); let domain_client = domain_contract::Client::new(&env, &domain_contract_id); let adm: Address = Address::generate(&env); @@ -45,11 +45,9 @@ fn test() { // setup for Tansu let contract_admin = Address::generate(&env); - let contract_id = env.register_contract(None, Tansu); + let contract_id = env.register(Tansu, (&contract_admin,)); let contract = TansuClient::new(&env, &contract_id); - contract.init(&contract_admin); - let name = String::from_str(&env, "tansu"); let url = String::from_str(&env, "github.com/file.toml"); let hash = String::from_str(&env, "2ef4f49fdd8fa9dc463f1f06a094c26b88710990"); @@ -243,7 +241,7 @@ fn test_utils() { let key: Bytes = env.crypto().keccak256(&name_b).into(); let node = domain_node(&env, &key); - let domain_contract_id = env.register_contract_wasm(None, domain_contract::WASM); + let domain_contract_id = env.register(domain_contract::WASM, ()); let domain_client = domain_contract::Client::new(&env, &domain_contract_id); let node_official = domain_client.parse_domain(&name_b, &tld_b); diff --git a/dapp/.env.example b/dapp/.env.example index c9d2b591..d5e296d4 100644 --- a/dapp/.env.example +++ b/dapp/.env.example @@ -2,8 +2,8 @@ PUBLIC_SOROBAN_NETWORK_PASSPHRASE="Test SDF Network ; September 2015" PUBLIC_SOROBAN_RPC_URL="https://soroban-testnet.stellar.org:443" -PUBLIC_TANSU_CONTRACT_ID="CCHZAAUJJZOCFZVTQWGZU4PXR7SFB5PL3XBSHUBNQPXJ3KWE4VFHOBE5" -PUBLIC_SOROBAN_DOMAIN_CONTRACT_ID="CDGNT7DB7BC6LFAAQ4BZGZYOC5UMSR55KOZGALVOPODLKMINQWACHKZF" +PUBLIC_TANSU_CONTRACT_ID="CB6EA5V4T5Z5XXOKHRU5MNYTZ2QESR4STUW6EBLA4HXYZ2BPVMCHRHUR" +PUBLIC_SOROBAN_DOMAIN_CONTRACT_ID="CDBITX57Q6Y7QP4BJZNATYKILHT2VTERXLZ6NYG353WMB4T7BCBNNUV2" PUBLIC_TANSU_OWNER_ID="GCILP4HWE2QGEO4KUMOZ6S6J3A46W47EVCGZW2YPYCPH5CQF6EACNBCN" SOROBAN_NETWORK="testnet | public" diff --git a/dapp/packages/soroban_versioning/dist/index.d.ts b/dapp/packages/soroban_versioning/dist/index.d.ts index bb1e2f0b..4c580732 100644 --- a/dapp/packages/soroban_versioning/dist/index.d.ts +++ b/dapp/packages/soroban_versioning/dist/index.d.ts @@ -272,30 +272,6 @@ export interface Client { simulate?: boolean; }, ) => Promise>; - /** - * Construct and simulate a init transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. - */ - init: ( - { - admin, - }: { - admin: string; - }, - options?: { - /** - * The fee to pay for the transaction. Default: BASE_FEE - */ - fee?: number; - /** - * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT - */ - timeoutInSeconds?: number; - /** - * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true - */ - simulate?: boolean; - }, - ) => Promise>; /** * Construct and simulate a upgrade transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ @@ -492,7 +468,6 @@ export declare class Client extends ContractClient { vote: (json: string) => AssembledTransaction; get_dao: (json: string) => AssembledTransaction; get_proposal: (json: string) => AssembledTransaction; - init: (json: string) => AssembledTransaction; upgrade: (json: string) => AssembledTransaction; version: (json: string) => AssembledTransaction; register: (json: string) => AssembledTransaction>; diff --git a/dapp/packages/soroban_versioning/dist/index.js b/dapp/packages/soroban_versioning/dist/index.js index 7379c82a..04efba4d 100644 --- a/dapp/packages/soroban_versioning/dist/index.js +++ b/dapp/packages/soroban_versioning/dist/index.js @@ -38,7 +38,7 @@ export class Client extends ContractClient { "AAAAAAAAAQ5DYXN0IGEgdm90ZSBvbiBhIHByb3Bvc2FsLgpEb3VibGUgdm90ZXMgYXJlIG5vdCBhbGxvd2VkLgojIEFyZ3VtZW50cwoqIGBlbnZgIC0gVGhlIGVudmlyb25tZW50IG9iamVjdAoqIGB2b3RlcmAgLSBBZGRyZXNzIG9mIHRoZSB2b3RlcgoqIGBwcm9qZWN0X2tleWAgLSBVbmlxdWUgaWRlbnRpZmllciBmb3IgdGhlIHByb2plY3QKKiBgcHJvcG9zYWxfaWRgIC0gSUQgb2YgdGhlIHByb3Bvc2FsCiogYHZvdGVgIC0gQXBwcm92ZSwgcmVqZWN0IG9yIGFic3RhaW4gZGVjaXNpb24AAAAAAAR2b3RlAAAABAAAAAAAAAAFdm90ZXIAAAAAAAATAAAAAAAAAAtwcm9qZWN0X2tleQAAAAAOAAAAAAAAAAtwcm9wb3NhbF9pZAAAAAAEAAAAAAAAAAR2b3RlAAAH0AAAAARWb3RlAAAAAA==", "AAAAAAAAARRHZXQgb25lIHBhZ2Ugb2YgcHJvcG9zYWwgb2YgdGhlIERBTy4KQSBwYWdlIGhhcyAwIHRvIE1BWF9QUk9QT1NBTFNfUEVSX1BBR0UgcHJvcG9zYWxzLgojIEFyZ3VtZW50cwoqIGBlbnZgIC0gVGhlIGVudmlyb25tZW50IG9iamVjdAoqIGBwcm9qZWN0X2tleWAgLSBVbmlxdWUgaWRlbnRpZmllciBmb3IgdGhlIHByb2plY3QKKiBgcGFnZWAgLSBQYWdlIG9mIHByb3Bvc2FscwojIFJldHVybnMKKiBgdHlwZXM6OkRhb2AgLSBUaGUgRGFvIG9iamVjdCAodmVjdG9yIG9mIHByb3Bvc2FscykAAAAHZ2V0X2RhbwAAA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65,6 @@ export class Client extends ContractClient { vote: this.txFromJSON, get_dao: this.txFromJSON, get_proposal: this.txFromJSON, - init: this.txFromJSON, upgrade: this.txFromJSON, version: this.txFromJSON, register: this.txFromJSON, diff --git a/dapp/packages/soroban_versioning/src/index.ts b/dapp/packages/soroban_versioning/src/index.ts index 2af0ea73..de731c29 100644 --- a/dapp/packages/soroban_versioning/src/index.ts +++ b/dapp/packages/soroban_versioning/src/index.ts @@ -249,29 +249,6 @@ export interface Client { }, ) => Promise>; - /** - * Construct and simulate a init transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. - */ - init: ( - { admin }: { admin: string }, - options?: { - /** - * The fee to pay for the transaction. Default: BASE_FEE - */ - fee?: number; - - /** - * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT - */ - timeoutInSeconds?: number; - - /** - * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true - */ - simulate?: boolean; - }, - ) => Promise>; - /** * Construct and simulate a upgrade transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ @@ -472,7 +449,7 @@ export class Client extends ContractClient { "AAAAAAAAAQ5DYXN0IGEgdm90ZSBvbiBhIHByb3Bvc2FsLgpEb3VibGUgdm90ZXMgYXJlIG5vdCBhbGxvd2VkLgojIEFyZ3VtZW50cwoqIGBlbnZgIC0gVGhlIGVudmlyb25tZW50IG9iamVjdAoqIGB2b3RlcmAgLSBBZGRyZXNzIG9mIHRoZSB2b3RlcgoqIGBwcm9qZWN0X2tleWAgLSBVbmlxdWUgaWRlbnRpZmllciBmb3IgdGhlIHByb2plY3QKKiBgcHJvcG9zYWxfaWRgIC0gSUQgb2YgdGhlIHByb3Bvc2FsCiogYHZvdGVgIC0gQXBwcm92ZSwgcmVqZWN0IG9yIGFic3RhaW4gZGVjaXNpb24AAAAAAAR2b3RlAAAABAAAAAAAAAA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AEwAAAAA=", + "AAAAAAAAAAAAAAANX19jb25zdHJ1Y3RvcgAAAAAAAAEAAAAAAAAABWFkbWluAAAAAAAAEwAAAAA=", "AAAAAAAAAAAAAAAHdXBncmFkZQAAAAABAAAAAAAAAA1uZXdfd2FzbV9oYXNoAAAAAAAD7gAAACAAAAAA", "AAAAAAAAAAAAAAAHdmVyc2lvbgAAAAAAAAAAAQAAAAQ=", "AAAAAAAAADRSZWdpc3RlciBhIG5ldyBHaXQgcHJvamVjdHMgYW5kIGFzc29jaWF0ZWQgbWV0YWRhdGEuAAAACHJlZ2lzdGVyAAAABgAAAAAAAAAKbWFpbnRhaW5lcgAAAAAAEwAAAAAAAAAEbmFtZQAAABAAAAAAAAAAC21haW50YWluZXJzAAAAA+oAAAATAAAAAAAAAAN1cmwAAAAAEAAAAAAAAAAEaGFzaAAAABAAAAAAAAAAEmRvbWFpbl9jb250cmFjdF9pZAAAAAAAEwAAAAEAAAAO", @@ -498,7 +475,6 @@ export class Client extends ContractClient { vote: this.txFromJSON, get_dao: this.txFromJSON, get_proposal: this.txFromJSON, - init: this.txFromJSON, upgrade: this.txFromJSON, version: this.txFromJSON, register: this.txFromJSON,