openbazaar-go icon indicating copy to clipboard operation
openbazaar-go copied to clipboard

Do not allow purchase of a listing where the purchase price would be lower than the lowest supported base unit of the payment currency

Open rmisio opened this issue 6 years ago • 1 comments

Steps to reproduce:

  • Create a crypto listing for BTC > ZRX
  • Purchase .00000001 of ZRX

Given the current exchange rate, this works out to less than 1 SAT of BTC and results in the required payment amount being 0.

Expectations:

The purchase call should kick back an error saying the desired purchase amount results in a price below the supported minimum price for the payment coin.

Also, can the returned error please include a unique error code so clients can provide a customized error message?

(FWIW, I think this could also manifest on non-crypto listings as well. I can't come up with a scenario because given the exchange rates of the current curs, I don't think it would happen. But, let's say we start supporting a currency with a really low price relative to the other ones, I think it could manifest if a listing were priced low enough. EDIT: actually a 1 WEI ETH listing would probably manifest this.)

rmisio avatar Oct 28 '19 21:10 rmisio

@drwasho Not sure if this should be a launch blocker or not. It creates a "ghost" order, which is not good. But, I don't think its fundable, so I don't think any funds would get lost.

rmisio avatar Oct 28 '19 23:10 rmisio