diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 3838e228..31dc66a2 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -20,7 +20,7 @@ permissions: jobs: contracts: name: Contracts - uses: multiversx/mx-sc-actions/.github/workflows/contracts.yml@v3.2.0 + uses: multiversx/mx-sc-actions/.github/workflows/contracts.yml@v3.3.1 with: rust-toolchain: stable coverage-args: --ignore-filename-regex='/.cargo/git' --output ./coverage.md diff --git a/Cargo.lock b/Cargo.lock index cb900a54..854b0e0d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -283,6 +283,23 @@ dependencies = [ "syn", ] +[[package]] +name = "delegation-mock" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "multiversx-sc-scenario", + "num-bigint", +] + +[[package]] +name = "delegation-mock-meta" +version = "0.0.0" +dependencies = [ + "delegation-mock", + "multiversx-sc-meta-lib", +] + [[package]] name = "der" version = "0.7.9" @@ -544,6 +561,24 @@ version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +[[package]] +name = "liquid-staking" +version = "0.0.0" +dependencies = [ + "delegation-mock", + "multiversx-sc", + "multiversx-sc-scenario", + "num-bigint", +] + +[[package]] +name = "liquid-staking-meta" +version = "0.0.0" +dependencies = [ + "liquid-staking", + "multiversx-sc-meta-lib", +] + [[package]] name = "log" version = "0.4.21" @@ -608,9 +643,9 @@ checksum = "b59072fa0624b55ae5ae3fa6bfa91515bbeb4ac440214bc4a509e2c8806d6e9f" [[package]] name = "multiversx-sc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a86a27b04bb7cca97ad8971ee57e6b978619623dde4ba9acae1d4ecb436f062" +checksum = "e05f8dfb9c2dd26feff1330b1e229f0886f5c0228ed570f19421a458e6e7b0ef" dependencies = [ "bitflags", "hex-literal", @@ -646,9 +681,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7a6ee275d6b1c2b86394369df0bc62a3f25018cbab12668a191b89d88fdcf71" +checksum = "f4b5176aa94b5e422e0d3c904492e0de0ae8381f166b563fbcac19a9ca4b28bc" dependencies = [ "hex", "proc-macro2", @@ -659,9 +694,9 @@ dependencies = [ [[package]] name = "multiversx-sc-meta-lib" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cadbd4a972764b864e7f6b73e6963df85f7010fbd3a993d820873809bce4e93" +checksum = "750e309894ebebad3675feb3d59bb709f826c07cbdf21adf5719b5ab2f23aa13" dependencies = [ "clap", "colored", @@ -680,18 +715,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fece2308326cc59c53fedd682259625e8ecc306e4c3b35051725ca388677b47b" +checksum = "3cfb6046ec3cc6ef94351b4ca89907b2b74b2e4a7f376adc0af18ddd1c5a4367" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-scenario" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe13bdcc09d9405c5767593359c8193dc05f8271423f76bd991cfabb90056e4c" +checksum = "701ca689a866acb88cf5022ec8bae1ba318065e5800f75dd76e3620d2a782ca0" dependencies = [ "base64", "bech32", diff --git a/Cargo.toml b/Cargo.toml index 6d3767a1..93732798 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,5 +11,9 @@ members = [ "header-verifier", "header-verifier/meta", "enshrine-esdt-safe", - "enshrine-esdt-safe/meta" + "enshrine-esdt-safe/meta", + "liquid-staking", + "liquid-staking/meta", + "delegation-mock", + "delegation-mock/meta", ] diff --git a/chain-config/Cargo.toml b/chain-config/Cargo.toml index cd4744a4..d5d3fcd5 100644 --- a/chain-config/Cargo.toml +++ b/chain-config/Cargo.toml @@ -12,10 +12,10 @@ path = "src/lib.rs" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.53.0" +version = "=0.53.1" [dependencies.multiversx-sc] -version = "=0.53.0" +version = "=0.53.1" [dependencies.multiversx-sc-modules] -version = "=0.53.0" +version = "=0.53.1" diff --git a/chain-config/meta/Cargo.toml b/chain-config/meta/Cargo.toml index ed0c1ef4..d5971030 100644 --- a/chain-config/meta/Cargo.toml +++ b/chain-config/meta/Cargo.toml @@ -11,4 +11,4 @@ authors = ["you"] path = ".." [dependencies.multiversx-sc-meta-lib] -version = "=0.53.0" +version = "=0.53.1" diff --git a/chain-config/wasm/Cargo.lock b/chain-config/wasm/Cargo.lock index 00dfb9ee..61d0dfb8 100644 --- a/chain-config/wasm/Cargo.lock +++ b/chain-config/wasm/Cargo.lock @@ -56,9 +56,9 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "multiversx-sc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a86a27b04bb7cca97ad8971ee57e6b978619623dde4ba9acae1d4ecb436f062" +checksum = "e05f8dfb9c2dd26feff1330b1e229f0886f5c0228ed570f19421a458e6e7b0ef" dependencies = [ "bitflags", "hex-literal", @@ -93,9 +93,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7a6ee275d6b1c2b86394369df0bc62a3f25018cbab12668a191b89d88fdcf71" +checksum = "f4b5176aa94b5e422e0d3c904492e0de0ae8381f166b563fbcac19a9ca4b28bc" dependencies = [ "hex", "proc-macro2", @@ -106,18 +106,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fece2308326cc59c53fedd682259625e8ecc306e4c3b35051725ca388677b47b" +checksum = "3cfb6046ec3cc6ef94351b4ca89907b2b74b2e4a7f376adc0af18ddd1c5a4367" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab5bb42b3ce827227a5e38f3c24fbe0fb23d475425b049043e193186e36c590" +checksum = "9aa0cbd543872f94b9bc98c4ce7c3ed25a7257e1425295af9036eba44893bdaa" dependencies = [ "multiversx-sc", ] diff --git a/chain-config/wasm/Cargo.toml b/chain-config/wasm/Cargo.toml index 5440d67d..6a696293 100644 --- a/chain-config/wasm/Cargo.toml +++ b/chain-config/wasm/Cargo.toml @@ -28,7 +28,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.53.0" +version = "=0.53.1" [workspace] members = ["."] diff --git a/chain-factory/Cargo.toml b/chain-factory/Cargo.toml index de7f33a8..337846c5 100644 --- a/chain-factory/Cargo.toml +++ b/chain-factory/Cargo.toml @@ -12,10 +12,10 @@ path = "src/lib.rs" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.53.0" +version = "=0.53.1" [dependencies.multiversx-sc] -version = "=0.53.0" +version = "=0.53.1" [dependencies.utils] path = "../common/utils" diff --git a/chain-factory/meta/Cargo.toml b/chain-factory/meta/Cargo.toml index 8db9cb29..6d3d98bb 100644 --- a/chain-factory/meta/Cargo.toml +++ b/chain-factory/meta/Cargo.toml @@ -11,4 +11,4 @@ authors = ["you"] path = ".." [dependencies.multiversx-sc-meta-lib] -version = "=0.53.0" +version = "=0.53.1" diff --git a/chain-factory/wasm/Cargo.lock b/chain-factory/wasm/Cargo.lock index 51ce0e6d..1a1b1683 100644 --- a/chain-factory/wasm/Cargo.lock +++ b/chain-factory/wasm/Cargo.lock @@ -74,9 +74,9 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "multiversx-sc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a86a27b04bb7cca97ad8971ee57e6b978619623dde4ba9acae1d4ecb436f062" +checksum = "e05f8dfb9c2dd26feff1330b1e229f0886f5c0228ed570f19421a458e6e7b0ef" dependencies = [ "bitflags", "hex-literal", @@ -111,9 +111,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7a6ee275d6b1c2b86394369df0bc62a3f25018cbab12668a191b89d88fdcf71" +checksum = "f4b5176aa94b5e422e0d3c904492e0de0ae8381f166b563fbcac19a9ca4b28bc" dependencies = [ "hex", "proc-macro2", @@ -124,18 +124,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fece2308326cc59c53fedd682259625e8ecc306e4c3b35051725ca388677b47b" +checksum = "3cfb6046ec3cc6ef94351b4ca89907b2b74b2e4a7f376adc0af18ddd1c5a4367" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab5bb42b3ce827227a5e38f3c24fbe0fb23d475425b049043e193186e36c590" +checksum = "9aa0cbd543872f94b9bc98c4ce7c3ed25a7257e1425295af9036eba44893bdaa" dependencies = [ "multiversx-sc", ] diff --git a/chain-factory/wasm/Cargo.toml b/chain-factory/wasm/Cargo.toml index acd7dbdf..da4b60be 100644 --- a/chain-factory/wasm/Cargo.toml +++ b/chain-factory/wasm/Cargo.toml @@ -28,7 +28,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.53.0" +version = "=0.53.1" [workspace] members = ["."] diff --git a/common/bls-signature/Cargo.toml b/common/bls-signature/Cargo.toml index 2191447e..d82386b8 100644 --- a/common/bls-signature/Cargo.toml +++ b/common/bls-signature/Cargo.toml @@ -5,10 +5,10 @@ authors = ["dorin-iancu "] edition = "2018" [dependencies.multiversx-sc] -version = "=0.53.0" +version = "=0.53.1" [dependencies.transaction] path = "../transaction" [dev-dependencies.multiversx-sc-scenario] -version = "=0.53.0" +version = "=0.53.1" diff --git a/common/max-bridged-amount-module/Cargo.toml b/common/max-bridged-amount-module/Cargo.toml index bf7ff1b8..b3b13d94 100644 --- a/common/max-bridged-amount-module/Cargo.toml +++ b/common/max-bridged-amount-module/Cargo.toml @@ -5,7 +5,7 @@ authors = ["dorin-iancu "] edition = "2018" [dependencies.multiversx-sc] -version = "=0.53.0" +version = "=0.53.1" [dev-dependencies.multiversx-sc-scenario] -version = "=0.53.0" +version = "=0.53.1" diff --git a/common/setup-phase/Cargo.toml b/common/setup-phase/Cargo.toml index 66afa678..7d90b854 100644 --- a/common/setup-phase/Cargo.toml +++ b/common/setup-phase/Cargo.toml @@ -5,7 +5,7 @@ authors = ["dorin-iancu "] edition = "2018" [dependencies.multiversx-sc] -version = "=0.53.0" +version = "=0.53.1" [dev-dependencies.multiversx-sc-scenario] -version = "=0.53.0" +version = "=0.53.1" diff --git a/common/token-whitelist/Cargo.toml b/common/token-whitelist/Cargo.toml index 9f7fb637..47706a54 100644 --- a/common/token-whitelist/Cargo.toml +++ b/common/token-whitelist/Cargo.toml @@ -14,7 +14,7 @@ path = "../setup-phase" path = "../utils" [dependencies.multiversx-sc] -version = "=0.53.0" +version = "=0.53.1" [dev-dependencies.multiversx-sc-scenario] -version = "=0.53.0" +version = "=0.53.1" diff --git a/common/transaction/Cargo.toml b/common/transaction/Cargo.toml index e8a91e96..38641b06 100644 --- a/common/transaction/Cargo.toml +++ b/common/transaction/Cargo.toml @@ -8,4 +8,4 @@ edition = "2018" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.53.0" +version = "=0.53.1" diff --git a/common/tx-batch-module/Cargo.toml b/common/tx-batch-module/Cargo.toml index 1e0a090b..e85dee7f 100644 --- a/common/tx-batch-module/Cargo.toml +++ b/common/tx-batch-module/Cargo.toml @@ -5,10 +5,10 @@ authors = ["dorin-iancu "] edition = "2018" [dependencies.multiversx-sc] -version = "=0.53.0" +version = "=0.53.1" [dependencies.transaction] path = "../transaction" [dev-dependencies.multiversx-sc-scenario] -version = "=0.53.0" +version = "=0.53.1" diff --git a/common/utils/Cargo.toml b/common/utils/Cargo.toml index 76df98fc..3e546289 100644 --- a/common/utils/Cargo.toml +++ b/common/utils/Cargo.toml @@ -11,5 +11,5 @@ path = "src/lib.rs" path = "../bls-signature" [dependencies.multiversx-sc] -version = "=0.53.0" +version = "=0.53.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/delegation-mock/Cargo.lock b/delegation-mock/Cargo.lock new file mode 100644 index 00000000..3b62e40b --- /dev/null +++ b/delegation-mock/Cargo.lock @@ -0,0 +1,1153 @@ +# This file is automatically @generated by Cargo. +# 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 = "anstream" +version = "0.6.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" + +[[package]] +name = "anstyle-parse" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + +[[package]] +name = "anyhow" +version = "1.0.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bech32" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "4.5.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" + +[[package]] +name = "colorchoice" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" + +[[package]] +name = "colored" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" +dependencies = [ + "lazy_static", + "windows-sys 0.48.0", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "cpufeatures" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "delegation-mock" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "multiversx-sc-scenario", + "num-bigint", +] + +[[package]] +name = "delegation-mock-meta" +version = "0.0.0" +dependencies = [ + "delegation-mock", + "multiversx-sc-meta-lib", +] + +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8", + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" +dependencies = [ + "curve25519-dalek", + "ed25519", + "serde", + "sha2", + "subtle", + "zeroize", +] + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[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 = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "serde", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "indexmap" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +dependencies = [ + "equivalent", + "hashbrown", + "serde", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.158" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "multiversx-chain-scenario-format" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcca77966bf5eb9c9f96d0597f17a4fa7b64681cc7b83e39bdf31f8c6ca04d44" +dependencies = [ + "bech32", + "hex", + "num-bigint", + "num-traits", + "serde", + "serde_json", + "sha3", +] + +[[package]] +name = "multiversx-chain-vm" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c537d27dfc7a8e295d4f7c5f67a967ce66b6c3fc8e31a160e8cf28e14ecb2d" +dependencies = [ + "bitflags", + "colored", + "ed25519-dalek", + "hex", + "hex-literal", + "itertools", + "multiversx-chain-vm-executor", + "num-bigint", + "num-traits", + "rand", + "rand_seeder", + "sha2", + "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.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a86a27b04bb7cca97ad8971ee57e6b978619623dde4ba9acae1d4ecb436f062" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "007d7a5a8534e5dc9128cb8f15a65a21dd378e135c6016c7cd1491cd012bc8cb" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "num-bigint", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dffba1dce273ed5b61ee1b90aeea5c8c744617d0f12624f620768c144d83e753" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7a6ee275d6b1c2b86394369df0bc62a3f25018cbab12668a191b89d88fdcf71" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-meta-lib" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cadbd4a972764b864e7f6b73e6963df85f7010fbd3a993d820873809bce4e93" +dependencies = [ + "clap", + "colored", + "convert_case", + "hex", + "lazy_static", + "multiversx-sc", + "rustc_version", + "semver", + "serde", + "serde_json", + "toml", + "wasmparser", + "wasmprinter", +] + +[[package]] +name = "multiversx-sc-scenario" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe13bdcc09d9405c5767593359c8193dc05f8271423f76bd991cfabb90056e4c" +dependencies = [ + "base64", + "bech32", + "colored", + "hex", + "itertools", + "log", + "multiversx-chain-scenario-format", + "multiversx-chain-vm", + "multiversx-chain-vm-executor", + "multiversx-sc", + "multiversx-sc-meta-lib", + "num-bigint", + "num-traits", + "pathdiff", + "serde", + "serde_json", + "sha2", + "unwrap-infallible", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "pathdiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_seeder" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9febe641d2842ffc76ee962668a17578767c4e01735e4802b21ed9a24b2e4e" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.128" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +dependencies = [ + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "rand_core", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "toml" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" + +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasmparser" +version = "0.216.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcdee6bea3619d311fb4b299721e89a986c3470f804b6d534340e412589028e3" +dependencies = [ + "ahash", + "bitflags", + "hashbrown", + "indexmap", + "semver", + "serde", +] + +[[package]] +name = "wasmprinter" +version = "0.216.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f82916f3892e53620639217d6ec78fe15c678352a3fbf3f3745b6417d0bd70f" +dependencies = [ + "anyhow", + "termcolor", + "wasmparser", +] + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +dependencies = [ + "memchr", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/delegation-mock/Cargo.toml b/delegation-mock/Cargo.toml new file mode 100644 index 00000000..343b6999 --- /dev/null +++ b/delegation-mock/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "delegation-mock" +version = "0.0.0" +publish = false +edition = "2021" +authors = ["you"] + +[lib] +path = "src/lib.rs" + +[dependencies.multiversx-sc] +version = "0.53.1" + +[dev-dependencies] +num-bigint = "0.4" + +[dev-dependencies.multiversx-sc-scenario] +version = "0.53.1" diff --git a/delegation-mock/meta/Cargo.toml b/delegation-mock/meta/Cargo.toml new file mode 100644 index 00000000..b1973e66 --- /dev/null +++ b/delegation-mock/meta/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "delegation-mock-meta" +version = "0.0.0" +edition = "2021" +publish = false + +[dependencies.delegation-mock] +path = ".." + +[dependencies.multiversx-sc-meta-lib] +version = "0.53.1" +default-features = false diff --git a/delegation-mock/meta/src/main.rs b/delegation-mock/meta/src/main.rs new file mode 100644 index 00000000..71ddc614 --- /dev/null +++ b/delegation-mock/meta/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + multiversx_sc_meta_lib::cli_main::(); +} diff --git a/delegation-mock/multiversx.json b/delegation-mock/multiversx.json new file mode 100644 index 00000000..73655396 --- /dev/null +++ b/delegation-mock/multiversx.json @@ -0,0 +1,3 @@ +{ + "language": "rust" +} \ No newline at end of file diff --git a/delegation-mock/sc-config.toml b/delegation-mock/sc-config.toml new file mode 100644 index 00000000..20ba4f63 --- /dev/null +++ b/delegation-mock/sc-config.toml @@ -0,0 +1,22 @@ +[settings] +main = "main" + +[contracts.main] +name = "delegation-mock" + +[contracts.full] +name = "delegation-mock-full" +add-unlabelled = true +add-labels = ["delegation-mock-external-view"] + +[contracts.view] +name = "delegation-mock-view" +external-view = true +add-unlabelled = false +add-labels = ["delegation-mock-external-view"] + +[[proxy]] +path = "src/delegation_proxy.rs" + +[[proxy]] +path = "../liquid-staking/src/delegation_proxy.rs" diff --git a/delegation-mock/scenarios/delegation_mock.scen.json b/delegation-mock/scenarios/delegation_mock.scen.json new file mode 100644 index 00000000..36982a29 --- /dev/null +++ b/delegation-mock/scenarios/delegation_mock.scen.json @@ -0,0 +1,39 @@ +{ + "name": "empty", + "steps": [ + { + "step": "setState", + "accounts": { + "address:owner": { + "nonce": "1", + "balance": "0" + } + }, + "newAddresses": [ + { + "creatorAddress": "address:owner", + "creatorNonce": "1", + "newAddress": "sc:empty" + } + ] + }, + { + "step": "scDeploy", + "id": "deploy", + "tx": { + "from": "address:owner", + "contractCode": "mxsc:../output/delegation-mock.mxsc.json", + "arguments": [], + "gasLimit": "5,000,000", + "gasPrice": "0" + }, + "expect": { + "out": [], + "status": "", + "logs": [], + "gas": "*", + "refund": "*" + } + } + ] +} diff --git a/delegation-mock/src/delegation_proxy.rs b/delegation-mock/src/delegation_proxy.rs new file mode 100644 index 00000000..268915ca --- /dev/null +++ b/delegation-mock/src/delegation_proxy.rs @@ -0,0 +1,111 @@ +// 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 DelegationMockProxy; + +impl TxProxyTrait for DelegationMockProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = DelegationMockProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + DelegationMockProxyMethods { wrapped_tx: tx } + } +} + +pub struct DelegationMockProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +#[rustfmt::skip] +impl DelegationMockProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + Gas: TxGas, +{ + pub fn init( + self, + ) -> TxTypedDeploy { + self.wrapped_tx + .payment(NotPayable) + .raw_deploy() + .original_result() + } +} + +#[rustfmt::skip] +impl DelegationMockProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn deposit_egld( + self, + ) -> TxTypedCall { + self.wrapped_tx + .raw_call("depositEGLD") + .original_result() + } + + pub fn delegate( + self, + ) -> TxTypedCall { + self.wrapped_tx + .raw_call("delegate") + .original_result() + } + + pub fn undelegate< + Arg0: ProxyArg>, + >( + self, + egld_to_undelegate: Arg0, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("unDelegate") + .argument(&egld_to_undelegate) + .original_result() + } + + pub fn withdraw( + self, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("withdraw") + .original_result() + } + + pub fn claim_rewards( + self, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("claimRewards") + .original_result() + } +} diff --git a/delegation-mock/src/lib.rs b/delegation-mock/src/lib.rs new file mode 100644 index 00000000..d6d990c9 --- /dev/null +++ b/delegation-mock/src/lib.rs @@ -0,0 +1,109 @@ +#![no_std] + +multiversx_sc::imports!(); + +pub type Epoch = u64; +pub const MAX_PERCENTAGE: u64 = 100_000; +pub const APY: u64 = 10_000; //10% +pub const EPOCHS_IN_YEAR: u64 = 365; +pub const UNBOND_PERIOD: u64 = 10; + +pub mod delegation_proxy; + +#[multiversx_sc::contract] +pub trait DelegationMock { + #[init] + fn init(&self) {} + + #[payable("EGLD")] + #[only_owner] + #[endpoint(depositEGLD)] + fn deposit_egld(&self) { + let payment_amount = self.call_value().egld_value().clone_value(); + self.egld_token_supply() + .update(|value| *value += &payment_amount); + } + + #[payable("EGLD")] + #[endpoint(delegate)] + fn delegate(&self) { + let caller = self.blockchain().get_caller(); + let payment_amount = self.call_value().egld_value().clone_value(); + self.address_deposit(&caller) + .update(|value| *value += &payment_amount); + self.egld_token_supply() + .update(|value| *value += &payment_amount); + } + + #[endpoint(unDelegate)] + fn undelegate(&self, egld_to_undelegate: BigUint) { + let caller = self.blockchain().get_caller(); + let current_epoch = self.blockchain().get_block_epoch(); + let total_deposit = self.address_deposit(&caller).get(); + require!( + egld_to_undelegate > 0 && egld_to_undelegate <= total_deposit, + "Invalid undelegate amount" + ); + self.address_deposit(&caller) + .update(|value| *value -= &egld_to_undelegate); + self.address_undelegate_amount(&caller) + .update(|value| *value += &egld_to_undelegate); + self.address_undelegate_epoch(&caller) + .set(current_epoch + UNBOND_PERIOD); + } + + #[endpoint(withdraw)] + fn withdraw(&self) { + let caller = self.blockchain().get_caller(); + let current_epoch = self.blockchain().get_block_epoch(); + let withdraw_epoch = self.address_undelegate_epoch(&caller).get(); + let withdraw_amount = self.address_undelegate_amount(&caller).get(); + + require!(withdraw_amount > 0, "No amount to withdraw"); + require!( + withdraw_epoch > 0 && current_epoch >= withdraw_epoch, + "Cannot withdraw yet" + ); + + self.egld_token_supply() + .update(|value| *value -= &withdraw_amount); + self.address_undelegate_epoch(&caller).clear(); + self.address_undelegate_amount(&caller).clear(); + + self.tx().to(&caller).egld(&withdraw_amount).transfer(); + } + + #[endpoint(claimRewards)] + fn claim_rewards(&self) { + let caller = self.blockchain().get_caller(); + let current_epoch = self.blockchain().get_block_epoch(); + let last_claim_epoch = self.address_last_claim_epoch(&caller).get(); + let total_deposit = self.address_deposit(&caller).get(); + + if current_epoch > last_claim_epoch { + let rewards = (total_deposit * APY / MAX_PERCENTAGE) + * (current_epoch - last_claim_epoch) + / EPOCHS_IN_YEAR; + if rewards > 0u64 { + self.tx().to(&caller).egld(&rewards).transfer(); + self.address_last_claim_epoch(&caller).set(current_epoch); + self.egld_token_supply().update(|value| *value -= &rewards); + } + } + } + + #[storage_mapper("egldTokenSupply")] + fn egld_token_supply(&self) -> SingleValueMapper; + + #[storage_mapper("addressDeposit")] + fn address_deposit(&self, address: &ManagedAddress) -> SingleValueMapper; + + #[storage_mapper("addressLastClaim")] + fn address_last_claim_epoch(&self, address: &ManagedAddress) -> SingleValueMapper; + + #[storage_mapper("addressUndelegateAmount")] + fn address_undelegate_amount(&self, address: &ManagedAddress) -> SingleValueMapper; + + #[storage_mapper("addressUndelegateEpoch")] + fn address_undelegate_epoch(&self, address: &ManagedAddress) -> SingleValueMapper; +} diff --git a/delegation-mock/tests/delegation_mock_scenario_go_test.rs b/delegation-mock/tests/delegation_mock_scenario_go_test.rs new file mode 100644 index 00000000..f6c50520 --- /dev/null +++ b/delegation-mock/tests/delegation_mock_scenario_go_test.rs @@ -0,0 +1,10 @@ +use multiversx_sc_scenario::*; + +fn world() -> ScenarioWorld { + ScenarioWorld::vm_go() +} + +#[test] +fn empty_go() { + world().run("scenarios/delegation_mock.scen.json"); +} diff --git a/delegation-mock/tests/delegation_mock_scenario_rs_test.rs b/delegation-mock/tests/delegation_mock_scenario_rs_test.rs new file mode 100644 index 00000000..778058f8 --- /dev/null +++ b/delegation-mock/tests/delegation_mock_scenario_rs_test.rs @@ -0,0 +1,13 @@ +use multiversx_sc_scenario::*; + +fn world() -> ScenarioWorld { + let mut blockchain = ScenarioWorld::new(); + + blockchain.register_contract("mxsc:output/delegation-mock.mxsc.json", delegation_mock::ContractBuilder); + blockchain +} + +#[test] +fn empty_rs() { + world().run("scenarios/delegation_mock.scen.json"); +} diff --git a/delegation-mock/wasm-delegation-mock-full/Cargo.lock b/delegation-mock/wasm-delegation-mock-full/Cargo.lock new file mode 100644 index 00000000..24c30f79 --- /dev/null +++ b/delegation-mock/wasm-delegation-mock-full/Cargo.lock @@ -0,0 +1,188 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "delegation-mock" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "delegation-mock-full-wasm" +version = "0.0.0" +dependencies = [ + "delegation-mock", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "multiversx-sc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e05f8dfb9c2dd26feff1330b1e229f0886f5c0228ed570f19421a458e6e7b0ef" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "007d7a5a8534e5dc9128cb8f15a65a21dd378e135c6016c7cd1491cd012bc8cb" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dffba1dce273ed5b61ee1b90aeea5c8c744617d0f12624f620768c144d83e753" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4b5176aa94b5e422e0d3c904492e0de0ae8381f166b563fbcac19a9ca4b28bc" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa0cbd543872f94b9bc98c4ce7c3ed25a7257e1425295af9036eba44893bdaa" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" diff --git a/delegation-mock/wasm-delegation-mock-full/Cargo.toml b/delegation-mock/wasm-delegation-mock-full/Cargo.toml new file mode 100644 index 00000000..816e5617 --- /dev/null +++ b/delegation-mock/wasm-delegation-mock-full/Cargo.toml @@ -0,0 +1,34 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + +[package] +name = "delegation-mock-full-wasm" +version = "0.0.0" +edition = "2021" +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.delegation-mock] +path = ".." + +[dependencies.multiversx-sc-wasm-adapter] +version = "0.53.1" + +[workspace] +members = ["."] diff --git a/delegation-mock/wasm-delegation-mock-full/src/lib.rs b/delegation-mock/wasm-delegation-mock-full/src/lib.rs new file mode 100644 index 00000000..0ba79e64 --- /dev/null +++ b/delegation-mock/wasm-delegation-mock-full/src/lib.rs @@ -0,0 +1,29 @@ +// Code generated by the multiversx-sc build system. DO NOT EDIT. + +//////////////////////////////////////////////////// +////////////////// AUTO-GENERATED ////////////////// +//////////////////////////////////////////////////// + +// Init: 1 +// Endpoints: 5 +// Async Callback (empty): 1 +// Total number of exported functions: 7 + +#![no_std] + +multiversx_sc_wasm_adapter::allocator!(); +multiversx_sc_wasm_adapter::panic_handler!(); + +multiversx_sc_wasm_adapter::endpoints! { + delegation_mock + ( + init => init + depositEGLD => deposit_egld + delegate => delegate + unDelegate => undelegate + withdraw => withdraw + claimRewards => claim_rewards + ) +} + +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/delegation-mock/wasm-delegation-mock-view/Cargo.lock b/delegation-mock/wasm-delegation-mock-view/Cargo.lock new file mode 100644 index 00000000..5ec02c4a --- /dev/null +++ b/delegation-mock/wasm-delegation-mock-view/Cargo.lock @@ -0,0 +1,188 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "delegation-mock" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "delegation-mock-view-wasm" +version = "0.0.0" +dependencies = [ + "delegation-mock", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "multiversx-sc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e05f8dfb9c2dd26feff1330b1e229f0886f5c0228ed570f19421a458e6e7b0ef" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "007d7a5a8534e5dc9128cb8f15a65a21dd378e135c6016c7cd1491cd012bc8cb" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dffba1dce273ed5b61ee1b90aeea5c8c744617d0f12624f620768c144d83e753" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4b5176aa94b5e422e0d3c904492e0de0ae8381f166b563fbcac19a9ca4b28bc" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa0cbd543872f94b9bc98c4ce7c3ed25a7257e1425295af9036eba44893bdaa" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" diff --git a/delegation-mock/wasm-delegation-mock-view/Cargo.toml b/delegation-mock/wasm-delegation-mock-view/Cargo.toml new file mode 100644 index 00000000..90f5fa9f --- /dev/null +++ b/delegation-mock/wasm-delegation-mock-view/Cargo.toml @@ -0,0 +1,34 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + +[package] +name = "delegation-mock-view-wasm" +version = "0.0.0" +edition = "2021" +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.delegation-mock] +path = ".." + +[dependencies.multiversx-sc-wasm-adapter] +version = "0.53.1" + +[workspace] +members = ["."] diff --git a/delegation-mock/wasm-delegation-mock-view/src/lib.rs b/delegation-mock/wasm-delegation-mock-view/src/lib.rs new file mode 100644 index 00000000..b2d1aa55 --- /dev/null +++ b/delegation-mock/wasm-delegation-mock-view/src/lib.rs @@ -0,0 +1,25 @@ +// Code generated by the multiversx-sc build system. DO NOT EDIT. + +//////////////////////////////////////////////////// +////////////////// AUTO-GENERATED ////////////////// +//////////////////////////////////////////////////// + +// Init: 1 +// Endpoints: 0 +// Async Callback (empty): 1 +// Total number of exported functions: 2 + +#![no_std] + +multiversx_sc_wasm_adapter::allocator!(); +multiversx_sc_wasm_adapter::panic_handler!(); + +multiversx_sc_wasm_adapter::external_view_init! {} + +multiversx_sc_wasm_adapter::external_view_endpoints! { + delegation_mock + ( + ) +} + +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/delegation-mock/wasm/Cargo.lock b/delegation-mock/wasm/Cargo.lock new file mode 100644 index 00000000..eadcfc49 --- /dev/null +++ b/delegation-mock/wasm/Cargo.lock @@ -0,0 +1,188 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "delegation-mock" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "delegation-mock-wasm" +version = "0.0.0" +dependencies = [ + "delegation-mock", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "multiversx-sc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e05f8dfb9c2dd26feff1330b1e229f0886f5c0228ed570f19421a458e6e7b0ef" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "007d7a5a8534e5dc9128cb8f15a65a21dd378e135c6016c7cd1491cd012bc8cb" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dffba1dce273ed5b61ee1b90aeea5c8c744617d0f12624f620768c144d83e753" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4b5176aa94b5e422e0d3c904492e0de0ae8381f166b563fbcac19a9ca4b28bc" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa0cbd543872f94b9bc98c4ce7c3ed25a7257e1425295af9036eba44893bdaa" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" diff --git a/delegation-mock/wasm/Cargo.toml b/delegation-mock/wasm/Cargo.toml new file mode 100644 index 00000000..696e7612 --- /dev/null +++ b/delegation-mock/wasm/Cargo.toml @@ -0,0 +1,34 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + +[package] +name = "delegation-mock-wasm" +version = "0.0.0" +edition = "2021" +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.delegation-mock] +path = ".." + +[dependencies.multiversx-sc-wasm-adapter] +version = "0.53.1" + +[workspace] +members = ["."] diff --git a/delegation-mock/wasm/src/lib.rs b/delegation-mock/wasm/src/lib.rs new file mode 100644 index 00000000..0ba79e64 --- /dev/null +++ b/delegation-mock/wasm/src/lib.rs @@ -0,0 +1,29 @@ +// Code generated by the multiversx-sc build system. DO NOT EDIT. + +//////////////////////////////////////////////////// +////////////////// AUTO-GENERATED ////////////////// +//////////////////////////////////////////////////// + +// Init: 1 +// Endpoints: 5 +// Async Callback (empty): 1 +// Total number of exported functions: 7 + +#![no_std] + +multiversx_sc_wasm_adapter::allocator!(); +multiversx_sc_wasm_adapter::panic_handler!(); + +multiversx_sc_wasm_adapter::endpoints! { + delegation_mock + ( + init => init + depositEGLD => deposit_egld + delegate => delegate + unDelegate => undelegate + withdraw => withdraw + claimRewards => claim_rewards + ) +} + +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/enshrine-esdt-safe/Cargo.toml b/enshrine-esdt-safe/Cargo.toml index c258915a..e0741c62 100644 --- a/enshrine-esdt-safe/Cargo.toml +++ b/enshrine-esdt-safe/Cargo.toml @@ -36,10 +36,10 @@ path = "../fee-market" path = "../header-verifier" [dependencies.multiversx-sc] -version = "=0.53.0" +version = "=0.53.1" [dependencies.multiversx-sc-modules] -version = "=0.53.0" +version = "=0.53.1" [dev-dependencies] num-bigint = "0.4.2" @@ -47,4 +47,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.53.0" +version = "=0.53.1" diff --git a/enshrine-esdt-safe/meta/Cargo.toml b/enshrine-esdt-safe/meta/Cargo.toml index 5ab95868..e3554570 100644 --- a/enshrine-esdt-safe/meta/Cargo.toml +++ b/enshrine-esdt-safe/meta/Cargo.toml @@ -8,5 +8,5 @@ publish = false path = ".." [dependencies.multiversx-sc-meta-lib] -version = "0.53.0" +version = "0.53.1" default-features = false diff --git a/enshrine-esdt-safe/wasm-enshrine-esdt-safe-full/Cargo.lock b/enshrine-esdt-safe/wasm-enshrine-esdt-safe-full/Cargo.lock index 7e40361e..e453bb9d 100644 --- a/enshrine-esdt-safe/wasm-enshrine-esdt-safe-full/Cargo.lock +++ b/enshrine-esdt-safe/wasm-enshrine-esdt-safe-full/Cargo.lock @@ -99,9 +99,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a86a27b04bb7cca97ad8971ee57e6b978619623dde4ba9acae1d4ecb436f062" +checksum = "e05f8dfb9c2dd26feff1330b1e229f0886f5c0228ed570f19421a458e6e7b0ef" dependencies = [ "bitflags", "hex-literal", @@ -136,9 +136,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7a6ee275d6b1c2b86394369df0bc62a3f25018cbab12668a191b89d88fdcf71" +checksum = "f4b5176aa94b5e422e0d3c904492e0de0ae8381f166b563fbcac19a9ca4b28bc" dependencies = [ "hex", "proc-macro2", @@ -149,18 +149,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fece2308326cc59c53fedd682259625e8ecc306e4c3b35051725ca388677b47b" +checksum = "3cfb6046ec3cc6ef94351b4ca89907b2b74b2e4a7f376adc0af18ddd1c5a4367" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab5bb42b3ce827227a5e38f3c24fbe0fb23d475425b049043e193186e36c590" +checksum = "9aa0cbd543872f94b9bc98c4ce7c3ed25a7257e1425295af9036eba44893bdaa" dependencies = [ "multiversx-sc", ] diff --git a/enshrine-esdt-safe/wasm-enshrine-esdt-safe-full/Cargo.toml b/enshrine-esdt-safe/wasm-enshrine-esdt-safe-full/Cargo.toml index 33313e4e..b2c0bb98 100644 --- a/enshrine-esdt-safe/wasm-enshrine-esdt-safe-full/Cargo.toml +++ b/enshrine-esdt-safe/wasm-enshrine-esdt-safe-full/Cargo.toml @@ -28,7 +28,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.53.0" +version = "=0.53.1" [workspace] members = ["."] diff --git a/enshrine-esdt-safe/wasm-enshrine-esdt-safe-view/Cargo.lock b/enshrine-esdt-safe/wasm-enshrine-esdt-safe-view/Cargo.lock index fc4faaad..d246b09a 100644 --- a/enshrine-esdt-safe/wasm-enshrine-esdt-safe-view/Cargo.lock +++ b/enshrine-esdt-safe/wasm-enshrine-esdt-safe-view/Cargo.lock @@ -99,9 +99,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a86a27b04bb7cca97ad8971ee57e6b978619623dde4ba9acae1d4ecb436f062" +checksum = "e05f8dfb9c2dd26feff1330b1e229f0886f5c0228ed570f19421a458e6e7b0ef" dependencies = [ "bitflags", "hex-literal", @@ -136,9 +136,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7a6ee275d6b1c2b86394369df0bc62a3f25018cbab12668a191b89d88fdcf71" +checksum = "f4b5176aa94b5e422e0d3c904492e0de0ae8381f166b563fbcac19a9ca4b28bc" dependencies = [ "hex", "proc-macro2", @@ -149,18 +149,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fece2308326cc59c53fedd682259625e8ecc306e4c3b35051725ca388677b47b" +checksum = "3cfb6046ec3cc6ef94351b4ca89907b2b74b2e4a7f376adc0af18ddd1c5a4367" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab5bb42b3ce827227a5e38f3c24fbe0fb23d475425b049043e193186e36c590" +checksum = "9aa0cbd543872f94b9bc98c4ce7c3ed25a7257e1425295af9036eba44893bdaa" dependencies = [ "multiversx-sc", ] diff --git a/enshrine-esdt-safe/wasm-enshrine-esdt-safe-view/Cargo.toml b/enshrine-esdt-safe/wasm-enshrine-esdt-safe-view/Cargo.toml index 803a9e8b..20369a4d 100644 --- a/enshrine-esdt-safe/wasm-enshrine-esdt-safe-view/Cargo.toml +++ b/enshrine-esdt-safe/wasm-enshrine-esdt-safe-view/Cargo.toml @@ -28,7 +28,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.53.0" +version = "=0.53.1" [workspace] members = ["."] diff --git a/enshrine-esdt-safe/wasm/Cargo.lock b/enshrine-esdt-safe/wasm/Cargo.lock index 6cda2691..f5163c4c 100644 --- a/enshrine-esdt-safe/wasm/Cargo.lock +++ b/enshrine-esdt-safe/wasm/Cargo.lock @@ -99,9 +99,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a86a27b04bb7cca97ad8971ee57e6b978619623dde4ba9acae1d4ecb436f062" +checksum = "e05f8dfb9c2dd26feff1330b1e229f0886f5c0228ed570f19421a458e6e7b0ef" dependencies = [ "bitflags", "hex-literal", @@ -136,9 +136,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7a6ee275d6b1c2b86394369df0bc62a3f25018cbab12668a191b89d88fdcf71" +checksum = "f4b5176aa94b5e422e0d3c904492e0de0ae8381f166b563fbcac19a9ca4b28bc" dependencies = [ "hex", "proc-macro2", @@ -149,18 +149,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fece2308326cc59c53fedd682259625e8ecc306e4c3b35051725ca388677b47b" +checksum = "3cfb6046ec3cc6ef94351b4ca89907b2b74b2e4a7f376adc0af18ddd1c5a4367" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab5bb42b3ce827227a5e38f3c24fbe0fb23d475425b049043e193186e36c590" +checksum = "9aa0cbd543872f94b9bc98c4ce7c3ed25a7257e1425295af9036eba44893bdaa" dependencies = [ "multiversx-sc", ] diff --git a/enshrine-esdt-safe/wasm/Cargo.toml b/enshrine-esdt-safe/wasm/Cargo.toml index 83bf78ef..8edc5c62 100644 --- a/enshrine-esdt-safe/wasm/Cargo.toml +++ b/enshrine-esdt-safe/wasm/Cargo.toml @@ -28,7 +28,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.53.0" +version = "=0.53.1" [workspace] members = ["."] diff --git a/esdt-safe/Cargo.toml b/esdt-safe/Cargo.toml index c089a976..0446986a 100644 --- a/esdt-safe/Cargo.toml +++ b/esdt-safe/Cargo.toml @@ -36,10 +36,10 @@ path = "../fee-market" path = "../header-verifier" [dependencies.multiversx-sc] -version = "=0.53.0" +version = "=0.53.1" [dependencies.multiversx-sc-modules] -version = "=0.53.0" +version = "=0.53.1" [dev-dependencies] num-bigint = "0.4.2" @@ -47,4 +47,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.53.0" +version = "=0.53.1" diff --git a/esdt-safe/meta/Cargo.toml b/esdt-safe/meta/Cargo.toml index 66439304..e01c2c40 100644 --- a/esdt-safe/meta/Cargo.toml +++ b/esdt-safe/meta/Cargo.toml @@ -11,4 +11,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta-lib] -version = "=0.53.0" +version = "=0.53.1" diff --git a/esdt-safe/wasm-esdt-safe-full/Cargo.lock b/esdt-safe/wasm-esdt-safe-full/Cargo.lock index 033da2d0..ef2e581d 100644 --- a/esdt-safe/wasm-esdt-safe-full/Cargo.lock +++ b/esdt-safe/wasm-esdt-safe-full/Cargo.lock @@ -99,9 +99,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a86a27b04bb7cca97ad8971ee57e6b978619623dde4ba9acae1d4ecb436f062" +checksum = "e05f8dfb9c2dd26feff1330b1e229f0886f5c0228ed570f19421a458e6e7b0ef" dependencies = [ "bitflags", "hex-literal", @@ -136,9 +136,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7a6ee275d6b1c2b86394369df0bc62a3f25018cbab12668a191b89d88fdcf71" +checksum = "f4b5176aa94b5e422e0d3c904492e0de0ae8381f166b563fbcac19a9ca4b28bc" dependencies = [ "hex", "proc-macro2", @@ -149,18 +149,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fece2308326cc59c53fedd682259625e8ecc306e4c3b35051725ca388677b47b" +checksum = "3cfb6046ec3cc6ef94351b4ca89907b2b74b2e4a7f376adc0af18ddd1c5a4367" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab5bb42b3ce827227a5e38f3c24fbe0fb23d475425b049043e193186e36c590" +checksum = "9aa0cbd543872f94b9bc98c4ce7c3ed25a7257e1425295af9036eba44893bdaa" dependencies = [ "multiversx-sc", ] diff --git a/esdt-safe/wasm-esdt-safe-full/Cargo.toml b/esdt-safe/wasm-esdt-safe-full/Cargo.toml index d7a38dde..135d06a4 100644 --- a/esdt-safe/wasm-esdt-safe-full/Cargo.toml +++ b/esdt-safe/wasm-esdt-safe-full/Cargo.toml @@ -28,7 +28,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.53.0" +version = "=0.53.1" [workspace] members = ["."] diff --git a/esdt-safe/wasm-esdt-safe-view/Cargo.lock b/esdt-safe/wasm-esdt-safe-view/Cargo.lock index 93bb6f82..4073ba2a 100644 --- a/esdt-safe/wasm-esdt-safe-view/Cargo.lock +++ b/esdt-safe/wasm-esdt-safe-view/Cargo.lock @@ -99,9 +99,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a86a27b04bb7cca97ad8971ee57e6b978619623dde4ba9acae1d4ecb436f062" +checksum = "e05f8dfb9c2dd26feff1330b1e229f0886f5c0228ed570f19421a458e6e7b0ef" dependencies = [ "bitflags", "hex-literal", @@ -136,9 +136,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7a6ee275d6b1c2b86394369df0bc62a3f25018cbab12668a191b89d88fdcf71" +checksum = "f4b5176aa94b5e422e0d3c904492e0de0ae8381f166b563fbcac19a9ca4b28bc" dependencies = [ "hex", "proc-macro2", @@ -149,18 +149,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fece2308326cc59c53fedd682259625e8ecc306e4c3b35051725ca388677b47b" +checksum = "3cfb6046ec3cc6ef94351b4ca89907b2b74b2e4a7f376adc0af18ddd1c5a4367" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab5bb42b3ce827227a5e38f3c24fbe0fb23d475425b049043e193186e36c590" +checksum = "9aa0cbd543872f94b9bc98c4ce7c3ed25a7257e1425295af9036eba44893bdaa" dependencies = [ "multiversx-sc", ] diff --git a/esdt-safe/wasm-esdt-safe-view/Cargo.toml b/esdt-safe/wasm-esdt-safe-view/Cargo.toml index e5e1aea7..72e8e214 100644 --- a/esdt-safe/wasm-esdt-safe-view/Cargo.toml +++ b/esdt-safe/wasm-esdt-safe-view/Cargo.toml @@ -28,7 +28,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.53.0" +version = "=0.53.1" [workspace] members = ["."] diff --git a/esdt-safe/wasm/Cargo.lock b/esdt-safe/wasm/Cargo.lock index 581b427f..0b6a5ce7 100644 --- a/esdt-safe/wasm/Cargo.lock +++ b/esdt-safe/wasm/Cargo.lock @@ -99,9 +99,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a86a27b04bb7cca97ad8971ee57e6b978619623dde4ba9acae1d4ecb436f062" +checksum = "e05f8dfb9c2dd26feff1330b1e229f0886f5c0228ed570f19421a458e6e7b0ef" dependencies = [ "bitflags", "hex-literal", @@ -136,9 +136,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7a6ee275d6b1c2b86394369df0bc62a3f25018cbab12668a191b89d88fdcf71" +checksum = "f4b5176aa94b5e422e0d3c904492e0de0ae8381f166b563fbcac19a9ca4b28bc" dependencies = [ "hex", "proc-macro2", @@ -149,18 +149,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fece2308326cc59c53fedd682259625e8ecc306e4c3b35051725ca388677b47b" +checksum = "3cfb6046ec3cc6ef94351b4ca89907b2b74b2e4a7f376adc0af18ddd1c5a4367" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab5bb42b3ce827227a5e38f3c24fbe0fb23d475425b049043e193186e36c590" +checksum = "9aa0cbd543872f94b9bc98c4ce7c3ed25a7257e1425295af9036eba44893bdaa" dependencies = [ "multiversx-sc", ] diff --git a/esdt-safe/wasm/Cargo.toml b/esdt-safe/wasm/Cargo.toml index a656a808..6d4995dd 100644 --- a/esdt-safe/wasm/Cargo.toml +++ b/esdt-safe/wasm/Cargo.toml @@ -28,7 +28,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.53.0" +version = "=0.53.1" [workspace] members = ["."] diff --git a/fee-market/Cargo.toml b/fee-market/Cargo.toml index 3ddd705f..eca63495 100644 --- a/fee-market/Cargo.toml +++ b/fee-market/Cargo.toml @@ -18,10 +18,10 @@ path = "../common/transaction" path = "../common/bls-signature" [dependencies.multiversx-sc] -version = "=0.53.0" +version = "=0.53.1" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.53.0" +version = "=0.53.1" diff --git a/fee-market/meta/Cargo.toml b/fee-market/meta/Cargo.toml index 605e19b9..28f67f70 100644 --- a/fee-market/meta/Cargo.toml +++ b/fee-market/meta/Cargo.toml @@ -8,5 +8,5 @@ publish = false path = ".." [dependencies.multiversx-sc-meta-lib] -version = "=0.53.0" +version = "=0.53.1" default-features = false diff --git a/fee-market/wasm-fee-marker-full/Cargo.lock b/fee-market/wasm-fee-marker-full/Cargo.lock index 047ada14..d9c9d464 100644 --- a/fee-market/wasm-fee-marker-full/Cargo.lock +++ b/fee-market/wasm-fee-marker-full/Cargo.lock @@ -66,9 +66,9 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "multiversx-sc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a86a27b04bb7cca97ad8971ee57e6b978619623dde4ba9acae1d4ecb436f062" +checksum = "e05f8dfb9c2dd26feff1330b1e229f0886f5c0228ed570f19421a458e6e7b0ef" dependencies = [ "bitflags", "hex-literal", @@ -103,9 +103,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7a6ee275d6b1c2b86394369df0bc62a3f25018cbab12668a191b89d88fdcf71" +checksum = "f4b5176aa94b5e422e0d3c904492e0de0ae8381f166b563fbcac19a9ca4b28bc" dependencies = [ "hex", "proc-macro2", @@ -116,9 +116,9 @@ dependencies = [ [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab5bb42b3ce827227a5e38f3c24fbe0fb23d475425b049043e193186e36c590" +checksum = "9aa0cbd543872f94b9bc98c4ce7c3ed25a7257e1425295af9036eba44893bdaa" dependencies = [ "multiversx-sc", ] diff --git a/fee-market/wasm-fee-marker-full/Cargo.toml b/fee-market/wasm-fee-marker-full/Cargo.toml index 05f8f890..9bef5fca 100644 --- a/fee-market/wasm-fee-marker-full/Cargo.toml +++ b/fee-market/wasm-fee-marker-full/Cargo.toml @@ -28,7 +28,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.53.0" +version = "=0.53.1" [workspace] members = ["."] diff --git a/fee-market/wasm-multisig-view/Cargo.lock b/fee-market/wasm-multisig-view/Cargo.lock index 106db055..c6ba5733 100644 --- a/fee-market/wasm-multisig-view/Cargo.lock +++ b/fee-market/wasm-multisig-view/Cargo.lock @@ -66,9 +66,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a86a27b04bb7cca97ad8971ee57e6b978619623dde4ba9acae1d4ecb436f062" +checksum = "e05f8dfb9c2dd26feff1330b1e229f0886f5c0228ed570f19421a458e6e7b0ef" dependencies = [ "bitflags", "hex-literal", @@ -103,9 +103,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7a6ee275d6b1c2b86394369df0bc62a3f25018cbab12668a191b89d88fdcf71" +checksum = "f4b5176aa94b5e422e0d3c904492e0de0ae8381f166b563fbcac19a9ca4b28bc" dependencies = [ "hex", "proc-macro2", @@ -116,9 +116,9 @@ dependencies = [ [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab5bb42b3ce827227a5e38f3c24fbe0fb23d475425b049043e193186e36c590" +checksum = "9aa0cbd543872f94b9bc98c4ce7c3ed25a7257e1425295af9036eba44893bdaa" dependencies = [ "multiversx-sc", ] diff --git a/fee-market/wasm-multisig-view/Cargo.toml b/fee-market/wasm-multisig-view/Cargo.toml index 347109b0..de4d4718 100644 --- a/fee-market/wasm-multisig-view/Cargo.toml +++ b/fee-market/wasm-multisig-view/Cargo.toml @@ -28,7 +28,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.53.0" +version = "=0.53.1" [workspace] members = ["."] diff --git a/fee-market/wasm/Cargo.lock b/fee-market/wasm/Cargo.lock index a9194490..9cfc7c0f 100644 --- a/fee-market/wasm/Cargo.lock +++ b/fee-market/wasm/Cargo.lock @@ -66,9 +66,9 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "multiversx-sc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a86a27b04bb7cca97ad8971ee57e6b978619623dde4ba9acae1d4ecb436f062" +checksum = "e05f8dfb9c2dd26feff1330b1e229f0886f5c0228ed570f19421a458e6e7b0ef" dependencies = [ "bitflags", "hex-literal", @@ -103,9 +103,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7a6ee275d6b1c2b86394369df0bc62a3f25018cbab12668a191b89d88fdcf71" +checksum = "f4b5176aa94b5e422e0d3c904492e0de0ae8381f166b563fbcac19a9ca4b28bc" dependencies = [ "hex", "proc-macro2", @@ -116,9 +116,9 @@ dependencies = [ [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab5bb42b3ce827227a5e38f3c24fbe0fb23d475425b049043e193186e36c590" +checksum = "9aa0cbd543872f94b9bc98c4ce7c3ed25a7257e1425295af9036eba44893bdaa" dependencies = [ "multiversx-sc", ] diff --git a/fee-market/wasm/Cargo.toml b/fee-market/wasm/Cargo.toml index 11cd4d4c..537b7554 100644 --- a/fee-market/wasm/Cargo.toml +++ b/fee-market/wasm/Cargo.toml @@ -28,7 +28,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.53.0" +version = "=0.53.1" [workspace] members = ["."] diff --git a/header-verifier/Cargo.toml b/header-verifier/Cargo.toml index 8aa18a42..59ab99ce 100644 --- a/header-verifier/Cargo.toml +++ b/header-verifier/Cargo.toml @@ -9,7 +9,7 @@ publish = false path = "src/lib.rs" [dependencies.multiversx-sc] -version = "0.53.0" +version = "0.53.1" [dependencies.bls-signature] path = "../common/bls-signature" @@ -21,4 +21,4 @@ path = "../common/transaction" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "0.53.0" +version = "0.53.1" diff --git a/header-verifier/meta/Cargo.toml b/header-verifier/meta/Cargo.toml index ed1949b9..28c50118 100644 --- a/header-verifier/meta/Cargo.toml +++ b/header-verifier/meta/Cargo.toml @@ -8,5 +8,5 @@ publish = false path = ".." [dependencies.multiversx-sc-meta-lib] -version = "0.53.0" +version = "0.53.1" default-features = false diff --git a/header-verifier/wasm-header-verifier-full/Cargo.lock b/header-verifier/wasm-header-verifier-full/Cargo.lock index b5f001af..bca57c41 100644 --- a/header-verifier/wasm-header-verifier-full/Cargo.lock +++ b/header-verifier/wasm-header-verifier-full/Cargo.lock @@ -65,9 +65,9 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "multiversx-sc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a86a27b04bb7cca97ad8971ee57e6b978619623dde4ba9acae1d4ecb436f062" +checksum = "e05f8dfb9c2dd26feff1330b1e229f0886f5c0228ed570f19421a458e6e7b0ef" dependencies = [ "bitflags", "hex-literal", @@ -102,9 +102,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7a6ee275d6b1c2b86394369df0bc62a3f25018cbab12668a191b89d88fdcf71" +checksum = "f4b5176aa94b5e422e0d3c904492e0de0ae8381f166b563fbcac19a9ca4b28bc" dependencies = [ "hex", "proc-macro2", @@ -115,9 +115,9 @@ dependencies = [ [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab5bb42b3ce827227a5e38f3c24fbe0fb23d475425b049043e193186e36c590" +checksum = "9aa0cbd543872f94b9bc98c4ce7c3ed25a7257e1425295af9036eba44893bdaa" dependencies = [ "multiversx-sc", ] diff --git a/header-verifier/wasm-header-verifier-full/Cargo.toml b/header-verifier/wasm-header-verifier-full/Cargo.toml index 844daf89..f4de6c91 100644 --- a/header-verifier/wasm-header-verifier-full/Cargo.toml +++ b/header-verifier/wasm-header-verifier-full/Cargo.toml @@ -28,7 +28,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "0.53.0" +version = "0.53.1" [workspace] members = ["."] diff --git a/header-verifier/wasm-multisig-view/Cargo.lock b/header-verifier/wasm-multisig-view/Cargo.lock index 11054e22..06233ac3 100644 --- a/header-verifier/wasm-multisig-view/Cargo.lock +++ b/header-verifier/wasm-multisig-view/Cargo.lock @@ -65,9 +65,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a86a27b04bb7cca97ad8971ee57e6b978619623dde4ba9acae1d4ecb436f062" +checksum = "e05f8dfb9c2dd26feff1330b1e229f0886f5c0228ed570f19421a458e6e7b0ef" dependencies = [ "bitflags", "hex-literal", @@ -102,9 +102,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7a6ee275d6b1c2b86394369df0bc62a3f25018cbab12668a191b89d88fdcf71" +checksum = "f4b5176aa94b5e422e0d3c904492e0de0ae8381f166b563fbcac19a9ca4b28bc" dependencies = [ "hex", "proc-macro2", @@ -115,9 +115,9 @@ dependencies = [ [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab5bb42b3ce827227a5e38f3c24fbe0fb23d475425b049043e193186e36c590" +checksum = "9aa0cbd543872f94b9bc98c4ce7c3ed25a7257e1425295af9036eba44893bdaa" dependencies = [ "multiversx-sc", ] diff --git a/header-verifier/wasm-multisig-view/Cargo.toml b/header-verifier/wasm-multisig-view/Cargo.toml index 02396926..e99867bb 100644 --- a/header-verifier/wasm-multisig-view/Cargo.toml +++ b/header-verifier/wasm-multisig-view/Cargo.toml @@ -28,7 +28,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "0.53.0" +version = "0.53.1" [workspace] members = ["."] diff --git a/header-verifier/wasm/Cargo.lock b/header-verifier/wasm/Cargo.lock index bd5315a4..361892b4 100644 --- a/header-verifier/wasm/Cargo.lock +++ b/header-verifier/wasm/Cargo.lock @@ -65,9 +65,9 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "multiversx-sc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a86a27b04bb7cca97ad8971ee57e6b978619623dde4ba9acae1d4ecb436f062" +checksum = "e05f8dfb9c2dd26feff1330b1e229f0886f5c0228ed570f19421a458e6e7b0ef" dependencies = [ "bitflags", "hex-literal", @@ -102,9 +102,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7a6ee275d6b1c2b86394369df0bc62a3f25018cbab12668a191b89d88fdcf71" +checksum = "f4b5176aa94b5e422e0d3c904492e0de0ae8381f166b563fbcac19a9ca4b28bc" dependencies = [ "hex", "proc-macro2", @@ -115,9 +115,9 @@ dependencies = [ [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab5bb42b3ce827227a5e38f3c24fbe0fb23d475425b049043e193186e36c590" +checksum = "9aa0cbd543872f94b9bc98c4ce7c3ed25a7257e1425295af9036eba44893bdaa" dependencies = [ "multiversx-sc", ] diff --git a/header-verifier/wasm/Cargo.toml b/header-verifier/wasm/Cargo.toml index 739674f5..e38bcab7 100644 --- a/header-verifier/wasm/Cargo.toml +++ b/header-verifier/wasm/Cargo.toml @@ -28,7 +28,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "0.53.0" +version = "0.53.1" [workspace] members = ["."] diff --git a/liquid-staking/Cargo.lock b/liquid-staking/Cargo.lock new file mode 100644 index 00000000..3d754044 --- /dev/null +++ b/liquid-staking/Cargo.lock @@ -0,0 +1,1196 @@ +# This file is automatically @generated by Cargo. +# 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 = "anstream" +version = "0.6.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" + +[[package]] +name = "anstyle-parse" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + +[[package]] +name = "anyhow" +version = "1.0.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e1496f8fb1fbf272686b8d37f523dab3e4a7443300055e74cdaa449f3114356" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[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 = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "4.5.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" + +[[package]] +name = "colorchoice" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" + +[[package]] +name = "colored" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" +dependencies = [ + "lazy_static", + "windows-sys 0.48.0", +] + +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "cpufeatures" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common", +] + +[[package]] +name = "ed25519" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[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 = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "serde", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "indexmap" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +dependencies = [ + "equivalent", + "hashbrown", + "serde", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.158" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" + +[[package]] +name = "liquid-staking" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "multiversx-sc-scenario", + "num-bigint", +] + +[[package]] +name = "liquid-staking-meta" +version = "0.0.0" +dependencies = [ + "liquid-staking", + "multiversx-sc-meta-lib", +] + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "multiversx-chain-scenario-format" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "921a66f6db5ffff311e355d42a49fd49baf72d7a6a6215b0484dcd9d8dd512a3" +dependencies = [ + "bech32", + "hex", + "num-bigint", + "num-traits", + "serde", + "serde_json", + "sha3", +] + +[[package]] +name = "multiversx-chain-vm" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d91b6ce610a3ac1272f0813284a3f03a34d55db2f86cddaff357bf651074ee" +dependencies = [ + "bitflags", + "colored", + "ed25519-dalek", + "hex", + "hex-literal", + "itertools", + "multiversx-chain-vm-executor", + "num-bigint", + "num-traits", + "rand 0.8.5", + "rand_seeder", + "sha2 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.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "526760b1d6236c011285b264a70a0a9dd3b3dbc53c3b5f76932f4bcfd3a8910c" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad4f318427761faecf26c1f3115a3beeb5f61858845a60547d9763aa981ddd2d" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "num-bigint", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "476501462b0c2654b64f9dec6f2c480e24b4e9b7133ec10b7167e64acda35d04" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3557f2f12640a8a07fa6af66cc2a13b188c5b61bed72db22fe631fb3a60c3e96" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-meta-lib" +version = "0.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8deccfcc760b8fd281e2603268fa1a453ed65e4caac7a51a2d71c40cec37ae3" +dependencies = [ + "clap", + "colored", + "convert_case", + "hex", + "lazy_static", + "multiversx-sc", + "rustc_version", + "semver", + "serde", + "serde_json", + "toml", + "wasmparser", + "wasmprinter", +] + +[[package]] +name = "multiversx-sc-scenario" +version = "0.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d3024d52e2cb7d455f5a560218be8968e446eabc7c31dc9fc479c329f45e05e" +dependencies = [ + "base64", + "bech32", + "colored", + "hex", + "itertools", + "log", + "multiversx-chain-scenario-format", + "multiversx-chain-vm", + "multiversx-chain-vm-executor", + "multiversx-sc", + "multiversx-sc-meta-lib", + "num-bigint", + "num-traits", + "pathdiff", + "serde", + "serde_json", + "sha2 0.10.8", + "unwrap-infallible", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "pathdiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.15", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_seeder" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf2890aaef0aa82719a50e808de264f9484b74b442e1a3a0e5ee38243ac40bdb" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.128" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +dependencies = [ + "serde", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "toml" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" + +[[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 = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasmparser" +version = "0.214.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5309c1090e3e84dad0d382f42064e9933fdaedb87e468cc239f0eabea73ddcb6" +dependencies = [ + "ahash", + "bitflags", + "hashbrown", + "indexmap", + "semver", + "serde", +] + +[[package]] +name = "wasmprinter" +version = "0.214.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58d4f2b3f7bd2ba10f99e03f885ff90d5db3455e163bccecebbbf60406bd8980" +dependencies = [ + "anyhow", + "termcolor", + "wasmparser", +] + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +dependencies = [ + "memchr", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zeroize" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/liquid-staking/Cargo.toml b/liquid-staking/Cargo.toml new file mode 100644 index 00000000..dfa56e32 --- /dev/null +++ b/liquid-staking/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "liquid-staking" +version = "0.0.0" +authors = ["you"] +edition = "2021" +publish = false + +[lib] +path = "src/lib.rs" + +[dependencies.multiversx-sc] +version = "0.53.1" + +[dependencies.delegation-mock] +path = "../delegation-mock" + +[dev-dependencies] +num-bigint = "0.4" + +[dev-dependencies.multiversx-sc-scenario] +version = "0.53.1" diff --git a/liquid-staking/meta/Cargo.toml b/liquid-staking/meta/Cargo.toml new file mode 100644 index 00000000..f6a20c47 --- /dev/null +++ b/liquid-staking/meta/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "liquid-staking-meta" +version = "0.0.0" +edition = "2021" +publish = false + +[dependencies.liquid-staking] +path = ".." + +[dependencies.multiversx-sc-meta-lib] +version = "0.53.1" +default-features = false diff --git a/liquid-staking/meta/src/main.rs b/liquid-staking/meta/src/main.rs new file mode 100644 index 00000000..318631a8 --- /dev/null +++ b/liquid-staking/meta/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + multiversx_sc_meta_lib::cli_main::(); +} diff --git a/liquid-staking/multiversx.json b/liquid-staking/multiversx.json new file mode 100644 index 00000000..73655396 --- /dev/null +++ b/liquid-staking/multiversx.json @@ -0,0 +1,3 @@ +{ + "language": "rust" +} \ No newline at end of file diff --git a/liquid-staking/sc-config.toml b/liquid-staking/sc-config.toml new file mode 100644 index 00000000..08c9a572 --- /dev/null +++ b/liquid-staking/sc-config.toml @@ -0,0 +1,19 @@ +[settings] +main = "main" + +[contracts.main] +name = "liquid-staking" + +[contracts.full] +name = "liquid-staking-full" +add-unlabelled = true +add-labels = ["liquid-staking-external-view"] + +[contracts.view] +name = "liquid-staking-view" +external-view = true +add-unlabelled = false +add-labels = ["liquid-staking-external-view"] + +[[proxy]] +path = "src/liquid_staking_proxy.rs" diff --git a/liquid-staking/scenarios/liquid_staking.scen.json b/liquid-staking/scenarios/liquid_staking.scen.json new file mode 100644 index 00000000..1527f733 --- /dev/null +++ b/liquid-staking/scenarios/liquid_staking.scen.json @@ -0,0 +1,39 @@ +{ + "name": "empty", + "steps": [ + { + "step": "setState", + "accounts": { + "address:owner": { + "nonce": "1", + "balance": "0" + } + }, + "newAddresses": [ + { + "creatorAddress": "address:owner", + "creatorNonce": "1", + "newAddress": "sc:empty" + } + ] + }, + { + "step": "scDeploy", + "id": "deploy", + "tx": { + "from": "address:owner", + "contractCode": "mxsc:../output/liquid-staking.mxsc.json", + "arguments": [], + "gasLimit": "5,000,000", + "gasPrice": "0" + }, + "expect": { + "out": [], + "status": "", + "logs": [], + "gas": "*", + "refund": "*" + } + } + ] +} diff --git a/liquid-staking/src/common/mod.rs b/liquid-staking/src/common/mod.rs new file mode 100644 index 00000000..30f61eb6 --- /dev/null +++ b/liquid-staking/src/common/mod.rs @@ -0,0 +1 @@ +pub mod storage; diff --git a/liquid-staking/src/common/storage.rs b/liquid-staking/src/common/storage.rs new file mode 100644 index 00000000..a8874a51 --- /dev/null +++ b/liquid-staking/src/common/storage.rs @@ -0,0 +1,79 @@ +use multiversx_sc::imports::*; +pub type Epoch = u64; +pub type BlsKey = ManagedBuffer; +pub type ChainId = ManagedBuffer; + +#[multiversx_sc::module] +pub trait CommonStorageModule { + #[view(getDelegationAddress)] + #[storage_mapper("delegationAddress")] + fn delegation_addresses( + &self, + contract_name: &ManagedBuffer, + ) -> SingleValueMapper; + + // TODO: use AddressToIdMapper for lower gas usage + // + #[storage_mapper("userIds")] + fn validator_ids(&self) -> AddressToIdMapper; + + #[view(getDelegatedValue)] + #[storage_mapper("delegatedValue")] + fn delegated_value(&self, validator: &AddressId) -> SingleValueMapper; + + #[view(unDelegateEpoch)] + #[storage_mapper("unDelegateEpoch")] + fn undelegate_epoch(&self, address: &ManagedAddress) -> SingleValueMapper; + + #[view(getTotalEgldSupply)] + #[storage_mapper("totalEgldSupply")] + fn egld_token_supply(&self) -> SingleValueMapper; + + #[view(getHeaderVerifierAddress)] + #[storage_mapper("headerVerifierAddress")] + fn header_verifier_address(&self) -> SingleValueMapper; + + #[view(getRegisteredBlsKeys)] + #[storage_mapper("registeredBlsKeys")] + fn registered_bls_keys(&self) -> UnorderedSetMapper>; + + #[view(validatorBlsKeyMap)] + #[storage_mapper("validatorBlsKeyMap")] + fn validator_bls_key_address_map( + &self, + bls_key: &BlsKey, + ) -> SingleValueMapper; + + // NOTE: Number of nodes where ? + #[view(lockedSupply)] + #[storage_mapper("lockerSupply")] + fn locked_supply(&self, chain_id: ChainId) -> SingleValueMapper; + + fn require_bls_key_registered(&self, bls_key: &BlsKey) { + require!( + self.registered_bls_keys().contains(bls_key), + "The given bls key is not registered" + ); + } + + fn require_caller_header_verifier(&self, address: &ManagedAddress) { + require!( + !self.header_verifier_address().is_empty(), + "There is no address registered as the Header Verifier" + ); + + let header_verifier_address = self.header_verifier_address().get(); + + require!( + address == &header_verifier_address, + "Caller is not Header Verifier contract" + ); + } + + fn require_address_has_stake(&self, validator_address: &ManagedAddress) { + let validator_id = self.validator_ids().get_id_or_insert(validator_address); + let total_egld_deposit = self.delegated_value(&validator_id).get(); + + require!(total_egld_deposit > 0, "Caller has 0 delegated value"); + } +} diff --git a/liquid-staking/src/delegation.rs b/liquid-staking/src/delegation.rs new file mode 100644 index 00000000..c62147c0 --- /dev/null +++ b/liquid-staking/src/delegation.rs @@ -0,0 +1,177 @@ +use multiversx_sc::imports::*; +pub const UNBOND_PERIOD: u64 = 10; +pub const DELEGATE_ENDPOINT: &[u8] = b"delegate"; +pub const UNDELEGATE_ENDPOINT: &[u8] = b"unDelegate"; +pub const CLAIM_REWARDS_ENDPOINT: &[u8] = b"claimRewards"; + +use crate::{ + common::{ + self, + storage::{BlsKey, ChainId}, + }, + delegation_proxy, +}; + +#[multiversx_sc::module] +pub trait DelegationModule: common::storage::CommonStorageModule { + #[payable("EGLD")] + #[endpoint] + fn stake(&self, contract_name: ManagedBuffer) { + let caller = self.blockchain().get_caller(); + let egld_amount = self.call_value().egld_value().clone_value(); + let delegation_contract_address = self.delegation_addresses(&contract_name).get(); + + self.tx() + .to(delegation_contract_address) + .typed(delegation_proxy::DelegationMockProxy) + .delegate() + .egld(&egld_amount) + .gas(self.blockchain().get_gas_left()) + .callback(self.callbacks().stake_callback(&caller, &egld_amount)) + .register_promise(); + } + + #[promises_callback] + fn stake_callback( + &self, + validator_address: &ManagedAddress, + egld_amount: &BigUint, + #[call_result] result: ManagedAsyncCallResult<()>, + ) { + match result { + ManagedAsyncCallResult::Ok(()) => { + let validator_id = self.validator_ids().get_id_or_insert(validator_address); + + self.delegated_value(&validator_id) + .update(|value| *value += egld_amount); + self.egld_token_supply() + .update(|value| *value += egld_amount) + } + _ => self.tx().egld(egld_amount).to(validator_address).transfer(), + } + } + + #[endpoint(unStake)] + fn unstake(&self, contract_name: ManagedBuffer, egld_amount_to_unstake: BigUint) { + let caller = self.blockchain().get_caller(); + let delegation_contract_address = self.delegation_addresses(&contract_name).get(); + let validator_id = self.validator_ids().get_id_or_insert(&caller); + let total_egld_deposit = self.delegated_value(&validator_id).get(); + + require!( + egld_amount_to_unstake <= total_egld_deposit, + "The value to unstake is greater than the deposited amount" + ); + + self.tx() + .to(delegation_contract_address) + .typed(delegation_proxy::DelegationMockProxy) + .undelegate(&egld_amount_to_unstake) + .gas(self.blockchain().get_gas_left()) + .callback( + self.callbacks() + .unstake_callback(&caller, &egld_amount_to_unstake), + ) + .register_promise(); + } + + #[promises_callback] + fn unstake_callback( + &self, + validator_address: &ManagedAddress, + egld_amount_to_unstake: &BigUint, + #[call_result] result: ManagedAsyncCallResult<()>, + ) { + match result { + ManagedAsyncCallResult::Ok(()) => { + let validator_id = self.validator_ids().get_id_or_insert(validator_address); + + self.delegated_value(&validator_id) + .update(|value| *value -= egld_amount_to_unstake); + } + _ => sc_panic!("There was an error at delegating"), + } + } + + #[endpoint(claimRewardsFromDelegation)] + fn claim_rewards_from_delegation(&self, contracts: MultiValueEncoded) { + let caller = self.blockchain().get_caller(); + self.require_address_has_stake(&caller); + + for delegation_contract in contracts { + let delegation_mapper = self.delegation_addresses(&delegation_contract); + + if delegation_mapper.is_empty() { + continue; + } + + let delegation_address = delegation_mapper.get(); + self.tx() + .to(delegation_address) + .typed(delegation_proxy::DelegationMockProxy) + .claim_rewards() + .gas(self.blockchain().get_gas_left()) + .callback(self.callbacks().claim_rewards_from_delegation_cb()) + .register_promise(); + } + } + + #[promises_callback] + fn claim_rewards_from_delegation_cb( + &self, + // egld_amount: &BigUint, + #[call_result] result: ManagedAsyncCallResult<()>, + ) { + require!( + result.is_ok(), + "There was an error at claiming rewards from the delegation contract" + ); + } + + // NOTE: Should this also add to the map ? + #[endpoint(slashValidator)] + fn slash_validator( + &self, + validator_address: ManagedAddress, + bls_key: BlsKey, + value_to_slash: BigUint, + ) { + let caller = self.blockchain().get_caller(); + self.require_caller_header_verifier(&caller); + self.require_bls_key_registered(&bls_key); + + require!( + !self.validator_bls_key_address_map(&bls_key).is_empty(), + "There is no associated address to the given BLS key" + ); + + self.require_address_has_stake(&validator_address); + + require!(value_to_slash > 0, "You can't slash a value of 0 eGLD"); + + let validator_id = self.validator_ids().get_id_or_insert(&validator_address); + let delegation_mapper = self.delegated_value(&validator_id); + let delegated_value = delegation_mapper.get(); + require!( + delegated_value >= value_to_slash, + "The slash value can't be greater than the total delegated amount" + ); + + delegation_mapper.update(|value| *value -= &value_to_slash); + } + + #[payable("EGLD")] + #[endpoint(lockForSovereignChain)] + fn lock_for_sovereign_chain(&self, chain_id: ChainId) { + let call_value = self.call_value().egld_value().clone_value(); + + require!(call_value > 0, "No value send to lock"); + self.locked_supply(chain_id) + .update(|supply| *supply += call_value); + + // lock amount with ChainConfigSC + } + + #[endpoint] + fn claim_rewards(&self) {} +} diff --git a/liquid-staking/src/delegation_proxy.rs b/liquid-staking/src/delegation_proxy.rs new file mode 100644 index 00000000..268915ca --- /dev/null +++ b/liquid-staking/src/delegation_proxy.rs @@ -0,0 +1,111 @@ +// 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 DelegationMockProxy; + +impl TxProxyTrait for DelegationMockProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = DelegationMockProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + DelegationMockProxyMethods { wrapped_tx: tx } + } +} + +pub struct DelegationMockProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +#[rustfmt::skip] +impl DelegationMockProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + Gas: TxGas, +{ + pub fn init( + self, + ) -> TxTypedDeploy { + self.wrapped_tx + .payment(NotPayable) + .raw_deploy() + .original_result() + } +} + +#[rustfmt::skip] +impl DelegationMockProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn deposit_egld( + self, + ) -> TxTypedCall { + self.wrapped_tx + .raw_call("depositEGLD") + .original_result() + } + + pub fn delegate( + self, + ) -> TxTypedCall { + self.wrapped_tx + .raw_call("delegate") + .original_result() + } + + pub fn undelegate< + Arg0: ProxyArg>, + >( + self, + egld_to_undelegate: Arg0, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("unDelegate") + .argument(&egld_to_undelegate) + .original_result() + } + + pub fn withdraw( + self, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("withdraw") + .original_result() + } + + pub fn claim_rewards( + self, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("claimRewards") + .original_result() + } +} diff --git a/liquid-staking/src/lib.rs b/liquid-staking/src/lib.rs new file mode 100644 index 00000000..33df723d --- /dev/null +++ b/liquid-staking/src/lib.rs @@ -0,0 +1,68 @@ +#![no_std] + +use multiversx_sc::imports::*; + +pub mod common; +pub mod delegation; +pub mod delegation_proxy; +pub mod liquid_staking_proxy; +pub mod liquidity_pools; + +#[multiversx_sc::contract] +pub trait LiquidStaking: + liquidity_pools::LiquidityPoolModule + + delegation::DelegationModule + + common::storage::CommonStorageModule +{ + #[init] + fn init(&self) {} + + #[upgrade] + fn upgrade(&self) {} + + #[endpoint(registerDelegationContractAddress)] + fn register_delegation_address( + &self, + contract_name: ManagedBuffer, + delegation_address: ManagedAddress, + ) { + require!( + self.blockchain().is_smart_contract(&delegation_address), + "Provided address is not a valid Smart Contract address" + ); + + require!( + self.delegation_addresses(&contract_name).is_empty(), + "This contract is already registered" + ); + + self.delegation_addresses(&contract_name) + .set(delegation_address); + } + + #[only_owner] + #[endpoint(registerHeaderVerifierAddress)] + fn register_header_verifier_address(&self, header_verifier_address: ManagedAddress) { + self.header_verifier_address().set(header_verifier_address); + } + + #[endpoint(registerBlsKeys)] + fn register_bls_keys(&self, bls_keys: MultiValueEncoded) { + let caller = self.blockchain().get_caller(); + self.require_caller_header_verifier(&caller); + + self.registered_bls_keys().extend(bls_keys); + } + + #[endpoint(registerBlsKeys)] + fn unregister_bls_keys(&self, bls_keys: MultiValueEncoded) { + let caller = self.blockchain().get_caller(); + self.require_caller_header_verifier(&caller); + + let mut bls_keys_mapper = self.registered_bls_keys(); + + for bls_key in bls_keys { + bls_keys_mapper.swap_remove(&bls_key); + } + } +} diff --git a/liquid-staking/src/liquid_staking_proxy.rs b/liquid-staking/src/liquid_staking_proxy.rs new file mode 100644 index 00000000..06ca0c07 --- /dev/null +++ b/liquid-staking/src/liquid_staking_proxy.rs @@ -0,0 +1,298 @@ +// 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 LiquidStakingProxy; + +impl TxProxyTrait for LiquidStakingProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = LiquidStakingProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + LiquidStakingProxyMethods { wrapped_tx: tx } + } +} + +pub struct LiquidStakingProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +#[rustfmt::skip] +impl LiquidStakingProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + Gas: TxGas, +{ + pub fn init( + self, + ) -> TxTypedDeploy { + self.wrapped_tx + .payment(NotPayable) + .raw_deploy() + .original_result() + } +} + +#[rustfmt::skip] +impl LiquidStakingProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn upgrade( + self, + ) -> TxTypedUpgrade { + self.wrapped_tx + .payment(NotPayable) + .raw_upgrade() + .original_result() + } +} + +#[rustfmt::skip] +impl LiquidStakingProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn register_delegation_address< + Arg0: ProxyArg>, + Arg1: ProxyArg>, + >( + self, + contract_name: Arg0, + delegation_address: Arg1, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("registerDelegationContractAddress") + .argument(&contract_name) + .argument(&delegation_address) + .original_result() + } + + pub fn register_header_verifier_address< + Arg0: ProxyArg>, + >( + self, + header_verifier_address: Arg0, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("registerHeaderVerifierAddress") + .argument(&header_verifier_address) + .original_result() + } + + pub fn register_bls_keys< + Arg0: ProxyArg>>, + >( + self, + bls_keys: Arg0, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("registerBlsKeys") + .argument(&bls_keys) + .original_result() + } + + pub fn stake< + Arg0: ProxyArg>, + >( + self, + contract_name: Arg0, + ) -> TxTypedCall { + self.wrapped_tx + .raw_call("stake") + .argument(&contract_name) + .original_result() + } + + pub fn unstake< + Arg0: ProxyArg>, + Arg1: ProxyArg>, + >( + self, + contract_name: Arg0, + egld_amount_to_unstake: Arg1, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("unStake") + .argument(&contract_name) + .argument(&egld_amount_to_unstake) + .original_result() + } + + pub fn claim_rewards_from_delegation< + Arg0: ProxyArg>>, + >( + self, + contracts: Arg0, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("claimRewardsFromDelegation") + .argument(&contracts) + .original_result() + } + + pub fn slash_validator< + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg>, + >( + self, + validator_address: Arg0, + bls_key: Arg1, + value_to_slash: Arg2, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("slashValidator") + .argument(&validator_address) + .argument(&bls_key) + .argument(&value_to_slash) + .original_result() + } + + pub fn lock_for_sovereign_chain< + Arg0: ProxyArg>, + >( + self, + chain_id: Arg0, + ) -> TxTypedCall { + self.wrapped_tx + .raw_call("lockForSovereignChain") + .argument(&chain_id) + .original_result() + } + + pub fn claim_rewards( + self, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("claim_rewards") + .original_result() + } + + pub fn delegation_addresses< + Arg0: ProxyArg>, + >( + self, + contract_name: Arg0, + ) -> TxTypedCall> { + self.wrapped_tx + .payment(NotPayable) + .raw_call("getDelegationAddress") + .argument(&contract_name) + .original_result() + } + + pub fn delegated_value< + Arg0: ProxyArg, + >( + self, + validator: Arg0, + ) -> TxTypedCall> { + self.wrapped_tx + .payment(NotPayable) + .raw_call("getDelegatedValue") + .argument(&validator) + .original_result() + } + + pub fn undelegate_epoch< + Arg0: ProxyArg>, + >( + self, + address: Arg0, + ) -> TxTypedCall { + self.wrapped_tx + .payment(NotPayable) + .raw_call("unDelegateEpoch") + .argument(&address) + .original_result() + } + + pub fn egld_token_supply( + self, + ) -> TxTypedCall> { + self.wrapped_tx + .payment(NotPayable) + .raw_call("getTotalEgldSupply") + .original_result() + } + + pub fn header_verifier_address( + self, + ) -> TxTypedCall> { + self.wrapped_tx + .payment(NotPayable) + .raw_call("getHeaderVerifierAddress") + .original_result() + } + + pub fn registered_bls_keys( + self, + ) -> TxTypedCall>> { + self.wrapped_tx + .payment(NotPayable) + .raw_call("getRegisteredBlsKeys") + .original_result() + } + + pub fn validator_bls_key_address_map< + Arg0: ProxyArg>, + >( + self, + bls_key: Arg0, + ) -> TxTypedCall> { + self.wrapped_tx + .payment(NotPayable) + .raw_call("validatorBlsKeyMap") + .argument(&bls_key) + .original_result() + } + + pub fn locked_supply< + Arg0: ProxyArg>, + >( + self, + chain_id: Arg0, + ) -> TxTypedCall> { + self.wrapped_tx + .payment(NotPayable) + .raw_call("lockedSupply") + .argument(&chain_id) + .original_result() + } +} diff --git a/liquid-staking/src/liquidity_pools.rs b/liquid-staking/src/liquidity_pools.rs new file mode 100644 index 00000000..210ff6d2 --- /dev/null +++ b/liquid-staking/src/liquidity_pools.rs @@ -0,0 +1,2 @@ +#[multiversx_sc::module] +pub trait LiquidityPoolModule {} diff --git a/liquid-staking/tests/liquid_staking_tests.rs b/liquid-staking/tests/liquid_staking_tests.rs new file mode 100644 index 00000000..16c52894 --- /dev/null +++ b/liquid-staking/tests/liquid_staking_tests.rs @@ -0,0 +1,678 @@ +use delegation_mock::{APY, EPOCHS_IN_YEAR, MAX_PERCENTAGE}; +use liquid_staking::{ + common::storage::CommonStorageModule, delegation_proxy, liquid_staking_proxy, +}; +use multiversx_sc::types::{ + BigUint, ManagedAddress, ManagedBuffer, MultiValueEncoded, TestAddress, TestSCAddress, +}; +use multiversx_sc_scenario::{ + api::StaticApi, imports::MxscPath, DebugApi, ExpectError, ScenarioTxRun, ScenarioTxWhitebox, + ScenarioWorld, +}; + +const LIQUID_STAKING_CODE_PATH: MxscPath = MxscPath::new("output/liquid-stacking.mxsc.json"); +const LIQUID_STAKING_ADDRESS: TestSCAddress = TestSCAddress::new("liquid-staking"); +const OWNER: TestAddress = TestAddress::new("owner"); + +const DELEGATION_CODE_PATH: MxscPath = + MxscPath::new("../delegation-mock/output/delegation-mock.mxsc.json"); +const DELEGATION_ADDRESS: TestSCAddress = TestSCAddress::new("delegation"); + +const MOCK_CODE_PATH: MxscPath = + MxscPath::new("../header-verifier/output/header-verifier.mxsc.json"); + +const HEADER_VERIFIER_ADDRESS: TestSCAddress = TestSCAddress::new("header_verifier"); + +const VALIDATOR_ADDRESS: TestAddress = TestAddress::new("validator"); + +const WEGLD_BALANCE: u128 = 100_000_000_000_000_000; + +fn world() -> ScenarioWorld { + let mut blockchain = ScenarioWorld::new(); + + blockchain.register_contract(LIQUID_STAKING_CODE_PATH, liquid_staking::ContractBuilder); + blockchain.register_contract(DELEGATION_CODE_PATH, delegation_mock::ContractBuilder); + blockchain.register_contract(MOCK_CODE_PATH, delegation_mock::ContractBuilder); + + blockchain +} + +struct LiquidStakingTestState { + world: ScenarioWorld, +} + +pub struct ErrorStatus<'a> { + code: u64, + error_message: &'a str, +} + +impl LiquidStakingTestState { + fn new() -> Self { + let mut world = world(); + + world + .account(OWNER) + .balance(BigUint::from(WEGLD_BALANCE)) + .nonce(1); + + world + .account(VALIDATOR_ADDRESS) + .balance(BigUint::from(WEGLD_BALANCE)) + .nonce(1); + + Self { world } + } + + fn deploy_liquid_staking(&mut self) -> &mut Self { + self.world + .tx() + .from(OWNER) + .typed(liquid_staking_proxy::LiquidStakingProxy) + .init() + .code(LIQUID_STAKING_CODE_PATH) + .new_address(LIQUID_STAKING_ADDRESS) + .run(); + + self + } + + fn deploy_delegation(&mut self) -> &mut Self { + self.world + .tx() + .from(OWNER) + .typed(delegation_proxy::DelegationMockProxy) + .init() + .code(DELEGATION_CODE_PATH) + .new_address(DELEGATION_ADDRESS) + .run(); + + self + } + + fn deploy_mock_header_verifier(&mut self) -> &mut Self { + self.world + .tx() + .from(OWNER) + .typed(delegation_proxy::DelegationMockProxy) + .init() + .code(MOCK_CODE_PATH) + .new_address(HEADER_VERIFIER_ADDRESS) + .run(); + + self + } + + fn propose_setup_contracts(&mut self) -> &mut Self { + self.deploy_liquid_staking(); + self.deploy_delegation(); + self.deploy_mock_header_verifier(); + + self + } + + fn propose_register_delegation_address( + &mut self, + contract_name: &ManagedBuffer, + delegation_address: TestSCAddress, + error_status: Option, + ) -> &mut Self { + let managed_delegation_address = delegation_address.to_managed_address(); + match error_status { + Some(error) => self + .world + .tx() + .from(OWNER) + .to(LIQUID_STAKING_ADDRESS) + .typed(liquid_staking_proxy::LiquidStakingProxy) + .register_delegation_address(contract_name, managed_delegation_address) + .returns(ExpectError(error.code, error.error_message)) + .run(), + None => self + .world + .tx() + .from(OWNER) + .to(LIQUID_STAKING_ADDRESS) + .typed(liquid_staking_proxy::LiquidStakingProxy) + .register_delegation_address(contract_name, managed_delegation_address) + .run(), + } + self + } + + fn propose_stake( + &mut self, + validator: &TestAddress, + contract_name: &ManagedBuffer, + payment: &BigUint, + ) -> &mut Self { + self.world + .tx() + .from(validator.to_managed_address()) + .to(LIQUID_STAKING_ADDRESS) + .typed(liquid_staking_proxy::LiquidStakingProxy) + .stake(contract_name) + .egld(payment) + .run(); + + self + } + + fn propose_unstake( + &mut self, + contract_name: &ManagedBuffer, + amount_to_unstake: &BigUint, + error_status: Option, + ) -> &mut Self { + match error_status { + Some(error) => self + .world + .tx() + .from(OWNER) + .to(LIQUID_STAKING_ADDRESS) + .typed(liquid_staking_proxy::LiquidStakingProxy) + .unstake(contract_name, amount_to_unstake) + .returns(ExpectError(error.code, error.error_message)) + .run(), + None => self + .world + .tx() + .from(OWNER) + .to(LIQUID_STAKING_ADDRESS) + .typed(liquid_staking_proxy::LiquidStakingProxy) + .unstake(contract_name, amount_to_unstake) + .run(), + } + + self + } + + fn propose_claim_rewards_from_delegation( + &mut self, + contracts: &MultiValueEncoded>, + ) -> &mut Self { + self.world + .tx() + .from(OWNER) + .to(LIQUID_STAKING_ADDRESS) + .typed(liquid_staking_proxy::LiquidStakingProxy) + .claim_rewards_from_delegation(contracts) + .run(); + + self + } + + fn propose_register_bls_keys( + &mut self, + bls_keys: MultiValueEncoded>, + error_status: Option, + ) { + match error_status { + Some(error) => self + .world + .tx() + .from(OWNER) + .to(LIQUID_STAKING_ADDRESS) + .typed(liquid_staking_proxy::LiquidStakingProxy) + .register_bls_keys(bls_keys) + .returns(ExpectError(error.code, error.error_message)) + .run(), + None => self + .world + .tx() + .from(HEADER_VERIFIER_ADDRESS) + .to(LIQUID_STAKING_ADDRESS) + .typed(liquid_staking_proxy::LiquidStakingProxy) + .register_bls_keys(bls_keys) + .run(), + } + } + + fn propose_register_header_verifier( + &mut self, + header_verifier_address: TestSCAddress, + ) -> &mut Self { + self.world + .tx() + .from(OWNER) + .to(LIQUID_STAKING_ADDRESS) + .typed(liquid_staking_proxy::LiquidStakingProxy) + .register_header_verifier_address(header_verifier_address) + .run(); + + self + } + + fn propose_slash_validator( + &mut self, + validator_address: &TestAddress, + bls_key: &ManagedBuffer, + value_to_slash: BigUint, + error_status: Option, + ) { + match error_status { + Some(error) => self + .world + .tx() + .from(HEADER_VERIFIER_ADDRESS) + .to(LIQUID_STAKING_ADDRESS) + .typed(liquid_staking_proxy::LiquidStakingProxy) + .slash_validator( + validator_address.to_managed_address(), + bls_key, + value_to_slash, + ) + .returns(ExpectError(error.code, error.error_message)) + .run(), + None => self + .world + .tx() + .from(HEADER_VERIFIER_ADDRESS) + .to(LIQUID_STAKING_ADDRESS) + .typed(liquid_staking_proxy::LiquidStakingProxy) + .slash_validator( + validator_address.to_managed_address(), + bls_key, + value_to_slash, + ) + .run(), + } + } + + fn propose_check_is_contract_registered(&mut self, contract_name: &ManagedBuffer) { + self.world.query().to(LIQUID_STAKING_ADDRESS).whitebox( + liquid_staking::contract_obj, + |sc| { + let contract_name_debug_api: ManagedBuffer = + ManagedBuffer::from(contract_name.to_vec()); + let registered_address = sc.delegation_addresses(&contract_name_debug_api).get(); + assert_eq!(DELEGATION_ADDRESS, registered_address); + }, + ); + } + + fn get_expected_rewards( + &mut self, + staked_amount: &BigUint, + current_epoch: u64, + last_claim_epoch: u64, + ) -> BigUint { + (staked_amount * APY / MAX_PERCENTAGE) * (current_epoch - last_claim_epoch) / EPOCHS_IN_YEAR + } + + fn map_bls_key_vec_to_multi_value( + &mut self, + bls_keys: Vec<&ManagedBuffer>, + ) -> MultiValueEncoded> { + let managed_bls_keys: MultiValueEncoded> = + bls_keys.iter().map(|bls_key| (*bls_key).clone()).collect(); + + managed_bls_keys + } + + fn get_validator_id(&mut self, validator: &TestAddress) -> u64 { + let mut validator_id = 0; + self.world.query().to(LIQUID_STAKING_ADDRESS).whitebox( + liquid_staking::contract_obj, + |sc| { + validator_id = sc + .validator_ids() + .get_id_or_insert(&validator.to_managed_address()); + }, + ); + + validator_id + } + + fn whitebox_map_bls_to_address(&mut self, bls_key: &str, address: &TestAddress) -> &mut Self { + self.world + .tx() + .from(OWNER) + .to(LIQUID_STAKING_ADDRESS) + .whitebox(liquid_staking::contract_obj, |sc| { + let validator_address: ManagedAddress = address.to_managed_address(); + let bls_key_whitebox: ManagedBuffer = ManagedBuffer::from(bls_key); + sc.validator_bls_key_address_map(&bls_key_whitebox) + .set(validator_address); + }); + + self + } +} + +#[test] +fn test_deploy() { + let mut state = LiquidStakingTestState::new(); + + state.propose_setup_contracts(); +} + +#[test] +fn test_register_delegation_contract() { + let mut state = LiquidStakingTestState::new(); + let contract_name = ManagedBuffer::from("delegation"); + + state.propose_setup_contracts(); + state.propose_register_delegation_address(&contract_name, DELEGATION_ADDRESS, None); + state.propose_check_is_contract_registered(&contract_name); +} + +#[test] +fn test_register_delegation_contract_contract_already_registered() { + let mut state = LiquidStakingTestState::new(); + let error_status = ErrorStatus { + code: 4, + error_message: "This contract is already registered", + }; + + state.propose_setup_contracts(); + state.propose_register_delegation_address(&ManagedBuffer::new(), DELEGATION_ADDRESS, None); + state.propose_register_delegation_address( + &ManagedBuffer::new(), + DELEGATION_ADDRESS, + Some(error_status), + ); +} + +#[test] +fn test_stake() { + let mut state = LiquidStakingTestState::new(); + let contract_name = ManagedBuffer::from("delegation_sc"); + let payment = BigUint::from(100_000u64); + + state.propose_setup_contracts(); + state.propose_register_delegation_address(&contract_name, DELEGATION_ADDRESS, None); + state.propose_check_is_contract_registered(&contract_name); + state.propose_stake(&OWNER, &contract_name, &payment); + + state + .world + .check_account(OWNER) + .balance(BigUint::from(WEGLD_BALANCE) - payment); + + let validator_id = state.get_validator_id(&OWNER); + + state + .world + .query() + .to(LIQUID_STAKING_ADDRESS) + .whitebox(liquid_staking::contract_obj, |sc| { + let payment_whitebox = BigUint::from(100_000u64); + let delegated_value = sc.delegated_value(&validator_id).get(); + let egld_supply = sc.egld_token_supply().get(); + + assert!(egld_supply > 0); + assert_eq!(delegated_value, payment_whitebox); + }); +} + +#[test] +fn test_unstake_user_no_deposit() { + let mut state = LiquidStakingTestState::new(); + let contract_name = ManagedBuffer::from("delegation"); + let payment = BigUint::from(100_000u64); + let error_status = ErrorStatus { + code: 4, + error_message: "The value to unstake is greater than the deposited amount", + }; + + state.propose_setup_contracts(); + state.propose_register_delegation_address(&contract_name, DELEGATION_ADDRESS, None); + state.propose_check_is_contract_registered(&contract_name); + state.propose_unstake(&contract_name, &payment, Some(error_status)); +} + +#[test] +fn test_unstake() { + let mut state = LiquidStakingTestState::new(); + let contract_name = ManagedBuffer::from("delegation"); + let payment = BigUint::from(100_000u64); + let amount_to_unstake = BigUint::from(10_000u64); + + state.propose_setup_contracts(); + state.propose_register_delegation_address(&contract_name, DELEGATION_ADDRESS, None); + state.propose_check_is_contract_registered(&contract_name); + state.propose_stake(&OWNER, &contract_name, &payment); + state.propose_unstake(&contract_name, &amount_to_unstake, None); + + state + .world + .check_account(OWNER) + .balance(BigUint::from(WEGLD_BALANCE) - payment); + + let validator_id = state.get_validator_id(&OWNER); + + state + .world + .query() + .to(LIQUID_STAKING_ADDRESS) + .whitebox(liquid_staking::contract_obj, |sc| { + let expected_amount = BigUint::from(90_000u64); + let delegated_value = sc.delegated_value(&validator_id).get(); + + assert_eq!(delegated_value, expected_amount); + }) +} + +#[test] +fn test_claim_rewards_from_delegation_contract() { + let mut state = LiquidStakingTestState::new(); + let contract_name = ManagedBuffer::from("delegation"); + let payment = BigUint::from(100_000u64); + let mut contracts_to_claim_from: MultiValueEncoded> = + MultiValueEncoded::new(); + let claim_rewards_epoch = 20; + + state.propose_setup_contracts(); + state.propose_register_delegation_address(&contract_name, DELEGATION_ADDRESS, None); + state.propose_check_is_contract_registered(&contract_name); + state.propose_stake(&OWNER, &contract_name, &payment); + + contracts_to_claim_from.push(contract_name); + + state.world.current_block().block_epoch(claim_rewards_epoch); + + state.propose_claim_rewards_from_delegation(&contracts_to_claim_from); + state.world.current_block().block_epoch(claim_rewards_epoch); + state.propose_claim_rewards_from_delegation(&contracts_to_claim_from); + + let expected_rewards = state.get_expected_rewards(&payment, claim_rewards_epoch, 0); + + state + .world + .check_account(LIQUID_STAKING_ADDRESS) + .balance(expected_rewards); +} + +#[test] +fn test_slash_validator() { + let mut state = LiquidStakingTestState::new(); + let contract_name = ManagedBuffer::from("delegation"); + let payment = BigUint::from(100_000u64); + // let validator_1_bls_key = ManagedBuffer::from("validator1"); + // let validator_2_bls_key = ManagedBuffer::from("validator2"); + + state.propose_setup_contracts(); + state.propose_register_delegation_address(&contract_name, DELEGATION_ADDRESS, None); + state.propose_check_is_contract_registered(&contract_name); + state.propose_stake(&OWNER, &contract_name, &payment); + // state.propose_slash_validator(bls_key, value_to_slash); +} + +#[test] +fn test_register_bls_keys_no_header_verifier_address() { + let mut state = LiquidStakingTestState::new(); + let contract_name = ManagedBuffer::from("delegation"); + let bls_keys = state.map_bls_key_vec_to_multi_value(vec![&ManagedBuffer::from("bls_key")]); + let error_status = ErrorStatus { + code: 4, + error_message: "There is no address registered as the Header Verifier", + }; + + state.propose_setup_contracts(); + state.propose_register_delegation_address(&contract_name, DELEGATION_ADDRESS, None); + state.propose_check_is_contract_registered(&contract_name); + state.propose_register_bls_keys(bls_keys, Some(error_status)); +} + +#[test] +fn test_register_bls_keys_caller_not_header_verifier() { + let mut state = LiquidStakingTestState::new(); + let contract_name = ManagedBuffer::from("delegation"); + let bls_keys = state.map_bls_key_vec_to_multi_value(vec![&ManagedBuffer::from("bls_key")]); + let error_status = ErrorStatus { + code: 4, + error_message: "Caller is not Header Verifier contract", + }; + + state.propose_setup_contracts(); + state.propose_register_delegation_address(&contract_name, DELEGATION_ADDRESS, None); + state.propose_check_is_contract_registered(&contract_name); + state.propose_register_header_verifier(HEADER_VERIFIER_ADDRESS); + state.propose_register_bls_keys(bls_keys, Some(error_status)); +} + +#[test] +fn register_bls_keys() { + let mut state = LiquidStakingTestState::new(); + let contract_name = ManagedBuffer::from("delegation"); + let validator_1_bls_key = ManagedBuffer::from("bls_key_1"); + let validator_2_bls_key = ManagedBuffer::from("bls_key_2"); + let bls_keys = + state.map_bls_key_vec_to_multi_value(vec![&validator_1_bls_key, &validator_2_bls_key]); + + state.propose_setup_contracts(); + state.propose_register_delegation_address(&contract_name, DELEGATION_ADDRESS, None); + state.propose_register_header_verifier(HEADER_VERIFIER_ADDRESS); + state.propose_register_bls_keys(bls_keys, None); + + state + .world + .query() + .to(LIQUID_STAKING_ADDRESS) + .whitebox(liquid_staking::contract_obj, |sc| { + assert!(!sc.registered_bls_keys().is_empty()); + }) +} + +#[test] +fn slash_no_delegated_value() { + let mut state = LiquidStakingTestState::new(); + let contract_name = ManagedBuffer::from("delegation"); + let validator_bls_key_1 = ManagedBuffer::from("bls_key_1"); + let validator_bls_key_2 = ManagedBuffer::from("bls_key_2"); + let bls_keys = + state.map_bls_key_vec_to_multi_value(vec![&validator_bls_key_1, &validator_bls_key_2]); + let value_to_slash = BigUint::from(10_000u64); + let error_status = ErrorStatus { + code: 4, + error_message: "Caller has 0 delegated value", + }; + + state.propose_setup_contracts(); + state.propose_register_delegation_address(&contract_name, DELEGATION_ADDRESS, None); + state.propose_register_header_verifier(HEADER_VERIFIER_ADDRESS); + state.propose_register_bls_keys(bls_keys, None); + state.whitebox_map_bls_to_address("bls_key_1", &VALIDATOR_ADDRESS); + state.propose_slash_validator( + &VALIDATOR_ADDRESS, + &validator_bls_key_1, + value_to_slash, + Some(error_status), + ); +} + +#[test] +fn slash_zero_value() { + let mut state = LiquidStakingTestState::new(); + let contract_name = ManagedBuffer::from("delegation"); + let validator_bls_key_1 = ManagedBuffer::from("bls_key_1"); + let validator_bls_key_2 = ManagedBuffer::from("bls_key_2"); + let payment = BigUint::from(100_000u64); + let bls_keys = + state.map_bls_key_vec_to_multi_value(vec![&validator_bls_key_1, &validator_bls_key_2]); + let value_to_slash = BigUint::from(0u64); + let error_status = ErrorStatus { + code: 4, + error_message: "You can't slash a value of 0 eGLD", + }; + + state.propose_setup_contracts(); + state.propose_register_delegation_address(&contract_name, DELEGATION_ADDRESS, None); + state.propose_register_header_verifier(HEADER_VERIFIER_ADDRESS); + state.propose_register_bls_keys(bls_keys, None); + state.propose_stake(&VALIDATOR_ADDRESS, &contract_name, &payment); + state.whitebox_map_bls_to_address("bls_key_1", &VALIDATOR_ADDRESS); + state.propose_slash_validator( + &VALIDATOR_ADDRESS, + &validator_bls_key_1, + value_to_slash, + Some(error_status), + ); +} + +#[test] +fn slash_more_than_delegated_value() { + let mut state = LiquidStakingTestState::new(); + let contract_name = ManagedBuffer::from("delegation"); + let validator_bls_key_1 = ManagedBuffer::from("bls_key_1"); + let validator_bls_key_2 = ManagedBuffer::from("bls_key_2"); + let payment = BigUint::from(100_000u64); + let bls_keys = + state.map_bls_key_vec_to_multi_value(vec![&validator_bls_key_1, &validator_bls_key_2]); + let value_to_slash = BigUint::from(100_100u64); + let error_status = ErrorStatus { + code: 4, + error_message: "The slash value can't be greater than the total delegated amount", + }; + + state.propose_setup_contracts(); + state.propose_register_delegation_address(&contract_name, DELEGATION_ADDRESS, None); + state.propose_register_header_verifier(HEADER_VERIFIER_ADDRESS); + state.propose_register_bls_keys(bls_keys, None); + state.propose_stake(&VALIDATOR_ADDRESS, &contract_name, &payment); + state.whitebox_map_bls_to_address("bls_key_1", &VALIDATOR_ADDRESS); + state.propose_slash_validator( + &VALIDATOR_ADDRESS, + &validator_bls_key_1, + value_to_slash, + Some(error_status), + ); +} + +#[test] +fn slash_validator() { + let mut state = LiquidStakingTestState::new(); + let contract_name = ManagedBuffer::from("delegation"); + let validator_1_bls_key = ManagedBuffer::from("bls_key_1"); + let validator_2_bls_key = ManagedBuffer::from("bls_key_2"); + let bls_keys = + state.map_bls_key_vec_to_multi_value(vec![&validator_1_bls_key, &validator_2_bls_key]); + let payment = BigUint::from(100_000u64); + let value_to_slash = BigUint::from(10_000u64); + + state.propose_setup_contracts(); + state.propose_register_delegation_address(&contract_name, DELEGATION_ADDRESS, None); + state.propose_register_header_verifier(HEADER_VERIFIER_ADDRESS); + state.propose_register_bls_keys(bls_keys, None); + state.propose_stake(&VALIDATOR_ADDRESS, &contract_name, &payment); + state.whitebox_map_bls_to_address("bls_key_1", &VALIDATOR_ADDRESS); + state.propose_slash_validator( + &VALIDATOR_ADDRESS, + &validator_1_bls_key, + value_to_slash, + None, + ); + + let validator_id = state.get_validator_id(&VALIDATOR_ADDRESS); + + state + .world + .query() + .to(LIQUID_STAKING_ADDRESS) + .whitebox(liquid_staking::contract_obj, |sc| { + let expected_value = BigUint::from(90_000u64); + let validator_delegated_value = sc.delegated_value(&validator_id).get(); + + assert_eq!(validator_delegated_value, expected_value); + }) +} diff --git a/liquid-staking/wasm-liquid-staking-full/Cargo.lock b/liquid-staking/wasm-liquid-staking-full/Cargo.lock new file mode 100644 index 00000000..38d91fa4 --- /dev/null +++ b/liquid-staking/wasm-liquid-staking-full/Cargo.lock @@ -0,0 +1,196 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "delegation-mock" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "liquid-staking" +version = "0.0.0" +dependencies = [ + "delegation-mock", + "multiversx-sc", +] + +[[package]] +name = "liquid-staking-full-wasm" +version = "0.0.0" +dependencies = [ + "liquid-staking", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "multiversx-sc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e05f8dfb9c2dd26feff1330b1e229f0886f5c0228ed570f19421a458e6e7b0ef" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "007d7a5a8534e5dc9128cb8f15a65a21dd378e135c6016c7cd1491cd012bc8cb" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dffba1dce273ed5b61ee1b90aeea5c8c744617d0f12624f620768c144d83e753" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4b5176aa94b5e422e0d3c904492e0de0ae8381f166b563fbcac19a9ca4b28bc" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa0cbd543872f94b9bc98c4ce7c3ed25a7257e1425295af9036eba44893bdaa" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" diff --git a/liquid-staking/wasm-liquid-staking-full/Cargo.toml b/liquid-staking/wasm-liquid-staking-full/Cargo.toml new file mode 100644 index 00000000..2ce419ba --- /dev/null +++ b/liquid-staking/wasm-liquid-staking-full/Cargo.toml @@ -0,0 +1,34 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + +[package] +name = "liquid-staking-full-wasm" +version = "0.0.0" +edition = "2021" +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.liquid-staking] +path = ".." + +[dependencies.multiversx-sc-wasm-adapter] +version = "0.53.1" + +[workspace] +members = ["."] diff --git a/liquid-staking/wasm-liquid-staking-full/src/lib.rs b/liquid-staking/wasm-liquid-staking-full/src/lib.rs new file mode 100644 index 00000000..599ad5b0 --- /dev/null +++ b/liquid-staking/wasm-liquid-staking-full/src/lib.rs @@ -0,0 +1,43 @@ +// Code generated by the multiversx-sc build system. DO NOT EDIT. + +//////////////////////////////////////////////////// +////////////////// AUTO-GENERATED ////////////////// +//////////////////////////////////////////////////// + +// Init: 1 +// Upgrade: 1 +// Endpoints: 17 +// Async Callback: 1 +// Total number of exported functions: 20 + +#![no_std] + +multiversx_sc_wasm_adapter::allocator!(); +multiversx_sc_wasm_adapter::panic_handler!(); + +multiversx_sc_wasm_adapter::endpoints! { + liquid_staking + ( + init => init + upgrade => upgrade + registerDelegationContractAddress => register_delegation_address + registerHeaderVerifierAddress => register_header_verifier_address + registerBlsKeys => register_bls_keys + stake => stake + unStake => unstake + claimRewardsFromDelegation => claim_rewards_from_delegation + slashValidator => slash_validator + lockForSovereignChain => lock_for_sovereign_chain + claim_rewards => claim_rewards + getDelegationAddress => delegation_addresses + getDelegatedValue => delegated_value + unDelegateEpoch => undelegate_epoch + getTotalEgldSupply => egld_token_supply + getHeaderVerifierAddress => header_verifier_address + getRegisteredBlsKeys => registered_bls_keys + validatorBlsKeyMap => validator_bls_key_address_map + lockedSupply => locked_supply + ) +} + +multiversx_sc_wasm_adapter::async_callback! { liquid_staking } diff --git a/liquid-staking/wasm-liquid-staking-view/Cargo.lock b/liquid-staking/wasm-liquid-staking-view/Cargo.lock new file mode 100644 index 00000000..eefc4527 --- /dev/null +++ b/liquid-staking/wasm-liquid-staking-view/Cargo.lock @@ -0,0 +1,196 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "delegation-mock" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "liquid-staking" +version = "0.0.0" +dependencies = [ + "delegation-mock", + "multiversx-sc", +] + +[[package]] +name = "liquid-staking-view-wasm" +version = "0.0.0" +dependencies = [ + "liquid-staking", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "multiversx-sc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e05f8dfb9c2dd26feff1330b1e229f0886f5c0228ed570f19421a458e6e7b0ef" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "007d7a5a8534e5dc9128cb8f15a65a21dd378e135c6016c7cd1491cd012bc8cb" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dffba1dce273ed5b61ee1b90aeea5c8c744617d0f12624f620768c144d83e753" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4b5176aa94b5e422e0d3c904492e0de0ae8381f166b563fbcac19a9ca4b28bc" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa0cbd543872f94b9bc98c4ce7c3ed25a7257e1425295af9036eba44893bdaa" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" diff --git a/liquid-staking/wasm-liquid-staking-view/Cargo.toml b/liquid-staking/wasm-liquid-staking-view/Cargo.toml new file mode 100644 index 00000000..2ea3a0d6 --- /dev/null +++ b/liquid-staking/wasm-liquid-staking-view/Cargo.toml @@ -0,0 +1,34 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + +[package] +name = "liquid-staking-view-wasm" +version = "0.0.0" +edition = "2021" +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.liquid-staking] +path = ".." + +[dependencies.multiversx-sc-wasm-adapter] +version = "0.53.1" + +[workspace] +members = ["."] diff --git a/liquid-staking/wasm-liquid-staking-view/src/lib.rs b/liquid-staking/wasm-liquid-staking-view/src/lib.rs new file mode 100644 index 00000000..d3395237 --- /dev/null +++ b/liquid-staking/wasm-liquid-staking-view/src/lib.rs @@ -0,0 +1,25 @@ +// Code generated by the multiversx-sc build system. DO NOT EDIT. + +//////////////////////////////////////////////////// +////////////////// AUTO-GENERATED ////////////////// +//////////////////////////////////////////////////// + +// Init: 1 +// Endpoints: 0 +// Async Callback (empty): 1 +// Total number of exported functions: 2 + +#![no_std] + +multiversx_sc_wasm_adapter::allocator!(); +multiversx_sc_wasm_adapter::panic_handler!(); + +multiversx_sc_wasm_adapter::external_view_init! {} + +multiversx_sc_wasm_adapter::external_view_endpoints! { + liquid_staking + ( + ) +} + +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/liquid-staking/wasm/Cargo.lock b/liquid-staking/wasm/Cargo.lock new file mode 100644 index 00000000..1961cca8 --- /dev/null +++ b/liquid-staking/wasm/Cargo.lock @@ -0,0 +1,196 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "delegation-mock" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "liquid-staking" +version = "0.0.0" +dependencies = [ + "delegation-mock", + "multiversx-sc", +] + +[[package]] +name = "liquid-staking-wasm" +version = "0.0.0" +dependencies = [ + "liquid-staking", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "multiversx-sc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e05f8dfb9c2dd26feff1330b1e229f0886f5c0228ed570f19421a458e6e7b0ef" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "007d7a5a8534e5dc9128cb8f15a65a21dd378e135c6016c7cd1491cd012bc8cb" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dffba1dce273ed5b61ee1b90aeea5c8c744617d0f12624f620768c144d83e753" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4b5176aa94b5e422e0d3c904492e0de0ae8381f166b563fbcac19a9ca4b28bc" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa0cbd543872f94b9bc98c4ce7c3ed25a7257e1425295af9036eba44893bdaa" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" diff --git a/liquid-staking/wasm/Cargo.toml b/liquid-staking/wasm/Cargo.toml new file mode 100644 index 00000000..bf40eca0 --- /dev/null +++ b/liquid-staking/wasm/Cargo.toml @@ -0,0 +1,34 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + +[package] +name = "liquid-staking-wasm" +version = "0.0.0" +edition = "2021" +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.liquid-staking] +path = ".." + +[dependencies.multiversx-sc-wasm-adapter] +version = "0.53.1" + +[workspace] +members = ["."] diff --git a/liquid-staking/wasm/src/lib.rs b/liquid-staking/wasm/src/lib.rs new file mode 100644 index 00000000..599ad5b0 --- /dev/null +++ b/liquid-staking/wasm/src/lib.rs @@ -0,0 +1,43 @@ +// Code generated by the multiversx-sc build system. DO NOT EDIT. + +//////////////////////////////////////////////////// +////////////////// AUTO-GENERATED ////////////////// +//////////////////////////////////////////////////// + +// Init: 1 +// Upgrade: 1 +// Endpoints: 17 +// Async Callback: 1 +// Total number of exported functions: 20 + +#![no_std] + +multiversx_sc_wasm_adapter::allocator!(); +multiversx_sc_wasm_adapter::panic_handler!(); + +multiversx_sc_wasm_adapter::endpoints! { + liquid_staking + ( + init => init + upgrade => upgrade + registerDelegationContractAddress => register_delegation_address + registerHeaderVerifierAddress => register_header_verifier_address + registerBlsKeys => register_bls_keys + stake => stake + unStake => unstake + claimRewardsFromDelegation => claim_rewards_from_delegation + slashValidator => slash_validator + lockForSovereignChain => lock_for_sovereign_chain + claim_rewards => claim_rewards + getDelegationAddress => delegation_addresses + getDelegatedValue => delegated_value + unDelegateEpoch => undelegate_epoch + getTotalEgldSupply => egld_token_supply + getHeaderVerifierAddress => header_verifier_address + getRegisteredBlsKeys => registered_bls_keys + validatorBlsKeyMap => validator_bls_key_address_map + lockedSupply => locked_supply + ) +} + +multiversx_sc_wasm_adapter::async_callback! { liquid_staking }