Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

auction-bid-collateral: extract code from FREEP-605 #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

naure
Copy link
Contributor

@naure naure commented Sep 1, 2022

@neanvo I don’t understand the point of this.

@naure naure force-pushed the auction-bid-collateral branch from 664fa4a to 35e3348 Compare September 1, 2022 05:57
@@ -221,6 +222,8 @@ contract SimpleAuction is /* AccessControl, */ MetaTxContext, ERC1155HolderUpgra

// Transfer the NFT to the buyer.
freeport.transferFrom(address(this), buyer, nftId, 1);
// Tracking amount of collateral NFTs
bidCollateral[seller][nftId] = 0;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not -1 ? I mean based on other constraints this always be 1 at this stage but that’d be more logical.
@neanvo

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it's not compatible with existing bids, that need to be decreased but counter is already 0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it

Base automatically changed from auction-early-close to master September 1, 2022 06:01
@naure
Copy link
Contributor Author

naure commented Sep 1, 2022

@neanvo And do we need this?

If what we want is that the clients can found out whether they have an NFT locked in an auction, they can read the variable sellerNftBids and check whether closeTimeSec == 0.

We could write a simple getter too: auctionExists(seller, nftId) returns bool

@neanvo
Copy link
Contributor

neanvo commented Sep 1, 2022

@naure Sounds reasonable. For the current implementation it might be the case.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants