diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 18598b9..6f6d91a 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -13,9 +13,8 @@ permissions: jobs: contracts: name: Contracts - uses: multiversx/mx-sc-actions/.github/workflows/contracts.yml@v2.3.5 + uses: multiversx/mx-sc-actions/.github/workflows/contracts.yml@v3.1.0 with: rust-toolchain: nightly-2023-12-11 - vmtools-version: v1.5.24 secrets: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/Cargo.lock b/Cargo.lock index 2f7dd16..5d98473 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12,6 +12,21 @@ dependencies = [ "regex", ] +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "ahash" version = "0.8.11" @@ -88,6 +103,15 @@ version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" +[[package]] +name = "arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +dependencies = [ + "derive_arbitrary", +] + [[package]] name = "arrayvec" version = "0.7.4" @@ -100,25 +124,70 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +[[package]] +name = "backtrace" +version = "0.3.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "bech32" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" +[[package]] +name = "bip39" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" +dependencies = [ + "bitcoin_hashes", + "rand 0.8.5", + "rand_core 0.6.4", + "serde", + "unicode-normalization", +] + +[[package]] +name = "bitcoin_hashes" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" + [[package]] name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + [[package]] name = "block-buffer" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "block-padding", "generic-array", ] @@ -131,12 +200,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "block-padding" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" - [[package]] name = "bstr" version = "1.9.1" @@ -147,12 +210,30 @@ dependencies = [ "serde", ] +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + [[package]] name = "byteorder" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +[[package]] +name = "bytes" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" + +[[package]] +name = "cc" +version = "1.0.97" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" + [[package]] name = "cfg-if" version = "1.0.0" @@ -190,7 +271,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.61", + "syn", ] [[package]] @@ -230,6 +311,31 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "copy_dir" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "543d1dd138ef086e2ff05e3a48cf9da045da2033d16f8538fd76b86cd49b2ca3" +dependencies = [ + "walkdir", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + [[package]] name = "cpufeatures" version = "0.2.12" @@ -239,6 +345,15 @@ dependencies = [ "libc", ] +[[package]] +name = "crc32fast" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +dependencies = [ + "cfg-if", +] + [[package]] name = "crossbeam-deque" version = "0.8.5" @@ -276,9 +391,9 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.2.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" dependencies = [ "byteorder", "digest 0.9.0", @@ -287,6 +402,17 @@ dependencies = [ "zeroize", ] +[[package]] +name = "derive_arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "digest" version = "0.9.0" @@ -304,6 +430,18 @@ checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", "crypto-common", + "subtle", +] + +[[package]] +name = "displaydoc" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +dependencies = [ + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -335,12 +473,37 @@ version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" +[[package]] +name = "encoding_rs" +version = "0.8.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +dependencies = [ + "cfg-if", +] + [[package]] name = "endian-type" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "esdt-system-sc-mock" version = "0.0.0" @@ -357,6 +520,102 @@ dependencies = [ "multiversx-sc-meta", ] +[[package]] +name = "fastrand" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" + +[[package]] +name = "flate2" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -389,6 +648,12 @@ dependencies = [ "wasi 0.11.0+wasi-snapshot-preview1", ] +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + [[package]] name = "globset" version = "0.4.14" @@ -403,16 +668,29 @@ dependencies = [ ] [[package]] -name = "hashbrown" -version = "0.12.3" +name = "h2" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "816ec7294445779408f36fe57bc5b7fc1cf59664059096c65f905c1c61f58069" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", ] @@ -423,6 +701,12 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + [[package]] name = "hex" version = "0.4.3" @@ -431,9 +715,124 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "http" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "hyper" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "socket2", + "tokio", + "tower", + "tower-service", + "tracing", +] + +[[package]] +name = "idna" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] [[package]] name = "ignore" @@ -453,14 +852,20 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.3" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ - "autocfg", - "hashbrown 0.12.3", + "equivalent", + "hashbrown", ] +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + [[package]] name = "is_terminal_polyfill" version = "1.70.0" @@ -469,9 +874,9 @@ checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" [[package]] name = "itertools" -version = "0.10.5" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] @@ -482,6 +887,15 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +[[package]] +name = "js-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +dependencies = [ + "wasm-bindgen", +] + [[package]] name = "keccak" version = "0.1.5" @@ -503,6 +917,22 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + [[package]] name = "log" version = "0.4.21" @@ -515,11 +945,37 @@ version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.48.0", +] + [[package]] name = "multiversx-chain-scenario-format" -version = "0.19.1" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d2592a441608937c5aebec6732c38e6097f58de1dc9a64d7dbe98e0ab97a3c0" +checksum = "7a9190bdd56300e801e7793fc4ee7dc0c76c1149aac019da8c71cc58254966fe" dependencies = [ "bech32", "hex", @@ -527,127 +983,194 @@ dependencies = [ "num-traits", "serde", "serde_json", - "sha3 0.9.1", + "sha3", ] [[package]] name = "multiversx-chain-vm" -version = "0.3.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212ddb5a9199f5d94d873a30126fb24b9a80383af748911c5dea71595f39a5c7" +checksum = "f69520691466bc184475320c27db21137e68be5e959df25c1a14b09e055d0d58" dependencies = [ - "bech32", + "bitflags 2.5.0", + "colored", "ed25519-dalek", "hex", + "hex-literal", "itertools", - "multiversx-chain-scenario-format", - "multiversx-sc", - "multiversx-sc-meta", + "multiversx-chain-vm-executor", "num-bigint", "num-traits", "rand 0.8.5", "rand_seeder", - "serde", - "serde_json", "sha2 0.10.8", - "sha3 0.10.8", + "sha3", ] +[[package]] +name = "multiversx-chain-vm-executor" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b59072fa0624b55ae5ae3fa6bfa91515bbeb4ac440214bc4a509e2c8806d6e9f" + [[package]] name = "multiversx-sc" -version = "0.41.3" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfbe80ec68fedf299dd65469f8999cf3c0f884ffa497122428f08303bcb8b884" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" dependencies = [ - "bitflags", - "hashbrown 0.13.2", + "bitflags 2.5.0", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", "num-traits", + "unwrap-infallible", ] [[package]] name = "multiversx-sc-codec" -version = "0.17.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d70ea458247d263b7e9fdfb207530b6a530546247139c162450e515c013a18" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", "num-bigint", + "unwrap-infallible", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ad6920f80fda67fc60fd51aaa9f83ec7e069470f60a068c81205f9da5d05a30" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" dependencies = [ "hex", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] name = "multiversx-sc-derive" -version = "0.41.3" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c2b87d817f2176bf1830bef938884f24267516c334a377e71a96bc18ebb09c1" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn 1.0.109", + "syn", ] [[package]] name = "multiversx-sc-meta" -version = "0.41.3" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a027febbf84d887b429699cf8cbe2a9d1776d26dee7359d9b7afdc3407e57da0" +checksum = "1685ec123bf256310f876db64f63a19ce0df9721857981a4910f26c48ddf3dc6" dependencies = [ "clap", "colored", "common-path", "convert_case", + "copy_dir", "hex", "lazy_static", "multiversx-sc", "pathdiff", + "reqwest", "ruplacer", "rustc_version", + "semver", "serde", "serde_json", "toml", + "wasmparser", + "wasmprinter", + "zip", ] [[package]] name = "multiversx-sc-modules" -version = "0.41.3" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704825223788bfdfd622980cae8feedae82609fded5ef5f53af31661d5e02312" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-scenario" -version = "0.41.3" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0466020f9dcceaeb5ffe293e07c1eb43d81395170267e1b77445063bf17279cc" +checksum = "25f9434d86800639499dc899c4220f615c4a2aa1a998a56d2d635cd4b5fea851" dependencies = [ + "base64", + "bech32", + "clap", "colored", "hex", "itertools", + "log", + "multiversx-chain-scenario-format", "multiversx-chain-vm", + "multiversx-chain-vm-executor", + "multiversx-sc", + "multiversx-sc-meta", + "multiversx-sdk", + "num-bigint", "num-traits", "pathdiff", "serde", "serde_json", "sha2 0.10.8", + "tokio", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sdk" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cb2f8dd4a17ce9c9fa1ab3d80152929702968be6536499f32bd7e2278c2e0fb" +dependencies = [ + "anyhow", + "base64", + "bech32", + "bip39", + "hex", + "hmac", + "itertools", + "pbkdf2", + "pem", + "rand 0.8.5", + "reqwest", + "serde", + "serde_json", + "serde_repr", + "sha2 0.10.8", + "sha3", + "tokio", + "zeroize", +] + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", ] [[package]] @@ -726,6 +1249,25 @@ dependencies = [ "autocfg", ] +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" version = "1.19.0" @@ -738,12 +1280,142 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" +[[package]] +name = "openssl" +version = "0.10.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +dependencies = [ + "bitflags 2.5.0", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "parking_lot" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.5", +] + [[package]] name = "pathdiff" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" +[[package]] +name = "pbkdf2" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "pem" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" +dependencies = [ + "base64", + "serde", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -858,6 +1530,15 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "redox_syscall" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags 2.5.0", +] + [[package]] name = "regex" version = "1.10.4" @@ -887,6 +1568,49 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +[[package]] +name = "reqwest" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-tls", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + [[package]] name = "royalties-handler" version = "0.0.0" @@ -922,6 +1646,12 @@ dependencies = [ "regex", ] +[[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.0" @@ -931,6 +1661,35 @@ dependencies = [ "semver", ] +[[package]] +name = "rustix" +version = "0.38.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls-pemfile" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +dependencies = [ + "base64", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" + [[package]] name = "ryu" version = "1.0.18" @@ -946,6 +1705,44 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "schannel" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "security-framework" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" +dependencies = [ + "bitflags 2.5.0", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "semver" version = "1.0.23" @@ -969,7 +1766,7 @@ checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn", ] [[package]] @@ -978,6 +1775,39 @@ version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ + "indexmap", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_spanned" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", "itoa", "ryu", "serde", @@ -1009,24 +1839,21 @@ dependencies = [ [[package]] name = "sha3" -version = "0.9.1" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" dependencies = [ - "block-buffer 0.9.0", - "digest 0.9.0", + "digest 0.10.7", "keccak", - "opaque-debug", ] [[package]] -name = "sha3" -version = "0.10.8" +name = "signal-hook-registry" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ - "digest 0.10.7", - "keccak", + "libc", ] [[package]] @@ -1035,12 +1862,31 @@ version = "1.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + [[package]] name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +[[package]] +name = "socket2" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "strsim" version = "0.11.1" @@ -1055,9 +1901,9 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" -version = "1.0.109" +version = "2.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" dependencies = [ "proc-macro2", "quote", @@ -1065,50 +1911,283 @@ dependencies = [ ] [[package]] -name = "syn" -version = "2.0.61" +name = "sync_wrapper" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tempfile" +version = "3.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +dependencies = [ + "cfg-if", + "fastrand", + "rustix", + "windows-sys 0.52.0", +] + +[[package]] +name = "thiserror" +version = "1.0.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" dependencies = [ "proc-macro2", "quote", - "unicode-ident", + "syn", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", ] [[package]] name = "toml" -version = "0.5.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" dependencies = [ "indexmap", "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +dependencies = [ + "serde", ] +[[package]] +name = "toml_edit" +version = "0.22.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "log", + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + [[package]] name = "typenum" version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + [[package]] name = "unicode-segmentation" version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + [[package]] name = "utf8parse" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "version_check" version = "0.9.4" @@ -1125,6 +2204,15 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" @@ -1137,6 +2225,105 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasm-bindgen" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" + +[[package]] +name = "wasmparser" +version = "0.207.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e19bb9f8ab07616da582ef8adb24c54f1424c7ec876720b7da9db8ec0626c92c" +dependencies = [ + "ahash", + "bitflags 2.5.0", + "hashbrown", + "indexmap", + "semver", +] + +[[package]] +name = "wasmprinter" +version = "0.207.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c2d8a7b4dabb460208e6b4334d9db5766e84505038b2529e69c3d07ac619115" +dependencies = [ + "anyhow", + "wasmparser", +] + +[[package]] +name = "web-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "winapi-util" version = "0.1.8" @@ -1285,6 +2472,25 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +[[package]] +name = "winnow" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + [[package]] name = "zerocopy" version = "0.7.34" @@ -1302,14 +2508,14 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn", ] [[package]] name = "zeroize" -version = "1.3.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" dependencies = [ "zeroize_derive", ] @@ -1322,5 +2528,20 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn", +] + +[[package]] +name = "zip" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c700ea425e148de30c29c580c1f9508b93ca57ad31c9f4e96b83c194c37a7a8f" +dependencies = [ + "arbitrary", + "crc32fast", + "crossbeam-utils", + "displaydoc", + "flate2", + "indexmap", + "thiserror", ] diff --git a/Cargo.toml b/Cargo.toml index 5c140ae..4f24218 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,6 @@ [workspace] +resolver = "2" + members = [ "nft-minter", "nft-minter/meta", diff --git a/esdt-system-sc-mock/Cargo.toml b/esdt-system-sc-mock/Cargo.toml index 5f53327..9537f44 100644 --- a/esdt-system-sc-mock/Cargo.toml +++ b/esdt-system-sc-mock/Cargo.toml @@ -7,7 +7,9 @@ publish = false [lib] path = "src/esdt_system_sc_mock.rs" + [dependencies.multiversx-sc] -version = "=0.41.3" +version = "=0.50.0" + [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.3" +version = "=0.50.0" diff --git a/esdt-system-sc-mock/meta/Cargo.toml b/esdt-system-sc-mock/meta/Cargo.toml index 71f8fc3..f46e624 100644 --- a/esdt-system-sc-mock/meta/Cargo.toml +++ b/esdt-system-sc-mock/meta/Cargo.toml @@ -4,8 +4,10 @@ version = "0.0.0" authors = ["Dorin Marian Iancu "] edition = "2018" publish = false + [dependencies.esdt-system-sc-mock] path = ".." [dependencies.multiversx-sc-meta] -version = "=0.41.3" +version = "=0.50.0" +default-features = false diff --git a/esdt-system-sc-mock/mandos/esdt_system_sc.scen.json b/esdt-system-sc-mock/scenarios/esdt_system_sc.scen.json similarity index 97% rename from esdt-system-sc-mock/mandos/esdt_system_sc.scen.json rename to esdt-system-sc-mock/scenarios/esdt_system_sc.scen.json index 9477a47..5e54fb1 100644 --- a/esdt-system-sc-mock/mandos/esdt_system_sc.scen.json +++ b/esdt-system-sc-mock/scenarios/esdt_system_sc.scen.json @@ -19,7 +19,7 @@ } }, "storage": {}, - "code": "file:../output/esdt-system-sc-mock.wasm" + "code": "mxsc:../output/esdt-system-sc-mock.mxsc.json" } } }, @@ -97,7 +97,7 @@ "storage": { "str:nrIssuedTokens": "1" }, - "code": "file:../output/esdt-system-sc-mock.wasm" + "code": "mxsc:../output/esdt-system-sc-mock.mxsc.json" } } }, diff --git a/esdt-system-sc-mock/tests/esdt_system_sc_mock_go_test.rs b/esdt-system-sc-mock/tests/esdt_system_sc_mock_go_test.rs index 721eed9..5559e31 100644 --- a/esdt-system-sc-mock/tests/esdt_system_sc_mock_go_test.rs +++ b/esdt-system-sc-mock/tests/esdt_system_sc_mock_go_test.rs @@ -1,4 +1,10 @@ +use multiversx_sc_scenario::*; + +fn world() -> ScenarioWorld { + ScenarioWorld::vm_go() +} + #[test] fn issue_go() { - multiversx_sc_scenario::run_go("mandos/esdt_system_sc.scen.json"); + world().run("scenarios/esdt_system_sc.scen.json"); } diff --git a/esdt-system-sc-mock/tests/esdt_system_sc_mock_rs_test.rs b/esdt-system-sc-mock/tests/esdt_system_sc_mock_rs_test.rs index 92691b8..8d72b70 100644 --- a/esdt-system-sc-mock/tests/esdt_system_sc_mock_rs_test.rs +++ b/esdt-system-sc-mock/tests/esdt_system_sc_mock_rs_test.rs @@ -4,7 +4,7 @@ fn world() -> ScenarioWorld { let mut blockchain = ScenarioWorld::new(); blockchain.set_current_dir_from_workspace("esdt-system-sc-mock"); blockchain.register_contract( - "file:output/esdt-system-sc-mock.wasm", + "mxsc:output/esdt-system-sc-mock.mxsc.json", esdt_system_sc_mock::ContractBuilder, ); blockchain @@ -12,5 +12,5 @@ fn world() -> ScenarioWorld { #[test] fn issue_rs() { - multiversx_sc_scenario::run_rs("mandos/esdt_system_sc.scen.json", world()); + world().run("scenarios/esdt_system_sc.scen.json"); } diff --git a/esdt-system-sc-mock/wasm/Cargo.lock b/esdt-system-sc-mock/wasm/Cargo.lock index b74cfd6..bb1e676 100644 --- a/esdt-system-sc-mock/wasm/Cargo.lock +++ b/esdt-system-sc-mock/wasm/Cargo.lock @@ -2,18 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - [[package]] name = "arrayvec" version = "0.7.4" @@ -28,15 +16,9 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "bitflags" -version = "1.3.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "endian-type" @@ -59,15 +41,6 @@ dependencies = [ "multiversx-sc-wasm-adapter", ] -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - [[package]] name = "hex" version = "0.4.3" @@ -76,64 +49,65 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "multiversx-sc" -version = "0.41.3" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfbe80ec68fedf299dd65469f8999cf3c0f884ffa497122428f08303bcb8b884" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", "num-traits", + "unwrap-infallible", ] [[package]] name = "multiversx-sc-codec" -version = "0.17.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d70ea458247d263b7e9fdfb207530b6a530546247139c162450e515c013a18" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", + "unwrap-infallible", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ad6920f80fda67fc60fd51aaa9f83ec7e069470f60a068c81205f9da5d05a30" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" dependencies = [ "hex", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] name = "multiversx-sc-derive" -version = "0.41.3" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c2b87d817f2176bf1830bef938884f24267516c334a377e71a96bc18ebb09c1" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn 1.0.109", + "syn", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.41.3" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "932327626de71eeb1dbe86b863cc70cc532f8ceba8e73a059410f6aa56b22a77" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" dependencies = [ "multiversx-sc", ] @@ -156,12 +130,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "proc-macro2" version = "1.0.82" @@ -196,17 +164,6 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" -[[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.61" @@ -225,27 +182,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "zerocopy" -version = "0.7.34" +name = "unwrap-infallible" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.61", -] +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" diff --git a/esdt-system-sc-mock/wasm/Cargo.toml b/esdt-system-sc-mock/wasm/Cargo.toml index 0919f57..789f88b 100644 --- a/esdt-system-sc-mock/wasm/Cargo.toml +++ b/esdt-system-sc-mock/wasm/Cargo.toml @@ -1,23 +1,34 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "esdt-system-sc-mock-wasm" version = "0.0.0" -authors = ["Dorin Marian Iancu "] edition = "2018" publish = false [lib] crate-type = ["cdylib"] + [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false + +[profile.dev] +panic = "abort" + [dependencies.esdt-system-sc-mock] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.3" +version = "=0.50.0" [workspace] members = ["."] diff --git a/esdt-system-sc-mock/wasm/src/lib.rs b/esdt-system-sc-mock/wasm/src/lib.rs index eb8e3b7..8301d8c 100644 --- a/esdt-system-sc-mock/wasm/src/lib.rs +++ b/esdt-system-sc-mock/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// @@ -10,7 +10,6 @@ // Total number of exported functions: 8 #![no_std] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,13 +17,14 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { esdt_system_sc_mock ( - issue - issueNonFungible - issueSemiFungible - registerMetaESDT - setSpecialRole - registerAndSetAllRoles + init => init + issue => issue_fungible + issueNonFungible => issue_non_fungible + issueSemiFungible => issue_semi_fungible + registerMetaESDT => issue_meta_esdt + setSpecialRole => set_special_roles + registerAndSetAllRoles => register_and_set_all_roles ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/nft-minter-deployer/Cargo.toml b/nft-minter-deployer/Cargo.toml index 5d47cd4..50fdfda 100644 --- a/nft-minter-deployer/Cargo.toml +++ b/nft-minter-deployer/Cargo.toml @@ -12,10 +12,10 @@ path = "src/lib.rs" path = "../nft-minter" [dependencies.multiversx-sc] -version = "=0.41.3" +version = "=0.50.0" [dependencies.multiversx-sc-modules] -version = "=0.41.3" +version = "=0.50.0" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.3" +version = "=0.50.0" diff --git a/nft-minter-deployer/meta/Cargo.toml b/nft-minter-deployer/meta/Cargo.toml index da59e96..c776eda 100644 --- a/nft-minter-deployer/meta/Cargo.toml +++ b/nft-minter-deployer/meta/Cargo.toml @@ -4,8 +4,10 @@ version = "0.0.0" authors = ["MultiversX "] edition = "2021" publish = false + [dependencies.nft-minter-deployer] path = ".." [dependencies.multiversx-sc-meta] -version = "=0.41.3" +version = "=0.50.0" +default-features = false diff --git a/nft-minter-deployer/src/events.rs b/nft-minter-deployer/src/events.rs index 9a35001..658ca53 100644 --- a/nft-minter-deployer/src/events.rs +++ b/nft-minter-deployer/src/events.rs @@ -1,7 +1,8 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); -#[derive(TypeAbi, TopEncode)] +#[type_abi] +#[derive(TopEncode)] pub struct CreateNftMinterEvent { royalties_claim_address: ManagedAddress, mint_payments_claim_address: ManagedAddress, diff --git a/nft-minter-deployer/src/factory.rs b/nft-minter-deployer/src/factory.rs index d1c4da8..06c2a03 100644 --- a/nft-minter-deployer/src/factory.rs +++ b/nft-minter-deployer/src/factory.rs @@ -1,5 +1,6 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); +pub use nft_minter; #[multiversx_sc::module] pub trait FactoryModule { @@ -14,18 +15,21 @@ pub trait FactoryModule { !self.nft_minter_template_address().is_empty(), "Nft minter contract template is empty" ); - let (new_address, ()) = self - .nft_minter_contract_proxy() + let new_address = self + .tx() + .typed(nft_minter::nft_minter_proxy::NftMinterProxy) .init( royalties_claim_address, mint_payments_claim_address, max_nfts_per_transaction, OptionalValue::Some(admin.clone()), ) - .deploy_from_source( - &self.nft_minter_template_address().get(), + .code_metadata( CodeMetadata::UPGRADEABLE | CodeMetadata::READABLE | CodeMetadata::PAYABLE_BY_SC, - ); + ) + .from_source(self.nft_minter_template_address().get()) + .returns(ReturnsNewManagedAddress) + .sync_call(); self.user_nft_minter_contracts(&admin) .insert(new_address.clone()); @@ -41,26 +45,22 @@ pub trait FactoryModule { mint_payments_claim_address: ManagedAddress, max_nfts_per_transaction: usize, ) { - self.nft_minter_contract_proxy() - .contract(nft_minter_address) - .init( - royalties_claim_address, - mint_payments_claim_address, - max_nfts_per_transaction, + self.tx() + .to(nft_minter_address) + .typed(nft_minter::nft_minter_proxy::NftMinterProxy) + .upgrade( + &royalties_claim_address, + &mint_payments_claim_address, + &max_nfts_per_transaction, OptionalValue::None::, ) - .upgrade_from_source( - &self.nft_minter_template_address().get(), + .code_metadata( CodeMetadata::UPGRADEABLE | CodeMetadata::READABLE | CodeMetadata::PAYABLE_BY_SC, - ); + ) + .from_source(self.nft_minter_template_address().get()) + .upgrade_async_call_and_exit(); } - #[proxy] - fn nft_minter_contract_proxy(&self) -> nft_minter::Proxy; - - #[proxy] - fn user_nft_minter_proxy(&self, to: ManagedAddress) -> nft_minter::Proxy; - #[view(getUserNftMinterContracts)] #[storage_mapper("userNftMinterContracts")] fn user_nft_minter_contracts( diff --git a/nft-minter-deployer/src/lib.rs b/nft-minter-deployer/src/lib.rs index b48647f..f1ee930 100644 --- a/nft-minter-deployer/src/lib.rs +++ b/nft-minter-deployer/src/lib.rs @@ -3,9 +3,6 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); -use multiversx_sc_modules::pause::ProxyTrait as _; -use nft_minter::admin_whitelist::ProxyTrait as _; - mod events; pub mod factory; @@ -95,10 +92,11 @@ pub trait NftMinterDeployer: factory::FactoryModule + events::EventsModule { "NFT Minter contract does not exist" ); - let _: IgnoreValue = self - .user_nft_minter_proxy(nft_minter_address) + self.tx() + .to(nft_minter_address) + .typed(nft_minter::nft_minter_proxy::NftMinterProxy) .pause_endpoint() - .execute_on_dest_context(); + .sync_call(); } #[only_owner] @@ -110,10 +108,11 @@ pub trait NftMinterDeployer: factory::FactoryModule + events::EventsModule { "NFT Minter contract does not exist" ); - let _: IgnoreValue = self - .user_nft_minter_proxy(nft_minter_address) + self.tx() + .to(nft_minter_address) + .typed(nft_minter::nft_minter_proxy::NftMinterProxy) .unpause_endpoint() - .execute_on_dest_context(); + .sync_call(); } #[only_owner] @@ -128,11 +127,11 @@ pub trait NftMinterDeployer: factory::FactoryModule + events::EventsModule { .contains(&nft_minter_address), "NFT Minter contract does not exist" ); - - let _: IgnoreValue = self - .user_nft_minter_proxy(nft_minter_address) + self.tx() + .to(nft_minter_address) + .typed(nft_minter::nft_minter_proxy::NftMinterProxy) .add_user_to_admin_list(admin_address) - .execute_on_dest_context(); + .sync_call(); } #[only_owner] @@ -148,10 +147,11 @@ pub trait NftMinterDeployer: factory::FactoryModule + events::EventsModule { "NFT Minter contract does not exist" ); - let _: IgnoreValue = self - .user_nft_minter_proxy(nft_minter_address) + self.tx() + .to(nft_minter_address) + .typed(nft_minter::nft_minter_proxy::NftMinterProxy) .remove_user_from_admin_list(admin_address) - .execute_on_dest_context(); + .sync_call(); } #[only_owner] diff --git a/nft-minter-deployer/wasm/Cargo.lock b/nft-minter-deployer/wasm/Cargo.lock index d485ebd..2f0c08c 100644 --- a/nft-minter-deployer/wasm/Cargo.lock +++ b/nft-minter-deployer/wasm/Cargo.lock @@ -2,18 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - [[package]] name = "arrayvec" version = "0.7.4" @@ -28,15 +16,9 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "bitflags" -version = "1.3.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "endian-type" @@ -44,15 +26,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - [[package]] name = "hex" version = "0.4.3" @@ -61,73 +34,74 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "multiversx-sc" -version = "0.41.3" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfbe80ec68fedf299dd65469f8999cf3c0f884ffa497122428f08303bcb8b884" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", "num-traits", + "unwrap-infallible", ] [[package]] name = "multiversx-sc-codec" -version = "0.17.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d70ea458247d263b7e9fdfb207530b6a530546247139c162450e515c013a18" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", + "unwrap-infallible", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ad6920f80fda67fc60fd51aaa9f83ec7e069470f60a068c81205f9da5d05a30" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" dependencies = [ "hex", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] name = "multiversx-sc-derive" -version = "0.41.3" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c2b87d817f2176bf1830bef938884f24267516c334a377e71a96bc18ebb09c1" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn 1.0.109", + "syn", ] [[package]] name = "multiversx-sc-modules" -version = "0.41.3" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704825223788bfdfd622980cae8feedae82609fded5ef5f53af31661d5e02312" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.41.3" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "932327626de71eeb1dbe86b863cc70cc532f8ceba8e73a059410f6aa56b22a77" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" dependencies = [ "multiversx-sc", ] @@ -175,12 +149,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "proc-macro2" version = "1.0.82" @@ -215,17 +183,6 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" -[[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.61" @@ -244,27 +201,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "zerocopy" -version = "0.7.34" +name = "unwrap-infallible" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.61", -] +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" diff --git a/nft-minter-deployer/wasm/Cargo.toml b/nft-minter-deployer/wasm/Cargo.toml index 7483e98..c2bd115 100644 --- a/nft-minter-deployer/wasm/Cargo.toml +++ b/nft-minter-deployer/wasm/Cargo.toml @@ -1,26 +1,34 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "nft-minter-deployer-wasm" version = "0.0.0" -authors = ["MultiversX "] edition = "2021" publish = false [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false + +[profile.dev] +panic = "abort" + [dependencies.nft-minter-deployer] -default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.3" +version = "=0.50.0" + +[workspace] +members = ["."] diff --git a/nft-minter-deployer/wasm/src/lib.rs b/nft-minter-deployer/wasm/src/lib.rs index b8bff52..d1df1c8 100644 --- a/nft-minter-deployer/wasm/src/lib.rs +++ b/nft-minter-deployer/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// @@ -10,7 +10,6 @@ // Total number of exported functions: 14 #![no_std] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,19 +17,20 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { nft_minter_deployer ( - createNftMinter - upgradeNftMinter - pauseNftMinter - resumeNftMinter - addAdminToNftMinterContract - removeAdminToNftMinterContract - setNftMinterTemplateAddress - setNftMinterCreationEnabled - getUserNftMinterContracts - getAllNftMinterContracts - getNftMinterTemplateAddress - getNftMinterCreationEnabled + init => init + createNftMinter => create_nft_minter_endpoint + upgradeNftMinter => upgrade_nft_minter_endpoint + pauseNftMinter => pause_nft_minter + resumeNftMinter => resume_nft_minter + addAdminToNftMinterContract => add_admin_to_nft_minter_contract + removeAdminToNftMinterContract => remove_admin_to_nft_minter_contract + setNftMinterTemplateAddress => set_nft_minter_template_address + setNftMinterCreationEnabled => set_nft_minter_creation_enabled + getUserNftMinterContracts => user_nft_minter_contracts + getAllNftMinterContracts => all_nft_minter_contracts + getNftMinterTemplateAddress => nft_minter_template_address + getNftMinterCreationEnabled => nft_minter_creation_enabled ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/nft-minter/Cargo.toml b/nft-minter/Cargo.toml index cd15c3d..2b78535 100644 --- a/nft-minter/Cargo.toml +++ b/nft-minter/Cargo.toml @@ -7,19 +7,20 @@ publish = false [lib] path = "src/lib.rs" + [dependencies.multiversx-sc] -version = "=0.41.3" +version = "=0.50.0" + +[dependencies.multiversx-sc-modules] +version = "=0.50.0" [dev-dependencies] num-bigint = "0.4.2" num-traits = "0.2" hex = "0.4" -[dependencies.multiversx-sc-modules] -version = "=0.41.3" - [dev-dependencies.esdt-system-sc-mock] path = "../esdt-system-sc-mock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.3" +version = "=0.50.0" diff --git a/nft-minter/meta/Cargo.toml b/nft-minter/meta/Cargo.toml index f307927..c9d51ed 100644 --- a/nft-minter/meta/Cargo.toml +++ b/nft-minter/meta/Cargo.toml @@ -6,8 +6,10 @@ publish = false authors = ["Dorin Marian Iancu, dorin.iancu@elrond.com"] [dev-dependencies] + [dependencies.nft-minter] path = ".." [dependencies.multiversx-sc-meta] -version = "=0.41.3" +version = "=0.50.0" +default-features = false diff --git a/nft-minter/sc-config.toml b/nft-minter/sc-config.toml new file mode 100644 index 0000000..ebf6a53 --- /dev/null +++ b/nft-minter/sc-config.toml @@ -0,0 +1,4 @@ +[settings] + +[[proxy]] +path = "src/nft_minter_proxy.rs" diff --git a/nft-minter/src/common_storage.rs b/nft-minter/src/common_storage.rs index bdee935..4a98557 100644 --- a/nft-minter/src/common_storage.rs +++ b/nft-minter/src/common_storage.rs @@ -10,7 +10,8 @@ pub type PaymentsVec = ManagedVec>; pub type EgldValuePaymentsVecPair = MultiValue2, PaymentsVec>; pub type BrandId = ManagedBuffer; -#[derive(TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode, PartialEq, Debug)] +#[type_abi] +#[derive(TopEncode, TopDecode, NestedEncode, NestedDecode, PartialEq, Debug)] pub struct BrandInfo { pub collection_hash: CollectionHash, pub token_display_name: ManagedBuffer, @@ -20,13 +21,15 @@ pub struct BrandInfo { pub whitelist_expire_timestamp: u64, } -#[derive(TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode, PartialEq, Debug)] +#[type_abi] +#[derive(TopEncode, TopDecode, NestedEncode, NestedDecode, PartialEq, Debug)] pub struct TimePeriod { pub start: u64, pub end: u64, } -#[derive(TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode, PartialEq, Debug)] +#[type_abi] +#[derive(TopEncode, TopDecode, NestedEncode, NestedDecode, PartialEq, Debug)] pub struct MintPrice { pub token_id: EgldOrEsdtTokenIdentifier, pub amount: BigUint, diff --git a/nft-minter/src/lib.rs b/nft-minter/src/lib.rs index a568da1..ac6eb75 100644 --- a/nft-minter/src/lib.rs +++ b/nft-minter/src/lib.rs @@ -8,6 +8,7 @@ pub mod common_storage; pub mod events; pub mod nft_attributes_builder; pub mod nft_marketplace_interactor; +pub mod nft_minter_proxy; pub mod nft_minting; pub mod nft_tier; pub mod royalties; @@ -47,7 +48,7 @@ pub trait NftMinter: } } - #[endpoint] + #[upgrade] fn upgrade( &self, royalties_claim_address: ManagedAddress, diff --git a/nft-minter/src/nft_marketplace_interactor.rs b/nft-minter/src/nft_marketplace_interactor.rs index b9e5b26..8766555 100644 --- a/nft-minter/src/nft_marketplace_interactor.rs +++ b/nft-minter/src/nft_marketplace_interactor.rs @@ -43,7 +43,8 @@ pub trait NftMarketplaceInteractorModule: let call_result: EgldValuePaymentsVecPair = self .nft_marketplace_proxy_builder(marketplace_address) .claim_tokens(own_sc_address, args) - .execute_on_dest_context(); + .returns(ReturnsResult) + .sync_call(); let (egld_amount, other_payments) = call_result.into_tuple(); if egld_amount > 0 { diff --git a/nft-minter/src/nft_minter_proxy.rs b/nft-minter/src/nft_minter_proxy.rs new file mode 100644 index 0000000..965c699 --- /dev/null +++ b/nft-minter/src/nft_minter_proxy.rs @@ -0,0 +1,605 @@ +// Code generated by the multiversx-sc proxy generator. DO NOT EDIT. + +//////////////////////////////////////////////////// +////////////////// AUTO-GENERATED ////////////////// +//////////////////////////////////////////////////// + +#![allow(dead_code)] +#![allow(clippy::all)] + +use multiversx_sc::proxy_imports::*; + +pub struct NftMinterProxy; + +impl TxProxyTrait for NftMinterProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = NftMinterProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + NftMinterProxyMethods { wrapped_tx: tx } + } +} + +pub struct NftMinterProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +#[rustfmt::skip] +impl NftMinterProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + Gas: TxGas, +{ + pub fn init< + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg, + Arg3: ProxyArg>>, + >( + self, + royalties_claim_address: Arg0, + mint_payments_claim_address: Arg1, + max_nfts_per_transaction: Arg2, + opt_admin: Arg3, + ) -> TxTypedDeploy { + self.wrapped_tx + .payment(NotPayable) + .raw_deploy() + .argument(&royalties_claim_address) + .argument(&mint_payments_claim_address) + .argument(&max_nfts_per_transaction) + .argument(&opt_admin) + .original_result() + } +} + +#[rustfmt::skip] +impl NftMinterProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn upgrade< + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg, + Arg3: ProxyArg>>, + >( + self, + royalties_claim_address: Arg0, + mint_payments_claim_address: Arg1, + max_nfts_per_transaction: Arg2, + opt_admin: Arg3, + ) -> TxTypedUpgrade { + self.wrapped_tx + .payment(NotPayable) + .raw_upgrade() + .argument(&royalties_claim_address) + .argument(&mint_payments_claim_address) + .argument(&max_nfts_per_transaction) + .argument(&opt_admin) + .original_result() + } +} + +#[rustfmt::skip] +impl NftMinterProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn set_max_nfts_per_transaction< + Arg0: ProxyArg, + >( + self, + max: Arg0, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("setMaxNftsPerTransaction") + .argument(&max) + .original_result() + } + + pub fn max_nfts_per_transaction( + self, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("getMaxNftsPerTransaction") + .original_result() + } + + pub fn registered_collection_hashes( + self, + ) -> TxTypedCall>> { + self.wrapped_tx + .payment(NotPayable) + .raw_call("getRegisterdCollectionHashes") + .original_result() + } + + pub fn registered_brands( + self, + ) -> TxTypedCall>> { + self.wrapped_tx + .payment(NotPayable) + .raw_call("getRegisteredBrands") + .original_result() + } + + pub fn nft_token< + Arg0: ProxyArg>, + >( + self, + brand_id: Arg0, + ) -> TxTypedCall> { + self.wrapped_tx + .payment(NotPayable) + .raw_call("getNftTokenIdForBrand") + .argument(&brand_id) + .original_result() + } + + pub fn price_for_tier< + Arg0: ProxyArg>, + Arg1: ProxyArg>, + >( + self, + brand_id: Arg0, + tier: Arg1, + ) -> TxTypedCall> { + self.wrapped_tx + .payment(NotPayable) + .raw_call("getPriceForTier") + .argument(&brand_id) + .argument(&tier) + .original_result() + } + + pub fn tags_for_brand< + Arg0: ProxyArg>, + >( + self, + brand_id: Arg0, + ) -> TxTypedCall>> { + self.wrapped_tx + .payment(NotPayable) + .raw_call("getTagsForBrand") + .argument(&brand_id) + .original_result() + } + + pub fn mint_whitelist< + Arg0: ProxyArg>, + >( + self, + brand_id: Arg0, + ) -> TxTypedCall>> { + self.wrapped_tx + .payment(NotPayable) + .raw_call("getMintWhitelist") + .argument(&brand_id) + .original_result() + } + + pub fn add_user_to_admin_list< + Arg0: ProxyArg>, + >( + self, + address: Arg0, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("addUserToAdminList") + .argument(&address) + .original_result() + } + + pub fn remove_user_from_admin_list< + Arg0: ProxyArg>, + >( + self, + address: Arg0, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("removeUserFromAdminList") + .argument(&address) + .original_result() + } + + pub fn issue_token_for_brand< + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg>, + Arg3: ProxyArg>, + Arg4: ProxyArg, + Arg5: ProxyArg, + Arg6: ProxyArg>, + Arg7: ProxyArg>, + Arg8: ProxyArg>, + Arg9: ProxyArg, + Arg10: ProxyArg>>, + Arg11: ProxyArg, usize, BigUint>>>, + >( + self, + collection_hash: Arg0, + brand_id: Arg1, + media_type: Arg2, + royalties: Arg3, + mint_start_timestamp: Arg4, + mint_end_timestamp: Arg5, + mint_price_token_id: Arg6, + token_display_name: Arg7, + token_ticker: Arg8, + whitelist_expire_timestamp: Arg9, + tags: Arg10, + tier_name_nr_nfts_pairs: Arg11, + ) -> TxTypedCall { + self.wrapped_tx + .raw_call("issueTokenForBrand") + .argument(&collection_hash) + .argument(&brand_id) + .argument(&media_type) + .argument(&royalties) + .argument(&mint_start_timestamp) + .argument(&mint_end_timestamp) + .argument(&mint_price_token_id) + .argument(&token_display_name) + .argument(&token_ticker) + .argument(&whitelist_expire_timestamp) + .argument(&tags) + .argument(&tier_name_nr_nfts_pairs) + .original_result() + } + + pub fn add_to_whitelist< + Arg0: ProxyArg>, + Arg1: ProxyArg>>, + >( + self, + brand_id: Arg0, + users: Arg1, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("addToWhitelist") + .argument(&brand_id) + .argument(&users) + .original_result() + } + + pub fn remove_from_whitelist< + Arg0: ProxyArg>, + Arg1: ProxyArg>>, + >( + self, + brand_id: Arg0, + users: Arg1, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("removeFromWhitelist") + .argument(&brand_id) + .argument(&users) + .original_result() + } + + pub fn set_mint_whitelist_expire_timestamp< + Arg0: ProxyArg>, + Arg1: ProxyArg, + >( + self, + brand_id: Arg0, + timestamp: Arg1, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("setMintWhitelistExpireTimestamp") + .argument(&brand_id) + .argument(×tamp) + .original_result() + } + + pub fn buy_random_nft< + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg>, + >( + self, + brand_id: Arg0, + tier: Arg1, + opt_nfts_to_buy: Arg2, + ) -> TxTypedCall>> { + self.wrapped_tx + .raw_call("buyRandomNft") + .argument(&brand_id) + .argument(&tier) + .argument(&opt_nfts_to_buy) + .original_result() + } + + pub fn giveaway_nfts< + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg, usize>>>, + >( + self, + brand_id: Arg0, + tier: Arg1, + dest_amount_pairs: Arg2, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("giveawayNfts") + .argument(&brand_id) + .argument(&tier) + .argument(&dest_amount_pairs) + .original_result() + } + + pub fn nft_tiers_for_brand< + Arg0: ProxyArg>, + >( + self, + brand_id: Arg0, + ) -> TxTypedCall>> { + self.wrapped_tx + .payment(NotPayable) + .raw_call("getNftTiersForBrand") + .argument(&brand_id) + .original_result() + } + + pub fn nft_id_offset_for_tier< + Arg0: ProxyArg>, + Arg1: ProxyArg>, + >( + self, + brand_id: Arg0, + tier: Arg1, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("nftIdOffsetForTier") + .argument(&brand_id) + .argument(&tier) + .original_result() + } + + pub fn set_royalties_claim_address< + Arg0: ProxyArg>, + >( + self, + new_address: Arg0, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("setRoyaltiesClaimAddress") + .argument(&new_address) + .original_result() + } + + pub fn change_royalties_for_brand< + Arg0: ProxyArg>, + Arg1: ProxyArg>, + >( + self, + brand_id: Arg0, + new_royalties: Arg1, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("changeRoyaltiesForBrand") + .argument(&brand_id) + .argument(&new_royalties) + .original_result() + } + + pub fn set_mint_payments_claim_address< + Arg0: ProxyArg>, + >( + self, + new_address: Arg0, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("setMintPaymentsClaimAddress") + .argument(&new_address) + .original_result() + } + + pub fn claim_royalties( + self, + ) -> TxTypedCall, ManagedVec>>> { + self.wrapped_tx + .payment(NotPayable) + .raw_call("claimRoyalties") + .original_result() + } + + pub fn claim_mint_payments( + self, + ) -> TxTypedCall, ManagedVec>>> { + self.wrapped_tx + .payment(NotPayable) + .raw_call("claimMintPayments") + .original_result() + } + + pub fn royalties_claim_address( + self, + ) -> TxTypedCall> { + self.wrapped_tx + .payment(NotPayable) + .raw_call("getRoyaltiesClaimAddress") + .original_result() + } + + pub fn mint_payments_claim_address( + self, + ) -> TxTypedCall> { + self.wrapped_tx + .payment(NotPayable) + .raw_call("getMintPaymentsClaimAddress") + .original_result() + } + + pub fn accumulated_royalties( + self, + ) -> TxTypedCall, BigUint>>> { + self.wrapped_tx + .payment(NotPayable) + .raw_call("getAccumulatedRoyalties") + .original_result() + } + + pub fn accumulated_mint_payments( + self, + ) -> TxTypedCall, BigUint>>> { + self.wrapped_tx + .payment(NotPayable) + .raw_call("getAccumulatedMintPayments") + .original_result() + } + + pub fn claim_royalties_from_marketplace< + Arg0: ProxyArg>, + Arg1: ProxyArg>>, + >( + self, + marketplace_address: Arg0, + tokens: Arg1, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("claimRoyaltiesFromMarketplace") + .argument(&marketplace_address) + .argument(&tokens) + .original_result() + } + + pub fn get_brand_info_view< + Arg0: ProxyArg>, + >( + self, + brand_id: Arg0, + ) -> TxTypedCall> { + self.wrapped_tx + .payment(NotPayable) + .raw_call("getBrandInfo") + .argument(&brand_id) + .original_result() + } + + pub fn get_all_brands_info( + self, + ) -> TxTypedCall>> { + self.wrapped_tx + .payment(NotPayable) + .raw_call("getAllBrandsInfo") + .original_result() + } + + pub fn pause_endpoint( + self, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("pause") + .original_result() + } + + pub fn unpause_endpoint( + self, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("unpause") + .original_result() + } + + pub fn paused_status( + self, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("isPaused") + .original_result() + } +} + +#[type_abi] +#[derive(TopEncode, TopDecode, NestedEncode, NestedDecode, PartialEq, Debug)] +pub struct MintPrice +where + Api: ManagedTypeApi, +{ + pub token_id: EgldOrEsdtTokenIdentifier, + pub amount: BigUint, +} + +#[type_abi] +#[derive(TopEncode, TopDecode)] +pub struct BrandInfoViewResultType +where + Api: ManagedTypeApi, +{ + pub brand_id: ManagedBuffer, + pub nft_token_id: TokenIdentifier, + pub brand_info: BrandInfo, + pub tier_info_entries: ArrayVec, 5usize>, +} + +#[type_abi] +#[derive(TopEncode, TopDecode, NestedEncode, NestedDecode, PartialEq, Debug)] +pub struct BrandInfo +where + Api: ManagedTypeApi, +{ + pub collection_hash: ManagedByteArray, + pub token_display_name: ManagedBuffer, + pub media_type: ManagedBuffer, + pub royalties: BigUint, + pub mint_period: TimePeriod, + pub whitelist_expire_timestamp: u64, +} + +#[type_abi] +#[derive(TopEncode, TopDecode, NestedEncode, NestedDecode, PartialEq, Debug)] +pub struct TimePeriod { + pub start: u64, + pub end: u64, +} + +#[type_abi] +#[derive(TopEncode, TopDecode, NestedEncode, NestedDecode, Debug, PartialEq)] +pub struct TierInfoEntry +where + Api: ManagedTypeApi, +{ + pub tier: ManagedBuffer, + pub total_nfts: usize, + pub available_nfts: usize, + pub mint_price: MintPrice, +} diff --git a/nft-minter/src/views.rs b/nft-minter/src/views.rs index 53711b6..9bde908 100644 --- a/nft-minter/src/views.rs +++ b/nft-minter/src/views.rs @@ -7,7 +7,8 @@ use crate::{ nft_tier::{TierName, MAX_TIERS_PER_BRAND}, }; -#[derive(TypeAbi, TopEncode, TopDecode)] +#[type_abi] +#[derive(TopEncode, TopDecode)] pub struct BrandInfoViewResultType { pub brand_id: BrandId, pub nft_token_id: TokenIdentifier, @@ -15,7 +16,8 @@ pub struct BrandInfoViewResultType { pub tier_info_entries: ArrayVec, MAX_TIERS_PER_BRAND>, } -#[derive(TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode, Debug, PartialEq)] +#[type_abi] +#[derive(TopEncode, TopDecode, NestedEncode, NestedDecode, Debug, PartialEq)] pub struct TierInfoEntry { pub tier: TierName, pub total_nfts: usize, diff --git a/nft-minter/tests/constants/mod.rs b/nft-minter/tests/constants/mod.rs index 3045bc7..5d7fec8 100644 --- a/nft-minter/tests/constants/mod.rs +++ b/nft-minter/tests/constants/mod.rs @@ -19,7 +19,7 @@ pub const FIRST_MINT_PRICE_TOKEN_ID: &[u8] = EGLD_TOKEN_ID; pub const FIRST_MINT_PRICE_AMOUNT: u64 = 1_000; pub const FIRST_TOKEN_DISPLAY_NAME: &[u8] = b"FirstToken"; pub const FIRST_TOKEN_TICKER: &[u8] = b"FIRST"; -pub const FIRST_TOKEN_ID: &[u8] = b"FIRST-000000"; +pub const FIRST_TOKEN_ID: &[u8] = b"FIRST-7afdf5"; pub const FIRST_TAGS: &[&[u8]] = &[b"funny", b"sad", b"memes"]; pub const FIRST_TIERS: &[&[u8]] = &[b"gold", b"silver", b"bronze"]; pub const FIRST_NFT_AMOUNTS: &[usize] = &[5, 10, 20]; @@ -34,7 +34,7 @@ pub const SECOND_MINT_PRICE_TOKEN_ID: &[u8] = EGLD_TOKEN_ID; pub const SECOND_MINT_PRICE_AMOUNT: u64 = 100_000; pub const SECOND_TOKEN_DISPLAY_NAME: &[u8] = b"SecondToken"; pub const SECOND_TOKEN_TICKER: &[u8] = b"SECOND"; -pub const SECOND_TOKEN_ID: &[u8] = b"SECOND-111111"; +pub const SECOND_TOKEN_ID: &[u8] = b"SECOND-7afdf5"; pub const SECOND_TAGS: &[&[u8]] = &[b"random", b"good", b"best"]; pub const SECOND_TIERS: &[&[u8]] = &[b"gold", b"silver", b"bronze"]; pub const SECOND_NFT_AMOUNTS: &[usize] = &[10, 15, 25]; diff --git a/nft-minter/tests/nft_minter_interactor/mod.rs b/nft-minter/tests/nft_minter_interactor/mod.rs index 11b9d64..665470b 100644 --- a/nft-minter/tests/nft_minter_interactor/mod.rs +++ b/nft-minter/tests/nft_minter_interactor/mod.rs @@ -4,10 +4,9 @@ use multiversx_sc::{ types::{Address, EsdtLocalRole, ManagedVec, MultiValueEncoded}, }; use multiversx_sc_scenario::{ - managed_address, managed_biguint, managed_buffer, rust_biguint, - whitebox::TxResult, - whitebox::{BlockchainStateWrapper, ContractObjWrapper}, - DebugApi, + imports::TxResult, + imports::{BlockchainStateWrapper, ContractObjWrapper}, + managed_address, managed_biguint, managed_buffer, rust_biguint, DebugApi, }; use nft_minter::brand_creation::BrandCreationModule; use nft_minter::nft_attributes_builder::COLLECTION_HASH_LEN; diff --git a/nft-minter/tests/rust_test.rs b/nft-minter/tests/rust_test.rs index 9221c09..be86bb6 100644 --- a/nft-minter/tests/rust_test.rs +++ b/nft-minter/tests/rust_test.rs @@ -3,7 +3,9 @@ pub mod nft_minter_interactor; use constants::*; use multiversx_sc::types::{ManagedBuffer, ManagedByteArray, MultiValueEncoded}; -use multiversx_sc_scenario::{managed_address, managed_biguint, managed_buffer, rust_biguint, DebugApi}; +use multiversx_sc_scenario::{ + managed_address, managed_biguint, managed_buffer, rust_biguint, DebugApi, +}; use nft_minter::brand_creation::BrandCreationModule; use nft_minter::common_storage::{BrandInfo, MintPrice, TimePeriod}; use nft_minter::nft_attributes_builder::{NftAttributesBuilderModule, COLLECTION_HASH_LEN}; @@ -128,6 +130,16 @@ fn create_brands_test() { ); }) .assert_ok(); + + nm_setup + .b_mock + .execute_query(&nm_setup.nm_wrapper, |sc| { + let result = sc.get_brand_info_view(managed_buffer!(SECOND_BRAND_ID)); + + let expected_token_id = managed_token_id!(SECOND_TOKEN_ID); + assert_eq!(result.nft_token_id, expected_token_id.unwrap_esdt()); + }) + .assert_ok(); } #[test] diff --git a/nft-minter/wasm/Cargo.lock b/nft-minter/wasm/Cargo.lock index 9e216e2..46d4b26 100644 --- a/nft-minter/wasm/Cargo.lock +++ b/nft-minter/wasm/Cargo.lock @@ -2,18 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - [[package]] name = "arrayvec" version = "0.7.4" @@ -28,15 +16,9 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "bitflags" -version = "1.3.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "endian-type" @@ -44,15 +26,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - [[package]] name = "hex" version = "0.4.3" @@ -61,73 +34,74 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "multiversx-sc" -version = "0.41.3" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfbe80ec68fedf299dd65469f8999cf3c0f884ffa497122428f08303bcb8b884" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", "num-traits", + "unwrap-infallible", ] [[package]] name = "multiversx-sc-codec" -version = "0.17.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d70ea458247d263b7e9fdfb207530b6a530546247139c162450e515c013a18" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", + "unwrap-infallible", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ad6920f80fda67fc60fd51aaa9f83ec7e069470f60a068c81205f9da5d05a30" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" dependencies = [ "hex", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] name = "multiversx-sc-derive" -version = "0.41.3" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c2b87d817f2176bf1830bef938884f24267516c334a377e71a96bc18ebb09c1" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn 1.0.109", + "syn", ] [[package]] name = "multiversx-sc-modules" -version = "0.41.3" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704825223788bfdfd622980cae8feedae82609fded5ef5f53af31661d5e02312" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.41.3" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "932327626de71eeb1dbe86b863cc70cc532f8ceba8e73a059410f6aa56b22a77" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" dependencies = [ "multiversx-sc", ] @@ -166,12 +140,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "proc-macro2" version = "1.0.82" @@ -206,17 +174,6 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" -[[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.61" @@ -235,27 +192,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "zerocopy" -version = "0.7.34" +name = "unwrap-infallible" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.61", -] +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" diff --git a/nft-minter/wasm/Cargo.toml b/nft-minter/wasm/Cargo.toml index 70a9e1b..75703fa 100644 --- a/nft-minter/wasm/Cargo.toml +++ b/nft-minter/wasm/Cargo.toml @@ -1,25 +1,34 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "nft-minter-wasm" version = "0.0.0" -authors = ["Dorin Marian Iancu, dorin.iancu@elrond.com"] edition = "2018" publish = false [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false + +[profile.dev] +panic = "abort" + [dependencies.nft-minter] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.3" +version = "=0.50.0" + +[workspace] +members = ["."] diff --git a/nft-minter/wasm/src/lib.rs b/nft-minter/wasm/src/lib.rs index 3e9fc3e..f93b817 100644 --- a/nft-minter/wasm/src/lib.rs +++ b/nft-minter/wasm/src/lib.rs @@ -1,16 +1,16 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 34 +// Upgrade: 1 +// Endpoints: 33 // Async Callback: 1 // Total number of exported functions: 36 #![no_std] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,40 +18,42 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { nft_minter ( - upgrade - setMaxNftsPerTransaction - getMaxNftsPerTransaction - getRegisterdCollectionHashes - getRegisteredBrands - getNftTokenIdForBrand - getPriceForTier - getTagsForBrand - getMintWhitelist - addUserToAdminList - removeUserFromAdminList - issueTokenForBrand - addToWhitelist - removeFromWhitelist - setMintWhitelistExpireTimestamp - buyRandomNft - giveawayNfts - getNftTiersForBrand - nftIdOffsetForTier - setRoyaltiesClaimAddress - changeRoyaltiesForBrand - setMintPaymentsClaimAddress - claimRoyalties - claimMintPayments - getRoyaltiesClaimAddress - getMintPaymentsClaimAddress - getAccumulatedRoyalties - getAccumulatedMintPayments - claimRoyaltiesFromMarketplace - getBrandInfo - getAllBrandsInfo - pause - unpause - isPaused - callBack + init => init + upgrade => upgrade + setMaxNftsPerTransaction => set_max_nfts_per_transaction + getMaxNftsPerTransaction => max_nfts_per_transaction + getRegisterdCollectionHashes => registered_collection_hashes + getRegisteredBrands => registered_brands + getNftTokenIdForBrand => nft_token + getPriceForTier => price_for_tier + getTagsForBrand => tags_for_brand + getMintWhitelist => mint_whitelist + addUserToAdminList => add_user_to_admin_list + removeUserFromAdminList => remove_user_from_admin_list + issueTokenForBrand => issue_token_for_brand + addToWhitelist => add_to_whitelist + removeFromWhitelist => remove_from_whitelist + setMintWhitelistExpireTimestamp => set_mint_whitelist_expire_timestamp + buyRandomNft => buy_random_nft + giveawayNfts => giveaway_nfts + getNftTiersForBrand => nft_tiers_for_brand + nftIdOffsetForTier => nft_id_offset_for_tier + setRoyaltiesClaimAddress => set_royalties_claim_address + changeRoyaltiesForBrand => change_royalties_for_brand + setMintPaymentsClaimAddress => set_mint_payments_claim_address + claimRoyalties => claim_royalties + claimMintPayments => claim_mint_payments + getRoyaltiesClaimAddress => royalties_claim_address + getMintPaymentsClaimAddress => mint_payments_claim_address + getAccumulatedRoyalties => accumulated_royalties + getAccumulatedMintPayments => accumulated_mint_payments + claimRoyaltiesFromMarketplace => claim_royalties_from_marketplace + getBrandInfo => get_brand_info_view + getAllBrandsInfo => get_all_brands_info + pause => pause_endpoint + unpause => unpause_endpoint + isPaused => paused_status ) } + +multiversx_sc_wasm_adapter::async_callback! { nft_minter } diff --git a/royalties-handler/Cargo.toml b/royalties-handler/Cargo.toml index c05c924..67bde9a 100644 --- a/royalties-handler/Cargo.toml +++ b/royalties-handler/Cargo.toml @@ -7,11 +7,12 @@ publish = false [lib] path = "src/lib.rs" + [dependencies.nft-minter] path = "../nft-minter" [dependencies.multiversx-sc] -version = "=0.41.3" +version = "=0.50.0" [dev-dependencies] num-bigint = "0.4.2" @@ -22,4 +23,4 @@ hex = "0.4" path = "../esdt-system-sc-mock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.3" +version = "=0.50.0" diff --git a/royalties-handler/meta/Cargo.toml b/royalties-handler/meta/Cargo.toml index 215b5ad..a38dbc5 100644 --- a/royalties-handler/meta/Cargo.toml +++ b/royalties-handler/meta/Cargo.toml @@ -6,8 +6,10 @@ publish = false authors = ["Dorin Marian Iancu, dorin.iancu@elrond.com"] [dev-dependencies] + [dependencies.royalties-handler] path = ".." [dependencies.multiversx-sc-meta] -version = "=0.41.3" +version = "=0.50.0" +default-features = false diff --git a/royalties-handler/src/nft_minter_interactor.rs b/royalties-handler/src/nft_minter_interactor.rs index bbead67..986f699 100644 --- a/royalties-handler/src/nft_minter_interactor.rs +++ b/royalties-handler/src/nft_minter_interactor.rs @@ -1,6 +1,6 @@ multiversx_sc::imports!(); -use nft_minter::{common_storage::EgldValuePaymentsVecPair, royalties::ProxyTrait as _}; +use nft_minter::common_storage::EgldValuePaymentsVecPair; #[multiversx_sc::module] pub trait NftMinterInteractorModule: @@ -31,23 +31,26 @@ pub trait NftMinterInteractorModule: &self, sc_address: ManagedAddress, ) -> EgldValuePaymentsVecPair { - self.nft_minter_proxy(sc_address) + self.tx() + .to(sc_address) + .typed(nft_minter::nft_minter_proxy::NftMinterProxy) .claim_royalties() - .execute_on_dest_context() + .returns(ReturnsResult) + .sync_call() } fn call_claim_mint_payments( &self, sc_address: ManagedAddress, ) -> EgldValuePaymentsVecPair { - self.nft_minter_proxy(sc_address) + self.tx() + .to(sc_address) + .typed(nft_minter::nft_minter_proxy::NftMinterProxy) .claim_mint_payments() - .execute_on_dest_context() + .returns(ReturnsResult) + .sync_call() } - #[proxy] - fn nft_minter_proxy(&self, sc_address: ManagedAddress) -> nft_minter::Proxy; - #[view(getNftMinterScAddress)] #[storage_mapper("nftMinterScAddress")] fn nft_minter_sc_address(&self) -> SingleValueMapper; diff --git a/royalties-handler/src/reward_entries.rs b/royalties-handler/src/reward_entries.rs index 370bf37..4f17c94 100644 --- a/royalties-handler/src/reward_entries.rs +++ b/royalties-handler/src/reward_entries.rs @@ -5,7 +5,8 @@ use nft_minter::common_storage::PaymentsVec; pub const FIRST_ENTRY_ID: usize = 1; -#[derive(TypeAbi, TopEncode, TopDecode, PartialEq, Debug)] +#[type_abi] +#[derive(TopEncode, TopDecode, PartialEq, Debug)] pub struct RewardEntry { pub egld_amount: BigUint, pub esdt_payments: PaymentsVec, diff --git a/royalties-handler/tests/constants/mod.rs b/royalties-handler/tests/constants/mod.rs index c0c8bd3..d7567f5 100644 --- a/royalties-handler/tests/constants/mod.rs +++ b/royalties-handler/tests/constants/mod.rs @@ -19,7 +19,7 @@ pub const FIRST_MINT_PRICE_TOKEN_ID: &[u8] = EGLD_TOKEN_ID; pub const FIRST_MINT_PRICE_AMOUNT: u64 = 1_000; pub const FIRST_TOKEN_DISPLAY_NAME: &[u8] = b"FirstToken"; pub const FIRST_TOKEN_TICKER: &[u8] = b"FIRST"; -pub const FIRST_TOKEN_ID: &[u8] = b"FIRST-000000"; +pub const FIRST_TOKEN_ID: &[u8] = b"FIRST-7afdf5"; pub const FIRST_TAGS: &[&[u8]] = &[b"funny", b"sad", b"memes"]; pub const FIRST_TIERS: &[&[u8]] = &[b"gold", b"silver", b"bronze"]; pub const FIRST_NFT_AMOUNTS: &[usize] = &[5, 10, 20]; diff --git a/royalties-handler/tests/nft_minter_setup/mod.rs b/royalties-handler/tests/nft_minter_setup/mod.rs index d32192c..771aa53 100644 --- a/royalties-handler/tests/nft_minter_setup/mod.rs +++ b/royalties-handler/tests/nft_minter_setup/mod.rs @@ -4,10 +4,8 @@ use multiversx_sc::{ types::{Address, EsdtLocalRole, ManagedVec, MultiValueEncoded}, }; use multiversx_sc_scenario::{ - managed_address, managed_biguint, managed_buffer, rust_biguint, - whitebox::TxResult, - whitebox::{BlockchainStateWrapper, ContractObjWrapper}, - DebugApi, + imports::{BlockchainStateWrapper, ContractObjWrapper, TxResult}, + managed_address, managed_biguint, managed_buffer, rust_biguint, DebugApi, }; use nft_minter::brand_creation::BrandCreationModule; use nft_minter::nft_attributes_builder::COLLECTION_HASH_LEN; @@ -52,15 +50,6 @@ where let nm_wrapper = b_mock.create_sc_account(&rust_zero, Some(&owner_address), builder, "nft minter path"); - // init ESDT System SC mock - b_mock.create_sc_account_fixed_address( - &Address::from(ESDT_SYSTEM_SC_ADDRESS_ARRAY), - &rust_zero, - None, - esdt_system_sc_mock::contract_obj, - "ESDT system SC mock path", - ); - b_mock .execute_tx(&owner_address, &nm_wrapper, &rust_zero, |sc| { sc.init( diff --git a/royalties-handler/tests/royalties_handler_setup/mod.rs b/royalties-handler/tests/royalties_handler_setup/mod.rs index b7f26b6..2e7f79e 100644 --- a/royalties-handler/tests/royalties_handler_setup/mod.rs +++ b/royalties-handler/tests/royalties_handler_setup/mod.rs @@ -1,10 +1,9 @@ use crate::nft_minter_setup::NftMinterSetup; use multiversx_sc::types::{Address, MultiValueEncoded}; use multiversx_sc_scenario::{ - managed_address, rust_biguint, - whitebox::{BlockchainStateWrapper, ContractObjWrapper}, - whitebox::TxResult, - DebugApi, + imports::TxResult, + imports::{BlockchainStateWrapper, ContractObjWrapper}, + managed_address, rust_biguint, DebugApi, }; use nft_minter::royalties::RoyaltiesModule; use royalties_handler::nft_minter_interactor::NftMinterInteractorModule; diff --git a/royalties-handler/wasm/Cargo.lock b/royalties-handler/wasm/Cargo.lock index 835b9d5..bfd3652 100644 --- a/royalties-handler/wasm/Cargo.lock +++ b/royalties-handler/wasm/Cargo.lock @@ -2,18 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - [[package]] name = "arrayvec" version = "0.7.4" @@ -28,15 +16,9 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "bitflags" -version = "1.3.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "endian-type" @@ -44,15 +26,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - [[package]] name = "hex" version = "0.4.3" @@ -61,73 +34,74 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "multiversx-sc" -version = "0.41.3" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfbe80ec68fedf299dd65469f8999cf3c0f884ffa497122428f08303bcb8b884" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", "num-traits", + "unwrap-infallible", ] [[package]] name = "multiversx-sc-codec" -version = "0.17.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d70ea458247d263b7e9fdfb207530b6a530546247139c162450e515c013a18" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", + "unwrap-infallible", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ad6920f80fda67fc60fd51aaa9f83ec7e069470f60a068c81205f9da5d05a30" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" dependencies = [ "hex", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] name = "multiversx-sc-derive" -version = "0.41.3" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c2b87d817f2176bf1830bef938884f24267516c334a377e71a96bc18ebb09c1" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn 1.0.109", + "syn", ] [[package]] name = "multiversx-sc-modules" -version = "0.41.3" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704825223788bfdfd622980cae8feedae82609fded5ef5f53af31661d5e02312" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.41.3" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "932327626de71eeb1dbe86b863cc70cc532f8ceba8e73a059410f6aa56b22a77" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" dependencies = [ "multiversx-sc", ] @@ -158,12 +132,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "proc-macro2" version = "1.0.82" @@ -214,17 +182,6 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" -[[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.61" @@ -243,27 +200,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "zerocopy" -version = "0.7.34" +name = "unwrap-infallible" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.61", -] +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" diff --git a/royalties-handler/wasm/Cargo.toml b/royalties-handler/wasm/Cargo.toml index 73cd94f..91104ee 100644 --- a/royalties-handler/wasm/Cargo.toml +++ b/royalties-handler/wasm/Cargo.toml @@ -1,25 +1,34 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "royalties-handler-wasm" version = "0.0.0" -authors = ["Dorin Marian Iancu, dorin.iancu@elrond.com"] edition = "2018" publish = false [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false + +[profile.dev] +panic = "abort" + [dependencies.royalties-handler] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.3" +version = "=0.50.0" + +[workspace] +members = ["."] diff --git a/royalties-handler/wasm/src/lib.rs b/royalties-handler/wasm/src/lib.rs index 6e7cafd..019be5b 100644 --- a/royalties-handler/wasm/src/lib.rs +++ b/royalties-handler/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// @@ -10,7 +10,6 @@ // Total number of exported functions: 16 #![no_std] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,21 +17,22 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { royalties_handler ( - getLastClaimEpoch - getShareholders - claimNftMinterPaymentsAndRoyalties - getNftMinterScAddress - addShareholders - removeShareholders - claimRewards - getClaimableEntryIdsForAddress - claimableTokensForRewardEntry - createNewRewardEntry - getLastRewardEntryEpoch - getLastEntryId - getClaimWhitelistForEntry - getTokenBalances + init => init + getLastClaimEpoch => last_claim_epoch + getShareholders => shareholders + claimNftMinterPaymentsAndRoyalties => claim_nft_minter_payments_and_royalties + getNftMinterScAddress => nft_minter_sc_address + addShareholders => add_shareholders + removeShareholders => remove_shareholders + claimRewards => claim_rewards + getClaimableEntryIdsForAddress => get_claimable_entry_ids_for_address + claimableTokensForRewardEntry => get_claimable_tokens_for_reward_entry + createNewRewardEntry => create_new_reward_entry + getLastRewardEntryEpoch => last_reward_entry_epoch + getLastEntryId => last_entry_id + getClaimWhitelistForEntry => claim_whitelist_for_entry + getTokenBalances => get_token_balances ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {}