You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (_offer.priceType == PriceType.Discovery && _offer.price !=0) revertInvalidPriceDiscoveryPrice();
This is to ensure that the offerPrice in releaseFunds is correct in all subsequent calculations. If we didn't require zero price at offer creation time, we'd need to handle it here.
if (_offer.buyerCancelPenalty > offerPrice) revertInvalidOfferPenalty();
This imposes restrictions for price discovery offers, while at the same time buyer cancellation penalty works ok with the static offers, even when they are used in secondary commit. All that needs to be checked is that the actual price is high enough to cover cancellation penalty:
if (thisExchangeCost.price < offer.buyerCancelPenalty) revertPriceDoesNotCoverPenalty();
We should allow for buyer cancellation penalty in price discovery offers as well. It would then also serve as some sort of reserved price, since the protocol won't allow lower prices.
Steps to enable it:
remove restrictions in storeOffer
properly handle offerPrice in releaseFunds
add check-in commitToPriceDiscoveryOffer to make sure actualPrice is greater than the buyer cancellation penalty. Maybe the check can be moved into priceDiscoveryBase, so that both the price discovery handler and sequential commit handler would use the same code.
The text was updated successfully, but these errors were encountered:
Currently, price discovery offers require its price to be set to zero:
boson-protocol-contracts/contracts/protocol/bases/OfferBase.sol
Line 153 in b131a97
This is to ensure that the offerPrice in
releaseFunds
is correct in all subsequent calculations. If we didn't require zero price at offer creation time, we'd need to handle it here.boson-protocol-contracts/contracts/protocol/libs/FundsLib.sol
Line 131 in b131a97
As a consequence, the buyer cancellation penalty is restricted to 0
boson-protocol-contracts/contracts/protocol/bases/OfferBase.sol
Line 238 in b131a97
This imposes restrictions for price discovery offers, while at the same time buyer cancellation penalty works ok with the static offers, even when they are used in secondary commit. All that needs to be checked is that the actual price is high enough to cover cancellation penalty:
boson-protocol-contracts/contracts/protocol/facets/SequentialCommitHandlerFacet.sol
Line 109 in b131a97
We should allow for buyer cancellation penalty in price discovery offers as well. It would then also serve as some sort of reserved price, since the protocol won't allow lower prices.
Steps to enable it:
storeOffer
offerPrice
inreleaseFunds
commitToPriceDiscoveryOffer
to make sureactualPrice
is greater than the buyer cancellation penalty. Maybe the check can be moved intopriceDiscoveryBase
, so that both the price discovery handler and sequential commit handler would use the same code.The text was updated successfully, but these errors were encountered: