feat: add Buy It Now / Fixed Price option to auction system#2
Open
syed-ghufran-hassan wants to merge 1 commit intoSandijigs:mainfrom
Open
feat: add Buy It Now / Fixed Price option to auction system#2syed-ghufran-hassan wants to merge 1 commit intoSandijigs:mainfrom
syed-ghufran-hassan wants to merge 1 commit intoSandijigs:mainfrom
Conversation
Add immediate purchase capability alongside traditional bidding, giving sellers flexibility to offer instant sale options while maintaining auction dynamics. Key features: - Optional buy-now-price parameter in create-auction (0 = disabled) - buy-it-now function for instant purchases at fixed price - Automatic deactivation after first bid received - Separate tracking: buy-now-volume global and buy-now-purchases per user - buy-now-price must be >= starting-price (validation) - Buy now unavailable for seller's own auctions New data structures: - auctions.buy-now-price: uint (0 = disabled) - user-bids.buy-now-purchases: uint - buy-now-volume global counter New functions: - buy-it-now (public): Execute instant purchase - is-buy-now-available (read-only): Check availability - get-buy-now-price (read-only): View current price - generate-buy-now-receipt: Purchase confirmation Events & Logging: - log-buy-now event for purchase tracking - Enhanced auction-created event with buy-now-price - Updated user stats tracking for buy now purchases Error handling: - ERR_BUY_NOW_UNAVAILABLE (u6010): Buy now not available - ERR_BUY_NOW_EXPIRED (u6011): Beyond auction end - ERR_BUY_NOW_ALREADY_SOLD (u6012): Already purchased - ERR_INVALID_BUY_NOW (u6013): Price < starting-price This enhancement provides instant liquidity option while preserving traditional auction mechanics, improving user experience and market efficiency.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add immediate purchase capability alongside traditional bidding, giving sellers flexibility to offer instant sale options while maintaining auction dynamics.
Key features:
New data structures:
New functions:
Events & Logging:
Error handling:
This enhancement provides instant liquidity option while preserving traditional auction mechanics, improving user experience and market efficiency.