Skip to content

Commit

Permalink
Merge pull request #637 from bosonprotocol/reserve-range-CEI
Browse files Browse the repository at this point in the history
Fix code scanning alert - Reentrancy vulnerabilities
  • Loading branch information
mischat committed Jun 7, 2023
2 parents 66225eb + 00dfcd6 commit 451dc3d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions contracts/protocol/bases/OfferBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,6 @@ contract OfferBase is ProtocolBase, IBosonOfferEvents {
// _to must be the contract address or the contract owner
require(_to == address(bosonVoucher) || _to == sender, INVALID_TO_ADDRESS);

// Call reserveRange on voucher
bosonVoucher.reserveRange(_offerId, _startId, _length, _to);

// increase exchangeIds
pc.nextExchangeId = _startId + _length;

Expand All @@ -333,6 +330,9 @@ contract OfferBase is ProtocolBase, IBosonOfferEvents {
offer.quantityAvailable -= _length;
}

// Call reserveRange on voucher
bosonVoucher.reserveRange(_offerId, _startId, _length, _to);

// Notify external observers
emit RangeReserved(_offerId, offer.sellerId, _startId, _startId + _length - 1, _to, sender);
}
Expand Down

0 comments on commit 451dc3d

Please sign in to comment.