Repository navigation
Add seller cancel action before the first bid - #6
Merged
Merged
Conversation
Rigidity
commented
Oct 27, 2026
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 0d7557e1-ab2d-4652-9077-857eabf2d579) |
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.
Adds a cancel action that lets the seller cancel an auction before the first bid, returning the NFT to the payout address.
Puzzle
puzzles/actions/cancel_action.rue(hash3711cd50a0332a4b8f46bb2f1eb66d9c1d1ed658d104b94a4cf6e424906c782e) is added as a third merkle leaf, after the bid and end actions.winning_bid.amount == 0). There are no timing restrictions.ReceiveMessagewith mode0x17(SENDER_PUZZLE | RECEIVER_COIN), message"c"(a single byte), senderPAYOUT_PUZZLE_HASH. Since the message is tied to the current auction coin, it can't be replayed.ended: true,reserve_amount: 0,winning_bidunchanged, and the NFT is unlocked to the payout puzzle hash via the existing NFT unlocker. No payments are made. Like the end action, it creates the$coin announcement.Every auction puzzle hash changes because the merkle root changes. The memo format is unchanged.
Driver
CancelActionArgs,CANCEL_MESSAGE,CANCEL_MESSAGE_MODEAuctionInfo::cancel_action/cancel_action_hash;merkle_leavesnow returns 3 leavesAuctionExt::spend_cancel_action(ctx, nft)andAuctionExt::cancel_authorization(ctx), which returns the conditions a coin at the payout address must outputunlock_nft,child_state,spend, andparse_childwork with a cancel spend as-isREADME covers the lifecycle, a new Cancelling section (including that a cancel, like an end, needs an empty reserve coin, which for CAT reserves may require holding some of the CAT), and the payout address trust assumption.
Tests
tests/cancel.rs:MessageNotSentOrReceived).spend_unchecked) that skips the driver's checks, so only consensus validation runs the auction puzzle; a control test shows the same path succeeds without bids.parse_childfollows a cancel (XCH, CAT, and revocable CAT).tests/puzzles.rsalso checks the new puzzle against its hash.Note
High Risk
Changes core auction singleton puzzles (new merkle root) and authorization semantics; integrators must adopt new puzzle hashes and understand payout-address cancel control and mempool races with first bids.
Overview
Adds a seller cancel path before any bid: the auctioneer can abort and recover the locked NFT to the payout address, with the same on-chain outcome as ending with no bids (
ended, empty reserve,$announcement).The new
cancel_actionpuzzle becomes a third action-layer merkle leaf, so all auction singleton puzzle hashes change. Cancel requires a coin at the payout address to send messagecwith mode0x17to the current auction coin; the Rust driver exposesspend_cancel_action,cancel_authorization, and wires cancel intounlock_nft/ state parsing. Cancels are blocked once there is a bid or after end; they race with a pending first bid in the mempool.README documents lifecycle, cancel mechanics (including empty reserve / stand-in reserve), mempool behavior, and a new payout-address trust assumption. Tests cover authorization, timing, on-chain rejection when combined with bid/end or after bids, and reserve types (XCH/CAT/revocable CAT).
Reviewed by Cursor Bugbot for commit 1300908. Bugbot is set up for automated code reviews on this repo. Configure here.