From 0c44417b4b2315431558d48733ce4b84a22bd9a0 Mon Sep 17 00:00:00 2001 From: zajck Date: Tue, 16 May 2023 12:02:17 +0200 Subject: [PATCH] CEI pattern - #617 --- contracts/protocol/bases/OfferBase.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/protocol/bases/OfferBase.sol b/contracts/protocol/bases/OfferBase.sol index 1b5dc9bcd..8d664c297 100644 --- a/contracts/protocol/bases/OfferBase.sol +++ b/contracts/protocol/bases/OfferBase.sol @@ -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; @@ -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); }