From b19db0b2e6fdc398cade824d99926fcefe6af3e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20B=C4=83ncioiu?= Date: Thu, 28 Dec 2023 23:30:20 +0200 Subject: [PATCH 1/5] Fix marker. --- dex/farm/{elrond.json => multiversx.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename dex/farm/{elrond.json => multiversx.json} (100%) diff --git a/dex/farm/elrond.json b/dex/farm/multiversx.json similarity index 100% rename from dex/farm/elrond.json rename to dex/farm/multiversx.json From ec4182de2e63e31c80abac587469a431e6ff5439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20B=C4=83ncioiu?= Date: Thu, 28 Dec 2023 23:42:22 +0200 Subject: [PATCH 2/5] Add cargo.lock. --- .gitignore | 3 - dex/farm/wasm/Cargo.lock | 343 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 343 insertions(+), 3 deletions(-) create mode 100644 dex/farm/wasm/Cargo.lock diff --git a/.gitignore b/.gitignore index 6d80f2d9d..319a84b30 100644 --- a/.gitignore +++ b/.gitignore @@ -2,9 +2,6 @@ # will have compiled files and executables **/target/ **/output/ -# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries -# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html -Cargo.lock # These are backup files generated by rustfmt **/*.rs.bk diff --git a/dex/farm/wasm/Cargo.lock b/dex/farm/wasm/Cargo.lock new file mode 100644 index 000000000..75682535c --- /dev/null +++ b/dex/farm/wasm/Cargo.lock @@ -0,0 +1,343 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "elrond-wasm", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "elrond-codec" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f334430693f49bf3d550a50242e0e3e38125153efd6e8d540071d98f65781ff3" +dependencies = [ + "arrayvec", + "elrond-codec-derive", + "wee_alloc", +] + +[[package]] +name = "elrond-codec-derive" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15b58321f05a10c110500092a8f776dc4609a6023d7675b270b46356209d3058" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "elrond-wasm" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c3d9d56aee9151925241980fecac33c2785fbec12d0ffe52694428df578630" +dependencies = [ + "arrayvec", + "bitflags", + "elrond-codec", + "elrond-wasm-derive", + "hashbrown", + "hex-literal", + "wee_alloc", +] + +[[package]] +name = "elrond-wasm-derive" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f7bbff620e43729364f4d7c3355e46810371c9c9a4ec8ea1aee3738bc864094" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "elrond-wasm-node" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a42c0cccfcebe57c35276a921f428ea46d17f0bc24f488643dd0678c10772ee2" +dependencies = [ + "elrond-wasm", +] + +[[package]] +name = "elrond-wasm-output" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6824ca2ad739c37f73b97004c4dd297f6d9a5ee729c002c05d31fd86586849f0" +dependencies = [ + "elrond-wasm-node", + "wee_alloc", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "factory" +version = "0.0.0" +dependencies = [ + "arrayvec", + "common_structs", + "elrond-wasm", + "itertools", + "token_merge", + "token_send", + "wee_alloc", +] + +[[package]] +name = "farm" +version = "0.0.0" +dependencies = [ + "common_structs", + "elrond-wasm", + "factory", + "pair", + "token_merge", + "token_send", +] + +[[package]] +name = "farm-wasm" +version = "0.0.0" +dependencies = [ + "elrond-wasm-node", + "elrond-wasm-output", + "farm", +] + +[[package]] +name = "getrandom" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi", +] + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash", +] + +[[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.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "libc" +version = "0.2.138" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" + +[[package]] +name = "memory_units" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + +[[package]] +name = "nibble_vec" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d77f3db4bce033f4d04db08079b2ef1c3d02b44e86f25d08886fafa7756ffa" + +[[package]] +name = "once_cell" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" + +[[package]] +name = "pair" +version = "0.0.0" +dependencies = [ + "common_structs", + "elrond-wasm", + "itertools", + "token_send", +] + +[[package]] +name = "proc-macro2" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3681b28cd95acfb0560ea9441f82d6a4504fa3b15b97bd7b6e952131820e95" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "syn" +version = "1.0.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_merge" +version = "0.0.0" +dependencies = [ + "common_structs", + "elrond-wasm", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_structs", + "elrond-wasm", +] + +[[package]] +name = "unicode-ident" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + +[[package]] +name = "wee_alloc" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "memory_units", + "winapi", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" From 3110daa176aed117b5c06e1cd77eabca6e154f79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20B=C4=83ncioiu?= Date: Thu, 28 Dec 2023 23:44:52 +0200 Subject: [PATCH 3/5] Fix package. --- dex/farm/wasm/Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dex/farm/wasm/Cargo.lock b/dex/farm/wasm/Cargo.lock index 75682535c..e01042dfa 100644 --- a/dex/farm/wasm/Cargo.lock +++ b/dex/farm/wasm/Cargo.lock @@ -46,9 +46,9 @@ dependencies = [ [[package]] name = "either" -version = "1.9.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "elrond-codec" From 472bb948fcbcff495b859e34b3bf16f07f700bc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20B=C4=83ncioiu?= Date: Thu, 28 Dec 2023 23:46:34 +0200 Subject: [PATCH 4/5] Add workflow file, Cargo.lock of workspace etc. --- .../on_pull_request_build_contracts.yml | 15 + Cargo.lock | 676 ++++++++++++++++++ dex/farm/wasm/src/lib.rs | 15 +- 3 files changed, 694 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/on_pull_request_build_contracts.yml create mode 100644 Cargo.lock diff --git a/.github/workflows/on_pull_request_build_contracts.yml b/.github/workflows/on_pull_request_build_contracts.yml new file mode 100644 index 000000000..32ddf4c4f --- /dev/null +++ b/.github/workflows/on_pull_request_build_contracts.yml @@ -0,0 +1,15 @@ +name: On pull request, build contracts + +on: + pull_request: + +permissions: + contents: write + +jobs: + build: + uses: multiversx/mx-sc-actions/.github/workflows/reproducible-build.yml@v2.3.4 + with: + image_tag: v4.2.1 + package_whole_project_src: true + skip_preliminary_checks: true diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 000000000..50b74a174 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,676 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "block-padding", + "generic-array", +] + +[[package]] +name = "block-padding" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "elrond-wasm", +] + +[[package]] +name = "cpufeatures" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +dependencies = [ + "libc", +] + +[[package]] +name = "dex-tests" +version = "0.0.0" +dependencies = [ + "elrond-wasm", + "elrond-wasm-debug", + "farm", + "pair", + "router", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "distribution" +version = "0.0.0" +dependencies = [ + "common_structs", + "elrond-wasm", + "elrond-wasm-debug", + "factory", +] + +[[package]] +name = "distribution-abi" +version = "0.0.0" +dependencies = [ + "distribution", + "elrond-wasm", + "elrond-wasm-debug", +] + +[[package]] +name = "distribution-tests" +version = "0.0.0" +dependencies = [ + "distribution", + "elrond-wasm", + "elrond-wasm-debug", + "factory", + "farm", + "pair", + "proxy-dex", + "router", +] + +[[package]] +name = "either" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" + +[[package]] +name = "elrond-codec" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f334430693f49bf3d550a50242e0e3e38125153efd6e8d540071d98f65781ff3" +dependencies = [ + "arrayvec", + "elrond-codec-derive", + "wee_alloc", +] + +[[package]] +name = "elrond-codec-derive" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15b58321f05a10c110500092a8f776dc4609a6023d7675b270b46356209d3058" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "elrond-wasm" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c3d9d56aee9151925241980fecac33c2785fbec12d0ffe52694428df578630" +dependencies = [ + "arrayvec", + "bitflags", + "elrond-codec", + "elrond-wasm-derive", + "hashbrown", + "hex-literal", + "wee_alloc", +] + +[[package]] +name = "elrond-wasm-debug" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71fc59ebe4ce3556c0d7d0bf77129c4aee0b6cf7b7d52722e55e80841064afee" +dependencies = [ + "elrond-wasm", + "hex", + "mandos", + "num-bigint", + "num-traits", + "rustc_version", + "serde", + "serde_json", + "sha2", + "sha3", +] + +[[package]] +name = "elrond-wasm-derive" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f7bbff620e43729364f4d7c3355e46810371c9c9a4ec8ea1aee3738bc864094" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn 1.0.109", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "factory" +version = "0.0.0" +dependencies = [ + "arrayvec", + "common_structs", + "elrond-wasm", + "elrond-wasm-debug", + "itertools", + "token_merge", + "token_send", + "wee_alloc", +] + +[[package]] +name = "factory-abi" +version = "0.0.0" +dependencies = [ + "elrond-wasm", + "elrond-wasm-debug", + "factory", +] + +[[package]] +name = "farm" +version = "0.0.0" +dependencies = [ + "common_structs", + "elrond-wasm", + "elrond-wasm-debug", + "factory", + "pair", + "token_merge", + "token_send", +] + +[[package]] +name = "farm-abi" +version = "0.0.0" +dependencies = [ + "elrond-wasm", + "elrond-wasm-debug", + "farm", +] + +[[package]] +name = "farm_mock_v1_4" +version = "0.0.0" +dependencies = [ + "common_structs", + "elrond-wasm", + "elrond-wasm-debug", +] + +[[package]] +name = "farm_mock_v1_4-abi" +version = "0.0.0" +dependencies = [ + "elrond-wasm", + "elrond-wasm-debug", + "farm_mock_v1_4", +] + +[[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.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi", +] + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash", +] + +[[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.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "keccak" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "libc" +version = "0.2.151" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" + +[[package]] +name = "mandos" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27bf7cd11f1278190deb39ac404d3eb217e972ab89ebb3558a902f7c7de8bdca" +dependencies = [ + "hex", + "num-bigint", + "num-traits", + "serde", + "serde_json", + "sha3", +] + +[[package]] +name = "memory_units" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + +[[package]] +name = "nibble_vec" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d77f3db4bce033f4d04db08079b2ef1c3d02b44e86f25d08886fafa7756ffa" + +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "pair" +version = "0.0.0" +dependencies = [ + "common_structs", + "elrond-wasm", + "elrond-wasm-debug", + "itertools", + "token_send", +] + +[[package]] +name = "pair-abi" +version = "0.0.0" +dependencies = [ + "elrond-wasm", + "elrond-wasm-debug", + "pair", +] + +[[package]] +name = "proc-macro2" +version = "1.0.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75cb1540fadbd5b8fbccc4dddad2734eba435053f725621c070711a14bb5f4b8" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proxy-dex" +version = "0.0.0" +dependencies = [ + "common_structs", + "elrond-wasm", + "elrond-wasm-debug", + "factory", + "farm", + "itertools", + "pair", + "token_merge", + "token_send", +] + +[[package]] +name = "proxy-dex-meta" +version = "0.0.0" +dependencies = [ + "elrond-wasm", + "elrond-wasm-debug", + "proxy-dex", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3681b28cd95acfb0560ea9441f82d6a4504fa3b15b97bd7b6e952131820e95" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "router" +version = "0.0.0" +dependencies = [ + "elrond-wasm", + "elrond-wasm-debug", + "pair", +] + +[[package]] +name = "router-abi" +version = "0.0.0" +dependencies = [ + "elrond-wasm", + "elrond-wasm-debug", + "router", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "ryu" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" + +[[package]] +name = "semver" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" + +[[package]] +name = "serde" +version = "1.0.193" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.193" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.43", +] + +[[package]] +name = "serde_json" +version = "1.0.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer", + "cfg-if 1.0.0", + "cpufeatures", + "digest", + "opaque-debug", +] + +[[package]] +name = "sha3" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" +dependencies = [ + "block-buffer", + "digest", + "keccak", + "opaque-debug", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_merge" +version = "0.0.0" +dependencies = [ + "common_structs", + "elrond-wasm", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_structs", + "elrond-wasm", +] + +[[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.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wee_alloc" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "memory_units", + "winapi", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/dex/farm/wasm/src/lib.rs b/dex/farm/wasm/src/lib.rs index b7834a264..881e9d516 100644 --- a/dex/farm/wasm/src/lib.rs +++ b/dex/farm/wasm/src/lib.rs @@ -8,19 +8,13 @@ elrond_wasm_node::wasm_endpoints! { farm ( init - callBack acceptFee calculateRewardsForGivenPosition - claimRewards - compoundRewards end_produce_rewards_as_owner - enterFarm - enterFarmAndLockRewards exitFarm getBurnedTokenAmount getCurrentBlockFee getDivisionSafetyConstant - getFarmMigrationConfiguration getFarmTokenId getFarmTokenSupply getFarmingTokenId @@ -41,19 +35,16 @@ elrond_wasm_node::wasm_endpoints! { getState getTransferExecGasLimit getUndistributedFees - mergeFarmTokens - migrateToNewFarm pause - registerFarmToken resume - setFarmMigrationConfig - setLocalRolesFarmToken setPerBlockRewardAmount + setTransferRoleFarmToken set_locked_rewards_apr_multiplier set_minimum_farming_epochs set_penalty_percent set_transfer_exec_gas_limit start_produce_rewards - stopRewardsAndMigrateRps ) } + +elrond_wasm_node::wasm_empty_callback! {} From ef2d94d5eb9e9a4fdfc44ee7c12b4cc2e477a25b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20B=C4=83ncioiu?= Date: Thu, 28 Dec 2023 23:48:51 +0200 Subject: [PATCH 5/5] Some cleanup. --- .github/workflows/actions.yml | 110 ---------------------------------- .github/workflows/env | 1 - .github/workflows/release.yml | 81 ------------------------- 3 files changed, 192 deletions(-) delete mode 100644 .github/workflows/actions.yml delete mode 100644 .github/workflows/env delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml deleted file mode 100644 index 4498c70b9..000000000 --- a/.github/workflows/actions.yml +++ /dev/null @@ -1,110 +0,0 @@ -name: Builds and tests - -on: - push: - branches: - - main - - 'dex-v[0-9]+_[0-9]+' - pull_request: - -jobs: - wasm_test: - name: Wasm tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - default: true - toolchain: nightly - - name: Install erdpy and vmtools - run : | - source .github/workflows/env - pip3 install erdpy - mkdir $HOME/elrondsdk - erdpy config set dependencies.vmtools.tag v1.4.27 - erdpy deps install vmtools - sudo apt install binaryen - - name: Build the wasm contracts - run: | - source .github/workflows/env - ./build-wasm.sh - ./wasm-opt.sh - - name: Run VM tests - run: | - source .github/workflows/env - cargo test --features elrond-wasm-debug/mandos-go-tests - - name: Generate file size report - run: | - source .github/workflows/env - ./sizes.sh > sizes.txt - - name: Upload file size report - uses: actions/upload-artifact@v2 - with: - name: sizes - path: sizes.txt - - name: Download base report - uses: dawidd6/action-download-artifact@v2 - if: ${{ github.event_name == 'pull_request' }} - continue-on-error: true - with: - workflow: actions.yml - name: sizes - commit: ${{github.event.pull_request.base.sha}} - path: base-sizes - - name: Generate report - id: sizes-report - if: ${{ github.event_name == 'pull_request' }} - run: | - source .github/workflows/env - python tools/size-report/size_report.py base-sizes/sizes.txt sizes.txt --allow-missing > report.md - - name: Render report - id: template - uses: chuhlomin/render-template@v1.2 - if: ${{ github.event_name == 'pull_request' }} - with: - template: report.md - vars: | - base: ${{github.event.pull_request.base.sha}} - head: ${{github.event.pull_request.head.sha}} - - name: Find sizes report comment - id: fc - uses: peter-evans/find-comment@v1 - if: ${{ github.event_name == 'pull_request' }} - with: - issue-number: ${{ github.event.pull_request.number }} - comment-author: 'github-actions[bot]' - body-includes: Contract file size comparison - - name: Create or update sizes report comment - uses: peter-evans/create-or-update-comment@v1 - if: ${{ github.event_name == 'pull_request' }} - with: - comment-id: ${{ steps.fc.outputs.comment-id }} - issue-number: ${{ github.event.pull_request.number }} - body: ${{ steps.template.outputs.result }} - edit-mode: replace - rust_test: - name: Rust tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - default: true - toolchain: nightly - - name: Run rust tests - run: cargo test - clippy_check: - name: Clippy linter check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - components: clippy - default: true - - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - diff --git a/.github/workflows/env b/.github/workflows/env deleted file mode 100644 index 28a99a67c..000000000 --- a/.github/workflows/env +++ /dev/null @@ -1 +0,0 @@ -export PATH=$HOME/.local/bin:$HOME/elrondsdk/vmtools:$PATH diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index d24bbfe2d..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: Create release - -on: - workflow_dispatch: - inputs: - tag: - required: true - description: Release tag - title: - required: true - description: Release title - image_tag: - type: choice - required: true - description: Image elrondnetwork/build-contract-rust - options: - - v3.2.0 - -permissions: - contents: write - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - ref: ${{ env.GITHUB_REF_NAME }} - fetch-depth: 0 - repository: ${{ env.GITHUB_REPOSITORY }} - - - name: Download build script - run: | - wget https://raw.githubusercontent.com/ElrondNetwork/elrond-sdk-images-build-contract-rust/${{ github.event.inputs.image_tag }}/build_with_docker.py - - - name: Build contract - run: | - python3 ./build_with_docker.py --no-docker-tty --image=elrondnetwork/build-contract-rust:${{ github.event.inputs.image_tag }} --project=. --contract=farm --output=/home/runner/work/output-from-docker - - - name: Save artifacts - uses: actions/upload-artifact@v2 - with: - name: built-contracts - path: | - /home/runner/work/output-from-docker/**/*.wasm - /home/runner/work/output-from-docker/**/*.abi.json - if-no-files-found: error - - release: - needs: [build] - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v2 - with: - fetch-depth: "0" - - - name: Download all workflow artifacts - uses: actions/download-artifact@v2 - with: - path: assets - - - name: Create release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - echo "Built using Docker image: **elrondnetwork/build-contract-rust:${{ github.event.inputs.image_tag }}**." >> notes.txt - echo "" >> notes.txt - echo "## Codehash (blake2b):" >> notes.txt - echo "" >> notes.txt - - for i in $(find ./assets -type f -name *.wasm); do - filename=$(basename ${i}) - checksum=($(b2sum -l 256 ${i})) - echo " - **${filename}**: \`${checksum}\`" >> notes.txt - done - - gh release create ${{ github.event.inputs.tag }} --target=$GITHUB_SHA --prerelease --title="${{ github.event.inputs.title }}" --generate-notes --notes-file=notes.txt - sleep 10 - gh release upload ${{ github.event.inputs.tag }} $(find ./assets -type f)