Skip to content

Commit

Permalink
Remediate [BVR-02C, EHF-02C, PHF-02C] Redundant Parenthesis Statement (
Browse files Browse the repository at this point in the history
…#750)

* fix #733

* fix #735

* Fix #739

---------

Co-authored-by: Ludovic Levalleux <levalleux_ludo@hotmail.com>
  • Loading branch information
zajck and levalleux-ludo authored Aug 17, 2023
1 parent 256d2fd commit 827a2a0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions contracts/protocol/clients/voucher/BosonVoucher.sol
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,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;
Expand Down Expand Up @@ -225,7 +225,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;
Expand Down Expand Up @@ -281,10 +281,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;
Expand Down Expand Up @@ -319,7 +319,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;
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/protocol/facets/ExchangeHandlerFacet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,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;
}
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/protocol/facets/PauseHandlerFacet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,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++;
Expand Down

0 comments on commit 827a2a0

Please sign in to comment.