epam / corgis

Simple solution for corgi NFT
https://epam.github.io/corgis
0 stars 4 forks source link

Auction clearance #168

Closed zahhar closed 3 years ago

zahhar commented 3 years ago

Any auction participant call call [change] checkClearance(CorgiID) method for given CorgiID.

Method implements the following logic: 1) IF called by Corgi Owner AND no bids were made: Corgi is unlocked and removed from auction. Auction ends.

2) IF called by Corgi Owner AND there is at least one bid: 2.1) IF more then 24h passed after opening auction: runClearance(), means: transfer Corgi to highest bidder; transfer highest bid to Owner; unlock Corgi; return all other bids to their owners; (potential issue: time/gas, need to add MAX gas?) 2.2) IF less then 24h passed: nothing happens, Owner cannot end auction preliminary if there are bids, but deadline not reached yet;

3) IF called by any of the Bidders: 3.1) IF I am NOT the highest bidder: give me my money back, remove me from the list of bidders (I do not want to participate in the auction anymore) 3.2) IF I AM the highest bidder at the moment: money back is not allowed; check time passed: less then 24h -> do nothing (not allowed to withdraw a bid); more then 24h: runClearance(), see 2.1

acuarica commented 3 years ago

Closed by #182