From 81ef1e41dbf73f8f2ed94305127f32ca5de2b52f Mon Sep 17 00:00:00 2001 From: zajck Date: Thu, 3 Aug 2023 15:54:35 +0200 Subject: [PATCH 1/3] fix #733 --- contracts/protocol/clients/voucher/BosonVoucher.sol | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/contracts/protocol/clients/voucher/BosonVoucher.sol b/contracts/protocol/clients/voucher/BosonVoucher.sol index 635710945..30b7896db 100644 --- a/contracts/protocol/clients/voucher/BosonVoucher.sol +++ b/contracts/protocol/clients/voucher/BosonVoucher.sol @@ -110,7 +110,7 @@ contract BosonVoucherBase is IBosonVoucher, BeaconClientBase, OwnableUpgradeable // Revert if exchange id falls within a reserved range uint256 rangeStart = range.start; - require((_tokenId < rangeStart) || (_tokenId >= rangeStart + range.length), EXCHANGE_ID_IN_RESERVED_RANGE); + require(_tokenId < rangeStart || _tokenId >= rangeStart + range.length, EXCHANGE_ID_IN_RESERVED_RANGE); // Issue voucher is called only during commitToOffer (in protocol), so token can be set as committed _committed[_tokenId] = true; @@ -220,7 +220,7 @@ contract BosonVoucherBase is IBosonVoucher, BeaconClientBase, OwnableUpgradeable // Make sure that offer is not expired or voided (Offer memory offer, OfferDates memory offerDates) = getBosonOffer(_offerId); - require(!offer.voided && (block.timestamp <= offerDates.validUntil), OFFER_EXPIRED_OR_VOIDED); + require(!offer.voided && block.timestamp <= offerDates.validUntil, OFFER_EXPIRED_OR_VOIDED); // Get the first token to mint uint256 start = range.start + range.minted; @@ -276,10 +276,10 @@ contract BosonVoucherBase is IBosonVoucher, BeaconClientBase, OwnableUpgradeable // Make sure that offer is either expired or voided (Offer memory offer, OfferDates memory offerDates) = getBosonOffer(_offerId); - require(offer.voided || (block.timestamp > offerDates.validUntil), OFFER_STILL_VALID); + require(offer.voided || block.timestamp > offerDates.validUntil, OFFER_STILL_VALID); // Get the first token to burn - uint256 start = (range.lastBurnedTokenId == 0) ? range.start : (range.lastBurnedTokenId + 1); + uint256 start = range.lastBurnedTokenId == 0 ? range.start : range.lastBurnedTokenId + 1; // Get the last token to burn uint256 end = start + _amount; @@ -314,7 +314,7 @@ contract BosonVoucherBase is IBosonVoucher, BeaconClientBase, OwnableUpgradeable function getAvailablePreMints(uint256 _offerId) external view returns (uint256 count) { // If offer is expired or voided, return 0 (Offer memory offer, OfferDates memory offerDates) = getBosonOffer(_offerId); - if (offer.voided || (block.timestamp > offerDates.validUntil)) { + if (offer.voided || block.timestamp > offerDates.validUntil) { return 0; } From d3e171a300a7821d97a89d462f9ba5e6a977aa15 Mon Sep 17 00:00:00 2001 From: zajck Date: Thu, 3 Aug 2023 15:55:33 +0200 Subject: [PATCH 2/3] fix #735 --- contracts/protocol/facets/ExchangeHandlerFacet.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/protocol/facets/ExchangeHandlerFacet.sol b/contracts/protocol/facets/ExchangeHandlerFacet.sol index 01dca6bab..15c07d127 100644 --- a/contracts/protocol/facets/ExchangeHandlerFacet.sol +++ b/contracts/protocol/facets/ExchangeHandlerFacet.sol @@ -1062,7 +1062,7 @@ contract ExchangeHandlerFacet is IBosonExchangeHandler, BuyerBase, DisputeBase { return IERC1155(_condition.tokenAddress).balanceOf(_buyer, _tokenId) >= _condition.threshold; } else { // no need to check if is NonFungible token there is no way to create a SpecifiedToken condition with a Fungible token - return (IERC721(_condition.tokenAddress).ownerOf(_tokenId) == _buyer); + return IERC721(_condition.tokenAddress).ownerOf(_tokenId) == _buyer; } } From 63d941f1a735761eb8b9fc40d038ca273ecf6be3 Mon Sep 17 00:00:00 2001 From: zajck Date: Thu, 3 Aug 2023 15:56:44 +0200 Subject: [PATCH 3/3] Fix #739 --- contracts/protocol/facets/PauseHandlerFacet.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/protocol/facets/PauseHandlerFacet.sol b/contracts/protocol/facets/PauseHandlerFacet.sol index e116e64e3..fe37db4ce 100644 --- a/contracts/protocol/facets/PauseHandlerFacet.sol +++ b/contracts/protocol/facets/PauseHandlerFacet.sol @@ -86,7 +86,7 @@ contract PauseHandlerFacet is ProtocolBase, IBosonPauseHandler { for (uint256 i = 0; i < totalRegions; i++) { // Check if the region is paused by bitwise AND operation with shifted 1 - if ((status.pauseScenario & (1 << i)) != 0) { + if (status.pauseScenario & (1 << i) != 0) { regions[count] = BosonTypes.PausableRegion(i); count++;