This repository was archived by the owner on Jan 14, 2020. It is now read-only.
This repository was archived by the owner on Jan 14, 2020. It is now read-only.
Excess seller deposit is inaccessible unless listing is withdrawn #585
Open
Description
Consider the following scenario:
- Seller creates listing with commission of 100 OGN, which
createListing
transfers to the Marketplace contract - Buyer makes an offer with a commission of 25 OGN
- Seller accepts offer
- Buyer finalizes. Marketplace contracts pay 25 OGN to the affiliate, because affiliate payouts are based on the commission specified in the offer.
Now there's an excess commission of 75 OGN that's held by the Marketplace contract. The only way the seller can recover those funds is by withdrawing the listing. This is undesirable from a UI point of view.
There are other cases where we actually do want the marketplace contract to hold tokens after an offer finalizes:
- Multi-unit purchases, such as concert tickets
- Fractional usage listings, such as home rentals. The seller may pay commission for each completed reservation, so a single reservation would not use up all the commission.
However, when there is a single item for sale (as there will be with our v1 launch), we might want to consider auto-refunding any excess commission to the seller upon finalization.
This is a little nuanced, so I'm posting as much detail as I can here.