diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 39dede4..ed5eb05 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -15,7 +15,7 @@ jobs: name: Contracts uses: ElrondNetwork/elrond-actions/.github/workflows/contracts.yml@v1 with: - rust-toolchain: nightly-2022-03-01 + rust-toolchain: nightly-2022-12-08 vmtools-version: v1.4.60 extra-build-args: --ignore-eei-checks secrets: diff --git a/esdt-nft-marketplace/Cargo.toml b/esdt-nft-marketplace/Cargo.toml index 2e9f717..66b75d0 100644 --- a/esdt-nft-marketplace/Cargo.toml +++ b/esdt-nft-marketplace/Cargo.toml @@ -9,10 +9,10 @@ publish = false path = "src/marketplace_main.rs" [dependencies.elrond-wasm] -version = "0.33.0" +version = "0.38.0" [dependencies.elrond-wasm-modules] -version = "0.33.0" +version = "0.38.0" [dev-dependencies.elrond-wasm-debug] -version = "0.33.0" +version = "0.38.0" diff --git a/esdt-nft-marketplace/meta/Cargo.toml b/esdt-nft-marketplace/meta/Cargo.toml index 59b196e..5db1419 100644 --- a/esdt-nft-marketplace/meta/Cargo.toml +++ b/esdt-nft-marketplace/meta/Cargo.toml @@ -9,7 +9,7 @@ publish = false path = ".." [dependencies.elrond-wasm] -version = "0.33.0" +version = "0.38.0" [dependencies.elrond-wasm-debug] -version = "0.33.0" +version = "0.38.0" diff --git a/esdt-nft-marketplace/src/common_util_functions.rs b/esdt-nft-marketplace/src/common_util_functions.rs index 0f13093..e7b0122 100644 --- a/esdt-nft-marketplace/src/common_util_functions.rs +++ b/esdt-nft-marketplace/src/common_util_functions.rs @@ -9,8 +9,4 @@ pub trait CommonUtilFunctions: elrond_wasm_modules::pause::PauseModule { nft_nonce, ) } - - fn require_not_paused(&self) { - require!(self.not_paused(), "Marketplace is paused"); - } } diff --git a/esdt-nft-marketplace/src/token_distribution.rs b/esdt-nft-marketplace/src/token_distribution.rs index 48edf2c..43ac8d1 100644 --- a/esdt-nft-marketplace/src/token_distribution.rs +++ b/esdt-nft-marketplace/src/token_distribution.rs @@ -29,21 +29,20 @@ pub trait TokenDistributionModule: for pair in token_nonce_pairs { let (token_id, token_nonce) = pair.into_tuple(); - let amount_mapper = self.claimable_amount(&caller, &token_id, token_nonce); - let amount = amount_mapper.get(); - - if amount > 0 { - amount_mapper.clear(); - - if token_id.is_egld() { - egld_payment_amount = amount; - } else { - output_payments.push(EsdtTokenPayment::new( - token_id.unwrap_esdt(), - token_nonce, - amount, - )); - } + let amount = self + .claimable_amount(&caller, &token_id, token_nonce) + .take(); + if amount == 0 { + continue; + } + if token_id.is_egld() { + egld_payment_amount = amount; + } else { + output_payments.push(EsdtTokenPayment::new( + token_id.unwrap_esdt(), + token_nonce, + amount, + )); } } diff --git a/esdt-nft-marketplace/wasm/Cargo.toml b/esdt-nft-marketplace/wasm/Cargo.toml index 87a9705..c300ac2 100644 --- a/esdt-nft-marketplace/wasm/Cargo.toml +++ b/esdt-nft-marketplace/wasm/Cargo.toml @@ -19,10 +19,10 @@ panic = "abort" path = ".." [dependencies.elrond-wasm-node] -version = "0.33.0" +version = "0.38.0" [dependencies.elrond-wasm-output] -version = "0.33.0" +version = "0.38.0" features = ["wasm-output-mode"] [workspace] diff --git a/esdt-nft-marketplace/wasm/src/lib.rs b/esdt-nft-marketplace/wasm/src/lib.rs index f84599a..b1d01e3 100644 --- a/esdt-nft-marketplace/wasm/src/lib.rs +++ b/esdt-nft-marketplace/wasm/src/lib.rs @@ -1,35 +1,42 @@ +// Code generated by the elrond-wasm multi-contract system. DO NOT EDIT. + //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// //////////////////////////////////////////////////// +// Init: 1 +// Endpoints: 23 +// Async Callback (empty): 1 +// Total number of exported functions: 25 + #![no_std] elrond_wasm_node::wasm_endpoints! { esdt_nft_marketplace ( - acceptOffer - addTokensToWhitelist + setCutPercentage auctionToken - bid - buySft - claimTokens endAuction - getClaimableAmount + withdraw getFullAuctionData - getFullOfferData getLastValidAuctionId - getLastValidOfferId getMarketplaceCutPercentage + sendOffer + withdrawOffer + acceptOffer + withdrawAuctionAndAcceptOffer + getFullOfferData + getLastValidOfferId + bid + buySft + claimTokens + getClaimableAmount + addTokensToWhitelist + removeTokensFromWhitelist getWhitelistedTokens - isPaused pause - removeTokensFromWhitelist - sendOffer - setCutPercentage unpause - withdraw - withdrawAuctionAndAcceptOffer - withdrawOffer + isPaused ) } diff --git a/seller-contract-mock/Cargo.toml b/seller-contract-mock/Cargo.toml index dc41985..1df4e0d 100644 --- a/seller-contract-mock/Cargo.toml +++ b/seller-contract-mock/Cargo.toml @@ -9,10 +9,10 @@ publish = false path = "src/lib.rs" [dependencies.elrond-wasm] -version = "0.33.0" +version = "0.38.0" [dependencies.esdt-nft-marketplace] path = "../esdt-nft-marketplace" [dev-dependencies.elrond-wasm-debug] -version = "0.33.0" +version = "0.38.0" diff --git a/seller-contract-mock/meta/Cargo.toml b/seller-contract-mock/meta/Cargo.toml index 6c44501..5f4620f 100644 --- a/seller-contract-mock/meta/Cargo.toml +++ b/seller-contract-mock/meta/Cargo.toml @@ -11,7 +11,7 @@ authors = ["Dorin Iancu "] path = ".." [dependencies.elrond-wasm] -version = "0.33.0" +version = "0.38.0" [dependencies.elrond-wasm-debug] -version = "0.33.0" +version = "0.38.0" diff --git a/seller-contract-mock/src/lib.rs b/seller-contract-mock/src/lib.rs index 31eee33..4856919 100644 --- a/seller-contract-mock/src/lib.rs +++ b/seller-contract-mock/src/lib.rs @@ -20,9 +20,10 @@ pub trait Adder { let mut token_nonce_pairs = MultiValueEncoded::new(); token_nonce_pairs.push(MultiValue2::from((token_id, token_nonce))); - self.market_proxy(marketplace_sc_address) + let _: IgnoreValue = self + .market_proxy(marketplace_sc_address) .claim_tokens(caller, token_nonce_pairs) - .execute_on_dest_context_ignore_result(); + .execute_on_dest_context(); } #[proxy] diff --git a/seller-contract-mock/wasm/Cargo.toml b/seller-contract-mock/wasm/Cargo.toml index c830adf..906f4b2 100644 --- a/seller-contract-mock/wasm/Cargo.toml +++ b/seller-contract-mock/wasm/Cargo.toml @@ -24,8 +24,8 @@ panic = "abort" path = ".." [dependencies.elrond-wasm-node] -version = "0.33.0" +version = "0.38.0" [dependencies.elrond-wasm-output] -version = "0.33.0" +version = "0.38.0" features = [ "wasm-output-mode",] diff --git a/seller-contract-mock/wasm/src/lib.rs b/seller-contract-mock/wasm/src/lib.rs index de80106..79d3dc1 100644 --- a/seller-contract-mock/wasm/src/lib.rs +++ b/seller-contract-mock/wasm/src/lib.rs @@ -1,7 +1,14 @@ +// Code generated by the elrond-wasm multi-contract system. DO NOT EDIT. + //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// //////////////////////////////////////////////////// +// Init: 1 +// Endpoints: 1 +// Async Callback (empty): 1 +// Total number of exported functions: 3 + #![no_std] elrond_wasm_node::wasm_endpoints! {