bosonprotocol / boson-protocol-contracts

Boson Protocol V2 (latest)
https://bosonprotocol.io/
GNU General Public License v3.0
32 stars 8 forks source link

Wrong price used in release funds #902

Closed zajck closed 8 months ago

zajck commented 8 months ago

The release funds method always uses the original offer price:

https://github.com/bosonprotocol/boson-protocol-contracts/blob/9ed49d780f04b2f168001f72d6c09f5fc94818b7/contracts/protocol/libs/FundsLib.sol#L132

This is incorrect for offers with price discovery and offers with sequential commit since the last price is likely to be different from the starting price.

First the test suite should be updated and then the contracts should be fixed to release the correct amount.

zajck commented 8 months ago

This introduces another constraint - each secondary price should be at least equal to buyer cancelation penalty to work when the final state is canceled.