Skip to content

Commit

Permalink
Merge pull request #37 from multiversx/framework-update-0.38
Browse files Browse the repository at this point in the history
framework update - 0.38
  • Loading branch information
psorinionut committed Jan 13, 2023
2 parents b0eb431 + 8ff40a7 commit 6a8a87e
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions esdt-nft-marketplace/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions esdt-nft-marketplace/meta/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 0 additions & 4 deletions esdt-nft-marketplace/src/common_util_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
29 changes: 14 additions & 15 deletions esdt-nft-marketplace/src/token_distribution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
));
}
}

Expand Down
4 changes: 2 additions & 2 deletions esdt-nft-marketplace/wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
37 changes: 22 additions & 15 deletions esdt-nft-marketplace/wasm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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
)
}

Expand Down
4 changes: 2 additions & 2 deletions seller-contract-mock/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions seller-contract-mock/meta/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authors = ["Dorin Iancu <dorin.iancu@elrond.com>"]
path = ".."

[dependencies.elrond-wasm]
version = "0.33.0"
version = "0.38.0"

[dependencies.elrond-wasm-debug]
version = "0.33.0"
version = "0.38.0"
5 changes: 3 additions & 2 deletions seller-contract-mock/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions seller-contract-mock/wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",]
7 changes: 7 additions & 0 deletions seller-contract-mock/wasm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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! {
Expand Down

0 comments on commit 6a8a87e

Please sign in to comment.